diff --git a/config/app.php b/config/app.php new file mode 100644 index 0000000..3891e37 --- /dev/null +++ b/config/app.php @@ -0,0 +1,72 @@ + +// +---------------------------------------------------------------------- + +// +---------------------------------------------------------------------- +// | 应用设置 +// +---------------------------------------------------------------------- + +use think\facade\Env; +use think\facade\Request; + +//By.jingshuixian +//自定义开发模式 +$adminModelListPaht = include app()->getBasePath().'/Info.php'; + +if(Env::get('DEV_MODE',false)){ + $host = Request::host(); + $infoPath = app()->getBasePath().'/Info_'.$host.'.php'; + if(file_exists($infoPath)){ + $infoData = include $infoPath; + $adminModelListPaht = $infoData ; + } +} + +return [ + // 应用地址 + 'app_host' => Env::get('app.host', ''), + // 应用Trace(环境变量优先读取) + 'app_trace' => false, + // 应用的命名空间 + 'app_namespace' => '', + // 是否启用路由 + 'with_route' => true, + // 是否启用事件 + 'with_event' => true, + // 自动多应用模式 + 'auto_multi_app' => true, + // 应用映射(自动多应用模式有效) + 'app_map' => [], + // 域名绑定(自动多应用模式有效) + 'domain_bind' => [], + // 禁止URL访问的应用列表(自动多应用模式有效) + 'deny_app_list' => [], + // 默认应用 + 'default_app' => 'index', + // 默认时区 + 'default_timezone' => 'Asia/Shanghai', + // 默认验证器 + 'default_validate' => '', + // 异常页面的模板文件 + 'exception_tmpl' => app()->getThinkPath() . 'tpl/think_exception.tpl', + // 错误显示信息,非调试模式有效 + 'error_message' => '页面错误!请稍后再试~', + // 显示错误信息 + 'show_error_msg' => true, + //是否是微擎系统 + //'is_weiqin' => true, + //By.jingshuixian 2019年11月23日16:13:36 + 'AdminModelList' => $adminModelListPaht, + //验证地址 // 这里应该是多个验证地址,防止验证失败 + 'longbing_saas_url'=> 'http://api.longbing.org', + + 'longbing_version' => '0.0.1', + +]; diff --git a/config/cache.php b/config/cache.php new file mode 100644 index 0000000..c16b54a --- /dev/null +++ b/config/cache.php @@ -0,0 +1,77 @@ + +// +---------------------------------------------------------------------- +use think\facade\Env; +defined('IN_IA') || define('IN_IA',true); +// +---------------------------------------------------------------------- +// | 缓存设置 +// +---------------------------------------------------------------------- +$host = Env::get('cache.host', '127.0.0.1'); +$prefix = Env::get('cache.prefix', 'longbing_'); +$password = Env::get('cache.passwd', ''); +$expire = Env::get('cache.expire', 0); +$port = Env::get('cache.port', 6379); + + + +$dir_path = __DIR__ . '/../../../../data/config.php'; +// var_dump(file_exists($dir_path)); +if(file_exists($dir_path) && longbingIsWeiqin()) +{ + require_once $dir_path; + + if(isset($config['setting']['redis']['server']) ) $host = $config['setting']['redis']['server']; + if(isset($config['setting']['redis']['prefix']) ) $prefix = $config['setting']['redis']['prefix']; + if(isset($config['setting']['redis']['pconnect']) ) $expire = $config['setting']['redis']['pconnect']; + if(isset($config['setting']['redis']['requirepass']) ) $password = $config['setting']['redis']['requirepass']; + if(isset($config['setting']['redis']['port']) ) $port = $config['setting']['redis']['port']; +} +// var_dump($host ,$prefix ,$password ,$expire);die; +return [ + // 默认缓存驱动 + 'default' => Env::get('cache.driver', 'redis'), + + // 缓存连接方式配置 + 'stores' => [ +// 'file' => [ +// // 驱动方式 +// 'type' => 'file', +// // 缓存保存目录 +// 'path' => '', +// // 缓存前缀 +// 'prefix' => '', +// // 缓存有效期 0表示永久缓存 +// 'expire' => 0, +// // 缓存标签前缀 +// 'tag_prefix' => 'tag:', +// // 序列化机制 例如 ['serialize', 'unserialize'] +// 'serialize' => [], +// ], + // 更多的缓存连接 + // redis缓存 + 'redis' => [ + // 驱动方式 + 'type' => 'redis', + // 服务器地址 + 'host' => !empty($host)?$host:'127.0.0.1', + //前缀 + 'prefix' => !empty($prefix)?$prefix:'longbing_', + //密码 + 'password' => $password, + //有效时长 + 'expire' => $expire, + //端口 + 'port' => !empty($port)?$port:'6379' + + + ], + ], +]; + diff --git a/config/console.php b/config/console.php new file mode 100644 index 0000000..3bbe6e6 --- /dev/null +++ b/config/console.php @@ -0,0 +1,28 @@ + +// +---------------------------------------------------------------------- + +// +---------------------------------------------------------------------- +// | 控制台配置 +// +---------------------------------------------------------------------- +//return [ +// // 执行用户(Windows下无效) +// 'user' => null, +// // 指令定义 +// 'commands' => [ +// +// ], +//]; + +return [ + 'commands' => [ + 'Swoole-Im' => 'app\command\SwooleIm', + ] +]; diff --git a/config/cookie.php b/config/cookie.php new file mode 100644 index 0000000..bbc5819 --- /dev/null +++ b/config/cookie.php @@ -0,0 +1,28 @@ + +// +---------------------------------------------------------------------- + +// +---------------------------------------------------------------------- +// | Cookie设置 +// +---------------------------------------------------------------------- +return [ + // cookie 保存时间 + 'expire' => 0, + // cookie 保存路径 + 'path' => '/', + // cookie 有效域名 + 'domain' => '', + // cookie 启用安全传输 + 'secure' => false, + // httponly设置 + 'httponly' => false, + // 是否使用 setcookie + 'setcookie' => true, +]; diff --git a/config/database.php b/config/database.php new file mode 100644 index 0000000..47d7aae --- /dev/null +++ b/config/database.php @@ -0,0 +1,91 @@ + +// +---------------------------------------------------------------------- +use think\facade\Env; +defined('IN_IA') || define('IN_IA',true); +$dir_path = __DIR__ . '/../../../../data/config.php'; +if(file_exists($dir_path) && longbingIsWeiqin()) +{ + require $dir_path; +}else{ + $config = array(); + $config['db']['master']['host'] = Env::get('database.hostname', '127.0.0.1'); + $config['db']['master']['username'] = Env::get('database.username', 'root'); + $config['db']['master']['password'] = Env::get('database.password', ''); + $config['db']['master']['port'] = Env::get('database.hostport', '3306'); + $config['db']['master']['database'] = Env::get('database.database', ''); + $config['db']['master']['charset'] = Env::get('database.charset', 'utf8mb4'); + $config['db']['master']['pconnect'] = 0; + $config['db']['master']['tablepre'] = Env::get('database.prefix', 'ims'); +} +return [ + // 默认使用的数据库连接配置 + 'default' => Env::get('database.driver', 'mysql'), + + // 数据库连接配置信息 + 'connections' => [ + 'mysql' => [ + // 数据库类型 + 'type' => 'mysql', + // 服务器地址 + 'hostname' => $config['db']['master']['host'], + // 数据库名 + 'database' => $config['db']['master']['database'], + // 用户名 + 'username' => $config['db']['master']['username'] , + // 密码 + 'password' => $config['db']['master']['password'], + // 端口 + 'hostport' => $config['db']['master']['port'], + // 连接dsn + 'dsn' => '', + // 数据库连接参数 + 'params' => [], + // 数据库编码默认采用utf8 + 'charset' => 'utf8mb4' , + // 数据库表前缀 + 'prefix' => $config['db']['master']['tablepre'] , + // 数据库调试模式 + 'debug' => Env::get('APP_DEBUG', false), + // 监听SQL + 'trigger_sql' => Env::get('APP_DEBUG', false), + // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器) + 'deploy' => 0, + // 数据库读写是否分离 主从式有效 + 'rw_separate' => false, + // 读写分离后 主服务器数量 + 'master_num' => 1, + // 指定从服务器序号 + 'slave_no' => '', + // 是否严格检查字段是否存在 + 'fields_strict' => true, + // 是否需要进行SQL性能分析 + 'sql_explain' => false, + // Builder类 + 'builder' => '', + // Query类 + 'query' => '', + // 是否需要断线重连 + 'break_reconnect' => false, + //数据集返回类型 + 'resultset_type' => 'array', + ], + + // 更多的数据库配置信息 + ], + + // 自定义时间查询规则 + 'time_query_rule' => [], + // 自动写入时间戳字段 +// 'auto_timestamp' => 'timestamp', + 'auto_timestamp' => true, + // 时间字段取出后的默认时间格式 +// 'datetime_format' => 'Y-m-d H:i:s', +]; diff --git a/config/filesystem.php b/config/filesystem.php new file mode 100644 index 0000000..3247f88 --- /dev/null +++ b/config/filesystem.php @@ -0,0 +1,24 @@ + Env::get('filesystem.driver', 'local'), + 'disks' => [ + 'local' => [ + 'type' => 'local', + 'root' => app()->getRuntimePath() . 'storage', + ], + 'public' => [ + 'type' => 'local', + 'root' => app()->getRootPath() . 'public/storage', + 'url' => '/storage', + 'visibility' => 'public', + ], + // 更多的磁盘配置信息 + 'longbing' => [ + 'type' => 'local', + 'root' => FILE_UPLOAD_PATH, + ] + ], +]; diff --git a/config/gateway_worker.php b/config/gateway_worker.php new file mode 100644 index 0000000..21d1ebe --- /dev/null +++ b/config/gateway_worker.php @@ -0,0 +1,45 @@ + +// +---------------------------------------------------------------------- +// +---------------------------------------------------------------------- +// | Workerman设置 仅对 php think worker:gateway 指令有效 +// +---------------------------------------------------------------------- +return [ + // 扩展自身需要的配置 + 'protocol' => 'websocket', // 协议 支持 tcp udp unix http websocket text + 'host' => '0.0.0.0', // 监听地址 + 'port' => 2348, // 监听端口 + 'socket' => '', // 完整监听地址 + 'context' => [], // socket 上下文选项 + 'register_deploy' => true, // 是否需要部署register + 'businessWorker_deploy' => true, // 是否需要部署businessWorker + 'gateway_deploy' => true, // 是否需要部署gateway + + // Register配置 + 'registerAddress' => '127.0.0.1:1236', + + // Gateway配置 + 'name' => 'thinkphp', + 'count' => 1, + 'lanIp' => '127.0.0.1', + 'startPort' => 2000, + 'daemonize' => false, + 'pingInterval' => 30, + 'pingNotResponseLimit' => 0, + 'pingData' => '{"type":"ping"}', + + // BusinsessWorker配置 + 'businessWorker' => [ + 'name' => 'BusinessWorker', + 'count' => 1, + 'eventHandler' => '\think\worker\Events', + ], + +]; diff --git a/config/lang.php b/config/lang.php new file mode 100644 index 0000000..8f699a5 --- /dev/null +++ b/config/lang.php @@ -0,0 +1,37 @@ + +// +---------------------------------------------------------------------- + +// +---------------------------------------------------------------------- +// | 多语言设置 +// +---------------------------------------------------------------------- + +use think\facade\Env; + +return [ + // 默认语言 + 'default_lang' => Env::get('lang.default_lang', 'zh-cn'), + // 允许的语言列表 + 'allow_lang_list' => ['zh-cn', 'en-us'], + // 多语言自动侦测变量名 + 'detect_var' => 'lang', + // 是否使用Cookie记录 + 'use_cookie' => true, + // 多语言cookie变量 + 'cookie_var' => 'think_lang', + // 扩展语言包 + 'extend_list' => [], + // Accept-Language转义为对应语言包名称 + 'accept_language' => [ + 'zh-hans-cn' => 'zh-cn', + ], + // 是否支持语言分组 + 'allow_group' => true, +]; diff --git a/config/log.php b/config/log.php new file mode 100644 index 0000000..0208828 --- /dev/null +++ b/config/log.php @@ -0,0 +1,55 @@ + +// +---------------------------------------------------------------------- +use think\facade\Env; + +// +---------------------------------------------------------------------- +// | 日志设置 +// +---------------------------------------------------------------------- + + +return [ + // 默认日志记录通道 + 'default' => Env::get('log.channel', 'file') , + // 日志记录级别 + 'level' => [], + // 日志类型记录的通道 ['error'=>'email',...] + 'type_channel' => [], + // 是否关闭日志写入 + 'close' => Env::get('APP_DEBUG', false) , + + // 日志通道列表 + 'channels' => [ + 'file' => [ + // 日志记录方式 + 'type' => 'File', + // 日志保存目录 + 'path' => '', + // 单文件日志写入 + 'single' => true, + // 独立日志级别 + 'apart_level' => [], + // 最大日志文件数量 + 'max_files' => 100, + //文件大小 + 'file_size' => 1024, + ], + // 其它日志通道配置 + 'SocketLog'=> [ + 'type' => 'SocketLog', + 'host' => 'slog.migugu.com', + //日志强制记录到配置的client_id + 'force_client_ids' => ['shuixian_zfH5NbLn','longbing_TkbB7uznHAdfLtCP','chenniang_qkEAbc1vgmKlL6H0'], + //限制允许读取日志的client_id + 'allow_client_ids' => ['shuixian_zfH5NbLn','longbing_TkbB7uznHAdfLtCP','chenniang_qkEAbc1vgmKlL6H0'], + ] + ], + +]; diff --git a/config/permissions.php b/config/permissions.php new file mode 100644 index 0000000..f2be209 --- /dev/null +++ b/config/permissions.php @@ -0,0 +1,33 @@ + +// +---------------------------------------------------------------------- + +// +---------------------------------------------------------------------- +// | 应用设置 +// +---------------------------------------------------------------------- + +return [ + // PATHINFO变量名 用于兼容模式 + 'var_pathinfo' => 's', + // 兼容PATH_INFO获取 + 'pathinfo_fetch' => ['ORIG_PATH_INFO', 'REDIRECT_PATH_INFO', 'REDIRECT_URL'], + // pathinfo分隔符 + 'pathinfo_depr' => '/', + // HTTPS代理标识 + 'https_agent_name' => '', + // URL伪静态后缀 + 'url_html_suffix' => 'html', + // URL普通方式参数 用于自动生成 + 'url_common_param' => true, + // 是否开启路由延迟解析 + 'url_lazy_route' => false, + // 是否强制使用路由 + 'url_route_must' => true, + // 合并路由规则 + 'route_rule_merge' => true, + // 路由是否完全匹配 + 'route_complete_match' => true, + // 使用注解路由 + 'route_annotation' => false, + // 是否开启路由缓存 + 'route_check_cache' => false, + // 路由缓存连接参数 + 'route_cache_option' => [], + // 路由缓存Key + 'route_check_cache_key' => '', + // 访问控制器层名称 + 'controller_layer' => 'controller', + // 空控制器名 + 'empty_controller' => 'Error', + // 是否使用控制器后缀 + 'controller_suffix' => false, + // 默认的路由变量规则 + 'default_route_pattern' => '[\w\.]+', + // 域名根,如thinkphp.cn + 'url_domain_root' => '', + // 是否自动转换URL中的控制器和操作名 + 'url_convert' => true, + // 表单请求类型伪装变量 + 'var_method' => '_method', + // 表单ajax伪装变量 + 'var_ajax' => '_ajax', + // 表单pjax伪装变量 + 'var_pjax' => '_pjax', + // 是否开启请求缓存 true自动缓存 支持设置请求缓存规则 + 'request_cache' => false, + // 请求缓存有效期 + 'request_cache_expire' => null, + // 全局请求缓存排除规则 + 'request_cache_except' => [], + // 默认控制器名 + 'default_controller' => 'Index', + // 默认操作名 + 'default_action' => 'index', + // 操作方法后缀 + 'action_suffix' => '', + // 默认JSONP格式返回的处理方法 + 'default_jsonp_handler' => 'jsonpReturn', + // 默认JSONP处理方法 + 'var_jsonp_handler' => 'callback', +]; diff --git a/config/session.php b/config/session.php new file mode 100644 index 0000000..7a2527a --- /dev/null +++ b/config/session.php @@ -0,0 +1,27 @@ + +// +---------------------------------------------------------------------- + +// +---------------------------------------------------------------------- +// | 会话设置 +// +---------------------------------------------------------------------- + +return [ + // session name + 'name' => '', + // SESSION_ID的提交变量,解决flash上传跨域 + 'var_session_id' => '', + // 驱动方式 支持file redis memcache memcached + 'type' => 'file', + // 过期时间 + 'expire' => 0, + // 前缀 + 'prefix' => '', +]; diff --git a/config/swoole.php b/config/swoole.php new file mode 100644 index 0000000..864db49 --- /dev/null +++ b/config/swoole.php @@ -0,0 +1,54 @@ + [ + 'host' => '0.0.0.0', // 监听地址 + 'port' => Env::get('swoole.port', '8005'), // 监听端口 + 'mode' => SWOOLE_PROCESS, // 运行模式 默认为SWOOLE_PROCESS + 'sock_type' => SWOOLE_SOCK_TCP, // sock type 默认为SWOOLE_SOCK_TCP + 'options' => [ + 'pid_file' => runtime_path() . 'swoole.pid', + 'log_file' => Env::get('APP_DEBUG', false) ? runtime_path() . 'swoole.log' : false, + 'daemonize' => Env::get('swoole.daemonize', false), + // Normally this value should be 1~4 times larger according to your cpu cores. + 'reactor_num' => swoole_cpu_num(), + 'worker_num' => swoole_cpu_num(), + 'task_worker_num' => swoole_cpu_num(), + 'enable_static_handler' => true, + 'document_root' => root_path('public'), + 'package_max_length' => 20 * 1024 * 1024, + 'buffer_output_size' => 10 * 1024 * 1024, + 'socket_buffer_size' => 128 * 1024 * 1024, + 'max_request' => 3000, + 'send_yield' => true, + ], + ], + 'websocket' => [ + 'enabled' => true, + 'handler' => Handler::class, + 'parser' => Parser::class, + 'route_file' => base_path() . 'im/controller/websocket.php', + 'ping_interval' => 25000, + 'ping_timeout' => 60000, + 'room' => [ + 'type' => TableRoom::class, + 'room_rows' => 4096, + 'room_size' => 2048, + 'client_rows' => 8192, + 'client_size' => 2048, + ], + ], + 'hot_update' => [ + 'enable' => true, + 'name' => ['*.php'], + 'include' => [app_path().'im/controller'], + 'exclude' => [], + ], + 'auto_reload' => false, + 'enable_coroutine' => true, + 'resetters' => [], + 'tables' => [], +]; diff --git a/config/template.php b/config/template.php new file mode 100644 index 0000000..98fd536 --- /dev/null +++ b/config/template.php @@ -0,0 +1,25 @@ + 'Think', + // 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法 + 'auto_rule' => 1, + // 模板路径 + 'view_path' => '', + // 模板后缀 + 'view_suffix' => 'html', + // 模板文件名分隔符 + 'view_depr' => DIRECTORY_SEPARATOR, + // 模板引擎普通标签开始标记 + 'tpl_begin' => '{', + // 模板引擎普通标签结束标记 + 'tpl_end' => '}', + // 标签库标签开始标记 + 'taglib_begin' => '{', + // 标签库标签结束标记 + 'taglib_end' => '}', +]; diff --git a/config/trace.php b/config/trace.php new file mode 100644 index 0000000..da33a46 --- /dev/null +++ b/config/trace.php @@ -0,0 +1,18 @@ + +// +---------------------------------------------------------------------- + +// +---------------------------------------------------------------------- +// | Trace设置 开启调试模式后有效 +// +---------------------------------------------------------------------- +return [ + // 内置Html 支持扩展 + 'type' => 'Html', +]; diff --git a/config/view.php b/config/view.php new file mode 100644 index 0000000..28b4403 --- /dev/null +++ b/config/view.php @@ -0,0 +1,23 @@ + 'Think', + // 模板路径 + 'view_path' => '', + // 模板后缀 + 'view_suffix' => 'html', + // 模板文件名分隔符 + 'view_depr' => '/', + // 模板引擎普通标签开始标记 + 'tpl_begin' => '{', + // 模板引擎普通标签结束标记 + 'tpl_end' => '}', + // 标签库标签开始标记 + 'taglib_begin' => '{', + // 标签库标签结束标记 + 'taglib_end' => '}', +]; diff --git a/config/worker.php b/config/worker.php new file mode 100644 index 0000000..498812c --- /dev/null +++ b/config/worker.php @@ -0,0 +1,30 @@ + +// +---------------------------------------------------------------------- + +// +---------------------------------------------------------------------- +// | Workerman设置 仅对 php think worker 指令有效 +// +---------------------------------------------------------------------- +return [ + // 扩展自身需要的配置 + 'host' => '0.0.0.0', // 监听地址 + 'port' => 2346, // 监听端口 + 'root' => '', // WEB 根目录 默认会定位public目录 + 'app_path' => '', // 应用目录 守护进程模式必须设置(绝对路径) + 'file_monitor' => false, // 是否开启PHP文件更改监控(调试模式下自动开启) + 'file_monitor_interval' => 2, // 文件监控检测时间间隔(秒) + 'file_monitor_path' => [], // 文件监控目录 默认监控application和config目录 + + // 支持workerman的所有配置参数 + 'name' => 'thinkphp', + 'count' => 4, + 'daemonize' => false, + 'pidFile' => '', +]; diff --git a/config/worker_server.php b/config/worker_server.php new file mode 100644 index 0000000..292328f --- /dev/null +++ b/config/worker_server.php @@ -0,0 +1,55 @@ + +// +---------------------------------------------------------------------- + +// +---------------------------------------------------------------------- +// | Workerman设置 仅对 php think worker:server 指令有效 +// +---------------------------------------------------------------------- +return [ + // 扩展自身需要的配置 + 'protocol' => 'websocket', // 协议 支持 tcp udp unix http websocket text + 'host' => '0.0.0.0', // 监听地址 + 'port' => 2345, // 监听端口 + 'socket' => '', // 完整监听地址 + 'context' => [], // socket 上下文选项 + 'worker_class' => '', // 自定义Workerman服务类名 支持数组定义多个服务 + + // 支持workerman的所有配置参数 + 'name' => 'thinkphp', + 'count' => 4, + 'daemonize' => false, + 'pidFile' => '', + + // 支持事件回调 + // onWorkerStart + 'onWorkerStart' => function ($worker) { + + }, + // onWorkerReload + 'onWorkerReload' => function ($worker) { + + }, + // onConnect + 'onConnect' => function ($connection) { + + }, + // onMessage + 'onMessage' => function ($connection, $data) { + $connection->send('receive success'); + }, + // onClose + 'onClose' => function ($connection) { + + }, + // onError + 'onError' => function ($connection, $code, $msg) { + echo "error [ $code ] $msg\n"; + }, +]; diff --git a/extend/PHPExcel/PHPExcel.php b/extend/PHPExcel/PHPExcel.php new file mode 100644 index 0000000..b8dbe0e --- /dev/null +++ b/extend/PHPExcel/PHPExcel.php @@ -0,0 +1,1153 @@ +hasMacros; + } + + /** + * Define if a workbook has macros + * + * @param boolean $hasMacros true|false + */ + public function setHasMacros($hasMacros = false) + { + $this->hasMacros = (bool) $hasMacros; + } + + /** + * Set the macros code + * + * @param string $MacrosCode string|null + */ + public function setMacrosCode($MacrosCode = null) + { + $this->macrosCode=$MacrosCode; + $this->setHasMacros(!is_null($MacrosCode)); + } + + /** + * Return the macros code + * + * @return string|null + */ + public function getMacrosCode() + { + return $this->macrosCode; + } + + /** + * Set the macros certificate + * + * @param string|null $Certificate + */ + public function setMacrosCertificate($Certificate = null) + { + $this->macrosCertificate=$Certificate; + } + + /** + * Is the project signed ? + * + * @return boolean true|false + */ + public function hasMacrosCertificate() + { + return !is_null($this->macrosCertificate); + } + + /** + * Return the macros certificate + * + * @return string|null + */ + public function getMacrosCertificate() + { + return $this->macrosCertificate; + } + + /** + * Remove all macros, certificate from spreadsheet + * + */ + public function discardMacros() + { + $this->hasMacros=false; + $this->macrosCode=null; + $this->macrosCertificate=null; + } + + /** + * set ribbon XML data + * + */ + public function setRibbonXMLData($Target = null, $XMLData = null) + { + if (!is_null($Target) && !is_null($XMLData)) { + $this->ribbonXMLData = array('target' => $Target, 'data' => $XMLData); + } else { + $this->ribbonXMLData = null; + } + } + + /** + * retrieve ribbon XML Data + * + * return string|null|array + */ + public function getRibbonXMLData($What = 'all') //we need some constants here... + { + $ReturnData = null; + $What = strtolower($What); + switch ($What){ + case 'all': + $ReturnData = $this->ribbonXMLData; + break; + case 'target': + case 'data': + if (is_array($this->ribbonXMLData) && array_key_exists($What, $this->ribbonXMLData)) { + $ReturnData = $this->ribbonXMLData[$What]; + } + break; + } + + return $ReturnData; + } + + /** + * store binaries ribbon objects (pictures) + * + */ + public function setRibbonBinObjects($BinObjectsNames = null, $BinObjectsData = null) + { + if (!is_null($BinObjectsNames) && !is_null($BinObjectsData)) { + $this->ribbonBinObjects = array('names' => $BinObjectsNames, 'data' => $BinObjectsData); + } else { + $this->ribbonBinObjects = null; + } + } + /** + * return the extension of a filename. Internal use for a array_map callback (php<5.3 don't like lambda function) + * + */ + private function getExtensionOnly($ThePath) + { + return pathinfo($ThePath, PATHINFO_EXTENSION); + } + + /** + * retrieve Binaries Ribbon Objects + * + */ + public function getRibbonBinObjects($What = 'all') + { + $ReturnData = null; + $What = strtolower($What); + switch($What) { + case 'all': + return $this->ribbonBinObjects; + break; + case 'names': + case 'data': + if (is_array($this->ribbonBinObjects) && array_key_exists($What, $this->ribbonBinObjects)) { + $ReturnData=$this->ribbonBinObjects[$What]; + } + break; + case 'types': + if (is_array($this->ribbonBinObjects) && + array_key_exists('data', $this->ribbonBinObjects) && is_array($this->ribbonBinObjects['data'])) { + $tmpTypes=array_keys($this->ribbonBinObjects['data']); + $ReturnData = array_unique(array_map(array($this, 'getExtensionOnly'), $tmpTypes)); + } else { + $ReturnData=array(); // the caller want an array... not null if empty + } + break; + } + return $ReturnData; + } + + /** + * This workbook have a custom UI ? + * + * @return boolean true|false + */ + public function hasRibbon() + { + return !is_null($this->ribbonXMLData); + } + + /** + * This workbook have additionnal object for the ribbon ? + * + * @return boolean true|false + */ + public function hasRibbonBinObjects() + { + return !is_null($this->ribbonBinObjects); + } + + /** + * Check if a sheet with a specified code name already exists + * + * @param string $pSheetCodeName Name of the worksheet to check + * @return boolean + */ + public function sheetCodeNameExists($pSheetCodeName) + { + return ($this->getSheetByCodeName($pSheetCodeName) !== null); + } + + /** + * Get sheet by code name. Warning : sheet don't have always a code name ! + * + * @param string $pName Sheet name + * @return PHPExcel_Worksheet + */ + public function getSheetByCodeName($pName = '') + { + $worksheetCount = count($this->workSheetCollection); + for ($i = 0; $i < $worksheetCount; ++$i) { + if ($this->workSheetCollection[$i]->getCodeName() == $pName) { + return $this->workSheetCollection[$i]; + } + } + + return null; + } + + /** + * Create a new PHPExcel with one Worksheet + */ + public function __construct() + { + $this->uniqueID = uniqid(); + $this->calculationEngine = new PHPExcel_Calculation($this); + + // Initialise worksheet collection and add one worksheet + $this->workSheetCollection = array(); + $this->workSheetCollection[] = new PHPExcel_Worksheet($this); + $this->activeSheetIndex = 0; + + // Create document properties + $this->properties = new PHPExcel_DocumentProperties(); + + // Create document security + $this->security = new PHPExcel_DocumentSecurity(); + + // Set named ranges + $this->namedRanges = array(); + + // Create the cellXf supervisor + $this->cellXfSupervisor = new PHPExcel_Style(true); + $this->cellXfSupervisor->bindParent($this); + + // Create the default style + $this->addCellXf(new PHPExcel_Style); + $this->addCellStyleXf(new PHPExcel_Style); + } + + /** + * Code to execute when this worksheet is unset() + * + */ + public function __destruct() + { + $this->calculationEngine = null; + $this->disconnectWorksheets(); + } + + /** + * Disconnect all worksheets from this PHPExcel workbook object, + * typically so that the PHPExcel object can be unset + * + */ + public function disconnectWorksheets() + { + $worksheet = null; + foreach ($this->workSheetCollection as $k => &$worksheet) { + $worksheet->disconnectCells(); + $this->workSheetCollection[$k] = null; + } + unset($worksheet); + $this->workSheetCollection = array(); + } + + /** + * Return the calculation engine for this worksheet + * + * @return PHPExcel_Calculation + */ + public function getCalculationEngine() + { + return $this->calculationEngine; + } // function getCellCacheController() + + /** + * Get properties + * + * @return PHPExcel_DocumentProperties + */ + public function getProperties() + { + return $this->properties; + } + + /** + * Set properties + * + * @param PHPExcel_DocumentProperties $pValue + */ + public function setProperties(PHPExcel_DocumentProperties $pValue) + { + $this->properties = $pValue; + } + + /** + * Get security + * + * @return PHPExcel_DocumentSecurity + */ + public function getSecurity() + { + return $this->security; + } + + /** + * Set security + * + * @param PHPExcel_DocumentSecurity $pValue + */ + public function setSecurity(PHPExcel_DocumentSecurity $pValue) + { + $this->security = $pValue; + } + + /** + * Get active sheet + * + * @return PHPExcel_Worksheet + * + * @throws PHPExcel_Exception + */ + public function getActiveSheet() + { + return $this->getSheet($this->activeSheetIndex); + } + + /** + * Create sheet and add it to this workbook + * + * @param int|null $iSheetIndex Index where sheet should go (0,1,..., or null for last) + * @return PHPExcel_Worksheet + * @throws PHPExcel_Exception + */ + public function createSheet($iSheetIndex = null) + { + $newSheet = new PHPExcel_Worksheet($this); + $this->addSheet($newSheet, $iSheetIndex); + return $newSheet; + } + + /** + * Check if a sheet with a specified name already exists + * + * @param string $pSheetName Name of the worksheet to check + * @return boolean + */ + public function sheetNameExists($pSheetName) + { + return ($this->getSheetByName($pSheetName) !== null); + } + + /** + * Add sheet + * + * @param PHPExcel_Worksheet $pSheet + * @param int|null $iSheetIndex Index where sheet should go (0,1,..., or null for last) + * @return PHPExcel_Worksheet + * @throws PHPExcel_Exception + */ + public function addSheet(PHPExcel_Worksheet $pSheet, $iSheetIndex = null) + { + if ($this->sheetNameExists($pSheet->getTitle())) { + throw new PHPExcel_Exception( + "Workbook already contains a worksheet named '{$pSheet->getTitle()}'. Rename this worksheet first." + ); + } + + if ($iSheetIndex === null) { + if ($this->activeSheetIndex < 0) { + $this->activeSheetIndex = 0; + } + $this->workSheetCollection[] = $pSheet; + } else { + // Insert the sheet at the requested index + array_splice( + $this->workSheetCollection, + $iSheetIndex, + 0, + array($pSheet) + ); + + // Adjust active sheet index if necessary + if ($this->activeSheetIndex >= $iSheetIndex) { + ++$this->activeSheetIndex; + } + } + + if ($pSheet->getParent() === null) { + $pSheet->rebindParent($this); + } + + return $pSheet; + } + + /** + * Remove sheet by index + * + * @param int $pIndex Active sheet index + * @throws PHPExcel_Exception + */ + public function removeSheetByIndex($pIndex = 0) + { + + $numSheets = count($this->workSheetCollection); + if ($pIndex > $numSheets - 1) { + throw new PHPExcel_Exception( + "You tried to remove a sheet by the out of bounds index: {$pIndex}. The actual number of sheets is {$numSheets}." + ); + } else { + array_splice($this->workSheetCollection, $pIndex, 1); + } + // Adjust active sheet index if necessary + if (($this->activeSheetIndex >= $pIndex) && + ($pIndex > count($this->workSheetCollection) - 1)) { + --$this->activeSheetIndex; + } + + } + + /** + * Get sheet by index + * + * @param int $pIndex Sheet index + * @return PHPExcel_Worksheet + * @throws PHPExcel_Exception + */ + public function getSheet($pIndex = 0) + { + if (!isset($this->workSheetCollection[$pIndex])) { + $numSheets = $this->getSheetCount(); + throw new PHPExcel_Exception( + "Your requested sheet index: {$pIndex} is out of bounds. The actual number of sheets is {$numSheets}." + ); + } + + return $this->workSheetCollection[$pIndex]; + } + + /** + * Get all sheets + * + * @return PHPExcel_Worksheet[] + */ + public function getAllSheets() + { + return $this->workSheetCollection; + } + + /** + * Get sheet by name + * + * @param string $pName Sheet name + * @return PHPExcel_Worksheet + */ + public function getSheetByName($pName = '') + { + $worksheetCount = count($this->workSheetCollection); + for ($i = 0; $i < $worksheetCount; ++$i) { + if ($this->workSheetCollection[$i]->getTitle() === $pName) { + return $this->workSheetCollection[$i]; + } + } + + return null; + } + + /** + * Get index for sheet + * + * @param PHPExcel_Worksheet $pSheet + * @return int Sheet index + * @throws PHPExcel_Exception + */ + public function getIndex(PHPExcel_Worksheet $pSheet) + { + foreach ($this->workSheetCollection as $key => $value) { + if ($value->getHashCode() == $pSheet->getHashCode()) { + return $key; + } + } + + throw new PHPExcel_Exception("Sheet does not exist."); + } + + /** + * Set index for sheet by sheet name. + * + * @param string $sheetName Sheet name to modify index for + * @param int $newIndex New index for the sheet + * @return int New sheet index + * @throws PHPExcel_Exception + */ + public function setIndexByName($sheetName, $newIndex) + { + $oldIndex = $this->getIndex($this->getSheetByName($sheetName)); + $pSheet = array_splice( + $this->workSheetCollection, + $oldIndex, + 1 + ); + array_splice( + $this->workSheetCollection, + $newIndex, + 0, + $pSheet + ); + return $newIndex; + } + + /** + * Get sheet count + * + * @return int + */ + public function getSheetCount() + { + return count($this->workSheetCollection); + } + + /** + * Get active sheet index + * + * @return int Active sheet index + */ + public function getActiveSheetIndex() + { + return $this->activeSheetIndex; + } + + /** + * Set active sheet index + * + * @param int $pIndex Active sheet index + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function setActiveSheetIndex($pIndex = 0) + { + $numSheets = count($this->workSheetCollection); + + if ($pIndex > $numSheets - 1) { + throw new PHPExcel_Exception( + "You tried to set a sheet active by the out of bounds index: {$pIndex}. The actual number of sheets is {$numSheets}." + ); + } else { + $this->activeSheetIndex = $pIndex; + } + return $this->getActiveSheet(); + } + + /** + * Set active sheet index by name + * + * @param string $pValue Sheet title + * @return PHPExcel_Worksheet + * @throws PHPExcel_Exception + */ + public function setActiveSheetIndexByName($pValue = '') + { + if (($worksheet = $this->getSheetByName($pValue)) instanceof PHPExcel_Worksheet) { + $this->setActiveSheetIndex($this->getIndex($worksheet)); + return $worksheet; + } + + throw new PHPExcel_Exception('Workbook does not contain sheet:' . $pValue); + } + + /** + * Get sheet names + * + * @return string[] + */ + public function getSheetNames() + { + $returnValue = array(); + $worksheetCount = $this->getSheetCount(); + for ($i = 0; $i < $worksheetCount; ++$i) { + $returnValue[] = $this->getSheet($i)->getTitle(); + } + + return $returnValue; + } + + /** + * Add external sheet + * + * @param PHPExcel_Worksheet $pSheet External sheet to add + * @param int|null $iSheetIndex Index where sheet should go (0,1,..., or null for last) + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function addExternalSheet(PHPExcel_Worksheet $pSheet, $iSheetIndex = null) + { + if ($this->sheetNameExists($pSheet->getTitle())) { + throw new PHPExcel_Exception("Workbook already contains a worksheet named '{$pSheet->getTitle()}'. Rename the external sheet first."); + } + + // count how many cellXfs there are in this workbook currently, we will need this below + $countCellXfs = count($this->cellXfCollection); + + // copy all the shared cellXfs from the external workbook and append them to the current + foreach ($pSheet->getParent()->getCellXfCollection() as $cellXf) { + $this->addCellXf(clone $cellXf); + } + + // move sheet to this workbook + $pSheet->rebindParent($this); + + // update the cellXfs + foreach ($pSheet->getCellCollection(false) as $cellID) { + $cell = $pSheet->getCell($cellID); + $cell->setXfIndex($cell->getXfIndex() + $countCellXfs); + } + + return $this->addSheet($pSheet, $iSheetIndex); + } + + /** + * Get named ranges + * + * @return PHPExcel_NamedRange[] + */ + public function getNamedRanges() + { + return $this->namedRanges; + } + + /** + * Add named range + * + * @param PHPExcel_NamedRange $namedRange + * @return boolean + */ + public function addNamedRange(PHPExcel_NamedRange $namedRange) + { + if ($namedRange->getScope() == null) { + // global scope + $this->namedRanges[$namedRange->getName()] = $namedRange; + } else { + // local scope + $this->namedRanges[$namedRange->getScope()->getTitle().'!'.$namedRange->getName()] = $namedRange; + } + return true; + } + + /** + * Get named range + * + * @param string $namedRange + * @param PHPExcel_Worksheet|null $pSheet Scope. Use null for global scope + * @return PHPExcel_NamedRange|null + */ + public function getNamedRange($namedRange, PHPExcel_Worksheet $pSheet = null) + { + $returnValue = null; + + if ($namedRange != '' && ($namedRange !== null)) { + // first look for global defined name + if (isset($this->namedRanges[$namedRange])) { + $returnValue = $this->namedRanges[$namedRange]; + } + + // then look for local defined name (has priority over global defined name if both names exist) + if (($pSheet !== null) && isset($this->namedRanges[$pSheet->getTitle() . '!' . $namedRange])) { + $returnValue = $this->namedRanges[$pSheet->getTitle() . '!' . $namedRange]; + } + } + + return $returnValue; + } + + /** + * Remove named range + * + * @param string $namedRange + * @param PHPExcel_Worksheet|null $pSheet Scope: use null for global scope. + * @return PHPExcel + */ + public function removeNamedRange($namedRange, PHPExcel_Worksheet $pSheet = null) + { + if ($pSheet === null) { + if (isset($this->namedRanges[$namedRange])) { + unset($this->namedRanges[$namedRange]); + } + } else { + if (isset($this->namedRanges[$pSheet->getTitle() . '!' . $namedRange])) { + unset($this->namedRanges[$pSheet->getTitle() . '!' . $namedRange]); + } + } + return $this; + } + + /** + * Get worksheet iterator + * + * @return PHPExcel_WorksheetIterator + */ + public function getWorksheetIterator() + { + return new PHPExcel_WorksheetIterator($this); + } + + /** + * Copy workbook (!= clone!) + * + * @return PHPExcel + */ + public function copy() + { + $copied = clone $this; + + $worksheetCount = count($this->workSheetCollection); + for ($i = 0; $i < $worksheetCount; ++$i) { + $this->workSheetCollection[$i] = $this->workSheetCollection[$i]->copy(); + $this->workSheetCollection[$i]->rebindParent($this); + } + + return $copied; + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + foreach ($this as $key => $val) { + if (is_object($val) || (is_array($val))) { + $this->{$key} = unserialize(serialize($val)); + } + } + } + + /** + * Get the workbook collection of cellXfs + * + * @return PHPExcel_Style[] + */ + public function getCellXfCollection() + { + return $this->cellXfCollection; + } + + /** + * Get cellXf by index + * + * @param int $pIndex + * @return PHPExcel_Style + */ + public function getCellXfByIndex($pIndex = 0) + { + return $this->cellXfCollection[$pIndex]; + } + + /** + * Get cellXf by hash code + * + * @param string $pValue + * @return PHPExcel_Style|boolean False if no match found + */ + public function getCellXfByHashCode($pValue = '') + { + foreach ($this->cellXfCollection as $cellXf) { + if ($cellXf->getHashCode() == $pValue) { + return $cellXf; + } + } + return false; + } + + /** + * Check if style exists in style collection + * + * @param PHPExcel_Style $pCellStyle + * @return boolean + */ + public function cellXfExists($pCellStyle = null) + { + return in_array($pCellStyle, $this->cellXfCollection, true); + } + + /** + * Get default style + * + * @return PHPExcel_Style + * @throws PHPExcel_Exception + */ + public function getDefaultStyle() + { + if (isset($this->cellXfCollection[0])) { + return $this->cellXfCollection[0]; + } + throw new PHPExcel_Exception('No default style found for this workbook'); + } + + /** + * Add a cellXf to the workbook + * + * @param PHPExcel_Style $style + */ + public function addCellXf(PHPExcel_Style $style) + { + $this->cellXfCollection[] = $style; + $style->setIndex(count($this->cellXfCollection) - 1); + } + + /** + * Remove cellXf by index. It is ensured that all cells get their xf index updated. + * + * @param integer $pIndex Index to cellXf + * @throws PHPExcel_Exception + */ + public function removeCellXfByIndex($pIndex = 0) + { + if ($pIndex > count($this->cellXfCollection) - 1) { + throw new PHPExcel_Exception("CellXf index is out of bounds."); + } else { + // first remove the cellXf + array_splice($this->cellXfCollection, $pIndex, 1); + + // then update cellXf indexes for cells + foreach ($this->workSheetCollection as $worksheet) { + foreach ($worksheet->getCellCollection(false) as $cellID) { + $cell = $worksheet->getCell($cellID); + $xfIndex = $cell->getXfIndex(); + if ($xfIndex > $pIndex) { + // decrease xf index by 1 + $cell->setXfIndex($xfIndex - 1); + } elseif ($xfIndex == $pIndex) { + // set to default xf index 0 + $cell->setXfIndex(0); + } + } + } + } + } + + /** + * Get the cellXf supervisor + * + * @return PHPExcel_Style + */ + public function getCellXfSupervisor() + { + return $this->cellXfSupervisor; + } + + /** + * Get the workbook collection of cellStyleXfs + * + * @return PHPExcel_Style[] + */ + public function getCellStyleXfCollection() + { + return $this->cellStyleXfCollection; + } + + /** + * Get cellStyleXf by index + * + * @param integer $pIndex Index to cellXf + * @return PHPExcel_Style + */ + public function getCellStyleXfByIndex($pIndex = 0) + { + return $this->cellStyleXfCollection[$pIndex]; + } + + /** + * Get cellStyleXf by hash code + * + * @param string $pValue + * @return PHPExcel_Style|boolean False if no match found + */ + public function getCellStyleXfByHashCode($pValue = '') + { + foreach ($this->cellStyleXfCollection as $cellStyleXf) { + if ($cellStyleXf->getHashCode() == $pValue) { + return $cellStyleXf; + } + } + return false; + } + + /** + * Add a cellStyleXf to the workbook + * + * @param PHPExcel_Style $pStyle + */ + public function addCellStyleXf(PHPExcel_Style $pStyle) + { + $this->cellStyleXfCollection[] = $pStyle; + $pStyle->setIndex(count($this->cellStyleXfCollection) - 1); + } + + /** + * Remove cellStyleXf by index + * + * @param integer $pIndex Index to cellXf + * @throws PHPExcel_Exception + */ + public function removeCellStyleXfByIndex($pIndex = 0) + { + if ($pIndex > count($this->cellStyleXfCollection) - 1) { + throw new PHPExcel_Exception("CellStyleXf index is out of bounds."); + } else { + array_splice($this->cellStyleXfCollection, $pIndex, 1); + } + } + + /** + * Eliminate all unneeded cellXf and afterwards update the xfIndex for all cells + * and columns in the workbook + */ + public function garbageCollect() + { + // how many references are there to each cellXf ? + $countReferencesCellXf = array(); + foreach ($this->cellXfCollection as $index => $cellXf) { + $countReferencesCellXf[$index] = 0; + } + + foreach ($this->getWorksheetIterator() as $sheet) { + // from cells + foreach ($sheet->getCellCollection(false) as $cellID) { + $cell = $sheet->getCell($cellID); + ++$countReferencesCellXf[$cell->getXfIndex()]; + } + + // from row dimensions + foreach ($sheet->getRowDimensions() as $rowDimension) { + if ($rowDimension->getXfIndex() !== null) { + ++$countReferencesCellXf[$rowDimension->getXfIndex()]; + } + } + + // from column dimensions + foreach ($sheet->getColumnDimensions() as $columnDimension) { + ++$countReferencesCellXf[$columnDimension->getXfIndex()]; + } + } + + // remove cellXfs without references and create mapping so we can update xfIndex + // for all cells and columns + $countNeededCellXfs = 0; + $map = array(); + foreach ($this->cellXfCollection as $index => $cellXf) { + if ($countReferencesCellXf[$index] > 0 || $index == 0) { // we must never remove the first cellXf + ++$countNeededCellXfs; + } else { + unset($this->cellXfCollection[$index]); + } + $map[$index] = $countNeededCellXfs - 1; + } + $this->cellXfCollection = array_values($this->cellXfCollection); + + // update the index for all cellXfs + foreach ($this->cellXfCollection as $i => $cellXf) { + $cellXf->setIndex($i); + } + + // make sure there is always at least one cellXf (there should be) + if (empty($this->cellXfCollection)) { + $this->cellXfCollection[] = new PHPExcel_Style(); + } + + // update the xfIndex for all cells, row dimensions, column dimensions + foreach ($this->getWorksheetIterator() as $sheet) { + // for all cells + foreach ($sheet->getCellCollection(false) as $cellID) { + $cell = $sheet->getCell($cellID); + $cell->setXfIndex($map[$cell->getXfIndex()]); + } + + // for all row dimensions + foreach ($sheet->getRowDimensions() as $rowDimension) { + if ($rowDimension->getXfIndex() !== null) { + $rowDimension->setXfIndex($map[$rowDimension->getXfIndex()]); + } + } + + // for all column dimensions + foreach ($sheet->getColumnDimensions() as $columnDimension) { + $columnDimension->setXfIndex($map[$columnDimension->getXfIndex()]); + } + + // also do garbage collection for all the sheets + $sheet->garbageCollect(); + } + } + + /** + * Return the unique ID value assigned to this spreadsheet workbook + * + * @return string + */ + public function getID() + { + return $this->uniqueID; + } +} diff --git a/extend/PHPExcel/PHPExcel/Autoloader.php b/extend/PHPExcel/PHPExcel/Autoloader.php new file mode 100644 index 0000000..c3b95a2 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Autoloader.php @@ -0,0 +1,81 @@ += 0) { + return spl_autoload_register(array('PHPExcel_Autoloader', 'load'), true, true); + } else { + return spl_autoload_register(array('PHPExcel_Autoloader', 'load')); + } + } + + /** + * Autoload a class identified by name + * + * @param string $pClassName Name of the object to load + */ + public static function load($pClassName) + { + if ((class_exists($pClassName, false)) || (strpos($pClassName, 'PHPExcel') !== 0)) { + // Either already loaded, or not a PHPExcel class request + return false; + } + + $pClassFilePath = PHPEXCEL_ROOT . + str_replace('_', DIRECTORY_SEPARATOR, $pClassName) . + '.php'; + + if ((file_exists($pClassFilePath) === false) || (is_readable($pClassFilePath) === false)) { + // Can't load + return false; + } + + require($pClassFilePath); + } +} diff --git a/extend/PHPExcel/PHPExcel/CachedObjectStorage/APC.php b/extend/PHPExcel/PHPExcel/CachedObjectStorage/APC.php new file mode 100644 index 0000000..c74b07f --- /dev/null +++ b/extend/PHPExcel/PHPExcel/CachedObjectStorage/APC.php @@ -0,0 +1,290 @@ +currentCellIsDirty && !empty($this->currentObjectID)) { + $this->currentObject->detach(); + + if (!apc_store( + $this->cachePrefix . $this->currentObjectID . '.cache', + serialize($this->currentObject), + $this->cacheTime + )) { + $this->__destruct(); + throw new PHPExcel_Exception('Failed to store cell ' . $this->currentObjectID . ' in APC'); + } + $this->currentCellIsDirty = false; + } + $this->currentObjectID = $this->currentObject = null; + } + + /** + * Add or Update a cell in cache identified by coordinate address + * + * @access public + * @param string $pCoord Coordinate address of the cell to update + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function addCacheData($pCoord, PHPExcel_Cell $cell) + { + if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { + $this->storeData(); + } + $this->cellCache[$pCoord] = true; + + $this->currentObjectID = $pCoord; + $this->currentObject = $cell; + $this->currentCellIsDirty = true; + + return $cell; + } + + /** + * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? + * + * @access public + * @param string $pCoord Coordinate address of the cell to check + * @throws PHPExcel_Exception + * @return boolean + */ + public function isDataSet($pCoord) + { + // Check if the requested entry is the current object, or exists in the cache + if (parent::isDataSet($pCoord)) { + if ($this->currentObjectID == $pCoord) { + return true; + } + // Check if the requested entry still exists in apc + $success = apc_fetch($this->cachePrefix.$pCoord.'.cache'); + if ($success === false) { + // Entry no longer exists in APC, so clear it from the cache array + parent::deleteCacheData($pCoord); + throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in APC cache'); + } + return true; + } + return false; + } + + /** + * Get cell at a specific coordinate + * + * @access public + * @param string $pCoord Coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Cell Cell that was found, or null if not found + */ + public function getCacheData($pCoord) + { + if ($pCoord === $this->currentObjectID) { + return $this->currentObject; + } + $this->storeData(); + + // Check if the entry that has been requested actually exists + if (parent::isDataSet($pCoord)) { + $obj = apc_fetch($this->cachePrefix . $pCoord . '.cache'); + if ($obj === false) { + // Entry no longer exists in APC, so clear it from the cache array + parent::deleteCacheData($pCoord); + throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in APC cache'); + } + } else { + // Return null if requested entry doesn't exist in cache + return null; + } + + // Set current entry to the requested entry + $this->currentObjectID = $pCoord; + $this->currentObject = unserialize($obj); + // Re-attach this as the cell's parent + $this->currentObject->attach($this); + + // Return requested entry + return $this->currentObject; + } + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + public function getCellList() + { + if ($this->currentObjectID !== null) { + $this->storeData(); + } + + return parent::getCellList(); + } + + /** + * Delete a cell in cache identified by coordinate address + * + * @access public + * @param string $pCoord Coordinate address of the cell to delete + * @throws PHPExcel_Exception + */ + public function deleteCacheData($pCoord) + { + // Delete the entry from APC + apc_delete($this->cachePrefix.$pCoord.'.cache'); + + // Delete the entry from our cell address array + parent::deleteCacheData($pCoord); + } + + /** + * Clone the cell collection + * + * @access public + * @param PHPExcel_Worksheet $parent The new worksheet + * @throws PHPExcel_Exception + * @return void + */ + public function copyCellCollection(PHPExcel_Worksheet $parent) + { + parent::copyCellCollection($parent); + // Get a new id for the new file name + $baseUnique = $this->getUniqueID(); + $newCachePrefix = substr(md5($baseUnique), 0, 8) . '.'; + $cacheList = $this->getCellList(); + foreach ($cacheList as $cellID) { + if ($cellID != $this->currentObjectID) { + $obj = apc_fetch($this->cachePrefix . $cellID . '.cache'); + if ($obj === false) { + // Entry no longer exists in APC, so clear it from the cache array + parent::deleteCacheData($cellID); + throw new PHPExcel_Exception('Cell entry ' . $cellID . ' no longer exists in APC'); + } + if (!apc_store($newCachePrefix . $cellID . '.cache', $obj, $this->cacheTime)) { + $this->__destruct(); + throw new PHPExcel_Exception('Failed to store cell ' . $cellID . ' in APC'); + } + } + } + $this->cachePrefix = $newCachePrefix; + } + + /** + * Clear the cell collection and disconnect from our parent + * + * @return void + */ + public function unsetWorksheetCells() + { + if ($this->currentObject !== null) { + $this->currentObject->detach(); + $this->currentObject = $this->currentObjectID = null; + } + + // Flush the APC cache + $this->__destruct(); + + $this->cellCache = array(); + + // detach ourself from the worksheet, so that it can then delete this object successfully + $this->parent = null; + } + + /** + * Initialise this new cell collection + * + * @param PHPExcel_Worksheet $parent The worksheet for this cell collection + * @param array of mixed $arguments Additional initialisation arguments + */ + public function __construct(PHPExcel_Worksheet $parent, $arguments) + { + $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; + + if ($this->cachePrefix === null) { + $baseUnique = $this->getUniqueID(); + $this->cachePrefix = substr(md5($baseUnique), 0, 8) . '.'; + $this->cacheTime = $cacheTime; + + parent::__construct($parent); + } + } + + /** + * Destroy this cell collection + */ + public function __destruct() + { + $cacheList = $this->getCellList(); + foreach ($cacheList as $cellID) { + apc_delete($this->cachePrefix . $cellID . '.cache'); + } + } + + /** + * Identify whether the caching method is currently available + * Some methods are dependent on the availability of certain extensions being enabled in the PHP build + * + * @return boolean + */ + public static function cacheMethodIsAvailable() + { + if (!function_exists('apc_store')) { + return false; + } + if (apc_sma_info() === false) { + return false; + } + + return true; + } +} diff --git a/extend/PHPExcel/PHPExcel/CachedObjectStorage/CacheBase.php b/extend/PHPExcel/PHPExcel/CachedObjectStorage/CacheBase.php new file mode 100644 index 0000000..9a12ec8 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/CachedObjectStorage/CacheBase.php @@ -0,0 +1,368 @@ +parent = $parent; + } + + /** + * Return the parent worksheet for this cell collection + * + * @return PHPExcel_Worksheet + */ + public function getParent() + { + return $this->parent; + } + + /** + * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? + * + * @param string $pCoord Coordinate address of the cell to check + * @return boolean + */ + public function isDataSet($pCoord) + { + if ($pCoord === $this->currentObjectID) { + return true; + } + // Check if the requested entry exists in the cache + return isset($this->cellCache[$pCoord]); + } + + /** + * Move a cell object from one address to another + * + * @param string $fromAddress Current address of the cell to move + * @param string $toAddress Destination address of the cell to move + * @return boolean + */ + public function moveCell($fromAddress, $toAddress) + { + if ($fromAddress === $this->currentObjectID) { + $this->currentObjectID = $toAddress; + } + $this->currentCellIsDirty = true; + if (isset($this->cellCache[$fromAddress])) { + $this->cellCache[$toAddress] = &$this->cellCache[$fromAddress]; + unset($this->cellCache[$fromAddress]); + } + + return true; + } + + /** + * Add or Update a cell in cache + * + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function updateCacheData(PHPExcel_Cell $cell) + { + return $this->addCacheData($cell->getCoordinate(), $cell); + } + + /** + * Delete a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to delete + * @throws PHPExcel_Exception + */ + public function deleteCacheData($pCoord) + { + if ($pCoord === $this->currentObjectID && !is_null($this->currentObject)) { + $this->currentObject->detach(); + $this->currentObjectID = $this->currentObject = null; + } + + if (is_object($this->cellCache[$pCoord])) { + $this->cellCache[$pCoord]->detach(); + unset($this->cellCache[$pCoord]); + } + $this->currentCellIsDirty = false; + } + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + public function getCellList() + { + return array_keys($this->cellCache); + } + + /** + * Sort the list of all cell addresses currently held in cache by row and column + * + * @return string[] + */ + public function getSortedCellList() + { + $sortKeys = array(); + foreach ($this->getCellList() as $coord) { + sscanf($coord, '%[A-Z]%d', $column, $row); + $sortKeys[sprintf('%09d%3s', $row, $column)] = $coord; + } + ksort($sortKeys); + + return array_values($sortKeys); + } + + /** + * Get highest worksheet column and highest row that have cell records + * + * @return array Highest column name and highest row number + */ + public function getHighestRowAndColumn() + { + // Lookup highest column and highest row + $col = array('A' => '1A'); + $row = array(1); + foreach ($this->getCellList() as $coord) { + sscanf($coord, '%[A-Z]%d', $c, $r); + $row[$r] = $r; + $col[$c] = strlen($c).$c; + } + if (!empty($row)) { + // Determine highest column and row + $highestRow = max($row); + $highestColumn = substr(max($col), 1); + } + + return array( + 'row' => $highestRow, + 'column' => $highestColumn + ); + } + + /** + * Return the cell address of the currently active cell object + * + * @return string + */ + public function getCurrentAddress() + { + return $this->currentObjectID; + } + + /** + * Return the column address of the currently active cell object + * + * @return string + */ + public function getCurrentColumn() + { + sscanf($this->currentObjectID, '%[A-Z]%d', $column, $row); + return $column; + } + + /** + * Return the row address of the currently active cell object + * + * @return integer + */ + public function getCurrentRow() + { + sscanf($this->currentObjectID, '%[A-Z]%d', $column, $row); + return (integer) $row; + } + + /** + * Get highest worksheet column + * + * @param string $row Return the highest column for the specified row, + * or the highest column of any row if no row number is passed + * @return string Highest column name + */ + public function getHighestColumn($row = null) + { + if ($row == null) { + $colRow = $this->getHighestRowAndColumn(); + return $colRow['column']; + } + + $columnList = array(1); + foreach ($this->getCellList() as $coord) { + sscanf($coord, '%[A-Z]%d', $c, $r); + if ($r != $row) { + continue; + } + $columnList[] = PHPExcel_Cell::columnIndexFromString($c); + } + return PHPExcel_Cell::stringFromColumnIndex(max($columnList) - 1); + } + + /** + * Get highest worksheet row + * + * @param string $column Return the highest row for the specified column, + * or the highest row of any column if no column letter is passed + * @return int Highest row number + */ + public function getHighestRow($column = null) + { + if ($column == null) { + $colRow = $this->getHighestRowAndColumn(); + return $colRow['row']; + } + + $rowList = array(0); + foreach ($this->getCellList() as $coord) { + sscanf($coord, '%[A-Z]%d', $c, $r); + if ($c != $column) { + continue; + } + $rowList[] = $r; + } + + return max($rowList); + } + + /** + * Generate a unique ID for cache referencing + * + * @return string Unique Reference + */ + protected function getUniqueID() + { + if (function_exists('posix_getpid')) { + $baseUnique = posix_getpid(); + } else { + $baseUnique = mt_rand(); + } + return uniqid($baseUnique, true); + } + + /** + * Clone the cell collection + * + * @param PHPExcel_Worksheet $parent The new worksheet + * @return void + */ + public function copyCellCollection(PHPExcel_Worksheet $parent) + { + $this->currentCellIsDirty; + $this->storeData(); + + $this->parent = $parent; + if (($this->currentObject !== null) && (is_object($this->currentObject))) { + $this->currentObject->attach($this); + } + } // function copyCellCollection() + + /** + * Remove a row, deleting all cells in that row + * + * @param string $row Row number to remove + * @return void + */ + public function removeRow($row) + { + foreach ($this->getCellList() as $coord) { + sscanf($coord, '%[A-Z]%d', $c, $r); + if ($r == $row) { + $this->deleteCacheData($coord); + } + } + } + + /** + * Remove a column, deleting all cells in that column + * + * @param string $column Column ID to remove + * @return void + */ + public function removeColumn($column) + { + foreach ($this->getCellList() as $coord) { + sscanf($coord, '%[A-Z]%d', $c, $r); + if ($c == $column) { + $this->deleteCacheData($coord); + } + } + } + + /** + * Identify whether the caching method is currently available + * Some methods are dependent on the availability of certain extensions being enabled in the PHP build + * + * @return boolean + */ + public static function cacheMethodIsAvailable() + { + return true; + } +} diff --git a/extend/PHPExcel/PHPExcel/CachedObjectStorage/DiscISAM.php b/extend/PHPExcel/PHPExcel/CachedObjectStorage/DiscISAM.php new file mode 100644 index 0000000..13bc033 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/CachedObjectStorage/DiscISAM.php @@ -0,0 +1,208 @@ +currentCellIsDirty && !empty($this->currentObjectID)) { + $this->currentObject->detach(); + + fseek($this->fileHandle, 0, SEEK_END); + + $this->cellCache[$this->currentObjectID] = array( + 'ptr' => ftell($this->fileHandle), + 'sz' => fwrite($this->fileHandle, serialize($this->currentObject)) + ); + $this->currentCellIsDirty = false; + } + $this->currentObjectID = $this->currentObject = null; + } + + /** + * Add or Update a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to update + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function addCacheData($pCoord, PHPExcel_Cell $cell) + { + if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { + $this->storeData(); + } + + $this->currentObjectID = $pCoord; + $this->currentObject = $cell; + $this->currentCellIsDirty = true; + + return $cell; + } + + /** + * Get cell at a specific coordinate + * + * @param string $pCoord Coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Cell Cell that was found, or null if not found + */ + public function getCacheData($pCoord) + { + if ($pCoord === $this->currentObjectID) { + return $this->currentObject; + } + $this->storeData(); + + // Check if the entry that has been requested actually exists + if (!isset($this->cellCache[$pCoord])) { + // Return null if requested entry doesn't exist in cache + return null; + } + + // Set current entry to the requested entry + $this->currentObjectID = $pCoord; + fseek($this->fileHandle, $this->cellCache[$pCoord]['ptr']); + $this->currentObject = unserialize(fread($this->fileHandle, $this->cellCache[$pCoord]['sz'])); + // Re-attach this as the cell's parent + $this->currentObject->attach($this); + + // Return requested entry + return $this->currentObject; + } + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + public function getCellList() + { + if ($this->currentObjectID !== null) { + $this->storeData(); + } + + return parent::getCellList(); + } + + /** + * Clone the cell collection + * + * @param PHPExcel_Worksheet $parent The new worksheet + */ + public function copyCellCollection(PHPExcel_Worksheet $parent) + { + parent::copyCellCollection($parent); + // Get a new id for the new file name + $baseUnique = $this->getUniqueID(); + $newFileName = $this->cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache'; + // Copy the existing cell cache file + copy($this->fileName, $newFileName); + $this->fileName = $newFileName; + // Open the copied cell cache file + $this->fileHandle = fopen($this->fileName, 'a+'); + } + + /** + * Clear the cell collection and disconnect from our parent + * + */ + public function unsetWorksheetCells() + { + if (!is_null($this->currentObject)) { + $this->currentObject->detach(); + $this->currentObject = $this->currentObjectID = null; + } + $this->cellCache = array(); + + // detach ourself from the worksheet, so that it can then delete this object successfully + $this->parent = null; + + // Close down the temporary cache file + $this->__destruct(); + } + + /** + * Initialise this new cell collection + * + * @param PHPExcel_Worksheet $parent The worksheet for this cell collection + * @param array of mixed $arguments Additional initialisation arguments + */ + public function __construct(PHPExcel_Worksheet $parent, $arguments) + { + $this->cacheDirectory = ((isset($arguments['dir'])) && ($arguments['dir'] !== null)) + ? $arguments['dir'] + : PHPExcel_Shared_File::sys_get_temp_dir(); + + parent::__construct($parent); + if (is_null($this->fileHandle)) { + $baseUnique = $this->getUniqueID(); + $this->fileName = $this->cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache'; + $this->fileHandle = fopen($this->fileName, 'a+'); + } + } + + /** + * Destroy this cell collection + */ + public function __destruct() + { + if (!is_null($this->fileHandle)) { + fclose($this->fileHandle); + unlink($this->fileName); + } + $this->fileHandle = null; + } +} diff --git a/extend/PHPExcel/PHPExcel/CachedObjectStorage/ICache.php b/extend/PHPExcel/PHPExcel/CachedObjectStorage/ICache.php new file mode 100644 index 0000000..aafef6e --- /dev/null +++ b/extend/PHPExcel/PHPExcel/CachedObjectStorage/ICache.php @@ -0,0 +1,103 @@ +currentCellIsDirty && !empty($this->currentObjectID)) { + $this->currentObject->detach(); + + $this->cellCache[$this->currentObjectID] = igbinary_serialize($this->currentObject); + $this->currentCellIsDirty = false; + } + $this->currentObjectID = $this->currentObject = null; + } // function _storeData() + + + /** + * Add or Update a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to update + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function addCacheData($pCoord, PHPExcel_Cell $cell) + { + if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { + $this->storeData(); + } + + $this->currentObjectID = $pCoord; + $this->currentObject = $cell; + $this->currentCellIsDirty = true; + + return $cell; + } // function addCacheData() + + + /** + * Get cell at a specific coordinate + * + * @param string $pCoord Coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Cell Cell that was found, or null if not found + */ + public function getCacheData($pCoord) + { + if ($pCoord === $this->currentObjectID) { + return $this->currentObject; + } + $this->storeData(); + + // Check if the entry that has been requested actually exists + if (!isset($this->cellCache[$pCoord])) { + // Return null if requested entry doesn't exist in cache + return null; + } + + // Set current entry to the requested entry + $this->currentObjectID = $pCoord; + $this->currentObject = igbinary_unserialize($this->cellCache[$pCoord]); + // Re-attach this as the cell's parent + $this->currentObject->attach($this); + + // Return requested entry + return $this->currentObject; + } // function getCacheData() + + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + public function getCellList() + { + if ($this->currentObjectID !== null) { + $this->storeData(); + } + + return parent::getCellList(); + } + + + /** + * Clear the cell collection and disconnect from our parent + * + * @return void + */ + public function unsetWorksheetCells() + { + if (!is_null($this->currentObject)) { + $this->currentObject->detach(); + $this->currentObject = $this->currentObjectID = null; + } + $this->cellCache = array(); + + // detach ourself from the worksheet, so that it can then delete this object successfully + $this->parent = null; + } // function unsetWorksheetCells() + + + /** + * Identify whether the caching method is currently available + * Some methods are dependent on the availability of certain extensions being enabled in the PHP build + * + * @return boolean + */ + public static function cacheMethodIsAvailable() + { + if (!function_exists('igbinary_serialize')) { + return false; + } + + return true; + } +} diff --git a/extend/PHPExcel/PHPExcel/CachedObjectStorage/Memcache.php b/extend/PHPExcel/PHPExcel/CachedObjectStorage/Memcache.php new file mode 100644 index 0000000..07942cc --- /dev/null +++ b/extend/PHPExcel/PHPExcel/CachedObjectStorage/Memcache.php @@ -0,0 +1,308 @@ +currentCellIsDirty && !empty($this->currentObjectID)) { + $this->currentObject->detach(); + + $obj = serialize($this->currentObject); + if (!$this->memcache->replace($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) { + if (!$this->memcache->add($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) { + $this->__destruct(); + throw new PHPExcel_Exception("Failed to store cell {$this->currentObjectID} in MemCache"); + } + } + $this->currentCellIsDirty = false; + } + $this->currentObjectID = $this->currentObject = null; + } // function _storeData() + + + /** + * Add or Update a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to update + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function addCacheData($pCoord, PHPExcel_Cell $cell) + { + if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { + $this->storeData(); + } + $this->cellCache[$pCoord] = true; + + $this->currentObjectID = $pCoord; + $this->currentObject = $cell; + $this->currentCellIsDirty = true; + + return $cell; + } // function addCacheData() + + + /** + * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? + * + * @param string $pCoord Coordinate address of the cell to check + * @return boolean + * @return boolean + */ + public function isDataSet($pCoord) + { + // Check if the requested entry is the current object, or exists in the cache + if (parent::isDataSet($pCoord)) { + if ($this->currentObjectID == $pCoord) { + return true; + } + // Check if the requested entry still exists in Memcache + $success = $this->memcache->get($this->cachePrefix.$pCoord.'.cache'); + if ($success === false) { + // Entry no longer exists in Memcache, so clear it from the cache array + parent::deleteCacheData($pCoord); + throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in MemCache'); + } + return true; + } + return false; + } + + + /** + * Get cell at a specific coordinate + * + * @param string $pCoord Coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Cell Cell that was found, or null if not found + */ + public function getCacheData($pCoord) + { + if ($pCoord === $this->currentObjectID) { + return $this->currentObject; + } + $this->storeData(); + + // Check if the entry that has been requested actually exists + if (parent::isDataSet($pCoord)) { + $obj = $this->memcache->get($this->cachePrefix . $pCoord . '.cache'); + if ($obj === false) { + // Entry no longer exists in Memcache, so clear it from the cache array + parent::deleteCacheData($pCoord); + throw new PHPExcel_Exception("Cell entry {$pCoord} no longer exists in MemCache"); + } + } else { + // Return null if requested entry doesn't exist in cache + return null; + } + + // Set current entry to the requested entry + $this->currentObjectID = $pCoord; + $this->currentObject = unserialize($obj); + // Re-attach this as the cell's parent + $this->currentObject->attach($this); + + // Return requested entry + return $this->currentObject; + } + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + public function getCellList() + { + if ($this->currentObjectID !== null) { + $this->storeData(); + } + + return parent::getCellList(); + } + + /** + * Delete a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to delete + * @throws PHPExcel_Exception + */ + public function deleteCacheData($pCoord) + { + // Delete the entry from Memcache + $this->memcache->delete($this->cachePrefix . $pCoord . '.cache'); + + // Delete the entry from our cell address array + parent::deleteCacheData($pCoord); + } + + /** + * Clone the cell collection + * + * @param PHPExcel_Worksheet $parent The new worksheet + * @return void + */ + public function copyCellCollection(PHPExcel_Worksheet $parent) + { + parent::copyCellCollection($parent); + // Get a new id for the new file name + $baseUnique = $this->getUniqueID(); + $newCachePrefix = substr(md5($baseUnique), 0, 8) . '.'; + $cacheList = $this->getCellList(); + foreach ($cacheList as $cellID) { + if ($cellID != $this->currentObjectID) { + $obj = $this->memcache->get($this->cachePrefix.$cellID.'.cache'); + if ($obj === false) { + // Entry no longer exists in Memcache, so clear it from the cache array + parent::deleteCacheData($cellID); + throw new PHPExcel_Exception("Cell entry {$cellID} no longer exists in MemCache"); + } + if (!$this->memcache->add($newCachePrefix . $cellID . '.cache', $obj, null, $this->cacheTime)) { + $this->__destruct(); + throw new PHPExcel_Exception("Failed to store cell {$cellID} in MemCache"); + } + } + } + $this->cachePrefix = $newCachePrefix; + } + + /** + * Clear the cell collection and disconnect from our parent + * + * @return void + */ + public function unsetWorksheetCells() + { + if (!is_null($this->currentObject)) { + $this->currentObject->detach(); + $this->currentObject = $this->currentObjectID = null; + } + + // Flush the Memcache cache + $this->__destruct(); + + $this->cellCache = array(); + + // detach ourself from the worksheet, so that it can then delete this object successfully + $this->parent = null; + } + + /** + * Initialise this new cell collection + * + * @param PHPExcel_Worksheet $parent The worksheet for this cell collection + * @param array of mixed $arguments Additional initialisation arguments + */ + public function __construct(PHPExcel_Worksheet $parent, $arguments) + { + $memcacheServer = (isset($arguments['memcacheServer'])) ? $arguments['memcacheServer'] : 'localhost'; + $memcachePort = (isset($arguments['memcachePort'])) ? $arguments['memcachePort'] : 11211; + $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; + + if (is_null($this->cachePrefix)) { + $baseUnique = $this->getUniqueID(); + $this->cachePrefix = substr(md5($baseUnique), 0, 8) . '.'; + + // Set a new Memcache object and connect to the Memcache server + $this->memcache = new Memcache(); + if (!$this->memcache->addServer($memcacheServer, $memcachePort, false, 50, 5, 5, true, array($this, 'failureCallback'))) { + throw new PHPExcel_Exception("Could not connect to MemCache server at {$memcacheServer}:{$memcachePort}"); + } + $this->cacheTime = $cacheTime; + + parent::__construct($parent); + } + } + + /** + * Memcache error handler + * + * @param string $host Memcache server + * @param integer $port Memcache port + * @throws PHPExcel_Exception + */ + public function failureCallback($host, $port) + { + throw new PHPExcel_Exception("memcache {$host}:{$port} failed"); + } + + /** + * Destroy this cell collection + */ + public function __destruct() + { + $cacheList = $this->getCellList(); + foreach ($cacheList as $cellID) { + $this->memcache->delete($this->cachePrefix.$cellID . '.cache'); + } + } + + /** + * Identify whether the caching method is currently available + * Some methods are dependent on the availability of certain extensions being enabled in the PHP build + * + * @return boolean + */ + public static function cacheMethodIsAvailable() + { + if (!function_exists('memcache_add')) { + return false; + } + + return true; + } +} diff --git a/extend/PHPExcel/PHPExcel/CachedObjectStorage/Memory.php b/extend/PHPExcel/PHPExcel/CachedObjectStorage/Memory.php new file mode 100644 index 0000000..0e2ea0b --- /dev/null +++ b/extend/PHPExcel/PHPExcel/CachedObjectStorage/Memory.php @@ -0,0 +1,118 @@ +cellCache[$pCoord] = $cell; + + // Set current entry to the new/updated entry + $this->currentObjectID = $pCoord; + + return $cell; + } + + + /** + * Get cell at a specific coordinate + * + * @param string $pCoord Coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Cell Cell that was found, or null if not found + */ + public function getCacheData($pCoord) + { + // Check if the entry that has been requested actually exists + if (!isset($this->cellCache[$pCoord])) { + $this->currentObjectID = null; + // Return null if requested entry doesn't exist in cache + return null; + } + + // Set current entry to the requested entry + $this->currentObjectID = $pCoord; + + // Return requested entry + return $this->cellCache[$pCoord]; + } + + + /** + * Clone the cell collection + * + * @param PHPExcel_Worksheet $parent The new worksheet + */ + public function copyCellCollection(PHPExcel_Worksheet $parent) + { + parent::copyCellCollection($parent); + + $newCollection = array(); + foreach ($this->cellCache as $k => &$cell) { + $newCollection[$k] = clone $cell; + $newCollection[$k]->attach($this); + } + + $this->cellCache = $newCollection; + } + + /** + * Clear the cell collection and disconnect from our parent + * + */ + public function unsetWorksheetCells() + { + // Because cells are all stored as intact objects in memory, we need to detach each one from the parent + foreach ($this->cellCache as $k => &$cell) { + $cell->detach(); + $this->cellCache[$k] = null; + } + unset($cell); + + $this->cellCache = array(); + + // detach ourself from the worksheet, so that it can then delete this object successfully + $this->parent = null; + } +} diff --git a/extend/PHPExcel/PHPExcel/CachedObjectStorage/MemoryGZip.php b/extend/PHPExcel/PHPExcel/CachedObjectStorage/MemoryGZip.php new file mode 100644 index 0000000..c06ec71 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/CachedObjectStorage/MemoryGZip.php @@ -0,0 +1,133 @@ +currentCellIsDirty && !empty($this->currentObjectID)) { + $this->currentObject->detach(); + + $this->cellCache[$this->currentObjectID] = gzdeflate(serialize($this->currentObject)); + $this->currentCellIsDirty = false; + } + $this->currentObjectID = $this->currentObject = null; + } + + + /** + * Add or Update a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to update + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function addCacheData($pCoord, PHPExcel_Cell $cell) + { + if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { + $this->storeData(); + } + + $this->currentObjectID = $pCoord; + $this->currentObject = $cell; + $this->currentCellIsDirty = true; + + return $cell; + } + + + /** + * Get cell at a specific coordinate + * + * @param string $pCoord Coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Cell Cell that was found, or null if not found + */ + public function getCacheData($pCoord) + { + if ($pCoord === $this->currentObjectID) { + return $this->currentObject; + } + $this->storeData(); + + // Check if the entry that has been requested actually exists + if (!isset($this->cellCache[$pCoord])) { + // Return null if requested entry doesn't exist in cache + return null; + } + + // Set current entry to the requested entry + $this->currentObjectID = $pCoord; + $this->currentObject = unserialize(gzinflate($this->cellCache[$pCoord])); + // Re-attach this as the cell's parent + $this->currentObject->attach($this); + + // Return requested entry + return $this->currentObject; + } + + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + public function getCellList() + { + if ($this->currentObjectID !== null) { + $this->storeData(); + } + + return parent::getCellList(); + } + + + /** + * Clear the cell collection and disconnect from our parent + * + * @return void + */ + public function unsetWorksheetCells() + { + if (!is_null($this->currentObject)) { + $this->currentObject->detach(); + $this->currentObject = $this->currentObjectID = null; + } + $this->cellCache = array(); + + // detach ourself from the worksheet, so that it can then delete this object successfully + $this->parent = null; + } +} diff --git a/extend/PHPExcel/PHPExcel/CachedObjectStorage/MemorySerialized.php b/extend/PHPExcel/PHPExcel/CachedObjectStorage/MemorySerialized.php new file mode 100644 index 0000000..1332514 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/CachedObjectStorage/MemorySerialized.php @@ -0,0 +1,129 @@ +currentCellIsDirty && !empty($this->currentObjectID)) { + $this->currentObject->detach(); + + $this->cellCache[$this->currentObjectID] = serialize($this->currentObject); + $this->currentCellIsDirty = false; + } + $this->currentObjectID = $this->currentObject = null; + } + + /** + * Add or Update a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to update + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function addCacheData($pCoord, PHPExcel_Cell $cell) + { + if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { + $this->storeData(); + } + + $this->currentObjectID = $pCoord; + $this->currentObject = $cell; + $this->currentCellIsDirty = true; + + return $cell; + } + + /** + * Get cell at a specific coordinate + * + * @param string $pCoord Coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Cell Cell that was found, or null if not found + */ + public function getCacheData($pCoord) + { + if ($pCoord === $this->currentObjectID) { + return $this->currentObject; + } + $this->storeData(); + + // Check if the entry that has been requested actually exists + if (!isset($this->cellCache[$pCoord])) { + // Return null if requested entry doesn't exist in cache + return null; + } + + // Set current entry to the requested entry + $this->currentObjectID = $pCoord; + $this->currentObject = unserialize($this->cellCache[$pCoord]); + // Re-attach this as the cell's parent + $this->currentObject->attach($this); + + // Return requested entry + return $this->currentObject; + } + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + public function getCellList() + { + if ($this->currentObjectID !== null) { + $this->storeData(); + } + + return parent::getCellList(); + } + + /** + * Clear the cell collection and disconnect from our parent + * + * @return void + */ + public function unsetWorksheetCells() + { + if (!is_null($this->currentObject)) { + $this->currentObject->detach(); + $this->currentObject = $this->currentObjectID = null; + } + $this->cellCache = array(); + + // detach ourself from the worksheet, so that it can then delete this object successfully + $this->parent = null; + } +} diff --git a/extend/PHPExcel/PHPExcel/CachedObjectStorage/PHPTemp.php b/extend/PHPExcel/PHPExcel/CachedObjectStorage/PHPTemp.php new file mode 100644 index 0000000..43c7819 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/CachedObjectStorage/PHPTemp.php @@ -0,0 +1,200 @@ +currentCellIsDirty && !empty($this->currentObjectID)) { + $this->currentObject->detach(); + + fseek($this->fileHandle, 0, SEEK_END); + + $this->cellCache[$this->currentObjectID] = array( + 'ptr' => ftell($this->fileHandle), + 'sz' => fwrite($this->fileHandle, serialize($this->currentObject)) + ); + $this->currentCellIsDirty = false; + } + $this->currentObjectID = $this->currentObject = null; + } + + + /** + * Add or Update a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to update + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function addCacheData($pCoord, PHPExcel_Cell $cell) + { + if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { + $this->storeData(); + } + + $this->currentObjectID = $pCoord; + $this->currentObject = $cell; + $this->currentCellIsDirty = true; + + return $cell; + } + + + /** + * Get cell at a specific coordinate + * + * @param string $pCoord Coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Cell Cell that was found, or null if not found + */ + public function getCacheData($pCoord) + { + if ($pCoord === $this->currentObjectID) { + return $this->currentObject; + } + $this->storeData(); + + // Check if the entry that has been requested actually exists + if (!isset($this->cellCache[$pCoord])) { + // Return null if requested entry doesn't exist in cache + return null; + } + + // Set current entry to the requested entry + $this->currentObjectID = $pCoord; + fseek($this->fileHandle, $this->cellCache[$pCoord]['ptr']); + $this->currentObject = unserialize(fread($this->fileHandle, $this->cellCache[$pCoord]['sz'])); + // Re-attach this as the cell's parent + $this->currentObject->attach($this); + + // Return requested entry + return $this->currentObject; + } + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + public function getCellList() + { + if ($this->currentObjectID !== null) { + $this->storeData(); + } + + return parent::getCellList(); + } + + /** + * Clone the cell collection + * + * @param PHPExcel_Worksheet $parent The new worksheet + * @return void + */ + public function copyCellCollection(PHPExcel_Worksheet $parent) + { + parent::copyCellCollection($parent); + // Open a new stream for the cell cache data + $newFileHandle = fopen('php://temp/maxmemory:' . $this->memoryCacheSize, 'a+'); + // Copy the existing cell cache data to the new stream + fseek($this->fileHandle, 0); + while (!feof($this->fileHandle)) { + fwrite($newFileHandle, fread($this->fileHandle, 1024)); + } + $this->fileHandle = $newFileHandle; + } + + /** + * Clear the cell collection and disconnect from our parent + * + * @return void + */ + public function unsetWorksheetCells() + { + if (!is_null($this->currentObject)) { + $this->currentObject->detach(); + $this->currentObject = $this->currentObjectID = null; + } + $this->cellCache = array(); + + // detach ourself from the worksheet, so that it can then delete this object successfully + $this->parent = null; + + // Close down the php://temp file + $this->__destruct(); + } + + /** + * Initialise this new cell collection + * + * @param PHPExcel_Worksheet $parent The worksheet for this cell collection + * @param array of mixed $arguments Additional initialisation arguments + */ + public function __construct(PHPExcel_Worksheet $parent, $arguments) + { + $this->memoryCacheSize = (isset($arguments['memoryCacheSize'])) ? $arguments['memoryCacheSize'] : '1MB'; + + parent::__construct($parent); + if (is_null($this->fileHandle)) { + $this->fileHandle = fopen('php://temp/maxmemory:' . $this->memoryCacheSize, 'a+'); + } + } + + /** + * Destroy this cell collection + */ + public function __destruct() + { + if (!is_null($this->fileHandle)) { + fclose($this->fileHandle); + } + $this->fileHandle = null; + } +} diff --git a/extend/PHPExcel/PHPExcel/CachedObjectStorage/SQLite.php b/extend/PHPExcel/PHPExcel/CachedObjectStorage/SQLite.php new file mode 100644 index 0000000..e7b50c5 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/CachedObjectStorage/SQLite.php @@ -0,0 +1,307 @@ +currentCellIsDirty && !empty($this->currentObjectID)) { + $this->currentObject->detach(); + + if (!$this->DBHandle->queryExec("INSERT OR REPLACE INTO kvp_".$this->TableName." VALUES('".$this->currentObjectID."','".sqlite_escape_string(serialize($this->currentObject))."')")) { + throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError())); + } + $this->currentCellIsDirty = false; + } + $this->currentObjectID = $this->currentObject = null; + } + + /** + * Add or Update a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to update + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function addCacheData($pCoord, PHPExcel_Cell $cell) + { + if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { + $this->storeData(); + } + + $this->currentObjectID = $pCoord; + $this->currentObject = $cell; + $this->currentCellIsDirty = true; + + return $cell; + } + + /** + * Get cell at a specific coordinate + * + * @param string $pCoord Coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Cell Cell that was found, or null if not found + */ + public function getCacheData($pCoord) + { + if ($pCoord === $this->currentObjectID) { + return $this->currentObject; + } + $this->storeData(); + + $query = "SELECT value FROM kvp_".$this->TableName." WHERE id='".$pCoord."'"; + $cellResultSet = $this->DBHandle->query($query, SQLITE_ASSOC); + if ($cellResultSet === false) { + throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError())); + } elseif ($cellResultSet->numRows() == 0) { + // Return null if requested entry doesn't exist in cache + return null; + } + + // Set current entry to the requested entry + $this->currentObjectID = $pCoord; + + $cellResult = $cellResultSet->fetchSingle(); + $this->currentObject = unserialize($cellResult); + // Re-attach this as the cell's parent + $this->currentObject->attach($this); + + // Return requested entry + return $this->currentObject; + } + + /** + * Is a value set for an indexed cell? + * + * @param string $pCoord Coordinate address of the cell to check + * @return boolean + */ + public function isDataSet($pCoord) + { + if ($pCoord === $this->currentObjectID) { + return true; + } + + // Check if the requested entry exists in the cache + $query = "SELECT id FROM kvp_".$this->TableName." WHERE id='".$pCoord."'"; + $cellResultSet = $this->DBHandle->query($query, SQLITE_ASSOC); + if ($cellResultSet === false) { + throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError())); + } elseif ($cellResultSet->numRows() == 0) { + // Return null if requested entry doesn't exist in cache + return false; + } + return true; + } + + /** + * Delete a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to delete + * @throws PHPExcel_Exception + */ + public function deleteCacheData($pCoord) + { + if ($pCoord === $this->currentObjectID) { + $this->currentObject->detach(); + $this->currentObjectID = $this->currentObject = null; + } + + // Check if the requested entry exists in the cache + $query = "DELETE FROM kvp_".$this->TableName." WHERE id='".$pCoord."'"; + if (!$this->DBHandle->queryExec($query)) { + throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError())); + } + + $this->currentCellIsDirty = false; + } + + /** + * Move a cell object from one address to another + * + * @param string $fromAddress Current address of the cell to move + * @param string $toAddress Destination address of the cell to move + * @return boolean + */ + public function moveCell($fromAddress, $toAddress) + { + if ($fromAddress === $this->currentObjectID) { + $this->currentObjectID = $toAddress; + } + + $query = "DELETE FROM kvp_".$this->TableName." WHERE id='".$toAddress."'"; + $result = $this->DBHandle->exec($query); + if ($result === false) { + throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg()); + } + + $query = "UPDATE kvp_".$this->TableName." SET id='".$toAddress."' WHERE id='".$fromAddress."'"; + $result = $this->DBHandle->exec($query); + if ($result === false) { + throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg()); + } + + return true; + } + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + public function getCellList() + { + if ($this->currentObjectID !== null) { + $this->storeData(); + } + + $query = "SELECT id FROM kvp_".$this->TableName; + $cellIdsResult = $this->DBHandle->unbufferedQuery($query, SQLITE_ASSOC); + if ($cellIdsResult === false) { + throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError())); + } + + $cellKeys = array(); + foreach ($cellIdsResult as $row) { + $cellKeys[] = $row['id']; + } + + return $cellKeys; + } + + /** + * Clone the cell collection + * + * @param PHPExcel_Worksheet $parent The new worksheet + * @return void + */ + public function copyCellCollection(PHPExcel_Worksheet $parent) + { + $this->currentCellIsDirty; + $this->storeData(); + + // Get a new id for the new table name + $tableName = str_replace('.', '_', $this->getUniqueID()); + if (!$this->DBHandle->queryExec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB) + AS SELECT * FROM kvp_'.$this->TableName) + ) { + throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError())); + } + + // Copy the existing cell cache file + $this->TableName = $tableName; + } + + /** + * Clear the cell collection and disconnect from our parent + * + * @return void + */ + public function unsetWorksheetCells() + { + if (!is_null($this->currentObject)) { + $this->currentObject->detach(); + $this->currentObject = $this->currentObjectID = null; + } + // detach ourself from the worksheet, so that it can then delete this object successfully + $this->parent = null; + + // Close down the temporary cache file + $this->__destruct(); + } + + /** + * Initialise this new cell collection + * + * @param PHPExcel_Worksheet $parent The worksheet for this cell collection + */ + public function __construct(PHPExcel_Worksheet $parent) + { + parent::__construct($parent); + if (is_null($this->DBHandle)) { + $this->TableName = str_replace('.', '_', $this->getUniqueID()); + $_DBName = ':memory:'; + + $this->DBHandle = new SQLiteDatabase($_DBName); + if ($this->DBHandle === false) { + throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError())); + } + if (!$this->DBHandle->queryExec('CREATE TABLE kvp_'.$this->TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) { + throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError())); + } + } + } + + /** + * Destroy this cell collection + */ + public function __destruct() + { + if (!is_null($this->DBHandle)) { + $this->DBHandle->queryExec('DROP TABLE kvp_'.$this->TableName); + } + $this->DBHandle = null; + } + + /** + * Identify whether the caching method is currently available + * Some methods are dependent on the availability of certain extensions being enabled in the PHP build + * + * @return boolean + */ + public static function cacheMethodIsAvailable() + { + if (!function_exists('sqlite_open')) { + return false; + } + + return true; + } +} diff --git a/extend/PHPExcel/PHPExcel/CachedObjectStorage/SQLite3.php b/extend/PHPExcel/PHPExcel/CachedObjectStorage/SQLite3.php new file mode 100644 index 0000000..27473d6 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/CachedObjectStorage/SQLite3.php @@ -0,0 +1,346 @@ +currentCellIsDirty && !empty($this->currentObjectID)) { + $this->currentObject->detach(); + + $this->insertQuery->bindValue('id', $this->currentObjectID, SQLITE3_TEXT); + $this->insertQuery->bindValue('data', serialize($this->currentObject), SQLITE3_BLOB); + $result = $this->insertQuery->execute(); + if ($result === false) { + throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg()); + } + $this->currentCellIsDirty = false; + } + $this->currentObjectID = $this->currentObject = null; + } + + /** + * Add or Update a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to update + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function addCacheData($pCoord, PHPExcel_Cell $cell) + { + if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { + $this->storeData(); + } + + $this->currentObjectID = $pCoord; + $this->currentObject = $cell; + $this->currentCellIsDirty = true; + + return $cell; + } + + /** + * Get cell at a specific coordinate + * + * @param string $pCoord Coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Cell Cell that was found, or null if not found + */ + public function getCacheData($pCoord) + { + if ($pCoord === $this->currentObjectID) { + return $this->currentObject; + } + $this->storeData(); + + $this->selectQuery->bindValue('id', $pCoord, SQLITE3_TEXT); + $cellResult = $this->selectQuery->execute(); + if ($cellResult === false) { + throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg()); + } + $cellData = $cellResult->fetchArray(SQLITE3_ASSOC); + if ($cellData === false) { + // Return null if requested entry doesn't exist in cache + return null; + } + + // Set current entry to the requested entry + $this->currentObjectID = $pCoord; + + $this->currentObject = unserialize($cellData['value']); + // Re-attach this as the cell's parent + $this->currentObject->attach($this); + + // Return requested entry + return $this->currentObject; + } + + /** + * Is a value set for an indexed cell? + * + * @param string $pCoord Coordinate address of the cell to check + * @return boolean + */ + public function isDataSet($pCoord) + { + if ($pCoord === $this->currentObjectID) { + return true; + } + + // Check if the requested entry exists in the cache + $this->selectQuery->bindValue('id', $pCoord, SQLITE3_TEXT); + $cellResult = $this->selectQuery->execute(); + if ($cellResult === false) { + throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg()); + } + $cellData = $cellResult->fetchArray(SQLITE3_ASSOC); + + return ($cellData === false) ? false : true; + } + + /** + * Delete a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to delete + * @throws PHPExcel_Exception + */ + public function deleteCacheData($pCoord) + { + if ($pCoord === $this->currentObjectID) { + $this->currentObject->detach(); + $this->currentObjectID = $this->currentObject = null; + } + + // Check if the requested entry exists in the cache + $this->deleteQuery->bindValue('id', $pCoord, SQLITE3_TEXT); + $result = $this->deleteQuery->execute(); + if ($result === false) { + throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg()); + } + + $this->currentCellIsDirty = false; + } + + /** + * Move a cell object from one address to another + * + * @param string $fromAddress Current address of the cell to move + * @param string $toAddress Destination address of the cell to move + * @return boolean + */ + public function moveCell($fromAddress, $toAddress) + { + if ($fromAddress === $this->currentObjectID) { + $this->currentObjectID = $toAddress; + } + + $this->deleteQuery->bindValue('id', $toAddress, SQLITE3_TEXT); + $result = $this->deleteQuery->execute(); + if ($result === false) { + throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg()); + } + + $this->updateQuery->bindValue('toid', $toAddress, SQLITE3_TEXT); + $this->updateQuery->bindValue('fromid', $fromAddress, SQLITE3_TEXT); + $result = $this->updateQuery->execute(); + if ($result === false) { + throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg()); + } + + return true; + } + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + public function getCellList() + { + if ($this->currentObjectID !== null) { + $this->storeData(); + } + + $query = "SELECT id FROM kvp_".$this->TableName; + $cellIdsResult = $this->DBHandle->query($query); + if ($cellIdsResult === false) { + throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg()); + } + + $cellKeys = array(); + while ($row = $cellIdsResult->fetchArray(SQLITE3_ASSOC)) { + $cellKeys[] = $row['id']; + } + + return $cellKeys; + } + + /** + * Clone the cell collection + * + * @param PHPExcel_Worksheet $parent The new worksheet + * @return void + */ + public function copyCellCollection(PHPExcel_Worksheet $parent) + { + $this->currentCellIsDirty; + $this->storeData(); + + // Get a new id for the new table name + $tableName = str_replace('.', '_', $this->getUniqueID()); + if (!$this->DBHandle->exec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB) + AS SELECT * FROM kvp_'.$this->TableName) + ) { + throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg()); + } + + // Copy the existing cell cache file + $this->TableName = $tableName; + } + + /** + * Clear the cell collection and disconnect from our parent + * + * @return void + */ + public function unsetWorksheetCells() + { + if (!is_null($this->currentObject)) { + $this->currentObject->detach(); + $this->currentObject = $this->currentObjectID = null; + } + // detach ourself from the worksheet, so that it can then delete this object successfully + $this->parent = null; + + // Close down the temporary cache file + $this->__destruct(); + } + + /** + * Initialise this new cell collection + * + * @param PHPExcel_Worksheet $parent The worksheet for this cell collection + */ + public function __construct(PHPExcel_Worksheet $parent) + { + parent::__construct($parent); + if (is_null($this->DBHandle)) { + $this->TableName = str_replace('.', '_', $this->getUniqueID()); + $_DBName = ':memory:'; + + $this->DBHandle = new SQLite3($_DBName); + if ($this->DBHandle === false) { + throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg()); + } + if (!$this->DBHandle->exec('CREATE TABLE kvp_'.$this->TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) { + throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg()); + } + } + + $this->selectQuery = $this->DBHandle->prepare("SELECT value FROM kvp_".$this->TableName." WHERE id = :id"); + $this->insertQuery = $this->DBHandle->prepare("INSERT OR REPLACE INTO kvp_".$this->TableName." VALUES(:id,:data)"); + $this->updateQuery = $this->DBHandle->prepare("UPDATE kvp_".$this->TableName." SET id=:toId WHERE id=:fromId"); + $this->deleteQuery = $this->DBHandle->prepare("DELETE FROM kvp_".$this->TableName." WHERE id = :id"); + } + + /** + * Destroy this cell collection + */ + public function __destruct() + { + if (!is_null($this->DBHandle)) { + $this->DBHandle->exec('DROP TABLE kvp_'.$this->TableName); + $this->DBHandle->close(); + } + $this->DBHandle = null; + } + + /** + * Identify whether the caching method is currently available + * Some methods are dependent on the availability of certain extensions being enabled in the PHP build + * + * @return boolean + */ + public static function cacheMethodIsAvailable() + { + if (!class_exists('SQLite3', false)) { + return false; + } + + return true; + } +} diff --git a/extend/PHPExcel/PHPExcel/CachedObjectStorage/Wincache.php b/extend/PHPExcel/PHPExcel/CachedObjectStorage/Wincache.php new file mode 100644 index 0000000..1567874 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/CachedObjectStorage/Wincache.php @@ -0,0 +1,289 @@ +currentCellIsDirty && !empty($this->currentObjectID)) { + $this->currentObject->detach(); + + $obj = serialize($this->currentObject); + if (wincache_ucache_exists($this->cachePrefix.$this->currentObjectID.'.cache')) { + if (!wincache_ucache_set($this->cachePrefix.$this->currentObjectID.'.cache', $obj, $this->cacheTime)) { + $this->__destruct(); + throw new PHPExcel_Exception('Failed to store cell '.$this->currentObjectID.' in WinCache'); + } + } else { + if (!wincache_ucache_add($this->cachePrefix.$this->currentObjectID.'.cache', $obj, $this->cacheTime)) { + $this->__destruct(); + throw new PHPExcel_Exception('Failed to store cell '.$this->currentObjectID.' in WinCache'); + } + } + $this->currentCellIsDirty = false; + } + + $this->currentObjectID = $this->currentObject = null; + } + + /** + * Add or Update a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to update + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function addCacheData($pCoord, PHPExcel_Cell $cell) + { + if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { + $this->storeData(); + } + $this->cellCache[$pCoord] = true; + + $this->currentObjectID = $pCoord; + $this->currentObject = $cell; + $this->currentCellIsDirty = true; + + return $cell; + } + + /** + * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? + * + * @param string $pCoord Coordinate address of the cell to check + * @return boolean + */ + public function isDataSet($pCoord) + { + // Check if the requested entry is the current object, or exists in the cache + if (parent::isDataSet($pCoord)) { + if ($this->currentObjectID == $pCoord) { + return true; + } + // Check if the requested entry still exists in cache + $success = wincache_ucache_exists($this->cachePrefix.$pCoord.'.cache'); + if ($success === false) { + // Entry no longer exists in Wincache, so clear it from the cache array + parent::deleteCacheData($pCoord); + throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in WinCache'); + } + return true; + } + return false; + } + + + /** + * Get cell at a specific coordinate + * + * @param string $pCoord Coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Cell Cell that was found, or null if not found + */ + public function getCacheData($pCoord) + { + if ($pCoord === $this->currentObjectID) { + return $this->currentObject; + } + $this->storeData(); + + // Check if the entry that has been requested actually exists + $obj = null; + if (parent::isDataSet($pCoord)) { + $success = false; + $obj = wincache_ucache_get($this->cachePrefix.$pCoord.'.cache', $success); + if ($success === false) { + // Entry no longer exists in WinCache, so clear it from the cache array + parent::deleteCacheData($pCoord); + throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in WinCache'); + } + } else { + // Return null if requested entry doesn't exist in cache + return null; + } + + // Set current entry to the requested entry + $this->currentObjectID = $pCoord; + $this->currentObject = unserialize($obj); + // Re-attach this as the cell's parent + $this->currentObject->attach($this); + + // Return requested entry + return $this->currentObject; + } + + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + public function getCellList() + { + if ($this->currentObjectID !== null) { + $this->storeData(); + } + + return parent::getCellList(); + } + + /** + * Delete a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to delete + * @throws PHPExcel_Exception + */ + public function deleteCacheData($pCoord) + { + // Delete the entry from Wincache + wincache_ucache_delete($this->cachePrefix.$pCoord.'.cache'); + + // Delete the entry from our cell address array + parent::deleteCacheData($pCoord); + } + + /** + * Clone the cell collection + * + * @param PHPExcel_Worksheet $parent The new worksheet + * @return void + */ + public function copyCellCollection(PHPExcel_Worksheet $parent) + { + parent::copyCellCollection($parent); + // Get a new id for the new file name + $baseUnique = $this->getUniqueID(); + $newCachePrefix = substr(md5($baseUnique), 0, 8) . '.'; + $cacheList = $this->getCellList(); + foreach ($cacheList as $cellID) { + if ($cellID != $this->currentObjectID) { + $success = false; + $obj = wincache_ucache_get($this->cachePrefix.$cellID.'.cache', $success); + if ($success === false) { + // Entry no longer exists in WinCache, so clear it from the cache array + parent::deleteCacheData($cellID); + throw new PHPExcel_Exception('Cell entry '.$cellID.' no longer exists in Wincache'); + } + if (!wincache_ucache_add($newCachePrefix.$cellID.'.cache', $obj, $this->cacheTime)) { + $this->__destruct(); + throw new PHPExcel_Exception('Failed to store cell '.$cellID.' in Wincache'); + } + } + } + $this->cachePrefix = $newCachePrefix; + } + + + /** + * Clear the cell collection and disconnect from our parent + * + * @return void + */ + public function unsetWorksheetCells() + { + if (!is_null($this->currentObject)) { + $this->currentObject->detach(); + $this->currentObject = $this->currentObjectID = null; + } + + // Flush the WinCache cache + $this->__destruct(); + + $this->cellCache = array(); + + // detach ourself from the worksheet, so that it can then delete this object successfully + $this->parent = null; + } + + /** + * Initialise this new cell collection + * + * @param PHPExcel_Worksheet $parent The worksheet for this cell collection + * @param array of mixed $arguments Additional initialisation arguments + */ + public function __construct(PHPExcel_Worksheet $parent, $arguments) + { + $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; + + if (is_null($this->cachePrefix)) { + $baseUnique = $this->getUniqueID(); + $this->cachePrefix = substr(md5($baseUnique), 0, 8).'.'; + $this->cacheTime = $cacheTime; + + parent::__construct($parent); + } + } + + /** + * Destroy this cell collection + */ + public function __destruct() + { + $cacheList = $this->getCellList(); + foreach ($cacheList as $cellID) { + wincache_ucache_delete($this->cachePrefix.$cellID.'.cache'); + } + } + + /** + * Identify whether the caching method is currently available + * Some methods are dependent on the availability of certain extensions being enabled in the PHP build + * + * @return boolean + */ + public static function cacheMethodIsAvailable() + { + if (!function_exists('wincache_ucache_add')) { + return false; + } + + return true; + } +} diff --git a/extend/PHPExcel/PHPExcel/CachedObjectStorageFactory.php b/extend/PHPExcel/PHPExcel/CachedObjectStorageFactory.php new file mode 100644 index 0000000..0a96978 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/CachedObjectStorageFactory.php @@ -0,0 +1,231 @@ + array( + ), + self::cache_in_memory_gzip => array( + ), + self::cache_in_memory_serialized => array( + ), + self::cache_igbinary => array( + ), + self::cache_to_phpTemp => array( 'memoryCacheSize' => '1MB' + ), + self::cache_to_discISAM => array( 'dir' => null + ), + self::cache_to_apc => array( 'cacheTime' => 600 + ), + self::cache_to_memcache => array( 'memcacheServer' => 'localhost', + 'memcachePort' => 11211, + 'cacheTime' => 600 + ), + self::cache_to_wincache => array( 'cacheTime' => 600 + ), + self::cache_to_sqlite => array( + ), + self::cache_to_sqlite3 => array( + ), + ); + + /** + * Arguments for the active cache storage method + * + * @var array of mixed array + */ + private static $storageMethodParameters = array(); + + /** + * Return the current cache storage method + * + * @return string|null + **/ + public static function getCacheStorageMethod() + { + return self::$cacheStorageMethod; + } + + /** + * Return the current cache storage class + * + * @return PHPExcel_CachedObjectStorage_ICache|null + **/ + public static function getCacheStorageClass() + { + return self::$cacheStorageClass; + } + + /** + * Return the list of all possible cache storage methods + * + * @return string[] + **/ + public static function getAllCacheStorageMethods() + { + return self::$storageMethods; + } + + /** + * Return the list of all available cache storage methods + * + * @return string[] + **/ + public static function getCacheStorageMethods() + { + $activeMethods = array(); + foreach (self::$storageMethods as $storageMethod) { + $cacheStorageClass = 'PHPExcel_CachedObjectStorage_' . $storageMethod; + if (call_user_func(array($cacheStorageClass, 'cacheMethodIsAvailable'))) { + $activeMethods[] = $storageMethod; + } + } + return $activeMethods; + } + + /** + * Identify the cache storage method to use + * + * @param string $method Name of the method to use for cell cacheing + * @param array of mixed $arguments Additional arguments to pass to the cell caching class + * when instantiating + * @return boolean + **/ + public static function initialize($method = self::cache_in_memory, $arguments = array()) + { + if (!in_array($method, self::$storageMethods)) { + return false; + } + + $cacheStorageClass = 'PHPExcel_CachedObjectStorage_'.$method; + if (!call_user_func(array( $cacheStorageClass, + 'cacheMethodIsAvailable'))) { + return false; + } + + self::$storageMethodParameters[$method] = self::$storageMethodDefaultParameters[$method]; + foreach ($arguments as $k => $v) { + if (array_key_exists($k, self::$storageMethodParameters[$method])) { + self::$storageMethodParameters[$method][$k] = $v; + } + } + + if (self::$cacheStorageMethod === null) { + self::$cacheStorageClass = 'PHPExcel_CachedObjectStorage_' . $method; + self::$cacheStorageMethod = $method; + } + return true; + } + + /** + * Initialise the cache storage + * + * @param PHPExcel_Worksheet $parent Enable cell caching for this worksheet + * @return PHPExcel_CachedObjectStorage_ICache + **/ + public static function getInstance(PHPExcel_Worksheet $parent) + { + $cacheMethodIsAvailable = true; + if (self::$cacheStorageMethod === null) { + $cacheMethodIsAvailable = self::initialize(); + } + + if ($cacheMethodIsAvailable) { + $instance = new self::$cacheStorageClass( + $parent, + self::$storageMethodParameters[self::$cacheStorageMethod] + ); + if ($instance !== null) { + return $instance; + } + } + + return false; + } + + /** + * Clear the cache storage + * + **/ + public static function finalize() + { + self::$cacheStorageMethod = null; + self::$cacheStorageClass = null; + self::$storageMethodParameters = array(); + } +} diff --git a/extend/PHPExcel/PHPExcel/CalcEngine/CyclicReferenceStack.php b/extend/PHPExcel/PHPExcel/CalcEngine/CyclicReferenceStack.php new file mode 100644 index 0000000..1072fc7 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/CalcEngine/CyclicReferenceStack.php @@ -0,0 +1,94 @@ +stack); + } + + /** + * Push a new entry onto the stack + * + * @param mixed $value + */ + public function push($value) + { + $this->stack[$value] = $value; + } + + /** + * Pop the last entry from the stack + * + * @return mixed + */ + public function pop() + { + return array_pop($this->stack); + } + + /** + * Test to see if a specified entry exists on the stack + * + * @param mixed $value The value to test + */ + public function onStack($value) + { + return isset($this->stack[$value]); + } + + /** + * Clear the stack + */ + public function clear() + { + $this->stack = array(); + } + + /** + * Return an array of all entries on the stack + * + * @return mixed[] + */ + public function showStack() + { + return $this->stack; + } +} diff --git a/extend/PHPExcel/PHPExcel/CalcEngine/Logger.php b/extend/PHPExcel/PHPExcel/CalcEngine/Logger.php new file mode 100644 index 0000000..c5ffe73 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/CalcEngine/Logger.php @@ -0,0 +1,151 @@ +cellStack = $stack; + } + + /** + * Enable/Disable Calculation engine logging + * + * @param boolean $pValue + */ + public function setWriteDebugLog($pValue = false) + { + $this->writeDebugLog = $pValue; + } + + /** + * Return whether calculation engine logging is enabled or disabled + * + * @return boolean + */ + public function getWriteDebugLog() + { + return $this->writeDebugLog; + } + + /** + * Enable/Disable echoing of debug log information + * + * @param boolean $pValue + */ + public function setEchoDebugLog($pValue = false) + { + $this->echoDebugLog = $pValue; + } + + /** + * Return whether echoing of debug log information is enabled or disabled + * + * @return boolean + */ + public function getEchoDebugLog() + { + return $this->echoDebugLog; + } + + /** + * Write an entry to the calculation engine debug log + */ + public function writeDebugLog() + { + // Only write the debug log if logging is enabled + if ($this->writeDebugLog) { + $message = implode(func_get_args()); + $cellReference = implode(' -> ', $this->cellStack->showStack()); + if ($this->echoDebugLog) { + echo $cellReference, + ($this->cellStack->count() > 0 ? ' => ' : ''), + $message, + PHP_EOL; + } + $this->debugLog[] = $cellReference . + ($this->cellStack->count() > 0 ? ' => ' : '') . + $message; + } + } + + /** + * Clear the calculation engine debug log + */ + public function clearLog() + { + $this->debugLog = array(); + } + + /** + * Return the calculation engine debug log + * + * @return string[] + */ + public function getLog() + { + return $this->debugLog; + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation.php b/extend/PHPExcel/PHPExcel/Calculation.php new file mode 100644 index 0000000..20b1ec3 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation.php @@ -0,0 +1,4391 @@ +=-]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?\$?([a-z]{1,3})\$?(\d{1,7})'); + // Named Range of cells + define('CALCULATION_REGEXP_NAMEDRANGE', '((([^\s,!&%^\/\*\+<>=-]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?([_A-Z][_A-Z0-9\.]*)'); + } else { + // Cell reference (cell or range of cells, with or without a sheet reference) + define('CALCULATION_REGEXP_CELLREF', '(((\w*)|(\'[^\']*\')|(\"[^\"]*\"))!)?\$?([a-z]{1,3})\$?(\d+)'); + // Named Range of cells + define('CALCULATION_REGEXP_NAMEDRANGE', '(((\w*)|(\'.*\')|(\".*\"))!)?([_A-Z][_A-Z0-9\.]*)'); + } +} + +/** + * PHPExcel_Calculation (Multiton) + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Calculation + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Calculation +{ + /** Constants */ + /** Regular Expressions */ + // Numeric operand + const CALCULATION_REGEXP_NUMBER = '[-+]?\d*\.?\d+(e[-+]?\d+)?'; + // String operand + const CALCULATION_REGEXP_STRING = '"(?:[^"]|"")*"'; + // Opening bracket + const CALCULATION_REGEXP_OPENBRACE = '\('; + // Function (allow for the old @ symbol that could be used to prefix a function, but we'll ignore it) + const CALCULATION_REGEXP_FUNCTION = '@?([A-Z][A-Z0-9\.]*)[\s]*\('; + // Cell reference (cell or range of cells, with or without a sheet reference) + const CALCULATION_REGEXP_CELLREF = CALCULATION_REGEXP_CELLREF; + // Named Range of cells + const CALCULATION_REGEXP_NAMEDRANGE = CALCULATION_REGEXP_NAMEDRANGE; + // Error + const CALCULATION_REGEXP_ERROR = '\#[A-Z][A-Z0_\/]*[!\?]?'; + + + /** constants */ + const RETURN_ARRAY_AS_ERROR = 'error'; + const RETURN_ARRAY_AS_VALUE = 'value'; + const RETURN_ARRAY_AS_ARRAY = 'array'; + + private static $returnArrayAsType = self::RETURN_ARRAY_AS_VALUE; + + + /** + * Instance of this class + * + * @access private + * @var PHPExcel_Calculation + */ + private static $instance; + + + /** + * Instance of the workbook this Calculation Engine is using + * + * @access private + * @var PHPExcel + */ + private $workbook; + + /** + * List of instances of the calculation engine that we've instantiated for individual workbooks + * + * @access private + * @var PHPExcel_Calculation[] + */ + private static $workbookSets; + + /** + * Calculation cache + * + * @access private + * @var array + */ + private $calculationCache = array (); + + + /** + * Calculation cache enabled + * + * @access private + * @var boolean + */ + private $calculationCacheEnabled = true; + + + /** + * List of operators that can be used within formulae + * The true/false value indicates whether it is a binary operator or a unary operator + * + * @access private + * @var array + */ + private static $operators = array( + '+' => true, '-' => true, '*' => true, '/' => true, + '^' => true, '&' => true, '%' => false, '~' => false, + '>' => true, '<' => true, '=' => true, '>=' => true, + '<=' => true, '<>' => true, '|' => true, ':' => true + ); + + /** + * List of binary operators (those that expect two operands) + * + * @access private + * @var array + */ + private static $binaryOperators = array( + '+' => true, '-' => true, '*' => true, '/' => true, + '^' => true, '&' => true, '>' => true, '<' => true, + '=' => true, '>=' => true, '<=' => true, '<>' => true, + '|' => true, ':' => true + ); + + /** + * The debug log generated by the calculation engine + * + * @access private + * @var PHPExcel_CalcEngine_Logger + * + */ + private $debugLog; + + /** + * Flag to determine how formula errors should be handled + * If true, then a user error will be triggered + * If false, then an exception will be thrown + * + * @access public + * @var boolean + * + */ + public $suppressFormulaErrors = false; + + /** + * Error message for any error that was raised/thrown by the calculation engine + * + * @access public + * @var string + * + */ + public $formulaError = null; + + /** + * An array of the nested cell references accessed by the calculation engine, used for the debug log + * + * @access private + * @var array of string + * + */ + private $cyclicReferenceStack; + + private $cellStack = array(); + + /** + * Current iteration counter for cyclic formulae + * If the value is 0 (or less) then cyclic formulae will throw an exception, + * otherwise they will iterate to the limit defined here before returning a result + * + * @var integer + * + */ + private $cyclicFormulaCounter = 1; + + private $cyclicFormulaCell = ''; + + /** + * Number of iterations for cyclic formulae + * + * @var integer + * + */ + public $cyclicFormulaCount = 1; + + /** + * Epsilon Precision used for comparisons in calculations + * + * @var float + * + */ + private $delta = 0.1e-12; + + + /** + * The current locale setting + * + * @var string + * + */ + private static $localeLanguage = 'en_us'; // US English (default locale) + + /** + * List of available locale settings + * Note that this is read for the locale subdirectory only when requested + * + * @var string[] + * + */ + private static $validLocaleLanguages = array( + 'en' // English (default language) + ); + + /** + * Locale-specific argument separator for function arguments + * + * @var string + * + */ + private static $localeArgumentSeparator = ','; + private static $localeFunctions = array(); + + /** + * Locale-specific translations for Excel constants (True, False and Null) + * + * @var string[] + * + */ + public static $localeBoolean = array( + 'TRUE' => 'TRUE', + 'FALSE' => 'FALSE', + 'NULL' => 'NULL' + ); + + /** + * Excel constant string translations to their PHP equivalents + * Constant conversion from text name/value to actual (datatyped) value + * + * @var string[] + * + */ + private static $excelConstants = array( + 'TRUE' => true, + 'FALSE' => false, + 'NULL' => null + ); + + // PHPExcel functions + private static $PHPExcelFunctions = array( + 'ABS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'abs', + 'argumentCount' => '1' + ), + 'ACCRINT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::ACCRINT', + 'argumentCount' => '4-7' + ), + 'ACCRINTM' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::ACCRINTM', + 'argumentCount' => '3-5' + ), + 'ACOS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'acos', + 'argumentCount' => '1' + ), + 'ACOSH' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'acosh', + 'argumentCount' => '1' + ), + 'ADDRESS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_LookupRef::CELL_ADDRESS', + 'argumentCount' => '2-5' + ), + 'AMORDEGRC' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::AMORDEGRC', + 'argumentCount' => '6,7' + ), + 'AMORLINC' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::AMORLINC', + 'argumentCount' => '6,7' + ), + 'AND' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, + 'functionCall' => 'PHPExcel_Calculation_Logical::LOGICAL_AND', + 'argumentCount' => '1+' + ), + 'AREAS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '1' + ), + 'ASC' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '1' + ), + 'ASIN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'asin', + 'argumentCount' => '1' + ), + 'ASINH' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'asinh', + 'argumentCount' => '1' + ), + 'ATAN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'atan', + 'argumentCount' => '1' + ), + 'ATAN2' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::ATAN2', + 'argumentCount' => '2' + ), + 'ATANH' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'atanh', + 'argumentCount' => '1' + ), + 'AVEDEV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::AVEDEV', + 'argumentCount' => '1+' + ), + 'AVERAGE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::AVERAGE', + 'argumentCount' => '1+' + ), + 'AVERAGEA' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::AVERAGEA', + 'argumentCount' => '1+' + ), + 'AVERAGEIF' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::AVERAGEIF', + 'argumentCount' => '2,3' + ), + 'AVERAGEIFS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '3+' + ), + 'BAHTTEXT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '1' + ), + 'BESSELI' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::BESSELI', + 'argumentCount' => '2' + ), + 'BESSELJ' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::BESSELJ', + 'argumentCount' => '2' + ), + 'BESSELK' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::BESSELK', + 'argumentCount' => '2' + ), + 'BESSELY' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::BESSELY', + 'argumentCount' => '2' + ), + 'BETADIST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::BETADIST', + 'argumentCount' => '3-5' + ), + 'BETAINV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::BETAINV', + 'argumentCount' => '3-5' + ), + 'BIN2DEC' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::BINTODEC', + 'argumentCount' => '1' + ), + 'BIN2HEX' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::BINTOHEX', + 'argumentCount' => '1,2' + ), + 'BIN2OCT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::BINTOOCT', + 'argumentCount' => '1,2' + ), + 'BINOMDIST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::BINOMDIST', + 'argumentCount' => '4' + ), + 'CEILING' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::CEILING', + 'argumentCount' => '2' + ), + 'CELL' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '1,2' + ), + 'CHAR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::CHARACTER', + 'argumentCount' => '1' + ), + 'CHIDIST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::CHIDIST', + 'argumentCount' => '2' + ), + 'CHIINV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::CHIINV', + 'argumentCount' => '2' + ), + 'CHITEST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '2' + ), + 'CHOOSE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_LookupRef::CHOOSE', + 'argumentCount' => '2+' + ), + 'CLEAN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::TRIMNONPRINTABLE', + 'argumentCount' => '1' + ), + 'CODE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::ASCIICODE', + 'argumentCount' => '1' + ), + 'COLUMN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_LookupRef::COLUMN', + 'argumentCount' => '-1', + 'passByReference' => array(true) + ), + 'COLUMNS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_LookupRef::COLUMNS', + 'argumentCount' => '1' + ), + 'COMBIN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::COMBIN', + 'argumentCount' => '2' + ), + 'COMPLEX' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::COMPLEX', + 'argumentCount' => '2,3' + ), + 'CONCATENATE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::CONCATENATE', + 'argumentCount' => '1+' + ), + 'CONFIDENCE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::CONFIDENCE', + 'argumentCount' => '3' + ), + 'CONVERT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::CONVERTUOM', + 'argumentCount' => '3' + ), + 'CORREL' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::CORREL', + 'argumentCount' => '2' + ), + 'COS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'cos', + 'argumentCount' => '1' + ), + 'COSH' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'cosh', + 'argumentCount' => '1' + ), + 'COUNT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::COUNT', + 'argumentCount' => '1+' + ), + 'COUNTA' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::COUNTA', + 'argumentCount' => '1+' + ), + 'COUNTBLANK' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::COUNTBLANK', + 'argumentCount' => '1' + ), + 'COUNTIF' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::COUNTIF', + 'argumentCount' => '2' + ), + 'COUNTIFS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '2' + ), + 'COUPDAYBS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::COUPDAYBS', + 'argumentCount' => '3,4' + ), + 'COUPDAYS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::COUPDAYS', + 'argumentCount' => '3,4' + ), + 'COUPDAYSNC' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::COUPDAYSNC', + 'argumentCount' => '3,4' + ), + 'COUPNCD' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::COUPNCD', + 'argumentCount' => '3,4' + ), + 'COUPNUM' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::COUPNUM', + 'argumentCount' => '3,4' + ), + 'COUPPCD' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::COUPPCD', + 'argumentCount' => '3,4' + ), + 'COVAR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::COVAR', + 'argumentCount' => '2' + ), + 'CRITBINOM' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::CRITBINOM', + 'argumentCount' => '3' + ), + 'CUBEKPIMEMBER' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '?' + ), + 'CUBEMEMBER' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '?' + ), + 'CUBEMEMBERPROPERTY' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '?' + ), + 'CUBERANKEDMEMBER' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '?' + ), + 'CUBESET' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '?' + ), + 'CUBESETCOUNT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '?' + ), + 'CUBEVALUE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '?' + ), + 'CUMIPMT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::CUMIPMT', + 'argumentCount' => '6' + ), + 'CUMPRINC' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::CUMPRINC', + 'argumentCount' => '6' + ), + 'DATE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::DATE', + 'argumentCount' => '3' + ), + 'DATEDIF' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::DATEDIF', + 'argumentCount' => '2,3' + ), + 'DATEVALUE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::DATEVALUE', + 'argumentCount' => '1' + ), + 'DAVERAGE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'functionCall' => 'PHPExcel_Calculation_Database::DAVERAGE', + 'argumentCount' => '3' + ), + 'DAY' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::DAYOFMONTH', + 'argumentCount' => '1' + ), + 'DAYS360' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::DAYS360', + 'argumentCount' => '2,3' + ), + 'DB' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::DB', + 'argumentCount' => '4,5' + ), + 'DCOUNT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'functionCall' => 'PHPExcel_Calculation_Database::DCOUNT', + 'argumentCount' => '3' + ), + 'DCOUNTA' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'functionCall' => 'PHPExcel_Calculation_Database::DCOUNTA', + 'argumentCount' => '3' + ), + 'DDB' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::DDB', + 'argumentCount' => '4,5' + ), + 'DEC2BIN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::DECTOBIN', + 'argumentCount' => '1,2' + ), + 'DEC2HEX' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::DECTOHEX', + 'argumentCount' => '1,2' + ), + 'DEC2OCT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::DECTOOCT', + 'argumentCount' => '1,2' + ), + 'DEGREES' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'rad2deg', + 'argumentCount' => '1' + ), + 'DELTA' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::DELTA', + 'argumentCount' => '1,2' + ), + 'DEVSQ' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::DEVSQ', + 'argumentCount' => '1+' + ), + 'DGET' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'functionCall' => 'PHPExcel_Calculation_Database::DGET', + 'argumentCount' => '3' + ), + 'DISC' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::DISC', + 'argumentCount' => '4,5' + ), + 'DMAX' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'functionCall' => 'PHPExcel_Calculation_Database::DMAX', + 'argumentCount' => '3' + ), + 'DMIN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'functionCall' => 'PHPExcel_Calculation_Database::DMIN', + 'argumentCount' => '3' + ), + 'DOLLAR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::DOLLAR', + 'argumentCount' => '1,2' + ), + 'DOLLARDE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::DOLLARDE', + 'argumentCount' => '2' + ), + 'DOLLARFR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::DOLLARFR', + 'argumentCount' => '2' + ), + 'DPRODUCT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'functionCall' => 'PHPExcel_Calculation_Database::DPRODUCT', + 'argumentCount' => '3' + ), + 'DSTDEV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'functionCall' => 'PHPExcel_Calculation_Database::DSTDEV', + 'argumentCount' => '3' + ), + 'DSTDEVP' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'functionCall' => 'PHPExcel_Calculation_Database::DSTDEVP', + 'argumentCount' => '3' + ), + 'DSUM' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'functionCall' => 'PHPExcel_Calculation_Database::DSUM', + 'argumentCount' => '3' + ), + 'DURATION' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '5,6' + ), + 'DVAR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'functionCall' => 'PHPExcel_Calculation_Database::DVAR', + 'argumentCount' => '3' + ), + 'DVARP' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'functionCall' => 'PHPExcel_Calculation_Database::DVARP', + 'argumentCount' => '3' + ), + 'EDATE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::EDATE', + 'argumentCount' => '2' + ), + 'EFFECT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::EFFECT', + 'argumentCount' => '2' + ), + 'EOMONTH' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::EOMONTH', + 'argumentCount' => '2' + ), + 'ERF' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::ERF', + 'argumentCount' => '1,2' + ), + 'ERFC' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::ERFC', + 'argumentCount' => '1' + ), + 'ERROR.TYPE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::ERROR_TYPE', + 'argumentCount' => '1' + ), + 'EVEN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::EVEN', + 'argumentCount' => '1' + ), + 'EXACT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '2' + ), + 'EXP' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'exp', + 'argumentCount' => '1' + ), + 'EXPONDIST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::EXPONDIST', + 'argumentCount' => '3' + ), + 'FACT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::FACT', + 'argumentCount' => '1' + ), + 'FACTDOUBLE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::FACTDOUBLE', + 'argumentCount' => '1' + ), + 'FALSE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, + 'functionCall' => 'PHPExcel_Calculation_Logical::FALSE', + 'argumentCount' => '0' + ), + 'FDIST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '3' + ), + 'FIND' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::SEARCHSENSITIVE', + 'argumentCount' => '2,3' + ), + 'FINDB' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::SEARCHSENSITIVE', + 'argumentCount' => '2,3' + ), + 'FINV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '3' + ), + 'FISHER' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::FISHER', + 'argumentCount' => '1' + ), + 'FISHERINV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::FISHERINV', + 'argumentCount' => '1' + ), + 'FIXED' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::FIXEDFORMAT', + 'argumentCount' => '1-3' + ), + 'FLOOR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::FLOOR', + 'argumentCount' => '2' + ), + 'FORECAST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::FORECAST', + 'argumentCount' => '3' + ), + 'FREQUENCY' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '2' + ), + 'FTEST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '2' + ), + 'FV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::FV', + 'argumentCount' => '3-5' + ), + 'FVSCHEDULE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::FVSCHEDULE', + 'argumentCount' => '2' + ), + 'GAMMADIST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::GAMMADIST', + 'argumentCount' => '4' + ), + 'GAMMAINV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::GAMMAINV', + 'argumentCount' => '3' + ), + 'GAMMALN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::GAMMALN', + 'argumentCount' => '1' + ), + 'GCD' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::GCD', + 'argumentCount' => '1+' + ), + 'GEOMEAN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::GEOMEAN', + 'argumentCount' => '1+' + ), + 'GESTEP' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::GESTEP', + 'argumentCount' => '1,2' + ), + 'GETPIVOTDATA' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '2+' + ), + 'GROWTH' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::GROWTH', + 'argumentCount' => '1-4' + ), + 'HARMEAN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::HARMEAN', + 'argumentCount' => '1+' + ), + 'HEX2BIN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::HEXTOBIN', + 'argumentCount' => '1,2' + ), + 'HEX2DEC' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::HEXTODEC', + 'argumentCount' => '1' + ), + 'HEX2OCT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::HEXTOOCT', + 'argumentCount' => '1,2' + ), + 'HLOOKUP' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_LookupRef::HLOOKUP', + 'argumentCount' => '3,4' + ), + 'HOUR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::HOUROFDAY', + 'argumentCount' => '1' + ), + 'HYPERLINK' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_LookupRef::HYPERLINK', + 'argumentCount' => '1,2', + 'passCellReference' => true + ), + 'HYPGEOMDIST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::HYPGEOMDIST', + 'argumentCount' => '4' + ), + 'IF' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, + 'functionCall' => 'PHPExcel_Calculation_Logical::STATEMENT_IF', + 'argumentCount' => '1-3' + ), + 'IFERROR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, + 'functionCall' => 'PHPExcel_Calculation_Logical::IFERROR', + 'argumentCount' => '2' + ), + 'IMABS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMABS', + 'argumentCount' => '1' + ), + 'IMAGINARY' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMAGINARY', + 'argumentCount' => '1' + ), + 'IMARGUMENT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMARGUMENT', + 'argumentCount' => '1' + ), + 'IMCONJUGATE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMCONJUGATE', + 'argumentCount' => '1' + ), + 'IMCOS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMCOS', + 'argumentCount' => '1' + ), + 'IMDIV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMDIV', + 'argumentCount' => '2' + ), + 'IMEXP' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMEXP', + 'argumentCount' => '1' + ), + 'IMLN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMLN', + 'argumentCount' => '1' + ), + 'IMLOG10' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMLOG10', + 'argumentCount' => '1' + ), + 'IMLOG2' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMLOG2', + 'argumentCount' => '1' + ), + 'IMPOWER' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMPOWER', + 'argumentCount' => '2' + ), + 'IMPRODUCT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMPRODUCT', + 'argumentCount' => '1+' + ), + 'IMREAL' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMREAL', + 'argumentCount' => '1' + ), + 'IMSIN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMSIN', + 'argumentCount' => '1' + ), + 'IMSQRT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMSQRT', + 'argumentCount' => '1' + ), + 'IMSUB' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMSUB', + 'argumentCount' => '2' + ), + 'IMSUM' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::IMSUM', + 'argumentCount' => '1+' + ), + 'INDEX' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_LookupRef::INDEX', + 'argumentCount' => '1-4' + ), + 'INDIRECT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_LookupRef::INDIRECT', + 'argumentCount' => '1,2', + 'passCellReference' => true + ), + 'INFO' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '1' + ), + 'INT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::INT', + 'argumentCount' => '1' + ), + 'INTERCEPT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::INTERCEPT', + 'argumentCount' => '2' + ), + 'INTRATE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::INTRATE', + 'argumentCount' => '4,5' + ), + 'IPMT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::IPMT', + 'argumentCount' => '4-6' + ), + 'IRR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::IRR', + 'argumentCount' => '1,2' + ), + 'ISBLANK' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::IS_BLANK', + 'argumentCount' => '1' + ), + 'ISERR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::IS_ERR', + 'argumentCount' => '1' + ), + 'ISERROR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::IS_ERROR', + 'argumentCount' => '1' + ), + 'ISEVEN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::IS_EVEN', + 'argumentCount' => '1' + ), + 'ISLOGICAL' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::IS_LOGICAL', + 'argumentCount' => '1' + ), + 'ISNA' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::IS_NA', + 'argumentCount' => '1' + ), + 'ISNONTEXT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::IS_NONTEXT', + 'argumentCount' => '1' + ), + 'ISNUMBER' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::IS_NUMBER', + 'argumentCount' => '1' + ), + 'ISODD' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::IS_ODD', + 'argumentCount' => '1' + ), + 'ISPMT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::ISPMT', + 'argumentCount' => '4' + ), + 'ISREF' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '1' + ), + 'ISTEXT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::IS_TEXT', + 'argumentCount' => '1' + ), + 'JIS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '1' + ), + 'KURT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::KURT', + 'argumentCount' => '1+' + ), + 'LARGE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::LARGE', + 'argumentCount' => '2' + ), + 'LCM' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::LCM', + 'argumentCount' => '1+' + ), + 'LEFT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::LEFT', + 'argumentCount' => '1,2' + ), + 'LEFTB' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::LEFT', + 'argumentCount' => '1,2' + ), + 'LEN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::STRINGLENGTH', + 'argumentCount' => '1' + ), + 'LENB' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::STRINGLENGTH', + 'argumentCount' => '1' + ), + 'LINEST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::LINEST', + 'argumentCount' => '1-4' + ), + 'LN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'log', + 'argumentCount' => '1' + ), + 'LOG' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::LOG_BASE', + 'argumentCount' => '1,2' + ), + 'LOG10' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'log10', + 'argumentCount' => '1' + ), + 'LOGEST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::LOGEST', + 'argumentCount' => '1-4' + ), + 'LOGINV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::LOGINV', + 'argumentCount' => '3' + ), + 'LOGNORMDIST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::LOGNORMDIST', + 'argumentCount' => '3' + ), + 'LOOKUP' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_LookupRef::LOOKUP', + 'argumentCount' => '2,3' + ), + 'LOWER' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::LOWERCASE', + 'argumentCount' => '1' + ), + 'MATCH' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_LookupRef::MATCH', + 'argumentCount' => '2,3' + ), + 'MAX' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::MAX', + 'argumentCount' => '1+' + ), + 'MAXA' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::MAXA', + 'argumentCount' => '1+' + ), + 'MAXIF' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::MAXIF', + 'argumentCount' => '2+' + ), + 'MDETERM' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::MDETERM', + 'argumentCount' => '1' + ), + 'MDURATION' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '5,6' + ), + 'MEDIAN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::MEDIAN', + 'argumentCount' => '1+' + ), + 'MEDIANIF' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '2+' + ), + 'MID' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::MID', + 'argumentCount' => '3' + ), + 'MIDB' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::MID', + 'argumentCount' => '3' + ), + 'MIN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::MIN', + 'argumentCount' => '1+' + ), + 'MINA' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::MINA', + 'argumentCount' => '1+' + ), + 'MINIF' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::MINIF', + 'argumentCount' => '2+' + ), + 'MINUTE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::MINUTEOFHOUR', + 'argumentCount' => '1' + ), + 'MINVERSE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::MINVERSE', + 'argumentCount' => '1' + ), + 'MIRR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::MIRR', + 'argumentCount' => '3' + ), + 'MMULT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::MMULT', + 'argumentCount' => '2' + ), + 'MOD' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::MOD', + 'argumentCount' => '2' + ), + 'MODE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::MODE', + 'argumentCount' => '1+' + ), + 'MONTH' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::MONTHOFYEAR', + 'argumentCount' => '1' + ), + 'MROUND' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::MROUND', + 'argumentCount' => '2' + ), + 'MULTINOMIAL' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::MULTINOMIAL', + 'argumentCount' => '1+' + ), + 'N' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::N', + 'argumentCount' => '1' + ), + 'NA' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::NA', + 'argumentCount' => '0' + ), + 'NEGBINOMDIST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::NEGBINOMDIST', + 'argumentCount' => '3' + ), + 'NETWORKDAYS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::NETWORKDAYS', + 'argumentCount' => '2+' + ), + 'NOMINAL' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::NOMINAL', + 'argumentCount' => '2' + ), + 'NORMDIST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::NORMDIST', + 'argumentCount' => '4' + ), + 'NORMINV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::NORMINV', + 'argumentCount' => '3' + ), + 'NORMSDIST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::NORMSDIST', + 'argumentCount' => '1' + ), + 'NORMSINV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::NORMSINV', + 'argumentCount' => '1' + ), + 'NOT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, + 'functionCall' => 'PHPExcel_Calculation_Logical::NOT', + 'argumentCount' => '1' + ), + 'NOW' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::DATETIMENOW', + 'argumentCount' => '0' + ), + 'NPER' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::NPER', + 'argumentCount' => '3-5' + ), + 'NPV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::NPV', + 'argumentCount' => '2+' + ), + 'OCT2BIN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::OCTTOBIN', + 'argumentCount' => '1,2' + ), + 'OCT2DEC' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::OCTTODEC', + 'argumentCount' => '1' + ), + 'OCT2HEX' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'functionCall' => 'PHPExcel_Calculation_Engineering::OCTTOHEX', + 'argumentCount' => '1,2' + ), + 'ODD' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::ODD', + 'argumentCount' => '1' + ), + 'ODDFPRICE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '8,9' + ), + 'ODDFYIELD' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '8,9' + ), + 'ODDLPRICE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '7,8' + ), + 'ODDLYIELD' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '7,8' + ), + 'OFFSET' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_LookupRef::OFFSET', + 'argumentCount' => '3-5', + 'passCellReference' => true, + 'passByReference' => array(true) + ), + 'OR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, + 'functionCall' => 'PHPExcel_Calculation_Logical::LOGICAL_OR', + 'argumentCount' => '1+' + ), + 'PEARSON' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::CORREL', + 'argumentCount' => '2' + ), + 'PERCENTILE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::PERCENTILE', + 'argumentCount' => '2' + ), + 'PERCENTRANK' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::PERCENTRANK', + 'argumentCount' => '2,3' + ), + 'PERMUT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::PERMUT', + 'argumentCount' => '2' + ), + 'PHONETIC' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '1' + ), + 'PI' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'pi', + 'argumentCount' => '0' + ), + 'PMT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::PMT', + 'argumentCount' => '3-5' + ), + 'POISSON' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::POISSON', + 'argumentCount' => '3' + ), + 'POWER' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::POWER', + 'argumentCount' => '2' + ), + 'PPMT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::PPMT', + 'argumentCount' => '4-6' + ), + 'PRICE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::PRICE', + 'argumentCount' => '6,7' + ), + 'PRICEDISC' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::PRICEDISC', + 'argumentCount' => '4,5' + ), + 'PRICEMAT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::PRICEMAT', + 'argumentCount' => '5,6' + ), + 'PROB' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '3,4' + ), + 'PRODUCT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::PRODUCT', + 'argumentCount' => '1+' + ), + 'PROPER' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::PROPERCASE', + 'argumentCount' => '1' + ), + 'PV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::PV', + 'argumentCount' => '3-5' + ), + 'QUARTILE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::QUARTILE', + 'argumentCount' => '2' + ), + 'QUOTIENT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::QUOTIENT', + 'argumentCount' => '2' + ), + 'RADIANS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'deg2rad', + 'argumentCount' => '1' + ), + 'RAND' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::RAND', + 'argumentCount' => '0' + ), + 'RANDBETWEEN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::RAND', + 'argumentCount' => '2' + ), + 'RANK' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::RANK', + 'argumentCount' => '2,3' + ), + 'RATE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::RATE', + 'argumentCount' => '3-6' + ), + 'RECEIVED' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::RECEIVED', + 'argumentCount' => '4-5' + ), + 'REPLACE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::REPLACE', + 'argumentCount' => '4' + ), + 'REPLACEB' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::REPLACE', + 'argumentCount' => '4' + ), + 'REPT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'str_repeat', + 'argumentCount' => '2' + ), + 'RIGHT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::RIGHT', + 'argumentCount' => '1,2' + ), + 'RIGHTB' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::RIGHT', + 'argumentCount' => '1,2' + ), + 'ROMAN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::ROMAN', + 'argumentCount' => '1,2' + ), + 'ROUND' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'round', + 'argumentCount' => '2' + ), + 'ROUNDDOWN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::ROUNDDOWN', + 'argumentCount' => '2' + ), + 'ROUNDUP' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::ROUNDUP', + 'argumentCount' => '2' + ), + 'ROW' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_LookupRef::ROW', + 'argumentCount' => '-1', + 'passByReference' => array(true) + ), + 'ROWS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_LookupRef::ROWS', + 'argumentCount' => '1' + ), + 'RSQ' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::RSQ', + 'argumentCount' => '2' + ), + 'RTD' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '1+' + ), + 'SEARCH' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::SEARCHINSENSITIVE', + 'argumentCount' => '2,3' + ), + 'SEARCHB' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::SEARCHINSENSITIVE', + 'argumentCount' => '2,3' + ), + 'SECOND' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::SECONDOFMINUTE', + 'argumentCount' => '1' + ), + 'SERIESSUM' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::SERIESSUM', + 'argumentCount' => '4' + ), + 'SIGN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::SIGN', + 'argumentCount' => '1' + ), + 'SIN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'sin', + 'argumentCount' => '1' + ), + 'SINH' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'sinh', + 'argumentCount' => '1' + ), + 'SKEW' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::SKEW', + 'argumentCount' => '1+' + ), + 'SLN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::SLN', + 'argumentCount' => '3' + ), + 'SLOPE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::SLOPE', + 'argumentCount' => '2' + ), + 'SMALL' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::SMALL', + 'argumentCount' => '2' + ), + 'SQRT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'sqrt', + 'argumentCount' => '1' + ), + 'SQRTPI' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::SQRTPI', + 'argumentCount' => '1' + ), + 'STANDARDIZE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::STANDARDIZE', + 'argumentCount' => '3' + ), + 'STDEV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::STDEV', + 'argumentCount' => '1+' + ), + 'STDEVA' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::STDEVA', + 'argumentCount' => '1+' + ), + 'STDEVP' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::STDEVP', + 'argumentCount' => '1+' + ), + 'STDEVPA' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::STDEVPA', + 'argumentCount' => '1+' + ), + 'STEYX' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::STEYX', + 'argumentCount' => '2' + ), + 'SUBSTITUTE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::SUBSTITUTE', + 'argumentCount' => '3,4' + ), + 'SUBTOTAL' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUBTOTAL', + 'argumentCount' => '2+' + ), + 'SUM' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUM', + 'argumentCount' => '1+' + ), + 'SUMIF' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMIF', + 'argumentCount' => '2,3' + ), + 'SUMIFS' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMIFS', + 'argumentCount' => '3+' + ), + 'SUMPRODUCT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMPRODUCT', + 'argumentCount' => '1+' + ), + 'SUMSQ' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMSQ', + 'argumentCount' => '1+' + ), + 'SUMX2MY2' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMX2MY2', + 'argumentCount' => '2' + ), + 'SUMX2PY2' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMX2PY2', + 'argumentCount' => '2' + ), + 'SUMXMY2' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMXMY2', + 'argumentCount' => '2' + ), + 'SYD' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::SYD', + 'argumentCount' => '4' + ), + 'T' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::RETURNSTRING', + 'argumentCount' => '1' + ), + 'TAN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'tan', + 'argumentCount' => '1' + ), + 'TANH' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'tanh', + 'argumentCount' => '1' + ), + 'TBILLEQ' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::TBILLEQ', + 'argumentCount' => '3' + ), + 'TBILLPRICE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::TBILLPRICE', + 'argumentCount' => '3' + ), + 'TBILLYIELD' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::TBILLYIELD', + 'argumentCount' => '3' + ), + 'TDIST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::TDIST', + 'argumentCount' => '3' + ), + 'TEXT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::TEXTFORMAT', + 'argumentCount' => '2' + ), + 'TIME' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::TIME', + 'argumentCount' => '3' + ), + 'TIMEVALUE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::TIMEVALUE', + 'argumentCount' => '1' + ), + 'TINV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::TINV', + 'argumentCount' => '2' + ), + 'TODAY' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::DATENOW', + 'argumentCount' => '0' + ), + 'TRANSPOSE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_LookupRef::TRANSPOSE', + 'argumentCount' => '1' + ), + 'TREND' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::TREND', + 'argumentCount' => '1-4' + ), + 'TRIM' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::TRIMSPACES', + 'argumentCount' => '1' + ), + 'TRIMMEAN' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::TRIMMEAN', + 'argumentCount' => '2' + ), + 'TRUE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, + 'functionCall' => 'PHPExcel_Calculation_Logical::TRUE', + 'argumentCount' => '0' + ), + 'TRUNC' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'PHPExcel_Calculation_MathTrig::TRUNC', + 'argumentCount' => '1,2' + ), + 'TTEST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '4' + ), + 'TYPE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::TYPE', + 'argumentCount' => '1' + ), + 'UPPER' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::UPPERCASE', + 'argumentCount' => '1' + ), + 'USDOLLAR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '2' + ), + 'VALUE' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'PHPExcel_Calculation_TextData::VALUE', + 'argumentCount' => '1' + ), + 'VAR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::VARFunc', + 'argumentCount' => '1+' + ), + 'VARA' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::VARA', + 'argumentCount' => '1+' + ), + 'VARP' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::VARP', + 'argumentCount' => '1+' + ), + 'VARPA' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::VARPA', + 'argumentCount' => '1+' + ), + 'VDB' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '5-7' + ), + 'VERSION' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, + 'functionCall' => 'PHPExcel_Calculation_Functions::VERSION', + 'argumentCount' => '0' + ), + 'VLOOKUP' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'PHPExcel_Calculation_LookupRef::VLOOKUP', + 'argumentCount' => '3,4' + ), + 'WEEKDAY' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::DAYOFWEEK', + 'argumentCount' => '1,2' + ), + 'WEEKNUM' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::WEEKOFYEAR', + 'argumentCount' => '1,2' + ), + 'WEIBULL' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::WEIBULL', + 'argumentCount' => '4' + ), + 'WORKDAY' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::WORKDAY', + 'argumentCount' => '2+' + ), + 'XIRR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::XIRR', + 'argumentCount' => '2,3' + ), + 'XNPV' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::XNPV', + 'argumentCount' => '3' + ), + 'YEAR' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::YEAR', + 'argumentCount' => '1' + ), + 'YEARFRAC' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'functionCall' => 'PHPExcel_Calculation_DateTime::YEARFRAC', + 'argumentCount' => '2,3' + ), + 'YIELD' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'argumentCount' => '6,7' + ), + 'YIELDDISC' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::YIELDDISC', + 'argumentCount' => '4,5' + ), + 'YIELDMAT' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'functionCall' => 'PHPExcel_Calculation_Financial::YIELDMAT', + 'argumentCount' => '5,6' + ), + 'ZTEST' => array( + 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'functionCall' => 'PHPExcel_Calculation_Statistical::ZTEST', + 'argumentCount' => '2-3' + ) + ); + + // Internal functions used for special control purposes + private static $controlFunctions = array( + 'MKMATRIX' => array( + 'argumentCount' => '*', + 'functionCall' => 'self::mkMatrix' + ) + ); + + + public function __construct(PHPExcel $workbook = null) + { + $this->delta = 1 * pow(10, 0 - ini_get('precision')); + + $this->workbook = $workbook; + $this->cyclicReferenceStack = new PHPExcel_CalcEngine_CyclicReferenceStack(); + $this->_debugLog = new PHPExcel_CalcEngine_Logger($this->cyclicReferenceStack); + } + + + private static function loadLocales() + { + $localeFileDirectory = PHPEXCEL_ROOT.'PHPExcel/locale/'; + foreach (glob($localeFileDirectory.'/*', GLOB_ONLYDIR) as $filename) { + $filename = substr($filename, strlen($localeFileDirectory)+1); + if ($filename != 'en') { + self::$validLocaleLanguages[] = $filename; + } + } + } + + /** + * Get an instance of this class + * + * @access public + * @param PHPExcel $workbook Injected workbook for working with a PHPExcel object, + * or NULL to create a standalone claculation engine + * @return PHPExcel_Calculation + */ + public static function getInstance(PHPExcel $workbook = null) + { + if ($workbook !== null) { + $instance = $workbook->getCalculationEngine(); + if (isset($instance)) { + return $instance; + } + } + + if (!isset(self::$instance) || (self::$instance === null)) { + self::$instance = new PHPExcel_Calculation(); + } + return self::$instance; + } + + /** + * Unset an instance of this class + * + * @access public + */ + public function __destruct() + { + $this->workbook = null; + } + + /** + * Flush the calculation cache for any existing instance of this class + * but only if a PHPExcel_Calculation instance exists + * + * @access public + * @return null + */ + public function flushInstance() + { + $this->clearCalculationCache(); + } + + + /** + * Get the debuglog for this claculation engine instance + * + * @access public + * @return PHPExcel_CalcEngine_Logger + */ + public function getDebugLog() + { + return $this->_debugLog; + } + + /** + * __clone implementation. Cloning should not be allowed in a Singleton! + * + * @access public + * @throws PHPExcel_Calculation_Exception + */ + final public function __clone() + { + throw new PHPExcel_Calculation_Exception('Cloning the calculation engine is not allowed!'); + } + + + /** + * Return the locale-specific translation of TRUE + * + * @access public + * @return string locale-specific translation of TRUE + */ + public static function getTRUE() + { + return self::$localeBoolean['TRUE']; + } + + /** + * Return the locale-specific translation of FALSE + * + * @access public + * @return string locale-specific translation of FALSE + */ + public static function getFALSE() + { + return self::$localeBoolean['FALSE']; + } + + /** + * Set the Array Return Type (Array or Value of first element in the array) + * + * @access public + * @param string $returnType Array return type + * @return boolean Success or failure + */ + public static function setArrayReturnType($returnType) + { + if (($returnType == self::RETURN_ARRAY_AS_VALUE) || + ($returnType == self::RETURN_ARRAY_AS_ERROR) || + ($returnType == self::RETURN_ARRAY_AS_ARRAY)) { + self::$returnArrayAsType = $returnType; + return true; + } + return false; + } + + + /** + * Return the Array Return Type (Array or Value of first element in the array) + * + * @access public + * @return string $returnType Array return type + */ + public static function getArrayReturnType() + { + return self::$returnArrayAsType; + } + + + /** + * Is calculation caching enabled? + * + * @access public + * @return boolean + */ + public function getCalculationCacheEnabled() + { + return $this->calculationCacheEnabled; + } + + /** + * Enable/disable calculation cache + * + * @access public + * @param boolean $pValue + */ + public function setCalculationCacheEnabled($pValue = true) + { + $this->calculationCacheEnabled = $pValue; + $this->clearCalculationCache(); + } + + + /** + * Enable calculation cache + */ + public function enableCalculationCache() + { + $this->setCalculationCacheEnabled(true); + } + + + /** + * Disable calculation cache + */ + public function disableCalculationCache() + { + $this->setCalculationCacheEnabled(false); + } + + + /** + * Clear calculation cache + */ + public function clearCalculationCache() + { + $this->calculationCache = array(); + } + + /** + * Clear calculation cache for a specified worksheet + * + * @param string $worksheetName + */ + public function clearCalculationCacheForWorksheet($worksheetName) + { + if (isset($this->calculationCache[$worksheetName])) { + unset($this->calculationCache[$worksheetName]); + } + } + + /** + * Rename calculation cache for a specified worksheet + * + * @param string $fromWorksheetName + * @param string $toWorksheetName + */ + public function renameCalculationCacheForWorksheet($fromWorksheetName, $toWorksheetName) + { + if (isset($this->calculationCache[$fromWorksheetName])) { + $this->calculationCache[$toWorksheetName] = &$this->calculationCache[$fromWorksheetName]; + unset($this->calculationCache[$fromWorksheetName]); + } + } + + + /** + * Get the currently defined locale code + * + * @return string + */ + public function getLocale() + { + return self::$localeLanguage; + } + + + /** + * Set the locale code + * + * @param string $locale The locale to use for formula translation + * @return boolean + */ + public function setLocale($locale = 'en_us') + { + // Identify our locale and language + $language = $locale = strtolower($locale); + if (strpos($locale, '_') !== false) { + list($language) = explode('_', $locale); + } + + if (count(self::$validLocaleLanguages) == 1) { + self::loadLocales(); + } + // Test whether we have any language data for this language (any locale) + if (in_array($language, self::$validLocaleLanguages)) { + // initialise language/locale settings + self::$localeFunctions = array(); + self::$localeArgumentSeparator = ','; + self::$localeBoolean = array('TRUE' => 'TRUE', 'FALSE' => 'FALSE', 'NULL' => 'NULL'); + // Default is English, if user isn't requesting english, then read the necessary data from the locale files + if ($locale != 'en_us') { + // Search for a file with a list of function names for locale + $functionNamesFile = PHPEXCEL_ROOT . 'PHPExcel'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $locale).DIRECTORY_SEPARATOR.'functions'; + if (!file_exists($functionNamesFile)) { + // If there isn't a locale specific function file, look for a language specific function file + $functionNamesFile = PHPEXCEL_ROOT . 'PHPExcel'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.$language.DIRECTORY_SEPARATOR.'functions'; + if (!file_exists($functionNamesFile)) { + return false; + } + } + // Retrieve the list of locale or language specific function names + $localeFunctions = file($functionNamesFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + foreach ($localeFunctions as $localeFunction) { + list($localeFunction) = explode('##', $localeFunction); // Strip out comments + if (strpos($localeFunction, '=') !== false) { + list($fName, $lfName) = explode('=', $localeFunction); + $fName = trim($fName); + $lfName = trim($lfName); + if ((isset(self::$PHPExcelFunctions[$fName])) && ($lfName != '') && ($fName != $lfName)) { + self::$localeFunctions[$fName] = $lfName; + } + } + } + // Default the TRUE and FALSE constants to the locale names of the TRUE() and FALSE() functions + if (isset(self::$localeFunctions['TRUE'])) { + self::$localeBoolean['TRUE'] = self::$localeFunctions['TRUE']; + } + if (isset(self::$localeFunctions['FALSE'])) { + self::$localeBoolean['FALSE'] = self::$localeFunctions['FALSE']; + } + + $configFile = PHPEXCEL_ROOT . 'PHPExcel'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $locale).DIRECTORY_SEPARATOR.'config'; + if (!file_exists($configFile)) { + $configFile = PHPEXCEL_ROOT . 'PHPExcel'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.$language.DIRECTORY_SEPARATOR.'config'; + } + if (file_exists($configFile)) { + $localeSettings = file($configFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + foreach ($localeSettings as $localeSetting) { + list($localeSetting) = explode('##', $localeSetting); // Strip out comments + if (strpos($localeSetting, '=') !== false) { + list($settingName, $settingValue) = explode('=', $localeSetting); + $settingName = strtoupper(trim($settingName)); + switch ($settingName) { + case 'ARGUMENTSEPARATOR': + self::$localeArgumentSeparator = trim($settingValue); + break; + } + } + } + } + } + + self::$functionReplaceFromExcel = self::$functionReplaceToExcel = + self::$functionReplaceFromLocale = self::$functionReplaceToLocale = null; + self::$localeLanguage = $locale; + return true; + } + return false; + } + + + + public static function translateSeparator($fromSeparator, $toSeparator, $formula, &$inBraces) + { + $strlen = mb_strlen($formula); + for ($i = 0; $i < $strlen; ++$i) { + $chr = mb_substr($formula, $i, 1); + switch ($chr) { + case '{': + $inBraces = true; + break; + case '}': + $inBraces = false; + break; + case $fromSeparator: + if (!$inBraces) { + $formula = mb_substr($formula, 0, $i).$toSeparator.mb_substr($formula, $i+1); + } + } + } + return $formula; + } + + private static function translateFormula($from, $to, $formula, $fromSeparator, $toSeparator) + { + // Convert any Excel function names to the required language + if (self::$localeLanguage !== 'en_us') { + $inBraces = false; + // If there is the possibility of braces within a quoted string, then we don't treat those as matrix indicators + if (strpos($formula, '"') !== false) { + // So instead we skip replacing in any quoted strings by only replacing in every other array element after we've exploded + // the formula + $temp = explode('"', $formula); + $i = false; + foreach ($temp as &$value) { + // Only count/replace in alternating array entries + if ($i = !$i) { + $value = preg_replace($from, $to, $value); + $value = self::translateSeparator($fromSeparator, $toSeparator, $value, $inBraces); + } + } + unset($value); + // Then rebuild the formula string + $formula = implode('"', $temp); + } else { + // If there's no quoted strings, then we do a simple count/replace + $formula = preg_replace($from, $to, $formula); + $formula = self::translateSeparator($fromSeparator, $toSeparator, $formula, $inBraces); + } + } + + return $formula; + } + + private static $functionReplaceFromExcel = null; + private static $functionReplaceToLocale = null; + + public function _translateFormulaToLocale($formula) + { + if (self::$functionReplaceFromExcel === null) { + self::$functionReplaceFromExcel = array(); + foreach (array_keys(self::$localeFunctions) as $excelFunctionName) { + self::$functionReplaceFromExcel[] = '/(@?[^\w\.])'.preg_quote($excelFunctionName).'([\s]*\()/Ui'; + } + foreach (array_keys(self::$localeBoolean) as $excelBoolean) { + self::$functionReplaceFromExcel[] = '/(@?[^\w\.])'.preg_quote($excelBoolean).'([^\w\.])/Ui'; + } + + } + + if (self::$functionReplaceToLocale === null) { + self::$functionReplaceToLocale = array(); + foreach (array_values(self::$localeFunctions) as $localeFunctionName) { + self::$functionReplaceToLocale[] = '$1'.trim($localeFunctionName).'$2'; + } + foreach (array_values(self::$localeBoolean) as $localeBoolean) { + self::$functionReplaceToLocale[] = '$1'.trim($localeBoolean).'$2'; + } + } + + return self::translateFormula(self::$functionReplaceFromExcel, self::$functionReplaceToLocale, $formula, ',', self::$localeArgumentSeparator); + } + + + private static $functionReplaceFromLocale = null; + private static $functionReplaceToExcel = null; + + public function _translateFormulaToEnglish($formula) + { + if (self::$functionReplaceFromLocale === null) { + self::$functionReplaceFromLocale = array(); + foreach (array_values(self::$localeFunctions) as $localeFunctionName) { + self::$functionReplaceFromLocale[] = '/(@?[^\w\.])'.preg_quote($localeFunctionName).'([\s]*\()/Ui'; + } + foreach (array_values(self::$localeBoolean) as $excelBoolean) { + self::$functionReplaceFromLocale[] = '/(@?[^\w\.])'.preg_quote($excelBoolean).'([^\w\.])/Ui'; + } + } + + if (self::$functionReplaceToExcel === null) { + self::$functionReplaceToExcel = array(); + foreach (array_keys(self::$localeFunctions) as $excelFunctionName) { + self::$functionReplaceToExcel[] = '$1'.trim($excelFunctionName).'$2'; + } + foreach (array_keys(self::$localeBoolean) as $excelBoolean) { + self::$functionReplaceToExcel[] = '$1'.trim($excelBoolean).'$2'; + } + } + + return self::translateFormula(self::$functionReplaceFromLocale, self::$functionReplaceToExcel, $formula, self::$localeArgumentSeparator, ','); + } + + + public static function localeFunc($function) + { + if (self::$localeLanguage !== 'en_us') { + $functionName = trim($function, '('); + if (isset(self::$localeFunctions[$functionName])) { + $brace = ($functionName != $function); + $function = self::$localeFunctions[$functionName]; + if ($brace) { + $function .= '('; + } + } + } + return $function; + } + + + + + /** + * Wrap string values in quotes + * + * @param mixed $value + * @return mixed + */ + public static function wrapResult($value) + { + if (is_string($value)) { + // Error values cannot be "wrapped" + if (preg_match('/^'.self::CALCULATION_REGEXP_ERROR.'$/i', $value, $match)) { + // Return Excel errors "as is" + return $value; + } + // Return strings wrapped in quotes + return '"'.$value.'"'; + // Convert numeric errors to NaN error + } elseif ((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) { + return PHPExcel_Calculation_Functions::NaN(); + } + + return $value; + } + + + /** + * Remove quotes used as a wrapper to identify string values + * + * @param mixed $value + * @return mixed + */ + public static function unwrapResult($value) + { + if (is_string($value)) { + if ((isset($value{0})) && ($value{0} == '"') && (substr($value, -1) == '"')) { + return substr($value, 1, -1); + } + // Convert numeric errors to NaN error + } elseif ((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) { + return PHPExcel_Calculation_Functions::NaN(); + } + return $value; + } + + + + + /** + * Calculate cell value (using formula from a cell ID) + * Retained for backward compatibility + * + * @access public + * @param PHPExcel_Cell $pCell Cell to calculate + * @return mixed + * @throws PHPExcel_Calculation_Exception + */ + public function calculate(PHPExcel_Cell $pCell = null) + { + try { + return $this->calculateCellValue($pCell); + } catch (PHPExcel_Exception $e) { + throw new PHPExcel_Calculation_Exception($e->getMessage()); + } + } + + + /** + * Calculate the value of a cell formula + * + * @access public + * @param PHPExcel_Cell $pCell Cell to calculate + * @param Boolean $resetLog Flag indicating whether the debug log should be reset or not + * @return mixed + * @throws PHPExcel_Calculation_Exception + */ + public function calculateCellValue(PHPExcel_Cell $pCell = null, $resetLog = true) + { + if ($pCell === null) { + return null; + } + + $returnArrayAsType = self::$returnArrayAsType; + if ($resetLog) { + // Initialise the logging settings if requested + $this->formulaError = null; + $this->_debugLog->clearLog(); + $this->cyclicReferenceStack->clear(); + $this->cyclicFormulaCounter = 1; + + self::$returnArrayAsType = self::RETURN_ARRAY_AS_ARRAY; + } + + // Execute the calculation for the cell formula + $this->cellStack[] = array( + 'sheet' => $pCell->getWorksheet()->getTitle(), + 'cell' => $pCell->getCoordinate(), + ); + try { + $result = self::unwrapResult($this->_calculateFormulaValue($pCell->getValue(), $pCell->getCoordinate(), $pCell)); + $cellAddress = array_pop($this->cellStack); + $this->workbook->getSheetByName($cellAddress['sheet'])->getCell($cellAddress['cell']); + } catch (PHPExcel_Exception $e) { + $cellAddress = array_pop($this->cellStack); + $this->workbook->getSheetByName($cellAddress['sheet'])->getCell($cellAddress['cell']); + throw new PHPExcel_Calculation_Exception($e->getMessage()); + } + + if ((is_array($result)) && (self::$returnArrayAsType != self::RETURN_ARRAY_AS_ARRAY)) { + self::$returnArrayAsType = $returnArrayAsType; + $testResult = PHPExcel_Calculation_Functions::flattenArray($result); + if (self::$returnArrayAsType == self::RETURN_ARRAY_AS_ERROR) { + return PHPExcel_Calculation_Functions::VALUE(); + } + // If there's only a single cell in the array, then we allow it + if (count($testResult) != 1) { + // If keys are numeric, then it's a matrix result rather than a cell range result, so we permit it + $r = array_keys($result); + $r = array_shift($r); + if (!is_numeric($r)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if (is_array($result[$r])) { + $c = array_keys($result[$r]); + $c = array_shift($c); + if (!is_numeric($c)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + } + $result = array_shift($testResult); + } + self::$returnArrayAsType = $returnArrayAsType; + + + if ($result === null) { + return 0; + } elseif ((is_float($result)) && ((is_nan($result)) || (is_infinite($result)))) { + return PHPExcel_Calculation_Functions::NaN(); + } + return $result; + } + + + /** + * Validate and parse a formula string + * + * @param string $formula Formula to parse + * @return array + * @throws PHPExcel_Calculation_Exception + */ + public function parseFormula($formula) + { + // Basic validation that this is indeed a formula + // We return an empty array if not + $formula = trim($formula); + if ((!isset($formula{0})) || ($formula{0} != '=')) { + return array(); + } + $formula = ltrim(substr($formula, 1)); + if (!isset($formula{0})) { + return array(); + } + + // Parse the formula and return the token stack + return $this->_parseFormula($formula); + } + + + /** + * Calculate the value of a formula + * + * @param string $formula Formula to parse + * @param string $cellID Address of the cell to calculate + * @param PHPExcel_Cell $pCell Cell to calculate + * @return mixed + * @throws PHPExcel_Calculation_Exception + */ + public function calculateFormula($formula, $cellID = null, PHPExcel_Cell $pCell = null) + { + // Initialise the logging settings + $this->formulaError = null; + $this->_debugLog->clearLog(); + $this->cyclicReferenceStack->clear(); + + if ($this->workbook !== null && $cellID === null && $pCell === null) { + $cellID = 'A1'; + $pCell = $this->workbook->getActiveSheet()->getCell($cellID); + } else { + // Disable calculation cacheing because it only applies to cell calculations, not straight formulae + // But don't actually flush any cache + $resetCache = $this->getCalculationCacheEnabled(); + $this->calculationCacheEnabled = false; + } + + // Execute the calculation + try { + $result = self::unwrapResult($this->_calculateFormulaValue($formula, $cellID, $pCell)); + } catch (PHPExcel_Exception $e) { + throw new PHPExcel_Calculation_Exception($e->getMessage()); + } + + if ($this->workbook === null) { + // Reset calculation cacheing to its previous state + $this->calculationCacheEnabled = $resetCache; + } + + return $result; + } + + + public function getValueFromCache($cellReference, &$cellValue) + { + // Is calculation cacheing enabled? + // Is the value present in calculation cache? + $this->_debugLog->writeDebugLog('Testing cache value for cell ', $cellReference); + if (($this->calculationCacheEnabled) && (isset($this->calculationCache[$cellReference]))) { + $this->_debugLog->writeDebugLog('Retrieving value for cell ', $cellReference, ' from cache'); + // Return the cached result + $cellValue = $this->calculationCache[$cellReference]; + return true; + } + return false; + } + + public function saveValueToCache($cellReference, $cellValue) + { + if ($this->calculationCacheEnabled) { + $this->calculationCache[$cellReference] = $cellValue; + } + } + + /** + * Parse a cell formula and calculate its value + * + * @param string $formula The formula to parse and calculate + * @param string $cellID The ID (e.g. A3) of the cell that we are calculating + * @param PHPExcel_Cell $pCell Cell to calculate + * @return mixed + * @throws PHPExcel_Calculation_Exception + */ + public function _calculateFormulaValue($formula, $cellID = null, PHPExcel_Cell $pCell = null) + { + $cellValue = null; + + // Basic validation that this is indeed a formula + // We simply return the cell value if not + $formula = trim($formula); + if ($formula{0} != '=') { + return self::wrapResult($formula); + } + $formula = ltrim(substr($formula, 1)); + if (!isset($formula{0})) { + return self::wrapResult($formula); + } + + $pCellParent = ($pCell !== null) ? $pCell->getWorksheet() : null; + $wsTitle = ($pCellParent !== null) ? $pCellParent->getTitle() : "\x00Wrk"; + $wsCellReference = $wsTitle . '!' . $cellID; + + if (($cellID !== null) && ($this->getValueFromCache($wsCellReference, $cellValue))) { + return $cellValue; + } + + if (($wsTitle{0} !== "\x00") && ($this->cyclicReferenceStack->onStack($wsCellReference))) { + if ($this->cyclicFormulaCount <= 0) { + $this->cyclicFormulaCell = ''; + return $this->raiseFormulaError('Cyclic Reference in Formula'); + } elseif ($this->cyclicFormulaCell === $wsCellReference) { + ++$this->cyclicFormulaCounter; + if ($this->cyclicFormulaCounter >= $this->cyclicFormulaCount) { + $this->cyclicFormulaCell = ''; + return $cellValue; + } + } elseif ($this->cyclicFormulaCell == '') { + if ($this->cyclicFormulaCounter >= $this->cyclicFormulaCount) { + return $cellValue; + } + $this->cyclicFormulaCell = $wsCellReference; + } + } + + // Parse the formula onto the token stack and calculate the value + $this->cyclicReferenceStack->push($wsCellReference); + $cellValue = $this->processTokenStack($this->_parseFormula($formula, $pCell), $cellID, $pCell); + $this->cyclicReferenceStack->pop(); + + // Save to calculation cache + if ($cellID !== null) { + $this->saveValueToCache($wsCellReference, $cellValue); + } + + // Return the calculated value + return $cellValue; + } + + + /** + * Ensure that paired matrix operands are both matrices and of the same size + * + * @param mixed &$operand1 First matrix operand + * @param mixed &$operand2 Second matrix operand + * @param integer $resize Flag indicating whether the matrices should be resized to match + * and (if so), whether the smaller dimension should grow or the + * larger should shrink. + * 0 = no resize + * 1 = shrink to fit + * 2 = extend to fit + */ + private static function checkMatrixOperands(&$operand1, &$operand2, $resize = 1) + { + // Examine each of the two operands, and turn them into an array if they aren't one already + // Note that this function should only be called if one or both of the operand is already an array + if (!is_array($operand1)) { + list($matrixRows, $matrixColumns) = self::getMatrixDimensions($operand2); + $operand1 = array_fill(0, $matrixRows, array_fill(0, $matrixColumns, $operand1)); + $resize = 0; + } elseif (!is_array($operand2)) { + list($matrixRows, $matrixColumns) = self::getMatrixDimensions($operand1); + $operand2 = array_fill(0, $matrixRows, array_fill(0, $matrixColumns, $operand2)); + $resize = 0; + } + + list($matrix1Rows, $matrix1Columns) = self::getMatrixDimensions($operand1); + list($matrix2Rows, $matrix2Columns) = self::getMatrixDimensions($operand2); + if (($matrix1Rows == $matrix2Columns) && ($matrix2Rows == $matrix1Columns)) { + $resize = 1; + } + + if ($resize == 2) { + // Given two matrices of (potentially) unequal size, convert the smaller in each dimension to match the larger + self::resizeMatricesExtend($operand1, $operand2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns); + } elseif ($resize == 1) { + // Given two matrices of (potentially) unequal size, convert the larger in each dimension to match the smaller + self::resizeMatricesShrink($operand1, $operand2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns); + } + return array( $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns); + } + + + /** + * Read the dimensions of a matrix, and re-index it with straight numeric keys starting from row 0, column 0 + * + * @param mixed &$matrix matrix operand + * @return array An array comprising the number of rows, and number of columns + */ + private static function getMatrixDimensions(&$matrix) + { + $matrixRows = count($matrix); + $matrixColumns = 0; + foreach ($matrix as $rowKey => $rowValue) { + $matrixColumns = max(count($rowValue), $matrixColumns); + if (!is_array($rowValue)) { + $matrix[$rowKey] = array($rowValue); + } else { + $matrix[$rowKey] = array_values($rowValue); + } + } + $matrix = array_values($matrix); + return array($matrixRows, $matrixColumns); + } + + + /** + * Ensure that paired matrix operands are both matrices of the same size + * + * @param mixed &$matrix1 First matrix operand + * @param mixed &$matrix2 Second matrix operand + * @param integer $matrix1Rows Row size of first matrix operand + * @param integer $matrix1Columns Column size of first matrix operand + * @param integer $matrix2Rows Row size of second matrix operand + * @param integer $matrix2Columns Column size of second matrix operand + */ + private static function resizeMatricesShrink(&$matrix1, &$matrix2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns) + { + if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) { + if ($matrix2Rows < $matrix1Rows) { + for ($i = $matrix2Rows; $i < $matrix1Rows; ++$i) { + unset($matrix1[$i]); + } + } + if ($matrix2Columns < $matrix1Columns) { + for ($i = 0; $i < $matrix1Rows; ++$i) { + for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) { + unset($matrix1[$i][$j]); + } + } + } + } + + if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) { + if ($matrix1Rows < $matrix2Rows) { + for ($i = $matrix1Rows; $i < $matrix2Rows; ++$i) { + unset($matrix2[$i]); + } + } + if ($matrix1Columns < $matrix2Columns) { + for ($i = 0; $i < $matrix2Rows; ++$i) { + for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) { + unset($matrix2[$i][$j]); + } + } + } + } + } + + + /** + * Ensure that paired matrix operands are both matrices of the same size + * + * @param mixed &$matrix1 First matrix operand + * @param mixed &$matrix2 Second matrix operand + * @param integer $matrix1Rows Row size of first matrix operand + * @param integer $matrix1Columns Column size of first matrix operand + * @param integer $matrix2Rows Row size of second matrix operand + * @param integer $matrix2Columns Column size of second matrix operand + */ + private static function resizeMatricesExtend(&$matrix1, &$matrix2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns) + { + if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) { + if ($matrix2Columns < $matrix1Columns) { + for ($i = 0; $i < $matrix2Rows; ++$i) { + $x = $matrix2[$i][$matrix2Columns-1]; + for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) { + $matrix2[$i][$j] = $x; + } + } + } + if ($matrix2Rows < $matrix1Rows) { + $x = $matrix2[$matrix2Rows-1]; + for ($i = 0; $i < $matrix1Rows; ++$i) { + $matrix2[$i] = $x; + } + } + } + + if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) { + if ($matrix1Columns < $matrix2Columns) { + for ($i = 0; $i < $matrix1Rows; ++$i) { + $x = $matrix1[$i][$matrix1Columns-1]; + for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) { + $matrix1[$i][$j] = $x; + } + } + } + if ($matrix1Rows < $matrix2Rows) { + $x = $matrix1[$matrix1Rows-1]; + for ($i = 0; $i < $matrix2Rows; ++$i) { + $matrix1[$i] = $x; + } + } + } + } + + + /** + * Format details of an operand for display in the log (based on operand type) + * + * @param mixed $value First matrix operand + * @return mixed + */ + private function showValue($value) + { + if ($this->_debugLog->getWriteDebugLog()) { + $testArray = PHPExcel_Calculation_Functions::flattenArray($value); + if (count($testArray) == 1) { + $value = array_pop($testArray); + } + + if (is_array($value)) { + $returnMatrix = array(); + $pad = $rpad = ', '; + foreach ($value as $row) { + if (is_array($row)) { + $returnMatrix[] = implode($pad, array_map(array($this, 'showValue'), $row)); + $rpad = '; '; + } else { + $returnMatrix[] = $this->showValue($row); + } + } + return '{ '.implode($rpad, $returnMatrix).' }'; + } elseif (is_string($value) && (trim($value, '"') == $value)) { + return '"'.$value.'"'; + } elseif (is_bool($value)) { + return ($value) ? self::$localeBoolean['TRUE'] : self::$localeBoolean['FALSE']; + } + } + return PHPExcel_Calculation_Functions::flattenSingleValue($value); + } + + + /** + * Format type and details of an operand for display in the log (based on operand type) + * + * @param mixed $value First matrix operand + * @return mixed + */ + private function showTypeDetails($value) + { + if ($this->_debugLog->getWriteDebugLog()) { + $testArray = PHPExcel_Calculation_Functions::flattenArray($value); + if (count($testArray) == 1) { + $value = array_pop($testArray); + } + + if ($value === null) { + return 'a NULL value'; + } elseif (is_float($value)) { + $typeString = 'a floating point number'; + } elseif (is_int($value)) { + $typeString = 'an integer number'; + } elseif (is_bool($value)) { + $typeString = 'a boolean'; + } elseif (is_array($value)) { + $typeString = 'a matrix'; + } else { + if ($value == '') { + return 'an empty string'; + } elseif ($value{0} == '#') { + return 'a '.$value.' error'; + } else { + $typeString = 'a string'; + } + } + return $typeString.' with a value of '.$this->showValue($value); + } + } + + + private function convertMatrixReferences($formula) + { + static $matrixReplaceFrom = array('{', ';', '}'); + static $matrixReplaceTo = array('MKMATRIX(MKMATRIX(', '),MKMATRIX(', '))'); + + // Convert any Excel matrix references to the MKMATRIX() function + if (strpos($formula, '{') !== false) { + // If there is the possibility of braces within a quoted string, then we don't treat those as matrix indicators + if (strpos($formula, '"') !== false) { + // So instead we skip replacing in any quoted strings by only replacing in every other array element after we've exploded + // the formula + $temp = explode('"', $formula); + // Open and Closed counts used for trapping mismatched braces in the formula + $openCount = $closeCount = 0; + $i = false; + foreach ($temp as &$value) { + // Only count/replace in alternating array entries + if ($i = !$i) { + $openCount += substr_count($value, '{'); + $closeCount += substr_count($value, '}'); + $value = str_replace($matrixReplaceFrom, $matrixReplaceTo, $value); + } + } + unset($value); + // Then rebuild the formula string + $formula = implode('"', $temp); + } else { + // If there's no quoted strings, then we do a simple count/replace + $openCount = substr_count($formula, '{'); + $closeCount = substr_count($formula, '}'); + $formula = str_replace($matrixReplaceFrom, $matrixReplaceTo, $formula); + } + // Trap for mismatched braces and trigger an appropriate error + if ($openCount < $closeCount) { + if ($openCount > 0) { + return $this->raiseFormulaError("Formula Error: Mismatched matrix braces '}'"); + } else { + return $this->raiseFormulaError("Formula Error: Unexpected '}' encountered"); + } + } elseif ($openCount > $closeCount) { + if ($closeCount > 0) { + return $this->raiseFormulaError("Formula Error: Mismatched matrix braces '{'"); + } else { + return $this->raiseFormulaError("Formula Error: Unexpected '{' encountered"); + } + } + } + + return $formula; + } + + + private static function mkMatrix() + { + return func_get_args(); + } + + + // Binary Operators + // These operators always work on two values + // Array key is the operator, the value indicates whether this is a left or right associative operator + private static $operatorAssociativity = array( + '^' => 0, // Exponentiation + '*' => 0, '/' => 0, // Multiplication and Division + '+' => 0, '-' => 0, // Addition and Subtraction + '&' => 0, // Concatenation + '|' => 0, ':' => 0, // Intersect and Range + '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0 // Comparison + ); + + // Comparison (Boolean) Operators + // These operators work on two values, but always return a boolean result + private static $comparisonOperators = array('>' => true, '<' => true, '=' => true, '>=' => true, '<=' => true, '<>' => true); + + // Operator Precedence + // This list includes all valid operators, whether binary (including boolean) or unary (such as %) + // Array key is the operator, the value is its precedence + private static $operatorPrecedence = array( + ':' => 8, // Range + '|' => 7, // Intersect + '~' => 6, // Negation + '%' => 5, // Percentage + '^' => 4, // Exponentiation + '*' => 3, '/' => 3, // Multiplication and Division + '+' => 2, '-' => 2, // Addition and Subtraction + '&' => 1, // Concatenation + '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0 // Comparison + ); + + // Convert infix to postfix notation + private function _parseFormula($formula, PHPExcel_Cell $pCell = null) + { + if (($formula = $this->convertMatrixReferences(trim($formula))) === false) { + return false; + } + + // If we're using cell caching, then $pCell may well be flushed back to the cache (which detaches the parent worksheet), + // so we store the parent worksheet so that we can re-attach it when necessary + $pCellParent = ($pCell !== null) ? $pCell->getWorksheet() : null; + + $regexpMatchString = '/^('.self::CALCULATION_REGEXP_FUNCTION. + '|'.self::CALCULATION_REGEXP_CELLREF. + '|'.self::CALCULATION_REGEXP_NUMBER. + '|'.self::CALCULATION_REGEXP_STRING. + '|'.self::CALCULATION_REGEXP_OPENBRACE. + '|'.self::CALCULATION_REGEXP_NAMEDRANGE. + '|'.self::CALCULATION_REGEXP_ERROR. + ')/si'; + + // Start with initialisation + $index = 0; + $stack = new PHPExcel_Calculation_Token_Stack; + $output = array(); + $expectingOperator = false; // We use this test in syntax-checking the expression to determine when a + // - is a negation or + is a positive operator rather than an operation + $expectingOperand = false; // We use this test in syntax-checking the expression to determine whether an operand + // should be null in a function call + // The guts of the lexical parser + // Loop through the formula extracting each operator and operand in turn + while (true) { +//echo 'Assessing Expression '.substr($formula, $index), PHP_EOL; + $opCharacter = $formula{$index}; // Get the first character of the value at the current index position +//echo 'Initial character of expression block is '.$opCharacter, PHP_EOL; + if ((isset(self::$comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset(self::$comparisonOperators[$formula{$index+1}]))) { + $opCharacter .= $formula{++$index}; +//echo 'Initial character of expression block is comparison operator '.$opCharacter.PHP_EOL; + } + + // Find out if we're currently at the beginning of a number, variable, cell reference, function, parenthesis or operand + $isOperandOrFunction = preg_match($regexpMatchString, substr($formula, $index), $match); +//echo '$isOperandOrFunction is '.(($isOperandOrFunction) ? 'True' : 'False').PHP_EOL; +//var_dump($match); + + if ($opCharacter == '-' && !$expectingOperator) { // Is it a negation instead of a minus? +//echo 'Element is a Negation operator', PHP_EOL; + $stack->push('Unary Operator', '~'); // Put a negation on the stack + ++$index; // and drop the negation symbol + } elseif ($opCharacter == '%' && $expectingOperator) { +//echo 'Element is a Percentage operator', PHP_EOL; + $stack->push('Unary Operator', '%'); // Put a percentage on the stack + ++$index; + } elseif ($opCharacter == '+' && !$expectingOperator) { // Positive (unary plus rather than binary operator plus) can be discarded? +//echo 'Element is a Positive number, not Plus operator', PHP_EOL; + ++$index; // Drop the redundant plus symbol + } elseif ((($opCharacter == '~') || ($opCharacter == '|')) && (!$isOperandOrFunction)) { // We have to explicitly deny a tilde or pipe, because they are legal + return $this->raiseFormulaError("Formula Error: Illegal character '~'"); // on the stack but not in the input expression + + } elseif ((isset(self::$operators[$opCharacter]) or $isOperandOrFunction) && $expectingOperator) { // Are we putting an operator on the stack? +//echo 'Element with value '.$opCharacter.' is an Operator', PHP_EOL; + while ($stack->count() > 0 && + ($o2 = $stack->last()) && + isset(self::$operators[$o2['value']]) && + @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])) { + $output[] = $stack->pop(); // Swap operands and higher precedence operators from the stack to the output + } + $stack->push('Binary Operator', $opCharacter); // Finally put our current operator onto the stack + ++$index; + $expectingOperator = false; + + } elseif ($opCharacter == ')' && $expectingOperator) { // Are we expecting to close a parenthesis? +//echo 'Element is a Closing bracket', PHP_EOL; + $expectingOperand = false; + while (($o2 = $stack->pop()) && $o2['value'] != '(') { // Pop off the stack back to the last ( + if ($o2 === null) { + return $this->raiseFormulaError('Formula Error: Unexpected closing brace ")"'); + } else { + $output[] = $o2; + } + } + $d = $stack->last(2); + if (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches)) { // Did this parenthesis just close a function? + $functionName = $matches[1]; // Get the function name +//echo 'Closed Function is '.$functionName, PHP_EOL; + $d = $stack->pop(); + $argumentCount = $d['value']; // See how many arguments there were (argument count is the next value stored on the stack) +//if ($argumentCount == 0) { +// echo 'With no arguments', PHP_EOL; +//} elseif ($argumentCount == 1) { +// echo 'With 1 argument', PHP_EOL; +//} else { +// echo 'With '.$argumentCount.' arguments', PHP_EOL; +//} + $output[] = $d; // Dump the argument count on the output + $output[] = $stack->pop(); // Pop the function and push onto the output + if (isset(self::$controlFunctions[$functionName])) { +//echo 'Built-in function '.$functionName, PHP_EOL; + $expectedArgumentCount = self::$controlFunctions[$functionName]['argumentCount']; + $functionCall = self::$controlFunctions[$functionName]['functionCall']; + } elseif (isset(self::$PHPExcelFunctions[$functionName])) { +//echo 'PHPExcel function '.$functionName, PHP_EOL; + $expectedArgumentCount = self::$PHPExcelFunctions[$functionName]['argumentCount']; + $functionCall = self::$PHPExcelFunctions[$functionName]['functionCall']; + } else { // did we somehow push a non-function on the stack? this should never happen + return $this->raiseFormulaError("Formula Error: Internal error, non-function on stack"); + } + // Check the argument count + $argumentCountError = false; + if (is_numeric($expectedArgumentCount)) { + if ($expectedArgumentCount < 0) { +//echo '$expectedArgumentCount is between 0 and '.abs($expectedArgumentCount), PHP_EOL; + if ($argumentCount > abs($expectedArgumentCount)) { + $argumentCountError = true; + $expectedArgumentCountString = 'no more than '.abs($expectedArgumentCount); + } + } else { +//echo '$expectedArgumentCount is numeric '.$expectedArgumentCount, PHP_EOL; + if ($argumentCount != $expectedArgumentCount) { + $argumentCountError = true; + $expectedArgumentCountString = $expectedArgumentCount; + } + } + } elseif ($expectedArgumentCount != '*') { + $isOperandOrFunction = preg_match('/(\d*)([-+,])(\d*)/', $expectedArgumentCount, $argMatch); +//print_r($argMatch); +//echo PHP_EOL; + switch ($argMatch[2]) { + case '+': + if ($argumentCount < $argMatch[1]) { + $argumentCountError = true; + $expectedArgumentCountString = $argMatch[1].' or more '; + } + break; + case '-': + if (($argumentCount < $argMatch[1]) || ($argumentCount > $argMatch[3])) { + $argumentCountError = true; + $expectedArgumentCountString = 'between '.$argMatch[1].' and '.$argMatch[3]; + } + break; + case ',': + if (($argumentCount != $argMatch[1]) && ($argumentCount != $argMatch[3])) { + $argumentCountError = true; + $expectedArgumentCountString = 'either '.$argMatch[1].' or '.$argMatch[3]; + } + break; + } + } + if ($argumentCountError) { + return $this->raiseFormulaError("Formula Error: Wrong number of arguments for $functionName() function: $argumentCount given, ".$expectedArgumentCountString." expected"); + } + } + ++$index; + + } elseif ($opCharacter == ',') { // Is this the separator for function arguments? +//echo 'Element is a Function argument separator', PHP_EOL; + while (($o2 = $stack->pop()) && $o2['value'] != '(') { // Pop off the stack back to the last ( + if ($o2 === null) { + return $this->raiseFormulaError("Formula Error: Unexpected ,"); + } else { + $output[] = $o2; // pop the argument expression stuff and push onto the output + } + } + // If we've a comma when we're expecting an operand, then what we actually have is a null operand; + // so push a null onto the stack + if (($expectingOperand) || (!$expectingOperator)) { + $output[] = array('type' => 'NULL Value', 'value' => self::$excelConstants['NULL'], 'reference' => null); + } + // make sure there was a function + $d = $stack->last(2); + if (!preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches)) { + return $this->raiseFormulaError("Formula Error: Unexpected ,"); + } + $d = $stack->pop(); + $stack->push($d['type'], ++$d['value'], $d['reference']); // increment the argument count + $stack->push('Brace', '('); // put the ( back on, we'll need to pop back to it again + $expectingOperator = false; + $expectingOperand = true; + ++$index; + + } elseif ($opCharacter == '(' && !$expectingOperator) { +// echo 'Element is an Opening Bracket
'; + $stack->push('Brace', '('); + ++$index; + + } elseif ($isOperandOrFunction && !$expectingOperator) { // do we now have a function/variable/number? + $expectingOperator = true; + $expectingOperand = false; + $val = $match[1]; + $length = strlen($val); +// echo 'Element with value '.$val.' is an Operand, Variable, Constant, String, Number, Cell Reference or Function
'; + + if (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $val, $matches)) { + $val = preg_replace('/\s/u', '', $val); +// echo 'Element '.$val.' is a Function
'; + if (isset(self::$PHPExcelFunctions[strtoupper($matches[1])]) || isset(self::$controlFunctions[strtoupper($matches[1])])) { // it's a function + $stack->push('Function', strtoupper($val)); + $ax = preg_match('/^\s*(\s*\))/ui', substr($formula, $index+$length), $amatch); + if ($ax) { + $stack->push('Operand Count for Function '.strtoupper($val).')', 0); + $expectingOperator = true; + } else { + $stack->push('Operand Count for Function '.strtoupper($val).')', 1); + $expectingOperator = false; + } + $stack->push('Brace', '('); + } else { // it's a var w/ implicit multiplication + $output[] = array('type' => 'Value', 'value' => $matches[1], 'reference' => null); + } + } elseif (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $val, $matches)) { +// echo 'Element '.$val.' is a Cell reference
'; + // Watch for this case-change when modifying to allow cell references in different worksheets... + // Should only be applied to the actual cell column, not the worksheet name + + // If the last entry on the stack was a : operator, then we have a cell range reference + $testPrevOp = $stack->last(1); + if ($testPrevOp['value'] == ':') { + // If we have a worksheet reference, then we're playing with a 3D reference + if ($matches[2] == '') { + // Otherwise, we 'inherit' the worksheet reference from the start cell reference + // The start of the cell range reference should be the last entry in $output + $startCellRef = $output[count($output)-1]['value']; + preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $startCellRef, $startMatches); + if ($startMatches[2] > '') { + $val = $startMatches[2].'!'.$val; + } + } else { + return $this->raiseFormulaError("3D Range references are not yet supported"); + } + } + + $output[] = array('type' => 'Cell Reference', 'value' => $val, 'reference' => $val); +// $expectingOperator = FALSE; + } else { // it's a variable, constant, string, number or boolean +// echo 'Element is a Variable, Constant, String, Number or Boolean
'; + // If the last entry on the stack was a : operator, then we may have a row or column range reference + $testPrevOp = $stack->last(1); + if ($testPrevOp['value'] == ':') { + $startRowColRef = $output[count($output)-1]['value']; + $rangeWS1 = ''; + if (strpos('!', $startRowColRef) !== false) { + list($rangeWS1, $startRowColRef) = explode('!', $startRowColRef); + } + if ($rangeWS1 != '') { + $rangeWS1 .= '!'; + } + $rangeWS2 = $rangeWS1; + if (strpos('!', $val) !== false) { + list($rangeWS2, $val) = explode('!', $val); + } + if ($rangeWS2 != '') { + $rangeWS2 .= '!'; + } + if ((is_integer($startRowColRef)) && (ctype_digit($val)) && + ($startRowColRef <= 1048576) && ($val <= 1048576)) { + // Row range + $endRowColRef = ($pCellParent !== null) ? $pCellParent->getHighestColumn() : 'XFD'; // Max 16,384 columns for Excel2007 + $output[count($output)-1]['value'] = $rangeWS1.'A'.$startRowColRef; + $val = $rangeWS2.$endRowColRef.$val; + } elseif ((ctype_alpha($startRowColRef)) && (ctype_alpha($val)) && + (strlen($startRowColRef) <= 3) && (strlen($val) <= 3)) { + // Column range + $endRowColRef = ($pCellParent !== null) ? $pCellParent->getHighestRow() : 1048576; // Max 1,048,576 rows for Excel2007 + $output[count($output)-1]['value'] = $rangeWS1.strtoupper($startRowColRef).'1'; + $val = $rangeWS2.$val.$endRowColRef; + } + } + + $localeConstant = false; + if ($opCharacter == '"') { +// echo 'Element is a String
'; + // UnEscape any quotes within the string + $val = self::wrapResult(str_replace('""', '"', self::unwrapResult($val))); + } elseif (is_numeric($val)) { +// echo 'Element is a Number
'; + if ((strpos($val, '.') !== false) || (stripos($val, 'e') !== false) || ($val > PHP_INT_MAX) || ($val < -PHP_INT_MAX)) { +// echo 'Casting '.$val.' to float
'; + $val = (float) $val; + } else { +// echo 'Casting '.$val.' to integer
'; + $val = (integer) $val; + } + } elseif (isset(self::$excelConstants[trim(strtoupper($val))])) { + $excelConstant = trim(strtoupper($val)); +// echo 'Element '.$excelConstant.' is an Excel Constant
'; + $val = self::$excelConstants[$excelConstant]; + } elseif (($localeConstant = array_search(trim(strtoupper($val)), self::$localeBoolean)) !== false) { +// echo 'Element '.$localeConstant.' is an Excel Constant
'; + $val = self::$excelConstants[$localeConstant]; + } + $details = array('type' => 'Value', 'value' => $val, 'reference' => null); + if ($localeConstant) { + $details['localeValue'] = $localeConstant; + } + $output[] = $details; + } + $index += $length; + + } elseif ($opCharacter == '$') { // absolute row or column range + ++$index; + } elseif ($opCharacter == ')') { // miscellaneous error checking + if ($expectingOperand) { + $output[] = array('type' => 'NULL Value', 'value' => self::$excelConstants['NULL'], 'reference' => null); + $expectingOperand = false; + $expectingOperator = true; + } else { + return $this->raiseFormulaError("Formula Error: Unexpected ')'"); + } + } elseif (isset(self::$operators[$opCharacter]) && !$expectingOperator) { + return $this->raiseFormulaError("Formula Error: Unexpected operator '$opCharacter'"); + } else { // I don't even want to know what you did to get here + return $this->raiseFormulaError("Formula Error: An unexpected error occured"); + } + // Test for end of formula string + if ($index == strlen($formula)) { + // Did we end with an operator?. + // Only valid for the % unary operator + if ((isset(self::$operators[$opCharacter])) && ($opCharacter != '%')) { + return $this->raiseFormulaError("Formula Error: Operator '$opCharacter' has no operands"); + } else { + break; + } + } + // Ignore white space + while (($formula{$index} == "\n") || ($formula{$index} == "\r")) { + ++$index; + } + if ($formula{$index} == ' ') { + while ($formula{$index} == ' ') { + ++$index; + } + // If we're expecting an operator, but only have a space between the previous and next operands (and both are + // Cell References) then we have an INTERSECTION operator +// echo 'Possible Intersect Operator
'; + if (($expectingOperator) && (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'.*/Ui', substr($formula, $index), $match)) && + ($output[count($output)-1]['type'] == 'Cell Reference')) { +// echo 'Element is an Intersect Operator
'; + while ($stack->count() > 0 && + ($o2 = $stack->last()) && + isset(self::$operators[$o2['value']]) && + @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])) { + $output[] = $stack->pop(); // Swap operands and higher precedence operators from the stack to the output + } + $stack->push('Binary Operator', '|'); // Put an Intersect Operator on the stack + $expectingOperator = false; + } + } + } + + while (($op = $stack->pop()) !== null) { // pop everything off the stack and push onto output + if ((is_array($op) && $op['value'] == '(') || ($op === '(')) { + return $this->raiseFormulaError("Formula Error: Expecting ')'"); // if there are any opening braces on the stack, then braces were unbalanced + } + $output[] = $op; + } + return $output; + } + + + private static function dataTestReference(&$operandData) + { + $operand = $operandData['value']; + if (($operandData['reference'] === null) && (is_array($operand))) { + $rKeys = array_keys($operand); + $rowKey = array_shift($rKeys); + $cKeys = array_keys(array_keys($operand[$rowKey])); + $colKey = array_shift($cKeys); + if (ctype_upper($colKey)) { + $operandData['reference'] = $colKey.$rowKey; + } + } + return $operand; + } + + // evaluate postfix notation + private function processTokenStack($tokens, $cellID = null, PHPExcel_Cell $pCell = null) + { + if ($tokens == false) { + return false; + } + + // If we're using cell caching, then $pCell may well be flushed back to the cache (which detaches the parent cell collection), + // so we store the parent cell collection so that we can re-attach it when necessary + $pCellWorksheet = ($pCell !== null) ? $pCell->getWorksheet() : null; + $pCellParent = ($pCell !== null) ? $pCell->getParent() : null; + $stack = new PHPExcel_Calculation_Token_Stack; + + // Loop through each token in turn + foreach ($tokens as $tokenData) { +// print_r($tokenData); +// echo '
'; + $token = $tokenData['value']; +// echo 'Token is '.$token.'
'; + // if the token is a binary operator, pop the top two values off the stack, do the operation, and push the result back on the stack + if (isset(self::$binaryOperators[$token])) { +// echo 'Token is a binary operator
'; + // We must have two operands, error if we don't + if (($operand2Data = $stack->pop()) === null) { + return $this->raiseFormulaError('Internal error - Operand value missing from stack'); + } + if (($operand1Data = $stack->pop()) === null) { + return $this->raiseFormulaError('Internal error - Operand value missing from stack'); + } + + $operand1 = self::dataTestReference($operand1Data); + $operand2 = self::dataTestReference($operand2Data); + + // Log what we're doing + if ($token == ':') { + $this->_debugLog->writeDebugLog('Evaluating Range ', $this->showValue($operand1Data['reference']), ' ', $token, ' ', $this->showValue($operand2Data['reference'])); + } else { + $this->_debugLog->writeDebugLog('Evaluating ', $this->showValue($operand1), ' ', $token, ' ', $this->showValue($operand2)); + } + + // Process the operation in the appropriate manner + switch ($token) { + // Comparison (Boolean) Operators + case '>': // Greater than + case '<': // Less than + case '>=': // Greater than or Equal to + case '<=': // Less than or Equal to + case '=': // Equality + case '<>': // Inequality + $this->executeBinaryComparisonOperation($cellID, $operand1, $operand2, $token, $stack); + break; + // Binary Operators + case ':': // Range + $sheet1 = $sheet2 = ''; + if (strpos($operand1Data['reference'], '!') !== false) { + list($sheet1, $operand1Data['reference']) = explode('!', $operand1Data['reference']); + } else { + $sheet1 = ($pCellParent !== null) ? $pCellWorksheet->getTitle() : ''; + } + if (strpos($operand2Data['reference'], '!') !== false) { + list($sheet2, $operand2Data['reference']) = explode('!', $operand2Data['reference']); + } else { + $sheet2 = $sheet1; + } + if ($sheet1 == $sheet2) { + if ($operand1Data['reference'] === null) { + if ((trim($operand1Data['value']) != '') && (is_numeric($operand1Data['value']))) { + $operand1Data['reference'] = $pCell->getColumn().$operand1Data['value']; + } elseif (trim($operand1Data['reference']) == '') { + $operand1Data['reference'] = $pCell->getCoordinate(); + } else { + $operand1Data['reference'] = $operand1Data['value'].$pCell->getRow(); + } + } + if ($operand2Data['reference'] === null) { + if ((trim($operand2Data['value']) != '') && (is_numeric($operand2Data['value']))) { + $operand2Data['reference'] = $pCell->getColumn().$operand2Data['value']; + } elseif (trim($operand2Data['reference']) == '') { + $operand2Data['reference'] = $pCell->getCoordinate(); + } else { + $operand2Data['reference'] = $operand2Data['value'].$pCell->getRow(); + } + } + + $oData = array_merge(explode(':', $operand1Data['reference']), explode(':', $operand2Data['reference'])); + $oCol = $oRow = array(); + foreach ($oData as $oDatum) { + $oCR = PHPExcel_Cell::coordinateFromString($oDatum); + $oCol[] = PHPExcel_Cell::columnIndexFromString($oCR[0]) - 1; + $oRow[] = $oCR[1]; + } + $cellRef = PHPExcel_Cell::stringFromColumnIndex(min($oCol)).min($oRow).':'.PHPExcel_Cell::stringFromColumnIndex(max($oCol)).max($oRow); + if ($pCellParent !== null) { + $cellValue = $this->extractCellRange($cellRef, $this->workbook->getSheetByName($sheet1), false); + } else { + return $this->raiseFormulaError('Unable to access Cell Reference'); + } + $stack->push('Cell Reference', $cellValue, $cellRef); + } else { + $stack->push('Error', PHPExcel_Calculation_Functions::REF(), null); + } + break; + case '+': // Addition + $this->executeNumericBinaryOperation($cellID, $operand1, $operand2, $token, 'plusEquals', $stack); + break; + case '-': // Subtraction + $this->executeNumericBinaryOperation($cellID, $operand1, $operand2, $token, 'minusEquals', $stack); + break; + case '*': // Multiplication + $this->executeNumericBinaryOperation($cellID, $operand1, $operand2, $token, 'arrayTimesEquals', $stack); + break; + case '/': // Division + $this->executeNumericBinaryOperation($cellID, $operand1, $operand2, $token, 'arrayRightDivide', $stack); + break; + case '^': // Exponential + $this->executeNumericBinaryOperation($cellID, $operand1, $operand2, $token, 'power', $stack); + break; + case '&': // Concatenation + // If either of the operands is a matrix, we need to treat them both as matrices + // (converting the other operand to a matrix if need be); then perform the required + // matrix operation + if (is_bool($operand1)) { + $operand1 = ($operand1) ? self::$localeBoolean['TRUE'] : self::$localeBoolean['FALSE']; + } + if (is_bool($operand2)) { + $operand2 = ($operand2) ? self::$localeBoolean['TRUE'] : self::$localeBoolean['FALSE']; + } + if ((is_array($operand1)) || (is_array($operand2))) { + // Ensure that both operands are arrays/matrices + self::checkMatrixOperands($operand1, $operand2, 2); + try { + // Convert operand 1 from a PHP array to a matrix + $matrix = new PHPExcel_Shared_JAMA_Matrix($operand1); + // Perform the required operation against the operand 1 matrix, passing in operand 2 + $matrixResult = $matrix->concat($operand2); + $result = $matrixResult->getArray(); + } catch (PHPExcel_Exception $ex) { + $this->_debugLog->writeDebugLog('JAMA Matrix Exception: ', $ex->getMessage()); + $result = '#VALUE!'; + } + } else { + $result = '"'.str_replace('""', '"', self::unwrapResult($operand1, '"').self::unwrapResult($operand2, '"')).'"'; + } + $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result)); + $stack->push('Value', $result); + break; + case '|': // Intersect + $rowIntersect = array_intersect_key($operand1, $operand2); + $cellIntersect = $oCol = $oRow = array(); + foreach (array_keys($rowIntersect) as $row) { + $oRow[] = $row; + foreach ($rowIntersect[$row] as $col => $data) { + $oCol[] = PHPExcel_Cell::columnIndexFromString($col) - 1; + $cellIntersect[$row] = array_intersect_key($operand1[$row], $operand2[$row]); + } + } + $cellRef = PHPExcel_Cell::stringFromColumnIndex(min($oCol)).min($oRow).':'.PHPExcel_Cell::stringFromColumnIndex(max($oCol)).max($oRow); + $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($cellIntersect)); + $stack->push('Value', $cellIntersect, $cellRef); + break; + } + + // if the token is a unary operator, pop one value off the stack, do the operation, and push it back on + } elseif (($token === '~') || ($token === '%')) { +// echo 'Token is a unary operator
'; + if (($arg = $stack->pop()) === null) { + return $this->raiseFormulaError('Internal error - Operand value missing from stack'); + } + $arg = $arg['value']; + if ($token === '~') { +// echo 'Token is a negation operator
'; + $this->_debugLog->writeDebugLog('Evaluating Negation of ', $this->showValue($arg)); + $multiplier = -1; + } else { +// echo 'Token is a percentile operator
'; + $this->_debugLog->writeDebugLog('Evaluating Percentile of ', $this->showValue($arg)); + $multiplier = 0.01; + } + if (is_array($arg)) { + self::checkMatrixOperands($arg, $multiplier, 2); + try { + $matrix1 = new PHPExcel_Shared_JAMA_Matrix($arg); + $matrixResult = $matrix1->arrayTimesEquals($multiplier); + $result = $matrixResult->getArray(); + } catch (PHPExcel_Exception $ex) { + $this->_debugLog->writeDebugLog('JAMA Matrix Exception: ', $ex->getMessage()); + $result = '#VALUE!'; + } + $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result)); + $stack->push('Value', $result); + } else { + $this->executeNumericBinaryOperation($cellID, $multiplier, $arg, '*', 'arrayTimesEquals', $stack); + } + + } elseif (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $token, $matches)) { + $cellRef = null; +// echo 'Element '.$token.' is a Cell reference
'; + if (isset($matches[8])) { +// echo 'Reference is a Range of cells
'; + if ($pCell === null) { +// We can't access the range, so return a REF error + $cellValue = PHPExcel_Calculation_Functions::REF(); + } else { + $cellRef = $matches[6].$matches[7].':'.$matches[9].$matches[10]; + if ($matches[2] > '') { + $matches[2] = trim($matches[2], "\"'"); + if ((strpos($matches[2], '[') !== false) || (strpos($matches[2], ']') !== false)) { + // It's a Reference to an external workbook (not currently supported) + return $this->raiseFormulaError('Unable to access External Workbook'); + } + $matches[2] = trim($matches[2], "\"'"); +// echo '$cellRef='.$cellRef.' in worksheet '.$matches[2].'
'; + $this->_debugLog->writeDebugLog('Evaluating Cell Range ', $cellRef, ' in worksheet ', $matches[2]); + if ($pCellParent !== null) { + $cellValue = $this->extractCellRange($cellRef, $this->workbook->getSheetByName($matches[2]), false); + } else { + return $this->raiseFormulaError('Unable to access Cell Reference'); + } + $this->_debugLog->writeDebugLog('Evaluation Result for cells ', $cellRef, ' in worksheet ', $matches[2], ' is ', $this->showTypeDetails($cellValue)); +// $cellRef = $matches[2].'!'.$cellRef; + } else { +// echo '$cellRef='.$cellRef.' in current worksheet
'; + $this->_debugLog->writeDebugLog('Evaluating Cell Range ', $cellRef, ' in current worksheet'); + if ($pCellParent !== null) { + $cellValue = $this->extractCellRange($cellRef, $pCellWorksheet, false); + } else { + return $this->raiseFormulaError('Unable to access Cell Reference'); + } + $this->_debugLog->writeDebugLog('Evaluation Result for cells ', $cellRef, ' is ', $this->showTypeDetails($cellValue)); + } + } + } else { +// echo 'Reference is a single Cell
'; + if ($pCell === null) { +// We can't access the cell, so return a REF error + $cellValue = PHPExcel_Calculation_Functions::REF(); + } else { + $cellRef = $matches[6].$matches[7]; + if ($matches[2] > '') { + $matches[2] = trim($matches[2], "\"'"); + if ((strpos($matches[2], '[') !== false) || (strpos($matches[2], ']') !== false)) { + // It's a Reference to an external workbook (not currently supported) + return $this->raiseFormulaError('Unable to access External Workbook'); + } +// echo '$cellRef='.$cellRef.' in worksheet '.$matches[2].'
'; + $this->_debugLog->writeDebugLog('Evaluating Cell ', $cellRef, ' in worksheet ', $matches[2]); + if ($pCellParent !== null) { + $cellSheet = $this->workbook->getSheetByName($matches[2]); + if ($cellSheet && $cellSheet->cellExists($cellRef)) { + $cellValue = $this->extractCellRange($cellRef, $this->workbook->getSheetByName($matches[2]), false); + $pCell->attach($pCellParent); + } else { + $cellValue = null; + } + } else { + return $this->raiseFormulaError('Unable to access Cell Reference'); + } + $this->_debugLog->writeDebugLog('Evaluation Result for cell ', $cellRef, ' in worksheet ', $matches[2], ' is ', $this->showTypeDetails($cellValue)); +// $cellRef = $matches[2].'!'.$cellRef; + } else { +// echo '$cellRef='.$cellRef.' in current worksheet
'; + $this->_debugLog->writeDebugLog('Evaluating Cell ', $cellRef, ' in current worksheet'); + if ($pCellParent->isDataSet($cellRef)) { + $cellValue = $this->extractCellRange($cellRef, $pCellWorksheet, false); + $pCell->attach($pCellParent); + } else { + $cellValue = null; + } + $this->_debugLog->writeDebugLog('Evaluation Result for cell ', $cellRef, ' is ', $this->showTypeDetails($cellValue)); + } + } + } + $stack->push('Value', $cellValue, $cellRef); + + // if the token is a function, pop arguments off the stack, hand them to the function, and push the result back on + } elseif (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $token, $matches)) { +// echo 'Token is a function
'; + $functionName = $matches[1]; + $argCount = $stack->pop(); + $argCount = $argCount['value']; + if ($functionName != 'MKMATRIX') { + $this->_debugLog->writeDebugLog('Evaluating Function ', self::localeFunc($functionName), '() with ', (($argCount == 0) ? 'no' : $argCount), ' argument', (($argCount == 1) ? '' : 's')); + } + if ((isset(self::$PHPExcelFunctions[$functionName])) || (isset(self::$controlFunctions[$functionName]))) { // function + if (isset(self::$PHPExcelFunctions[$functionName])) { + $functionCall = self::$PHPExcelFunctions[$functionName]['functionCall']; + $passByReference = isset(self::$PHPExcelFunctions[$functionName]['passByReference']); + $passCellReference = isset(self::$PHPExcelFunctions[$functionName]['passCellReference']); + } elseif (isset(self::$controlFunctions[$functionName])) { + $functionCall = self::$controlFunctions[$functionName]['functionCall']; + $passByReference = isset(self::$controlFunctions[$functionName]['passByReference']); + $passCellReference = isset(self::$controlFunctions[$functionName]['passCellReference']); + } + // get the arguments for this function +// echo 'Function '.$functionName.' expects '.$argCount.' arguments
'; + $args = $argArrayVals = array(); + for ($i = 0; $i < $argCount; ++$i) { + $arg = $stack->pop(); + $a = $argCount - $i - 1; + if (($passByReference) && + (isset(self::$PHPExcelFunctions[$functionName]['passByReference'][$a])) && + (self::$PHPExcelFunctions[$functionName]['passByReference'][$a])) { + if ($arg['reference'] === null) { + $args[] = $cellID; + if ($functionName != 'MKMATRIX') { + $argArrayVals[] = $this->showValue($cellID); + } + } else { + $args[] = $arg['reference']; + if ($functionName != 'MKMATRIX') { + $argArrayVals[] = $this->showValue($arg['reference']); + } + } + } else { + $args[] = self::unwrapResult($arg['value']); + if ($functionName != 'MKMATRIX') { + $argArrayVals[] = $this->showValue($arg['value']); + } + } + } + // Reverse the order of the arguments + krsort($args); + if (($passByReference) && ($argCount == 0)) { + $args[] = $cellID; + $argArrayVals[] = $this->showValue($cellID); + } +// echo 'Arguments are: '; +// print_r($args); +// echo '
'; + if ($functionName != 'MKMATRIX') { + if ($this->_debugLog->getWriteDebugLog()) { + krsort($argArrayVals); + $this->_debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', implode(self::$localeArgumentSeparator.' ', PHPExcel_Calculation_Functions::flattenArray($argArrayVals)), ' )'); + } + } + // Process each argument in turn, building the return value as an array +// if (($argCount == 1) && (is_array($args[1])) && ($functionName != 'MKMATRIX')) { +// $operand1 = $args[1]; +// $this->_debugLog->writeDebugLog('Argument is a matrix: ', $this->showValue($operand1)); +// $result = array(); +// $row = 0; +// foreach($operand1 as $args) { +// if (is_array($args)) { +// foreach($args as $arg) { +// $this->_debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', $this->showValue($arg), ' )'); +// $r = call_user_func_array($functionCall, $arg); +// $this->_debugLog->writeDebugLog('Evaluation Result for ', self::localeFunc($functionName), '() function call is ', $this->showTypeDetails($r)); +// $result[$row][] = $r; +// } +// ++$row; +// } else { +// $this->_debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', $this->showValue($args), ' )'); +// $r = call_user_func_array($functionCall, $args); +// $this->_debugLog->writeDebugLog('Evaluation Result for ', self::localeFunc($functionName), '() function call is ', $this->showTypeDetails($r)); +// $result[] = $r; +// } +// } +// } else { + // Process the argument with the appropriate function call + if ($passCellReference) { + $args[] = $pCell; + } + if (strpos($functionCall, '::') !== false) { + $result = call_user_func_array(explode('::', $functionCall), $args); + } else { + foreach ($args as &$arg) { + $arg = PHPExcel_Calculation_Functions::flattenSingleValue($arg); + } + unset($arg); + $result = call_user_func_array($functionCall, $args); + } + if ($functionName != 'MKMATRIX') { + $this->_debugLog->writeDebugLog('Evaluation Result for ', self::localeFunc($functionName), '() function call is ', $this->showTypeDetails($result)); + } + $stack->push('Value', self::wrapResult($result)); + } + + } else { + // if the token is a number, boolean, string or an Excel error, push it onto the stack + if (isset(self::$excelConstants[strtoupper($token)])) { + $excelConstant = strtoupper($token); +// echo 'Token is a PHPExcel constant: '.$excelConstant.'
'; + $stack->push('Constant Value', self::$excelConstants[$excelConstant]); + $this->_debugLog->writeDebugLog('Evaluating Constant ', $excelConstant, ' as ', $this->showTypeDetails(self::$excelConstants[$excelConstant])); + } elseif ((is_numeric($token)) || ($token === null) || (is_bool($token)) || ($token == '') || ($token{0} == '"') || ($token{0} == '#')) { +// echo 'Token is a number, boolean, string, null or an Excel error
'; + $stack->push('Value', $token); + // if the token is a named range, push the named range name onto the stack + } elseif (preg_match('/^'.self::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $token, $matches)) { +// echo 'Token is a named range
'; + $namedRange = $matches[6]; +// echo 'Named Range is '.$namedRange.'
'; + $this->_debugLog->writeDebugLog('Evaluating Named Range ', $namedRange); + $cellValue = $this->extractNamedRange($namedRange, ((null !== $pCell) ? $pCellWorksheet : null), false); + $pCell->attach($pCellParent); + $this->_debugLog->writeDebugLog('Evaluation Result for named range ', $namedRange, ' is ', $this->showTypeDetails($cellValue)); + $stack->push('Named Range', $cellValue, $namedRange); + } else { + return $this->raiseFormulaError("undefined variable '$token'"); + } + } + } + // when we're out of tokens, the stack should have a single element, the final result + if ($stack->count() != 1) { + return $this->raiseFormulaError("internal error"); + } + $output = $stack->pop(); + $output = $output['value']; + +// if ((is_array($output)) && (self::$returnArrayAsType != self::RETURN_ARRAY_AS_ARRAY)) { +// return array_shift(PHPExcel_Calculation_Functions::flattenArray($output)); +// } + return $output; + } + + + private function validateBinaryOperand($cellID, &$operand, &$stack) + { + if (is_array($operand)) { + if ((count($operand, COUNT_RECURSIVE) - count($operand)) == 1) { + do { + $operand = array_pop($operand); + } while (is_array($operand)); + } + } + // Numbers, matrices and booleans can pass straight through, as they're already valid + if (is_string($operand)) { + // We only need special validations for the operand if it is a string + // Start by stripping off the quotation marks we use to identify true excel string values internally + if ($operand > '' && $operand{0} == '"') { + $operand = self::unwrapResult($operand); + } + // If the string is a numeric value, we treat it as a numeric, so no further testing + if (!is_numeric($operand)) { + // If not a numeric, test to see if the value is an Excel error, and so can't be used in normal binary operations + if ($operand > '' && $operand{0} == '#') { + $stack->push('Value', $operand); + $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($operand)); + return false; + } elseif (!PHPExcel_Shared_String::convertToNumberIfFraction($operand)) { + // If not a numeric or a fraction, then it's a text string, and so can't be used in mathematical binary operations + $stack->push('Value', '#VALUE!'); + $this->_debugLog->writeDebugLog('Evaluation Result is a ', $this->showTypeDetails('#VALUE!')); + return false; + } + } + } + + // return a true if the value of the operand is one that we can use in normal binary operations + return true; + } + + + private function executeBinaryComparisonOperation($cellID, $operand1, $operand2, $operation, &$stack, $recursingArrays = false) + { + // If we're dealing with matrix operations, we want a matrix result + if ((is_array($operand1)) || (is_array($operand2))) { + $result = array(); + if ((is_array($operand1)) && (!is_array($operand2))) { + foreach ($operand1 as $x => $operandData) { + $this->_debugLog->writeDebugLog('Evaluating Comparison ', $this->showValue($operandData), ' ', $operation, ' ', $this->showValue($operand2)); + $this->executeBinaryComparisonOperation($cellID, $operandData, $operand2, $operation, $stack); + $r = $stack->pop(); + $result[$x] = $r['value']; + } + } elseif ((!is_array($operand1)) && (is_array($operand2))) { + foreach ($operand2 as $x => $operandData) { + $this->_debugLog->writeDebugLog('Evaluating Comparison ', $this->showValue($operand1), ' ', $operation, ' ', $this->showValue($operandData)); + $this->executeBinaryComparisonOperation($cellID, $operand1, $operandData, $operation, $stack); + $r = $stack->pop(); + $result[$x] = $r['value']; + } + } else { + if (!$recursingArrays) { + self::checkMatrixOperands($operand1, $operand2, 2); + } + foreach ($operand1 as $x => $operandData) { + $this->_debugLog->writeDebugLog('Evaluating Comparison ', $this->showValue($operandData), ' ', $operation, ' ', $this->showValue($operand2[$x])); + $this->executeBinaryComparisonOperation($cellID, $operandData, $operand2[$x], $operation, $stack, true); + $r = $stack->pop(); + $result[$x] = $r['value']; + } + } + // Log the result details + $this->_debugLog->writeDebugLog('Comparison Evaluation Result is ', $this->showTypeDetails($result)); + // And push the result onto the stack + $stack->push('Array', $result); + return true; + } + + // Simple validate the two operands if they are string values + if (is_string($operand1) && $operand1 > '' && $operand1{0} == '"') { + $operand1 = self::unwrapResult($operand1); + } + if (is_string($operand2) && $operand2 > '' && $operand2{0} == '"') { + $operand2 = self::unwrapResult($operand2); + } + + // Use case insensitive comparaison if not OpenOffice mode + if (PHPExcel_Calculation_Functions::getCompatibilityMode() != PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { + if (is_string($operand1)) { + $operand1 = strtoupper($operand1); + } + if (is_string($operand2)) { + $operand2 = strtoupper($operand2); + } + } + + $useLowercaseFirstComparison = is_string($operand1) && is_string($operand2) && PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE; + + // execute the necessary operation + switch ($operation) { + // Greater than + case '>': + if ($useLowercaseFirstComparison) { + $result = $this->strcmpLowercaseFirst($operand1, $operand2) > 0; + } else { + $result = ($operand1 > $operand2); + } + break; + // Less than + case '<': + if ($useLowercaseFirstComparison) { + $result = $this->strcmpLowercaseFirst($operand1, $operand2) < 0; + } else { + $result = ($operand1 < $operand2); + } + break; + // Equality + case '=': + if (is_numeric($operand1) && is_numeric($operand2)) { + $result = (abs($operand1 - $operand2) < $this->delta); + } else { + $result = strcmp($operand1, $operand2) == 0; + } + break; + // Greater than or equal + case '>=': + if (is_numeric($operand1) && is_numeric($operand2)) { + $result = ((abs($operand1 - $operand2) < $this->delta) || ($operand1 > $operand2)); + } elseif ($useLowercaseFirstComparison) { + $result = $this->strcmpLowercaseFirst($operand1, $operand2) >= 0; + } else { + $result = strcmp($operand1, $operand2) >= 0; + } + break; + // Less than or equal + case '<=': + if (is_numeric($operand1) && is_numeric($operand2)) { + $result = ((abs($operand1 - $operand2) < $this->delta) || ($operand1 < $operand2)); + } elseif ($useLowercaseFirstComparison) { + $result = $this->strcmpLowercaseFirst($operand1, $operand2) <= 0; + } else { + $result = strcmp($operand1, $operand2) <= 0; + } + break; + // Inequality + case '<>': + if (is_numeric($operand1) && is_numeric($operand2)) { + $result = (abs($operand1 - $operand2) > 1E-14); + } else { + $result = strcmp($operand1, $operand2) != 0; + } + break; + } + + // Log the result details + $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result)); + // And push the result onto the stack + $stack->push('Value', $result); + return true; + } + + /** + * Compare two strings in the same way as strcmp() except that lowercase come before uppercase letters + * @param string $str1 First string value for the comparison + * @param string $str2 Second string value for the comparison + * @return integer + */ + private function strcmpLowercaseFirst($str1, $str2) + { + $inversedStr1 = PHPExcel_Shared_String::StrCaseReverse($str1); + $inversedStr2 = PHPExcel_Shared_String::StrCaseReverse($str2); + + return strcmp($inversedStr1, $inversedStr2); + } + + private function executeNumericBinaryOperation($cellID, $operand1, $operand2, $operation, $matrixFunction, &$stack) + { + // Validate the two operands + if (!$this->validateBinaryOperand($cellID, $operand1, $stack)) { + return false; + } + if (!$this->validateBinaryOperand($cellID, $operand2, $stack)) { + return false; + } + + // If either of the operands is a matrix, we need to treat them both as matrices + // (converting the other operand to a matrix if need be); then perform the required + // matrix operation + if ((is_array($operand1)) || (is_array($operand2))) { + // Ensure that both operands are arrays/matrices of the same size + self::checkMatrixOperands($operand1, $operand2, 2); + + try { + // Convert operand 1 from a PHP array to a matrix + $matrix = new PHPExcel_Shared_JAMA_Matrix($operand1); + // Perform the required operation against the operand 1 matrix, passing in operand 2 + $matrixResult = $matrix->$matrixFunction($operand2); + $result = $matrixResult->getArray(); + } catch (PHPExcel_Exception $ex) { + $this->_debugLog->writeDebugLog('JAMA Matrix Exception: ', $ex->getMessage()); + $result = '#VALUE!'; + } + } else { + if ((PHPExcel_Calculation_Functions::getCompatibilityMode() != PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) && + ((is_string($operand1) && !is_numeric($operand1) && strlen($operand1)>0) || + (is_string($operand2) && !is_numeric($operand2) && strlen($operand2)>0))) { + $result = PHPExcel_Calculation_Functions::VALUE(); + } else { + // If we're dealing with non-matrix operations, execute the necessary operation + switch ($operation) { + // Addition + case '+': + $result = $operand1 + $operand2; + break; + // Subtraction + case '-': + $result = $operand1 - $operand2; + break; + // Multiplication + case '*': + $result = $operand1 * $operand2; + break; + // Division + case '/': + if ($operand2 == 0) { + // Trap for Divide by Zero error + $stack->push('Value', '#DIV/0!'); + $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails('#DIV/0!')); + return false; + } else { + $result = $operand1 / $operand2; + } + break; + // Power + case '^': + $result = pow($operand1, $operand2); + break; + } + } + } + + // Log the result details + $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result)); + // And push the result onto the stack + $stack->push('Value', $result); + return true; + } + + + // trigger an error, but nicely, if need be + protected function raiseFormulaError($errorMessage) + { + $this->formulaError = $errorMessage; + $this->cyclicReferenceStack->clear(); + if (!$this->suppressFormulaErrors) { + throw new PHPExcel_Calculation_Exception($errorMessage); + } + trigger_error($errorMessage, E_USER_ERROR); + } + + + /** + * Extract range values + * + * @param string &$pRange String based range representation + * @param PHPExcel_Worksheet $pSheet Worksheet + * @param boolean $resetLog Flag indicating whether calculation log should be reset or not + * @return mixed Array of values in range if range contains more than one element. Otherwise, a single value is returned. + * @throws PHPExcel_Calculation_Exception + */ + public function extractCellRange(&$pRange = 'A1', PHPExcel_Worksheet $pSheet = null, $resetLog = true) + { + // Return value + $returnValue = array (); + +// echo 'extractCellRange('.$pRange.')', PHP_EOL; + if ($pSheet !== null) { + $pSheetName = $pSheet->getTitle(); +// echo 'Passed sheet name is '.$pSheetName.PHP_EOL; +// echo 'Range reference is '.$pRange.PHP_EOL; + if (strpos($pRange, '!') !== false) { +// echo '$pRange reference includes sheet reference', PHP_EOL; + list($pSheetName, $pRange) = PHPExcel_Worksheet::extractSheetTitle($pRange, true); +// echo 'New sheet name is '.$pSheetName, PHP_EOL; +// echo 'Adjusted Range reference is '.$pRange, PHP_EOL; + $pSheet = $this->workbook->getSheetByName($pSheetName); + } + + // Extract range + $aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($pRange); + $pRange = $pSheetName.'!'.$pRange; + if (!isset($aReferences[1])) { + // Single cell in range + sscanf($aReferences[0], '%[A-Z]%d', $currentCol, $currentRow); + $cellValue = null; + if ($pSheet->cellExists($aReferences[0])) { + $returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog); + } else { + $returnValue[$currentRow][$currentCol] = null; + } + } else { + // Extract cell data for all cells in the range + foreach ($aReferences as $reference) { + // Extract range + sscanf($reference, '%[A-Z]%d', $currentCol, $currentRow); + $cellValue = null; + if ($pSheet->cellExists($reference)) { + $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog); + } else { + $returnValue[$currentRow][$currentCol] = null; + } + } + } + } + + return $returnValue; + } + + + /** + * Extract range values + * + * @param string &$pRange String based range representation + * @param PHPExcel_Worksheet $pSheet Worksheet + * @return mixed Array of values in range if range contains more than one element. Otherwise, a single value is returned. + * @param boolean $resetLog Flag indicating whether calculation log should be reset or not + * @throws PHPExcel_Calculation_Exception + */ + public function extractNamedRange(&$pRange = 'A1', PHPExcel_Worksheet $pSheet = null, $resetLog = true) + { + // Return value + $returnValue = array (); + +// echo 'extractNamedRange('.$pRange.')
'; + if ($pSheet !== null) { + $pSheetName = $pSheet->getTitle(); +// echo 'Current sheet name is '.$pSheetName.'
'; +// echo 'Range reference is '.$pRange.'
'; + if (strpos($pRange, '!') !== false) { +// echo '$pRange reference includes sheet reference', PHP_EOL; + list($pSheetName, $pRange) = PHPExcel_Worksheet::extractSheetTitle($pRange, true); +// echo 'New sheet name is '.$pSheetName, PHP_EOL; +// echo 'Adjusted Range reference is '.$pRange, PHP_EOL; + $pSheet = $this->workbook->getSheetByName($pSheetName); + } + + // Named range? + $namedRange = PHPExcel_NamedRange::resolveRange($pRange, $pSheet); + if ($namedRange !== null) { + $pSheet = $namedRange->getWorksheet(); +// echo 'Named Range '.$pRange.' ('; + $pRange = $namedRange->getRange(); + $splitRange = PHPExcel_Cell::splitRange($pRange); + // Convert row and column references + if (ctype_alpha($splitRange[0][0])) { + $pRange = $splitRange[0][0] . '1:' . $splitRange[0][1] . $namedRange->getWorksheet()->getHighestRow(); + } elseif (ctype_digit($splitRange[0][0])) { + $pRange = 'A' . $splitRange[0][0] . ':' . $namedRange->getWorksheet()->getHighestColumn() . $splitRange[0][1]; + } +// echo $pRange.') is in sheet '.$namedRange->getWorksheet()->getTitle().'
'; + +// if ($pSheet->getTitle() != $namedRange->getWorksheet()->getTitle()) { +// if (!$namedRange->getLocalOnly()) { +// $pSheet = $namedRange->getWorksheet(); +// } else { +// return $returnValue; +// } +// } + } else { + return PHPExcel_Calculation_Functions::REF(); + } + + // Extract range + $aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($pRange); +// var_dump($aReferences); + if (!isset($aReferences[1])) { + // Single cell (or single column or row) in range + list($currentCol, $currentRow) = PHPExcel_Cell::coordinateFromString($aReferences[0]); + $cellValue = null; + if ($pSheet->cellExists($aReferences[0])) { + $returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog); + } else { + $returnValue[$currentRow][$currentCol] = null; + } + } else { + // Extract cell data for all cells in the range + foreach ($aReferences as $reference) { + // Extract range + list($currentCol, $currentRow) = PHPExcel_Cell::coordinateFromString($reference); +// echo 'NAMED RANGE: $currentCol='.$currentCol.' $currentRow='.$currentRow.'
'; + $cellValue = null; + if ($pSheet->cellExists($reference)) { + $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog); + } else { + $returnValue[$currentRow][$currentCol] = null; + } + } + } +// print_r($returnValue); +// echo '
'; + } + + return $returnValue; + } + + + /** + * Is a specific function implemented? + * + * @param string $pFunction Function Name + * @return boolean + */ + public function isImplemented($pFunction = '') + { + $pFunction = strtoupper($pFunction); + if (isset(self::$PHPExcelFunctions[$pFunction])) { + return (self::$PHPExcelFunctions[$pFunction]['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY'); + } else { + return false; + } + } + + + /** + * Get a list of all implemented functions as an array of function objects + * + * @return array of PHPExcel_Calculation_Function + */ + public function listFunctions() + { + $returnValue = array(); + + foreach (self::$PHPExcelFunctions as $functionName => $function) { + if ($function['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY') { + $returnValue[$functionName] = new PHPExcel_Calculation_Function( + $function['category'], + $functionName, + $function['functionCall'] + ); + } + } + + return $returnValue; + } + + + /** + * Get a list of all Excel function names + * + * @return array + */ + public function listAllFunctionNames() + { + return array_keys(self::$PHPExcelFunctions); + } + + /** + * Get a list of implemented Excel function names + * + * @return array + */ + public function listFunctionNames() + { + $returnValue = array(); + foreach (self::$PHPExcelFunctions as $functionName => $function) { + if ($function['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY') { + $returnValue[] = $functionName; + } + } + + return $returnValue; + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation/Database.php b/extend/PHPExcel/PHPExcel/Calculation/Database.php new file mode 100644 index 0000000..b8d91cb --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation/Database.php @@ -0,0 +1,676 @@ + $criteriaName) { + $testCondition = array(); + $testConditionCount = 0; + foreach ($criteria as $row => $criterion) { + if ($criterion[$key] > '') { + $testCondition[] = '[:'.$criteriaName.']'.PHPExcel_Calculation_Functions::ifCondition($criterion[$key]); + $testConditionCount++; + } + } + if ($testConditionCount > 1) { + $testConditions[] = 'OR(' . implode(',', $testCondition) . ')'; + $testConditionsCount++; + } elseif ($testConditionCount == 1) { + $testConditions[] = $testCondition[0]; + $testConditionsCount++; + } + } + + if ($testConditionsCount > 1) { + $testConditionSet = 'AND(' . implode(',', $testConditions) . ')'; + } elseif ($testConditionsCount == 1) { + $testConditionSet = $testConditions[0]; + } + + // Loop through each row of the database + foreach ($database as $dataRow => $dataValues) { + // Substitute actual values from the database row for our [:placeholders] + $testConditionList = $testConditionSet; + foreach ($criteriaNames as $key => $criteriaName) { + $k = array_search($criteriaName, $fieldNames); + if (isset($dataValues[$k])) { + $dataValue = $dataValues[$k]; + $dataValue = (is_string($dataValue)) ? PHPExcel_Calculation::wrapResult(strtoupper($dataValue)) : $dataValue; + $testConditionList = str_replace('[:' . $criteriaName . ']', $dataValue, $testConditionList); + } + } + // evaluate the criteria against the row data + $result = PHPExcel_Calculation::getInstance()->_calculateFormulaValue('='.$testConditionList); + // If the row failed to meet the criteria, remove it from the database + if (!$result) { + unset($database[$dataRow]); + } + } + + return $database; + } + + + private static function getFilteredColumn($database, $field, $criteria) + { + // reduce the database to a set of rows that match all the criteria + $database = self::filter($database, $criteria); + // extract an array of values for the requested column + $colData = array(); + foreach ($database as $row) { + $colData[] = $row[$field]; + } + + return $colData; + } + + /** + * DAVERAGE + * + * Averages the values in a column of a list or database that match conditions you specify. + * + * Excel Function: + * DAVERAGE(database,field,criteria) + * + * @access public + * @category Database Functions + * @param mixed[] $database The range of cells that makes up the list or database. + * A database is a list of related data in which rows of related + * information are records, and columns of data are fields. The + * first row of the list contains labels for each column. + * @param string|integer $field Indicates which column is used in the function. Enter the + * column label enclosed between double quotation marks, such as + * "Age" or "Yield," or a number (without quotation marks) that + * represents the position of the column within the list: 1 for + * the first column, 2 for the second column, and so on. + * @param mixed[] $criteria The range of cells that contains the conditions you specify. + * You can use any range for the criteria argument, as long as it + * includes at least one column label and at least one cell below + * the column label in which you specify a condition for the + * column. + * @return float + * + */ + public static function DAVERAGE($database, $field, $criteria) + { + $field = self::fieldExtract($database, $field); + if (is_null($field)) { + return null; + } + + // Return + return PHPExcel_Calculation_Statistical::AVERAGE( + self::getFilteredColumn($database, $field, $criteria) + ); + } + + + /** + * DCOUNT + * + * Counts the cells that contain numbers in a column of a list or database that match conditions + * that you specify. + * + * Excel Function: + * DCOUNT(database,[field],criteria) + * + * Excel Function: + * DAVERAGE(database,field,criteria) + * + * @access public + * @category Database Functions + * @param mixed[] $database The range of cells that makes up the list or database. + * A database is a list of related data in which rows of related + * information are records, and columns of data are fields. The + * first row of the list contains labels for each column. + * @param string|integer $field Indicates which column is used in the function. Enter the + * column label enclosed between double quotation marks, such as + * "Age" or "Yield," or a number (without quotation marks) that + * represents the position of the column within the list: 1 for + * the first column, 2 for the second column, and so on. + * @param mixed[] $criteria The range of cells that contains the conditions you specify. + * You can use any range for the criteria argument, as long as it + * includes at least one column label and at least one cell below + * the column label in which you specify a condition for the + * column. + * @return integer + * + * @TODO The field argument is optional. If field is omitted, DCOUNT counts all records in the + * database that match the criteria. + * + */ + public static function DCOUNT($database, $field, $criteria) + { + $field = self::fieldExtract($database, $field); + if (is_null($field)) { + return null; + } + + // Return + return PHPExcel_Calculation_Statistical::COUNT( + self::getFilteredColumn($database, $field, $criteria) + ); + } + + + /** + * DCOUNTA + * + * Counts the nonblank cells in a column of a list or database that match conditions that you specify. + * + * Excel Function: + * DCOUNTA(database,[field],criteria) + * + * @access public + * @category Database Functions + * @param mixed[] $database The range of cells that makes up the list or database. + * A database is a list of related data in which rows of related + * information are records, and columns of data are fields. The + * first row of the list contains labels for each column. + * @param string|integer $field Indicates which column is used in the function. Enter the + * column label enclosed between double quotation marks, such as + * "Age" or "Yield," or a number (without quotation marks) that + * represents the position of the column within the list: 1 for + * the first column, 2 for the second column, and so on. + * @param mixed[] $criteria The range of cells that contains the conditions you specify. + * You can use any range for the criteria argument, as long as it + * includes at least one column label and at least one cell below + * the column label in which you specify a condition for the + * column. + * @return integer + * + * @TODO The field argument is optional. If field is omitted, DCOUNTA counts all records in the + * database that match the criteria. + * + */ + public static function DCOUNTA($database, $field, $criteria) + { + $field = self::fieldExtract($database, $field); + if (is_null($field)) { + return null; + } + + // reduce the database to a set of rows that match all the criteria + $database = self::filter($database, $criteria); + // extract an array of values for the requested column + $colData = array(); + foreach ($database as $row) { + $colData[] = $row[$field]; + } + + // Return + return PHPExcel_Calculation_Statistical::COUNTA( + self::getFilteredColumn($database, $field, $criteria) + ); + } + + + /** + * DGET + * + * Extracts a single value from a column of a list or database that matches conditions that you + * specify. + * + * Excel Function: + * DGET(database,field,criteria) + * + * @access public + * @category Database Functions + * @param mixed[] $database The range of cells that makes up the list or database. + * A database is a list of related data in which rows of related + * information are records, and columns of data are fields. The + * first row of the list contains labels for each column. + * @param string|integer $field Indicates which column is used in the function. Enter the + * column label enclosed between double quotation marks, such as + * "Age" or "Yield," or a number (without quotation marks) that + * represents the position of the column within the list: 1 for + * the first column, 2 for the second column, and so on. + * @param mixed[] $criteria The range of cells that contains the conditions you specify. + * You can use any range for the criteria argument, as long as it + * includes at least one column label and at least one cell below + * the column label in which you specify a condition for the + * column. + * @return mixed + * + */ + public static function DGET($database, $field, $criteria) + { + $field = self::fieldExtract($database, $field); + if (is_null($field)) { + return null; + } + + // Return + $colData = self::getFilteredColumn($database, $field, $criteria); + if (count($colData) > 1) { + return PHPExcel_Calculation_Functions::NaN(); + } + + return $colData[0]; + } + + + /** + * DMAX + * + * Returns the largest number in a column of a list or database that matches conditions you that + * specify. + * + * Excel Function: + * DMAX(database,field,criteria) + * + * @access public + * @category Database Functions + * @param mixed[] $database The range of cells that makes up the list or database. + * A database is a list of related data in which rows of related + * information are records, and columns of data are fields. The + * first row of the list contains labels for each column. + * @param string|integer $field Indicates which column is used in the function. Enter the + * column label enclosed between double quotation marks, such as + * "Age" or "Yield," or a number (without quotation marks) that + * represents the position of the column within the list: 1 for + * the first column, 2 for the second column, and so on. + * @param mixed[] $criteria The range of cells that contains the conditions you specify. + * You can use any range for the criteria argument, as long as it + * includes at least one column label and at least one cell below + * the column label in which you specify a condition for the + * column. + * @return float + * + */ + public static function DMAX($database, $field, $criteria) + { + $field = self::fieldExtract($database, $field); + if (is_null($field)) { + return null; + } + + // Return + return PHPExcel_Calculation_Statistical::MAX( + self::getFilteredColumn($database, $field, $criteria) + ); + } + + + /** + * DMIN + * + * Returns the smallest number in a column of a list or database that matches conditions you that + * specify. + * + * Excel Function: + * DMIN(database,field,criteria) + * + * @access public + * @category Database Functions + * @param mixed[] $database The range of cells that makes up the list or database. + * A database is a list of related data in which rows of related + * information are records, and columns of data are fields. The + * first row of the list contains labels for each column. + * @param string|integer $field Indicates which column is used in the function. Enter the + * column label enclosed between double quotation marks, such as + * "Age" or "Yield," or a number (without quotation marks) that + * represents the position of the column within the list: 1 for + * the first column, 2 for the second column, and so on. + * @param mixed[] $criteria The range of cells that contains the conditions you specify. + * You can use any range for the criteria argument, as long as it + * includes at least one column label and at least one cell below + * the column label in which you specify a condition for the + * column. + * @return float + * + */ + public static function DMIN($database, $field, $criteria) + { + $field = self::fieldExtract($database, $field); + if (is_null($field)) { + return null; + } + + // Return + return PHPExcel_Calculation_Statistical::MIN( + self::getFilteredColumn($database, $field, $criteria) + ); + } + + + /** + * DPRODUCT + * + * Multiplies the values in a column of a list or database that match conditions that you specify. + * + * Excel Function: + * DPRODUCT(database,field,criteria) + * + * @access public + * @category Database Functions + * @param mixed[] $database The range of cells that makes up the list or database. + * A database is a list of related data in which rows of related + * information are records, and columns of data are fields. The + * first row of the list contains labels for each column. + * @param string|integer $field Indicates which column is used in the function. Enter the + * column label enclosed between double quotation marks, such as + * "Age" or "Yield," or a number (without quotation marks) that + * represents the position of the column within the list: 1 for + * the first column, 2 for the second column, and so on. + * @param mixed[] $criteria The range of cells that contains the conditions you specify. + * You can use any range for the criteria argument, as long as it + * includes at least one column label and at least one cell below + * the column label in which you specify a condition for the + * column. + * @return float + * + */ + public static function DPRODUCT($database, $field, $criteria) + { + $field = self::fieldExtract($database, $field); + if (is_null($field)) { + return null; + } + + // Return + return PHPExcel_Calculation_MathTrig::PRODUCT( + self::getFilteredColumn($database, $field, $criteria) + ); + } + + + /** + * DSTDEV + * + * Estimates the standard deviation of a population based on a sample by using the numbers in a + * column of a list or database that match conditions that you specify. + * + * Excel Function: + * DSTDEV(database,field,criteria) + * + * @access public + * @category Database Functions + * @param mixed[] $database The range of cells that makes up the list or database. + * A database is a list of related data in which rows of related + * information are records, and columns of data are fields. The + * first row of the list contains labels for each column. + * @param string|integer $field Indicates which column is used in the function. Enter the + * column label enclosed between double quotation marks, such as + * "Age" or "Yield," or a number (without quotation marks) that + * represents the position of the column within the list: 1 for + * the first column, 2 for the second column, and so on. + * @param mixed[] $criteria The range of cells that contains the conditions you specify. + * You can use any range for the criteria argument, as long as it + * includes at least one column label and at least one cell below + * the column label in which you specify a condition for the + * column. + * @return float + * + */ + public static function DSTDEV($database, $field, $criteria) + { + $field = self::fieldExtract($database, $field); + if (is_null($field)) { + return null; + } + + // Return + return PHPExcel_Calculation_Statistical::STDEV( + self::getFilteredColumn($database, $field, $criteria) + ); + } + + + /** + * DSTDEVP + * + * Calculates the standard deviation of a population based on the entire population by using the + * numbers in a column of a list or database that match conditions that you specify. + * + * Excel Function: + * DSTDEVP(database,field,criteria) + * + * @access public + * @category Database Functions + * @param mixed[] $database The range of cells that makes up the list or database. + * A database is a list of related data in which rows of related + * information are records, and columns of data are fields. The + * first row of the list contains labels for each column. + * @param string|integer $field Indicates which column is used in the function. Enter the + * column label enclosed between double quotation marks, such as + * "Age" or "Yield," or a number (without quotation marks) that + * represents the position of the column within the list: 1 for + * the first column, 2 for the second column, and so on. + * @param mixed[] $criteria The range of cells that contains the conditions you specify. + * You can use any range for the criteria argument, as long as it + * includes at least one column label and at least one cell below + * the column label in which you specify a condition for the + * column. + * @return float + * + */ + public static function DSTDEVP($database, $field, $criteria) + { + $field = self::fieldExtract($database, $field); + if (is_null($field)) { + return null; + } + + // Return + return PHPExcel_Calculation_Statistical::STDEVP( + self::getFilteredColumn($database, $field, $criteria) + ); + } + + + /** + * DSUM + * + * Adds the numbers in a column of a list or database that match conditions that you specify. + * + * Excel Function: + * DSUM(database,field,criteria) + * + * @access public + * @category Database Functions + * @param mixed[] $database The range of cells that makes up the list or database. + * A database is a list of related data in which rows of related + * information are records, and columns of data are fields. The + * first row of the list contains labels for each column. + * @param string|integer $field Indicates which column is used in the function. Enter the + * column label enclosed between double quotation marks, such as + * "Age" or "Yield," or a number (without quotation marks) that + * represents the position of the column within the list: 1 for + * the first column, 2 for the second column, and so on. + * @param mixed[] $criteria The range of cells that contains the conditions you specify. + * You can use any range for the criteria argument, as long as it + * includes at least one column label and at least one cell below + * the column label in which you specify a condition for the + * column. + * @return float + * + */ + public static function DSUM($database, $field, $criteria) + { + $field = self::fieldExtract($database, $field); + if (is_null($field)) { + return null; + } + + // Return + return PHPExcel_Calculation_MathTrig::SUM( + self::getFilteredColumn($database, $field, $criteria) + ); + } + + + /** + * DVAR + * + * Estimates the variance of a population based on a sample by using the numbers in a column + * of a list or database that match conditions that you specify. + * + * Excel Function: + * DVAR(database,field,criteria) + * + * @access public + * @category Database Functions + * @param mixed[] $database The range of cells that makes up the list or database. + * A database is a list of related data in which rows of related + * information are records, and columns of data are fields. The + * first row of the list contains labels for each column. + * @param string|integer $field Indicates which column is used in the function. Enter the + * column label enclosed between double quotation marks, such as + * "Age" or "Yield," or a number (without quotation marks) that + * represents the position of the column within the list: 1 for + * the first column, 2 for the second column, and so on. + * @param mixed[] $criteria The range of cells that contains the conditions you specify. + * You can use any range for the criteria argument, as long as it + * includes at least one column label and at least one cell below + * the column label in which you specify a condition for the + * column. + * @return float + * + */ + public static function DVAR($database, $field, $criteria) + { + $field = self::fieldExtract($database, $field); + if (is_null($field)) { + return null; + } + + // Return + return PHPExcel_Calculation_Statistical::VARFunc( + self::getFilteredColumn($database, $field, $criteria) + ); + } + + + /** + * DVARP + * + * Calculates the variance of a population based on the entire population by using the numbers + * in a column of a list or database that match conditions that you specify. + * + * Excel Function: + * DVARP(database,field,criteria) + * + * @access public + * @category Database Functions + * @param mixed[] $database The range of cells that makes up the list or database. + * A database is a list of related data in which rows of related + * information are records, and columns of data are fields. The + * first row of the list contains labels for each column. + * @param string|integer $field Indicates which column is used in the function. Enter the + * column label enclosed between double quotation marks, such as + * "Age" or "Yield," or a number (without quotation marks) that + * represents the position of the column within the list: 1 for + * the first column, 2 for the second column, and so on. + * @param mixed[] $criteria The range of cells that contains the conditions you specify. + * You can use any range for the criteria argument, as long as it + * includes at least one column label and at least one cell below + * the column label in which you specify a condition for the + * column. + * @return float + * + */ + public static function DVARP($database, $field, $criteria) + { + $field = self::fieldExtract($database, $field); + if (is_null($field)) { + return null; + } + + // Return + return PHPExcel_Calculation_Statistical::VARP( + self::getFilteredColumn($database, $field, $criteria) + ); + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation/DateTime.php b/extend/PHPExcel/PHPExcel/Calculation/DateTime.php new file mode 100644 index 0000000..72f4c7a --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation/DateTime.php @@ -0,0 +1,1553 @@ +format('m'); + $oYear = (int) $PHPDateObject->format('Y'); + + $adjustmentMonthsString = (string) $adjustmentMonths; + if ($adjustmentMonths > 0) { + $adjustmentMonthsString = '+'.$adjustmentMonths; + } + if ($adjustmentMonths != 0) { + $PHPDateObject->modify($adjustmentMonthsString.' months'); + } + $nMonth = (int) $PHPDateObject->format('m'); + $nYear = (int) $PHPDateObject->format('Y'); + + $monthDiff = ($nMonth - $oMonth) + (($nYear - $oYear) * 12); + if ($monthDiff != $adjustmentMonths) { + $adjustDays = (int) $PHPDateObject->format('d'); + $adjustDaysString = '-'.$adjustDays.' days'; + $PHPDateObject->modify($adjustDaysString); + } + return $PHPDateObject; + } + + + /** + * DATETIMENOW + * + * Returns the current date and time. + * The NOW function is useful when you need to display the current date and time on a worksheet or + * calculate a value based on the current date and time, and have that value updated each time you + * open the worksheet. + * + * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date + * and time format of your regional settings. PHPExcel does not change cell formatting in this way. + * + * Excel Function: + * NOW() + * + * @access public + * @category Date/Time Functions + * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, + * depending on the value of the ReturnDateType flag + */ + public static function DATETIMENOW() + { + $saveTimeZone = date_default_timezone_get(); + date_default_timezone_set('UTC'); + $retValue = false; + switch (PHPExcel_Calculation_Functions::getReturnDateType()) { + case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL: + $retValue = (float) PHPExcel_Shared_Date::PHPToExcel(time()); + break; + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC: + $retValue = (integer) time(); + break; + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT: + $retValue = new DateTime(); + break; + } + date_default_timezone_set($saveTimeZone); + + return $retValue; + } + + + /** + * DATENOW + * + * Returns the current date. + * The NOW function is useful when you need to display the current date and time on a worksheet or + * calculate a value based on the current date and time, and have that value updated each time you + * open the worksheet. + * + * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date + * and time format of your regional settings. PHPExcel does not change cell formatting in this way. + * + * Excel Function: + * TODAY() + * + * @access public + * @category Date/Time Functions + * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, + * depending on the value of the ReturnDateType flag + */ + public static function DATENOW() + { + $saveTimeZone = date_default_timezone_get(); + date_default_timezone_set('UTC'); + $retValue = false; + $excelDateTime = floor(PHPExcel_Shared_Date::PHPToExcel(time())); + switch (PHPExcel_Calculation_Functions::getReturnDateType()) { + case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL: + $retValue = (float) $excelDateTime; + break; + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC: + $retValue = (integer) PHPExcel_Shared_Date::ExcelToPHP($excelDateTime); + break; + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT: + $retValue = PHPExcel_Shared_Date::ExcelToPHPObject($excelDateTime); + break; + } + date_default_timezone_set($saveTimeZone); + + return $retValue; + } + + + /** + * DATE + * + * The DATE function returns a value that represents a particular date. + * + * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date + * format of your regional settings. PHPExcel does not change cell formatting in this way. + * + * Excel Function: + * DATE(year,month,day) + * + * PHPExcel is a lot more forgiving than MS Excel when passing non numeric values to this function. + * A Month name or abbreviation (English only at this point) such as 'January' or 'Jan' will still be accepted, + * as will a day value with a suffix (e.g. '21st' rather than simply 21); again only English language. + * + * @access public + * @category Date/Time Functions + * @param integer $year The value of the year argument can include one to four digits. + * Excel interprets the year argument according to the configured + * date system: 1900 or 1904. + * If year is between 0 (zero) and 1899 (inclusive), Excel adds that + * value to 1900 to calculate the year. For example, DATE(108,1,2) + * returns January 2, 2008 (1900+108). + * If year is between 1900 and 9999 (inclusive), Excel uses that + * value as the year. For example, DATE(2008,1,2) returns January 2, + * 2008. + * If year is less than 0 or is 10000 or greater, Excel returns the + * #NUM! error value. + * @param integer $month A positive or negative integer representing the month of the year + * from 1 to 12 (January to December). + * If month is greater than 12, month adds that number of months to + * the first month in the year specified. For example, DATE(2008,14,2) + * returns the serial number representing February 2, 2009. + * If month is less than 1, month subtracts the magnitude of that + * number of months, plus 1, from the first month in the year + * specified. For example, DATE(2008,-3,2) returns the serial number + * representing September 2, 2007. + * @param integer $day A positive or negative integer representing the day of the month + * from 1 to 31. + * If day is greater than the number of days in the month specified, + * day adds that number of days to the first day in the month. For + * example, DATE(2008,1,35) returns the serial number representing + * February 4, 2008. + * If day is less than 1, day subtracts the magnitude that number of + * days, plus one, from the first day of the month specified. For + * example, DATE(2008,1,-15) returns the serial number representing + * December 16, 2007. + * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, + * depending on the value of the ReturnDateType flag + */ + public static function DATE($year = 0, $month = 1, $day = 1) + { + $year = PHPExcel_Calculation_Functions::flattenSingleValue($year); + $month = PHPExcel_Calculation_Functions::flattenSingleValue($month); + $day = PHPExcel_Calculation_Functions::flattenSingleValue($day); + + if (($month !== null) && (!is_numeric($month))) { + $month = PHPExcel_Shared_Date::monthStringToNumber($month); + } + + if (($day !== null) && (!is_numeric($day))) { + $day = PHPExcel_Shared_Date::dayStringToNumber($day); + } + + $year = ($year !== null) ? PHPExcel_Shared_String::testStringAsNumeric($year) : 0; + $month = ($month !== null) ? PHPExcel_Shared_String::testStringAsNumeric($month) : 0; + $day = ($day !== null) ? PHPExcel_Shared_String::testStringAsNumeric($day) : 0; + if ((!is_numeric($year)) || + (!is_numeric($month)) || + (!is_numeric($day))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $year = (integer) $year; + $month = (integer) $month; + $day = (integer) $day; + + $baseYear = PHPExcel_Shared_Date::getExcelCalendar(); + // Validate parameters + if ($year < ($baseYear-1900)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ((($baseYear-1900) != 0) && ($year < $baseYear) && ($year >= 1900)) { + return PHPExcel_Calculation_Functions::NaN(); + } + + if (($year < $baseYear) && ($year >= ($baseYear-1900))) { + $year += 1900; + } + + if ($month < 1) { + // Handle year/month adjustment if month < 1 + --$month; + $year += ceil($month / 12) - 1; + $month = 13 - abs($month % 12); + } elseif ($month > 12) { + // Handle year/month adjustment if month > 12 + $year += floor($month / 12); + $month = ($month % 12); + } + + // Re-validate the year parameter after adjustments + if (($year < $baseYear) || ($year >= 10000)) { + return PHPExcel_Calculation_Functions::NaN(); + } + + // Execute function + $excelDateValue = PHPExcel_Shared_Date::FormattedPHPToExcel($year, $month, $day); + switch (PHPExcel_Calculation_Functions::getReturnDateType()) { + case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL: + return (float) $excelDateValue; + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC: + return (integer) PHPExcel_Shared_Date::ExcelToPHP($excelDateValue); + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT: + return PHPExcel_Shared_Date::ExcelToPHPObject($excelDateValue); + } + } + + + /** + * TIME + * + * The TIME function returns a value that represents a particular time. + * + * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the time + * format of your regional settings. PHPExcel does not change cell formatting in this way. + * + * Excel Function: + * TIME(hour,minute,second) + * + * @access public + * @category Date/Time Functions + * @param integer $hour A number from 0 (zero) to 32767 representing the hour. + * Any value greater than 23 will be divided by 24 and the remainder + * will be treated as the hour value. For example, TIME(27,0,0) = + * TIME(3,0,0) = .125 or 3:00 AM. + * @param integer $minute A number from 0 to 32767 representing the minute. + * Any value greater than 59 will be converted to hours and minutes. + * For example, TIME(0,750,0) = TIME(12,30,0) = .520833 or 12:30 PM. + * @param integer $second A number from 0 to 32767 representing the second. + * Any value greater than 59 will be converted to hours, minutes, + * and seconds. For example, TIME(0,0,2000) = TIME(0,33,22) = .023148 + * or 12:33:20 AM + * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, + * depending on the value of the ReturnDateType flag + */ + public static function TIME($hour = 0, $minute = 0, $second = 0) + { + $hour = PHPExcel_Calculation_Functions::flattenSingleValue($hour); + $minute = PHPExcel_Calculation_Functions::flattenSingleValue($minute); + $second = PHPExcel_Calculation_Functions::flattenSingleValue($second); + + if ($hour == '') { + $hour = 0; + } + if ($minute == '') { + $minute = 0; + } + if ($second == '') { + $second = 0; + } + + if ((!is_numeric($hour)) || (!is_numeric($minute)) || (!is_numeric($second))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $hour = (integer) $hour; + $minute = (integer) $minute; + $second = (integer) $second; + + if ($second < 0) { + $minute += floor($second / 60); + $second = 60 - abs($second % 60); + if ($second == 60) { + $second = 0; + } + } elseif ($second >= 60) { + $minute += floor($second / 60); + $second = $second % 60; + } + if ($minute < 0) { + $hour += floor($minute / 60); + $minute = 60 - abs($minute % 60); + if ($minute == 60) { + $minute = 0; + } + } elseif ($minute >= 60) { + $hour += floor($minute / 60); + $minute = $minute % 60; + } + + if ($hour > 23) { + $hour = $hour % 24; + } elseif ($hour < 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + + // Execute function + switch (PHPExcel_Calculation_Functions::getReturnDateType()) { + case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL: + $date = 0; + $calendar = PHPExcel_Shared_Date::getExcelCalendar(); + if ($calendar != PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900) { + $date = 1; + } + return (float) PHPExcel_Shared_Date::FormattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second); + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC: + return (integer) PHPExcel_Shared_Date::ExcelToPHP(PHPExcel_Shared_Date::FormattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600 + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT: + $dayAdjust = 0; + if ($hour < 0) { + $dayAdjust = floor($hour / 24); + $hour = 24 - abs($hour % 24); + if ($hour == 24) { + $hour = 0; + } + } elseif ($hour >= 24) { + $dayAdjust = floor($hour / 24); + $hour = $hour % 24; + } + $phpDateObject = new DateTime('1900-01-01 '.$hour.':'.$minute.':'.$second); + if ($dayAdjust != 0) { + $phpDateObject->modify($dayAdjust.' days'); + } + return $phpDateObject; + } + } + + + /** + * DATEVALUE + * + * Returns a value that represents a particular date. + * Use DATEVALUE to convert a date represented by a text string to an Excel or PHP date/time stamp + * value. + * + * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date + * format of your regional settings. PHPExcel does not change cell formatting in this way. + * + * Excel Function: + * DATEVALUE(dateValue) + * + * @access public + * @category Date/Time Functions + * @param string $dateValue Text that represents a date in a Microsoft Excel date format. + * For example, "1/30/2008" or "30-Jan-2008" are text strings within + * quotation marks that represent dates. Using the default date + * system in Excel for Windows, date_text must represent a date from + * January 1, 1900, to December 31, 9999. Using the default date + * system in Excel for the Macintosh, date_text must represent a date + * from January 1, 1904, to December 31, 9999. DATEVALUE returns the + * #VALUE! error value if date_text is out of this range. + * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, + * depending on the value of the ReturnDateType flag + */ + public static function DATEVALUE($dateValue = 1) + { + $dateValue = trim(PHPExcel_Calculation_Functions::flattenSingleValue($dateValue), '"'); + // Strip any ordinals because they're allowed in Excel (English only) + $dateValue = preg_replace('/(\d)(st|nd|rd|th)([ -\/])/Ui', '$1$3', $dateValue); + // Convert separators (/ . or space) to hyphens (should also handle dot used for ordinals in some countries, e.g. Denmark, Germany) + $dateValue = str_replace(array('/', '.', '-', ' '), array(' ', ' ', ' ', ' '), $dateValue); + + $yearFound = false; + $t1 = explode(' ', $dateValue); + foreach ($t1 as &$t) { + if ((is_numeric($t)) && ($t > 31)) { + if ($yearFound) { + return PHPExcel_Calculation_Functions::VALUE(); + } else { + if ($t < 100) { + $t += 1900; + } + $yearFound = true; + } + } + } + if ((count($t1) == 1) && (strpos($t, ':') != false)) { + // We've been fed a time value without any date + return 0.0; + } elseif (count($t1) == 2) { + // We only have two parts of the date: either day/month or month/year + if ($yearFound) { + array_unshift($t1, 1); + } else { + array_push($t1, date('Y')); + } + } + unset($t); + $dateValue = implode(' ', $t1); + + $PHPDateArray = date_parse($dateValue); + if (($PHPDateArray === false) || ($PHPDateArray['error_count'] > 0)) { + $testVal1 = strtok($dateValue, '- '); + if ($testVal1 !== false) { + $testVal2 = strtok('- '); + if ($testVal2 !== false) { + $testVal3 = strtok('- '); + if ($testVal3 === false) { + $testVal3 = strftime('%Y'); + } + } else { + return PHPExcel_Calculation_Functions::VALUE(); + } + } else { + return PHPExcel_Calculation_Functions::VALUE(); + } + $PHPDateArray = date_parse($testVal1.'-'.$testVal2.'-'.$testVal3); + if (($PHPDateArray === false) || ($PHPDateArray['error_count'] > 0)) { + $PHPDateArray = date_parse($testVal2.'-'.$testVal1.'-'.$testVal3); + if (($PHPDateArray === false) || ($PHPDateArray['error_count'] > 0)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + } + + if (($PHPDateArray !== false) && ($PHPDateArray['error_count'] == 0)) { + // Execute function + if ($PHPDateArray['year'] == '') { + $PHPDateArray['year'] = strftime('%Y'); + } + if ($PHPDateArray['year'] < 1900) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if ($PHPDateArray['month'] == '') { + $PHPDateArray['month'] = strftime('%m'); + } + if ($PHPDateArray['day'] == '') { + $PHPDateArray['day'] = strftime('%d'); + } + $excelDateValue = floor( + PHPExcel_Shared_Date::FormattedPHPToExcel( + $PHPDateArray['year'], + $PHPDateArray['month'], + $PHPDateArray['day'], + $PHPDateArray['hour'], + $PHPDateArray['minute'], + $PHPDateArray['second'] + ) + ); + + switch (PHPExcel_Calculation_Functions::getReturnDateType()) { + case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL: + return (float) $excelDateValue; + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC: + return (integer) PHPExcel_Shared_Date::ExcelToPHP($excelDateValue); + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT: + return new DateTime($PHPDateArray['year'].'-'.$PHPDateArray['month'].'-'.$PHPDateArray['day'].' 00:00:00'); + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * TIMEVALUE + * + * Returns a value that represents a particular time. + * Use TIMEVALUE to convert a time represented by a text string to an Excel or PHP date/time stamp + * value. + * + * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the time + * format of your regional settings. PHPExcel does not change cell formatting in this way. + * + * Excel Function: + * TIMEVALUE(timeValue) + * + * @access public + * @category Date/Time Functions + * @param string $timeValue A text string that represents a time in any one of the Microsoft + * Excel time formats; for example, "6:45 PM" and "18:45" text strings + * within quotation marks that represent time. + * Date information in time_text is ignored. + * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, + * depending on the value of the ReturnDateType flag + */ + public static function TIMEVALUE($timeValue) + { + $timeValue = trim(PHPExcel_Calculation_Functions::flattenSingleValue($timeValue), '"'); + $timeValue = str_replace(array('/', '.'), array('-', '-'), $timeValue); + + $PHPDateArray = date_parse($timeValue); + if (($PHPDateArray !== false) && ($PHPDateArray['error_count'] == 0)) { + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { + $excelDateValue = PHPExcel_Shared_Date::FormattedPHPToExcel( + $PHPDateArray['year'], + $PHPDateArray['month'], + $PHPDateArray['day'], + $PHPDateArray['hour'], + $PHPDateArray['minute'], + $PHPDateArray['second'] + ); + } else { + $excelDateValue = PHPExcel_Shared_Date::FormattedPHPToExcel(1900, 1, 1, $PHPDateArray['hour'], $PHPDateArray['minute'], $PHPDateArray['second']) - 1; + } + + switch (PHPExcel_Calculation_Functions::getReturnDateType()) { + case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL: + return (float) $excelDateValue; + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC: + return (integer) $phpDateValue = PHPExcel_Shared_Date::ExcelToPHP($excelDateValue+25569) - 3600; + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT: + return new DateTime('1900-01-01 '.$PHPDateArray['hour'].':'.$PHPDateArray['minute'].':'.$PHPDateArray['second']); + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * DATEDIF + * + * @param mixed $startDate Excel date serial value, PHP date/time stamp, PHP DateTime object + * or a standard date string + * @param mixed $endDate Excel date serial value, PHP date/time stamp, PHP DateTime object + * or a standard date string + * @param string $unit + * @return integer Interval between the dates + */ + public static function DATEDIF($startDate = 0, $endDate = 0, $unit = 'D') + { + $startDate = PHPExcel_Calculation_Functions::flattenSingleValue($startDate); + $endDate = PHPExcel_Calculation_Functions::flattenSingleValue($endDate); + $unit = strtoupper(PHPExcel_Calculation_Functions::flattenSingleValue($unit)); + + if (is_string($startDate = self::getDateValue($startDate))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if (is_string($endDate = self::getDateValue($endDate))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + // Validate parameters + if ($startDate >= $endDate) { + return PHPExcel_Calculation_Functions::NaN(); + } + + // Execute function + $difference = $endDate - $startDate; + + $PHPStartDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($startDate); + $startDays = $PHPStartDateObject->format('j'); + $startMonths = $PHPStartDateObject->format('n'); + $startYears = $PHPStartDateObject->format('Y'); + + $PHPEndDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($endDate); + $endDays = $PHPEndDateObject->format('j'); + $endMonths = $PHPEndDateObject->format('n'); + $endYears = $PHPEndDateObject->format('Y'); + + $retVal = PHPExcel_Calculation_Functions::NaN(); + switch ($unit) { + case 'D': + $retVal = intval($difference); + break; + case 'M': + $retVal = intval($endMonths - $startMonths) + (intval($endYears - $startYears) * 12); + // We're only interested in full months + if ($endDays < $startDays) { + --$retVal; + } + break; + case 'Y': + $retVal = intval($endYears - $startYears); + // We're only interested in full months + if ($endMonths < $startMonths) { + --$retVal; + } elseif (($endMonths == $startMonths) && ($endDays < $startDays)) { + --$retVal; + } + break; + case 'MD': + if ($endDays < $startDays) { + $retVal = $endDays; + $PHPEndDateObject->modify('-'.$endDays.' days'); + $adjustDays = $PHPEndDateObject->format('j'); + if ($adjustDays > $startDays) { + $retVal += ($adjustDays - $startDays); + } + } else { + $retVal = $endDays - $startDays; + } + break; + case 'YM': + $retVal = intval($endMonths - $startMonths); + if ($retVal < 0) { + $retVal += 12; + } + // We're only interested in full months + if ($endDays < $startDays) { + --$retVal; + } + break; + case 'YD': + $retVal = intval($difference); + if ($endYears > $startYears) { + while ($endYears > $startYears) { + $PHPEndDateObject->modify('-1 year'); + $endYears = $PHPEndDateObject->format('Y'); + } + $retVal = $PHPEndDateObject->format('z') - $PHPStartDateObject->format('z'); + if ($retVal < 0) { + $retVal += 365; + } + } + break; + default: + $retVal = PHPExcel_Calculation_Functions::NaN(); + } + return $retVal; + } + + + /** + * DAYS360 + * + * Returns the number of days between two dates based on a 360-day year (twelve 30-day months), + * which is used in some accounting calculations. Use this function to help compute payments if + * your accounting system is based on twelve 30-day months. + * + * Excel Function: + * DAYS360(startDate,endDate[,method]) + * + * @access public + * @category Date/Time Functions + * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard date string + * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard date string + * @param boolean $method US or European Method + * FALSE or omitted: U.S. (NASD) method. If the starting date is + * the last day of a month, it becomes equal to the 30th of the + * same month. If the ending date is the last day of a month and + * the starting date is earlier than the 30th of a month, the + * ending date becomes equal to the 1st of the next month; + * otherwise the ending date becomes equal to the 30th of the + * same month. + * TRUE: European method. Starting dates and ending dates that + * occur on the 31st of a month become equal to the 30th of the + * same month. + * @return integer Number of days between start date and end date + */ + public static function DAYS360($startDate = 0, $endDate = 0, $method = false) + { + $startDate = PHPExcel_Calculation_Functions::flattenSingleValue($startDate); + $endDate = PHPExcel_Calculation_Functions::flattenSingleValue($endDate); + + if (is_string($startDate = self::getDateValue($startDate))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if (is_string($endDate = self::getDateValue($endDate))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + if (!is_bool($method)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + // Execute function + $PHPStartDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($startDate); + $startDay = $PHPStartDateObject->format('j'); + $startMonth = $PHPStartDateObject->format('n'); + $startYear = $PHPStartDateObject->format('Y'); + + $PHPEndDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($endDate); + $endDay = $PHPEndDateObject->format('j'); + $endMonth = $PHPEndDateObject->format('n'); + $endYear = $PHPEndDateObject->format('Y'); + + return self::dateDiff360($startDay, $startMonth, $startYear, $endDay, $endMonth, $endYear, !$method); + } + + + /** + * YEARFRAC + * + * Calculates the fraction of the year represented by the number of whole days between two dates + * (the start_date and the end_date). + * Use the YEARFRAC worksheet function to identify the proportion of a whole year's benefits or + * obligations to assign to a specific term. + * + * Excel Function: + * YEARFRAC(startDate,endDate[,method]) + * + * @access public + * @category Date/Time Functions + * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard date string + * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard date string + * @param integer $method Method used for the calculation + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return float fraction of the year + */ + public static function YEARFRAC($startDate = 0, $endDate = 0, $method = 0) + { + $startDate = PHPExcel_Calculation_Functions::flattenSingleValue($startDate); + $endDate = PHPExcel_Calculation_Functions::flattenSingleValue($endDate); + $method = PHPExcel_Calculation_Functions::flattenSingleValue($method); + + if (is_string($startDate = self::getDateValue($startDate))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if (is_string($endDate = self::getDateValue($endDate))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + if (((is_numeric($method)) && (!is_string($method))) || ($method == '')) { + switch ($method) { + case 0: + return self::DAYS360($startDate, $endDate) / 360; + case 1: + $days = self::DATEDIF($startDate, $endDate); + $startYear = self::YEAR($startDate); + $endYear = self::YEAR($endDate); + $years = $endYear - $startYear + 1; + $leapDays = 0; + if ($years == 1) { + if (self::isLeapYear($endYear)) { + $startMonth = self::MONTHOFYEAR($startDate); + $endMonth = self::MONTHOFYEAR($endDate); + $endDay = self::DAYOFMONTH($endDate); + if (($startMonth < 3) || + (($endMonth * 100 + $endDay) >= (2 * 100 + 29))) { + $leapDays += 1; + } + } + } else { + for ($year = $startYear; $year <= $endYear; ++$year) { + if ($year == $startYear) { + $startMonth = self::MONTHOFYEAR($startDate); + $startDay = self::DAYOFMONTH($startDate); + if ($startMonth < 3) { + $leapDays += (self::isLeapYear($year)) ? 1 : 0; + } + } elseif ($year == $endYear) { + $endMonth = self::MONTHOFYEAR($endDate); + $endDay = self::DAYOFMONTH($endDate); + if (($endMonth * 100 + $endDay) >= (2 * 100 + 29)) { + $leapDays += (self::isLeapYear($year)) ? 1 : 0; + } + } else { + $leapDays += (self::isLeapYear($year)) ? 1 : 0; + } + } + if ($years == 2) { + if (($leapDays == 0) && (self::isLeapYear($startYear)) && ($days > 365)) { + $leapDays = 1; + } elseif ($days < 366) { + $years = 1; + } + } + $leapDays /= $years; + } + return $days / (365 + $leapDays); + case 2: + return self::DATEDIF($startDate, $endDate) / 360; + case 3: + return self::DATEDIF($startDate, $endDate) / 365; + case 4: + return self::DAYS360($startDate, $endDate, true) / 360; + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * NETWORKDAYS + * + * Returns the number of whole working days between start_date and end_date. Working days + * exclude weekends and any dates identified in holidays. + * Use NETWORKDAYS to calculate employee benefits that accrue based on the number of days + * worked during a specific term. + * + * Excel Function: + * NETWORKDAYS(startDate,endDate[,holidays[,holiday[,...]]]) + * + * @access public + * @category Date/Time Functions + * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard date string + * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard date string + * @param mixed $holidays,... Optional series of Excel date serial value (float), PHP date + * timestamp (integer), PHP DateTime object, or a standard date + * strings that will be excluded from the working calendar, such + * as state and federal holidays and floating holidays. + * @return integer Interval between the dates + */ + public static function NETWORKDAYS($startDate, $endDate) + { + // Retrieve the mandatory start and end date that are referenced in the function definition + $startDate = PHPExcel_Calculation_Functions::flattenSingleValue($startDate); + $endDate = PHPExcel_Calculation_Functions::flattenSingleValue($endDate); + // Flush the mandatory start and end date that are referenced in the function definition, and get the optional days + $dateArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + array_shift($dateArgs); + array_shift($dateArgs); + + // Validate the start and end dates + if (is_string($startDate = $sDate = self::getDateValue($startDate))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $startDate = (float) floor($startDate); + if (is_string($endDate = $eDate = self::getDateValue($endDate))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $endDate = (float) floor($endDate); + + if ($sDate > $eDate) { + $startDate = $eDate; + $endDate = $sDate; + } + + // Execute function + $startDoW = 6 - self::DAYOFWEEK($startDate, 2); + if ($startDoW < 0) { + $startDoW = 0; + } + $endDoW = self::DAYOFWEEK($endDate, 2); + if ($endDoW >= 6) { + $endDoW = 0; + } + + $wholeWeekDays = floor(($endDate - $startDate) / 7) * 5; + $partWeekDays = $endDoW + $startDoW; + if ($partWeekDays > 5) { + $partWeekDays -= 5; + } + + // Test any extra holiday parameters + $holidayCountedArray = array(); + foreach ($dateArgs as $holidayDate) { + if (is_string($holidayDate = self::getDateValue($holidayDate))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if (($holidayDate >= $startDate) && ($holidayDate <= $endDate)) { + if ((self::DAYOFWEEK($holidayDate, 2) < 6) && (!in_array($holidayDate, $holidayCountedArray))) { + --$partWeekDays; + $holidayCountedArray[] = $holidayDate; + } + } + } + + if ($sDate > $eDate) { + return 0 - ($wholeWeekDays + $partWeekDays); + } + return $wholeWeekDays + $partWeekDays; + } + + + /** + * WORKDAY + * + * Returns the date that is the indicated number of working days before or after a date (the + * starting date). Working days exclude weekends and any dates identified as holidays. + * Use WORKDAY to exclude weekends or holidays when you calculate invoice due dates, expected + * delivery times, or the number of days of work performed. + * + * Excel Function: + * WORKDAY(startDate,endDays[,holidays[,holiday[,...]]]) + * + * @access public + * @category Date/Time Functions + * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard date string + * @param integer $endDays The number of nonweekend and nonholiday days before or after + * startDate. A positive value for days yields a future date; a + * negative value yields a past date. + * @param mixed $holidays,... Optional series of Excel date serial value (float), PHP date + * timestamp (integer), PHP DateTime object, or a standard date + * strings that will be excluded from the working calendar, such + * as state and federal holidays and floating holidays. + * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, + * depending on the value of the ReturnDateType flag + */ + public static function WORKDAY($startDate, $endDays) + { + // Retrieve the mandatory start date and days that are referenced in the function definition + $startDate = PHPExcel_Calculation_Functions::flattenSingleValue($startDate); + $endDays = PHPExcel_Calculation_Functions::flattenSingleValue($endDays); + // Flush the mandatory start date and days that are referenced in the function definition, and get the optional days + $dateArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + array_shift($dateArgs); + array_shift($dateArgs); + + if ((is_string($startDate = self::getDateValue($startDate))) || (!is_numeric($endDays))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $startDate = (float) floor($startDate); + $endDays = (int) floor($endDays); + // If endDays is 0, we always return startDate + if ($endDays == 0) { + return $startDate; + } + + $decrementing = ($endDays < 0) ? true : false; + + // Adjust the start date if it falls over a weekend + + $startDoW = self::DAYOFWEEK($startDate, 3); + if (self::DAYOFWEEK($startDate, 3) >= 5) { + $startDate += ($decrementing) ? -$startDoW + 4: 7 - $startDoW; + ($decrementing) ? $endDays++ : $endDays--; + } + + // Add endDays + $endDate = (float) $startDate + (intval($endDays / 5) * 7) + ($endDays % 5); + + // Adjust the calculated end date if it falls over a weekend + $endDoW = self::DAYOFWEEK($endDate, 3); + if ($endDoW >= 5) { + $endDate += ($decrementing) ? -$endDoW + 4: 7 - $endDoW; + } + + // Test any extra holiday parameters + if (!empty($dateArgs)) { + $holidayCountedArray = $holidayDates = array(); + foreach ($dateArgs as $holidayDate) { + if (($holidayDate !== null) && (trim($holidayDate) > '')) { + if (is_string($holidayDate = self::getDateValue($holidayDate))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if (self::DAYOFWEEK($holidayDate, 3) < 5) { + $holidayDates[] = $holidayDate; + } + } + } + if ($decrementing) { + rsort($holidayDates, SORT_NUMERIC); + } else { + sort($holidayDates, SORT_NUMERIC); + } + foreach ($holidayDates as $holidayDate) { + if ($decrementing) { + if (($holidayDate <= $startDate) && ($holidayDate >= $endDate)) { + if (!in_array($holidayDate, $holidayCountedArray)) { + --$endDate; + $holidayCountedArray[] = $holidayDate; + } + } + } else { + if (($holidayDate >= $startDate) && ($holidayDate <= $endDate)) { + if (!in_array($holidayDate, $holidayCountedArray)) { + ++$endDate; + $holidayCountedArray[] = $holidayDate; + } + } + } + // Adjust the calculated end date if it falls over a weekend + $endDoW = self::DAYOFWEEK($endDate, 3); + if ($endDoW >= 5) { + $endDate += ($decrementing) ? -$endDoW + 4 : 7 - $endDoW; + } + } + } + + switch (PHPExcel_Calculation_Functions::getReturnDateType()) { + case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL: + return (float) $endDate; + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC: + return (integer) PHPExcel_Shared_Date::ExcelToPHP($endDate); + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT: + return PHPExcel_Shared_Date::ExcelToPHPObject($endDate); + } + } + + + /** + * DAYOFMONTH + * + * Returns the day of the month, for a specified date. The day is given as an integer + * ranging from 1 to 31. + * + * Excel Function: + * DAY(dateValue) + * + * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard date string + * @return int Day of the month + */ + public static function DAYOFMONTH($dateValue = 1) + { + $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue); + + if ($dateValue === null) { + $dateValue = 1; + } elseif (is_string($dateValue = self::getDateValue($dateValue))) { + return PHPExcel_Calculation_Functions::VALUE(); + } elseif ($dateValue == 0.0) { + return 0; + } elseif ($dateValue < 0.0) { + return PHPExcel_Calculation_Functions::NaN(); + } + + // Execute function + $PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue); + + return (int) $PHPDateObject->format('j'); + } + + + /** + * DAYOFWEEK + * + * Returns the day of the week for a specified date. The day is given as an integer + * ranging from 0 to 7 (dependent on the requested style). + * + * Excel Function: + * WEEKDAY(dateValue[,style]) + * + * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard date string + * @param int $style A number that determines the type of return value + * 1 or omitted Numbers 1 (Sunday) through 7 (Saturday). + * 2 Numbers 1 (Monday) through 7 (Sunday). + * 3 Numbers 0 (Monday) through 6 (Sunday). + * @return int Day of the week value + */ + public static function DAYOFWEEK($dateValue = 1, $style = 1) + { + $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue); + $style = PHPExcel_Calculation_Functions::flattenSingleValue($style); + + if (!is_numeric($style)) { + return PHPExcel_Calculation_Functions::VALUE(); + } elseif (($style < 1) || ($style > 3)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $style = floor($style); + + if ($dateValue === null) { + $dateValue = 1; + } elseif (is_string($dateValue = self::getDateValue($dateValue))) { + return PHPExcel_Calculation_Functions::VALUE(); + } elseif ($dateValue < 0.0) { + return PHPExcel_Calculation_Functions::NaN(); + } + + // Execute function + $PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue); + $DoW = $PHPDateObject->format('w'); + + $firstDay = 1; + switch ($style) { + case 1: + ++$DoW; + break; + case 2: + if ($DoW == 0) { + $DoW = 7; + } + break; + case 3: + if ($DoW == 0) { + $DoW = 7; + } + $firstDay = 0; + --$DoW; + break; + } + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL) { + // Test for Excel's 1900 leap year, and introduce the error as required + if (($PHPDateObject->format('Y') == 1900) && ($PHPDateObject->format('n') <= 2)) { + --$DoW; + if ($DoW < $firstDay) { + $DoW += 7; + } + } + } + + return (int) $DoW; + } + + + /** + * WEEKOFYEAR + * + * Returns the week of the year for a specified date. + * The WEEKNUM function considers the week containing January 1 to be the first week of the year. + * However, there is a European standard that defines the first week as the one with the majority + * of days (four or more) falling in the new year. This means that for years in which there are + * three days or less in the first week of January, the WEEKNUM function returns week numbers + * that are incorrect according to the European standard. + * + * Excel Function: + * WEEKNUM(dateValue[,style]) + * + * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard date string + * @param boolean $method Week begins on Sunday or Monday + * 1 or omitted Week begins on Sunday. + * 2 Week begins on Monday. + * @return int Week Number + */ + public static function WEEKOFYEAR($dateValue = 1, $method = 1) + { + $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue); + $method = PHPExcel_Calculation_Functions::flattenSingleValue($method); + + if (!is_numeric($method)) { + return PHPExcel_Calculation_Functions::VALUE(); + } elseif (($method < 1) || ($method > 2)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $method = floor($method); + + if ($dateValue === null) { + $dateValue = 1; + } elseif (is_string($dateValue = self::getDateValue($dateValue))) { + return PHPExcel_Calculation_Functions::VALUE(); + } elseif ($dateValue < 0.0) { + return PHPExcel_Calculation_Functions::NaN(); + } + + // Execute function + $PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue); + $dayOfYear = $PHPDateObject->format('z'); + $dow = $PHPDateObject->format('w'); + $PHPDateObject->modify('-' . $dayOfYear . ' days'); + $dow = $PHPDateObject->format('w'); + $daysInFirstWeek = 7 - (($dow + (2 - $method)) % 7); + $dayOfYear -= $daysInFirstWeek; + $weekOfYear = ceil($dayOfYear / 7) + 1; + + return (int) $weekOfYear; + } + + + /** + * MONTHOFYEAR + * + * Returns the month of a date represented by a serial number. + * The month is given as an integer, ranging from 1 (January) to 12 (December). + * + * Excel Function: + * MONTH(dateValue) + * + * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard date string + * @return int Month of the year + */ + public static function MONTHOFYEAR($dateValue = 1) + { + $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue); + + if ($dateValue === null) { + $dateValue = 1; + } elseif (is_string($dateValue = self::getDateValue($dateValue))) { + return PHPExcel_Calculation_Functions::VALUE(); + } elseif ($dateValue < 0.0) { + return PHPExcel_Calculation_Functions::NaN(); + } + + // Execute function + $PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue); + + return (int) $PHPDateObject->format('n'); + } + + + /** + * YEAR + * + * Returns the year corresponding to a date. + * The year is returned as an integer in the range 1900-9999. + * + * Excel Function: + * YEAR(dateValue) + * + * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard date string + * @return int Year + */ + public static function YEAR($dateValue = 1) + { + $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue); + + if ($dateValue === null) { + $dateValue = 1; + } elseif (is_string($dateValue = self::getDateValue($dateValue))) { + return PHPExcel_Calculation_Functions::VALUE(); + } elseif ($dateValue < 0.0) { + return PHPExcel_Calculation_Functions::NaN(); + } + + // Execute function + $PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue); + + return (int) $PHPDateObject->format('Y'); + } + + + /** + * HOUROFDAY + * + * Returns the hour of a time value. + * The hour is given as an integer, ranging from 0 (12:00 A.M.) to 23 (11:00 P.M.). + * + * Excel Function: + * HOUR(timeValue) + * + * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard time string + * @return int Hour + */ + public static function HOUROFDAY($timeValue = 0) + { + $timeValue = PHPExcel_Calculation_Functions::flattenSingleValue($timeValue); + + if (!is_numeric($timeValue)) { + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { + $testVal = strtok($timeValue, '/-: '); + if (strlen($testVal) < strlen($timeValue)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + $timeValue = self::getTimeValue($timeValue); + if (is_string($timeValue)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + // Execute function + if ($timeValue >= 1) { + $timeValue = fmod($timeValue, 1); + } elseif ($timeValue < 0.0) { + return PHPExcel_Calculation_Functions::NaN(); + } + $timeValue = PHPExcel_Shared_Date::ExcelToPHP($timeValue); + + return (int) gmdate('G', $timeValue); + } + + + /** + * MINUTEOFHOUR + * + * Returns the minutes of a time value. + * The minute is given as an integer, ranging from 0 to 59. + * + * Excel Function: + * MINUTE(timeValue) + * + * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard time string + * @return int Minute + */ + public static function MINUTEOFHOUR($timeValue = 0) + { + $timeValue = $timeTester = PHPExcel_Calculation_Functions::flattenSingleValue($timeValue); + + if (!is_numeric($timeValue)) { + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { + $testVal = strtok($timeValue, '/-: '); + if (strlen($testVal) < strlen($timeValue)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + $timeValue = self::getTimeValue($timeValue); + if (is_string($timeValue)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + // Execute function + if ($timeValue >= 1) { + $timeValue = fmod($timeValue, 1); + } elseif ($timeValue < 0.0) { + return PHPExcel_Calculation_Functions::NaN(); + } + $timeValue = PHPExcel_Shared_Date::ExcelToPHP($timeValue); + + return (int) gmdate('i', $timeValue); + } + + + /** + * SECONDOFMINUTE + * + * Returns the seconds of a time value. + * The second is given as an integer in the range 0 (zero) to 59. + * + * Excel Function: + * SECOND(timeValue) + * + * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard time string + * @return int Second + */ + public static function SECONDOFMINUTE($timeValue = 0) + { + $timeValue = PHPExcel_Calculation_Functions::flattenSingleValue($timeValue); + + if (!is_numeric($timeValue)) { + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { + $testVal = strtok($timeValue, '/-: '); + if (strlen($testVal) < strlen($timeValue)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + $timeValue = self::getTimeValue($timeValue); + if (is_string($timeValue)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + // Execute function + if ($timeValue >= 1) { + $timeValue = fmod($timeValue, 1); + } elseif ($timeValue < 0.0) { + return PHPExcel_Calculation_Functions::NaN(); + } + $timeValue = PHPExcel_Shared_Date::ExcelToPHP($timeValue); + + return (int) gmdate('s', $timeValue); + } + + + /** + * EDATE + * + * Returns the serial number that represents the date that is the indicated number of months + * before or after a specified date (the start_date). + * Use EDATE to calculate maturity dates or due dates that fall on the same day of the month + * as the date of issue. + * + * Excel Function: + * EDATE(dateValue,adjustmentMonths) + * + * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard date string + * @param int $adjustmentMonths The number of months before or after start_date. + * A positive value for months yields a future date; + * a negative value yields a past date. + * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, + * depending on the value of the ReturnDateType flag + */ + public static function EDATE($dateValue = 1, $adjustmentMonths = 0) + { + $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue); + $adjustmentMonths = PHPExcel_Calculation_Functions::flattenSingleValue($adjustmentMonths); + + if (!is_numeric($adjustmentMonths)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $adjustmentMonths = floor($adjustmentMonths); + + if (is_string($dateValue = self::getDateValue($dateValue))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + // Execute function + $PHPDateObject = self::adjustDateByMonths($dateValue, $adjustmentMonths); + + switch (PHPExcel_Calculation_Functions::getReturnDateType()) { + case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL: + return (float) PHPExcel_Shared_Date::PHPToExcel($PHPDateObject); + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC: + return (integer) PHPExcel_Shared_Date::ExcelToPHP(PHPExcel_Shared_Date::PHPToExcel($PHPDateObject)); + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT: + return $PHPDateObject; + } + } + + + /** + * EOMONTH + * + * Returns the date value for the last day of the month that is the indicated number of months + * before or after start_date. + * Use EOMONTH to calculate maturity dates or due dates that fall on the last day of the month. + * + * Excel Function: + * EOMONTH(dateValue,adjustmentMonths) + * + * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), + * PHP DateTime object, or a standard date string + * @param int $adjustmentMonths The number of months before or after start_date. + * A positive value for months yields a future date; + * a negative value yields a past date. + * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, + * depending on the value of the ReturnDateType flag + */ + public static function EOMONTH($dateValue = 1, $adjustmentMonths = 0) + { + $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue); + $adjustmentMonths = PHPExcel_Calculation_Functions::flattenSingleValue($adjustmentMonths); + + if (!is_numeric($adjustmentMonths)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $adjustmentMonths = floor($adjustmentMonths); + + if (is_string($dateValue = self::getDateValue($dateValue))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + // Execute function + $PHPDateObject = self::adjustDateByMonths($dateValue, $adjustmentMonths+1); + $adjustDays = (int) $PHPDateObject->format('d'); + $adjustDaysString = '-' . $adjustDays . ' days'; + $PHPDateObject->modify($adjustDaysString); + + switch (PHPExcel_Calculation_Functions::getReturnDateType()) { + case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL: + return (float) PHPExcel_Shared_Date::PHPToExcel($PHPDateObject); + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC: + return (integer) PHPExcel_Shared_Date::ExcelToPHP(PHPExcel_Shared_Date::PHPToExcel($PHPDateObject)); + case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT: + return $PHPDateObject; + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation/Engineering.php b/extend/PHPExcel/PHPExcel/Calculation/Engineering.php new file mode 100644 index 0000000..75e2784 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation/Engineering.php @@ -0,0 +1,2650 @@ + array('Group' => 'Mass', 'Unit Name' => 'Gram', 'AllowPrefix' => true), + 'sg' => array('Group' => 'Mass', 'Unit Name' => 'Slug', 'AllowPrefix' => false), + 'lbm' => array('Group' => 'Mass', 'Unit Name' => 'Pound mass (avoirdupois)', 'AllowPrefix' => false), + 'u' => array('Group' => 'Mass', 'Unit Name' => 'U (atomic mass unit)', 'AllowPrefix' => true), + 'ozm' => array('Group' => 'Mass', 'Unit Name' => 'Ounce mass (avoirdupois)', 'AllowPrefix' => false), + 'm' => array('Group' => 'Distance', 'Unit Name' => 'Meter', 'AllowPrefix' => true), + 'mi' => array('Group' => 'Distance', 'Unit Name' => 'Statute mile', 'AllowPrefix' => false), + 'Nmi' => array('Group' => 'Distance', 'Unit Name' => 'Nautical mile', 'AllowPrefix' => false), + 'in' => array('Group' => 'Distance', 'Unit Name' => 'Inch', 'AllowPrefix' => false), + 'ft' => array('Group' => 'Distance', 'Unit Name' => 'Foot', 'AllowPrefix' => false), + 'yd' => array('Group' => 'Distance', 'Unit Name' => 'Yard', 'AllowPrefix' => false), + 'ang' => array('Group' => 'Distance', 'Unit Name' => 'Angstrom', 'AllowPrefix' => true), + 'Pica' => array('Group' => 'Distance', 'Unit Name' => 'Pica (1/72 in)', 'AllowPrefix' => false), + 'yr' => array('Group' => 'Time', 'Unit Name' => 'Year', 'AllowPrefix' => false), + 'day' => array('Group' => 'Time', 'Unit Name' => 'Day', 'AllowPrefix' => false), + 'hr' => array('Group' => 'Time', 'Unit Name' => 'Hour', 'AllowPrefix' => false), + 'mn' => array('Group' => 'Time', 'Unit Name' => 'Minute', 'AllowPrefix' => false), + 'sec' => array('Group' => 'Time', 'Unit Name' => 'Second', 'AllowPrefix' => true), + 'Pa' => array('Group' => 'Pressure', 'Unit Name' => 'Pascal', 'AllowPrefix' => true), + 'p' => array('Group' => 'Pressure', 'Unit Name' => 'Pascal', 'AllowPrefix' => true), + 'atm' => array('Group' => 'Pressure', 'Unit Name' => 'Atmosphere', 'AllowPrefix' => true), + 'at' => array('Group' => 'Pressure', 'Unit Name' => 'Atmosphere', 'AllowPrefix' => true), + 'mmHg' => array('Group' => 'Pressure', 'Unit Name' => 'mm of Mercury', 'AllowPrefix' => true), + 'N' => array('Group' => 'Force', 'Unit Name' => 'Newton', 'AllowPrefix' => true), + 'dyn' => array('Group' => 'Force', 'Unit Name' => 'Dyne', 'AllowPrefix' => true), + 'dy' => array('Group' => 'Force', 'Unit Name' => 'Dyne', 'AllowPrefix' => true), + 'lbf' => array('Group' => 'Force', 'Unit Name' => 'Pound force', 'AllowPrefix' => false), + 'J' => array('Group' => 'Energy', 'Unit Name' => 'Joule', 'AllowPrefix' => true), + 'e' => array('Group' => 'Energy', 'Unit Name' => 'Erg', 'AllowPrefix' => true), + 'c' => array('Group' => 'Energy', 'Unit Name' => 'Thermodynamic calorie', 'AllowPrefix' => true), + 'cal' => array('Group' => 'Energy', 'Unit Name' => 'IT calorie', 'AllowPrefix' => true), + 'eV' => array('Group' => 'Energy', 'Unit Name' => 'Electron volt', 'AllowPrefix' => true), + 'ev' => array('Group' => 'Energy', 'Unit Name' => 'Electron volt', 'AllowPrefix' => true), + 'HPh' => array('Group' => 'Energy', 'Unit Name' => 'Horsepower-hour', 'AllowPrefix' => false), + 'hh' => array('Group' => 'Energy', 'Unit Name' => 'Horsepower-hour', 'AllowPrefix' => false), + 'Wh' => array('Group' => 'Energy', 'Unit Name' => 'Watt-hour', 'AllowPrefix' => true), + 'wh' => array('Group' => 'Energy', 'Unit Name' => 'Watt-hour', 'AllowPrefix' => true), + 'flb' => array('Group' => 'Energy', 'Unit Name' => 'Foot-pound', 'AllowPrefix' => false), + 'BTU' => array('Group' => 'Energy', 'Unit Name' => 'BTU', 'AllowPrefix' => false), + 'btu' => array('Group' => 'Energy', 'Unit Name' => 'BTU', 'AllowPrefix' => false), + 'HP' => array('Group' => 'Power', 'Unit Name' => 'Horsepower', 'AllowPrefix' => false), + 'h' => array('Group' => 'Power', 'Unit Name' => 'Horsepower', 'AllowPrefix' => false), + 'W' => array('Group' => 'Power', 'Unit Name' => 'Watt', 'AllowPrefix' => true), + 'w' => array('Group' => 'Power', 'Unit Name' => 'Watt', 'AllowPrefix' => true), + 'T' => array('Group' => 'Magnetism', 'Unit Name' => 'Tesla', 'AllowPrefix' => true), + 'ga' => array('Group' => 'Magnetism', 'Unit Name' => 'Gauss', 'AllowPrefix' => true), + 'C' => array('Group' => 'Temperature', 'Unit Name' => 'Celsius', 'AllowPrefix' => false), + 'cel' => array('Group' => 'Temperature', 'Unit Name' => 'Celsius', 'AllowPrefix' => false), + 'F' => array('Group' => 'Temperature', 'Unit Name' => 'Fahrenheit', 'AllowPrefix' => false), + 'fah' => array('Group' => 'Temperature', 'Unit Name' => 'Fahrenheit', 'AllowPrefix' => false), + 'K' => array('Group' => 'Temperature', 'Unit Name' => 'Kelvin', 'AllowPrefix' => false), + 'kel' => array('Group' => 'Temperature', 'Unit Name' => 'Kelvin', 'AllowPrefix' => false), + 'tsp' => array('Group' => 'Liquid', 'Unit Name' => 'Teaspoon', 'AllowPrefix' => false), + 'tbs' => array('Group' => 'Liquid', 'Unit Name' => 'Tablespoon', 'AllowPrefix' => false), + 'oz' => array('Group' => 'Liquid', 'Unit Name' => 'Fluid Ounce', 'AllowPrefix' => false), + 'cup' => array('Group' => 'Liquid', 'Unit Name' => 'Cup', 'AllowPrefix' => false), + 'pt' => array('Group' => 'Liquid', 'Unit Name' => 'U.S. Pint', 'AllowPrefix' => false), + 'us_pt' => array('Group' => 'Liquid', 'Unit Name' => 'U.S. Pint', 'AllowPrefix' => false), + 'uk_pt' => array('Group' => 'Liquid', 'Unit Name' => 'U.K. Pint', 'AllowPrefix' => false), + 'qt' => array('Group' => 'Liquid', 'Unit Name' => 'Quart', 'AllowPrefix' => false), + 'gal' => array('Group' => 'Liquid', 'Unit Name' => 'Gallon', 'AllowPrefix' => false), + 'l' => array('Group' => 'Liquid', 'Unit Name' => 'Litre', 'AllowPrefix' => true), + 'lt' => array('Group' => 'Liquid', 'Unit Name' => 'Litre', 'AllowPrefix' => true), + ); + + /** + * Details of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM() + * + * @var mixed[] + */ + private static $conversionMultipliers = array( + 'Y' => array('multiplier' => 1E24, 'name' => 'yotta'), + 'Z' => array('multiplier' => 1E21, 'name' => 'zetta'), + 'E' => array('multiplier' => 1E18, 'name' => 'exa'), + 'P' => array('multiplier' => 1E15, 'name' => 'peta'), + 'T' => array('multiplier' => 1E12, 'name' => 'tera'), + 'G' => array('multiplier' => 1E9, 'name' => 'giga'), + 'M' => array('multiplier' => 1E6, 'name' => 'mega'), + 'k' => array('multiplier' => 1E3, 'name' => 'kilo'), + 'h' => array('multiplier' => 1E2, 'name' => 'hecto'), + 'e' => array('multiplier' => 1E1, 'name' => 'deka'), + 'd' => array('multiplier' => 1E-1, 'name' => 'deci'), + 'c' => array('multiplier' => 1E-2, 'name' => 'centi'), + 'm' => array('multiplier' => 1E-3, 'name' => 'milli'), + 'u' => array('multiplier' => 1E-6, 'name' => 'micro'), + 'n' => array('multiplier' => 1E-9, 'name' => 'nano'), + 'p' => array('multiplier' => 1E-12, 'name' => 'pico'), + 'f' => array('multiplier' => 1E-15, 'name' => 'femto'), + 'a' => array('multiplier' => 1E-18, 'name' => 'atto'), + 'z' => array('multiplier' => 1E-21, 'name' => 'zepto'), + 'y' => array('multiplier' => 1E-24, 'name' => 'yocto'), + ); + + /** + * Details of the Units of measure conversion factors, organised by group + * + * @var mixed[] + */ + private static $unitConversions = array( + 'Mass' => array( + 'g' => array( + 'g' => 1.0, + 'sg' => 6.85220500053478E-05, + 'lbm' => 2.20462291469134E-03, + 'u' => 6.02217000000000E+23, + 'ozm' => 3.52739718003627E-02, + ), + 'sg' => array( + 'g' => 1.45938424189287E+04, + 'sg' => 1.0, + 'lbm' => 3.21739194101647E+01, + 'u' => 8.78866000000000E+27, + 'ozm' => 5.14782785944229E+02, + ), + 'lbm' => array( + 'g' => 4.5359230974881148E+02, + 'sg' => 3.10810749306493E-02, + 'lbm' => 1.0, + 'u' => 2.73161000000000E+26, + 'ozm' => 1.60000023429410E+01, + ), + 'u' => array( + 'g' => 1.66053100460465E-24, + 'sg' => 1.13782988532950E-28, + 'lbm' => 3.66084470330684E-27, + 'u' => 1.0, + 'ozm' => 5.85735238300524E-26, + ), + 'ozm' => array( + 'g' => 2.83495152079732E+01, + 'sg' => 1.94256689870811E-03, + 'lbm' => 6.24999908478882E-02, + 'u' => 1.70725600000000E+25, + 'ozm' => 1.0, + ), + ), + 'Distance' => array( + 'm' => array( + 'm' => 1.0, + 'mi' => 6.21371192237334E-04, + 'Nmi' => 5.39956803455724E-04, + 'in' => 3.93700787401575E+01, + 'ft' => 3.28083989501312E+00, + 'yd' => 1.09361329797891E+00, + 'ang' => 1.00000000000000E+10, + 'Pica' => 2.83464566929116E+03, + ), + 'mi' => array( + 'm' => 1.60934400000000E+03, + 'mi' => 1.0, + 'Nmi' => 8.68976241900648E-01, + 'in' => 6.33600000000000E+04, + 'ft' => 5.28000000000000E+03, + 'yd' => 1.76000000000000E+03, + 'ang' => 1.60934400000000E+13, + 'Pica' => 4.56191999999971E+06, + ), + 'Nmi' => array( + 'm' => 1.85200000000000E+03, + 'mi' => 1.15077944802354E+00, + 'Nmi' => 1.0, + 'in' => 7.29133858267717E+04, + 'ft' => 6.07611548556430E+03, + 'yd' => 2.02537182785694E+03, + 'ang' => 1.85200000000000E+13, + 'Pica' => 5.24976377952723E+06, + ), + 'in' => array( + 'm' => 2.54000000000000E-02, + 'mi' => 1.57828282828283E-05, + 'Nmi' => 1.37149028077754E-05, + 'in' => 1.0, + 'ft' => 8.33333333333333E-02, + 'yd' => 2.77777777686643E-02, + 'ang' => 2.54000000000000E+08, + 'Pica' => 7.19999999999955E+01, + ), + 'ft' => array( + 'm' => 3.04800000000000E-01, + 'mi' => 1.89393939393939E-04, + 'Nmi' => 1.64578833693305E-04, + 'in' => 1.20000000000000E+01, + 'ft' => 1.0, + 'yd' => 3.33333333223972E-01, + 'ang' => 3.04800000000000E+09, + 'Pica' => 8.63999999999946E+02, + ), + 'yd' => array( + 'm' => 9.14400000300000E-01, + 'mi' => 5.68181818368230E-04, + 'Nmi' => 4.93736501241901E-04, + 'in' => 3.60000000118110E+01, + 'ft' => 3.00000000000000E+00, + 'yd' => 1.0, + 'ang' => 9.14400000300000E+09, + 'Pica' => 2.59200000085023E+03, + ), + 'ang' => array( + 'm' => 1.00000000000000E-10, + 'mi' => 6.21371192237334E-14, + 'Nmi' => 5.39956803455724E-14, + 'in' => 3.93700787401575E-09, + 'ft' => 3.28083989501312E-10, + 'yd' => 1.09361329797891E-10, + 'ang' => 1.0, + 'Pica' => 2.83464566929116E-07, + ), + 'Pica' => array( + 'm' => 3.52777777777800E-04, + 'mi' => 2.19205948372629E-07, + 'Nmi' => 1.90484761219114E-07, + 'in' => 1.38888888888898E-02, + 'ft' => 1.15740740740748E-03, + 'yd' => 3.85802469009251E-04, + 'ang' => 3.52777777777800E+06, + 'Pica' => 1.0, + ), + ), + 'Time' => array( + 'yr' => array( + 'yr' => 1.0, + 'day' => 365.25, + 'hr' => 8766.0, + 'mn' => 525960.0, + 'sec' => 31557600.0, + ), + 'day' => array( + 'yr' => 2.73785078713210E-03, + 'day' => 1.0, + 'hr' => 24.0, + 'mn' => 1440.0, + 'sec' => 86400.0, + ), + 'hr' => array( + 'yr' => 1.14077116130504E-04, + 'day' => 4.16666666666667E-02, + 'hr' => 1.0, + 'mn' => 60.0, + 'sec' => 3600.0, + ), + 'mn' => array( + 'yr' => 1.90128526884174E-06, + 'day' => 6.94444444444444E-04, + 'hr' => 1.66666666666667E-02, + 'mn' => 1.0, + 'sec' => 60.0, + ), + 'sec' => array( + 'yr' => 3.16880878140289E-08, + 'day' => 1.15740740740741E-05, + 'hr' => 2.77777777777778E-04, + 'mn' => 1.66666666666667E-02, + 'sec' => 1.0, + ), + ), + 'Pressure' => array( + 'Pa' => array( + 'Pa' => 1.0, + 'p' => 1.0, + 'atm' => 9.86923299998193E-06, + 'at' => 9.86923299998193E-06, + 'mmHg' => 7.50061707998627E-03, + ), + 'p' => array( + 'Pa' => 1.0, + 'p' => 1.0, + 'atm' => 9.86923299998193E-06, + 'at' => 9.86923299998193E-06, + 'mmHg' => 7.50061707998627E-03, + ), + 'atm' => array( + 'Pa' => 1.01324996583000E+05, + 'p' => 1.01324996583000E+05, + 'atm' => 1.0, + 'at' => 1.0, + 'mmHg' => 760.0, + ), + 'at' => array( + 'Pa' => 1.01324996583000E+05, + 'p' => 1.01324996583000E+05, + 'atm' => 1.0, + 'at' => 1.0, + 'mmHg' => 760.0, + ), + 'mmHg' => array( + 'Pa' => 1.33322363925000E+02, + 'p' => 1.33322363925000E+02, + 'atm' => 1.31578947368421E-03, + 'at' => 1.31578947368421E-03, + 'mmHg' => 1.0, + ), + ), + 'Force' => array( + 'N' => array( + 'N' => 1.0, + 'dyn' => 1.0E+5, + 'dy' => 1.0E+5, + 'lbf' => 2.24808923655339E-01, + ), + 'dyn' => array( + 'N' => 1.0E-5, + 'dyn' => 1.0, + 'dy' => 1.0, + 'lbf' => 2.24808923655339E-06, + ), + 'dy' => array( + 'N' => 1.0E-5, + 'dyn' => 1.0, + 'dy' => 1.0, + 'lbf' => 2.24808923655339E-06, + ), + 'lbf' => array( + 'N' => 4.448222, + 'dyn' => 4.448222E+5, + 'dy' => 4.448222E+5, + 'lbf' => 1.0, + ), + ), + 'Energy' => array( + 'J' => array( + 'J' => 1.0, + 'e' => 9.99999519343231E+06, + 'c' => 2.39006249473467E-01, + 'cal' => 2.38846190642017E-01, + 'eV' => 6.24145700000000E+18, + 'ev' => 6.24145700000000E+18, + 'HPh' => 3.72506430801000E-07, + 'hh' => 3.72506430801000E-07, + 'Wh' => 2.77777916238711E-04, + 'wh' => 2.77777916238711E-04, + 'flb' => 2.37304222192651E+01, + 'BTU' => 9.47815067349015E-04, + 'btu' => 9.47815067349015E-04, + ), + 'e' => array( + 'J' => 1.00000048065700E-07, + 'e' => 1.0, + 'c' => 2.39006364353494E-08, + 'cal' => 2.38846305445111E-08, + 'eV' => 6.24146000000000E+11, + 'ev' => 6.24146000000000E+11, + 'HPh' => 3.72506609848824E-14, + 'hh' => 3.72506609848824E-14, + 'Wh' => 2.77778049754611E-11, + 'wh' => 2.77778049754611E-11, + 'flb' => 2.37304336254586E-06, + 'BTU' => 9.47815522922962E-11, + 'btu' => 9.47815522922962E-11, + ), + 'c' => array( + 'J' => 4.18399101363672E+00, + 'e' => 4.18398900257312E+07, + 'c' => 1.0, + 'cal' => 9.99330315287563E-01, + 'eV' => 2.61142000000000E+19, + 'ev' => 2.61142000000000E+19, + 'HPh' => 1.55856355899327E-06, + 'hh' => 1.55856355899327E-06, + 'Wh' => 1.16222030532950E-03, + 'wh' => 1.16222030532950E-03, + 'flb' => 9.92878733152102E+01, + 'BTU' => 3.96564972437776E-03, + 'btu' => 3.96564972437776E-03, + ), + 'cal' => array( + 'J' => 4.18679484613929E+00, + 'e' => 4.18679283372801E+07, + 'c' => 1.00067013349059E+00, + 'cal' => 1.0, + 'eV' => 2.61317000000000E+19, + 'ev' => 2.61317000000000E+19, + 'HPh' => 1.55960800463137E-06, + 'hh' => 1.55960800463137E-06, + 'Wh' => 1.16299914807955E-03, + 'wh' => 1.16299914807955E-03, + 'flb' => 9.93544094443283E+01, + 'BTU' => 3.96830723907002E-03, + 'btu' => 3.96830723907002E-03, + ), + 'eV' => array( + 'J' => 1.60219000146921E-19, + 'e' => 1.60218923136574E-12, + 'c' => 3.82933423195043E-20, + 'cal' => 3.82676978535648E-20, + 'eV' => 1.0, + 'ev' => 1.0, + 'HPh' => 5.96826078912344E-26, + 'hh' => 5.96826078912344E-26, + 'Wh' => 4.45053000026614E-23, + 'wh' => 4.45053000026614E-23, + 'flb' => 3.80206452103492E-18, + 'BTU' => 1.51857982414846E-22, + 'btu' => 1.51857982414846E-22, + ), + 'ev' => array( + 'J' => 1.60219000146921E-19, + 'e' => 1.60218923136574E-12, + 'c' => 3.82933423195043E-20, + 'cal' => 3.82676978535648E-20, + 'eV' => 1.0, + 'ev' => 1.0, + 'HPh' => 5.96826078912344E-26, + 'hh' => 5.96826078912344E-26, + 'Wh' => 4.45053000026614E-23, + 'wh' => 4.45053000026614E-23, + 'flb' => 3.80206452103492E-18, + 'BTU' => 1.51857982414846E-22, + 'btu' => 1.51857982414846E-22, + ), + 'HPh' => array( + 'J' => 2.68451741316170E+06, + 'e' => 2.68451612283024E+13, + 'c' => 6.41616438565991E+05, + 'cal' => 6.41186757845835E+05, + 'eV' => 1.67553000000000E+25, + 'ev' => 1.67553000000000E+25, + 'HPh' => 1.0, + 'hh' => 1.0, + 'Wh' => 7.45699653134593E+02, + 'wh' => 7.45699653134593E+02, + 'flb' => 6.37047316692964E+07, + 'BTU' => 2.54442605275546E+03, + 'btu' => 2.54442605275546E+03, + ), + 'hh' => array( + 'J' => 2.68451741316170E+06, + 'e' => 2.68451612283024E+13, + 'c' => 6.41616438565991E+05, + 'cal' => 6.41186757845835E+05, + 'eV' => 1.67553000000000E+25, + 'ev' => 1.67553000000000E+25, + 'HPh' => 1.0, + 'hh' => 1.0, + 'Wh' => 7.45699653134593E+02, + 'wh' => 7.45699653134593E+02, + 'flb' => 6.37047316692964E+07, + 'BTU' => 2.54442605275546E+03, + 'btu' => 2.54442605275546E+03, + ), + 'Wh' => array( + 'J' => 3.59999820554720E+03, + 'e' => 3.59999647518369E+10, + 'c' => 8.60422069219046E+02, + 'cal' => 8.59845857713046E+02, + 'eV' => 2.24692340000000E+22, + 'ev' => 2.24692340000000E+22, + 'HPh' => 1.34102248243839E-03, + 'hh' => 1.34102248243839E-03, + 'Wh' => 1.0, + 'wh' => 1.0, + 'flb' => 8.54294774062316E+04, + 'BTU' => 3.41213254164705E+00, + 'btu' => 3.41213254164705E+00, + ), + 'wh' => array( + 'J' => 3.59999820554720E+03, + 'e' => 3.59999647518369E+10, + 'c' => 8.60422069219046E+02, + 'cal' => 8.59845857713046E+02, + 'eV' => 2.24692340000000E+22, + 'ev' => 2.24692340000000E+22, + 'HPh' => 1.34102248243839E-03, + 'hh' => 1.34102248243839E-03, + 'Wh' => 1.0, + 'wh' => 1.0, + 'flb' => 8.54294774062316E+04, + 'BTU' => 3.41213254164705E+00, + 'btu' => 3.41213254164705E+00, + ), + 'flb' => array( + 'J' => 4.21400003236424E-02, + 'e' => 4.21399800687660E+05, + 'c' => 1.00717234301644E-02, + 'cal' => 1.00649785509554E-02, + 'eV' => 2.63015000000000E+17, + 'ev' => 2.63015000000000E+17, + 'HPh' => 1.56974211145130E-08, + 'hh' => 1.56974211145130E-08, + 'Wh' => 1.17055614802000E-05, + 'wh' => 1.17055614802000E-05, + 'flb' => 1.0, + 'BTU' => 3.99409272448406E-05, + 'btu' => 3.99409272448406E-05, + ), + 'BTU' => array( + 'J' => 1.05505813786749E+03, + 'e' => 1.05505763074665E+10, + 'c' => 2.52165488508168E+02, + 'cal' => 2.51996617135510E+02, + 'eV' => 6.58510000000000E+21, + 'ev' => 6.58510000000000E+21, + 'HPh' => 3.93015941224568E-04, + 'hh' => 3.93015941224568E-04, + 'Wh' => 2.93071851047526E-01, + 'wh' => 2.93071851047526E-01, + 'flb' => 2.50369750774671E+04, + 'BTU' => 1.0, + 'btu' => 1.0, + ), + 'btu' => array( + 'J' => 1.05505813786749E+03, + 'e' => 1.05505763074665E+10, + 'c' => 2.52165488508168E+02, + 'cal' => 2.51996617135510E+02, + 'eV' => 6.58510000000000E+21, + 'ev' => 6.58510000000000E+21, + 'HPh' => 3.93015941224568E-04, + 'hh' => 3.93015941224568E-04, + 'Wh' => 2.93071851047526E-01, + 'wh' => 2.93071851047526E-01, + 'flb' => 2.50369750774671E+04, + 'BTU' => 1.0, + 'btu' => 1.0, + ), + ), + 'Power' => array( + 'HP' => array( + 'HP' => 1.0, + 'h' => 1.0, + 'W' => 7.45701000000000E+02, + 'w' => 7.45701000000000E+02, + ), + 'h' => array( + 'HP' => 1.0, + 'h' => 1.0, + 'W' => 7.45701000000000E+02, + 'w' => 7.45701000000000E+02, + ), + 'W' => array( + 'HP' => 1.34102006031908E-03, + 'h' => 1.34102006031908E-03, + 'W' => 1.0, + 'w' => 1.0, + ), + 'w' => array( + 'HP' => 1.34102006031908E-03, + 'h' => 1.34102006031908E-03, + 'W' => 1.0, + 'w' => 1.0, + ), + ), + 'Magnetism' => array( + 'T' => array( + 'T' => 1.0, + 'ga' => 10000.0, + ), + 'ga' => array( + 'T' => 0.0001, + 'ga' => 1.0, + ), + ), + 'Liquid' => array( + 'tsp' => array( + 'tsp' => 1.0, + 'tbs' => 3.33333333333333E-01, + 'oz' => 1.66666666666667E-01, + 'cup' => 2.08333333333333E-02, + 'pt' => 1.04166666666667E-02, + 'us_pt' => 1.04166666666667E-02, + 'uk_pt' => 8.67558516821960E-03, + 'qt' => 5.20833333333333E-03, + 'gal' => 1.30208333333333E-03, + 'l' => 4.92999408400710E-03, + 'lt' => 4.92999408400710E-03, + ), + 'tbs' => array( + 'tsp' => 3.00000000000000E+00, + 'tbs' => 1.0, + 'oz' => 5.00000000000000E-01, + 'cup' => 6.25000000000000E-02, + 'pt' => 3.12500000000000E-02, + 'us_pt' => 3.12500000000000E-02, + 'uk_pt' => 2.60267555046588E-02, + 'qt' => 1.56250000000000E-02, + 'gal' => 3.90625000000000E-03, + 'l' => 1.47899822520213E-02, + 'lt' => 1.47899822520213E-02, + ), + 'oz' => array( + 'tsp' => 6.00000000000000E+00, + 'tbs' => 2.00000000000000E+00, + 'oz' => 1.0, + 'cup' => 1.25000000000000E-01, + 'pt' => 6.25000000000000E-02, + 'us_pt' => 6.25000000000000E-02, + 'uk_pt' => 5.20535110093176E-02, + 'qt' => 3.12500000000000E-02, + 'gal' => 7.81250000000000E-03, + 'l' => 2.95799645040426E-02, + 'lt' => 2.95799645040426E-02, + ), + 'cup' => array( + 'tsp' => 4.80000000000000E+01, + 'tbs' => 1.60000000000000E+01, + 'oz' => 8.00000000000000E+00, + 'cup' => 1.0, + 'pt' => 5.00000000000000E-01, + 'us_pt' => 5.00000000000000E-01, + 'uk_pt' => 4.16428088074541E-01, + 'qt' => 2.50000000000000E-01, + 'gal' => 6.25000000000000E-02, + 'l' => 2.36639716032341E-01, + 'lt' => 2.36639716032341E-01, + ), + 'pt' => array( + 'tsp' => 9.60000000000000E+01, + 'tbs' => 3.20000000000000E+01, + 'oz' => 1.60000000000000E+01, + 'cup' => 2.00000000000000E+00, + 'pt' => 1.0, + 'us_pt' => 1.0, + 'uk_pt' => 8.32856176149081E-01, + 'qt' => 5.00000000000000E-01, + 'gal' => 1.25000000000000E-01, + 'l' => 4.73279432064682E-01, + 'lt' => 4.73279432064682E-01, + ), + 'us_pt' => array( + 'tsp' => 9.60000000000000E+01, + 'tbs' => 3.20000000000000E+01, + 'oz' => 1.60000000000000E+01, + 'cup' => 2.00000000000000E+00, + 'pt' => 1.0, + 'us_pt' => 1.0, + 'uk_pt' => 8.32856176149081E-01, + 'qt' => 5.00000000000000E-01, + 'gal' => 1.25000000000000E-01, + 'l' => 4.73279432064682E-01, + 'lt' => 4.73279432064682E-01, + ), + 'uk_pt' => array( + 'tsp' => 1.15266000000000E+02, + 'tbs' => 3.84220000000000E+01, + 'oz' => 1.92110000000000E+01, + 'cup' => 2.40137500000000E+00, + 'pt' => 1.20068750000000E+00, + 'us_pt' => 1.20068750000000E+00, + 'uk_pt' => 1.0, + 'qt' => 6.00343750000000E-01, + 'gal' => 1.50085937500000E-01, + 'l' => 5.68260698087162E-01, + 'lt' => 5.68260698087162E-01, + ), + 'qt' => array( + 'tsp' => 1.92000000000000E+02, + 'tbs' => 6.40000000000000E+01, + 'oz' => 3.20000000000000E+01, + 'cup' => 4.00000000000000E+00, + 'pt' => 2.00000000000000E+00, + 'us_pt' => 2.00000000000000E+00, + 'uk_pt' => 1.66571235229816E+00, + 'qt' => 1.0, + 'gal' => 2.50000000000000E-01, + 'l' => 9.46558864129363E-01, + 'lt' => 9.46558864129363E-01, + ), + 'gal' => array( + 'tsp' => 7.68000000000000E+02, + 'tbs' => 2.56000000000000E+02, + 'oz' => 1.28000000000000E+02, + 'cup' => 1.60000000000000E+01, + 'pt' => 8.00000000000000E+00, + 'us_pt' => 8.00000000000000E+00, + 'uk_pt' => 6.66284940919265E+00, + 'qt' => 4.00000000000000E+00, + 'gal' => 1.0, + 'l' => 3.78623545651745E+00, + 'lt' => 3.78623545651745E+00, + ), + 'l' => array( + 'tsp' => 2.02840000000000E+02, + 'tbs' => 6.76133333333333E+01, + 'oz' => 3.38066666666667E+01, + 'cup' => 4.22583333333333E+00, + 'pt' => 2.11291666666667E+00, + 'us_pt' => 2.11291666666667E+00, + 'uk_pt' => 1.75975569552166E+00, + 'qt' => 1.05645833333333E+00, + 'gal' => 2.64114583333333E-01, + 'l' => 1.0, + 'lt' => 1.0, + ), + 'lt' => array( + 'tsp' => 2.02840000000000E+02, + 'tbs' => 6.76133333333333E+01, + 'oz' => 3.38066666666667E+01, + 'cup' => 4.22583333333333E+00, + 'pt' => 2.11291666666667E+00, + 'us_pt' => 2.11291666666667E+00, + 'uk_pt' => 1.75975569552166E+00, + 'qt' => 1.05645833333333E+00, + 'gal' => 2.64114583333333E-01, + 'l' => 1.0, + 'lt' => 1.0, + ), + ), + ); + + + /** + * parseComplex + * + * Parses a complex number into its real and imaginary parts, and an I or J suffix + * + * @param string $complexNumber The complex number + * @return string[] Indexed on "real", "imaginary" and "suffix" + */ + public static function parseComplex($complexNumber) + { + $workString = (string) $complexNumber; + + $realNumber = $imaginary = 0; + // Extract the suffix, if there is one + $suffix = substr($workString, -1); + if (!is_numeric($suffix)) { + $workString = substr($workString, 0, -1); + } else { + $suffix = ''; + } + + // Split the input into its Real and Imaginary components + $leadingSign = 0; + if (strlen($workString) > 0) { + $leadingSign = (($workString{0} == '+') || ($workString{0} == '-')) ? 1 : 0; + } + $power = ''; + $realNumber = strtok($workString, '+-'); + if (strtoupper(substr($realNumber, -1)) == 'E') { + $power = strtok('+-'); + ++$leadingSign; + } + + $realNumber = substr($workString, 0, strlen($realNumber)+strlen($power)+$leadingSign); + + if ($suffix != '') { + $imaginary = substr($workString, strlen($realNumber)); + + if (($imaginary == '') && (($realNumber == '') || ($realNumber == '+') || ($realNumber == '-'))) { + $imaginary = $realNumber.'1'; + $realNumber = '0'; + } elseif ($imaginary == '') { + $imaginary = $realNumber; + $realNumber = '0'; + } elseif (($imaginary == '+') || ($imaginary == '-')) { + $imaginary .= '1'; + } + } + + return array( + 'real' => $realNumber, + 'imaginary' => $imaginary, + 'suffix' => $suffix + ); + } + + + /** + * Cleans the leading characters in a complex number string + * + * @param string $complexNumber The complex number to clean + * @return string The "cleaned" complex number + */ + private static function cleanComplex($complexNumber) + { + if ($complexNumber{0} == '+') { + $complexNumber = substr($complexNumber, 1); + } + if ($complexNumber{0} == '0') { + $complexNumber = substr($complexNumber, 1); + } + if ($complexNumber{0} == '.') { + $complexNumber = '0'.$complexNumber; + } + if ($complexNumber{0} == '+') { + $complexNumber = substr($complexNumber, 1); + } + return $complexNumber; + } + + /** + * Formats a number base string value with leading zeroes + * + * @param string $xVal The "number" to pad + * @param integer $places The length that we want to pad this value + * @return string The padded "number" + */ + private static function nbrConversionFormat($xVal, $places) + { + if (!is_null($places)) { + if (strlen($xVal) <= $places) { + return substr(str_pad($xVal, $places, '0', STR_PAD_LEFT), -10); + } else { + return PHPExcel_Calculation_Functions::NaN(); + } + } + + return substr($xVal, -10); + } + + /** + * BESSELI + * + * Returns the modified Bessel function In(x), which is equivalent to the Bessel function evaluated + * for purely imaginary arguments + * + * Excel Function: + * BESSELI(x,ord) + * + * @access public + * @category Engineering Functions + * @param float $x The value at which to evaluate the function. + * If x is nonnumeric, BESSELI returns the #VALUE! error value. + * @param integer $ord The order of the Bessel function. + * If ord is not an integer, it is truncated. + * If $ord is nonnumeric, BESSELI returns the #VALUE! error value. + * If $ord < 0, BESSELI returns the #NUM! error value. + * @return float + * + */ + public static function BESSELI($x, $ord) + { + $x = (is_null($x)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($x); + $ord = (is_null($ord)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($ord); + + if ((is_numeric($x)) && (is_numeric($ord))) { + $ord = floor($ord); + if ($ord < 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + + if (abs($x) <= 30) { + $fResult = $fTerm = pow($x / 2, $ord) / PHPExcel_Calculation_MathTrig::FACT($ord); + $ordK = 1; + $fSqrX = ($x * $x) / 4; + do { + $fTerm *= $fSqrX; + $fTerm /= ($ordK * ($ordK + $ord)); + $fResult += $fTerm; + } while ((abs($fTerm) > 1e-12) && (++$ordK < 100)); + } else { + $f_2_PI = 2 * M_PI; + + $fXAbs = abs($x); + $fResult = exp($fXAbs) / sqrt($f_2_PI * $fXAbs); + if (($ord & 1) && ($x < 0)) { + $fResult = -$fResult; + } + } + return (is_nan($fResult)) ? PHPExcel_Calculation_Functions::NaN() : $fResult; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * BESSELJ + * + * Returns the Bessel function + * + * Excel Function: + * BESSELJ(x,ord) + * + * @access public + * @category Engineering Functions + * @param float $x The value at which to evaluate the function. + * If x is nonnumeric, BESSELJ returns the #VALUE! error value. + * @param integer $ord The order of the Bessel function. If n is not an integer, it is truncated. + * If $ord is nonnumeric, BESSELJ returns the #VALUE! error value. + * If $ord < 0, BESSELJ returns the #NUM! error value. + * @return float + * + */ + public static function BESSELJ($x, $ord) + { + $x = (is_null($x)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($x); + $ord = (is_null($ord)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($ord); + + if ((is_numeric($x)) && (is_numeric($ord))) { + $ord = floor($ord); + if ($ord < 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + + $fResult = 0; + if (abs($x) <= 30) { + $fResult = $fTerm = pow($x / 2, $ord) / PHPExcel_Calculation_MathTrig::FACT($ord); + $ordK = 1; + $fSqrX = ($x * $x) / -4; + do { + $fTerm *= $fSqrX; + $fTerm /= ($ordK * ($ordK + $ord)); + $fResult += $fTerm; + } while ((abs($fTerm) > 1e-12) && (++$ordK < 100)); + } else { + $f_PI_DIV_2 = M_PI / 2; + $f_PI_DIV_4 = M_PI / 4; + + $fXAbs = abs($x); + $fResult = sqrt(M_2DIVPI / $fXAbs) * cos($fXAbs - $ord * $f_PI_DIV_2 - $f_PI_DIV_4); + if (($ord & 1) && ($x < 0)) { + $fResult = -$fResult; + } + } + return (is_nan($fResult)) ? PHPExcel_Calculation_Functions::NaN() : $fResult; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + private static function besselK0($fNum) + { + if ($fNum <= 2) { + $fNum2 = $fNum * 0.5; + $y = ($fNum2 * $fNum2); + $fRet = -log($fNum2) * self::BESSELI($fNum, 0) + + (-0.57721566 + $y * (0.42278420 + $y * (0.23069756 + $y * (0.3488590e-1 + $y * (0.262698e-2 + $y * + (0.10750e-3 + $y * 0.74e-5)))))); + } else { + $y = 2 / $fNum; + $fRet = exp(-$fNum) / sqrt($fNum) * + (1.25331414 + $y * (-0.7832358e-1 + $y * (0.2189568e-1 + $y * (-0.1062446e-1 + $y * + (0.587872e-2 + $y * (-0.251540e-2 + $y * 0.53208e-3)))))); + } + return $fRet; + } + + + private static function besselK1($fNum) + { + if ($fNum <= 2) { + $fNum2 = $fNum * 0.5; + $y = ($fNum2 * $fNum2); + $fRet = log($fNum2) * self::BESSELI($fNum, 1) + + (1 + $y * (0.15443144 + $y * (-0.67278579 + $y * (-0.18156897 + $y * (-0.1919402e-1 + $y * + (-0.110404e-2 + $y * (-0.4686e-4))))))) / $fNum; + } else { + $y = 2 / $fNum; + $fRet = exp(-$fNum) / sqrt($fNum) * + (1.25331414 + $y * (0.23498619 + $y * (-0.3655620e-1 + $y * (0.1504268e-1 + $y * (-0.780353e-2 + $y * + (0.325614e-2 + $y * (-0.68245e-3))))))); + } + return $fRet; + } + + + /** + * BESSELK + * + * Returns the modified Bessel function Kn(x), which is equivalent to the Bessel functions evaluated + * for purely imaginary arguments. + * + * Excel Function: + * BESSELK(x,ord) + * + * @access public + * @category Engineering Functions + * @param float $x The value at which to evaluate the function. + * If x is nonnumeric, BESSELK returns the #VALUE! error value. + * @param integer $ord The order of the Bessel function. If n is not an integer, it is truncated. + * If $ord is nonnumeric, BESSELK returns the #VALUE! error value. + * If $ord < 0, BESSELK returns the #NUM! error value. + * @return float + * + */ + public static function BESSELK($x, $ord) + { + $x = (is_null($x)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($x); + $ord = (is_null($ord)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($ord); + + if ((is_numeric($x)) && (is_numeric($ord))) { + if (($ord < 0) || ($x == 0.0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + + switch (floor($ord)) { + case 0: + return self::besselK0($x); + case 1: + return self::besselK1($x); + default: + $fTox = 2 / $x; + $fBkm = self::besselK0($x); + $fBk = self::besselK1($x); + for ($n = 1; $n < $ord; ++$n) { + $fBkp = $fBkm + $n * $fTox * $fBk; + $fBkm = $fBk; + $fBk = $fBkp; + } + } + return (is_nan($fBk)) ? PHPExcel_Calculation_Functions::NaN() : $fBk; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + private static function besselY0($fNum) + { + if ($fNum < 8.0) { + $y = ($fNum * $fNum); + $f1 = -2957821389.0 + $y * (7062834065.0 + $y * (-512359803.6 + $y * (10879881.29 + $y * (-86327.92757 + $y * 228.4622733)))); + $f2 = 40076544269.0 + $y * (745249964.8 + $y * (7189466.438 + $y * (47447.26470 + $y * (226.1030244 + $y)))); + $fRet = $f1 / $f2 + 0.636619772 * self::BESSELJ($fNum, 0) * log($fNum); + } else { + $z = 8.0 / $fNum; + $y = ($z * $z); + $xx = $fNum - 0.785398164; + $f1 = 1 + $y * (-0.1098628627e-2 + $y * (0.2734510407e-4 + $y * (-0.2073370639e-5 + $y * 0.2093887211e-6))); + $f2 = -0.1562499995e-1 + $y * (0.1430488765e-3 + $y * (-0.6911147651e-5 + $y * (0.7621095161e-6 + $y * (-0.934945152e-7)))); + $fRet = sqrt(0.636619772 / $fNum) * (sin($xx) * $f1 + $z * cos($xx) * $f2); + } + return $fRet; + } + + + private static function besselY1($fNum) + { + if ($fNum < 8.0) { + $y = ($fNum * $fNum); + $f1 = $fNum * (-0.4900604943e13 + $y * (0.1275274390e13 + $y * (-0.5153438139e11 + $y * (0.7349264551e9 + $y * + (-0.4237922726e7 + $y * 0.8511937935e4))))); + $f2 = 0.2499580570e14 + $y * (0.4244419664e12 + $y * (0.3733650367e10 + $y * (0.2245904002e8 + $y * + (0.1020426050e6 + $y * (0.3549632885e3 + $y))))); + $fRet = $f1 / $f2 + 0.636619772 * ( self::BESSELJ($fNum, 1) * log($fNum) - 1 / $fNum); + } else { + $fRet = sqrt(0.636619772 / $fNum) * sin($fNum - 2.356194491); + } + return $fRet; + } + + + /** + * BESSELY + * + * Returns the Bessel function, which is also called the Weber function or the Neumann function. + * + * Excel Function: + * BESSELY(x,ord) + * + * @access public + * @category Engineering Functions + * @param float $x The value at which to evaluate the function. + * If x is nonnumeric, BESSELK returns the #VALUE! error value. + * @param integer $ord The order of the Bessel function. If n is not an integer, it is truncated. + * If $ord is nonnumeric, BESSELK returns the #VALUE! error value. + * If $ord < 0, BESSELK returns the #NUM! error value. + * + * @return float + */ + public static function BESSELY($x, $ord) + { + $x = (is_null($x)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($x); + $ord = (is_null($ord)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($ord); + + if ((is_numeric($x)) && (is_numeric($ord))) { + if (($ord < 0) || ($x == 0.0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + + switch (floor($ord)) { + case 0: + return self::besselY0($x); + case 1: + return self::besselY1($x); + default: + $fTox = 2 / $x; + $fBym = self::besselY0($x); + $fBy = self::besselY1($x); + for ($n = 1; $n < $ord; ++$n) { + $fByp = $n * $fTox * $fBy - $fBym; + $fBym = $fBy; + $fBy = $fByp; + } + } + return (is_nan($fBy)) ? PHPExcel_Calculation_Functions::NaN() : $fBy; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * BINTODEC + * + * Return a binary value as decimal. + * + * Excel Function: + * BIN2DEC(x) + * + * @access public + * @category Engineering Functions + * @param string $x The binary number (as a string) that you want to convert. The number + * cannot contain more than 10 characters (10 bits). The most significant + * bit of number is the sign bit. The remaining 9 bits are magnitude bits. + * Negative numbers are represented using two's-complement notation. + * If number is not a valid binary number, or if number contains more than + * 10 characters (10 bits), BIN2DEC returns the #NUM! error value. + * @return string + */ + public static function BINTODEC($x) + { + $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); + + if (is_bool($x)) { + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { + $x = (int) $x; + } else { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { + $x = floor($x); + } + $x = (string) $x; + if (strlen($x) > preg_match_all('/[01]/', $x, $out)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if (strlen($x) > 10) { + return PHPExcel_Calculation_Functions::NaN(); + } elseif (strlen($x) == 10) { + // Two's Complement + $x = substr($x, -9); + return '-'.(512-bindec($x)); + } + return bindec($x); + } + + + /** + * BINTOHEX + * + * Return a binary value as hex. + * + * Excel Function: + * BIN2HEX(x[,places]) + * + * @access public + * @category Engineering Functions + * @param string $x The binary number (as a string) that you want to convert. The number + * cannot contain more than 10 characters (10 bits). The most significant + * bit of number is the sign bit. The remaining 9 bits are magnitude bits. + * Negative numbers are represented using two's-complement notation. + * If number is not a valid binary number, or if number contains more than + * 10 characters (10 bits), BIN2HEX returns the #NUM! error value. + * @param integer $places The number of characters to use. If places is omitted, BIN2HEX uses the + * minimum number of characters necessary. Places is useful for padding the + * return value with leading 0s (zeros). + * If places is not an integer, it is truncated. + * If places is nonnumeric, BIN2HEX returns the #VALUE! error value. + * If places is negative, BIN2HEX returns the #NUM! error value. + * @return string + */ + public static function BINTOHEX($x, $places = null) + { + $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); + $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); + + if (is_bool($x)) { + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { + $x = (int) $x; + } else { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { + $x = floor($x); + } + $x = (string) $x; + if (strlen($x) > preg_match_all('/[01]/', $x, $out)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if (strlen($x) > 10) { + return PHPExcel_Calculation_Functions::NaN(); + } elseif (strlen($x) == 10) { + // Two's Complement + return str_repeat('F', 8).substr(strtoupper(dechex(bindec(substr($x, -9)))), -2); + } + $hexVal = (string) strtoupper(dechex(bindec($x))); + + return self::nbrConversionFormat($hexVal, $places); + } + + + /** + * BINTOOCT + * + * Return a binary value as octal. + * + * Excel Function: + * BIN2OCT(x[,places]) + * + * @access public + * @category Engineering Functions + * @param string $x The binary number (as a string) that you want to convert. The number + * cannot contain more than 10 characters (10 bits). The most significant + * bit of number is the sign bit. The remaining 9 bits are magnitude bits. + * Negative numbers are represented using two's-complement notation. + * If number is not a valid binary number, or if number contains more than + * 10 characters (10 bits), BIN2OCT returns the #NUM! error value. + * @param integer $places The number of characters to use. If places is omitted, BIN2OCT uses the + * minimum number of characters necessary. Places is useful for padding the + * return value with leading 0s (zeros). + * If places is not an integer, it is truncated. + * If places is nonnumeric, BIN2OCT returns the #VALUE! error value. + * If places is negative, BIN2OCT returns the #NUM! error value. + * @return string + */ + public static function BINTOOCT($x, $places = null) + { + $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); + $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); + + if (is_bool($x)) { + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { + $x = (int) $x; + } else { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { + $x = floor($x); + } + $x = (string) $x; + if (strlen($x) > preg_match_all('/[01]/', $x, $out)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if (strlen($x) > 10) { + return PHPExcel_Calculation_Functions::NaN(); + } elseif (strlen($x) == 10) { + // Two's Complement + return str_repeat('7', 7).substr(strtoupper(decoct(bindec(substr($x, -9)))), -3); + } + $octVal = (string) decoct(bindec($x)); + + return self::nbrConversionFormat($octVal, $places); + } + + + /** + * DECTOBIN + * + * Return a decimal value as binary. + * + * Excel Function: + * DEC2BIN(x[,places]) + * + * @access public + * @category Engineering Functions + * @param string $x The decimal integer you want to convert. If number is negative, + * valid place values are ignored and DEC2BIN returns a 10-character + * (10-bit) binary number in which the most significant bit is the sign + * bit. The remaining 9 bits are magnitude bits. Negative numbers are + * represented using two's-complement notation. + * If number < -512 or if number > 511, DEC2BIN returns the #NUM! error + * value. + * If number is nonnumeric, DEC2BIN returns the #VALUE! error value. + * If DEC2BIN requires more than places characters, it returns the #NUM! + * error value. + * @param integer $places The number of characters to use. If places is omitted, DEC2BIN uses + * the minimum number of characters necessary. Places is useful for + * padding the return value with leading 0s (zeros). + * If places is not an integer, it is truncated. + * If places is nonnumeric, DEC2BIN returns the #VALUE! error value. + * If places is zero or negative, DEC2BIN returns the #NUM! error value. + * @return string + */ + public static function DECTOBIN($x, $places = null) + { + $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); + $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); + + if (is_bool($x)) { + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { + $x = (int) $x; + } else { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + $x = (string) $x; + if (strlen($x) > preg_match_all('/[-0123456789.]/', $x, $out)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $x = (string) floor($x); + $r = decbin($x); + if (strlen($r) == 32) { + // Two's Complement + $r = substr($r, -10); + } elseif (strlen($r) > 11) { + return PHPExcel_Calculation_Functions::NaN(); + } + + return self::nbrConversionFormat($r, $places); + } + + + /** + * DECTOHEX + * + * Return a decimal value as hex. + * + * Excel Function: + * DEC2HEX(x[,places]) + * + * @access public + * @category Engineering Functions + * @param string $x The decimal integer you want to convert. If number is negative, + * places is ignored and DEC2HEX returns a 10-character (40-bit) + * hexadecimal number in which the most significant bit is the sign + * bit. The remaining 39 bits are magnitude bits. Negative numbers + * are represented using two's-complement notation. + * If number < -549,755,813,888 or if number > 549,755,813,887, + * DEC2HEX returns the #NUM! error value. + * If number is nonnumeric, DEC2HEX returns the #VALUE! error value. + * If DEC2HEX requires more than places characters, it returns the + * #NUM! error value. + * @param integer $places The number of characters to use. If places is omitted, DEC2HEX uses + * the minimum number of characters necessary. Places is useful for + * padding the return value with leading 0s (zeros). + * If places is not an integer, it is truncated. + * If places is nonnumeric, DEC2HEX returns the #VALUE! error value. + * If places is zero or negative, DEC2HEX returns the #NUM! error value. + * @return string + */ + public static function DECTOHEX($x, $places = null) + { + $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); + $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); + + if (is_bool($x)) { + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { + $x = (int) $x; + } else { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + $x = (string) $x; + if (strlen($x) > preg_match_all('/[-0123456789.]/', $x, $out)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $x = (string) floor($x); + $r = strtoupper(dechex($x)); + if (strlen($r) == 8) { + // Two's Complement + $r = 'FF'.$r; + } + + return self::nbrConversionFormat($r, $places); + } + + + /** + * DECTOOCT + * + * Return an decimal value as octal. + * + * Excel Function: + * DEC2OCT(x[,places]) + * + * @access public + * @category Engineering Functions + * @param string $x The decimal integer you want to convert. If number is negative, + * places is ignored and DEC2OCT returns a 10-character (30-bit) + * octal number in which the most significant bit is the sign bit. + * The remaining 29 bits are magnitude bits. Negative numbers are + * represented using two's-complement notation. + * If number < -536,870,912 or if number > 536,870,911, DEC2OCT + * returns the #NUM! error value. + * If number is nonnumeric, DEC2OCT returns the #VALUE! error value. + * If DEC2OCT requires more than places characters, it returns the + * #NUM! error value. + * @param integer $places The number of characters to use. If places is omitted, DEC2OCT uses + * the minimum number of characters necessary. Places is useful for + * padding the return value with leading 0s (zeros). + * If places is not an integer, it is truncated. + * If places is nonnumeric, DEC2OCT returns the #VALUE! error value. + * If places is zero or negative, DEC2OCT returns the #NUM! error value. + * @return string + */ + public static function DECTOOCT($x, $places = null) + { + $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); + $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); + + if (is_bool($x)) { + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { + $x = (int) $x; + } else { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + $x = (string) $x; + if (strlen($x) > preg_match_all('/[-0123456789.]/', $x, $out)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $x = (string) floor($x); + $r = decoct($x); + if (strlen($r) == 11) { + // Two's Complement + $r = substr($r, -10); + } + + return self::nbrConversionFormat($r, $places); + } + + + /** + * HEXTOBIN + * + * Return a hex value as binary. + * + * Excel Function: + * HEX2BIN(x[,places]) + * + * @access public + * @category Engineering Functions + * @param string $x the hexadecimal number you want to convert. Number cannot + * contain more than 10 characters. The most significant bit of + * number is the sign bit (40th bit from the right). The remaining + * 9 bits are magnitude bits. Negative numbers are represented + * using two's-complement notation. + * If number is negative, HEX2BIN ignores places and returns a + * 10-character binary number. + * If number is negative, it cannot be less than FFFFFFFE00, and + * if number is positive, it cannot be greater than 1FF. + * If number is not a valid hexadecimal number, HEX2BIN returns + * the #NUM! error value. + * If HEX2BIN requires more than places characters, it returns + * the #NUM! error value. + * @param integer $places The number of characters to use. If places is omitted, + * HEX2BIN uses the minimum number of characters necessary. Places + * is useful for padding the return value with leading 0s (zeros). + * If places is not an integer, it is truncated. + * If places is nonnumeric, HEX2BIN returns the #VALUE! error value. + * If places is negative, HEX2BIN returns the #NUM! error value. + * @return string + */ + public static function HEXTOBIN($x, $places = null) + { + $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); + $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); + + if (is_bool($x)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $x = (string) $x; + if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/', strtoupper($x), $out)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $binVal = decbin(hexdec($x)); + + return substr(self::nbrConversionFormat($binVal, $places), -10); + } + + + /** + * HEXTODEC + * + * Return a hex value as decimal. + * + * Excel Function: + * HEX2DEC(x) + * + * @access public + * @category Engineering Functions + * @param string $x The hexadecimal number you want to convert. This number cannot + * contain more than 10 characters (40 bits). The most significant + * bit of number is the sign bit. The remaining 39 bits are magnitude + * bits. Negative numbers are represented using two's-complement + * notation. + * If number is not a valid hexadecimal number, HEX2DEC returns the + * #NUM! error value. + * @return string + */ + public static function HEXTODEC($x) + { + $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); + + if (is_bool($x)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $x = (string) $x; + if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/', strtoupper($x), $out)) { + return PHPExcel_Calculation_Functions::NaN(); + } + return hexdec($x); + } + + + /** + * HEXTOOCT + * + * Return a hex value as octal. + * + * Excel Function: + * HEX2OCT(x[,places]) + * + * @access public + * @category Engineering Functions + * @param string $x The hexadecimal number you want to convert. Number cannot + * contain more than 10 characters. The most significant bit of + * number is the sign bit. The remaining 39 bits are magnitude + * bits. Negative numbers are represented using two's-complement + * notation. + * If number is negative, HEX2OCT ignores places and returns a + * 10-character octal number. + * If number is negative, it cannot be less than FFE0000000, and + * if number is positive, it cannot be greater than 1FFFFFFF. + * If number is not a valid hexadecimal number, HEX2OCT returns + * the #NUM! error value. + * If HEX2OCT requires more than places characters, it returns + * the #NUM! error value. + * @param integer $places The number of characters to use. If places is omitted, HEX2OCT + * uses the minimum number of characters necessary. Places is + * useful for padding the return value with leading 0s (zeros). + * If places is not an integer, it is truncated. + * If places is nonnumeric, HEX2OCT returns the #VALUE! error + * value. + * If places is negative, HEX2OCT returns the #NUM! error value. + * @return string + */ + public static function HEXTOOCT($x, $places = null) + { + $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); + $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); + + if (is_bool($x)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $x = (string) $x; + if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/', strtoupper($x), $out)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $octVal = decoct(hexdec($x)); + + return self::nbrConversionFormat($octVal, $places); + } // function HEXTOOCT() + + + /** + * OCTTOBIN + * + * Return an octal value as binary. + * + * Excel Function: + * OCT2BIN(x[,places]) + * + * @access public + * @category Engineering Functions + * @param string $x The octal number you want to convert. Number may not + * contain more than 10 characters. The most significant + * bit of number is the sign bit. The remaining 29 bits + * are magnitude bits. Negative numbers are represented + * using two's-complement notation. + * If number is negative, OCT2BIN ignores places and returns + * a 10-character binary number. + * If number is negative, it cannot be less than 7777777000, + * and if number is positive, it cannot be greater than 777. + * If number is not a valid octal number, OCT2BIN returns + * the #NUM! error value. + * If OCT2BIN requires more than places characters, it + * returns the #NUM! error value. + * @param integer $places The number of characters to use. If places is omitted, + * OCT2BIN uses the minimum number of characters necessary. + * Places is useful for padding the return value with + * leading 0s (zeros). + * If places is not an integer, it is truncated. + * If places is nonnumeric, OCT2BIN returns the #VALUE! + * error value. + * If places is negative, OCT2BIN returns the #NUM! error + * value. + * @return string + */ + public static function OCTTOBIN($x, $places = null) + { + $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); + $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); + + if (is_bool($x)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $x = (string) $x; + if (preg_match_all('/[01234567]/', $x, $out) != strlen($x)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $r = decbin(octdec($x)); + + return self::nbrConversionFormat($r, $places); + } + + + /** + * OCTTODEC + * + * Return an octal value as decimal. + * + * Excel Function: + * OCT2DEC(x) + * + * @access public + * @category Engineering Functions + * @param string $x The octal number you want to convert. Number may not contain + * more than 10 octal characters (30 bits). The most significant + * bit of number is the sign bit. The remaining 29 bits are + * magnitude bits. Negative numbers are represented using + * two's-complement notation. + * If number is not a valid octal number, OCT2DEC returns the + * #NUM! error value. + * @return string + */ + public static function OCTTODEC($x) + { + $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); + + if (is_bool($x)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $x = (string) $x; + if (preg_match_all('/[01234567]/', $x, $out) != strlen($x)) { + return PHPExcel_Calculation_Functions::NaN(); + } + return octdec($x); + } + + + /** + * OCTTOHEX + * + * Return an octal value as hex. + * + * Excel Function: + * OCT2HEX(x[,places]) + * + * @access public + * @category Engineering Functions + * @param string $x The octal number you want to convert. Number may not contain + * more than 10 octal characters (30 bits). The most significant + * bit of number is the sign bit. The remaining 29 bits are + * magnitude bits. Negative numbers are represented using + * two's-complement notation. + * If number is negative, OCT2HEX ignores places and returns a + * 10-character hexadecimal number. + * If number is not a valid octal number, OCT2HEX returns the + * #NUM! error value. + * If OCT2HEX requires more than places characters, it returns + * the #NUM! error value. + * @param integer $places The number of characters to use. If places is omitted, OCT2HEX + * uses the minimum number of characters necessary. Places is useful + * for padding the return value with leading 0s (zeros). + * If places is not an integer, it is truncated. + * If places is nonnumeric, OCT2HEX returns the #VALUE! error value. + * If places is negative, OCT2HEX returns the #NUM! error value. + * @return string + */ + public static function OCTTOHEX($x, $places = null) + { + $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); + $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); + + if (is_bool($x)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $x = (string) $x; + if (preg_match_all('/[01234567]/', $x, $out) != strlen($x)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $hexVal = strtoupper(dechex(octdec($x))); + + return self::nbrConversionFormat($hexVal, $places); + } + + + /** + * COMPLEX + * + * Converts real and imaginary coefficients into a complex number of the form x + yi or x + yj. + * + * Excel Function: + * COMPLEX(realNumber,imaginary[,places]) + * + * @access public + * @category Engineering Functions + * @param float $realNumber The real coefficient of the complex number. + * @param float $imaginary The imaginary coefficient of the complex number. + * @param string $suffix The suffix for the imaginary component of the complex number. + * If omitted, the suffix is assumed to be "i". + * @return string + */ + public static function COMPLEX($realNumber = 0.0, $imaginary = 0.0, $suffix = 'i') + { + $realNumber = (is_null($realNumber)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($realNumber); + $imaginary = (is_null($imaginary)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($imaginary); + $suffix = (is_null($suffix)) ? 'i' : PHPExcel_Calculation_Functions::flattenSingleValue($suffix); + + if (((is_numeric($realNumber)) && (is_numeric($imaginary))) && + (($suffix == 'i') || ($suffix == 'j') || ($suffix == ''))) { + $realNumber = (float) $realNumber; + $imaginary = (float) $imaginary; + + if ($suffix == '') { + $suffix = 'i'; + } + if ($realNumber == 0.0) { + if ($imaginary == 0.0) { + return (string) '0'; + } elseif ($imaginary == 1.0) { + return (string) $suffix; + } elseif ($imaginary == -1.0) { + return (string) '-'.$suffix; + } + return (string) $imaginary.$suffix; + } elseif ($imaginary == 0.0) { + return (string) $realNumber; + } elseif ($imaginary == 1.0) { + return (string) $realNumber.'+'.$suffix; + } elseif ($imaginary == -1.0) { + return (string) $realNumber.'-'.$suffix; + } + if ($imaginary > 0) { + $imaginary = (string) '+'.$imaginary; + } + return (string) $realNumber.$imaginary.$suffix; + } + + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * IMAGINARY + * + * Returns the imaginary coefficient of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMAGINARY(complexNumber) + * + * @access public + * @category Engineering Functions + * @param string $complexNumber The complex number for which you want the imaginary + * coefficient. + * @return float + */ + public static function IMAGINARY($complexNumber) + { + $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); + + $parsedComplex = self::parseComplex($complexNumber); + return $parsedComplex['imaginary']; + } + + + /** + * IMREAL + * + * Returns the real coefficient of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMREAL(complexNumber) + * + * @access public + * @category Engineering Functions + * @param string $complexNumber The complex number for which you want the real coefficient. + * @return float + */ + public static function IMREAL($complexNumber) + { + $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); + + $parsedComplex = self::parseComplex($complexNumber); + return $parsedComplex['real']; + } + + + /** + * IMABS + * + * Returns the absolute value (modulus) of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMABS(complexNumber) + * + * @param string $complexNumber The complex number for which you want the absolute value. + * @return float + */ + public static function IMABS($complexNumber) + { + $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); + + $parsedComplex = self::parseComplex($complexNumber); + + return sqrt( + ($parsedComplex['real'] * $parsedComplex['real']) + + ($parsedComplex['imaginary'] * $parsedComplex['imaginary']) + ); + } + + + /** + * IMARGUMENT + * + * Returns the argument theta of a complex number, i.e. the angle in radians from the real + * axis to the representation of the number in polar coordinates. + * + * Excel Function: + * IMARGUMENT(complexNumber) + * + * @param string $complexNumber The complex number for which you want the argument theta. + * @return float + */ + public static function IMARGUMENT($complexNumber) + { + $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); + + $parsedComplex = self::parseComplex($complexNumber); + + if ($parsedComplex['real'] == 0.0) { + if ($parsedComplex['imaginary'] == 0.0) { + return 0.0; + } elseif ($parsedComplex['imaginary'] < 0.0) { + return M_PI / -2; + } else { + return M_PI / 2; + } + } elseif ($parsedComplex['real'] > 0.0) { + return atan($parsedComplex['imaginary'] / $parsedComplex['real']); + } elseif ($parsedComplex['imaginary'] < 0.0) { + return 0 - (M_PI - atan(abs($parsedComplex['imaginary']) / abs($parsedComplex['real']))); + } else { + return M_PI - atan($parsedComplex['imaginary'] / abs($parsedComplex['real'])); + } + } + + + /** + * IMCONJUGATE + * + * Returns the complex conjugate of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMCONJUGATE(complexNumber) + * + * @param string $complexNumber The complex number for which you want the conjugate. + * @return string + */ + public static function IMCONJUGATE($complexNumber) + { + $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); + + $parsedComplex = self::parseComplex($complexNumber); + + if ($parsedComplex['imaginary'] == 0.0) { + return $parsedComplex['real']; + } else { + return self::cleanComplex( + self::COMPLEX( + $parsedComplex['real'], + 0 - $parsedComplex['imaginary'], + $parsedComplex['suffix'] + ) + ); + } + } + + + /** + * IMCOS + * + * Returns the cosine of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMCOS(complexNumber) + * + * @param string $complexNumber The complex number for which you want the cosine. + * @return string|float + */ + public static function IMCOS($complexNumber) + { + $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); + + $parsedComplex = self::parseComplex($complexNumber); + + if ($parsedComplex['imaginary'] == 0.0) { + return cos($parsedComplex['real']); + } else { + return self::IMCONJUGATE( + self::COMPLEX( + cos($parsedComplex['real']) * cosh($parsedComplex['imaginary']), + sin($parsedComplex['real']) * sinh($parsedComplex['imaginary']), + $parsedComplex['suffix'] + ) + ); + } + } + + + /** + * IMSIN + * + * Returns the sine of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMSIN(complexNumber) + * + * @param string $complexNumber The complex number for which you want the sine. + * @return string|float + */ + public static function IMSIN($complexNumber) + { + $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); + + $parsedComplex = self::parseComplex($complexNumber); + + if ($parsedComplex['imaginary'] == 0.0) { + return sin($parsedComplex['real']); + } else { + return self::COMPLEX( + sin($parsedComplex['real']) * cosh($parsedComplex['imaginary']), + cos($parsedComplex['real']) * sinh($parsedComplex['imaginary']), + $parsedComplex['suffix'] + ); + } + } + + + /** + * IMSQRT + * + * Returns the square root of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMSQRT(complexNumber) + * + * @param string $complexNumber The complex number for which you want the square root. + * @return string + */ + public static function IMSQRT($complexNumber) + { + $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); + + $parsedComplex = self::parseComplex($complexNumber); + + $theta = self::IMARGUMENT($complexNumber); + $d1 = cos($theta / 2); + $d2 = sin($theta / 2); + $r = sqrt(sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary']))); + + if ($parsedComplex['suffix'] == '') { + return self::COMPLEX($d1 * $r, $d2 * $r); + } else { + return self::COMPLEX($d1 * $r, $d2 * $r, $parsedComplex['suffix']); + } + } + + + /** + * IMLN + * + * Returns the natural logarithm of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMLN(complexNumber) + * + * @param string $complexNumber The complex number for which you want the natural logarithm. + * @return string + */ + public static function IMLN($complexNumber) + { + $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); + + $parsedComplex = self::parseComplex($complexNumber); + + if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + + $logR = log(sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary']))); + $t = self::IMARGUMENT($complexNumber); + + if ($parsedComplex['suffix'] == '') { + return self::COMPLEX($logR, $t); + } else { + return self::COMPLEX($logR, $t, $parsedComplex['suffix']); + } + } + + + /** + * IMLOG10 + * + * Returns the common logarithm (base 10) of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMLOG10(complexNumber) + * + * @param string $complexNumber The complex number for which you want the common logarithm. + * @return string + */ + public static function IMLOG10($complexNumber) + { + $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); + + $parsedComplex = self::parseComplex($complexNumber); + + if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) { + return PHPExcel_Calculation_Functions::NaN(); + } elseif (($parsedComplex['real'] > 0.0) && ($parsedComplex['imaginary'] == 0.0)) { + return log10($parsedComplex['real']); + } + + return self::IMPRODUCT(log10(EULER), self::IMLN($complexNumber)); + } + + + /** + * IMLOG2 + * + * Returns the base-2 logarithm of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMLOG2(complexNumber) + * + * @param string $complexNumber The complex number for which you want the base-2 logarithm. + * @return string + */ + public static function IMLOG2($complexNumber) + { + $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); + + $parsedComplex = self::parseComplex($complexNumber); + + if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) { + return PHPExcel_Calculation_Functions::NaN(); + } elseif (($parsedComplex['real'] > 0.0) && ($parsedComplex['imaginary'] == 0.0)) { + return log($parsedComplex['real'], 2); + } + + return self::IMPRODUCT(log(EULER, 2), self::IMLN($complexNumber)); + } + + + /** + * IMEXP + * + * Returns the exponential of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMEXP(complexNumber) + * + * @param string $complexNumber The complex number for which you want the exponential. + * @return string + */ + public static function IMEXP($complexNumber) + { + $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); + + $parsedComplex = self::parseComplex($complexNumber); + + if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) { + return '1'; + } + + $e = exp($parsedComplex['real']); + $eX = $e * cos($parsedComplex['imaginary']); + $eY = $e * sin($parsedComplex['imaginary']); + + if ($parsedComplex['suffix'] == '') { + return self::COMPLEX($eX, $eY); + } else { + return self::COMPLEX($eX, $eY, $parsedComplex['suffix']); + } + } + + + /** + * IMPOWER + * + * Returns a complex number in x + yi or x + yj text format raised to a power. + * + * Excel Function: + * IMPOWER(complexNumber,realNumber) + * + * @param string $complexNumber The complex number you want to raise to a power. + * @param float $realNumber The power to which you want to raise the complex number. + * @return string + */ + public static function IMPOWER($complexNumber, $realNumber) + { + $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); + $realNumber = PHPExcel_Calculation_Functions::flattenSingleValue($realNumber); + + if (!is_numeric($realNumber)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + $parsedComplex = self::parseComplex($complexNumber); + + $r = sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary'])); + $rPower = pow($r, $realNumber); + $theta = self::IMARGUMENT($complexNumber) * $realNumber; + if ($theta == 0) { + return 1; + } elseif ($parsedComplex['imaginary'] == 0.0) { + return self::COMPLEX($rPower * cos($theta), $rPower * sin($theta), $parsedComplex['suffix']); + } else { + return self::COMPLEX($rPower * cos($theta), $rPower * sin($theta), $parsedComplex['suffix']); + } + } + + + /** + * IMDIV + * + * Returns the quotient of two complex numbers in x + yi or x + yj text format. + * + * Excel Function: + * IMDIV(complexDividend,complexDivisor) + * + * @param string $complexDividend The complex numerator or dividend. + * @param string $complexDivisor The complex denominator or divisor. + * @return string + */ + public static function IMDIV($complexDividend, $complexDivisor) + { + $complexDividend = PHPExcel_Calculation_Functions::flattenSingleValue($complexDividend); + $complexDivisor = PHPExcel_Calculation_Functions::flattenSingleValue($complexDivisor); + + $parsedComplexDividend = self::parseComplex($complexDividend); + $parsedComplexDivisor = self::parseComplex($complexDivisor); + + if (($parsedComplexDividend['suffix'] != '') && ($parsedComplexDivisor['suffix'] != '') && + ($parsedComplexDividend['suffix'] != $parsedComplexDivisor['suffix'])) { + return PHPExcel_Calculation_Functions::NaN(); + } + if (($parsedComplexDividend['suffix'] != '') && ($parsedComplexDivisor['suffix'] == '')) { + $parsedComplexDivisor['suffix'] = $parsedComplexDividend['suffix']; + } + + $d1 = ($parsedComplexDividend['real'] * $parsedComplexDivisor['real']) + ($parsedComplexDividend['imaginary'] * $parsedComplexDivisor['imaginary']); + $d2 = ($parsedComplexDividend['imaginary'] * $parsedComplexDivisor['real']) - ($parsedComplexDividend['real'] * $parsedComplexDivisor['imaginary']); + $d3 = ($parsedComplexDivisor['real'] * $parsedComplexDivisor['real']) + ($parsedComplexDivisor['imaginary'] * $parsedComplexDivisor['imaginary']); + + $r = $d1 / $d3; + $i = $d2 / $d3; + + if ($i > 0.0) { + return self::cleanComplex($r.'+'.$i.$parsedComplexDivisor['suffix']); + } elseif ($i < 0.0) { + return self::cleanComplex($r.$i.$parsedComplexDivisor['suffix']); + } else { + return $r; + } + } + + + /** + * IMSUB + * + * Returns the difference of two complex numbers in x + yi or x + yj text format. + * + * Excel Function: + * IMSUB(complexNumber1,complexNumber2) + * + * @param string $complexNumber1 The complex number from which to subtract complexNumber2. + * @param string $complexNumber2 The complex number to subtract from complexNumber1. + * @return string + */ + public static function IMSUB($complexNumber1, $complexNumber2) + { + $complexNumber1 = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber1); + $complexNumber2 = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber2); + + $parsedComplex1 = self::parseComplex($complexNumber1); + $parsedComplex2 = self::parseComplex($complexNumber2); + + if ((($parsedComplex1['suffix'] != '') && ($parsedComplex2['suffix'] != '')) && + ($parsedComplex1['suffix'] != $parsedComplex2['suffix'])) { + return PHPExcel_Calculation_Functions::NaN(); + } elseif (($parsedComplex1['suffix'] == '') && ($parsedComplex2['suffix'] != '')) { + $parsedComplex1['suffix'] = $parsedComplex2['suffix']; + } + + $d1 = $parsedComplex1['real'] - $parsedComplex2['real']; + $d2 = $parsedComplex1['imaginary'] - $parsedComplex2['imaginary']; + + return self::COMPLEX($d1, $d2, $parsedComplex1['suffix']); + } + + + /** + * IMSUM + * + * Returns the sum of two or more complex numbers in x + yi or x + yj text format. + * + * Excel Function: + * IMSUM(complexNumber[,complexNumber[,...]]) + * + * @param string $complexNumber,... Series of complex numbers to add + * @return string + */ + public static function IMSUM() + { + // Return value + $returnValue = self::parseComplex('0'); + $activeSuffix = ''; + + // Loop through the arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + foreach ($aArgs as $arg) { + $parsedComplex = self::parseComplex($arg); + + if ($activeSuffix == '') { + $activeSuffix = $parsedComplex['suffix']; + } elseif (($parsedComplex['suffix'] != '') && ($activeSuffix != $parsedComplex['suffix'])) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + $returnValue['real'] += $parsedComplex['real']; + $returnValue['imaginary'] += $parsedComplex['imaginary']; + } + + if ($returnValue['imaginary'] == 0.0) { + $activeSuffix = ''; + } + return self::COMPLEX($returnValue['real'], $returnValue['imaginary'], $activeSuffix); + } + + + /** + * IMPRODUCT + * + * Returns the product of two or more complex numbers in x + yi or x + yj text format. + * + * Excel Function: + * IMPRODUCT(complexNumber[,complexNumber[,...]]) + * + * @param string $complexNumber,... Series of complex numbers to multiply + * @return string + */ + public static function IMPRODUCT() + { + // Return value + $returnValue = self::parseComplex('1'); + $activeSuffix = ''; + + // Loop through the arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + foreach ($aArgs as $arg) { + $parsedComplex = self::parseComplex($arg); + + $workValue = $returnValue; + if (($parsedComplex['suffix'] != '') && ($activeSuffix == '')) { + $activeSuffix = $parsedComplex['suffix']; + } elseif (($parsedComplex['suffix'] != '') && ($activeSuffix != $parsedComplex['suffix'])) { + return PHPExcel_Calculation_Functions::NaN(); + } + $returnValue['real'] = ($workValue['real'] * $parsedComplex['real']) - ($workValue['imaginary'] * $parsedComplex['imaginary']); + $returnValue['imaginary'] = ($workValue['real'] * $parsedComplex['imaginary']) + ($workValue['imaginary'] * $parsedComplex['real']); + } + + if ($returnValue['imaginary'] == 0.0) { + $activeSuffix = ''; + } + return self::COMPLEX($returnValue['real'], $returnValue['imaginary'], $activeSuffix); + } + + + /** + * DELTA + * + * Tests whether two values are equal. Returns 1 if number1 = number2; returns 0 otherwise. + * Use this function to filter a set of values. For example, by summing several DELTA + * functions you calculate the count of equal pairs. This function is also known as the + * Kronecker Delta function. + * + * Excel Function: + * DELTA(a[,b]) + * + * @param float $a The first number. + * @param float $b The second number. If omitted, b is assumed to be zero. + * @return int + */ + public static function DELTA($a, $b = 0) + { + $a = PHPExcel_Calculation_Functions::flattenSingleValue($a); + $b = PHPExcel_Calculation_Functions::flattenSingleValue($b); + + return (int) ($a == $b); + } + + + /** + * GESTEP + * + * Excel Function: + * GESTEP(number[,step]) + * + * Returns 1 if number >= step; returns 0 (zero) otherwise + * Use this function to filter a set of values. For example, by summing several GESTEP + * functions you calculate the count of values that exceed a threshold. + * + * @param float $number The value to test against step. + * @param float $step The threshold value. + * If you omit a value for step, GESTEP uses zero. + * @return int + */ + public static function GESTEP($number, $step = 0) + { + $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); + $step = PHPExcel_Calculation_Functions::flattenSingleValue($step); + + return (int) ($number >= $step); + } + + + // + // Private method to calculate the erf value + // + private static $twoSqrtPi = 1.128379167095512574; + + public static function erfVal($x) + { + if (abs($x) > 2.2) { + return 1 - self::erfcVal($x); + } + $sum = $term = $x; + $xsqr = ($x * $x); + $j = 1; + do { + $term *= $xsqr / $j; + $sum -= $term / (2 * $j + 1); + ++$j; + $term *= $xsqr / $j; + $sum += $term / (2 * $j + 1); + ++$j; + if ($sum == 0.0) { + break; + } + } while (abs($term / $sum) > PRECISION); + return self::$twoSqrtPi * $sum; + } + + + /** + * ERF + * + * Returns the error function integrated between the lower and upper bound arguments. + * + * Note: In Excel 2007 or earlier, if you input a negative value for the upper or lower bound arguments, + * the function would return a #NUM! error. However, in Excel 2010, the function algorithm was + * improved, so that it can now calculate the function for both positive and negative ranges. + * PHPExcel follows Excel 2010 behaviour, and accepts nagative arguments. + * + * Excel Function: + * ERF(lower[,upper]) + * + * @param float $lower lower bound for integrating ERF + * @param float $upper upper bound for integrating ERF. + * If omitted, ERF integrates between zero and lower_limit + * @return float + */ + public static function ERF($lower, $upper = null) + { + $lower = PHPExcel_Calculation_Functions::flattenSingleValue($lower); + $upper = PHPExcel_Calculation_Functions::flattenSingleValue($upper); + + if (is_numeric($lower)) { + if (is_null($upper)) { + return self::erfVal($lower); + } + if (is_numeric($upper)) { + return self::erfVal($upper) - self::erfVal($lower); + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + // + // Private method to calculate the erfc value + // + private static $oneSqrtPi = 0.564189583547756287; + + private static function erfcVal($x) + { + if (abs($x) < 2.2) { + return 1 - self::erfVal($x); + } + if ($x < 0) { + return 2 - self::ERFC(-$x); + } + $a = $n = 1; + $b = $c = $x; + $d = ($x * $x) + 0.5; + $q1 = $q2 = $b / $d; + $t = 0; + do { + $t = $a * $n + $b * $x; + $a = $b; + $b = $t; + $t = $c * $n + $d * $x; + $c = $d; + $d = $t; + $n += 0.5; + $q1 = $q2; + $q2 = $b / $d; + } while ((abs($q1 - $q2) / $q2) > PRECISION); + return self::$oneSqrtPi * exp(-$x * $x) * $q2; + } + + + /** + * ERFC + * + * Returns the complementary ERF function integrated between x and infinity + * + * Note: In Excel 2007 or earlier, if you input a negative value for the lower bound argument, + * the function would return a #NUM! error. However, in Excel 2010, the function algorithm was + * improved, so that it can now calculate the function for both positive and negative x values. + * PHPExcel follows Excel 2010 behaviour, and accepts nagative arguments. + * + * Excel Function: + * ERFC(x) + * + * @param float $x The lower bound for integrating ERFC + * @return float + */ + public static function ERFC($x) + { + $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); + + if (is_numeric($x)) { + return self::erfcVal($x); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * getConversionGroups + * Returns a list of the different conversion groups for UOM conversions + * + * @return array + */ + public static function getConversionGroups() + { + $conversionGroups = array(); + foreach (self::$conversionUnits as $conversionUnit) { + $conversionGroups[] = $conversionUnit['Group']; + } + return array_merge(array_unique($conversionGroups)); + } + + + /** + * getConversionGroupUnits + * Returns an array of units of measure, for a specified conversion group, or for all groups + * + * @param string $group The group whose units of measure you want to retrieve + * @return array + */ + public static function getConversionGroupUnits($group = null) + { + $conversionGroups = array(); + foreach (self::$conversionUnits as $conversionUnit => $conversionGroup) { + if ((is_null($group)) || ($conversionGroup['Group'] == $group)) { + $conversionGroups[$conversionGroup['Group']][] = $conversionUnit; + } + } + return $conversionGroups; + } + + + /** + * getConversionGroupUnitDetails + * + * @param string $group The group whose units of measure you want to retrieve + * @return array + */ + public static function getConversionGroupUnitDetails($group = null) + { + $conversionGroups = array(); + foreach (self::$conversionUnits as $conversionUnit => $conversionGroup) { + if ((is_null($group)) || ($conversionGroup['Group'] == $group)) { + $conversionGroups[$conversionGroup['Group']][] = array( + 'unit' => $conversionUnit, + 'description' => $conversionGroup['Unit Name'] + ); + } + } + return $conversionGroups; + } + + + /** + * getConversionMultipliers + * Returns an array of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM() + * + * @return array of mixed + */ + public static function getConversionMultipliers() + { + return self::$conversionMultipliers; + } + + + /** + * CONVERTUOM + * + * Converts a number from one measurement system to another. + * For example, CONVERT can translate a table of distances in miles to a table of distances + * in kilometers. + * + * Excel Function: + * CONVERT(value,fromUOM,toUOM) + * + * @param float $value The value in fromUOM to convert. + * @param string $fromUOM The units for value. + * @param string $toUOM The units for the result. + * + * @return float + */ + public static function CONVERTUOM($value, $fromUOM, $toUOM) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $fromUOM = PHPExcel_Calculation_Functions::flattenSingleValue($fromUOM); + $toUOM = PHPExcel_Calculation_Functions::flattenSingleValue($toUOM); + + if (!is_numeric($value)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $fromMultiplier = 1.0; + if (isset(self::$conversionUnits[$fromUOM])) { + $unitGroup1 = self::$conversionUnits[$fromUOM]['Group']; + } else { + $fromMultiplier = substr($fromUOM, 0, 1); + $fromUOM = substr($fromUOM, 1); + if (isset(self::$conversionMultipliers[$fromMultiplier])) { + $fromMultiplier = self::$conversionMultipliers[$fromMultiplier]['multiplier']; + } else { + return PHPExcel_Calculation_Functions::NA(); + } + if ((isset(self::$conversionUnits[$fromUOM])) && (self::$conversionUnits[$fromUOM]['AllowPrefix'])) { + $unitGroup1 = self::$conversionUnits[$fromUOM]['Group']; + } else { + return PHPExcel_Calculation_Functions::NA(); + } + } + $value *= $fromMultiplier; + + $toMultiplier = 1.0; + if (isset(self::$conversionUnits[$toUOM])) { + $unitGroup2 = self::$conversionUnits[$toUOM]['Group']; + } else { + $toMultiplier = substr($toUOM, 0, 1); + $toUOM = substr($toUOM, 1); + if (isset(self::$conversionMultipliers[$toMultiplier])) { + $toMultiplier = self::$conversionMultipliers[$toMultiplier]['multiplier']; + } else { + return PHPExcel_Calculation_Functions::NA(); + } + if ((isset(self::$conversionUnits[$toUOM])) && (self::$conversionUnits[$toUOM]['AllowPrefix'])) { + $unitGroup2 = self::$conversionUnits[$toUOM]['Group']; + } else { + return PHPExcel_Calculation_Functions::NA(); + } + } + if ($unitGroup1 != $unitGroup2) { + return PHPExcel_Calculation_Functions::NA(); + } + + if (($fromUOM == $toUOM) && ($fromMultiplier == $toMultiplier)) { + // We've already factored $fromMultiplier into the value, so we need + // to reverse it again + return $value / $fromMultiplier; + } elseif ($unitGroup1 == 'Temperature') { + if (($fromUOM == 'F') || ($fromUOM == 'fah')) { + if (($toUOM == 'F') || ($toUOM == 'fah')) { + return $value; + } else { + $value = (($value - 32) / 1.8); + if (($toUOM == 'K') || ($toUOM == 'kel')) { + $value += 273.15; + } + return $value; + } + } elseif ((($fromUOM == 'K') || ($fromUOM == 'kel')) && + (($toUOM == 'K') || ($toUOM == 'kel'))) { + return $value; + } elseif ((($fromUOM == 'C') || ($fromUOM == 'cel')) && + (($toUOM == 'C') || ($toUOM == 'cel'))) { + return $value; + } + if (($toUOM == 'F') || ($toUOM == 'fah')) { + if (($fromUOM == 'K') || ($fromUOM == 'kel')) { + $value -= 273.15; + } + return ($value * 1.8) + 32; + } + if (($toUOM == 'C') || ($toUOM == 'cel')) { + return $value - 273.15; + } + return $value + 273.15; + } + return ($value * self::$unitConversions[$unitGroup1][$fromUOM][$toUOM]) / $toMultiplier; + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation/Exception.php b/extend/PHPExcel/PHPExcel/Calculation/Exception.php new file mode 100644 index 0000000..52d73fc --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation/Exception.php @@ -0,0 +1,46 @@ +line = $line; + $e->file = $file; + throw $e; + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation/ExceptionHandler.php b/extend/PHPExcel/PHPExcel/Calculation/ExceptionHandler.php new file mode 100644 index 0000000..4cb0a68 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation/ExceptionHandler.php @@ -0,0 +1,45 @@ +format('d') == $testDate->format('t')); + } + + + /** + * isFirstDayOfMonth + * + * Returns a boolean TRUE/FALSE indicating if this date is the first date of the month + * + * @param DateTime $testDate The date for testing + * @return boolean + */ + private static function isFirstDayOfMonth($testDate) + { + return ($testDate->format('d') == 1); + } + + + private static function couponFirstPeriodDate($settlement, $maturity, $frequency, $next) + { + $months = 12 / $frequency; + + $result = PHPExcel_Shared_Date::ExcelToPHPObject($maturity); + $eom = self::isLastDayOfMonth($result); + + while ($settlement < PHPExcel_Shared_Date::PHPToExcel($result)) { + $result->modify('-'.$months.' months'); + } + if ($next) { + $result->modify('+'.$months.' months'); + } + + if ($eom) { + $result->modify('-1 day'); + } + + return PHPExcel_Shared_Date::PHPToExcel($result); + } + + + private static function isValidFrequency($frequency) + { + if (($frequency == 1) || ($frequency == 2) || ($frequency == 4)) { + return true; + } + if ((PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) && + (($frequency == 6) || ($frequency == 12))) { + return true; + } + return false; + } + + + /** + * daysPerYear + * + * Returns the number of days in a specified year, as defined by the "basis" value + * + * @param integer $year The year against which we're testing + * @param integer $basis The type of day count: + * 0 or omitted US (NASD) 360 + * 1 Actual (365 or 366 in a leap year) + * 2 360 + * 3 365 + * 4 European 360 + * @return integer + */ + private static function daysPerYear($year, $basis = 0) + { + switch ($basis) { + case 0: + case 2: + case 4: + $daysPerYear = 360; + break; + case 3: + $daysPerYear = 365; + break; + case 1: + $daysPerYear = (PHPExcel_Calculation_DateTime::isLeapYear($year)) ? 366 : 365; + break; + default: + return PHPExcel_Calculation_Functions::NaN(); + } + return $daysPerYear; + } + + + private static function interestAndPrincipal($rate = 0, $per = 0, $nper = 0, $pv = 0, $fv = 0, $type = 0) + { + $pmt = self::PMT($rate, $nper, $pv, $fv, $type); + $capital = $pv; + for ($i = 1; $i<= $per; ++$i) { + $interest = ($type && $i == 1) ? 0 : -$capital * $rate; + $principal = $pmt - $interest; + $capital += $principal; + } + return array($interest, $principal); + } + + + /** + * ACCRINT + * + * Returns the accrued interest for a security that pays periodic interest. + * + * Excel Function: + * ACCRINT(issue,firstinterest,settlement,rate,par,frequency[,basis]) + * + * @access public + * @category Financial Functions + * @param mixed $issue The security's issue date. + * @param mixed $firstinterest The security's first interest date. + * @param mixed $settlement The security's settlement date. + * The security settlement date is the date after the issue date + * when the security is traded to the buyer. + * @param float $rate The security's annual coupon rate. + * @param float $par The security's par value. + * If you omit par, ACCRINT uses $1,000. + * @param integer $frequency the number of coupon payments per year. + * Valid frequency values are: + * 1 Annual + * 2 Semi-Annual + * 4 Quarterly + * If working in Gnumeric Mode, the following frequency options are + * also available + * 6 Bimonthly + * 12 Monthly + * @param integer $basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return float + */ + public static function ACCRINT($issue, $firstinterest, $settlement, $rate, $par = 1000, $frequency = 1, $basis = 0) + { + $issue = PHPExcel_Calculation_Functions::flattenSingleValue($issue); + $firstinterest = PHPExcel_Calculation_Functions::flattenSingleValue($firstinterest); + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); + $par = (is_null($par)) ? 1000 : PHPExcel_Calculation_Functions::flattenSingleValue($par); + $frequency = (is_null($frequency)) ? 1 : PHPExcel_Calculation_Functions::flattenSingleValue($frequency); + $basis = (is_null($basis)) ? 0 : PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + // Validate + if ((is_numeric($rate)) && (is_numeric($par))) { + $rate = (float) $rate; + $par = (float) $par; + if (($rate <= 0) || ($par <= 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $daysBetweenIssueAndSettlement = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $settlement, $basis); + if (!is_numeric($daysBetweenIssueAndSettlement)) { + // return date error + return $daysBetweenIssueAndSettlement; + } + + return $par * $rate * $daysBetweenIssueAndSettlement; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * ACCRINTM + * + * Returns the accrued interest for a security that pays interest at maturity. + * + * Excel Function: + * ACCRINTM(issue,settlement,rate[,par[,basis]]) + * + * @access public + * @category Financial Functions + * @param mixed issue The security's issue date. + * @param mixed settlement The security's settlement (or maturity) date. + * @param float rate The security's annual coupon rate. + * @param float par The security's par value. + * If you omit par, ACCRINT uses $1,000. + * @param integer basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return float + */ + public static function ACCRINTM($issue, $settlement, $rate, $par = 1000, $basis = 0) + { + $issue = PHPExcel_Calculation_Functions::flattenSingleValue($issue); + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); + $par = (is_null($par)) ? 1000 : PHPExcel_Calculation_Functions::flattenSingleValue($par); + $basis = (is_null($basis)) ? 0 : PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + // Validate + if ((is_numeric($rate)) && (is_numeric($par))) { + $rate = (float) $rate; + $par = (float) $par; + if (($rate <= 0) || ($par <= 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $daysBetweenIssueAndSettlement = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $settlement, $basis); + if (!is_numeric($daysBetweenIssueAndSettlement)) { + // return date error + return $daysBetweenIssueAndSettlement; + } + return $par * $rate * $daysBetweenIssueAndSettlement; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * AMORDEGRC + * + * Returns the depreciation for each accounting period. + * This function is provided for the French accounting system. If an asset is purchased in + * the middle of the accounting period, the prorated depreciation is taken into account. + * The function is similar to AMORLINC, except that a depreciation coefficient is applied in + * the calculation depending on the life of the assets. + * This function will return the depreciation until the last period of the life of the assets + * or until the cumulated value of depreciation is greater than the cost of the assets minus + * the salvage value. + * + * Excel Function: + * AMORDEGRC(cost,purchased,firstPeriod,salvage,period,rate[,basis]) + * + * @access public + * @category Financial Functions + * @param float cost The cost of the asset. + * @param mixed purchased Date of the purchase of the asset. + * @param mixed firstPeriod Date of the end of the first period. + * @param mixed salvage The salvage value at the end of the life of the asset. + * @param float period The period. + * @param float rate Rate of depreciation. + * @param integer basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return float + */ + public static function AMORDEGRC($cost, $purchased, $firstPeriod, $salvage, $period, $rate, $basis = 0) + { + $cost = PHPExcel_Calculation_Functions::flattenSingleValue($cost); + $purchased = PHPExcel_Calculation_Functions::flattenSingleValue($purchased); + $firstPeriod = PHPExcel_Calculation_Functions::flattenSingleValue($firstPeriod); + $salvage = PHPExcel_Calculation_Functions::flattenSingleValue($salvage); + $period = floor(PHPExcel_Calculation_Functions::flattenSingleValue($period)); + $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); + $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + // The depreciation coefficients are: + // Life of assets (1/rate) Depreciation coefficient + // Less than 3 years 1 + // Between 3 and 4 years 1.5 + // Between 5 and 6 years 2 + // More than 6 years 2.5 + $fUsePer = 1.0 / $rate; + if ($fUsePer < 3.0) { + $amortiseCoeff = 1.0; + } elseif ($fUsePer < 5.0) { + $amortiseCoeff = 1.5; + } elseif ($fUsePer <= 6.0) { + $amortiseCoeff = 2.0; + } else { + $amortiseCoeff = 2.5; + } + + $rate *= $amortiseCoeff; + $fNRate = round(PHPExcel_Calculation_DateTime::YEARFRAC($purchased, $firstPeriod, $basis) * $rate * $cost, 0); + $cost -= $fNRate; + $fRest = $cost - $salvage; + + for ($n = 0; $n < $period; ++$n) { + $fNRate = round($rate * $cost, 0); + $fRest -= $fNRate; + + if ($fRest < 0.0) { + switch ($period - $n) { + case 0: + case 1: + return round($cost * 0.5, 0); + default: + return 0.0; + } + } + $cost -= $fNRate; + } + return $fNRate; + } + + + /** + * AMORLINC + * + * Returns the depreciation for each accounting period. + * This function is provided for the French accounting system. If an asset is purchased in + * the middle of the accounting period, the prorated depreciation is taken into account. + * + * Excel Function: + * AMORLINC(cost,purchased,firstPeriod,salvage,period,rate[,basis]) + * + * @access public + * @category Financial Functions + * @param float cost The cost of the asset. + * @param mixed purchased Date of the purchase of the asset. + * @param mixed firstPeriod Date of the end of the first period. + * @param mixed salvage The salvage value at the end of the life of the asset. + * @param float period The period. + * @param float rate Rate of depreciation. + * @param integer basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return float + */ + public static function AMORLINC($cost, $purchased, $firstPeriod, $salvage, $period, $rate, $basis = 0) + { + $cost = PHPExcel_Calculation_Functions::flattenSingleValue($cost); + $purchased = PHPExcel_Calculation_Functions::flattenSingleValue($purchased); + $firstPeriod = PHPExcel_Calculation_Functions::flattenSingleValue($firstPeriod); + $salvage = PHPExcel_Calculation_Functions::flattenSingleValue($salvage); + $period = PHPExcel_Calculation_Functions::flattenSingleValue($period); + $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); + $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + $fOneRate = $cost * $rate; + $fCostDelta = $cost - $salvage; + // Note, quirky variation for leap years on the YEARFRAC for this function + $purchasedYear = PHPExcel_Calculation_DateTime::YEAR($purchased); + $yearFrac = PHPExcel_Calculation_DateTime::YEARFRAC($purchased, $firstPeriod, $basis); + + if (($basis == 1) && ($yearFrac < 1) && (PHPExcel_Calculation_DateTime::isLeapYear($purchasedYear))) { + $yearFrac *= 365 / 366; + } + + $f0Rate = $yearFrac * $rate * $cost; + $nNumOfFullPeriods = intval(($cost - $salvage - $f0Rate) / $fOneRate); + + if ($period == 0) { + return $f0Rate; + } elseif ($period <= $nNumOfFullPeriods) { + return $fOneRate; + } elseif ($period == ($nNumOfFullPeriods + 1)) { + return ($fCostDelta - $fOneRate * $nNumOfFullPeriods - $f0Rate); + } else { + return 0.0; + } + } + + + /** + * COUPDAYBS + * + * Returns the number of days from the beginning of the coupon period to the settlement date. + * + * Excel Function: + * COUPDAYBS(settlement,maturity,frequency[,basis]) + * + * @access public + * @category Financial Functions + * @param mixed settlement The security's settlement date. + * The security settlement date is the date after the issue + * date when the security is traded to the buyer. + * @param mixed maturity The security's maturity date. + * The maturity date is the date when the security expires. + * @param mixed frequency the number of coupon payments per year. + * Valid frequency values are: + * 1 Annual + * 2 Semi-Annual + * 4 Quarterly + * If working in Gnumeric Mode, the following frequency options are + * also available + * 6 Bimonthly + * 12 Monthly + * @param integer basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return float + */ + public static function COUPDAYBS($settlement, $maturity, $frequency, $basis = 0) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency); + $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + if (is_string($settlement = PHPExcel_Calculation_DateTime::getDateValue($settlement))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + if (($settlement > $maturity) || + (!self::isValidFrequency($frequency)) || + (($basis < 0) || ($basis > 4))) { + return PHPExcel_Calculation_Functions::NaN(); + } + + $daysPerYear = self::daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement), $basis); + $prev = self::couponFirstPeriodDate($settlement, $maturity, $frequency, false); + + return PHPExcel_Calculation_DateTime::YEARFRAC($prev, $settlement, $basis) * $daysPerYear; + } + + + /** + * COUPDAYS + * + * Returns the number of days in the coupon period that contains the settlement date. + * + * Excel Function: + * COUPDAYS(settlement,maturity,frequency[,basis]) + * + * @access public + * @category Financial Functions + * @param mixed settlement The security's settlement date. + * The security settlement date is the date after the issue + * date when the security is traded to the buyer. + * @param mixed maturity The security's maturity date. + * The maturity date is the date when the security expires. + * @param mixed frequency the number of coupon payments per year. + * Valid frequency values are: + * 1 Annual + * 2 Semi-Annual + * 4 Quarterly + * If working in Gnumeric Mode, the following frequency options are + * also available + * 6 Bimonthly + * 12 Monthly + * @param integer basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return float + */ + public static function COUPDAYS($settlement, $maturity, $frequency, $basis = 0) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency); + $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + if (is_string($settlement = PHPExcel_Calculation_DateTime::getDateValue($settlement))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + if (($settlement > $maturity) || + (!self::isValidFrequency($frequency)) || + (($basis < 0) || ($basis > 4))) { + return PHPExcel_Calculation_Functions::NaN(); + } + + switch ($basis) { + case 3: + // Actual/365 + return 365 / $frequency; + case 1: + // Actual/actual + if ($frequency == 1) { + $daysPerYear = self::daysPerYear(PHPExcel_Calculation_DateTime::YEAR($maturity), $basis); + return ($daysPerYear / $frequency); + } + $prev = self::couponFirstPeriodDate($settlement, $maturity, $frequency, false); + $next = self::couponFirstPeriodDate($settlement, $maturity, $frequency, true); + return ($next - $prev); + default: + // US (NASD) 30/360, Actual/360 or European 30/360 + return 360 / $frequency; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * COUPDAYSNC + * + * Returns the number of days from the settlement date to the next coupon date. + * + * Excel Function: + * COUPDAYSNC(settlement,maturity,frequency[,basis]) + * + * @access public + * @category Financial Functions + * @param mixed settlement The security's settlement date. + * The security settlement date is the date after the issue + * date when the security is traded to the buyer. + * @param mixed maturity The security's maturity date. + * The maturity date is the date when the security expires. + * @param mixed frequency the number of coupon payments per year. + * Valid frequency values are: + * 1 Annual + * 2 Semi-Annual + * 4 Quarterly + * If working in Gnumeric Mode, the following frequency options are + * also available + * 6 Bimonthly + * 12 Monthly + * @param integer basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return float + */ + public static function COUPDAYSNC($settlement, $maturity, $frequency, $basis = 0) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency); + $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + if (is_string($settlement = PHPExcel_Calculation_DateTime::getDateValue($settlement))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + if (($settlement > $maturity) || + (!self::isValidFrequency($frequency)) || + (($basis < 0) || ($basis > 4))) { + return PHPExcel_Calculation_Functions::NaN(); + } + + $daysPerYear = self::daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement), $basis); + $next = self::couponFirstPeriodDate($settlement, $maturity, $frequency, true); + + return PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $next, $basis) * $daysPerYear; + } + + + /** + * COUPNCD + * + * Returns the next coupon date after the settlement date. + * + * Excel Function: + * COUPNCD(settlement,maturity,frequency[,basis]) + * + * @access public + * @category Financial Functions + * @param mixed settlement The security's settlement date. + * The security settlement date is the date after the issue + * date when the security is traded to the buyer. + * @param mixed maturity The security's maturity date. + * The maturity date is the date when the security expires. + * @param mixed frequency the number of coupon payments per year. + * Valid frequency values are: + * 1 Annual + * 2 Semi-Annual + * 4 Quarterly + * If working in Gnumeric Mode, the following frequency options are + * also available + * 6 Bimonthly + * 12 Monthly + * @param integer basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, + * depending on the value of the ReturnDateType flag + */ + public static function COUPNCD($settlement, $maturity, $frequency, $basis = 0) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency); + $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + if (is_string($settlement = PHPExcel_Calculation_DateTime::getDateValue($settlement))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + if (($settlement > $maturity) || + (!self::isValidFrequency($frequency)) || + (($basis < 0) || ($basis > 4))) { + return PHPExcel_Calculation_Functions::NaN(); + } + + return self::couponFirstPeriodDate($settlement, $maturity, $frequency, true); + } + + + /** + * COUPNUM + * + * Returns the number of coupons payable between the settlement date and maturity date, + * rounded up to the nearest whole coupon. + * + * Excel Function: + * COUPNUM(settlement,maturity,frequency[,basis]) + * + * @access public + * @category Financial Functions + * @param mixed settlement The security's settlement date. + * The security settlement date is the date after the issue + * date when the security is traded to the buyer. + * @param mixed maturity The security's maturity date. + * The maturity date is the date when the security expires. + * @param mixed frequency the number of coupon payments per year. + * Valid frequency values are: + * 1 Annual + * 2 Semi-Annual + * 4 Quarterly + * If working in Gnumeric Mode, the following frequency options are + * also available + * 6 Bimonthly + * 12 Monthly + * @param integer basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return integer + */ + public static function COUPNUM($settlement, $maturity, $frequency, $basis = 0) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency); + $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + if (is_string($settlement = PHPExcel_Calculation_DateTime::getDateValue($settlement))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + if (($settlement > $maturity) || + (!self::isValidFrequency($frequency)) || + (($basis < 0) || ($basis > 4))) { + return PHPExcel_Calculation_Functions::NaN(); + } + + $settlement = self::couponFirstPeriodDate($settlement, $maturity, $frequency, true); + $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis) * 365; + + switch ($frequency) { + case 1: // annual payments + return ceil($daysBetweenSettlementAndMaturity / 360); + case 2: // half-yearly + return ceil($daysBetweenSettlementAndMaturity / 180); + case 4: // quarterly + return ceil($daysBetweenSettlementAndMaturity / 90); + case 6: // bimonthly + return ceil($daysBetweenSettlementAndMaturity / 60); + case 12: // monthly + return ceil($daysBetweenSettlementAndMaturity / 30); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * COUPPCD + * + * Returns the previous coupon date before the settlement date. + * + * Excel Function: + * COUPPCD(settlement,maturity,frequency[,basis]) + * + * @access public + * @category Financial Functions + * @param mixed settlement The security's settlement date. + * The security settlement date is the date after the issue + * date when the security is traded to the buyer. + * @param mixed maturity The security's maturity date. + * The maturity date is the date when the security expires. + * @param mixed frequency the number of coupon payments per year. + * Valid frequency values are: + * 1 Annual + * 2 Semi-Annual + * 4 Quarterly + * If working in Gnumeric Mode, the following frequency options are + * also available + * 6 Bimonthly + * 12 Monthly + * @param integer basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, + * depending on the value of the ReturnDateType flag + */ + public static function COUPPCD($settlement, $maturity, $frequency, $basis = 0) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency); + $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + if (is_string($settlement = PHPExcel_Calculation_DateTime::getDateValue($settlement))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + if (($settlement > $maturity) || + (!self::isValidFrequency($frequency)) || + (($basis < 0) || ($basis > 4))) { + return PHPExcel_Calculation_Functions::NaN(); + } + + return self::couponFirstPeriodDate($settlement, $maturity, $frequency, false); + } + + + /** + * CUMIPMT + * + * Returns the cumulative interest paid on a loan between the start and end periods. + * + * Excel Function: + * CUMIPMT(rate,nper,pv,start,end[,type]) + * + * @access public + * @category Financial Functions + * @param float $rate The Interest rate + * @param integer $nper The total number of payment periods + * @param float $pv Present Value + * @param integer $start The first period in the calculation. + * Payment periods are numbered beginning with 1. + * @param integer $end The last period in the calculation. + * @param integer $type A number 0 or 1 and indicates when payments are due: + * 0 or omitted At the end of the period. + * 1 At the beginning of the period. + * @return float + */ + public static function CUMIPMT($rate, $nper, $pv, $start, $end, $type = 0) + { + $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); + $nper = (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper); + $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv); + $start = (int) PHPExcel_Calculation_Functions::flattenSingleValue($start); + $end = (int) PHPExcel_Calculation_Functions::flattenSingleValue($end); + $type = (int) PHPExcel_Calculation_Functions::flattenSingleValue($type); + + // Validate parameters + if ($type != 0 && $type != 1) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ($start < 1 || $start > $end) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + // Calculate + $interest = 0; + for ($per = $start; $per <= $end; ++$per) { + $interest += self::IPMT($rate, $per, $nper, $pv, 0, $type); + } + + return $interest; + } + + + /** + * CUMPRINC + * + * Returns the cumulative principal paid on a loan between the start and end periods. + * + * Excel Function: + * CUMPRINC(rate,nper,pv,start,end[,type]) + * + * @access public + * @category Financial Functions + * @param float $rate The Interest rate + * @param integer $nper The total number of payment periods + * @param float $pv Present Value + * @param integer $start The first period in the calculation. + * Payment periods are numbered beginning with 1. + * @param integer $end The last period in the calculation. + * @param integer $type A number 0 or 1 and indicates when payments are due: + * 0 or omitted At the end of the period. + * 1 At the beginning of the period. + * @return float + */ + public static function CUMPRINC($rate, $nper, $pv, $start, $end, $type = 0) + { + $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); + $nper = (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper); + $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv); + $start = (int) PHPExcel_Calculation_Functions::flattenSingleValue($start); + $end = (int) PHPExcel_Calculation_Functions::flattenSingleValue($end); + $type = (int) PHPExcel_Calculation_Functions::flattenSingleValue($type); + + // Validate parameters + if ($type != 0 && $type != 1) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ($start < 1 || $start > $end) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + // Calculate + $principal = 0; + for ($per = $start; $per <= $end; ++$per) { + $principal += self::PPMT($rate, $per, $nper, $pv, 0, $type); + } + + return $principal; + } + + + /** + * DB + * + * Returns the depreciation of an asset for a specified period using the + * fixed-declining balance method. + * This form of depreciation is used if you want to get a higher depreciation value + * at the beginning of the depreciation (as opposed to linear depreciation). The + * depreciation value is reduced with every depreciation period by the depreciation + * already deducted from the initial cost. + * + * Excel Function: + * DB(cost,salvage,life,period[,month]) + * + * @access public + * @category Financial Functions + * @param float cost Initial cost of the asset. + * @param float salvage Value at the end of the depreciation. + * (Sometimes called the salvage value of the asset) + * @param integer life Number of periods over which the asset is depreciated. + * (Sometimes called the useful life of the asset) + * @param integer period The period for which you want to calculate the + * depreciation. Period must use the same units as life. + * @param integer month Number of months in the first year. If month is omitted, + * it defaults to 12. + * @return float + */ + public static function DB($cost, $salvage, $life, $period, $month = 12) + { + $cost = PHPExcel_Calculation_Functions::flattenSingleValue($cost); + $salvage = PHPExcel_Calculation_Functions::flattenSingleValue($salvage); + $life = PHPExcel_Calculation_Functions::flattenSingleValue($life); + $period = PHPExcel_Calculation_Functions::flattenSingleValue($period); + $month = PHPExcel_Calculation_Functions::flattenSingleValue($month); + + // Validate + if ((is_numeric($cost)) && (is_numeric($salvage)) && (is_numeric($life)) && (is_numeric($period)) && (is_numeric($month))) { + $cost = (float) $cost; + $salvage = (float) $salvage; + $life = (int) $life; + $period = (int) $period; + $month = (int) $month; + if ($cost == 0) { + return 0.0; + } elseif (($cost < 0) || (($salvage / $cost) < 0) || ($life <= 0) || ($period < 1) || ($month < 1)) { + return PHPExcel_Calculation_Functions::NaN(); + } + // Set Fixed Depreciation Rate + $fixedDepreciationRate = 1 - pow(($salvage / $cost), (1 / $life)); + $fixedDepreciationRate = round($fixedDepreciationRate, 3); + + // Loop through each period calculating the depreciation + $previousDepreciation = 0; + for ($per = 1; $per <= $period; ++$per) { + if ($per == 1) { + $depreciation = $cost * $fixedDepreciationRate * $month / 12; + } elseif ($per == ($life + 1)) { + $depreciation = ($cost - $previousDepreciation) * $fixedDepreciationRate * (12 - $month) / 12; + } else { + $depreciation = ($cost - $previousDepreciation) * $fixedDepreciationRate; + } + $previousDepreciation += $depreciation; + } + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { + $depreciation = round($depreciation, 2); + } + return $depreciation; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * DDB + * + * Returns the depreciation of an asset for a specified period using the + * double-declining balance method or some other method you specify. + * + * Excel Function: + * DDB(cost,salvage,life,period[,factor]) + * + * @access public + * @category Financial Functions + * @param float cost Initial cost of the asset. + * @param float salvage Value at the end of the depreciation. + * (Sometimes called the salvage value of the asset) + * @param integer life Number of periods over which the asset is depreciated. + * (Sometimes called the useful life of the asset) + * @param integer period The period for which you want to calculate the + * depreciation. Period must use the same units as life. + * @param float factor The rate at which the balance declines. + * If factor is omitted, it is assumed to be 2 (the + * double-declining balance method). + * @return float + */ + public static function DDB($cost, $salvage, $life, $period, $factor = 2.0) + { + $cost = PHPExcel_Calculation_Functions::flattenSingleValue($cost); + $salvage = PHPExcel_Calculation_Functions::flattenSingleValue($salvage); + $life = PHPExcel_Calculation_Functions::flattenSingleValue($life); + $period = PHPExcel_Calculation_Functions::flattenSingleValue($period); + $factor = PHPExcel_Calculation_Functions::flattenSingleValue($factor); + + // Validate + if ((is_numeric($cost)) && (is_numeric($salvage)) && (is_numeric($life)) && (is_numeric($period)) && (is_numeric($factor))) { + $cost = (float) $cost; + $salvage = (float) $salvage; + $life = (int) $life; + $period = (int) $period; + $factor = (float) $factor; + if (($cost <= 0) || (($salvage / $cost) < 0) || ($life <= 0) || ($period < 1) || ($factor <= 0.0) || ($period > $life)) { + return PHPExcel_Calculation_Functions::NaN(); + } + // Set Fixed Depreciation Rate + $fixedDepreciationRate = 1 - pow(($salvage / $cost), (1 / $life)); + $fixedDepreciationRate = round($fixedDepreciationRate, 3); + + // Loop through each period calculating the depreciation + $previousDepreciation = 0; + for ($per = 1; $per <= $period; ++$per) { + $depreciation = min(($cost - $previousDepreciation) * ($factor / $life), ($cost - $salvage - $previousDepreciation)); + $previousDepreciation += $depreciation; + } + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { + $depreciation = round($depreciation, 2); + } + return $depreciation; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * DISC + * + * Returns the discount rate for a security. + * + * Excel Function: + * DISC(settlement,maturity,price,redemption[,basis]) + * + * @access public + * @category Financial Functions + * @param mixed settlement The security's settlement date. + * The security settlement date is the date after the issue + * date when the security is traded to the buyer. + * @param mixed maturity The security's maturity date. + * The maturity date is the date when the security expires. + * @param integer price The security's price per $100 face value. + * @param integer redemption The security's redemption value per $100 face value. + * @param integer basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return float + */ + public static function DISC($settlement, $maturity, $price, $redemption, $basis = 0) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $price = PHPExcel_Calculation_Functions::flattenSingleValue($price); + $redemption = PHPExcel_Calculation_Functions::flattenSingleValue($redemption); + $basis = PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + // Validate + if ((is_numeric($price)) && (is_numeric($redemption)) && (is_numeric($basis))) { + $price = (float) $price; + $redemption = (float) $redemption; + $basis = (int) $basis; + if (($price <= 0) || ($redemption <= 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis); + if (!is_numeric($daysBetweenSettlementAndMaturity)) { + // return date error + return $daysBetweenSettlementAndMaturity; + } + + return ((1 - $price / $redemption) / $daysBetweenSettlementAndMaturity); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * DOLLARDE + * + * Converts a dollar price expressed as an integer part and a fraction + * part into a dollar price expressed as a decimal number. + * Fractional dollar numbers are sometimes used for security prices. + * + * Excel Function: + * DOLLARDE(fractional_dollar,fraction) + * + * @access public + * @category Financial Functions + * @param float $fractional_dollar Fractional Dollar + * @param integer $fraction Fraction + * @return float + */ + public static function DOLLARDE($fractional_dollar = null, $fraction = 0) + { + $fractional_dollar = PHPExcel_Calculation_Functions::flattenSingleValue($fractional_dollar); + $fraction = (int)PHPExcel_Calculation_Functions::flattenSingleValue($fraction); + + // Validate parameters + if (is_null($fractional_dollar) || $fraction < 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ($fraction == 0) { + return PHPExcel_Calculation_Functions::DIV0(); + } + + $dollars = floor($fractional_dollar); + $cents = fmod($fractional_dollar, 1); + $cents /= $fraction; + $cents *= pow(10, ceil(log10($fraction))); + return $dollars + $cents; + } + + + /** + * DOLLARFR + * + * Converts a dollar price expressed as a decimal number into a dollar price + * expressed as a fraction. + * Fractional dollar numbers are sometimes used for security prices. + * + * Excel Function: + * DOLLARFR(decimal_dollar,fraction) + * + * @access public + * @category Financial Functions + * @param float $decimal_dollar Decimal Dollar + * @param integer $fraction Fraction + * @return float + */ + public static function DOLLARFR($decimal_dollar = null, $fraction = 0) + { + $decimal_dollar = PHPExcel_Calculation_Functions::flattenSingleValue($decimal_dollar); + $fraction = (int)PHPExcel_Calculation_Functions::flattenSingleValue($fraction); + + // Validate parameters + if (is_null($decimal_dollar) || $fraction < 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ($fraction == 0) { + return PHPExcel_Calculation_Functions::DIV0(); + } + + $dollars = floor($decimal_dollar); + $cents = fmod($decimal_dollar, 1); + $cents *= $fraction; + $cents *= pow(10, -ceil(log10($fraction))); + return $dollars + $cents; + } + + + /** + * EFFECT + * + * Returns the effective interest rate given the nominal rate and the number of + * compounding payments per year. + * + * Excel Function: + * EFFECT(nominal_rate,npery) + * + * @access public + * @category Financial Functions + * @param float $nominal_rate Nominal interest rate + * @param integer $npery Number of compounding payments per year + * @return float + */ + public static function EFFECT($nominal_rate = 0, $npery = 0) + { + $nominal_rate = PHPExcel_Calculation_Functions::flattenSingleValue($nominal_rate); + $npery = (int)PHPExcel_Calculation_Functions::flattenSingleValue($npery); + + // Validate parameters + if ($nominal_rate <= 0 || $npery < 1) { + return PHPExcel_Calculation_Functions::NaN(); + } + + return pow((1 + $nominal_rate / $npery), $npery) - 1; + } + + + /** + * FV + * + * Returns the Future Value of a cash flow with constant payments and interest rate (annuities). + * + * Excel Function: + * FV(rate,nper,pmt[,pv[,type]]) + * + * @access public + * @category Financial Functions + * @param float $rate The interest rate per period + * @param int $nper Total number of payment periods in an annuity + * @param float $pmt The payment made each period: it cannot change over the + * life of the annuity. Typically, pmt contains principal + * and interest but no other fees or taxes. + * @param float $pv Present Value, or the lump-sum amount that a series of + * future payments is worth right now. + * @param integer $type A number 0 or 1 and indicates when payments are due: + * 0 or omitted At the end of the period. + * 1 At the beginning of the period. + * @return float + */ + public static function FV($rate = 0, $nper = 0, $pmt = 0, $pv = 0, $type = 0) + { + $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); + $nper = PHPExcel_Calculation_Functions::flattenSingleValue($nper); + $pmt = PHPExcel_Calculation_Functions::flattenSingleValue($pmt); + $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv); + $type = PHPExcel_Calculation_Functions::flattenSingleValue($type); + + // Validate parameters + if ($type != 0 && $type != 1) { + return PHPExcel_Calculation_Functions::NaN(); + } + + // Calculate + if (!is_null($rate) && $rate != 0) { + return -$pv * pow(1 + $rate, $nper) - $pmt * (1 + $rate * $type) * (pow(1 + $rate, $nper) - 1) / $rate; + } + return -$pv - $pmt * $nper; + } + + + /** + * FVSCHEDULE + * + * Returns the future value of an initial principal after applying a series of compound interest rates. + * Use FVSCHEDULE to calculate the future value of an investment with a variable or adjustable rate. + * + * Excel Function: + * FVSCHEDULE(principal,schedule) + * + * @param float $principal The present value. + * @param float[] $schedule An array of interest rates to apply. + * @return float + */ + public static function FVSCHEDULE($principal, $schedule) + { + $principal = PHPExcel_Calculation_Functions::flattenSingleValue($principal); + $schedule = PHPExcel_Calculation_Functions::flattenArray($schedule); + + foreach ($schedule as $rate) { + $principal *= 1 + $rate; + } + + return $principal; + } + + + /** + * INTRATE + * + * Returns the interest rate for a fully invested security. + * + * Excel Function: + * INTRATE(settlement,maturity,investment,redemption[,basis]) + * + * @param mixed $settlement The security's settlement date. + * The security settlement date is the date after the issue date when the security is traded to the buyer. + * @param mixed $maturity The security's maturity date. + * The maturity date is the date when the security expires. + * @param integer $investment The amount invested in the security. + * @param integer $redemption The amount to be received at maturity. + * @param integer $basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return float + */ + public static function INTRATE($settlement, $maturity, $investment, $redemption, $basis = 0) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $investment = PHPExcel_Calculation_Functions::flattenSingleValue($investment); + $redemption = PHPExcel_Calculation_Functions::flattenSingleValue($redemption); + $basis = PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + // Validate + if ((is_numeric($investment)) && (is_numeric($redemption)) && (is_numeric($basis))) { + $investment = (float) $investment; + $redemption = (float) $redemption; + $basis = (int) $basis; + if (($investment <= 0) || ($redemption <= 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis); + if (!is_numeric($daysBetweenSettlementAndMaturity)) { + // return date error + return $daysBetweenSettlementAndMaturity; + } + + return (($redemption / $investment) - 1) / ($daysBetweenSettlementAndMaturity); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * IPMT + * + * Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate. + * + * Excel Function: + * IPMT(rate,per,nper,pv[,fv][,type]) + * + * @param float $rate Interest rate per period + * @param int $per Period for which we want to find the interest + * @param int $nper Number of periods + * @param float $pv Present Value + * @param float $fv Future Value + * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period + * @return float + */ + public static function IPMT($rate, $per, $nper, $pv, $fv = 0, $type = 0) + { + $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); + $per = (int) PHPExcel_Calculation_Functions::flattenSingleValue($per); + $nper = (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper); + $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv); + $fv = PHPExcel_Calculation_Functions::flattenSingleValue($fv); + $type = (int) PHPExcel_Calculation_Functions::flattenSingleValue($type); + + // Validate parameters + if ($type != 0 && $type != 1) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ($per <= 0 || $per > $nper) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + // Calculate + $interestAndPrincipal = self::interestAndPrincipal($rate, $per, $nper, $pv, $fv, $type); + return $interestAndPrincipal[0]; + } + + /** + * IRR + * + * Returns the internal rate of return for a series of cash flows represented by the numbers in values. + * These cash flows do not have to be even, as they would be for an annuity. However, the cash flows must occur + * at regular intervals, such as monthly or annually. The internal rate of return is the interest rate received + * for an investment consisting of payments (negative values) and income (positive values) that occur at regular + * periods. + * + * Excel Function: + * IRR(values[,guess]) + * + * @param float[] $values An array or a reference to cells that contain numbers for which you want + * to calculate the internal rate of return. + * Values must contain at least one positive value and one negative value to + * calculate the internal rate of return. + * @param float $guess A number that you guess is close to the result of IRR + * @return float + */ + public static function IRR($values, $guess = 0.1) + { + if (!is_array($values)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $values = PHPExcel_Calculation_Functions::flattenArray($values); + $guess = PHPExcel_Calculation_Functions::flattenSingleValue($guess); + + // create an initial range, with a root somewhere between 0 and guess + $x1 = 0.0; + $x2 = $guess; + $f1 = self::NPV($x1, $values); + $f2 = self::NPV($x2, $values); + for ($i = 0; $i < FINANCIAL_MAX_ITERATIONS; ++$i) { + if (($f1 * $f2) < 0.0) { + break; + } + if (abs($f1) < abs($f2)) { + $f1 = self::NPV($x1 += 1.6 * ($x1 - $x2), $values); + } else { + $f2 = self::NPV($x2 += 1.6 * ($x2 - $x1), $values); + } + } + if (($f1 * $f2) > 0.0) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + $f = self::NPV($x1, $values); + if ($f < 0.0) { + $rtb = $x1; + $dx = $x2 - $x1; + } else { + $rtb = $x2; + $dx = $x1 - $x2; + } + + for ($i = 0; $i < FINANCIAL_MAX_ITERATIONS; ++$i) { + $dx *= 0.5; + $x_mid = $rtb + $dx; + $f_mid = self::NPV($x_mid, $values); + if ($f_mid <= 0.0) { + $rtb = $x_mid; + } + if ((abs($f_mid) < FINANCIAL_PRECISION) || (abs($dx) < FINANCIAL_PRECISION)) { + return $x_mid; + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * ISPMT + * + * Returns the interest payment for an investment based on an interest rate and a constant payment schedule. + * + * Excel Function: + * =ISPMT(interest_rate, period, number_payments, PV) + * + * interest_rate is the interest rate for the investment + * + * period is the period to calculate the interest rate. It must be betweeen 1 and number_payments. + * + * number_payments is the number of payments for the annuity + * + * PV is the loan amount or present value of the payments + */ + public static function ISPMT() + { + // Return value + $returnValue = 0; + + // Get the parameters + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + $interestRate = array_shift($aArgs); + $period = array_shift($aArgs); + $numberPeriods = array_shift($aArgs); + $principleRemaining = array_shift($aArgs); + + // Calculate + $principlePayment = ($principleRemaining * 1.0) / ($numberPeriods * 1.0); + for ($i=0; $i <= $period; ++$i) { + $returnValue = $interestRate * $principleRemaining * -1; + $principleRemaining -= $principlePayment; + // principle needs to be 0 after the last payment, don't let floating point screw it up + if ($i == $numberPeriods) { + $returnValue = 0; + } + } + return($returnValue); + } + + + /** + * MIRR + * + * Returns the modified internal rate of return for a series of periodic cash flows. MIRR considers both + * the cost of the investment and the interest received on reinvestment of cash. + * + * Excel Function: + * MIRR(values,finance_rate, reinvestment_rate) + * + * @param float[] $values An array or a reference to cells that contain a series of payments and + * income occurring at regular intervals. + * Payments are negative value, income is positive values. + * @param float $finance_rate The interest rate you pay on the money used in the cash flows + * @param float $reinvestment_rate The interest rate you receive on the cash flows as you reinvest them + * @return float + */ + public static function MIRR($values, $finance_rate, $reinvestment_rate) + { + if (!is_array($values)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $values = PHPExcel_Calculation_Functions::flattenArray($values); + $finance_rate = PHPExcel_Calculation_Functions::flattenSingleValue($finance_rate); + $reinvestment_rate = PHPExcel_Calculation_Functions::flattenSingleValue($reinvestment_rate); + $n = count($values); + + $rr = 1.0 + $reinvestment_rate; + $fr = 1.0 + $finance_rate; + + $npv_pos = $npv_neg = 0.0; + foreach ($values as $i => $v) { + if ($v >= 0) { + $npv_pos += $v / pow($rr, $i); + } else { + $npv_neg += $v / pow($fr, $i); + } + } + + if (($npv_neg == 0) || ($npv_pos == 0) || ($reinvestment_rate <= -1)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + $mirr = pow((-$npv_pos * pow($rr, $n)) + / ($npv_neg * ($rr)), (1.0 / ($n - 1))) - 1.0; + + return (is_finite($mirr) ? $mirr : PHPExcel_Calculation_Functions::VALUE()); + } + + + /** + * NOMINAL + * + * Returns the nominal interest rate given the effective rate and the number of compounding payments per year. + * + * @param float $effect_rate Effective interest rate + * @param int $npery Number of compounding payments per year + * @return float + */ + public static function NOMINAL($effect_rate = 0, $npery = 0) + { + $effect_rate = PHPExcel_Calculation_Functions::flattenSingleValue($effect_rate); + $npery = (int)PHPExcel_Calculation_Functions::flattenSingleValue($npery); + + // Validate parameters + if ($effect_rate <= 0 || $npery < 1) { + return PHPExcel_Calculation_Functions::NaN(); + } + + // Calculate + return $npery * (pow($effect_rate + 1, 1 / $npery) - 1); + } + + + /** + * NPER + * + * Returns the number of periods for a cash flow with constant periodic payments (annuities), and interest rate. + * + * @param float $rate Interest rate per period + * @param int $pmt Periodic payment (annuity) + * @param float $pv Present Value + * @param float $fv Future Value + * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period + * @return float + */ + public static function NPER($rate = 0, $pmt = 0, $pv = 0, $fv = 0, $type = 0) + { + $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); + $pmt = PHPExcel_Calculation_Functions::flattenSingleValue($pmt); + $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv); + $fv = PHPExcel_Calculation_Functions::flattenSingleValue($fv); + $type = PHPExcel_Calculation_Functions::flattenSingleValue($type); + + // Validate parameters + if ($type != 0 && $type != 1) { + return PHPExcel_Calculation_Functions::NaN(); + } + + // Calculate + if (!is_null($rate) && $rate != 0) { + if ($pmt == 0 && $pv == 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + return log(($pmt * (1 + $rate * $type) / $rate - $fv) / ($pv + $pmt * (1 + $rate * $type) / $rate)) / log(1 + $rate); + } + if ($pmt == 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + return (-$pv -$fv) / $pmt; + } + + /** + * NPV + * + * Returns the Net Present Value of a cash flow series given a discount rate. + * + * @return float + */ + public static function NPV() + { + // Return value + $returnValue = 0; + + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + + // Calculate + $rate = array_shift($aArgs); + for ($i = 1; $i <= count($aArgs); ++$i) { + // Is it a numeric value? + if (is_numeric($aArgs[$i - 1])) { + $returnValue += $aArgs[$i - 1] / pow(1 + $rate, $i); + } + } + + // Return + return $returnValue; + } + + /** + * PMT + * + * Returns the constant payment (annuity) for a cash flow with a constant interest rate. + * + * @param float $rate Interest rate per period + * @param int $nper Number of periods + * @param float $pv Present Value + * @param float $fv Future Value + * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period + * @return float + */ + public static function PMT($rate = 0, $nper = 0, $pv = 0, $fv = 0, $type = 0) + { + $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); + $nper = PHPExcel_Calculation_Functions::flattenSingleValue($nper); + $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv); + $fv = PHPExcel_Calculation_Functions::flattenSingleValue($fv); + $type = PHPExcel_Calculation_Functions::flattenSingleValue($type); + + // Validate parameters + if ($type != 0 && $type != 1) { + return PHPExcel_Calculation_Functions::NaN(); + } + + // Calculate + if (!is_null($rate) && $rate != 0) { + return (-$fv - $pv * pow(1 + $rate, $nper)) / (1 + $rate * $type) / ((pow(1 + $rate, $nper) - 1) / $rate); + } + return (-$pv - $fv) / $nper; + } + + + /** + * PPMT + * + * Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate. + * + * @param float $rate Interest rate per period + * @param int $per Period for which we want to find the interest + * @param int $nper Number of periods + * @param float $pv Present Value + * @param float $fv Future Value + * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period + * @return float + */ + public static function PPMT($rate, $per, $nper, $pv, $fv = 0, $type = 0) + { + $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); + $per = (int) PHPExcel_Calculation_Functions::flattenSingleValue($per); + $nper = (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper); + $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv); + $fv = PHPExcel_Calculation_Functions::flattenSingleValue($fv); + $type = (int) PHPExcel_Calculation_Functions::flattenSingleValue($type); + + // Validate parameters + if ($type != 0 && $type != 1) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ($per <= 0 || $per > $nper) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + // Calculate + $interestAndPrincipal = self::interestAndPrincipal($rate, $per, $nper, $pv, $fv, $type); + return $interestAndPrincipal[1]; + } + + + public static function PRICE($settlement, $maturity, $rate, $yield, $redemption, $frequency, $basis = 0) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $rate = (float) PHPExcel_Calculation_Functions::flattenSingleValue($rate); + $yield = (float) PHPExcel_Calculation_Functions::flattenSingleValue($yield); + $redemption = (float) PHPExcel_Calculation_Functions::flattenSingleValue($redemption); + $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency); + $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + if (is_string($settlement = PHPExcel_Calculation_DateTime::getDateValue($settlement))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + if (($settlement > $maturity) || + (!self::isValidFrequency($frequency)) || + (($basis < 0) || ($basis > 4))) { + return PHPExcel_Calculation_Functions::NaN(); + } + + $dsc = self::COUPDAYSNC($settlement, $maturity, $frequency, $basis); + $e = self::COUPDAYS($settlement, $maturity, $frequency, $basis); + $n = self::COUPNUM($settlement, $maturity, $frequency, $basis); + $a = self::COUPDAYBS($settlement, $maturity, $frequency, $basis); + + $baseYF = 1.0 + ($yield / $frequency); + $rfp = 100 * ($rate / $frequency); + $de = $dsc / $e; + + $result = $redemption / pow($baseYF, (--$n + $de)); + for ($k = 0; $k <= $n; ++$k) { + $result += $rfp / (pow($baseYF, ($k + $de))); + } + $result -= $rfp * ($a / $e); + + return $result; + } + + + /** + * PRICEDISC + * + * Returns the price per $100 face value of a discounted security. + * + * @param mixed settlement The security's settlement date. + * The security settlement date is the date after the issue date when the security is traded to the buyer. + * @param mixed maturity The security's maturity date. + * The maturity date is the date when the security expires. + * @param int discount The security's discount rate. + * @param int redemption The security's redemption value per $100 face value. + * @param int basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return float + */ + public static function PRICEDISC($settlement, $maturity, $discount, $redemption, $basis = 0) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $discount = (float) PHPExcel_Calculation_Functions::flattenSingleValue($discount); + $redemption = (float) PHPExcel_Calculation_Functions::flattenSingleValue($redemption); + $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + // Validate + if ((is_numeric($discount)) && (is_numeric($redemption)) && (is_numeric($basis))) { + if (($discount <= 0) || ($redemption <= 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis); + if (!is_numeric($daysBetweenSettlementAndMaturity)) { + // return date error + return $daysBetweenSettlementAndMaturity; + } + + return $redemption * (1 - $discount * $daysBetweenSettlementAndMaturity); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * PRICEMAT + * + * Returns the price per $100 face value of a security that pays interest at maturity. + * + * @param mixed settlement The security's settlement date. + * The security's settlement date is the date after the issue date when the security is traded to the buyer. + * @param mixed maturity The security's maturity date. + * The maturity date is the date when the security expires. + * @param mixed issue The security's issue date. + * @param int rate The security's interest rate at date of issue. + * @param int yield The security's annual yield. + * @param int basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return float + */ + public static function PRICEMAT($settlement, $maturity, $issue, $rate, $yield, $basis = 0) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $issue = PHPExcel_Calculation_Functions::flattenSingleValue($issue); + $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); + $yield = PHPExcel_Calculation_Functions::flattenSingleValue($yield); + $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + // Validate + if (is_numeric($rate) && is_numeric($yield)) { + if (($rate <= 0) || ($yield <= 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $daysPerYear = self::daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement), $basis); + if (!is_numeric($daysPerYear)) { + return $daysPerYear; + } + $daysBetweenIssueAndSettlement = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $settlement, $basis); + if (!is_numeric($daysBetweenIssueAndSettlement)) { + // return date error + return $daysBetweenIssueAndSettlement; + } + $daysBetweenIssueAndSettlement *= $daysPerYear; + $daysBetweenIssueAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $maturity, $basis); + if (!is_numeric($daysBetweenIssueAndMaturity)) { + // return date error + return $daysBetweenIssueAndMaturity; + } + $daysBetweenIssueAndMaturity *= $daysPerYear; + $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis); + if (!is_numeric($daysBetweenSettlementAndMaturity)) { + // return date error + return $daysBetweenSettlementAndMaturity; + } + $daysBetweenSettlementAndMaturity *= $daysPerYear; + + return ((100 + (($daysBetweenIssueAndMaturity / $daysPerYear) * $rate * 100)) / + (1 + (($daysBetweenSettlementAndMaturity / $daysPerYear) * $yield)) - + (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate * 100)); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * PV + * + * Returns the Present Value of a cash flow with constant payments and interest rate (annuities). + * + * @param float $rate Interest rate per period + * @param int $nper Number of periods + * @param float $pmt Periodic payment (annuity) + * @param float $fv Future Value + * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period + * @return float + */ + public static function PV($rate = 0, $nper = 0, $pmt = 0, $fv = 0, $type = 0) + { + $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); + $nper = PHPExcel_Calculation_Functions::flattenSingleValue($nper); + $pmt = PHPExcel_Calculation_Functions::flattenSingleValue($pmt); + $fv = PHPExcel_Calculation_Functions::flattenSingleValue($fv); + $type = PHPExcel_Calculation_Functions::flattenSingleValue($type); + + // Validate parameters + if ($type != 0 && $type != 1) { + return PHPExcel_Calculation_Functions::NaN(); + } + + // Calculate + if (!is_null($rate) && $rate != 0) { + return (-$pmt * (1 + $rate * $type) * ((pow(1 + $rate, $nper) - 1) / $rate) - $fv) / pow(1 + $rate, $nper); + } + return -$fv - $pmt * $nper; + } + + + /** + * RATE + * + * Returns the interest rate per period of an annuity. + * RATE is calculated by iteration and can have zero or more solutions. + * If the successive results of RATE do not converge to within 0.0000001 after 20 iterations, + * RATE returns the #NUM! error value. + * + * Excel Function: + * RATE(nper,pmt,pv[,fv[,type[,guess]]]) + * + * @access public + * @category Financial Functions + * @param float nper The total number of payment periods in an annuity. + * @param float pmt The payment made each period and cannot change over the life + * of the annuity. + * Typically, pmt includes principal and interest but no other + * fees or taxes. + * @param float pv The present value - the total amount that a series of future + * payments is worth now. + * @param float fv The future value, or a cash balance you want to attain after + * the last payment is made. If fv is omitted, it is assumed + * to be 0 (the future value of a loan, for example, is 0). + * @param integer type A number 0 or 1 and indicates when payments are due: + * 0 or omitted At the end of the period. + * 1 At the beginning of the period. + * @param float guess Your guess for what the rate will be. + * If you omit guess, it is assumed to be 10 percent. + * @return float + **/ + public static function RATE($nper, $pmt, $pv, $fv = 0.0, $type = 0, $guess = 0.1) + { + $nper = (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper); + $pmt = PHPExcel_Calculation_Functions::flattenSingleValue($pmt); + $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv); + $fv = (is_null($fv)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($fv); + $type = (is_null($type)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($type); + $guess = (is_null($guess)) ? 0.1 : PHPExcel_Calculation_Functions::flattenSingleValue($guess); + + $rate = $guess; + if (abs($rate) < FINANCIAL_PRECISION) { + $y = $pv * (1 + $nper * $rate) + $pmt * (1 + $rate * $type) * $nper + $fv; + } else { + $f = exp($nper * log(1 + $rate)); + $y = $pv * $f + $pmt * (1 / $rate + $type) * ($f - 1) + $fv; + } + $y0 = $pv + $pmt * $nper + $fv; + $y1 = $pv * $f + $pmt * (1 / $rate + $type) * ($f - 1) + $fv; + + // find root by secant method + $i = $x0 = 0.0; + $x1 = $rate; + while ((abs($y0 - $y1) > FINANCIAL_PRECISION) && ($i < FINANCIAL_MAX_ITERATIONS)) { + $rate = ($y1 * $x0 - $y0 * $x1) / ($y1 - $y0); + $x0 = $x1; + $x1 = $rate; + if (($nper * abs($pmt)) > ($pv - $fv)) { + $x1 = abs($x1); + } + if (abs($rate) < FINANCIAL_PRECISION) { + $y = $pv * (1 + $nper * $rate) + $pmt * (1 + $rate * $type) * $nper + $fv; + } else { + $f = exp($nper * log(1 + $rate)); + $y = $pv * $f + $pmt * (1 / $rate + $type) * ($f - 1) + $fv; + } + + $y0 = $y1; + $y1 = $y; + ++$i; + } + return $rate; + } + + + /** + * RECEIVED + * + * Returns the price per $100 face value of a discounted security. + * + * @param mixed settlement The security's settlement date. + * The security settlement date is the date after the issue date when the security is traded to the buyer. + * @param mixed maturity The security's maturity date. + * The maturity date is the date when the security expires. + * @param int investment The amount invested in the security. + * @param int discount The security's discount rate. + * @param int basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return float + */ + public static function RECEIVED($settlement, $maturity, $investment, $discount, $basis = 0) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $investment = (float) PHPExcel_Calculation_Functions::flattenSingleValue($investment); + $discount = (float) PHPExcel_Calculation_Functions::flattenSingleValue($discount); + $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + // Validate + if ((is_numeric($investment)) && (is_numeric($discount)) && (is_numeric($basis))) { + if (($investment <= 0) || ($discount <= 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis); + if (!is_numeric($daysBetweenSettlementAndMaturity)) { + // return date error + return $daysBetweenSettlementAndMaturity; + } + + return $investment / ( 1 - ($discount * $daysBetweenSettlementAndMaturity)); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * SLN + * + * Returns the straight-line depreciation of an asset for one period + * + * @param cost Initial cost of the asset + * @param salvage Value at the end of the depreciation + * @param life Number of periods over which the asset is depreciated + * @return float + */ + public static function SLN($cost, $salvage, $life) + { + $cost = PHPExcel_Calculation_Functions::flattenSingleValue($cost); + $salvage = PHPExcel_Calculation_Functions::flattenSingleValue($salvage); + $life = PHPExcel_Calculation_Functions::flattenSingleValue($life); + + // Calculate + if ((is_numeric($cost)) && (is_numeric($salvage)) && (is_numeric($life))) { + if ($life < 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + return ($cost - $salvage) / $life; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * SYD + * + * Returns the sum-of-years' digits depreciation of an asset for a specified period. + * + * @param cost Initial cost of the asset + * @param salvage Value at the end of the depreciation + * @param life Number of periods over which the asset is depreciated + * @param period Period + * @return float + */ + public static function SYD($cost, $salvage, $life, $period) + { + $cost = PHPExcel_Calculation_Functions::flattenSingleValue($cost); + $salvage = PHPExcel_Calculation_Functions::flattenSingleValue($salvage); + $life = PHPExcel_Calculation_Functions::flattenSingleValue($life); + $period = PHPExcel_Calculation_Functions::flattenSingleValue($period); + + // Calculate + if ((is_numeric($cost)) && (is_numeric($salvage)) && (is_numeric($life)) && (is_numeric($period))) { + if (($life < 1) || ($period > $life)) { + return PHPExcel_Calculation_Functions::NaN(); + } + return (($cost - $salvage) * ($life - $period + 1) * 2) / ($life * ($life + 1)); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * TBILLEQ + * + * Returns the bond-equivalent yield for a Treasury bill. + * + * @param mixed settlement The Treasury bill's settlement date. + * The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer. + * @param mixed maturity The Treasury bill's maturity date. + * The maturity date is the date when the Treasury bill expires. + * @param int discount The Treasury bill's discount rate. + * @return float + */ + public static function TBILLEQ($settlement, $maturity, $discount) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $discount = PHPExcel_Calculation_Functions::flattenSingleValue($discount); + + // Use TBILLPRICE for validation + $testValue = self::TBILLPRICE($settlement, $maturity, $discount); + if (is_string($testValue)) { + return $testValue; + } + + if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { + ++$maturity; + $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity) * 360; + } else { + $daysBetweenSettlementAndMaturity = (PHPExcel_Calculation_DateTime::getDateValue($maturity) - PHPExcel_Calculation_DateTime::getDateValue($settlement)); + } + + return (365 * $discount) / (360 - $discount * $daysBetweenSettlementAndMaturity); + } + + + /** + * TBILLPRICE + * + * Returns the yield for a Treasury bill. + * + * @param mixed settlement The Treasury bill's settlement date. + * The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer. + * @param mixed maturity The Treasury bill's maturity date. + * The maturity date is the date when the Treasury bill expires. + * @param int discount The Treasury bill's discount rate. + * @return float + */ + public static function TBILLPRICE($settlement, $maturity, $discount) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $discount = PHPExcel_Calculation_Functions::flattenSingleValue($discount); + + if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + // Validate + if (is_numeric($discount)) { + if ($discount <= 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { + ++$maturity; + $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity) * 360; + if (!is_numeric($daysBetweenSettlementAndMaturity)) { + // return date error + return $daysBetweenSettlementAndMaturity; + } + } else { + $daysBetweenSettlementAndMaturity = (PHPExcel_Calculation_DateTime::getDateValue($maturity) - PHPExcel_Calculation_DateTime::getDateValue($settlement)); + } + + if ($daysBetweenSettlementAndMaturity > 360) { + return PHPExcel_Calculation_Functions::NaN(); + } + + $price = 100 * (1 - (($discount * $daysBetweenSettlementAndMaturity) / 360)); + if ($price <= 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + return $price; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * TBILLYIELD + * + * Returns the yield for a Treasury bill. + * + * @param mixed settlement The Treasury bill's settlement date. + * The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer. + * @param mixed maturity The Treasury bill's maturity date. + * The maturity date is the date when the Treasury bill expires. + * @param int price The Treasury bill's price per $100 face value. + * @return float + */ + public static function TBILLYIELD($settlement, $maturity, $price) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $price = PHPExcel_Calculation_Functions::flattenSingleValue($price); + + // Validate + if (is_numeric($price)) { + if ($price <= 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { + ++$maturity; + $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity) * 360; + if (!is_numeric($daysBetweenSettlementAndMaturity)) { + // return date error + return $daysBetweenSettlementAndMaturity; + } + } else { + $daysBetweenSettlementAndMaturity = (PHPExcel_Calculation_DateTime::getDateValue($maturity) - PHPExcel_Calculation_DateTime::getDateValue($settlement)); + } + + if ($daysBetweenSettlementAndMaturity > 360) { + return PHPExcel_Calculation_Functions::NaN(); + } + + return ((100 - $price) / $price) * (360 / $daysBetweenSettlementAndMaturity); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + public static function XIRR($values, $dates, $guess = 0.1) + { + if ((!is_array($values)) && (!is_array($dates))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $values = PHPExcel_Calculation_Functions::flattenArray($values); + $dates = PHPExcel_Calculation_Functions::flattenArray($dates); + $guess = PHPExcel_Calculation_Functions::flattenSingleValue($guess); + if (count($values) != count($dates)) { + return PHPExcel_Calculation_Functions::NaN(); + } + + // create an initial range, with a root somewhere between 0 and guess + $x1 = 0.0; + $x2 = $guess; + $f1 = self::XNPV($x1, $values, $dates); + $f2 = self::XNPV($x2, $values, $dates); + for ($i = 0; $i < FINANCIAL_MAX_ITERATIONS; ++$i) { + if (($f1 * $f2) < 0.0) { + break; + } elseif (abs($f1) < abs($f2)) { + $f1 = self::XNPV($x1 += 1.6 * ($x1 - $x2), $values, $dates); + } else { + $f2 = self::XNPV($x2 += 1.6 * ($x2 - $x1), $values, $dates); + } + } + if (($f1 * $f2) > 0.0) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + $f = self::XNPV($x1, $values, $dates); + if ($f < 0.0) { + $rtb = $x1; + $dx = $x2 - $x1; + } else { + $rtb = $x2; + $dx = $x1 - $x2; + } + + for ($i = 0; $i < FINANCIAL_MAX_ITERATIONS; ++$i) { + $dx *= 0.5; + $x_mid = $rtb + $dx; + $f_mid = self::XNPV($x_mid, $values, $dates); + if ($f_mid <= 0.0) { + $rtb = $x_mid; + } + if ((abs($f_mid) < FINANCIAL_PRECISION) || (abs($dx) < FINANCIAL_PRECISION)) { + return $x_mid; + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * XNPV + * + * Returns the net present value for a schedule of cash flows that is not necessarily periodic. + * To calculate the net present value for a series of cash flows that is periodic, use the NPV function. + * + * Excel Function: + * =XNPV(rate,values,dates) + * + * @param float $rate The discount rate to apply to the cash flows. + * @param array of float $values A series of cash flows that corresponds to a schedule of payments in dates. + * The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment. + * If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year. + * The series of values must contain at least one positive value and one negative value. + * @param array of mixed $dates A schedule of payment dates that corresponds to the cash flow payments. + * The first payment date indicates the beginning of the schedule of payments. + * All other dates must be later than this date, but they may occur in any order. + * @return float + */ + public static function XNPV($rate, $values, $dates) + { + $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); + if (!is_numeric($rate)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if ((!is_array($values)) || (!is_array($dates))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $values = PHPExcel_Calculation_Functions::flattenArray($values); + $dates = PHPExcel_Calculation_Functions::flattenArray($dates); + $valCount = count($values); + if ($valCount != count($dates)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ((min($values) > 0) || (max($values) < 0)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + $xnpv = 0.0; + for ($i = 0; $i < $valCount; ++$i) { + if (!is_numeric($values[$i])) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $xnpv += $values[$i] / pow(1 + $rate, PHPExcel_Calculation_DateTime::DATEDIF($dates[0], $dates[$i], 'd') / 365); + } + return (is_finite($xnpv)) ? $xnpv : PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * YIELDDISC + * + * Returns the annual yield of a security that pays interest at maturity. + * + * @param mixed settlement The security's settlement date. + * The security's settlement date is the date after the issue date when the security is traded to the buyer. + * @param mixed maturity The security's maturity date. + * The maturity date is the date when the security expires. + * @param int price The security's price per $100 face value. + * @param int redemption The security's redemption value per $100 face value. + * @param int basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return float + */ + public static function YIELDDISC($settlement, $maturity, $price, $redemption, $basis = 0) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $price = PHPExcel_Calculation_Functions::flattenSingleValue($price); + $redemption = PHPExcel_Calculation_Functions::flattenSingleValue($redemption); + $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + // Validate + if (is_numeric($price) && is_numeric($redemption)) { + if (($price <= 0) || ($redemption <= 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $daysPerYear = self::daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement), $basis); + if (!is_numeric($daysPerYear)) { + return $daysPerYear; + } + $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis); + if (!is_numeric($daysBetweenSettlementAndMaturity)) { + // return date error + return $daysBetweenSettlementAndMaturity; + } + $daysBetweenSettlementAndMaturity *= $daysPerYear; + + return (($redemption - $price) / $price) * ($daysPerYear / $daysBetweenSettlementAndMaturity); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * YIELDMAT + * + * Returns the annual yield of a security that pays interest at maturity. + * + * @param mixed settlement The security's settlement date. + * The security's settlement date is the date after the issue date when the security is traded to the buyer. + * @param mixed maturity The security's maturity date. + * The maturity date is the date when the security expires. + * @param mixed issue The security's issue date. + * @param int rate The security's interest rate at date of issue. + * @param int price The security's price per $100 face value. + * @param int basis The type of day count to use. + * 0 or omitted US (NASD) 30/360 + * 1 Actual/actual + * 2 Actual/360 + * 3 Actual/365 + * 4 European 30/360 + * @return float + */ + public static function YIELDMAT($settlement, $maturity, $issue, $rate, $price, $basis = 0) + { + $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); + $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); + $issue = PHPExcel_Calculation_Functions::flattenSingleValue($issue); + $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); + $price = PHPExcel_Calculation_Functions::flattenSingleValue($price); + $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); + + // Validate + if (is_numeric($rate) && is_numeric($price)) { + if (($rate <= 0) || ($price <= 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $daysPerYear = self::daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement), $basis); + if (!is_numeric($daysPerYear)) { + return $daysPerYear; + } + $daysBetweenIssueAndSettlement = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $settlement, $basis); + if (!is_numeric($daysBetweenIssueAndSettlement)) { + // return date error + return $daysBetweenIssueAndSettlement; + } + $daysBetweenIssueAndSettlement *= $daysPerYear; + $daysBetweenIssueAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $maturity, $basis); + if (!is_numeric($daysBetweenIssueAndMaturity)) { + // return date error + return $daysBetweenIssueAndMaturity; + } + $daysBetweenIssueAndMaturity *= $daysPerYear; + $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis); + if (!is_numeric($daysBetweenSettlementAndMaturity)) { + // return date error + return $daysBetweenSettlementAndMaturity; + } + $daysBetweenSettlementAndMaturity *= $daysPerYear; + + return ((1 + (($daysBetweenIssueAndMaturity / $daysPerYear) * $rate) - (($price / 100) + (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate))) / + (($price / 100) + (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate))) * + ($daysPerYear / $daysBetweenSettlementAndMaturity); + } + return PHPExcel_Calculation_Functions::VALUE(); + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation/FormulaParser.php b/extend/PHPExcel/PHPExcel/Calculation/FormulaParser.php new file mode 100644 index 0000000..893f19e --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation/FormulaParser.php @@ -0,0 +1,622 @@ +<"; + const OPERATORS_POSTFIX = "%"; + + /** + * Formula + * + * @var string + */ + private $formula; + + /** + * Tokens + * + * @var PHPExcel_Calculation_FormulaToken[] + */ + private $tokens = array(); + + /** + * Create a new PHPExcel_Calculation_FormulaParser + * + * @param string $pFormula Formula to parse + * @throws PHPExcel_Calculation_Exception + */ + public function __construct($pFormula = '') + { + // Check parameters + if (is_null($pFormula)) { + throw new PHPExcel_Calculation_Exception("Invalid parameter passed: formula"); + } + + // Initialise values + $this->formula = trim($pFormula); + // Parse! + $this->parseToTokens(); + } + + /** + * Get Formula + * + * @return string + */ + public function getFormula() + { + return $this->formula; + } + + /** + * Get Token + * + * @param int $pId Token id + * @return string + * @throws PHPExcel_Calculation_Exception + */ + public function getToken($pId = 0) + { + if (isset($this->tokens[$pId])) { + return $this->tokens[$pId]; + } else { + throw new PHPExcel_Calculation_Exception("Token with id $pId does not exist."); + } + } + + /** + * Get Token count + * + * @return string + */ + public function getTokenCount() + { + return count($this->tokens); + } + + /** + * Get Tokens + * + * @return PHPExcel_Calculation_FormulaToken[] + */ + public function getTokens() + { + return $this->tokens; + } + + /** + * Parse to tokens + */ + private function parseToTokens() + { + // No attempt is made to verify formulas; assumes formulas are derived from Excel, where + // they can only exist if valid; stack overflows/underflows sunk as nulls without exceptions. + + // Check if the formula has a valid starting = + $formulaLength = strlen($this->formula); + if ($formulaLength < 2 || $this->formula{0} != '=') { + return; + } + + // Helper variables + $tokens1 = $tokens2 = $stack = array(); + $inString = $inPath = $inRange = $inError = false; + $token = $previousToken = $nextToken = null; + + $index = 1; + $value = ''; + + $ERRORS = array("#NULL!", "#DIV/0!", "#VALUE!", "#REF!", "#NAME?", "#NUM!", "#N/A"); + $COMPARATORS_MULTI = array(">=", "<=", "<>"); + + while ($index < $formulaLength) { + // state-dependent character evaluation (order is important) + + // double-quoted strings + // embeds are doubled + // end marks token + if ($inString) { + if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) { + if ((($index + 2) <= $formulaLength) && ($this->formula{$index + 1} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE)) { + $value .= PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE; + ++$index; + } else { + $inString = false; + $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_TEXT); + $value = ""; + } + } else { + $value .= $this->formula{$index}; + } + ++$index; + continue; + } + + // single-quoted strings (links) + // embeds are double + // end does not mark a token + if ($inPath) { + if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) { + if ((($index + 2) <= $formulaLength) && ($this->formula{$index + 1} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE)) { + $value .= PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE; + ++$index; + } else { + $inPath = false; + } + } else { + $value .= $this->formula{$index}; + } + ++$index; + continue; + } + + // bracked strings (R1C1 range index or linked workbook name) + // no embeds (changed to "()" by Excel) + // end does not mark a token + if ($inRange) { + if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::BRACKET_CLOSE) { + $inRange = false; + } + $value .= $this->formula{$index}; + ++$index; + continue; + } + + // error values + // end marks a token, determined from absolute list of values + if ($inError) { + $value .= $this->formula{$index}; + ++$index; + if (in_array($value, $ERRORS)) { + $inError = false; + $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_ERROR); + $value = ""; + } + continue; + } + + // scientific notation check + if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_SN, $this->formula{$index}) !== false) { + if (strlen($value) > 1) { + if (preg_match("/^[1-9]{1}(\.[0-9]+)?E{1}$/", $this->formula{$index}) != 0) { + $value .= $this->formula{$index}; + ++$index; + continue; + } + } + } + + // independent character evaluation (order not important) + + // establish state-dependent character evaluations + if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) { + if (strlen($value > 0)) { + // unexpected + $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN); + $value = ""; + } + $inString = true; + ++$index; + continue; + } + + if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) { + if (strlen($value) > 0) { + // unexpected + $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN); + $value = ""; + } + $inPath = true; + ++$index; + continue; + } + + if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::BRACKET_OPEN) { + $inRange = true; + $value .= PHPExcel_Calculation_FormulaParser::BRACKET_OPEN; + ++$index; + continue; + } + + if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::ERROR_START) { + if (strlen($value) > 0) { + // unexpected + $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN); + $value = ""; + } + $inError = true; + $value .= PHPExcel_Calculation_FormulaParser::ERROR_START; + ++$index; + continue; + } + + // mark start and end of arrays and array rows + if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::BRACE_OPEN) { + if (strlen($value) > 0) { + // unexpected + $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN); + $value = ""; + } + + $tmp = new PHPExcel_Calculation_FormulaToken("ARRAY", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START); + $tokens1[] = $tmp; + $stack[] = clone $tmp; + + $tmp = new PHPExcel_Calculation_FormulaToken("ARRAYROW", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START); + $tokens1[] = $tmp; + $stack[] = clone $tmp; + + ++$index; + continue; + } + + if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::SEMICOLON) { + if (strlen($value) > 0) { + $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); + $value = ""; + } + + $tmp = array_pop($stack); + $tmp->setValue(""); + $tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP); + $tokens1[] = $tmp; + + $tmp = new PHPExcel_Calculation_FormulaToken(",", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_ARGUMENT); + $tokens1[] = $tmp; + + $tmp = new PHPExcel_Calculation_FormulaToken("ARRAYROW", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START); + $tokens1[] = $tmp; + $stack[] = clone $tmp; + + ++$index; + continue; + } + + if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::BRACE_CLOSE) { + if (strlen($value) > 0) { + $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); + $value = ""; + } + + $tmp = array_pop($stack); + $tmp->setValue(""); + $tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP); + $tokens1[] = $tmp; + + $tmp = array_pop($stack); + $tmp->setValue(""); + $tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP); + $tokens1[] = $tmp; + + ++$index; + continue; + } + + // trim white-space + if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::WHITESPACE) { + if (strlen($value) > 0) { + $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); + $value = ""; + } + $tokens1[] = new PHPExcel_Calculation_FormulaToken("", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_WHITESPACE); + ++$index; + while (($this->formula{$index} == PHPExcel_Calculation_FormulaParser::WHITESPACE) && ($index < $formulaLength)) { + ++$index; + } + continue; + } + + // multi-character comparators + if (($index + 2) <= $formulaLength) { + if (in_array(substr($this->formula, $index, 2), $COMPARATORS_MULTI)) { + if (strlen($value) > 0) { + $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); + $value = ""; + } + $tokens1[] = new PHPExcel_Calculation_FormulaToken(substr($this->formula, $index, 2), PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_LOGICAL); + $index += 2; + continue; + } + } + + // standard infix operators + if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_INFIX, $this->formula{$index}) !== false) { + if (strlen($value) > 0) { + $tokens1[] =new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); + $value = ""; + } + $tokens1[] = new PHPExcel_Calculation_FormulaToken($this->formula{$index}, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX); + ++$index; + continue; + } + + // standard postfix operators (only one) + if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_POSTFIX, $this->formula{$index}) !== false) { + if (strlen($value) > 0) { + $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); + $value = ""; + } + $tokens1[] = new PHPExcel_Calculation_FormulaToken($this->formula{$index}, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX); + ++$index; + continue; + } + + // start subexpression or function + if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::PAREN_OPEN) { + if (strlen($value) > 0) { + $tmp = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START); + $tokens1[] = $tmp; + $stack[] = clone $tmp; + $value = ""; + } else { + $tmp = new PHPExcel_Calculation_FormulaToken("", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START); + $tokens1[] = $tmp; + $stack[] = clone $tmp; + } + ++$index; + continue; + } + + // function, subexpression, or array parameters, or operand unions + if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::COMMA) { + if (strlen($value) > 0) { + $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); + $value = ""; + } + + $tmp = array_pop($stack); + $tmp->setValue(""); + $tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP); + $stack[] = $tmp; + + if ($tmp->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) { + $tokens1[] = new PHPExcel_Calculation_FormulaToken(",", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_UNION); + } else { + $tokens1[] = new PHPExcel_Calculation_FormulaToken(",", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_ARGUMENT); + } + ++$index; + continue; + } + + // stop subexpression + if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::PAREN_CLOSE) { + if (strlen($value) > 0) { + $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); + $value = ""; + } + + $tmp = array_pop($stack); + $tmp->setValue(""); + $tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP); + $tokens1[] = $tmp; + + ++$index; + continue; + } + + // token accumulation + $value .= $this->formula{$index}; + ++$index; + } + + // dump remaining accumulation + if (strlen($value) > 0) { + $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); + } + + // move tokenList to new set, excluding unnecessary white-space tokens and converting necessary ones to intersections + $tokenCount = count($tokens1); + for ($i = 0; $i < $tokenCount; ++$i) { + $token = $tokens1[$i]; + if (isset($tokens1[$i - 1])) { + $previousToken = $tokens1[$i - 1]; + } else { + $previousToken = null; + } + if (isset($tokens1[$i + 1])) { + $nextToken = $tokens1[$i + 1]; + } else { + $nextToken = null; + } + + if (is_null($token)) { + continue; + } + + if ($token->getTokenType() != PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_WHITESPACE) { + $tokens2[] = $token; + continue; + } + + if (is_null($previousToken)) { + continue; + } + + if (! ( + (($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) && ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) || + (($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) || + ($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND) + ) ) { + continue; + } + + if (is_null($nextToken)) { + continue; + } + + if (! ( + (($nextToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) && ($nextToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START)) || + (($nextToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($nextToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START)) || + ($nextToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND) + ) ) { + continue; + } + + $tokens2[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_INTERSECTION); + } + + // move tokens to final list, switching infix "-" operators to prefix when appropriate, switching infix "+" operators + // to noop when appropriate, identifying operand and infix-operator subtypes, and pulling "@" from function names + $this->tokens = array(); + + $tokenCount = count($tokens2); + for ($i = 0; $i < $tokenCount; ++$i) { + $token = $tokens2[$i]; + if (isset($tokens2[$i - 1])) { + $previousToken = $tokens2[$i - 1]; + } else { + $previousToken = null; + } + if (isset($tokens2[$i + 1])) { + $nextToken = $tokens2[$i + 1]; + } else { + $nextToken = null; + } + + if (is_null($token)) { + continue; + } + + if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getValue() == "-") { + if ($i == 0) { + $token->setTokenType(PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPREFIX); + } elseif ((($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) && + ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) || + (($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && + ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) || + ($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX) || + ($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND)) { + $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_MATH); + } else { + $token->setTokenType(PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPREFIX); + } + + $this->tokens[] = $token; + continue; + } + + if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getValue() == "+") { + if ($i == 0) { + continue; + } elseif ((($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) && + ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) || + (($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && + ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) || + ($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX) || + ($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND)) { + $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_MATH); + } else { + continue; + } + + $this->tokens[] = $token; + continue; + } + + if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX && + $token->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NOTHING) { + if (strpos("<>=", substr($token->getValue(), 0, 1)) !== false) { + $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_LOGICAL); + } elseif ($token->getValue() == "&") { + $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_CONCATENATION); + } else { + $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_MATH); + } + + $this->tokens[] = $token; + continue; + } + + if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND && + $token->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NOTHING) { + if (!is_numeric($token->getValue())) { + if (strtoupper($token->getValue()) == "TRUE" || strtoupper($token->getValue() == "FALSE")) { + $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_LOGICAL); + } else { + $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_RANGE); + } + } else { + $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NUMBER); + } + + $this->tokens[] = $token; + continue; + } + + if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) { + if (strlen($token->getValue() > 0)) { + if (substr($token->getValue(), 0, 1) == "@") { + $token->setValue(substr($token->getValue(), 1)); + } + } + } + + $this->tokens[] = $token; + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation/FormulaToken.php b/extend/PHPExcel/PHPExcel/Calculation/FormulaToken.php new file mode 100644 index 0000000..41c6e3d --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation/FormulaToken.php @@ -0,0 +1,176 @@ +value = $pValue; + $this->tokenType = $pTokenType; + $this->tokenSubType = $pTokenSubType; + } + + /** + * Get Value + * + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Set Value + * + * @param string $value + */ + public function setValue($value) + { + $this->value = $value; + } + + /** + * Get Token Type (represented by TOKEN_TYPE_*) + * + * @return string + */ + public function getTokenType() + { + return $this->tokenType; + } + + /** + * Set Token Type + * + * @param string $value + */ + public function setTokenType($value = PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN) + { + $this->tokenType = $value; + } + + /** + * Get Token SubType (represented by TOKEN_SUBTYPE_*) + * + * @return string + */ + public function getTokenSubType() + { + return $this->tokenSubType; + } + + /** + * Set Token SubType + * + * @param string $value + */ + public function setTokenSubType($value = PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NOTHING) + { + $this->tokenSubType = $value; + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation/Function.php b/extend/PHPExcel/PHPExcel/Calculation/Function.php new file mode 100644 index 0000000..d58cef2 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation/Function.php @@ -0,0 +1,148 @@ +category = $pCategory; + $this->excelName = $pExcelName; + $this->phpExcelName = $pPHPExcelName; + } else { + throw new PHPExcel_Calculation_Exception("Invalid parameters passed."); + } + } + + /** + * Get Category (represented by CATEGORY_*) + * + * @return string + */ + public function getCategory() + { + return $this->category; + } + + /** + * Set Category (represented by CATEGORY_*) + * + * @param string $value + * @throws PHPExcel_Calculation_Exception + */ + public function setCategory($value = null) + { + if (!is_null($value)) { + $this->category = $value; + } else { + throw new PHPExcel_Calculation_Exception("Invalid parameter passed."); + } + } + + /** + * Get Excel name + * + * @return string + */ + public function getExcelName() + { + return $this->excelName; + } + + /** + * Set Excel name + * + * @param string $value + */ + public function setExcelName($value) + { + $this->excelName = $value; + } + + /** + * Get PHPExcel name + * + * @return string + */ + public function getPHPExcelName() + { + return $this->phpExcelName; + } + + /** + * Set PHPExcel name + * + * @param string $value + */ + public function setPHPExcelName($value) + { + $this->phpExcelName = $value; + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation/Functions.php b/extend/PHPExcel/PHPExcel/Calculation/Functions.php new file mode 100644 index 0000000..5a1e5ee --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation/Functions.php @@ -0,0 +1,760 @@ + '#NULL!', + 'divisionbyzero' => '#DIV/0!', + 'value' => '#VALUE!', + 'reference' => '#REF!', + 'name' => '#NAME?', + 'num' => '#NUM!', + 'na' => '#N/A', + 'gettingdata' => '#GETTING_DATA' + ); + + + /** + * Set the Compatibility Mode + * + * @access public + * @category Function Configuration + * @param string $compatibilityMode Compatibility Mode + * Permitted values are: + * PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL 'Excel' + * PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC 'Gnumeric' + * PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc' + * @return boolean (Success or Failure) + */ + public static function setCompatibilityMode($compatibilityMode) + { + if (($compatibilityMode == self::COMPATIBILITY_EXCEL) || + ($compatibilityMode == self::COMPATIBILITY_GNUMERIC) || + ($compatibilityMode == self::COMPATIBILITY_OPENOFFICE)) { + self::$compatibilityMode = $compatibilityMode; + return true; + } + return false; + } + + + /** + * Return the current Compatibility Mode + * + * @access public + * @category Function Configuration + * @return string Compatibility Mode + * Possible Return values are: + * PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL 'Excel' + * PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC 'Gnumeric' + * PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc' + */ + public static function getCompatibilityMode() + { + return self::$compatibilityMode; + } + + + /** + * Set the Return Date Format used by functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object) + * + * @access public + * @category Function Configuration + * @param string $returnDateType Return Date Format + * Permitted values are: + * PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC 'P' + * PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT 'O' + * PHPExcel_Calculation_Functions::RETURNDATE_EXCEL 'E' + * @return boolean Success or failure + */ + public static function setReturnDateType($returnDateType) + { + if (($returnDateType == self::RETURNDATE_PHP_NUMERIC) || + ($returnDateType == self::RETURNDATE_PHP_OBJECT) || + ($returnDateType == self::RETURNDATE_EXCEL)) { + self::$returnDateType = $returnDateType; + return true; + } + return false; + } + + + /** + * Return the current Return Date Format for functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object) + * + * @access public + * @category Function Configuration + * @return string Return Date Format + * Possible Return values are: + * PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC 'P' + * PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT 'O' + * PHPExcel_Calculation_Functions::RETURNDATE_EXCEL 'E' + */ + public static function getReturnDateType() + { + return self::$returnDateType; + } + + + /** + * DUMMY + * + * @access public + * @category Error Returns + * @return string #Not Yet Implemented + */ + public static function DUMMY() + { + return '#Not Yet Implemented'; + } + + + /** + * DIV0 + * + * @access public + * @category Error Returns + * @return string #Not Yet Implemented + */ + public static function DIV0() + { + return self::$errorCodes['divisionbyzero']; + } + + + /** + * NA + * + * Excel Function: + * =NA() + * + * Returns the error value #N/A + * #N/A is the error value that means "no value is available." + * + * @access public + * @category Logical Functions + * @return string #N/A! + */ + public static function NA() + { + return self::$errorCodes['na']; + } + + + /** + * NaN + * + * Returns the error value #NUM! + * + * @access public + * @category Error Returns + * @return string #NUM! + */ + public static function NaN() + { + return self::$errorCodes['num']; + } + + + /** + * NAME + * + * Returns the error value #NAME? + * + * @access public + * @category Error Returns + * @return string #NAME? + */ + public static function NAME() + { + return self::$errorCodes['name']; + } + + + /** + * REF + * + * Returns the error value #REF! + * + * @access public + * @category Error Returns + * @return string #REF! + */ + public static function REF() + { + return self::$errorCodes['reference']; + } + + + /** + * NULL + * + * Returns the error value #NULL! + * + * @access public + * @category Error Returns + * @return string #NULL! + */ + public static function NULL() + { + return self::$errorCodes['null']; + } + + + /** + * VALUE + * + * Returns the error value #VALUE! + * + * @access public + * @category Error Returns + * @return string #VALUE! + */ + public static function VALUE() + { + return self::$errorCodes['value']; + } + + + public static function isMatrixValue($idx) + { + return ((substr_count($idx, '.') <= 1) || (preg_match('/\.[A-Z]/', $idx) > 0)); + } + + + public static function isValue($idx) + { + return (substr_count($idx, '.') == 0); + } + + + public static function isCellValue($idx) + { + return (substr_count($idx, '.') > 1); + } + + + public static function ifCondition($condition) + { + $condition = PHPExcel_Calculation_Functions::flattenSingleValue($condition); + if (!isset($condition{0})) { + $condition = '=""'; + } + if (!in_array($condition{0}, array('>', '<', '='))) { + if (!is_numeric($condition)) { + $condition = PHPExcel_Calculation::wrapResult(strtoupper($condition)); + } + return '=' . $condition; + } else { + preg_match('/([<>=]+)(.*)/', $condition, $matches); + list(, $operator, $operand) = $matches; + + if (!is_numeric($operand)) { + $operand = str_replace('"', '""', $operand); + $operand = PHPExcel_Calculation::wrapResult(strtoupper($operand)); + } + + return $operator.$operand; + } + } + + /** + * ERROR_TYPE + * + * @param mixed $value Value to check + * @return boolean + */ + public static function ERROR_TYPE($value = '') + { + $value = self::flattenSingleValue($value); + + $i = 1; + foreach (self::$errorCodes as $errorCode) { + if ($value === $errorCode) { + return $i; + } + ++$i; + } + return self::NA(); + } + + + /** + * IS_BLANK + * + * @param mixed $value Value to check + * @return boolean + */ + public static function IS_BLANK($value = null) + { + if (!is_null($value)) { + $value = self::flattenSingleValue($value); + } + + return is_null($value); + } + + + /** + * IS_ERR + * + * @param mixed $value Value to check + * @return boolean + */ + public static function IS_ERR($value = '') + { + $value = self::flattenSingleValue($value); + + return self::IS_ERROR($value) && (!self::IS_NA($value)); + } + + + /** + * IS_ERROR + * + * @param mixed $value Value to check + * @return boolean + */ + public static function IS_ERROR($value = '') + { + $value = self::flattenSingleValue($value); + + if (!is_string($value)) { + return false; + } + return in_array($value, array_values(self::$errorCodes)); + } + + + /** + * IS_NA + * + * @param mixed $value Value to check + * @return boolean + */ + public static function IS_NA($value = '') + { + $value = self::flattenSingleValue($value); + + return ($value === self::NA()); + } + + + /** + * IS_EVEN + * + * @param mixed $value Value to check + * @return boolean + */ + public static function IS_EVEN($value = null) + { + $value = self::flattenSingleValue($value); + + if ($value === null) { + return self::NAME(); + } elseif ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) { + return self::VALUE(); + } + + return ($value % 2 == 0); + } + + + /** + * IS_ODD + * + * @param mixed $value Value to check + * @return boolean + */ + public static function IS_ODD($value = null) + { + $value = self::flattenSingleValue($value); + + if ($value === null) { + return self::NAME(); + } elseif ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) { + return self::VALUE(); + } + + return (abs($value) % 2 == 1); + } + + + /** + * IS_NUMBER + * + * @param mixed $value Value to check + * @return boolean + */ + public static function IS_NUMBER($value = null) + { + $value = self::flattenSingleValue($value); + + if (is_string($value)) { + return false; + } + return is_numeric($value); + } + + + /** + * IS_LOGICAL + * + * @param mixed $value Value to check + * @return boolean + */ + public static function IS_LOGICAL($value = null) + { + $value = self::flattenSingleValue($value); + + return is_bool($value); + } + + + /** + * IS_TEXT + * + * @param mixed $value Value to check + * @return boolean + */ + public static function IS_TEXT($value = null) + { + $value = self::flattenSingleValue($value); + + return (is_string($value) && !self::IS_ERROR($value)); + } + + + /** + * IS_NONTEXT + * + * @param mixed $value Value to check + * @return boolean + */ + public static function IS_NONTEXT($value = null) + { + return !self::IS_TEXT($value); + } + + + /** + * VERSION + * + * @return string Version information + */ + public static function VERSION() + { + return 'PHPExcel ##VERSION##, ##DATE##'; + } + + + /** + * N + * + * Returns a value converted to a number + * + * @param value The value you want converted + * @return number N converts values listed in the following table + * If value is or refers to N returns + * A number That number + * A date The serial number of that date + * TRUE 1 + * FALSE 0 + * An error value The error value + * Anything else 0 + */ + public static function N($value = null) + { + while (is_array($value)) { + $value = array_shift($value); + } + + switch (gettype($value)) { + case 'double': + case 'float': + case 'integer': + return $value; + case 'boolean': + return (integer) $value; + case 'string': + // Errors + if ((strlen($value) > 0) && ($value{0} == '#')) { + return $value; + } + break; + } + return 0; + } + + + /** + * TYPE + * + * Returns a number that identifies the type of a value + * + * @param value The value you want tested + * @return number N converts values listed in the following table + * If value is or refers to N returns + * A number 1 + * Text 2 + * Logical Value 4 + * An error value 16 + * Array or Matrix 64 + */ + public static function TYPE($value = null) + { + $value = self::flattenArrayIndexed($value); + if (is_array($value) && (count($value) > 1)) { + end($value); + $a = key($value); + // Range of cells is an error + if (self::isCellValue($a)) { + return 16; + // Test for Matrix + } elseif (self::isMatrixValue($a)) { + return 64; + } + } elseif (empty($value)) { + // Empty Cell + return 1; + } + $value = self::flattenSingleValue($value); + + if (($value === null) || (is_float($value)) || (is_int($value))) { + return 1; + } elseif (is_bool($value)) { + return 4; + } elseif (is_array($value)) { + return 64; + } elseif (is_string($value)) { + // Errors + if ((strlen($value) > 0) && ($value{0} == '#')) { + return 16; + } + return 2; + } + return 0; + } + + + /** + * Convert a multi-dimensional array to a simple 1-dimensional array + * + * @param array $array Array to be flattened + * @return array Flattened array + */ + public static function flattenArray($array) + { + if (!is_array($array)) { + return (array) $array; + } + + $arrayValues = array(); + foreach ($array as $value) { + if (is_array($value)) { + foreach ($value as $val) { + if (is_array($val)) { + foreach ($val as $v) { + $arrayValues[] = $v; + } + } else { + $arrayValues[] = $val; + } + } + } else { + $arrayValues[] = $value; + } + } + + return $arrayValues; + } + + + /** + * Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing + * + * @param array $array Array to be flattened + * @return array Flattened array + */ + public static function flattenArrayIndexed($array) + { + if (!is_array($array)) { + return (array) $array; + } + + $arrayValues = array(); + foreach ($array as $k1 => $value) { + if (is_array($value)) { + foreach ($value as $k2 => $val) { + if (is_array($val)) { + foreach ($val as $k3 => $v) { + $arrayValues[$k1.'.'.$k2.'.'.$k3] = $v; + } + } else { + $arrayValues[$k1.'.'.$k2] = $val; + } + } + } else { + $arrayValues[$k1] = $value; + } + } + + return $arrayValues; + } + + + /** + * Convert an array to a single scalar value by extracting the first element + * + * @param mixed $value Array or scalar value + * @return mixed + */ + public static function flattenSingleValue($value = '') + { + while (is_array($value)) { + $value = array_pop($value); + } + + return $value; + } +} + + +// +// There are a few mathematical functions that aren't available on all versions of PHP for all platforms +// These functions aren't available in Windows implementations of PHP prior to version 5.3.0 +// So we test if they do exist for this version of PHP/operating platform; and if not we create them +// +if (!function_exists('acosh')) { + function acosh($x) + { + return 2 * log(sqrt(($x + 1) / 2) + sqrt(($x - 1) / 2)); + } // function acosh() +} + +if (!function_exists('asinh')) { + function asinh($x) + { + return log($x + sqrt(1 + $x * $x)); + } // function asinh() +} + +if (!function_exists('atanh')) { + function atanh($x) + { + return (log(1 + $x) - log(1 - $x)) / 2; + } // function atanh() +} + + +// +// Strangely, PHP doesn't have a mb_str_replace multibyte function +// As we'll only ever use this function with UTF-8 characters, we can simply "hard-code" the character set +// +if ((!function_exists('mb_str_replace')) && + (function_exists('mb_substr')) && (function_exists('mb_strlen')) && (function_exists('mb_strpos'))) { + function mb_str_replace($search, $replace, $subject) + { + if (is_array($subject)) { + $ret = array(); + foreach ($subject as $key => $val) { + $ret[$key] = mb_str_replace($search, $replace, $val); + } + return $ret; + } + + foreach ((array) $search as $key => $s) { + if ($s == '' && $s !== 0) { + continue; + } + $r = !is_array($replace) ? $replace : (array_key_exists($key, $replace) ? $replace[$key] : ''); + $pos = mb_strpos($subject, $s, 0, 'UTF-8'); + while ($pos !== false) { + $subject = mb_substr($subject, 0, $pos, 'UTF-8') . $r . mb_substr($subject, $pos + mb_strlen($s, 'UTF-8'), 65535, 'UTF-8'); + $pos = mb_strpos($subject, $s, $pos + mb_strlen($r, 'UTF-8'), 'UTF-8'); + } + } + return $subject; + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation/Logical.php b/extend/PHPExcel/PHPExcel/Calculation/Logical.php new file mode 100644 index 0000000..dd65f01 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation/Logical.php @@ -0,0 +1,285 @@ + $arg) { + // Is it a boolean value? + if (is_bool($arg)) { + $returnValue = $returnValue && $arg; + } elseif ((is_numeric($arg)) && (!is_string($arg))) { + $returnValue = $returnValue && ($arg != 0); + } elseif (is_string($arg)) { + $arg = strtoupper($arg); + if (($arg == 'TRUE') || ($arg == PHPExcel_Calculation::getTRUE())) { + $arg = true; + } elseif (($arg == 'FALSE') || ($arg == PHPExcel_Calculation::getFALSE())) { + $arg = false; + } else { + return PHPExcel_Calculation_Functions::VALUE(); + } + $returnValue = $returnValue && ($arg != 0); + } + } + + // Return + if ($argCount < 0) { + return PHPExcel_Calculation_Functions::VALUE(); + } + return $returnValue; + } + + + /** + * LOGICAL_OR + * + * Returns boolean TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE. + * + * Excel Function: + * =OR(logical1[,logical2[, ...]]) + * + * The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays + * or references that contain logical values. + * + * Boolean arguments are treated as True or False as appropriate + * Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False + * If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds + * the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value + * + * @access public + * @category Logical Functions + * @param mixed $arg,... Data values + * @return boolean The logical OR of the arguments. + */ + public static function LOGICAL_OR() + { + // Return value + $returnValue = false; + + // Loop through the arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + $argCount = -1; + foreach ($aArgs as $argCount => $arg) { + // Is it a boolean value? + if (is_bool($arg)) { + $returnValue = $returnValue || $arg; + } elseif ((is_numeric($arg)) && (!is_string($arg))) { + $returnValue = $returnValue || ($arg != 0); + } elseif (is_string($arg)) { + $arg = strtoupper($arg); + if (($arg == 'TRUE') || ($arg == PHPExcel_Calculation::getTRUE())) { + $arg = true; + } elseif (($arg == 'FALSE') || ($arg == PHPExcel_Calculation::getFALSE())) { + $arg = false; + } else { + return PHPExcel_Calculation_Functions::VALUE(); + } + $returnValue = $returnValue || ($arg != 0); + } + } + + // Return + if ($argCount < 0) { + return PHPExcel_Calculation_Functions::VALUE(); + } + return $returnValue; + } + + + /** + * NOT + * + * Returns the boolean inverse of the argument. + * + * Excel Function: + * =NOT(logical) + * + * The argument must evaluate to a logical value such as TRUE or FALSE + * + * Boolean arguments are treated as True or False as appropriate + * Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False + * If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds + * the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value + * + * @access public + * @category Logical Functions + * @param mixed $logical A value or expression that can be evaluated to TRUE or FALSE + * @return boolean The boolean inverse of the argument. + */ + public static function NOT($logical = false) + { + $logical = PHPExcel_Calculation_Functions::flattenSingleValue($logical); + if (is_string($logical)) { + $logical = strtoupper($logical); + if (($logical == 'TRUE') || ($logical == PHPExcel_Calculation::getTRUE())) { + return false; + } elseif (($logical == 'FALSE') || ($logical == PHPExcel_Calculation::getFALSE())) { + return true; + } else { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + + return !$logical; + } + + /** + * STATEMENT_IF + * + * Returns one value if a condition you specify evaluates to TRUE and another value if it evaluates to FALSE. + * + * Excel Function: + * =IF(condition[,returnIfTrue[,returnIfFalse]]) + * + * Condition is any value or expression that can be evaluated to TRUE or FALSE. + * For example, A10=100 is a logical expression; if the value in cell A10 is equal to 100, + * the expression evaluates to TRUE. Otherwise, the expression evaluates to FALSE. + * This argument can use any comparison calculation operator. + * ReturnIfTrue is the value that is returned if condition evaluates to TRUE. + * For example, if this argument is the text string "Within budget" and the condition argument evaluates to TRUE, + * then the IF function returns the text "Within budget" + * If condition is TRUE and ReturnIfTrue is blank, this argument returns 0 (zero). To display the word TRUE, use + * the logical value TRUE for this argument. + * ReturnIfTrue can be another formula. + * ReturnIfFalse is the value that is returned if condition evaluates to FALSE. + * For example, if this argument is the text string "Over budget" and the condition argument evaluates to FALSE, + * then the IF function returns the text "Over budget". + * If condition is FALSE and ReturnIfFalse is omitted, then the logical value FALSE is returned. + * If condition is FALSE and ReturnIfFalse is blank, then the value 0 (zero) is returned. + * ReturnIfFalse can be another formula. + * + * @access public + * @category Logical Functions + * @param mixed $condition Condition to evaluate + * @param mixed $returnIfTrue Value to return when condition is true + * @param mixed $returnIfFalse Optional value to return when condition is false + * @return mixed The value of returnIfTrue or returnIfFalse determined by condition + */ + public static function STATEMENT_IF($condition = true, $returnIfTrue = 0, $returnIfFalse = false) + { + $condition = (is_null($condition)) ? true : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($condition); + $returnIfTrue = (is_null($returnIfTrue)) ? 0 : PHPExcel_Calculation_Functions::flattenSingleValue($returnIfTrue); + $returnIfFalse = (is_null($returnIfFalse)) ? false : PHPExcel_Calculation_Functions::flattenSingleValue($returnIfFalse); + + return ($condition) ? $returnIfTrue : $returnIfFalse; + } + + + /** + * IFERROR + * + * Excel Function: + * =IFERROR(testValue,errorpart) + * + * @access public + * @category Logical Functions + * @param mixed $testValue Value to check, is also the value returned when no error + * @param mixed $errorpart Value to return when testValue is an error condition + * @return mixed The value of errorpart or testValue determined by error condition + */ + public static function IFERROR($testValue = '', $errorpart = '') + { + $testValue = (is_null($testValue)) ? '' : PHPExcel_Calculation_Functions::flattenSingleValue($testValue); + $errorpart = (is_null($errorpart)) ? '' : PHPExcel_Calculation_Functions::flattenSingleValue($errorpart); + + return self::STATEMENT_IF(PHPExcel_Calculation_Functions::IS_ERROR($testValue), $errorpart, $testValue); + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation/LookupRef.php b/extend/PHPExcel/PHPExcel/Calculation/LookupRef.php new file mode 100644 index 0000000..1fe7790 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation/LookupRef.php @@ -0,0 +1,879 @@ + '') { + if (strpos($sheetText, ' ') !== false) { + $sheetText = "'".$sheetText."'"; + } + $sheetText .='!'; + } + if ((!is_bool($referenceStyle)) || $referenceStyle) { + $rowRelative = $columnRelative = '$'; + $column = PHPExcel_Cell::stringFromColumnIndex($column-1); + if (($relativity == 2) || ($relativity == 4)) { + $columnRelative = ''; + } + if (($relativity == 3) || ($relativity == 4)) { + $rowRelative = ''; + } + return $sheetText.$columnRelative.$column.$rowRelative.$row; + } else { + if (($relativity == 2) || ($relativity == 4)) { + $column = '['.$column.']'; + } + if (($relativity == 3) || ($relativity == 4)) { + $row = '['.$row.']'; + } + return $sheetText.'R'.$row.'C'.$column; + } + } + + + /** + * COLUMN + * + * Returns the column number of the given cell reference + * If the cell reference is a range of cells, COLUMN returns the column numbers of each column in the reference as a horizontal array. + * If cell reference is omitted, and the function is being called through the calculation engine, then it is assumed to be the + * reference of the cell in which the COLUMN function appears; otherwise this function returns 0. + * + * Excel Function: + * =COLUMN([cellAddress]) + * + * @param cellAddress A reference to a range of cells for which you want the column numbers + * @return integer or array of integer + */ + public static function COLUMN($cellAddress = null) + { + if (is_null($cellAddress) || trim($cellAddress) === '') { + return 0; + } + + if (is_array($cellAddress)) { + foreach ($cellAddress as $columnKey => $value) { + $columnKey = preg_replace('/[^a-z]/i', '', $columnKey); + return (integer) PHPExcel_Cell::columnIndexFromString($columnKey); + } + } else { + if (strpos($cellAddress, '!') !== false) { + list($sheet, $cellAddress) = explode('!', $cellAddress); + } + if (strpos($cellAddress, ':') !== false) { + list($startAddress, $endAddress) = explode(':', $cellAddress); + $startAddress = preg_replace('/[^a-z]/i', '', $startAddress); + $endAddress = preg_replace('/[^a-z]/i', '', $endAddress); + $returnValue = array(); + do { + $returnValue[] = (integer) PHPExcel_Cell::columnIndexFromString($startAddress); + } while ($startAddress++ != $endAddress); + return $returnValue; + } else { + $cellAddress = preg_replace('/[^a-z]/i', '', $cellAddress); + return (integer) PHPExcel_Cell::columnIndexFromString($cellAddress); + } + } + } + + + /** + * COLUMNS + * + * Returns the number of columns in an array or reference. + * + * Excel Function: + * =COLUMNS(cellAddress) + * + * @param cellAddress An array or array formula, or a reference to a range of cells for which you want the number of columns + * @return integer The number of columns in cellAddress + */ + public static function COLUMNS($cellAddress = null) + { + if (is_null($cellAddress) || $cellAddress === '') { + return 1; + } elseif (!is_array($cellAddress)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + reset($cellAddress); + $isMatrix = (is_numeric(key($cellAddress))); + list($columns, $rows) = PHPExcel_Calculation::_getMatrixDimensions($cellAddress); + + if ($isMatrix) { + return $rows; + } else { + return $columns; + } + } + + + /** + * ROW + * + * Returns the row number of the given cell reference + * If the cell reference is a range of cells, ROW returns the row numbers of each row in the reference as a vertical array. + * If cell reference is omitted, and the function is being called through the calculation engine, then it is assumed to be the + * reference of the cell in which the ROW function appears; otherwise this function returns 0. + * + * Excel Function: + * =ROW([cellAddress]) + * + * @param cellAddress A reference to a range of cells for which you want the row numbers + * @return integer or array of integer + */ + public static function ROW($cellAddress = null) + { + if (is_null($cellAddress) || trim($cellAddress) === '') { + return 0; + } + + if (is_array($cellAddress)) { + foreach ($cellAddress as $columnKey => $rowValue) { + foreach ($rowValue as $rowKey => $cellValue) { + return (integer) preg_replace('/[^0-9]/i', '', $rowKey); + } + } + } else { + if (strpos($cellAddress, '!') !== false) { + list($sheet, $cellAddress) = explode('!', $cellAddress); + } + if (strpos($cellAddress, ':') !== false) { + list($startAddress, $endAddress) = explode(':', $cellAddress); + $startAddress = preg_replace('/[^0-9]/', '', $startAddress); + $endAddress = preg_replace('/[^0-9]/', '', $endAddress); + $returnValue = array(); + do { + $returnValue[][] = (integer) $startAddress; + } while ($startAddress++ != $endAddress); + return $returnValue; + } else { + list($cellAddress) = explode(':', $cellAddress); + return (integer) preg_replace('/[^0-9]/', '', $cellAddress); + } + } + } + + + /** + * ROWS + * + * Returns the number of rows in an array or reference. + * + * Excel Function: + * =ROWS(cellAddress) + * + * @param cellAddress An array or array formula, or a reference to a range of cells for which you want the number of rows + * @return integer The number of rows in cellAddress + */ + public static function ROWS($cellAddress = null) + { + if (is_null($cellAddress) || $cellAddress === '') { + return 1; + } elseif (!is_array($cellAddress)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + reset($cellAddress); + $isMatrix = (is_numeric(key($cellAddress))); + list($columns, $rows) = PHPExcel_Calculation::_getMatrixDimensions($cellAddress); + + if ($isMatrix) { + return $columns; + } else { + return $rows; + } + } + + + /** + * HYPERLINK + * + * Excel Function: + * =HYPERLINK(linkURL,displayName) + * + * @access public + * @category Logical Functions + * @param string $linkURL Value to check, is also the value returned when no error + * @param string $displayName Value to return when testValue is an error condition + * @param PHPExcel_Cell $pCell The cell to set the hyperlink in + * @return mixed The value of $displayName (or $linkURL if $displayName was blank) + */ + public static function HYPERLINK($linkURL = '', $displayName = null, PHPExcel_Cell $pCell = null) + { + $args = func_get_args(); + $pCell = array_pop($args); + + $linkURL = (is_null($linkURL)) ? '' : PHPExcel_Calculation_Functions::flattenSingleValue($linkURL); + $displayName = (is_null($displayName)) ? '' : PHPExcel_Calculation_Functions::flattenSingleValue($displayName); + + if ((!is_object($pCell)) || (trim($linkURL) == '')) { + return PHPExcel_Calculation_Functions::REF(); + } + + if ((is_object($displayName)) || trim($displayName) == '') { + $displayName = $linkURL; + } + + $pCell->getHyperlink()->setUrl($linkURL); + $pCell->getHyperlink()->setTooltip($displayName); + + return $displayName; + } + + + /** + * INDIRECT + * + * Returns the reference specified by a text string. + * References are immediately evaluated to display their contents. + * + * Excel Function: + * =INDIRECT(cellAddress) + * + * NOTE - INDIRECT() does not yet support the optional a1 parameter introduced in Excel 2010 + * + * @param cellAddress $cellAddress The cell address of the current cell (containing this formula) + * @param PHPExcel_Cell $pCell The current cell (containing this formula) + * @return mixed The cells referenced by cellAddress + * + * @todo Support for the optional a1 parameter introduced in Excel 2010 + * + */ + public static function INDIRECT($cellAddress = null, PHPExcel_Cell $pCell = null) + { + $cellAddress = PHPExcel_Calculation_Functions::flattenSingleValue($cellAddress); + if (is_null($cellAddress) || $cellAddress === '') { + return PHPExcel_Calculation_Functions::REF(); + } + + $cellAddress1 = $cellAddress; + $cellAddress2 = null; + if (strpos($cellAddress, ':') !== false) { + list($cellAddress1, $cellAddress2) = explode(':', $cellAddress); + } + + if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress1, $matches)) || + ((!is_null($cellAddress2)) && (!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress2, $matches)))) { + if (!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $cellAddress1, $matches)) { + return PHPExcel_Calculation_Functions::REF(); + } + + if (strpos($cellAddress, '!') !== false) { + list($sheetName, $cellAddress) = explode('!', $cellAddress); + $sheetName = trim($sheetName, "'"); + $pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName); + } else { + $pSheet = $pCell->getWorksheet(); + } + + return PHPExcel_Calculation::getInstance()->extractNamedRange($cellAddress, $pSheet, false); + } + + if (strpos($cellAddress, '!') !== false) { + list($sheetName, $cellAddress) = explode('!', $cellAddress); + $sheetName = trim($sheetName, "'"); + $pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName); + } else { + $pSheet = $pCell->getWorksheet(); + } + + return PHPExcel_Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false); + } + + + /** + * OFFSET + * + * Returns a reference to a range that is a specified number of rows and columns from a cell or range of cells. + * The reference that is returned can be a single cell or a range of cells. You can specify the number of rows and + * the number of columns to be returned. + * + * Excel Function: + * =OFFSET(cellAddress, rows, cols, [height], [width]) + * + * @param cellAddress The reference from which you want to base the offset. Reference must refer to a cell or + * range of adjacent cells; otherwise, OFFSET returns the #VALUE! error value. + * @param rows The number of rows, up or down, that you want the upper-left cell to refer to. + * Using 5 as the rows argument specifies that the upper-left cell in the reference is + * five rows below reference. Rows can be positive (which means below the starting reference) + * or negative (which means above the starting reference). + * @param cols The number of columns, to the left or right, that you want the upper-left cell of the result + * to refer to. Using 5 as the cols argument specifies that the upper-left cell in the + * reference is five columns to the right of reference. Cols can be positive (which means + * to the right of the starting reference) or negative (which means to the left of the + * starting reference). + * @param height The height, in number of rows, that you want the returned reference to be. Height must be a positive number. + * @param width The width, in number of columns, that you want the returned reference to be. Width must be a positive number. + * @return string A reference to a cell or range of cells + */ + public static function OFFSET($cellAddress = null, $rows = 0, $columns = 0, $height = null, $width = null) + { + $rows = PHPExcel_Calculation_Functions::flattenSingleValue($rows); + $columns = PHPExcel_Calculation_Functions::flattenSingleValue($columns); + $height = PHPExcel_Calculation_Functions::flattenSingleValue($height); + $width = PHPExcel_Calculation_Functions::flattenSingleValue($width); + if ($cellAddress == null) { + return 0; + } + + $args = func_get_args(); + $pCell = array_pop($args); + if (!is_object($pCell)) { + return PHPExcel_Calculation_Functions::REF(); + } + + $sheetName = null; + if (strpos($cellAddress, "!")) { + list($sheetName, $cellAddress) = explode("!", $cellAddress); + $sheetName = trim($sheetName, "'"); + } + if (strpos($cellAddress, ":")) { + list($startCell, $endCell) = explode(":", $cellAddress); + } else { + $startCell = $endCell = $cellAddress; + } + list($startCellColumn, $startCellRow) = PHPExcel_Cell::coordinateFromString($startCell); + list($endCellColumn, $endCellRow) = PHPExcel_Cell::coordinateFromString($endCell); + + $startCellRow += $rows; + $startCellColumn = PHPExcel_Cell::columnIndexFromString($startCellColumn) - 1; + $startCellColumn += $columns; + + if (($startCellRow <= 0) || ($startCellColumn < 0)) { + return PHPExcel_Calculation_Functions::REF(); + } + $endCellColumn = PHPExcel_Cell::columnIndexFromString($endCellColumn) - 1; + if (($width != null) && (!is_object($width))) { + $endCellColumn = $startCellColumn + $width - 1; + } else { + $endCellColumn += $columns; + } + $startCellColumn = PHPExcel_Cell::stringFromColumnIndex($startCellColumn); + + if (($height != null) && (!is_object($height))) { + $endCellRow = $startCellRow + $height - 1; + } else { + $endCellRow += $rows; + } + + if (($endCellRow <= 0) || ($endCellColumn < 0)) { + return PHPExcel_Calculation_Functions::REF(); + } + $endCellColumn = PHPExcel_Cell::stringFromColumnIndex($endCellColumn); + + $cellAddress = $startCellColumn.$startCellRow; + if (($startCellColumn != $endCellColumn) || ($startCellRow != $endCellRow)) { + $cellAddress .= ':'.$endCellColumn.$endCellRow; + } + + if ($sheetName !== null) { + $pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName); + } else { + $pSheet = $pCell->getWorksheet(); + } + + return PHPExcel_Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false); + } + + + /** + * CHOOSE + * + * Uses lookup_value to return a value from the list of value arguments. + * Use CHOOSE to select one of up to 254 values based on the lookup_value. + * + * Excel Function: + * =CHOOSE(index_num, value1, [value2], ...) + * + * @param index_num Specifies which value argument is selected. + * Index_num must be a number between 1 and 254, or a formula or reference to a cell containing a number + * between 1 and 254. + * @param value1... Value1 is required, subsequent values are optional. + * Between 1 to 254 value arguments from which CHOOSE selects a value or an action to perform based on + * index_num. The arguments can be numbers, cell references, defined names, formulas, functions, or + * text. + * @return mixed The selected value + */ + public static function CHOOSE() + { + $chooseArgs = func_get_args(); + $chosenEntry = PHPExcel_Calculation_Functions::flattenArray(array_shift($chooseArgs)); + $entryCount = count($chooseArgs) - 1; + + if (is_array($chosenEntry)) { + $chosenEntry = array_shift($chosenEntry); + } + if ((is_numeric($chosenEntry)) && (!is_bool($chosenEntry))) { + --$chosenEntry; + } else { + return PHPExcel_Calculation_Functions::VALUE(); + } + $chosenEntry = floor($chosenEntry); + if (($chosenEntry < 0) || ($chosenEntry > $entryCount)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + if (is_array($chooseArgs[$chosenEntry])) { + return PHPExcel_Calculation_Functions::flattenArray($chooseArgs[$chosenEntry]); + } else { + return $chooseArgs[$chosenEntry]; + } + } + + + /** + * MATCH + * + * The MATCH function searches for a specified item in a range of cells + * + * Excel Function: + * =MATCH(lookup_value, lookup_array, [match_type]) + * + * @param lookup_value The value that you want to match in lookup_array + * @param lookup_array The range of cells being searched + * @param match_type The number -1, 0, or 1. -1 means above, 0 means exact match, 1 means below. If match_type is 1 or -1, the list has to be ordered. + * @return integer The relative position of the found item + */ + public static function MATCH($lookup_value, $lookup_array, $match_type = 1) + { + $lookup_array = PHPExcel_Calculation_Functions::flattenArray($lookup_array); + $lookup_value = PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value); + $match_type = (is_null($match_type)) ? 1 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($match_type); + // MATCH is not case sensitive + $lookup_value = strtolower($lookup_value); + + // lookup_value type has to be number, text, or logical values + if ((!is_numeric($lookup_value)) && (!is_string($lookup_value)) && (!is_bool($lookup_value))) { + return PHPExcel_Calculation_Functions::NA(); + } + + // match_type is 0, 1 or -1 + if (($match_type !== 0) && ($match_type !== -1) && ($match_type !== 1)) { + return PHPExcel_Calculation_Functions::NA(); + } + + // lookup_array should not be empty + $lookupArraySize = count($lookup_array); + if ($lookupArraySize <= 0) { + return PHPExcel_Calculation_Functions::NA(); + } + + // lookup_array should contain only number, text, or logical values, or empty (null) cells + foreach ($lookup_array as $i => $lookupArrayValue) { + // check the type of the value + if ((!is_numeric($lookupArrayValue)) && (!is_string($lookupArrayValue)) && + (!is_bool($lookupArrayValue)) && (!is_null($lookupArrayValue))) { + return PHPExcel_Calculation_Functions::NA(); + } + // convert strings to lowercase for case-insensitive testing + if (is_string($lookupArrayValue)) { + $lookup_array[$i] = strtolower($lookupArrayValue); + } + if ((is_null($lookupArrayValue)) && (($match_type == 1) || ($match_type == -1))) { + $lookup_array = array_slice($lookup_array, 0, $i-1); + } + } + + // if match_type is 1 or -1, the list has to be ordered + if ($match_type == 1) { + asort($lookup_array); + $keySet = array_keys($lookup_array); + } elseif ($match_type == -1) { + arsort($lookup_array); + $keySet = array_keys($lookup_array); + } + + // ** + // find the match + // ** + foreach ($lookup_array as $i => $lookupArrayValue) { + if (($match_type == 0) && ($lookupArrayValue == $lookup_value)) { + // exact match + return ++$i; + } elseif (($match_type == -1) && ($lookupArrayValue <= $lookup_value)) { + $i = array_search($i, $keySet); + // if match_type is -1 <=> find the smallest value that is greater than or equal to lookup_value + if ($i < 1) { + // 1st cell was already smaller than the lookup_value + break; + } else { + // the previous cell was the match + return $keySet[$i-1]+1; + } + } elseif (($match_type == 1) && ($lookupArrayValue >= $lookup_value)) { + $i = array_search($i, $keySet); + // if match_type is 1 <=> find the largest value that is less than or equal to lookup_value + if ($i < 1) { + // 1st cell was already bigger than the lookup_value + break; + } else { + // the previous cell was the match + return $keySet[$i-1]+1; + } + } + } + + // unsuccessful in finding a match, return #N/A error value + return PHPExcel_Calculation_Functions::NA(); + } + + + /** + * INDEX + * + * Uses an index to choose a value from a reference or array + * + * Excel Function: + * =INDEX(range_array, row_num, [column_num]) + * + * @param range_array A range of cells or an array constant + * @param row_num The row in array from which to return a value. If row_num is omitted, column_num is required. + * @param column_num The column in array from which to return a value. If column_num is omitted, row_num is required. + * @return mixed the value of a specified cell or array of cells + */ + public static function INDEX($arrayValues, $rowNum = 0, $columnNum = 0) + { + if (($rowNum < 0) || ($columnNum < 0)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + if (!is_array($arrayValues)) { + return PHPExcel_Calculation_Functions::REF(); + } + + $rowKeys = array_keys($arrayValues); + $columnKeys = @array_keys($arrayValues[$rowKeys[0]]); + + if ($columnNum > count($columnKeys)) { + return PHPExcel_Calculation_Functions::VALUE(); + } elseif ($columnNum == 0) { + if ($rowNum == 0) { + return $arrayValues; + } + $rowNum = $rowKeys[--$rowNum]; + $returnArray = array(); + foreach ($arrayValues as $arrayColumn) { + if (is_array($arrayColumn)) { + if (isset($arrayColumn[$rowNum])) { + $returnArray[] = $arrayColumn[$rowNum]; + } else { + return $arrayValues[$rowNum]; + } + } else { + return $arrayValues[$rowNum]; + } + } + return $returnArray; + } + $columnNum = $columnKeys[--$columnNum]; + if ($rowNum > count($rowKeys)) { + return PHPExcel_Calculation_Functions::VALUE(); + } elseif ($rowNum == 0) { + return $arrayValues[$columnNum]; + } + $rowNum = $rowKeys[--$rowNum]; + + return $arrayValues[$rowNum][$columnNum]; + } + + + /** + * TRANSPOSE + * + * @param array $matrixData A matrix of values + * @return array + * + * Unlike the Excel TRANSPOSE function, which will only work on a single row or column, this function will transpose a full matrix. + */ + public static function TRANSPOSE($matrixData) + { + $returnMatrix = array(); + if (!is_array($matrixData)) { + $matrixData = array(array($matrixData)); + } + + $column = 0; + foreach ($matrixData as $matrixRow) { + $row = 0; + foreach ($matrixRow as $matrixCell) { + $returnMatrix[$row][$column] = $matrixCell; + ++$row; + } + ++$column; + } + return $returnMatrix; + } + + + private static function vlookupSort($a, $b) + { + reset($a); + $firstColumn = key($a); + if (($aLower = strtolower($a[$firstColumn])) == ($bLower = strtolower($b[$firstColumn]))) { + return 0; + } + return ($aLower < $bLower) ? -1 : 1; + } + + + /** + * VLOOKUP + * The VLOOKUP function searches for value in the left-most column of lookup_array and returns the value in the same row based on the index_number. + * @param lookup_value The value that you want to match in lookup_array + * @param lookup_array The range of cells being searched + * @param index_number The column number in table_array from which the matching value must be returned. The first column is 1. + * @param not_exact_match Determines if you are looking for an exact match based on lookup_value. + * @return mixed The value of the found cell + */ + public static function VLOOKUP($lookup_value, $lookup_array, $index_number, $not_exact_match = true) + { + $lookup_value = PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value); + $index_number = PHPExcel_Calculation_Functions::flattenSingleValue($index_number); + $not_exact_match = PHPExcel_Calculation_Functions::flattenSingleValue($not_exact_match); + + // index_number must be greater than or equal to 1 + if ($index_number < 1) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + // index_number must be less than or equal to the number of columns in lookup_array + if ((!is_array($lookup_array)) || (empty($lookup_array))) { + return PHPExcel_Calculation_Functions::REF(); + } else { + $f = array_keys($lookup_array); + $firstRow = array_pop($f); + if ((!is_array($lookup_array[$firstRow])) || ($index_number > count($lookup_array[$firstRow]))) { + return PHPExcel_Calculation_Functions::REF(); + } else { + $columnKeys = array_keys($lookup_array[$firstRow]); + $returnColumn = $columnKeys[--$index_number]; + $firstColumn = array_shift($columnKeys); + } + } + + if (!$not_exact_match) { + uasort($lookup_array, array('self', 'vlookupSort')); + } + + $rowNumber = $rowValue = false; + foreach ($lookup_array as $rowKey => $rowData) { + if ((is_numeric($lookup_value) && is_numeric($rowData[$firstColumn]) && ($rowData[$firstColumn] > $lookup_value)) || + (!is_numeric($lookup_value) && !is_numeric($rowData[$firstColumn]) && (strtolower($rowData[$firstColumn]) > strtolower($lookup_value)))) { + break; + } + $rowNumber = $rowKey; + $rowValue = $rowData[$firstColumn]; + } + + if ($rowNumber !== false) { + if ((!$not_exact_match) && ($rowValue != $lookup_value)) { + // if an exact match is required, we have what we need to return an appropriate response + return PHPExcel_Calculation_Functions::NA(); + } else { + // otherwise return the appropriate value + return $lookup_array[$rowNumber][$returnColumn]; + } + } + + return PHPExcel_Calculation_Functions::NA(); + } + + + /** + * HLOOKUP + * The HLOOKUP function searches for value in the top-most row of lookup_array and returns the value in the same column based on the index_number. + * @param lookup_value The value that you want to match in lookup_array + * @param lookup_array The range of cells being searched + * @param index_number The row number in table_array from which the matching value must be returned. The first row is 1. + * @param not_exact_match Determines if you are looking for an exact match based on lookup_value. + * @return mixed The value of the found cell + */ + public static function HLOOKUP($lookup_value, $lookup_array, $index_number, $not_exact_match = true) + { + $lookup_value = PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value); + $index_number = PHPExcel_Calculation_Functions::flattenSingleValue($index_number); + $not_exact_match = PHPExcel_Calculation_Functions::flattenSingleValue($not_exact_match); + + // index_number must be greater than or equal to 1 + if ($index_number < 1) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + // index_number must be less than or equal to the number of columns in lookup_array + if ((!is_array($lookup_array)) || (empty($lookup_array))) { + return PHPExcel_Calculation_Functions::REF(); + } else { + $f = array_keys($lookup_array); + $firstRow = array_pop($f); + if ((!is_array($lookup_array[$firstRow])) || ($index_number > count($lookup_array[$firstRow]))) { + return PHPExcel_Calculation_Functions::REF(); + } else { + $columnKeys = array_keys($lookup_array[$firstRow]); + $firstkey = $f[0] - 1; + $returnColumn = $firstkey + $index_number; + $firstColumn = array_shift($f); + } + } + + if (!$not_exact_match) { + $firstRowH = asort($lookup_array[$firstColumn]); + } + + $rowNumber = $rowValue = false; + foreach ($lookup_array[$firstColumn] as $rowKey => $rowData) { + if ((is_numeric($lookup_value) && is_numeric($rowData) && ($rowData > $lookup_value)) || + (!is_numeric($lookup_value) && !is_numeric($rowData) && (strtolower($rowData) > strtolower($lookup_value)))) { + break; + } + $rowNumber = $rowKey; + $rowValue = $rowData; + } + + if ($rowNumber !== false) { + if ((!$not_exact_match) && ($rowValue != $lookup_value)) { + // if an exact match is required, we have what we need to return an appropriate response + return PHPExcel_Calculation_Functions::NA(); + } else { + // otherwise return the appropriate value + return $lookup_array[$returnColumn][$rowNumber]; + } + } + + return PHPExcel_Calculation_Functions::NA(); + } + + + /** + * LOOKUP + * The LOOKUP function searches for value either from a one-row or one-column range or from an array. + * @param lookup_value The value that you want to match in lookup_array + * @param lookup_vector The range of cells being searched + * @param result_vector The column from which the matching value must be returned + * @return mixed The value of the found cell + */ + public static function LOOKUP($lookup_value, $lookup_vector, $result_vector = null) + { + $lookup_value = PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value); + + if (!is_array($lookup_vector)) { + return PHPExcel_Calculation_Functions::NA(); + } + $lookupRows = count($lookup_vector); + $l = array_keys($lookup_vector); + $l = array_shift($l); + $lookupColumns = count($lookup_vector[$l]); + if ((($lookupRows == 1) && ($lookupColumns > 1)) || (($lookupRows == 2) && ($lookupColumns != 2))) { + $lookup_vector = self::TRANSPOSE($lookup_vector); + $lookupRows = count($lookup_vector); + $l = array_keys($lookup_vector); + $lookupColumns = count($lookup_vector[array_shift($l)]); + } + + if (is_null($result_vector)) { + $result_vector = $lookup_vector; + } + $resultRows = count($result_vector); + $l = array_keys($result_vector); + $l = array_shift($l); + $resultColumns = count($result_vector[$l]); + if ((($resultRows == 1) && ($resultColumns > 1)) || (($resultRows == 2) && ($resultColumns != 2))) { + $result_vector = self::TRANSPOSE($result_vector); + $resultRows = count($result_vector); + $r = array_keys($result_vector); + $resultColumns = count($result_vector[array_shift($r)]); + } + + if ($lookupRows == 2) { + $result_vector = array_pop($lookup_vector); + $lookup_vector = array_shift($lookup_vector); + } + if ($lookupColumns != 2) { + foreach ($lookup_vector as &$value) { + if (is_array($value)) { + $k = array_keys($value); + $key1 = $key2 = array_shift($k); + $key2++; + $dataValue1 = $value[$key1]; + } else { + $key1 = 0; + $key2 = 1; + $dataValue1 = $value; + } + $dataValue2 = array_shift($result_vector); + if (is_array($dataValue2)) { + $dataValue2 = array_shift($dataValue2); + } + $value = array($key1 => $dataValue1, $key2 => $dataValue2); + } + unset($value); + } + + return self::VLOOKUP($lookup_value, $lookup_vector, 2); + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation/MathTrig.php b/extend/PHPExcel/PHPExcel/Calculation/MathTrig.php new file mode 100644 index 0000000..894ba9c --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation/MathTrig.php @@ -0,0 +1,1459 @@ + 1; --$i) { + if (($value % $i) == 0) { + $factorArray = array_merge($factorArray, self::factors($value / $i)); + $factorArray = array_merge($factorArray, self::factors($i)); + if ($i <= sqrt($value)) { + break; + } + } + } + if (!empty($factorArray)) { + rsort($factorArray); + return $factorArray; + } else { + return array((integer) $value); + } + } + + + private static function romanCut($num, $n) + { + return ($num - ($num % $n ) ) / $n; + } + + + /** + * ATAN2 + * + * This function calculates the arc tangent of the two variables x and y. It is similar to + * calculating the arc tangent of y ÷ x, except that the signs of both arguments are used + * to determine the quadrant of the result. + * The arctangent is the angle from the x-axis to a line containing the origin (0, 0) and a + * point with coordinates (xCoordinate, yCoordinate). The angle is given in radians between + * -pi and pi, excluding -pi. + * + * Note that the Excel ATAN2() function accepts its arguments in the reverse order to the standard + * PHP atan2() function, so we need to reverse them here before calling the PHP atan() function. + * + * Excel Function: + * ATAN2(xCoordinate,yCoordinate) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param float $xCoordinate The x-coordinate of the point. + * @param float $yCoordinate The y-coordinate of the point. + * @return float The inverse tangent of the specified x- and y-coordinates. + */ + public static function ATAN2($xCoordinate = null, $yCoordinate = null) + { + $xCoordinate = PHPExcel_Calculation_Functions::flattenSingleValue($xCoordinate); + $yCoordinate = PHPExcel_Calculation_Functions::flattenSingleValue($yCoordinate); + + $xCoordinate = ($xCoordinate !== null) ? $xCoordinate : 0.0; + $yCoordinate = ($yCoordinate !== null) ? $yCoordinate : 0.0; + + if (((is_numeric($xCoordinate)) || (is_bool($xCoordinate))) && + ((is_numeric($yCoordinate))) || (is_bool($yCoordinate))) { + $xCoordinate = (float) $xCoordinate; + $yCoordinate = (float) $yCoordinate; + + if (($xCoordinate == 0) && ($yCoordinate == 0)) { + return PHPExcel_Calculation_Functions::DIV0(); + } + + return atan2($yCoordinate, $xCoordinate); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * CEILING + * + * Returns number rounded up, away from zero, to the nearest multiple of significance. + * For example, if you want to avoid using pennies in your prices and your product is + * priced at $4.42, use the formula =CEILING(4.42,0.05) to round prices up to the + * nearest nickel. + * + * Excel Function: + * CEILING(number[,significance]) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param float $number The number you want to round. + * @param float $significance The multiple to which you want to round. + * @return float Rounded Number + */ + public static function CEILING($number, $significance = null) + { + $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); + $significance = PHPExcel_Calculation_Functions::flattenSingleValue($significance); + + if ((is_null($significance)) && + (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC)) { + $significance = $number / abs($number); + } + + if ((is_numeric($number)) && (is_numeric($significance))) { + if (($number == 0.0 ) || ($significance == 0.0)) { + return 0.0; + } elseif (self::SIGN($number) == self::SIGN($significance)) { + return ceil($number / $significance) * $significance; + } else { + return PHPExcel_Calculation_Functions::NaN(); + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * COMBIN + * + * Returns the number of combinations for a given number of items. Use COMBIN to + * determine the total possible number of groups for a given number of items. + * + * Excel Function: + * COMBIN(numObjs,numInSet) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param int $numObjs Number of different objects + * @param int $numInSet Number of objects in each combination + * @return int Number of combinations + */ + public static function COMBIN($numObjs, $numInSet) + { + $numObjs = PHPExcel_Calculation_Functions::flattenSingleValue($numObjs); + $numInSet = PHPExcel_Calculation_Functions::flattenSingleValue($numInSet); + + if ((is_numeric($numObjs)) && (is_numeric($numInSet))) { + if ($numObjs < $numInSet) { + return PHPExcel_Calculation_Functions::NaN(); + } elseif ($numInSet < 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + return round(self::FACT($numObjs) / self::FACT($numObjs - $numInSet)) / self::FACT($numInSet); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * EVEN + * + * Returns number rounded up to the nearest even integer. + * You can use this function for processing items that come in twos. For example, + * a packing crate accepts rows of one or two items. The crate is full when + * the number of items, rounded up to the nearest two, matches the crate's + * capacity. + * + * Excel Function: + * EVEN(number) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param float $number Number to round + * @return int Rounded Number + */ + public static function EVEN($number) + { + $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); + + if (is_null($number)) { + return 0; + } elseif (is_bool($number)) { + $number = (int) $number; + } + + if (is_numeric($number)) { + $significance = 2 * self::SIGN($number); + return (int) self::CEILING($number, $significance); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * FACT + * + * Returns the factorial of a number. + * The factorial of a number is equal to 1*2*3*...* number. + * + * Excel Function: + * FACT(factVal) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param float $factVal Factorial Value + * @return int Factorial + */ + public static function FACT($factVal) + { + $factVal = PHPExcel_Calculation_Functions::flattenSingleValue($factVal); + + if (is_numeric($factVal)) { + if ($factVal < 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + $factLoop = floor($factVal); + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { + if ($factVal > $factLoop) { + return PHPExcel_Calculation_Functions::NaN(); + } + } + + $factorial = 1; + while ($factLoop > 1) { + $factorial *= $factLoop--; + } + return $factorial ; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * FACTDOUBLE + * + * Returns the double factorial of a number. + * + * Excel Function: + * FACTDOUBLE(factVal) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param float $factVal Factorial Value + * @return int Double Factorial + */ + public static function FACTDOUBLE($factVal) + { + $factLoop = PHPExcel_Calculation_Functions::flattenSingleValue($factVal); + + if (is_numeric($factLoop)) { + $factLoop = floor($factLoop); + if ($factVal < 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + $factorial = 1; + while ($factLoop > 1) { + $factorial *= $factLoop--; + --$factLoop; + } + return $factorial ; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * FLOOR + * + * Rounds number down, toward zero, to the nearest multiple of significance. + * + * Excel Function: + * FLOOR(number[,significance]) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param float $number Number to round + * @param float $significance Significance + * @return float Rounded Number + */ + public static function FLOOR($number, $significance = null) + { + $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); + $significance = PHPExcel_Calculation_Functions::flattenSingleValue($significance); + + if ((is_null($significance)) && + (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC)) { + $significance = $number/abs($number); + } + + if ((is_numeric($number)) && (is_numeric($significance))) { + if ($significance == 0.0) { + return PHPExcel_Calculation_Functions::DIV0(); + } elseif ($number == 0.0) { + return 0.0; + } elseif (self::SIGN($number) == self::SIGN($significance)) { + return floor($number / $significance) * $significance; + } else { + return PHPExcel_Calculation_Functions::NaN(); + } + } + + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * GCD + * + * Returns the greatest common divisor of a series of numbers. + * The greatest common divisor is the largest integer that divides both + * number1 and number2 without a remainder. + * + * Excel Function: + * GCD(number1[,number2[, ...]]) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param mixed $arg,... Data values + * @return integer Greatest Common Divisor + */ + public static function GCD() + { + $returnValue = 1; + $allValuesFactors = array(); + // Loop through arguments + foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $value) { + if (!is_numeric($value)) { + return PHPExcel_Calculation_Functions::VALUE(); + } elseif ($value == 0) { + continue; + } elseif ($value < 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + $myFactors = self::factors($value); + $myCountedFactors = array_count_values($myFactors); + $allValuesFactors[] = $myCountedFactors; + } + $allValuesCount = count($allValuesFactors); + if ($allValuesCount == 0) { + return 0; + } + + $mergedArray = $allValuesFactors[0]; + for ($i=1; $i < $allValuesCount; ++$i) { + $mergedArray = array_intersect_key($mergedArray, $allValuesFactors[$i]); + } + $mergedArrayValues = count($mergedArray); + if ($mergedArrayValues == 0) { + return $returnValue; + } elseif ($mergedArrayValues > 1) { + foreach ($mergedArray as $mergedKey => $mergedValue) { + foreach ($allValuesFactors as $highestPowerTest) { + foreach ($highestPowerTest as $testKey => $testValue) { + if (($testKey == $mergedKey) && ($testValue < $mergedValue)) { + $mergedArray[$mergedKey] = $testValue; + $mergedValue = $testValue; + } + } + } + } + + $returnValue = 1; + foreach ($mergedArray as $key => $value) { + $returnValue *= pow($key, $value); + } + return $returnValue; + } else { + $keys = array_keys($mergedArray); + $key = $keys[0]; + $value = $mergedArray[$key]; + foreach ($allValuesFactors as $testValue) { + foreach ($testValue as $mergedKey => $mergedValue) { + if (($mergedKey == $key) && ($mergedValue < $value)) { + $value = $mergedValue; + } + } + } + return pow($key, $value); + } + } + + + /** + * INT + * + * Casts a floating point value to an integer + * + * Excel Function: + * INT(number) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param float $number Number to cast to an integer + * @return integer Integer value + */ + public static function INT($number) + { + $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); + + if (is_null($number)) { + return 0; + } elseif (is_bool($number)) { + return (int) $number; + } + if (is_numeric($number)) { + return (int) floor($number); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * LCM + * + * Returns the lowest common multiplier of a series of numbers + * The least common multiple is the smallest positive integer that is a multiple + * of all integer arguments number1, number2, and so on. Use LCM to add fractions + * with different denominators. + * + * Excel Function: + * LCM(number1[,number2[, ...]]) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param mixed $arg,... Data values + * @return int Lowest Common Multiplier + */ + public static function LCM() + { + $returnValue = 1; + $allPoweredFactors = array(); + // Loop through arguments + foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $value) { + if (!is_numeric($value)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if ($value == 0) { + return 0; + } elseif ($value < 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + $myFactors = self::factors(floor($value)); + $myCountedFactors = array_count_values($myFactors); + $myPoweredFactors = array(); + foreach ($myCountedFactors as $myCountedFactor => $myCountedPower) { + $myPoweredFactors[$myCountedFactor] = pow($myCountedFactor, $myCountedPower); + } + foreach ($myPoweredFactors as $myPoweredValue => $myPoweredFactor) { + if (array_key_exists($myPoweredValue, $allPoweredFactors)) { + if ($allPoweredFactors[$myPoweredValue] < $myPoweredFactor) { + $allPoweredFactors[$myPoweredValue] = $myPoweredFactor; + } + } else { + $allPoweredFactors[$myPoweredValue] = $myPoweredFactor; + } + } + } + foreach ($allPoweredFactors as $allPoweredFactor) { + $returnValue *= (integer) $allPoweredFactor; + } + return $returnValue; + } + + + /** + * LOG_BASE + * + * Returns the logarithm of a number to a specified base. The default base is 10. + * + * Excel Function: + * LOG(number[,base]) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param float $number The positive real number for which you want the logarithm + * @param float $base The base of the logarithm. If base is omitted, it is assumed to be 10. + * @return float + */ + public static function LOG_BASE($number = null, $base = 10) + { + $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); + $base = (is_null($base)) ? 10 : (float) PHPExcel_Calculation_Functions::flattenSingleValue($base); + + if ((!is_numeric($base)) || (!is_numeric($number))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if (($base <= 0) || ($number <= 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + return log($number, $base); + } + + + /** + * MDETERM + * + * Returns the matrix determinant of an array. + * + * Excel Function: + * MDETERM(array) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param array $matrixValues A matrix of values + * @return float + */ + public static function MDETERM($matrixValues) + { + $matrixData = array(); + if (!is_array($matrixValues)) { + $matrixValues = array(array($matrixValues)); + } + + $row = $maxColumn = 0; + foreach ($matrixValues as $matrixRow) { + if (!is_array($matrixRow)) { + $matrixRow = array($matrixRow); + } + $column = 0; + foreach ($matrixRow as $matrixCell) { + if ((is_string($matrixCell)) || ($matrixCell === null)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $matrixData[$column][$row] = $matrixCell; + ++$column; + } + if ($column > $maxColumn) { + $maxColumn = $column; + } + ++$row; + } + if ($row != $maxColumn) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + try { + $matrix = new PHPExcel_Shared_JAMA_Matrix($matrixData); + return $matrix->det(); + } catch (PHPExcel_Exception $ex) { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + + + /** + * MINVERSE + * + * Returns the inverse matrix for the matrix stored in an array. + * + * Excel Function: + * MINVERSE(array) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param array $matrixValues A matrix of values + * @return array + */ + public static function MINVERSE($matrixValues) + { + $matrixData = array(); + if (!is_array($matrixValues)) { + $matrixValues = array(array($matrixValues)); + } + + $row = $maxColumn = 0; + foreach ($matrixValues as $matrixRow) { + if (!is_array($matrixRow)) { + $matrixRow = array($matrixRow); + } + $column = 0; + foreach ($matrixRow as $matrixCell) { + if ((is_string($matrixCell)) || ($matrixCell === null)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $matrixData[$column][$row] = $matrixCell; + ++$column; + } + if ($column > $maxColumn) { + $maxColumn = $column; + } + ++$row; + } + if ($row != $maxColumn) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + try { + $matrix = new PHPExcel_Shared_JAMA_Matrix($matrixData); + return $matrix->inverse()->getArray(); + } catch (PHPExcel_Exception $ex) { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + + + /** + * MMULT + * + * @param array $matrixData1 A matrix of values + * @param array $matrixData2 A matrix of values + * @return array + */ + public static function MMULT($matrixData1, $matrixData2) + { + $matrixAData = $matrixBData = array(); + if (!is_array($matrixData1)) { + $matrixData1 = array(array($matrixData1)); + } + if (!is_array($matrixData2)) { + $matrixData2 = array(array($matrixData2)); + } + + try { + $rowA = 0; + foreach ($matrixData1 as $matrixRow) { + if (!is_array($matrixRow)) { + $matrixRow = array($matrixRow); + } + $columnA = 0; + foreach ($matrixRow as $matrixCell) { + if ((!is_numeric($matrixCell)) || ($matrixCell === null)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $matrixAData[$rowA][$columnA] = $matrixCell; + ++$columnA; + } + ++$rowA; + } + $matrixA = new PHPExcel_Shared_JAMA_Matrix($matrixAData); + $rowB = 0; + foreach ($matrixData2 as $matrixRow) { + if (!is_array($matrixRow)) { + $matrixRow = array($matrixRow); + } + $columnB = 0; + foreach ($matrixRow as $matrixCell) { + if ((!is_numeric($matrixCell)) || ($matrixCell === null)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $matrixBData[$rowB][$columnB] = $matrixCell; + ++$columnB; + } + ++$rowB; + } + $matrixB = new PHPExcel_Shared_JAMA_Matrix($matrixBData); + + if ($columnA != $rowB) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + return $matrixA->times($matrixB)->getArray(); + } catch (PHPExcel_Exception $ex) { + var_dump($ex->getMessage()); + return PHPExcel_Calculation_Functions::VALUE(); + } + } + + + /** + * MOD + * + * @param int $a Dividend + * @param int $b Divisor + * @return int Remainder + */ + public static function MOD($a = 1, $b = 1) + { + $a = PHPExcel_Calculation_Functions::flattenSingleValue($a); + $b = PHPExcel_Calculation_Functions::flattenSingleValue($b); + + if ($b == 0.0) { + return PHPExcel_Calculation_Functions::DIV0(); + } elseif (($a < 0.0) && ($b > 0.0)) { + return $b - fmod(abs($a), $b); + } elseif (($a > 0.0) && ($b < 0.0)) { + return $b + fmod($a, abs($b)); + } + + return fmod($a, $b); + } + + + /** + * MROUND + * + * Rounds a number to the nearest multiple of a specified value + * + * @param float $number Number to round + * @param int $multiple Multiple to which you want to round $number + * @return float Rounded Number + */ + public static function MROUND($number, $multiple) + { + $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); + $multiple = PHPExcel_Calculation_Functions::flattenSingleValue($multiple); + + if ((is_numeric($number)) && (is_numeric($multiple))) { + if ($multiple == 0) { + return 0; + } + if ((self::SIGN($number)) == (self::SIGN($multiple))) { + $multiplier = 1 / $multiple; + return round($number * $multiplier) / $multiplier; + } + return PHPExcel_Calculation_Functions::NaN(); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * MULTINOMIAL + * + * Returns the ratio of the factorial of a sum of values to the product of factorials. + * + * @param array of mixed Data Series + * @return float + */ + public static function MULTINOMIAL() + { + $summer = 0; + $divisor = 1; + // Loop through arguments + foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) { + // Is it a numeric value? + if (is_numeric($arg)) { + if ($arg < 1) { + return PHPExcel_Calculation_Functions::NaN(); + } + $summer += floor($arg); + $divisor *= self::FACT($arg); + } else { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + + // Return + if ($summer > 0) { + $summer = self::FACT($summer); + return $summer / $divisor; + } + return 0; + } + + + /** + * ODD + * + * Returns number rounded up to the nearest odd integer. + * + * @param float $number Number to round + * @return int Rounded Number + */ + public static function ODD($number) + { + $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); + + if (is_null($number)) { + return 1; + } elseif (is_bool($number)) { + return 1; + } elseif (is_numeric($number)) { + $significance = self::SIGN($number); + if ($significance == 0) { + return 1; + } + + $result = self::CEILING($number, $significance); + if ($result == self::EVEN($result)) { + $result += $significance; + } + + return (int) $result; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * POWER + * + * Computes x raised to the power y. + * + * @param float $x + * @param float $y + * @return float + */ + public static function POWER($x = 0, $y = 2) + { + $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); + $y = PHPExcel_Calculation_Functions::flattenSingleValue($y); + + // Validate parameters + if ($x == 0.0 && $y == 0.0) { + return PHPExcel_Calculation_Functions::NaN(); + } elseif ($x == 0.0 && $y < 0.0) { + return PHPExcel_Calculation_Functions::DIV0(); + } + + // Return + $result = pow($x, $y); + return (!is_nan($result) && !is_infinite($result)) ? $result : PHPExcel_Calculation_Functions::NaN(); + } + + + /** + * PRODUCT + * + * PRODUCT returns the product of all the values and cells referenced in the argument list. + * + * Excel Function: + * PRODUCT(value1[,value2[, ...]]) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function PRODUCT() + { + // Return value + $returnValue = null; + + // Loop through arguments + foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) { + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + if (is_null($returnValue)) { + $returnValue = $arg; + } else { + $returnValue *= $arg; + } + } + } + + // Return + if (is_null($returnValue)) { + return 0; + } + return $returnValue; + } + + + /** + * QUOTIENT + * + * QUOTIENT function returns the integer portion of a division. Numerator is the divided number + * and denominator is the divisor. + * + * Excel Function: + * QUOTIENT(value1[,value2[, ...]]) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function QUOTIENT() + { + // Return value + $returnValue = null; + + // Loop through arguments + foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) { + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + if (is_null($returnValue)) { + $returnValue = ($arg == 0) ? 0 : $arg; + } else { + if (($returnValue == 0) || ($arg == 0)) { + $returnValue = 0; + } else { + $returnValue /= $arg; + } + } + } + } + + // Return + return intval($returnValue); + } + + + /** + * RAND + * + * @param int $min Minimal value + * @param int $max Maximal value + * @return int Random number + */ + public static function RAND($min = 0, $max = 0) + { + $min = PHPExcel_Calculation_Functions::flattenSingleValue($min); + $max = PHPExcel_Calculation_Functions::flattenSingleValue($max); + + if ($min == 0 && $max == 0) { + return (mt_rand(0, 10000000)) / 10000000; + } else { + return mt_rand($min, $max); + } + } + + + public static function ROMAN($aValue, $style = 0) + { + $aValue = PHPExcel_Calculation_Functions::flattenSingleValue($aValue); + $style = (is_null($style)) ? 0 : (integer) PHPExcel_Calculation_Functions::flattenSingleValue($style); + if ((!is_numeric($aValue)) || ($aValue < 0) || ($aValue >= 4000)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $aValue = (integer) $aValue; + if ($aValue == 0) { + return ''; + } + + $mill = array('', 'M', 'MM', 'MMM', 'MMMM', 'MMMMM'); + $cent = array('', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM'); + $tens = array('', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'); + $ones = array('', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'); + + $roman = ''; + while ($aValue > 5999) { + $roman .= 'M'; + $aValue -= 1000; + } + $m = self::romanCut($aValue, 1000); + $aValue %= 1000; + $c = self::romanCut($aValue, 100); + $aValue %= 100; + $t = self::romanCut($aValue, 10); + $aValue %= 10; + + return $roman.$mill[$m].$cent[$c].$tens[$t].$ones[$aValue]; + } + + + /** + * ROUNDUP + * + * Rounds a number up to a specified number of decimal places + * + * @param float $number Number to round + * @param int $digits Number of digits to which you want to round $number + * @return float Rounded Number + */ + public static function ROUNDUP($number, $digits) + { + $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); + $digits = PHPExcel_Calculation_Functions::flattenSingleValue($digits); + + if ((is_numeric($number)) && (is_numeric($digits))) { + $significance = pow(10, (int) $digits); + if ($number < 0.0) { + return floor($number * $significance) / $significance; + } else { + return ceil($number * $significance) / $significance; + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * ROUNDDOWN + * + * Rounds a number down to a specified number of decimal places + * + * @param float $number Number to round + * @param int $digits Number of digits to which you want to round $number + * @return float Rounded Number + */ + public static function ROUNDDOWN($number, $digits) + { + $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); + $digits = PHPExcel_Calculation_Functions::flattenSingleValue($digits); + + if ((is_numeric($number)) && (is_numeric($digits))) { + $significance = pow(10, (int) $digits); + if ($number < 0.0) { + return ceil($number * $significance) / $significance; + } else { + return floor($number * $significance) / $significance; + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * SERIESSUM + * + * Returns the sum of a power series + * + * @param float $x Input value to the power series + * @param float $n Initial power to which you want to raise $x + * @param float $m Step by which to increase $n for each term in the series + * @param array of mixed Data Series + * @return float + */ + public static function SERIESSUM() + { + $returnValue = 0; + + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + + $x = array_shift($aArgs); + $n = array_shift($aArgs); + $m = array_shift($aArgs); + + if ((is_numeric($x)) && (is_numeric($n)) && (is_numeric($m))) { + // Calculate + $i = 0; + foreach ($aArgs as $arg) { + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + $returnValue += $arg * pow($x, $n + ($m * $i++)); + } else { + return PHPExcel_Calculation_Functions::VALUE(); + } + } + return $returnValue; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * SIGN + * + * Determines the sign of a number. Returns 1 if the number is positive, zero (0) + * if the number is 0, and -1 if the number is negative. + * + * @param float $number Number to round + * @return int sign value + */ + public static function SIGN($number) + { + $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); + + if (is_bool($number)) { + return (int) $number; + } + if (is_numeric($number)) { + if ($number == 0.0) { + return 0; + } + return $number / abs($number); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * SQRTPI + * + * Returns the square root of (number * pi). + * + * @param float $number Number + * @return float Square Root of Number * Pi + */ + public static function SQRTPI($number) + { + $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); + + if (is_numeric($number)) { + if ($number < 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + return sqrt($number * M_PI) ; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * SUBTOTAL + * + * Returns a subtotal in a list or database. + * + * @param int the number 1 to 11 that specifies which function to + * use in calculating subtotals within a list. + * @param array of mixed Data Series + * @return float + */ + public static function SUBTOTAL() + { + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + + // Calculate + $subtotal = array_shift($aArgs); + + if ((is_numeric($subtotal)) && (!is_string($subtotal))) { + switch ($subtotal) { + case 1: + return PHPExcel_Calculation_Statistical::AVERAGE($aArgs); + case 2: + return PHPExcel_Calculation_Statistical::COUNT($aArgs); + case 3: + return PHPExcel_Calculation_Statistical::COUNTA($aArgs); + case 4: + return PHPExcel_Calculation_Statistical::MAX($aArgs); + case 5: + return PHPExcel_Calculation_Statistical::MIN($aArgs); + case 6: + return self::PRODUCT($aArgs); + case 7: + return PHPExcel_Calculation_Statistical::STDEV($aArgs); + case 8: + return PHPExcel_Calculation_Statistical::STDEVP($aArgs); + case 9: + return self::SUM($aArgs); + case 10: + return PHPExcel_Calculation_Statistical::VARFunc($aArgs); + case 11: + return PHPExcel_Calculation_Statistical::VARP($aArgs); + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * SUM + * + * SUM computes the sum of all the values and cells referenced in the argument list. + * + * Excel Function: + * SUM(value1[,value2[, ...]]) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function SUM() + { + $returnValue = 0; + + // Loop through the arguments + foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) { + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + $returnValue += $arg; + } + } + + return $returnValue; + } + + + /** + * SUMIF + * + * Counts the number of cells that contain numbers within the list of arguments + * + * Excel Function: + * SUMIF(value1[,value2[, ...]],condition) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param mixed $arg,... Data values + * @param string $condition The criteria that defines which cells will be summed. + * @return float + */ + public static function SUMIF($aArgs, $condition, $sumArgs = array()) + { + $returnValue = 0; + + $aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs); + $sumArgs = PHPExcel_Calculation_Functions::flattenArray($sumArgs); + if (empty($sumArgs)) { + $sumArgs = $aArgs; + } + $condition = PHPExcel_Calculation_Functions::ifCondition($condition); + // Loop through arguments + foreach ($aArgs as $key => $arg) { + if (!is_numeric($arg)) { + $arg = str_replace('"', '""', $arg); + $arg = PHPExcel_Calculation::wrapResult(strtoupper($arg)); + } + + $testCondition = '='.$arg.$condition; + if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + // Is it a value within our criteria + $returnValue += $sumArgs[$key]; + } + } + + return $returnValue; + } + + + /** + * SUMIFS + * + * Counts the number of cells that contain numbers within the list of arguments + * + * Excel Function: + * SUMIFS(value1[,value2[, ...]],condition) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param mixed $arg,... Data values + * @param string $condition The criteria that defines which cells will be summed. + * @return float + */ + public static function SUMIFS() { + $arrayList = func_get_args(); + + $sumArgs = PHPExcel_Calculation_Functions::flattenArray(array_shift($arrayList)); + + while (count($arrayList) > 0) { + $aArgsArray[] = PHPExcel_Calculation_Functions::flattenArray(array_shift($arrayList)); + $conditions[] = PHPExcel_Calculation_Functions::ifCondition(array_shift($arrayList)); + } + + // Loop through each set of arguments and conditions + foreach ($conditions as $index => $condition) { + $aArgs = $aArgsArray[$index]; + $wildcard = false; + if ((strpos($condition, '*') !== false) || (strpos($condition, '?') !== false)) { + // * and ? are wildcard characters. + // Use ~* and ~? for literal star and question mark + // Code logic doesn't yet handle escaping + $condition = trim(ltrim($condition, '=<>'), '"'); + $wildcard = true; + } + // Loop through arguments + foreach ($aArgs as $key => $arg) { + if ($wildcard) { + if (!fnmatch($condition, $arg, FNM_CASEFOLD)) { + // Is it a value within our criteria + $sumArgs[$key] = 0.0; + } + } else { + if (!is_numeric($arg)) { + $arg = PHPExcel_Calculation::wrapResult(strtoupper($arg)); + } + $testCondition = '='.$arg.$condition; + if (!PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + // Is it a value within our criteria + $sumArgs[$key] = 0.0; + } + } + } + } + + // Return + return array_sum($sumArgs); + } + + + /** + * SUMPRODUCT + * + * Excel Function: + * SUMPRODUCT(value1[,value2[, ...]]) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function SUMPRODUCT() + { + $arrayList = func_get_args(); + + $wrkArray = PHPExcel_Calculation_Functions::flattenArray(array_shift($arrayList)); + $wrkCellCount = count($wrkArray); + + for ($i=0; $i< $wrkCellCount; ++$i) { + if ((!is_numeric($wrkArray[$i])) || (is_string($wrkArray[$i]))) { + $wrkArray[$i] = 0; + } + } + + foreach ($arrayList as $matrixData) { + $array2 = PHPExcel_Calculation_Functions::flattenArray($matrixData); + $count = count($array2); + if ($wrkCellCount != $count) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + foreach ($array2 as $i => $val) { + if ((!is_numeric($val)) || (is_string($val))) { + $val = 0; + } + $wrkArray[$i] *= $val; + } + } + + return array_sum($wrkArray); + } + + + /** + * SUMSQ + * + * SUMSQ returns the sum of the squares of the arguments + * + * Excel Function: + * SUMSQ(value1[,value2[, ...]]) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function SUMSQ() + { + $returnValue = 0; + + // Loop through arguments + foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) { + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + $returnValue += ($arg * $arg); + } + } + + return $returnValue; + } + + + /** + * SUMX2MY2 + * + * @param mixed[] $matrixData1 Matrix #1 + * @param mixed[] $matrixData2 Matrix #2 + * @return float + */ + public static function SUMX2MY2($matrixData1, $matrixData2) + { + $array1 = PHPExcel_Calculation_Functions::flattenArray($matrixData1); + $array2 = PHPExcel_Calculation_Functions::flattenArray($matrixData2); + $count = min(count($array1), count($array2)); + + $result = 0; + for ($i = 0; $i < $count; ++$i) { + if (((is_numeric($array1[$i])) && (!is_string($array1[$i]))) && + ((is_numeric($array2[$i])) && (!is_string($array2[$i])))) { + $result += ($array1[$i] * $array1[$i]) - ($array2[$i] * $array2[$i]); + } + } + + return $result; + } + + + /** + * SUMX2PY2 + * + * @param mixed[] $matrixData1 Matrix #1 + * @param mixed[] $matrixData2 Matrix #2 + * @return float + */ + public static function SUMX2PY2($matrixData1, $matrixData2) + { + $array1 = PHPExcel_Calculation_Functions::flattenArray($matrixData1); + $array2 = PHPExcel_Calculation_Functions::flattenArray($matrixData2); + $count = min(count($array1), count($array2)); + + $result = 0; + for ($i = 0; $i < $count; ++$i) { + if (((is_numeric($array1[$i])) && (!is_string($array1[$i]))) && + ((is_numeric($array2[$i])) && (!is_string($array2[$i])))) { + $result += ($array1[$i] * $array1[$i]) + ($array2[$i] * $array2[$i]); + } + } + + return $result; + } + + + /** + * SUMXMY2 + * + * @param mixed[] $matrixData1 Matrix #1 + * @param mixed[] $matrixData2 Matrix #2 + * @return float + */ + public static function SUMXMY2($matrixData1, $matrixData2) + { + $array1 = PHPExcel_Calculation_Functions::flattenArray($matrixData1); + $array2 = PHPExcel_Calculation_Functions::flattenArray($matrixData2); + $count = min(count($array1), count($array2)); + + $result = 0; + for ($i = 0; $i < $count; ++$i) { + if (((is_numeric($array1[$i])) && (!is_string($array1[$i]))) && + ((is_numeric($array2[$i])) && (!is_string($array2[$i])))) { + $result += ($array1[$i] - $array2[$i]) * ($array1[$i] - $array2[$i]); + } + } + + return $result; + } + + + /** + * TRUNC + * + * Truncates value to the number of fractional digits by number_digits. + * + * @param float $value + * @param int $digits + * @return float Truncated value + */ + public static function TRUNC($value = 0, $digits = 0) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $digits = PHPExcel_Calculation_Functions::flattenSingleValue($digits); + + // Validate parameters + if ((!is_numeric($value)) || (!is_numeric($digits))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $digits = floor($digits); + + // Truncate + $adjust = pow(10, $digits); + + if (($digits > 0) && (rtrim(intval((abs($value) - abs(intval($value))) * $adjust), '0') < $adjust/10)) { + return $value; + } + + return (intval($value * $adjust)) / $adjust; + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation/Statistical.php b/extend/PHPExcel/PHPExcel/Calculation/Statistical.php new file mode 100644 index 0000000..1a33610 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation/Statistical.php @@ -0,0 +1,3745 @@ + $value) { + if ((is_bool($value)) || (is_string($value)) || (is_null($value))) { + unset($array1[$key]); + unset($array2[$key]); + } + } + foreach ($array2 as $key => $value) { + if ((is_bool($value)) || (is_string($value)) || (is_null($value))) { + unset($array1[$key]); + unset($array2[$key]); + } + } + $array1 = array_merge($array1); + $array2 = array_merge($array2); + + return true; + } + + + /** + * Beta function. + * + * @author Jaco van Kooten + * + * @param p require p>0 + * @param q require q>0 + * @return 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow + */ + private static function beta($p, $q) + { + if ($p <= 0.0 || $q <= 0.0 || ($p + $q) > LOG_GAMMA_X_MAX_VALUE) { + return 0.0; + } else { + return exp(self::logBeta($p, $q)); + } + } + + + /** + * Incomplete beta function + * + * @author Jaco van Kooten + * @author Paul Meagher + * + * The computation is based on formulas from Numerical Recipes, Chapter 6.4 (W.H. Press et al, 1992). + * @param x require 0<=x<=1 + * @param p require p>0 + * @param q require q>0 + * @return 0 if x<0, p<=0, q<=0 or p+q>2.55E305 and 1 if x>1 to avoid errors and over/underflow + */ + private static function incompleteBeta($x, $p, $q) + { + if ($x <= 0.0) { + return 0.0; + } elseif ($x >= 1.0) { + return 1.0; + } elseif (($p <= 0.0) || ($q <= 0.0) || (($p + $q) > LOG_GAMMA_X_MAX_VALUE)) { + return 0.0; + } + $beta_gam = exp((0 - self::logBeta($p, $q)) + $p * log($x) + $q * log(1.0 - $x)); + if ($x < ($p + 1.0) / ($p + $q + 2.0)) { + return $beta_gam * self::betaFraction($x, $p, $q) / $p; + } else { + return 1.0 - ($beta_gam * self::betaFraction(1 - $x, $q, $p) / $q); + } + } + + + // Function cache for logBeta function + private static $logBetaCacheP = 0.0; + private static $logBetaCacheQ = 0.0; + private static $logBetaCacheResult = 0.0; + + /** + * The natural logarithm of the beta function. + * + * @param p require p>0 + * @param q require q>0 + * @return 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow + * @author Jaco van Kooten + */ + private static function logBeta($p, $q) + { + if ($p != self::$logBetaCacheP || $q != self::$logBetaCacheQ) { + self::$logBetaCacheP = $p; + self::$logBetaCacheQ = $q; + if (($p <= 0.0) || ($q <= 0.0) || (($p + $q) > LOG_GAMMA_X_MAX_VALUE)) { + self::$logBetaCacheResult = 0.0; + } else { + self::$logBetaCacheResult = self::logGamma($p) + self::logGamma($q) - self::logGamma($p + $q); + } + } + return self::$logBetaCacheResult; + } + + + /** + * Evaluates of continued fraction part of incomplete beta function. + * Based on an idea from Numerical Recipes (W.H. Press et al, 1992). + * @author Jaco van Kooten + */ + private static function betaFraction($x, $p, $q) + { + $c = 1.0; + $sum_pq = $p + $q; + $p_plus = $p + 1.0; + $p_minus = $p - 1.0; + $h = 1.0 - $sum_pq * $x / $p_plus; + if (abs($h) < XMININ) { + $h = XMININ; + } + $h = 1.0 / $h; + $frac = $h; + $m = 1; + $delta = 0.0; + while ($m <= MAX_ITERATIONS && abs($delta-1.0) > PRECISION) { + $m2 = 2 * $m; + // even index for d + $d = $m * ($q - $m) * $x / ( ($p_minus + $m2) * ($p + $m2)); + $h = 1.0 + $d * $h; + if (abs($h) < XMININ) { + $h = XMININ; + } + $h = 1.0 / $h; + $c = 1.0 + $d / $c; + if (abs($c) < XMININ) { + $c = XMININ; + } + $frac *= $h * $c; + // odd index for d + $d = -($p + $m) * ($sum_pq + $m) * $x / (($p + $m2) * ($p_plus + $m2)); + $h = 1.0 + $d * $h; + if (abs($h) < XMININ) { + $h = XMININ; + } + $h = 1.0 / $h; + $c = 1.0 + $d / $c; + if (abs($c) < XMININ) { + $c = XMININ; + } + $delta = $h * $c; + $frac *= $delta; + ++$m; + } + return $frac; + } + + + /** + * logGamma function + * + * @version 1.1 + * @author Jaco van Kooten + * + * Original author was Jaco van Kooten. Ported to PHP by Paul Meagher. + * + * The natural logarithm of the gamma function.
+ * Based on public domain NETLIB (Fortran) code by W. J. Cody and L. Stoltz
+ * Applied Mathematics Division
+ * Argonne National Laboratory
+ * Argonne, IL 60439
+ *

+ * References: + *

    + *
  1. W. J. Cody and K. E. Hillstrom, 'Chebyshev Approximations for the Natural + * Logarithm of the Gamma Function,' Math. Comp. 21, 1967, pp. 198-203.
  2. + *
  3. K. E. Hillstrom, ANL/AMD Program ANLC366S, DGAMMA/DLGAMA, May, 1969.
  4. + *
  5. Hart, Et. Al., Computer Approximations, Wiley and sons, New York, 1968.
  6. + *
+ *

+ *

+ * From the original documentation: + *

+ *

+ * This routine calculates the LOG(GAMMA) function for a positive real argument X. + * Computation is based on an algorithm outlined in references 1 and 2. + * The program uses rational functions that theoretically approximate LOG(GAMMA) + * to at least 18 significant decimal digits. The approximation for X > 12 is from + * reference 3, while approximations for X < 12.0 are similar to those in reference + * 1, but are unpublished. The accuracy achieved depends on the arithmetic system, + * the compiler, the intrinsic functions, and proper selection of the + * machine-dependent constants. + *

+ *

+ * Error returns:
+ * The program returns the value XINF for X .LE. 0.0 or when overflow would occur. + * The computation is believed to be free of underflow and overflow. + *

+ * @return MAX_VALUE for x < 0.0 or when overflow would occur, i.e. x > 2.55E305 + */ + + // Function cache for logGamma + private static $logGammaCacheResult = 0.0; + private static $logGammaCacheX = 0.0; + + private static function logGamma($x) + { + // Log Gamma related constants + static $lg_d1 = -0.5772156649015328605195174; + static $lg_d2 = 0.4227843350984671393993777; + static $lg_d4 = 1.791759469228055000094023; + + static $lg_p1 = array( + 4.945235359296727046734888, + 201.8112620856775083915565, + 2290.838373831346393026739, + 11319.67205903380828685045, + 28557.24635671635335736389, + 38484.96228443793359990269, + 26377.48787624195437963534, + 7225.813979700288197698961 + ); + static $lg_p2 = array( + 4.974607845568932035012064, + 542.4138599891070494101986, + 15506.93864978364947665077, + 184793.2904445632425417223, + 1088204.76946882876749847, + 3338152.967987029735917223, + 5106661.678927352456275255, + 3074109.054850539556250927 + ); + static $lg_p4 = array( + 14745.02166059939948905062, + 2426813.369486704502836312, + 121475557.4045093227939592, + 2663432449.630976949898078, + 29403789566.34553899906876, + 170266573776.5398868392998, + 492612579337.743088758812, + 560625185622.3951465078242 + ); + static $lg_q1 = array( + 67.48212550303777196073036, + 1113.332393857199323513008, + 7738.757056935398733233834, + 27639.87074403340708898585, + 54993.10206226157329794414, + 61611.22180066002127833352, + 36351.27591501940507276287, + 8785.536302431013170870835 + ); + static $lg_q2 = array( + 183.0328399370592604055942, + 7765.049321445005871323047, + 133190.3827966074194402448, + 1136705.821321969608938755, + 5267964.117437946917577538, + 13467014.54311101692290052, + 17827365.30353274213975932, + 9533095.591844353613395747 + ); + static $lg_q4 = array( + 2690.530175870899333379843, + 639388.5654300092398984238, + 41355999.30241388052042842, + 1120872109.61614794137657, + 14886137286.78813811542398, + 101680358627.2438228077304, + 341747634550.7377132798597, + 446315818741.9713286462081 + ); + static $lg_c = array( + -0.001910444077728, + 8.4171387781295e-4, + -5.952379913043012e-4, + 7.93650793500350248e-4, + -0.002777777777777681622553, + 0.08333333333333333331554247, + 0.0057083835261 + ); + + // Rough estimate of the fourth root of logGamma_xBig + static $lg_frtbig = 2.25e76; + static $pnt68 = 0.6796875; + + + if ($x == self::$logGammaCacheX) { + return self::$logGammaCacheResult; + } + $y = $x; + if ($y > 0.0 && $y <= LOG_GAMMA_X_MAX_VALUE) { + if ($y <= EPS) { + $res = -log(y); + } elseif ($y <= 1.5) { + // --------------------- + // EPS .LT. X .LE. 1.5 + // --------------------- + if ($y < $pnt68) { + $corr = -log($y); + $xm1 = $y; + } else { + $corr = 0.0; + $xm1 = $y - 1.0; + } + if ($y <= 0.5 || $y >= $pnt68) { + $xden = 1.0; + $xnum = 0.0; + for ($i = 0; $i < 8; ++$i) { + $xnum = $xnum * $xm1 + $lg_p1[$i]; + $xden = $xden * $xm1 + $lg_q1[$i]; + } + $res = $corr + $xm1 * ($lg_d1 + $xm1 * ($xnum / $xden)); + } else { + $xm2 = $y - 1.0; + $xden = 1.0; + $xnum = 0.0; + for ($i = 0; $i < 8; ++$i) { + $xnum = $xnum * $xm2 + $lg_p2[$i]; + $xden = $xden * $xm2 + $lg_q2[$i]; + } + $res = $corr + $xm2 * ($lg_d2 + $xm2 * ($xnum / $xden)); + } + } elseif ($y <= 4.0) { + // --------------------- + // 1.5 .LT. X .LE. 4.0 + // --------------------- + $xm2 = $y - 2.0; + $xden = 1.0; + $xnum = 0.0; + for ($i = 0; $i < 8; ++$i) { + $xnum = $xnum * $xm2 + $lg_p2[$i]; + $xden = $xden * $xm2 + $lg_q2[$i]; + } + $res = $xm2 * ($lg_d2 + $xm2 * ($xnum / $xden)); + } elseif ($y <= 12.0) { + // ---------------------- + // 4.0 .LT. X .LE. 12.0 + // ---------------------- + $xm4 = $y - 4.0; + $xden = -1.0; + $xnum = 0.0; + for ($i = 0; $i < 8; ++$i) { + $xnum = $xnum * $xm4 + $lg_p4[$i]; + $xden = $xden * $xm4 + $lg_q4[$i]; + } + $res = $lg_d4 + $xm4 * ($xnum / $xden); + } else { + // --------------------------------- + // Evaluate for argument .GE. 12.0 + // --------------------------------- + $res = 0.0; + if ($y <= $lg_frtbig) { + $res = $lg_c[6]; + $ysq = $y * $y; + for ($i = 0; $i < 6; ++$i) { + $res = $res / $ysq + $lg_c[$i]; + } + $res /= $y; + $corr = log($y); + $res = $res + log(SQRT2PI) - 0.5 * $corr; + $res += $y * ($corr - 1.0); + } + } + } else { + // -------------------------- + // Return for bad arguments + // -------------------------- + $res = MAX_VALUE; + } + // ------------------------------ + // Final adjustments and return + // ------------------------------ + self::$logGammaCacheX = $x; + self::$logGammaCacheResult = $res; + return $res; + } + + + // + // Private implementation of the incomplete Gamma function + // + private static function incompleteGamma($a, $x) + { + static $max = 32; + $summer = 0; + for ($n=0; $n<=$max; ++$n) { + $divisor = $a; + for ($i=1; $i<=$n; ++$i) { + $divisor *= ($a + $i); + } + $summer += (pow($x, $n) / $divisor); + } + return pow($x, $a) * exp(0-$x) * $summer; + } + + + // + // Private implementation of the Gamma function + // + private static function gamma($data) + { + if ($data == 0.0) { + return 0; + } + + static $p0 = 1.000000000190015; + static $p = array( + 1 => 76.18009172947146, + 2 => -86.50532032941677, + 3 => 24.01409824083091, + 4 => -1.231739572450155, + 5 => 1.208650973866179e-3, + 6 => -5.395239384953e-6 + ); + + $y = $x = $data; + $tmp = $x + 5.5; + $tmp -= ($x + 0.5) * log($tmp); + + $summer = $p0; + for ($j=1; $j<=6; ++$j) { + $summer += ($p[$j] / ++$y); + } + return exp(0 - $tmp + log(SQRT2PI * $summer / $x)); + } + + + /*************************************************************************** + * inverse_ncdf.php + * ------------------- + * begin : Friday, January 16, 2004 + * copyright : (C) 2004 Michael Nickerson + * email : nickersonm@yahoo.com + * + ***************************************************************************/ + private static function inverseNcdf($p) + { + // Inverse ncdf approximation by Peter J. Acklam, implementation adapted to + // PHP by Michael Nickerson, using Dr. Thomas Ziegler's C implementation as + // a guide. http://home.online.no/~pjacklam/notes/invnorm/index.html + // I have not checked the accuracy of this implementation. Be aware that PHP + // will truncate the coeficcients to 14 digits. + + // You have permission to use and distribute this function freely for + // whatever purpose you want, but please show common courtesy and give credit + // where credit is due. + + // Input paramater is $p - probability - where 0 < p < 1. + + // Coefficients in rational approximations + static $a = array( + 1 => -3.969683028665376e+01, + 2 => 2.209460984245205e+02, + 3 => -2.759285104469687e+02, + 4 => 1.383577518672690e+02, + 5 => -3.066479806614716e+01, + 6 => 2.506628277459239e+00 + ); + + static $b = array( + 1 => -5.447609879822406e+01, + 2 => 1.615858368580409e+02, + 3 => -1.556989798598866e+02, + 4 => 6.680131188771972e+01, + 5 => -1.328068155288572e+01 + ); + + static $c = array( + 1 => -7.784894002430293e-03, + 2 => -3.223964580411365e-01, + 3 => -2.400758277161838e+00, + 4 => -2.549732539343734e+00, + 5 => 4.374664141464968e+00, + 6 => 2.938163982698783e+00 + ); + + static $d = array( + 1 => 7.784695709041462e-03, + 2 => 3.224671290700398e-01, + 3 => 2.445134137142996e+00, + 4 => 3.754408661907416e+00 + ); + + // Define lower and upper region break-points. + $p_low = 0.02425; //Use lower region approx. below this + $p_high = 1 - $p_low; //Use upper region approx. above this + + if (0 < $p && $p < $p_low) { + // Rational approximation for lower region. + $q = sqrt(-2 * log($p)); + return ((((($c[1] * $q + $c[2]) * $q + $c[3]) * $q + $c[4]) * $q + $c[5]) * $q + $c[6]) / + (((($d[1] * $q + $d[2]) * $q + $d[3]) * $q + $d[4]) * $q + 1); + } elseif ($p_low <= $p && $p <= $p_high) { + // Rational approximation for central region. + $q = $p - 0.5; + $r = $q * $q; + return ((((($a[1] * $r + $a[2]) * $r + $a[3]) * $r + $a[4]) * $r + $a[5]) * $r + $a[6]) * $q / + ((((($b[1] * $r + $b[2]) * $r + $b[3]) * $r + $b[4]) * $r + $b[5]) * $r + 1); + } elseif ($p_high < $p && $p < 1) { + // Rational approximation for upper region. + $q = sqrt(-2 * log(1 - $p)); + return -((((($c[1] * $q + $c[2]) * $q + $c[3]) * $q + $c[4]) * $q + $c[5]) * $q + $c[6]) / + (((($d[1] * $q + $d[2]) * $q + $d[3]) * $q + $d[4]) * $q + 1); + } + // If 0 < p < 1, return a null value + return PHPExcel_Calculation_Functions::NULL(); + } + + + private static function inverseNcdf2($prob) + { + // Approximation of inverse standard normal CDF developed by + // B. Moro, "The Full Monte," Risk 8(2), Feb 1995, 57-58. + + $a1 = 2.50662823884; + $a2 = -18.61500062529; + $a3 = 41.39119773534; + $a4 = -25.44106049637; + + $b1 = -8.4735109309; + $b2 = 23.08336743743; + $b3 = -21.06224101826; + $b4 = 3.13082909833; + + $c1 = 0.337475482272615; + $c2 = 0.976169019091719; + $c3 = 0.160797971491821; + $c4 = 2.76438810333863E-02; + $c5 = 3.8405729373609E-03; + $c6 = 3.951896511919E-04; + $c7 = 3.21767881768E-05; + $c8 = 2.888167364E-07; + $c9 = 3.960315187E-07; + + $y = $prob - 0.5; + if (abs($y) < 0.42) { + $z = ($y * $y); + $z = $y * ((($a4 * $z + $a3) * $z + $a2) * $z + $a1) / (((($b4 * $z + $b3) * $z + $b2) * $z + $b1) * $z + 1); + } else { + if ($y > 0) { + $z = log(-log(1 - $prob)); + } else { + $z = log(-log($prob)); + } + $z = $c1 + $z * ($c2 + $z * ($c3 + $z * ($c4 + $z * ($c5 + $z * ($c6 + $z * ($c7 + $z * ($c8 + $z * $c9))))))); + if ($y < 0) { + $z = -$z; + } + } + return $z; + } // function inverseNcdf2() + + + private static function inverseNcdf3($p) + { + // ALGORITHM AS241 APPL. STATIST. (1988) VOL. 37, NO. 3. + // Produces the normal deviate Z corresponding to a given lower + // tail area of P; Z is accurate to about 1 part in 10**16. + // + // This is a PHP version of the original FORTRAN code that can + // be found at http://lib.stat.cmu.edu/apstat/ + $split1 = 0.425; + $split2 = 5; + $const1 = 0.180625; + $const2 = 1.6; + + // coefficients for p close to 0.5 + $a0 = 3.3871328727963666080; + $a1 = 1.3314166789178437745E+2; + $a2 = 1.9715909503065514427E+3; + $a3 = 1.3731693765509461125E+4; + $a4 = 4.5921953931549871457E+4; + $a5 = 6.7265770927008700853E+4; + $a6 = 3.3430575583588128105E+4; + $a7 = 2.5090809287301226727E+3; + + $b1 = 4.2313330701600911252E+1; + $b2 = 6.8718700749205790830E+2; + $b3 = 5.3941960214247511077E+3; + $b4 = 2.1213794301586595867E+4; + $b5 = 3.9307895800092710610E+4; + $b6 = 2.8729085735721942674E+4; + $b7 = 5.2264952788528545610E+3; + + // coefficients for p not close to 0, 0.5 or 1. + $c0 = 1.42343711074968357734; + $c1 = 4.63033784615654529590; + $c2 = 5.76949722146069140550; + $c3 = 3.64784832476320460504; + $c4 = 1.27045825245236838258; + $c5 = 2.41780725177450611770E-1; + $c6 = 2.27238449892691845833E-2; + $c7 = 7.74545014278341407640E-4; + + $d1 = 2.05319162663775882187; + $d2 = 1.67638483018380384940; + $d3 = 6.89767334985100004550E-1; + $d4 = 1.48103976427480074590E-1; + $d5 = 1.51986665636164571966E-2; + $d6 = 5.47593808499534494600E-4; + $d7 = 1.05075007164441684324E-9; + + // coefficients for p near 0 or 1. + $e0 = 6.65790464350110377720; + $e1 = 5.46378491116411436990; + $e2 = 1.78482653991729133580; + $e3 = 2.96560571828504891230E-1; + $e4 = 2.65321895265761230930E-2; + $e5 = 1.24266094738807843860E-3; + $e6 = 2.71155556874348757815E-5; + $e7 = 2.01033439929228813265E-7; + + $f1 = 5.99832206555887937690E-1; + $f2 = 1.36929880922735805310E-1; + $f3 = 1.48753612908506148525E-2; + $f4 = 7.86869131145613259100E-4; + $f5 = 1.84631831751005468180E-5; + $f6 = 1.42151175831644588870E-7; + $f7 = 2.04426310338993978564E-15; + + $q = $p - 0.5; + + // computation for p close to 0.5 + if (abs($q) <= split1) { + $R = $const1 - $q * $q; + $z = $q * ((((((($a7 * $R + $a6) * $R + $a5) * $R + $a4) * $R + $a3) * $R + $a2) * $R + $a1) * $R + $a0) / + ((((((($b7 * $R + $b6) * $R + $b5) * $R + $b4) * $R + $b3) * $R + $b2) * $R + $b1) * $R + 1); + } else { + if ($q < 0) { + $R = $p; + } else { + $R = 1 - $p; + } + $R = pow(-log($R), 2); + + // computation for p not close to 0, 0.5 or 1. + if ($R <= $split2) { + $R = $R - $const2; + $z = ((((((($c7 * $R + $c6) * $R + $c5) * $R + $c4) * $R + $c3) * $R + $c2) * $R + $c1) * $R + $c0) / + ((((((($d7 * $R + $d6) * $R + $d5) * $R + $d4) * $R + $d3) * $R + $d2) * $R + $d1) * $R + 1); + } else { + // computation for p near 0 or 1. + $R = $R - $split2; + $z = ((((((($e7 * $R + $e6) * $R + $e5) * $R + $e4) * $R + $e3) * $R + $e2) * $R + $e1) * $R + $e0) / + ((((((($f7 * $R + $f6) * $R + $f5) * $R + $f4) * $R + $f3) * $R + $f2) * $R + $f1) * $R + 1); + } + if ($q < 0) { + $z = -$z; + } + } + return $z; + } + + + /** + * AVEDEV + * + * Returns the average of the absolute deviations of data points from their mean. + * AVEDEV is a measure of the variability in a data set. + * + * Excel Function: + * AVEDEV(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function AVEDEV() + { + $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); + + // Return value + $returnValue = null; + + $aMean = self::AVERAGE($aArgs); + if ($aMean != PHPExcel_Calculation_Functions::DIV0()) { + $aCount = 0; + foreach ($aArgs as $k => $arg) { + if ((is_bool($arg)) && + ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) { + $arg = (integer) $arg; + } + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + if (is_null($returnValue)) { + $returnValue = abs($arg - $aMean); + } else { + $returnValue += abs($arg - $aMean); + } + ++$aCount; + } + } + + // Return + if ($aCount == 0) { + return PHPExcel_Calculation_Functions::DIV0(); + } + return $returnValue / $aCount; + } + return PHPExcel_Calculation_Functions::NaN(); + } + + + /** + * AVERAGE + * + * Returns the average (arithmetic mean) of the arguments + * + * Excel Function: + * AVERAGE(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function AVERAGE() + { + $returnValue = $aCount = 0; + + // Loop through arguments + foreach (PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()) as $k => $arg) { + if ((is_bool($arg)) && + ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) { + $arg = (integer) $arg; + } + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + if (is_null($returnValue)) { + $returnValue = $arg; + } else { + $returnValue += $arg; + } + ++$aCount; + } + } + + // Return + if ($aCount > 0) { + return $returnValue / $aCount; + } else { + return PHPExcel_Calculation_Functions::DIV0(); + } + } + + + /** + * AVERAGEA + * + * Returns the average of its arguments, including numbers, text, and logical values + * + * Excel Function: + * AVERAGEA(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function AVERAGEA() + { + $returnValue = null; + + $aCount = 0; + // Loop through arguments + foreach (PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()) as $k => $arg) { + if ((is_bool($arg)) && + (!PHPExcel_Calculation_Functions::isMatrixValue($k))) { + } else { + if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) { + if (is_bool($arg)) { + $arg = (integer) $arg; + } elseif (is_string($arg)) { + $arg = 0; + } + if (is_null($returnValue)) { + $returnValue = $arg; + } else { + $returnValue += $arg; + } + ++$aCount; + } + } + } + + if ($aCount > 0) { + return $returnValue / $aCount; + } else { + return PHPExcel_Calculation_Functions::DIV0(); + } + } + + + /** + * AVERAGEIF + * + * Returns the average value from a range of cells that contain numbers within the list of arguments + * + * Excel Function: + * AVERAGEIF(value1[,value2[, ...]],condition) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param mixed $arg,... Data values + * @param string $condition The criteria that defines which cells will be checked. + * @param mixed[] $averageArgs Data values + * @return float + */ + public static function AVERAGEIF($aArgs, $condition, $averageArgs = array()) + { + $returnValue = 0; + + $aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs); + $averageArgs = PHPExcel_Calculation_Functions::flattenArray($averageArgs); + if (empty($averageArgs)) { + $averageArgs = $aArgs; + } + $condition = PHPExcel_Calculation_Functions::ifCondition($condition); + // Loop through arguments + $aCount = 0; + foreach ($aArgs as $key => $arg) { + if (!is_numeric($arg)) { + $arg = PHPExcel_Calculation::wrapResult(strtoupper($arg)); + } + $testCondition = '='.$arg.$condition; + if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + if ((is_null($returnValue)) || ($arg > $returnValue)) { + $returnValue += $arg; + ++$aCount; + } + } + } + + if ($aCount > 0) { + return $returnValue / $aCount; + } + return PHPExcel_Calculation_Functions::DIV0(); + } + + + /** + * BETADIST + * + * Returns the beta distribution. + * + * @param float $value Value at which you want to evaluate the distribution + * @param float $alpha Parameter to the distribution + * @param float $beta Parameter to the distribution + * @param boolean $cumulative + * @return float + * + */ + public static function BETADIST($value, $alpha, $beta, $rMin = 0, $rMax = 1) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha); + $beta = PHPExcel_Calculation_Functions::flattenSingleValue($beta); + $rMin = PHPExcel_Calculation_Functions::flattenSingleValue($rMin); + $rMax = PHPExcel_Calculation_Functions::flattenSingleValue($rMax); + + if ((is_numeric($value)) && (is_numeric($alpha)) && (is_numeric($beta)) && (is_numeric($rMin)) && (is_numeric($rMax))) { + if (($value < $rMin) || ($value > $rMax) || ($alpha <= 0) || ($beta <= 0) || ($rMin == $rMax)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ($rMin > $rMax) { + $tmp = $rMin; + $rMin = $rMax; + $rMax = $tmp; + } + $value -= $rMin; + $value /= ($rMax - $rMin); + return self::incompleteBeta($value, $alpha, $beta); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * BETAINV + * + * Returns the inverse of the beta distribution. + * + * @param float $probability Probability at which you want to evaluate the distribution + * @param float $alpha Parameter to the distribution + * @param float $beta Parameter to the distribution + * @param float $rMin Minimum value + * @param float $rMax Maximum value + * @param boolean $cumulative + * @return float + * + */ + public static function BETAINV($probability, $alpha, $beta, $rMin = 0, $rMax = 1) + { + $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); + $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha); + $beta = PHPExcel_Calculation_Functions::flattenSingleValue($beta); + $rMin = PHPExcel_Calculation_Functions::flattenSingleValue($rMin); + $rMax = PHPExcel_Calculation_Functions::flattenSingleValue($rMax); + + if ((is_numeric($probability)) && (is_numeric($alpha)) && (is_numeric($beta)) && (is_numeric($rMin)) && (is_numeric($rMax))) { + if (($alpha <= 0) || ($beta <= 0) || ($rMin == $rMax) || ($probability <= 0) || ($probability > 1)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ($rMin > $rMax) { + $tmp = $rMin; + $rMin = $rMax; + $rMax = $tmp; + } + $a = 0; + $b = 2; + + $i = 0; + while ((($b - $a) > PRECISION) && ($i++ < MAX_ITERATIONS)) { + $guess = ($a + $b) / 2; + $result = self::BETADIST($guess, $alpha, $beta); + if (($result == $probability) || ($result == 0)) { + $b = $a; + } elseif ($result > $probability) { + $b = $guess; + } else { + $a = $guess; + } + } + if ($i == MAX_ITERATIONS) { + return PHPExcel_Calculation_Functions::NA(); + } + return round($rMin + $guess * ($rMax - $rMin), 12); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * BINOMDIST + * + * Returns the individual term binomial distribution probability. Use BINOMDIST in problems with + * a fixed number of tests or trials, when the outcomes of any trial are only success or failure, + * when trials are independent, and when the probability of success is constant throughout the + * experiment. For example, BINOMDIST can calculate the probability that two of the next three + * babies born are male. + * + * @param float $value Number of successes in trials + * @param float $trials Number of trials + * @param float $probability Probability of success on each trial + * @param boolean $cumulative + * @return float + * + * @todo Cumulative distribution function + * + */ + public static function BINOMDIST($value, $trials, $probability, $cumulative) + { + $value = floor(PHPExcel_Calculation_Functions::flattenSingleValue($value)); + $trials = floor(PHPExcel_Calculation_Functions::flattenSingleValue($trials)); + $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); + + if ((is_numeric($value)) && (is_numeric($trials)) && (is_numeric($probability))) { + if (($value < 0) || ($value > $trials)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if (($probability < 0) || ($probability > 1)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ((is_numeric($cumulative)) || (is_bool($cumulative))) { + if ($cumulative) { + $summer = 0; + for ($i = 0; $i <= $value; ++$i) { + $summer += PHPExcel_Calculation_MathTrig::COMBIN($trials, $i) * pow($probability, $i) * pow(1 - $probability, $trials - $i); + } + return $summer; + } else { + return PHPExcel_Calculation_MathTrig::COMBIN($trials, $value) * pow($probability, $value) * pow(1 - $probability, $trials - $value) ; + } + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * CHIDIST + * + * Returns the one-tailed probability of the chi-squared distribution. + * + * @param float $value Value for the function + * @param float $degrees degrees of freedom + * @return float + */ + public static function CHIDIST($value, $degrees) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $degrees = floor(PHPExcel_Calculation_Functions::flattenSingleValue($degrees)); + + if ((is_numeric($value)) && (is_numeric($degrees))) { + if ($degrees < 1) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ($value < 0) { + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { + return 1; + } + return PHPExcel_Calculation_Functions::NaN(); + } + return 1 - (self::incompleteGamma($degrees/2, $value/2) / self::gamma($degrees/2)); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * CHIINV + * + * Returns the one-tailed probability of the chi-squared distribution. + * + * @param float $probability Probability for the function + * @param float $degrees degrees of freedom + * @return float + */ + public static function CHIINV($probability, $degrees) + { + $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); + $degrees = floor(PHPExcel_Calculation_Functions::flattenSingleValue($degrees)); + + if ((is_numeric($probability)) && (is_numeric($degrees))) { + $xLo = 100; + $xHi = 0; + + $x = $xNew = 1; + $dx = 1; + $i = 0; + + while ((abs($dx) > PRECISION) && ($i++ < MAX_ITERATIONS)) { + // Apply Newton-Raphson step + $result = self::CHIDIST($x, $degrees); + $error = $result - $probability; + if ($error == 0.0) { + $dx = 0; + } elseif ($error < 0.0) { + $xLo = $x; + } else { + $xHi = $x; + } + // Avoid division by zero + if ($result != 0.0) { + $dx = $error / $result; + $xNew = $x - $dx; + } + // If the NR fails to converge (which for example may be the + // case if the initial guess is too rough) we apply a bisection + // step to determine a more narrow interval around the root. + if (($xNew < $xLo) || ($xNew > $xHi) || ($result == 0.0)) { + $xNew = ($xLo + $xHi) / 2; + $dx = $xNew - $x; + } + $x = $xNew; + } + if ($i == MAX_ITERATIONS) { + return PHPExcel_Calculation_Functions::NA(); + } + return round($x, 12); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * CONFIDENCE + * + * Returns the confidence interval for a population mean + * + * @param float $alpha + * @param float $stdDev Standard Deviation + * @param float $size + * @return float + * + */ + public static function CONFIDENCE($alpha, $stdDev, $size) + { + $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha); + $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev); + $size = floor(PHPExcel_Calculation_Functions::flattenSingleValue($size)); + + if ((is_numeric($alpha)) && (is_numeric($stdDev)) && (is_numeric($size))) { + if (($alpha <= 0) || ($alpha >= 1)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if (($stdDev <= 0) || ($size < 1)) { + return PHPExcel_Calculation_Functions::NaN(); + } + return self::NORMSINV(1 - $alpha / 2) * $stdDev / sqrt($size); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * CORREL + * + * Returns covariance, the average of the products of deviations for each data point pair. + * + * @param array of mixed Data Series Y + * @param array of mixed Data Series X + * @return float + */ + public static function CORREL($yValues, $xValues = null) + { + if ((is_null($xValues)) || (!is_array($yValues)) || (!is_array($xValues))) { + return PHPExcel_Calculation_Functions::VALUE(); + } + if (!self::checkTrendArrays($yValues, $xValues)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $yValueCount = count($yValues); + $xValueCount = count($xValues); + + if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { + return PHPExcel_Calculation_Functions::NA(); + } elseif ($yValueCount == 1) { + return PHPExcel_Calculation_Functions::DIV0(); + } + + $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues); + return $bestFitLinear->getCorrelation(); + } + + + /** + * COUNT + * + * Counts the number of cells that contain numbers within the list of arguments + * + * Excel Function: + * COUNT(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return int + */ + public static function COUNT() + { + $returnValue = 0; + + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); + foreach ($aArgs as $k => $arg) { + if ((is_bool($arg)) && + ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) { + $arg = (integer) $arg; + } + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + ++$returnValue; + } + } + + return $returnValue; + } + + + /** + * COUNTA + * + * Counts the number of cells that are not empty within the list of arguments + * + * Excel Function: + * COUNTA(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return int + */ + public static function COUNTA() + { + $returnValue = 0; + + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + foreach ($aArgs as $arg) { + // Is it a numeric, boolean or string value? + if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) { + ++$returnValue; + } + } + + return $returnValue; + } + + + /** + * COUNTBLANK + * + * Counts the number of empty cells within the list of arguments + * + * Excel Function: + * COUNTBLANK(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return int + */ + public static function COUNTBLANK() + { + $returnValue = 0; + + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + foreach ($aArgs as $arg) { + // Is it a blank cell? + if ((is_null($arg)) || ((is_string($arg)) && ($arg == ''))) { + ++$returnValue; + } + } + + return $returnValue; + } + + + /** + * COUNTIF + * + * Counts the number of cells that contain numbers within the list of arguments + * + * Excel Function: + * COUNTIF(value1[,value2[, ...]],condition) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @param string $condition The criteria that defines which cells will be counted. + * @return int + */ + public static function COUNTIF($aArgs, $condition) + { + $returnValue = 0; + + $aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs); + $condition = PHPExcel_Calculation_Functions::ifCondition($condition); + // Loop through arguments + foreach ($aArgs as $arg) { + if (!is_numeric($arg)) { + $arg = PHPExcel_Calculation::wrapResult(strtoupper($arg)); + } + $testCondition = '='.$arg.$condition; + if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + // Is it a value within our criteria + ++$returnValue; + } + } + + return $returnValue; + } + + + /** + * COVAR + * + * Returns covariance, the average of the products of deviations for each data point pair. + * + * @param array of mixed Data Series Y + * @param array of mixed Data Series X + * @return float + */ + public static function COVAR($yValues, $xValues) + { + if (!self::checkTrendArrays($yValues, $xValues)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $yValueCount = count($yValues); + $xValueCount = count($xValues); + + if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { + return PHPExcel_Calculation_Functions::NA(); + } elseif ($yValueCount == 1) { + return PHPExcel_Calculation_Functions::DIV0(); + } + + $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues); + return $bestFitLinear->getCovariance(); + } + + + /** + * CRITBINOM + * + * Returns the smallest value for which the cumulative binomial distribution is greater + * than or equal to a criterion value + * + * See http://support.microsoft.com/kb/828117/ for details of the algorithm used + * + * @param float $trials number of Bernoulli trials + * @param float $probability probability of a success on each trial + * @param float $alpha criterion value + * @return int + * + * @todo Warning. This implementation differs from the algorithm detailed on the MS + * web site in that $CumPGuessMinus1 = $CumPGuess - 1 rather than $CumPGuess - $PGuess + * This eliminates a potential endless loop error, but may have an adverse affect on the + * accuracy of the function (although all my tests have so far returned correct results). + * + */ + public static function CRITBINOM($trials, $probability, $alpha) + { + $trials = floor(PHPExcel_Calculation_Functions::flattenSingleValue($trials)); + $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); + $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha); + + if ((is_numeric($trials)) && (is_numeric($probability)) && (is_numeric($alpha))) { + if ($trials < 0) { + return PHPExcel_Calculation_Functions::NaN(); + } elseif (($probability < 0) || ($probability > 1)) { + return PHPExcel_Calculation_Functions::NaN(); + } elseif (($alpha < 0) || ($alpha > 1)) { + return PHPExcel_Calculation_Functions::NaN(); + } elseif ($alpha <= 0.5) { + $t = sqrt(log(1 / ($alpha * $alpha))); + $trialsApprox = 0 - ($t + (2.515517 + 0.802853 * $t + 0.010328 * $t * $t) / (1 + 1.432788 * $t + 0.189269 * $t * $t + 0.001308 * $t * $t * $t)); + } else { + $t = sqrt(log(1 / pow(1 - $alpha, 2))); + $trialsApprox = $t - (2.515517 + 0.802853 * $t + 0.010328 * $t * $t) / (1 + 1.432788 * $t + 0.189269 * $t * $t + 0.001308 * $t * $t * $t); + } + $Guess = floor($trials * $probability + $trialsApprox * sqrt($trials * $probability * (1 - $probability))); + if ($Guess < 0) { + $Guess = 0; + } elseif ($Guess > $trials) { + $Guess = $trials; + } + + $TotalUnscaledProbability = $UnscaledPGuess = $UnscaledCumPGuess = 0.0; + $EssentiallyZero = 10e-12; + + $m = floor($trials * $probability); + ++$TotalUnscaledProbability; + if ($m == $Guess) { + ++$UnscaledPGuess; + } + if ($m <= $Guess) { + ++$UnscaledCumPGuess; + } + + $PreviousValue = 1; + $Done = false; + $k = $m + 1; + while ((!$Done) && ($k <= $trials)) { + $CurrentValue = $PreviousValue * ($trials - $k + 1) * $probability / ($k * (1 - $probability)); + $TotalUnscaledProbability += $CurrentValue; + if ($k == $Guess) { + $UnscaledPGuess += $CurrentValue; + } + if ($k <= $Guess) { + $UnscaledCumPGuess += $CurrentValue; + } + if ($CurrentValue <= $EssentiallyZero) { + $Done = true; + } + $PreviousValue = $CurrentValue; + ++$k; + } + + $PreviousValue = 1; + $Done = false; + $k = $m - 1; + while ((!$Done) && ($k >= 0)) { + $CurrentValue = $PreviousValue * $k + 1 * (1 - $probability) / (($trials - $k) * $probability); + $TotalUnscaledProbability += $CurrentValue; + if ($k == $Guess) { + $UnscaledPGuess += $CurrentValue; + } + if ($k <= $Guess) { + $UnscaledCumPGuess += $CurrentValue; + } + if ($CurrentValue <= $EssentiallyZero) { + $Done = true; + } + $PreviousValue = $CurrentValue; + --$k; + } + + $PGuess = $UnscaledPGuess / $TotalUnscaledProbability; + $CumPGuess = $UnscaledCumPGuess / $TotalUnscaledProbability; + +// $CumPGuessMinus1 = $CumPGuess - $PGuess; + $CumPGuessMinus1 = $CumPGuess - 1; + + while (true) { + if (($CumPGuessMinus1 < $alpha) && ($CumPGuess >= $alpha)) { + return $Guess; + } elseif (($CumPGuessMinus1 < $alpha) && ($CumPGuess < $alpha)) { + $PGuessPlus1 = $PGuess * ($trials - $Guess) * $probability / $Guess / (1 - $probability); + $CumPGuessMinus1 = $CumPGuess; + $CumPGuess = $CumPGuess + $PGuessPlus1; + $PGuess = $PGuessPlus1; + ++$Guess; + } elseif (($CumPGuessMinus1 >= $alpha) && ($CumPGuess >= $alpha)) { + $PGuessMinus1 = $PGuess * $Guess * (1 - $probability) / ($trials - $Guess + 1) / $probability; + $CumPGuess = $CumPGuessMinus1; + $CumPGuessMinus1 = $CumPGuessMinus1 - $PGuess; + $PGuess = $PGuessMinus1; + --$Guess; + } + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * DEVSQ + * + * Returns the sum of squares of deviations of data points from their sample mean. + * + * Excel Function: + * DEVSQ(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function DEVSQ() + { + $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); + + // Return value + $returnValue = null; + + $aMean = self::AVERAGE($aArgs); + if ($aMean != PHPExcel_Calculation_Functions::DIV0()) { + $aCount = -1; + foreach ($aArgs as $k => $arg) { + // Is it a numeric value? + if ((is_bool($arg)) && + ((!PHPExcel_Calculation_Functions::isCellValue($k)) || + (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) { + $arg = (integer) $arg; + } + if ((is_numeric($arg)) && (!is_string($arg))) { + if (is_null($returnValue)) { + $returnValue = pow(($arg - $aMean), 2); + } else { + $returnValue += pow(($arg - $aMean), 2); + } + ++$aCount; + } + } + + // Return + if (is_null($returnValue)) { + return PHPExcel_Calculation_Functions::NaN(); + } else { + return $returnValue; + } + } + return self::NA(); + } + + + /** + * EXPONDIST + * + * Returns the exponential distribution. Use EXPONDIST to model the time between events, + * such as how long an automated bank teller takes to deliver cash. For example, you can + * use EXPONDIST to determine the probability that the process takes at most 1 minute. + * + * @param float $value Value of the function + * @param float $lambda The parameter value + * @param boolean $cumulative + * @return float + */ + public static function EXPONDIST($value, $lambda, $cumulative) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $lambda = PHPExcel_Calculation_Functions::flattenSingleValue($lambda); + $cumulative = PHPExcel_Calculation_Functions::flattenSingleValue($cumulative); + + if ((is_numeric($value)) && (is_numeric($lambda))) { + if (($value < 0) || ($lambda < 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ((is_numeric($cumulative)) || (is_bool($cumulative))) { + if ($cumulative) { + return 1 - exp(0-$value*$lambda); + } else { + return $lambda * exp(0-$value*$lambda); + } + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * FISHER + * + * Returns the Fisher transformation at x. This transformation produces a function that + * is normally distributed rather than skewed. Use this function to perform hypothesis + * testing on the correlation coefficient. + * + * @param float $value + * @return float + */ + public static function FISHER($value) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + + if (is_numeric($value)) { + if (($value <= -1) || ($value >= 1)) { + return PHPExcel_Calculation_Functions::NaN(); + } + return 0.5 * log((1+$value)/(1-$value)); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * FISHERINV + * + * Returns the inverse of the Fisher transformation. Use this transformation when + * analyzing correlations between ranges or arrays of data. If y = FISHER(x), then + * FISHERINV(y) = x. + * + * @param float $value + * @return float + */ + public static function FISHERINV($value) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + + if (is_numeric($value)) { + return (exp(2 * $value) - 1) / (exp(2 * $value) + 1); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * FORECAST + * + * Calculates, or predicts, a future value by using existing values. The predicted value is a y-value for a given x-value. + * + * @param float Value of X for which we want to find Y + * @param array of mixed Data Series Y + * @param array of mixed Data Series X + * @return float + */ + public static function FORECAST($xValue, $yValues, $xValues) + { + $xValue = PHPExcel_Calculation_Functions::flattenSingleValue($xValue); + if (!is_numeric($xValue)) { + return PHPExcel_Calculation_Functions::VALUE(); + } elseif (!self::checkTrendArrays($yValues, $xValues)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $yValueCount = count($yValues); + $xValueCount = count($xValues); + + if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { + return PHPExcel_Calculation_Functions::NA(); + } elseif ($yValueCount == 1) { + return PHPExcel_Calculation_Functions::DIV0(); + } + + $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues); + return $bestFitLinear->getValueOfYForX($xValue); + } + + + /** + * GAMMADIST + * + * Returns the gamma distribution. + * + * @param float $value Value at which you want to evaluate the distribution + * @param float $a Parameter to the distribution + * @param float $b Parameter to the distribution + * @param boolean $cumulative + * @return float + * + */ + public static function GAMMADIST($value, $a, $b, $cumulative) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $a = PHPExcel_Calculation_Functions::flattenSingleValue($a); + $b = PHPExcel_Calculation_Functions::flattenSingleValue($b); + + if ((is_numeric($value)) && (is_numeric($a)) && (is_numeric($b))) { + if (($value < 0) || ($a <= 0) || ($b <= 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ((is_numeric($cumulative)) || (is_bool($cumulative))) { + if ($cumulative) { + return self::incompleteGamma($a, $value / $b) / self::gamma($a); + } else { + return (1 / (pow($b, $a) * self::gamma($a))) * pow($value, $a-1) * exp(0-($value / $b)); + } + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * GAMMAINV + * + * Returns the inverse of the beta distribution. + * + * @param float $probability Probability at which you want to evaluate the distribution + * @param float $alpha Parameter to the distribution + * @param float $beta Parameter to the distribution + * @return float + * + */ + public static function GAMMAINV($probability, $alpha, $beta) + { + $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); + $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha); + $beta = PHPExcel_Calculation_Functions::flattenSingleValue($beta); + + if ((is_numeric($probability)) && (is_numeric($alpha)) && (is_numeric($beta))) { + if (($alpha <= 0) || ($beta <= 0) || ($probability < 0) || ($probability > 1)) { + return PHPExcel_Calculation_Functions::NaN(); + } + + $xLo = 0; + $xHi = $alpha * $beta * 5; + + $x = $xNew = 1; + $error = $pdf = 0; + $dx = 1024; + $i = 0; + + while ((abs($dx) > PRECISION) && ($i++ < MAX_ITERATIONS)) { + // Apply Newton-Raphson step + $error = self::GAMMADIST($x, $alpha, $beta, true) - $probability; + if ($error < 0.0) { + $xLo = $x; + } else { + $xHi = $x; + } + $pdf = self::GAMMADIST($x, $alpha, $beta, false); + // Avoid division by zero + if ($pdf != 0.0) { + $dx = $error / $pdf; + $xNew = $x - $dx; + } + // If the NR fails to converge (which for example may be the + // case if the initial guess is too rough) we apply a bisection + // step to determine a more narrow interval around the root. + if (($xNew < $xLo) || ($xNew > $xHi) || ($pdf == 0.0)) { + $xNew = ($xLo + $xHi) / 2; + $dx = $xNew - $x; + } + $x = $xNew; + } + if ($i == MAX_ITERATIONS) { + return PHPExcel_Calculation_Functions::NA(); + } + return $x; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * GAMMALN + * + * Returns the natural logarithm of the gamma function. + * + * @param float $value + * @return float + */ + public static function GAMMALN($value) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + + if (is_numeric($value)) { + if ($value <= 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + return log(self::gamma($value)); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * GEOMEAN + * + * Returns the geometric mean of an array or range of positive data. For example, you + * can use GEOMEAN to calculate average growth rate given compound interest with + * variable rates. + * + * Excel Function: + * GEOMEAN(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function GEOMEAN() + { + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + + $aMean = PHPExcel_Calculation_MathTrig::PRODUCT($aArgs); + if (is_numeric($aMean) && ($aMean > 0)) { + $aCount = self::COUNT($aArgs) ; + if (self::MIN($aArgs) > 0) { + return pow($aMean, (1 / $aCount)); + } + } + return PHPExcel_Calculation_Functions::NaN(); + } + + + /** + * GROWTH + * + * Returns values along a predicted emponential trend + * + * @param array of mixed Data Series Y + * @param array of mixed Data Series X + * @param array of mixed Values of X for which we want to find Y + * @param boolean A logical value specifying whether to force the intersect to equal 0. + * @return array of float + */ + public static function GROWTH($yValues, $xValues = array(), $newValues = array(), $const = true) + { + $yValues = PHPExcel_Calculation_Functions::flattenArray($yValues); + $xValues = PHPExcel_Calculation_Functions::flattenArray($xValues); + $newValues = PHPExcel_Calculation_Functions::flattenArray($newValues); + $const = (is_null($const)) ? true : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($const); + + $bestFitExponential = trendClass::calculate(trendClass::TREND_EXPONENTIAL, $yValues, $xValues, $const); + if (empty($newValues)) { + $newValues = $bestFitExponential->getXValues(); + } + + $returnArray = array(); + foreach ($newValues as $xValue) { + $returnArray[0][] = $bestFitExponential->getValueOfYForX($xValue); + } + + return $returnArray; + } + + + /** + * HARMEAN + * + * Returns the harmonic mean of a data set. The harmonic mean is the reciprocal of the + * arithmetic mean of reciprocals. + * + * Excel Function: + * HARMEAN(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function HARMEAN() + { + // Return value + $returnValue = PHPExcel_Calculation_Functions::NA(); + + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + if (self::MIN($aArgs) < 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + $aCount = 0; + foreach ($aArgs as $arg) { + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + if ($arg <= 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + if (is_null($returnValue)) { + $returnValue = (1 / $arg); + } else { + $returnValue += (1 / $arg); + } + ++$aCount; + } + } + + // Return + if ($aCount > 0) { + return 1 / ($returnValue / $aCount); + } else { + return $returnValue; + } + } + + + /** + * HYPGEOMDIST + * + * Returns the hypergeometric distribution. HYPGEOMDIST returns the probability of a given number of + * sample successes, given the sample size, population successes, and population size. + * + * @param float $sampleSuccesses Number of successes in the sample + * @param float $sampleNumber Size of the sample + * @param float $populationSuccesses Number of successes in the population + * @param float $populationNumber Population size + * @return float + * + */ + public static function HYPGEOMDIST($sampleSuccesses, $sampleNumber, $populationSuccesses, $populationNumber) + { + $sampleSuccesses = floor(PHPExcel_Calculation_Functions::flattenSingleValue($sampleSuccesses)); + $sampleNumber = floor(PHPExcel_Calculation_Functions::flattenSingleValue($sampleNumber)); + $populationSuccesses = floor(PHPExcel_Calculation_Functions::flattenSingleValue($populationSuccesses)); + $populationNumber = floor(PHPExcel_Calculation_Functions::flattenSingleValue($populationNumber)); + + if ((is_numeric($sampleSuccesses)) && (is_numeric($sampleNumber)) && (is_numeric($populationSuccesses)) && (is_numeric($populationNumber))) { + if (($sampleSuccesses < 0) || ($sampleSuccesses > $sampleNumber) || ($sampleSuccesses > $populationSuccesses)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if (($sampleNumber <= 0) || ($sampleNumber > $populationNumber)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if (($populationSuccesses <= 0) || ($populationSuccesses > $populationNumber)) { + return PHPExcel_Calculation_Functions::NaN(); + } + return PHPExcel_Calculation_MathTrig::COMBIN($populationSuccesses, $sampleSuccesses) * + PHPExcel_Calculation_MathTrig::COMBIN($populationNumber - $populationSuccesses, $sampleNumber - $sampleSuccesses) / + PHPExcel_Calculation_MathTrig::COMBIN($populationNumber, $sampleNumber); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * INTERCEPT + * + * Calculates the point at which a line will intersect the y-axis by using existing x-values and y-values. + * + * @param array of mixed Data Series Y + * @param array of mixed Data Series X + * @return float + */ + public static function INTERCEPT($yValues, $xValues) + { + if (!self::checkTrendArrays($yValues, $xValues)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $yValueCount = count($yValues); + $xValueCount = count($xValues); + + if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { + return PHPExcel_Calculation_Functions::NA(); + } elseif ($yValueCount == 1) { + return PHPExcel_Calculation_Functions::DIV0(); + } + + $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues); + return $bestFitLinear->getIntersect(); + } + + + /** + * KURT + * + * Returns the kurtosis of a data set. Kurtosis characterizes the relative peakedness + * or flatness of a distribution compared with the normal distribution. Positive + * kurtosis indicates a relatively peaked distribution. Negative kurtosis indicates a + * relatively flat distribution. + * + * @param array Data Series + * @return float + */ + public static function KURT() + { + $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); + $mean = self::AVERAGE($aArgs); + $stdDev = self::STDEV($aArgs); + + if ($stdDev > 0) { + $count = $summer = 0; + // Loop through arguments + foreach ($aArgs as $k => $arg) { + if ((is_bool($arg)) && + (!PHPExcel_Calculation_Functions::isMatrixValue($k))) { + } else { + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + $summer += pow((($arg - $mean) / $stdDev), 4); + ++$count; + } + } + } + + // Return + if ($count > 3) { + return $summer * ($count * ($count+1) / (($count-1) * ($count-2) * ($count-3))) - (3 * pow($count-1, 2) / (($count-2) * ($count-3))); + } + } + return PHPExcel_Calculation_Functions::DIV0(); + } + + + /** + * LARGE + * + * Returns the nth largest value in a data set. You can use this function to + * select a value based on its relative standing. + * + * Excel Function: + * LARGE(value1[,value2[, ...]],entry) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @param int $entry Position (ordered from the largest) in the array or range of data to return + * @return float + * + */ + public static function LARGE() + { + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + + // Calculate + $entry = floor(array_pop($aArgs)); + + if ((is_numeric($entry)) && (!is_string($entry))) { + $mArgs = array(); + foreach ($aArgs as $arg) { + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + $mArgs[] = $arg; + } + } + $count = self::COUNT($mArgs); + $entry = floor(--$entry); + if (($entry < 0) || ($entry >= $count) || ($count == 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + rsort($mArgs); + return $mArgs[$entry]; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * LINEST + * + * Calculates the statistics for a line by using the "least squares" method to calculate a straight line that best fits your data, + * and then returns an array that describes the line. + * + * @param array of mixed Data Series Y + * @param array of mixed Data Series X + * @param boolean A logical value specifying whether to force the intersect to equal 0. + * @param boolean A logical value specifying whether to return additional regression statistics. + * @return array + */ + public static function LINEST($yValues, $xValues = null, $const = true, $stats = false) + { + $const = (is_null($const)) ? true : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($const); + $stats = (is_null($stats)) ? false : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($stats); + if (is_null($xValues)) { + $xValues = range(1, count(PHPExcel_Calculation_Functions::flattenArray($yValues))); + } + + if (!self::checkTrendArrays($yValues, $xValues)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $yValueCount = count($yValues); + $xValueCount = count($xValues); + + + if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { + return PHPExcel_Calculation_Functions::NA(); + } elseif ($yValueCount == 1) { + return 0; + } + + $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues, $const); + if ($stats) { + return array( + array( + $bestFitLinear->getSlope(), + $bestFitLinear->getSlopeSE(), + $bestFitLinear->getGoodnessOfFit(), + $bestFitLinear->getF(), + $bestFitLinear->getSSRegression(), + ), + array( + $bestFitLinear->getIntersect(), + $bestFitLinear->getIntersectSE(), + $bestFitLinear->getStdevOfResiduals(), + $bestFitLinear->getDFResiduals(), + $bestFitLinear->getSSResiduals() + ) + ); + } else { + return array( + $bestFitLinear->getSlope(), + $bestFitLinear->getIntersect() + ); + } + } + + + /** + * LOGEST + * + * Calculates an exponential curve that best fits the X and Y data series, + * and then returns an array that describes the line. + * + * @param array of mixed Data Series Y + * @param array of mixed Data Series X + * @param boolean A logical value specifying whether to force the intersect to equal 0. + * @param boolean A logical value specifying whether to return additional regression statistics. + * @return array + */ + public static function LOGEST($yValues, $xValues = null, $const = true, $stats = false) + { + $const = (is_null($const)) ? true : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($const); + $stats = (is_null($stats)) ? false : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($stats); + if (is_null($xValues)) { + $xValues = range(1, count(PHPExcel_Calculation_Functions::flattenArray($yValues))); + } + + if (!self::checkTrendArrays($yValues, $xValues)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $yValueCount = count($yValues); + $xValueCount = count($xValues); + + foreach ($yValues as $value) { + if ($value <= 0.0) { + return PHPExcel_Calculation_Functions::NaN(); + } + } + + + if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { + return PHPExcel_Calculation_Functions::NA(); + } elseif ($yValueCount == 1) { + return 1; + } + + $bestFitExponential = trendClass::calculate(trendClass::TREND_EXPONENTIAL, $yValues, $xValues, $const); + if ($stats) { + return array( + array( + $bestFitExponential->getSlope(), + $bestFitExponential->getSlopeSE(), + $bestFitExponential->getGoodnessOfFit(), + $bestFitExponential->getF(), + $bestFitExponential->getSSRegression(), + ), + array( + $bestFitExponential->getIntersect(), + $bestFitExponential->getIntersectSE(), + $bestFitExponential->getStdevOfResiduals(), + $bestFitExponential->getDFResiduals(), + $bestFitExponential->getSSResiduals() + ) + ); + } else { + return array( + $bestFitExponential->getSlope(), + $bestFitExponential->getIntersect() + ); + } + } + + + /** + * LOGINV + * + * Returns the inverse of the normal cumulative distribution + * + * @param float $probability + * @param float $mean + * @param float $stdDev + * @return float + * + * @todo Try implementing P J Acklam's refinement algorithm for greater + * accuracy if I can get my head round the mathematics + * (as described at) http://home.online.no/~pjacklam/notes/invnorm/ + */ + public static function LOGINV($probability, $mean, $stdDev) + { + $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); + $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean); + $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev); + + if ((is_numeric($probability)) && (is_numeric($mean)) && (is_numeric($stdDev))) { + if (($probability < 0) || ($probability > 1) || ($stdDev <= 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + return exp($mean + $stdDev * self::NORMSINV($probability)); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * LOGNORMDIST + * + * Returns the cumulative lognormal distribution of x, where ln(x) is normally distributed + * with parameters mean and standard_dev. + * + * @param float $value + * @param float $mean + * @param float $stdDev + * @return float + */ + public static function LOGNORMDIST($value, $mean, $stdDev) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean); + $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev); + + if ((is_numeric($value)) && (is_numeric($mean)) && (is_numeric($stdDev))) { + if (($value <= 0) || ($stdDev <= 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + return self::NORMSDIST((log($value) - $mean) / $stdDev); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * MAX + * + * MAX returns the value of the element of the values passed that has the highest value, + * with negative numbers considered smaller than positive numbers. + * + * Excel Function: + * MAX(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function MAX() + { + $returnValue = null; + + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + foreach ($aArgs as $arg) { + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + if ((is_null($returnValue)) || ($arg > $returnValue)) { + $returnValue = $arg; + } + } + } + + if (is_null($returnValue)) { + return 0; + } + return $returnValue; + } + + + /** + * MAXA + * + * Returns the greatest value in a list of arguments, including numbers, text, and logical values + * + * Excel Function: + * MAXA(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function MAXA() + { + $returnValue = null; + + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + foreach ($aArgs as $arg) { + // Is it a numeric value? + if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) { + if (is_bool($arg)) { + $arg = (integer) $arg; + } elseif (is_string($arg)) { + $arg = 0; + } + if ((is_null($returnValue)) || ($arg > $returnValue)) { + $returnValue = $arg; + } + } + } + + if (is_null($returnValue)) { + return 0; + } + return $returnValue; + } + + + /** + * MAXIF + * + * Counts the maximum value within a range of cells that contain numbers within the list of arguments + * + * Excel Function: + * MAXIF(value1[,value2[, ...]],condition) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param mixed $arg,... Data values + * @param string $condition The criteria that defines which cells will be checked. + * @return float + */ + public static function MAXIF($aArgs, $condition, $sumArgs = array()) + { + $returnValue = null; + + $aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs); + $sumArgs = PHPExcel_Calculation_Functions::flattenArray($sumArgs); + if (empty($sumArgs)) { + $sumArgs = $aArgs; + } + $condition = PHPExcel_Calculation_Functions::ifCondition($condition); + // Loop through arguments + foreach ($aArgs as $key => $arg) { + if (!is_numeric($arg)) { + $arg = PHPExcel_Calculation::wrapResult(strtoupper($arg)); + } + $testCondition = '='.$arg.$condition; + if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + if ((is_null($returnValue)) || ($arg > $returnValue)) { + $returnValue = $arg; + } + } + } + + return $returnValue; + } + + /** + * MEDIAN + * + * Returns the median of the given numbers. The median is the number in the middle of a set of numbers. + * + * Excel Function: + * MEDIAN(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function MEDIAN() + { + $returnValue = PHPExcel_Calculation_Functions::NaN(); + + $mArgs = array(); + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + foreach ($aArgs as $arg) { + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + $mArgs[] = $arg; + } + } + + $mValueCount = count($mArgs); + if ($mValueCount > 0) { + sort($mArgs, SORT_NUMERIC); + $mValueCount = $mValueCount / 2; + if ($mValueCount == floor($mValueCount)) { + $returnValue = ($mArgs[$mValueCount--] + $mArgs[$mValueCount]) / 2; + } else { + $mValueCount = floor($mValueCount); + $returnValue = $mArgs[$mValueCount]; + } + } + + return $returnValue; + } + + + /** + * MIN + * + * MIN returns the value of the element of the values passed that has the smallest value, + * with negative numbers considered smaller than positive numbers. + * + * Excel Function: + * MIN(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function MIN() + { + $returnValue = null; + + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + foreach ($aArgs as $arg) { + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + if ((is_null($returnValue)) || ($arg < $returnValue)) { + $returnValue = $arg; + } + } + } + + if (is_null($returnValue)) { + return 0; + } + return $returnValue; + } + + + /** + * MINA + * + * Returns the smallest value in a list of arguments, including numbers, text, and logical values + * + * Excel Function: + * MINA(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function MINA() + { + $returnValue = null; + + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + foreach ($aArgs as $arg) { + // Is it a numeric value? + if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) { + if (is_bool($arg)) { + $arg = (integer) $arg; + } elseif (is_string($arg)) { + $arg = 0; + } + if ((is_null($returnValue)) || ($arg < $returnValue)) { + $returnValue = $arg; + } + } + } + + if (is_null($returnValue)) { + return 0; + } + return $returnValue; + } + + + /** + * MINIF + * + * Returns the minimum value within a range of cells that contain numbers within the list of arguments + * + * Excel Function: + * MINIF(value1[,value2[, ...]],condition) + * + * @access public + * @category Mathematical and Trigonometric Functions + * @param mixed $arg,... Data values + * @param string $condition The criteria that defines which cells will be checked. + * @return float + */ + public static function MINIF($aArgs, $condition, $sumArgs = array()) + { + $returnValue = null; + + $aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs); + $sumArgs = PHPExcel_Calculation_Functions::flattenArray($sumArgs); + if (empty($sumArgs)) { + $sumArgs = $aArgs; + } + $condition = PHPExcel_Calculation_Functions::ifCondition($condition); + // Loop through arguments + foreach ($aArgs as $key => $arg) { + if (!is_numeric($arg)) { + $arg = PHPExcel_Calculation::wrapResult(strtoupper($arg)); + } + $testCondition = '='.$arg.$condition; + if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + if ((is_null($returnValue)) || ($arg < $returnValue)) { + $returnValue = $arg; + } + } + } + + return $returnValue; + } + + + // + // Special variant of array_count_values that isn't limited to strings and integers, + // but can work with floating point numbers as values + // + private static function modeCalc($data) + { + $frequencyArray = array(); + foreach ($data as $datum) { + $found = false; + foreach ($frequencyArray as $key => $value) { + if ((string) $value['value'] == (string) $datum) { + ++$frequencyArray[$key]['frequency']; + $found = true; + break; + } + } + if (!$found) { + $frequencyArray[] = array( + 'value' => $datum, + 'frequency' => 1 + ); + } + } + + foreach ($frequencyArray as $key => $value) { + $frequencyList[$key] = $value['frequency']; + $valueList[$key] = $value['value']; + } + array_multisort($frequencyList, SORT_DESC, $valueList, SORT_ASC, SORT_NUMERIC, $frequencyArray); + + if ($frequencyArray[0]['frequency'] == 1) { + return PHPExcel_Calculation_Functions::NA(); + } + return $frequencyArray[0]['value']; + } + + + /** + * MODE + * + * Returns the most frequently occurring, or repetitive, value in an array or range of data + * + * Excel Function: + * MODE(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function MODE() + { + $returnValue = PHPExcel_Calculation_Functions::NA(); + + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + + $mArgs = array(); + foreach ($aArgs as $arg) { + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + $mArgs[] = $arg; + } + } + + if (!empty($mArgs)) { + return self::modeCalc($mArgs); + } + + return $returnValue; + } + + + /** + * NEGBINOMDIST + * + * Returns the negative binomial distribution. NEGBINOMDIST returns the probability that + * there will be number_f failures before the number_s-th success, when the constant + * probability of a success is probability_s. This function is similar to the binomial + * distribution, except that the number of successes is fixed, and the number of trials is + * variable. Like the binomial, trials are assumed to be independent. + * + * @param float $failures Number of Failures + * @param float $successes Threshold number of Successes + * @param float $probability Probability of success on each trial + * @return float + * + */ + public static function NEGBINOMDIST($failures, $successes, $probability) + { + $failures = floor(PHPExcel_Calculation_Functions::flattenSingleValue($failures)); + $successes = floor(PHPExcel_Calculation_Functions::flattenSingleValue($successes)); + $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); + + if ((is_numeric($failures)) && (is_numeric($successes)) && (is_numeric($probability))) { + if (($failures < 0) || ($successes < 1)) { + return PHPExcel_Calculation_Functions::NaN(); + } elseif (($probability < 0) || ($probability > 1)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { + if (($failures + $successes - 1) <= 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + } + return (PHPExcel_Calculation_MathTrig::COMBIN($failures + $successes - 1, $successes - 1)) * (pow($probability, $successes)) * (pow(1 - $probability, $failures)); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * NORMDIST + * + * Returns the normal distribution for the specified mean and standard deviation. This + * function has a very wide range of applications in statistics, including hypothesis + * testing. + * + * @param float $value + * @param float $mean Mean Value + * @param float $stdDev Standard Deviation + * @param boolean $cumulative + * @return float + * + */ + public static function NORMDIST($value, $mean, $stdDev, $cumulative) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean); + $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev); + + if ((is_numeric($value)) && (is_numeric($mean)) && (is_numeric($stdDev))) { + if ($stdDev < 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ((is_numeric($cumulative)) || (is_bool($cumulative))) { + if ($cumulative) { + return 0.5 * (1 + PHPExcel_Calculation_Engineering::erfVal(($value - $mean) / ($stdDev * sqrt(2)))); + } else { + return (1 / (SQRT2PI * $stdDev)) * exp(0 - (pow($value - $mean, 2) / (2 * ($stdDev * $stdDev)))); + } + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * NORMINV + * + * Returns the inverse of the normal cumulative distribution for the specified mean and standard deviation. + * + * @param float $value + * @param float $mean Mean Value + * @param float $stdDev Standard Deviation + * @return float + * + */ + public static function NORMINV($probability, $mean, $stdDev) + { + $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); + $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean); + $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev); + + if ((is_numeric($probability)) && (is_numeric($mean)) && (is_numeric($stdDev))) { + if (($probability < 0) || ($probability > 1)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ($stdDev < 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + return (self::inverseNcdf($probability) * $stdDev) + $mean; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * NORMSDIST + * + * Returns the standard normal cumulative distribution function. The distribution has + * a mean of 0 (zero) and a standard deviation of one. Use this function in place of a + * table of standard normal curve areas. + * + * @param float $value + * @return float + */ + public static function NORMSDIST($value) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + + return self::NORMDIST($value, 0, 1, true); + } + + + /** + * NORMSINV + * + * Returns the inverse of the standard normal cumulative distribution + * + * @param float $value + * @return float + */ + public static function NORMSINV($value) + { + return self::NORMINV($value, 0, 1); + } + + + /** + * PERCENTILE + * + * Returns the nth percentile of values in a range.. + * + * Excel Function: + * PERCENTILE(value1[,value2[, ...]],entry) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @param float $entry Percentile value in the range 0..1, inclusive. + * @return float + */ + public static function PERCENTILE() + { + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + + // Calculate + $entry = array_pop($aArgs); + + if ((is_numeric($entry)) && (!is_string($entry))) { + if (($entry < 0) || ($entry > 1)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $mArgs = array(); + foreach ($aArgs as $arg) { + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + $mArgs[] = $arg; + } + } + $mValueCount = count($mArgs); + if ($mValueCount > 0) { + sort($mArgs); + $count = self::COUNT($mArgs); + $index = $entry * ($count-1); + $iBase = floor($index); + if ($index == $iBase) { + return $mArgs[$index]; + } else { + $iNext = $iBase + 1; + $iProportion = $index - $iBase; + return $mArgs[$iBase] + (($mArgs[$iNext] - $mArgs[$iBase]) * $iProportion) ; + } + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * PERCENTRANK + * + * Returns the rank of a value in a data set as a percentage of the data set. + * + * @param array of number An array of, or a reference to, a list of numbers. + * @param number The number whose rank you want to find. + * @param number The number of significant digits for the returned percentage value. + * @return float + */ + public static function PERCENTRANK($valueSet, $value, $significance = 3) + { + $valueSet = PHPExcel_Calculation_Functions::flattenArray($valueSet); + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $significance = (is_null($significance)) ? 3 : (integer) PHPExcel_Calculation_Functions::flattenSingleValue($significance); + + foreach ($valueSet as $key => $valueEntry) { + if (!is_numeric($valueEntry)) { + unset($valueSet[$key]); + } + } + sort($valueSet, SORT_NUMERIC); + $valueCount = count($valueSet); + if ($valueCount == 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + + $valueAdjustor = $valueCount - 1; + if (($value < $valueSet[0]) || ($value > $valueSet[$valueAdjustor])) { + return PHPExcel_Calculation_Functions::NA(); + } + + $pos = array_search($value, $valueSet); + if ($pos === false) { + $pos = 0; + $testValue = $valueSet[0]; + while ($testValue < $value) { + $testValue = $valueSet[++$pos]; + } + --$pos; + $pos += (($value - $valueSet[$pos]) / ($testValue - $valueSet[$pos])); + } + + return round($pos / $valueAdjustor, $significance); + } + + + /** + * PERMUT + * + * Returns the number of permutations for a given number of objects that can be + * selected from number objects. A permutation is any set or subset of objects or + * events where internal order is significant. Permutations are different from + * combinations, for which the internal order is not significant. Use this function + * for lottery-style probability calculations. + * + * @param int $numObjs Number of different objects + * @param int $numInSet Number of objects in each permutation + * @return int Number of permutations + */ + public static function PERMUT($numObjs, $numInSet) + { + $numObjs = PHPExcel_Calculation_Functions::flattenSingleValue($numObjs); + $numInSet = PHPExcel_Calculation_Functions::flattenSingleValue($numInSet); + + if ((is_numeric($numObjs)) && (is_numeric($numInSet))) { + $numInSet = floor($numInSet); + if ($numObjs < $numInSet) { + return PHPExcel_Calculation_Functions::NaN(); + } + return round(PHPExcel_Calculation_MathTrig::FACT($numObjs) / PHPExcel_Calculation_MathTrig::FACT($numObjs - $numInSet)); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * POISSON + * + * Returns the Poisson distribution. A common application of the Poisson distribution + * is predicting the number of events over a specific time, such as the number of + * cars arriving at a toll plaza in 1 minute. + * + * @param float $value + * @param float $mean Mean Value + * @param boolean $cumulative + * @return float + * + */ + public static function POISSON($value, $mean, $cumulative) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean); + + if ((is_numeric($value)) && (is_numeric($mean))) { + if (($value < 0) || ($mean <= 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ((is_numeric($cumulative)) || (is_bool($cumulative))) { + if ($cumulative) { + $summer = 0; + for ($i = 0; $i <= floor($value); ++$i) { + $summer += pow($mean, $i) / PHPExcel_Calculation_MathTrig::FACT($i); + } + return exp(0-$mean) * $summer; + } else { + return (exp(0-$mean) * pow($mean, $value)) / PHPExcel_Calculation_MathTrig::FACT($value); + } + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * QUARTILE + * + * Returns the quartile of a data set. + * + * Excel Function: + * QUARTILE(value1[,value2[, ...]],entry) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @param int $entry Quartile value in the range 1..3, inclusive. + * @return float + */ + public static function QUARTILE() + { + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + + // Calculate + $entry = floor(array_pop($aArgs)); + + if ((is_numeric($entry)) && (!is_string($entry))) { + $entry /= 4; + if (($entry < 0) || ($entry > 1)) { + return PHPExcel_Calculation_Functions::NaN(); + } + return self::PERCENTILE($aArgs, $entry); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * RANK + * + * Returns the rank of a number in a list of numbers. + * + * @param number The number whose rank you want to find. + * @param array of number An array of, or a reference to, a list of numbers. + * @param mixed Order to sort the values in the value set + * @return float + */ + public static function RANK($value, $valueSet, $order = 0) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $valueSet = PHPExcel_Calculation_Functions::flattenArray($valueSet); + $order = (is_null($order)) ? 0 : (integer) PHPExcel_Calculation_Functions::flattenSingleValue($order); + + foreach ($valueSet as $key => $valueEntry) { + if (!is_numeric($valueEntry)) { + unset($valueSet[$key]); + } + } + + if ($order == 0) { + rsort($valueSet, SORT_NUMERIC); + } else { + sort($valueSet, SORT_NUMERIC); + } + $pos = array_search($value, $valueSet); + if ($pos === false) { + return PHPExcel_Calculation_Functions::NA(); + } + + return ++$pos; + } + + + /** + * RSQ + * + * Returns the square of the Pearson product moment correlation coefficient through data points in known_y's and known_x's. + * + * @param array of mixed Data Series Y + * @param array of mixed Data Series X + * @return float + */ + public static function RSQ($yValues, $xValues) + { + if (!self::checkTrendArrays($yValues, $xValues)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $yValueCount = count($yValues); + $xValueCount = count($xValues); + + if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { + return PHPExcel_Calculation_Functions::NA(); + } elseif ($yValueCount == 1) { + return PHPExcel_Calculation_Functions::DIV0(); + } + + $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues); + return $bestFitLinear->getGoodnessOfFit(); + } + + + /** + * SKEW + * + * Returns the skewness of a distribution. Skewness characterizes the degree of asymmetry + * of a distribution around its mean. Positive skewness indicates a distribution with an + * asymmetric tail extending toward more positive values. Negative skewness indicates a + * distribution with an asymmetric tail extending toward more negative values. + * + * @param array Data Series + * @return float + */ + public static function SKEW() + { + $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); + $mean = self::AVERAGE($aArgs); + $stdDev = self::STDEV($aArgs); + + $count = $summer = 0; + // Loop through arguments + foreach ($aArgs as $k => $arg) { + if ((is_bool($arg)) && + (!PHPExcel_Calculation_Functions::isMatrixValue($k))) { + } else { + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + $summer += pow((($arg - $mean) / $stdDev), 3); + ++$count; + } + } + } + + if ($count > 2) { + return $summer * ($count / (($count-1) * ($count-2))); + } + return PHPExcel_Calculation_Functions::DIV0(); + } + + + /** + * SLOPE + * + * Returns the slope of the linear regression line through data points in known_y's and known_x's. + * + * @param array of mixed Data Series Y + * @param array of mixed Data Series X + * @return float + */ + public static function SLOPE($yValues, $xValues) + { + if (!self::checkTrendArrays($yValues, $xValues)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $yValueCount = count($yValues); + $xValueCount = count($xValues); + + if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { + return PHPExcel_Calculation_Functions::NA(); + } elseif ($yValueCount == 1) { + return PHPExcel_Calculation_Functions::DIV0(); + } + + $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues); + return $bestFitLinear->getSlope(); + } + + + /** + * SMALL + * + * Returns the nth smallest value in a data set. You can use this function to + * select a value based on its relative standing. + * + * Excel Function: + * SMALL(value1[,value2[, ...]],entry) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @param int $entry Position (ordered from the smallest) in the array or range of data to return + * @return float + */ + public static function SMALL() + { + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + + // Calculate + $entry = array_pop($aArgs); + + if ((is_numeric($entry)) && (!is_string($entry))) { + $mArgs = array(); + foreach ($aArgs as $arg) { + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + $mArgs[] = $arg; + } + } + $count = self::COUNT($mArgs); + $entry = floor(--$entry); + if (($entry < 0) || ($entry >= $count) || ($count == 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + sort($mArgs); + return $mArgs[$entry]; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * STANDARDIZE + * + * Returns a normalized value from a distribution characterized by mean and standard_dev. + * + * @param float $value Value to normalize + * @param float $mean Mean Value + * @param float $stdDev Standard Deviation + * @return float Standardized value + */ + public static function STANDARDIZE($value, $mean, $stdDev) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean); + $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev); + + if ((is_numeric($value)) && (is_numeric($mean)) && (is_numeric($stdDev))) { + if ($stdDev <= 0) { + return PHPExcel_Calculation_Functions::NaN(); + } + return ($value - $mean) / $stdDev ; + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * STDEV + * + * Estimates standard deviation based on a sample. The standard deviation is a measure of how + * widely values are dispersed from the average value (the mean). + * + * Excel Function: + * STDEV(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function STDEV() + { + $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); + + // Return value + $returnValue = null; + + $aMean = self::AVERAGE($aArgs); + if (!is_null($aMean)) { + $aCount = -1; + foreach ($aArgs as $k => $arg) { + if ((is_bool($arg)) && + ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) { + $arg = (integer) $arg; + } + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + if (is_null($returnValue)) { + $returnValue = pow(($arg - $aMean), 2); + } else { + $returnValue += pow(($arg - $aMean), 2); + } + ++$aCount; + } + } + + // Return + if (($aCount > 0) && ($returnValue >= 0)) { + return sqrt($returnValue / $aCount); + } + } + return PHPExcel_Calculation_Functions::DIV0(); + } + + + /** + * STDEVA + * + * Estimates standard deviation based on a sample, including numbers, text, and logical values + * + * Excel Function: + * STDEVA(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function STDEVA() + { + $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); + + $returnValue = null; + + $aMean = self::AVERAGEA($aArgs); + if (!is_null($aMean)) { + $aCount = -1; + foreach ($aArgs as $k => $arg) { + if ((is_bool($arg)) && + (!PHPExcel_Calculation_Functions::isMatrixValue($k))) { + } else { + // Is it a numeric value? + if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) & ($arg != '')))) { + if (is_bool($arg)) { + $arg = (integer) $arg; + } elseif (is_string($arg)) { + $arg = 0; + } + if (is_null($returnValue)) { + $returnValue = pow(($arg - $aMean), 2); + } else { + $returnValue += pow(($arg - $aMean), 2); + } + ++$aCount; + } + } + } + + if (($aCount > 0) && ($returnValue >= 0)) { + return sqrt($returnValue / $aCount); + } + } + return PHPExcel_Calculation_Functions::DIV0(); + } + + + /** + * STDEVP + * + * Calculates standard deviation based on the entire population + * + * Excel Function: + * STDEVP(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function STDEVP() + { + $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); + + $returnValue = null; + + $aMean = self::AVERAGE($aArgs); + if (!is_null($aMean)) { + $aCount = 0; + foreach ($aArgs as $k => $arg) { + if ((is_bool($arg)) && + ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) { + $arg = (integer) $arg; + } + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + if (is_null($returnValue)) { + $returnValue = pow(($arg - $aMean), 2); + } else { + $returnValue += pow(($arg - $aMean), 2); + } + ++$aCount; + } + } + + if (($aCount > 0) && ($returnValue >= 0)) { + return sqrt($returnValue / $aCount); + } + } + return PHPExcel_Calculation_Functions::DIV0(); + } + + + /** + * STDEVPA + * + * Calculates standard deviation based on the entire population, including numbers, text, and logical values + * + * Excel Function: + * STDEVPA(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function STDEVPA() + { + $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); + + $returnValue = null; + + $aMean = self::AVERAGEA($aArgs); + if (!is_null($aMean)) { + $aCount = 0; + foreach ($aArgs as $k => $arg) { + if ((is_bool($arg)) && + (!PHPExcel_Calculation_Functions::isMatrixValue($k))) { + } else { + // Is it a numeric value? + if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) & ($arg != '')))) { + if (is_bool($arg)) { + $arg = (integer) $arg; + } elseif (is_string($arg)) { + $arg = 0; + } + if (is_null($returnValue)) { + $returnValue = pow(($arg - $aMean), 2); + } else { + $returnValue += pow(($arg - $aMean), 2); + } + ++$aCount; + } + } + } + + if (($aCount > 0) && ($returnValue >= 0)) { + return sqrt($returnValue / $aCount); + } + } + return PHPExcel_Calculation_Functions::DIV0(); + } + + + /** + * STEYX + * + * Returns the standard error of the predicted y-value for each x in the regression. + * + * @param array of mixed Data Series Y + * @param array of mixed Data Series X + * @return float + */ + public static function STEYX($yValues, $xValues) + { + if (!self::checkTrendArrays($yValues, $xValues)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $yValueCount = count($yValues); + $xValueCount = count($xValues); + + if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { + return PHPExcel_Calculation_Functions::NA(); + } elseif ($yValueCount == 1) { + return PHPExcel_Calculation_Functions::DIV0(); + } + + $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues); + return $bestFitLinear->getStdevOfResiduals(); + } + + + /** + * TDIST + * + * Returns the probability of Student's T distribution. + * + * @param float $value Value for the function + * @param float $degrees degrees of freedom + * @param float $tails number of tails (1 or 2) + * @return float + */ + public static function TDIST($value, $degrees, $tails) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $degrees = floor(PHPExcel_Calculation_Functions::flattenSingleValue($degrees)); + $tails = floor(PHPExcel_Calculation_Functions::flattenSingleValue($tails)); + + if ((is_numeric($value)) && (is_numeric($degrees)) && (is_numeric($tails))) { + if (($value < 0) || ($degrees < 1) || ($tails < 1) || ($tails > 2)) { + return PHPExcel_Calculation_Functions::NaN(); + } + // tdist, which finds the probability that corresponds to a given value + // of t with k degrees of freedom. This algorithm is translated from a + // pascal function on p81 of "Statistical Computing in Pascal" by D + // Cooke, A H Craven & G M Clark (1985: Edward Arnold (Pubs.) Ltd: + // London). The above Pascal algorithm is itself a translation of the + // fortran algoritm "AS 3" by B E Cooper of the Atlas Computer + // Laboratory as reported in (among other places) "Applied Statistics + // Algorithms", editied by P Griffiths and I D Hill (1985; Ellis + // Horwood Ltd.; W. Sussex, England). + $tterm = $degrees; + $ttheta = atan2($value, sqrt($tterm)); + $tc = cos($ttheta); + $ts = sin($ttheta); + $tsum = 0; + + if (($degrees % 2) == 1) { + $ti = 3; + $tterm = $tc; + } else { + $ti = 2; + $tterm = 1; + } + + $tsum = $tterm; + while ($ti < $degrees) { + $tterm *= $tc * $tc * ($ti - 1) / $ti; + $tsum += $tterm; + $ti += 2; + } + $tsum *= $ts; + if (($degrees % 2) == 1) { + $tsum = M_2DIVPI * ($tsum + $ttheta); + } + $tValue = 0.5 * (1 + $tsum); + if ($tails == 1) { + return 1 - abs($tValue); + } else { + return 1 - abs((1 - $tValue) - $tValue); + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * TINV + * + * Returns the one-tailed probability of the chi-squared distribution. + * + * @param float $probability Probability for the function + * @param float $degrees degrees of freedom + * @return float + */ + public static function TINV($probability, $degrees) + { + $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); + $degrees = floor(PHPExcel_Calculation_Functions::flattenSingleValue($degrees)); + + if ((is_numeric($probability)) && (is_numeric($degrees))) { + $xLo = 100; + $xHi = 0; + + $x = $xNew = 1; + $dx = 1; + $i = 0; + + while ((abs($dx) > PRECISION) && ($i++ < MAX_ITERATIONS)) { + // Apply Newton-Raphson step + $result = self::TDIST($x, $degrees, 2); + $error = $result - $probability; + if ($error == 0.0) { + $dx = 0; + } elseif ($error < 0.0) { + $xLo = $x; + } else { + $xHi = $x; + } + // Avoid division by zero + if ($result != 0.0) { + $dx = $error / $result; + $xNew = $x - $dx; + } + // If the NR fails to converge (which for example may be the + // case if the initial guess is too rough) we apply a bisection + // step to determine a more narrow interval around the root. + if (($xNew < $xLo) || ($xNew > $xHi) || ($result == 0.0)) { + $xNew = ($xLo + $xHi) / 2; + $dx = $xNew - $x; + } + $x = $xNew; + } + if ($i == MAX_ITERATIONS) { + return PHPExcel_Calculation_Functions::NA(); + } + return round($x, 12); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * TREND + * + * Returns values along a linear trend + * + * @param array of mixed Data Series Y + * @param array of mixed Data Series X + * @param array of mixed Values of X for which we want to find Y + * @param boolean A logical value specifying whether to force the intersect to equal 0. + * @return array of float + */ + public static function TREND($yValues, $xValues = array(), $newValues = array(), $const = true) + { + $yValues = PHPExcel_Calculation_Functions::flattenArray($yValues); + $xValues = PHPExcel_Calculation_Functions::flattenArray($xValues); + $newValues = PHPExcel_Calculation_Functions::flattenArray($newValues); + $const = (is_null($const)) ? true : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($const); + + $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues, $const); + if (empty($newValues)) { + $newValues = $bestFitLinear->getXValues(); + } + + $returnArray = array(); + foreach ($newValues as $xValue) { + $returnArray[0][] = $bestFitLinear->getValueOfYForX($xValue); + } + + return $returnArray; + } + + + /** + * TRIMMEAN + * + * Returns the mean of the interior of a data set. TRIMMEAN calculates the mean + * taken by excluding a percentage of data points from the top and bottom tails + * of a data set. + * + * Excel Function: + * TRIMEAN(value1[,value2[, ...]], $discard) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @param float $discard Percentage to discard + * @return float + */ + public static function TRIMMEAN() + { + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + + // Calculate + $percent = array_pop($aArgs); + + if ((is_numeric($percent)) && (!is_string($percent))) { + if (($percent < 0) || ($percent > 1)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $mArgs = array(); + foreach ($aArgs as $arg) { + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + $mArgs[] = $arg; + } + } + $discard = floor(self::COUNT($mArgs) * $percent / 2); + sort($mArgs); + for ($i=0; $i < $discard; ++$i) { + array_pop($mArgs); + array_shift($mArgs); + } + return self::AVERAGE($mArgs); + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * VARFunc + * + * Estimates variance based on a sample. + * + * Excel Function: + * VAR(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function VARFunc() + { + $returnValue = PHPExcel_Calculation_Functions::DIV0(); + + $summerA = $summerB = 0; + + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + $aCount = 0; + foreach ($aArgs as $arg) { + if (is_bool($arg)) { + $arg = (integer) $arg; + } + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + $summerA += ($arg * $arg); + $summerB += $arg; + ++$aCount; + } + } + + if ($aCount > 1) { + $summerA *= $aCount; + $summerB *= $summerB; + $returnValue = ($summerA - $summerB) / ($aCount * ($aCount - 1)); + } + return $returnValue; + } + + + /** + * VARA + * + * Estimates variance based on a sample, including numbers, text, and logical values + * + * Excel Function: + * VARA(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function VARA() + { + $returnValue = PHPExcel_Calculation_Functions::DIV0(); + + $summerA = $summerB = 0; + + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); + $aCount = 0; + foreach ($aArgs as $k => $arg) { + if ((is_string($arg)) && + (PHPExcel_Calculation_Functions::isValue($k))) { + return PHPExcel_Calculation_Functions::VALUE(); + } elseif ((is_string($arg)) && + (!PHPExcel_Calculation_Functions::isMatrixValue($k))) { + } else { + // Is it a numeric value? + if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) & ($arg != '')))) { + if (is_bool($arg)) { + $arg = (integer) $arg; + } elseif (is_string($arg)) { + $arg = 0; + } + $summerA += ($arg * $arg); + $summerB += $arg; + ++$aCount; + } + } + } + + if ($aCount > 1) { + $summerA *= $aCount; + $summerB *= $summerB; + $returnValue = ($summerA - $summerB) / ($aCount * ($aCount - 1)); + } + return $returnValue; + } + + + /** + * VARP + * + * Calculates variance based on the entire population + * + * Excel Function: + * VARP(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function VARP() + { + // Return value + $returnValue = PHPExcel_Calculation_Functions::DIV0(); + + $summerA = $summerB = 0; + + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + $aCount = 0; + foreach ($aArgs as $arg) { + if (is_bool($arg)) { + $arg = (integer) $arg; + } + // Is it a numeric value? + if ((is_numeric($arg)) && (!is_string($arg))) { + $summerA += ($arg * $arg); + $summerB += $arg; + ++$aCount; + } + } + + if ($aCount > 0) { + $summerA *= $aCount; + $summerB *= $summerB; + $returnValue = ($summerA - $summerB) / ($aCount * $aCount); + } + return $returnValue; + } + + + /** + * VARPA + * + * Calculates variance based on the entire population, including numbers, text, and logical values + * + * Excel Function: + * VARPA(value1[,value2[, ...]]) + * + * @access public + * @category Statistical Functions + * @param mixed $arg,... Data values + * @return float + */ + public static function VARPA() + { + $returnValue = PHPExcel_Calculation_Functions::DIV0(); + + $summerA = $summerB = 0; + + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); + $aCount = 0; + foreach ($aArgs as $k => $arg) { + if ((is_string($arg)) && + (PHPExcel_Calculation_Functions::isValue($k))) { + return PHPExcel_Calculation_Functions::VALUE(); + } elseif ((is_string($arg)) && + (!PHPExcel_Calculation_Functions::isMatrixValue($k))) { + } else { + // Is it a numeric value? + if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) & ($arg != '')))) { + if (is_bool($arg)) { + $arg = (integer) $arg; + } elseif (is_string($arg)) { + $arg = 0; + } + $summerA += ($arg * $arg); + $summerB += $arg; + ++$aCount; + } + } + } + + if ($aCount > 0) { + $summerA *= $aCount; + $summerB *= $summerB; + $returnValue = ($summerA - $summerB) / ($aCount * $aCount); + } + return $returnValue; + } + + + /** + * WEIBULL + * + * Returns the Weibull distribution. Use this distribution in reliability + * analysis, such as calculating a device's mean time to failure. + * + * @param float $value + * @param float $alpha Alpha Parameter + * @param float $beta Beta Parameter + * @param boolean $cumulative + * @return float + * + */ + public static function WEIBULL($value, $alpha, $beta, $cumulative) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha); + $beta = PHPExcel_Calculation_Functions::flattenSingleValue($beta); + + if ((is_numeric($value)) && (is_numeric($alpha)) && (is_numeric($beta))) { + if (($value < 0) || ($alpha <= 0) || ($beta <= 0)) { + return PHPExcel_Calculation_Functions::NaN(); + } + if ((is_numeric($cumulative)) || (is_bool($cumulative))) { + if ($cumulative) { + return 1 - exp(0 - pow($value / $beta, $alpha)); + } else { + return ($alpha / pow($beta, $alpha)) * pow($value, $alpha - 1) * exp(0 - pow($value / $beta, $alpha)); + } + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * ZTEST + * + * Returns the Weibull distribution. Use this distribution in reliability + * analysis, such as calculating a device's mean time to failure. + * + * @param float $dataSet + * @param float $m0 Alpha Parameter + * @param float $sigma Beta Parameter + * @param boolean $cumulative + * @return float + * + */ + public static function ZTEST($dataSet, $m0, $sigma = null) + { + $dataSet = PHPExcel_Calculation_Functions::flattenArrayIndexed($dataSet); + $m0 = PHPExcel_Calculation_Functions::flattenSingleValue($m0); + $sigma = PHPExcel_Calculation_Functions::flattenSingleValue($sigma); + + if (is_null($sigma)) { + $sigma = self::STDEV($dataSet); + } + $n = count($dataSet); + + return 1 - self::NORMSDIST((self::AVERAGE($dataSet) - $m0) / ($sigma / SQRT($n))); + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation/TextData.php b/extend/PHPExcel/PHPExcel/Calculation/TextData.php new file mode 100644 index 0000000..6461d06 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation/TextData.php @@ -0,0 +1,651 @@ +=0 && ord($c{0}) <= 127) { + return ord($c{0}); + } elseif (ord($c{0}) >= 192 && ord($c{0}) <= 223) { + return (ord($c{0})-192)*64 + (ord($c{1})-128); + } elseif (ord($c{0}) >= 224 && ord($c{0}) <= 239) { + return (ord($c{0})-224)*4096 + (ord($c{1})-128)*64 + (ord($c{2})-128); + } elseif (ord($c{0}) >= 240 && ord($c{0}) <= 247) { + return (ord($c{0})-240)*262144 + (ord($c{1})-128)*4096 + (ord($c{2})-128)*64 + (ord($c{3})-128); + } elseif (ord($c{0}) >= 248 && ord($c{0}) <= 251) { + return (ord($c{0})-248)*16777216 + (ord($c{1})-128)*262144 + (ord($c{2})-128)*4096 + (ord($c{3})-128)*64 + (ord($c{4})-128); + } elseif (ord($c{0}) >= 252 && ord($c{0}) <= 253) { + return (ord($c{0})-252)*1073741824 + (ord($c{1})-128)*16777216 + (ord($c{2})-128)*262144 + (ord($c{3})-128)*4096 + (ord($c{4})-128)*64 + (ord($c{5})-128); + } elseif (ord($c{0}) >= 254 && ord($c{0}) <= 255) { + // error + return PHPExcel_Calculation_Functions::VALUE(); + } + return 0; + } + + /** + * CHARACTER + * + * @param string $character Value + * @return int + */ + public static function CHARACTER($character) + { + $character = PHPExcel_Calculation_Functions::flattenSingleValue($character); + + if ((!is_numeric($character)) || ($character < 0)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + if (function_exists('mb_convert_encoding')) { + return mb_convert_encoding('&#'.intval($character).';', 'UTF-8', 'HTML-ENTITIES'); + } else { + return chr(intval($character)); + } + } + + + /** + * TRIMNONPRINTABLE + * + * @param mixed $stringValue Value to check + * @return string + */ + public static function TRIMNONPRINTABLE($stringValue = '') + { + $stringValue = PHPExcel_Calculation_Functions::flattenSingleValue($stringValue); + + if (is_bool($stringValue)) { + return ($stringValue) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE(); + } + + if (self::$invalidChars == null) { + self::$invalidChars = range(chr(0), chr(31)); + } + + if (is_string($stringValue) || is_numeric($stringValue)) { + return str_replace(self::$invalidChars, '', trim($stringValue, "\x00..\x1F")); + } + return null; + } + + + /** + * TRIMSPACES + * + * @param mixed $stringValue Value to check + * @return string + */ + public static function TRIMSPACES($stringValue = '') + { + $stringValue = PHPExcel_Calculation_Functions::flattenSingleValue($stringValue); + if (is_bool($stringValue)) { + return ($stringValue) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE(); + } + + if (is_string($stringValue) || is_numeric($stringValue)) { + return trim(preg_replace('/ +/', ' ', trim($stringValue, ' ')), ' '); + } + return null; + } + + + /** + * ASCIICODE + * + * @param string $characters Value + * @return int + */ + public static function ASCIICODE($characters) + { + if (($characters === null) || ($characters === '')) { + return PHPExcel_Calculation_Functions::VALUE(); + } + $characters = PHPExcel_Calculation_Functions::flattenSingleValue($characters); + if (is_bool($characters)) { + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { + $characters = (int) $characters; + } else { + $characters = ($characters) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE(); + } + } + + $character = $characters; + if ((function_exists('mb_strlen')) && (function_exists('mb_substr'))) { + if (mb_strlen($characters, 'UTF-8') > 1) { + $character = mb_substr($characters, 0, 1, 'UTF-8'); + } + return self::unicodeToOrd($character); + } else { + if (strlen($characters) > 0) { + $character = substr($characters, 0, 1); + } + return ord($character); + } + } + + + /** + * CONCATENATE + * + * @return string + */ + public static function CONCATENATE() + { + $returnValue = ''; + + // Loop through arguments + $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); + foreach ($aArgs as $arg) { + if (is_bool($arg)) { + if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { + $arg = (int) $arg; + } else { + $arg = ($arg) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE(); + } + } + $returnValue .= $arg; + } + + return $returnValue; + } + + + /** + * DOLLAR + * + * This function converts a number to text using currency format, with the decimals rounded to the specified place. + * The format used is $#,##0.00_);($#,##0.00).. + * + * @param float $value The value to format + * @param int $decimals The number of digits to display to the right of the decimal point. + * If decimals is negative, number is rounded to the left of the decimal point. + * If you omit decimals, it is assumed to be 2 + * @return string + */ + public static function DOLLAR($value = 0, $decimals = 2) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $decimals = is_null($decimals) ? 0 : PHPExcel_Calculation_Functions::flattenSingleValue($decimals); + + // Validate parameters + if (!is_numeric($value) || !is_numeric($decimals)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $decimals = floor($decimals); + + $mask = '$#,##0'; + if ($decimals > 0) { + $mask .= '.' . str_repeat('0', $decimals); + } else { + $round = pow(10, abs($decimals)); + if ($value < 0) { + $round = 0-$round; + } + $value = PHPExcel_Calculation_MathTrig::MROUND($value, $round); + } + + return PHPExcel_Style_NumberFormat::toFormattedString($value, $mask); + + } + + + /** + * SEARCHSENSITIVE + * + * @param string $needle The string to look for + * @param string $haystack The string in which to look + * @param int $offset Offset within $haystack + * @return string + */ + public static function SEARCHSENSITIVE($needle, $haystack, $offset = 1) + { + $needle = PHPExcel_Calculation_Functions::flattenSingleValue($needle); + $haystack = PHPExcel_Calculation_Functions::flattenSingleValue($haystack); + $offset = PHPExcel_Calculation_Functions::flattenSingleValue($offset); + + if (!is_bool($needle)) { + if (is_bool($haystack)) { + $haystack = ($haystack) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE(); + } + + if (($offset > 0) && (PHPExcel_Shared_String::CountCharacters($haystack) > $offset)) { + if (PHPExcel_Shared_String::CountCharacters($needle) == 0) { + return $offset; + } + if (function_exists('mb_strpos')) { + $pos = mb_strpos($haystack, $needle, --$offset, 'UTF-8'); + } else { + $pos = strpos($haystack, $needle, --$offset); + } + if ($pos !== false) { + return ++$pos; + } + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * SEARCHINSENSITIVE + * + * @param string $needle The string to look for + * @param string $haystack The string in which to look + * @param int $offset Offset within $haystack + * @return string + */ + public static function SEARCHINSENSITIVE($needle, $haystack, $offset = 1) + { + $needle = PHPExcel_Calculation_Functions::flattenSingleValue($needle); + $haystack = PHPExcel_Calculation_Functions::flattenSingleValue($haystack); + $offset = PHPExcel_Calculation_Functions::flattenSingleValue($offset); + + if (!is_bool($needle)) { + if (is_bool($haystack)) { + $haystack = ($haystack) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE(); + } + + if (($offset > 0) && (PHPExcel_Shared_String::CountCharacters($haystack) > $offset)) { + if (PHPExcel_Shared_String::CountCharacters($needle) == 0) { + return $offset; + } + if (function_exists('mb_stripos')) { + $pos = mb_stripos($haystack, $needle, --$offset, 'UTF-8'); + } else { + $pos = stripos($haystack, $needle, --$offset); + } + if ($pos !== false) { + return ++$pos; + } + } + } + return PHPExcel_Calculation_Functions::VALUE(); + } + + + /** + * FIXEDFORMAT + * + * @param mixed $value Value to check + * @param integer $decimals + * @param boolean $no_commas + * @return boolean + */ + public static function FIXEDFORMAT($value, $decimals = 2, $no_commas = false) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $decimals = PHPExcel_Calculation_Functions::flattenSingleValue($decimals); + $no_commas = PHPExcel_Calculation_Functions::flattenSingleValue($no_commas); + + // Validate parameters + if (!is_numeric($value) || !is_numeric($decimals)) { + return PHPExcel_Calculation_Functions::NaN(); + } + $decimals = floor($decimals); + + $valueResult = round($value, $decimals); + if ($decimals < 0) { + $decimals = 0; + } + if (!$no_commas) { + $valueResult = number_format($valueResult, $decimals); + } + + return (string) $valueResult; + } + + + /** + * LEFT + * + * @param string $value Value + * @param int $chars Number of characters + * @return string + */ + public static function LEFT($value = '', $chars = 1) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $chars = PHPExcel_Calculation_Functions::flattenSingleValue($chars); + + if ($chars < 0) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + if (is_bool($value)) { + $value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE(); + } + + if (function_exists('mb_substr')) { + return mb_substr($value, 0, $chars, 'UTF-8'); + } else { + return substr($value, 0, $chars); + } + } + + + /** + * MID + * + * @param string $value Value + * @param int $start Start character + * @param int $chars Number of characters + * @return string + */ + public static function MID($value = '', $start = 1, $chars = null) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $start = PHPExcel_Calculation_Functions::flattenSingleValue($start); + $chars = PHPExcel_Calculation_Functions::flattenSingleValue($chars); + + if (($start < 1) || ($chars < 0)) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + if (is_bool($value)) { + $value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE(); + } + + if (function_exists('mb_substr')) { + return mb_substr($value, --$start, $chars, 'UTF-8'); + } else { + return substr($value, --$start, $chars); + } + } + + + /** + * RIGHT + * + * @param string $value Value + * @param int $chars Number of characters + * @return string + */ + public static function RIGHT($value = '', $chars = 1) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $chars = PHPExcel_Calculation_Functions::flattenSingleValue($chars); + + if ($chars < 0) { + return PHPExcel_Calculation_Functions::VALUE(); + } + + if (is_bool($value)) { + $value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE(); + } + + if ((function_exists('mb_substr')) && (function_exists('mb_strlen'))) { + return mb_substr($value, mb_strlen($value, 'UTF-8') - $chars, $chars, 'UTF-8'); + } else { + return substr($value, strlen($value) - $chars); + } + } + + + /** + * STRINGLENGTH + * + * @param string $value Value + * @return string + */ + public static function STRINGLENGTH($value = '') + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + + if (is_bool($value)) { + $value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE(); + } + + if (function_exists('mb_strlen')) { + return mb_strlen($value, 'UTF-8'); + } else { + return strlen($value); + } + } + + + /** + * LOWERCASE + * + * Converts a string value to upper case. + * + * @param string $mixedCaseString + * @return string + */ + public static function LOWERCASE($mixedCaseString) + { + $mixedCaseString = PHPExcel_Calculation_Functions::flattenSingleValue($mixedCaseString); + + if (is_bool($mixedCaseString)) { + $mixedCaseString = ($mixedCaseString) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE(); + } + + return PHPExcel_Shared_String::StrToLower($mixedCaseString); + } + + + /** + * UPPERCASE + * + * Converts a string value to upper case. + * + * @param string $mixedCaseString + * @return string + */ + public static function UPPERCASE($mixedCaseString) + { + $mixedCaseString = PHPExcel_Calculation_Functions::flattenSingleValue($mixedCaseString); + + if (is_bool($mixedCaseString)) { + $mixedCaseString = ($mixedCaseString) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE(); + } + + return PHPExcel_Shared_String::StrToUpper($mixedCaseString); + } + + + /** + * PROPERCASE + * + * Converts a string value to upper case. + * + * @param string $mixedCaseString + * @return string + */ + public static function PROPERCASE($mixedCaseString) + { + $mixedCaseString = PHPExcel_Calculation_Functions::flattenSingleValue($mixedCaseString); + + if (is_bool($mixedCaseString)) { + $mixedCaseString = ($mixedCaseString) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE(); + } + + return PHPExcel_Shared_String::StrToTitle($mixedCaseString); + } + + + /** + * REPLACE + * + * @param string $oldText String to modify + * @param int $start Start character + * @param int $chars Number of characters + * @param string $newText String to replace in defined position + * @return string + */ + public static function REPLACE($oldText = '', $start = 1, $chars = null, $newText) + { + $oldText = PHPExcel_Calculation_Functions::flattenSingleValue($oldText); + $start = PHPExcel_Calculation_Functions::flattenSingleValue($start); + $chars = PHPExcel_Calculation_Functions::flattenSingleValue($chars); + $newText = PHPExcel_Calculation_Functions::flattenSingleValue($newText); + + $left = self::LEFT($oldText, $start-1); + $right = self::RIGHT($oldText, self::STRINGLENGTH($oldText)-($start+$chars)+1); + + return $left.$newText.$right; + } + + + /** + * SUBSTITUTE + * + * @param string $text Value + * @param string $fromText From Value + * @param string $toText To Value + * @param integer $instance Instance Number + * @return string + */ + public static function SUBSTITUTE($text = '', $fromText = '', $toText = '', $instance = 0) + { + $text = PHPExcel_Calculation_Functions::flattenSingleValue($text); + $fromText = PHPExcel_Calculation_Functions::flattenSingleValue($fromText); + $toText = PHPExcel_Calculation_Functions::flattenSingleValue($toText); + $instance = floor(PHPExcel_Calculation_Functions::flattenSingleValue($instance)); + + if ($instance == 0) { + if (function_exists('mb_str_replace')) { + return mb_str_replace($fromText, $toText, $text); + } else { + return str_replace($fromText, $toText, $text); + } + } else { + $pos = -1; + while ($instance > 0) { + if (function_exists('mb_strpos')) { + $pos = mb_strpos($text, $fromText, $pos+1, 'UTF-8'); + } else { + $pos = strpos($text, $fromText, $pos+1); + } + if ($pos === false) { + break; + } + --$instance; + } + if ($pos !== false) { + if (function_exists('mb_strlen')) { + return self::REPLACE($text, ++$pos, mb_strlen($fromText, 'UTF-8'), $toText); + } else { + return self::REPLACE($text, ++$pos, strlen($fromText), $toText); + } + } + } + + return $text; + } + + + /** + * RETURNSTRING + * + * @param mixed $testValue Value to check + * @return boolean + */ + public static function RETURNSTRING($testValue = '') + { + $testValue = PHPExcel_Calculation_Functions::flattenSingleValue($testValue); + + if (is_string($testValue)) { + return $testValue; + } + return null; + } + + + /** + * TEXTFORMAT + * + * @param mixed $value Value to check + * @param string $format Format mask to use + * @return boolean + */ + public static function TEXTFORMAT($value, $format) + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + $format = PHPExcel_Calculation_Functions::flattenSingleValue($format); + + if ((is_string($value)) && (!is_numeric($value)) && PHPExcel_Shared_Date::isDateTimeFormatCode($format)) { + $value = PHPExcel_Calculation_DateTime::DATEVALUE($value); + } + + return (string) PHPExcel_Style_NumberFormat::toFormattedString($value, $format); + } + + /** + * VALUE + * + * @param mixed $value Value to check + * @return boolean + */ + public static function VALUE($value = '') + { + $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); + + if (!is_numeric($value)) { + $numberValue = str_replace( + PHPExcel_Shared_String::getThousandsSeparator(), + '', + trim($value, " \t\n\r\0\x0B" . PHPExcel_Shared_String::getCurrencyCode()) + ); + if (is_numeric($numberValue)) { + return (float) $numberValue; + } + + $dateSetting = PHPExcel_Calculation_Functions::getReturnDateType(); + PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); + + if (strpos($value, ':') !== false) { + $timeValue = PHPExcel_Calculation_DateTime::TIMEVALUE($value); + if ($timeValue !== PHPExcel_Calculation_Functions::VALUE()) { + PHPExcel_Calculation_Functions::setReturnDateType($dateSetting); + return $timeValue; + } + } + $dateValue = PHPExcel_Calculation_DateTime::DATEVALUE($value); + if ($dateValue !== PHPExcel_Calculation_Functions::VALUE()) { + PHPExcel_Calculation_Functions::setReturnDateType($dateSetting); + return $dateValue; + } + PHPExcel_Calculation_Functions::setReturnDateType($dateSetting); + + return PHPExcel_Calculation_Functions::VALUE(); + } + return (float) $value; + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation/Token/Stack.php b/extend/PHPExcel/PHPExcel/Calculation/Token/Stack.php new file mode 100644 index 0000000..02ed5aa --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation/Token/Stack.php @@ -0,0 +1,111 @@ +count; + } + + /** + * Push a new entry onto the stack + * + * @param mixed $type + * @param mixed $value + * @param mixed $reference + */ + public function push($type, $value, $reference = null) + { + $this->stack[$this->count++] = array( + 'type' => $type, + 'value' => $value, + 'reference' => $reference + ); + if ($type == 'Function') { + $localeFunction = PHPExcel_Calculation::localeFunc($value); + if ($localeFunction != $value) { + $this->stack[($this->count - 1)]['localeValue'] = $localeFunction; + } + } + } + + /** + * Pop the last entry from the stack + * + * @return mixed + */ + public function pop() + { + if ($this->count > 0) { + return $this->stack[--$this->count]; + } + return null; + } + + /** + * Return an entry from the stack without removing it + * + * @param integer $n number indicating how far back in the stack we want to look + * @return mixed + */ + public function last($n = 1) + { + if ($this->count - $n < 0) { + return null; + } + return $this->stack[$this->count - $n]; + } + + /** + * Clear the stack + */ + public function clear() + { + $this->stack = array(); + $this->count = 0; + } +} diff --git a/extend/PHPExcel/PHPExcel/Calculation/functionlist.txt b/extend/PHPExcel/PHPExcel/Calculation/functionlist.txt new file mode 100644 index 0000000..67dbd49 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Calculation/functionlist.txt @@ -0,0 +1,351 @@ +ABS +ACCRINT +ACCRINTM +ACOS +ACOSH +ADDRESS +AMORDEGRC +AMORLINC +AND +AREAS +ASC +ASIN +ASINH +ATAN +ATAN2 +ATANH +AVEDEV +AVERAGE +AVERAGEA +AVERAGEIF +AVERAGEIFS +BAHTTEXT +BESSELI +BESSELJ +BESSELK +BESSELY +BETADIST +BETAINV +BIN2DEC +BIN2HEX +BIN2OCT +BINOMDIST +CEILING +CELL +CHAR +CHIDIST +CHIINV +CHITEST +CHOOSE +CLEAN +CODE +COLUMN +COLUMNS +COMBIN +COMPLEX +CONCATENATE +CONFIDENCE +CONVERT +CORREL +COS +COSH +COUNT +COUNTA +COUNTBLANK +COUNTIF +COUNTIFS +COUPDAYBS +COUPDAYBS +COUPDAYSNC +COUPNCD +COUPNUM +COUPPCD +COVAR +CRITBINOM +CUBEKPIMEMBER +CUBEMEMBER +CUBEMEMBERPROPERTY +CUBERANKEDMEMBER +CUBESET +CUBESETCOUNT +CUBEVALUE +CUMIPMT +CUMPRINC +DATE +DATEDIF +DATEVALUE +DAVERAGE +DAY +DAYS360 +DB +DCOUNT +DCOUNTA +DDB +DEC2BIN +DEC2HEX +DEC2OCT +DEGREES +DELTA +DEVSQ +DGET +DISC +DMAX +DMIN +DOLLAR +DOLLARDE +DOLLARFR +DPRODUCT +DSTDEV +DSTDEVP +DSUM +DURATION +DVAR +DVARP +EDATE +EFFECT +EOMONTH +ERF +ERFC +ERROR.TYPE +EVEN +EXACT +EXP +EXPONDIST +FACT +FACTDOUBLE +FALSE +FDIST +FIND +FINDB +FINV +FISHER +FISHERINV +FIXED +FLOOR +FORECAST +FREQUENCY +FTEST +FV +FVSCHEDULE +GAMAMDIST +GAMMAINV +GAMMALN +GCD +GEOMEAN +GESTEP +GETPIVOTDATA +GROWTH +HARMEAN +HEX2BIN +HEX2OCT +HLOOKUP +HOUR +HYPERLINK +HYPGEOMDIST +IF +IFERROR +IMABS +IMAGINARY +IMARGUMENT +IMCONJUGATE +IMCOS +IMEXP +IMLN +IMLOG10 +IMLOG2 +IMPOWER +IMPRODUCT +IMREAL +IMSIN +IMSQRT +IMSUB +IMSUM +INDEX +INDIRECT +INFO +INT +INTERCEPT +INTRATE +IPMT +IRR +ISBLANK +ISERR +ISERROR +ISEVEN +ISLOGICAL +ISNA +ISNONTEXT +ISNUMBER +ISODD +ISPMT +ISREF +ISTEXT +JIS +KURT +LARGE +LCM +LEFT +LEFTB +LEN +LENB +LINEST +LN +LOG +LOG10 +LOGEST +LOGINV +LOGNORMDIST +LOOKUP +LOWER +MATCH +MAX +MAXA +MDETERM +MDURATION +MEDIAN +MID +MIDB +MIN +MINA +MINUTE +MINVERSE +MIRR +MMULT +MOD +MODE +MONTH +MROUND +MULTINOMIAL +N +NA +NEGBINOMDIST +NETWORKDAYS +NOMINAL +NORMDIST +NORMINV +NORMSDIST +NORMSINV +NOT +NOW +NPER +NPV +OCT2BIN +OCT2DEC +OCT2HEX +ODD +ODDFPRICE +ODDFYIELD +ODDLPRICE +ODDLYIELD +OFFSET +OR +PEARSON +PERCENTILE +PERCENTRANK +PERMUT +PHONETIC +PI +PMT +POISSON +POWER +PPMT +PRICE +PRICEDISC +PRICEMAT +PROB +PRODUCT +PROPER +PV +QUARTILE +QUOTIENT +RADIANS +RAND +RANDBETWEEN +RANK +RATE +RECEIVED +REPLACE +REPLACEB +REPT +RIGHT +RIGHTB +ROMAN +ROUND +ROUNDDOWN +ROUNDUP +ROW +ROWS +RSQ +RTD +SEARCH +SEARCHB +SECOND +SERIESSUM +SIGN +SIN +SINH +SKEW +SLN +SLOPE +SMALL +SQRT +SQRTPI +STANDARDIZE +STDEV +STDEVA +STDEVP +STDEVPA +STEYX +SUBSTITUTE +SUBTOTAL +SUM +SUMIF +SUMIFS +SUMPRODUCT +SUMSQ +SUMX2MY2 +SUMX2PY2 +SUMXMY2 +SYD +T +TAN +TANH +TBILLEQ +TBILLPRICE +TBILLYIELD +TDIST +TEXT +TIME +TIMEVALUE +TINV +TODAY +TRANSPOSE +TREND +TRIM +TRIMMEAN +TRUE +TRUNC +TTEST +TYPE +UPPER +USDOLLAR +VALUE +VAR +VARA +VARP +VARPA +VDB +VERSION +VLOOKUP +WEEKDAY +WEEKNUM +WEIBULL +WORKDAY +XIRR +XNPV +YEAR +YEARFRAC +YIELD +YIELDDISC +YIELDMAT +ZTEST diff --git a/extend/PHPExcel/PHPExcel/Cell.php b/extend/PHPExcel/PHPExcel/Cell.php new file mode 100644 index 0000000..c99a3c8 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Cell.php @@ -0,0 +1,1032 @@ +parent->updateCacheData($this); + + return $this; + } + + public function detach() + { + $this->parent = null; + } + + public function attach(PHPExcel_CachedObjectStorage_CacheBase $parent) + { + $this->parent = $parent; + } + + + /** + * Create a new Cell + * + * @param mixed $pValue + * @param string $pDataType + * @param PHPExcel_Worksheet $pSheet + * @throws PHPExcel_Exception + */ + public function __construct($pValue = null, $pDataType = null, PHPExcel_Worksheet $pSheet = null) + { + // Initialise cell value + $this->value = $pValue; + + // Set worksheet cache + $this->parent = $pSheet->getCellCacheController(); + + // Set datatype? + if ($pDataType !== null) { + if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2) { + $pDataType = PHPExcel_Cell_DataType::TYPE_STRING; + } + $this->dataType = $pDataType; + } elseif (!self::getValueBinder()->bindValue($this, $pValue)) { + throw new PHPExcel_Exception("Value could not be bound to cell."); + } + } + + /** + * Get cell coordinate column + * + * @return string + */ + public function getColumn() + { + return $this->parent->getCurrentColumn(); + } + + /** + * Get cell coordinate row + * + * @return int + */ + public function getRow() + { + return $this->parent->getCurrentRow(); + } + + /** + * Get cell coordinate + * + * @return string + */ + public function getCoordinate() + { + return $this->parent->getCurrentAddress(); + } + + /** + * Get cell value + * + * @return mixed + */ + public function getValue() + { + return $this->value; + } + + /** + * Get cell value with formatting + * + * @return string + */ + public function getFormattedValue() + { + return (string) PHPExcel_Style_NumberFormat::toFormattedString( + $this->getCalculatedValue(), + $this->getStyle() + ->getNumberFormat()->getFormatCode() + ); + } + + /** + * Set cell value + * + * Sets the value for a cell, automatically determining the datatype using the value binder + * + * @param mixed $pValue Value + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function setValue($pValue = null) + { + if (!self::getValueBinder()->bindValue($this, $pValue)) { + throw new PHPExcel_Exception("Value could not be bound to cell."); + } + return $this; + } + + /** + * Set the value for a cell, with the explicit data type passed to the method (bypassing any use of the value binder) + * + * @param mixed $pValue Value + * @param string $pDataType Explicit data type + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function setValueExplicit($pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING) + { + // set the value according to data type + switch ($pDataType) { + case PHPExcel_Cell_DataType::TYPE_NULL: + $this->value = $pValue; + break; + case PHPExcel_Cell_DataType::TYPE_STRING2: + $pDataType = PHPExcel_Cell_DataType::TYPE_STRING; + // no break + case PHPExcel_Cell_DataType::TYPE_STRING: + // Synonym for string + case PHPExcel_Cell_DataType::TYPE_INLINE: + // Rich text + $this->value = PHPExcel_Cell_DataType::checkString($pValue); + break; + case PHPExcel_Cell_DataType::TYPE_NUMERIC: + $this->value = (float) $pValue; + break; + case PHPExcel_Cell_DataType::TYPE_FORMULA: + $this->value = (string) $pValue; + break; + case PHPExcel_Cell_DataType::TYPE_BOOL: + $this->value = (bool) $pValue; + break; + case PHPExcel_Cell_DataType::TYPE_ERROR: + $this->value = PHPExcel_Cell_DataType::checkErrorCode($pValue); + break; + default: + throw new PHPExcel_Exception('Invalid datatype: ' . $pDataType); + break; + } + + // set the datatype + $this->dataType = $pDataType; + + return $this->notifyCacheController(); + } + + /** + * Get calculated cell value + * + * @deprecated Since version 1.7.8 for planned changes to cell for array formula handling + * + * @param boolean $resetLog Whether the calculation engine logger should be reset or not + * @return mixed + * @throws PHPExcel_Exception + */ + public function getCalculatedValue($resetLog = true) + { +//echo 'Cell '.$this->getCoordinate().' value is a '.$this->dataType.' with a value of '.$this->getValue().PHP_EOL; + if ($this->dataType == PHPExcel_Cell_DataType::TYPE_FORMULA) { + try { +//echo 'Cell value for '.$this->getCoordinate().' is a formula: Calculating value'.PHP_EOL; + $result = PHPExcel_Calculation::getInstance( + $this->getWorksheet()->getParent() + )->calculateCellValue($this, $resetLog); +//echo $this->getCoordinate().' calculation result is '.$result.PHP_EOL; + // We don't yet handle array returns + if (is_array($result)) { + while (is_array($result)) { + $result = array_pop($result); + } + } + } catch (PHPExcel_Exception $ex) { + if (($ex->getMessage() === 'Unable to access External Workbook') && ($this->calculatedValue !== null)) { +//echo 'Returning fallback value of '.$this->calculatedValue.' for cell '.$this->getCoordinate().PHP_EOL; + return $this->calculatedValue; // Fallback for calculations referencing external files. + } +//echo 'Calculation Exception: '.$ex->getMessage().PHP_EOL; + $result = '#N/A'; + throw new PHPExcel_Calculation_Exception( + $this->getWorksheet()->getTitle().'!'.$this->getCoordinate().' -> '.$ex->getMessage() + ); + } + + if ($result === '#Not Yet Implemented') { +//echo 'Returning fallback value of '.$this->calculatedValue.' for cell '.$this->getCoordinate().PHP_EOL; + return $this->calculatedValue; // Fallback if calculation engine does not support the formula. + } +//echo 'Returning calculated value of '.$result.' for cell '.$this->getCoordinate().PHP_EOL; + return $result; + } elseif ($this->value instanceof PHPExcel_RichText) { +// echo 'Cell value for '.$this->getCoordinate().' is rich text: Returning data value of '.$this->value.'
'; + return $this->value->getPlainText(); + } +// echo 'Cell value for '.$this->getCoordinate().' is not a formula: Returning data value of '.$this->value.'
'; + return $this->value; + } + + /** + * Set old calculated value (cached) + * + * @param mixed $pValue Value + * @return PHPExcel_Cell + */ + public function setCalculatedValue($pValue = null) + { + if ($pValue !== null) { + $this->calculatedValue = (is_numeric($pValue)) ? (float) $pValue : $pValue; + } + + return $this->notifyCacheController(); + } + + /** + * Get old calculated value (cached) + * This returns the value last calculated by MS Excel or whichever spreadsheet program was used to + * create the original spreadsheet file. + * Note that this value is not guaranteed to refelect the actual calculated value because it is + * possible that auto-calculation was disabled in the original spreadsheet, and underlying data + * values used by the formula have changed since it was last calculated. + * + * @return mixed + */ + public function getOldCalculatedValue() + { + return $this->calculatedValue; + } + + /** + * Get cell data type + * + * @return string + */ + public function getDataType() + { + return $this->dataType; + } + + /** + * Set cell data type + * + * @param string $pDataType + * @return PHPExcel_Cell + */ + public function setDataType($pDataType = PHPExcel_Cell_DataType::TYPE_STRING) + { + if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2) { + $pDataType = PHPExcel_Cell_DataType::TYPE_STRING; + } + $this->dataType = $pDataType; + + return $this->notifyCacheController(); + } + + /** + * Identify if the cell contains a formula + * + * @return boolean + */ + public function isFormula() + { + return $this->dataType == PHPExcel_Cell_DataType::TYPE_FORMULA; + } + + /** + * Does this cell contain Data validation rules? + * + * @return boolean + * @throws PHPExcel_Exception + */ + public function hasDataValidation() + { + if (!isset($this->parent)) { + throw new PHPExcel_Exception('Cannot check for data validation when cell is not bound to a worksheet'); + } + + return $this->getWorksheet()->dataValidationExists($this->getCoordinate()); + } + + /** + * Get Data validation rules + * + * @return PHPExcel_Cell_DataValidation + * @throws PHPExcel_Exception + */ + public function getDataValidation() + { + if (!isset($this->parent)) { + throw new PHPExcel_Exception('Cannot get data validation for cell that is not bound to a worksheet'); + } + + return $this->getWorksheet()->getDataValidation($this->getCoordinate()); + } + + /** + * Set Data validation rules + * + * @param PHPExcel_Cell_DataValidation $pDataValidation + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function setDataValidation(PHPExcel_Cell_DataValidation $pDataValidation = null) + { + if (!isset($this->parent)) { + throw new PHPExcel_Exception('Cannot set data validation for cell that is not bound to a worksheet'); + } + + $this->getWorksheet()->setDataValidation($this->getCoordinate(), $pDataValidation); + + return $this->notifyCacheController(); + } + + /** + * Does this cell contain a Hyperlink? + * + * @return boolean + * @throws PHPExcel_Exception + */ + public function hasHyperlink() + { + if (!isset($this->parent)) { + throw new PHPExcel_Exception('Cannot check for hyperlink when cell is not bound to a worksheet'); + } + + return $this->getWorksheet()->hyperlinkExists($this->getCoordinate()); + } + + /** + * Get Hyperlink + * + * @return PHPExcel_Cell_Hyperlink + * @throws PHPExcel_Exception + */ + public function getHyperlink() + { + if (!isset($this->parent)) { + throw new PHPExcel_Exception('Cannot get hyperlink for cell that is not bound to a worksheet'); + } + + return $this->getWorksheet()->getHyperlink($this->getCoordinate()); + } + + /** + * Set Hyperlink + * + * @param PHPExcel_Cell_Hyperlink $pHyperlink + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function setHyperlink(PHPExcel_Cell_Hyperlink $pHyperlink = null) + { + if (!isset($this->parent)) { + throw new PHPExcel_Exception('Cannot set hyperlink for cell that is not bound to a worksheet'); + } + + $this->getWorksheet()->setHyperlink($this->getCoordinate(), $pHyperlink); + + return $this->notifyCacheController(); + } + + /** + * Get parent worksheet + * + * @return PHPExcel_CachedObjectStorage_CacheBase + */ + public function getParent() + { + return $this->parent; + } + + /** + * Get parent worksheet + * + * @return PHPExcel_Worksheet + */ + public function getWorksheet() + { + return $this->parent->getParent(); + } + + /** + * Is this cell in a merge range + * + * @return boolean + */ + public function isInMergeRange() + { + return (boolean) $this->getMergeRange(); + } + + /** + * Is this cell the master (top left cell) in a merge range (that holds the actual data value) + * + * @return boolean + */ + public function isMergeRangeValueCell() + { + if ($mergeRange = $this->getMergeRange()) { + $mergeRange = PHPExcel_Cell::splitRange($mergeRange); + list($startCell) = $mergeRange[0]; + if ($this->getCoordinate() === $startCell) { + return true; + } + } + return false; + } + + /** + * If this cell is in a merge range, then return the range + * + * @return string + */ + public function getMergeRange() + { + foreach ($this->getWorksheet()->getMergeCells() as $mergeRange) { + if ($this->isInRange($mergeRange)) { + return $mergeRange; + } + } + return false; + } + + /** + * Get cell style + * + * @return PHPExcel_Style + */ + public function getStyle() + { + return $this->getWorksheet()->getStyle($this->getCoordinate()); + } + + /** + * Re-bind parent + * + * @param PHPExcel_Worksheet $parent + * @return PHPExcel_Cell + */ + public function rebindParent(PHPExcel_Worksheet $parent) + { + $this->parent = $parent->getCellCacheController(); + + return $this->notifyCacheController(); + } + + /** + * Is cell in a specific range? + * + * @param string $pRange Cell range (e.g. A1:A1) + * @return boolean + */ + public function isInRange($pRange = 'A1:A1') + { + list($rangeStart, $rangeEnd) = self::rangeBoundaries($pRange); + + // Translate properties + $myColumn = self::columnIndexFromString($this->getColumn()); + $myRow = $this->getRow(); + + // Verify if cell is in range + return (($rangeStart[0] <= $myColumn) && ($rangeEnd[0] >= $myColumn) && + ($rangeStart[1] <= $myRow) && ($rangeEnd[1] >= $myRow) + ); + } + + /** + * Coordinate from string + * + * @param string $pCoordinateString + * @return array Array containing column and row (indexes 0 and 1) + * @throws PHPExcel_Exception + */ + public static function coordinateFromString($pCoordinateString = 'A1') + { + if (preg_match("/^([$]?[A-Z]{1,3})([$]?\d{1,7})$/", $pCoordinateString, $matches)) { + return array($matches[1],$matches[2]); + } elseif ((strpos($pCoordinateString, ':') !== false) || (strpos($pCoordinateString, ',') !== false)) { + throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells'); + } elseif ($pCoordinateString == '') { + throw new PHPExcel_Exception('Cell coordinate can not be zero-length string'); + } + + throw new PHPExcel_Exception('Invalid cell coordinate '.$pCoordinateString); + } + + /** + * Make string row, column or cell coordinate absolute + * + * @param string $pCoordinateString e.g. 'A' or '1' or 'A1' + * Note that this value can be a row or column reference as well as a cell reference + * @return string Absolute coordinate e.g. '$A' or '$1' or '$A$1' + * @throws PHPExcel_Exception + */ + public static function absoluteReference($pCoordinateString = 'A1') + { + if (strpos($pCoordinateString, ':') === false && strpos($pCoordinateString, ',') === false) { + // Split out any worksheet name from the reference + $worksheet = ''; + $cellAddress = explode('!', $pCoordinateString); + if (count($cellAddress) > 1) { + list($worksheet, $pCoordinateString) = $cellAddress; + } + if ($worksheet > '') { + $worksheet .= '!'; + } + + // Create absolute coordinate + if (ctype_digit($pCoordinateString)) { + return $worksheet . '$' . $pCoordinateString; + } elseif (ctype_alpha($pCoordinateString)) { + return $worksheet . '$' . strtoupper($pCoordinateString); + } + return $worksheet . self::absoluteCoordinate($pCoordinateString); + } + + throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells'); + } + + /** + * Make string coordinate absolute + * + * @param string $pCoordinateString e.g. 'A1' + * @return string Absolute coordinate e.g. '$A$1' + * @throws PHPExcel_Exception + */ + public static function absoluteCoordinate($pCoordinateString = 'A1') + { + if (strpos($pCoordinateString, ':') === false && strpos($pCoordinateString, ',') === false) { + // Split out any worksheet name from the coordinate + $worksheet = ''; + $cellAddress = explode('!', $pCoordinateString); + if (count($cellAddress) > 1) { + list($worksheet, $pCoordinateString) = $cellAddress; + } + if ($worksheet > '') { + $worksheet .= '!'; + } + + // Create absolute coordinate + list($column, $row) = self::coordinateFromString($pCoordinateString); + $column = ltrim($column, '$'); + $row = ltrim($row, '$'); + return $worksheet . '$' . $column . '$' . $row; + } + + throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells'); + } + + /** + * Split range into coordinate strings + * + * @param string $pRange e.g. 'B4:D9' or 'B4:D9,H2:O11' or 'B4' + * @return array Array containg one or more arrays containing one or two coordinate strings + * e.g. array('B4','D9') or array(array('B4','D9'),array('H2','O11')) + * or array('B4') + */ + public static function splitRange($pRange = 'A1:A1') + { + // Ensure $pRange is a valid range + if (empty($pRange)) { + $pRange = self::DEFAULT_RANGE; + } + + $exploded = explode(',', $pRange); + $counter = count($exploded); + for ($i = 0; $i < $counter; ++$i) { + $exploded[$i] = explode(':', $exploded[$i]); + } + return $exploded; + } + + /** + * Build range from coordinate strings + * + * @param array $pRange Array containg one or more arrays containing one or two coordinate strings + * @return string String representation of $pRange + * @throws PHPExcel_Exception + */ + public static function buildRange($pRange) + { + // Verify range + if (!is_array($pRange) || empty($pRange) || !is_array($pRange[0])) { + throw new PHPExcel_Exception('Range does not contain any information'); + } + + // Build range + $imploded = array(); + $counter = count($pRange); + for ($i = 0; $i < $counter; ++$i) { + $pRange[$i] = implode(':', $pRange[$i]); + } + $imploded = implode(',', $pRange); + + return $imploded; + } + + /** + * Calculate range boundaries + * + * @param string $pRange Cell range (e.g. A1:A1) + * @return array Range coordinates array(Start Cell, End Cell) + * where Start Cell and End Cell are arrays (Column Number, Row Number) + */ + public static function rangeBoundaries($pRange = 'A1:A1') + { + // Ensure $pRange is a valid range + if (empty($pRange)) { + $pRange = self::DEFAULT_RANGE; + } + + // Uppercase coordinate + $pRange = strtoupper($pRange); + + // Extract range + if (strpos($pRange, ':') === false) { + $rangeA = $rangeB = $pRange; + } else { + list($rangeA, $rangeB) = explode(':', $pRange); + } + + // Calculate range outer borders + $rangeStart = self::coordinateFromString($rangeA); + $rangeEnd = self::coordinateFromString($rangeB); + + // Translate column into index + $rangeStart[0] = self::columnIndexFromString($rangeStart[0]); + $rangeEnd[0] = self::columnIndexFromString($rangeEnd[0]); + + return array($rangeStart, $rangeEnd); + } + + /** + * Calculate range dimension + * + * @param string $pRange Cell range (e.g. A1:A1) + * @return array Range dimension (width, height) + */ + public static function rangeDimension($pRange = 'A1:A1') + { + // Calculate range outer borders + list($rangeStart, $rangeEnd) = self::rangeBoundaries($pRange); + + return array( ($rangeEnd[0] - $rangeStart[0] + 1), ($rangeEnd[1] - $rangeStart[1] + 1) ); + } + + /** + * Calculate range boundaries + * + * @param string $pRange Cell range (e.g. A1:A1) + * @return array Range coordinates array(Start Cell, End Cell) + * where Start Cell and End Cell are arrays (Column ID, Row Number) + */ + public static function getRangeBoundaries($pRange = 'A1:A1') + { + // Ensure $pRange is a valid range + if (empty($pRange)) { + $pRange = self::DEFAULT_RANGE; + } + + // Uppercase coordinate + $pRange = strtoupper($pRange); + + // Extract range + if (strpos($pRange, ':') === false) { + $rangeA = $rangeB = $pRange; + } else { + list($rangeA, $rangeB) = explode(':', $pRange); + } + + return array( self::coordinateFromString($rangeA), self::coordinateFromString($rangeB)); + } + + /** + * Column index from string + * + * @param string $pString + * @return int Column index (base 1 !!!) + */ + public static function columnIndexFromString($pString = 'A') + { + // Using a lookup cache adds a slight memory overhead, but boosts speed + // caching using a static within the method is faster than a class static, + // though it's additional memory overhead + static $_indexCache = array(); + + if (isset($_indexCache[$pString])) { + return $_indexCache[$pString]; + } + // It's surprising how costly the strtoupper() and ord() calls actually are, so we use a lookup array rather than use ord() + // and make it case insensitive to get rid of the strtoupper() as well. Because it's a static, there's no significant + // memory overhead either + static $_columnLookup = array( + 'A' => 1, 'B' => 2, 'C' => 3, 'D' => 4, 'E' => 5, 'F' => 6, 'G' => 7, 'H' => 8, 'I' => 9, 'J' => 10, 'K' => 11, 'L' => 12, 'M' => 13, + 'N' => 14, 'O' => 15, 'P' => 16, 'Q' => 17, 'R' => 18, 'S' => 19, 'T' => 20, 'U' => 21, 'V' => 22, 'W' => 23, 'X' => 24, 'Y' => 25, 'Z' => 26, + 'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5, 'f' => 6, 'g' => 7, 'h' => 8, 'i' => 9, 'j' => 10, 'k' => 11, 'l' => 12, 'm' => 13, + 'n' => 14, 'o' => 15, 'p' => 16, 'q' => 17, 'r' => 18, 's' => 19, 't' => 20, 'u' => 21, 'v' => 22, 'w' => 23, 'x' => 24, 'y' => 25, 'z' => 26 + ); + + // We also use the language construct isset() rather than the more costly strlen() function to match the length of $pString + // for improved performance + if (isset($pString{0})) { + if (!isset($pString{1})) { + $_indexCache[$pString] = $_columnLookup[$pString]; + return $_indexCache[$pString]; + } elseif (!isset($pString{2})) { + $_indexCache[$pString] = $_columnLookup[$pString{0}] * 26 + $_columnLookup[$pString{1}]; + return $_indexCache[$pString]; + } elseif (!isset($pString{3})) { + $_indexCache[$pString] = $_columnLookup[$pString{0}] * 676 + $_columnLookup[$pString{1}] * 26 + $_columnLookup[$pString{2}]; + return $_indexCache[$pString]; + } + } + throw new PHPExcel_Exception("Column string index can not be " . ((isset($pString{0})) ? "longer than 3 characters" : "empty")); + } + + /** + * String from columnindex + * + * @param int $pColumnIndex Column index (base 0 !!!) + * @return string + */ + public static function stringFromColumnIndex($pColumnIndex = 0) + { + // Using a lookup cache adds a slight memory overhead, but boosts speed + // caching using a static within the method is faster than a class static, + // though it's additional memory overhead + static $_indexCache = array(); + + if (!isset($_indexCache[$pColumnIndex])) { + // Determine column string + if ($pColumnIndex < 26) { + $_indexCache[$pColumnIndex] = chr(65 + $pColumnIndex); + } elseif ($pColumnIndex < 702) { + $_indexCache[$pColumnIndex] = chr(64 + ($pColumnIndex / 26)) . + chr(65 + $pColumnIndex % 26); + } else { + $_indexCache[$pColumnIndex] = chr(64 + (($pColumnIndex - 26) / 676)) . + chr(65 + ((($pColumnIndex - 26) % 676) / 26)) . + chr(65 + $pColumnIndex % 26); + } + } + return $_indexCache[$pColumnIndex]; + } + + /** + * Extract all cell references in range + * + * @param string $pRange Range (e.g. A1 or A1:C10 or A1:E10 A20:E25) + * @return array Array containing single cell references + */ + public static function extractAllCellReferencesInRange($pRange = 'A1') + { + // Returnvalue + $returnValue = array(); + + // Explode spaces + $cellBlocks = explode(' ', str_replace('$', '', strtoupper($pRange))); + foreach ($cellBlocks as $cellBlock) { + // Single cell? + if (strpos($cellBlock, ':') === false && strpos($cellBlock, ',') === false) { + $returnValue[] = $cellBlock; + continue; + } + + // Range... + $ranges = self::splitRange($cellBlock); + foreach ($ranges as $range) { + // Single cell? + if (!isset($range[1])) { + $returnValue[] = $range[0]; + continue; + } + + // Range... + list($rangeStart, $rangeEnd) = $range; + sscanf($rangeStart, '%[A-Z]%d', $startCol, $startRow); + sscanf($rangeEnd, '%[A-Z]%d', $endCol, $endRow); + ++$endCol; + + // Current data + $currentCol = $startCol; + $currentRow = $startRow; + + // Loop cells + while ($currentCol != $endCol) { + while ($currentRow <= $endRow) { + $returnValue[] = $currentCol.$currentRow; + ++$currentRow; + } + ++$currentCol; + $currentRow = $startRow; + } + } + } + + // Sort the result by column and row + $sortKeys = array(); + foreach (array_unique($returnValue) as $coord) { + sscanf($coord, '%[A-Z]%d', $column, $row); + $sortKeys[sprintf('%3s%09d', $column, $row)] = $coord; + } + ksort($sortKeys); + + // Return value + return array_values($sortKeys); + } + + /** + * Compare 2 cells + * + * @param PHPExcel_Cell $a Cell a + * @param PHPExcel_Cell $b Cell b + * @return int Result of comparison (always -1 or 1, never zero!) + */ + public static function compareCells(PHPExcel_Cell $a, PHPExcel_Cell $b) + { + if ($a->getRow() < $b->getRow()) { + return -1; + } elseif ($a->getRow() > $b->getRow()) { + return 1; + } elseif (self::columnIndexFromString($a->getColumn()) < self::columnIndexFromString($b->getColumn())) { + return -1; + } else { + return 1; + } + } + + /** + * Get value binder to use + * + * @return PHPExcel_Cell_IValueBinder + */ + public static function getValueBinder() + { + if (self::$valueBinder === null) { + self::$valueBinder = new PHPExcel_Cell_DefaultValueBinder(); + } + + return self::$valueBinder; + } + + /** + * Set value binder to use + * + * @param PHPExcel_Cell_IValueBinder $binder + * @throws PHPExcel_Exception + */ + public static function setValueBinder(PHPExcel_Cell_IValueBinder $binder = null) + { + if ($binder === null) { + throw new PHPExcel_Exception("A PHPExcel_Cell_IValueBinder is required for PHPExcel to function correctly."); + } + + self::$valueBinder = $binder; + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if ((is_object($value)) && ($key != 'parent')) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } + + /** + * Get index to cellXf + * + * @return int + */ + public function getXfIndex() + { + return $this->xfIndex; + } + + /** + * Set index to cellXf + * + * @param int $pValue + * @return PHPExcel_Cell + */ + public function setXfIndex($pValue = 0) + { + $this->xfIndex = $pValue; + + return $this->notifyCacheController(); + } + + /** + * @deprecated Since version 1.7.8 for planned changes to cell for array formula handling + */ + public function setFormulaAttributes($pAttributes) + { + $this->formulaAttributes = $pAttributes; + return $this; + } + + /** + * @deprecated Since version 1.7.8 for planned changes to cell for array formula handling + */ + public function getFormulaAttributes() + { + return $this->formulaAttributes; + } + + /** + * Convert to string + * + * @return string + */ + public function __toString() + { + return (string) $this->getValue(); + } +} diff --git a/extend/PHPExcel/PHPExcel/Cell/AdvancedValueBinder.php b/extend/PHPExcel/PHPExcel/Cell/AdvancedValueBinder.php new file mode 100644 index 0000000..061d04e --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Cell/AdvancedValueBinder.php @@ -0,0 +1,187 @@ +setValueExplicit(true, PHPExcel_Cell_DataType::TYPE_BOOL); + return true; + } elseif ($value == PHPExcel_Calculation::getFALSE()) { + $cell->setValueExplicit(false, PHPExcel_Cell_DataType::TYPE_BOOL); + return true; + } + + // Check for number in scientific format + if (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NUMBER.'$/', $value)) { + $cell->setValueExplicit((float) $value, PHPExcel_Cell_DataType::TYPE_NUMERIC); + return true; + } + + // Check for fraction + if (preg_match('/^([+-]?)\s*([0-9]+)\s?\/\s*([0-9]+)$/', $value, $matches)) { + // Convert value to number + $value = $matches[2] / $matches[3]; + if ($matches[1] == '-') { + $value = 0 - $value; + } + $cell->setValueExplicit((float) $value, PHPExcel_Cell_DataType::TYPE_NUMERIC); + // Set style + $cell->getWorksheet()->getStyle($cell->getCoordinate()) + ->getNumberFormat()->setFormatCode('??/??'); + return true; + } elseif (preg_match('/^([+-]?)([0-9]*) +([0-9]*)\s?\/\s*([0-9]*)$/', $value, $matches)) { + // Convert value to number + $value = $matches[2] + ($matches[3] / $matches[4]); + if ($matches[1] == '-') { + $value = 0 - $value; + } + $cell->setValueExplicit((float) $value, PHPExcel_Cell_DataType::TYPE_NUMERIC); + // Set style + $cell->getWorksheet()->getStyle($cell->getCoordinate()) + ->getNumberFormat()->setFormatCode('# ??/??'); + return true; + } + + // Check for percentage + if (preg_match('/^\-?[0-9]*\.?[0-9]*\s?\%$/', $value)) { + // Convert value to number + $value = (float) str_replace('%', '', $value) / 100; + $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_NUMERIC); + // Set style + $cell->getWorksheet()->getStyle($cell->getCoordinate()) + ->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00); + return true; + } + + // Check for currency + $currencyCode = PHPExcel_Shared_String::getCurrencyCode(); + $decimalSeparator = PHPExcel_Shared_String::getDecimalSeparator(); + $thousandsSeparator = PHPExcel_Shared_String::getThousandsSeparator(); + if (preg_match('/^'.preg_quote($currencyCode).' *(\d{1,3}('.preg_quote($thousandsSeparator).'\d{3})*|(\d+))('.preg_quote($decimalSeparator).'\d{2})?$/', $value)) { + // Convert value to number + $value = (float) trim(str_replace(array($currencyCode, $thousandsSeparator, $decimalSeparator), array('', '', '.'), $value)); + $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_NUMERIC); + // Set style + $cell->getWorksheet()->getStyle($cell->getCoordinate()) + ->getNumberFormat()->setFormatCode( + str_replace('$', $currencyCode, PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE) + ); + return true; + } elseif (preg_match('/^\$ *(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$/', $value)) { + // Convert value to number + $value = (float) trim(str_replace(array('$',','), '', $value)); + $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_NUMERIC); + // Set style + $cell->getWorksheet()->getStyle($cell->getCoordinate()) + ->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE); + return true; + } + + // Check for time without seconds e.g. '9:45', '09:45' + if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d$/', $value)) { + // Convert value to number + list($h, $m) = explode(':', $value); + $days = $h / 24 + $m / 1440; + $cell->setValueExplicit($days, PHPExcel_Cell_DataType::TYPE_NUMERIC); + // Set style + $cell->getWorksheet()->getStyle($cell->getCoordinate()) + ->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME3); + return true; + } + + // Check for time with seconds '9:45:59', '09:45:59' + if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d:[0-5]\d$/', $value)) { + // Convert value to number + list($h, $m, $s) = explode(':', $value); + $days = $h / 24 + $m / 1440 + $s / 86400; + // Convert value to number + $cell->setValueExplicit($days, PHPExcel_Cell_DataType::TYPE_NUMERIC); + // Set style + $cell->getWorksheet()->getStyle($cell->getCoordinate()) + ->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4); + return true; + } + + // Check for datetime, e.g. '2008-12-31', '2008-12-31 15:59', '2008-12-31 15:59:10' + if (($d = PHPExcel_Shared_Date::stringToExcel($value)) !== false) { + // Convert value to number + $cell->setValueExplicit($d, PHPExcel_Cell_DataType::TYPE_NUMERIC); + // Determine style. Either there is a time part or not. Look for ':' + if (strpos($value, ':') !== false) { + $formatCode = 'yyyy-mm-dd h:mm'; + } else { + $formatCode = 'yyyy-mm-dd'; + } + $cell->getWorksheet()->getStyle($cell->getCoordinate()) + ->getNumberFormat()->setFormatCode($formatCode); + return true; + } + + // Check for newline character "\n" + if (strpos($value, "\n") !== false) { + $value = PHPExcel_Shared_String::SanitizeUTF8($value); + $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_STRING); + // Set style + $cell->getWorksheet()->getStyle($cell->getCoordinate()) + ->getAlignment()->setWrapText(true); + return true; + } + } + + // Not bound yet? Use parent... + return parent::bindValue($cell, $value); + } +} diff --git a/extend/PHPExcel/PHPExcel/Cell/DataType.php b/extend/PHPExcel/PHPExcel/Cell/DataType.php new file mode 100644 index 0000000..fc010e6 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Cell/DataType.php @@ -0,0 +1,115 @@ + 0, + '#DIV/0!' => 1, + '#VALUE!' => 2, + '#REF!' => 3, + '#NAME?' => 4, + '#NUM!' => 5, + '#N/A' => 6 + ); + + /** + * Get list of error codes + * + * @return array + */ + public static function getErrorCodes() + { + return self::$errorCodes; + } + + /** + * DataType for value + * + * @deprecated Replaced by PHPExcel_Cell_IValueBinder infrastructure, will be removed in version 1.8.0 + * @param mixed $pValue + * @return string + */ + public static function dataTypeForValue($pValue = null) + { + return PHPExcel_Cell_DefaultValueBinder::dataTypeForValue($pValue); + } + + /** + * Check a string that it satisfies Excel requirements + * + * @param mixed Value to sanitize to an Excel string + * @return mixed Sanitized value + */ + public static function checkString($pValue = null) + { + if ($pValue instanceof PHPExcel_RichText) { + // TODO: Sanitize Rich-Text string (max. character count is 32,767) + return $pValue; + } + + // string must never be longer than 32,767 characters, truncate if necessary + $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 32767); + + // we require that newline is represented as "\n" in core, not as "\r\n" or "\r" + $pValue = str_replace(array("\r\n", "\r"), "\n", $pValue); + + return $pValue; + } + + /** + * Check a value that it is a valid error code + * + * @param mixed Value to sanitize to an Excel error code + * @return string Sanitized value + */ + public static function checkErrorCode($pValue = null) + { + $pValue = (string) $pValue; + + if (!array_key_exists($pValue, self::$errorCodes)) { + $pValue = '#NULL!'; + } + + return $pValue; + } +} diff --git a/extend/PHPExcel/PHPExcel/Cell/DataValidation.php b/extend/PHPExcel/PHPExcel/Cell/DataValidation.php new file mode 100644 index 0000000..9883633 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Cell/DataValidation.php @@ -0,0 +1,492 @@ +formula1 = ''; + $this->formula2 = ''; + $this->type = PHPExcel_Cell_DataValidation::TYPE_NONE; + $this->errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP; + $this->operator = ''; + $this->allowBlank = false; + $this->showDropDown = false; + $this->showInputMessage = false; + $this->showErrorMessage = false; + $this->errorTitle = ''; + $this->error = ''; + $this->promptTitle = ''; + $this->prompt = ''; + } + + /** + * Get Formula 1 + * + * @return string + */ + public function getFormula1() + { + return $this->formula1; + } + + /** + * Set Formula 1 + * + * @param string $value + * @return PHPExcel_Cell_DataValidation + */ + public function setFormula1($value = '') + { + $this->formula1 = $value; + return $this; + } + + /** + * Get Formula 2 + * + * @return string + */ + public function getFormula2() + { + return $this->formula2; + } + + /** + * Set Formula 2 + * + * @param string $value + * @return PHPExcel_Cell_DataValidation + */ + public function setFormula2($value = '') + { + $this->formula2 = $value; + return $this; + } + + /** + * Get Type + * + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Set Type + * + * @param string $value + * @return PHPExcel_Cell_DataValidation + */ + public function setType($value = PHPExcel_Cell_DataValidation::TYPE_NONE) + { + $this->type = $value; + return $this; + } + + /** + * Get Error style + * + * @return string + */ + public function getErrorStyle() + { + return $this->errorStyle; + } + + /** + * Set Error style + * + * @param string $value + * @return PHPExcel_Cell_DataValidation + */ + public function setErrorStyle($value = PHPExcel_Cell_DataValidation::STYLE_STOP) + { + $this->errorStyle = $value; + return $this; + } + + /** + * Get Operator + * + * @return string + */ + public function getOperator() + { + return $this->operator; + } + + /** + * Set Operator + * + * @param string $value + * @return PHPExcel_Cell_DataValidation + */ + public function setOperator($value = '') + { + $this->operator = $value; + return $this; + } + + /** + * Get Allow Blank + * + * @return boolean + */ + public function getAllowBlank() + { + return $this->allowBlank; + } + + /** + * Set Allow Blank + * + * @param boolean $value + * @return PHPExcel_Cell_DataValidation + */ + public function setAllowBlank($value = false) + { + $this->allowBlank = $value; + return $this; + } + + /** + * Get Show DropDown + * + * @return boolean + */ + public function getShowDropDown() + { + return $this->showDropDown; + } + + /** + * Set Show DropDown + * + * @param boolean $value + * @return PHPExcel_Cell_DataValidation + */ + public function setShowDropDown($value = false) + { + $this->showDropDown = $value; + return $this; + } + + /** + * Get Show InputMessage + * + * @return boolean + */ + public function getShowInputMessage() + { + return $this->showInputMessage; + } + + /** + * Set Show InputMessage + * + * @param boolean $value + * @return PHPExcel_Cell_DataValidation + */ + public function setShowInputMessage($value = false) + { + $this->showInputMessage = $value; + return $this; + } + + /** + * Get Show ErrorMessage + * + * @return boolean + */ + public function getShowErrorMessage() + { + return $this->showErrorMessage; + } + + /** + * Set Show ErrorMessage + * + * @param boolean $value + * @return PHPExcel_Cell_DataValidation + */ + public function setShowErrorMessage($value = false) + { + $this->showErrorMessage = $value; + return $this; + } + + /** + * Get Error title + * + * @return string + */ + public function getErrorTitle() + { + return $this->errorTitle; + } + + /** + * Set Error title + * + * @param string $value + * @return PHPExcel_Cell_DataValidation + */ + public function setErrorTitle($value = '') + { + $this->errorTitle = $value; + return $this; + } + + /** + * Get Error + * + * @return string + */ + public function getError() + { + return $this->error; + } + + /** + * Set Error + * + * @param string $value + * @return PHPExcel_Cell_DataValidation + */ + public function setError($value = '') + { + $this->error = $value; + return $this; + } + + /** + * Get Prompt title + * + * @return string + */ + public function getPromptTitle() + { + return $this->promptTitle; + } + + /** + * Set Prompt title + * + * @param string $value + * @return PHPExcel_Cell_DataValidation + */ + public function setPromptTitle($value = '') + { + $this->promptTitle = $value; + return $this; + } + + /** + * Get Prompt + * + * @return string + */ + public function getPrompt() + { + return $this->prompt; + } + + /** + * Set Prompt + * + * @param string $value + * @return PHPExcel_Cell_DataValidation + */ + public function setPrompt($value = '') + { + $this->prompt = $value; + return $this; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + return md5( + $this->formula1 . + $this->formula2 . + $this->type = PHPExcel_Cell_DataValidation::TYPE_NONE . + $this->errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP . + $this->operator . + ($this->allowBlank ? 't' : 'f') . + ($this->showDropDown ? 't' : 'f') . + ($this->showInputMessage ? 't' : 'f') . + ($this->showErrorMessage ? 't' : 'f') . + $this->errorTitle . + $this->error . + $this->promptTitle . + $this->prompt . + __CLASS__ + ); + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Cell/DefaultValueBinder.php b/extend/PHPExcel/PHPExcel/Cell/DefaultValueBinder.php new file mode 100644 index 0000000..dc19e6c --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Cell/DefaultValueBinder.php @@ -0,0 +1,102 @@ +format('Y-m-d H:i:s'); + } elseif (!($value instanceof PHPExcel_RichText)) { + $value = (string) $value; + } + } + + // Set value explicit + $cell->setValueExplicit($value, self::dataTypeForValue($value)); + + // Done! + return true; + } + + /** + * DataType for value + * + * @param mixed $pValue + * @return string + */ + public static function dataTypeForValue($pValue = null) + { + // Match the value against a few data types + if ($pValue === null) { + return PHPExcel_Cell_DataType::TYPE_NULL; + } elseif ($pValue === '') { + return PHPExcel_Cell_DataType::TYPE_STRING; + } elseif ($pValue instanceof PHPExcel_RichText) { + return PHPExcel_Cell_DataType::TYPE_INLINE; + } elseif ($pValue{0} === '=' && strlen($pValue) > 1) { + return PHPExcel_Cell_DataType::TYPE_FORMULA; + } elseif (is_bool($pValue)) { + return PHPExcel_Cell_DataType::TYPE_BOOL; + } elseif (is_float($pValue) || is_int($pValue)) { + return PHPExcel_Cell_DataType::TYPE_NUMERIC; + } elseif (preg_match('/^[\+\-]?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)([Ee][\-\+]?[0-2]?\d{1,3})?$/', $pValue)) { + $tValue = ltrim($pValue, '+-'); + if (is_string($pValue) && $tValue{0} === '0' && strlen($tValue) > 1 && $tValue{1} !== '.') { + return PHPExcel_Cell_DataType::TYPE_STRING; + } elseif ((strpos($pValue, '.') === false) && ($pValue > PHP_INT_MAX)) { + return PHPExcel_Cell_DataType::TYPE_STRING; + } + return PHPExcel_Cell_DataType::TYPE_NUMERIC; + } elseif (is_string($pValue) && array_key_exists($pValue, PHPExcel_Cell_DataType::getErrorCodes())) { + return PHPExcel_Cell_DataType::TYPE_ERROR; + } + + return PHPExcel_Cell_DataType::TYPE_STRING; + } +} diff --git a/extend/PHPExcel/PHPExcel/Cell/Hyperlink.php b/extend/PHPExcel/PHPExcel/Cell/Hyperlink.php new file mode 100644 index 0000000..daab54c --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Cell/Hyperlink.php @@ -0,0 +1,124 @@ +url = $pUrl; + $this->tooltip = $pTooltip; + } + + /** + * Get URL + * + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * Set URL + * + * @param string $value + * @return PHPExcel_Cell_Hyperlink + */ + public function setUrl($value = '') + { + $this->url = $value; + return $this; + } + + /** + * Get tooltip + * + * @return string + */ + public function getTooltip() + { + return $this->tooltip; + } + + /** + * Set tooltip + * + * @param string $value + * @return PHPExcel_Cell_Hyperlink + */ + public function setTooltip($value = '') + { + $this->tooltip = $value; + return $this; + } + + /** + * Is this hyperlink internal? (to another worksheet) + * + * @return boolean + */ + public function isInternal() + { + return strpos($this->url, 'sheet://') !== false; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + return md5( + $this->url . + $this->tooltip . + __CLASS__ + ); + } +} diff --git a/extend/PHPExcel/PHPExcel/Cell/IValueBinder.php b/extend/PHPExcel/PHPExcel/Cell/IValueBinder.php new file mode 100644 index 0000000..de2d0ac --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Cell/IValueBinder.php @@ -0,0 +1,47 @@ +name = $name; + $this->title = $title; + $this->legend = $legend; + $this->xAxisLabel = $xAxisLabel; + $this->yAxisLabel = $yAxisLabel; + $this->plotArea = $plotArea; + $this->plotVisibleOnly = $plotVisibleOnly; + $this->displayBlanksAs = $displayBlanksAs; + $this->xAxis = $xAxis; + $this->yAxis = $yAxis; + $this->majorGridlines = $majorGridlines; + $this->minorGridlines = $minorGridlines; + } + + /** + * Get Name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Get Worksheet + * + * @return PHPExcel_Worksheet + */ + public function getWorksheet() + { + return $this->worksheet; + } + + /** + * Set Worksheet + * + * @param PHPExcel_Worksheet $pValue + * @throws PHPExcel_Chart_Exception + * @return PHPExcel_Chart + */ + public function setWorksheet(PHPExcel_Worksheet $pValue = null) + { + $this->worksheet = $pValue; + + return $this; + } + + /** + * Get Title + * + * @return PHPExcel_Chart_Title + */ + public function getTitle() + { + return $this->title; + } + + /** + * Set Title + * + * @param PHPExcel_Chart_Title $title + * @return PHPExcel_Chart + */ + public function setTitle(PHPExcel_Chart_Title $title) + { + $this->title = $title; + + return $this; + } + + /** + * Get Legend + * + * @return PHPExcel_Chart_Legend + */ + public function getLegend() + { + return $this->legend; + } + + /** + * Set Legend + * + * @param PHPExcel_Chart_Legend $legend + * @return PHPExcel_Chart + */ + public function setLegend(PHPExcel_Chart_Legend $legend) + { + $this->legend = $legend; + + return $this; + } + + /** + * Get X-Axis Label + * + * @return PHPExcel_Chart_Title + */ + public function getXAxisLabel() + { + return $this->xAxisLabel; + } + + /** + * Set X-Axis Label + * + * @param PHPExcel_Chart_Title $label + * @return PHPExcel_Chart + */ + public function setXAxisLabel(PHPExcel_Chart_Title $label) + { + $this->xAxisLabel = $label; + + return $this; + } + + /** + * Get Y-Axis Label + * + * @return PHPExcel_Chart_Title + */ + public function getYAxisLabel() + { + return $this->yAxisLabel; + } + + /** + * Set Y-Axis Label + * + * @param PHPExcel_Chart_Title $label + * @return PHPExcel_Chart + */ + public function setYAxisLabel(PHPExcel_Chart_Title $label) + { + $this->yAxisLabel = $label; + + return $this; + } + + /** + * Get Plot Area + * + * @return PHPExcel_Chart_PlotArea + */ + public function getPlotArea() + { + return $this->plotArea; + } + + /** + * Get Plot Visible Only + * + * @return boolean + */ + public function getPlotVisibleOnly() + { + return $this->plotVisibleOnly; + } + + /** + * Set Plot Visible Only + * + * @param boolean $plotVisibleOnly + * @return PHPExcel_Chart + */ + public function setPlotVisibleOnly($plotVisibleOnly = true) + { + $this->plotVisibleOnly = $plotVisibleOnly; + + return $this; + } + + /** + * Get Display Blanks as + * + * @return string + */ + public function getDisplayBlanksAs() + { + return $this->displayBlanksAs; + } + + /** + * Set Display Blanks as + * + * @param string $displayBlanksAs + * @return PHPExcel_Chart + */ + public function setDisplayBlanksAs($displayBlanksAs = '0') + { + $this->displayBlanksAs = $displayBlanksAs; + } + + + /** + * Get yAxis + * + * @return PHPExcel_Chart_Axis + */ + public function getChartAxisY() + { + if ($this->yAxis !== null) { + return $this->yAxis; + } + + return new PHPExcel_Chart_Axis(); + } + + /** + * Get xAxis + * + * @return PHPExcel_Chart_Axis + */ + public function getChartAxisX() + { + if ($this->xAxis !== null) { + return $this->xAxis; + } + + return new PHPExcel_Chart_Axis(); + } + + /** + * Get Major Gridlines + * + * @return PHPExcel_Chart_GridLines + */ + public function getMajorGridlines() + { + if ($this->majorGridlines !== null) { + return $this->majorGridlines; + } + + return new PHPExcel_Chart_GridLines(); + } + + /** + * Get Minor Gridlines + * + * @return PHPExcel_Chart_GridLines + */ + public function getMinorGridlines() + { + if ($this->minorGridlines !== null) { + return $this->minorGridlines; + } + + return new PHPExcel_Chart_GridLines(); + } + + + /** + * Set the Top Left position for the chart + * + * @param string $cell + * @param integer $xOffset + * @param integer $yOffset + * @return PHPExcel_Chart + */ + public function setTopLeftPosition($cell, $xOffset = null, $yOffset = null) + { + $this->topLeftCellRef = $cell; + if (!is_null($xOffset)) { + $this->setTopLeftXOffset($xOffset); + } + if (!is_null($yOffset)) { + $this->setTopLeftYOffset($yOffset); + } + + return $this; + } + + /** + * Get the top left position of the chart + * + * @return array an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell + */ + public function getTopLeftPosition() + { + return array( + 'cell' => $this->topLeftCellRef, + 'xOffset' => $this->topLeftXOffset, + 'yOffset' => $this->topLeftYOffset + ); + } + + /** + * Get the cell address where the top left of the chart is fixed + * + * @return string + */ + public function getTopLeftCell() + { + return $this->topLeftCellRef; + } + + /** + * Set the Top Left cell position for the chart + * + * @param string $cell + * @return PHPExcel_Chart + */ + public function setTopLeftCell($cell) + { + $this->topLeftCellRef = $cell; + + return $this; + } + + /** + * Set the offset position within the Top Left cell for the chart + * + * @param integer $xOffset + * @param integer $yOffset + * @return PHPExcel_Chart + */ + public function setTopLeftOffset($xOffset = null, $yOffset = null) + { + if (!is_null($xOffset)) { + $this->setTopLeftXOffset($xOffset); + } + if (!is_null($yOffset)) { + $this->setTopLeftYOffset($yOffset); + } + + return $this; + } + + /** + * Get the offset position within the Top Left cell for the chart + * + * @return integer[] + */ + public function getTopLeftOffset() + { + return array( + 'X' => $this->topLeftXOffset, + 'Y' => $this->topLeftYOffset + ); + } + + public function setTopLeftXOffset($xOffset) + { + $this->topLeftXOffset = $xOffset; + + return $this; + } + + public function getTopLeftXOffset() + { + return $this->topLeftXOffset; + } + + public function setTopLeftYOffset($yOffset) + { + $this->topLeftYOffset = $yOffset; + + return $this; + } + + public function getTopLeftYOffset() + { + return $this->topLeftYOffset; + } + + /** + * Set the Bottom Right position of the chart + * + * @param string $cell + * @param integer $xOffset + * @param integer $yOffset + * @return PHPExcel_Chart + */ + public function setBottomRightPosition($cell, $xOffset = null, $yOffset = null) + { + $this->bottomRightCellRef = $cell; + if (!is_null($xOffset)) { + $this->setBottomRightXOffset($xOffset); + } + if (!is_null($yOffset)) { + $this->setBottomRightYOffset($yOffset); + } + + return $this; + } + + /** + * Get the bottom right position of the chart + * + * @return array an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell + */ + public function getBottomRightPosition() + { + return array( + 'cell' => $this->bottomRightCellRef, + 'xOffset' => $this->bottomRightXOffset, + 'yOffset' => $this->bottomRightYOffset + ); + } + + public function setBottomRightCell($cell) + { + $this->bottomRightCellRef = $cell; + + return $this; + } + + /** + * Get the cell address where the bottom right of the chart is fixed + * + * @return string + */ + public function getBottomRightCell() + { + return $this->bottomRightCellRef; + } + + /** + * Set the offset position within the Bottom Right cell for the chart + * + * @param integer $xOffset + * @param integer $yOffset + * @return PHPExcel_Chart + */ + public function setBottomRightOffset($xOffset = null, $yOffset = null) + { + if (!is_null($xOffset)) { + $this->setBottomRightXOffset($xOffset); + } + if (!is_null($yOffset)) { + $this->setBottomRightYOffset($yOffset); + } + + return $this; + } + + /** + * Get the offset position within the Bottom Right cell for the chart + * + * @return integer[] + */ + public function getBottomRightOffset() + { + return array( + 'X' => $this->bottomRightXOffset, + 'Y' => $this->bottomRightYOffset + ); + } + + public function setBottomRightXOffset($xOffset) + { + $this->bottomRightXOffset = $xOffset; + + return $this; + } + + public function getBottomRightXOffset() + { + return $this->bottomRightXOffset; + } + + public function setBottomRightYOffset($yOffset) + { + $this->bottomRightYOffset = $yOffset; + + return $this; + } + + public function getBottomRightYOffset() + { + return $this->bottomRightYOffset; + } + + + public function refresh() + { + if ($this->worksheet !== null) { + $this->plotArea->refresh($this->worksheet); + } + } + + public function render($outputDestination = null) + { + $libraryName = PHPExcel_Settings::getChartRendererName(); + if (is_null($libraryName)) { + return false; + } + // Ensure that data series values are up-to-date before we render + $this->refresh(); + + $libraryPath = PHPExcel_Settings::getChartRendererPath(); + $includePath = str_replace('\\', '/', get_include_path()); + $rendererPath = str_replace('\\', '/', $libraryPath); + if (strpos($rendererPath, $includePath) === false) { + set_include_path(get_include_path() . PATH_SEPARATOR . $libraryPath); + } + + $rendererName = 'PHPExcel_Chart_Renderer_'.$libraryName; + $renderer = new $rendererName($this); + + if ($outputDestination == 'php://output') { + $outputDestination = null; + } + return $renderer->render($outputDestination); + } +} diff --git a/extend/PHPExcel/PHPExcel/Chart/Axis.php b/extend/PHPExcel/PHPExcel/Chart/Axis.php new file mode 100644 index 0000000..9aeafc6 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Chart/Axis.php @@ -0,0 +1,561 @@ + self::FORMAT_CODE_GENERAL, + 'source_linked' => 1 + ); + + /** + * Axis Options + * + * @var array of mixed + */ + private $axisOptions = array( + 'minimum' => null, + 'maximum' => null, + 'major_unit' => null, + 'minor_unit' => null, + 'orientation' => self::ORIENTATION_NORMAL, + 'minor_tick_mark' => self::TICK_MARK_NONE, + 'major_tick_mark' => self::TICK_MARK_NONE, + 'axis_labels' => self::AXIS_LABELS_NEXT_TO, + 'horizontal_crosses' => self::HORIZONTAL_CROSSES_AUTOZERO, + 'horizontal_crosses_value' => null + ); + + /** + * Fill Properties + * + * @var array of mixed + */ + private $fillProperties = array( + 'type' => self::EXCEL_COLOR_TYPE_ARGB, + 'value' => null, + 'alpha' => 0 + ); + + /** + * Line Properties + * + * @var array of mixed + */ + private $lineProperties = array( + 'type' => self::EXCEL_COLOR_TYPE_ARGB, + 'value' => null, + 'alpha' => 0 + ); + + /** + * Line Style Properties + * + * @var array of mixed + */ + private $lineStyleProperties = array( + 'width' => '9525', + 'compound' => self::LINE_STYLE_COMPOUND_SIMPLE, + 'dash' => self::LINE_STYLE_DASH_SOLID, + 'cap' => self::LINE_STYLE_CAP_FLAT, + 'join' => self::LINE_STYLE_JOIN_BEVEL, + 'arrow' => array( + 'head' => array( + 'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW, + 'size' => self::LINE_STYLE_ARROW_SIZE_5 + ), + 'end' => array( + 'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW, + 'size' => self::LINE_STYLE_ARROW_SIZE_8 + ), + ) + ); + + /** + * Shadow Properties + * + * @var array of mixed + */ + private $shadowProperties = array( + 'presets' => self::SHADOW_PRESETS_NOSHADOW, + 'effect' => null, + 'color' => array( + 'type' => self::EXCEL_COLOR_TYPE_STANDARD, + 'value' => 'black', + 'alpha' => 40, + ), + 'size' => array( + 'sx' => null, + 'sy' => null, + 'kx' => null + ), + 'blur' => null, + 'direction' => null, + 'distance' => null, + 'algn' => null, + 'rotWithShape' => null + ); + + /** + * Glow Properties + * + * @var array of mixed + */ + private $glowProperties = array( + 'size' => null, + 'color' => array( + 'type' => self::EXCEL_COLOR_TYPE_STANDARD, + 'value' => 'black', + 'alpha' => 40 + ) + ); + + /** + * Soft Edge Properties + * + * @var array of mixed + */ + private $softEdges = array( + 'size' => null + ); + + /** + * Get Series Data Type + * + * @return string + */ + public function setAxisNumberProperties($format_code) + { + $this->axisNumber['format'] = (string) $format_code; + $this->axisNumber['source_linked'] = 0; + } + + /** + * Get Axis Number Format Data Type + * + * @return string + */ + public function getAxisNumberFormat() + { + return $this->axisNumber['format']; + } + + /** + * Get Axis Number Source Linked + * + * @return string + */ + public function getAxisNumberSourceLinked() + { + return (string) $this->axisNumber['source_linked']; + } + + /** + * Set Axis Options Properties + * + * @param string $axis_labels + * @param string $horizontal_crosses_value + * @param string $horizontal_crosses + * @param string $axis_orientation + * @param string $major_tmt + * @param string $minor_tmt + * @param string $minimum + * @param string $maximum + * @param string $major_unit + * @param string $minor_unit + * + */ + public function setAxisOptionsProperties($axis_labels, $horizontal_crosses_value = null, $horizontal_crosses = null, $axis_orientation = null, $major_tmt = null, $minor_tmt = null, $minimum = null, $maximum = null, $major_unit = null, $minor_unit = null) + { + $this->axisOptions['axis_labels'] = (string) $axis_labels; + ($horizontal_crosses_value !== null) ? $this->axisOptions['horizontal_crosses_value'] = (string) $horizontal_crosses_value : null; + ($horizontal_crosses !== null) ? $this->axisOptions['horizontal_crosses'] = (string) $horizontal_crosses : null; + ($axis_orientation !== null) ? $this->axisOptions['orientation'] = (string) $axis_orientation : null; + ($major_tmt !== null) ? $this->axisOptions['major_tick_mark'] = (string) $major_tmt : null; + ($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null; + ($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null; + ($minimum !== null) ? $this->axisOptions['minimum'] = (string) $minimum : null; + ($maximum !== null) ? $this->axisOptions['maximum'] = (string) $maximum : null; + ($major_unit !== null) ? $this->axisOptions['major_unit'] = (string) $major_unit : null; + ($minor_unit !== null) ? $this->axisOptions['minor_unit'] = (string) $minor_unit : null; + } + + /** + * Get Axis Options Property + * + * @param string $property + * + * @return string + */ + public function getAxisOptionsProperty($property) + { + return $this->axisOptions[$property]; + } + + /** + * Set Axis Orientation Property + * + * @param string $orientation + * + */ + public function setAxisOrientation($orientation) + { + $this->orientation = (string) $orientation; + } + + /** + * Set Fill Property + * + * @param string $color + * @param int $alpha + * @param string $type + * + */ + public function setFillParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB) + { + $this->fillProperties = $this->setColorProperties($color, $alpha, $type); + } + + /** + * Set Line Property + * + * @param string $color + * @param int $alpha + * @param string $type + * + */ + public function setLineParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB) + { + $this->lineProperties = $this->setColorProperties($color, $alpha, $type); + } + + /** + * Get Fill Property + * + * @param string $property + * + * @return string + */ + public function getFillProperty($property) + { + return $this->fillProperties[$property]; + } + + /** + * Get Line Property + * + * @param string $property + * + * @return string + */ + public function getLineProperty($property) + { + return $this->lineProperties[$property]; + } + + /** + * Set Line Style Properties + * + * @param float $line_width + * @param string $compound_type + * @param string $dash_type + * @param string $cap_type + * @param string $join_type + * @param string $head_arrow_type + * @param string $head_arrow_size + * @param string $end_arrow_type + * @param string $end_arrow_size + * + */ + public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null) + { + (!is_null($line_width)) ? $this->lineStyleProperties['width'] = $this->getExcelPointsWidth((float) $line_width) : null; + (!is_null($compound_type)) ? $this->lineStyleProperties['compound'] = (string) $compound_type : null; + (!is_null($dash_type)) ? $this->lineStyleProperties['dash'] = (string) $dash_type : null; + (!is_null($cap_type)) ? $this->lineStyleProperties['cap'] = (string) $cap_type : null; + (!is_null($join_type)) ? $this->lineStyleProperties['join'] = (string) $join_type : null; + (!is_null($head_arrow_type)) ? $this->lineStyleProperties['arrow']['head']['type'] = (string) $head_arrow_type : null; + (!is_null($head_arrow_size)) ? $this->lineStyleProperties['arrow']['head']['size'] = (string) $head_arrow_size : null; + (!is_null($end_arrow_type)) ? $this->lineStyleProperties['arrow']['end']['type'] = (string) $end_arrow_type : null; + (!is_null($end_arrow_size)) ? $this->lineStyleProperties['arrow']['end']['size'] = (string) $end_arrow_size : null; + } + + /** + * Get Line Style Property + * + * @param array|string $elements + * + * @return string + */ + public function getLineStyleProperty($elements) + { + return $this->getArrayElementsValue($this->lineStyleProperties, $elements); + } + + /** + * Get Line Style Arrow Excel Width + * + * @param string $arrow + * + * @return string + */ + public function getLineStyleArrowWidth($arrow) + { + return $this->getLineStyleArrowSize($this->lineStyleProperties['arrow'][$arrow]['size'], 'w'); + } + + /** + * Get Line Style Arrow Excel Length + * + * @param string $arrow + * + * @return string + */ + public function getLineStyleArrowLength($arrow) + { + return $this->getLineStyleArrowSize($this->lineStyleProperties['arrow'][$arrow]['size'], 'len'); + } + + /** + * Set Shadow Properties + * + * @param int $shadow_presets + * @param string $sh_color_value + * @param string $sh_color_type + * @param string $sh_color_alpha + * @param float $sh_blur + * @param int $sh_angle + * @param float $sh_distance + * + */ + public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null) + { + $this->setShadowPresetsProperties((int) $sh_presets) + ->setShadowColor( + is_null($sh_color_value) ? $this->shadowProperties['color']['value'] : $sh_color_value, + is_null($sh_color_alpha) ? (int) $this->shadowProperties['color']['alpha'] : $sh_color_alpha, + is_null($sh_color_type) ? $this->shadowProperties['color']['type'] : $sh_color_type + ) + ->setShadowBlur($sh_blur) + ->setShadowAngle($sh_angle) + ->setShadowDistance($sh_distance); + } + + /** + * Set Shadow Color + * + * @param int $shadow_presets + * + * @return PHPExcel_Chart_Axis + */ + private function setShadowPresetsProperties($shadow_presets) + { + $this->shadowProperties['presets'] = $shadow_presets; + $this->setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets)); + + return $this; + } + + /** + * Set Shadow Properties from Maped Values + * + * @param array $properties_map + * @param * $reference + * + * @return PHPExcel_Chart_Axis + */ + private function setShadowProperiesMapValues(array $properties_map, &$reference = null) + { + $base_reference = $reference; + foreach ($properties_map as $property_key => $property_val) { + if (is_array($property_val)) { + if ($reference === null) { + $reference = & $this->shadowProperties[$property_key]; + } else { + $reference = & $reference[$property_key]; + } + $this->setShadowProperiesMapValues($property_val, $reference); + } else { + if ($base_reference === null) { + $this->shadowProperties[$property_key] = $property_val; + } else { + $reference[$property_key] = $property_val; + } + } + } + + return $this; + } + + /** + * Set Shadow Color + * + * @param string $color + * @param int $alpha + * @param string $type + * + * @return PHPExcel_Chart_Axis + */ + private function setShadowColor($color, $alpha, $type) + { + $this->shadowProperties['color'] = $this->setColorProperties($color, $alpha, $type); + + return $this; + } + + /** + * Set Shadow Blur + * + * @param float $blur + * + * @return PHPExcel_Chart_Axis + */ + private function setShadowBlur($blur) + { + if ($blur !== null) { + $this->shadowProperties['blur'] = (string) $this->getExcelPointsWidth($blur); + } + + return $this; + } + + /** + * Set Shadow Angle + * + * @param int $angle + * + * @return PHPExcel_Chart_Axis + */ + private function setShadowAngle($angle) + { + if ($angle !== null) { + $this->shadowProperties['direction'] = (string) $this->getExcelPointsAngle($angle); + } + + return $this; + } + + /** + * Set Shadow Distance + * + * @param float $distance + * + * @return PHPExcel_Chart_Axis + */ + private function setShadowDistance($distance) + { + if ($distance !== null) { + $this->shadowProperties['distance'] = (string) $this->getExcelPointsWidth($distance); + } + + return $this; + } + + /** + * Get Glow Property + * + * @param float $size + * @param string $color_value + * @param int $color_alpha + * @param string $color_type + */ + public function getShadowProperty($elements) + { + return $this->getArrayElementsValue($this->shadowProperties, $elements); + } + + /** + * Set Glow Properties + * + * @param float $size + * @param string $color_value + * @param int $color_alpha + * @param string $color_type + */ + public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null) + { + $this->setGlowSize($size) + ->setGlowColor( + is_null($color_value) ? $this->glowProperties['color']['value'] : $color_value, + is_null($color_alpha) ? (int) $this->glowProperties['color']['alpha'] : $color_alpha, + is_null($color_type) ? $this->glowProperties['color']['type'] : $color_type + ); + } + + /** + * Get Glow Property + * + * @param array|string $property + * + * @return string + */ + public function getGlowProperty($property) + { + return $this->getArrayElementsValue($this->glowProperties, $property); + } + + /** + * Set Glow Color + * + * @param float $size + * + * @return PHPExcel_Chart_Axis + */ + private function setGlowSize($size) + { + if (!is_null($size)) { + $this->glowProperties['size'] = $this->getExcelPointsWidth($size); + } + + return $this; + } + + /** + * Set Glow Color + * + * @param string $color + * @param int $alpha + * @param string $type + * + * @return PHPExcel_Chart_Axis + */ + private function setGlowColor($color, $alpha, $type) + { + $this->glowProperties['color'] = $this->setColorProperties($color, $alpha, $type); + + return $this; + } + + /** + * Set Soft Edges Size + * + * @param float $size + */ + public function setSoftEdges($size) + { + if (!is_null($size)) { + $softEdges['size'] = (string) $this->getExcelPointsWidth($size); + } + } + + /** + * Get Soft Edges Size + * + * @return string + */ + public function getSoftEdgesSize() + { + return $this->softEdges['size']; + } +} diff --git a/extend/PHPExcel/PHPExcel/Chart/DataSeries.php b/extend/PHPExcel/PHPExcel/Chart/DataSeries.php new file mode 100644 index 0000000..9ecd543 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Chart/DataSeries.php @@ -0,0 +1,390 @@ +plotType = $plotType; + $this->plotGrouping = $plotGrouping; + $this->plotOrder = $plotOrder; + $keys = array_keys($plotValues); + $this->plotValues = $plotValues; + if ((count($plotLabel) == 0) || (is_null($plotLabel[$keys[0]]))) { + $plotLabel[$keys[0]] = new PHPExcel_Chart_DataSeriesValues(); + } + + $this->plotLabel = $plotLabel; + if ((count($plotCategory) == 0) || (is_null($plotCategory[$keys[0]]))) { + $plotCategory[$keys[0]] = new PHPExcel_Chart_DataSeriesValues(); + } + $this->plotCategory = $plotCategory; + $this->smoothLine = $smoothLine; + $this->plotStyle = $plotStyle; + + if (is_null($plotDirection)) { + $plotDirection = self::DIRECTION_COL; + } + $this->plotDirection = $plotDirection; + } + + /** + * Get Plot Type + * + * @return string + */ + public function getPlotType() + { + return $this->plotType; + } + + /** + * Set Plot Type + * + * @param string $plotType + * @return PHPExcel_Chart_DataSeries + */ + public function setPlotType($plotType = '') + { + $this->plotType = $plotType; + return $this; + } + + /** + * Get Plot Grouping Type + * + * @return string + */ + public function getPlotGrouping() + { + return $this->plotGrouping; + } + + /** + * Set Plot Grouping Type + * + * @param string $groupingType + * @return PHPExcel_Chart_DataSeries + */ + public function setPlotGrouping($groupingType = null) + { + $this->plotGrouping = $groupingType; + return $this; + } + + /** + * Get Plot Direction + * + * @return string + */ + public function getPlotDirection() + { + return $this->plotDirection; + } + + /** + * Set Plot Direction + * + * @param string $plotDirection + * @return PHPExcel_Chart_DataSeries + */ + public function setPlotDirection($plotDirection = null) + { + $this->plotDirection = $plotDirection; + return $this; + } + + /** + * Get Plot Order + * + * @return string + */ + public function getPlotOrder() + { + return $this->plotOrder; + } + + /** + * Get Plot Labels + * + * @return array of PHPExcel_Chart_DataSeriesValues + */ + public function getPlotLabels() + { + return $this->plotLabel; + } + + /** + * Get Plot Label by Index + * + * @return PHPExcel_Chart_DataSeriesValues + */ + public function getPlotLabelByIndex($index) + { + $keys = array_keys($this->plotLabel); + if (in_array($index, $keys)) { + return $this->plotLabel[$index]; + } elseif (isset($keys[$index])) { + return $this->plotLabel[$keys[$index]]; + } + return false; + } + + /** + * Get Plot Categories + * + * @return array of PHPExcel_Chart_DataSeriesValues + */ + public function getPlotCategories() + { + return $this->plotCategory; + } + + /** + * Get Plot Category by Index + * + * @return PHPExcel_Chart_DataSeriesValues + */ + public function getPlotCategoryByIndex($index) + { + $keys = array_keys($this->plotCategory); + if (in_array($index, $keys)) { + return $this->plotCategory[$index]; + } elseif (isset($keys[$index])) { + return $this->plotCategory[$keys[$index]]; + } + return false; + } + + /** + * Get Plot Style + * + * @return string + */ + public function getPlotStyle() + { + return $this->plotStyle; + } + + /** + * Set Plot Style + * + * @param string $plotStyle + * @return PHPExcel_Chart_DataSeries + */ + public function setPlotStyle($plotStyle = null) + { + $this->plotStyle = $plotStyle; + return $this; + } + + /** + * Get Plot Values + * + * @return array of PHPExcel_Chart_DataSeriesValues + */ + public function getPlotValues() + { + return $this->plotValues; + } + + /** + * Get Plot Values by Index + * + * @return PHPExcel_Chart_DataSeriesValues + */ + public function getPlotValuesByIndex($index) + { + $keys = array_keys($this->plotValues); + if (in_array($index, $keys)) { + return $this->plotValues[$index]; + } elseif (isset($keys[$index])) { + return $this->plotValues[$keys[$index]]; + } + return false; + } + + /** + * Get Number of Plot Series + * + * @return integer + */ + public function getPlotSeriesCount() + { + return count($this->plotValues); + } + + /** + * Get Smooth Line + * + * @return boolean + */ + public function getSmoothLine() + { + return $this->smoothLine; + } + + /** + * Set Smooth Line + * + * @param boolean $smoothLine + * @return PHPExcel_Chart_DataSeries + */ + public function setSmoothLine($smoothLine = true) + { + $this->smoothLine = $smoothLine; + return $this; + } + + public function refresh(PHPExcel_Worksheet $worksheet) + { + foreach ($this->plotValues as $plotValues) { + if ($plotValues !== null) { + $plotValues->refresh($worksheet, true); + } + } + foreach ($this->plotLabel as $plotValues) { + if ($plotValues !== null) { + $plotValues->refresh($worksheet, true); + } + } + foreach ($this->plotCategory as $plotValues) { + if ($plotValues !== null) { + $plotValues->refresh($worksheet, false); + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Chart/DataSeriesValues.php b/extend/PHPExcel/PHPExcel/Chart/DataSeriesValues.php new file mode 100644 index 0000000..ea57e52 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Chart/DataSeriesValues.php @@ -0,0 +1,333 @@ +setDataType($dataType); + $this->dataSource = $dataSource; + $this->formatCode = $formatCode; + $this->pointCount = $pointCount; + $this->dataValues = $dataValues; + $this->pointMarker = $marker; + } + + /** + * Get Series Data Type + * + * @return string + */ + public function getDataType() + { + return $this->dataType; + } + + /** + * Set Series Data Type + * + * @param string $dataType Datatype of this data series + * Typical values are: + * PHPExcel_Chart_DataSeriesValues::DATASERIES_TYPE_STRING + * Normally used for axis point values + * PHPExcel_Chart_DataSeriesValues::DATASERIES_TYPE_NUMBER + * Normally used for chart data values + * @return PHPExcel_Chart_DataSeriesValues + */ + public function setDataType($dataType = self::DATASERIES_TYPE_NUMBER) + { + if (!in_array($dataType, self::$dataTypeValues)) { + throw new PHPExcel_Chart_Exception('Invalid datatype for chart data series values'); + } + $this->dataType = $dataType; + + return $this; + } + + /** + * Get Series Data Source (formula) + * + * @return string + */ + public function getDataSource() + { + return $this->dataSource; + } + + /** + * Set Series Data Source (formula) + * + * @param string $dataSource + * @return PHPExcel_Chart_DataSeriesValues + */ + public function setDataSource($dataSource = null, $refreshDataValues = true) + { + $this->dataSource = $dataSource; + + if ($refreshDataValues) { + // TO DO + } + + return $this; + } + + /** + * Get Point Marker + * + * @return string + */ + public function getPointMarker() + { + return $this->pointMarker; + } + + /** + * Set Point Marker + * + * @param string $marker + * @return PHPExcel_Chart_DataSeriesValues + */ + public function setPointMarker($marker = null) + { + $this->pointMarker = $marker; + + return $this; + } + + /** + * Get Series Format Code + * + * @return string + */ + public function getFormatCode() + { + return $this->formatCode; + } + + /** + * Set Series Format Code + * + * @param string $formatCode + * @return PHPExcel_Chart_DataSeriesValues + */ + public function setFormatCode($formatCode = null) + { + $this->formatCode = $formatCode; + + return $this; + } + + /** + * Get Series Point Count + * + * @return integer + */ + public function getPointCount() + { + return $this->pointCount; + } + + /** + * Identify if the Data Series is a multi-level or a simple series + * + * @return boolean + */ + public function isMultiLevelSeries() + { + if (count($this->dataValues) > 0) { + return is_array($this->dataValues[0]); + } + return null; + } + + /** + * Return the level count of a multi-level Data Series + * + * @return boolean + */ + public function multiLevelCount() + { + $levelCount = 0; + foreach ($this->dataValues as $dataValueSet) { + $levelCount = max($levelCount, count($dataValueSet)); + } + return $levelCount; + } + + /** + * Get Series Data Values + * + * @return array of mixed + */ + public function getDataValues() + { + return $this->dataValues; + } + + /** + * Get the first Series Data value + * + * @return mixed + */ + public function getDataValue() + { + $count = count($this->dataValues); + if ($count == 0) { + return null; + } elseif ($count == 1) { + return $this->dataValues[0]; + } + return $this->dataValues; + } + + /** + * Set Series Data Values + * + * @param array $dataValues + * @param boolean $refreshDataSource + * TRUE - refresh the value of dataSource based on the values of $dataValues + * FALSE - don't change the value of dataSource + * @return PHPExcel_Chart_DataSeriesValues + */ + public function setDataValues($dataValues = array(), $refreshDataSource = true) + { + $this->dataValues = PHPExcel_Calculation_Functions::flattenArray($dataValues); + $this->pointCount = count($dataValues); + + if ($refreshDataSource) { + // TO DO + } + + return $this; + } + + private function stripNulls($var) + { + return $var !== null; + } + + public function refresh(PHPExcel_Worksheet $worksheet, $flatten = true) + { + if ($this->dataSource !== null) { + $calcEngine = PHPExcel_Calculation::getInstance($worksheet->getParent()); + $newDataValues = PHPExcel_Calculation::unwrapResult( + $calcEngine->_calculateFormulaValue( + '='.$this->dataSource, + null, + $worksheet->getCell('A1') + ) + ); + if ($flatten) { + $this->dataValues = PHPExcel_Calculation_Functions::flattenArray($newDataValues); + foreach ($this->dataValues as &$dataValue) { + if ((!empty($dataValue)) && ($dataValue[0] == '#')) { + $dataValue = 0.0; + } + } + unset($dataValue); + } else { + $cellRange = explode('!', $this->dataSource); + if (count($cellRange) > 1) { + list(, $cellRange) = $cellRange; + } + + $dimensions = PHPExcel_Cell::rangeDimension(str_replace('$', '', $cellRange)); + if (($dimensions[0] == 1) || ($dimensions[1] == 1)) { + $this->dataValues = PHPExcel_Calculation_Functions::flattenArray($newDataValues); + } else { + $newArray = array_values(array_shift($newDataValues)); + foreach ($newArray as $i => $newDataSet) { + $newArray[$i] = array($newDataSet); + } + + foreach ($newDataValues as $newDataSet) { + $i = 0; + foreach ($newDataSet as $newDataVal) { + array_unshift($newArray[$i++], $newDataVal); + } + } + $this->dataValues = $newArray; + } + } + $this->pointCount = count($this->dataValues); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Chart/Exception.php b/extend/PHPExcel/PHPExcel/Chart/Exception.php new file mode 100644 index 0000000..e20dfa5 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Chart/Exception.php @@ -0,0 +1,46 @@ +line = $line; + $e->file = $file; + throw $e; + } +} diff --git a/extend/PHPExcel/PHPExcel/Chart/GridLines.php b/extend/PHPExcel/PHPExcel/Chart/GridLines.php new file mode 100644 index 0000000..898012e --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Chart/GridLines.php @@ -0,0 +1,472 @@ + array( + 'type' => self::EXCEL_COLOR_TYPE_STANDARD, + 'value' => null, + 'alpha' => 0 + ), + 'style' => array( + 'width' => '9525', + 'compound' => self::LINE_STYLE_COMPOUND_SIMPLE, + 'dash' => self::LINE_STYLE_DASH_SOLID, + 'cap' => self::LINE_STYLE_CAP_FLAT, + 'join' => self::LINE_STYLE_JOIN_BEVEL, + 'arrow' => array( + 'head' => array( + 'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW, + 'size' => self::LINE_STYLE_ARROW_SIZE_5 + ), + 'end' => array( + 'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW, + 'size' => self::LINE_STYLE_ARROW_SIZE_8 + ), + ) + ) + ); + + private $shadowProperties = array( + 'presets' => self::SHADOW_PRESETS_NOSHADOW, + 'effect' => null, + 'color' => array( + 'type' => self::EXCEL_COLOR_TYPE_STANDARD, + 'value' => 'black', + 'alpha' => 85, + ), + 'size' => array( + 'sx' => null, + 'sy' => null, + 'kx' => null + ), + 'blur' => null, + 'direction' => null, + 'distance' => null, + 'algn' => null, + 'rotWithShape' => null + ); + + private $glowProperties = array( + 'size' => null, + 'color' => array( + 'type' => self::EXCEL_COLOR_TYPE_STANDARD, + 'value' => 'black', + 'alpha' => 40 + ) + ); + + private $softEdges = array( + 'size' => null + ); + + /** + * Get Object State + * + * @return bool + */ + + public function getObjectState() + { + return $this->objectState; + } + + /** + * Change Object State to True + * + * @return PHPExcel_Chart_GridLines + */ + + private function activateObject() + { + $this->objectState = true; + + return $this; + } + + /** + * Set Line Color Properties + * + * @param string $value + * @param int $alpha + * @param string $type + */ + + public function setLineColorProperties($value, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_STANDARD) + { + $this->activateObject() + ->lineProperties['color'] = $this->setColorProperties( + $value, + $alpha, + $type + ); + } + + /** + * Set Line Color Properties + * + * @param float $line_width + * @param string $compound_type + * @param string $dash_type + * @param string $cap_type + * @param string $join_type + * @param string $head_arrow_type + * @param string $head_arrow_size + * @param string $end_arrow_type + * @param string $end_arrow_size + */ + + public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null) + { + $this->activateObject(); + (!is_null($line_width)) + ? $this->lineProperties['style']['width'] = $this->getExcelPointsWidth((float) $line_width) + : null; + (!is_null($compound_type)) + ? $this->lineProperties['style']['compound'] = (string) $compound_type + : null; + (!is_null($dash_type)) + ? $this->lineProperties['style']['dash'] = (string) $dash_type + : null; + (!is_null($cap_type)) + ? $this->lineProperties['style']['cap'] = (string) $cap_type + : null; + (!is_null($join_type)) + ? $this->lineProperties['style']['join'] = (string) $join_type + : null; + (!is_null($head_arrow_type)) + ? $this->lineProperties['style']['arrow']['head']['type'] = (string) $head_arrow_type + : null; + (!is_null($head_arrow_size)) + ? $this->lineProperties['style']['arrow']['head']['size'] = (string) $head_arrow_size + : null; + (!is_null($end_arrow_type)) + ? $this->lineProperties['style']['arrow']['end']['type'] = (string) $end_arrow_type + : null; + (!is_null($end_arrow_size)) + ? $this->lineProperties['style']['arrow']['end']['size'] = (string) $end_arrow_size + : null; + } + + /** + * Get Line Color Property + * + * @param string $parameter + * + * @return string + */ + + public function getLineColorProperty($parameter) + { + return $this->lineProperties['color'][$parameter]; + } + + /** + * Get Line Style Property + * + * @param array|string $elements + * + * @return string + */ + + public function getLineStyleProperty($elements) + { + return $this->getArrayElementsValue($this->lineProperties['style'], $elements); + } + + /** + * Set Glow Properties + * + * @param float $size + * @param string $color_value + * @param int $color_alpha + * @param string $color_type + * + */ + + public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null) + { + $this + ->activateObject() + ->setGlowSize($size) + ->setGlowColor($color_value, $color_alpha, $color_type); + } + + /** + * Get Glow Color Property + * + * @param string $property + * + * @return string + */ + + public function getGlowColor($property) + { + return $this->glowProperties['color'][$property]; + } + + /** + * Get Glow Size + * + * @return string + */ + + public function getGlowSize() + { + return $this->glowProperties['size']; + } + + /** + * Set Glow Size + * + * @param float $size + * + * @return PHPExcel_Chart_GridLines + */ + + private function setGlowSize($size) + { + $this->glowProperties['size'] = $this->getExcelPointsWidth((float) $size); + + return $this; + } + + /** + * Set Glow Color + * + * @param string $color + * @param int $alpha + * @param string $type + * + * @return PHPExcel_Chart_GridLines + */ + + private function setGlowColor($color, $alpha, $type) + { + if (!is_null($color)) { + $this->glowProperties['color']['value'] = (string) $color; + } + if (!is_null($alpha)) { + $this->glowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha); + } + if (!is_null($type)) { + $this->glowProperties['color']['type'] = (string) $type; + } + + return $this; + } + + /** + * Get Line Style Arrow Parameters + * + * @param string $arrow_selector + * @param string $property_selector + * + * @return string + */ + + public function getLineStyleArrowParameters($arrow_selector, $property_selector) + { + return $this->getLineStyleArrowSize($this->lineProperties['style']['arrow'][$arrow_selector]['size'], $property_selector); + } + + /** + * Set Shadow Properties + * + * @param int $sh_presets + * @param string $sh_color_value + * @param string $sh_color_type + * @param int $sh_color_alpha + * @param string $sh_blur + * @param int $sh_angle + * @param float $sh_distance + * + */ + + public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null) + { + $this->activateObject() + ->setShadowPresetsProperties((int) $sh_presets) + ->setShadowColor( + is_null($sh_color_value) ? $this->shadowProperties['color']['value'] : $sh_color_value, + is_null($sh_color_alpha) ? (int) $this->shadowProperties['color']['alpha'] : $this->getTrueAlpha($sh_color_alpha), + is_null($sh_color_type) ? $this->shadowProperties['color']['type'] : $sh_color_type + ) + ->setShadowBlur($sh_blur) + ->setShadowAngle($sh_angle) + ->setShadowDistance($sh_distance); + } + + /** + * Set Shadow Presets Properties + * + * @param int $shadow_presets + * + * @return PHPExcel_Chart_GridLines + */ + + private function setShadowPresetsProperties($shadow_presets) + { + $this->shadowProperties['presets'] = $shadow_presets; + $this->setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets)); + + return $this; + } + + /** + * Set Shadow Properties Values + * + * @param array $properties_map + * @param * $reference + * + * @return PHPExcel_Chart_GridLines + */ + + private function setShadowProperiesMapValues(array $properties_map, &$reference = null) + { + $base_reference = $reference; + foreach ($properties_map as $property_key => $property_val) { + if (is_array($property_val)) { + if ($reference === null) { + $reference = & $this->shadowProperties[$property_key]; + } else { + $reference = & $reference[$property_key]; + } + $this->setShadowProperiesMapValues($property_val, $reference); + } else { + if ($base_reference === null) { + $this->shadowProperties[$property_key] = $property_val; + } else { + $reference[$property_key] = $property_val; + } + } + } + + return $this; + } + + /** + * Set Shadow Color + * + * @param string $color + * @param int $alpha + * @param string $type + * @return PHPExcel_Chart_GridLines + */ + private function setShadowColor($color, $alpha, $type) + { + if (!is_null($color)) { + $this->shadowProperties['color']['value'] = (string) $color; + } + if (!is_null($alpha)) { + $this->shadowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha); + } + if (!is_null($type)) { + $this->shadowProperties['color']['type'] = (string) $type; + } + + return $this; + } + + /** + * Set Shadow Blur + * + * @param float $blur + * + * @return PHPExcel_Chart_GridLines + */ + private function setShadowBlur($blur) + { + if ($blur !== null) { + $this->shadowProperties['blur'] = (string) $this->getExcelPointsWidth($blur); + } + + return $this; + } + + /** + * Set Shadow Angle + * + * @param int $angle + * @return PHPExcel_Chart_GridLines + */ + + private function setShadowAngle($angle) + { + if ($angle !== null) { + $this->shadowProperties['direction'] = (string) $this->getExcelPointsAngle($angle); + } + + return $this; + } + + /** + * Set Shadow Distance + * + * @param float $distance + * @return PHPExcel_Chart_GridLines + */ + private function setShadowDistance($distance) + { + if ($distance !== null) { + $this->shadowProperties['distance'] = (string) $this->getExcelPointsWidth($distance); + } + + return $this; + } + + /** + * Get Shadow Property + * + * @param string $elements + * @param array $elements + * @return string + */ + public function getShadowProperty($elements) + { + return $this->getArrayElementsValue($this->shadowProperties, $elements); + } + + /** + * Set Soft Edges Size + * + * @param float $size + */ + public function setSoftEdgesSize($size) + { + if (!is_null($size)) { + $this->activateObject(); + $softEdges['size'] = (string) $this->getExcelPointsWidth($size); + } + } + + /** + * Get Soft Edges Size + * + * @return string + */ + public function getSoftEdgesSize() + { + return $this->softEdges['size']; + } +} diff --git a/extend/PHPExcel/PHPExcel/Chart/Layout.php b/extend/PHPExcel/PHPExcel/Chart/Layout.php new file mode 100644 index 0000000..7fef074 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Chart/Layout.php @@ -0,0 +1,486 @@ +layoutTarget = $layout['layoutTarget']; + } + if (isset($layout['xMode'])) { + $this->xMode = $layout['xMode']; + } + if (isset($layout['yMode'])) { + $this->yMode = $layout['yMode']; + } + if (isset($layout['x'])) { + $this->xPos = (float) $layout['x']; + } + if (isset($layout['y'])) { + $this->yPos = (float) $layout['y']; + } + if (isset($layout['w'])) { + $this->width = (float) $layout['w']; + } + if (isset($layout['h'])) { + $this->height = (float) $layout['h']; + } + } + + /** + * Get Layout Target + * + * @return string + */ + public function getLayoutTarget() + { + return $this->layoutTarget; + } + + /** + * Set Layout Target + * + * @param Layout Target $value + * @return PHPExcel_Chart_Layout + */ + public function setLayoutTarget($value) + { + $this->layoutTarget = $value; + return $this; + } + + /** + * Get X-Mode + * + * @return string + */ + public function getXMode() + { + return $this->xMode; + } + + /** + * Set X-Mode + * + * @param X-Mode $value + * @return PHPExcel_Chart_Layout + */ + public function setXMode($value) + { + $this->xMode = $value; + return $this; + } + + /** + * Get Y-Mode + * + * @return string + */ + public function getYMode() + { + return $this->yMode; + } + + /** + * Set Y-Mode + * + * @param Y-Mode $value + * @return PHPExcel_Chart_Layout + */ + public function setYMode($value) + { + $this->yMode = $value; + return $this; + } + + /** + * Get X-Position + * + * @return number + */ + public function getXPosition() + { + return $this->xPos; + } + + /** + * Set X-Position + * + * @param X-Position $value + * @return PHPExcel_Chart_Layout + */ + public function setXPosition($value) + { + $this->xPos = $value; + return $this; + } + + /** + * Get Y-Position + * + * @return number + */ + public function getYPosition() + { + return $this->yPos; + } + + /** + * Set Y-Position + * + * @param Y-Position $value + * @return PHPExcel_Chart_Layout + */ + public function setYPosition($value) + { + $this->yPos = $value; + return $this; + } + + /** + * Get Width + * + * @return number + */ + public function getWidth() + { + return $this->width; + } + + /** + * Set Width + * + * @param Width $value + * @return PHPExcel_Chart_Layout + */ + public function setWidth($value) + { + $this->width = $value; + return $this; + } + + /** + * Get Height + * + * @return number + */ + public function getHeight() + { + return $this->height; + } + + /** + * Set Height + * + * @param Height $value + * @return PHPExcel_Chart_Layout + */ + public function setHeight($value) + { + $this->height = $value; + return $this; + } + + + /** + * Get show legend key + * + * @return boolean + */ + public function getShowLegendKey() + { + return $this->showLegendKey; + } + + /** + * Set show legend key + * Specifies that legend keys should be shown in data labels. + * + * @param boolean $value Show legend key + * @return PHPExcel_Chart_Layout + */ + public function setShowLegendKey($value) + { + $this->showLegendKey = $value; + return $this; + } + + /** + * Get show value + * + * @return boolean + */ + public function getShowVal() + { + return $this->showVal; + } + + /** + * Set show val + * Specifies that the value should be shown in data labels. + * + * @param boolean $value Show val + * @return PHPExcel_Chart_Layout + */ + public function setShowVal($value) + { + $this->showVal = $value; + return $this; + } + + /** + * Get show category name + * + * @return boolean + */ + public function getShowCatName() + { + return $this->showCatName; + } + + /** + * Set show cat name + * Specifies that the category name should be shown in data labels. + * + * @param boolean $value Show cat name + * @return PHPExcel_Chart_Layout + */ + public function setShowCatName($value) + { + $this->showCatName = $value; + return $this; + } + + /** + * Get show data series name + * + * @return boolean + */ + public function getShowSerName() + { + return $this->showSerName; + } + + /** + * Set show ser name + * Specifies that the series name should be shown in data labels. + * + * @param boolean $value Show series name + * @return PHPExcel_Chart_Layout + */ + public function setShowSerName($value) + { + $this->showSerName = $value; + return $this; + } + + /** + * Get show percentage + * + * @return boolean + */ + public function getShowPercent() + { + return $this->showPercent; + } + + /** + * Set show percentage + * Specifies that the percentage should be shown in data labels. + * + * @param boolean $value Show percentage + * @return PHPExcel_Chart_Layout + */ + public function setShowPercent($value) + { + $this->showPercent = $value; + return $this; + } + + /** + * Get show bubble size + * + * @return boolean + */ + public function getShowBubbleSize() + { + return $this->showBubbleSize; + } + + /** + * Set show bubble size + * Specifies that the bubble size should be shown in data labels. + * + * @param boolean $value Show bubble size + * @return PHPExcel_Chart_Layout + */ + public function setShowBubbleSize($value) + { + $this->showBubbleSize = $value; + return $this; + } + + /** + * Get show leader lines + * + * @return boolean + */ + public function getShowLeaderLines() + { + return $this->showLeaderLines; + } + + /** + * Set show leader lines + * Specifies that leader lines should be shown in data labels. + * + * @param boolean $value Show leader lines + * @return PHPExcel_Chart_Layout + */ + public function setShowLeaderLines($value) + { + $this->showLeaderLines = $value; + return $this; + } +} diff --git a/extend/PHPExcel/PHPExcel/Chart/Legend.php b/extend/PHPExcel/PHPExcel/Chart/Legend.php new file mode 100644 index 0000000..e850eb5 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Chart/Legend.php @@ -0,0 +1,170 @@ + self::POSITION_BOTTOM, + self::xlLegendPositionCorner => self::POSITION_TOPRIGHT, + self::xlLegendPositionCustom => '??', + self::xlLegendPositionLeft => self::POSITION_LEFT, + self::xlLegendPositionRight => self::POSITION_RIGHT, + self::xlLegendPositionTop => self::POSITION_TOP + ); + + /** + * Legend position + * + * @var string + */ + private $position = self::POSITION_RIGHT; + + /** + * Allow overlay of other elements? + * + * @var boolean + */ + private $overlay = true; + + /** + * Legend Layout + * + * @var PHPExcel_Chart_Layout + */ + private $layout = null; + + + /** + * Create a new PHPExcel_Chart_Legend + */ + public function __construct($position = self::POSITION_RIGHT, PHPExcel_Chart_Layout $layout = null, $overlay = false) + { + $this->setPosition($position); + $this->layout = $layout; + $this->setOverlay($overlay); + } + + /** + * Get legend position as an excel string value + * + * @return string + */ + public function getPosition() + { + return $this->position; + } + + /** + * Get legend position using an excel string value + * + * @param string $position + */ + public function setPosition($position = self::POSITION_RIGHT) + { + if (!in_array($position, self::$positionXLref)) { + return false; + } + + $this->position = $position; + return true; + } + + /** + * Get legend position as an Excel internal numeric value + * + * @return number + */ + public function getPositionXL() + { + return array_search($this->position, self::$positionXLref); + } + + /** + * Set legend position using an Excel internal numeric value + * + * @param number $positionXL + */ + public function setPositionXL($positionXL = self::xlLegendPositionRight) + { + if (!array_key_exists($positionXL, self::$positionXLref)) { + return false; + } + + $this->position = self::$positionXLref[$positionXL]; + return true; + } + + /** + * Get allow overlay of other elements? + * + * @return boolean + */ + public function getOverlay() + { + return $this->overlay; + } + + /** + * Set allow overlay of other elements? + * + * @param boolean $overlay + * @return boolean + */ + public function setOverlay($overlay = false) + { + if (!is_bool($overlay)) { + return false; + } + + $this->overlay = $overlay; + return true; + } + + /** + * Get Layout + * + * @return PHPExcel_Chart_Layout + */ + public function getLayout() + { + return $this->layout; + } +} diff --git a/extend/PHPExcel/PHPExcel/Chart/PlotArea.php b/extend/PHPExcel/PHPExcel/Chart/PlotArea.php new file mode 100644 index 0000000..551cc51 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Chart/PlotArea.php @@ -0,0 +1,126 @@ +layout = $layout; + $this->plotSeries = $plotSeries; + } + + /** + * Get Layout + * + * @return PHPExcel_Chart_Layout + */ + public function getLayout() + { + return $this->layout; + } + + /** + * Get Number of Plot Groups + * + * @return array of PHPExcel_Chart_DataSeries + */ + public function getPlotGroupCount() + { + return count($this->plotSeries); + } + + /** + * Get Number of Plot Series + * + * @return integer + */ + public function getPlotSeriesCount() + { + $seriesCount = 0; + foreach ($this->plotSeries as $plot) { + $seriesCount += $plot->getPlotSeriesCount(); + } + return $seriesCount; + } + + /** + * Get Plot Series + * + * @return array of PHPExcel_Chart_DataSeries + */ + public function getPlotGroup() + { + return $this->plotSeries; + } + + /** + * Get Plot Series by Index + * + * @return PHPExcel_Chart_DataSeries + */ + public function getPlotGroupByIndex($index) + { + return $this->plotSeries[$index]; + } + + /** + * Set Plot Series + * + * @param [PHPExcel_Chart_DataSeries] + * @return PHPExcel_Chart_PlotArea + */ + public function setPlotSeries($plotSeries = array()) + { + $this->plotSeries = $plotSeries; + + return $this; + } + + public function refresh(PHPExcel_Worksheet $worksheet) + { + foreach ($this->plotSeries as $plotSeries) { + $plotSeries->refresh($worksheet); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Chart/Properties.php b/extend/PHPExcel/PHPExcel/Chart/Properties.php new file mode 100644 index 0000000..9bb6e93 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Chart/Properties.php @@ -0,0 +1,363 @@ + (string) $type, + 'value' => (string) $color, + 'alpha' => (string) $this->getTrueAlpha($alpha) + ); + } + + protected function getLineStyleArrowSize($array_selector, $array_kay_selector) + { + $sizes = array( + 1 => array('w' => 'sm', 'len' => 'sm'), + 2 => array('w' => 'sm', 'len' => 'med'), + 3 => array('w' => 'sm', 'len' => 'lg'), + 4 => array('w' => 'med', 'len' => 'sm'), + 5 => array('w' => 'med', 'len' => 'med'), + 6 => array('w' => 'med', 'len' => 'lg'), + 7 => array('w' => 'lg', 'len' => 'sm'), + 8 => array('w' => 'lg', 'len' => 'med'), + 9 => array('w' => 'lg', 'len' => 'lg') + ); + + return $sizes[$array_selector][$array_kay_selector]; + } + + protected function getShadowPresetsMap($shadow_presets_option) + { + $presets_options = array( + //OUTER + 1 => array( + 'effect' => 'outerShdw', + 'blur' => '50800', + 'distance' => '38100', + 'direction' => '2700000', + 'algn' => 'tl', + 'rotWithShape' => '0' + ), + 2 => array( + 'effect' => 'outerShdw', + 'blur' => '50800', + 'distance' => '38100', + 'direction' => '5400000', + 'algn' => 't', + 'rotWithShape' => '0' + ), + 3 => array( + 'effect' => 'outerShdw', + 'blur' => '50800', + 'distance' => '38100', + 'direction' => '8100000', + 'algn' => 'tr', + 'rotWithShape' => '0' + ), + 4 => array( + 'effect' => 'outerShdw', + 'blur' => '50800', + 'distance' => '38100', + 'algn' => 'l', + 'rotWithShape' => '0' + ), + 5 => array( + 'effect' => 'outerShdw', + 'size' => array( + 'sx' => '102000', + 'sy' => '102000' + ) + , + 'blur' => '63500', + 'distance' => '38100', + 'algn' => 'ctr', + 'rotWithShape' => '0' + ), + 6 => array( + 'effect' => 'outerShdw', + 'blur' => '50800', + 'distance' => '38100', + 'direction' => '10800000', + 'algn' => 'r', + 'rotWithShape' => '0' + ), + 7 => array( + 'effect' => 'outerShdw', + 'blur' => '50800', + 'distance' => '38100', + 'direction' => '18900000', + 'algn' => 'bl', + 'rotWithShape' => '0' + ), + 8 => array( + 'effect' => 'outerShdw', + 'blur' => '50800', + 'distance' => '38100', + 'direction' => '16200000', + 'rotWithShape' => '0' + ), + 9 => array( + 'effect' => 'outerShdw', + 'blur' => '50800', + 'distance' => '38100', + 'direction' => '13500000', + 'algn' => 'br', + 'rotWithShape' => '0' + ), + //INNER + 10 => array( + 'effect' => 'innerShdw', + 'blur' => '63500', + 'distance' => '50800', + 'direction' => '2700000', + ), + 11 => array( + 'effect' => 'innerShdw', + 'blur' => '63500', + 'distance' => '50800', + 'direction' => '5400000', + ), + 12 => array( + 'effect' => 'innerShdw', + 'blur' => '63500', + 'distance' => '50800', + 'direction' => '8100000', + ), + 13 => array( + 'effect' => 'innerShdw', + 'blur' => '63500', + 'distance' => '50800', + ), + 14 => array( + 'effect' => 'innerShdw', + 'blur' => '114300', + ), + 15 => array( + 'effect' => 'innerShdw', + 'blur' => '63500', + 'distance' => '50800', + 'direction' => '10800000', + ), + 16 => array( + 'effect' => 'innerShdw', + 'blur' => '63500', + 'distance' => '50800', + 'direction' => '18900000', + ), + 17 => array( + 'effect' => 'innerShdw', + 'blur' => '63500', + 'distance' => '50800', + 'direction' => '16200000', + ), + 18 => array( + 'effect' => 'innerShdw', + 'blur' => '63500', + 'distance' => '50800', + 'direction' => '13500000', + ), + //perspective + 19 => array( + 'effect' => 'outerShdw', + 'blur' => '152400', + 'distance' => '317500', + 'size' => array( + 'sx' => '90000', + 'sy' => '-19000', + ), + 'direction' => '5400000', + 'rotWithShape' => '0', + ), + 20 => array( + 'effect' => 'outerShdw', + 'blur' => '76200', + 'direction' => '18900000', + 'size' => array( + 'sy' => '23000', + 'kx' => '-1200000', + ), + 'algn' => 'bl', + 'rotWithShape' => '0', + ), + 21 => array( + 'effect' => 'outerShdw', + 'blur' => '76200', + 'direction' => '13500000', + 'size' => array( + 'sy' => '23000', + 'kx' => '1200000', + ), + 'algn' => 'br', + 'rotWithShape' => '0', + ), + 22 => array( + 'effect' => 'outerShdw', + 'blur' => '76200', + 'distance' => '12700', + 'direction' => '2700000', + 'size' => array( + 'sy' => '-23000', + 'kx' => '-800400', + ), + 'algn' => 'bl', + 'rotWithShape' => '0', + ), + 23 => array( + 'effect' => 'outerShdw', + 'blur' => '76200', + 'distance' => '12700', + 'direction' => '8100000', + 'size' => array( + 'sy' => '-23000', + 'kx' => '800400', + ), + 'algn' => 'br', + 'rotWithShape' => '0', + ), + ); + + return $presets_options[$shadow_presets_option]; + } + + protected function getArrayElementsValue($properties, $elements) + { + $reference = & $properties; + if (!is_array($elements)) { + return $reference[$elements]; + } else { + foreach ($elements as $keys) { + $reference = & $reference[$keys]; + } + return $reference; + } + return $this; + } +} diff --git a/extend/PHPExcel/PHPExcel/Chart/Renderer/PHP Charting Libraries.txt b/extend/PHPExcel/PHPExcel/Chart/Renderer/PHP Charting Libraries.txt new file mode 100644 index 0000000..9334f68 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Chart/Renderer/PHP Charting Libraries.txt @@ -0,0 +1,20 @@ +ChartDirector + http://www.advsofteng.com/cdphp.html + +GraPHPite + http://graphpite.sourceforge.net/ + +JpGraph + http://www.aditus.nu/jpgraph/ + +LibChart + http://naku.dohcrew.com/libchart/pages/introduction/ + +pChart + http://pchart.sourceforge.net/ + +TeeChart + http://www.steema.com/products/teechart/overview.html + +PHPGraphLib + http://www.ebrueggeman.com/phpgraphlib \ No newline at end of file diff --git a/extend/PHPExcel/PHPExcel/Chart/Renderer/jpgraph.php b/extend/PHPExcel/PHPExcel/Chart/Renderer/jpgraph.php new file mode 100644 index 0000000..b3d7396 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Chart/Renderer/jpgraph.php @@ -0,0 +1,883 @@ + MARK_DIAMOND, + 'square' => MARK_SQUARE, + 'triangle' => MARK_UTRIANGLE, + 'x' => MARK_X, + 'star' => MARK_STAR, + 'dot' => MARK_FILLEDCIRCLE, + 'dash' => MARK_DTRIANGLE, + 'circle' => MARK_CIRCLE, + 'plus' => MARK_CROSS + ); + + + private $chart; + + private $graph; + + private static $plotColour = 0; + + private static $plotMark = 0; + + + private function formatPointMarker($seriesPlot, $markerID) + { + $plotMarkKeys = array_keys(self::$markSet); + if (is_null($markerID)) { + // Use default plot marker (next marker in the series) + self::$plotMark %= count(self::$markSet); + $seriesPlot->mark->SetType(self::$markSet[$plotMarkKeys[self::$plotMark++]]); + } elseif ($markerID !== 'none') { + // Use specified plot marker (if it exists) + if (isset(self::$markSet[$markerID])) { + $seriesPlot->mark->SetType(self::$markSet[$markerID]); + } else { + // If the specified plot marker doesn't exist, use default plot marker (next marker in the series) + self::$plotMark %= count(self::$markSet); + $seriesPlot->mark->SetType(self::$markSet[$plotMarkKeys[self::$plotMark++]]); + } + } else { + // Hide plot marker + $seriesPlot->mark->Hide(); + } + $seriesPlot->mark->SetColor(self::$colourSet[self::$plotColour]); + $seriesPlot->mark->SetFillColor(self::$colourSet[self::$plotColour]); + $seriesPlot->SetColor(self::$colourSet[self::$plotColour++]); + + return $seriesPlot; + } + + + private function formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation = '') + { + $datasetLabelFormatCode = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getFormatCode(); + if (!is_null($datasetLabelFormatCode)) { + // Retrieve any label formatting code + $datasetLabelFormatCode = stripslashes($datasetLabelFormatCode); + } + + $testCurrentIndex = 0; + foreach ($datasetLabels as $i => $datasetLabel) { + if (is_array($datasetLabel)) { + if ($rotation == 'bar') { + $datasetLabels[$i] = implode(" ", $datasetLabel); + } else { + $datasetLabel = array_reverse($datasetLabel); + $datasetLabels[$i] = implode("\n", $datasetLabel); + } + } else { + // Format labels according to any formatting code + if (!is_null($datasetLabelFormatCode)) { + $datasetLabels[$i] = PHPExcel_Style_NumberFormat::toFormattedString($datasetLabel, $datasetLabelFormatCode); + } + } + ++$testCurrentIndex; + } + + return $datasetLabels; + } + + + private function percentageSumCalculation($groupID, $seriesCount) + { + // Adjust our values to a percentage value across all series in the group + for ($i = 0; $i < $seriesCount; ++$i) { + if ($i == 0) { + $sumValues = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); + } else { + $nextValues = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); + foreach ($nextValues as $k => $value) { + if (isset($sumValues[$k])) { + $sumValues[$k] += $value; + } else { + $sumValues[$k] = $value; + } + } + } + } + + return $sumValues; + } + + + private function percentageAdjustValues($dataValues, $sumValues) + { + foreach ($dataValues as $k => $dataValue) { + $dataValues[$k] = $dataValue / $sumValues[$k] * 100; + } + + return $dataValues; + } + + + private function getCaption($captionElement) + { + // Read any caption + $caption = (!is_null($captionElement)) ? $captionElement->getCaption() : null; + // Test if we have a title caption to display + if (!is_null($caption)) { + // If we do, it could be a plain string or an array + if (is_array($caption)) { + // Implode an array to a plain string + $caption = implode('', $caption); + } + } + return $caption; + } + + + private function renderTitle() + { + $title = $this->getCaption($this->chart->getTitle()); + if (!is_null($title)) { + $this->graph->title->Set($title); + } + } + + + private function renderLegend() + { + $legend = $this->chart->getLegend(); + if (!is_null($legend)) { + $legendPosition = $legend->getPosition(); + $legendOverlay = $legend->getOverlay(); + switch ($legendPosition) { + case 'r': + $this->graph->legend->SetPos(0.01, 0.5, 'right', 'center'); // right + $this->graph->legend->SetColumns(1); + break; + case 'l': + $this->graph->legend->SetPos(0.01, 0.5, 'left', 'center'); // left + $this->graph->legend->SetColumns(1); + break; + case 't': + $this->graph->legend->SetPos(0.5, 0.01, 'center', 'top'); // top + break; + case 'b': + $this->graph->legend->SetPos(0.5, 0.99, 'center', 'bottom'); // bottom + break; + default: + $this->graph->legend->SetPos(0.01, 0.01, 'right', 'top'); // top-right + $this->graph->legend->SetColumns(1); + break; + } + } else { + $this->graph->legend->Hide(); + } + } + + + private function renderCartesianPlotArea($type = 'textlin') + { + $this->graph = new Graph(self::$width, self::$height); + $this->graph->SetScale($type); + + $this->renderTitle(); + + // Rotate for bar rather than column chart + $rotation = $this->chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotDirection(); + $reverse = ($rotation == 'bar') ? true : false; + + $xAxisLabel = $this->chart->getXAxisLabel(); + if (!is_null($xAxisLabel)) { + $title = $this->getCaption($xAxisLabel); + if (!is_null($title)) { + $this->graph->xaxis->SetTitle($title, 'center'); + $this->graph->xaxis->title->SetMargin(35); + if ($reverse) { + $this->graph->xaxis->title->SetAngle(90); + $this->graph->xaxis->title->SetMargin(90); + } + } + } + + $yAxisLabel = $this->chart->getYAxisLabel(); + if (!is_null($yAxisLabel)) { + $title = $this->getCaption($yAxisLabel); + if (!is_null($title)) { + $this->graph->yaxis->SetTitle($title, 'center'); + if ($reverse) { + $this->graph->yaxis->title->SetAngle(0); + $this->graph->yaxis->title->SetMargin(-55); + } + } + } + } + + + private function renderPiePlotArea($doughnut = false) + { + $this->graph = new PieGraph(self::$width, self::$height); + + $this->renderTitle(); + } + + + private function renderRadarPlotArea() + { + $this->graph = new RadarGraph(self::$width, self::$height); + $this->graph->SetScale('lin'); + + $this->renderTitle(); + } + + + private function renderPlotLine($groupID, $filled = false, $combination = false, $dimensions = '2d') + { + $grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping(); + + $labelCount = count($this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount()); + if ($labelCount > 0) { + $datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues(); + $datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount); + $this->graph->xaxis->SetTickLabels($datasetLabels); + } + + $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); + $seriesPlots = array(); + if ($grouping == 'percentStacked') { + $sumValues = $this->percentageSumCalculation($groupID, $seriesCount); + } + + // Loop through each data series in turn + for ($i = 0; $i < $seriesCount; ++$i) { + $dataValues = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); + $marker = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker(); + + if ($grouping == 'percentStacked') { + $dataValues = $this->percentageAdjustValues($dataValues, $sumValues); + } + + // Fill in any missing values in the $dataValues array + $testCurrentIndex = 0; + foreach ($dataValues as $k => $dataValue) { + while ($k != $testCurrentIndex) { + $dataValues[$testCurrentIndex] = null; + ++$testCurrentIndex; + } + ++$testCurrentIndex; + } + + $seriesPlot = new LinePlot($dataValues); + if ($combination) { + $seriesPlot->SetBarCenter(); + } + + if ($filled) { + $seriesPlot->SetFilled(true); + $seriesPlot->SetColor('black'); + $seriesPlot->SetFillColor(self::$colourSet[self::$plotColour++]); + } else { + // Set the appropriate plot marker + $this->formatPointMarker($seriesPlot, $marker); + } + $dataLabel = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue(); + $seriesPlot->SetLegend($dataLabel); + + $seriesPlots[] = $seriesPlot; + } + + if ($grouping == 'standard') { + $groupPlot = $seriesPlots; + } else { + $groupPlot = new AccLinePlot($seriesPlots); + } + $this->graph->Add($groupPlot); + } + + + private function renderPlotBar($groupID, $dimensions = '2d') + { + $rotation = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotDirection(); + // Rotate for bar rather than column chart + if (($groupID == 0) && ($rotation == 'bar')) { + $this->graph->Set90AndMargin(); + } + $grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping(); + + $labelCount = count($this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount()); + if ($labelCount > 0) { + $datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues(); + $datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation); + // Rotate for bar rather than column chart + if ($rotation == 'bar') { + $datasetLabels = array_reverse($datasetLabels); + $this->graph->yaxis->SetPos('max'); + $this->graph->yaxis->SetLabelAlign('center', 'top'); + $this->graph->yaxis->SetLabelSide(SIDE_RIGHT); + } + $this->graph->xaxis->SetTickLabels($datasetLabels); + } + + + $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); + $seriesPlots = array(); + if ($grouping == 'percentStacked') { + $sumValues = $this->percentageSumCalculation($groupID, $seriesCount); + } + + // Loop through each data series in turn + for ($j = 0; $j < $seriesCount; ++$j) { + $dataValues = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($j)->getDataValues(); + if ($grouping == 'percentStacked') { + $dataValues = $this->percentageAdjustValues($dataValues, $sumValues); + } + + // Fill in any missing values in the $dataValues array + $testCurrentIndex = 0; + foreach ($dataValues as $k => $dataValue) { + while ($k != $testCurrentIndex) { + $dataValues[$testCurrentIndex] = null; + ++$testCurrentIndex; + } + ++$testCurrentIndex; + } + + // Reverse the $dataValues order for bar rather than column chart + if ($rotation == 'bar') { + $dataValues = array_reverse($dataValues); + } + $seriesPlot = new BarPlot($dataValues); + $seriesPlot->SetColor('black'); + $seriesPlot->SetFillColor(self::$colourSet[self::$plotColour++]); + if ($dimensions == '3d') { + $seriesPlot->SetShadow(); + } + if (!$this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($j)) { + $dataLabel = ''; + } else { + $dataLabel = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($j)->getDataValue(); + } + $seriesPlot->SetLegend($dataLabel); + + $seriesPlots[] = $seriesPlot; + } + // Reverse the plot order for bar rather than column chart + if (($rotation == 'bar') && (!($grouping == 'percentStacked'))) { + $seriesPlots = array_reverse($seriesPlots); + } + + if ($grouping == 'clustered') { + $groupPlot = new GroupBarPlot($seriesPlots); + } elseif ($grouping == 'standard') { + $groupPlot = new GroupBarPlot($seriesPlots); + } else { + $groupPlot = new AccBarPlot($seriesPlots); + if ($dimensions == '3d') { + $groupPlot->SetShadow(); + } + } + + $this->graph->Add($groupPlot); + } + + + private function renderPlotScatter($groupID, $bubble) + { + $grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping(); + $scatterStyle = $bubbleSize = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle(); + + $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); + $seriesPlots = array(); + + // Loop through each data series in turn + for ($i = 0; $i < $seriesCount; ++$i) { + $dataValuesY = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues(); + $dataValuesX = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); + + foreach ($dataValuesY as $k => $dataValueY) { + $dataValuesY[$k] = $k; + } + + $seriesPlot = new ScatterPlot($dataValuesX, $dataValuesY); + if ($scatterStyle == 'lineMarker') { + $seriesPlot->SetLinkPoints(); + $seriesPlot->link->SetColor(self::$colourSet[self::$plotColour]); + } elseif ($scatterStyle == 'smoothMarker') { + $spline = new Spline($dataValuesY, $dataValuesX); + list($splineDataY, $splineDataX) = $spline->Get(count($dataValuesX) * self::$width / 20); + $lplot = new LinePlot($splineDataX, $splineDataY); + $lplot->SetColor(self::$colourSet[self::$plotColour]); + + $this->graph->Add($lplot); + } + + if ($bubble) { + $this->formatPointMarker($seriesPlot, 'dot'); + $seriesPlot->mark->SetColor('black'); + $seriesPlot->mark->SetSize($bubbleSize); + } else { + $marker = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker(); + $this->formatPointMarker($seriesPlot, $marker); + } + $dataLabel = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue(); + $seriesPlot->SetLegend($dataLabel); + + $this->graph->Add($seriesPlot); + } + } + + + private function renderPlotRadar($groupID) + { + $radarStyle = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle(); + + $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); + $seriesPlots = array(); + + // Loop through each data series in turn + for ($i = 0; $i < $seriesCount; ++$i) { + $dataValuesY = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues(); + $dataValuesX = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); + $marker = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker(); + + $dataValues = array(); + foreach ($dataValuesY as $k => $dataValueY) { + $dataValues[$k] = implode(' ', array_reverse($dataValueY)); + } + $tmp = array_shift($dataValues); + $dataValues[] = $tmp; + $tmp = array_shift($dataValuesX); + $dataValuesX[] = $tmp; + + $this->graph->SetTitles(array_reverse($dataValues)); + + $seriesPlot = new RadarPlot(array_reverse($dataValuesX)); + + $dataLabel = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue(); + $seriesPlot->SetColor(self::$colourSet[self::$plotColour++]); + if ($radarStyle == 'filled') { + $seriesPlot->SetFillColor(self::$colourSet[self::$plotColour]); + } + $this->formatPointMarker($seriesPlot, $marker); + $seriesPlot->SetLegend($dataLabel); + + $this->graph->Add($seriesPlot); + } + } + + + private function renderPlotContour($groupID) + { + $contourStyle = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle(); + + $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); + $seriesPlots = array(); + + $dataValues = array(); + // Loop through each data series in turn + for ($i = 0; $i < $seriesCount; ++$i) { + $dataValuesY = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues(); + $dataValuesX = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); + + $dataValues[$i] = $dataValuesX; + } + $seriesPlot = new ContourPlot($dataValues); + + $this->graph->Add($seriesPlot); + } + + + private function renderPlotStock($groupID) + { + $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); + $plotOrder = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotOrder(); + + $dataValues = array(); + // Loop through each data series in turn and build the plot arrays + foreach ($plotOrder as $i => $v) { + $dataValuesX = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($v)->getDataValues(); + foreach ($dataValuesX as $j => $dataValueX) { + $dataValues[$plotOrder[$i]][$j] = $dataValueX; + } + } + if (empty($dataValues)) { + return; + } + + $dataValuesPlot = array(); + // Flatten the plot arrays to a single dimensional array to work with jpgraph + for ($j = 0; $j < count($dataValues[0]); ++$j) { + for ($i = 0; $i < $seriesCount; ++$i) { + $dataValuesPlot[] = $dataValues[$i][$j]; + } + } + + // Set the x-axis labels + $labelCount = count($this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount()); + if ($labelCount > 0) { + $datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues(); + $datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount); + $this->graph->xaxis->SetTickLabels($datasetLabels); + } + + $seriesPlot = new StockPlot($dataValuesPlot); + $seriesPlot->SetWidth(20); + + $this->graph->Add($seriesPlot); + } + + + private function renderAreaChart($groupCount, $dimensions = '2d') + { + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php'); + + $this->renderCartesianPlotArea(); + + for ($i = 0; $i < $groupCount; ++$i) { + $this->renderPlotLine($i, true, false, $dimensions); + } + } + + + private function renderLineChart($groupCount, $dimensions = '2d') + { + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php'); + + $this->renderCartesianPlotArea(); + + for ($i = 0; $i < $groupCount; ++$i) { + $this->renderPlotLine($i, false, false, $dimensions); + } + } + + + private function renderBarChart($groupCount, $dimensions = '2d') + { + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_bar.php'); + + $this->renderCartesianPlotArea(); + + for ($i = 0; $i < $groupCount; ++$i) { + $this->renderPlotBar($i, $dimensions); + } + } + + + private function renderScatterChart($groupCount) + { + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_scatter.php'); + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_regstat.php'); + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php'); + + $this->renderCartesianPlotArea('linlin'); + + for ($i = 0; $i < $groupCount; ++$i) { + $this->renderPlotScatter($i, false); + } + } + + + private function renderBubbleChart($groupCount) + { + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_scatter.php'); + + $this->renderCartesianPlotArea('linlin'); + + for ($i = 0; $i < $groupCount; ++$i) { + $this->renderPlotScatter($i, true); + } + } + + + private function renderPieChart($groupCount, $dimensions = '2d', $doughnut = false, $multiplePlots = false) + { + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_pie.php'); + if ($dimensions == '3d') { + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_pie3d.php'); + } + + $this->renderPiePlotArea($doughnut); + + $iLimit = ($multiplePlots) ? $groupCount : 1; + for ($groupID = 0; $groupID < $iLimit; ++$groupID) { + $grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping(); + $exploded = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle(); + if ($groupID == 0) { + $labelCount = count($this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount()); + if ($labelCount > 0) { + $datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues(); + $datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount); + } + } + + $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); + $seriesPlots = array(); + // For pie charts, we only display the first series: doughnut charts generally display all series + $jLimit = ($multiplePlots) ? $seriesCount : 1; + // Loop through each data series in turn + for ($j = 0; $j < $jLimit; ++$j) { + $dataValues = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($j)->getDataValues(); + + // Fill in any missing values in the $dataValues array + $testCurrentIndex = 0; + foreach ($dataValues as $k => $dataValue) { + while ($k != $testCurrentIndex) { + $dataValues[$testCurrentIndex] = null; + ++$testCurrentIndex; + } + ++$testCurrentIndex; + } + + if ($dimensions == '3d') { + $seriesPlot = new PiePlot3D($dataValues); + } else { + if ($doughnut) { + $seriesPlot = new PiePlotC($dataValues); + } else { + $seriesPlot = new PiePlot($dataValues); + } + } + + if ($multiplePlots) { + $seriesPlot->SetSize(($jLimit-$j) / ($jLimit * 4)); + } + + if ($doughnut) { + $seriesPlot->SetMidColor('white'); + } + + $seriesPlot->SetColor(self::$colourSet[self::$plotColour++]); + if (count($datasetLabels) > 0) { + $seriesPlot->SetLabels(array_fill(0, count($datasetLabels), '')); + } + if ($dimensions != '3d') { + $seriesPlot->SetGuideLines(false); + } + if ($j == 0) { + if ($exploded) { + $seriesPlot->ExplodeAll(); + } + $seriesPlot->SetLegends($datasetLabels); + } + + $this->graph->Add($seriesPlot); + } + } + } + + + private function renderRadarChart($groupCount) + { + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_radar.php'); + + $this->renderRadarPlotArea(); + + for ($groupID = 0; $groupID < $groupCount; ++$groupID) { + $this->renderPlotRadar($groupID); + } + } + + + private function renderStockChart($groupCount) + { + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_stock.php'); + + $this->renderCartesianPlotArea('intint'); + + for ($groupID = 0; $groupID < $groupCount; ++$groupID) { + $this->renderPlotStock($groupID); + } + } + + + private function renderContourChart($groupCount, $dimensions) + { + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_contour.php'); + + $this->renderCartesianPlotArea('intint'); + + for ($i = 0; $i < $groupCount; ++$i) { + $this->renderPlotContour($i); + } + } + + + private function renderCombinationChart($groupCount, $dimensions, $outputDestination) + { + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php'); + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_bar.php'); + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_scatter.php'); + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_regstat.php'); + require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php'); + + $this->renderCartesianPlotArea(); + + for ($i = 0; $i < $groupCount; ++$i) { + $dimensions = null; + $chartType = $this->chart->getPlotArea()->getPlotGroupByIndex($i)->getPlotType(); + switch ($chartType) { + case 'area3DChart': + $dimensions = '3d'; + // no break + case 'areaChart': + $this->renderPlotLine($i, true, true, $dimensions); + break; + case 'bar3DChart': + $dimensions = '3d'; + // no break + case 'barChart': + $this->renderPlotBar($i, $dimensions); + break; + case 'line3DChart': + $dimensions = '3d'; + // no break + case 'lineChart': + $this->renderPlotLine($i, false, true, $dimensions); + break; + case 'scatterChart': + $this->renderPlotScatter($i, false); + break; + case 'bubbleChart': + $this->renderPlotScatter($i, true); + break; + default: + $this->graph = null; + return false; + } + } + + $this->renderLegend(); + + $this->graph->Stroke($outputDestination); + return true; + } + + + public function render($outputDestination) + { + self::$plotColour = 0; + + $groupCount = $this->chart->getPlotArea()->getPlotGroupCount(); + + $dimensions = null; + if ($groupCount == 1) { + $chartType = $this->chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotType(); + } else { + $chartTypes = array(); + for ($i = 0; $i < $groupCount; ++$i) { + $chartTypes[] = $this->chart->getPlotArea()->getPlotGroupByIndex($i)->getPlotType(); + } + $chartTypes = array_unique($chartTypes); + if (count($chartTypes) == 1) { + $chartType = array_pop($chartTypes); + } elseif (count($chartTypes) == 0) { + echo 'Chart is not yet implemented
'; + return false; + } else { + return $this->renderCombinationChart($groupCount, $dimensions, $outputDestination); + } + } + + switch ($chartType) { + case 'area3DChart': + $dimensions = '3d'; + // no break + case 'areaChart': + $this->renderAreaChart($groupCount, $dimensions); + break; + case 'bar3DChart': + $dimensions = '3d'; + // no break + case 'barChart': + $this->renderBarChart($groupCount, $dimensions); + break; + case 'line3DChart': + $dimensions = '3d'; + // no break + case 'lineChart': + $this->renderLineChart($groupCount, $dimensions); + break; + case 'pie3DChart': + $dimensions = '3d'; + // no break + case 'pieChart': + $this->renderPieChart($groupCount, $dimensions, false, false); + break; + case 'doughnut3DChart': + $dimensions = '3d'; + // no break + case 'doughnutChart': + $this->renderPieChart($groupCount, $dimensions, true, true); + break; + case 'scatterChart': + $this->renderScatterChart($groupCount); + break; + case 'bubbleChart': + $this->renderBubbleChart($groupCount); + break; + case 'radarChart': + $this->renderRadarChart($groupCount); + break; + case 'surface3DChart': + $dimensions = '3d'; + // no break + case 'surfaceChart': + $this->renderContourChart($groupCount, $dimensions); + break; + case 'stockChart': + $this->renderStockChart($groupCount, $dimensions); + break; + default: + echo $chartType.' is not yet implemented
'; + return false; + } + $this->renderLegend(); + + $this->graph->Stroke($outputDestination); + return true; + } + + + /** + * Create a new PHPExcel_Chart_Renderer_jpgraph + */ + public function __construct(PHPExcel_Chart $chart) + { + $this->graph = null; + $this->chart = $chart; + } +} diff --git a/extend/PHPExcel/PHPExcel/Chart/Title.php b/extend/PHPExcel/PHPExcel/Chart/Title.php new file mode 100644 index 0000000..d8dc14f --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Chart/Title.php @@ -0,0 +1,86 @@ +caption = $caption; + $this->layout = $layout; + } + + /** + * Get caption + * + * @return string + */ + public function getCaption() + { + return $this->caption; + } + + /** + * Set caption + * + * @param string $caption + * @return PHPExcel_Chart_Title + */ + public function setCaption($caption = null) + { + $this->caption = $caption; + + return $this; + } + + /** + * Get Layout + * + * @return PHPExcel_Chart_Layout + */ + public function getLayout() + { + return $this->layout; + } +} diff --git a/extend/PHPExcel/PHPExcel/Comment.php b/extend/PHPExcel/PHPExcel/Comment.php new file mode 100644 index 0000000..d55363f --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Comment.php @@ -0,0 +1,338 @@ +author = 'Author'; + $this->text = new PHPExcel_RichText(); + $this->fillColor = new PHPExcel_Style_Color('FFFFFFE1'); + $this->alignment = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; + } + + /** + * Get Author + * + * @return string + */ + public function getAuthor() + { + return $this->author; + } + + /** + * Set Author + * + * @param string $pValue + * @return PHPExcel_Comment + */ + public function setAuthor($pValue = '') + { + $this->author = $pValue; + return $this; + } + + /** + * Get Rich text comment + * + * @return PHPExcel_RichText + */ + public function getText() + { + return $this->text; + } + + /** + * Set Rich text comment + * + * @param PHPExcel_RichText $pValue + * @return PHPExcel_Comment + */ + public function setText(PHPExcel_RichText $pValue) + { + $this->text = $pValue; + return $this; + } + + /** + * Get comment width (CSS style, i.e. XXpx or YYpt) + * + * @return string + */ + public function getWidth() + { + return $this->width; + } + + /** + * Set comment width (CSS style, i.e. XXpx or YYpt) + * + * @param string $value + * @return PHPExcel_Comment + */ + public function setWidth($value = '96pt') + { + $this->width = $value; + return $this; + } + + /** + * Get comment height (CSS style, i.e. XXpx or YYpt) + * + * @return string + */ + public function getHeight() + { + return $this->height; + } + + /** + * Set comment height (CSS style, i.e. XXpx or YYpt) + * + * @param string $value + * @return PHPExcel_Comment + */ + public function setHeight($value = '55.5pt') + { + $this->height = $value; + return $this; + } + + /** + * Get left margin (CSS style, i.e. XXpx or YYpt) + * + * @return string + */ + public function getMarginLeft() + { + return $this->marginLeft; + } + + /** + * Set left margin (CSS style, i.e. XXpx or YYpt) + * + * @param string $value + * @return PHPExcel_Comment + */ + public function setMarginLeft($value = '59.25pt') + { + $this->marginLeft = $value; + return $this; + } + + /** + * Get top margin (CSS style, i.e. XXpx or YYpt) + * + * @return string + */ + public function getMarginTop() + { + return $this->marginTop; + } + + /** + * Set top margin (CSS style, i.e. XXpx or YYpt) + * + * @param string $value + * @return PHPExcel_Comment + */ + public function setMarginTop($value = '1.5pt') + { + $this->marginTop = $value; + return $this; + } + + /** + * Is the comment visible by default? + * + * @return boolean + */ + public function getVisible() + { + return $this->visible; + } + + /** + * Set comment default visibility + * + * @param boolean $value + * @return PHPExcel_Comment + */ + public function setVisible($value = false) + { + $this->visible = $value; + return $this; + } + + /** + * Get fill color + * + * @return PHPExcel_Style_Color + */ + public function getFillColor() + { + return $this->fillColor; + } + + /** + * Set Alignment + * + * @param string $pValue + * @return PHPExcel_Comment + */ + public function setAlignment($pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL) + { + $this->alignment = $pValue; + return $this; + } + + /** + * Get Alignment + * + * @return string + */ + public function getAlignment() + { + return $this->alignment; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + return md5( + $this->author . + $this->text->getHashCode() . + $this->width . + $this->height . + $this->marginLeft . + $this->marginTop . + ($this->visible ? 1 : 0) . + $this->fillColor->getHashCode() . + $this->alignment . + __CLASS__ + ); + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } + + /** + * Convert to string + * + * @return string + */ + public function __toString() + { + return $this->text->getPlainText(); + } +} diff --git a/extend/PHPExcel/PHPExcel/DocumentProperties.php b/extend/PHPExcel/PHPExcel/DocumentProperties.php new file mode 100644 index 0000000..2395ba9 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/DocumentProperties.php @@ -0,0 +1,611 @@ +lastModifiedBy = $this->creator; + $this->created = time(); + $this->modified = time(); + } + + /** + * Get Creator + * + * @return string + */ + public function getCreator() + { + return $this->creator; + } + + /** + * Set Creator + * + * @param string $pValue + * @return PHPExcel_DocumentProperties + */ + public function setCreator($pValue = '') + { + $this->creator = $pValue; + return $this; + } + + /** + * Get Last Modified By + * + * @return string + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy; + } + + /** + * Set Last Modified By + * + * @param string $pValue + * @return PHPExcel_DocumentProperties + */ + public function setLastModifiedBy($pValue = '') + { + $this->lastModifiedBy = $pValue; + return $this; + } + + /** + * Get Created + * + * @return datetime + */ + public function getCreated() + { + return $this->created; + } + + /** + * Set Created + * + * @param datetime $pValue + * @return PHPExcel_DocumentProperties + */ + public function setCreated($pValue = null) + { + if ($pValue === null) { + $pValue = time(); + } elseif (is_string($pValue)) { + if (is_numeric($pValue)) { + $pValue = intval($pValue); + } else { + $pValue = strtotime($pValue); + } + } + + $this->created = $pValue; + return $this; + } + + /** + * Get Modified + * + * @return datetime + */ + public function getModified() + { + return $this->modified; + } + + /** + * Set Modified + * + * @param datetime $pValue + * @return PHPExcel_DocumentProperties + */ + public function setModified($pValue = null) + { + if ($pValue === null) { + $pValue = time(); + } elseif (is_string($pValue)) { + if (is_numeric($pValue)) { + $pValue = intval($pValue); + } else { + $pValue = strtotime($pValue); + } + } + + $this->modified = $pValue; + return $this; + } + + /** + * Get Title + * + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Set Title + * + * @param string $pValue + * @return PHPExcel_DocumentProperties + */ + public function setTitle($pValue = '') + { + $this->title = $pValue; + return $this; + } + + /** + * Get Description + * + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Set Description + * + * @param string $pValue + * @return PHPExcel_DocumentProperties + */ + public function setDescription($pValue = '') + { + $this->description = $pValue; + return $this; + } + + /** + * Get Subject + * + * @return string + */ + public function getSubject() + { + return $this->subject; + } + + /** + * Set Subject + * + * @param string $pValue + * @return PHPExcel_DocumentProperties + */ + public function setSubject($pValue = '') + { + $this->subject = $pValue; + return $this; + } + + /** + * Get Keywords + * + * @return string + */ + public function getKeywords() + { + return $this->keywords; + } + + /** + * Set Keywords + * + * @param string $pValue + * @return PHPExcel_DocumentProperties + */ + public function setKeywords($pValue = '') + { + $this->keywords = $pValue; + return $this; + } + + /** + * Get Category + * + * @return string + */ + public function getCategory() + { + return $this->category; + } + + /** + * Set Category + * + * @param string $pValue + * @return PHPExcel_DocumentProperties + */ + public function setCategory($pValue = '') + { + $this->category = $pValue; + return $this; + } + + /** + * Get Company + * + * @return string + */ + public function getCompany() + { + return $this->company; + } + + /** + * Set Company + * + * @param string $pValue + * @return PHPExcel_DocumentProperties + */ + public function setCompany($pValue = '') + { + $this->company = $pValue; + return $this; + } + + /** + * Get Manager + * + * @return string + */ + public function getManager() + { + return $this->manager; + } + + /** + * Set Manager + * + * @param string $pValue + * @return PHPExcel_DocumentProperties + */ + public function setManager($pValue = '') + { + $this->manager = $pValue; + return $this; + } + + /** + * Get a List of Custom Property Names + * + * @return array of string + */ + public function getCustomProperties() + { + return array_keys($this->customProperties); + } + + /** + * Check if a Custom Property is defined + * + * @param string $propertyName + * @return boolean + */ + public function isCustomPropertySet($propertyName) + { + return isset($this->customProperties[$propertyName]); + } + + /** + * Get a Custom Property Value + * + * @param string $propertyName + * @return string + */ + public function getCustomPropertyValue($propertyName) + { + if (isset($this->customProperties[$propertyName])) { + return $this->customProperties[$propertyName]['value']; + } + + } + + /** + * Get a Custom Property Type + * + * @param string $propertyName + * @return string + */ + public function getCustomPropertyType($propertyName) + { + if (isset($this->customProperties[$propertyName])) { + return $this->customProperties[$propertyName]['type']; + } + + } + + /** + * Set a Custom Property + * + * @param string $propertyName + * @param mixed $propertyValue + * @param string $propertyType + * 'i' : Integer + * 'f' : Floating Point + * 's' : String + * 'd' : Date/Time + * 'b' : Boolean + * @return PHPExcel_DocumentProperties + */ + public function setCustomProperty($propertyName, $propertyValue = '', $propertyType = null) + { + if (($propertyType === null) || (!in_array($propertyType, array(self::PROPERTY_TYPE_INTEGER, + self::PROPERTY_TYPE_FLOAT, + self::PROPERTY_TYPE_STRING, + self::PROPERTY_TYPE_DATE, + self::PROPERTY_TYPE_BOOLEAN)))) { + if ($propertyValue === null) { + $propertyType = self::PROPERTY_TYPE_STRING; + } elseif (is_float($propertyValue)) { + $propertyType = self::PROPERTY_TYPE_FLOAT; + } elseif (is_int($propertyValue)) { + $propertyType = self::PROPERTY_TYPE_INTEGER; + } elseif (is_bool($propertyValue)) { + $propertyType = self::PROPERTY_TYPE_BOOLEAN; + } else { + $propertyType = self::PROPERTY_TYPE_STRING; + } + } + + $this->customProperties[$propertyName] = array( + 'value' => $propertyValue, + 'type' => $propertyType + ); + return $this; + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } + + public static function convertProperty($propertyValue, $propertyType) + { + switch ($propertyType) { + case 'empty': // Empty + return ''; + break; + case 'null': // Null + return null; + break; + case 'i1': // 1-Byte Signed Integer + case 'i2': // 2-Byte Signed Integer + case 'i4': // 4-Byte Signed Integer + case 'i8': // 8-Byte Signed Integer + case 'int': // Integer + return (int) $propertyValue; + break; + case 'ui1': // 1-Byte Unsigned Integer + case 'ui2': // 2-Byte Unsigned Integer + case 'ui4': // 4-Byte Unsigned Integer + case 'ui8': // 8-Byte Unsigned Integer + case 'uint': // Unsigned Integer + return abs((int) $propertyValue); + break; + case 'r4': // 4-Byte Real Number + case 'r8': // 8-Byte Real Number + case 'decimal': // Decimal + return (float) $propertyValue; + break; + case 'lpstr': // LPSTR + case 'lpwstr': // LPWSTR + case 'bstr': // Basic String + return $propertyValue; + break; + case 'date': // Date and Time + case 'filetime': // File Time + return strtotime($propertyValue); + break; + case 'bool': // Boolean + return ($propertyValue == 'true') ? true : false; + break; + case 'cy': // Currency + case 'error': // Error Status Code + case 'vector': // Vector + case 'array': // Array + case 'blob': // Binary Blob + case 'oblob': // Binary Blob Object + case 'stream': // Binary Stream + case 'ostream': // Binary Stream Object + case 'storage': // Binary Storage + case 'ostorage': // Binary Storage Object + case 'vstream': // Binary Versioned Stream + case 'clsid': // Class ID + case 'cf': // Clipboard Data + return $propertyValue; + break; + } + return $propertyValue; + } + + public static function convertPropertyType($propertyType) + { + switch ($propertyType) { + case 'i1': // 1-Byte Signed Integer + case 'i2': // 2-Byte Signed Integer + case 'i4': // 4-Byte Signed Integer + case 'i8': // 8-Byte Signed Integer + case 'int': // Integer + case 'ui1': // 1-Byte Unsigned Integer + case 'ui2': // 2-Byte Unsigned Integer + case 'ui4': // 4-Byte Unsigned Integer + case 'ui8': // 8-Byte Unsigned Integer + case 'uint': // Unsigned Integer + return self::PROPERTY_TYPE_INTEGER; + break; + case 'r4': // 4-Byte Real Number + case 'r8': // 8-Byte Real Number + case 'decimal': // Decimal + return self::PROPERTY_TYPE_FLOAT; + break; + case 'empty': // Empty + case 'null': // Null + case 'lpstr': // LPSTR + case 'lpwstr': // LPWSTR + case 'bstr': // Basic String + return self::PROPERTY_TYPE_STRING; + break; + case 'date': // Date and Time + case 'filetime': // File Time + return self::PROPERTY_TYPE_DATE; + break; + case 'bool': // Boolean + return self::PROPERTY_TYPE_BOOLEAN; + break; + case 'cy': // Currency + case 'error': // Error Status Code + case 'vector': // Vector + case 'array': // Array + case 'blob': // Binary Blob + case 'oblob': // Binary Blob Object + case 'stream': // Binary Stream + case 'ostream': // Binary Stream Object + case 'storage': // Binary Storage + case 'ostorage': // Binary Storage Object + case 'vstream': // Binary Versioned Stream + case 'clsid': // Class ID + case 'cf': // Clipboard Data + return self::PROPERTY_TYPE_UNKNOWN; + break; + } + return self::PROPERTY_TYPE_UNKNOWN; + } +} diff --git a/extend/PHPExcel/PHPExcel/DocumentSecurity.php b/extend/PHPExcel/PHPExcel/DocumentSecurity.php new file mode 100644 index 0000000..ecea0da --- /dev/null +++ b/extend/PHPExcel/PHPExcel/DocumentSecurity.php @@ -0,0 +1,222 @@ +lockRevision = false; + $this->lockStructure = false; + $this->lockWindows = false; + $this->revisionsPassword = ''; + $this->workbookPassword = ''; + } + + /** + * Is some sort of document security enabled? + * + * @return boolean + */ + public function isSecurityEnabled() + { + return $this->lockRevision || + $this->lockStructure || + $this->lockWindows; + } + + /** + * Get LockRevision + * + * @return boolean + */ + public function getLockRevision() + { + return $this->lockRevision; + } + + /** + * Set LockRevision + * + * @param boolean $pValue + * @return PHPExcel_DocumentSecurity + */ + public function setLockRevision($pValue = false) + { + $this->lockRevision = $pValue; + return $this; + } + + /** + * Get LockStructure + * + * @return boolean + */ + public function getLockStructure() + { + return $this->lockStructure; + } + + /** + * Set LockStructure + * + * @param boolean $pValue + * @return PHPExcel_DocumentSecurity + */ + public function setLockStructure($pValue = false) + { + $this->lockStructure = $pValue; + return $this; + } + + /** + * Get LockWindows + * + * @return boolean + */ + public function getLockWindows() + { + return $this->lockWindows; + } + + /** + * Set LockWindows + * + * @param boolean $pValue + * @return PHPExcel_DocumentSecurity + */ + public function setLockWindows($pValue = false) + { + $this->lockWindows = $pValue; + return $this; + } + + /** + * Get RevisionsPassword (hashed) + * + * @return string + */ + public function getRevisionsPassword() + { + return $this->revisionsPassword; + } + + /** + * Set RevisionsPassword + * + * @param string $pValue + * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true + * @return PHPExcel_DocumentSecurity + */ + public function setRevisionsPassword($pValue = '', $pAlreadyHashed = false) + { + if (!$pAlreadyHashed) { + $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue); + } + $this->revisionsPassword = $pValue; + return $this; + } + + /** + * Get WorkbookPassword (hashed) + * + * @return string + */ + public function getWorkbookPassword() + { + return $this->workbookPassword; + } + + /** + * Set WorkbookPassword + * + * @param string $pValue + * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true + * @return PHPExcel_DocumentSecurity + */ + public function setWorkbookPassword($pValue = '', $pAlreadyHashed = false) + { + if (!$pAlreadyHashed) { + $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue); + } + $this->workbookPassword = $pValue; + return $this; + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Exception.php b/extend/PHPExcel/PHPExcel/Exception.php new file mode 100644 index 0000000..b27750e --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Exception.php @@ -0,0 +1,54 @@ +line = $line; + $e->file = $file; + throw $e; + } +} diff --git a/extend/PHPExcel/PHPExcel/HashTable.php b/extend/PHPExcel/PHPExcel/HashTable.php new file mode 100644 index 0000000..c21d18c --- /dev/null +++ b/extend/PHPExcel/PHPExcel/HashTable.php @@ -0,0 +1,204 @@ +addFromSource($pSource); + } + } + + /** + * Add HashTable items from source + * + * @param PHPExcel_IComparable[] $pSource Source array to create HashTable from + * @throws PHPExcel_Exception + */ + public function addFromSource($pSource = null) + { + // Check if an array was passed + if ($pSource == null) { + return; + } elseif (!is_array($pSource)) { + throw new PHPExcel_Exception('Invalid array parameter passed.'); + } + + foreach ($pSource as $item) { + $this->add($item); + } + } + + /** + * Add HashTable item + * + * @param PHPExcel_IComparable $pSource Item to add + * @throws PHPExcel_Exception + */ + public function add(PHPExcel_IComparable $pSource = null) + { + $hash = $pSource->getHashCode(); + if (!isset($this->items[$hash])) { + $this->items[$hash] = $pSource; + $this->keyMap[count($this->items) - 1] = $hash; + } + } + + /** + * Remove HashTable item + * + * @param PHPExcel_IComparable $pSource Item to remove + * @throws PHPExcel_Exception + */ + public function remove(PHPExcel_IComparable $pSource = null) + { + $hash = $pSource->getHashCode(); + if (isset($this->items[$hash])) { + unset($this->items[$hash]); + + $deleteKey = -1; + foreach ($this->keyMap as $key => $value) { + if ($deleteKey >= 0) { + $this->keyMap[$key - 1] = $value; + } + + if ($value == $hash) { + $deleteKey = $key; + } + } + unset($this->keyMap[count($this->keyMap) - 1]); + } + } + + /** + * Clear HashTable + * + */ + public function clear() + { + $this->items = array(); + $this->keyMap = array(); + } + + /** + * Count + * + * @return int + */ + public function count() + { + return count($this->items); + } + + /** + * Get index for hash code + * + * @param string $pHashCode + * @return int Index + */ + public function getIndexForHashCode($pHashCode = '') + { + return array_search($pHashCode, $this->keyMap); + } + + /** + * Get by index + * + * @param int $pIndex + * @return PHPExcel_IComparable + * + */ + public function getByIndex($pIndex = 0) + { + if (isset($this->keyMap[$pIndex])) { + return $this->getByHashCode($this->keyMap[$pIndex]); + } + + return null; + } + + /** + * Get by hashcode + * + * @param string $pHashCode + * @return PHPExcel_IComparable + * + */ + public function getByHashCode($pHashCode = '') + { + if (isset($this->items[$pHashCode])) { + return $this->items[$pHashCode]; + } + + return null; + } + + /** + * HashTable to array + * + * @return PHPExcel_IComparable[] + */ + public function toArray() + { + return $this->items; + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Helper/HTML.php b/extend/PHPExcel/PHPExcel/Helper/HTML.php new file mode 100644 index 0000000..a78f11c --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Helper/HTML.php @@ -0,0 +1,808 @@ + 'f0f8ff', + 'antiquewhite' => 'faebd7', + 'antiquewhite1' => 'ffefdb', + 'antiquewhite2' => 'eedfcc', + 'antiquewhite3' => 'cdc0b0', + 'antiquewhite4' => '8b8378', + 'aqua' => '00ffff', + 'aquamarine1' => '7fffd4', + 'aquamarine2' => '76eec6', + 'aquamarine4' => '458b74', + 'azure1' => 'f0ffff', + 'azure2' => 'e0eeee', + 'azure3' => 'c1cdcd', + 'azure4' => '838b8b', + 'beige' => 'f5f5dc', + 'bisque1' => 'ffe4c4', + 'bisque2' => 'eed5b7', + 'bisque3' => 'cdb79e', + 'bisque4' => '8b7d6b', + 'black' => '000000', + 'blanchedalmond' => 'ffebcd', + 'blue' => '0000ff', + 'blue1' => '0000ff', + 'blue2' => '0000ee', + 'blue4' => '00008b', + 'blueviolet' => '8a2be2', + 'brown' => 'a52a2a', + 'brown1' => 'ff4040', + 'brown2' => 'ee3b3b', + 'brown3' => 'cd3333', + 'brown4' => '8b2323', + 'burlywood' => 'deb887', + 'burlywood1' => 'ffd39b', + 'burlywood2' => 'eec591', + 'burlywood3' => 'cdaa7d', + 'burlywood4' => '8b7355', + 'cadetblue' => '5f9ea0', + 'cadetblue1' => '98f5ff', + 'cadetblue2' => '8ee5ee', + 'cadetblue3' => '7ac5cd', + 'cadetblue4' => '53868b', + 'chartreuse1' => '7fff00', + 'chartreuse2' => '76ee00', + 'chartreuse3' => '66cd00', + 'chartreuse4' => '458b00', + 'chocolate' => 'd2691e', + 'chocolate1' => 'ff7f24', + 'chocolate2' => 'ee7621', + 'chocolate3' => 'cd661d', + 'coral' => 'ff7f50', + 'coral1' => 'ff7256', + 'coral2' => 'ee6a50', + 'coral3' => 'cd5b45', + 'coral4' => '8b3e2f', + 'cornflowerblue' => '6495ed', + 'cornsilk1' => 'fff8dc', + 'cornsilk2' => 'eee8cd', + 'cornsilk3' => 'cdc8b1', + 'cornsilk4' => '8b8878', + 'cyan1' => '00ffff', + 'cyan2' => '00eeee', + 'cyan3' => '00cdcd', + 'cyan4' => '008b8b', + 'darkgoldenrod' => 'b8860b', + 'darkgoldenrod1' => 'ffb90f', + 'darkgoldenrod2' => 'eead0e', + 'darkgoldenrod3' => 'cd950c', + 'darkgoldenrod4' => '8b6508', + 'darkgreen' => '006400', + 'darkkhaki' => 'bdb76b', + 'darkolivegreen' => '556b2f', + 'darkolivegreen1' => 'caff70', + 'darkolivegreen2' => 'bcee68', + 'darkolivegreen3' => 'a2cd5a', + 'darkolivegreen4' => '6e8b3d', + 'darkorange' => 'ff8c00', + 'darkorange1' => 'ff7f00', + 'darkorange2' => 'ee7600', + 'darkorange3' => 'cd6600', + 'darkorange4' => '8b4500', + 'darkorchid' => '9932cc', + 'darkorchid1' => 'bf3eff', + 'darkorchid2' => 'b23aee', + 'darkorchid3' => '9a32cd', + 'darkorchid4' => '68228b', + 'darksalmon' => 'e9967a', + 'darkseagreen' => '8fbc8f', + 'darkseagreen1' => 'c1ffc1', + 'darkseagreen2' => 'b4eeb4', + 'darkseagreen3' => '9bcd9b', + 'darkseagreen4' => '698b69', + 'darkslateblue' => '483d8b', + 'darkslategray' => '2f4f4f', + 'darkslategray1' => '97ffff', + 'darkslategray2' => '8deeee', + 'darkslategray3' => '79cdcd', + 'darkslategray4' => '528b8b', + 'darkturquoise' => '00ced1', + 'darkviolet' => '9400d3', + 'deeppink1' => 'ff1493', + 'deeppink2' => 'ee1289', + 'deeppink3' => 'cd1076', + 'deeppink4' => '8b0a50', + 'deepskyblue1' => '00bfff', + 'deepskyblue2' => '00b2ee', + 'deepskyblue3' => '009acd', + 'deepskyblue4' => '00688b', + 'dimgray' => '696969', + 'dodgerblue1' => '1e90ff', + 'dodgerblue2' => '1c86ee', + 'dodgerblue3' => '1874cd', + 'dodgerblue4' => '104e8b', + 'firebrick' => 'b22222', + 'firebrick1' => 'ff3030', + 'firebrick2' => 'ee2c2c', + 'firebrick3' => 'cd2626', + 'firebrick4' => '8b1a1a', + 'floralwhite' => 'fffaf0', + 'forestgreen' => '228b22', + 'fuchsia' => 'ff00ff', + 'gainsboro' => 'dcdcdc', + 'ghostwhite' => 'f8f8ff', + 'gold1' => 'ffd700', + 'gold2' => 'eec900', + 'gold3' => 'cdad00', + 'gold4' => '8b7500', + 'goldenrod' => 'daa520', + 'goldenrod1' => 'ffc125', + 'goldenrod2' => 'eeb422', + 'goldenrod3' => 'cd9b1d', + 'goldenrod4' => '8b6914', + 'gray' => 'bebebe', + 'gray1' => '030303', + 'gray10' => '1a1a1a', + 'gray11' => '1c1c1c', + 'gray12' => '1f1f1f', + 'gray13' => '212121', + 'gray14' => '242424', + 'gray15' => '262626', + 'gray16' => '292929', + 'gray17' => '2b2b2b', + 'gray18' => '2e2e2e', + 'gray19' => '303030', + 'gray2' => '050505', + 'gray20' => '333333', + 'gray21' => '363636', + 'gray22' => '383838', + 'gray23' => '3b3b3b', + 'gray24' => '3d3d3d', + 'gray25' => '404040', + 'gray26' => '424242', + 'gray27' => '454545', + 'gray28' => '474747', + 'gray29' => '4a4a4a', + 'gray3' => '080808', + 'gray30' => '4d4d4d', + 'gray31' => '4f4f4f', + 'gray32' => '525252', + 'gray33' => '545454', + 'gray34' => '575757', + 'gray35' => '595959', + 'gray36' => '5c5c5c', + 'gray37' => '5e5e5e', + 'gray38' => '616161', + 'gray39' => '636363', + 'gray4' => '0a0a0a', + 'gray40' => '666666', + 'gray41' => '696969', + 'gray42' => '6b6b6b', + 'gray43' => '6e6e6e', + 'gray44' => '707070', + 'gray45' => '737373', + 'gray46' => '757575', + 'gray47' => '787878', + 'gray48' => '7a7a7a', + 'gray49' => '7d7d7d', + 'gray5' => '0d0d0d', + 'gray50' => '7f7f7f', + 'gray51' => '828282', + 'gray52' => '858585', + 'gray53' => '878787', + 'gray54' => '8a8a8a', + 'gray55' => '8c8c8c', + 'gray56' => '8f8f8f', + 'gray57' => '919191', + 'gray58' => '949494', + 'gray59' => '969696', + 'gray6' => '0f0f0f', + 'gray60' => '999999', + 'gray61' => '9c9c9c', + 'gray62' => '9e9e9e', + 'gray63' => 'a1a1a1', + 'gray64' => 'a3a3a3', + 'gray65' => 'a6a6a6', + 'gray66' => 'a8a8a8', + 'gray67' => 'ababab', + 'gray68' => 'adadad', + 'gray69' => 'b0b0b0', + 'gray7' => '121212', + 'gray70' => 'b3b3b3', + 'gray71' => 'b5b5b5', + 'gray72' => 'b8b8b8', + 'gray73' => 'bababa', + 'gray74' => 'bdbdbd', + 'gray75' => 'bfbfbf', + 'gray76' => 'c2c2c2', + 'gray77' => 'c4c4c4', + 'gray78' => 'c7c7c7', + 'gray79' => 'c9c9c9', + 'gray8' => '141414', + 'gray80' => 'cccccc', + 'gray81' => 'cfcfcf', + 'gray82' => 'd1d1d1', + 'gray83' => 'd4d4d4', + 'gray84' => 'd6d6d6', + 'gray85' => 'd9d9d9', + 'gray86' => 'dbdbdb', + 'gray87' => 'dedede', + 'gray88' => 'e0e0e0', + 'gray89' => 'e3e3e3', + 'gray9' => '171717', + 'gray90' => 'e5e5e5', + 'gray91' => 'e8e8e8', + 'gray92' => 'ebebeb', + 'gray93' => 'ededed', + 'gray94' => 'f0f0f0', + 'gray95' => 'f2f2f2', + 'gray97' => 'f7f7f7', + 'gray98' => 'fafafa', + 'gray99' => 'fcfcfc', + 'green' => '00ff00', + 'green1' => '00ff00', + 'green2' => '00ee00', + 'green3' => '00cd00', + 'green4' => '008b00', + 'greenyellow' => 'adff2f', + 'honeydew1' => 'f0fff0', + 'honeydew2' => 'e0eee0', + 'honeydew3' => 'c1cdc1', + 'honeydew4' => '838b83', + 'hotpink' => 'ff69b4', + 'hotpink1' => 'ff6eb4', + 'hotpink2' => 'ee6aa7', + 'hotpink3' => 'cd6090', + 'hotpink4' => '8b3a62', + 'indianred' => 'cd5c5c', + 'indianred1' => 'ff6a6a', + 'indianred2' => 'ee6363', + 'indianred3' => 'cd5555', + 'indianred4' => '8b3a3a', + 'ivory1' => 'fffff0', + 'ivory2' => 'eeeee0', + 'ivory3' => 'cdcdc1', + 'ivory4' => '8b8b83', + 'khaki' => 'f0e68c', + 'khaki1' => 'fff68f', + 'khaki2' => 'eee685', + 'khaki3' => 'cdc673', + 'khaki4' => '8b864e', + 'lavender' => 'e6e6fa', + 'lavenderblush1' => 'fff0f5', + 'lavenderblush2' => 'eee0e5', + 'lavenderblush3' => 'cdc1c5', + 'lavenderblush4' => '8b8386', + 'lawngreen' => '7cfc00', + 'lemonchiffon1' => 'fffacd', + 'lemonchiffon2' => 'eee9bf', + 'lemonchiffon3' => 'cdc9a5', + 'lemonchiffon4' => '8b8970', + 'light' => 'eedd82', + 'lightblue' => 'add8e6', + 'lightblue1' => 'bfefff', + 'lightblue2' => 'b2dfee', + 'lightblue3' => '9ac0cd', + 'lightblue4' => '68838b', + 'lightcoral' => 'f08080', + 'lightcyan1' => 'e0ffff', + 'lightcyan2' => 'd1eeee', + 'lightcyan3' => 'b4cdcd', + 'lightcyan4' => '7a8b8b', + 'lightgoldenrod1' => 'ffec8b', + 'lightgoldenrod2' => 'eedc82', + 'lightgoldenrod3' => 'cdbe70', + 'lightgoldenrod4' => '8b814c', + 'lightgoldenrodyellow' => 'fafad2', + 'lightgray' => 'd3d3d3', + 'lightpink' => 'ffb6c1', + 'lightpink1' => 'ffaeb9', + 'lightpink2' => 'eea2ad', + 'lightpink3' => 'cd8c95', + 'lightpink4' => '8b5f65', + 'lightsalmon1' => 'ffa07a', + 'lightsalmon2' => 'ee9572', + 'lightsalmon3' => 'cd8162', + 'lightsalmon4' => '8b5742', + 'lightseagreen' => '20b2aa', + 'lightskyblue' => '87cefa', + 'lightskyblue1' => 'b0e2ff', + 'lightskyblue2' => 'a4d3ee', + 'lightskyblue3' => '8db6cd', + 'lightskyblue4' => '607b8b', + 'lightslateblue' => '8470ff', + 'lightslategray' => '778899', + 'lightsteelblue' => 'b0c4de', + 'lightsteelblue1' => 'cae1ff', + 'lightsteelblue2' => 'bcd2ee', + 'lightsteelblue3' => 'a2b5cd', + 'lightsteelblue4' => '6e7b8b', + 'lightyellow1' => 'ffffe0', + 'lightyellow2' => 'eeeed1', + 'lightyellow3' => 'cdcdb4', + 'lightyellow4' => '8b8b7a', + 'lime' => '00ff00', + 'limegreen' => '32cd32', + 'linen' => 'faf0e6', + 'magenta' => 'ff00ff', + 'magenta2' => 'ee00ee', + 'magenta3' => 'cd00cd', + 'magenta4' => '8b008b', + 'maroon' => 'b03060', + 'maroon1' => 'ff34b3', + 'maroon2' => 'ee30a7', + 'maroon3' => 'cd2990', + 'maroon4' => '8b1c62', + 'medium' => '66cdaa', + 'mediumaquamarine' => '66cdaa', + 'mediumblue' => '0000cd', + 'mediumorchid' => 'ba55d3', + 'mediumorchid1' => 'e066ff', + 'mediumorchid2' => 'd15fee', + 'mediumorchid3' => 'b452cd', + 'mediumorchid4' => '7a378b', + 'mediumpurple' => '9370db', + 'mediumpurple1' => 'ab82ff', + 'mediumpurple2' => '9f79ee', + 'mediumpurple3' => '8968cd', + 'mediumpurple4' => '5d478b', + 'mediumseagreen' => '3cb371', + 'mediumslateblue' => '7b68ee', + 'mediumspringgreen' => '00fa9a', + 'mediumturquoise' => '48d1cc', + 'mediumvioletred' => 'c71585', + 'midnightblue' => '191970', + 'mintcream' => 'f5fffa', + 'mistyrose1' => 'ffe4e1', + 'mistyrose2' => 'eed5d2', + 'mistyrose3' => 'cdb7b5', + 'mistyrose4' => '8b7d7b', + 'moccasin' => 'ffe4b5', + 'navajowhite1' => 'ffdead', + 'navajowhite2' => 'eecfa1', + 'navajowhite3' => 'cdb38b', + 'navajowhite4' => '8b795e', + 'navy' => '000080', + 'navyblue' => '000080', + 'oldlace' => 'fdf5e6', + 'olive' => '808000', + 'olivedrab' => '6b8e23', + 'olivedrab1' => 'c0ff3e', + 'olivedrab2' => 'b3ee3a', + 'olivedrab4' => '698b22', + 'orange' => 'ffa500', + 'orange1' => 'ffa500', + 'orange2' => 'ee9a00', + 'orange3' => 'cd8500', + 'orange4' => '8b5a00', + 'orangered1' => 'ff4500', + 'orangered2' => 'ee4000', + 'orangered3' => 'cd3700', + 'orangered4' => '8b2500', + 'orchid' => 'da70d6', + 'orchid1' => 'ff83fa', + 'orchid2' => 'ee7ae9', + 'orchid3' => 'cd69c9', + 'orchid4' => '8b4789', + 'pale' => 'db7093', + 'palegoldenrod' => 'eee8aa', + 'palegreen' => '98fb98', + 'palegreen1' => '9aff9a', + 'palegreen2' => '90ee90', + 'palegreen3' => '7ccd7c', + 'palegreen4' => '548b54', + 'paleturquoise' => 'afeeee', + 'paleturquoise1' => 'bbffff', + 'paleturquoise2' => 'aeeeee', + 'paleturquoise3' => '96cdcd', + 'paleturquoise4' => '668b8b', + 'palevioletred' => 'db7093', + 'palevioletred1' => 'ff82ab', + 'palevioletred2' => 'ee799f', + 'palevioletred3' => 'cd6889', + 'palevioletred4' => '8b475d', + 'papayawhip' => 'ffefd5', + 'peachpuff1' => 'ffdab9', + 'peachpuff2' => 'eecbad', + 'peachpuff3' => 'cdaf95', + 'peachpuff4' => '8b7765', + 'pink' => 'ffc0cb', + 'pink1' => 'ffb5c5', + 'pink2' => 'eea9b8', + 'pink3' => 'cd919e', + 'pink4' => '8b636c', + 'plum' => 'dda0dd', + 'plum1' => 'ffbbff', + 'plum2' => 'eeaeee', + 'plum3' => 'cd96cd', + 'plum4' => '8b668b', + 'powderblue' => 'b0e0e6', + 'purple' => 'a020f0', + 'rebeccapurple' => '663399', + 'purple1' => '9b30ff', + 'purple2' => '912cee', + 'purple3' => '7d26cd', + 'purple4' => '551a8b', + 'red' => 'ff0000', + 'red1' => 'ff0000', + 'red2' => 'ee0000', + 'red3' => 'cd0000', + 'red4' => '8b0000', + 'rosybrown' => 'bc8f8f', + 'rosybrown1' => 'ffc1c1', + 'rosybrown2' => 'eeb4b4', + 'rosybrown3' => 'cd9b9b', + 'rosybrown4' => '8b6969', + 'royalblue' => '4169e1', + 'royalblue1' => '4876ff', + 'royalblue2' => '436eee', + 'royalblue3' => '3a5fcd', + 'royalblue4' => '27408b', + 'saddlebrown' => '8b4513', + 'salmon' => 'fa8072', + 'salmon1' => 'ff8c69', + 'salmon2' => 'ee8262', + 'salmon3' => 'cd7054', + 'salmon4' => '8b4c39', + 'sandybrown' => 'f4a460', + 'seagreen1' => '54ff9f', + 'seagreen2' => '4eee94', + 'seagreen3' => '43cd80', + 'seagreen4' => '2e8b57', + 'seashell1' => 'fff5ee', + 'seashell2' => 'eee5de', + 'seashell3' => 'cdc5bf', + 'seashell4' => '8b8682', + 'sienna' => 'a0522d', + 'sienna1' => 'ff8247', + 'sienna2' => 'ee7942', + 'sienna3' => 'cd6839', + 'sienna4' => '8b4726', + 'silver' => 'c0c0c0', + 'skyblue' => '87ceeb', + 'skyblue1' => '87ceff', + 'skyblue2' => '7ec0ee', + 'skyblue3' => '6ca6cd', + 'skyblue4' => '4a708b', + 'slateblue' => '6a5acd', + 'slateblue1' => '836fff', + 'slateblue2' => '7a67ee', + 'slateblue3' => '6959cd', + 'slateblue4' => '473c8b', + 'slategray' => '708090', + 'slategray1' => 'c6e2ff', + 'slategray2' => 'b9d3ee', + 'slategray3' => '9fb6cd', + 'slategray4' => '6c7b8b', + 'snow1' => 'fffafa', + 'snow2' => 'eee9e9', + 'snow3' => 'cdc9c9', + 'snow4' => '8b8989', + 'springgreen1' => '00ff7f', + 'springgreen2' => '00ee76', + 'springgreen3' => '00cd66', + 'springgreen4' => '008b45', + 'steelblue' => '4682b4', + 'steelblue1' => '63b8ff', + 'steelblue2' => '5cacee', + 'steelblue3' => '4f94cd', + 'steelblue4' => '36648b', + 'tan' => 'd2b48c', + 'tan1' => 'ffa54f', + 'tan2' => 'ee9a49', + 'tan3' => 'cd853f', + 'tan4' => '8b5a2b', + 'teal' => '008080', + 'thistle' => 'd8bfd8', + 'thistle1' => 'ffe1ff', + 'thistle2' => 'eed2ee', + 'thistle3' => 'cdb5cd', + 'thistle4' => '8b7b8b', + 'tomato1' => 'ff6347', + 'tomato2' => 'ee5c42', + 'tomato3' => 'cd4f39', + 'tomato4' => '8b3626', + 'turquoise' => '40e0d0', + 'turquoise1' => '00f5ff', + 'turquoise2' => '00e5ee', + 'turquoise3' => '00c5cd', + 'turquoise4' => '00868b', + 'violet' => 'ee82ee', + 'violetred' => 'd02090', + 'violetred1' => 'ff3e96', + 'violetred2' => 'ee3a8c', + 'violetred3' => 'cd3278', + 'violetred4' => '8b2252', + 'wheat' => 'f5deb3', + 'wheat1' => 'ffe7ba', + 'wheat2' => 'eed8ae', + 'wheat3' => 'cdba96', + 'wheat4' => '8b7e66', + 'white' => 'ffffff', + 'whitesmoke' => 'f5f5f5', + 'yellow' => 'ffff00', + 'yellow1' => 'ffff00', + 'yellow2' => 'eeee00', + 'yellow3' => 'cdcd00', + 'yellow4' => '8b8b00', + 'yellowgreen' => '9acd32', + ); + + protected $face; + protected $size; + protected $color; + + protected $bold = false; + protected $italic = false; + protected $underline = false; + protected $superscript = false; + protected $subscript = false; + protected $strikethrough = false; + + protected $startTagCallbacks = array( + 'font' => 'startFontTag', + 'b' => 'startBoldTag', + 'strong' => 'startBoldTag', + 'i' => 'startItalicTag', + 'em' => 'startItalicTag', + 'u' => 'startUnderlineTag', + 'ins' => 'startUnderlineTag', + 'del' => 'startStrikethruTag', + 'sup' => 'startSuperscriptTag', + 'sub' => 'startSubscriptTag', + ); + + protected $endTagCallbacks = array( + 'font' => 'endFontTag', + 'b' => 'endBoldTag', + 'strong' => 'endBoldTag', + 'i' => 'endItalicTag', + 'em' => 'endItalicTag', + 'u' => 'endUnderlineTag', + 'ins' => 'endUnderlineTag', + 'del' => 'endStrikethruTag', + 'sup' => 'endSuperscriptTag', + 'sub' => 'endSubscriptTag', + 'br' => 'breakTag', + 'p' => 'breakTag', + 'h1' => 'breakTag', + 'h2' => 'breakTag', + 'h3' => 'breakTag', + 'h4' => 'breakTag', + 'h5' => 'breakTag', + 'h6' => 'breakTag', + ); + + protected $stack = array(); + + protected $stringData = ''; + + protected $richTextObject; + + protected function initialise() + { + $this->face = $this->size = $this->color = null; + $this->bold = $this->italic = $this->underline = $this->superscript = $this->subscript = $this->strikethrough = false; + + $this->stack = array(); + + $this->stringData = ''; + } + + public function toRichTextObject($html) + { + $this->initialise(); + + // Create a new DOM object + $dom = new \DOMDocument; + // Load the HTML file into the DOM object + // Note the use of error suppression, because typically this will be an html fragment, so not fully valid markup + $loaded = @$dom->loadHTML($html); + + // Discard excess white space + $dom->preserveWhiteSpace = false; + + $this->richTextObject = new PHPExcel_RichText();; + $this->parseElements($dom); + + // Clean any further spurious whitespace + $this->cleanWhitespace(); + + return $this->richTextObject; + } + + protected function cleanWhitespace() + { + foreach ($this->richTextObject->getRichTextElements() as $key => $element) { + $text = $element->getText(); + // Trim any leading spaces on the first run + if ($key == 0) { + $text = ltrim($text); + } + // Trim any spaces immediately after a line break + $text = preg_replace('/\n */mu', "\n", $text); + $element->setText($text); + } + } + + protected function buildTextRun() + { + $text = $this->stringData; + if (trim($text) === '') { + return; + } + + $richtextRun = $this->richTextObject->createTextRun($this->stringData); + if ($this->face) { + $richtextRun->getFont()->setName($this->face); + } + if ($this->size) { + $richtextRun->getFont()->setSize($this->size); + } + if ($this->color) { + $richtextRun->getFont()->setColor(new PHPExcel_Style_Color('ff' . $this->color)); + } + if ($this->bold) { + $richtextRun->getFont()->setBold(true); + } + if ($this->italic) { + $richtextRun->getFont()->setItalic(true); + } + if ($this->underline) { + $richtextRun->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE); + } + if ($this->superscript) { + $richtextRun->getFont()->setSuperScript(true); + } + if ($this->subscript) { + $richtextRun->getFont()->setSubScript(true); + } + if ($this->strikethrough) { + $richtextRun->getFont()->setStrikethrough(true); + } + $this->stringData = ''; + } + + protected function rgbToColour($rgb) + { + preg_match_all('/\d+/', $rgb, $values); + foreach ($values[0] as &$value) { + $value = str_pad(dechex($value), 2, '0', STR_PAD_LEFT); + } + return implode($values[0]); + } + + protected function colourNameLookup($rgb) + { + return self::$colourMap[$rgb]; + } + + protected function startFontTag($tag) + { + foreach ($tag->attributes as $attribute) { + $attributeName = strtolower($attribute->name); + $attributeValue = $attribute->value; + + if ($attributeName == 'color') { + if (preg_match('/rgb\s*\(/', $attributeValue)) { + $this->$attributeName = $this->rgbToColour($attributeValue); + } elseif (strpos(trim($attributeValue), '#') === 0) { + $this->$attributeName = ltrim($attributeValue, '#'); + } else { + $this->$attributeName = $this->colourNameLookup($attributeValue); + } + } else { + $this->$attributeName = $attributeValue; + } + } + } + + protected function endFontTag() + { + $this->face = $this->size = $this->color = null; + } + + protected function startBoldTag() + { + $this->bold = true; + } + + protected function endBoldTag() + { + $this->bold = false; + } + + protected function startItalicTag() + { + $this->italic = true; + } + + protected function endItalicTag() + { + $this->italic = false; + } + + protected function startUnderlineTag() + { + $this->underline = true; + } + + protected function endUnderlineTag() + { + $this->underline = false; + } + + protected function startSubscriptTag() + { + $this->subscript = true; + } + + protected function endSubscriptTag() + { + $this->subscript = false; + } + + protected function startSuperscriptTag() + { + $this->superscript = true; + } + + protected function endSuperscriptTag() + { + $this->superscript = false; + } + + protected function startStrikethruTag() + { + $this->strikethrough = true; + } + + protected function endStrikethruTag() + { + $this->strikethrough = false; + } + + protected function breakTag() + { + $this->stringData .= "\n"; + } + + protected function parseTextNode(DOMText $textNode) + { + $domText = preg_replace( + '/\s+/u', + ' ', + str_replace(array("\r", "\n"), ' ', $textNode->nodeValue) + ); + $this->stringData .= $domText; + $this->buildTextRun(); + } + + protected function handleCallback($element, $callbackTag, $callbacks) + { + if (isset($callbacks[$callbackTag])) { + $elementHandler = $callbacks[$callbackTag]; + if (method_exists($this, $elementHandler)) { + call_user_func(array($this, $elementHandler), $element); + } + } + } + + protected function parseElementNode(DOMElement $element) + { + $callbackTag = strtolower($element->nodeName); + $this->stack[] = $callbackTag; + + $this->handleCallback($element, $callbackTag, $this->startTagCallbacks); + + $this->parseElements($element); + array_pop($this->stack); + + $this->handleCallback($element, $callbackTag, $this->endTagCallbacks); + } + + protected function parseElements(DOMNode $element) + { + foreach ($element->childNodes as $child) { + if ($child instanceof DOMText) { + $this->parseTextNode($child); + } elseif ($child instanceof DOMElement) { + $this->parseElementNode($child); + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/IComparable.php b/extend/PHPExcel/PHPExcel/IComparable.php new file mode 100644 index 0000000..6dc36a9 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/IComparable.php @@ -0,0 +1,34 @@ + 'IWriter', 'path' => 'PHPExcel/Writer/{0}.php', 'class' => 'PHPExcel_Writer_{0}' ), + array( 'type' => 'IReader', 'path' => 'PHPExcel/Reader/{0}.php', 'class' => 'PHPExcel_Reader_{0}' ) + ); + + /** + * Autoresolve classes + * + * @var array + * @access private + * @static + */ + private static $autoResolveClasses = array( + 'Excel2007', + 'Excel5', + 'Excel2003XML', + 'OOCalc', + 'SYLK', + 'Gnumeric', + 'HTML', + 'CSV', + ); + + /** + * Private constructor for PHPExcel_IOFactory + */ + private function __construct() + { + } + + /** + * Get search locations + * + * @static + * @access public + * @return array + */ + public static function getSearchLocations() + { + return self::$searchLocations; + } + + /** + * Set search locations + * + * @static + * @access public + * @param array $value + * @throws PHPExcel_Reader_Exception + */ + public static function setSearchLocations($value) + { + if (is_array($value)) { + self::$searchLocations = $value; + } else { + throw new PHPExcel_Reader_Exception('Invalid parameter passed.'); + } + } + + /** + * Add search location + * + * @static + * @access public + * @param string $type Example: IWriter + * @param string $location Example: PHPExcel/Writer/{0}.php + * @param string $classname Example: PHPExcel_Writer_{0} + */ + public static function addSearchLocation($type = '', $location = '', $classname = '') + { + self::$searchLocations[] = array( 'type' => $type, 'path' => $location, 'class' => $classname ); + } + + /** + * Create PHPExcel_Writer_IWriter + * + * @static + * @access public + * @param PHPExcel $phpExcel + * @param string $writerType Example: Excel2007 + * @return PHPExcel_Writer_IWriter + * @throws PHPExcel_Reader_Exception + */ + public static function createWriter(PHPExcel $phpExcel, $writerType = '') + { + // Search type + $searchType = 'IWriter'; + + // Include class + foreach (self::$searchLocations as $searchLocation) { + if ($searchLocation['type'] == $searchType) { + $className = str_replace('{0}', $writerType, $searchLocation['class']); + + $instance = new $className($phpExcel); + if ($instance !== null) { + return $instance; + } + } + } + + // Nothing found... + throw new PHPExcel_Reader_Exception("No $searchType found for type $writerType"); + } + + /** + * Create PHPExcel_Reader_IReader + * + * @static + * @access public + * @param string $readerType Example: Excel2007 + * @return PHPExcel_Reader_IReader + * @throws PHPExcel_Reader_Exception + */ + public static function createReader($readerType = '') + { + // Search type + $searchType = 'IReader'; + + // Include class + foreach (self::$searchLocations as $searchLocation) { + if ($searchLocation['type'] == $searchType) { + $className = str_replace('{0}', $readerType, $searchLocation['class']); + + $instance = new $className(); + if ($instance !== null) { + return $instance; + } + } + } + + // Nothing found... + throw new PHPExcel_Reader_Exception("No $searchType found for type $readerType"); + } + + /** + * Loads PHPExcel from file using automatic PHPExcel_Reader_IReader resolution + * + * @static + * @access public + * @param string $pFilename The name of the spreadsheet file + * @return PHPExcel + * @throws PHPExcel_Reader_Exception + */ + public static function load($pFilename) + { + $reader = self::createReaderForFile($pFilename); + return $reader->load($pFilename); + } + + /** + * Identify file type using automatic PHPExcel_Reader_IReader resolution + * + * @static + * @access public + * @param string $pFilename The name of the spreadsheet file to identify + * @return string + * @throws PHPExcel_Reader_Exception + */ + public static function identify($pFilename) + { + $reader = self::createReaderForFile($pFilename); + $className = get_class($reader); + $classType = explode('_', $className); + unset($reader); + return array_pop($classType); + } + + /** + * Create PHPExcel_Reader_IReader for file using automatic PHPExcel_Reader_IReader resolution + * + * @static + * @access public + * @param string $pFilename The name of the spreadsheet file + * @return PHPExcel_Reader_IReader + * @throws PHPExcel_Reader_Exception + */ + public static function createReaderForFile($pFilename) + { + // First, lucky guess by inspecting file extension + $pathinfo = pathinfo($pFilename); + + $extensionType = null; + if (isset($pathinfo['extension'])) { + switch (strtolower($pathinfo['extension'])) { + case 'xlsx': // Excel (OfficeOpenXML) Spreadsheet + case 'xlsm': // Excel (OfficeOpenXML) Macro Spreadsheet (macros will be discarded) + case 'xltx': // Excel (OfficeOpenXML) Template + case 'xltm': // Excel (OfficeOpenXML) Macro Template (macros will be discarded) + $extensionType = 'Excel2007'; + break; + case 'xls': // Excel (BIFF) Spreadsheet + case 'xlt': // Excel (BIFF) Template + $extensionType = 'Excel5'; + break; + case 'ods': // Open/Libre Offic Calc + case 'ots': // Open/Libre Offic Calc Template + $extensionType = 'OOCalc'; + break; + case 'slk': + $extensionType = 'SYLK'; + break; + case 'xml': // Excel 2003 SpreadSheetML + $extensionType = 'Excel2003XML'; + break; + case 'gnumeric': + $extensionType = 'Gnumeric'; + break; + case 'htm': + case 'html': + $extensionType = 'HTML'; + break; + case 'csv': + // Do nothing + // We must not try to use CSV reader since it loads + // all files including Excel files etc. + break; + default: + break; + } + + if ($extensionType !== null) { + $reader = self::createReader($extensionType); + // Let's see if we are lucky + if (isset($reader) && $reader->canRead($pFilename)) { + return $reader; + } + } + } + + // If we reach here then "lucky guess" didn't give any result + // Try walking through all the options in self::$autoResolveClasses + foreach (self::$autoResolveClasses as $autoResolveClass) { + // Ignore our original guess, we know that won't work + if ($autoResolveClass !== $extensionType) { + $reader = self::createReader($autoResolveClass); + if ($reader->canRead($pFilename)) { + return $reader; + } + } + } + + throw new PHPExcel_Reader_Exception('Unable to identify a reader for this file'); + } +} diff --git a/extend/PHPExcel/PHPExcel/NamedRange.php b/extend/PHPExcel/PHPExcel/NamedRange.php new file mode 100644 index 0000000..2848db8 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/NamedRange.php @@ -0,0 +1,249 @@ +worksheet) + * + * @var bool + */ + private $localOnly; + + /** + * Scope + * + * @var PHPExcel_Worksheet + */ + private $scope; + + /** + * Create a new NamedRange + * + * @param string $pName + * @param PHPExcel_Worksheet $pWorksheet + * @param string $pRange + * @param bool $pLocalOnly + * @param PHPExcel_Worksheet|null $pScope Scope. Only applies when $pLocalOnly = true. Null for global scope. + * @throws PHPExcel_Exception + */ + public function __construct($pName = null, PHPExcel_Worksheet $pWorksheet, $pRange = 'A1', $pLocalOnly = false, $pScope = null) + { + // Validate data + if (($pName === null) || ($pWorksheet === null) || ($pRange === null)) { + throw new PHPExcel_Exception('Parameters can not be null.'); + } + + // Set local members + $this->name = $pName; + $this->worksheet = $pWorksheet; + $this->range = $pRange; + $this->localOnly = $pLocalOnly; + $this->scope = ($pLocalOnly == true) ? (($pScope == null) ? $pWorksheet : $pScope) : null; + } + + /** + * Get name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set name + * + * @param string $value + * @return PHPExcel_NamedRange + */ + public function setName($value = null) + { + if ($value !== null) { + // Old title + $oldTitle = $this->name; + + // Re-attach + if ($this->worksheet !== null) { + $this->worksheet->getParent()->removeNamedRange($this->name, $this->worksheet); + } + $this->name = $value; + + if ($this->worksheet !== null) { + $this->worksheet->getParent()->addNamedRange($this); + } + + // New title + $newTitle = $this->name; + PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->worksheet->getParent(), $oldTitle, $newTitle); + } + return $this; + } + + /** + * Get worksheet + * + * @return PHPExcel_Worksheet + */ + public function getWorksheet() + { + return $this->worksheet; + } + + /** + * Set worksheet + * + * @param PHPExcel_Worksheet $value + * @return PHPExcel_NamedRange + */ + public function setWorksheet(PHPExcel_Worksheet $value = null) + { + if ($value !== null) { + $this->worksheet = $value; + } + return $this; + } + + /** + * Get range + * + * @return string + */ + public function getRange() + { + return $this->range; + } + + /** + * Set range + * + * @param string $value + * @return PHPExcel_NamedRange + */ + public function setRange($value = null) + { + if ($value !== null) { + $this->range = $value; + } + return $this; + } + + /** + * Get localOnly + * + * @return bool + */ + public function getLocalOnly() + { + return $this->localOnly; + } + + /** + * Set localOnly + * + * @param bool $value + * @return PHPExcel_NamedRange + */ + public function setLocalOnly($value = false) + { + $this->localOnly = $value; + $this->scope = $value ? $this->worksheet : null; + return $this; + } + + /** + * Get scope + * + * @return PHPExcel_Worksheet|null + */ + public function getScope() + { + return $this->scope; + } + + /** + * Set scope + * + * @param PHPExcel_Worksheet|null $value + * @return PHPExcel_NamedRange + */ + public function setScope(PHPExcel_Worksheet $value = null) + { + $this->scope = $value; + $this->localOnly = ($value == null) ? false : true; + return $this; + } + + /** + * Resolve a named range to a regular cell range + * + * @param string $pNamedRange Named range + * @param PHPExcel_Worksheet|null $pSheet Scope. Use null for global scope + * @return PHPExcel_NamedRange + */ + public static function resolveRange($pNamedRange = '', PHPExcel_Worksheet $pSheet) + { + return $pSheet->getParent()->getNamedRange($pNamedRange, $pSheet); + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Reader/Abstract.php b/extend/PHPExcel/PHPExcel/Reader/Abstract.php new file mode 100644 index 0000000..189c70a --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Abstract.php @@ -0,0 +1,289 @@ +readDataOnly; + } + + /** + * Set read data only + * Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information. + * Set to false (the default) to advise the Reader to read both data and formatting for cells. + * + * @param boolean $pValue + * + * @return PHPExcel_Reader_IReader + */ + public function setReadDataOnly($pValue = false) + { + $this->readDataOnly = $pValue; + return $this; + } + + /** + * Read empty cells? + * If this is true (the default), then the Reader will read data values for all cells, irrespective of value. + * If false it will not read data for cells containing a null value or an empty string. + * + * @return boolean + */ + public function getReadEmptyCells() + { + return $this->readEmptyCells; + } + + /** + * Set read empty cells + * Set to true (the default) to advise the Reader read data values for all cells, irrespective of value. + * Set to false to advise the Reader to ignore cells containing a null value or an empty string. + * + * @param boolean $pValue + * + * @return PHPExcel_Reader_IReader + */ + public function setReadEmptyCells($pValue = true) + { + $this->readEmptyCells = $pValue; + return $this; + } + + /** + * Read charts in workbook? + * If this is true, then the Reader will include any charts that exist in the workbook. + * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. + * If false (the default) it will ignore any charts defined in the workbook file. + * + * @return boolean + */ + public function getIncludeCharts() + { + return $this->includeCharts; + } + + /** + * Set read charts in workbook + * Set to true, to advise the Reader to include any charts that exist in the workbook. + * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. + * Set to false (the default) to discard charts. + * + * @param boolean $pValue + * + * @return PHPExcel_Reader_IReader + */ + public function setIncludeCharts($pValue = false) + { + $this->includeCharts = (boolean) $pValue; + return $this; + } + + /** + * Get which sheets to load + * Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null + * indicating that all worksheets in the workbook should be loaded. + * + * @return mixed + */ + public function getLoadSheetsOnly() + { + return $this->loadSheetsOnly; + } + + /** + * Set which sheets to load + * + * @param mixed $value + * This should be either an array of worksheet names to be loaded, or a string containing a single worksheet name. + * If NULL, then it tells the Reader to read all worksheets in the workbook + * + * @return PHPExcel_Reader_IReader + */ + public function setLoadSheetsOnly($value = null) + { + if ($value === null) { + return $this->setLoadAllSheets(); + } + + $this->loadSheetsOnly = is_array($value) ? $value : array($value); + return $this; + } + + /** + * Set all sheets to load + * Tells the Reader to load all worksheets from the workbook. + * + * @return PHPExcel_Reader_IReader + */ + public function setLoadAllSheets() + { + $this->loadSheetsOnly = null; + return $this; + } + + /** + * Read filter + * + * @return PHPExcel_Reader_IReadFilter + */ + public function getReadFilter() + { + return $this->readFilter; + } + + /** + * Set read filter + * + * @param PHPExcel_Reader_IReadFilter $pValue + * @return PHPExcel_Reader_IReader + */ + public function setReadFilter(PHPExcel_Reader_IReadFilter $pValue) + { + $this->readFilter = $pValue; + return $this; + } + + /** + * Open file for reading + * + * @param string $pFilename + * @throws PHPExcel_Reader_Exception + * @return resource + */ + protected function openFile($pFilename) + { + // Check if file exists + if (!file_exists($pFilename) || !is_readable($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + // Open file + $this->fileHandle = fopen($pFilename, 'r'); + if ($this->fileHandle === false) { + throw new PHPExcel_Reader_Exception("Could not open file " . $pFilename . " for reading."); + } + } + + /** + * Can the current PHPExcel_Reader_IReader read the file? + * + * @param string $pFilename + * @return boolean + * @throws PHPExcel_Reader_Exception + */ + public function canRead($pFilename) + { + // Check if file exists + try { + $this->openFile($pFilename); + } catch (Exception $e) { + return false; + } + + $readable = $this->isValidFormat(); + fclose($this->fileHandle); + return $readable; + } + + /** + * Scan theXML for use of securityScan(file_get_contents($filestream)); + } +} diff --git a/extend/PHPExcel/PHPExcel/Reader/CSV.php b/extend/PHPExcel/PHPExcel/Reader/CSV.php new file mode 100644 index 0000000..21329da --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/CSV.php @@ -0,0 +1,406 @@ +readFilter = new PHPExcel_Reader_DefaultReadFilter(); + } + + /** + * Validate that the current file is a CSV file + * + * @return boolean + */ + protected function isValidFormat() + { + return true; + } + + /** + * Set input encoding + * + * @param string $pValue Input encoding + */ + public function setInputEncoding($pValue = 'UTF-8') + { + $this->inputEncoding = $pValue; + return $this; + } + + /** + * Get input encoding + * + * @return string + */ + public function getInputEncoding() + { + return $this->inputEncoding; + } + + /** + * Move filepointer past any BOM marker + * + */ + protected function skipBOM() + { + rewind($this->fileHandle); + + switch ($this->inputEncoding) { + case 'UTF-8': + fgets($this->fileHandle, 4) == "\xEF\xBB\xBF" ? + fseek($this->fileHandle, 3) : fseek($this->fileHandle, 0); + break; + case 'UTF-16LE': + fgets($this->fileHandle, 3) == "\xFF\xFE" ? + fseek($this->fileHandle, 2) : fseek($this->fileHandle, 0); + break; + case 'UTF-16BE': + fgets($this->fileHandle, 3) == "\xFE\xFF" ? + fseek($this->fileHandle, 2) : fseek($this->fileHandle, 0); + break; + case 'UTF-32LE': + fgets($this->fileHandle, 5) == "\xFF\xFE\x00\x00" ? + fseek($this->fileHandle, 4) : fseek($this->fileHandle, 0); + break; + case 'UTF-32BE': + fgets($this->fileHandle, 5) == "\x00\x00\xFE\xFF" ? + fseek($this->fileHandle, 4) : fseek($this->fileHandle, 0); + break; + default: + break; + } + } + + /** + * Identify any separator that is explicitly set in the file + * + */ + protected function checkSeparator() + { + $line = fgets($this->fileHandle); + if ($line === false) { + return; + } + + if ((strlen(trim($line, "\r\n")) == 5) && (stripos($line, 'sep=') === 0)) { + $this->delimiter = substr($line, 4, 1); + return; + } + return $this->skipBOM(); + } + + /** + * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns) + * + * @param string $pFilename + * @throws PHPExcel_Reader_Exception + */ + public function listWorksheetInfo($pFilename) + { + // Open file + $this->openFile($pFilename); + if (!$this->isValidFormat()) { + fclose($this->fileHandle); + throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file."); + } + $fileHandle = $this->fileHandle; + + // Skip BOM, if any + $this->skipBOM(); + $this->checkSeparator(); + + $escapeEnclosures = array( "\\" . $this->enclosure, $this->enclosure . $this->enclosure ); + + $worksheetInfo = array(); + $worksheetInfo[0]['worksheetName'] = 'Worksheet'; + $worksheetInfo[0]['lastColumnLetter'] = 'A'; + $worksheetInfo[0]['lastColumnIndex'] = 0; + $worksheetInfo[0]['totalRows'] = 0; + $worksheetInfo[0]['totalColumns'] = 0; + + // Loop through each line of the file in turn + while (($rowData = fgetcsv($fileHandle, 0, $this->delimiter, $this->enclosure)) !== false) { + $worksheetInfo[0]['totalRows']++; + $worksheetInfo[0]['lastColumnIndex'] = max($worksheetInfo[0]['lastColumnIndex'], count($rowData) - 1); + } + + $worksheetInfo[0]['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($worksheetInfo[0]['lastColumnIndex']); + $worksheetInfo[0]['totalColumns'] = $worksheetInfo[0]['lastColumnIndex'] + 1; + + // Close file + fclose($fileHandle); + + return $worksheetInfo; + } + + /** + * Loads PHPExcel from file + * + * @param string $pFilename + * @return PHPExcel + * @throws PHPExcel_Reader_Exception + */ + public function load($pFilename) + { + // Create new PHPExcel + $objPHPExcel = new PHPExcel(); + + // Load into this instance + return $this->loadIntoExisting($pFilename, $objPHPExcel); + } + + /** + * Loads PHPExcel from file into PHPExcel instance + * + * @param string $pFilename + * @param PHPExcel $objPHPExcel + * @return PHPExcel + * @throws PHPExcel_Reader_Exception + */ + public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) + { + $lineEnding = ini_get('auto_detect_line_endings'); + ini_set('auto_detect_line_endings', true); + + // Open file + $this->openFile($pFilename); + if (!$this->isValidFormat()) { + fclose($this->fileHandle); + throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file."); + } + $fileHandle = $this->fileHandle; + + // Skip BOM, if any + $this->skipBOM(); + $this->checkSeparator(); + + // Create new PHPExcel object + while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) { + $objPHPExcel->createSheet(); + } + $sheet = $objPHPExcel->setActiveSheetIndex($this->sheetIndex); + + $escapeEnclosures = array( "\\" . $this->enclosure, + $this->enclosure . $this->enclosure + ); + + // Set our starting row based on whether we're in contiguous mode or not + $currentRow = 1; + if ($this->contiguous) { + $currentRow = ($this->contiguousRow == -1) ? $sheet->getHighestRow(): $this->contiguousRow; + } + + // Loop through each line of the file in turn + while (($rowData = fgetcsv($fileHandle, 0, $this->delimiter, $this->enclosure)) !== false) { + $columnLetter = 'A'; + foreach ($rowData as $rowDatum) { + if ($rowDatum != '' && $this->readFilter->readCell($columnLetter, $currentRow)) { + // Unescape enclosures + $rowDatum = str_replace($escapeEnclosures, $this->enclosure, $rowDatum); + + // Convert encoding if necessary + if ($this->inputEncoding !== 'UTF-8') { + $rowDatum = PHPExcel_Shared_String::ConvertEncoding($rowDatum, 'UTF-8', $this->inputEncoding); + } + + // Set cell value + $sheet->getCell($columnLetter . $currentRow)->setValue($rowDatum); + } + ++$columnLetter; + } + ++$currentRow; + } + + // Close file + fclose($fileHandle); + + if ($this->contiguous) { + $this->contiguousRow = $currentRow; + } + + ini_set('auto_detect_line_endings', $lineEnding); + + // Return + return $objPHPExcel; + } + + /** + * Get delimiter + * + * @return string + */ + public function getDelimiter() + { + return $this->delimiter; + } + + /** + * Set delimiter + * + * @param string $pValue Delimiter, defaults to , + * @return PHPExcel_Reader_CSV + */ + public function setDelimiter($pValue = ',') + { + $this->delimiter = $pValue; + return $this; + } + + /** + * Get enclosure + * + * @return string + */ + public function getEnclosure() + { + return $this->enclosure; + } + + /** + * Set enclosure + * + * @param string $pValue Enclosure, defaults to " + * @return PHPExcel_Reader_CSV + */ + public function setEnclosure($pValue = '"') + { + if ($pValue == '') { + $pValue = '"'; + } + $this->enclosure = $pValue; + return $this; + } + + /** + * Get sheet index + * + * @return integer + */ + public function getSheetIndex() + { + return $this->sheetIndex; + } + + /** + * Set sheet index + * + * @param integer $pValue Sheet index + * @return PHPExcel_Reader_CSV + */ + public function setSheetIndex($pValue = 0) + { + $this->sheetIndex = $pValue; + return $this; + } + + /** + * Set Contiguous + * + * @param boolean $contiguous + */ + public function setContiguous($contiguous = false) + { + $this->contiguous = (bool) $contiguous; + if (!$contiguous) { + $this->contiguousRow = -1; + } + + return $this; + } + + /** + * Get Contiguous + * + * @return boolean + */ + public function getContiguous() + { + return $this->contiguous; + } +} diff --git a/extend/PHPExcel/PHPExcel/Reader/DefaultReadFilter.php b/extend/PHPExcel/PHPExcel/Reader/DefaultReadFilter.php new file mode 100644 index 0000000..ea25f63 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/DefaultReadFilter.php @@ -0,0 +1,51 @@ +readFilter = new PHPExcel_Reader_DefaultReadFilter(); + } + + + /** + * Can the current PHPExcel_Reader_IReader read the file? + * + * @param string $pFilename + * @return boolean + * @throws PHPExcel_Reader_Exception + */ + public function canRead($pFilename) + { + + // Office xmlns:o="urn:schemas-microsoft-com:office:office" + // Excel xmlns:x="urn:schemas-microsoft-com:office:excel" + // XML Spreadsheet xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" + // Spreadsheet component xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" + // XML schema xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" + // XML data type xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" + // MS-persist recordset xmlns:rs="urn:schemas-microsoft-com:rowset" + // Rowset xmlns:z="#RowsetSchema" + // + + $signature = array( + '' + ); + + // Open file + $this->openFile($pFilename); + $fileHandle = $this->fileHandle; + + // Read sample data (first 2 KB will do) + $data = fread($fileHandle, 2048); + fclose($fileHandle); + + $valid = true; + foreach ($signature as $match) { + // every part of the signature must be present + if (strpos($data, $match) === false) { + $valid = false; + break; + } + } + + // Retrieve charset encoding + if (preg_match('//um', $data, $matches)) { + $this->charSet = strtoupper($matches[1]); + } +// echo 'Character Set is ', $this->charSet,'
'; + + return $valid; + } + + + /** + * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object + * + * @param string $pFilename + * @throws PHPExcel_Reader_Exception + */ + public function listWorksheetNames($pFilename) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + if (!$this->canRead($pFilename)) { + throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file."); + } + + $worksheetNames = array(); + + $xml = simplexml_load_string($this->securityScan(file_get_contents($pFilename)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + $namespaces = $xml->getNamespaces(true); + + $xml_ss = $xml->children($namespaces['ss']); + foreach ($xml_ss->Worksheet as $worksheet) { + $worksheet_ss = $worksheet->attributes($namespaces['ss']); + $worksheetNames[] = self::convertStringEncoding((string) $worksheet_ss['Name'], $this->charSet); + } + + return $worksheetNames; + } + + + /** + * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns) + * + * @param string $pFilename + * @throws PHPExcel_Reader_Exception + */ + public function listWorksheetInfo($pFilename) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + $worksheetInfo = array(); + + $xml = simplexml_load_string($this->securityScan(file_get_contents($pFilename)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + $namespaces = $xml->getNamespaces(true); + + $worksheetID = 1; + $xml_ss = $xml->children($namespaces['ss']); + foreach ($xml_ss->Worksheet as $worksheet) { + $worksheet_ss = $worksheet->attributes($namespaces['ss']); + + $tmpInfo = array(); + $tmpInfo['worksheetName'] = ''; + $tmpInfo['lastColumnLetter'] = 'A'; + $tmpInfo['lastColumnIndex'] = 0; + $tmpInfo['totalRows'] = 0; + $tmpInfo['totalColumns'] = 0; + + if (isset($worksheet_ss['Name'])) { + $tmpInfo['worksheetName'] = (string) $worksheet_ss['Name']; + } else { + $tmpInfo['worksheetName'] = "Worksheet_{$worksheetID}"; + } + + if (isset($worksheet->Table->Row)) { + $rowIndex = 0; + + foreach ($worksheet->Table->Row as $rowData) { + $columnIndex = 0; + $rowHasData = false; + + foreach ($rowData->Cell as $cell) { + if (isset($cell->Data)) { + $tmpInfo['lastColumnIndex'] = max($tmpInfo['lastColumnIndex'], $columnIndex); + $rowHasData = true; + } + + ++$columnIndex; + } + + ++$rowIndex; + + if ($rowHasData) { + $tmpInfo['totalRows'] = max($tmpInfo['totalRows'], $rowIndex); + } + } + } + + $tmpInfo['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); + $tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1; + + $worksheetInfo[] = $tmpInfo; + ++$worksheetID; + } + + return $worksheetInfo; + } + + + /** + * Loads PHPExcel from file + * + * @param string $pFilename + * @return PHPExcel + * @throws PHPExcel_Reader_Exception + */ + public function load($pFilename) + { + // Create new PHPExcel + $objPHPExcel = new PHPExcel(); + $objPHPExcel->removeSheetByIndex(0); + + // Load into this instance + return $this->loadIntoExisting($pFilename, $objPHPExcel); + } + + protected static function identifyFixedStyleValue($styleList, &$styleAttributeValue) + { + $styleAttributeValue = strtolower($styleAttributeValue); + foreach ($styleList as $style) { + if ($styleAttributeValue == strtolower($style)) { + $styleAttributeValue = $style; + return true; + } + } + return false; + } + + /** + * pixel units to excel width units(units of 1/256th of a character width) + * @param pxs + * @return + */ + protected static function pixel2WidthUnits($pxs) + { + $UNIT_OFFSET_MAP = array(0, 36, 73, 109, 146, 182, 219); + + $widthUnits = 256 * ($pxs / 7); + $widthUnits += $UNIT_OFFSET_MAP[($pxs % 7)]; + return $widthUnits; + } + + /** + * excel width units(units of 1/256th of a character width) to pixel units + * @param widthUnits + * @return + */ + protected static function widthUnits2Pixel($widthUnits) + { + $pixels = ($widthUnits / 256) * 7; + $offsetWidthUnits = $widthUnits % 256; + $pixels += round($offsetWidthUnits / (256 / 7)); + return $pixels; + } + + protected static function hex2str($hex) + { + return chr(hexdec($hex[1])); + } + + /** + * Loads PHPExcel from file into PHPExcel instance + * + * @param string $pFilename + * @param PHPExcel $objPHPExcel + * @return PHPExcel + * @throws PHPExcel_Reader_Exception + */ + public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) + { + $fromFormats = array('\-', '\ '); + $toFormats = array('-', ' '); + + $underlineStyles = array ( + PHPExcel_Style_Font::UNDERLINE_NONE, + PHPExcel_Style_Font::UNDERLINE_DOUBLE, + PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING, + PHPExcel_Style_Font::UNDERLINE_SINGLE, + PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING + ); + $verticalAlignmentStyles = array ( + PHPExcel_Style_Alignment::VERTICAL_BOTTOM, + PHPExcel_Style_Alignment::VERTICAL_TOP, + PHPExcel_Style_Alignment::VERTICAL_CENTER, + PHPExcel_Style_Alignment::VERTICAL_JUSTIFY + ); + $horizontalAlignmentStyles = array ( + PHPExcel_Style_Alignment::HORIZONTAL_GENERAL, + PHPExcel_Style_Alignment::HORIZONTAL_LEFT, + PHPExcel_Style_Alignment::HORIZONTAL_RIGHT, + PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS, + PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY + ); + + $timezoneObj = new DateTimeZone('Europe/London'); + $GMT = new DateTimeZone('UTC'); + + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + if (!$this->canRead($pFilename)) { + throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file."); + } + + $xml = simplexml_load_string($this->securityScan(file_get_contents($pFilename)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + $namespaces = $xml->getNamespaces(true); + + $docProps = $objPHPExcel->getProperties(); + if (isset($xml->DocumentProperties[0])) { + foreach ($xml->DocumentProperties[0] as $propertyName => $propertyValue) { + switch ($propertyName) { + case 'Title': + $docProps->setTitle(self::convertStringEncoding($propertyValue, $this->charSet)); + break; + case 'Subject': + $docProps->setSubject(self::convertStringEncoding($propertyValue, $this->charSet)); + break; + case 'Author': + $docProps->setCreator(self::convertStringEncoding($propertyValue, $this->charSet)); + break; + case 'Created': + $creationDate = strtotime($propertyValue); + $docProps->setCreated($creationDate); + break; + case 'LastAuthor': + $docProps->setLastModifiedBy(self::convertStringEncoding($propertyValue, $this->charSet)); + break; + case 'LastSaved': + $lastSaveDate = strtotime($propertyValue); + $docProps->setModified($lastSaveDate); + break; + case 'Company': + $docProps->setCompany(self::convertStringEncoding($propertyValue, $this->charSet)); + break; + case 'Category': + $docProps->setCategory(self::convertStringEncoding($propertyValue, $this->charSet)); + break; + case 'Manager': + $docProps->setManager(self::convertStringEncoding($propertyValue, $this->charSet)); + break; + case 'Keywords': + $docProps->setKeywords(self::convertStringEncoding($propertyValue, $this->charSet)); + break; + case 'Description': + $docProps->setDescription(self::convertStringEncoding($propertyValue, $this->charSet)); + break; + } + } + } + if (isset($xml->CustomDocumentProperties)) { + foreach ($xml->CustomDocumentProperties[0] as $propertyName => $propertyValue) { + $propertyAttributes = $propertyValue->attributes($namespaces['dt']); + $propertyName = preg_replace_callback('/_x([0-9a-z]{4})_/', 'PHPExcel_Reader_Excel2003XML::hex2str', $propertyName); + $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_UNKNOWN; + switch ((string) $propertyAttributes) { + case 'string': + $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_STRING; + $propertyValue = trim($propertyValue); + break; + case 'boolean': + $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_BOOLEAN; + $propertyValue = (bool) $propertyValue; + break; + case 'integer': + $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_INTEGER; + $propertyValue = intval($propertyValue); + break; + case 'float': + $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_FLOAT; + $propertyValue = floatval($propertyValue); + break; + case 'dateTime.tz': + $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_DATE; + $propertyValue = strtotime(trim($propertyValue)); + break; + } + $docProps->setCustomProperty($propertyName, $propertyValue, $propertyType); + } + } + + foreach ($xml->Styles[0] as $style) { + $style_ss = $style->attributes($namespaces['ss']); + $styleID = (string) $style_ss['ID']; +// echo 'Style ID = '.$styleID.'
'; + $this->styles[$styleID] = (isset($this->styles['Default'])) ? $this->styles['Default'] : array(); + foreach ($style as $styleType => $styleData) { + $styleAttributes = $styleData->attributes($namespaces['ss']); +// echo $styleType.'
'; + switch ($styleType) { + case 'Alignment': + foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) { +// echo $styleAttributeKey.' = '.$styleAttributeValue.'
'; + $styleAttributeValue = (string) $styleAttributeValue; + switch ($styleAttributeKey) { + case 'Vertical': + if (self::identifyFixedStyleValue($verticalAlignmentStyles, $styleAttributeValue)) { + $this->styles[$styleID]['alignment']['vertical'] = $styleAttributeValue; + } + break; + case 'Horizontal': + if (self::identifyFixedStyleValue($horizontalAlignmentStyles, $styleAttributeValue)) { + $this->styles[$styleID]['alignment']['horizontal'] = $styleAttributeValue; + } + break; + case 'WrapText': + $this->styles[$styleID]['alignment']['wrap'] = true; + break; + } + } + break; + case 'Borders': + foreach ($styleData->Border as $borderStyle) { + $borderAttributes = $borderStyle->attributes($namespaces['ss']); + $thisBorder = array(); + foreach ($borderAttributes as $borderStyleKey => $borderStyleValue) { +// echo $borderStyleKey.' = '.$borderStyleValue.'
'; + switch ($borderStyleKey) { + case 'LineStyle': + $thisBorder['style'] = PHPExcel_Style_Border::BORDER_MEDIUM; +// $thisBorder['style'] = $borderStyleValue; + break; + case 'Weight': +// $thisBorder['style'] = $borderStyleValue; + break; + case 'Position': + $borderPosition = strtolower($borderStyleValue); + break; + case 'Color': + $borderColour = substr($borderStyleValue, 1); + $thisBorder['color']['rgb'] = $borderColour; + break; + } + } + if (!empty($thisBorder)) { + if (($borderPosition == 'left') || ($borderPosition == 'right') || ($borderPosition == 'top') || ($borderPosition == 'bottom')) { + $this->styles[$styleID]['borders'][$borderPosition] = $thisBorder; + } + } + } + break; + case 'Font': + foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) { +// echo $styleAttributeKey.' = '.$styleAttributeValue.'
'; + $styleAttributeValue = (string) $styleAttributeValue; + switch ($styleAttributeKey) { + case 'FontName': + $this->styles[$styleID]['font']['name'] = $styleAttributeValue; + break; + case 'Size': + $this->styles[$styleID]['font']['size'] = $styleAttributeValue; + break; + case 'Color': + $this->styles[$styleID]['font']['color']['rgb'] = substr($styleAttributeValue, 1); + break; + case 'Bold': + $this->styles[$styleID]['font']['bold'] = true; + break; + case 'Italic': + $this->styles[$styleID]['font']['italic'] = true; + break; + case 'Underline': + if (self::identifyFixedStyleValue($underlineStyles, $styleAttributeValue)) { + $this->styles[$styleID]['font']['underline'] = $styleAttributeValue; + } + break; + } + } + break; + case 'Interior': + foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) { +// echo $styleAttributeKey.' = '.$styleAttributeValue.'
'; + switch ($styleAttributeKey) { + case 'Color': + $this->styles[$styleID]['fill']['color']['rgb'] = substr($styleAttributeValue, 1); + break; + } + } + break; + case 'NumberFormat': + foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) { +// echo $styleAttributeKey.' = '.$styleAttributeValue.'
'; + $styleAttributeValue = str_replace($fromFormats, $toFormats, $styleAttributeValue); + switch ($styleAttributeValue) { + case 'Short Date': + $styleAttributeValue = 'dd/mm/yyyy'; + break; + } + if ($styleAttributeValue > '') { + $this->styles[$styleID]['numberformat']['code'] = $styleAttributeValue; + } + } + break; + case 'Protection': + foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) { +// echo $styleAttributeKey.' = '.$styleAttributeValue.'
'; + } + break; + } + } +// print_r($this->styles[$styleID]); +// echo '
'; + } +// echo '
'; + + $worksheetID = 0; + $xml_ss = $xml->children($namespaces['ss']); + + foreach ($xml_ss->Worksheet as $worksheet) { + $worksheet_ss = $worksheet->attributes($namespaces['ss']); + + if ((isset($this->loadSheetsOnly)) && (isset($worksheet_ss['Name'])) && + (!in_array($worksheet_ss['Name'], $this->loadSheetsOnly))) { + continue; + } + +// echo '

Worksheet: ', $worksheet_ss['Name'],'

'; +// + // Create new Worksheet + $objPHPExcel->createSheet(); + $objPHPExcel->setActiveSheetIndex($worksheetID); + if (isset($worksheet_ss['Name'])) { + $worksheetName = self::convertStringEncoding((string) $worksheet_ss['Name'], $this->charSet); + // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in + // formula cells... during the load, all formulae should be correct, and we're simply bringing + // the worksheet name in line with the formula, not the reverse + $objPHPExcel->getActiveSheet()->setTitle($worksheetName, false); + } + + $columnID = 'A'; + if (isset($worksheet->Table->Column)) { + foreach ($worksheet->Table->Column as $columnData) { + $columnData_ss = $columnData->attributes($namespaces['ss']); + if (isset($columnData_ss['Index'])) { + $columnID = PHPExcel_Cell::stringFromColumnIndex($columnData_ss['Index']-1); + } + if (isset($columnData_ss['Width'])) { + $columnWidth = $columnData_ss['Width']; +// echo 'Setting column width for '.$columnID.' to '.$columnWidth.'
'; + $objPHPExcel->getActiveSheet()->getColumnDimension($columnID)->setWidth($columnWidth / 5.4); + } + ++$columnID; + } + } + + $rowID = 1; + if (isset($worksheet->Table->Row)) { + $additionalMergedCells = 0; + foreach ($worksheet->Table->Row as $rowData) { + $rowHasData = false; + $row_ss = $rowData->attributes($namespaces['ss']); + if (isset($row_ss['Index'])) { + $rowID = (integer) $row_ss['Index']; + } +// echo 'Row '.$rowID.'
'; + + $columnID = 'A'; + foreach ($rowData->Cell as $cell) { + $cell_ss = $cell->attributes($namespaces['ss']); + if (isset($cell_ss['Index'])) { + $columnID = PHPExcel_Cell::stringFromColumnIndex($cell_ss['Index']-1); + } + $cellRange = $columnID.$rowID; + + if ($this->getReadFilter() !== null) { + if (!$this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) { + continue; + } + } + + if ((isset($cell_ss['MergeAcross'])) || (isset($cell_ss['MergeDown']))) { + $columnTo = $columnID; + if (isset($cell_ss['MergeAcross'])) { + $additionalMergedCells += (int)$cell_ss['MergeAcross']; + $columnTo = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($columnID) + $cell_ss['MergeAcross'] -1); + } + $rowTo = $rowID; + if (isset($cell_ss['MergeDown'])) { + $rowTo = $rowTo + $cell_ss['MergeDown']; + } + $cellRange .= ':'.$columnTo.$rowTo; + $objPHPExcel->getActiveSheet()->mergeCells($cellRange); + } + + $cellIsSet = $hasCalculatedValue = false; + $cellDataFormula = ''; + if (isset($cell_ss['Formula'])) { + $cellDataFormula = $cell_ss['Formula']; + // added this as a check for array formulas + if (isset($cell_ss['ArrayRange'])) { + $cellDataCSEFormula = $cell_ss['ArrayRange']; +// echo "found an array formula at ".$columnID.$rowID."
"; + } + $hasCalculatedValue = true; + } + if (isset($cell->Data)) { + $cellValue = $cellData = $cell->Data; + $type = PHPExcel_Cell_DataType::TYPE_NULL; + $cellData_ss = $cellData->attributes($namespaces['ss']); + if (isset($cellData_ss['Type'])) { + $cellDataType = $cellData_ss['Type']; + switch ($cellDataType) { + /* + const TYPE_STRING = 's'; + const TYPE_FORMULA = 'f'; + const TYPE_NUMERIC = 'n'; + const TYPE_BOOL = 'b'; + const TYPE_NULL = 'null'; + const TYPE_INLINE = 'inlineStr'; + const TYPE_ERROR = 'e'; + */ + case 'String': + $cellValue = self::convertStringEncoding($cellValue, $this->charSet); + $type = PHPExcel_Cell_DataType::TYPE_STRING; + break; + case 'Number': + $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; + $cellValue = (float) $cellValue; + if (floor($cellValue) == $cellValue) { + $cellValue = (integer) $cellValue; + } + break; + case 'Boolean': + $type = PHPExcel_Cell_DataType::TYPE_BOOL; + $cellValue = ($cellValue != 0); + break; + case 'DateTime': + $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; + $cellValue = PHPExcel_Shared_Date::PHPToExcel(strtotime($cellValue)); + break; + case 'Error': + $type = PHPExcel_Cell_DataType::TYPE_ERROR; + break; + } + } + + if ($hasCalculatedValue) { +// echo 'FORMULA
'; + $type = PHPExcel_Cell_DataType::TYPE_FORMULA; + $columnNumber = PHPExcel_Cell::columnIndexFromString($columnID); + if (substr($cellDataFormula, 0, 3) == 'of:') { + $cellDataFormula = substr($cellDataFormula, 3); +// echo 'Before: ', $cellDataFormula,'
'; + $temp = explode('"', $cellDataFormula); + $key = false; + foreach ($temp as &$value) { + // Only replace in alternate array entries (i.e. non-quoted blocks) + if ($key = !$key) { + $value = str_replace(array('[.', '.', ']'), '', $value); + } + } + } else { + // Convert R1C1 style references to A1 style references (but only when not quoted) +// echo 'Before: ', $cellDataFormula,'
'; + $temp = explode('"', $cellDataFormula); + $key = false; + foreach ($temp as &$value) { + // Only replace in alternate array entries (i.e. non-quoted blocks) + if ($key = !$key) { + preg_match_all('/(R(\[?-?\d*\]?))(C(\[?-?\d*\]?))/', $value, $cellReferences, PREG_SET_ORDER + PREG_OFFSET_CAPTURE); + // Reverse the matches array, otherwise all our offsets will become incorrect if we modify our way + // through the formula from left to right. Reversing means that we work right to left.through + // the formula + $cellReferences = array_reverse($cellReferences); + // Loop through each R1C1 style reference in turn, converting it to its A1 style equivalent, + // then modify the formula to use that new reference + foreach ($cellReferences as $cellReference) { + $rowReference = $cellReference[2][0]; + // Empty R reference is the current row + if ($rowReference == '') { + $rowReference = $rowID; + } + // Bracketed R references are relative to the current row + if ($rowReference{0} == '[') { + $rowReference = $rowID + trim($rowReference, '[]'); + } + $columnReference = $cellReference[4][0]; + // Empty C reference is the current column + if ($columnReference == '') { + $columnReference = $columnNumber; + } + // Bracketed C references are relative to the current column + if ($columnReference{0} == '[') { + $columnReference = $columnNumber + trim($columnReference, '[]'); + } + $A1CellReference = PHPExcel_Cell::stringFromColumnIndex($columnReference-1).$rowReference; + $value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0])); + } + } + } + } + unset($value); + // Then rebuild the formula string + $cellDataFormula = implode('"', $temp); +// echo 'After: ', $cellDataFormula,'
'; + } + +// echo 'Cell '.$columnID.$rowID.' is a '.$type.' with a value of '.(($hasCalculatedValue) ? $cellDataFormula : $cellValue).'
'; +// + $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type); + if ($hasCalculatedValue) { +// echo 'Formula result is '.$cellValue.'
'; + $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setCalculatedValue($cellValue); + } + $cellIsSet = $rowHasData = true; + } + + if (isset($cell->Comment)) { +// echo 'comment found
'; + $commentAttributes = $cell->Comment->attributes($namespaces['ss']); + $author = 'unknown'; + if (isset($commentAttributes->Author)) { + $author = (string)$commentAttributes->Author; +// echo 'Author: ', $author,'
'; + } + $node = $cell->Comment->Data->asXML(); +// $annotation = str_replace('html:','',substr($node,49,-10)); +// echo $annotation,'
'; + $annotation = strip_tags($node); +// echo 'Annotation: ', $annotation,'
'; + $objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setAuthor(self::convertStringEncoding($author, $this->charSet))->setText($this->parseRichText($annotation)); + } + + if (($cellIsSet) && (isset($cell_ss['StyleID']))) { + $style = (string) $cell_ss['StyleID']; +// echo 'Cell style for '.$columnID.$rowID.' is '.$style.'
'; + if ((isset($this->styles[$style])) && (!empty($this->styles[$style]))) { +// echo 'Cell '.$columnID.$rowID.'
'; +// print_r($this->styles[$style]); +// echo '
'; + if (!$objPHPExcel->getActiveSheet()->cellExists($columnID.$rowID)) { + $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValue(null); + } + $objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styles[$style]); + } + } + ++$columnID; + while ($additionalMergedCells > 0) { + ++$columnID; + $additionalMergedCells--; + } + } + + if ($rowHasData) { + if (isset($row_ss['StyleID'])) { + $rowStyle = $row_ss['StyleID']; + } + if (isset($row_ss['Height'])) { + $rowHeight = $row_ss['Height']; +// echo 'Setting row height to '.$rowHeight.'
'; + $objPHPExcel->getActiveSheet()->getRowDimension($rowID)->setRowHeight($rowHeight); + } + } + + ++$rowID; + } + } + ++$worksheetID; + } + + // Return + return $objPHPExcel; + } + + + protected static function convertStringEncoding($string, $charset) + { + if ($charset != 'UTF-8') { + return PHPExcel_Shared_String::ConvertEncoding($string, 'UTF-8', $charset); + } + return $string; + } + + + protected function parseRichText($is = '') + { + $value = new PHPExcel_RichText(); + + $value->createText(self::convertStringEncoding($is, $this->charSet)); + + return $value; + } +} diff --git a/extend/PHPExcel/PHPExcel/Reader/Excel2007.php b/extend/PHPExcel/PHPExcel/Reader/Excel2007.php new file mode 100644 index 0000000..1932df4 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Excel2007.php @@ -0,0 +1,2051 @@ +readFilter = new PHPExcel_Reader_DefaultReadFilter(); + $this->referenceHelper = PHPExcel_ReferenceHelper::getInstance(); + } + + /** + * Can the current PHPExcel_Reader_IReader read the file? + * + * @param string $pFilename + * @return boolean + * @throws PHPExcel_Reader_Exception + */ + public function canRead($pFilename) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + $zipClass = PHPExcel_Settings::getZipClass(); + + // Check if zip class exists +// if (!class_exists($zipClass, false)) { +// throw new PHPExcel_Reader_Exception($zipClass . " library is not enabled"); +// } + + $xl = false; + // Load file + $zip = new $zipClass; + if ($zip->open($pFilename) === true) { + // check if it is an OOXML archive + $rels = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + if ($rels !== false) { + foreach ($rels->Relationship as $rel) { + switch ($rel["Type"]) { + case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument": + if (basename($rel["Target"]) == 'workbook.xml') { + $xl = true; + } + break; + + } + } + } + $zip->close(); + } + + return $xl; + } + + + /** + * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object + * + * @param string $pFilename + * @throws PHPExcel_Reader_Exception + */ + public function listWorksheetNames($pFilename) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + $worksheetNames = array(); + + $zipClass = PHPExcel_Settings::getZipClass(); + + $zip = new $zipClass; + $zip->open($pFilename); + + // The files we're looking at here are small enough that simpleXML is more efficient than XMLReader + $rels = simplexml_load_string( + $this->securityScan($this->getFromZipArchive($zip, "_rels/.rels"), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()) + ); //~ http://schemas.openxmlformats.org/package/2006/relationships"); + foreach ($rels->Relationship as $rel) { + switch ($rel["Type"]) { + case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument": + $xmlWorkbook = simplexml_load_string( + $this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}"), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()) + ); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"); + + if ($xmlWorkbook->sheets) { + foreach ($xmlWorkbook->sheets->sheet as $eleSheet) { + // Check if sheet should be skipped + $worksheetNames[] = (string) $eleSheet["name"]; + } + } + } + } + + $zip->close(); + + return $worksheetNames; + } + + + /** + * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns) + * + * @param string $pFilename + * @throws PHPExcel_Reader_Exception + */ + public function listWorksheetInfo($pFilename) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + $worksheetInfo = array(); + + $zipClass = PHPExcel_Settings::getZipClass(); + + $zip = new $zipClass; + $zip->open($pFilename); + + $rels = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships"); + foreach ($rels->Relationship as $rel) { + if ($rel["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument") { + $dir = dirname($rel["Target"]); + $relsWorkbook = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships"); + $relsWorkbook->registerXPathNamespace("rel", "http://schemas.openxmlformats.org/package/2006/relationships"); + + $worksheets = array(); + foreach ($relsWorkbook->Relationship as $ele) { + if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet") { + $worksheets[(string) $ele["Id"]] = $ele["Target"]; + } + } + + $xmlWorkbook = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"); + if ($xmlWorkbook->sheets) { + $dir = dirname($rel["Target"]); + foreach ($xmlWorkbook->sheets->sheet as $eleSheet) { + $tmpInfo = array( + 'worksheetName' => (string) $eleSheet["name"], + 'lastColumnLetter' => 'A', + 'lastColumnIndex' => 0, + 'totalRows' => 0, + 'totalColumns' => 0, + ); + + $fileWorksheet = $worksheets[(string) self::getArrayItem($eleSheet->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")]; + + $xml = new XMLReader(); + $res = $xml->xml($this->securityScanFile('zip://'.PHPExcel_Shared_File::realpath($pFilename).'#'."$dir/$fileWorksheet"), null, PHPExcel_Settings::getLibXmlLoaderOptions()); + $xml->setParserProperty(2, true); + + $currCells = 0; + while ($xml->read()) { + if ($xml->name == 'row' && $xml->nodeType == XMLReader::ELEMENT) { + $row = $xml->getAttribute('r'); + $tmpInfo['totalRows'] = $row; + $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells); + $currCells = 0; + } elseif ($xml->name == 'c' && $xml->nodeType == XMLReader::ELEMENT) { + $currCells++; + } + } + $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells); + $xml->close(); + + $tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1; + $tmpInfo['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); + + $worksheetInfo[] = $tmpInfo; + } + } + } + } + + $zip->close(); + + return $worksheetInfo; + } + + private static function castToBoolean($c) + { +// echo 'Initial Cast to Boolean', PHP_EOL; + $value = isset($c->v) ? (string) $c->v : null; + if ($value == '0') { + return false; + } elseif ($value == '1') { + return true; + } else { + return (bool)$c->v; + } + return $value; + } + + private static function castToError($c) + { +// echo 'Initial Cast to Error', PHP_EOL; + return isset($c->v) ? (string) $c->v : null; + } + + private static function castToString($c) + { +// echo 'Initial Cast to String, PHP_EOL; + return isset($c->v) ? (string) $c->v : null; + } + + private function castToFormula($c, $r, &$cellDataType, &$value, &$calculatedValue, &$sharedFormulas, $castBaseType) + { +// echo 'Formula', PHP_EOL; +// echo '$c->f is ', $c->f, PHP_EOL; + $cellDataType = 'f'; + $value = "={$c->f}"; + $calculatedValue = self::$castBaseType($c); + + // Shared formula? + if (isset($c->f['t']) && strtolower((string)$c->f['t']) == 'shared') { +// echo 'SHARED FORMULA', PHP_EOL; + $instance = (string)$c->f['si']; + +// echo 'Instance ID = ', $instance, PHP_EOL; +// +// echo 'Shared Formula Array:', PHP_EOL; +// print_r($sharedFormulas); + if (!isset($sharedFormulas[(string)$c->f['si']])) { +// echo 'SETTING NEW SHARED FORMULA', PHP_EOL; +// echo 'Master is ', $r, PHP_EOL; +// echo 'Formula is ', $value, PHP_EOL; + $sharedFormulas[$instance] = array('master' => $r, 'formula' => $value); +// echo 'New Shared Formula Array:', PHP_EOL; +// print_r($sharedFormulas); + } else { +// echo 'GETTING SHARED FORMULA', PHP_EOL; +// echo 'Master is ', $sharedFormulas[$instance]['master'], PHP_EOL; +// echo 'Formula is ', $sharedFormulas[$instance]['formula'], PHP_EOL; + $master = PHPExcel_Cell::coordinateFromString($sharedFormulas[$instance]['master']); + $current = PHPExcel_Cell::coordinateFromString($r); + + $difference = array(0, 0); + $difference[0] = PHPExcel_Cell::columnIndexFromString($current[0]) - PHPExcel_Cell::columnIndexFromString($master[0]); + $difference[1] = $current[1] - $master[1]; + + $value = $this->referenceHelper->updateFormulaReferences($sharedFormulas[$instance]['formula'], 'A1', $difference[0], $difference[1]); +// echo 'Adjusted Formula is ', $value, PHP_EOL; + } + } + } + + + private function getFromZipArchive($archive, $fileName = '') + { + // Root-relative paths + if (strpos($fileName, '//') !== false) { + $fileName = substr($fileName, strpos($fileName, '//') + 1); + } + $fileName = PHPExcel_Shared_File::realpath($fileName); + + // Sadly, some 3rd party xlsx generators don't use consistent case for filenaming + // so we need to load case-insensitively from the zip file + + // Apache POI fixes + $contents = $archive->getFromIndex( + $archive->locateName($fileName, ZIPARCHIVE::FL_NOCASE) + ); + if ($contents === false) { + $contents = $archive->getFromIndex( + $archive->locateName(substr($fileName, 1), ZIPARCHIVE::FL_NOCASE) + ); + } + + return $contents; + } + + + /** + * Loads PHPExcel from file + * + * @param string $pFilename + * @return PHPExcel + * @throws PHPExcel_Reader_Exception + */ + public function load($pFilename) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + // Initialisations + $excel = new PHPExcel; + $excel->removeSheetByIndex(0); + if (!$this->readDataOnly) { + $excel->removeCellStyleXfByIndex(0); // remove the default style + $excel->removeCellXfByIndex(0); // remove the default style + } + + $zipClass = PHPExcel_Settings::getZipClass(); + + $zip = new $zipClass; + $zip->open($pFilename); + + // Read the theme first, because we need the colour scheme when reading the styles + $wbRels = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "xl/_rels/workbook.xml.rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships"); + foreach ($wbRels->Relationship as $rel) { + switch ($rel["Type"]) { + case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme": + $themeOrderArray = array('lt1', 'dk1', 'lt2', 'dk2'); + $themeOrderAdditional = count($themeOrderArray); + + $xmlTheme = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "xl/{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + if (is_object($xmlTheme)) { + $xmlThemeName = $xmlTheme->attributes(); + $xmlTheme = $xmlTheme->children("http://schemas.openxmlformats.org/drawingml/2006/main"); + $themeName = (string)$xmlThemeName['name']; + + $colourScheme = $xmlTheme->themeElements->clrScheme->attributes(); + $colourSchemeName = (string)$colourScheme['name']; + $colourScheme = $xmlTheme->themeElements->clrScheme->children("http://schemas.openxmlformats.org/drawingml/2006/main"); + + $themeColours = array(); + foreach ($colourScheme as $k => $xmlColour) { + $themePos = array_search($k, $themeOrderArray); + if ($themePos === false) { + $themePos = $themeOrderAdditional++; + } + if (isset($xmlColour->sysClr)) { + $xmlColourData = $xmlColour->sysClr->attributes(); + $themeColours[$themePos] = $xmlColourData['lastClr']; + } elseif (isset($xmlColour->srgbClr)) { + $xmlColourData = $xmlColour->srgbClr->attributes(); + $themeColours[$themePos] = $xmlColourData['val']; + } + } + self::$theme = new PHPExcel_Reader_Excel2007_Theme($themeName, $colourSchemeName, $themeColours); + } + break; + } + } + + $rels = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships"); + foreach ($rels->Relationship as $rel) { + switch ($rel["Type"]) { + case "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties": + $xmlCore = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + if (is_object($xmlCore)) { + $xmlCore->registerXPathNamespace("dc", "http://purl.org/dc/elements/1.1/"); + $xmlCore->registerXPathNamespace("dcterms", "http://purl.org/dc/terms/"); + $xmlCore->registerXPathNamespace("cp", "http://schemas.openxmlformats.org/package/2006/metadata/core-properties"); + $docProps = $excel->getProperties(); + $docProps->setCreator((string) self::getArrayItem($xmlCore->xpath("dc:creator"))); + $docProps->setLastModifiedBy((string) self::getArrayItem($xmlCore->xpath("cp:lastModifiedBy"))); + $docProps->setCreated(strtotime(self::getArrayItem($xmlCore->xpath("dcterms:created")))); //! respect xsi:type + $docProps->setModified(strtotime(self::getArrayItem($xmlCore->xpath("dcterms:modified")))); //! respect xsi:type + $docProps->setTitle((string) self::getArrayItem($xmlCore->xpath("dc:title"))); + $docProps->setDescription((string) self::getArrayItem($xmlCore->xpath("dc:description"))); + $docProps->setSubject((string) self::getArrayItem($xmlCore->xpath("dc:subject"))); + $docProps->setKeywords((string) self::getArrayItem($xmlCore->xpath("cp:keywords"))); + $docProps->setCategory((string) self::getArrayItem($xmlCore->xpath("cp:category"))); + } + break; + case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties": + $xmlCore = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + if (is_object($xmlCore)) { + $docProps = $excel->getProperties(); + if (isset($xmlCore->Company)) { + $docProps->setCompany((string) $xmlCore->Company); + } + if (isset($xmlCore->Manager)) { + $docProps->setManager((string) $xmlCore->Manager); + } + } + break; + case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties": + $xmlCore = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + if (is_object($xmlCore)) { + $docProps = $excel->getProperties(); + foreach ($xmlCore as $xmlProperty) { + $cellDataOfficeAttributes = $xmlProperty->attributes(); + if (isset($cellDataOfficeAttributes['name'])) { + $propertyName = (string) $cellDataOfficeAttributes['name']; + $cellDataOfficeChildren = $xmlProperty->children('http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'); + $attributeType = $cellDataOfficeChildren->getName(); + $attributeValue = (string) $cellDataOfficeChildren->{$attributeType}; + $attributeValue = PHPExcel_DocumentProperties::convertProperty($attributeValue, $attributeType); + $attributeType = PHPExcel_DocumentProperties::convertPropertyType($attributeType); + $docProps->setCustomProperty($propertyName, $attributeValue, $attributeType); + } + } + } + break; + //Ribbon + case "http://schemas.microsoft.com/office/2006/relationships/ui/extensibility": + $customUI = $rel['Target']; + if (!is_null($customUI)) { + $this->readRibbon($excel, $customUI, $zip); + } + break; + case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument": + $dir = dirname($rel["Target"]); + $relsWorkbook = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships"); + $relsWorkbook->registerXPathNamespace("rel", "http://schemas.openxmlformats.org/package/2006/relationships"); + + $sharedStrings = array(); + $xpath = self::getArrayItem($relsWorkbook->xpath("rel:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings']")); + $xmlStrings = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"); + if (isset($xmlStrings) && isset($xmlStrings->si)) { + foreach ($xmlStrings->si as $val) { + if (isset($val->t)) { + $sharedStrings[] = PHPExcel_Shared_String::ControlCharacterOOXML2PHP((string) $val->t); + } elseif (isset($val->r)) { + $sharedStrings[] = $this->parseRichText($val); + } + } + } + + $worksheets = array(); + $macros = $customUI = null; + foreach ($relsWorkbook->Relationship as $ele) { + switch ($ele['Type']) { + case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet": + $worksheets[(string) $ele["Id"]] = $ele["Target"]; + break; + // a vbaProject ? (: some macros) + case "http://schemas.microsoft.com/office/2006/relationships/vbaProject": + $macros = $ele["Target"]; + break; + } + } + + if (!is_null($macros)) { + $macrosCode = $this->getFromZipArchive($zip, 'xl/vbaProject.bin');//vbaProject.bin always in 'xl' dir and always named vbaProject.bin + if ($macrosCode !== false) { + $excel->setMacrosCode($macrosCode); + $excel->setHasMacros(true); + //short-circuit : not reading vbaProject.bin.rel to get Signature =>allways vbaProjectSignature.bin in 'xl' dir + $Certificate = $this->getFromZipArchive($zip, 'xl/vbaProjectSignature.bin'); + if ($Certificate !== false) { + $excel->setMacrosCertificate($Certificate); + } + } + } + $styles = array(); + $cellStyles = array(); + $xpath = self::getArrayItem($relsWorkbook->xpath("rel:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles']")); + $xmlStyles = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"); + + $numFmts = null; + if ($xmlStyles && $xmlStyles->numFmts[0]) { + $numFmts = $xmlStyles->numFmts[0]; + } + if (isset($numFmts) && ($numFmts !== null)) { + $numFmts->registerXPathNamespace("sml", "http://schemas.openxmlformats.org/spreadsheetml/2006/main"); + } + if (!$this->readDataOnly && $xmlStyles) { + foreach ($xmlStyles->cellXfs->xf as $xf) { + $numFmt = PHPExcel_Style_NumberFormat::FORMAT_GENERAL; + if ($xf["numFmtId"]) { + if (isset($numFmts)) { + $tmpNumFmt = self::getArrayItem($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]")); + + if (isset($tmpNumFmt["formatCode"])) { + $numFmt = (string) $tmpNumFmt["formatCode"]; + } + } + + // We shouldn't override any of the built-in MS Excel values (values below id 164) + // But there's a lot of naughty homebrew xlsx writers that do use "reserved" id values that aren't actually used + // So we make allowance for them rather than lose formatting masks + if ((int)$xf["numFmtId"] < 164 && PHPExcel_Style_NumberFormat::builtInFormatCode((int)$xf["numFmtId"]) !== '') { + $numFmt = PHPExcel_Style_NumberFormat::builtInFormatCode((int)$xf["numFmtId"]); + } + } + $quotePrefix = false; + if (isset($xf["quotePrefix"])) { + $quotePrefix = (boolean) $xf["quotePrefix"]; + } + + $style = (object) array( + "numFmt" => $numFmt, + "font" => $xmlStyles->fonts->font[intval($xf["fontId"])], + "fill" => $xmlStyles->fills->fill[intval($xf["fillId"])], + "border" => $xmlStyles->borders->border[intval($xf["borderId"])], + "alignment" => $xf->alignment, + "protection" => $xf->protection, + "quotePrefix" => $quotePrefix, + ); + $styles[] = $style; + + // add style to cellXf collection + $objStyle = new PHPExcel_Style; + self::readStyle($objStyle, $style); + $excel->addCellXf($objStyle); + } + + foreach ($xmlStyles->cellStyleXfs->xf as $xf) { + $numFmt = PHPExcel_Style_NumberFormat::FORMAT_GENERAL; + if ($numFmts && $xf["numFmtId"]) { + $tmpNumFmt = self::getArrayItem($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]")); + if (isset($tmpNumFmt["formatCode"])) { + $numFmt = (string) $tmpNumFmt["formatCode"]; + } elseif ((int)$xf["numFmtId"] < 165) { + $numFmt = PHPExcel_Style_NumberFormat::builtInFormatCode((int)$xf["numFmtId"]); + } + } + + $cellStyle = (object) array( + "numFmt" => $numFmt, + "font" => $xmlStyles->fonts->font[intval($xf["fontId"])], + "fill" => $xmlStyles->fills->fill[intval($xf["fillId"])], + "border" => $xmlStyles->borders->border[intval($xf["borderId"])], + "alignment" => $xf->alignment, + "protection" => $xf->protection, + "quotePrefix" => $quotePrefix, + ); + $cellStyles[] = $cellStyle; + + // add style to cellStyleXf collection + $objStyle = new PHPExcel_Style; + self::readStyle($objStyle, $cellStyle); + $excel->addCellStyleXf($objStyle); + } + } + + $dxfs = array(); + if (!$this->readDataOnly && $xmlStyles) { + // Conditional Styles + if ($xmlStyles->dxfs) { + foreach ($xmlStyles->dxfs->dxf as $dxf) { + $style = new PHPExcel_Style(false, true); + self::readStyle($style, $dxf); + $dxfs[] = $style; + } + } + // Cell Styles + if ($xmlStyles->cellStyles) { + foreach ($xmlStyles->cellStyles->cellStyle as $cellStyle) { + if (intval($cellStyle['builtinId']) == 0) { + if (isset($cellStyles[intval($cellStyle['xfId'])])) { + // Set default style + $style = new PHPExcel_Style; + self::readStyle($style, $cellStyles[intval($cellStyle['xfId'])]); + + // normal style, currently not using it for anything + } + } + } + } + } + + $xmlWorkbook = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"); + + // Set base date + if ($xmlWorkbook->workbookPr) { + PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900); + if (isset($xmlWorkbook->workbookPr['date1904'])) { + if (self::boolean((string) $xmlWorkbook->workbookPr['date1904'])) { + PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904); + } + } + } + + $sheetId = 0; // keep track of new sheet id in final workbook + $oldSheetId = -1; // keep track of old sheet id in final workbook + $countSkippedSheets = 0; // keep track of number of skipped sheets + $mapSheetId = array(); // mapping of sheet ids from old to new + + $charts = $chartDetails = array(); + + if ($xmlWorkbook->sheets) { + foreach ($xmlWorkbook->sheets->sheet as $eleSheet) { + ++$oldSheetId; + + // Check if sheet should be skipped + if (isset($this->loadSheetsOnly) && !in_array((string) $eleSheet["name"], $this->loadSheetsOnly)) { + ++$countSkippedSheets; + $mapSheetId[$oldSheetId] = null; + continue; + } + + // Map old sheet id in original workbook to new sheet id. + // They will differ if loadSheetsOnly() is being used + $mapSheetId[$oldSheetId] = $oldSheetId - $countSkippedSheets; + + // Load sheet + $docSheet = $excel->createSheet(); + // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet + // references in formula cells... during the load, all formulae should be correct, + // and we're simply bringing the worksheet name in line with the formula, not the + // reverse + $docSheet->setTitle((string) $eleSheet["name"], false); + $fileWorksheet = $worksheets[(string) self::getArrayItem($eleSheet->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")]; + $xmlSheet = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "$dir/$fileWorksheet")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"); + + $sharedFormulas = array(); + + if (isset($eleSheet["state"]) && (string) $eleSheet["state"] != '') { + $docSheet->setSheetState((string) $eleSheet["state"]); + } + + if (isset($xmlSheet->sheetViews) && isset($xmlSheet->sheetViews->sheetView)) { + if (isset($xmlSheet->sheetViews->sheetView['zoomScale'])) { + $docSheet->getSheetView()->setZoomScale(intval($xmlSheet->sheetViews->sheetView['zoomScale'])); + } + if (isset($xmlSheet->sheetViews->sheetView['zoomScaleNormal'])) { + $docSheet->getSheetView()->setZoomScaleNormal(intval($xmlSheet->sheetViews->sheetView['zoomScaleNormal'])); + } + if (isset($xmlSheet->sheetViews->sheetView['view'])) { + $docSheet->getSheetView()->setView((string) $xmlSheet->sheetViews->sheetView['view']); + } + if (isset($xmlSheet->sheetViews->sheetView['showGridLines'])) { + $docSheet->setShowGridLines(self::boolean((string)$xmlSheet->sheetViews->sheetView['showGridLines'])); + } + if (isset($xmlSheet->sheetViews->sheetView['showRowColHeaders'])) { + $docSheet->setShowRowColHeaders(self::boolean((string)$xmlSheet->sheetViews->sheetView['showRowColHeaders'])); + } + if (isset($xmlSheet->sheetViews->sheetView['rightToLeft'])) { + $docSheet->setRightToLeft(self::boolean((string)$xmlSheet->sheetViews->sheetView['rightToLeft'])); + } + if (isset($xmlSheet->sheetViews->sheetView->pane)) { + if (isset($xmlSheet->sheetViews->sheetView->pane['topLeftCell'])) { + $docSheet->freezePane((string)$xmlSheet->sheetViews->sheetView->pane['topLeftCell']); + } else { + $xSplit = 0; + $ySplit = 0; + + if (isset($xmlSheet->sheetViews->sheetView->pane['xSplit'])) { + $xSplit = 1 + intval($xmlSheet->sheetViews->sheetView->pane['xSplit']); + } + + if (isset($xmlSheet->sheetViews->sheetView->pane['ySplit'])) { + $ySplit = 1 + intval($xmlSheet->sheetViews->sheetView->pane['ySplit']); + } + + $docSheet->freezePaneByColumnAndRow($xSplit, $ySplit); + } + } + + if (isset($xmlSheet->sheetViews->sheetView->selection)) { + if (isset($xmlSheet->sheetViews->sheetView->selection['sqref'])) { + $sqref = (string)$xmlSheet->sheetViews->sheetView->selection['sqref']; + $sqref = explode(' ', $sqref); + $sqref = $sqref[0]; + $docSheet->setSelectedCells($sqref); + } + } + } + + if (isset($xmlSheet->sheetPr) && isset($xmlSheet->sheetPr->tabColor)) { + if (isset($xmlSheet->sheetPr->tabColor['rgb'])) { + $docSheet->getTabColor()->setARGB((string)$xmlSheet->sheetPr->tabColor['rgb']); + } + } + if (isset($xmlSheet->sheetPr) && isset($xmlSheet->sheetPr['codeName'])) { + $docSheet->setCodeName((string) $xmlSheet->sheetPr['codeName']); + } + if (isset($xmlSheet->sheetPr) && isset($xmlSheet->sheetPr->outlinePr)) { + if (isset($xmlSheet->sheetPr->outlinePr['summaryRight']) && + !self::boolean((string) $xmlSheet->sheetPr->outlinePr['summaryRight'])) { + $docSheet->setShowSummaryRight(false); + } else { + $docSheet->setShowSummaryRight(true); + } + + if (isset($xmlSheet->sheetPr->outlinePr['summaryBelow']) && + !self::boolean((string) $xmlSheet->sheetPr->outlinePr['summaryBelow'])) { + $docSheet->setShowSummaryBelow(false); + } else { + $docSheet->setShowSummaryBelow(true); + } + } + + if (isset($xmlSheet->sheetPr) && isset($xmlSheet->sheetPr->pageSetUpPr)) { + if (isset($xmlSheet->sheetPr->pageSetUpPr['fitToPage']) && + !self::boolean((string) $xmlSheet->sheetPr->pageSetUpPr['fitToPage'])) { + $docSheet->getPageSetup()->setFitToPage(false); + } else { + $docSheet->getPageSetup()->setFitToPage(true); + } + } + + if (isset($xmlSheet->sheetFormatPr)) { + if (isset($xmlSheet->sheetFormatPr['customHeight']) && + self::boolean((string) $xmlSheet->sheetFormatPr['customHeight']) && + isset($xmlSheet->sheetFormatPr['defaultRowHeight'])) { + $docSheet->getDefaultRowDimension()->setRowHeight((float)$xmlSheet->sheetFormatPr['defaultRowHeight']); + } + if (isset($xmlSheet->sheetFormatPr['defaultColWidth'])) { + $docSheet->getDefaultColumnDimension()->setWidth((float)$xmlSheet->sheetFormatPr['defaultColWidth']); + } + if (isset($xmlSheet->sheetFormatPr['zeroHeight']) && + ((string)$xmlSheet->sheetFormatPr['zeroHeight'] == '1')) { + $docSheet->getDefaultRowDimension()->setZeroHeight(true); + } + } + + if (isset($xmlSheet->cols) && !$this->readDataOnly) { + foreach ($xmlSheet->cols->col as $col) { + for ($i = intval($col["min"]) - 1; $i < intval($col["max"]); ++$i) { + if ($col["style"] && !$this->readDataOnly) { + $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setXfIndex(intval($col["style"])); + } + if (self::boolean($col["bestFit"])) { + //$docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setAutoSize(true); + } + if (self::boolean($col["hidden"])) { + // echo PHPExcel_Cell::stringFromColumnIndex($i), ': HIDDEN COLUMN',PHP_EOL; + $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setVisible(false); + } + if (self::boolean($col["collapsed"])) { + $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setCollapsed(true); + } + if ($col["outlineLevel"] > 0) { + $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setOutlineLevel(intval($col["outlineLevel"])); + } + $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setWidth(floatval($col["width"])); + + if (intval($col["max"]) == 16384) { + break; + } + } + } + } + + if (isset($xmlSheet->printOptions) && !$this->readDataOnly) { + if (self::boolean((string) $xmlSheet->printOptions['gridLinesSet'])) { + $docSheet->setShowGridlines(true); + } + if (self::boolean((string) $xmlSheet->printOptions['gridLines'])) { + $docSheet->setPrintGridlines(true); + } + if (self::boolean((string) $xmlSheet->printOptions['horizontalCentered'])) { + $docSheet->getPageSetup()->setHorizontalCentered(true); + } + if (self::boolean((string) $xmlSheet->printOptions['verticalCentered'])) { + $docSheet->getPageSetup()->setVerticalCentered(true); + } + } + + if ($xmlSheet && $xmlSheet->sheetData && $xmlSheet->sheetData->row) { + foreach ($xmlSheet->sheetData->row as $row) { + if ($row["ht"] && !$this->readDataOnly) { + $docSheet->getRowDimension(intval($row["r"]))->setRowHeight(floatval($row["ht"])); + } + if (self::boolean($row["hidden"]) && !$this->readDataOnly) { + $docSheet->getRowDimension(intval($row["r"]))->setVisible(false); + } + if (self::boolean($row["collapsed"])) { + $docSheet->getRowDimension(intval($row["r"]))->setCollapsed(true); + } + if ($row["outlineLevel"] > 0) { + $docSheet->getRowDimension(intval($row["r"]))->setOutlineLevel(intval($row["outlineLevel"])); + } + if ($row["s"] && !$this->readDataOnly) { + $docSheet->getRowDimension(intval($row["r"]))->setXfIndex(intval($row["s"])); + } + + foreach ($row->c as $c) { + $r = (string) $c["r"]; + $cellDataType = (string) $c["t"]; + $value = null; + $calculatedValue = null; + + // Read cell? + if ($this->getReadFilter() !== null) { + $coordinates = PHPExcel_Cell::coordinateFromString($r); + + if (!$this->getReadFilter()->readCell($coordinates[0], $coordinates[1], $docSheet->getTitle())) { + continue; + } + } + + // echo 'Reading cell ', $coordinates[0], $coordinates[1], PHP_EOL; + // print_r($c); + // echo PHP_EOL; + // echo 'Cell Data Type is ', $cellDataType, ': '; + // + // Read cell! + switch ($cellDataType) { + case "s": + // echo 'String', PHP_EOL; + if ((string)$c->v != '') { + $value = $sharedStrings[intval($c->v)]; + + if ($value instanceof PHPExcel_RichText) { + $value = clone $value; + } + } else { + $value = ''; + } + break; + case "b": + // echo 'Boolean', PHP_EOL; + if (!isset($c->f)) { + $value = self::castToBoolean($c); + } else { + // Formula + $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToBoolean'); + if (isset($c->f['t'])) { + $att = array(); + $att = $c->f; + $docSheet->getCell($r)->setFormulaAttributes($att); + } + // echo '$calculatedValue = ', $calculatedValue, PHP_EOL; + } + break; + case "inlineStr": +// echo 'Inline String', PHP_EOL; + if (isset($c->f)) { + $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToError'); + } else { + $value = $this->parseRichText($c->is); + } + break; + case "e": + // echo 'Error', PHP_EOL; + if (!isset($c->f)) { + $value = self::castToError($c); + } else { + // Formula + $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToError'); + // echo '$calculatedValue = ', $calculatedValue, PHP_EOL; + } + break; + default: +// echo 'Default', PHP_EOL; + if (!isset($c->f)) { + // echo 'Not a Formula', PHP_EOL; + $value = self::castToString($c); + } else { + // echo 'Treat as Formula', PHP_EOL; + // Formula + $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToString'); + // echo '$calculatedValue = ', $calculatedValue, PHP_EOL; + } + break; + } + // echo 'Value is ', $value, PHP_EOL; + + // Check for numeric values + if (is_numeric($value) && $cellDataType != 's') { + if ($value == (int)$value) { + $value = (int)$value; + } elseif ($value == (float)$value) { + $value = (float)$value; + } elseif ($value == (double)$value) { + $value = (double)$value; + } + } + + // Rich text? + if ($value instanceof PHPExcel_RichText && $this->readDataOnly) { + $value = $value->getPlainText(); + } + + $cell = $docSheet->getCell($r); + // Assign value + if ($cellDataType != '') { + $cell->setValueExplicit($value, $cellDataType); + } else { + $cell->setValue($value); + } + if ($calculatedValue !== null) { + $cell->setCalculatedValue($calculatedValue); + } + + // Style information? + if ($c["s"] && !$this->readDataOnly) { + // no style index means 0, it seems + $cell->setXfIndex(isset($styles[intval($c["s"])]) ? + intval($c["s"]) : 0); + } + } + } + } + + $conditionals = array(); + if (!$this->readDataOnly && $xmlSheet && $xmlSheet->conditionalFormatting) { + foreach ($xmlSheet->conditionalFormatting as $conditional) { + foreach ($conditional->cfRule as $cfRule) { + if (((string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_NONE || (string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_CELLIS || (string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT || (string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_EXPRESSION) && isset($dxfs[intval($cfRule["dxfId"])])) { + $conditionals[(string) $conditional["sqref"]][intval($cfRule["priority"])] = $cfRule; + } + } + } + + foreach ($conditionals as $ref => $cfRules) { + ksort($cfRules); + $conditionalStyles = array(); + foreach ($cfRules as $cfRule) { + $objConditional = new PHPExcel_Style_Conditional(); + $objConditional->setConditionType((string)$cfRule["type"]); + $objConditional->setOperatorType((string)$cfRule["operator"]); + + if ((string)$cfRule["text"] != '') { + $objConditional->setText((string)$cfRule["text"]); + } + + if (count($cfRule->formula) > 1) { + foreach ($cfRule->formula as $formula) { + $objConditional->addCondition((string)$formula); + } + } else { + $objConditional->addCondition((string)$cfRule->formula); + } + $objConditional->setStyle(clone $dxfs[intval($cfRule["dxfId"])]); + $conditionalStyles[] = $objConditional; + } + + // Extract all cell references in $ref + $cellBlocks = explode(' ', str_replace('$', '', strtoupper($ref))); + foreach ($cellBlocks as $cellBlock) { + $docSheet->getStyle($cellBlock)->setConditionalStyles($conditionalStyles); + } + } + } + + $aKeys = array("sheet", "objects", "scenarios", "formatCells", "formatColumns", "formatRows", "insertColumns", "insertRows", "insertHyperlinks", "deleteColumns", "deleteRows", "selectLockedCells", "sort", "autoFilter", "pivotTables", "selectUnlockedCells"); + if (!$this->readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) { + foreach ($aKeys as $key) { + $method = "set" . ucfirst($key); + $docSheet->getProtection()->$method(self::boolean((string) $xmlSheet->sheetProtection[$key])); + } + } + + if (!$this->readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) { + $docSheet->getProtection()->setPassword((string) $xmlSheet->sheetProtection["password"], true); + if ($xmlSheet->protectedRanges->protectedRange) { + foreach ($xmlSheet->protectedRanges->protectedRange as $protectedRange) { + $docSheet->protectCells((string) $protectedRange["sqref"], (string) $protectedRange["password"], true); + } + } + } + + if ($xmlSheet && $xmlSheet->autoFilter && !$this->readDataOnly) { + $autoFilterRange = (string) $xmlSheet->autoFilter["ref"]; + if (strpos($autoFilterRange, ':') !== false) { + $autoFilter = $docSheet->getAutoFilter(); + $autoFilter->setRange($autoFilterRange); + + foreach ($xmlSheet->autoFilter->filterColumn as $filterColumn) { + $column = $autoFilter->getColumnByOffset((integer) $filterColumn["colId"]); + // Check for standard filters + if ($filterColumn->filters) { + $column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER); + $filters = $filterColumn->filters; + if ((isset($filters["blank"])) && ($filters["blank"] == 1)) { + // Operator is undefined, but always treated as EQUAL + $column->createRule()->setRule(null, '')->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER); + } + // Standard filters are always an OR join, so no join rule needs to be set + // Entries can be either filter elements + foreach ($filters->filter as $filterRule) { + // Operator is undefined, but always treated as EQUAL + $column->createRule()->setRule(null, (string) $filterRule["val"])->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER); + } + // Or Date Group elements + foreach ($filters->dateGroupItem as $dateGroupItem) { + $column->createRule()->setRule( + // Operator is undefined, but always treated as EQUAL + null, + array( + 'year' => (string) $dateGroupItem["year"], + 'month' => (string) $dateGroupItem["month"], + 'day' => (string) $dateGroupItem["day"], + 'hour' => (string) $dateGroupItem["hour"], + 'minute' => (string) $dateGroupItem["minute"], + 'second' => (string) $dateGroupItem["second"], + ), + (string) $dateGroupItem["dateTimeGrouping"] + ) + ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP); + } + } + // Check for custom filters + if ($filterColumn->customFilters) { + $column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER); + $customFilters = $filterColumn->customFilters; + // Custom filters can an AND or an OR join; + // and there should only ever be one or two entries + if ((isset($customFilters["and"])) && ($customFilters["and"] == 1)) { + $column->setJoin(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND); + } + foreach ($customFilters->customFilter as $filterRule) { + $column->createRule()->setRule( + (string) $filterRule["operator"], + (string) $filterRule["val"] + ) + ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); + } + } + // Check for dynamic filters + if ($filterColumn->dynamicFilter) { + $column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER); + // We should only ever have one dynamic filter + foreach ($filterColumn->dynamicFilter as $filterRule) { + $column->createRule()->setRule( + // Operator is undefined, but always treated as EQUAL + null, + (string) $filterRule["val"], + (string) $filterRule["type"] + ) + ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER); + if (isset($filterRule["val"])) { + $column->setAttribute('val', (string) $filterRule["val"]); + } + if (isset($filterRule["maxVal"])) { + $column->setAttribute('maxVal', (string) $filterRule["maxVal"]); + } + } + } + // Check for dynamic filters + if ($filterColumn->top10) { + $column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER); + // We should only ever have one top10 filter + foreach ($filterColumn->top10 as $filterRule) { + $column->createRule()->setRule( + (((isset($filterRule["percent"])) && ($filterRule["percent"] == 1)) + ? PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT + : PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE + ), + (string) $filterRule["val"], + (((isset($filterRule["top"])) && ($filterRule["top"] == 1)) + ? PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP + : PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM + ) + ) + ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_TOPTENFILTER); + } + } + } + } + } + + if ($xmlSheet && $xmlSheet->mergeCells && $xmlSheet->mergeCells->mergeCell && !$this->readDataOnly) { + foreach ($xmlSheet->mergeCells->mergeCell as $mergeCell) { + $mergeRef = (string) $mergeCell["ref"]; + if (strpos($mergeRef, ':') !== false) { + $docSheet->mergeCells((string) $mergeCell["ref"]); + } + } + } + + if ($xmlSheet && $xmlSheet->pageMargins && !$this->readDataOnly) { + $docPageMargins = $docSheet->getPageMargins(); + $docPageMargins->setLeft(floatval($xmlSheet->pageMargins["left"])); + $docPageMargins->setRight(floatval($xmlSheet->pageMargins["right"])); + $docPageMargins->setTop(floatval($xmlSheet->pageMargins["top"])); + $docPageMargins->setBottom(floatval($xmlSheet->pageMargins["bottom"])); + $docPageMargins->setHeader(floatval($xmlSheet->pageMargins["header"])); + $docPageMargins->setFooter(floatval($xmlSheet->pageMargins["footer"])); + } + + if ($xmlSheet && $xmlSheet->pageSetup && !$this->readDataOnly) { + $docPageSetup = $docSheet->getPageSetup(); + + if (isset($xmlSheet->pageSetup["orientation"])) { + $docPageSetup->setOrientation((string) $xmlSheet->pageSetup["orientation"]); + } + if (isset($xmlSheet->pageSetup["paperSize"])) { + $docPageSetup->setPaperSize(intval($xmlSheet->pageSetup["paperSize"])); + } + if (isset($xmlSheet->pageSetup["scale"])) { + $docPageSetup->setScale(intval($xmlSheet->pageSetup["scale"]), false); + } + if (isset($xmlSheet->pageSetup["fitToHeight"]) && intval($xmlSheet->pageSetup["fitToHeight"]) >= 0) { + $docPageSetup->setFitToHeight(intval($xmlSheet->pageSetup["fitToHeight"]), false); + } + if (isset($xmlSheet->pageSetup["fitToWidth"]) && intval($xmlSheet->pageSetup["fitToWidth"]) >= 0) { + $docPageSetup->setFitToWidth(intval($xmlSheet->pageSetup["fitToWidth"]), false); + } + if (isset($xmlSheet->pageSetup["firstPageNumber"]) && isset($xmlSheet->pageSetup["useFirstPageNumber"]) && + self::boolean((string) $xmlSheet->pageSetup["useFirstPageNumber"])) { + $docPageSetup->setFirstPageNumber(intval($xmlSheet->pageSetup["firstPageNumber"])); + } + } + + if ($xmlSheet && $xmlSheet->headerFooter && !$this->readDataOnly) { + $docHeaderFooter = $docSheet->getHeaderFooter(); + + if (isset($xmlSheet->headerFooter["differentOddEven"]) && + self::boolean((string)$xmlSheet->headerFooter["differentOddEven"])) { + $docHeaderFooter->setDifferentOddEven(true); + } else { + $docHeaderFooter->setDifferentOddEven(false); + } + if (isset($xmlSheet->headerFooter["differentFirst"]) && + self::boolean((string)$xmlSheet->headerFooter["differentFirst"])) { + $docHeaderFooter->setDifferentFirst(true); + } else { + $docHeaderFooter->setDifferentFirst(false); + } + if (isset($xmlSheet->headerFooter["scaleWithDoc"]) && + !self::boolean((string)$xmlSheet->headerFooter["scaleWithDoc"])) { + $docHeaderFooter->setScaleWithDocument(false); + } else { + $docHeaderFooter->setScaleWithDocument(true); + } + if (isset($xmlSheet->headerFooter["alignWithMargins"]) && + !self::boolean((string)$xmlSheet->headerFooter["alignWithMargins"])) { + $docHeaderFooter->setAlignWithMargins(false); + } else { + $docHeaderFooter->setAlignWithMargins(true); + } + + $docHeaderFooter->setOddHeader((string) $xmlSheet->headerFooter->oddHeader); + $docHeaderFooter->setOddFooter((string) $xmlSheet->headerFooter->oddFooter); + $docHeaderFooter->setEvenHeader((string) $xmlSheet->headerFooter->evenHeader); + $docHeaderFooter->setEvenFooter((string) $xmlSheet->headerFooter->evenFooter); + $docHeaderFooter->setFirstHeader((string) $xmlSheet->headerFooter->firstHeader); + $docHeaderFooter->setFirstFooter((string) $xmlSheet->headerFooter->firstFooter); + } + + if ($xmlSheet && $xmlSheet->rowBreaks && $xmlSheet->rowBreaks->brk && !$this->readDataOnly) { + foreach ($xmlSheet->rowBreaks->brk as $brk) { + if ($brk["man"]) { + $docSheet->setBreak("A$brk[id]", PHPExcel_Worksheet::BREAK_ROW); + } + } + } + if ($xmlSheet && $xmlSheet->colBreaks && $xmlSheet->colBreaks->brk && !$this->readDataOnly) { + foreach ($xmlSheet->colBreaks->brk as $brk) { + if ($brk["man"]) { + $docSheet->setBreak(PHPExcel_Cell::stringFromColumnIndex((string) $brk["id"]) . "1", PHPExcel_Worksheet::BREAK_COLUMN); + } + } + } + + if ($xmlSheet && $xmlSheet->dataValidations && !$this->readDataOnly) { + foreach ($xmlSheet->dataValidations->dataValidation as $dataValidation) { + // Uppercase coordinate + $range = strtoupper($dataValidation["sqref"]); + $rangeSet = explode(' ', $range); + foreach ($rangeSet as $range) { + $stRange = $docSheet->shrinkRangeToFit($range); + + // Extract all cell references in $range + foreach (PHPExcel_Cell::extractAllCellReferencesInRange($stRange) as $reference) { + // Create validation + $docValidation = $docSheet->getCell($reference)->getDataValidation(); + $docValidation->setType((string) $dataValidation["type"]); + $docValidation->setErrorStyle((string) $dataValidation["errorStyle"]); + $docValidation->setOperator((string) $dataValidation["operator"]); + $docValidation->setAllowBlank($dataValidation["allowBlank"] != 0); + $docValidation->setShowDropDown($dataValidation["showDropDown"] == 0); + $docValidation->setShowInputMessage($dataValidation["showInputMessage"] != 0); + $docValidation->setShowErrorMessage($dataValidation["showErrorMessage"] != 0); + $docValidation->setErrorTitle((string) $dataValidation["errorTitle"]); + $docValidation->setError((string) $dataValidation["error"]); + $docValidation->setPromptTitle((string) $dataValidation["promptTitle"]); + $docValidation->setPrompt((string) $dataValidation["prompt"]); + $docValidation->setFormula1((string) $dataValidation->formula1); + $docValidation->setFormula2((string) $dataValidation->formula2); + } + } + } + } + + // Add hyperlinks + $hyperlinks = array(); + if (!$this->readDataOnly) { + // Locate hyperlink relations + if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) { + $relsWorksheet = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships"); + foreach ($relsWorksheet->Relationship as $ele) { + if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink") { + $hyperlinks[(string)$ele["Id"]] = (string)$ele["Target"]; + } + } + } + + // Loop through hyperlinks + if ($xmlSheet && $xmlSheet->hyperlinks) { + foreach ($xmlSheet->hyperlinks->hyperlink as $hyperlink) { + // Link url + $linkRel = $hyperlink->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'); + + foreach (PHPExcel_Cell::extractAllCellReferencesInRange($hyperlink['ref']) as $cellReference) { + $cell = $docSheet->getCell($cellReference); + if (isset($linkRel['id'])) { + $hyperlinkUrl = $hyperlinks[ (string)$linkRel['id'] ]; + if (isset($hyperlink['location'])) { + $hyperlinkUrl .= '#' . (string) $hyperlink['location']; + } + $cell->getHyperlink()->setUrl($hyperlinkUrl); + } elseif (isset($hyperlink['location'])) { + $cell->getHyperlink()->setUrl('sheet://' . (string)$hyperlink['location']); + } + + // Tooltip + if (isset($hyperlink['tooltip'])) { + $cell->getHyperlink()->setTooltip((string)$hyperlink['tooltip']); + } + } + } + } + } + + // Add comments + $comments = array(); + $vmlComments = array(); + if (!$this->readDataOnly) { + // Locate comment relations + if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) { + $relsWorksheet = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships"); + foreach ($relsWorksheet->Relationship as $ele) { + if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments") { + $comments[(string)$ele["Id"]] = (string)$ele["Target"]; + } + if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing") { + $vmlComments[(string)$ele["Id"]] = (string)$ele["Target"]; + } + } + } + + // Loop through comments + foreach ($comments as $relName => $relPath) { + // Load comments file + $relPath = PHPExcel_Shared_File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath); + $commentsFile = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, $relPath)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + + // Utility variables + $authors = array(); + + // Loop through authors + foreach ($commentsFile->authors->author as $author) { + $authors[] = (string)$author; + } + + // Loop through contents + foreach ($commentsFile->commentList->comment as $comment) { + if (!empty($comment['authorId'])) { + $docSheet->getComment((string)$comment['ref'])->setAuthor($authors[(string)$comment['authorId']]); + } + $docSheet->getComment((string)$comment['ref'])->setText($this->parseRichText($comment->text)); + } + } + + // Loop through VML comments + foreach ($vmlComments as $relName => $relPath) { + // Load VML comments file + $relPath = PHPExcel_Shared_File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath); + $vmlCommentsFile = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, $relPath)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + $vmlCommentsFile->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); + + $shapes = $vmlCommentsFile->xpath('//v:shape'); + foreach ($shapes as $shape) { + $shape->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); + + if (isset($shape['style'])) { + $style = (string)$shape['style']; + $fillColor = strtoupper(substr((string)$shape['fillcolor'], 1)); + $column = null; + $row = null; + + $clientData = $shape->xpath('.//x:ClientData'); + if (is_array($clientData) && !empty($clientData)) { + $clientData = $clientData[0]; + + if (isset($clientData['ObjectType']) && (string)$clientData['ObjectType'] == 'Note') { + $temp = $clientData->xpath('.//x:Row'); + if (is_array($temp)) { + $row = $temp[0]; + } + + $temp = $clientData->xpath('.//x:Column'); + if (is_array($temp)) { + $column = $temp[0]; + } + } + } + + if (($column !== null) && ($row !== null)) { + // Set comment properties + $comment = $docSheet->getCommentByColumnAndRow((string) $column, $row + 1); + $comment->getFillColor()->setRGB($fillColor); + + // Parse style + $styleArray = explode(';', str_replace(' ', '', $style)); + foreach ($styleArray as $stylePair) { + $stylePair = explode(':', $stylePair); + + if ($stylePair[0] == 'margin-left') { + $comment->setMarginLeft($stylePair[1]); + } + if ($stylePair[0] == 'margin-top') { + $comment->setMarginTop($stylePair[1]); + } + if ($stylePair[0] == 'width') { + $comment->setWidth($stylePair[1]); + } + if ($stylePair[0] == 'height') { + $comment->setHeight($stylePair[1]); + } + if ($stylePair[0] == 'visibility') { + $comment->setVisible($stylePair[1] == 'visible'); + } + } + } + } + } + } + + // Header/footer images + if ($xmlSheet && $xmlSheet->legacyDrawingHF && !$this->readDataOnly) { + if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) { + $relsWorksheet = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships"); + $vmlRelationship = ''; + + foreach ($relsWorksheet->Relationship as $ele) { + if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing") { + $vmlRelationship = self::dirAdd("$dir/$fileWorksheet", $ele["Target"]); + } + } + + if ($vmlRelationship != '') { + // Fetch linked images + $relsVML = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname($vmlRelationship) . '/_rels/' . basename($vmlRelationship) . '.rels')), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships"); + $drawings = array(); + foreach ($relsVML->Relationship as $ele) { + if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") { + $drawings[(string) $ele["Id"]] = self::dirAdd($vmlRelationship, $ele["Target"]); + } + } + + // Fetch VML document + $vmlDrawing = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, $vmlRelationship)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + $vmlDrawing->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); + + $hfImages = array(); + + $shapes = $vmlDrawing->xpath('//v:shape'); + foreach ($shapes as $idx => $shape) { + $shape->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); + $imageData = $shape->xpath('//v:imagedata'); + $imageData = $imageData[$idx]; + + $imageData = $imageData->attributes('urn:schemas-microsoft-com:office:office'); + $style = self::toCSSArray((string)$shape['style']); + + $hfImages[ (string)$shape['id'] ] = new PHPExcel_Worksheet_HeaderFooterDrawing(); + if (isset($imageData['title'])) { + $hfImages[ (string)$shape['id'] ]->setName((string)$imageData['title']); + } + + $hfImages[ (string)$shape['id'] ]->setPath("zip://".PHPExcel_Shared_File::realpath($pFilename)."#" . $drawings[(string)$imageData['relid']], false); + $hfImages[ (string)$shape['id'] ]->setResizeProportional(false); + $hfImages[ (string)$shape['id'] ]->setWidth($style['width']); + $hfImages[ (string)$shape['id'] ]->setHeight($style['height']); + if (isset($style['margin-left'])) { + $hfImages[ (string)$shape['id'] ]->setOffsetX($style['margin-left']); + } + $hfImages[ (string)$shape['id'] ]->setOffsetY($style['margin-top']); + $hfImages[ (string)$shape['id'] ]->setResizeProportional(true); + } + + $docSheet->getHeaderFooter()->setImages($hfImages); + } + } + } + + } + + // TODO: Autoshapes from twoCellAnchors! + if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) { + $relsWorksheet = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships"); + $drawings = array(); + foreach ($relsWorksheet->Relationship as $ele) { + if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing") { + $drawings[(string) $ele["Id"]] = self::dirAdd("$dir/$fileWorksheet", $ele["Target"]); + } + } + if ($xmlSheet->drawing && !$this->readDataOnly) { + foreach ($xmlSheet->drawing as $drawing) { + $fileDrawing = $drawings[(string) self::getArrayItem($drawing->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")]; + $relsDrawing = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname($fileDrawing) . "/_rels/" . basename($fileDrawing) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships"); + $images = array(); + + if ($relsDrawing && $relsDrawing->Relationship) { + foreach ($relsDrawing->Relationship as $ele) { + if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") { + $images[(string) $ele["Id"]] = self::dirAdd($fileDrawing, $ele["Target"]); + } elseif ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart") { + if ($this->includeCharts) { + $charts[self::dirAdd($fileDrawing, $ele["Target"])] = array( + 'id' => (string) $ele["Id"], + 'sheet' => $docSheet->getTitle() + ); + } + } + } + } + $xmlDrawing = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, $fileDrawing)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions())->children("http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"); + + if ($xmlDrawing->oneCellAnchor) { + foreach ($xmlDrawing->oneCellAnchor as $oneCellAnchor) { + if ($oneCellAnchor->pic->blipFill) { + $blip = $oneCellAnchor->pic->blipFill->children("http://schemas.openxmlformats.org/drawingml/2006/main")->blip; + $xfrm = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm; + $outerShdw = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->effectLst->outerShdw; + $objDrawing = new PHPExcel_Worksheet_Drawing; + $objDrawing->setName((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name")); + $objDrawing->setDescription((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr")); + $objDrawing->setPath("zip://".PHPExcel_Shared_File::realpath($pFilename)."#" . $images[(string) self::getArrayItem($blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "embed")], false); + $objDrawing->setCoordinates(PHPExcel_Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1)); + $objDrawing->setOffsetX(PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->colOff)); + $objDrawing->setOffsetY(PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->rowOff)); + $objDrawing->setResizeProportional(false); + $objDrawing->setWidth(PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx"))); + $objDrawing->setHeight(PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy"))); + if ($xfrm) { + $objDrawing->setRotation(PHPExcel_Shared_Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), "rot"))); + } + if ($outerShdw) { + $shadow = $objDrawing->getShadow(); + $shadow->setVisible(true); + $shadow->setBlurRadius(PHPExcel_Shared_Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad"))); + $shadow->setDistance(PHPExcel_Shared_Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist"))); + $shadow->setDirection(PHPExcel_Shared_Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir"))); + $shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), "algn")); + $shadow->getColor()->setRGB(self::getArrayItem($outerShdw->srgbClr->attributes(), "val")); + $shadow->setAlpha(self::getArrayItem($outerShdw->srgbClr->alpha->attributes(), "val") / 1000); + } + $objDrawing->setWorksheet($docSheet); + } else { + // ? Can charts be positioned with a oneCellAnchor ? + $coordinates = PHPExcel_Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1); + $offsetX = PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->colOff); + $offsetY = PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->rowOff); + $width = PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx")); + $height = PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy")); + } + } + } + if ($xmlDrawing->twoCellAnchor) { + foreach ($xmlDrawing->twoCellAnchor as $twoCellAnchor) { + if ($twoCellAnchor->pic->blipFill) { + $blip = $twoCellAnchor->pic->blipFill->children("http://schemas.openxmlformats.org/drawingml/2006/main")->blip; + $xfrm = $twoCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm; + $outerShdw = $twoCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->effectLst->outerShdw; + $objDrawing = new PHPExcel_Worksheet_Drawing; + $objDrawing->setName((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name")); + $objDrawing->setDescription((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr")); + $objDrawing->setPath("zip://".PHPExcel_Shared_File::realpath($pFilename)."#" . $images[(string) self::getArrayItem($blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "embed")], false); + $objDrawing->setCoordinates(PHPExcel_Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1)); + $objDrawing->setOffsetX(PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->colOff)); + $objDrawing->setOffsetY(PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->rowOff)); + $objDrawing->setResizeProportional(false); + + if ($xfrm) { + $objDrawing->setWidth(PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cx"))); + $objDrawing->setHeight(PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cy"))); + $objDrawing->setRotation(PHPExcel_Shared_Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), "rot"))); + } + if ($outerShdw) { + $shadow = $objDrawing->getShadow(); + $shadow->setVisible(true); + $shadow->setBlurRadius(PHPExcel_Shared_Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad"))); + $shadow->setDistance(PHPExcel_Shared_Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist"))); + $shadow->setDirection(PHPExcel_Shared_Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir"))); + $shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), "algn")); + $shadow->getColor()->setRGB(self::getArrayItem($outerShdw->srgbClr->attributes(), "val")); + $shadow->setAlpha(self::getArrayItem($outerShdw->srgbClr->alpha->attributes(), "val") / 1000); + } + $objDrawing->setWorksheet($docSheet); + } elseif (($this->includeCharts) && ($twoCellAnchor->graphicFrame)) { + $fromCoordinate = PHPExcel_Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1); + $fromOffsetX = PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->colOff); + $fromOffsetY = PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->rowOff); + $toCoordinate = PHPExcel_Cell::stringFromColumnIndex((string) $twoCellAnchor->to->col) . ($twoCellAnchor->to->row + 1); + $toOffsetX = PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->to->colOff); + $toOffsetY = PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->to->rowOff); + $graphic = $twoCellAnchor->graphicFrame->children("http://schemas.openxmlformats.org/drawingml/2006/main")->graphic; + $chartRef = $graphic->graphicData->children("http://schemas.openxmlformats.org/drawingml/2006/chart")->chart; + $thisChart = (string) $chartRef->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"); + + $chartDetails[$docSheet->getTitle().'!'.$thisChart] = array( + 'fromCoordinate' => $fromCoordinate, + 'fromOffsetX' => $fromOffsetX, + 'fromOffsetY' => $fromOffsetY, + 'toCoordinate' => $toCoordinate, + 'toOffsetX' => $toOffsetX, + 'toOffsetY' => $toOffsetY, + 'worksheetTitle' => $docSheet->getTitle() + ); + } + } + } + } + } + } + + // Loop through definedNames + if ($xmlWorkbook->definedNames) { + foreach ($xmlWorkbook->definedNames->definedName as $definedName) { + // Extract range + $extractedRange = (string)$definedName; + $extractedRange = preg_replace('/\'(\w+)\'\!/', '', $extractedRange); + if (($spos = strpos($extractedRange, '!')) !== false) { + $extractedRange = substr($extractedRange, 0, $spos).str_replace('$', '', substr($extractedRange, $spos)); + } else { + $extractedRange = str_replace('$', '', $extractedRange); + } + + // Valid range? + if (stripos((string)$definedName, '#REF!') !== false || $extractedRange == '') { + continue; + } + + // Some definedNames are only applicable if we are on the same sheet... + if ((string)$definedName['localSheetId'] != '' && (string)$definedName['localSheetId'] == $sheetId) { + // Switch on type + switch ((string)$definedName['name']) { + case '_xlnm._FilterDatabase': + if ((string)$definedName['hidden'] !== '1') { + $extractedRange = explode(',', $extractedRange); + foreach ($extractedRange as $range) { + $autoFilterRange = $range; + if (strpos($autoFilterRange, ':') !== false) { + $docSheet->getAutoFilter()->setRange($autoFilterRange); + } + } + } + break; + case '_xlnm.Print_Titles': + // Split $extractedRange + $extractedRange = explode(',', $extractedRange); + + // Set print titles + foreach ($extractedRange as $range) { + $matches = array(); + $range = str_replace('$', '', $range); + + // check for repeating columns, e g. 'A:A' or 'A:D' + if (preg_match('/!?([A-Z]+)\:([A-Z]+)$/', $range, $matches)) { + $docSheet->getPageSetup()->setColumnsToRepeatAtLeft(array($matches[1], $matches[2])); + } elseif (preg_match('/!?(\d+)\:(\d+)$/', $range, $matches)) { + // check for repeating rows, e.g. '1:1' or '1:5' + $docSheet->getPageSetup()->setRowsToRepeatAtTop(array($matches[1], $matches[2])); + } + } + break; + case '_xlnm.Print_Area': + $rangeSets = explode(',', $extractedRange); // FIXME: what if sheetname contains comma? + $newRangeSets = array(); + foreach ($rangeSets as $rangeSet) { + $range = explode('!', $rangeSet); // FIXME: what if sheetname contains exclamation mark? + $rangeSet = isset($range[1]) ? $range[1] : $range[0]; + if (strpos($rangeSet, ':') === false) { + $rangeSet = $rangeSet . ':' . $rangeSet; + } + $newRangeSets[] = str_replace('$', '', $rangeSet); + } + $docSheet->getPageSetup()->setPrintArea(implode(',', $newRangeSets)); + break; + + default: + break; + } + } + } + } + + // Next sheet id + ++$sheetId; + } + + // Loop through definedNames + if ($xmlWorkbook->definedNames) { + foreach ($xmlWorkbook->definedNames->definedName as $definedName) { + // Extract range + $extractedRange = (string)$definedName; + $extractedRange = preg_replace('/\'(\w+)\'\!/', '', $extractedRange); + if (($spos = strpos($extractedRange, '!')) !== false) { + $extractedRange = substr($extractedRange, 0, $spos).str_replace('$', '', substr($extractedRange, $spos)); + } else { + $extractedRange = str_replace('$', '', $extractedRange); + } + + // Valid range? + if (stripos((string)$definedName, '#REF!') !== false || $extractedRange == '') { + continue; + } + + // Some definedNames are only applicable if we are on the same sheet... + if ((string)$definedName['localSheetId'] != '') { + // Local defined name + // Switch on type + switch ((string)$definedName['name']) { + case '_xlnm._FilterDatabase': + case '_xlnm.Print_Titles': + case '_xlnm.Print_Area': + break; + default: + if ($mapSheetId[(integer) $definedName['localSheetId']] !== null) { + $range = explode('!', (string)$definedName); + if (count($range) == 2) { + $range[0] = str_replace("''", "'", $range[0]); + $range[0] = str_replace("'", "", $range[0]); + if ($worksheet = $docSheet->getParent()->getSheetByName($range[0])) { + $extractedRange = str_replace('$', '', $range[1]); + $scope = $docSheet->getParent()->getSheet($mapSheetId[(integer) $definedName['localSheetId']]); + $excel->addNamedRange(new PHPExcel_NamedRange((string)$definedName['name'], $worksheet, $extractedRange, true, $scope)); + } + } + } + break; + } + } elseif (!isset($definedName['localSheetId'])) { + // "Global" definedNames + $locatedSheet = null; + $extractedSheetName = ''; + if (strpos((string)$definedName, '!') !== false) { + // Extract sheet name + $extractedSheetName = PHPExcel_Worksheet::extractSheetTitle((string)$definedName, true); + $extractedSheetName = $extractedSheetName[0]; + + // Locate sheet + $locatedSheet = $excel->getSheetByName($extractedSheetName); + + // Modify range + $range = explode('!', $extractedRange); + $extractedRange = isset($range[1]) ? $range[1] : $range[0]; + } + + if ($locatedSheet !== null) { + $excel->addNamedRange(new PHPExcel_NamedRange((string)$definedName['name'], $locatedSheet, $extractedRange, false)); + } + } + } + } + } + + if ((!$this->readDataOnly) || (!empty($this->loadSheetsOnly))) { + // active sheet index + $activeTab = intval($xmlWorkbook->bookViews->workbookView["activeTab"]); // refers to old sheet index + + // keep active sheet index if sheet is still loaded, else first sheet is set as the active + if (isset($mapSheetId[$activeTab]) && $mapSheetId[$activeTab] !== null) { + $excel->setActiveSheetIndex($mapSheetId[$activeTab]); + } else { + if ($excel->getSheetCount() == 0) { + $excel->createSheet(); + } + $excel->setActiveSheetIndex(0); + } + } + break; + } + } + + if (!$this->readDataOnly) { + $contentTypes = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "[Content_Types].xml")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + foreach ($contentTypes->Override as $contentType) { + switch ($contentType["ContentType"]) { + case "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": + if ($this->includeCharts) { + $chartEntryRef = ltrim($contentType['PartName'], '/'); + $chartElements = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, $chartEntryRef)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + $objChart = PHPExcel_Reader_Excel2007_Chart::readChart($chartElements, basename($chartEntryRef, '.xml')); + +// echo 'Chart ', $chartEntryRef, '
'; +// var_dump($charts[$chartEntryRef]); +// + if (isset($charts[$chartEntryRef])) { + $chartPositionRef = $charts[$chartEntryRef]['sheet'].'!'.$charts[$chartEntryRef]['id']; +// echo 'Position Ref ', $chartPositionRef, '
'; + if (isset($chartDetails[$chartPositionRef])) { +// var_dump($chartDetails[$chartPositionRef]); + + $excel->getSheetByName($charts[$chartEntryRef]['sheet'])->addChart($objChart); + $objChart->setWorksheet($excel->getSheetByName($charts[$chartEntryRef]['sheet'])); + $objChart->setTopLeftPosition($chartDetails[$chartPositionRef]['fromCoordinate'], $chartDetails[$chartPositionRef]['fromOffsetX'], $chartDetails[$chartPositionRef]['fromOffsetY']); + $objChart->setBottomRightPosition($chartDetails[$chartPositionRef]['toCoordinate'], $chartDetails[$chartPositionRef]['toOffsetX'], $chartDetails[$chartPositionRef]['toOffsetY']); + } + } + } + } + } + } + + $zip->close(); + + return $excel; + } + + private static function readColor($color, $background = false) + { + if (isset($color["rgb"])) { + return (string)$color["rgb"]; + } elseif (isset($color["indexed"])) { + return PHPExcel_Style_Color::indexedColor($color["indexed"]-7, $background)->getARGB(); + } elseif (isset($color["theme"])) { + if (self::$theme !== null) { + $returnColour = self::$theme->getColourByIndex((int)$color["theme"]); + if (isset($color["tint"])) { + $tintAdjust = (float) $color["tint"]; + $returnColour = PHPExcel_Style_Color::changeBrightness($returnColour, $tintAdjust); + } + return 'FF'.$returnColour; + } + } + + if ($background) { + return 'FFFFFFFF'; + } + return 'FF000000'; + } + + private static function readStyle($docStyle, $style) + { + // format code +// if (isset($style->numFmt)) { +// if (isset($style->numFmt['formatCode'])) { +// $docStyle->getNumberFormat()->setFormatCode((string) $style->numFmt['formatCode']); +// } else { + $docStyle->getNumberFormat()->setFormatCode($style->numFmt); +// } +// } + + // font + if (isset($style->font)) { + $docStyle->getFont()->setName((string) $style->font->name["val"]); + $docStyle->getFont()->setSize((string) $style->font->sz["val"]); + if (isset($style->font->b)) { + $docStyle->getFont()->setBold(!isset($style->font->b["val"]) || self::boolean((string) $style->font->b["val"])); + } + if (isset($style->font->i)) { + $docStyle->getFont()->setItalic(!isset($style->font->i["val"]) || self::boolean((string) $style->font->i["val"])); + } + if (isset($style->font->strike)) { + $docStyle->getFont()->setStrikethrough(!isset($style->font->strike["val"]) || self::boolean((string) $style->font->strike["val"])); + } + $docStyle->getFont()->getColor()->setARGB(self::readColor($style->font->color)); + + if (isset($style->font->u) && !isset($style->font->u["val"])) { + $docStyle->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE); + } elseif (isset($style->font->u) && isset($style->font->u["val"])) { + $docStyle->getFont()->setUnderline((string)$style->font->u["val"]); + } + + if (isset($style->font->vertAlign) && isset($style->font->vertAlign["val"])) { + $vertAlign = strtolower((string)$style->font->vertAlign["val"]); + if ($vertAlign == 'superscript') { + $docStyle->getFont()->setSuperScript(true); + } + if ($vertAlign == 'subscript') { + $docStyle->getFont()->setSubScript(true); + } + } + } + + // fill + if (isset($style->fill)) { + if ($style->fill->gradientFill) { + $gradientFill = $style->fill->gradientFill[0]; + if (!empty($gradientFill["type"])) { + $docStyle->getFill()->setFillType((string) $gradientFill["type"]); + } + $docStyle->getFill()->setRotation(floatval($gradientFill["degree"])); + $gradientFill->registerXPathNamespace("sml", "http://schemas.openxmlformats.org/spreadsheetml/2006/main"); + $docStyle->getFill()->getStartColor()->setARGB(self::readColor(self::getArrayItem($gradientFill->xpath("sml:stop[@position=0]"))->color)); + $docStyle->getFill()->getEndColor()->setARGB(self::readColor(self::getArrayItem($gradientFill->xpath("sml:stop[@position=1]"))->color)); + } elseif ($style->fill->patternFill) { + $patternType = (string)$style->fill->patternFill["patternType"] != '' ? (string)$style->fill->patternFill["patternType"] : 'solid'; + $docStyle->getFill()->setFillType($patternType); + if ($style->fill->patternFill->fgColor) { + $docStyle->getFill()->getStartColor()->setARGB(self::readColor($style->fill->patternFill->fgColor, true)); + } else { + $docStyle->getFill()->getStartColor()->setARGB('FF000000'); + } + if ($style->fill->patternFill->bgColor) { + $docStyle->getFill()->getEndColor()->setARGB(self::readColor($style->fill->patternFill->bgColor, true)); + } + } + } + + // border + if (isset($style->border)) { + $diagonalUp = self::boolean((string) $style->border["diagonalUp"]); + $diagonalDown = self::boolean((string) $style->border["diagonalDown"]); + if (!$diagonalUp && !$diagonalDown) { + $docStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_NONE); + } elseif ($diagonalUp && !$diagonalDown) { + $docStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_UP); + } elseif (!$diagonalUp && $diagonalDown) { + $docStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_DOWN); + } else { + $docStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_BOTH); + } + self::readBorder($docStyle->getBorders()->getLeft(), $style->border->left); + self::readBorder($docStyle->getBorders()->getRight(), $style->border->right); + self::readBorder($docStyle->getBorders()->getTop(), $style->border->top); + self::readBorder($docStyle->getBorders()->getBottom(), $style->border->bottom); + self::readBorder($docStyle->getBorders()->getDiagonal(), $style->border->diagonal); + } + + // alignment + if (isset($style->alignment)) { + $docStyle->getAlignment()->setHorizontal((string) $style->alignment["horizontal"]); + $docStyle->getAlignment()->setVertical((string) $style->alignment["vertical"]); + + $textRotation = 0; + if ((int)$style->alignment["textRotation"] <= 90) { + $textRotation = (int)$style->alignment["textRotation"]; + } elseif ((int)$style->alignment["textRotation"] > 90) { + $textRotation = 90 - (int)$style->alignment["textRotation"]; + } + + $docStyle->getAlignment()->setTextRotation(intval($textRotation)); + $docStyle->getAlignment()->setWrapText(self::boolean((string) $style->alignment["wrapText"])); + $docStyle->getAlignment()->setShrinkToFit(self::boolean((string) $style->alignment["shrinkToFit"])); + $docStyle->getAlignment()->setIndent(intval((string)$style->alignment["indent"]) > 0 ? intval((string)$style->alignment["indent"]) : 0); + $docStyle->getAlignment()->setReadorder(intval((string)$style->alignment["readingOrder"]) > 0 ? intval((string)$style->alignment["readingOrder"]) : 0); + } + + // protection + if (isset($style->protection)) { + if (isset($style->protection['locked'])) { + if (self::boolean((string) $style->protection['locked'])) { + $docStyle->getProtection()->setLocked(PHPExcel_Style_Protection::PROTECTION_PROTECTED); + } else { + $docStyle->getProtection()->setLocked(PHPExcel_Style_Protection::PROTECTION_UNPROTECTED); + } + } + + if (isset($style->protection['hidden'])) { + if (self::boolean((string) $style->protection['hidden'])) { + $docStyle->getProtection()->setHidden(PHPExcel_Style_Protection::PROTECTION_PROTECTED); + } else { + $docStyle->getProtection()->setHidden(PHPExcel_Style_Protection::PROTECTION_UNPROTECTED); + } + } + } + + // top-level style settings + if (isset($style->quotePrefix)) { + $docStyle->setQuotePrefix($style->quotePrefix); + } + } + + private static function readBorder($docBorder, $eleBorder) + { + if (isset($eleBorder["style"])) { + $docBorder->setBorderStyle((string) $eleBorder["style"]); + } + if (isset($eleBorder->color)) { + $docBorder->getColor()->setARGB(self::readColor($eleBorder->color)); + } + } + + private function parseRichText($is = null) + { + $value = new PHPExcel_RichText(); + + if (isset($is->t)) { + $value->createText(PHPExcel_Shared_String::ControlCharacterOOXML2PHP((string) $is->t)); + } else { + if (is_object($is->r)) { + foreach ($is->r as $run) { + if (!isset($run->rPr)) { + $objText = $value->createText(PHPExcel_Shared_String::ControlCharacterOOXML2PHP((string) $run->t)); + + } else { + $objText = $value->createTextRun(PHPExcel_Shared_String::ControlCharacterOOXML2PHP((string) $run->t)); + + if (isset($run->rPr->rFont["val"])) { + $objText->getFont()->setName((string) $run->rPr->rFont["val"]); + } + if (isset($run->rPr->sz["val"])) { + $objText->getFont()->setSize((string) $run->rPr->sz["val"]); + } + if (isset($run->rPr->color)) { + $objText->getFont()->setColor(new PHPExcel_Style_Color(self::readColor($run->rPr->color))); + } + if ((isset($run->rPr->b["val"]) && self::boolean((string) $run->rPr->b["val"])) || + (isset($run->rPr->b) && !isset($run->rPr->b["val"]))) { + $objText->getFont()->setBold(true); + } + if ((isset($run->rPr->i["val"]) && self::boolean((string) $run->rPr->i["val"])) || + (isset($run->rPr->i) && !isset($run->rPr->i["val"]))) { + $objText->getFont()->setItalic(true); + } + if (isset($run->rPr->vertAlign) && isset($run->rPr->vertAlign["val"])) { + $vertAlign = strtolower((string)$run->rPr->vertAlign["val"]); + if ($vertAlign == 'superscript') { + $objText->getFont()->setSuperScript(true); + } + if ($vertAlign == 'subscript') { + $objText->getFont()->setSubScript(true); + } + } + if (isset($run->rPr->u) && !isset($run->rPr->u["val"])) { + $objText->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE); + } elseif (isset($run->rPr->u) && isset($run->rPr->u["val"])) { + $objText->getFont()->setUnderline((string)$run->rPr->u["val"]); + } + if ((isset($run->rPr->strike["val"]) && self::boolean((string) $run->rPr->strike["val"])) || + (isset($run->rPr->strike) && !isset($run->rPr->strike["val"]))) { + $objText->getFont()->setStrikethrough(true); + } + } + } + } + } + + return $value; + } + + private function readRibbon($excel, $customUITarget, $zip) + { + $baseDir = dirname($customUITarget); + $nameCustomUI = basename($customUITarget); + // get the xml file (ribbon) + $localRibbon = $this->getFromZipArchive($zip, $customUITarget); + $customUIImagesNames = array(); + $customUIImagesBinaries = array(); + // something like customUI/_rels/customUI.xml.rels + $pathRels = $baseDir . '/_rels/' . $nameCustomUI . '.rels'; + $dataRels = $this->getFromZipArchive($zip, $pathRels); + if ($dataRels) { + // exists and not empty if the ribbon have some pictures (other than internal MSO) + $UIRels = simplexml_load_string($this->securityScan($dataRels), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + if ($UIRels) { + // we need to save id and target to avoid parsing customUI.xml and "guess" if it's a pseudo callback who load the image + foreach ($UIRels->Relationship as $ele) { + if ($ele["Type"] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image') { + // an image ? + $customUIImagesNames[(string) $ele['Id']] = (string)$ele['Target']; + $customUIImagesBinaries[(string)$ele['Target']] = $this->getFromZipArchive($zip, $baseDir . '/' . (string) $ele['Target']); + } + } + } + } + if ($localRibbon) { + $excel->setRibbonXMLData($customUITarget, $localRibbon); + if (count($customUIImagesNames) > 0 && count($customUIImagesBinaries) > 0) { + $excel->setRibbonBinObjects($customUIImagesNames, $customUIImagesBinaries); + } else { + $excel->setRibbonBinObjects(null); + } + } else { + $excel->setRibbonXMLData(null); + $excel->setRibbonBinObjects(null); + } + } + + private static function getArrayItem($array, $key = 0) + { + return (isset($array[$key]) ? $array[$key] : null); + } + + private static function dirAdd($base, $add) + { + return preg_replace('~[^/]+/\.\./~', '', dirname($base) . "/$add"); + } + + private static function toCSSArray($style) + { + $style = str_replace(array("\r","\n"), "", $style); + + $temp = explode(';', $style); + $style = array(); + foreach ($temp as $item) { + $item = explode(':', $item); + + if (strpos($item[1], 'px') !== false) { + $item[1] = str_replace('px', '', $item[1]); + } + if (strpos($item[1], 'pt') !== false) { + $item[1] = str_replace('pt', '', $item[1]); + $item[1] = PHPExcel_Shared_Font::fontSizeToPixels($item[1]); + } + if (strpos($item[1], 'in') !== false) { + $item[1] = str_replace('in', '', $item[1]); + $item[1] = PHPExcel_Shared_Font::inchSizeToPixels($item[1]); + } + if (strpos($item[1], 'cm') !== false) { + $item[1] = str_replace('cm', '', $item[1]); + $item[1] = PHPExcel_Shared_Font::centimeterSizeToPixels($item[1]); + } + + $style[$item[0]] = $item[1]; + } + + return $style; + } + + private static function boolean($value = null) + { + if (is_object($value)) { + $value = (string) $value; + } + if (is_numeric($value)) { + return (bool) $value; + } + return ($value === 'true' || $value === 'TRUE'); + } +} diff --git a/extend/PHPExcel/PHPExcel/Reader/Excel2007/Chart.php b/extend/PHPExcel/PHPExcel/Reader/Excel2007/Chart.php new file mode 100644 index 0000000..590bf2d --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Excel2007/Chart.php @@ -0,0 +1,520 @@ +attributes(); + if (isset($attributes[$name])) { + if ($format == 'string') { + return (string) $attributes[$name]; + } elseif ($format == 'integer') { + return (integer) $attributes[$name]; + } elseif ($format == 'boolean') { + return (boolean) ($attributes[$name] === '0' || $attributes[$name] !== 'true') ? false : true; + } else { + return (float) $attributes[$name]; + } + } + return null; + } + + + private static function readColor($color, $background = false) + { + if (isset($color["rgb"])) { + return (string)$color["rgb"]; + } elseif (isset($color["indexed"])) { + return PHPExcel_Style_Color::indexedColor($color["indexed"]-7, $background)->getARGB(); + } + } + + public static function readChart($chartElements, $chartName) + { + $namespacesChartMeta = $chartElements->getNamespaces(true); + $chartElementsC = $chartElements->children($namespacesChartMeta['c']); + + $XaxisLabel = $YaxisLabel = $legend = $title = null; + $dispBlanksAs = $plotVisOnly = null; + + foreach ($chartElementsC as $chartElementKey => $chartElement) { + switch ($chartElementKey) { + case "chart": + foreach ($chartElement as $chartDetailsKey => $chartDetails) { + $chartDetailsC = $chartDetails->children($namespacesChartMeta['c']); + switch ($chartDetailsKey) { + case "plotArea": + $plotAreaLayout = $XaxisLable = $YaxisLable = null; + $plotSeries = $plotAttributes = array(); + foreach ($chartDetails as $chartDetailKey => $chartDetail) { + switch ($chartDetailKey) { + case "layout": + $plotAreaLayout = self::chartLayoutDetails($chartDetail, $namespacesChartMeta, 'plotArea'); + break; + case "catAx": + if (isset($chartDetail->title)) { + $XaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta, 'cat'); + } + break; + case "dateAx": + if (isset($chartDetail->title)) { + $XaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta, 'cat'); + } + break; + case "valAx": + if (isset($chartDetail->title)) { + $YaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta, 'cat'); + } + break; + case "barChart": + case "bar3DChart": + $barDirection = self::getAttribute($chartDetail->barDir, 'val', 'string'); + $plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); + $plotSer->setPlotDirection($barDirection); + $plotSeries[] = $plotSer; + $plotAttributes = self::readChartAttributes($chartDetail); + break; + case "lineChart": + case "line3DChart": + $plotSeries[] = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); + $plotAttributes = self::readChartAttributes($chartDetail); + break; + case "areaChart": + case "area3DChart": + $plotSeries[] = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); + $plotAttributes = self::readChartAttributes($chartDetail); + break; + case "doughnutChart": + case "pieChart": + case "pie3DChart": + $explosion = isset($chartDetail->ser->explosion); + $plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); + $plotSer->setPlotStyle($explosion); + $plotSeries[] = $plotSer; + $plotAttributes = self::readChartAttributes($chartDetail); + break; + case "scatterChart": + $scatterStyle = self::getAttribute($chartDetail->scatterStyle, 'val', 'string'); + $plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); + $plotSer->setPlotStyle($scatterStyle); + $plotSeries[] = $plotSer; + $plotAttributes = self::readChartAttributes($chartDetail); + break; + case "bubbleChart": + $bubbleScale = self::getAttribute($chartDetail->bubbleScale, 'val', 'integer'); + $plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); + $plotSer->setPlotStyle($bubbleScale); + $plotSeries[] = $plotSer; + $plotAttributes = self::readChartAttributes($chartDetail); + break; + case "radarChart": + $radarStyle = self::getAttribute($chartDetail->radarStyle, 'val', 'string'); + $plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); + $plotSer->setPlotStyle($radarStyle); + $plotSeries[] = $plotSer; + $plotAttributes = self::readChartAttributes($chartDetail); + break; + case "surfaceChart": + case "surface3DChart": + $wireFrame = self::getAttribute($chartDetail->wireframe, 'val', 'boolean'); + $plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); + $plotSer->setPlotStyle($wireFrame); + $plotSeries[] = $plotSer; + $plotAttributes = self::readChartAttributes($chartDetail); + break; + case "stockChart": + $plotSeries[] = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); + $plotAttributes = self::readChartAttributes($plotAreaLayout); + break; + } + } + if ($plotAreaLayout == null) { + $plotAreaLayout = new PHPExcel_Chart_Layout(); + } + $plotArea = new PHPExcel_Chart_PlotArea($plotAreaLayout, $plotSeries); + self::setChartAttributes($plotAreaLayout, $plotAttributes); + break; + case "plotVisOnly": + $plotVisOnly = self::getAttribute($chartDetails, 'val', 'string'); + break; + case "dispBlanksAs": + $dispBlanksAs = self::getAttribute($chartDetails, 'val', 'string'); + break; + case "title": + $title = self::chartTitle($chartDetails, $namespacesChartMeta, 'title'); + break; + case "legend": + $legendPos = 'r'; + $legendLayout = null; + $legendOverlay = false; + foreach ($chartDetails as $chartDetailKey => $chartDetail) { + switch ($chartDetailKey) { + case "legendPos": + $legendPos = self::getAttribute($chartDetail, 'val', 'string'); + break; + case "overlay": + $legendOverlay = self::getAttribute($chartDetail, 'val', 'boolean'); + break; + case "layout": + $legendLayout = self::chartLayoutDetails($chartDetail, $namespacesChartMeta, 'legend'); + break; + } + } + $legend = new PHPExcel_Chart_Legend($legendPos, $legendLayout, $legendOverlay); + break; + } + } + } + } + $chart = new PHPExcel_Chart($chartName, $title, $legend, $plotArea, $plotVisOnly, $dispBlanksAs, $XaxisLabel, $YaxisLabel); + + return $chart; + } + + private static function chartTitle($titleDetails, $namespacesChartMeta, $type) + { + $caption = array(); + $titleLayout = null; + foreach ($titleDetails as $titleDetailKey => $chartDetail) { + switch ($titleDetailKey) { + case "tx": + $titleDetails = $chartDetail->rich->children($namespacesChartMeta['a']); + foreach ($titleDetails as $titleKey => $titleDetail) { + switch ($titleKey) { + case "p": + $titleDetailPart = $titleDetail->children($namespacesChartMeta['a']); + $caption[] = self::parseRichText($titleDetailPart); + } + } + break; + case "layout": + $titleLayout = self::chartLayoutDetails($chartDetail, $namespacesChartMeta); + break; + } + } + + return new PHPExcel_Chart_Title($caption, $titleLayout); + } + + private static function chartLayoutDetails($chartDetail, $namespacesChartMeta) + { + if (!isset($chartDetail->manualLayout)) { + return null; + } + $details = $chartDetail->manualLayout->children($namespacesChartMeta['c']); + if (is_null($details)) { + return null; + } + $layout = array(); + foreach ($details as $detailKey => $detail) { +// echo $detailKey, ' => ',self::getAttribute($detail, 'val', 'string'),PHP_EOL; + $layout[$detailKey] = self::getAttribute($detail, 'val', 'string'); + } + return new PHPExcel_Chart_Layout($layout); + } + + private static function chartDataSeries($chartDetail, $namespacesChartMeta, $plotType) + { + $multiSeriesType = null; + $smoothLine = false; + $seriesLabel = $seriesCategory = $seriesValues = $plotOrder = array(); + + $seriesDetailSet = $chartDetail->children($namespacesChartMeta['c']); + foreach ($seriesDetailSet as $seriesDetailKey => $seriesDetails) { + switch ($seriesDetailKey) { + case "grouping": + $multiSeriesType = self::getAttribute($chartDetail->grouping, 'val', 'string'); + break; + case "ser": + $marker = null; + foreach ($seriesDetails as $seriesKey => $seriesDetail) { + switch ($seriesKey) { + case "idx": + $seriesIndex = self::getAttribute($seriesDetail, 'val', 'integer'); + break; + case "order": + $seriesOrder = self::getAttribute($seriesDetail, 'val', 'integer'); + $plotOrder[$seriesIndex] = $seriesOrder; + break; + case "tx": + $seriesLabel[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta); + break; + case "marker": + $marker = self::getAttribute($seriesDetail->symbol, 'val', 'string'); + break; + case "smooth": + $smoothLine = self::getAttribute($seriesDetail, 'val', 'boolean'); + break; + case "cat": + $seriesCategory[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta); + break; + case "val": + $seriesValues[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker); + break; + case "xVal": + $seriesCategory[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker); + break; + case "yVal": + $seriesValues[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker); + break; + } + } + } + } + return new PHPExcel_Chart_DataSeries($plotType, $multiSeriesType, $plotOrder, $seriesLabel, $seriesCategory, $seriesValues, $smoothLine); + } + + + private static function chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker = null, $smoothLine = false) + { + if (isset($seriesDetail->strRef)) { + $seriesSource = (string) $seriesDetail->strRef->f; + $seriesData = self::chartDataSeriesValues($seriesDetail->strRef->strCache->children($namespacesChartMeta['c']), 's'); + + return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); + } elseif (isset($seriesDetail->numRef)) { + $seriesSource = (string) $seriesDetail->numRef->f; + $seriesData = self::chartDataSeriesValues($seriesDetail->numRef->numCache->children($namespacesChartMeta['c'])); + + return new PHPExcel_Chart_DataSeriesValues('Number', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); + } elseif (isset($seriesDetail->multiLvlStrRef)) { + $seriesSource = (string) $seriesDetail->multiLvlStrRef->f; + $seriesData = self::chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlStrRef->multiLvlStrCache->children($namespacesChartMeta['c']), 's'); + $seriesData['pointCount'] = count($seriesData['dataValues']); + + return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); + } elseif (isset($seriesDetail->multiLvlNumRef)) { + $seriesSource = (string) $seriesDetail->multiLvlNumRef->f; + $seriesData = self::chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlNumRef->multiLvlNumCache->children($namespacesChartMeta['c']), 's'); + $seriesData['pointCount'] = count($seriesData['dataValues']); + + return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); + } + return null; + } + + + private static function chartDataSeriesValues($seriesValueSet, $dataType = 'n') + { + $seriesVal = array(); + $formatCode = ''; + $pointCount = 0; + + foreach ($seriesValueSet as $seriesValueIdx => $seriesValue) { + switch ($seriesValueIdx) { + case 'ptCount': + $pointCount = self::getAttribute($seriesValue, 'val', 'integer'); + break; + case 'formatCode': + $formatCode = (string) $seriesValue; + break; + case 'pt': + $pointVal = self::getAttribute($seriesValue, 'idx', 'integer'); + if ($dataType == 's') { + $seriesVal[$pointVal] = (string) $seriesValue->v; + } else { + $seriesVal[$pointVal] = (float) $seriesValue->v; + } + break; + } + } + + return array( + 'formatCode' => $formatCode, + 'pointCount' => $pointCount, + 'dataValues' => $seriesVal + ); + } + + private static function chartDataSeriesValuesMultiLevel($seriesValueSet, $dataType = 'n') + { + $seriesVal = array(); + $formatCode = ''; + $pointCount = 0; + + foreach ($seriesValueSet->lvl as $seriesLevelIdx => $seriesLevel) { + foreach ($seriesLevel as $seriesValueIdx => $seriesValue) { + switch ($seriesValueIdx) { + case 'ptCount': + $pointCount = self::getAttribute($seriesValue, 'val', 'integer'); + break; + case 'formatCode': + $formatCode = (string) $seriesValue; + break; + case 'pt': + $pointVal = self::getAttribute($seriesValue, 'idx', 'integer'); + if ($dataType == 's') { + $seriesVal[$pointVal][] = (string) $seriesValue->v; + } else { + $seriesVal[$pointVal][] = (float) $seriesValue->v; + } + break; + } + } + } + + return array( + 'formatCode' => $formatCode, + 'pointCount' => $pointCount, + 'dataValues' => $seriesVal + ); + } + + private static function parseRichText($titleDetailPart = null) + { + $value = new PHPExcel_RichText(); + + foreach ($titleDetailPart as $titleDetailElementKey => $titleDetailElement) { + if (isset($titleDetailElement->t)) { + $objText = $value->createTextRun((string) $titleDetailElement->t); + } + if (isset($titleDetailElement->rPr)) { + if (isset($titleDetailElement->rPr->rFont["val"])) { + $objText->getFont()->setName((string) $titleDetailElement->rPr->rFont["val"]); + } + + $fontSize = (self::getAttribute($titleDetailElement->rPr, 'sz', 'integer')); + if (!is_null($fontSize)) { + $objText->getFont()->setSize(floor($fontSize / 100)); + } + + $fontColor = (self::getAttribute($titleDetailElement->rPr, 'color', 'string')); + if (!is_null($fontColor)) { + $objText->getFont()->setColor(new PHPExcel_Style_Color(self::readColor($fontColor))); + } + + $bold = self::getAttribute($titleDetailElement->rPr, 'b', 'boolean'); + if (!is_null($bold)) { + $objText->getFont()->setBold($bold); + } + + $italic = self::getAttribute($titleDetailElement->rPr, 'i', 'boolean'); + if (!is_null($italic)) { + $objText->getFont()->setItalic($italic); + } + + $baseline = self::getAttribute($titleDetailElement->rPr, 'baseline', 'integer'); + if (!is_null($baseline)) { + if ($baseline > 0) { + $objText->getFont()->setSuperScript(true); + } elseif ($baseline < 0) { + $objText->getFont()->setSubScript(true); + } + } + + $underscore = (self::getAttribute($titleDetailElement->rPr, 'u', 'string')); + if (!is_null($underscore)) { + if ($underscore == 'sng') { + $objText->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE); + } elseif ($underscore == 'dbl') { + $objText->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_DOUBLE); + } else { + $objText->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_NONE); + } + } + + $strikethrough = (self::getAttribute($titleDetailElement->rPr, 's', 'string')); + if (!is_null($strikethrough)) { + if ($strikethrough == 'noStrike') { + $objText->getFont()->setStrikethrough(false); + } else { + $objText->getFont()->setStrikethrough(true); + } + } + } + } + + return $value; + } + + private static function readChartAttributes($chartDetail) + { + $plotAttributes = array(); + if (isset($chartDetail->dLbls)) { + if (isset($chartDetail->dLbls->howLegendKey)) { + $plotAttributes['showLegendKey'] = self::getAttribute($chartDetail->dLbls->showLegendKey, 'val', 'string'); + } + if (isset($chartDetail->dLbls->showVal)) { + $plotAttributes['showVal'] = self::getAttribute($chartDetail->dLbls->showVal, 'val', 'string'); + } + if (isset($chartDetail->dLbls->showCatName)) { + $plotAttributes['showCatName'] = self::getAttribute($chartDetail->dLbls->showCatName, 'val', 'string'); + } + if (isset($chartDetail->dLbls->showSerName)) { + $plotAttributes['showSerName'] = self::getAttribute($chartDetail->dLbls->showSerName, 'val', 'string'); + } + if (isset($chartDetail->dLbls->showPercent)) { + $plotAttributes['showPercent'] = self::getAttribute($chartDetail->dLbls->showPercent, 'val', 'string'); + } + if (isset($chartDetail->dLbls->showBubbleSize)) { + $plotAttributes['showBubbleSize'] = self::getAttribute($chartDetail->dLbls->showBubbleSize, 'val', 'string'); + } + if (isset($chartDetail->dLbls->showLeaderLines)) { + $plotAttributes['showLeaderLines'] = self::getAttribute($chartDetail->dLbls->showLeaderLines, 'val', 'string'); + } + } + + return $plotAttributes; + } + + private static function setChartAttributes($plotArea, $plotAttributes) + { + foreach ($plotAttributes as $plotAttributeKey => $plotAttributeValue) { + switch ($plotAttributeKey) { + case 'showLegendKey': + $plotArea->setShowLegendKey($plotAttributeValue); + break; + case 'showVal': + $plotArea->setShowVal($plotAttributeValue); + break; + case 'showCatName': + $plotArea->setShowCatName($plotAttributeValue); + break; + case 'showSerName': + $plotArea->setShowSerName($plotAttributeValue); + break; + case 'showPercent': + $plotArea->setShowPercent($plotAttributeValue); + break; + case 'showBubbleSize': + $plotArea->setShowBubbleSize($plotAttributeValue); + break; + case 'showLeaderLines': + $plotArea->setShowLeaderLines($plotAttributeValue); + break; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Reader/Excel2007/Theme.php b/extend/PHPExcel/PHPExcel/Reader/Excel2007/Theme.php new file mode 100644 index 0000000..134f4b6 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Excel2007/Theme.php @@ -0,0 +1,127 @@ +themeName = $themeName; + $this->colourSchemeName = $colourSchemeName; + $this->colourMap = $colourMap; + } + + /** + * Get Theme Name + * + * @return string + */ + public function getThemeName() + { + return $this->themeName; + } + + /** + * Get colour Scheme Name + * + * @return string + */ + public function getColourSchemeName() + { + return $this->colourSchemeName; + } + + /** + * Get colour Map Value by Position + * + * @return string + */ + public function getColourByIndex($index = 0) + { + if (isset($this->colourMap[$index])) { + return $this->colourMap[$index]; + } + return null; + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if ((is_object($value)) && ($key != '_parent')) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Reader/Excel5.php b/extend/PHPExcel/PHPExcel/Reader/Excel5.php new file mode 100644 index 0000000..62e971d --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Excel5.php @@ -0,0 +1,7594 @@ +data + * + * @var int + */ + private $dataSize; + + /** + * Current position in stream + * + * @var integer + */ + private $pos; + + /** + * Workbook to be returned by the reader. + * + * @var PHPExcel + */ + private $phpExcel; + + /** + * Worksheet that is currently being built by the reader. + * + * @var PHPExcel_Worksheet + */ + private $phpSheet; + + /** + * BIFF version + * + * @var int + */ + private $version; + + /** + * Codepage set in the Excel file being read. Only important for BIFF5 (Excel 5.0 - Excel 95) + * For BIFF8 (Excel 97 - Excel 2003) this will always have the value 'UTF-16LE' + * + * @var string + */ + private $codepage; + + /** + * Shared formats + * + * @var array + */ + private $formats; + + /** + * Shared fonts + * + * @var array + */ + private $objFonts; + + /** + * Color palette + * + * @var array + */ + private $palette; + + /** + * Worksheets + * + * @var array + */ + private $sheets; + + /** + * External books + * + * @var array + */ + private $externalBooks; + + /** + * REF structures. Only applies to BIFF8. + * + * @var array + */ + private $ref; + + /** + * External names + * + * @var array + */ + private $externalNames; + + /** + * Defined names + * + * @var array + */ + private $definedname; + + /** + * Shared strings. Only applies to BIFF8. + * + * @var array + */ + private $sst; + + /** + * Panes are frozen? (in sheet currently being read). See WINDOW2 record. + * + * @var boolean + */ + private $frozen; + + /** + * Fit printout to number of pages? (in sheet currently being read). See SHEETPR record. + * + * @var boolean + */ + private $isFitToPages; + + /** + * Objects. One OBJ record contributes with one entry. + * + * @var array + */ + private $objs; + + /** + * Text Objects. One TXO record corresponds with one entry. + * + * @var array + */ + private $textObjects; + + /** + * Cell Annotations (BIFF8) + * + * @var array + */ + private $cellNotes; + + /** + * The combined MSODRAWINGGROUP data + * + * @var string + */ + private $drawingGroupData; + + /** + * The combined MSODRAWING data (per sheet) + * + * @var string + */ + private $drawingData; + + /** + * Keep track of XF index + * + * @var int + */ + private $xfIndex; + + /** + * Mapping of XF index (that is a cell XF) to final index in cellXf collection + * + * @var array + */ + private $mapCellXfIndex; + + /** + * Mapping of XF index (that is a style XF) to final index in cellStyleXf collection + * + * @var array + */ + private $mapCellStyleXfIndex; + + /** + * The shared formulas in a sheet. One SHAREDFMLA record contributes with one value. + * + * @var array + */ + private $sharedFormulas; + + /** + * The shared formula parts in a sheet. One FORMULA record contributes with one value if it + * refers to a shared formula. + * + * @var array + */ + private $sharedFormulaParts; + + /** + * The type of encryption in use + * + * @var int + */ + private $encryption = 0; + + /** + * The position in the stream after which contents are encrypted + * + * @var int + */ + private $encryptionStartPos = false; + + /** + * The current RC4 decryption object + * + * @var PHPExcel_Reader_Excel5_RC4 + */ + private $rc4Key = null; + + /** + * The position in the stream that the RC4 decryption object was left at + * + * @var int + */ + private $rc4Pos = 0; + + /** + * The current MD5 context state + * + * @var string + */ + private $md5Ctxt = null; + + /** + * Create a new PHPExcel_Reader_Excel5 instance + */ + public function __construct() + { + $this->readFilter = new PHPExcel_Reader_DefaultReadFilter(); + } + + /** + * Can the current PHPExcel_Reader_IReader read the file? + * + * @param string $pFilename + * @return boolean + * @throws PHPExcel_Reader_Exception + */ + public function canRead($pFilename) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + try { + // Use ParseXL for the hard work. + $ole = new PHPExcel_Shared_OLERead(); + + // get excel data + $res = $ole->read($pFilename); + return true; + } catch (PHPExcel_Exception $e) { + return false; + } + } + + /** + * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object + * + * @param string $pFilename + * @throws PHPExcel_Reader_Exception + */ + public function listWorksheetNames($pFilename) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + $worksheetNames = array(); + + // Read the OLE file + $this->loadOLE($pFilename); + + // total byte size of Excel data (workbook global substream + sheet substreams) + $this->dataSize = strlen($this->data); + + $this->pos = 0; + $this->sheets = array(); + + // Parse Workbook Global Substream + while ($this->pos < $this->dataSize) { + $code = self::getInt2d($this->data, $this->pos); + + switch ($code) { + case self::XLS_TYPE_BOF: + $this->readBof(); + break; + case self::XLS_TYPE_SHEET: + $this->readSheet(); + break; + case self::XLS_TYPE_EOF: + $this->readDefault(); + break 2; + default: + $this->readDefault(); + break; + } + } + + foreach ($this->sheets as $sheet) { + if ($sheet['sheetType'] != 0x00) { + // 0x00: Worksheet, 0x02: Chart, 0x06: Visual Basic module + continue; + } + + $worksheetNames[] = $sheet['name']; + } + + return $worksheetNames; + } + + + /** + * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns) + * + * @param string $pFilename + * @throws PHPExcel_Reader_Exception + */ + public function listWorksheetInfo($pFilename) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + $worksheetInfo = array(); + + // Read the OLE file + $this->loadOLE($pFilename); + + // total byte size of Excel data (workbook global substream + sheet substreams) + $this->dataSize = strlen($this->data); + + // initialize + $this->pos = 0; + $this->sheets = array(); + + // Parse Workbook Global Substream + while ($this->pos < $this->dataSize) { + $code = self::getInt2d($this->data, $this->pos); + + switch ($code) { + case self::XLS_TYPE_BOF: + $this->readBof(); + break; + case self::XLS_TYPE_SHEET: + $this->readSheet(); + break; + case self::XLS_TYPE_EOF: + $this->readDefault(); + break 2; + default: + $this->readDefault(); + break; + } + } + + // Parse the individual sheets + foreach ($this->sheets as $sheet) { + if ($sheet['sheetType'] != 0x00) { + // 0x00: Worksheet + // 0x02: Chart + // 0x06: Visual Basic module + continue; + } + + $tmpInfo = array(); + $tmpInfo['worksheetName'] = $sheet['name']; + $tmpInfo['lastColumnLetter'] = 'A'; + $tmpInfo['lastColumnIndex'] = 0; + $tmpInfo['totalRows'] = 0; + $tmpInfo['totalColumns'] = 0; + + $this->pos = $sheet['offset']; + + while ($this->pos <= $this->dataSize - 4) { + $code = self::getInt2d($this->data, $this->pos); + + switch ($code) { + case self::XLS_TYPE_RK: + case self::XLS_TYPE_LABELSST: + case self::XLS_TYPE_NUMBER: + case self::XLS_TYPE_FORMULA: + case self::XLS_TYPE_BOOLERR: + case self::XLS_TYPE_LABEL: + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + $rowIndex = self::getInt2d($recordData, 0) + 1; + $columnIndex = self::getInt2d($recordData, 2); + + $tmpInfo['totalRows'] = max($tmpInfo['totalRows'], $rowIndex); + $tmpInfo['lastColumnIndex'] = max($tmpInfo['lastColumnIndex'], $columnIndex); + break; + case self::XLS_TYPE_BOF: + $this->readBof(); + break; + case self::XLS_TYPE_EOF: + $this->readDefault(); + break 2; + default: + $this->readDefault(); + break; + } + } + + $tmpInfo['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); + $tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1; + + $worksheetInfo[] = $tmpInfo; + } + + return $worksheetInfo; + } + + + /** + * Loads PHPExcel from file + * + * @param string $pFilename + * @return PHPExcel + * @throws PHPExcel_Reader_Exception + */ + public function load($pFilename) + { + // Read the OLE file + $this->loadOLE($pFilename); + + // Initialisations + $this->phpExcel = new PHPExcel; + $this->phpExcel->removeSheetByIndex(0); // remove 1st sheet + if (!$this->readDataOnly) { + $this->phpExcel->removeCellStyleXfByIndex(0); // remove the default style + $this->phpExcel->removeCellXfByIndex(0); // remove the default style + } + + // Read the summary information stream (containing meta data) + $this->readSummaryInformation(); + + // Read the Additional document summary information stream (containing application-specific meta data) + $this->readDocumentSummaryInformation(); + + // total byte size of Excel data (workbook global substream + sheet substreams) + $this->dataSize = strlen($this->data); + + // initialize + $this->pos = 0; + $this->codepage = 'CP1252'; + $this->formats = array(); + $this->objFonts = array(); + $this->palette = array(); + $this->sheets = array(); + $this->externalBooks = array(); + $this->ref = array(); + $this->definedname = array(); + $this->sst = array(); + $this->drawingGroupData = ''; + $this->xfIndex = ''; + $this->mapCellXfIndex = array(); + $this->mapCellStyleXfIndex = array(); + + // Parse Workbook Global Substream + while ($this->pos < $this->dataSize) { + $code = self::getInt2d($this->data, $this->pos); + + switch ($code) { + case self::XLS_TYPE_BOF: + $this->readBof(); + break; + case self::XLS_TYPE_FILEPASS: + $this->readFilepass(); + break; + case self::XLS_TYPE_CODEPAGE: + $this->readCodepage(); + break; + case self::XLS_TYPE_DATEMODE: + $this->readDateMode(); + break; + case self::XLS_TYPE_FONT: + $this->readFont(); + break; + case self::XLS_TYPE_FORMAT: + $this->readFormat(); + break; + case self::XLS_TYPE_XF: + $this->readXf(); + break; + case self::XLS_TYPE_XFEXT: + $this->readXfExt(); + break; + case self::XLS_TYPE_STYLE: + $this->readStyle(); + break; + case self::XLS_TYPE_PALETTE: + $this->readPalette(); + break; + case self::XLS_TYPE_SHEET: + $this->readSheet(); + break; + case self::XLS_TYPE_EXTERNALBOOK: + $this->readExternalBook(); + break; + case self::XLS_TYPE_EXTERNNAME: + $this->readExternName(); + break; + case self::XLS_TYPE_EXTERNSHEET: + $this->readExternSheet(); + break; + case self::XLS_TYPE_DEFINEDNAME: + $this->readDefinedName(); + break; + case self::XLS_TYPE_MSODRAWINGGROUP: + $this->readMsoDrawingGroup(); + break; + case self::XLS_TYPE_SST: + $this->readSst(); + break; + case self::XLS_TYPE_EOF: + $this->readDefault(); + break 2; + default: + $this->readDefault(); + break; + } + } + + // Resolve indexed colors for font, fill, and border colors + // Cannot be resolved already in XF record, because PALETTE record comes afterwards + if (!$this->readDataOnly) { + foreach ($this->objFonts as $objFont) { + if (isset($objFont->colorIndex)) { + $color = PHPExcel_Reader_Excel5_Color::map($objFont->colorIndex, $this->palette, $this->version); + $objFont->getColor()->setRGB($color['rgb']); + } + } + + foreach ($this->phpExcel->getCellXfCollection() as $objStyle) { + // fill start and end color + $fill = $objStyle->getFill(); + + if (isset($fill->startcolorIndex)) { + $startColor = PHPExcel_Reader_Excel5_Color::map($fill->startcolorIndex, $this->palette, $this->version); + $fill->getStartColor()->setRGB($startColor['rgb']); + } + if (isset($fill->endcolorIndex)) { + $endColor = PHPExcel_Reader_Excel5_Color::map($fill->endcolorIndex, $this->palette, $this->version); + $fill->getEndColor()->setRGB($endColor['rgb']); + } + + // border colors + $top = $objStyle->getBorders()->getTop(); + $right = $objStyle->getBorders()->getRight(); + $bottom = $objStyle->getBorders()->getBottom(); + $left = $objStyle->getBorders()->getLeft(); + $diagonal = $objStyle->getBorders()->getDiagonal(); + + if (isset($top->colorIndex)) { + $borderTopColor = PHPExcel_Reader_Excel5_Color::map($top->colorIndex, $this->palette, $this->version); + $top->getColor()->setRGB($borderTopColor['rgb']); + } + if (isset($right->colorIndex)) { + $borderRightColor = PHPExcel_Reader_Excel5_Color::map($right->colorIndex, $this->palette, $this->version); + $right->getColor()->setRGB($borderRightColor['rgb']); + } + if (isset($bottom->colorIndex)) { + $borderBottomColor = PHPExcel_Reader_Excel5_Color::map($bottom->colorIndex, $this->palette, $this->version); + $bottom->getColor()->setRGB($borderBottomColor['rgb']); + } + if (isset($left->colorIndex)) { + $borderLeftColor = PHPExcel_Reader_Excel5_Color::map($left->colorIndex, $this->palette, $this->version); + $left->getColor()->setRGB($borderLeftColor['rgb']); + } + if (isset($diagonal->colorIndex)) { + $borderDiagonalColor = PHPExcel_Reader_Excel5_Color::map($diagonal->colorIndex, $this->palette, $this->version); + $diagonal->getColor()->setRGB($borderDiagonalColor['rgb']); + } + } + } + + // treat MSODRAWINGGROUP records, workbook-level Escher + if (!$this->readDataOnly && $this->drawingGroupData) { + $escherWorkbook = new PHPExcel_Shared_Escher(); + $reader = new PHPExcel_Reader_Excel5_Escher($escherWorkbook); + $escherWorkbook = $reader->load($this->drawingGroupData); + + // debug Escher stream + //$debug = new Debug_Escher(new PHPExcel_Shared_Escher()); + //$debug->load($this->drawingGroupData); + } + + // Parse the individual sheets + foreach ($this->sheets as $sheet) { + if ($sheet['sheetType'] != 0x00) { + // 0x00: Worksheet, 0x02: Chart, 0x06: Visual Basic module + continue; + } + + // check if sheet should be skipped + if (isset($this->loadSheetsOnly) && !in_array($sheet['name'], $this->loadSheetsOnly)) { + continue; + } + + // add sheet to PHPExcel object + $this->phpSheet = $this->phpExcel->createSheet(); + // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in formula + // cells... during the load, all formulae should be correct, and we're simply bringing the worksheet + // name in line with the formula, not the reverse + $this->phpSheet->setTitle($sheet['name'], false); + $this->phpSheet->setSheetState($sheet['sheetState']); + + $this->pos = $sheet['offset']; + + // Initialize isFitToPages. May change after reading SHEETPR record. + $this->isFitToPages = false; + + // Initialize drawingData + $this->drawingData = ''; + + // Initialize objs + $this->objs = array(); + + // Initialize shared formula parts + $this->sharedFormulaParts = array(); + + // Initialize shared formulas + $this->sharedFormulas = array(); + + // Initialize text objs + $this->textObjects = array(); + + // Initialize cell annotations + $this->cellNotes = array(); + $this->textObjRef = -1; + + while ($this->pos <= $this->dataSize - 4) { + $code = self::getInt2d($this->data, $this->pos); + + switch ($code) { + case self::XLS_TYPE_BOF: + $this->readBof(); + break; + case self::XLS_TYPE_PRINTGRIDLINES: + $this->readPrintGridlines(); + break; + case self::XLS_TYPE_DEFAULTROWHEIGHT: + $this->readDefaultRowHeight(); + break; + case self::XLS_TYPE_SHEETPR: + $this->readSheetPr(); + break; + case self::XLS_TYPE_HORIZONTALPAGEBREAKS: + $this->readHorizontalPageBreaks(); + break; + case self::XLS_TYPE_VERTICALPAGEBREAKS: + $this->readVerticalPageBreaks(); + break; + case self::XLS_TYPE_HEADER: + $this->readHeader(); + break; + case self::XLS_TYPE_FOOTER: + $this->readFooter(); + break; + case self::XLS_TYPE_HCENTER: + $this->readHcenter(); + break; + case self::XLS_TYPE_VCENTER: + $this->readVcenter(); + break; + case self::XLS_TYPE_LEFTMARGIN: + $this->readLeftMargin(); + break; + case self::XLS_TYPE_RIGHTMARGIN: + $this->readRightMargin(); + break; + case self::XLS_TYPE_TOPMARGIN: + $this->readTopMargin(); + break; + case self::XLS_TYPE_BOTTOMMARGIN: + $this->readBottomMargin(); + break; + case self::XLS_TYPE_PAGESETUP: + $this->readPageSetup(); + break; + case self::XLS_TYPE_PROTECT: + $this->readProtect(); + break; + case self::XLS_TYPE_SCENPROTECT: + $this->readScenProtect(); + break; + case self::XLS_TYPE_OBJECTPROTECT: + $this->readObjectProtect(); + break; + case self::XLS_TYPE_PASSWORD: + $this->readPassword(); + break; + case self::XLS_TYPE_DEFCOLWIDTH: + $this->readDefColWidth(); + break; + case self::XLS_TYPE_COLINFO: + $this->readColInfo(); + break; + case self::XLS_TYPE_DIMENSION: + $this->readDefault(); + break; + case self::XLS_TYPE_ROW: + $this->readRow(); + break; + case self::XLS_TYPE_DBCELL: + $this->readDefault(); + break; + case self::XLS_TYPE_RK: + $this->readRk(); + break; + case self::XLS_TYPE_LABELSST: + $this->readLabelSst(); + break; + case self::XLS_TYPE_MULRK: + $this->readMulRk(); + break; + case self::XLS_TYPE_NUMBER: + $this->readNumber(); + break; + case self::XLS_TYPE_FORMULA: + $this->readFormula(); + break; + case self::XLS_TYPE_SHAREDFMLA: + $this->readSharedFmla(); + break; + case self::XLS_TYPE_BOOLERR: + $this->readBoolErr(); + break; + case self::XLS_TYPE_MULBLANK: + $this->readMulBlank(); + break; + case self::XLS_TYPE_LABEL: + $this->readLabel(); + break; + case self::XLS_TYPE_BLANK: + $this->readBlank(); + break; + case self::XLS_TYPE_MSODRAWING: + $this->readMsoDrawing(); + break; + case self::XLS_TYPE_OBJ: + $this->readObj(); + break; + case self::XLS_TYPE_WINDOW2: + $this->readWindow2(); + break; + case self::XLS_TYPE_PAGELAYOUTVIEW: + $this->readPageLayoutView(); + break; + case self::XLS_TYPE_SCL: + $this->readScl(); + break; + case self::XLS_TYPE_PANE: + $this->readPane(); + break; + case self::XLS_TYPE_SELECTION: + $this->readSelection(); + break; + case self::XLS_TYPE_MERGEDCELLS: + $this->readMergedCells(); + break; + case self::XLS_TYPE_HYPERLINK: + $this->readHyperLink(); + break; + case self::XLS_TYPE_DATAVALIDATIONS: + $this->readDataValidations(); + break; + case self::XLS_TYPE_DATAVALIDATION: + $this->readDataValidation(); + break; + case self::XLS_TYPE_SHEETLAYOUT: + $this->readSheetLayout(); + break; + case self::XLS_TYPE_SHEETPROTECTION: + $this->readSheetProtection(); + break; + case self::XLS_TYPE_RANGEPROTECTION: + $this->readRangeProtection(); + break; + case self::XLS_TYPE_NOTE: + $this->readNote(); + break; + //case self::XLS_TYPE_IMDATA: $this->readImData(); break; + case self::XLS_TYPE_TXO: + $this->readTextObject(); + break; + case self::XLS_TYPE_CONTINUE: + $this->readContinue(); + break; + case self::XLS_TYPE_EOF: + $this->readDefault(); + break 2; + default: + $this->readDefault(); + break; + } + + } + + // treat MSODRAWING records, sheet-level Escher + if (!$this->readDataOnly && $this->drawingData) { + $escherWorksheet = new PHPExcel_Shared_Escher(); + $reader = new PHPExcel_Reader_Excel5_Escher($escherWorksheet); + $escherWorksheet = $reader->load($this->drawingData); + + // debug Escher stream + //$debug = new Debug_Escher(new PHPExcel_Shared_Escher()); + //$debug->load($this->drawingData); + + // get all spContainers in one long array, so they can be mapped to OBJ records + $allSpContainers = $escherWorksheet->getDgContainer()->getSpgrContainer()->getAllSpContainers(); + } + + // treat OBJ records + foreach ($this->objs as $n => $obj) { +// echo '
Object reference is ', $n,'
'; +// var_dump($obj); +// echo '
'; + + // the first shape container never has a corresponding OBJ record, hence $n + 1 + if (isset($allSpContainers[$n + 1]) && is_object($allSpContainers[$n + 1])) { + $spContainer = $allSpContainers[$n + 1]; + + // we skip all spContainers that are a part of a group shape since we cannot yet handle those + if ($spContainer->getNestingLevel() > 1) { + continue; + } + + // calculate the width and height of the shape + list($startColumn, $startRow) = PHPExcel_Cell::coordinateFromString($spContainer->getStartCoordinates()); + list($endColumn, $endRow) = PHPExcel_Cell::coordinateFromString($spContainer->getEndCoordinates()); + + $startOffsetX = $spContainer->getStartOffsetX(); + $startOffsetY = $spContainer->getStartOffsetY(); + $endOffsetX = $spContainer->getEndOffsetX(); + $endOffsetY = $spContainer->getEndOffsetY(); + + $width = PHPExcel_Shared_Excel5::getDistanceX($this->phpSheet, $startColumn, $startOffsetX, $endColumn, $endOffsetX); + $height = PHPExcel_Shared_Excel5::getDistanceY($this->phpSheet, $startRow, $startOffsetY, $endRow, $endOffsetY); + + // calculate offsetX and offsetY of the shape + $offsetX = $startOffsetX * PHPExcel_Shared_Excel5::sizeCol($this->phpSheet, $startColumn) / 1024; + $offsetY = $startOffsetY * PHPExcel_Shared_Excel5::sizeRow($this->phpSheet, $startRow) / 256; + + switch ($obj['otObjType']) { + case 0x19: + // Note +// echo 'Cell Annotation Object
'; +// echo 'Object ID is ', $obj['idObjID'],'
'; + if (isset($this->cellNotes[$obj['idObjID']])) { + $cellNote = $this->cellNotes[$obj['idObjID']]; + + if (isset($this->textObjects[$obj['idObjID']])) { + $textObject = $this->textObjects[$obj['idObjID']]; + $this->cellNotes[$obj['idObjID']]['objTextData'] = $textObject; + } + } + break; + case 0x08: +// echo 'Picture Object
'; + // picture + // get index to BSE entry (1-based) + $BSEindex = $spContainer->getOPT(0x0104); + $BSECollection = $escherWorkbook->getDggContainer()->getBstoreContainer()->getBSECollection(); + $BSE = $BSECollection[$BSEindex - 1]; + $blipType = $BSE->getBlipType(); + + // need check because some blip types are not supported by Escher reader such as EMF + if ($blip = $BSE->getBlip()) { + $ih = imagecreatefromstring($blip->getData()); + $drawing = new PHPExcel_Worksheet_MemoryDrawing(); + $drawing->setImageResource($ih); + + // width, height, offsetX, offsetY + $drawing->setResizeProportional(false); + $drawing->setWidth($width); + $drawing->setHeight($height); + $drawing->setOffsetX($offsetX); + $drawing->setOffsetY($offsetY); + + switch ($blipType) { + case PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG: + $drawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG); + $drawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_JPEG); + break; + case PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG: + $drawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_PNG); + $drawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_PNG); + break; + } + + $drawing->setWorksheet($this->phpSheet); + $drawing->setCoordinates($spContainer->getStartCoordinates()); + } + break; + default: + // other object type + break; + } + } + } + + // treat SHAREDFMLA records + if ($this->version == self::XLS_BIFF8) { + foreach ($this->sharedFormulaParts as $cell => $baseCell) { + list($column, $row) = PHPExcel_Cell::coordinateFromString($cell); + if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($column, $row, $this->phpSheet->getTitle())) { + $formula = $this->getFormulaFromStructure($this->sharedFormulas[$baseCell], $cell); + $this->phpSheet->getCell($cell)->setValueExplicit('=' . $formula, PHPExcel_Cell_DataType::TYPE_FORMULA); + } + } + } + + if (!empty($this->cellNotes)) { + foreach ($this->cellNotes as $note => $noteDetails) { + if (!isset($noteDetails['objTextData'])) { + if (isset($this->textObjects[$note])) { + $textObject = $this->textObjects[$note]; + $noteDetails['objTextData'] = $textObject; + } else { + $noteDetails['objTextData']['text'] = ''; + } + } +// echo 'Cell annotation ', $note,'
'; +// var_dump($noteDetails); +// echo '
'; + $cellAddress = str_replace('$', '', $noteDetails['cellRef']); + $this->phpSheet->getComment($cellAddress)->setAuthor($noteDetails['author'])->setText($this->parseRichText($noteDetails['objTextData']['text'])); + } + } + } + + // add the named ranges (defined names) + foreach ($this->definedname as $definedName) { + if ($definedName['isBuiltInName']) { + switch ($definedName['name']) { + case pack('C', 0x06): + // print area + // in general, formula looks like this: Foo!$C$7:$J$66,Bar!$A$1:$IV$2 + $ranges = explode(',', $definedName['formula']); // FIXME: what if sheetname contains comma? + + $extractedRanges = array(); + foreach ($ranges as $range) { + // $range should look like one of these + // Foo!$C$7:$J$66 + // Bar!$A$1:$IV$2 + $explodes = explode('!', $range); // FIXME: what if sheetname contains exclamation mark? + $sheetName = trim($explodes[0], "'"); + if (count($explodes) == 2) { + if (strpos($explodes[1], ':') === false) { + $explodes[1] = $explodes[1] . ':' . $explodes[1]; + } + $extractedRanges[] = str_replace('$', '', $explodes[1]); // C7:J66 + } + } + if ($docSheet = $this->phpExcel->getSheetByName($sheetName)) { + $docSheet->getPageSetup()->setPrintArea(implode(',', $extractedRanges)); // C7:J66,A1:IV2 + } + break; + case pack('C', 0x07): + // print titles (repeating rows) + // Assuming BIFF8, there are 3 cases + // 1. repeating rows + // formula looks like this: Sheet!$A$1:$IV$2 + // rows 1-2 repeat + // 2. repeating columns + // formula looks like this: Sheet!$A$1:$B$65536 + // columns A-B repeat + // 3. both repeating rows and repeating columns + // formula looks like this: Sheet!$A$1:$B$65536,Sheet!$A$1:$IV$2 + $ranges = explode(',', $definedName['formula']); // FIXME: what if sheetname contains comma? + foreach ($ranges as $range) { + // $range should look like this one of these + // Sheet!$A$1:$B$65536 + // Sheet!$A$1:$IV$2 + $explodes = explode('!', $range); + if (count($explodes) == 2) { + if ($docSheet = $this->phpExcel->getSheetByName($explodes[0])) { + $extractedRange = $explodes[1]; + $extractedRange = str_replace('$', '', $extractedRange); + + $coordinateStrings = explode(':', $extractedRange); + if (count($coordinateStrings) == 2) { + list($firstColumn, $firstRow) = PHPExcel_Cell::coordinateFromString($coordinateStrings[0]); + list($lastColumn, $lastRow) = PHPExcel_Cell::coordinateFromString($coordinateStrings[1]); + + if ($firstColumn == 'A' and $lastColumn == 'IV') { + // then we have repeating rows + $docSheet->getPageSetup()->setRowsToRepeatAtTop(array($firstRow, $lastRow)); + } elseif ($firstRow == 1 and $lastRow == 65536) { + // then we have repeating columns + $docSheet->getPageSetup()->setColumnsToRepeatAtLeft(array($firstColumn, $lastColumn)); + } + } + } + } + } + break; + } + } else { + // Extract range + $explodes = explode('!', $definedName['formula']); + + if (count($explodes) == 2) { + if (($docSheet = $this->phpExcel->getSheetByName($explodes[0])) || + ($docSheet = $this->phpExcel->getSheetByName(trim($explodes[0], "'")))) { + $extractedRange = $explodes[1]; + $extractedRange = str_replace('$', '', $extractedRange); + + $localOnly = ($definedName['scope'] == 0) ? false : true; + + $scope = ($definedName['scope'] == 0) ? null : $this->phpExcel->getSheetByName($this->sheets[$definedName['scope'] - 1]['name']); + + $this->phpExcel->addNamedRange(new PHPExcel_NamedRange((string)$definedName['name'], $docSheet, $extractedRange, $localOnly, $scope)); + } + } else { + // Named Value + // TODO Provide support for named values + } + } + } + $this->data = null; + + return $this->phpExcel; + } + + /** + * Read record data from stream, decrypting as required + * + * @param string $data Data stream to read from + * @param int $pos Position to start reading from + * @param int $length Record data length + * + * @return string Record data + */ + private function readRecordData($data, $pos, $len) + { + $data = substr($data, $pos, $len); + + // File not encrypted, or record before encryption start point + if ($this->encryption == self::MS_BIFF_CRYPTO_NONE || $pos < $this->encryptionStartPos) { + return $data; + } + + $recordData = ''; + if ($this->encryption == self::MS_BIFF_CRYPTO_RC4) { + $oldBlock = floor($this->rc4Pos / self::REKEY_BLOCK); + $block = floor($pos / self::REKEY_BLOCK); + $endBlock = floor(($pos + $len) / self::REKEY_BLOCK); + + // Spin an RC4 decryptor to the right spot. If we have a decryptor sitting + // at a point earlier in the current block, re-use it as we can save some time. + if ($block != $oldBlock || $pos < $this->rc4Pos || !$this->rc4Key) { + $this->rc4Key = $this->makeKey($block, $this->md5Ctxt); + $step = $pos % self::REKEY_BLOCK; + } else { + $step = $pos - $this->rc4Pos; + } + $this->rc4Key->RC4(str_repeat("\0", $step)); + + // Decrypt record data (re-keying at the end of every block) + while ($block != $endBlock) { + $step = self::REKEY_BLOCK - ($pos % self::REKEY_BLOCK); + $recordData .= $this->rc4Key->RC4(substr($data, 0, $step)); + $data = substr($data, $step); + $pos += $step; + $len -= $step; + $block++; + $this->rc4Key = $this->makeKey($block, $this->md5Ctxt); + } + $recordData .= $this->rc4Key->RC4(substr($data, 0, $len)); + + // Keep track of the position of this decryptor. + // We'll try and re-use it later if we can to speed things up + $this->rc4Pos = $pos + $len; + } elseif ($this->encryption == self::MS_BIFF_CRYPTO_XOR) { + throw new PHPExcel_Reader_Exception('XOr encryption not supported'); + } + return $recordData; + } + + /** + * Use OLE reader to extract the relevant data streams from the OLE file + * + * @param string $pFilename + */ + private function loadOLE($pFilename) + { + // OLE reader + $ole = new PHPExcel_Shared_OLERead(); + // get excel data, + $res = $ole->read($pFilename); + // Get workbook data: workbook stream + sheet streams + $this->data = $ole->getStream($ole->wrkbook); + // Get summary information data + $this->summaryInformation = $ole->getStream($ole->summaryInformation); + // Get additional document summary information data + $this->documentSummaryInformation = $ole->getStream($ole->documentSummaryInformation); + // Get user-defined property data +// $this->userDefinedProperties = $ole->getUserDefinedProperties(); + } + + + /** + * Read summary information + */ + private function readSummaryInformation() + { + if (!isset($this->summaryInformation)) { + return; + } + + // offset: 0; size: 2; must be 0xFE 0xFF (UTF-16 LE byte order mark) + // offset: 2; size: 2; + // offset: 4; size: 2; OS version + // offset: 6; size: 2; OS indicator + // offset: 8; size: 16 + // offset: 24; size: 4; section count + $secCount = self::getInt4d($this->summaryInformation, 24); + + // offset: 28; size: 16; first section's class id: e0 85 9f f2 f9 4f 68 10 ab 91 08 00 2b 27 b3 d9 + // offset: 44; size: 4 + $secOffset = self::getInt4d($this->summaryInformation, 44); + + // section header + // offset: $secOffset; size: 4; section length + $secLength = self::getInt4d($this->summaryInformation, $secOffset); + + // offset: $secOffset+4; size: 4; property count + $countProperties = self::getInt4d($this->summaryInformation, $secOffset+4); + + // initialize code page (used to resolve string values) + $codePage = 'CP1252'; + + // offset: ($secOffset+8); size: var + // loop through property decarations and properties + for ($i = 0; $i < $countProperties; ++$i) { + // offset: ($secOffset+8) + (8 * $i); size: 4; property ID + $id = self::getInt4d($this->summaryInformation, ($secOffset+8) + (8 * $i)); + + // Use value of property id as appropriate + // offset: ($secOffset+12) + (8 * $i); size: 4; offset from beginning of section (48) + $offset = self::getInt4d($this->summaryInformation, ($secOffset+12) + (8 * $i)); + + $type = self::getInt4d($this->summaryInformation, $secOffset + $offset); + + // initialize property value + $value = null; + + // extract property value based on property type + switch ($type) { + case 0x02: // 2 byte signed integer + $value = self::getInt2d($this->summaryInformation, $secOffset + 4 + $offset); + break; + case 0x03: // 4 byte signed integer + $value = self::getInt4d($this->summaryInformation, $secOffset + 4 + $offset); + break; + case 0x13: // 4 byte unsigned integer + // not needed yet, fix later if necessary + break; + case 0x1E: // null-terminated string prepended by dword string length + $byteLength = self::getInt4d($this->summaryInformation, $secOffset + 4 + $offset); + $value = substr($this->summaryInformation, $secOffset + 8 + $offset, $byteLength); + $value = PHPExcel_Shared_String::ConvertEncoding($value, 'UTF-8', $codePage); + $value = rtrim($value); + break; + case 0x40: // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) + // PHP-time + $value = PHPExcel_Shared_OLE::OLE2LocalDate(substr($this->summaryInformation, $secOffset + 4 + $offset, 8)); + break; + case 0x47: // Clipboard format + // not needed yet, fix later if necessary + break; + } + + switch ($id) { + case 0x01: // Code Page + $codePage = PHPExcel_Shared_CodePage::NumberToName($value); + break; + case 0x02: // Title + $this->phpExcel->getProperties()->setTitle($value); + break; + case 0x03: // Subject + $this->phpExcel->getProperties()->setSubject($value); + break; + case 0x04: // Author (Creator) + $this->phpExcel->getProperties()->setCreator($value); + break; + case 0x05: // Keywords + $this->phpExcel->getProperties()->setKeywords($value); + break; + case 0x06: // Comments (Description) + $this->phpExcel->getProperties()->setDescription($value); + break; + case 0x07: // Template + // Not supported by PHPExcel + break; + case 0x08: // Last Saved By (LastModifiedBy) + $this->phpExcel->getProperties()->setLastModifiedBy($value); + break; + case 0x09: // Revision + // Not supported by PHPExcel + break; + case 0x0A: // Total Editing Time + // Not supported by PHPExcel + break; + case 0x0B: // Last Printed + // Not supported by PHPExcel + break; + case 0x0C: // Created Date/Time + $this->phpExcel->getProperties()->setCreated($value); + break; + case 0x0D: // Modified Date/Time + $this->phpExcel->getProperties()->setModified($value); + break; + case 0x0E: // Number of Pages + // Not supported by PHPExcel + break; + case 0x0F: // Number of Words + // Not supported by PHPExcel + break; + case 0x10: // Number of Characters + // Not supported by PHPExcel + break; + case 0x11: // Thumbnail + // Not supported by PHPExcel + break; + case 0x12: // Name of creating application + // Not supported by PHPExcel + break; + case 0x13: // Security + // Not supported by PHPExcel + break; + } + } + } + + + /** + * Read additional document summary information + */ + private function readDocumentSummaryInformation() + { + if (!isset($this->documentSummaryInformation)) { + return; + } + + // offset: 0; size: 2; must be 0xFE 0xFF (UTF-16 LE byte order mark) + // offset: 2; size: 2; + // offset: 4; size: 2; OS version + // offset: 6; size: 2; OS indicator + // offset: 8; size: 16 + // offset: 24; size: 4; section count + $secCount = self::getInt4d($this->documentSummaryInformation, 24); +// echo '$secCount = ', $secCount,'
'; + + // offset: 28; size: 16; first section's class id: 02 d5 cd d5 9c 2e 1b 10 93 97 08 00 2b 2c f9 ae + // offset: 44; size: 4; first section offset + $secOffset = self::getInt4d($this->documentSummaryInformation, 44); +// echo '$secOffset = ', $secOffset,'
'; + + // section header + // offset: $secOffset; size: 4; section length + $secLength = self::getInt4d($this->documentSummaryInformation, $secOffset); +// echo '$secLength = ', $secLength,'
'; + + // offset: $secOffset+4; size: 4; property count + $countProperties = self::getInt4d($this->documentSummaryInformation, $secOffset+4); +// echo '$countProperties = ', $countProperties,'
'; + + // initialize code page (used to resolve string values) + $codePage = 'CP1252'; + + // offset: ($secOffset+8); size: var + // loop through property decarations and properties + for ($i = 0; $i < $countProperties; ++$i) { +// echo 'Property ', $i,'
'; + // offset: ($secOffset+8) + (8 * $i); size: 4; property ID + $id = self::getInt4d($this->documentSummaryInformation, ($secOffset+8) + (8 * $i)); +// echo 'ID is ', $id,'
'; + + // Use value of property id as appropriate + // offset: 60 + 8 * $i; size: 4; offset from beginning of section (48) + $offset = self::getInt4d($this->documentSummaryInformation, ($secOffset+12) + (8 * $i)); + + $type = self::getInt4d($this->documentSummaryInformation, $secOffset + $offset); +// echo 'Type is ', $type,', '; + + // initialize property value + $value = null; + + // extract property value based on property type + switch ($type) { + case 0x02: // 2 byte signed integer + $value = self::getInt2d($this->documentSummaryInformation, $secOffset + 4 + $offset); + break; + case 0x03: // 4 byte signed integer + $value = self::getInt4d($this->documentSummaryInformation, $secOffset + 4 + $offset); + break; + case 0x0B: // Boolean + $value = self::getInt2d($this->documentSummaryInformation, $secOffset + 4 + $offset); + $value = ($value == 0 ? false : true); + break; + case 0x13: // 4 byte unsigned integer + // not needed yet, fix later if necessary + break; + case 0x1E: // null-terminated string prepended by dword string length + $byteLength = self::getInt4d($this->documentSummaryInformation, $secOffset + 4 + $offset); + $value = substr($this->documentSummaryInformation, $secOffset + 8 + $offset, $byteLength); + $value = PHPExcel_Shared_String::ConvertEncoding($value, 'UTF-8', $codePage); + $value = rtrim($value); + break; + case 0x40: // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) + // PHP-Time + $value = PHPExcel_Shared_OLE::OLE2LocalDate(substr($this->documentSummaryInformation, $secOffset + 4 + $offset, 8)); + break; + case 0x47: // Clipboard format + // not needed yet, fix later if necessary + break; + } + + switch ($id) { + case 0x01: // Code Page + $codePage = PHPExcel_Shared_CodePage::NumberToName($value); + break; + case 0x02: // Category + $this->phpExcel->getProperties()->setCategory($value); + break; + case 0x03: // Presentation Target + // Not supported by PHPExcel + break; + case 0x04: // Bytes + // Not supported by PHPExcel + break; + case 0x05: // Lines + // Not supported by PHPExcel + break; + case 0x06: // Paragraphs + // Not supported by PHPExcel + break; + case 0x07: // Slides + // Not supported by PHPExcel + break; + case 0x08: // Notes + // Not supported by PHPExcel + break; + case 0x09: // Hidden Slides + // Not supported by PHPExcel + break; + case 0x0A: // MM Clips + // Not supported by PHPExcel + break; + case 0x0B: // Scale Crop + // Not supported by PHPExcel + break; + case 0x0C: // Heading Pairs + // Not supported by PHPExcel + break; + case 0x0D: // Titles of Parts + // Not supported by PHPExcel + break; + case 0x0E: // Manager + $this->phpExcel->getProperties()->setManager($value); + break; + case 0x0F: // Company + $this->phpExcel->getProperties()->setCompany($value); + break; + case 0x10: // Links up-to-date + // Not supported by PHPExcel + break; + } + } + } + + + /** + * Reads a general type of BIFF record. Does nothing except for moving stream pointer forward to next record. + */ + private function readDefault() + { + $length = self::getInt2d($this->data, $this->pos + 2); +// $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + } + + + /** + * The NOTE record specifies a comment associated with a particular cell. In Excel 95 (BIFF7) and earlier versions, + * this record stores a note (cell note). This feature was significantly enhanced in Excel 97. + */ + private function readNote() + { +// echo 'Read Cell Annotation
'; + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if ($this->readDataOnly) { + return; + } + + $cellAddress = $this->readBIFF8CellAddress(substr($recordData, 0, 4)); + if ($this->version == self::XLS_BIFF8) { + $noteObjID = self::getInt2d($recordData, 6); + $noteAuthor = self::readUnicodeStringLong(substr($recordData, 8)); + $noteAuthor = $noteAuthor['value']; +// echo 'Note Address=', $cellAddress,'
'; +// echo 'Note Object ID=', $noteObjID,'
'; +// echo 'Note Author=', $noteAuthor,'
'; +// + $this->cellNotes[$noteObjID] = array( + 'cellRef' => $cellAddress, + 'objectID' => $noteObjID, + 'author' => $noteAuthor + ); + } else { + $extension = false; + if ($cellAddress == '$B$65536') { + // If the address row is -1 and the column is 0, (which translates as $B$65536) then this is a continuation + // note from the previous cell annotation. We're not yet handling this, so annotations longer than the + // max 2048 bytes will probably throw a wobbly. + $row = self::getInt2d($recordData, 0); + $extension = true; + $cellAddress = array_pop(array_keys($this->phpSheet->getComments())); + } +// echo 'Note Address=', $cellAddress,'
'; + + $cellAddress = str_replace('$', '', $cellAddress); + $noteLength = self::getInt2d($recordData, 4); + $noteText = trim(substr($recordData, 6)); +// echo 'Note Length=', $noteLength,'
'; +// echo 'Note Text=', $noteText,'
'; + + if ($extension) { + // Concatenate this extension with the currently set comment for the cell + $comment = $this->phpSheet->getComment($cellAddress); + $commentText = $comment->getText()->getPlainText(); + $comment->setText($this->parseRichText($commentText.$noteText)); + } else { + // Set comment for the cell + $this->phpSheet->getComment($cellAddress)->setText($this->parseRichText($noteText)); +// ->setAuthor($author) + } + } + + } + + + /** + * The TEXT Object record contains the text associated with a cell annotation. + */ + private function readTextObject() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if ($this->readDataOnly) { + return; + } + + // recordData consists of an array of subrecords looking like this: + // grbit: 2 bytes; Option Flags + // rot: 2 bytes; rotation + // cchText: 2 bytes; length of the text (in the first continue record) + // cbRuns: 2 bytes; length of the formatting (in the second continue record) + // followed by the continuation records containing the actual text and formatting + $grbitOpts = self::getInt2d($recordData, 0); + $rot = self::getInt2d($recordData, 2); + $cchText = self::getInt2d($recordData, 10); + $cbRuns = self::getInt2d($recordData, 12); + $text = $this->getSplicedRecordData(); + + $this->textObjects[$this->textObjRef] = array( + 'text' => substr($text["recordData"], $text["spliceOffsets"][0]+1, $cchText), + 'format' => substr($text["recordData"], $text["spliceOffsets"][1], $cbRuns), + 'alignment' => $grbitOpts, + 'rotation' => $rot + ); + +// echo '_readTextObject()
'; +// var_dump($this->textObjects[$this->textObjRef]); +// echo '
'; + } + + + /** + * Read BOF + */ + private function readBof() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = substr($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 2; size: 2; type of the following data + $substreamType = self::getInt2d($recordData, 2); + + switch ($substreamType) { + case self::XLS_WorkbookGlobals: + $version = self::getInt2d($recordData, 0); + if (($version != self::XLS_BIFF8) && ($version != self::XLS_BIFF7)) { + throw new PHPExcel_Reader_Exception('Cannot read this Excel file. Version is too old.'); + } + $this->version = $version; + break; + case self::XLS_Worksheet: + // do not use this version information for anything + // it is unreliable (OpenOffice doc, 5.8), use only version information from the global stream + break; + default: + // substream, e.g. chart + // just skip the entire substream + do { + $code = self::getInt2d($this->data, $this->pos); + $this->readDefault(); + } while ($code != self::XLS_TYPE_EOF && $this->pos < $this->dataSize); + break; + } + } + + + /** + * FILEPASS + * + * This record is part of the File Protection Block. It + * contains information about the read/write password of the + * file. All record contents following this record will be + * encrypted. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + * + * The decryption functions and objects used from here on in + * are based on the source of Spreadsheet-ParseExcel: + * http://search.cpan.org/~jmcnamara/Spreadsheet-ParseExcel/ + */ + private function readFilepass() + { + $length = self::getInt2d($this->data, $this->pos + 2); + + if ($length != 54) { + throw new PHPExcel_Reader_Exception('Unexpected file pass record length'); + } + + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->verifyPassword('VelvetSweatshop', substr($recordData, 6, 16), substr($recordData, 22, 16), substr($recordData, 38, 16), $this->md5Ctxt)) { + throw new PHPExcel_Reader_Exception('Decryption password incorrect'); + } + + $this->encryption = self::MS_BIFF_CRYPTO_RC4; + + // Decryption required from the record after next onwards + $this->encryptionStartPos = $this->pos + self::getInt2d($this->data, $this->pos + 2); + } + + /** + * Make an RC4 decryptor for the given block + * + * @var int $block Block for which to create decrypto + * @var string $valContext MD5 context state + * + * @return PHPExcel_Reader_Excel5_RC4 + */ + private function makeKey($block, $valContext) + { + $pwarray = str_repeat("\0", 64); + + for ($i = 0; $i < 5; $i++) { + $pwarray[$i] = $valContext[$i]; + } + + $pwarray[5] = chr($block & 0xff); + $pwarray[6] = chr(($block >> 8) & 0xff); + $pwarray[7] = chr(($block >> 16) & 0xff); + $pwarray[8] = chr(($block >> 24) & 0xff); + + $pwarray[9] = "\x80"; + $pwarray[56] = "\x48"; + + $md5 = new PHPExcel_Reader_Excel5_MD5(); + $md5->add($pwarray); + + $s = $md5->getContext(); + return new PHPExcel_Reader_Excel5_RC4($s); + } + + /** + * Verify RC4 file password + * + * @var string $password Password to check + * @var string $docid Document id + * @var string $salt_data Salt data + * @var string $hashedsalt_data Hashed salt data + * @var string &$valContext Set to the MD5 context of the value + * + * @return bool Success + */ + private function verifyPassword($password, $docid, $salt_data, $hashedsalt_data, &$valContext) + { + $pwarray = str_repeat("\0", 64); + + for ($i = 0; $i < strlen($password); $i++) { + $o = ord(substr($password, $i, 1)); + $pwarray[2 * $i] = chr($o & 0xff); + $pwarray[2 * $i + 1] = chr(($o >> 8) & 0xff); + } + $pwarray[2 * $i] = chr(0x80); + $pwarray[56] = chr(($i << 4) & 0xff); + + $md5 = new PHPExcel_Reader_Excel5_MD5(); + $md5->add($pwarray); + + $mdContext1 = $md5->getContext(); + + $offset = 0; + $keyoffset = 0; + $tocopy = 5; + + $md5->reset(); + + while ($offset != 16) { + if ((64 - $offset) < 5) { + $tocopy = 64 - $offset; + } + for ($i = 0; $i <= $tocopy; $i++) { + $pwarray[$offset + $i] = $mdContext1[$keyoffset + $i]; + } + $offset += $tocopy; + + if ($offset == 64) { + $md5->add($pwarray); + $keyoffset = $tocopy; + $tocopy = 5 - $tocopy; + $offset = 0; + continue; + } + + $keyoffset = 0; + $tocopy = 5; + for ($i = 0; $i < 16; $i++) { + $pwarray[$offset + $i] = $docid[$i]; + } + $offset += 16; + } + + $pwarray[16] = "\x80"; + for ($i = 0; $i < 47; $i++) { + $pwarray[17 + $i] = "\0"; + } + $pwarray[56] = "\x80"; + $pwarray[57] = "\x0a"; + + $md5->add($pwarray); + $valContext = $md5->getContext(); + + $key = $this->makeKey(0, $valContext); + + $salt = $key->RC4($salt_data); + $hashedsalt = $key->RC4($hashedsalt_data); + + $salt .= "\x80" . str_repeat("\0", 47); + $salt[56] = "\x80"; + + $md5->reset(); + $md5->add($salt); + $mdContext2 = $md5->getContext(); + + return $mdContext2 == $hashedsalt; + } + + /** + * CODEPAGE + * + * This record stores the text encoding used to write byte + * strings, stored as MS Windows code page identifier. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + */ + private function readCodepage() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0; size: 2; code page identifier + $codepage = self::getInt2d($recordData, 0); + + $this->codepage = PHPExcel_Shared_CodePage::NumberToName($codepage); + } + + + /** + * DATEMODE + * + * This record specifies the base date for displaying date + * values. All dates are stored as count of days past this + * base date. In BIFF2-BIFF4 this record is part of the + * Calculation Settings Block. In BIFF5-BIFF8 it is + * stored in the Workbook Globals Substream. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + */ + private function readDateMode() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0; size: 2; 0 = base 1900, 1 = base 1904 + PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900); + if (ord($recordData{0}) == 1) { + PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904); + } + } + + + /** + * Read a FONT record + */ + private function readFont() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + $objFont = new PHPExcel_Style_Font(); + + // offset: 0; size: 2; height of the font (in twips = 1/20 of a point) + $size = self::getInt2d($recordData, 0); + $objFont->setSize($size / 20); + + // offset: 2; size: 2; option flags + // bit: 0; mask 0x0001; bold (redundant in BIFF5-BIFF8) + // bit: 1; mask 0x0002; italic + $isItalic = (0x0002 & self::getInt2d($recordData, 2)) >> 1; + if ($isItalic) { + $objFont->setItalic(true); + } + + // bit: 2; mask 0x0004; underlined (redundant in BIFF5-BIFF8) + // bit: 3; mask 0x0008; strike + $isStrike = (0x0008 & self::getInt2d($recordData, 2)) >> 3; + if ($isStrike) { + $objFont->setStrikethrough(true); + } + + // offset: 4; size: 2; colour index + $colorIndex = self::getInt2d($recordData, 4); + $objFont->colorIndex = $colorIndex; + + // offset: 6; size: 2; font weight + $weight = self::getInt2d($recordData, 6); + switch ($weight) { + case 0x02BC: + $objFont->setBold(true); + break; + } + + // offset: 8; size: 2; escapement type + $escapement = self::getInt2d($recordData, 8); + switch ($escapement) { + case 0x0001: + $objFont->setSuperScript(true); + break; + case 0x0002: + $objFont->setSubScript(true); + break; + } + + // offset: 10; size: 1; underline type + $underlineType = ord($recordData{10}); + switch ($underlineType) { + case 0x00: + break; // no underline + case 0x01: + $objFont->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE); + break; + case 0x02: + $objFont->setUnderline(PHPExcel_Style_Font::UNDERLINE_DOUBLE); + break; + case 0x21: + $objFont->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING); + break; + case 0x22: + $objFont->setUnderline(PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING); + break; + } + + // offset: 11; size: 1; font family + // offset: 12; size: 1; character set + // offset: 13; size: 1; not used + // offset: 14; size: var; font name + if ($this->version == self::XLS_BIFF8) { + $string = self::readUnicodeStringShort(substr($recordData, 14)); + } else { + $string = $this->readByteStringShort(substr($recordData, 14)); + } + $objFont->setName($string['value']); + + $this->objFonts[] = $objFont; + } + } + + + /** + * FORMAT + * + * This record contains information about a number format. + * All FORMAT records occur together in a sequential list. + * + * In BIFF2-BIFF4 other records referencing a FORMAT record + * contain a zero-based index into this list. From BIFF5 on + * the FORMAT record contains the index itself that will be + * used by other records. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + */ + private function readFormat() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + $indexCode = self::getInt2d($recordData, 0); + + if ($this->version == self::XLS_BIFF8) { + $string = self::readUnicodeStringLong(substr($recordData, 2)); + } else { + // BIFF7 + $string = $this->readByteStringShort(substr($recordData, 2)); + } + + $formatString = $string['value']; + $this->formats[$indexCode] = $formatString; + } + } + + + /** + * XF - Extended Format + * + * This record contains formatting information for cells, rows, columns or styles. + * According to http://support.microsoft.com/kb/147732 there are always at least 15 cell style XF + * and 1 cell XF. + * Inspection of Excel files generated by MS Office Excel shows that XF records 0-14 are cell style XF + * and XF record 15 is a cell XF + * We only read the first cell style XF and skip the remaining cell style XF records + * We read all cell XF records. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + */ + private function readXf() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + $objStyle = new PHPExcel_Style(); + + if (!$this->readDataOnly) { + // offset: 0; size: 2; Index to FONT record + if (self::getInt2d($recordData, 0) < 4) { + $fontIndex = self::getInt2d($recordData, 0); + } else { + // this has to do with that index 4 is omitted in all BIFF versions for some strange reason + // check the OpenOffice documentation of the FONT record + $fontIndex = self::getInt2d($recordData, 0) - 1; + } + $objStyle->setFont($this->objFonts[$fontIndex]); + + // offset: 2; size: 2; Index to FORMAT record + $numberFormatIndex = self::getInt2d($recordData, 2); + if (isset($this->formats[$numberFormatIndex])) { + // then we have user-defined format code + $numberformat = array('code' => $this->formats[$numberFormatIndex]); + } elseif (($code = PHPExcel_Style_NumberFormat::builtInFormatCode($numberFormatIndex)) !== '') { + // then we have built-in format code + $numberformat = array('code' => $code); + } else { + // we set the general format code + $numberformat = array('code' => 'General'); + } + $objStyle->getNumberFormat()->setFormatCode($numberformat['code']); + + // offset: 4; size: 2; XF type, cell protection, and parent style XF + // bit 2-0; mask 0x0007; XF_TYPE_PROT + $xfTypeProt = self::getInt2d($recordData, 4); + // bit 0; mask 0x01; 1 = cell is locked + $isLocked = (0x01 & $xfTypeProt) >> 0; + $objStyle->getProtection()->setLocked($isLocked ? PHPExcel_Style_Protection::PROTECTION_INHERIT : PHPExcel_Style_Protection::PROTECTION_UNPROTECTED); + + // bit 1; mask 0x02; 1 = Formula is hidden + $isHidden = (0x02 & $xfTypeProt) >> 1; + $objStyle->getProtection()->setHidden($isHidden ? PHPExcel_Style_Protection::PROTECTION_PROTECTED : PHPExcel_Style_Protection::PROTECTION_UNPROTECTED); + + // bit 2; mask 0x04; 0 = Cell XF, 1 = Cell Style XF + $isCellStyleXf = (0x04 & $xfTypeProt) >> 2; + + // offset: 6; size: 1; Alignment and text break + // bit 2-0, mask 0x07; horizontal alignment + $horAlign = (0x07 & ord($recordData{6})) >> 0; + switch ($horAlign) { + case 0: + $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_GENERAL); + break; + case 1: + $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); + break; + case 2: + $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); + break; + case 3: + $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); + break; + case 4: + $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_FILL); + break; + case 5: + $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY); + break; + case 6: + $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS); + break; + } + // bit 3, mask 0x08; wrap text + $wrapText = (0x08 & ord($recordData{6})) >> 3; + switch ($wrapText) { + case 0: + $objStyle->getAlignment()->setWrapText(false); + break; + case 1: + $objStyle->getAlignment()->setWrapText(true); + break; + } + // bit 6-4, mask 0x70; vertical alignment + $vertAlign = (0x70 & ord($recordData{6})) >> 4; + switch ($vertAlign) { + case 0: + $objStyle->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); + break; + case 1: + $objStyle->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER); + break; + case 2: + $objStyle->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_BOTTOM); + break; + case 3: + $objStyle->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_JUSTIFY); + break; + } + + if ($this->version == self::XLS_BIFF8) { + // offset: 7; size: 1; XF_ROTATION: Text rotation angle + $angle = ord($recordData{7}); + $rotation = 0; + if ($angle <= 90) { + $rotation = $angle; + } elseif ($angle <= 180) { + $rotation = 90 - $angle; + } elseif ($angle == 255) { + $rotation = -165; + } + $objStyle->getAlignment()->setTextRotation($rotation); + + // offset: 8; size: 1; Indentation, shrink to cell size, and text direction + // bit: 3-0; mask: 0x0F; indent level + $indent = (0x0F & ord($recordData{8})) >> 0; + $objStyle->getAlignment()->setIndent($indent); + + // bit: 4; mask: 0x10; 1 = shrink content to fit into cell + $shrinkToFit = (0x10 & ord($recordData{8})) >> 4; + switch ($shrinkToFit) { + case 0: + $objStyle->getAlignment()->setShrinkToFit(false); + break; + case 1: + $objStyle->getAlignment()->setShrinkToFit(true); + break; + } + + // offset: 9; size: 1; Flags used for attribute groups + + // offset: 10; size: 4; Cell border lines and background area + // bit: 3-0; mask: 0x0000000F; left style + if ($bordersLeftStyle = PHPExcel_Reader_Excel5_Style_Border::lookup((0x0000000F & self::getInt4d($recordData, 10)) >> 0)) { + $objStyle->getBorders()->getLeft()->setBorderStyle($bordersLeftStyle); + } + // bit: 7-4; mask: 0x000000F0; right style + if ($bordersRightStyle = PHPExcel_Reader_Excel5_Style_Border::lookup((0x000000F0 & self::getInt4d($recordData, 10)) >> 4)) { + $objStyle->getBorders()->getRight()->setBorderStyle($bordersRightStyle); + } + // bit: 11-8; mask: 0x00000F00; top style + if ($bordersTopStyle = PHPExcel_Reader_Excel5_Style_Border::lookup((0x00000F00 & self::getInt4d($recordData, 10)) >> 8)) { + $objStyle->getBorders()->getTop()->setBorderStyle($bordersTopStyle); + } + // bit: 15-12; mask: 0x0000F000; bottom style + if ($bordersBottomStyle = PHPExcel_Reader_Excel5_Style_Border::lookup((0x0000F000 & self::getInt4d($recordData, 10)) >> 12)) { + $objStyle->getBorders()->getBottom()->setBorderStyle($bordersBottomStyle); + } + // bit: 22-16; mask: 0x007F0000; left color + $objStyle->getBorders()->getLeft()->colorIndex = (0x007F0000 & self::getInt4d($recordData, 10)) >> 16; + + // bit: 29-23; mask: 0x3F800000; right color + $objStyle->getBorders()->getRight()->colorIndex = (0x3F800000 & self::getInt4d($recordData, 10)) >> 23; + + // bit: 30; mask: 0x40000000; 1 = diagonal line from top left to right bottom + $diagonalDown = (0x40000000 & self::getInt4d($recordData, 10)) >> 30 ? true : false; + + // bit: 31; mask: 0x80000000; 1 = diagonal line from bottom left to top right + $diagonalUp = (0x80000000 & self::getInt4d($recordData, 10)) >> 31 ? true : false; + + if ($diagonalUp == false && $diagonalDown == false) { + $objStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_NONE); + } elseif ($diagonalUp == true && $diagonalDown == false) { + $objStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_UP); + } elseif ($diagonalUp == false && $diagonalDown == true) { + $objStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_DOWN); + } elseif ($diagonalUp == true && $diagonalDown == true) { + $objStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_BOTH); + } + + // offset: 14; size: 4; + // bit: 6-0; mask: 0x0000007F; top color + $objStyle->getBorders()->getTop()->colorIndex = (0x0000007F & self::getInt4d($recordData, 14)) >> 0; + + // bit: 13-7; mask: 0x00003F80; bottom color + $objStyle->getBorders()->getBottom()->colorIndex = (0x00003F80 & self::getInt4d($recordData, 14)) >> 7; + + // bit: 20-14; mask: 0x001FC000; diagonal color + $objStyle->getBorders()->getDiagonal()->colorIndex = (0x001FC000 & self::getInt4d($recordData, 14)) >> 14; + + // bit: 24-21; mask: 0x01E00000; diagonal style + if ($bordersDiagonalStyle = PHPExcel_Reader_Excel5_Style_Border::lookup((0x01E00000 & self::getInt4d($recordData, 14)) >> 21)) { + $objStyle->getBorders()->getDiagonal()->setBorderStyle($bordersDiagonalStyle); + } + + // bit: 31-26; mask: 0xFC000000 fill pattern + if ($fillType = PHPExcel_Reader_Excel5_Style_FillPattern::lookup((0xFC000000 & self::getInt4d($recordData, 14)) >> 26)) { + $objStyle->getFill()->setFillType($fillType); + } + // offset: 18; size: 2; pattern and background colour + // bit: 6-0; mask: 0x007F; color index for pattern color + $objStyle->getFill()->startcolorIndex = (0x007F & self::getInt2d($recordData, 18)) >> 0; + + // bit: 13-7; mask: 0x3F80; color index for pattern background + $objStyle->getFill()->endcolorIndex = (0x3F80 & self::getInt2d($recordData, 18)) >> 7; + } else { + // BIFF5 + + // offset: 7; size: 1; Text orientation and flags + $orientationAndFlags = ord($recordData{7}); + + // bit: 1-0; mask: 0x03; XF_ORIENTATION: Text orientation + $xfOrientation = (0x03 & $orientationAndFlags) >> 0; + switch ($xfOrientation) { + case 0: + $objStyle->getAlignment()->setTextRotation(0); + break; + case 1: + $objStyle->getAlignment()->setTextRotation(-165); + break; + case 2: + $objStyle->getAlignment()->setTextRotation(90); + break; + case 3: + $objStyle->getAlignment()->setTextRotation(-90); + break; + } + + // offset: 8; size: 4; cell border lines and background area + $borderAndBackground = self::getInt4d($recordData, 8); + + // bit: 6-0; mask: 0x0000007F; color index for pattern color + $objStyle->getFill()->startcolorIndex = (0x0000007F & $borderAndBackground) >> 0; + + // bit: 13-7; mask: 0x00003F80; color index for pattern background + $objStyle->getFill()->endcolorIndex = (0x00003F80 & $borderAndBackground) >> 7; + + // bit: 21-16; mask: 0x003F0000; fill pattern + $objStyle->getFill()->setFillType(PHPExcel_Reader_Excel5_Style_FillPattern::lookup((0x003F0000 & $borderAndBackground) >> 16)); + + // bit: 24-22; mask: 0x01C00000; bottom line style + $objStyle->getBorders()->getBottom()->setBorderStyle(PHPExcel_Reader_Excel5_Style_Border::lookup((0x01C00000 & $borderAndBackground) >> 22)); + + // bit: 31-25; mask: 0xFE000000; bottom line color + $objStyle->getBorders()->getBottom()->colorIndex = (0xFE000000 & $borderAndBackground) >> 25; + + // offset: 12; size: 4; cell border lines + $borderLines = self::getInt4d($recordData, 12); + + // bit: 2-0; mask: 0x00000007; top line style + $objStyle->getBorders()->getTop()->setBorderStyle(PHPExcel_Reader_Excel5_Style_Border::lookup((0x00000007 & $borderLines) >> 0)); + + // bit: 5-3; mask: 0x00000038; left line style + $objStyle->getBorders()->getLeft()->setBorderStyle(PHPExcel_Reader_Excel5_Style_Border::lookup((0x00000038 & $borderLines) >> 3)); + + // bit: 8-6; mask: 0x000001C0; right line style + $objStyle->getBorders()->getRight()->setBorderStyle(PHPExcel_Reader_Excel5_Style_Border::lookup((0x000001C0 & $borderLines) >> 6)); + + // bit: 15-9; mask: 0x0000FE00; top line color index + $objStyle->getBorders()->getTop()->colorIndex = (0x0000FE00 & $borderLines) >> 9; + + // bit: 22-16; mask: 0x007F0000; left line color index + $objStyle->getBorders()->getLeft()->colorIndex = (0x007F0000 & $borderLines) >> 16; + + // bit: 29-23; mask: 0x3F800000; right line color index + $objStyle->getBorders()->getRight()->colorIndex = (0x3F800000 & $borderLines) >> 23; + } + + // add cellStyleXf or cellXf and update mapping + if ($isCellStyleXf) { + // we only read one style XF record which is always the first + if ($this->xfIndex == 0) { + $this->phpExcel->addCellStyleXf($objStyle); + $this->mapCellStyleXfIndex[$this->xfIndex] = 0; + } + } else { + // we read all cell XF records + $this->phpExcel->addCellXf($objStyle); + $this->mapCellXfIndex[$this->xfIndex] = count($this->phpExcel->getCellXfCollection()) - 1; + } + + // update XF index for when we read next record + ++$this->xfIndex; + } + } + + + /** + * + */ + private function readXfExt() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: 2; 0x087D = repeated header + + // offset: 2; size: 2 + + // offset: 4; size: 8; not used + + // offset: 12; size: 2; record version + + // offset: 14; size: 2; index to XF record which this record modifies + $ixfe = self::getInt2d($recordData, 14); + + // offset: 16; size: 2; not used + + // offset: 18; size: 2; number of extension properties that follow + $cexts = self::getInt2d($recordData, 18); + + // start reading the actual extension data + $offset = 20; + while ($offset < $length) { + // extension type + $extType = self::getInt2d($recordData, $offset); + + // extension length + $cb = self::getInt2d($recordData, $offset + 2); + + // extension data + $extData = substr($recordData, $offset + 4, $cb); + + switch ($extType) { + case 4: // fill start color + $xclfType = self::getInt2d($extData, 0); // color type + $xclrValue = substr($extData, 4, 4); // color value (value based on color type) + + if ($xclfType == 2) { + $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + + // modify the relevant style property + if (isset($this->mapCellXfIndex[$ixfe])) { + $fill = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getFill(); + $fill->getStartColor()->setRGB($rgb); + unset($fill->startcolorIndex); // normal color index does not apply, discard + } + } + break; + case 5: // fill end color + $xclfType = self::getInt2d($extData, 0); // color type + $xclrValue = substr($extData, 4, 4); // color value (value based on color type) + + if ($xclfType == 2) { + $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + + // modify the relevant style property + if (isset($this->mapCellXfIndex[$ixfe])) { + $fill = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getFill(); + $fill->getEndColor()->setRGB($rgb); + unset($fill->endcolorIndex); // normal color index does not apply, discard + } + } + break; + case 7: // border color top + $xclfType = self::getInt2d($extData, 0); // color type + $xclrValue = substr($extData, 4, 4); // color value (value based on color type) + + if ($xclfType == 2) { + $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + + // modify the relevant style property + if (isset($this->mapCellXfIndex[$ixfe])) { + $top = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getTop(); + $top->getColor()->setRGB($rgb); + unset($top->colorIndex); // normal color index does not apply, discard + } + } + break; + case 8: // border color bottom + $xclfType = self::getInt2d($extData, 0); // color type + $xclrValue = substr($extData, 4, 4); // color value (value based on color type) + + if ($xclfType == 2) { + $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + + // modify the relevant style property + if (isset($this->mapCellXfIndex[$ixfe])) { + $bottom = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getBottom(); + $bottom->getColor()->setRGB($rgb); + unset($bottom->colorIndex); // normal color index does not apply, discard + } + } + break; + case 9: // border color left + $xclfType = self::getInt2d($extData, 0); // color type + $xclrValue = substr($extData, 4, 4); // color value (value based on color type) + + if ($xclfType == 2) { + $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + + // modify the relevant style property + if (isset($this->mapCellXfIndex[$ixfe])) { + $left = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getLeft(); + $left->getColor()->setRGB($rgb); + unset($left->colorIndex); // normal color index does not apply, discard + } + } + break; + case 10: // border color right + $xclfType = self::getInt2d($extData, 0); // color type + $xclrValue = substr($extData, 4, 4); // color value (value based on color type) + + if ($xclfType == 2) { + $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + + // modify the relevant style property + if (isset($this->mapCellXfIndex[$ixfe])) { + $right = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getRight(); + $right->getColor()->setRGB($rgb); + unset($right->colorIndex); // normal color index does not apply, discard + } + } + break; + case 11: // border color diagonal + $xclfType = self::getInt2d($extData, 0); // color type + $xclrValue = substr($extData, 4, 4); // color value (value based on color type) + + if ($xclfType == 2) { + $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + + // modify the relevant style property + if (isset($this->mapCellXfIndex[$ixfe])) { + $diagonal = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getDiagonal(); + $diagonal->getColor()->setRGB($rgb); + unset($diagonal->colorIndex); // normal color index does not apply, discard + } + } + break; + case 13: // font color + $xclfType = self::getInt2d($extData, 0); // color type + $xclrValue = substr($extData, 4, 4); // color value (value based on color type) + + if ($xclfType == 2) { + $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + + // modify the relevant style property + if (isset($this->mapCellXfIndex[$ixfe])) { + $font = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getFont(); + $font->getColor()->setRGB($rgb); + unset($font->colorIndex); // normal color index does not apply, discard + } + } + break; + } + + $offset += $cb; + } + } + + } + + + /** + * Read STYLE record + */ + private function readStyle() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: 2; index to XF record and flag for built-in style + $ixfe = self::getInt2d($recordData, 0); + + // bit: 11-0; mask 0x0FFF; index to XF record + $xfIndex = (0x0FFF & $ixfe) >> 0; + + // bit: 15; mask 0x8000; 0 = user-defined style, 1 = built-in style + $isBuiltIn = (bool) ((0x8000 & $ixfe) >> 15); + + if ($isBuiltIn) { + // offset: 2; size: 1; identifier for built-in style + $builtInId = ord($recordData{2}); + + switch ($builtInId) { + case 0x00: + // currently, we are not using this for anything + break; + default: + break; + } + } else { + // user-defined; not supported by PHPExcel + } + } + } + + + /** + * Read PALETTE record + */ + private function readPalette() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: 2; number of following colors + $nm = self::getInt2d($recordData, 0); + + // list of RGB colors + for ($i = 0; $i < $nm; ++$i) { + $rgb = substr($recordData, 2 + 4 * $i, 4); + $this->palette[] = self::readRGB($rgb); + } + } + } + + + /** + * SHEET + * + * This record is located in the Workbook Globals + * Substream and represents a sheet inside the workbook. + * One SHEET record is written for each sheet. It stores the + * sheet name and a stream offset to the BOF record of the + * respective Sheet Substream within the Workbook Stream. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + */ + private function readSheet() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // offset: 0; size: 4; absolute stream position of the BOF record of the sheet + // NOTE: not encrypted + $rec_offset = self::getInt4d($this->data, $this->pos + 4); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 4; size: 1; sheet state + switch (ord($recordData{4})) { + case 0x00: + $sheetState = PHPExcel_Worksheet::SHEETSTATE_VISIBLE; + break; + case 0x01: + $sheetState = PHPExcel_Worksheet::SHEETSTATE_HIDDEN; + break; + case 0x02: + $sheetState = PHPExcel_Worksheet::SHEETSTATE_VERYHIDDEN; + break; + default: + $sheetState = PHPExcel_Worksheet::SHEETSTATE_VISIBLE; + break; + } + + // offset: 5; size: 1; sheet type + $sheetType = ord($recordData{5}); + + // offset: 6; size: var; sheet name + if ($this->version == self::XLS_BIFF8) { + $string = self::readUnicodeStringShort(substr($recordData, 6)); + $rec_name = $string['value']; + } elseif ($this->version == self::XLS_BIFF7) { + $string = $this->readByteStringShort(substr($recordData, 6)); + $rec_name = $string['value']; + } + + $this->sheets[] = array( + 'name' => $rec_name, + 'offset' => $rec_offset, + 'sheetState' => $sheetState, + 'sheetType' => $sheetType, + ); + } + + + /** + * Read EXTERNALBOOK record + */ + private function readExternalBook() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset within record data + $offset = 0; + + // there are 4 types of records + if (strlen($recordData) > 4) { + // external reference + // offset: 0; size: 2; number of sheet names ($nm) + $nm = self::getInt2d($recordData, 0); + $offset += 2; + + // offset: 2; size: var; encoded URL without sheet name (Unicode string, 16-bit length) + $encodedUrlString = self::readUnicodeStringLong(substr($recordData, 2)); + $offset += $encodedUrlString['size']; + + // offset: var; size: var; list of $nm sheet names (Unicode strings, 16-bit length) + $externalSheetNames = array(); + for ($i = 0; $i < $nm; ++$i) { + $externalSheetNameString = self::readUnicodeStringLong(substr($recordData, $offset)); + $externalSheetNames[] = $externalSheetNameString['value']; + $offset += $externalSheetNameString['size']; + } + + // store the record data + $this->externalBooks[] = array( + 'type' => 'external', + 'encodedUrl' => $encodedUrlString['value'], + 'externalSheetNames' => $externalSheetNames, + ); + } elseif (substr($recordData, 2, 2) == pack('CC', 0x01, 0x04)) { + // internal reference + // offset: 0; size: 2; number of sheet in this document + // offset: 2; size: 2; 0x01 0x04 + $this->externalBooks[] = array( + 'type' => 'internal', + ); + } elseif (substr($recordData, 0, 4) == pack('vCC', 0x0001, 0x01, 0x3A)) { + // add-in function + // offset: 0; size: 2; 0x0001 + $this->externalBooks[] = array( + 'type' => 'addInFunction', + ); + } elseif (substr($recordData, 0, 2) == pack('v', 0x0000)) { + // DDE links, OLE links + // offset: 0; size: 2; 0x0000 + // offset: 2; size: var; encoded source document name + $this->externalBooks[] = array( + 'type' => 'DDEorOLE', + ); + } + } + + + /** + * Read EXTERNNAME record. + */ + private function readExternName() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // external sheet references provided for named cells + if ($this->version == self::XLS_BIFF8) { + // offset: 0; size: 2; options + $options = self::getInt2d($recordData, 0); + + // offset: 2; size: 2; + + // offset: 4; size: 2; not used + + // offset: 6; size: var + $nameString = self::readUnicodeStringShort(substr($recordData, 6)); + + // offset: var; size: var; formula data + $offset = 6 + $nameString['size']; + $formula = $this->getFormulaFromStructure(substr($recordData, $offset)); + + $this->externalNames[] = array( + 'name' => $nameString['value'], + 'formula' => $formula, + ); + } + } + + + /** + * Read EXTERNSHEET record + */ + private function readExternSheet() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // external sheet references provided for named cells + if ($this->version == self::XLS_BIFF8) { + // offset: 0; size: 2; number of following ref structures + $nm = self::getInt2d($recordData, 0); + for ($i = 0; $i < $nm; ++$i) { + $this->ref[] = array( + // offset: 2 + 6 * $i; index to EXTERNALBOOK record + 'externalBookIndex' => self::getInt2d($recordData, 2 + 6 * $i), + // offset: 4 + 6 * $i; index to first sheet in EXTERNALBOOK record + 'firstSheetIndex' => self::getInt2d($recordData, 4 + 6 * $i), + // offset: 6 + 6 * $i; index to last sheet in EXTERNALBOOK record + 'lastSheetIndex' => self::getInt2d($recordData, 6 + 6 * $i), + ); + } + } + } + + + /** + * DEFINEDNAME + * + * This record is part of a Link Table. It contains the name + * and the token array of an internal defined name. Token + * arrays of defined names contain tokens with aberrant + * token classes. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + */ + private function readDefinedName() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if ($this->version == self::XLS_BIFF8) { + // retrieves named cells + + // offset: 0; size: 2; option flags + $opts = self::getInt2d($recordData, 0); + + // bit: 5; mask: 0x0020; 0 = user-defined name, 1 = built-in-name + $isBuiltInName = (0x0020 & $opts) >> 5; + + // offset: 2; size: 1; keyboard shortcut + + // offset: 3; size: 1; length of the name (character count) + $nlen = ord($recordData{3}); + + // offset: 4; size: 2; size of the formula data (it can happen that this is zero) + // note: there can also be additional data, this is not included in $flen + $flen = self::getInt2d($recordData, 4); + + // offset: 8; size: 2; 0=Global name, otherwise index to sheet (1-based) + $scope = self::getInt2d($recordData, 8); + + // offset: 14; size: var; Name (Unicode string without length field) + $string = self::readUnicodeString(substr($recordData, 14), $nlen); + + // offset: var; size: $flen; formula data + $offset = 14 + $string['size']; + $formulaStructure = pack('v', $flen) . substr($recordData, $offset); + + try { + $formula = $this->getFormulaFromStructure($formulaStructure); + } catch (PHPExcel_Exception $e) { + $formula = ''; + } + + $this->definedname[] = array( + 'isBuiltInName' => $isBuiltInName, + 'name' => $string['value'], + 'formula' => $formula, + 'scope' => $scope, + ); + } + } + + + /** + * Read MSODRAWINGGROUP record + */ + private function readMsoDrawingGroup() + { + $length = self::getInt2d($this->data, $this->pos + 2); + + // get spliced record data + $splicedRecordData = $this->getSplicedRecordData(); + $recordData = $splicedRecordData['recordData']; + + $this->drawingGroupData .= $recordData; + } + + + /** + * SST - Shared String Table + * + * This record contains a list of all strings used anywhere + * in the workbook. Each string occurs only once. The + * workbook uses indexes into the list to reference the + * strings. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + **/ + private function readSst() + { + // offset within (spliced) record data + $pos = 0; + + // get spliced record data + $splicedRecordData = $this->getSplicedRecordData(); + + $recordData = $splicedRecordData['recordData']; + $spliceOffsets = $splicedRecordData['spliceOffsets']; + + // offset: 0; size: 4; total number of strings in the workbook + $pos += 4; + + // offset: 4; size: 4; number of following strings ($nm) + $nm = self::getInt4d($recordData, 4); + $pos += 4; + + // loop through the Unicode strings (16-bit length) + for ($i = 0; $i < $nm; ++$i) { + // number of characters in the Unicode string + $numChars = self::getInt2d($recordData, $pos); + $pos += 2; + + // option flags + $optionFlags = ord($recordData{$pos}); + ++$pos; + + // bit: 0; mask: 0x01; 0 = compressed; 1 = uncompressed + $isCompressed = (($optionFlags & 0x01) == 0) ; + + // bit: 2; mask: 0x02; 0 = ordinary; 1 = Asian phonetic + $hasAsian = (($optionFlags & 0x04) != 0); + + // bit: 3; mask: 0x03; 0 = ordinary; 1 = Rich-Text + $hasRichText = (($optionFlags & 0x08) != 0); + + if ($hasRichText) { + // number of Rich-Text formatting runs + $formattingRuns = self::getInt2d($recordData, $pos); + $pos += 2; + } + + if ($hasAsian) { + // size of Asian phonetic setting + $extendedRunLength = self::getInt4d($recordData, $pos); + $pos += 4; + } + + // expected byte length of character array if not split + $len = ($isCompressed) ? $numChars : $numChars * 2; + + // look up limit position + foreach ($spliceOffsets as $spliceOffset) { + // it can happen that the string is empty, therefore we need + // <= and not just < + if ($pos <= $spliceOffset) { + $limitpos = $spliceOffset; + break; + } + } + + if ($pos + $len <= $limitpos) { + // character array is not split between records + + $retstr = substr($recordData, $pos, $len); + $pos += $len; + } else { + // character array is split between records + + // first part of character array + $retstr = substr($recordData, $pos, $limitpos - $pos); + + $bytesRead = $limitpos - $pos; + + // remaining characters in Unicode string + $charsLeft = $numChars - (($isCompressed) ? $bytesRead : ($bytesRead / 2)); + + $pos = $limitpos; + + // keep reading the characters + while ($charsLeft > 0) { + // look up next limit position, in case the string span more than one continue record + foreach ($spliceOffsets as $spliceOffset) { + if ($pos < $spliceOffset) { + $limitpos = $spliceOffset; + break; + } + } + + // repeated option flags + // OpenOffice.org documentation 5.21 + $option = ord($recordData{$pos}); + ++$pos; + + if ($isCompressed && ($option == 0)) { + // 1st fragment compressed + // this fragment compressed + $len = min($charsLeft, $limitpos - $pos); + $retstr .= substr($recordData, $pos, $len); + $charsLeft -= $len; + $isCompressed = true; + } elseif (!$isCompressed && ($option != 0)) { + // 1st fragment uncompressed + // this fragment uncompressed + $len = min($charsLeft * 2, $limitpos - $pos); + $retstr .= substr($recordData, $pos, $len); + $charsLeft -= $len / 2; + $isCompressed = false; + } elseif (!$isCompressed && ($option == 0)) { + // 1st fragment uncompressed + // this fragment compressed + $len = min($charsLeft, $limitpos - $pos); + for ($j = 0; $j < $len; ++$j) { + $retstr .= $recordData{$pos + $j} . chr(0); + } + $charsLeft -= $len; + $isCompressed = false; + } else { + // 1st fragment compressed + // this fragment uncompressed + $newstr = ''; + for ($j = 0; $j < strlen($retstr); ++$j) { + $newstr .= $retstr[$j] . chr(0); + } + $retstr = $newstr; + $len = min($charsLeft * 2, $limitpos - $pos); + $retstr .= substr($recordData, $pos, $len); + $charsLeft -= $len / 2; + $isCompressed = false; + } + + $pos += $len; + } + } + + // convert to UTF-8 + $retstr = self::encodeUTF16($retstr, $isCompressed); + + // read additional Rich-Text information, if any + $fmtRuns = array(); + if ($hasRichText) { + // list of formatting runs + for ($j = 0; $j < $formattingRuns; ++$j) { + // first formatted character; zero-based + $charPos = self::getInt2d($recordData, $pos + $j * 4); + + // index to font record + $fontIndex = self::getInt2d($recordData, $pos + 2 + $j * 4); + + $fmtRuns[] = array( + 'charPos' => $charPos, + 'fontIndex' => $fontIndex, + ); + } + $pos += 4 * $formattingRuns; + } + + // read additional Asian phonetics information, if any + if ($hasAsian) { + // For Asian phonetic settings, we skip the extended string data + $pos += $extendedRunLength; + } + + // store the shared sting + $this->sst[] = array( + 'value' => $retstr, + 'fmtRuns' => $fmtRuns, + ); + } + + // getSplicedRecordData() takes care of moving current position in data stream + } + + + /** + * Read PRINTGRIDLINES record + */ + private function readPrintGridlines() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if ($this->version == self::XLS_BIFF8 && !$this->readDataOnly) { + // offset: 0; size: 2; 0 = do not print sheet grid lines; 1 = print sheet gridlines + $printGridlines = (bool) self::getInt2d($recordData, 0); + $this->phpSheet->setPrintGridlines($printGridlines); + } + } + + + /** + * Read DEFAULTROWHEIGHT record + */ + private function readDefaultRowHeight() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0; size: 2; option flags + // offset: 2; size: 2; default height for unused rows, (twips 1/20 point) + $height = self::getInt2d($recordData, 2); + $this->phpSheet->getDefaultRowDimension()->setRowHeight($height / 20); + } + + + /** + * Read SHEETPR record + */ + private function readSheetPr() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0; size: 2 + + // bit: 6; mask: 0x0040; 0 = outline buttons above outline group + $isSummaryBelow = (0x0040 & self::getInt2d($recordData, 0)) >> 6; + $this->phpSheet->setShowSummaryBelow($isSummaryBelow); + + // bit: 7; mask: 0x0080; 0 = outline buttons left of outline group + $isSummaryRight = (0x0080 & self::getInt2d($recordData, 0)) >> 7; + $this->phpSheet->setShowSummaryRight($isSummaryRight); + + // bit: 8; mask: 0x100; 0 = scale printout in percent, 1 = fit printout to number of pages + // this corresponds to radio button setting in page setup dialog in Excel + $this->isFitToPages = (bool) ((0x0100 & self::getInt2d($recordData, 0)) >> 8); + } + + + /** + * Read HORIZONTALPAGEBREAKS record + */ + private function readHorizontalPageBreaks() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if ($this->version == self::XLS_BIFF8 && !$this->readDataOnly) { + // offset: 0; size: 2; number of the following row index structures + $nm = self::getInt2d($recordData, 0); + + // offset: 2; size: 6 * $nm; list of $nm row index structures + for ($i = 0; $i < $nm; ++$i) { + $r = self::getInt2d($recordData, 2 + 6 * $i); + $cf = self::getInt2d($recordData, 2 + 6 * $i + 2); + $cl = self::getInt2d($recordData, 2 + 6 * $i + 4); + + // not sure why two column indexes are necessary? + $this->phpSheet->setBreakByColumnAndRow($cf, $r, PHPExcel_Worksheet::BREAK_ROW); + } + } + } + + + /** + * Read VERTICALPAGEBREAKS record + */ + private function readVerticalPageBreaks() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if ($this->version == self::XLS_BIFF8 && !$this->readDataOnly) { + // offset: 0; size: 2; number of the following column index structures + $nm = self::getInt2d($recordData, 0); + + // offset: 2; size: 6 * $nm; list of $nm row index structures + for ($i = 0; $i < $nm; ++$i) { + $c = self::getInt2d($recordData, 2 + 6 * $i); + $rf = self::getInt2d($recordData, 2 + 6 * $i + 2); + $rl = self::getInt2d($recordData, 2 + 6 * $i + 4); + + // not sure why two row indexes are necessary? + $this->phpSheet->setBreakByColumnAndRow($c, $rf, PHPExcel_Worksheet::BREAK_COLUMN); + } + } + } + + + /** + * Read HEADER record + */ + private function readHeader() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: var + // realized that $recordData can be empty even when record exists + if ($recordData) { + if ($this->version == self::XLS_BIFF8) { + $string = self::readUnicodeStringLong($recordData); + } else { + $string = $this->readByteStringShort($recordData); + } + + $this->phpSheet->getHeaderFooter()->setOddHeader($string['value']); + $this->phpSheet->getHeaderFooter()->setEvenHeader($string['value']); + } + } + } + + + /** + * Read FOOTER record + */ + private function readFooter() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: var + // realized that $recordData can be empty even when record exists + if ($recordData) { + if ($this->version == self::XLS_BIFF8) { + $string = self::readUnicodeStringLong($recordData); + } else { + $string = $this->readByteStringShort($recordData); + } + $this->phpSheet->getHeaderFooter()->setOddFooter($string['value']); + $this->phpSheet->getHeaderFooter()->setEvenFooter($string['value']); + } + } + } + + + /** + * Read HCENTER record + */ + private function readHcenter() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: 2; 0 = print sheet left aligned, 1 = print sheet centered horizontally + $isHorizontalCentered = (bool) self::getInt2d($recordData, 0); + + $this->phpSheet->getPageSetup()->setHorizontalCentered($isHorizontalCentered); + } + } + + + /** + * Read VCENTER record + */ + private function readVcenter() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: 2; 0 = print sheet aligned at top page border, 1 = print sheet vertically centered + $isVerticalCentered = (bool) self::getInt2d($recordData, 0); + + $this->phpSheet->getPageSetup()->setVerticalCentered($isVerticalCentered); + } + } + + + /** + * Read LEFTMARGIN record + */ + private function readLeftMargin() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: 8 + $this->phpSheet->getPageMargins()->setLeft(self::extractNumber($recordData)); + } + } + + + /** + * Read RIGHTMARGIN record + */ + private function readRightMargin() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: 8 + $this->phpSheet->getPageMargins()->setRight(self::extractNumber($recordData)); + } + } + + + /** + * Read TOPMARGIN record + */ + private function readTopMargin() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: 8 + $this->phpSheet->getPageMargins()->setTop(self::extractNumber($recordData)); + } + } + + + /** + * Read BOTTOMMARGIN record + */ + private function readBottomMargin() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: 8 + $this->phpSheet->getPageMargins()->setBottom(self::extractNumber($recordData)); + } + } + + + /** + * Read PAGESETUP record + */ + private function readPageSetup() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: 2; paper size + $paperSize = self::getInt2d($recordData, 0); + + // offset: 2; size: 2; scaling factor + $scale = self::getInt2d($recordData, 2); + + // offset: 6; size: 2; fit worksheet width to this number of pages, 0 = use as many as needed + $fitToWidth = self::getInt2d($recordData, 6); + + // offset: 8; size: 2; fit worksheet height to this number of pages, 0 = use as many as needed + $fitToHeight = self::getInt2d($recordData, 8); + + // offset: 10; size: 2; option flags + + // bit: 1; mask: 0x0002; 0=landscape, 1=portrait + $isPortrait = (0x0002 & self::getInt2d($recordData, 10)) >> 1; + + // bit: 2; mask: 0x0004; 1= paper size, scaling factor, paper orient. not init + // when this bit is set, do not use flags for those properties + $isNotInit = (0x0004 & self::getInt2d($recordData, 10)) >> 2; + + if (!$isNotInit) { + $this->phpSheet->getPageSetup()->setPaperSize($paperSize); + switch ($isPortrait) { + case 0: + $this->phpSheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE); + break; + case 1: + $this->phpSheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT); + break; + } + + $this->phpSheet->getPageSetup()->setScale($scale, false); + $this->phpSheet->getPageSetup()->setFitToPage((bool) $this->isFitToPages); + $this->phpSheet->getPageSetup()->setFitToWidth($fitToWidth, false); + $this->phpSheet->getPageSetup()->setFitToHeight($fitToHeight, false); + } + + // offset: 16; size: 8; header margin (IEEE 754 floating-point value) + $marginHeader = self::extractNumber(substr($recordData, 16, 8)); + $this->phpSheet->getPageMargins()->setHeader($marginHeader); + + // offset: 24; size: 8; footer margin (IEEE 754 floating-point value) + $marginFooter = self::extractNumber(substr($recordData, 24, 8)); + $this->phpSheet->getPageMargins()->setFooter($marginFooter); + } + } + + + /** + * PROTECT - Sheet protection (BIFF2 through BIFF8) + * if this record is omitted, then it also means no sheet protection + */ + private function readProtect() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if ($this->readDataOnly) { + return; + } + + // offset: 0; size: 2; + + // bit 0, mask 0x01; 1 = sheet is protected + $bool = (0x01 & self::getInt2d($recordData, 0)) >> 0; + $this->phpSheet->getProtection()->setSheet((bool)$bool); + } + + + /** + * SCENPROTECT + */ + private function readScenProtect() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if ($this->readDataOnly) { + return; + } + + // offset: 0; size: 2; + + // bit: 0, mask 0x01; 1 = scenarios are protected + $bool = (0x01 & self::getInt2d($recordData, 0)) >> 0; + + $this->phpSheet->getProtection()->setScenarios((bool)$bool); + } + + + /** + * OBJECTPROTECT + */ + private function readObjectProtect() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if ($this->readDataOnly) { + return; + } + + // offset: 0; size: 2; + + // bit: 0, mask 0x01; 1 = objects are protected + $bool = (0x01 & self::getInt2d($recordData, 0)) >> 0; + + $this->phpSheet->getProtection()->setObjects((bool)$bool); + } + + + /** + * PASSWORD - Sheet protection (hashed) password (BIFF2 through BIFF8) + */ + private function readPassword() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: 2; 16-bit hash value of password + $password = strtoupper(dechex(self::getInt2d($recordData, 0))); // the hashed password + $this->phpSheet->getProtection()->setPassword($password, true); + } + } + + + /** + * Read DEFCOLWIDTH record + */ + private function readDefColWidth() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0; size: 2; default column width + $width = self::getInt2d($recordData, 0); + if ($width != 8) { + $this->phpSheet->getDefaultColumnDimension()->setWidth($width); + } + } + + + /** + * Read COLINFO record + */ + private function readColInfo() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: 2; index to first column in range + $fc = self::getInt2d($recordData, 0); // first column index + + // offset: 2; size: 2; index to last column in range + $lc = self::getInt2d($recordData, 2); // first column index + + // offset: 4; size: 2; width of the column in 1/256 of the width of the zero character + $width = self::getInt2d($recordData, 4); + + // offset: 6; size: 2; index to XF record for default column formatting + $xfIndex = self::getInt2d($recordData, 6); + + // offset: 8; size: 2; option flags + // bit: 0; mask: 0x0001; 1= columns are hidden + $isHidden = (0x0001 & self::getInt2d($recordData, 8)) >> 0; + + // bit: 10-8; mask: 0x0700; outline level of the columns (0 = no outline) + $level = (0x0700 & self::getInt2d($recordData, 8)) >> 8; + + // bit: 12; mask: 0x1000; 1 = collapsed + $isCollapsed = (0x1000 & self::getInt2d($recordData, 8)) >> 12; + + // offset: 10; size: 2; not used + + for ($i = $fc; $i <= $lc; ++$i) { + if ($lc == 255 || $lc == 256) { + $this->phpSheet->getDefaultColumnDimension()->setWidth($width / 256); + break; + } + $this->phpSheet->getColumnDimensionByColumn($i)->setWidth($width / 256); + $this->phpSheet->getColumnDimensionByColumn($i)->setVisible(!$isHidden); + $this->phpSheet->getColumnDimensionByColumn($i)->setOutlineLevel($level); + $this->phpSheet->getColumnDimensionByColumn($i)->setCollapsed($isCollapsed); + $this->phpSheet->getColumnDimensionByColumn($i)->setXfIndex($this->mapCellXfIndex[$xfIndex]); + } + } + } + + + /** + * ROW + * + * This record contains the properties of a single row in a + * sheet. Rows and cells in a sheet are divided into blocks + * of 32 rows. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + */ + private function readRow() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: 2; index of this row + $r = self::getInt2d($recordData, 0); + + // offset: 2; size: 2; index to column of the first cell which is described by a cell record + + // offset: 4; size: 2; index to column of the last cell which is described by a cell record, increased by 1 + + // offset: 6; size: 2; + + // bit: 14-0; mask: 0x7FFF; height of the row, in twips = 1/20 of a point + $height = (0x7FFF & self::getInt2d($recordData, 6)) >> 0; + + // bit: 15: mask: 0x8000; 0 = row has custom height; 1= row has default height + $useDefaultHeight = (0x8000 & self::getInt2d($recordData, 6)) >> 15; + + if (!$useDefaultHeight) { + $this->phpSheet->getRowDimension($r + 1)->setRowHeight($height / 20); + } + + // offset: 8; size: 2; not used + + // offset: 10; size: 2; not used in BIFF5-BIFF8 + + // offset: 12; size: 4; option flags and default row formatting + + // bit: 2-0: mask: 0x00000007; outline level of the row + $level = (0x00000007 & self::getInt4d($recordData, 12)) >> 0; + $this->phpSheet->getRowDimension($r + 1)->setOutlineLevel($level); + + // bit: 4; mask: 0x00000010; 1 = outline group start or ends here... and is collapsed + $isCollapsed = (0x00000010 & self::getInt4d($recordData, 12)) >> 4; + $this->phpSheet->getRowDimension($r + 1)->setCollapsed($isCollapsed); + + // bit: 5; mask: 0x00000020; 1 = row is hidden + $isHidden = (0x00000020 & self::getInt4d($recordData, 12)) >> 5; + $this->phpSheet->getRowDimension($r + 1)->setVisible(!$isHidden); + + // bit: 7; mask: 0x00000080; 1 = row has explicit format + $hasExplicitFormat = (0x00000080 & self::getInt4d($recordData, 12)) >> 7; + + // bit: 27-16; mask: 0x0FFF0000; only applies when hasExplicitFormat = 1; index to XF record + $xfIndex = (0x0FFF0000 & self::getInt4d($recordData, 12)) >> 16; + + if ($hasExplicitFormat) { + $this->phpSheet->getRowDimension($r + 1)->setXfIndex($this->mapCellXfIndex[$xfIndex]); + } + } + } + + + /** + * Read RK record + * This record represents a cell that contains an RK value + * (encoded integer or floating-point value). If a + * floating-point value cannot be encoded to an RK value, + * a NUMBER record will be written. This record replaces the + * record INTEGER written in BIFF2. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + */ + private function readRk() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0; size: 2; index to row + $row = self::getInt2d($recordData, 0); + + // offset: 2; size: 2; index to column + $column = self::getInt2d($recordData, 2); + $columnString = PHPExcel_Cell::stringFromColumnIndex($column); + + // Read cell? + if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { + // offset: 4; size: 2; index to XF record + $xfIndex = self::getInt2d($recordData, 4); + + // offset: 6; size: 4; RK value + $rknum = self::getInt4d($recordData, 6); + $numValue = self::getIEEE754($rknum); + + $cell = $this->phpSheet->getCell($columnString . ($row + 1)); + if (!$this->readDataOnly) { + // add style information + $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]); + } + + // add cell + $cell->setValueExplicit($numValue, PHPExcel_Cell_DataType::TYPE_NUMERIC); + } + } + + + /** + * Read LABELSST record + * This record represents a cell that contains a string. It + * replaces the LABEL record and RSTRING record used in + * BIFF2-BIFF5. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + */ + private function readLabelSst() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0; size: 2; index to row + $row = self::getInt2d($recordData, 0); + + // offset: 2; size: 2; index to column + $column = self::getInt2d($recordData, 2); + $columnString = PHPExcel_Cell::stringFromColumnIndex($column); + + $emptyCell = true; + // Read cell? + if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { + // offset: 4; size: 2; index to XF record + $xfIndex = self::getInt2d($recordData, 4); + + // offset: 6; size: 4; index to SST record + $index = self::getInt4d($recordData, 6); + + // add cell + if (($fmtRuns = $this->sst[$index]['fmtRuns']) && !$this->readDataOnly) { + // then we should treat as rich text + $richText = new PHPExcel_RichText(); + $charPos = 0; + $sstCount = count($this->sst[$index]['fmtRuns']); + for ($i = 0; $i <= $sstCount; ++$i) { + if (isset($fmtRuns[$i])) { + $text = PHPExcel_Shared_String::Substring($this->sst[$index]['value'], $charPos, $fmtRuns[$i]['charPos'] - $charPos); + $charPos = $fmtRuns[$i]['charPos']; + } else { + $text = PHPExcel_Shared_String::Substring($this->sst[$index]['value'], $charPos, PHPExcel_Shared_String::CountCharacters($this->sst[$index]['value'])); + } + + if (PHPExcel_Shared_String::CountCharacters($text) > 0) { + if ($i == 0) { // first text run, no style + $richText->createText($text); + } else { + $textRun = $richText->createTextRun($text); + if (isset($fmtRuns[$i - 1])) { + if ($fmtRuns[$i - 1]['fontIndex'] < 4) { + $fontIndex = $fmtRuns[$i - 1]['fontIndex']; + } else { + // this has to do with that index 4 is omitted in all BIFF versions for some strange reason + // check the OpenOffice documentation of the FONT record + $fontIndex = $fmtRuns[$i - 1]['fontIndex'] - 1; + } + $textRun->setFont(clone $this->objFonts[$fontIndex]); + } + } + } + } + if ($this->readEmptyCells || trim($richText->getPlainText()) !== '') { + $cell = $this->phpSheet->getCell($columnString . ($row + 1)); + $cell->setValueExplicit($richText, PHPExcel_Cell_DataType::TYPE_STRING); + $emptyCell = false; + } + } else { + if ($this->readEmptyCells || trim($this->sst[$index]['value']) !== '') { + $cell = $this->phpSheet->getCell($columnString . ($row + 1)); + $cell->setValueExplicit($this->sst[$index]['value'], PHPExcel_Cell_DataType::TYPE_STRING); + $emptyCell = false; + } + } + + if (!$this->readDataOnly && !$emptyCell) { + // add style information + $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]); + } + } + } + + + /** + * Read MULRK record + * This record represents a cell range containing RK value + * cells. All cells are located in the same row. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + */ + private function readMulRk() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0; size: 2; index to row + $row = self::getInt2d($recordData, 0); + + // offset: 2; size: 2; index to first column + $colFirst = self::getInt2d($recordData, 2); + + // offset: var; size: 2; index to last column + $colLast = self::getInt2d($recordData, $length - 2); + $columns = $colLast - $colFirst + 1; + + // offset within record data + $offset = 4; + + for ($i = 0; $i < $columns; ++$i) { + $columnString = PHPExcel_Cell::stringFromColumnIndex($colFirst + $i); + + // Read cell? + if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { + // offset: var; size: 2; index to XF record + $xfIndex = self::getInt2d($recordData, $offset); + + // offset: var; size: 4; RK value + $numValue = self::getIEEE754(self::getInt4d($recordData, $offset + 2)); + $cell = $this->phpSheet->getCell($columnString . ($row + 1)); + if (!$this->readDataOnly) { + // add style + $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]); + } + + // add cell value + $cell->setValueExplicit($numValue, PHPExcel_Cell_DataType::TYPE_NUMERIC); + } + + $offset += 6; + } + } + + + /** + * Read NUMBER record + * This record represents a cell that contains a + * floating-point value. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + */ + private function readNumber() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0; size: 2; index to row + $row = self::getInt2d($recordData, 0); + + // offset: 2; size 2; index to column + $column = self::getInt2d($recordData, 2); + $columnString = PHPExcel_Cell::stringFromColumnIndex($column); + + // Read cell? + if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { + // offset 4; size: 2; index to XF record + $xfIndex = self::getInt2d($recordData, 4); + + $numValue = self::extractNumber(substr($recordData, 6, 8)); + + $cell = $this->phpSheet->getCell($columnString . ($row + 1)); + if (!$this->readDataOnly) { + // add cell style + $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]); + } + + // add cell value + $cell->setValueExplicit($numValue, PHPExcel_Cell_DataType::TYPE_NUMERIC); + } + } + + + /** + * Read FORMULA record + perhaps a following STRING record if formula result is a string + * This record contains the token array and the result of a + * formula cell. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + */ + private function readFormula() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0; size: 2; row index + $row = self::getInt2d($recordData, 0); + + // offset: 2; size: 2; col index + $column = self::getInt2d($recordData, 2); + $columnString = PHPExcel_Cell::stringFromColumnIndex($column); + + // offset: 20: size: variable; formula structure + $formulaStructure = substr($recordData, 20); + + // offset: 14: size: 2; option flags, recalculate always, recalculate on open etc. + $options = self::getInt2d($recordData, 14); + + // bit: 0; mask: 0x0001; 1 = recalculate always + // bit: 1; mask: 0x0002; 1 = calculate on open + // bit: 2; mask: 0x0008; 1 = part of a shared formula + $isPartOfSharedFormula = (bool) (0x0008 & $options); + + // WARNING: + // We can apparently not rely on $isPartOfSharedFormula. Even when $isPartOfSharedFormula = true + // the formula data may be ordinary formula data, therefore we need to check + // explicitly for the tExp token (0x01) + $isPartOfSharedFormula = $isPartOfSharedFormula && ord($formulaStructure{2}) == 0x01; + + if ($isPartOfSharedFormula) { + // part of shared formula which means there will be a formula with a tExp token and nothing else + // get the base cell, grab tExp token + $baseRow = self::getInt2d($formulaStructure, 3); + $baseCol = self::getInt2d($formulaStructure, 5); + $this->_baseCell = PHPExcel_Cell::stringFromColumnIndex($baseCol). ($baseRow + 1); + } + + // Read cell? + if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { + if ($isPartOfSharedFormula) { + // formula is added to this cell after the sheet has been read + $this->sharedFormulaParts[$columnString . ($row + 1)] = $this->_baseCell; + } + + // offset: 16: size: 4; not used + + // offset: 4; size: 2; XF index + $xfIndex = self::getInt2d($recordData, 4); + + // offset: 6; size: 8; result of the formula + if ((ord($recordData{6}) == 0) && (ord($recordData{12}) == 255) && (ord($recordData{13}) == 255)) { + // String formula. Result follows in appended STRING record + $dataType = PHPExcel_Cell_DataType::TYPE_STRING; + + // read possible SHAREDFMLA record + $code = self::getInt2d($this->data, $this->pos); + if ($code == self::XLS_TYPE_SHAREDFMLA) { + $this->readSharedFmla(); + } + + // read STRING record + $value = $this->readString(); + } elseif ((ord($recordData{6}) == 1) + && (ord($recordData{12}) == 255) + && (ord($recordData{13}) == 255)) { + // Boolean formula. Result is in +2; 0=false, 1=true + $dataType = PHPExcel_Cell_DataType::TYPE_BOOL; + $value = (bool) ord($recordData{8}); + } elseif ((ord($recordData{6}) == 2) + && (ord($recordData{12}) == 255) + && (ord($recordData{13}) == 255)) { + // Error formula. Error code is in +2 + $dataType = PHPExcel_Cell_DataType::TYPE_ERROR; + $value = PHPExcel_Reader_Excel5_ErrorCode::lookup(ord($recordData{8})); + } elseif ((ord($recordData{6}) == 3) + && (ord($recordData{12}) == 255) + && (ord($recordData{13}) == 255)) { + // Formula result is a null string + $dataType = PHPExcel_Cell_DataType::TYPE_NULL; + $value = ''; + } else { + // forumla result is a number, first 14 bytes like _NUMBER record + $dataType = PHPExcel_Cell_DataType::TYPE_NUMERIC; + $value = self::extractNumber(substr($recordData, 6, 8)); + } + + $cell = $this->phpSheet->getCell($columnString . ($row + 1)); + if (!$this->readDataOnly) { + // add cell style + $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]); + } + + // store the formula + if (!$isPartOfSharedFormula) { + // not part of shared formula + // add cell value. If we can read formula, populate with formula, otherwise just used cached value + try { + if ($this->version != self::XLS_BIFF8) { + throw new PHPExcel_Reader_Exception('Not BIFF8. Can only read BIFF8 formulas'); + } + $formula = $this->getFormulaFromStructure($formulaStructure); // get formula in human language + $cell->setValueExplicit('=' . $formula, PHPExcel_Cell_DataType::TYPE_FORMULA); + + } catch (PHPExcel_Exception $e) { + $cell->setValueExplicit($value, $dataType); + } + } else { + if ($this->version == self::XLS_BIFF8) { + // do nothing at this point, formula id added later in the code + } else { + $cell->setValueExplicit($value, $dataType); + } + } + + // store the cached calculated value + $cell->setCalculatedValue($value); + } + } + + + /** + * Read a SHAREDFMLA record. This function just stores the binary shared formula in the reader, + * which usually contains relative references. + * These will be used to construct the formula in each shared formula part after the sheet is read. + */ + private function readSharedFmla() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0, size: 6; cell range address of the area used by the shared formula, not used for anything + $cellRange = substr($recordData, 0, 6); + $cellRange = $this->readBIFF5CellRangeAddressFixed($cellRange); // note: even BIFF8 uses BIFF5 syntax + + // offset: 6, size: 1; not used + + // offset: 7, size: 1; number of existing FORMULA records for this shared formula + $no = ord($recordData{7}); + + // offset: 8, size: var; Binary token array of the shared formula + $formula = substr($recordData, 8); + + // at this point we only store the shared formula for later use + $this->sharedFormulas[$this->_baseCell] = $formula; + } + + + /** + * Read a STRING record from current stream position and advance the stream pointer to next record + * This record is used for storing result from FORMULA record when it is a string, and + * it occurs directly after the FORMULA record + * + * @return string The string contents as UTF-8 + */ + private function readString() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if ($this->version == self::XLS_BIFF8) { + $string = self::readUnicodeStringLong($recordData); + $value = $string['value']; + } else { + $string = $this->readByteStringLong($recordData); + $value = $string['value']; + } + + return $value; + } + + + /** + * Read BOOLERR record + * This record represents a Boolean value or error value + * cell. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + */ + private function readBoolErr() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0; size: 2; row index + $row = self::getInt2d($recordData, 0); + + // offset: 2; size: 2; column index + $column = self::getInt2d($recordData, 2); + $columnString = PHPExcel_Cell::stringFromColumnIndex($column); + + // Read cell? + if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { + // offset: 4; size: 2; index to XF record + $xfIndex = self::getInt2d($recordData, 4); + + // offset: 6; size: 1; the boolean value or error value + $boolErr = ord($recordData{6}); + + // offset: 7; size: 1; 0=boolean; 1=error + $isError = ord($recordData{7}); + + $cell = $this->phpSheet->getCell($columnString . ($row + 1)); + switch ($isError) { + case 0: // boolean + $value = (bool) $boolErr; + + // add cell value + $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_BOOL); + break; + case 1: // error type + $value = PHPExcel_Reader_Excel5_ErrorCode::lookup($boolErr); + + // add cell value + $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_ERROR); + break; + } + + if (!$this->readDataOnly) { + // add cell style + $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]); + } + } + } + + + /** + * Read MULBLANK record + * This record represents a cell range of empty cells. All + * cells are located in the same row + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + */ + private function readMulBlank() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0; size: 2; index to row + $row = self::getInt2d($recordData, 0); + + // offset: 2; size: 2; index to first column + $fc = self::getInt2d($recordData, 2); + + // offset: 4; size: 2 x nc; list of indexes to XF records + // add style information + if (!$this->readDataOnly && $this->readEmptyCells) { + for ($i = 0; $i < $length / 2 - 3; ++$i) { + $columnString = PHPExcel_Cell::stringFromColumnIndex($fc + $i); + + // Read cell? + if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { + $xfIndex = self::getInt2d($recordData, 4 + 2 * $i); + $this->phpSheet->getCell($columnString . ($row + 1))->setXfIndex($this->mapCellXfIndex[$xfIndex]); + } + } + } + + // offset: 6; size 2; index to last column (not needed) + } + + + /** + * Read LABEL record + * This record represents a cell that contains a string. In + * BIFF8 it is usually replaced by the LABELSST record. + * Excel still uses this record, if it copies unformatted + * text cells to the clipboard. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + */ + private function readLabel() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0; size: 2; index to row + $row = self::getInt2d($recordData, 0); + + // offset: 2; size: 2; index to column + $column = self::getInt2d($recordData, 2); + $columnString = PHPExcel_Cell::stringFromColumnIndex($column); + + // Read cell? + if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { + // offset: 4; size: 2; XF index + $xfIndex = self::getInt2d($recordData, 4); + + // add cell value + // todo: what if string is very long? continue record + if ($this->version == self::XLS_BIFF8) { + $string = self::readUnicodeStringLong(substr($recordData, 6)); + $value = $string['value']; + } else { + $string = $this->readByteStringLong(substr($recordData, 6)); + $value = $string['value']; + } + if ($this->readEmptyCells || trim($value) !== '') { + $cell = $this->phpSheet->getCell($columnString . ($row + 1)); + $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_STRING); + + if (!$this->readDataOnly) { + // add cell style + $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]); + } + } + } + } + + + /** + * Read BLANK record + */ + private function readBlank() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0; size: 2; row index + $row = self::getInt2d($recordData, 0); + + // offset: 2; size: 2; col index + $col = self::getInt2d($recordData, 2); + $columnString = PHPExcel_Cell::stringFromColumnIndex($col); + + // Read cell? + if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { + // offset: 4; size: 2; XF index + $xfIndex = self::getInt2d($recordData, 4); + + // add style information + if (!$this->readDataOnly && $this->readEmptyCells) { + $this->phpSheet->getCell($columnString . ($row + 1))->setXfIndex($this->mapCellXfIndex[$xfIndex]); + } + } + } + + + /** + * Read MSODRAWING record + */ + private function readMsoDrawing() + { + $length = self::getInt2d($this->data, $this->pos + 2); + + // get spliced record data + $splicedRecordData = $this->getSplicedRecordData(); + $recordData = $splicedRecordData['recordData']; + + $this->drawingData .= $recordData; + } + + + /** + * Read OBJ record + */ + private function readObj() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if ($this->readDataOnly || $this->version != self::XLS_BIFF8) { + return; + } + + // recordData consists of an array of subrecords looking like this: + // ft: 2 bytes; ftCmo type (0x15) + // cb: 2 bytes; size in bytes of ftCmo data + // ot: 2 bytes; Object Type + // id: 2 bytes; Object id number + // grbit: 2 bytes; Option Flags + // data: var; subrecord data + + // for now, we are just interested in the second subrecord containing the object type + $ftCmoType = self::getInt2d($recordData, 0); + $cbCmoSize = self::getInt2d($recordData, 2); + $otObjType = self::getInt2d($recordData, 4); + $idObjID = self::getInt2d($recordData, 6); + $grbitOpts = self::getInt2d($recordData, 6); + + $this->objs[] = array( + 'ftCmoType' => $ftCmoType, + 'cbCmoSize' => $cbCmoSize, + 'otObjType' => $otObjType, + 'idObjID' => $idObjID, + 'grbitOpts' => $grbitOpts + ); + $this->textObjRef = $idObjID; + +// echo '_readObj()
'; +// var_dump(end($this->objs)); +// echo '
'; + } + + + /** + * Read WINDOW2 record + */ + private function readWindow2() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0; size: 2; option flags + $options = self::getInt2d($recordData, 0); + + // offset: 2; size: 2; index to first visible row + $firstVisibleRow = self::getInt2d($recordData, 2); + + // offset: 4; size: 2; index to first visible colum + $firstVisibleColumn = self::getInt2d($recordData, 4); + if ($this->version === self::XLS_BIFF8) { + // offset: 8; size: 2; not used + // offset: 10; size: 2; cached magnification factor in page break preview (in percent); 0 = Default (60%) + // offset: 12; size: 2; cached magnification factor in normal view (in percent); 0 = Default (100%) + // offset: 14; size: 4; not used + $zoomscaleInPageBreakPreview = self::getInt2d($recordData, 10); + if ($zoomscaleInPageBreakPreview === 0) { + $zoomscaleInPageBreakPreview = 60; + } + $zoomscaleInNormalView = self::getInt2d($recordData, 12); + if ($zoomscaleInNormalView === 0) { + $zoomscaleInNormalView = 100; + } + } + + // bit: 1; mask: 0x0002; 0 = do not show gridlines, 1 = show gridlines + $showGridlines = (bool) ((0x0002 & $options) >> 1); + $this->phpSheet->setShowGridlines($showGridlines); + + // bit: 2; mask: 0x0004; 0 = do not show headers, 1 = show headers + $showRowColHeaders = (bool) ((0x0004 & $options) >> 2); + $this->phpSheet->setShowRowColHeaders($showRowColHeaders); + + // bit: 3; mask: 0x0008; 0 = panes are not frozen, 1 = panes are frozen + $this->frozen = (bool) ((0x0008 & $options) >> 3); + + // bit: 6; mask: 0x0040; 0 = columns from left to right, 1 = columns from right to left + $this->phpSheet->setRightToLeft((bool)((0x0040 & $options) >> 6)); + + // bit: 10; mask: 0x0400; 0 = sheet not active, 1 = sheet active + $isActive = (bool) ((0x0400 & $options) >> 10); + if ($isActive) { + $this->phpExcel->setActiveSheetIndex($this->phpExcel->getIndex($this->phpSheet)); + } + + // bit: 11; mask: 0x0800; 0 = normal view, 1 = page break view + $isPageBreakPreview = (bool) ((0x0800 & $options) >> 11); + + //FIXME: set $firstVisibleRow and $firstVisibleColumn + + if ($this->phpSheet->getSheetView()->getView() !== PHPExcel_Worksheet_SheetView::SHEETVIEW_PAGE_LAYOUT) { + //NOTE: this setting is inferior to page layout view(Excel2007-) + $view = $isPageBreakPreview ? PHPExcel_Worksheet_SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW : PHPExcel_Worksheet_SheetView::SHEETVIEW_NORMAL; + $this->phpSheet->getSheetView()->setView($view); + if ($this->version === self::XLS_BIFF8) { + $zoomScale = $isPageBreakPreview ? $zoomscaleInPageBreakPreview : $zoomscaleInNormalView; + $this->phpSheet->getSheetView()->setZoomScale($zoomScale); + $this->phpSheet->getSheetView()->setZoomScaleNormal($zoomscaleInNormalView); + } + } + } + + /** + * Read PLV Record(Created by Excel2007 or upper) + */ + private function readPageLayoutView() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + //var_dump(unpack("vrt/vgrbitFrt/V2reserved/vwScalePLV/vgrbit", $recordData)); + + // offset: 0; size: 2; rt + //->ignore + $rt = self::getInt2d($recordData, 0); + // offset: 2; size: 2; grbitfr + //->ignore + $grbitFrt = self::getInt2d($recordData, 2); + // offset: 4; size: 8; reserved + //->ignore + + // offset: 12; size 2; zoom scale + $wScalePLV = self::getInt2d($recordData, 12); + // offset: 14; size 2; grbit + $grbit = self::getInt2d($recordData, 14); + + // decomprise grbit + $fPageLayoutView = $grbit & 0x01; + $fRulerVisible = ($grbit >> 1) & 0x01; //no support + $fWhitespaceHidden = ($grbit >> 3) & 0x01; //no support + + if ($fPageLayoutView === 1) { + $this->phpSheet->getSheetView()->setView(PHPExcel_Worksheet_SheetView::SHEETVIEW_PAGE_LAYOUT); + $this->phpSheet->getSheetView()->setZoomScale($wScalePLV); //set by Excel2007 only if SHEETVIEW_PAGE_LAYOUT + } + //otherwise, we cannot know whether SHEETVIEW_PAGE_LAYOUT or SHEETVIEW_PAGE_BREAK_PREVIEW. + } + + /** + * Read SCL record + */ + private function readScl() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // offset: 0; size: 2; numerator of the view magnification + $numerator = self::getInt2d($recordData, 0); + + // offset: 2; size: 2; numerator of the view magnification + $denumerator = self::getInt2d($recordData, 2); + + // set the zoom scale (in percent) + $this->phpSheet->getSheetView()->setZoomScale($numerator * 100 / $denumerator); + } + + + /** + * Read PANE record + */ + private function readPane() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: 2; position of vertical split + $px = self::getInt2d($recordData, 0); + + // offset: 2; size: 2; position of horizontal split + $py = self::getInt2d($recordData, 2); + + if ($this->frozen) { + // frozen panes + $this->phpSheet->freezePane(PHPExcel_Cell::stringFromColumnIndex($px) . ($py + 1)); + } else { + // unfrozen panes; split windows; not supported by PHPExcel core + } + } + } + + + /** + * Read SELECTION record. There is one such record for each pane in the sheet. + */ + private function readSelection() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: 1; pane identifier + $paneId = ord($recordData{0}); + + // offset: 1; size: 2; index to row of the active cell + $r = self::getInt2d($recordData, 1); + + // offset: 3; size: 2; index to column of the active cell + $c = self::getInt2d($recordData, 3); + + // offset: 5; size: 2; index into the following cell range list to the + // entry that contains the active cell + $index = self::getInt2d($recordData, 5); + + // offset: 7; size: var; cell range address list containing all selected cell ranges + $data = substr($recordData, 7); + $cellRangeAddressList = $this->readBIFF5CellRangeAddressList($data); // note: also BIFF8 uses BIFF5 syntax + + $selectedCells = $cellRangeAddressList['cellRangeAddresses'][0]; + + // first row '1' + last row '16384' indicates that full column is selected (apparently also in BIFF8!) + if (preg_match('/^([A-Z]+1\:[A-Z]+)16384$/', $selectedCells)) { + $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)16384$/', '${1}1048576', $selectedCells); + } + + // first row '1' + last row '65536' indicates that full column is selected + if (preg_match('/^([A-Z]+1\:[A-Z]+)65536$/', $selectedCells)) { + $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)65536$/', '${1}1048576', $selectedCells); + } + + // first column 'A' + last column 'IV' indicates that full row is selected + if (preg_match('/^(A[0-9]+\:)IV([0-9]+)$/', $selectedCells)) { + $selectedCells = preg_replace('/^(A[0-9]+\:)IV([0-9]+)$/', '${1}XFD${2}', $selectedCells); + } + + $this->phpSheet->setSelectedCells($selectedCells); + } + } + + + private function includeCellRangeFiltered($cellRangeAddress) + { + $includeCellRange = true; + if ($this->getReadFilter() !== null) { + $includeCellRange = false; + $rangeBoundaries = PHPExcel_Cell::getRangeBoundaries($cellRangeAddress); + $rangeBoundaries[1][0]++; + for ($row = $rangeBoundaries[0][1]; $row <= $rangeBoundaries[1][1]; $row++) { + for ($column = $rangeBoundaries[0][0]; $column != $rangeBoundaries[1][0]; $column++) { + if ($this->getReadFilter()->readCell($column, $row, $this->phpSheet->getTitle())) { + $includeCellRange = true; + break 2; + } + } + } + } + return $includeCellRange; + } + + + /** + * MERGEDCELLS + * + * This record contains the addresses of merged cell ranges + * in the current sheet. + * + * -- "OpenOffice.org's Documentation of the Microsoft + * Excel File Format" + */ + private function readMergedCells() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if ($this->version == self::XLS_BIFF8 && !$this->readDataOnly) { + $cellRangeAddressList = $this->readBIFF8CellRangeAddressList($recordData); + foreach ($cellRangeAddressList['cellRangeAddresses'] as $cellRangeAddress) { + if ((strpos($cellRangeAddress, ':') !== false) && + ($this->includeCellRangeFiltered($cellRangeAddress))) { + $this->phpSheet->mergeCells($cellRangeAddress); + } + } + } + } + + + /** + * Read HYPERLINK record + */ + private function readHyperLink() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer forward to next record + $this->pos += 4 + $length; + + if (!$this->readDataOnly) { + // offset: 0; size: 8; cell range address of all cells containing this hyperlink + try { + $cellRange = $this->readBIFF8CellRangeAddressFixed($recordData, 0, 8); + } catch (PHPExcel_Exception $e) { + return; + } + + // offset: 8, size: 16; GUID of StdLink + + // offset: 24, size: 4; unknown value + + // offset: 28, size: 4; option flags + // bit: 0; mask: 0x00000001; 0 = no link or extant, 1 = file link or URL + $isFileLinkOrUrl = (0x00000001 & self::getInt2d($recordData, 28)) >> 0; + + // bit: 1; mask: 0x00000002; 0 = relative path, 1 = absolute path or URL + $isAbsPathOrUrl = (0x00000001 & self::getInt2d($recordData, 28)) >> 1; + + // bit: 2 (and 4); mask: 0x00000014; 0 = no description + $hasDesc = (0x00000014 & self::getInt2d($recordData, 28)) >> 2; + + // bit: 3; mask: 0x00000008; 0 = no text, 1 = has text + $hasText = (0x00000008 & self::getInt2d($recordData, 28)) >> 3; + + // bit: 7; mask: 0x00000080; 0 = no target frame, 1 = has target frame + $hasFrame = (0x00000080 & self::getInt2d($recordData, 28)) >> 7; + + // bit: 8; mask: 0x00000100; 0 = file link or URL, 1 = UNC path (inc. server name) + $isUNC = (0x00000100 & self::getInt2d($recordData, 28)) >> 8; + + // offset within record data + $offset = 32; + + if ($hasDesc) { + // offset: 32; size: var; character count of description text + $dl = self::getInt4d($recordData, 32); + // offset: 36; size: var; character array of description text, no Unicode string header, always 16-bit characters, zero terminated + $desc = self::encodeUTF16(substr($recordData, 36, 2 * ($dl - 1)), false); + $offset += 4 + 2 * $dl; + } + if ($hasFrame) { + $fl = self::getInt4d($recordData, $offset); + $offset += 4 + 2 * $fl; + } + + // detect type of hyperlink (there are 4 types) + $hyperlinkType = null; + + if ($isUNC) { + $hyperlinkType = 'UNC'; + } elseif (!$isFileLinkOrUrl) { + $hyperlinkType = 'workbook'; + } elseif (ord($recordData{$offset}) == 0x03) { + $hyperlinkType = 'local'; + } elseif (ord($recordData{$offset}) == 0xE0) { + $hyperlinkType = 'URL'; + } + + switch ($hyperlinkType) { + case 'URL': + // section 5.58.2: Hyperlink containing a URL + // e.g. http://example.org/index.php + + // offset: var; size: 16; GUID of URL Moniker + $offset += 16; + // offset: var; size: 4; size (in bytes) of character array of the URL including trailing zero word + $us = self::getInt4d($recordData, $offset); + $offset += 4; + // offset: var; size: $us; character array of the URL, no Unicode string header, always 16-bit characters, zero-terminated + $url = self::encodeUTF16(substr($recordData, $offset, $us - 2), false); + $nullOffset = strpos($url, 0x00); + if ($nullOffset) { + $url = substr($url, 0, $nullOffset); + } + $url .= $hasText ? '#' : ''; + $offset += $us; + break; + case 'local': + // section 5.58.3: Hyperlink to local file + // examples: + // mydoc.txt + // ../../somedoc.xls#Sheet!A1 + + // offset: var; size: 16; GUI of File Moniker + $offset += 16; + + // offset: var; size: 2; directory up-level count. + $upLevelCount = self::getInt2d($recordData, $offset); + $offset += 2; + + // offset: var; size: 4; character count of the shortened file path and name, including trailing zero word + $sl = self::getInt4d($recordData, $offset); + $offset += 4; + + // offset: var; size: sl; character array of the shortened file path and name in 8.3-DOS-format (compressed Unicode string) + $shortenedFilePath = substr($recordData, $offset, $sl); + $shortenedFilePath = self::encodeUTF16($shortenedFilePath, true); + $shortenedFilePath = substr($shortenedFilePath, 0, -1); // remove trailing zero + + $offset += $sl; + + // offset: var; size: 24; unknown sequence + $offset += 24; + + // extended file path + // offset: var; size: 4; size of the following file link field including string lenth mark + $sz = self::getInt4d($recordData, $offset); + $offset += 4; + + // only present if $sz > 0 + if ($sz > 0) { + // offset: var; size: 4; size of the character array of the extended file path and name + $xl = self::getInt4d($recordData, $offset); + $offset += 4; + + // offset: var; size 2; unknown + $offset += 2; + + // offset: var; size $xl; character array of the extended file path and name. + $extendedFilePath = substr($recordData, $offset, $xl); + $extendedFilePath = self::encodeUTF16($extendedFilePath, false); + $offset += $xl; + } + + // construct the path + $url = str_repeat('..\\', $upLevelCount); + $url .= ($sz > 0) ? $extendedFilePath : $shortenedFilePath; // use extended path if available + $url .= $hasText ? '#' : ''; + + break; + case 'UNC': + // section 5.58.4: Hyperlink to a File with UNC (Universal Naming Convention) Path + // todo: implement + return; + case 'workbook': + // section 5.58.5: Hyperlink to the Current Workbook + // e.g. Sheet2!B1:C2, stored in text mark field + $url = 'sheet://'; + break; + default: + return; + } + + if ($hasText) { + // offset: var; size: 4; character count of text mark including trailing zero word + $tl = self::getInt4d($recordData, $offset); + $offset += 4; + // offset: var; size: var; character array of the text mark without the # sign, no Unicode header, always 16-bit characters, zero-terminated + $text = self::encodeUTF16(substr($recordData, $offset, 2 * ($tl - 1)), false); + $url .= $text; + } + + // apply the hyperlink to all the relevant cells + foreach (PHPExcel_Cell::extractAllCellReferencesInRange($cellRange) as $coordinate) { + $this->phpSheet->getCell($coordinate)->getHyperLink()->setUrl($url); + } + } + } + + + /** + * Read DATAVALIDATIONS record + */ + private function readDataValidations() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer forward to next record + $this->pos += 4 + $length; + } + + + /** + * Read DATAVALIDATION record + */ + private function readDataValidation() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer forward to next record + $this->pos += 4 + $length; + + if ($this->readDataOnly) { + return; + } + + // offset: 0; size: 4; Options + $options = self::getInt4d($recordData, 0); + + // bit: 0-3; mask: 0x0000000F; type + $type = (0x0000000F & $options) >> 0; + switch ($type) { + case 0x00: + $type = PHPExcel_Cell_DataValidation::TYPE_NONE; + break; + case 0x01: + $type = PHPExcel_Cell_DataValidation::TYPE_WHOLE; + break; + case 0x02: + $type = PHPExcel_Cell_DataValidation::TYPE_DECIMAL; + break; + case 0x03: + $type = PHPExcel_Cell_DataValidation::TYPE_LIST; + break; + case 0x04: + $type = PHPExcel_Cell_DataValidation::TYPE_DATE; + break; + case 0x05: + $type = PHPExcel_Cell_DataValidation::TYPE_TIME; + break; + case 0x06: + $type = PHPExcel_Cell_DataValidation::TYPE_TEXTLENGTH; + break; + case 0x07: + $type = PHPExcel_Cell_DataValidation::TYPE_CUSTOM; + break; + } + + // bit: 4-6; mask: 0x00000070; error type + $errorStyle = (0x00000070 & $options) >> 4; + switch ($errorStyle) { + case 0x00: + $errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP; + break; + case 0x01: + $errorStyle = PHPExcel_Cell_DataValidation::STYLE_WARNING; + break; + case 0x02: + $errorStyle = PHPExcel_Cell_DataValidation::STYLE_INFORMATION; + break; + } + + // bit: 7; mask: 0x00000080; 1= formula is explicit (only applies to list) + // I have only seen cases where this is 1 + $explicitFormula = (0x00000080 & $options) >> 7; + + // bit: 8; mask: 0x00000100; 1= empty cells allowed + $allowBlank = (0x00000100 & $options) >> 8; + + // bit: 9; mask: 0x00000200; 1= suppress drop down arrow in list type validity + $suppressDropDown = (0x00000200 & $options) >> 9; + + // bit: 18; mask: 0x00040000; 1= show prompt box if cell selected + $showInputMessage = (0x00040000 & $options) >> 18; + + // bit: 19; mask: 0x00080000; 1= show error box if invalid values entered + $showErrorMessage = (0x00080000 & $options) >> 19; + + // bit: 20-23; mask: 0x00F00000; condition operator + $operator = (0x00F00000 & $options) >> 20; + switch ($operator) { + case 0x00: + $operator = PHPExcel_Cell_DataValidation::OPERATOR_BETWEEN; + break; + case 0x01: + $operator = PHPExcel_Cell_DataValidation::OPERATOR_NOTBETWEEN; + break; + case 0x02: + $operator = PHPExcel_Cell_DataValidation::OPERATOR_EQUAL; + break; + case 0x03: + $operator = PHPExcel_Cell_DataValidation::OPERATOR_NOTEQUAL; + break; + case 0x04: + $operator = PHPExcel_Cell_DataValidation::OPERATOR_GREATERTHAN; + break; + case 0x05: + $operator = PHPExcel_Cell_DataValidation::OPERATOR_LESSTHAN; + break; + case 0x06: + $operator = PHPExcel_Cell_DataValidation::OPERATOR_GREATERTHANOREQUAL; + break; + case 0x07: + $operator = PHPExcel_Cell_DataValidation::OPERATOR_LESSTHANOREQUAL; + break; + } + + // offset: 4; size: var; title of the prompt box + $offset = 4; + $string = self::readUnicodeStringLong(substr($recordData, $offset)); + $promptTitle = $string['value'] !== chr(0) ? $string['value'] : ''; + $offset += $string['size']; + + // offset: var; size: var; title of the error box + $string = self::readUnicodeStringLong(substr($recordData, $offset)); + $errorTitle = $string['value'] !== chr(0) ? $string['value'] : ''; + $offset += $string['size']; + + // offset: var; size: var; text of the prompt box + $string = self::readUnicodeStringLong(substr($recordData, $offset)); + $prompt = $string['value'] !== chr(0) ? $string['value'] : ''; + $offset += $string['size']; + + // offset: var; size: var; text of the error box + $string = self::readUnicodeStringLong(substr($recordData, $offset)); + $error = $string['value'] !== chr(0) ? $string['value'] : ''; + $offset += $string['size']; + + // offset: var; size: 2; size of the formula data for the first condition + $sz1 = self::getInt2d($recordData, $offset); + $offset += 2; + + // offset: var; size: 2; not used + $offset += 2; + + // offset: var; size: $sz1; formula data for first condition (without size field) + $formula1 = substr($recordData, $offset, $sz1); + $formula1 = pack('v', $sz1) . $formula1; // prepend the length + try { + $formula1 = $this->getFormulaFromStructure($formula1); + + // in list type validity, null characters are used as item separators + if ($type == PHPExcel_Cell_DataValidation::TYPE_LIST) { + $formula1 = str_replace(chr(0), ',', $formula1); + } + } catch (PHPExcel_Exception $e) { + return; + } + $offset += $sz1; + + // offset: var; size: 2; size of the formula data for the first condition + $sz2 = self::getInt2d($recordData, $offset); + $offset += 2; + + // offset: var; size: 2; not used + $offset += 2; + + // offset: var; size: $sz2; formula data for second condition (without size field) + $formula2 = substr($recordData, $offset, $sz2); + $formula2 = pack('v', $sz2) . $formula2; // prepend the length + try { + $formula2 = $this->getFormulaFromStructure($formula2); + } catch (PHPExcel_Exception $e) { + return; + } + $offset += $sz2; + + // offset: var; size: var; cell range address list with + $cellRangeAddressList = $this->readBIFF8CellRangeAddressList(substr($recordData, $offset)); + $cellRangeAddresses = $cellRangeAddressList['cellRangeAddresses']; + + foreach ($cellRangeAddresses as $cellRange) { + $stRange = $this->phpSheet->shrinkRangeToFit($cellRange); + foreach (PHPExcel_Cell::extractAllCellReferencesInRange($stRange) as $coordinate) { + $objValidation = $this->phpSheet->getCell($coordinate)->getDataValidation(); + $objValidation->setType($type); + $objValidation->setErrorStyle($errorStyle); + $objValidation->setAllowBlank((bool)$allowBlank); + $objValidation->setShowInputMessage((bool)$showInputMessage); + $objValidation->setShowErrorMessage((bool)$showErrorMessage); + $objValidation->setShowDropDown(!$suppressDropDown); + $objValidation->setOperator($operator); + $objValidation->setErrorTitle($errorTitle); + $objValidation->setError($error); + $objValidation->setPromptTitle($promptTitle); + $objValidation->setPrompt($prompt); + $objValidation->setFormula1($formula1); + $objValidation->setFormula2($formula2); + } + } + } + + /** + * Read SHEETLAYOUT record. Stores sheet tab color information. + */ + private function readSheetLayout() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // local pointer in record data + $offset = 0; + + if (!$this->readDataOnly) { + // offset: 0; size: 2; repeated record identifier 0x0862 + + // offset: 2; size: 10; not used + + // offset: 12; size: 4; size of record data + // Excel 2003 uses size of 0x14 (documented), Excel 2007 uses size of 0x28 (not documented?) + $sz = self::getInt4d($recordData, 12); + + switch ($sz) { + case 0x14: + // offset: 16; size: 2; color index for sheet tab + $colorIndex = self::getInt2d($recordData, 16); + $color = PHPExcel_Reader_Excel5_Color::map($colorIndex, $this->palette, $this->version); + $this->phpSheet->getTabColor()->setRGB($color['rgb']); + break; + case 0x28: + // TODO: Investigate structure for .xls SHEETLAYOUT record as saved by MS Office Excel 2007 + return; + break; + } + } + } + + + /** + * Read SHEETPROTECTION record (FEATHEADR) + */ + private function readSheetProtection() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + if ($this->readDataOnly) { + return; + } + + // offset: 0; size: 2; repeated record header + + // offset: 2; size: 2; FRT cell reference flag (=0 currently) + + // offset: 4; size: 8; Currently not used and set to 0 + + // offset: 12; size: 2; Shared feature type index (2=Enhanced Protetion, 4=SmartTag) + $isf = self::getInt2d($recordData, 12); + if ($isf != 2) { + return; + } + + // offset: 14; size: 1; =1 since this is a feat header + + // offset: 15; size: 4; size of rgbHdrSData + + // rgbHdrSData, assume "Enhanced Protection" + // offset: 19; size: 2; option flags + $options = self::getInt2d($recordData, 19); + + // bit: 0; mask 0x0001; 1 = user may edit objects, 0 = users must not edit objects + $bool = (0x0001 & $options) >> 0; + $this->phpSheet->getProtection()->setObjects(!$bool); + + // bit: 1; mask 0x0002; edit scenarios + $bool = (0x0002 & $options) >> 1; + $this->phpSheet->getProtection()->setScenarios(!$bool); + + // bit: 2; mask 0x0004; format cells + $bool = (0x0004 & $options) >> 2; + $this->phpSheet->getProtection()->setFormatCells(!$bool); + + // bit: 3; mask 0x0008; format columns + $bool = (0x0008 & $options) >> 3; + $this->phpSheet->getProtection()->setFormatColumns(!$bool); + + // bit: 4; mask 0x0010; format rows + $bool = (0x0010 & $options) >> 4; + $this->phpSheet->getProtection()->setFormatRows(!$bool); + + // bit: 5; mask 0x0020; insert columns + $bool = (0x0020 & $options) >> 5; + $this->phpSheet->getProtection()->setInsertColumns(!$bool); + + // bit: 6; mask 0x0040; insert rows + $bool = (0x0040 & $options) >> 6; + $this->phpSheet->getProtection()->setInsertRows(!$bool); + + // bit: 7; mask 0x0080; insert hyperlinks + $bool = (0x0080 & $options) >> 7; + $this->phpSheet->getProtection()->setInsertHyperlinks(!$bool); + + // bit: 8; mask 0x0100; delete columns + $bool = (0x0100 & $options) >> 8; + $this->phpSheet->getProtection()->setDeleteColumns(!$bool); + + // bit: 9; mask 0x0200; delete rows + $bool = (0x0200 & $options) >> 9; + $this->phpSheet->getProtection()->setDeleteRows(!$bool); + + // bit: 10; mask 0x0400; select locked cells + $bool = (0x0400 & $options) >> 10; + $this->phpSheet->getProtection()->setSelectLockedCells(!$bool); + + // bit: 11; mask 0x0800; sort cell range + $bool = (0x0800 & $options) >> 11; + $this->phpSheet->getProtection()->setSort(!$bool); + + // bit: 12; mask 0x1000; auto filter + $bool = (0x1000 & $options) >> 12; + $this->phpSheet->getProtection()->setAutoFilter(!$bool); + + // bit: 13; mask 0x2000; pivot tables + $bool = (0x2000 & $options) >> 13; + $this->phpSheet->getProtection()->setPivotTables(!$bool); + + // bit: 14; mask 0x4000; select unlocked cells + $bool = (0x4000 & $options) >> 14; + $this->phpSheet->getProtection()->setSelectUnlockedCells(!$bool); + + // offset: 21; size: 2; not used + } + + + /** + * Read RANGEPROTECTION record + * Reading of this record is based on Microsoft Office Excel 97-2000 Binary File Format Specification, + * where it is referred to as FEAT record + */ + private function readRangeProtection() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // move stream pointer to next record + $this->pos += 4 + $length; + + // local pointer in record data + $offset = 0; + + if (!$this->readDataOnly) { + $offset += 12; + + // offset: 12; size: 2; shared feature type, 2 = enhanced protection, 4 = smart tag + $isf = self::getInt2d($recordData, 12); + if ($isf != 2) { + // we only read FEAT records of type 2 + return; + } + $offset += 2; + + $offset += 5; + + // offset: 19; size: 2; count of ref ranges this feature is on + $cref = self::getInt2d($recordData, 19); + $offset += 2; + + $offset += 6; + + // offset: 27; size: 8 * $cref; list of cell ranges (like in hyperlink record) + $cellRanges = array(); + for ($i = 0; $i < $cref; ++$i) { + try { + $cellRange = $this->readBIFF8CellRangeAddressFixed(substr($recordData, 27 + 8 * $i, 8)); + } catch (PHPExcel_Exception $e) { + return; + } + $cellRanges[] = $cellRange; + $offset += 8; + } + + // offset: var; size: var; variable length of feature specific data + $rgbFeat = substr($recordData, $offset); + $offset += 4; + + // offset: var; size: 4; the encrypted password (only 16-bit although field is 32-bit) + $wPassword = self::getInt4d($recordData, $offset); + $offset += 4; + + // Apply range protection to sheet + if ($cellRanges) { + $this->phpSheet->protectCells(implode(' ', $cellRanges), strtoupper(dechex($wPassword)), true); + } + } + } + + + /** + * Read IMDATA record + */ + private function readImData() + { + $length = self::getInt2d($this->data, $this->pos + 2); + + // get spliced record data + $splicedRecordData = $this->getSplicedRecordData(); + $recordData = $splicedRecordData['recordData']; + + // UNDER CONSTRUCTION + + // offset: 0; size: 2; image format + $cf = self::getInt2d($recordData, 0); + + // offset: 2; size: 2; environment from which the file was written + $env = self::getInt2d($recordData, 2); + + // offset: 4; size: 4; length of the image data + $lcb = self::getInt4d($recordData, 4); + + // offset: 8; size: var; image data + $iData = substr($recordData, 8); + + switch ($cf) { + case 0x09: // Windows bitmap format + // BITMAPCOREINFO + // 1. BITMAPCOREHEADER + // offset: 0; size: 4; bcSize, Specifies the number of bytes required by the structure + $bcSize = self::getInt4d($iData, 0); + // var_dump($bcSize); + + // offset: 4; size: 2; bcWidth, specifies the width of the bitmap, in pixels + $bcWidth = self::getInt2d($iData, 4); + // var_dump($bcWidth); + + // offset: 6; size: 2; bcHeight, specifies the height of the bitmap, in pixels. + $bcHeight = self::getInt2d($iData, 6); + // var_dump($bcHeight); + $ih = imagecreatetruecolor($bcWidth, $bcHeight); + + // offset: 8; size: 2; bcPlanes, specifies the number of planes for the target device. This value must be 1 + + // offset: 10; size: 2; bcBitCount specifies the number of bits-per-pixel. This value must be 1, 4, 8, or 24 + $bcBitCount = self::getInt2d($iData, 10); + // var_dump($bcBitCount); + + $rgbString = substr($iData, 12); + $rgbTriples = array(); + while (strlen($rgbString) > 0) { + $rgbTriples[] = unpack('Cb/Cg/Cr', $rgbString); + $rgbString = substr($rgbString, 3); + } + $x = 0; + $y = 0; + foreach ($rgbTriples as $i => $rgbTriple) { + $color = imagecolorallocate($ih, $rgbTriple['r'], $rgbTriple['g'], $rgbTriple['b']); + imagesetpixel($ih, $x, $bcHeight - 1 - $y, $color); + $x = ($x + 1) % $bcWidth; + $y = $y + floor(($x + 1) / $bcWidth); + } + //imagepng($ih, 'image.png'); + + $drawing = new PHPExcel_Worksheet_Drawing(); + $drawing->setPath($filename); + $drawing->setWorksheet($this->phpSheet); + break; + case 0x02: // Windows metafile or Macintosh PICT format + case 0x0e: // native format + default: + break; + } + + // getSplicedRecordData() takes care of moving current position in data stream + } + + + /** + * Read a free CONTINUE record. Free CONTINUE record may be a camouflaged MSODRAWING record + * When MSODRAWING data on a sheet exceeds 8224 bytes, CONTINUE records are used instead. Undocumented. + * In this case, we must treat the CONTINUE record as a MSODRAWING record + */ + private function readContinue() + { + $length = self::getInt2d($this->data, $this->pos + 2); + $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); + + // check if we are reading drawing data + // this is in case a free CONTINUE record occurs in other circumstances we are unaware of + if ($this->drawingData == '') { + // move stream pointer to next record + $this->pos += 4 + $length; + + return; + } + + // check if record data is at least 4 bytes long, otherwise there is no chance this is MSODRAWING data + if ($length < 4) { + // move stream pointer to next record + $this->pos += 4 + $length; + + return; + } + + // dirty check to see if CONTINUE record could be a camouflaged MSODRAWING record + // look inside CONTINUE record to see if it looks like a part of an Escher stream + // we know that Escher stream may be split at least at + // 0xF003 MsofbtSpgrContainer + // 0xF004 MsofbtSpContainer + // 0xF00D MsofbtClientTextbox + $validSplitPoints = array(0xF003, 0xF004, 0xF00D); // add identifiers if we find more + + $splitPoint = self::getInt2d($recordData, 2); + if (in_array($splitPoint, $validSplitPoints)) { + // get spliced record data (and move pointer to next record) + $splicedRecordData = $this->getSplicedRecordData(); + $this->drawingData .= $splicedRecordData['recordData']; + + return; + } + + // move stream pointer to next record + $this->pos += 4 + $length; + } + + + /** + * Reads a record from current position in data stream and continues reading data as long as CONTINUE + * records are found. Splices the record data pieces and returns the combined string as if record data + * is in one piece. + * Moves to next current position in data stream to start of next record different from a CONtINUE record + * + * @return array + */ + private function getSplicedRecordData() + { + $data = ''; + $spliceOffsets = array(); + + $i = 0; + $spliceOffsets[0] = 0; + + do { + ++$i; + + // offset: 0; size: 2; identifier + $identifier = self::getInt2d($this->data, $this->pos); + // offset: 2; size: 2; length + $length = self::getInt2d($this->data, $this->pos + 2); + $data .= $this->readRecordData($this->data, $this->pos + 4, $length); + + $spliceOffsets[$i] = $spliceOffsets[$i - 1] + $length; + + $this->pos += 4 + $length; + $nextIdentifier = self::getInt2d($this->data, $this->pos); + } while ($nextIdentifier == self::XLS_TYPE_CONTINUE); + + $splicedData = array( + 'recordData' => $data, + 'spliceOffsets' => $spliceOffsets, + ); + + return $splicedData; + + } + + + /** + * Convert formula structure into human readable Excel formula like 'A3+A5*5' + * + * @param string $formulaStructure The complete binary data for the formula + * @param string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas + * @return string Human readable formula + */ + private function getFormulaFromStructure($formulaStructure, $baseCell = 'A1') + { + // offset: 0; size: 2; size of the following formula data + $sz = self::getInt2d($formulaStructure, 0); + + // offset: 2; size: sz + $formulaData = substr($formulaStructure, 2, $sz); + + // for debug: dump the formula data + //echo ''; + //echo 'size: ' . $sz . "\n"; + //echo 'the entire formula data: '; + //Debug::dump($formulaData); + //echo "\n----\n"; + + // offset: 2 + sz; size: variable (optional) + if (strlen($formulaStructure) > 2 + $sz) { + $additionalData = substr($formulaStructure, 2 + $sz); + + // for debug: dump the additional data + //echo 'the entire additional data: '; + //Debug::dump($additionalData); + //echo "\n----\n"; + } else { + $additionalData = ''; + } + + return $this->getFormulaFromData($formulaData, $additionalData, $baseCell); + } + + + /** + * Take formula data and additional data for formula and return human readable formula + * + * @param string $formulaData The binary data for the formula itself + * @param string $additionalData Additional binary data going with the formula + * @param string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas + * @return string Human readable formula + */ + private function getFormulaFromData($formulaData, $additionalData = '', $baseCell = 'A1') + { + // start parsing the formula data + $tokens = array(); + + while (strlen($formulaData) > 0 and $token = $this->getNextToken($formulaData, $baseCell)) { + $tokens[] = $token; + $formulaData = substr($formulaData, $token['size']); + + // for debug: dump the token + //var_dump($token); + } + + $formulaString = $this->createFormulaFromTokens($tokens, $additionalData); + + return $formulaString; + } + + + /** + * Take array of tokens together with additional data for formula and return human readable formula + * + * @param array $tokens + * @param array $additionalData Additional binary data going with the formula + * @param string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas + * @return string Human readable formula + */ + private function createFormulaFromTokens($tokens, $additionalData) + { + // empty formula? + if (empty($tokens)) { + return ''; + } + + $formulaStrings = array(); + foreach ($tokens as $token) { + // initialize spaces + $space0 = isset($space0) ? $space0 : ''; // spaces before next token, not tParen + $space1 = isset($space1) ? $space1 : ''; // carriage returns before next token, not tParen + $space2 = isset($space2) ? $space2 : ''; // spaces before opening parenthesis + $space3 = isset($space3) ? $space3 : ''; // carriage returns before opening parenthesis + $space4 = isset($space4) ? $space4 : ''; // spaces before closing parenthesis + $space5 = isset($space5) ? $space5 : ''; // carriage returns before closing parenthesis + + switch ($token['name']) { + case 'tAdd': // addition + case 'tConcat': // addition + case 'tDiv': // division + case 'tEQ': // equality + case 'tGE': // greater than or equal + case 'tGT': // greater than + case 'tIsect': // intersection + case 'tLE': // less than or equal + case 'tList': // less than or equal + case 'tLT': // less than + case 'tMul': // multiplication + case 'tNE': // multiplication + case 'tPower': // power + case 'tRange': // range + case 'tSub': // subtraction + $op2 = array_pop($formulaStrings); + $op1 = array_pop($formulaStrings); + $formulaStrings[] = "$op1$space1$space0{$token['data']}$op2"; + unset($space0, $space1); + break; + case 'tUplus': // unary plus + case 'tUminus': // unary minus + $op = array_pop($formulaStrings); + $formulaStrings[] = "$space1$space0{$token['data']}$op"; + unset($space0, $space1); + break; + case 'tPercent': // percent sign + $op = array_pop($formulaStrings); + $formulaStrings[] = "$op$space1$space0{$token['data']}"; + unset($space0, $space1); + break; + case 'tAttrVolatile': // indicates volatile function + case 'tAttrIf': + case 'tAttrSkip': + case 'tAttrChoose': + // token is only important for Excel formula evaluator + // do nothing + break; + case 'tAttrSpace': // space / carriage return + // space will be used when next token arrives, do not alter formulaString stack + switch ($token['data']['spacetype']) { + case 'type0': + $space0 = str_repeat(' ', $token['data']['spacecount']); + break; + case 'type1': + $space1 = str_repeat("\n", $token['data']['spacecount']); + break; + case 'type2': + $space2 = str_repeat(' ', $token['data']['spacecount']); + break; + case 'type3': + $space3 = str_repeat("\n", $token['data']['spacecount']); + break; + case 'type4': + $space4 = str_repeat(' ', $token['data']['spacecount']); + break; + case 'type5': + $space5 = str_repeat("\n", $token['data']['spacecount']); + break; + } + break; + case 'tAttrSum': // SUM function with one parameter + $op = array_pop($formulaStrings); + $formulaStrings[] = "{$space1}{$space0}SUM($op)"; + unset($space0, $space1); + break; + case 'tFunc': // function with fixed number of arguments + case 'tFuncV': // function with variable number of arguments + if ($token['data']['function'] != '') { + // normal function + $ops = array(); // array of operators + for ($i = 0; $i < $token['data']['args']; ++$i) { + $ops[] = array_pop($formulaStrings); + } + $ops = array_reverse($ops); + $formulaStrings[] = "$space1$space0{$token['data']['function']}(" . implode(',', $ops) . ")"; + unset($space0, $space1); + } else { + // add-in function + $ops = array(); // array of operators + for ($i = 0; $i < $token['data']['args'] - 1; ++$i) { + $ops[] = array_pop($formulaStrings); + } + $ops = array_reverse($ops); + $function = array_pop($formulaStrings); + $formulaStrings[] = "$space1$space0$function(" . implode(',', $ops) . ")"; + unset($space0, $space1); + } + break; + case 'tParen': // parenthesis + $expression = array_pop($formulaStrings); + $formulaStrings[] = "$space3$space2($expression$space5$space4)"; + unset($space2, $space3, $space4, $space5); + break; + case 'tArray': // array constant + $constantArray = self::readBIFF8ConstantArray($additionalData); + $formulaStrings[] = $space1 . $space0 . $constantArray['value']; + $additionalData = substr($additionalData, $constantArray['size']); // bite of chunk of additional data + unset($space0, $space1); + break; + case 'tMemArea': + // bite off chunk of additional data + $cellRangeAddressList = $this->readBIFF8CellRangeAddressList($additionalData); + $additionalData = substr($additionalData, $cellRangeAddressList['size']); + $formulaStrings[] = "$space1$space0{$token['data']}"; + unset($space0, $space1); + break; + case 'tArea': // cell range address + case 'tBool': // boolean + case 'tErr': // error code + case 'tInt': // integer + case 'tMemErr': + case 'tMemFunc': + case 'tMissArg': + case 'tName': + case 'tNameX': + case 'tNum': // number + case 'tRef': // single cell reference + case 'tRef3d': // 3d cell reference + case 'tArea3d': // 3d cell range reference + case 'tRefN': + case 'tAreaN': + case 'tStr': // string + $formulaStrings[] = "$space1$space0{$token['data']}"; + unset($space0, $space1); + break; + } + } + $formulaString = $formulaStrings[0]; + + // for debug: dump the human readable formula + //echo '----' . "\n"; + //echo 'Formula: ' . $formulaString; + + return $formulaString; + } + + + /** + * Fetch next token from binary formula data + * + * @param string Formula data + * @param string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas + * @return array + * @throws PHPExcel_Reader_Exception + */ + private function getNextToken($formulaData, $baseCell = 'A1') + { + // offset: 0; size: 1; token id + $id = ord($formulaData[0]); // token id + $name = false; // initialize token name + + switch ($id) { + case 0x03: + $name = 'tAdd'; + $size = 1; + $data = '+'; + break; + case 0x04: + $name = 'tSub'; + $size = 1; + $data = '-'; + break; + case 0x05: + $name = 'tMul'; + $size = 1; + $data = '*'; + break; + case 0x06: + $name = 'tDiv'; + $size = 1; + $data = '/'; + break; + case 0x07: + $name = 'tPower'; + $size = 1; + $data = '^'; + break; + case 0x08: + $name = 'tConcat'; + $size = 1; + $data = '&'; + break; + case 0x09: + $name = 'tLT'; + $size = 1; + $data = '<'; + break; + case 0x0A: + $name = 'tLE'; + $size = 1; + $data = '<='; + break; + case 0x0B: + $name = 'tEQ'; + $size = 1; + $data = '='; + break; + case 0x0C: + $name = 'tGE'; + $size = 1; + $data = '>='; + break; + case 0x0D: + $name = 'tGT'; + $size = 1; + $data = '>'; + break; + case 0x0E: + $name = 'tNE'; + $size = 1; + $data = '<>'; + break; + case 0x0F: + $name = 'tIsect'; + $size = 1; + $data = ' '; + break; + case 0x10: + $name = 'tList'; + $size = 1; + $data = ','; + break; + case 0x11: + $name = 'tRange'; + $size = 1; + $data = ':'; + break; + case 0x12: + $name = 'tUplus'; + $size = 1; + $data = '+'; + break; + case 0x13: + $name = 'tUminus'; + $size = 1; + $data = '-'; + break; + case 0x14: + $name = 'tPercent'; + $size = 1; + $data = '%'; + break; + case 0x15: // parenthesis + $name = 'tParen'; + $size = 1; + $data = null; + break; + case 0x16: // missing argument + $name = 'tMissArg'; + $size = 1; + $data = ''; + break; + case 0x17: // string + $name = 'tStr'; + // offset: 1; size: var; Unicode string, 8-bit string length + $string = self::readUnicodeStringShort(substr($formulaData, 1)); + $size = 1 + $string['size']; + $data = self::UTF8toExcelDoubleQuoted($string['value']); + break; + case 0x19: // Special attribute + // offset: 1; size: 1; attribute type flags: + switch (ord($formulaData[1])) { + case 0x01: + $name = 'tAttrVolatile'; + $size = 4; + $data = null; + break; + case 0x02: + $name = 'tAttrIf'; + $size = 4; + $data = null; + break; + case 0x04: + $name = 'tAttrChoose'; + // offset: 2; size: 2; number of choices in the CHOOSE function ($nc, number of parameters decreased by 1) + $nc = self::getInt2d($formulaData, 2); + // offset: 4; size: 2 * $nc + // offset: 4 + 2 * $nc; size: 2 + $size = 2 * $nc + 6; + $data = null; + break; + case 0x08: + $name = 'tAttrSkip'; + $size = 4; + $data = null; + break; + case 0x10: + $name = 'tAttrSum'; + $size = 4; + $data = null; + break; + case 0x40: + case 0x41: + $name = 'tAttrSpace'; + $size = 4; + // offset: 2; size: 2; space type and position + switch (ord($formulaData[2])) { + case 0x00: + $spacetype = 'type0'; + break; + case 0x01: + $spacetype = 'type1'; + break; + case 0x02: + $spacetype = 'type2'; + break; + case 0x03: + $spacetype = 'type3'; + break; + case 0x04: + $spacetype = 'type4'; + break; + case 0x05: + $spacetype = 'type5'; + break; + default: + throw new PHPExcel_Reader_Exception('Unrecognized space type in tAttrSpace token'); + break; + } + // offset: 3; size: 1; number of inserted spaces/carriage returns + $spacecount = ord($formulaData[3]); + + $data = array('spacetype' => $spacetype, 'spacecount' => $spacecount); + break; + default: + throw new PHPExcel_Reader_Exception('Unrecognized attribute flag in tAttr token'); + break; + } + break; + case 0x1C: // error code + // offset: 1; size: 1; error code + $name = 'tErr'; + $size = 2; + $data = PHPExcel_Reader_Excel5_ErrorCode::lookup(ord($formulaData[1])); + break; + case 0x1D: // boolean + // offset: 1; size: 1; 0 = false, 1 = true; + $name = 'tBool'; + $size = 2; + $data = ord($formulaData[1]) ? 'TRUE' : 'FALSE'; + break; + case 0x1E: // integer + // offset: 1; size: 2; unsigned 16-bit integer + $name = 'tInt'; + $size = 3; + $data = self::getInt2d($formulaData, 1); + break; + case 0x1F: // number + // offset: 1; size: 8; + $name = 'tNum'; + $size = 9; + $data = self::extractNumber(substr($formulaData, 1)); + $data = str_replace(',', '.', (string)$data); // in case non-English locale + break; + case 0x20: // array constant + case 0x40: + case 0x60: + // offset: 1; size: 7; not used + $name = 'tArray'; + $size = 8; + $data = null; + break; + case 0x21: // function with fixed number of arguments + case 0x41: + case 0x61: + $name = 'tFunc'; + $size = 3; + // offset: 1; size: 2; index to built-in sheet function + switch (self::getInt2d($formulaData, 1)) { + case 2: + $function = 'ISNA'; + $args = 1; + break; + case 3: + $function = 'ISERROR'; + $args = 1; + break; + case 10: + $function = 'NA'; + $args = 0; + break; + case 15: + $function = 'SIN'; + $args = 1; + break; + case 16: + $function = 'COS'; + $args = 1; + break; + case 17: + $function = 'TAN'; + $args = 1; + break; + case 18: + $function = 'ATAN'; + $args = 1; + break; + case 19: + $function = 'PI'; + $args = 0; + break; + case 20: + $function = 'SQRT'; + $args = 1; + break; + case 21: + $function = 'EXP'; + $args = 1; + break; + case 22: + $function = 'LN'; + $args = 1; + break; + case 23: + $function = 'LOG10'; + $args = 1; + break; + case 24: + $function = 'ABS'; + $args = 1; + break; + case 25: + $function = 'INT'; + $args = 1; + break; + case 26: + $function = 'SIGN'; + $args = 1; + break; + case 27: + $function = 'ROUND'; + $args = 2; + break; + case 30: + $function = 'REPT'; + $args = 2; + break; + case 31: + $function = 'MID'; + $args = 3; + break; + case 32: + $function = 'LEN'; + $args = 1; + break; + case 33: + $function = 'VALUE'; + $args = 1; + break; + case 34: + $function = 'TRUE'; + $args = 0; + break; + case 35: + $function = 'FALSE'; + $args = 0; + break; + case 38: + $function = 'NOT'; + $args = 1; + break; + case 39: + $function = 'MOD'; + $args = 2; + break; + case 40: + $function = 'DCOUNT'; + $args = 3; + break; + case 41: + $function = 'DSUM'; + $args = 3; + break; + case 42: + $function = 'DAVERAGE'; + $args = 3; + break; + case 43: + $function = 'DMIN'; + $args = 3; + break; + case 44: + $function = 'DMAX'; + $args = 3; + break; + case 45: + $function = 'DSTDEV'; + $args = 3; + break; + case 48: + $function = 'TEXT'; + $args = 2; + break; + case 61: + $function = 'MIRR'; + $args = 3; + break; + case 63: + $function = 'RAND'; + $args = 0; + break; + case 65: + $function = 'DATE'; + $args = 3; + break; + case 66: + $function = 'TIME'; + $args = 3; + break; + case 67: + $function = 'DAY'; + $args = 1; + break; + case 68: + $function = 'MONTH'; + $args = 1; + break; + case 69: + $function = 'YEAR'; + $args = 1; + break; + case 71: + $function = 'HOUR'; + $args = 1; + break; + case 72: + $function = 'MINUTE'; + $args = 1; + break; + case 73: + $function = 'SECOND'; + $args = 1; + break; + case 74: + $function = 'NOW'; + $args = 0; + break; + case 75: + $function = 'AREAS'; + $args = 1; + break; + case 76: + $function = 'ROWS'; + $args = 1; + break; + case 77: + $function = 'COLUMNS'; + $args = 1; + break; + case 83: + $function = 'TRANSPOSE'; + $args = 1; + break; + case 86: + $function = 'TYPE'; + $args = 1; + break; + case 97: + $function = 'ATAN2'; + $args = 2; + break; + case 98: + $function = 'ASIN'; + $args = 1; + break; + case 99: + $function = 'ACOS'; + $args = 1; + break; + case 105: + $function = 'ISREF'; + $args = 1; + break; + case 111: + $function = 'CHAR'; + $args = 1; + break; + case 112: + $function = 'LOWER'; + $args = 1; + break; + case 113: + $function = 'UPPER'; + $args = 1; + break; + case 114: + $function = 'PROPER'; + $args = 1; + break; + case 117: + $function = 'EXACT'; + $args = 2; + break; + case 118: + $function = 'TRIM'; + $args = 1; + break; + case 119: + $function = 'REPLACE'; + $args = 4; + break; + case 121: + $function = 'CODE'; + $args = 1; + break; + case 126: + $function = 'ISERR'; + $args = 1; + break; + case 127: + $function = 'ISTEXT'; + $args = 1; + break; + case 128: + $function = 'ISNUMBER'; + $args = 1; + break; + case 129: + $function = 'ISBLANK'; + $args = 1; + break; + case 130: + $function = 'T'; + $args = 1; + break; + case 131: + $function = 'N'; + $args = 1; + break; + case 140: + $function = 'DATEVALUE'; + $args = 1; + break; + case 141: + $function = 'TIMEVALUE'; + $args = 1; + break; + case 142: + $function = 'SLN'; + $args = 3; + break; + case 143: + $function = 'SYD'; + $args = 4; + break; + case 162: + $function = 'CLEAN'; + $args = 1; + break; + case 163: + $function = 'MDETERM'; + $args = 1; + break; + case 164: + $function = 'MINVERSE'; + $args = 1; + break; + case 165: + $function = 'MMULT'; + $args = 2; + break; + case 184: + $function = 'FACT'; + $args = 1; + break; + case 189: + $function = 'DPRODUCT'; + $args = 3; + break; + case 190: + $function = 'ISNONTEXT'; + $args = 1; + break; + case 195: + $function = 'DSTDEVP'; + $args = 3; + break; + case 196: + $function = 'DVARP'; + $args = 3; + break; + case 198: + $function = 'ISLOGICAL'; + $args = 1; + break; + case 199: + $function = 'DCOUNTA'; + $args = 3; + break; + case 207: + $function = 'REPLACEB'; + $args = 4; + break; + case 210: + $function = 'MIDB'; + $args = 3; + break; + case 211: + $function = 'LENB'; + $args = 1; + break; + case 212: + $function = 'ROUNDUP'; + $args = 2; + break; + case 213: + $function = 'ROUNDDOWN'; + $args = 2; + break; + case 214: + $function = 'ASC'; + $args = 1; + break; + case 215: + $function = 'DBCS'; + $args = 1; + break; + case 221: + $function = 'TODAY'; + $args = 0; + break; + case 229: + $function = 'SINH'; + $args = 1; + break; + case 230: + $function = 'COSH'; + $args = 1; + break; + case 231: + $function = 'TANH'; + $args = 1; + break; + case 232: + $function = 'ASINH'; + $args = 1; + break; + case 233: + $function = 'ACOSH'; + $args = 1; + break; + case 234: + $function = 'ATANH'; + $args = 1; + break; + case 235: + $function = 'DGET'; + $args = 3; + break; + case 244: + $function = 'INFO'; + $args = 1; + break; + case 252: + $function = 'FREQUENCY'; + $args = 2; + break; + case 261: + $function = 'ERROR.TYPE'; + $args = 1; + break; + case 271: + $function = 'GAMMALN'; + $args = 1; + break; + case 273: + $function = 'BINOMDIST'; + $args = 4; + break; + case 274: + $function = 'CHIDIST'; + $args = 2; + break; + case 275: + $function = 'CHIINV'; + $args = 2; + break; + case 276: + $function = 'COMBIN'; + $args = 2; + break; + case 277: + $function = 'CONFIDENCE'; + $args = 3; + break; + case 278: + $function = 'CRITBINOM'; + $args = 3; + break; + case 279: + $function = 'EVEN'; + $args = 1; + break; + case 280: + $function = 'EXPONDIST'; + $args = 3; + break; + case 281: + $function = 'FDIST'; + $args = 3; + break; + case 282: + $function = 'FINV'; + $args = 3; + break; + case 283: + $function = 'FISHER'; + $args = 1; + break; + case 284: + $function = 'FISHERINV'; + $args = 1; + break; + case 285: + $function = 'FLOOR'; + $args = 2; + break; + case 286: + $function = 'GAMMADIST'; + $args = 4; + break; + case 287: + $function = 'GAMMAINV'; + $args = 3; + break; + case 288: + $function = 'CEILING'; + $args = 2; + break; + case 289: + $function = 'HYPGEOMDIST'; + $args = 4; + break; + case 290: + $function = 'LOGNORMDIST'; + $args = 3; + break; + case 291: + $function = 'LOGINV'; + $args = 3; + break; + case 292: + $function = 'NEGBINOMDIST'; + $args = 3; + break; + case 293: + $function = 'NORMDIST'; + $args = 4; + break; + case 294: + $function = 'NORMSDIST'; + $args = 1; + break; + case 295: + $function = 'NORMINV'; + $args = 3; + break; + case 296: + $function = 'NORMSINV'; + $args = 1; + break; + case 297: + $function = 'STANDARDIZE'; + $args = 3; + break; + case 298: + $function = 'ODD'; + $args = 1; + break; + case 299: + $function = 'PERMUT'; + $args = 2; + break; + case 300: + $function = 'POISSON'; + $args = 3; + break; + case 301: + $function = 'TDIST'; + $args = 3; + break; + case 302: + $function = 'WEIBULL'; + $args = 4; + break; + case 303: + $function = 'SUMXMY2'; + $args = 2; + break; + case 304: + $function = 'SUMX2MY2'; + $args = 2; + break; + case 305: + $function = 'SUMX2PY2'; + $args = 2; + break; + case 306: + $function = 'CHITEST'; + $args = 2; + break; + case 307: + $function = 'CORREL'; + $args = 2; + break; + case 308: + $function = 'COVAR'; + $args = 2; + break; + case 309: + $function = 'FORECAST'; + $args = 3; + break; + case 310: + $function = 'FTEST'; + $args = 2; + break; + case 311: + $function = 'INTERCEPT'; + $args = 2; + break; + case 312: + $function = 'PEARSON'; + $args = 2; + break; + case 313: + $function = 'RSQ'; + $args = 2; + break; + case 314: + $function = 'STEYX'; + $args = 2; + break; + case 315: + $function = 'SLOPE'; + $args = 2; + break; + case 316: + $function = 'TTEST'; + $args = 4; + break; + case 325: + $function = 'LARGE'; + $args = 2; + break; + case 326: + $function = 'SMALL'; + $args = 2; + break; + case 327: + $function = 'QUARTILE'; + $args = 2; + break; + case 328: + $function = 'PERCENTILE'; + $args = 2; + break; + case 331: + $function = 'TRIMMEAN'; + $args = 2; + break; + case 332: + $function = 'TINV'; + $args = 2; + break; + case 337: + $function = 'POWER'; + $args = 2; + break; + case 342: + $function = 'RADIANS'; + $args = 1; + break; + case 343: + $function = 'DEGREES'; + $args = 1; + break; + case 346: + $function = 'COUNTIF'; + $args = 2; + break; + case 347: + $function = 'COUNTBLANK'; + $args = 1; + break; + case 350: + $function = 'ISPMT'; + $args = 4; + break; + case 351: + $function = 'DATEDIF'; + $args = 3; + break; + case 352: + $function = 'DATESTRING'; + $args = 1; + break; + case 353: + $function = 'NUMBERSTRING'; + $args = 2; + break; + case 360: + $function = 'PHONETIC'; + $args = 1; + break; + case 368: + $function = 'BAHTTEXT'; + $args = 1; + break; + default: + throw new PHPExcel_Reader_Exception('Unrecognized function in formula'); + break; + } + $data = array('function' => $function, 'args' => $args); + break; + case 0x22: // function with variable number of arguments + case 0x42: + case 0x62: + $name = 'tFuncV'; + $size = 4; + // offset: 1; size: 1; number of arguments + $args = ord($formulaData[1]); + // offset: 2: size: 2; index to built-in sheet function + $index = self::getInt2d($formulaData, 2); + switch ($index) { + case 0: + $function = 'COUNT'; + break; + case 1: + $function = 'IF'; + break; + case 4: + $function = 'SUM'; + break; + case 5: + $function = 'AVERAGE'; + break; + case 6: + $function = 'MIN'; + break; + case 7: + $function = 'MAX'; + break; + case 8: + $function = 'ROW'; + break; + case 9: + $function = 'COLUMN'; + break; + case 11: + $function = 'NPV'; + break; + case 12: + $function = 'STDEV'; + break; + case 13: + $function = 'DOLLAR'; + break; + case 14: + $function = 'FIXED'; + break; + case 28: + $function = 'LOOKUP'; + break; + case 29: + $function = 'INDEX'; + break; + case 36: + $function = 'AND'; + break; + case 37: + $function = 'OR'; + break; + case 46: + $function = 'VAR'; + break; + case 49: + $function = 'LINEST'; + break; + case 50: + $function = 'TREND'; + break; + case 51: + $function = 'LOGEST'; + break; + case 52: + $function = 'GROWTH'; + break; + case 56: + $function = 'PV'; + break; + case 57: + $function = 'FV'; + break; + case 58: + $function = 'NPER'; + break; + case 59: + $function = 'PMT'; + break; + case 60: + $function = 'RATE'; + break; + case 62: + $function = 'IRR'; + break; + case 64: + $function = 'MATCH'; + break; + case 70: + $function = 'WEEKDAY'; + break; + case 78: + $function = 'OFFSET'; + break; + case 82: + $function = 'SEARCH'; + break; + case 100: + $function = 'CHOOSE'; + break; + case 101: + $function = 'HLOOKUP'; + break; + case 102: + $function = 'VLOOKUP'; + break; + case 109: + $function = 'LOG'; + break; + case 115: + $function = 'LEFT'; + break; + case 116: + $function = 'RIGHT'; + break; + case 120: + $function = 'SUBSTITUTE'; + break; + case 124: + $function = 'FIND'; + break; + case 125: + $function = 'CELL'; + break; + case 144: + $function = 'DDB'; + break; + case 148: + $function = 'INDIRECT'; + break; + case 167: + $function = 'IPMT'; + break; + case 168: + $function = 'PPMT'; + break; + case 169: + $function = 'COUNTA'; + break; + case 183: + $function = 'PRODUCT'; + break; + case 193: + $function = 'STDEVP'; + break; + case 194: + $function = 'VARP'; + break; + case 197: + $function = 'TRUNC'; + break; + case 204: + $function = 'USDOLLAR'; + break; + case 205: + $function = 'FINDB'; + break; + case 206: + $function = 'SEARCHB'; + break; + case 208: + $function = 'LEFTB'; + break; + case 209: + $function = 'RIGHTB'; + break; + case 216: + $function = 'RANK'; + break; + case 219: + $function = 'ADDRESS'; + break; + case 220: + $function = 'DAYS360'; + break; + case 222: + $function = 'VDB'; + break; + case 227: + $function = 'MEDIAN'; + break; + case 228: + $function = 'SUMPRODUCT'; + break; + case 247: + $function = 'DB'; + break; + case 255: + $function = ''; + break; + case 269: + $function = 'AVEDEV'; + break; + case 270: + $function = 'BETADIST'; + break; + case 272: + $function = 'BETAINV'; + break; + case 317: + $function = 'PROB'; + break; + case 318: + $function = 'DEVSQ'; + break; + case 319: + $function = 'GEOMEAN'; + break; + case 320: + $function = 'HARMEAN'; + break; + case 321: + $function = 'SUMSQ'; + break; + case 322: + $function = 'KURT'; + break; + case 323: + $function = 'SKEW'; + break; + case 324: + $function = 'ZTEST'; + break; + case 329: + $function = 'PERCENTRANK'; + break; + case 330: + $function = 'MODE'; + break; + case 336: + $function = 'CONCATENATE'; + break; + case 344: + $function = 'SUBTOTAL'; + break; + case 345: + $function = 'SUMIF'; + break; + case 354: + $function = 'ROMAN'; + break; + case 358: + $function = 'GETPIVOTDATA'; + break; + case 359: + $function = 'HYPERLINK'; + break; + case 361: + $function = 'AVERAGEA'; + break; + case 362: + $function = 'MAXA'; + break; + case 363: + $function = 'MINA'; + break; + case 364: + $function = 'STDEVPA'; + break; + case 365: + $function = 'VARPA'; + break; + case 366: + $function = 'STDEVA'; + break; + case 367: + $function = 'VARA'; + break; + default: + throw new PHPExcel_Reader_Exception('Unrecognized function in formula'); + break; + } + $data = array('function' => $function, 'args' => $args); + break; + case 0x23: // index to defined name + case 0x43: + case 0x63: + $name = 'tName'; + $size = 5; + // offset: 1; size: 2; one-based index to definedname record + $definedNameIndex = self::getInt2d($formulaData, 1) - 1; + // offset: 2; size: 2; not used + $data = $this->definedname[$definedNameIndex]['name']; + break; + case 0x24: // single cell reference e.g. A5 + case 0x44: + case 0x64: + $name = 'tRef'; + $size = 5; + $data = $this->readBIFF8CellAddress(substr($formulaData, 1, 4)); + break; + case 0x25: // cell range reference to cells in the same sheet (2d) + case 0x45: + case 0x65: + $name = 'tArea'; + $size = 9; + $data = $this->readBIFF8CellRangeAddress(substr($formulaData, 1, 8)); + break; + case 0x26: // Constant reference sub-expression + case 0x46: + case 0x66: + $name = 'tMemArea'; + // offset: 1; size: 4; not used + // offset: 5; size: 2; size of the following subexpression + $subSize = self::getInt2d($formulaData, 5); + $size = 7 + $subSize; + $data = $this->getFormulaFromData(substr($formulaData, 7, $subSize)); + break; + case 0x27: // Deleted constant reference sub-expression + case 0x47: + case 0x67: + $name = 'tMemErr'; + // offset: 1; size: 4; not used + // offset: 5; size: 2; size of the following subexpression + $subSize = self::getInt2d($formulaData, 5); + $size = 7 + $subSize; + $data = $this->getFormulaFromData(substr($formulaData, 7, $subSize)); + break; + case 0x29: // Variable reference sub-expression + case 0x49: + case 0x69: + $name = 'tMemFunc'; + // offset: 1; size: 2; size of the following sub-expression + $subSize = self::getInt2d($formulaData, 1); + $size = 3 + $subSize; + $data = $this->getFormulaFromData(substr($formulaData, 3, $subSize)); + break; + case 0x2C: // Relative 2d cell reference reference, used in shared formulas and some other places + case 0x4C: + case 0x6C: + $name = 'tRefN'; + $size = 5; + $data = $this->readBIFF8CellAddressB(substr($formulaData, 1, 4), $baseCell); + break; + case 0x2D: // Relative 2d range reference + case 0x4D: + case 0x6D: + $name = 'tAreaN'; + $size = 9; + $data = $this->readBIFF8CellRangeAddressB(substr($formulaData, 1, 8), $baseCell); + break; + case 0x39: // External name + case 0x59: + case 0x79: + $name = 'tNameX'; + $size = 7; + // offset: 1; size: 2; index to REF entry in EXTERNSHEET record + // offset: 3; size: 2; one-based index to DEFINEDNAME or EXTERNNAME record + $index = self::getInt2d($formulaData, 3); + // assume index is to EXTERNNAME record + $data = $this->externalNames[$index - 1]['name']; + // offset: 5; size: 2; not used + break; + case 0x3A: // 3d reference to cell + case 0x5A: + case 0x7A: + $name = 'tRef3d'; + $size = 7; + + try { + // offset: 1; size: 2; index to REF entry + $sheetRange = $this->readSheetRangeByRefIndex(self::getInt2d($formulaData, 1)); + // offset: 3; size: 4; cell address + $cellAddress = $this->readBIFF8CellAddress(substr($formulaData, 3, 4)); + + $data = "$sheetRange!$cellAddress"; + } catch (PHPExcel_Exception $e) { + // deleted sheet reference + $data = '#REF!'; + } + break; + case 0x3B: // 3d reference to cell range + case 0x5B: + case 0x7B: + $name = 'tArea3d'; + $size = 11; + + try { + // offset: 1; size: 2; index to REF entry + $sheetRange = $this->readSheetRangeByRefIndex(self::getInt2d($formulaData, 1)); + // offset: 3; size: 8; cell address + $cellRangeAddress = $this->readBIFF8CellRangeAddress(substr($formulaData, 3, 8)); + + $data = "$sheetRange!$cellRangeAddress"; + } catch (PHPExcel_Exception $e) { + // deleted sheet reference + $data = '#REF!'; + } + break; + // Unknown cases // don't know how to deal with + default: + throw new PHPExcel_Reader_Exception('Unrecognized token ' . sprintf('%02X', $id) . ' in formula'); + break; + } + + return array( + 'id' => $id, + 'name' => $name, + 'size' => $size, + 'data' => $data, + ); + } + + + /** + * Reads a cell address in BIFF8 e.g. 'A2' or '$A$2' + * section 3.3.4 + * + * @param string $cellAddressStructure + * @return string + */ + private function readBIFF8CellAddress($cellAddressStructure) + { + // offset: 0; size: 2; index to row (0... 65535) (or offset (-32768... 32767)) + $row = self::getInt2d($cellAddressStructure, 0) + 1; + + // offset: 2; size: 2; index to column or column offset + relative flags + // bit: 7-0; mask 0x00FF; column index + $column = PHPExcel_Cell::stringFromColumnIndex(0x00FF & self::getInt2d($cellAddressStructure, 2)); + + // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) + if (!(0x4000 & self::getInt2d($cellAddressStructure, 2))) { + $column = '$' . $column; + } + // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) + if (!(0x8000 & self::getInt2d($cellAddressStructure, 2))) { + $row = '$' . $row; + } + + return $column . $row; + } + + + /** + * Reads a cell address in BIFF8 for shared formulas. Uses positive and negative values for row and column + * to indicate offsets from a base cell + * section 3.3.4 + * + * @param string $cellAddressStructure + * @param string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas + * @return string + */ + private function readBIFF8CellAddressB($cellAddressStructure, $baseCell = 'A1') + { + list($baseCol, $baseRow) = PHPExcel_Cell::coordinateFromString($baseCell); + $baseCol = PHPExcel_Cell::columnIndexFromString($baseCol) - 1; + + // offset: 0; size: 2; index to row (0... 65535) (or offset (-32768... 32767)) + $rowIndex = self::getInt2d($cellAddressStructure, 0); + $row = self::getInt2d($cellAddressStructure, 0) + 1; + + // offset: 2; size: 2; index to column or column offset + relative flags + // bit: 7-0; mask 0x00FF; column index + $colIndex = 0x00FF & self::getInt2d($cellAddressStructure, 2); + + // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) + if (!(0x4000 & self::getInt2d($cellAddressStructure, 2))) { + $column = PHPExcel_Cell::stringFromColumnIndex($colIndex); + $column = '$' . $column; + } else { + $colIndex = ($colIndex <= 127) ? $colIndex : $colIndex - 256; + $column = PHPExcel_Cell::stringFromColumnIndex($baseCol + $colIndex); + } + + // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) + if (!(0x8000 & self::getInt2d($cellAddressStructure, 2))) { + $row = '$' . $row; + } else { + $rowIndex = ($rowIndex <= 32767) ? $rowIndex : $rowIndex - 65536; + $row = $baseRow + $rowIndex; + } + + return $column . $row; + } + + + /** + * Reads a cell range address in BIFF5 e.g. 'A2:B6' or 'A1' + * always fixed range + * section 2.5.14 + * + * @param string $subData + * @return string + * @throws PHPExcel_Reader_Exception + */ + private function readBIFF5CellRangeAddressFixed($subData) + { + // offset: 0; size: 2; index to first row + $fr = self::getInt2d($subData, 0) + 1; + + // offset: 2; size: 2; index to last row + $lr = self::getInt2d($subData, 2) + 1; + + // offset: 4; size: 1; index to first column + $fc = ord($subData{4}); + + // offset: 5; size: 1; index to last column + $lc = ord($subData{5}); + + // check values + if ($fr > $lr || $fc > $lc) { + throw new PHPExcel_Reader_Exception('Not a cell range address'); + } + + // column index to letter + $fc = PHPExcel_Cell::stringFromColumnIndex($fc); + $lc = PHPExcel_Cell::stringFromColumnIndex($lc); + + if ($fr == $lr and $fc == $lc) { + return "$fc$fr"; + } + return "$fc$fr:$lc$lr"; + } + + + /** + * Reads a cell range address in BIFF8 e.g. 'A2:B6' or 'A1' + * always fixed range + * section 2.5.14 + * + * @param string $subData + * @return string + * @throws PHPExcel_Reader_Exception + */ + private function readBIFF8CellRangeAddressFixed($subData) + { + // offset: 0; size: 2; index to first row + $fr = self::getInt2d($subData, 0) + 1; + + // offset: 2; size: 2; index to last row + $lr = self::getInt2d($subData, 2) + 1; + + // offset: 4; size: 2; index to first column + $fc = self::getInt2d($subData, 4); + + // offset: 6; size: 2; index to last column + $lc = self::getInt2d($subData, 6); + + // check values + if ($fr > $lr || $fc > $lc) { + throw new PHPExcel_Reader_Exception('Not a cell range address'); + } + + // column index to letter + $fc = PHPExcel_Cell::stringFromColumnIndex($fc); + $lc = PHPExcel_Cell::stringFromColumnIndex($lc); + + if ($fr == $lr and $fc == $lc) { + return "$fc$fr"; + } + return "$fc$fr:$lc$lr"; + } + + + /** + * Reads a cell range address in BIFF8 e.g. 'A2:B6' or '$A$2:$B$6' + * there are flags indicating whether column/row index is relative + * section 3.3.4 + * + * @param string $subData + * @return string + */ + private function readBIFF8CellRangeAddress($subData) + { + // todo: if cell range is just a single cell, should this funciton + // not just return e.g. 'A1' and not 'A1:A1' ? + + // offset: 0; size: 2; index to first row (0... 65535) (or offset (-32768... 32767)) + $fr = self::getInt2d($subData, 0) + 1; + + // offset: 2; size: 2; index to last row (0... 65535) (or offset (-32768... 32767)) + $lr = self::getInt2d($subData, 2) + 1; + + // offset: 4; size: 2; index to first column or column offset + relative flags + + // bit: 7-0; mask 0x00FF; column index + $fc = PHPExcel_Cell::stringFromColumnIndex(0x00FF & self::getInt2d($subData, 4)); + + // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) + if (!(0x4000 & self::getInt2d($subData, 4))) { + $fc = '$' . $fc; + } + + // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) + if (!(0x8000 & self::getInt2d($subData, 4))) { + $fr = '$' . $fr; + } + + // offset: 6; size: 2; index to last column or column offset + relative flags + + // bit: 7-0; mask 0x00FF; column index + $lc = PHPExcel_Cell::stringFromColumnIndex(0x00FF & self::getInt2d($subData, 6)); + + // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) + if (!(0x4000 & self::getInt2d($subData, 6))) { + $lc = '$' . $lc; + } + + // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) + if (!(0x8000 & self::getInt2d($subData, 6))) { + $lr = '$' . $lr; + } + + return "$fc$fr:$lc$lr"; + } + + + /** + * Reads a cell range address in BIFF8 for shared formulas. Uses positive and negative values for row and column + * to indicate offsets from a base cell + * section 3.3.4 + * + * @param string $subData + * @param string $baseCell Base cell + * @return string Cell range address + */ + private function readBIFF8CellRangeAddressB($subData, $baseCell = 'A1') + { + list($baseCol, $baseRow) = PHPExcel_Cell::coordinateFromString($baseCell); + $baseCol = PHPExcel_Cell::columnIndexFromString($baseCol) - 1; + + // TODO: if cell range is just a single cell, should this funciton + // not just return e.g. 'A1' and not 'A1:A1' ? + + // offset: 0; size: 2; first row + $frIndex = self::getInt2d($subData, 0); // adjust below + + // offset: 2; size: 2; relative index to first row (0... 65535) should be treated as offset (-32768... 32767) + $lrIndex = self::getInt2d($subData, 2); // adjust below + + // offset: 4; size: 2; first column with relative/absolute flags + + // bit: 7-0; mask 0x00FF; column index + $fcIndex = 0x00FF & self::getInt2d($subData, 4); + + // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) + if (!(0x4000 & self::getInt2d($subData, 4))) { + // absolute column index + $fc = PHPExcel_Cell::stringFromColumnIndex($fcIndex); + $fc = '$' . $fc; + } else { + // column offset + $fcIndex = ($fcIndex <= 127) ? $fcIndex : $fcIndex - 256; + $fc = PHPExcel_Cell::stringFromColumnIndex($baseCol + $fcIndex); + } + + // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) + if (!(0x8000 & self::getInt2d($subData, 4))) { + // absolute row index + $fr = $frIndex + 1; + $fr = '$' . $fr; + } else { + // row offset + $frIndex = ($frIndex <= 32767) ? $frIndex : $frIndex - 65536; + $fr = $baseRow + $frIndex; + } + + // offset: 6; size: 2; last column with relative/absolute flags + + // bit: 7-0; mask 0x00FF; column index + $lcIndex = 0x00FF & self::getInt2d($subData, 6); + $lcIndex = ($lcIndex <= 127) ? $lcIndex : $lcIndex - 256; + $lc = PHPExcel_Cell::stringFromColumnIndex($baseCol + $lcIndex); + + // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) + if (!(0x4000 & self::getInt2d($subData, 6))) { + // absolute column index + $lc = PHPExcel_Cell::stringFromColumnIndex($lcIndex); + $lc = '$' . $lc; + } else { + // column offset + $lcIndex = ($lcIndex <= 127) ? $lcIndex : $lcIndex - 256; + $lc = PHPExcel_Cell::stringFromColumnIndex($baseCol + $lcIndex); + } + + // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) + if (!(0x8000 & self::getInt2d($subData, 6))) { + // absolute row index + $lr = $lrIndex + 1; + $lr = '$' . $lr; + } else { + // row offset + $lrIndex = ($lrIndex <= 32767) ? $lrIndex : $lrIndex - 65536; + $lr = $baseRow + $lrIndex; + } + + return "$fc$fr:$lc$lr"; + } + + + /** + * Read BIFF8 cell range address list + * section 2.5.15 + * + * @param string $subData + * @return array + */ + private function readBIFF8CellRangeAddressList($subData) + { + $cellRangeAddresses = array(); + + // offset: 0; size: 2; number of the following cell range addresses + $nm = self::getInt2d($subData, 0); + + $offset = 2; + // offset: 2; size: 8 * $nm; list of $nm (fixed) cell range addresses + for ($i = 0; $i < $nm; ++$i) { + $cellRangeAddresses[] = $this->readBIFF8CellRangeAddressFixed(substr($subData, $offset, 8)); + $offset += 8; + } + + return array( + 'size' => 2 + 8 * $nm, + 'cellRangeAddresses' => $cellRangeAddresses, + ); + } + + + /** + * Read BIFF5 cell range address list + * section 2.5.15 + * + * @param string $subData + * @return array + */ + private function readBIFF5CellRangeAddressList($subData) + { + $cellRangeAddresses = array(); + + // offset: 0; size: 2; number of the following cell range addresses + $nm = self::getInt2d($subData, 0); + + $offset = 2; + // offset: 2; size: 6 * $nm; list of $nm (fixed) cell range addresses + for ($i = 0; $i < $nm; ++$i) { + $cellRangeAddresses[] = $this->readBIFF5CellRangeAddressFixed(substr($subData, $offset, 6)); + $offset += 6; + } + + return array( + 'size' => 2 + 6 * $nm, + 'cellRangeAddresses' => $cellRangeAddresses, + ); + } + + + /** + * Get a sheet range like Sheet1:Sheet3 from REF index + * Note: If there is only one sheet in the range, one gets e.g Sheet1 + * It can also happen that the REF structure uses the -1 (FFFF) code to indicate deleted sheets, + * in which case an PHPExcel_Reader_Exception is thrown + * + * @param int $index + * @return string|false + * @throws PHPExcel_Reader_Exception + */ + private function readSheetRangeByRefIndex($index) + { + if (isset($this->ref[$index])) { + $type = $this->externalBooks[$this->ref[$index]['externalBookIndex']]['type']; + + switch ($type) { + case 'internal': + // check if we have a deleted 3d reference + if ($this->ref[$index]['firstSheetIndex'] == 0xFFFF or $this->ref[$index]['lastSheetIndex'] == 0xFFFF) { + throw new PHPExcel_Reader_Exception('Deleted sheet reference'); + } + + // we have normal sheet range (collapsed or uncollapsed) + $firstSheetName = $this->sheets[$this->ref[$index]['firstSheetIndex']]['name']; + $lastSheetName = $this->sheets[$this->ref[$index]['lastSheetIndex']]['name']; + + if ($firstSheetName == $lastSheetName) { + // collapsed sheet range + $sheetRange = $firstSheetName; + } else { + $sheetRange = "$firstSheetName:$lastSheetName"; + } + + // escape the single-quotes + $sheetRange = str_replace("'", "''", $sheetRange); + + // if there are special characters, we need to enclose the range in single-quotes + // todo: check if we have identified the whole set of special characters + // it seems that the following characters are not accepted for sheet names + // and we may assume that they are not present: []*/:\? + if (preg_match("/[ !\"@#£$%&{()}<>=+'|^,;-]/", $sheetRange)) { + $sheetRange = "'$sheetRange'"; + } + + return $sheetRange; + break; + default: + // TODO: external sheet support + throw new PHPExcel_Reader_Exception('Excel5 reader only supports internal sheets in fomulas'); + break; + } + } + return false; + } + + + /** + * read BIFF8 constant value array from array data + * returns e.g. array('value' => '{1,2;3,4}', 'size' => 40} + * section 2.5.8 + * + * @param string $arrayData + * @return array + */ + private static function readBIFF8ConstantArray($arrayData) + { + // offset: 0; size: 1; number of columns decreased by 1 + $nc = ord($arrayData[0]); + + // offset: 1; size: 2; number of rows decreased by 1 + $nr = self::getInt2d($arrayData, 1); + $size = 3; // initialize + $arrayData = substr($arrayData, 3); + + // offset: 3; size: var; list of ($nc + 1) * ($nr + 1) constant values + $matrixChunks = array(); + for ($r = 1; $r <= $nr + 1; ++$r) { + $items = array(); + for ($c = 1; $c <= $nc + 1; ++$c) { + $constant = self::readBIFF8Constant($arrayData); + $items[] = $constant['value']; + $arrayData = substr($arrayData, $constant['size']); + $size += $constant['size']; + } + $matrixChunks[] = implode(',', $items); // looks like e.g. '1,"hello"' + } + $matrix = '{' . implode(';', $matrixChunks) . '}'; + + return array( + 'value' => $matrix, + 'size' => $size, + ); + } + + + /** + * read BIFF8 constant value which may be 'Empty Value', 'Number', 'String Value', 'Boolean Value', 'Error Value' + * section 2.5.7 + * returns e.g. array('value' => '5', 'size' => 9) + * + * @param string $valueData + * @return array + */ + private static function readBIFF8Constant($valueData) + { + // offset: 0; size: 1; identifier for type of constant + $identifier = ord($valueData[0]); + + switch ($identifier) { + case 0x00: // empty constant (what is this?) + $value = ''; + $size = 9; + break; + case 0x01: // number + // offset: 1; size: 8; IEEE 754 floating-point value + $value = self::extractNumber(substr($valueData, 1, 8)); + $size = 9; + break; + case 0x02: // string value + // offset: 1; size: var; Unicode string, 16-bit string length + $string = self::readUnicodeStringLong(substr($valueData, 1)); + $value = '"' . $string['value'] . '"'; + $size = 1 + $string['size']; + break; + case 0x04: // boolean + // offset: 1; size: 1; 0 = FALSE, 1 = TRUE + if (ord($valueData[1])) { + $value = 'TRUE'; + } else { + $value = 'FALSE'; + } + $size = 9; + break; + case 0x10: // error code + // offset: 1; size: 1; error code + $value = PHPExcel_Reader_Excel5_ErrorCode::lookup(ord($valueData[1])); + $size = 9; + break; + } + return array( + 'value' => $value, + 'size' => $size, + ); + } + + + /** + * Extract RGB color + * OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.4 + * + * @param string $rgb Encoded RGB value (4 bytes) + * @return array + */ + private static function readRGB($rgb) + { + // offset: 0; size 1; Red component + $r = ord($rgb{0}); + + // offset: 1; size: 1; Green component + $g = ord($rgb{1}); + + // offset: 2; size: 1; Blue component + $b = ord($rgb{2}); + + // HEX notation, e.g. 'FF00FC' + $rgb = sprintf('%02X%02X%02X', $r, $g, $b); + + return array('rgb' => $rgb); + } + + + /** + * Read byte string (8-bit string length) + * OpenOffice documentation: 2.5.2 + * + * @param string $subData + * @return array + */ + private function readByteStringShort($subData) + { + // offset: 0; size: 1; length of the string (character count) + $ln = ord($subData[0]); + + // offset: 1: size: var; character array (8-bit characters) + $value = $this->decodeCodepage(substr($subData, 1, $ln)); + + return array( + 'value' => $value, + 'size' => 1 + $ln, // size in bytes of data structure + ); + } + + + /** + * Read byte string (16-bit string length) + * OpenOffice documentation: 2.5.2 + * + * @param string $subData + * @return array + */ + private function readByteStringLong($subData) + { + // offset: 0; size: 2; length of the string (character count) + $ln = self::getInt2d($subData, 0); + + // offset: 2: size: var; character array (8-bit characters) + $value = $this->decodeCodepage(substr($subData, 2)); + + //return $string; + return array( + 'value' => $value, + 'size' => 2 + $ln, // size in bytes of data structure + ); + } + + + /** + * Extracts an Excel Unicode short string (8-bit string length) + * OpenOffice documentation: 2.5.3 + * function will automatically find out where the Unicode string ends. + * + * @param string $subData + * @return array + */ + private static function readUnicodeStringShort($subData) + { + $value = ''; + + // offset: 0: size: 1; length of the string (character count) + $characterCount = ord($subData[0]); + + $string = self::readUnicodeString(substr($subData, 1), $characterCount); + + // add 1 for the string length + $string['size'] += 1; + + return $string; + } + + + /** + * Extracts an Excel Unicode long string (16-bit string length) + * OpenOffice documentation: 2.5.3 + * this function is under construction, needs to support rich text, and Asian phonetic settings + * + * @param string $subData + * @return array + */ + private static function readUnicodeStringLong($subData) + { + $value = ''; + + // offset: 0: size: 2; length of the string (character count) + $characterCount = self::getInt2d($subData, 0); + + $string = self::readUnicodeString(substr($subData, 2), $characterCount); + + // add 2 for the string length + $string['size'] += 2; + + return $string; + } + + + /** + * Read Unicode string with no string length field, but with known character count + * this function is under construction, needs to support rich text, and Asian phonetic settings + * OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.3 + * + * @param string $subData + * @param int $characterCount + * @return array + */ + private static function readUnicodeString($subData, $characterCount) + { + $value = ''; + + // offset: 0: size: 1; option flags + // bit: 0; mask: 0x01; character compression (0 = compressed 8-bit, 1 = uncompressed 16-bit) + $isCompressed = !((0x01 & ord($subData[0])) >> 0); + + // bit: 2; mask: 0x04; Asian phonetic settings + $hasAsian = (0x04) & ord($subData[0]) >> 2; + + // bit: 3; mask: 0x08; Rich-Text settings + $hasRichText = (0x08) & ord($subData[0]) >> 3; + + // offset: 1: size: var; character array + // this offset assumes richtext and Asian phonetic settings are off which is generally wrong + // needs to be fixed + $value = self::encodeUTF16(substr($subData, 1, $isCompressed ? $characterCount : 2 * $characterCount), $isCompressed); + + return array( + 'value' => $value, + 'size' => $isCompressed ? 1 + $characterCount : 1 + 2 * $characterCount, // the size in bytes including the option flags + ); + } + + + /** + * Convert UTF-8 string to string surounded by double quotes. Used for explicit string tokens in formulas. + * Example: hello"world --> "hello""world" + * + * @param string $value UTF-8 encoded string + * @return string + */ + private static function UTF8toExcelDoubleQuoted($value) + { + return '"' . str_replace('"', '""', $value) . '"'; + } + + + /** + * Reads first 8 bytes of a string and return IEEE 754 float + * + * @param string $data Binary string that is at least 8 bytes long + * @return float + */ + private static function extractNumber($data) + { + $rknumhigh = self::getInt4d($data, 4); + $rknumlow = self::getInt4d($data, 0); + $sign = ($rknumhigh & 0x80000000) >> 31; + $exp = (($rknumhigh & 0x7ff00000) >> 20) - 1023; + $mantissa = (0x100000 | ($rknumhigh & 0x000fffff)); + $mantissalow1 = ($rknumlow & 0x80000000) >> 31; + $mantissalow2 = ($rknumlow & 0x7fffffff); + $value = $mantissa / pow(2, (20 - $exp)); + + if ($mantissalow1 != 0) { + $value += 1 / pow(2, (21 - $exp)); + } + + $value += $mantissalow2 / pow(2, (52 - $exp)); + if ($sign) { + $value *= -1; + } + + return $value; + } + + + private static function getIEEE754($rknum) + { + if (($rknum & 0x02) != 0) { + $value = $rknum >> 2; + } else { + // changes by mmp, info on IEEE754 encoding from + // research.microsoft.com/~hollasch/cgindex/coding/ieeefloat.html + // The RK format calls for using only the most significant 30 bits + // of the 64 bit floating point value. The other 34 bits are assumed + // to be 0 so we use the upper 30 bits of $rknum as follows... + $sign = ($rknum & 0x80000000) >> 31; + $exp = ($rknum & 0x7ff00000) >> 20; + $mantissa = (0x100000 | ($rknum & 0x000ffffc)); + $value = $mantissa / pow(2, (20- ($exp - 1023))); + if ($sign) { + $value = -1 * $value; + } + //end of changes by mmp + } + if (($rknum & 0x01) != 0) { + $value /= 100; + } + return $value; + } + + + /** + * Get UTF-8 string from (compressed or uncompressed) UTF-16 string + * + * @param string $string + * @param bool $compressed + * @return string + */ + private static function encodeUTF16($string, $compressed = '') + { + if ($compressed) { + $string = self::uncompressByteString($string); + } + + return PHPExcel_Shared_String::ConvertEncoding($string, 'UTF-8', 'UTF-16LE'); + } + + /** + * Convert UTF-16 string in compressed notation to uncompressed form. Only used for BIFF8. + * + * @param string $string + * @return string + */ + private static function uncompressByteString($string) + { + $uncompressedString = ''; + $strLen = strlen($string); + for ($i = 0; $i < $strLen; ++$i) { + $uncompressedString .= $string[$i] . "\0"; + } + + return $uncompressedString; + } + + /** + * Convert string to UTF-8. Only used for BIFF5. + * + * @param string $string + * @return string + */ + private function decodeCodepage($string) + { + return PHPExcel_Shared_String::ConvertEncoding($string, 'UTF-8', $this->codepage); + } + + /** + * Read 16-bit unsigned integer + * + * @param string $data + * @param int $pos + * @return int + */ + public static function getInt2d($data, $pos) + { + return ord($data[$pos]) | (ord($data[$pos+1]) << 8); + } + + /** + * Read 32-bit signed integer + * + * @param string $data + * @param int $pos + * @return int + */ + public static function getInt4d($data, $pos) + { + // FIX: represent numbers correctly on 64-bit system + // http://sourceforge.net/tracker/index.php?func=detail&aid=1487372&group_id=99160&atid=623334 + // Hacked by Andreas Rehm 2006 to ensure correct result of the <<24 block on 32 and 64bit systems + $_or_24 = ord($data[$pos + 3]); + if ($_or_24 >= 128) { + // negative number + $_ord_24 = -abs((256 - $_or_24) << 24); + } else { + $_ord_24 = ($_or_24 & 127) << 24; + } + return ord($data[$pos]) | (ord($data[$pos+1]) << 8) | (ord($data[$pos+2]) << 16) | $_ord_24; + } + + private function parseRichText($is = '') + { + $value = new PHPExcel_RichText(); + $value->createText($is); + + return $value; + } +} diff --git a/extend/PHPExcel/PHPExcel/Reader/Excel5/Color.php b/extend/PHPExcel/PHPExcel/Reader/Excel5/Color.php new file mode 100644 index 0000000..1801df5 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Excel5/Color.php @@ -0,0 +1,32 @@ +<?php + +class PHPExcel_Reader_Excel5_Color +{ + /** + * Read color + * + * @param int $color Indexed color + * @param array $palette Color palette + * @return array RGB color value, example: array('rgb' => 'FF0000') + */ + public static function map($color, $palette, $version) + { + if ($color <= 0x07 || $color >= 0x40) { + // special built-in color + return PHPExcel_Reader_Excel5_Color_BuiltIn::lookup($color); + } elseif (isset($palette) && isset($palette[$color - 8])) { + // palette color, color index 0x08 maps to pallete index 0 + return $palette[$color - 8]; + } else { + // default color table + if ($version == PHPExcel_Reader_Excel5::XLS_BIFF8) { + return PHPExcel_Reader_Excel5_Color_BIFF8::lookup($color); + } else { + // BIFF5 + return PHPExcel_Reader_Excel5_Color_BIFF5::lookup($color); + } + } + + return $color; + } +} \ No newline at end of file diff --git a/extend/PHPExcel/PHPExcel/Reader/Excel5/Color/BIFF5.php b/extend/PHPExcel/PHPExcel/Reader/Excel5/Color/BIFF5.php new file mode 100644 index 0000000..159c27f --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Excel5/Color/BIFF5.php @@ -0,0 +1,77 @@ +<?php + +class PHPExcel_Reader_Excel5_Color_BIFF5 +{ + protected static $map = array( + 0x08 => '000000', + 0x09 => 'FFFFFF', + 0x0A => 'FF0000', + 0x0B => '00FF00', + 0x0C => '0000FF', + 0x0D => 'FFFF00', + 0x0E => 'FF00FF', + 0x0F => '00FFFF', + 0x10 => '800000', + 0x11 => '008000', + 0x12 => '000080', + 0x13 => '808000', + 0x14 => '800080', + 0x15 => '008080', + 0x16 => 'C0C0C0', + 0x17 => '808080', + 0x18 => '8080FF', + 0x19 => '802060', + 0x1A => 'FFFFC0', + 0x1B => 'A0E0F0', + 0x1C => '600080', + 0x1D => 'FF8080', + 0x1E => '0080C0', + 0x1F => 'C0C0FF', + 0x20 => '000080', + 0x21 => 'FF00FF', + 0x22 => 'FFFF00', + 0x23 => '00FFFF', + 0x24 => '800080', + 0x25 => '800000', + 0x26 => '008080', + 0x27 => '0000FF', + 0x28 => '00CFFF', + 0x29 => '69FFFF', + 0x2A => 'E0FFE0', + 0x2B => 'FFFF80', + 0x2C => 'A6CAF0', + 0x2D => 'DD9CB3', + 0x2E => 'B38FEE', + 0x2F => 'E3E3E3', + 0x30 => '2A6FF9', + 0x31 => '3FB8CD', + 0x32 => '488436', + 0x33 => '958C41', + 0x34 => '8E5E42', + 0x35 => 'A0627A', + 0x36 => '624FAC', + 0x37 => '969696', + 0x38 => '1D2FBE', + 0x39 => '286676', + 0x3A => '004500', + 0x3B => '453E01', + 0x3C => '6A2813', + 0x3D => '85396A', + 0x3E => '4A3285', + 0x3F => '424242', + ); + + /** + * Map color array from BIFF5 built-in color index + * + * @param int $color + * @return array + */ + public static function lookup($color) + { + if (isset(self::$map[$color])) { + return array('rgb' => self::$map[$color]); + } + return array('rgb' => '000000'); + } +} \ No newline at end of file diff --git a/extend/PHPExcel/PHPExcel/Reader/Excel5/Color/BIFF8.php b/extend/PHPExcel/PHPExcel/Reader/Excel5/Color/BIFF8.php new file mode 100644 index 0000000..4d3f2d0 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Excel5/Color/BIFF8.php @@ -0,0 +1,77 @@ +<?php + +class PHPExcel_Reader_Excel5_Color_BIFF8 +{ + protected static $map = array( + 0x08 => '000000', + 0x09 => 'FFFFFF', + 0x0A => 'FF0000', + 0x0B => '00FF00', + 0x0C => '0000FF', + 0x0D => 'FFFF00', + 0x0E => 'FF00FF', + 0x0F => '00FFFF', + 0x10 => '800000', + 0x11 => '008000', + 0x12 => '000080', + 0x13 => '808000', + 0x14 => '800080', + 0x15 => '008080', + 0x16 => 'C0C0C0', + 0x17 => '808080', + 0x18 => '9999FF', + 0x19 => '993366', + 0x1A => 'FFFFCC', + 0x1B => 'CCFFFF', + 0x1C => '660066', + 0x1D => 'FF8080', + 0x1E => '0066CC', + 0x1F => 'CCCCFF', + 0x20 => '000080', + 0x21 => 'FF00FF', + 0x22 => 'FFFF00', + 0x23 => '00FFFF', + 0x24 => '800080', + 0x25 => '800000', + 0x26 => '008080', + 0x27 => '0000FF', + 0x28 => '00CCFF', + 0x29 => 'CCFFFF', + 0x2A => 'CCFFCC', + 0x2B => 'FFFF99', + 0x2C => '99CCFF', + 0x2D => 'FF99CC', + 0x2E => 'CC99FF', + 0x2F => 'FFCC99', + 0x30 => '3366FF', + 0x31 => '33CCCC', + 0x32 => '99CC00', + 0x33 => 'FFCC00', + 0x34 => 'FF9900', + 0x35 => 'FF6600', + 0x36 => '666699', + 0x37 => '969696', + 0x38 => '003366', + 0x39 => '339966', + 0x3A => '003300', + 0x3B => '333300', + 0x3C => '993300', + 0x3D => '993366', + 0x3E => '333399', + 0x3F => '333333', + ); + + /** + * Map color array from BIFF8 built-in color index + * + * @param int $color + * @return array + */ + public static function lookup($color) + { + if (isset(self::$map[$color])) { + return array('rgb' => self::$map[$color]); + } + return array('rgb' => '000000'); + } +} \ No newline at end of file diff --git a/extend/PHPExcel/PHPExcel/Reader/Excel5/Color/BuiltIn.php b/extend/PHPExcel/PHPExcel/Reader/Excel5/Color/BuiltIn.php new file mode 100644 index 0000000..a5b7e59 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Excel5/Color/BuiltIn.php @@ -0,0 +1,31 @@ +<?php + +class PHPExcel_Reader_Excel5_Color_BuiltIn +{ + protected static $map = array( + 0x00 => '000000', + 0x01 => 'FFFFFF', + 0x02 => 'FF0000', + 0x03 => '00FF00', + 0x04 => '0000FF', + 0x05 => 'FFFF00', + 0x06 => 'FF00FF', + 0x07 => '00FFFF', + 0x40 => '000000', // system window text color + 0x41 => 'FFFFFF', // system window background color + ); + + /** + * Map built-in color to RGB value + * + * @param int $color Indexed color + * @return array + */ + public static function lookup($color) + { + if (isset(self::$map[$color])) { + return array('rgb' => self::$map[$color]); + } + return array('rgb' => '000000'); + } +} \ No newline at end of file diff --git a/extend/PHPExcel/PHPExcel/Reader/Excel5/ErrorCode.php b/extend/PHPExcel/PHPExcel/Reader/Excel5/ErrorCode.php new file mode 100644 index 0000000..f1d1cb6 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Excel5/ErrorCode.php @@ -0,0 +1,28 @@ +<?php + +class PHPExcel_Reader_Excel5_ErrorCode +{ + protected static $map = array( + 0x00 => '#NULL!', + 0x07 => '#DIV/0!', + 0x0F => '#VALUE!', + 0x17 => '#REF!', + 0x1D => '#NAME?', + 0x24 => '#NUM!', + 0x2A => '#N/A', + ); + + /** + * Map error code, e.g. '#N/A' + * + * @param int $code + * @return string + */ + public static function lookup($code) + { + if (isset(self::$map[$code])) { + return self::$map[$code]; + } + return false; + } +} \ No newline at end of file diff --git a/extend/PHPExcel/PHPExcel/Reader/Excel5/Escher.php b/extend/PHPExcel/PHPExcel/Reader/Excel5/Escher.php new file mode 100644 index 0000000..2b99e22 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Excel5/Escher.php @@ -0,0 +1,669 @@ +<?php + +/** + * PHPExcel_Reader_Excel5_Escher + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Reader_Excel5 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Reader_Excel5_Escher +{ + const DGGCONTAINER = 0xF000; + const BSTORECONTAINER = 0xF001; + const DGCONTAINER = 0xF002; + const SPGRCONTAINER = 0xF003; + const SPCONTAINER = 0xF004; + const DGG = 0xF006; + const BSE = 0xF007; + const DG = 0xF008; + const SPGR = 0xF009; + const SP = 0xF00A; + const OPT = 0xF00B; + const CLIENTTEXTBOX = 0xF00D; + const CLIENTANCHOR = 0xF010; + const CLIENTDATA = 0xF011; + const BLIPJPEG = 0xF01D; + const BLIPPNG = 0xF01E; + const SPLITMENUCOLORS = 0xF11E; + const TERTIARYOPT = 0xF122; + + /** + * Escher stream data (binary) + * + * @var string + */ + private $data; + + /** + * Size in bytes of the Escher stream data + * + * @var int + */ + private $dataSize; + + /** + * Current position of stream pointer in Escher stream data + * + * @var int + */ + private $pos; + + /** + * The object to be returned by the reader. Modified during load. + * + * @var mixed + */ + private $object; + + /** + * Create a new PHPExcel_Reader_Excel5_Escher instance + * + * @param mixed $object + */ + public function __construct($object) + { + $this->object = $object; + } + + /** + * Load Escher stream data. May be a partial Escher stream. + * + * @param string $data + */ + public function load($data) + { + $this->data = $data; + + // total byte size of Excel data (workbook global substream + sheet substreams) + $this->dataSize = strlen($this->data); + + $this->pos = 0; + + // Parse Escher stream + while ($this->pos < $this->dataSize) { + // offset: 2; size: 2: Record Type + $fbt = PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos + 2); + + switch ($fbt) { + case self::DGGCONTAINER: + $this->readDggContainer(); + break; + case self::DGG: + $this->readDgg(); + break; + case self::BSTORECONTAINER: + $this->readBstoreContainer(); + break; + case self::BSE: + $this->readBSE(); + break; + case self::BLIPJPEG: + $this->readBlipJPEG(); + break; + case self::BLIPPNG: + $this->readBlipPNG(); + break; + case self::OPT: + $this->readOPT(); + break; + case self::TERTIARYOPT: + $this->readTertiaryOPT(); + break; + case self::SPLITMENUCOLORS: + $this->readSplitMenuColors(); + break; + case self::DGCONTAINER: + $this->readDgContainer(); + break; + case self::DG: + $this->readDg(); + break; + case self::SPGRCONTAINER: + $this->readSpgrContainer(); + break; + case self::SPCONTAINER: + $this->readSpContainer(); + break; + case self::SPGR: + $this->readSpgr(); + break; + case self::SP: + $this->readSp(); + break; + case self::CLIENTTEXTBOX: + $this->readClientTextbox(); + break; + case self::CLIENTANCHOR: + $this->readClientAnchor(); + break; + case self::CLIENTDATA: + $this->readClientData(); + break; + default: + $this->readDefault(); + break; + } + } + + return $this->object; + } + + /** + * Read a generic record + */ + private function readDefault() + { + // offset 0; size: 2; recVer and recInstance + $verInstance = PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos); + + // offset: 2; size: 2: Record Type + $fbt = PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos + 2); + + // bit: 0-3; mask: 0x000F; recVer + $recVer = (0x000F & $verInstance) >> 0; + + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + } + + /** + * Read DggContainer record (Drawing Group Container) + */ + private function readDggContainer() + { + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + + // record is a container, read contents + $dggContainer = new PHPExcel_Shared_Escher_DggContainer(); + $this->object->setDggContainer($dggContainer); + $reader = new PHPExcel_Reader_Excel5_Escher($dggContainer); + $reader->load($recordData); + } + + /** + * Read Dgg record (Drawing Group) + */ + private function readDgg() + { + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + } + + /** + * Read BstoreContainer record (Blip Store Container) + */ + private function readBstoreContainer() + { + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + + // record is a container, read contents + $bstoreContainer = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer(); + $this->object->setBstoreContainer($bstoreContainer); + $reader = new PHPExcel_Reader_Excel5_Escher($bstoreContainer); + $reader->load($recordData); + } + + /** + * Read BSE record + */ + private function readBSE() + { + // offset: 0; size: 2; recVer and recInstance + + // bit: 4-15; mask: 0xFFF0; recInstance + $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4; + + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + + // add BSE to BstoreContainer + $BSE = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE(); + $this->object->addBSE($BSE); + + $BSE->setBLIPType($recInstance); + + // offset: 0; size: 1; btWin32 (MSOBLIPTYPE) + $btWin32 = ord($recordData[0]); + + // offset: 1; size: 1; btWin32 (MSOBLIPTYPE) + $btMacOS = ord($recordData[1]); + + // offset: 2; size: 16; MD4 digest + $rgbUid = substr($recordData, 2, 16); + + // offset: 18; size: 2; tag + $tag = PHPExcel_Reader_Excel5::getInt2d($recordData, 18); + + // offset: 20; size: 4; size of BLIP in bytes + $size = PHPExcel_Reader_Excel5::getInt4d($recordData, 20); + + // offset: 24; size: 4; number of references to this BLIP + $cRef = PHPExcel_Reader_Excel5::getInt4d($recordData, 24); + + // offset: 28; size: 4; MSOFO file offset + $foDelay = PHPExcel_Reader_Excel5::getInt4d($recordData, 28); + + // offset: 32; size: 1; unused1 + $unused1 = ord($recordData{32}); + + // offset: 33; size: 1; size of nameData in bytes (including null terminator) + $cbName = ord($recordData{33}); + + // offset: 34; size: 1; unused2 + $unused2 = ord($recordData{34}); + + // offset: 35; size: 1; unused3 + $unused3 = ord($recordData{35}); + + // offset: 36; size: $cbName; nameData + $nameData = substr($recordData, 36, $cbName); + + // offset: 36 + $cbName, size: var; the BLIP data + $blipData = substr($recordData, 36 + $cbName); + + // record is a container, read contents + $reader = new PHPExcel_Reader_Excel5_Escher($BSE); + $reader->load($blipData); + } + + /** + * Read BlipJPEG record. Holds raw JPEG image data + */ + private function readBlipJPEG() + { + // offset: 0; size: 2; recVer and recInstance + + // bit: 4-15; mask: 0xFFF0; recInstance + $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4; + + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + + $pos = 0; + + // offset: 0; size: 16; rgbUid1 (MD4 digest of) + $rgbUid1 = substr($recordData, 0, 16); + $pos += 16; + + // offset: 16; size: 16; rgbUid2 (MD4 digest), only if $recInstance = 0x46B or 0x6E3 + if (in_array($recInstance, array(0x046B, 0x06E3))) { + $rgbUid2 = substr($recordData, 16, 16); + $pos += 16; + } + + // offset: var; size: 1; tag + $tag = ord($recordData{$pos}); + $pos += 1; + + // offset: var; size: var; the raw image data + $data = substr($recordData, $pos); + + $blip = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip(); + $blip->setData($data); + + $this->object->setBlip($blip); + } + + /** + * Read BlipPNG record. Holds raw PNG image data + */ + private function readBlipPNG() + { + // offset: 0; size: 2; recVer and recInstance + + // bit: 4-15; mask: 0xFFF0; recInstance + $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4; + + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + + $pos = 0; + + // offset: 0; size: 16; rgbUid1 (MD4 digest of) + $rgbUid1 = substr($recordData, 0, 16); + $pos += 16; + + // offset: 16; size: 16; rgbUid2 (MD4 digest), only if $recInstance = 0x46B or 0x6E3 + if ($recInstance == 0x06E1) { + $rgbUid2 = substr($recordData, 16, 16); + $pos += 16; + } + + // offset: var; size: 1; tag + $tag = ord($recordData{$pos}); + $pos += 1; + + // offset: var; size: var; the raw image data + $data = substr($recordData, $pos); + + $blip = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip(); + $blip->setData($data); + + $this->object->setBlip($blip); + } + + /** + * Read OPT record. This record may occur within DggContainer record or SpContainer + */ + private function readOPT() + { + // offset: 0; size: 2; recVer and recInstance + + // bit: 4-15; mask: 0xFFF0; recInstance + $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4; + + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + + $this->readOfficeArtRGFOPTE($recordData, $recInstance); + } + + /** + * Read TertiaryOPT record + */ + private function readTertiaryOPT() + { + // offset: 0; size: 2; recVer and recInstance + + // bit: 4-15; mask: 0xFFF0; recInstance + $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4; + + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + } + + /** + * Read SplitMenuColors record + */ + private function readSplitMenuColors() + { + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + } + + /** + * Read DgContainer record (Drawing Container) + */ + private function readDgContainer() + { + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + + // record is a container, read contents + $dgContainer = new PHPExcel_Shared_Escher_DgContainer(); + $this->object->setDgContainer($dgContainer); + $reader = new PHPExcel_Reader_Excel5_Escher($dgContainer); + $escher = $reader->load($recordData); + } + + /** + * Read Dg record (Drawing) + */ + private function readDg() + { + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + } + + /** + * Read SpgrContainer record (Shape Group Container) + */ + private function readSpgrContainer() + { + // context is either context DgContainer or SpgrContainer + + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + + // record is a container, read contents + $spgrContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer(); + + if ($this->object instanceof PHPExcel_Shared_Escher_DgContainer) { + // DgContainer + $this->object->setSpgrContainer($spgrContainer); + } else { + // SpgrContainer + $this->object->addChild($spgrContainer); + } + + $reader = new PHPExcel_Reader_Excel5_Escher($spgrContainer); + $escher = $reader->load($recordData); + } + + /** + * Read SpContainer record (Shape Container) + */ + private function readSpContainer() + { + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // add spContainer to spgrContainer + $spContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer(); + $this->object->addChild($spContainer); + + // move stream pointer to next record + $this->pos += 8 + $length; + + // record is a container, read contents + $reader = new PHPExcel_Reader_Excel5_Escher($spContainer); + $escher = $reader->load($recordData); + } + + /** + * Read Spgr record (Shape Group) + */ + private function readSpgr() + { + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + } + + /** + * Read Sp record (Shape) + */ + private function readSp() + { + // offset: 0; size: 2; recVer and recInstance + + // bit: 4-15; mask: 0xFFF0; recInstance + $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4; + + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + } + + /** + * Read ClientTextbox record + */ + private function readClientTextbox() + { + // offset: 0; size: 2; recVer and recInstance + + // bit: 4-15; mask: 0xFFF0; recInstance + $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4; + + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + } + + /** + * Read ClientAnchor record. This record holds information about where the shape is anchored in worksheet + */ + private function readClientAnchor() + { + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + + // offset: 2; size: 2; upper-left corner column index (0-based) + $c1 = PHPExcel_Reader_Excel5::getInt2d($recordData, 2); + + // offset: 4; size: 2; upper-left corner horizontal offset in 1/1024 of column width + $startOffsetX = PHPExcel_Reader_Excel5::getInt2d($recordData, 4); + + // offset: 6; size: 2; upper-left corner row index (0-based) + $r1 = PHPExcel_Reader_Excel5::getInt2d($recordData, 6); + + // offset: 8; size: 2; upper-left corner vertical offset in 1/256 of row height + $startOffsetY = PHPExcel_Reader_Excel5::getInt2d($recordData, 8); + + // offset: 10; size: 2; bottom-right corner column index (0-based) + $c2 = PHPExcel_Reader_Excel5::getInt2d($recordData, 10); + + // offset: 12; size: 2; bottom-right corner horizontal offset in 1/1024 of column width + $endOffsetX = PHPExcel_Reader_Excel5::getInt2d($recordData, 12); + + // offset: 14; size: 2; bottom-right corner row index (0-based) + $r2 = PHPExcel_Reader_Excel5::getInt2d($recordData, 14); + + // offset: 16; size: 2; bottom-right corner vertical offset in 1/256 of row height + $endOffsetY = PHPExcel_Reader_Excel5::getInt2d($recordData, 16); + + // set the start coordinates + $this->object->setStartCoordinates(PHPExcel_Cell::stringFromColumnIndex($c1) . ($r1 + 1)); + + // set the start offsetX + $this->object->setStartOffsetX($startOffsetX); + + // set the start offsetY + $this->object->setStartOffsetY($startOffsetY); + + // set the end coordinates + $this->object->setEndCoordinates(PHPExcel_Cell::stringFromColumnIndex($c2) . ($r2 + 1)); + + // set the end offsetX + $this->object->setEndOffsetX($endOffsetX); + + // set the end offsetY + $this->object->setEndOffsetY($endOffsetY); + } + + /** + * Read ClientData record + */ + private function readClientData() + { + $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4); + $recordData = substr($this->data, $this->pos + 8, $length); + + // move stream pointer to next record + $this->pos += 8 + $length; + } + + /** + * Read OfficeArtRGFOPTE table of property-value pairs + * + * @param string $data Binary data + * @param int $n Number of properties + */ + private function readOfficeArtRGFOPTE($data, $n) + { + $splicedComplexData = substr($data, 6 * $n); + + // loop through property-value pairs + for ($i = 0; $i < $n; ++$i) { + // read 6 bytes at a time + $fopte = substr($data, 6 * $i, 6); + + // offset: 0; size: 2; opid + $opid = PHPExcel_Reader_Excel5::getInt2d($fopte, 0); + + // bit: 0-13; mask: 0x3FFF; opid.opid + $opidOpid = (0x3FFF & $opid) >> 0; + + // bit: 14; mask 0x4000; 1 = value in op field is BLIP identifier + $opidFBid = (0x4000 & $opid) >> 14; + + // bit: 15; mask 0x8000; 1 = this is a complex property, op field specifies size of complex data + $opidFComplex = (0x8000 & $opid) >> 15; + + // offset: 2; size: 4; the value for this property + $op = PHPExcel_Reader_Excel5::getInt4d($fopte, 2); + + if ($opidFComplex) { + $complexData = substr($splicedComplexData, 0, $op); + $splicedComplexData = substr($splicedComplexData, $op); + + // we store string value with complex data + $value = $complexData; + } else { + // we store integer value + $value = $op; + } + + $this->object->setOPT($opidOpid, $value); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Reader/Excel5/MD5.php b/extend/PHPExcel/PHPExcel/Reader/Excel5/MD5.php new file mode 100644 index 0000000..f14ea94 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Excel5/MD5.php @@ -0,0 +1,203 @@ +<?php + +/** + * PHPExcel_Reader_Excel5_MD5 + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Reader_Excel5 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Reader_Excel5_MD5 +{ + // Context + private $a; + private $b; + private $c; + private $d; + + /** + * MD5 stream constructor + */ + public function __construct() + { + $this->reset(); + } + + /** + * Reset the MD5 stream context + */ + public function reset() + { + $this->a = 0x67452301; + $this->b = 0xEFCDAB89; + $this->c = 0x98BADCFE; + $this->d = 0x10325476; + } + + /** + * Get MD5 stream context + * + * @return string + */ + public function getContext() + { + $s = ''; + foreach (array('a', 'b', 'c', 'd') as $i) { + $v = $this->{$i}; + $s .= chr($v & 0xff); + $s .= chr(($v >> 8) & 0xff); + $s .= chr(($v >> 16) & 0xff); + $s .= chr(($v >> 24) & 0xff); + } + + return $s; + } + + /** + * Add data to context + * + * @param string $data Data to add + */ + public function add($data) + { + $words = array_values(unpack('V16', $data)); + + $A = $this->a; + $B = $this->b; + $C = $this->c; + $D = $this->d; + + $F = array('PHPExcel_Reader_Excel5_MD5','f'); + $G = array('PHPExcel_Reader_Excel5_MD5','g'); + $H = array('PHPExcel_Reader_Excel5_MD5','h'); + $I = array('PHPExcel_Reader_Excel5_MD5','i'); + + /* ROUND 1 */ + self::step($F, $A, $B, $C, $D, $words[0], 7, 0xd76aa478); + self::step($F, $D, $A, $B, $C, $words[1], 12, 0xe8c7b756); + self::step($F, $C, $D, $A, $B, $words[2], 17, 0x242070db); + self::step($F, $B, $C, $D, $A, $words[3], 22, 0xc1bdceee); + self::step($F, $A, $B, $C, $D, $words[4], 7, 0xf57c0faf); + self::step($F, $D, $A, $B, $C, $words[5], 12, 0x4787c62a); + self::step($F, $C, $D, $A, $B, $words[6], 17, 0xa8304613); + self::step($F, $B, $C, $D, $A, $words[7], 22, 0xfd469501); + self::step($F, $A, $B, $C, $D, $words[8], 7, 0x698098d8); + self::step($F, $D, $A, $B, $C, $words[9], 12, 0x8b44f7af); + self::step($F, $C, $D, $A, $B, $words[10], 17, 0xffff5bb1); + self::step($F, $B, $C, $D, $A, $words[11], 22, 0x895cd7be); + self::step($F, $A, $B, $C, $D, $words[12], 7, 0x6b901122); + self::step($F, $D, $A, $B, $C, $words[13], 12, 0xfd987193); + self::step($F, $C, $D, $A, $B, $words[14], 17, 0xa679438e); + self::step($F, $B, $C, $D, $A, $words[15], 22, 0x49b40821); + + /* ROUND 2 */ + self::step($G, $A, $B, $C, $D, $words[1], 5, 0xf61e2562); + self::step($G, $D, $A, $B, $C, $words[6], 9, 0xc040b340); + self::step($G, $C, $D, $A, $B, $words[11], 14, 0x265e5a51); + self::step($G, $B, $C, $D, $A, $words[0], 20, 0xe9b6c7aa); + self::step($G, $A, $B, $C, $D, $words[5], 5, 0xd62f105d); + self::step($G, $D, $A, $B, $C, $words[10], 9, 0x02441453); + self::step($G, $C, $D, $A, $B, $words[15], 14, 0xd8a1e681); + self::step($G, $B, $C, $D, $A, $words[4], 20, 0xe7d3fbc8); + self::step($G, $A, $B, $C, $D, $words[9], 5, 0x21e1cde6); + self::step($G, $D, $A, $B, $C, $words[14], 9, 0xc33707d6); + self::step($G, $C, $D, $A, $B, $words[3], 14, 0xf4d50d87); + self::step($G, $B, $C, $D, $A, $words[8], 20, 0x455a14ed); + self::step($G, $A, $B, $C, $D, $words[13], 5, 0xa9e3e905); + self::step($G, $D, $A, $B, $C, $words[2], 9, 0xfcefa3f8); + self::step($G, $C, $D, $A, $B, $words[7], 14, 0x676f02d9); + self::step($G, $B, $C, $D, $A, $words[12], 20, 0x8d2a4c8a); + + /* ROUND 3 */ + self::step($H, $A, $B, $C, $D, $words[5], 4, 0xfffa3942); + self::step($H, $D, $A, $B, $C, $words[8], 11, 0x8771f681); + self::step($H, $C, $D, $A, $B, $words[11], 16, 0x6d9d6122); + self::step($H, $B, $C, $D, $A, $words[14], 23, 0xfde5380c); + self::step($H, $A, $B, $C, $D, $words[1], 4, 0xa4beea44); + self::step($H, $D, $A, $B, $C, $words[4], 11, 0x4bdecfa9); + self::step($H, $C, $D, $A, $B, $words[7], 16, 0xf6bb4b60); + self::step($H, $B, $C, $D, $A, $words[10], 23, 0xbebfbc70); + self::step($H, $A, $B, $C, $D, $words[13], 4, 0x289b7ec6); + self::step($H, $D, $A, $B, $C, $words[0], 11, 0xeaa127fa); + self::step($H, $C, $D, $A, $B, $words[3], 16, 0xd4ef3085); + self::step($H, $B, $C, $D, $A, $words[6], 23, 0x04881d05); + self::step($H, $A, $B, $C, $D, $words[9], 4, 0xd9d4d039); + self::step($H, $D, $A, $B, $C, $words[12], 11, 0xe6db99e5); + self::step($H, $C, $D, $A, $B, $words[15], 16, 0x1fa27cf8); + self::step($H, $B, $C, $D, $A, $words[2], 23, 0xc4ac5665); + + /* ROUND 4 */ + self::step($I, $A, $B, $C, $D, $words[0], 6, 0xf4292244); + self::step($I, $D, $A, $B, $C, $words[7], 10, 0x432aff97); + self::step($I, $C, $D, $A, $B, $words[14], 15, 0xab9423a7); + self::step($I, $B, $C, $D, $A, $words[5], 21, 0xfc93a039); + self::step($I, $A, $B, $C, $D, $words[12], 6, 0x655b59c3); + self::step($I, $D, $A, $B, $C, $words[3], 10, 0x8f0ccc92); + self::step($I, $C, $D, $A, $B, $words[10], 15, 0xffeff47d); + self::step($I, $B, $C, $D, $A, $words[1], 21, 0x85845dd1); + self::step($I, $A, $B, $C, $D, $words[8], 6, 0x6fa87e4f); + self::step($I, $D, $A, $B, $C, $words[15], 10, 0xfe2ce6e0); + self::step($I, $C, $D, $A, $B, $words[6], 15, 0xa3014314); + self::step($I, $B, $C, $D, $A, $words[13], 21, 0x4e0811a1); + self::step($I, $A, $B, $C, $D, $words[4], 6, 0xf7537e82); + self::step($I, $D, $A, $B, $C, $words[11], 10, 0xbd3af235); + self::step($I, $C, $D, $A, $B, $words[2], 15, 0x2ad7d2bb); + self::step($I, $B, $C, $D, $A, $words[9], 21, 0xeb86d391); + + $this->a = ($this->a + $A) & 0xffffffff; + $this->b = ($this->b + $B) & 0xffffffff; + $this->c = ($this->c + $C) & 0xffffffff; + $this->d = ($this->d + $D) & 0xffffffff; + } + + private static function f($X, $Y, $Z) + { + return (($X & $Y) | ((~ $X) & $Z)); // X AND Y OR NOT X AND Z + } + + private static function g($X, $Y, $Z) + { + return (($X & $Z) | ($Y & (~ $Z))); // X AND Z OR Y AND NOT Z + } + + private static function h($X, $Y, $Z) + { + return ($X ^ $Y ^ $Z); // X XOR Y XOR Z + } + + private static function i($X, $Y, $Z) + { + return ($Y ^ ($X | (~ $Z))) ; // Y XOR (X OR NOT Z) + } + + private static function step($func, &$A, $B, $C, $D, $M, $s, $t) + { + $A = ($A + call_user_func($func, $B, $C, $D) + $M + $t) & 0xffffffff; + $A = self::rotate($A, $s); + $A = ($B + $A) & 0xffffffff; + } + + private static function rotate($decimal, $bits) + { + $binary = str_pad(decbin($decimal), 32, "0", STR_PAD_LEFT); + return bindec(substr($binary, $bits).substr($binary, 0, $bits)); + } +} diff --git a/extend/PHPExcel/PHPExcel/Reader/Excel5/RC4.php b/extend/PHPExcel/PHPExcel/Reader/Excel5/RC4.php new file mode 100644 index 0000000..5640539 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Excel5/RC4.php @@ -0,0 +1,81 @@ +<?php + +/** + * PHPExcel_Reader_Excel5_RC4 + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Reader_Excel5 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Reader_Excel5_RC4 +{ + // Context + protected $s = array(); + protected $i = 0; + protected $j = 0; + + /** + * RC4 stream decryption/encryption constrcutor + * + * @param string $key Encryption key/passphrase + */ + public function __construct($key) + { + $len = strlen($key); + + for ($this->i = 0; $this->i < 256; $this->i++) { + $this->s[$this->i] = $this->i; + } + + $this->j = 0; + for ($this->i = 0; $this->i < 256; $this->i++) { + $this->j = ($this->j + $this->s[$this->i] + ord($key[$this->i % $len])) % 256; + $t = $this->s[$this->i]; + $this->s[$this->i] = $this->s[$this->j]; + $this->s[$this->j] = $t; + } + $this->i = $this->j = 0; + } + + /** + * Symmetric decryption/encryption function + * + * @param string $data Data to encrypt/decrypt + * + * @return string + */ + public function RC4($data) + { + $len = strlen($data); + for ($c = 0; $c < $len; $c++) { + $this->i = ($this->i + 1) % 256; + $this->j = ($this->j + $this->s[$this->i]) % 256; + $t = $this->s[$this->i]; + $this->s[$this->i] = $this->s[$this->j]; + $this->s[$this->j] = $t; + + $t = ($this->s[$this->i] + $this->s[$this->j]) % 256; + + $data[$c] = chr(ord($data[$c]) ^ $this->s[$t]); + } + return $data; + } +} diff --git a/extend/PHPExcel/PHPExcel/Reader/Excel5/Style/Border.php b/extend/PHPExcel/PHPExcel/Reader/Excel5/Style/Border.php new file mode 100644 index 0000000..fb45b9d --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Excel5/Style/Border.php @@ -0,0 +1,36 @@ +<?php + +class PHPExcel_Reader_Excel5_Style_Border +{ + protected static $map = array( + 0x00 => PHPExcel_Style_Border::BORDER_NONE, + 0x01 => PHPExcel_Style_Border::BORDER_THIN, + 0x02 => PHPExcel_Style_Border::BORDER_MEDIUM, + 0x03 => PHPExcel_Style_Border::BORDER_DASHED, + 0x04 => PHPExcel_Style_Border::BORDER_DOTTED, + 0x05 => PHPExcel_Style_Border::BORDER_THICK, + 0x06 => PHPExcel_Style_Border::BORDER_DOUBLE, + 0x07 => PHPExcel_Style_Border::BORDER_HAIR, + 0x08 => PHPExcel_Style_Border::BORDER_MEDIUMDASHED, + 0x09 => PHPExcel_Style_Border::BORDER_DASHDOT, + 0x0A => PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT, + 0x0B => PHPExcel_Style_Border::BORDER_DASHDOTDOT, + 0x0C => PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT, + 0x0D => PHPExcel_Style_Border::BORDER_SLANTDASHDOT, + ); + + /** + * Map border style + * OpenOffice documentation: 2.5.11 + * + * @param int $index + * @return string + */ + public static function lookup($index) + { + if (isset(self::$map[$index])) { + return self::$map[$index]; + } + return PHPExcel_Style_Border::BORDER_NONE; + } +} \ No newline at end of file diff --git a/extend/PHPExcel/PHPExcel/Reader/Excel5/Style/FillPattern.php b/extend/PHPExcel/PHPExcel/Reader/Excel5/Style/FillPattern.php new file mode 100644 index 0000000..c92d19a --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Excel5/Style/FillPattern.php @@ -0,0 +1,41 @@ +<?php + +class PHPExcel_Reader_Excel5_Style_FillPattern +{ + protected static $map = array( + 0x00 => PHPExcel_Style_Fill::FILL_NONE, + 0x01 => PHPExcel_Style_Fill::FILL_SOLID, + 0x02 => PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY, + 0x03 => PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY, + 0x04 => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY, + 0x05 => PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL, + 0x06 => PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL, + 0x07 => PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN, + 0x08 => PHPExcel_Style_Fill::FILL_PATTERN_DARKUP, + 0x09 => PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID, + 0x0A => PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS, + 0x0B => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL, + 0x0C => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL, + 0x0D => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN, + 0x0E => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP, + 0x0F => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID, + 0x10 => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS, + 0x11 => PHPExcel_Style_Fill::FILL_PATTERN_GRAY125, + 0x12 => PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625, + ); + + /** + * Get fill pattern from index + * OpenOffice documentation: 2.5.12 + * + * @param int $index + * @return string + */ + public static function lookup($index) + { + if (isset(self::$map[$index])) { + return self::$map[$index]; + } + return PHPExcel_Style_Fill::FILL_NONE; + } +} \ No newline at end of file diff --git a/extend/PHPExcel/PHPExcel/Reader/Exception.php b/extend/PHPExcel/PHPExcel/Reader/Exception.php new file mode 100644 index 0000000..48b3f82 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Exception.php @@ -0,0 +1,46 @@ +<?php + +/** + * PHPExcel_Reader_Exception + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Reader + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Reader_Exception extends PHPExcel_Exception +{ + /** + * Error handler callback + * + * @param mixed $code + * @param mixed $string + * @param mixed $file + * @param mixed $line + * @param mixed $context + */ + public static function errorHandlerCallback($code, $string, $file, $line, $context) + { + $e = new self($string, $code); + $e->line = $line; + $e->file = $file; + throw $e; + } +} diff --git a/extend/PHPExcel/PHPExcel/Reader/Gnumeric.php b/extend/PHPExcel/PHPExcel/Reader/Gnumeric.php new file mode 100644 index 0000000..913e52b --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/Gnumeric.php @@ -0,0 +1,850 @@ +<?php + +/** PHPExcel root directory */ +if (!defined('PHPEXCEL_ROOT')) { + /** + * @ignore + */ + define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../'); + require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); +} + +/** + * PHPExcel_Reader_Gnumeric + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Reader + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader +{ + /** + * Formats + * + * @var array + */ + private $styles = array(); + + /** + * Shared Expressions + * + * @var array + */ + private $expressions = array(); + + private $referenceHelper = null; + + /** + * Create a new PHPExcel_Reader_Gnumeric + */ + public function __construct() + { + $this->readFilter = new PHPExcel_Reader_DefaultReadFilter(); + $this->referenceHelper = PHPExcel_ReferenceHelper::getInstance(); + } + + /** + * Can the current PHPExcel_Reader_IReader read the file? + * + * @param string $pFilename + * @return boolean + * @throws PHPExcel_Reader_Exception + */ + public function canRead($pFilename) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + // Check if gzlib functions are available + if (!function_exists('gzread')) { + throw new PHPExcel_Reader_Exception("gzlib library is not enabled"); + } + + // Read signature data (first 3 bytes) + $fh = fopen($pFilename, 'r'); + $data = fread($fh, 2); + fclose($fh); + + if ($data != chr(0x1F).chr(0x8B)) { + return false; + } + + return true; + } + + /** + * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object + * + * @param string $pFilename + * @throws PHPExcel_Reader_Exception + */ + public function listWorksheetNames($pFilename) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + $xml = new XMLReader(); + $xml->xml($this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, PHPExcel_Settings::getLibXmlLoaderOptions()); + $xml->setParserProperty(2, true); + + $worksheetNames = array(); + while ($xml->read()) { + if ($xml->name == 'gnm:SheetName' && $xml->nodeType == XMLReader::ELEMENT) { + $xml->read(); // Move onto the value node + $worksheetNames[] = (string) $xml->value; + } elseif ($xml->name == 'gnm:Sheets') { + // break out of the loop once we've got our sheet names rather than parse the entire file + break; + } + } + + return $worksheetNames; + } + + /** + * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns) + * + * @param string $pFilename + * @throws PHPExcel_Reader_Exception + */ + public function listWorksheetInfo($pFilename) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + $xml = new XMLReader(); + $xml->xml($this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, PHPExcel_Settings::getLibXmlLoaderOptions()); + $xml->setParserProperty(2, true); + + $worksheetInfo = array(); + while ($xml->read()) { + if ($xml->name == 'gnm:Sheet' && $xml->nodeType == XMLReader::ELEMENT) { + $tmpInfo = array( + 'worksheetName' => '', + 'lastColumnLetter' => 'A', + 'lastColumnIndex' => 0, + 'totalRows' => 0, + 'totalColumns' => 0, + ); + + while ($xml->read()) { + if ($xml->name == 'gnm:Name' && $xml->nodeType == XMLReader::ELEMENT) { + $xml->read(); // Move onto the value node + $tmpInfo['worksheetName'] = (string) $xml->value; + } elseif ($xml->name == 'gnm:MaxCol' && $xml->nodeType == XMLReader::ELEMENT) { + $xml->read(); // Move onto the value node + $tmpInfo['lastColumnIndex'] = (int) $xml->value; + $tmpInfo['totalColumns'] = (int) $xml->value + 1; + } elseif ($xml->name == 'gnm:MaxRow' && $xml->nodeType == XMLReader::ELEMENT) { + $xml->read(); // Move onto the value node + $tmpInfo['totalRows'] = (int) $xml->value + 1; + break; + } + } + $tmpInfo['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); + $worksheetInfo[] = $tmpInfo; + } + } + + return $worksheetInfo; + } + + private function gzfileGetContents($filename) + { + $file = @gzopen($filename, 'rb'); + if ($file !== false) { + $data = ''; + while (!gzeof($file)) { + $data .= gzread($file, 1024); + } + gzclose($file); + } + return $data; + } + + /** + * Loads PHPExcel from file + * + * @param string $pFilename + * @return PHPExcel + * @throws PHPExcel_Reader_Exception + */ + public function load($pFilename) + { + // Create new PHPExcel + $objPHPExcel = new PHPExcel(); + + // Load into this instance + return $this->loadIntoExisting($pFilename, $objPHPExcel); + } + + /** + * Loads PHPExcel from file into PHPExcel instance + * + * @param string $pFilename + * @param PHPExcel $objPHPExcel + * @return PHPExcel + * @throws PHPExcel_Reader_Exception + */ + public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + $timezoneObj = new DateTimeZone('Europe/London'); + $GMT = new DateTimeZone('UTC'); + + $gFileData = $this->gzfileGetContents($pFilename); + +// echo '<pre>'; +// echo htmlentities($gFileData,ENT_QUOTES,'UTF-8'); +// echo '</pre><hr />'; +// + $xml = simplexml_load_string($this->securityScan($gFileData), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + $namespacesMeta = $xml->getNamespaces(true); + +// var_dump($namespacesMeta); +// + $gnmXML = $xml->children($namespacesMeta['gnm']); + + $docProps = $objPHPExcel->getProperties(); + // Document Properties are held differently, depending on the version of Gnumeric + if (isset($namespacesMeta['office'])) { + $officeXML = $xml->children($namespacesMeta['office']); + $officeDocXML = $officeXML->{'document-meta'}; + $officeDocMetaXML = $officeDocXML->meta; + + foreach ($officeDocMetaXML as $officePropertyData) { + $officePropertyDC = array(); + if (isset($namespacesMeta['dc'])) { + $officePropertyDC = $officePropertyData->children($namespacesMeta['dc']); + } + foreach ($officePropertyDC as $propertyName => $propertyValue) { + $propertyValue = (string) $propertyValue; + switch ($propertyName) { + case 'title': + $docProps->setTitle(trim($propertyValue)); + break; + case 'subject': + $docProps->setSubject(trim($propertyValue)); + break; + case 'creator': + $docProps->setCreator(trim($propertyValue)); + $docProps->setLastModifiedBy(trim($propertyValue)); + break; + case 'date': + $creationDate = strtotime(trim($propertyValue)); + $docProps->setCreated($creationDate); + $docProps->setModified($creationDate); + break; + case 'description': + $docProps->setDescription(trim($propertyValue)); + break; + } + } + $officePropertyMeta = array(); + if (isset($namespacesMeta['meta'])) { + $officePropertyMeta = $officePropertyData->children($namespacesMeta['meta']); + } + foreach ($officePropertyMeta as $propertyName => $propertyValue) { + $attributes = $propertyValue->attributes($namespacesMeta['meta']); + $propertyValue = (string) $propertyValue; + switch ($propertyName) { + case 'keyword': + $docProps->setKeywords(trim($propertyValue)); + break; + case 'initial-creator': + $docProps->setCreator(trim($propertyValue)); + $docProps->setLastModifiedBy(trim($propertyValue)); + break; + case 'creation-date': + $creationDate = strtotime(trim($propertyValue)); + $docProps->setCreated($creationDate); + $docProps->setModified($creationDate); + break; + case 'user-defined': + list(, $attrName) = explode(':', $attributes['name']); + switch ($attrName) { + case 'publisher': + $docProps->setCompany(trim($propertyValue)); + break; + case 'category': + $docProps->setCategory(trim($propertyValue)); + break; + case 'manager': + $docProps->setManager(trim($propertyValue)); + break; + } + break; + } + } + } + } elseif (isset($gnmXML->Summary)) { + foreach ($gnmXML->Summary->Item as $summaryItem) { + $propertyName = $summaryItem->name; + $propertyValue = $summaryItem->{'val-string'}; + switch ($propertyName) { + case 'title': + $docProps->setTitle(trim($propertyValue)); + break; + case 'comments': + $docProps->setDescription(trim($propertyValue)); + break; + case 'keywords': + $docProps->setKeywords(trim($propertyValue)); + break; + case 'category': + $docProps->setCategory(trim($propertyValue)); + break; + case 'manager': + $docProps->setManager(trim($propertyValue)); + break; + case 'author': + $docProps->setCreator(trim($propertyValue)); + $docProps->setLastModifiedBy(trim($propertyValue)); + break; + case 'company': + $docProps->setCompany(trim($propertyValue)); + break; + } + } + } + + $worksheetID = 0; + foreach ($gnmXML->Sheets->Sheet as $sheet) { + $worksheetName = (string) $sheet->Name; +// echo '<b>Worksheet: ', $worksheetName,'</b><br />'; + if ((isset($this->loadSheetsOnly)) && (!in_array($worksheetName, $this->loadSheetsOnly))) { + continue; + } + + $maxRow = $maxCol = 0; + + // Create new Worksheet + $objPHPExcel->createSheet(); + $objPHPExcel->setActiveSheetIndex($worksheetID); + // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in formula + // cells... during the load, all formulae should be correct, and we're simply bringing the worksheet + // name in line with the formula, not the reverse + $objPHPExcel->getActiveSheet()->setTitle($worksheetName, false); + + if ((!$this->readDataOnly) && (isset($sheet->PrintInformation))) { + if (isset($sheet->PrintInformation->Margins)) { + foreach ($sheet->PrintInformation->Margins->children('gnm', true) as $key => $margin) { + $marginAttributes = $margin->attributes(); + $marginSize = 72 / 100; // Default + switch ($marginAttributes['PrefUnit']) { + case 'mm': + $marginSize = intval($marginAttributes['Points']) / 100; + break; + } + switch ($key) { + case 'top': + $objPHPExcel->getActiveSheet()->getPageMargins()->setTop($marginSize); + break; + case 'bottom': + $objPHPExcel->getActiveSheet()->getPageMargins()->setBottom($marginSize); + break; + case 'left': + $objPHPExcel->getActiveSheet()->getPageMargins()->setLeft($marginSize); + break; + case 'right': + $objPHPExcel->getActiveSheet()->getPageMargins()->setRight($marginSize); + break; + case 'header': + $objPHPExcel->getActiveSheet()->getPageMargins()->setHeader($marginSize); + break; + case 'footer': + $objPHPExcel->getActiveSheet()->getPageMargins()->setFooter($marginSize); + break; + } + } + } + } + + foreach ($sheet->Cells->Cell as $cell) { + $cellAttributes = $cell->attributes(); + $row = (int) $cellAttributes->Row + 1; + $column = (int) $cellAttributes->Col; + + if ($row > $maxRow) { + $maxRow = $row; + } + if ($column > $maxCol) { + $maxCol = $column; + } + + $column = PHPExcel_Cell::stringFromColumnIndex($column); + + // Read cell? + if ($this->getReadFilter() !== null) { + if (!$this->getReadFilter()->readCell($column, $row, $worksheetName)) { + continue; + } + } + + $ValueType = $cellAttributes->ValueType; + $ExprID = (string) $cellAttributes->ExprID; +// echo 'Cell ', $column, $row,'<br />'; +// echo 'Type is ', $ValueType,'<br />'; +// echo 'Value is ', $cell,'<br />'; + $type = PHPExcel_Cell_DataType::TYPE_FORMULA; + if ($ExprID > '') { + if (((string) $cell) > '') { + $this->expressions[$ExprID] = array( + 'column' => $cellAttributes->Col, + 'row' => $cellAttributes->Row, + 'formula' => (string) $cell + ); +// echo 'NEW EXPRESSION ', $ExprID,'<br />'; + } else { + $expression = $this->expressions[$ExprID]; + + $cell = $this->referenceHelper->updateFormulaReferences( + $expression['formula'], + 'A1', + $cellAttributes->Col - $expression['column'], + $cellAttributes->Row - $expression['row'], + $worksheetName + ); +// echo 'SHARED EXPRESSION ', $ExprID,'<br />'; +// echo 'New Value is ', $cell,'<br />'; + } + $type = PHPExcel_Cell_DataType::TYPE_FORMULA; + } else { + switch ($ValueType) { + case '10': // NULL + $type = PHPExcel_Cell_DataType::TYPE_NULL; + break; + case '20': // Boolean + $type = PHPExcel_Cell_DataType::TYPE_BOOL; + $cell = ($cell == 'TRUE') ? true: false; + break; + case '30': // Integer + $cell = intval($cell); + // Excel 2007+ doesn't differentiate between integer and float, so set the value and dropthru to the next (numeric) case + case '40': // Float + $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; + break; + case '50': // Error + $type = PHPExcel_Cell_DataType::TYPE_ERROR; + break; + case '60': // String + $type = PHPExcel_Cell_DataType::TYPE_STRING; + break; + case '70': // Cell Range + case '80': // Array + } + } + $objPHPExcel->getActiveSheet()->getCell($column.$row)->setValueExplicit($cell, $type); + } + + if ((!$this->readDataOnly) && (isset($sheet->Objects))) { + foreach ($sheet->Objects->children('gnm', true) as $key => $comment) { + $commentAttributes = $comment->attributes(); + // Only comment objects are handled at the moment + if ($commentAttributes->Text) { + $objPHPExcel->getActiveSheet()->getComment((string)$commentAttributes->ObjectBound)->setAuthor((string)$commentAttributes->Author)->setText($this->parseRichText((string)$commentAttributes->Text)); + } + } + } +// echo '$maxCol=', $maxCol,'; $maxRow=', $maxRow,'<br />'; +// + foreach ($sheet->Styles->StyleRegion as $styleRegion) { + $styleAttributes = $styleRegion->attributes(); + if (($styleAttributes['startRow'] <= $maxRow) && + ($styleAttributes['startCol'] <= $maxCol)) { + $startColumn = PHPExcel_Cell::stringFromColumnIndex((int) $styleAttributes['startCol']); + $startRow = $styleAttributes['startRow'] + 1; + + $endColumn = ($styleAttributes['endCol'] > $maxCol) ? $maxCol : (int) $styleAttributes['endCol']; + $endColumn = PHPExcel_Cell::stringFromColumnIndex($endColumn); + $endRow = ($styleAttributes['endRow'] > $maxRow) ? $maxRow : $styleAttributes['endRow']; + $endRow += 1; + $cellRange = $startColumn.$startRow.':'.$endColumn.$endRow; +// echo $cellRange,'<br />'; + + $styleAttributes = $styleRegion->Style->attributes(); +// var_dump($styleAttributes); +// echo '<br />'; + + // We still set the number format mask for date/time values, even if readDataOnly is true + if ((!$this->readDataOnly) || + (PHPExcel_Shared_Date::isDateTimeFormatCode((string) $styleAttributes['Format']))) { + $styleArray = array(); + $styleArray['numberformat']['code'] = (string) $styleAttributes['Format']; + // If readDataOnly is false, we set all formatting information + if (!$this->readDataOnly) { + switch ($styleAttributes['HAlign']) { + case '1': + $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; + break; + case '2': + $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_LEFT; + break; + case '4': + $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_RIGHT; + break; + case '8': + $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_CENTER; + break; + case '16': + case '64': + $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS; + break; + case '32': + $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY; + break; + } + + switch ($styleAttributes['VAlign']) { + case '1': + $styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_TOP; + break; + case '2': + $styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_BOTTOM; + break; + case '4': + $styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_CENTER; + break; + case '8': + $styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_JUSTIFY; + break; + } + + $styleArray['alignment']['wrap'] = ($styleAttributes['WrapText'] == '1') ? true : false; + $styleArray['alignment']['shrinkToFit'] = ($styleAttributes['ShrinkToFit'] == '1') ? true : false; + $styleArray['alignment']['indent'] = (intval($styleAttributes["Indent"]) > 0) ? $styleAttributes["indent"] : 0; + + $RGB = self::parseGnumericColour($styleAttributes["Fore"]); + $styleArray['font']['color']['rgb'] = $RGB; + $RGB = self::parseGnumericColour($styleAttributes["Back"]); + $shade = $styleAttributes["Shade"]; + if (($RGB != '000000') || ($shade != '0')) { + $styleArray['fill']['color']['rgb'] = $styleArray['fill']['startcolor']['rgb'] = $RGB; + $RGB2 = self::parseGnumericColour($styleAttributes["PatternColor"]); + $styleArray['fill']['endcolor']['rgb'] = $RGB2; + switch ($shade) { + case '1': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_SOLID; + break; + case '2': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR; + break; + case '3': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_GRADIENT_PATH; + break; + case '4': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN; + break; + case '5': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY; + break; + case '6': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID; + break; + case '7': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL; + break; + case '8': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS; + break; + case '9': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKUP; + break; + case '10': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL; + break; + case '11': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625; + break; + case '12': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_GRAY125; + break; + case '13': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN; + break; + case '14': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY; + break; + case '15': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID; + break; + case '16': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL; + break; + case '17': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS; + break; + case '18': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP; + break; + case '19': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL; + break; + case '20': + $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY; + break; + } + } + + $fontAttributes = $styleRegion->Style->Font->attributes(); +// var_dump($fontAttributes); +// echo '<br />'; + $styleArray['font']['name'] = (string) $styleRegion->Style->Font; + $styleArray['font']['size'] = intval($fontAttributes['Unit']); + $styleArray['font']['bold'] = ($fontAttributes['Bold'] == '1') ? true : false; + $styleArray['font']['italic'] = ($fontAttributes['Italic'] == '1') ? true : false; + $styleArray['font']['strike'] = ($fontAttributes['StrikeThrough'] == '1') ? true : false; + switch ($fontAttributes['Underline']) { + case '1': + $styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_SINGLE; + break; + case '2': + $styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_DOUBLE; + break; + case '3': + $styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING; + break; + case '4': + $styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING; + break; + default: + $styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_NONE; + break; + } + switch ($fontAttributes['Script']) { + case '1': + $styleArray['font']['superScript'] = true; + break; + case '-1': + $styleArray['font']['subScript'] = true; + break; + } + + if (isset($styleRegion->Style->StyleBorder)) { + if (isset($styleRegion->Style->StyleBorder->Top)) { + $styleArray['borders']['top'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Top->attributes()); + } + if (isset($styleRegion->Style->StyleBorder->Bottom)) { + $styleArray['borders']['bottom'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Bottom->attributes()); + } + if (isset($styleRegion->Style->StyleBorder->Left)) { + $styleArray['borders']['left'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Left->attributes()); + } + if (isset($styleRegion->Style->StyleBorder->Right)) { + $styleArray['borders']['right'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Right->attributes()); + } + if ((isset($styleRegion->Style->StyleBorder->Diagonal)) && (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}))) { + $styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes()); + $styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_BOTH; + } elseif (isset($styleRegion->Style->StyleBorder->Diagonal)) { + $styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes()); + $styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_UP; + } elseif (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'})) { + $styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}->attributes()); + $styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_DOWN; + } + } + if (isset($styleRegion->Style->HyperLink)) { + // TO DO + $hyperlink = $styleRegion->Style->HyperLink->attributes(); + } + } +// var_dump($styleArray); +// echo '<br />'; + $objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($styleArray); + } + } + } + + if ((!$this->readDataOnly) && (isset($sheet->Cols))) { + // Column Widths + $columnAttributes = $sheet->Cols->attributes(); + $defaultWidth = $columnAttributes['DefaultSizePts'] / 5.4; + $c = 0; + foreach ($sheet->Cols->ColInfo as $columnOverride) { + $columnAttributes = $columnOverride->attributes(); + $column = $columnAttributes['No']; + $columnWidth = $columnAttributes['Unit'] / 5.4; + $hidden = ((isset($columnAttributes['Hidden'])) && ($columnAttributes['Hidden'] == '1')) ? true : false; + $columnCount = (isset($columnAttributes['Count'])) ? $columnAttributes['Count'] : 1; + while ($c < $column) { + $objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setWidth($defaultWidth); + ++$c; + } + while (($c < ($column+$columnCount)) && ($c <= $maxCol)) { + $objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setWidth($columnWidth); + if ($hidden) { + $objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setVisible(false); + } + ++$c; + } + } + while ($c <= $maxCol) { + $objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setWidth($defaultWidth); + ++$c; + } + } + + if ((!$this->readDataOnly) && (isset($sheet->Rows))) { + // Row Heights + $rowAttributes = $sheet->Rows->attributes(); + $defaultHeight = $rowAttributes['DefaultSizePts']; + $r = 0; + + foreach ($sheet->Rows->RowInfo as $rowOverride) { + $rowAttributes = $rowOverride->attributes(); + $row = $rowAttributes['No']; + $rowHeight = $rowAttributes['Unit']; + $hidden = ((isset($rowAttributes['Hidden'])) && ($rowAttributes['Hidden'] == '1')) ? true : false; + $rowCount = (isset($rowAttributes['Count'])) ? $rowAttributes['Count'] : 1; + while ($r < $row) { + ++$r; + $objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight); + } + while (($r < ($row+$rowCount)) && ($r < $maxRow)) { + ++$r; + $objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($rowHeight); + if ($hidden) { + $objPHPExcel->getActiveSheet()->getRowDimension($r)->setVisible(false); + } + } + } + while ($r < $maxRow) { + ++$r; + $objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight); + } + } + + // Handle Merged Cells in this worksheet + if (isset($sheet->MergedRegions)) { + foreach ($sheet->MergedRegions->Merge as $mergeCells) { + if (strpos($mergeCells, ':') !== false) { + $objPHPExcel->getActiveSheet()->mergeCells($mergeCells); + } + } + } + + $worksheetID++; + } + + // Loop through definedNames (global named ranges) + if (isset($gnmXML->Names)) { + foreach ($gnmXML->Names->Name as $namedRange) { + $name = (string) $namedRange->name; + $range = (string) $namedRange->value; + if (stripos($range, '#REF!') !== false) { + continue; + } + + $range = explode('!', $range); + $range[0] = trim($range[0], "'"); + if ($worksheet = $objPHPExcel->getSheetByName($range[0])) { + $extractedRange = str_replace('$', '', $range[1]); + $objPHPExcel->addNamedRange(new PHPExcel_NamedRange($name, $worksheet, $extractedRange)); + } + } + } + + // Return + return $objPHPExcel; + } + + private static function parseBorderAttributes($borderAttributes) + { + $styleArray = array(); + if (isset($borderAttributes["Color"])) { + $styleArray['color']['rgb'] = self::parseGnumericColour($borderAttributes["Color"]); + } + + switch ($borderAttributes["Style"]) { + case '0': + $styleArray['style'] = PHPExcel_Style_Border::BORDER_NONE; + break; + case '1': + $styleArray['style'] = PHPExcel_Style_Border::BORDER_THIN; + break; + case '2': + $styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUM; + break; + case '3': + $styleArray['style'] = PHPExcel_Style_Border::BORDER_SLANTDASHDOT; + break; + case '4': + $styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHED; + break; + case '5': + $styleArray['style'] = PHPExcel_Style_Border::BORDER_THICK; + break; + case '6': + $styleArray['style'] = PHPExcel_Style_Border::BORDER_DOUBLE; + break; + case '7': + $styleArray['style'] = PHPExcel_Style_Border::BORDER_DOTTED; + break; + case '8': + $styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHED; + break; + case '9': + $styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHDOT; + break; + case '10': + $styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT; + break; + case '11': + $styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHDOTDOT; + break; + case '12': + $styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT; + break; + case '13': + $styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT; + break; + } + return $styleArray; + } + + private function parseRichText($is = '') + { + $value = new PHPExcel_RichText(); + $value->createText($is); + + return $value; + } + + private static function parseGnumericColour($gnmColour) + { + list($gnmR, $gnmG, $gnmB) = explode(':', $gnmColour); + $gnmR = substr(str_pad($gnmR, 4, '0', STR_PAD_RIGHT), 0, 2); + $gnmG = substr(str_pad($gnmG, 4, '0', STR_PAD_RIGHT), 0, 2); + $gnmB = substr(str_pad($gnmB, 4, '0', STR_PAD_RIGHT), 0, 2); + return $gnmR . $gnmG . $gnmB; + } +} diff --git a/extend/PHPExcel/PHPExcel/Reader/HTML.php b/extend/PHPExcel/PHPExcel/Reader/HTML.php new file mode 100644 index 0000000..ac762a4 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/HTML.php @@ -0,0 +1,549 @@ +<?php + +if (!defined('PHPEXCEL_ROOT')) { + /** + * @ignore + */ + define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../'); + require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); +} + +/** + * PHPExcel_Reader_HTML + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Reader + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +/** PHPExcel root directory */ +class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader +{ + + /** + * Input encoding + * + * @var string + */ + protected $inputEncoding = 'ANSI'; + + /** + * Sheet index to read + * + * @var int + */ + protected $sheetIndex = 0; + + /** + * Formats + * + * @var array + */ + protected $formats = array( + 'h1' => array( + 'font' => array( + 'bold' => true, + 'size' => 24, + ), + ), // Bold, 24pt + 'h2' => array( + 'font' => array( + 'bold' => true, + 'size' => 18, + ), + ), // Bold, 18pt + 'h3' => array( + 'font' => array( + 'bold' => true, + 'size' => 13.5, + ), + ), // Bold, 13.5pt + 'h4' => array( + 'font' => array( + 'bold' => true, + 'size' => 12, + ), + ), // Bold, 12pt + 'h5' => array( + 'font' => array( + 'bold' => true, + 'size' => 10, + ), + ), // Bold, 10pt + 'h6' => array( + 'font' => array( + 'bold' => true, + 'size' => 7.5, + ), + ), // Bold, 7.5pt + 'a' => array( + 'font' => array( + 'underline' => true, + 'color' => array( + 'argb' => PHPExcel_Style_Color::COLOR_BLUE, + ), + ), + ), // Blue underlined + 'hr' => array( + 'borders' => array( + 'bottom' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN, + 'color' => array( + PHPExcel_Style_Color::COLOR_BLACK, + ), + ), + ), + ), // Bottom border + ); + + protected $rowspan = array(); + + /** + * Create a new PHPExcel_Reader_HTML + */ + public function __construct() + { + $this->readFilter = new PHPExcel_Reader_DefaultReadFilter(); + } + + /** + * Validate that the current file is an HTML file + * + * @return boolean + */ + protected function isValidFormat() + { + // Reading 2048 bytes should be enough to validate that the format is HTML + $data = fread($this->fileHandle, 2048); + if ((strpos($data, '<') !== false) && + (strlen($data) !== strlen(strip_tags($data)))) { + return true; + } + + return false; + } + + /** + * Loads PHPExcel from file + * + * @param string $pFilename + * @return PHPExcel + * @throws PHPExcel_Reader_Exception + */ + public function load($pFilename) + { + // Create new PHPExcel + $objPHPExcel = new PHPExcel(); + + // Load into this instance + return $this->loadIntoExisting($pFilename, $objPHPExcel); + } + + /** + * Set input encoding + * + * @param string $pValue Input encoding + */ + public function setInputEncoding($pValue = 'ANSI') + { + $this->inputEncoding = $pValue; + + return $this; + } + + /** + * Get input encoding + * + * @return string + */ + public function getInputEncoding() + { + return $this->inputEncoding; + } + + // Data Array used for testing only, should write to PHPExcel object on completion of tests + protected $dataArray = array(); + protected $tableLevel = 0; + protected $nestedColumn = array('A'); + + protected function setTableStartColumn($column) + { + if ($this->tableLevel == 0) { + $column = 'A'; + } + ++$this->tableLevel; + $this->nestedColumn[$this->tableLevel] = $column; + + return $this->nestedColumn[$this->tableLevel]; + } + + protected function getTableStartColumn() + { + return $this->nestedColumn[$this->tableLevel]; + } + + protected function releaseTableStartColumn() + { + --$this->tableLevel; + + return array_pop($this->nestedColumn); + } + + protected function flushCell($sheet, $column, $row, &$cellContent) + { + if (is_string($cellContent)) { + // Simple String content + if (trim($cellContent) > '') { + // Only actually write it if there's content in the string +// echo 'FLUSH CELL: ' , $column , $row , ' => ' , $cellContent , '<br />'; + // Write to worksheet to be done here... + // ... we return the cell so we can mess about with styles more easily + $sheet->setCellValue($column . $row, $cellContent, true); + $this->dataArray[$row][$column] = $cellContent; + } + } else { + // We have a Rich Text run + // TODO + $this->dataArray[$row][$column] = 'RICH TEXT: ' . $cellContent; + } + $cellContent = (string) ''; + } + + protected function processDomElement(DOMNode $element, $sheet, &$row, &$column, &$cellContent, $format = null) + { + foreach ($element->childNodes as $child) { + if ($child instanceof DOMText) { + $domText = preg_replace('/\s+/u', ' ', trim($child->nodeValue)); + if (is_string($cellContent)) { + // simply append the text if the cell content is a plain text string + $cellContent .= $domText; + } else { + // but if we have a rich text run instead, we need to append it correctly + // TODO + } + } elseif ($child instanceof DOMElement) { +// echo '<b>DOM ELEMENT: </b>' , strtoupper($child->nodeName) , '<br />'; + + $attributeArray = array(); + foreach ($child->attributes as $attribute) { +// echo '<b>ATTRIBUTE: </b>' , $attribute->name , ' => ' , $attribute->value , '<br />'; + $attributeArray[$attribute->name] = $attribute->value; + } + + switch ($child->nodeName) { + case 'meta': + foreach ($attributeArray as $attributeName => $attributeValue) { + switch ($attributeName) { + case 'content': + // TODO + // Extract character set, so we can convert to UTF-8 if required + break; + } + } + $this->processDomElement($child, $sheet, $row, $column, $cellContent); + break; + case 'title': + $this->processDomElement($child, $sheet, $row, $column, $cellContent); + $sheet->setTitle($cellContent); + $cellContent = ''; + break; + case 'span': + case 'div': + case 'font': + case 'i': + case 'em': + case 'strong': + case 'b': +// echo 'STYLING, SPAN OR DIV<br />'; + if ($cellContent > '') { + $cellContent .= ' '; + } + $this->processDomElement($child, $sheet, $row, $column, $cellContent); + if ($cellContent > '') { + $cellContent .= ' '; + } +// echo 'END OF STYLING, SPAN OR DIV<br />'; + break; + case 'hr': + $this->flushCell($sheet, $column, $row, $cellContent); + ++$row; + if (isset($this->formats[$child->nodeName])) { + $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]); + } else { + $cellContent = '----------'; + $this->flushCell($sheet, $column, $row, $cellContent); + } + ++$row; + // Add a break after a horizontal rule, simply by allowing the code to dropthru + case 'br': + if ($this->tableLevel > 0) { + // If we're inside a table, replace with a \n + $cellContent .= "\n"; + } else { + // Otherwise flush our existing content and move the row cursor on + $this->flushCell($sheet, $column, $row, $cellContent); + ++$row; + } +// echo 'HARD LINE BREAK: ' , '<br />'; + break; + case 'a': +// echo 'START OF HYPERLINK: ' , '<br />'; + foreach ($attributeArray as $attributeName => $attributeValue) { + switch ($attributeName) { + case 'href': +// echo 'Link to ' , $attributeValue , '<br />'; + $sheet->getCell($column . $row)->getHyperlink()->setUrl($attributeValue); + if (isset($this->formats[$child->nodeName])) { + $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]); + } + break; + } + } + $cellContent .= ' '; + $this->processDomElement($child, $sheet, $row, $column, $cellContent); +// echo 'END OF HYPERLINK:' , '<br />'; + break; + case 'h1': + case 'h2': + case 'h3': + case 'h4': + case 'h5': + case 'h6': + case 'ol': + case 'ul': + case 'p': + if ($this->tableLevel > 0) { + // If we're inside a table, replace with a \n + $cellContent .= "\n"; +// echo 'LIST ENTRY: ' , '<br />'; + $this->processDomElement($child, $sheet, $row, $column, $cellContent); +// echo 'END OF LIST ENTRY:' , '<br />'; + } else { + if ($cellContent > '') { + $this->flushCell($sheet, $column, $row, $cellContent); + $row++; + } +// echo 'START OF PARAGRAPH: ' , '<br />'; + $this->processDomElement($child, $sheet, $row, $column, $cellContent); +// echo 'END OF PARAGRAPH:' , '<br />'; + $this->flushCell($sheet, $column, $row, $cellContent); + + if (isset($this->formats[$child->nodeName])) { + $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]); + } + + $row++; + $column = 'A'; + } + break; + case 'li': + if ($this->tableLevel > 0) { + // If we're inside a table, replace with a \n + $cellContent .= "\n"; +// echo 'LIST ENTRY: ' , '<br />'; + $this->processDomElement($child, $sheet, $row, $column, $cellContent); +// echo 'END OF LIST ENTRY:' , '<br />'; + } else { + if ($cellContent > '') { + $this->flushCell($sheet, $column, $row, $cellContent); + } + ++$row; +// echo 'LIST ENTRY: ' , '<br />'; + $this->processDomElement($child, $sheet, $row, $column, $cellContent); +// echo 'END OF LIST ENTRY:' , '<br />'; + $this->flushCell($sheet, $column, $row, $cellContent); + $column = 'A'; + } + break; + case 'table': + $this->flushCell($sheet, $column, $row, $cellContent); + $column = $this->setTableStartColumn($column); +// echo 'START OF TABLE LEVEL ' , $this->tableLevel , '<br />'; + if ($this->tableLevel > 1) { + --$row; + } + $this->processDomElement($child, $sheet, $row, $column, $cellContent); +// echo 'END OF TABLE LEVEL ' , $this->tableLevel , '<br />'; + $column = $this->releaseTableStartColumn(); + if ($this->tableLevel > 1) { + ++$column; + } else { + ++$row; + } + break; + case 'thead': + case 'tbody': + $this->processDomElement($child, $sheet, $row, $column, $cellContent); + break; + case 'tr': + $column = $this->getTableStartColumn(); + $cellContent = ''; +// echo 'START OF TABLE ' , $this->tableLevel , ' ROW<br />'; + $this->processDomElement($child, $sheet, $row, $column, $cellContent); + ++$row; +// echo 'END OF TABLE ' , $this->tableLevel , ' ROW<br />'; + break; + case 'th': + case 'td': +// echo 'START OF TABLE ' , $this->tableLevel , ' CELL<br />'; + $this->processDomElement($child, $sheet, $row, $column, $cellContent); +// echo 'END OF TABLE ' , $this->tableLevel , ' CELL<br />'; + + while (isset($this->rowspan[$column . $row])) { + ++$column; + } + + $this->flushCell($sheet, $column, $row, $cellContent); + +// if (isset($attributeArray['style']) && !empty($attributeArray['style'])) { +// $styleAry = $this->getPhpExcelStyleArray($attributeArray['style']); +// +// if (!empty($styleAry)) { +// $sheet->getStyle($column . $row)->applyFromArray($styleAry); +// } +// } + + if (isset($attributeArray['rowspan']) && isset($attributeArray['colspan'])) { + //create merging rowspan and colspan + $columnTo = $column; + for ($i = 0; $i < $attributeArray['colspan'] - 1; $i++) { + ++$columnTo; + } + $range = $column . $row . ':' . $columnTo . ($row + $attributeArray['rowspan'] - 1); + foreach (\PHPExcel_Cell::extractAllCellReferencesInRange($range) as $value) { + $this->rowspan[$value] = true; + } + $sheet->mergeCells($range); + $column = $columnTo; + } elseif (isset($attributeArray['rowspan'])) { + //create merging rowspan + $range = $column . $row . ':' . $column . ($row + $attributeArray['rowspan'] - 1); + foreach (\PHPExcel_Cell::extractAllCellReferencesInRange($range) as $value) { + $this->rowspan[$value] = true; + } + $sheet->mergeCells($range); + } elseif (isset($attributeArray['colspan'])) { + //create merging colspan + $columnTo = $column; + for ($i = 0; $i < $attributeArray['colspan'] - 1; $i++) { + ++$columnTo; + } + $sheet->mergeCells($column . $row . ':' . $columnTo . $row); + $column = $columnTo; + } + ++$column; + break; + case 'body': + $row = 1; + $column = 'A'; + $content = ''; + $this->tableLevel = 0; + $this->processDomElement($child, $sheet, $row, $column, $cellContent); + break; + default: + $this->processDomElement($child, $sheet, $row, $column, $cellContent); + } + } + } + } + + /** + * Loads PHPExcel from file into PHPExcel instance + * + * @param string $pFilename + * @param PHPExcel $objPHPExcel + * @return PHPExcel + * @throws PHPExcel_Reader_Exception + */ + public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) + { + // Open file to validate + $this->openFile($pFilename); + if (!$this->isValidFormat()) { + fclose($this->fileHandle); + throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid HTML file."); + } + // Close after validating + fclose($this->fileHandle); + + // Create new PHPExcel + while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) { + $objPHPExcel->createSheet(); + } + $objPHPExcel->setActiveSheetIndex($this->sheetIndex); + + // Create a new DOM object + $dom = new domDocument; + // Reload the HTML file into the DOM object + $loaded = $dom->loadHTML(mb_convert_encoding($this->securityScanFile($pFilename), 'HTML-ENTITIES', 'UTF-8')); + if ($loaded === false) { + throw new PHPExcel_Reader_Exception('Failed to load ' . $pFilename . ' as a DOM Document'); + } + + // Discard white space + $dom->preserveWhiteSpace = false; + + $row = 0; + $column = 'A'; + $content = ''; + $this->processDomElement($dom, $objPHPExcel->getActiveSheet(), $row, $column, $content); + + // Return + return $objPHPExcel; + } + + /** + * Get sheet index + * + * @return int + */ + public function getSheetIndex() + { + return $this->sheetIndex; + } + + /** + * Set sheet index + * + * @param int $pValue Sheet index + * @return PHPExcel_Reader_HTML + */ + public function setSheetIndex($pValue = 0) + { + $this->sheetIndex = $pValue; + + return $this; + } + + /** + * Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks + * + * @param string $xml + * @throws PHPExcel_Reader_Exception + */ + public function securityScan($xml) + { + $pattern = '/\\0?' . implode('\\0?', str_split('<!ENTITY')) . '\\0?/'; + if (preg_match($pattern, $xml)) { + throw new PHPExcel_Reader_Exception('Detected use of ENTITY in XML, spreadsheet file load() aborted to prevent XXE/XEE attacks'); + } + return $xml; + } +} diff --git a/extend/PHPExcel/PHPExcel/Reader/IReadFilter.php b/extend/PHPExcel/PHPExcel/Reader/IReadFilter.php new file mode 100644 index 0000000..f7c852d --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/IReadFilter.php @@ -0,0 +1,39 @@ +<?php + +/** + * PHPExcel_Reader_IReadFilter + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Reader + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +interface PHPExcel_Reader_IReadFilter +{ + /** + * Should this cell be read? + * + * @param $column Column address (as a string value like "A", or "IV") + * @param $row Row number + * @param $worksheetName Optional worksheet name + * @return boolean + */ + public function readCell($column, $row, $worksheetName = ''); +} diff --git a/extend/PHPExcel/PHPExcel/Reader/IReader.php b/extend/PHPExcel/PHPExcel/Reader/IReader.php new file mode 100644 index 0000000..9034546 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/IReader.php @@ -0,0 +1,46 @@ +<?php + +/** + * PHPExcel_Reader_IReader + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Reader + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +interface PHPExcel_Reader_IReader +{ + /** + * Can the current PHPExcel_Reader_IReader read the file? + * + * @param string $pFilename + * @return boolean + */ + public function canRead($pFilename); + + /** + * Loads PHPExcel from file + * + * @param string $pFilename + * @return PHPExcel + * @throws PHPExcel_Reader_Exception + */ + public function load($pFilename); +} diff --git a/extend/PHPExcel/PHPExcel/Reader/OOCalc.php b/extend/PHPExcel/PHPExcel/Reader/OOCalc.php new file mode 100644 index 0000000..a889d95 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/OOCalc.php @@ -0,0 +1,696 @@ +<?php + +/** PHPExcel root directory */ +if (!defined('PHPEXCEL_ROOT')) { + /** + * @ignore + */ + define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../'); + require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); +} + +/** + * PHPExcel_Reader_OOCalc + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Reader + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader +{ + /** + * Formats + * + * @var array + */ + private $styles = array(); + + /** + * Create a new PHPExcel_Reader_OOCalc + */ + public function __construct() + { + $this->readFilter = new PHPExcel_Reader_DefaultReadFilter(); + } + + /** + * Can the current PHPExcel_Reader_IReader read the file? + * + * @param string $pFilename + * @return boolean + * @throws PHPExcel_Reader_Exception + */ + public function canRead($pFilename) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + $zipClass = PHPExcel_Settings::getZipClass(); + + // Check if zip class exists +// if (!class_exists($zipClass, false)) { +// throw new PHPExcel_Reader_Exception($zipClass . " library is not enabled"); +// } + + $mimeType = 'UNKNOWN'; + // Load file + $zip = new $zipClass; + if ($zip->open($pFilename) === true) { + // check if it is an OOXML archive + $stat = $zip->statName('mimetype'); + if ($stat && ($stat['size'] <= 255)) { + $mimeType = $zip->getFromName($stat['name']); + } elseif ($stat = $zip->statName('META-INF/manifest.xml')) { + $xml = simplexml_load_string($this->securityScan($zip->getFromName('META-INF/manifest.xml')), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + $namespacesContent = $xml->getNamespaces(true); + if (isset($namespacesContent['manifest'])) { + $manifest = $xml->children($namespacesContent['manifest']); + foreach ($manifest as $manifestDataSet) { + $manifestAttributes = $manifestDataSet->attributes($namespacesContent['manifest']); + if ($manifestAttributes->{'full-path'} == '/') { + $mimeType = (string) $manifestAttributes->{'media-type'}; + break; + } + } + } + } + + $zip->close(); + + return ($mimeType === 'application/vnd.oasis.opendocument.spreadsheet'); + } + + return false; + } + + + /** + * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object + * + * @param string $pFilename + * @throws PHPExcel_Reader_Exception + */ + public function listWorksheetNames($pFilename) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + $zipClass = PHPExcel_Settings::getZipClass(); + + $zip = new $zipClass; + if (!$zip->open($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! Error opening file."); + } + + $worksheetNames = array(); + + $xml = new XMLReader(); + $res = $xml->xml($this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'), null, PHPExcel_Settings::getLibXmlLoaderOptions()); + $xml->setParserProperty(2, true); + + // Step into the first level of content of the XML + $xml->read(); + while ($xml->read()) { + // Quickly jump through to the office:body node + while ($xml->name !== 'office:body') { + if ($xml->isEmptyElement) { + $xml->read(); + } else { + $xml->next(); + } + } + // Now read each node until we find our first table:table node + while ($xml->read()) { + if ($xml->name == 'table:table' && $xml->nodeType == XMLReader::ELEMENT) { + // Loop through each table:table node reading the table:name attribute for each worksheet name + do { + $worksheetNames[] = $xml->getAttribute('table:name'); + $xml->next(); + } while ($xml->name == 'table:table' && $xml->nodeType == XMLReader::ELEMENT); + } + } + } + + return $worksheetNames; + } + + /** + * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns) + * + * @param string $pFilename + * @throws PHPExcel_Reader_Exception + */ + public function listWorksheetInfo($pFilename) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + $worksheetInfo = array(); + + $zipClass = PHPExcel_Settings::getZipClass(); + + $zip = new $zipClass; + if (!$zip->open($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! Error opening file."); + } + + $xml = new XMLReader(); + $res = $xml->xml($this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'), null, PHPExcel_Settings::getLibXmlLoaderOptions()); + $xml->setParserProperty(2, true); + + // Step into the first level of content of the XML + $xml->read(); + while ($xml->read()) { + // Quickly jump through to the office:body node + while ($xml->name !== 'office:body') { + if ($xml->isEmptyElement) { + $xml->read(); + } else { + $xml->next(); + } + } + // Now read each node until we find our first table:table node + while ($xml->read()) { + if ($xml->name == 'table:table' && $xml->nodeType == XMLReader::ELEMENT) { + $worksheetNames[] = $xml->getAttribute('table:name'); + + $tmpInfo = array( + 'worksheetName' => $xml->getAttribute('table:name'), + 'lastColumnLetter' => 'A', + 'lastColumnIndex' => 0, + 'totalRows' => 0, + 'totalColumns' => 0, + ); + + // Loop through each child node of the table:table element reading + $currCells = 0; + do { + $xml->read(); + if ($xml->name == 'table:table-row' && $xml->nodeType == XMLReader::ELEMENT) { + $rowspan = $xml->getAttribute('table:number-rows-repeated'); + $rowspan = empty($rowspan) ? 1 : $rowspan; + $tmpInfo['totalRows'] += $rowspan; + $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells); + $currCells = 0; + // Step into the row + $xml->read(); + do { + if ($xml->name == 'table:table-cell' && $xml->nodeType == XMLReader::ELEMENT) { + if (!$xml->isEmptyElement) { + $currCells++; + $xml->next(); + } else { + $xml->read(); + } + } elseif ($xml->name == 'table:covered-table-cell' && $xml->nodeType == XMLReader::ELEMENT) { + $mergeSize = $xml->getAttribute('table:number-columns-repeated'); + $currCells += $mergeSize; + $xml->read(); + } + } while ($xml->name != 'table:table-row'); + } + } while ($xml->name != 'table:table'); + + $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells); + $tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1; + $tmpInfo['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); + $worksheetInfo[] = $tmpInfo; + } + } + +// foreach ($workbookData->table as $worksheetDataSet) { +// $worksheetData = $worksheetDataSet->children($namespacesContent['table']); +// $worksheetDataAttributes = $worksheetDataSet->attributes($namespacesContent['table']); +// +// $rowIndex = 0; +// foreach ($worksheetData as $key => $rowData) { +// switch ($key) { +// case 'table-row' : +// $rowDataTableAttributes = $rowData->attributes($namespacesContent['table']); +// $rowRepeats = (isset($rowDataTableAttributes['number-rows-repeated'])) ? +// $rowDataTableAttributes['number-rows-repeated'] : 1; +// $columnIndex = 0; +// +// foreach ($rowData as $key => $cellData) { +// $cellDataTableAttributes = $cellData->attributes($namespacesContent['table']); +// $colRepeats = (isset($cellDataTableAttributes['number-columns-repeated'])) ? +// $cellDataTableAttributes['number-columns-repeated'] : 1; +// $cellDataOfficeAttributes = $cellData->attributes($namespacesContent['office']); +// if (isset($cellDataOfficeAttributes['value-type'])) { +// $tmpInfo['lastColumnIndex'] = max($tmpInfo['lastColumnIndex'], $columnIndex + $colRepeats - 1); +// $tmpInfo['totalRows'] = max($tmpInfo['totalRows'], $rowIndex + $rowRepeats); +// } +// $columnIndex += $colRepeats; +// } +// $rowIndex += $rowRepeats; +// break; +// } +// } +// +// $tmpInfo['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); +// $tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1; +// +// } +// } + } + + return $worksheetInfo; + } + + /** + * Loads PHPExcel from file + * + * @param string $pFilename + * @return PHPExcel + * @throws PHPExcel_Reader_Exception + */ + public function load($pFilename) + { + // Create new PHPExcel + $objPHPExcel = new PHPExcel(); + + // Load into this instance + return $this->loadIntoExisting($pFilename, $objPHPExcel); + } + + private static function identifyFixedStyleValue($styleList, &$styleAttributeValue) + { + $styleAttributeValue = strtolower($styleAttributeValue); + foreach ($styleList as $style) { + if ($styleAttributeValue == strtolower($style)) { + $styleAttributeValue = $style; + return true; + } + } + return false; + } + + /** + * Loads PHPExcel from file into PHPExcel instance + * + * @param string $pFilename + * @param PHPExcel $objPHPExcel + * @return PHPExcel + * @throws PHPExcel_Reader_Exception + */ + public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + $timezoneObj = new DateTimeZone('Europe/London'); + $GMT = new DateTimeZone('UTC'); + + $zipClass = PHPExcel_Settings::getZipClass(); + + $zip = new $zipClass; + if (!$zip->open($pFilename)) { + throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! Error opening file."); + } + +// echo '<h1>Meta Information</h1>'; + $xml = simplexml_load_string($this->securityScan($zip->getFromName("meta.xml")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + $namespacesMeta = $xml->getNamespaces(true); +// echo '<pre>'; +// print_r($namespacesMeta); +// echo '</pre><hr />'; + + $docProps = $objPHPExcel->getProperties(); + $officeProperty = $xml->children($namespacesMeta['office']); + foreach ($officeProperty as $officePropertyData) { + $officePropertyDC = array(); + if (isset($namespacesMeta['dc'])) { + $officePropertyDC = $officePropertyData->children($namespacesMeta['dc']); + } + foreach ($officePropertyDC as $propertyName => $propertyValue) { + $propertyValue = (string) $propertyValue; + switch ($propertyName) { + case 'title': + $docProps->setTitle($propertyValue); + break; + case 'subject': + $docProps->setSubject($propertyValue); + break; + case 'creator': + $docProps->setCreator($propertyValue); + $docProps->setLastModifiedBy($propertyValue); + break; + case 'date': + $creationDate = strtotime($propertyValue); + $docProps->setCreated($creationDate); + $docProps->setModified($creationDate); + break; + case 'description': + $docProps->setDescription($propertyValue); + break; + } + } + $officePropertyMeta = array(); + if (isset($namespacesMeta['dc'])) { + $officePropertyMeta = $officePropertyData->children($namespacesMeta['meta']); + } + foreach ($officePropertyMeta as $propertyName => $propertyValue) { + $propertyValueAttributes = $propertyValue->attributes($namespacesMeta['meta']); + $propertyValue = (string) $propertyValue; + switch ($propertyName) { + case 'initial-creator': + $docProps->setCreator($propertyValue); + break; + case 'keyword': + $docProps->setKeywords($propertyValue); + break; + case 'creation-date': + $creationDate = strtotime($propertyValue); + $docProps->setCreated($creationDate); + break; + case 'user-defined': + $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_STRING; + foreach ($propertyValueAttributes as $key => $value) { + if ($key == 'name') { + $propertyValueName = (string) $value; + } elseif ($key == 'value-type') { + switch ($value) { + case 'date': + $propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue, 'date'); + $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_DATE; + break; + case 'boolean': + $propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue, 'bool'); + $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_BOOLEAN; + break; + case 'float': + $propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue, 'r4'); + $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_FLOAT; + break; + default: + $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_STRING; + } + } + } + $docProps->setCustomProperty($propertyValueName, $propertyValue, $propertyValueType); + break; + } + } + } + + +// echo '<h1>Workbook Content</h1>'; + $xml = simplexml_load_string($this->securityScan($zip->getFromName("content.xml")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + $namespacesContent = $xml->getNamespaces(true); +// echo '<pre>'; +// print_r($namespacesContent); +// echo '</pre><hr />'; + + $workbook = $xml->children($namespacesContent['office']); + foreach ($workbook->body->spreadsheet as $workbookData) { + $workbookData = $workbookData->children($namespacesContent['table']); + $worksheetID = 0; + foreach ($workbookData->table as $worksheetDataSet) { + $worksheetData = $worksheetDataSet->children($namespacesContent['table']); +// print_r($worksheetData); +// echo '<br />'; + $worksheetDataAttributes = $worksheetDataSet->attributes($namespacesContent['table']); +// print_r($worksheetDataAttributes); +// echo '<br />'; + if ((isset($this->loadSheetsOnly)) && (isset($worksheetDataAttributes['name'])) && + (!in_array($worksheetDataAttributes['name'], $this->loadSheetsOnly))) { + continue; + } + +// echo '<h2>Worksheet '.$worksheetDataAttributes['name'].'</h2>'; + // Create new Worksheet + $objPHPExcel->createSheet(); + $objPHPExcel->setActiveSheetIndex($worksheetID); + if (isset($worksheetDataAttributes['name'])) { + $worksheetName = (string) $worksheetDataAttributes['name']; + // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in + // formula cells... during the load, all formulae should be correct, and we're simply + // bringing the worksheet name in line with the formula, not the reverse + $objPHPExcel->getActiveSheet()->setTitle($worksheetName, false); + } + + $rowID = 1; + foreach ($worksheetData as $key => $rowData) { +// echo '<b>'.$key.'</b><br />'; + switch ($key) { + case 'table-header-rows': + foreach ($rowData as $key => $cellData) { + $rowData = $cellData; + break; + } + case 'table-row': + $rowDataTableAttributes = $rowData->attributes($namespacesContent['table']); + $rowRepeats = (isset($rowDataTableAttributes['number-rows-repeated'])) ? $rowDataTableAttributes['number-rows-repeated'] : 1; + $columnID = 'A'; + foreach ($rowData as $key => $cellData) { + if ($this->getReadFilter() !== null) { + if (!$this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) { + continue; + } + } + +// echo '<b>'.$columnID.$rowID.'</b><br />'; + $cellDataText = (isset($namespacesContent['text'])) ? $cellData->children($namespacesContent['text']) : ''; + $cellDataOffice = $cellData->children($namespacesContent['office']); + $cellDataOfficeAttributes = $cellData->attributes($namespacesContent['office']); + $cellDataTableAttributes = $cellData->attributes($namespacesContent['table']); + +// echo 'Office Attributes: '; +// print_r($cellDataOfficeAttributes); +// echo '<br />Table Attributes: '; +// print_r($cellDataTableAttributes); +// echo '<br />Cell Data Text'; +// print_r($cellDataText); +// echo '<br />'; +// + $type = $formatting = $hyperlink = null; + $hasCalculatedValue = false; + $cellDataFormula = ''; + if (isset($cellDataTableAttributes['formula'])) { + $cellDataFormula = $cellDataTableAttributes['formula']; + $hasCalculatedValue = true; + } + + if (isset($cellDataOffice->annotation)) { +// echo 'Cell has comment<br />'; + $annotationText = $cellDataOffice->annotation->children($namespacesContent['text']); + $textArray = array(); + foreach ($annotationText as $t) { + if (isset($t->span)) { + foreach ($t->span as $text) { + $textArray[] = (string)$text; + } + } else { + $textArray[] = (string) $t; + } + } + $text = implode("\n", $textArray); +// echo $text, '<br />'; + $objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setText($this->parseRichText($text)); +// ->setAuthor( $author ) + } + + if (isset($cellDataText->p)) { + // Consolidate if there are multiple p records (maybe with spans as well) + $dataArray = array(); + // Text can have multiple text:p and within those, multiple text:span. + // text:p newlines, but text:span does not. + // Also, here we assume there is no text data is span fields are specified, since + // we have no way of knowing proper positioning anyway. + foreach ($cellDataText->p as $pData) { + if (isset($pData->span)) { + // span sections do not newline, so we just create one large string here + $spanSection = ""; + foreach ($pData->span as $spanData) { + $spanSection .= $spanData; + } + array_push($dataArray, $spanSection); + } else { + array_push($dataArray, $pData); + } + } + $allCellDataText = implode($dataArray, "\n"); + +// echo 'Value Type is '.$cellDataOfficeAttributes['value-type'].'<br />'; + switch ($cellDataOfficeAttributes['value-type']) { + case 'string': + $type = PHPExcel_Cell_DataType::TYPE_STRING; + $dataValue = $allCellDataText; + if (isset($dataValue->a)) { + $dataValue = $dataValue->a; + $cellXLinkAttributes = $dataValue->attributes($namespacesContent['xlink']); + $hyperlink = $cellXLinkAttributes['href']; + } + break; + case 'boolean': + $type = PHPExcel_Cell_DataType::TYPE_BOOL; + $dataValue = ($allCellDataText == 'TRUE') ? true : false; + break; + case 'percentage': + $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; + $dataValue = (float) $cellDataOfficeAttributes['value']; + if (floor($dataValue) == $dataValue) { + $dataValue = (integer) $dataValue; + } + $formatting = PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00; + break; + case 'currency': + $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; + $dataValue = (float) $cellDataOfficeAttributes['value']; + if (floor($dataValue) == $dataValue) { + $dataValue = (integer) $dataValue; + } + $formatting = PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE; + break; + case 'float': + $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; + $dataValue = (float) $cellDataOfficeAttributes['value']; + if (floor($dataValue) == $dataValue) { + if ($dataValue == (integer) $dataValue) { + $dataValue = (integer) $dataValue; + } else { + $dataValue = (float) $dataValue; + } + } + break; + case 'date': + $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; + $dateObj = new DateTime($cellDataOfficeAttributes['date-value'], $GMT); + $dateObj->setTimeZone($timezoneObj); + list($year, $month, $day, $hour, $minute, $second) = explode(' ', $dateObj->format('Y m d H i s')); + $dataValue = PHPExcel_Shared_Date::FormattedPHPToExcel($year, $month, $day, $hour, $minute, $second); + if ($dataValue != floor($dataValue)) { + $formatting = PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX15.' '.PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4; + } else { + $formatting = PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX15; + } + break; + case 'time': + $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; + $dataValue = PHPExcel_Shared_Date::PHPToExcel(strtotime('01-01-1970 '.implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS')))); + $formatting = PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4; + break; + } +// echo 'Data value is '.$dataValue.'<br />'; +// if ($hyperlink !== null) { +// echo 'Hyperlink is '.$hyperlink.'<br />'; +// } + } else { + $type = PHPExcel_Cell_DataType::TYPE_NULL; + $dataValue = null; + } + + if ($hasCalculatedValue) { + $type = PHPExcel_Cell_DataType::TYPE_FORMULA; +// echo 'Formula: ', $cellDataFormula, PHP_EOL; + $cellDataFormula = substr($cellDataFormula, strpos($cellDataFormula, ':=')+1); + $temp = explode('"', $cellDataFormula); + $tKey = false; + foreach ($temp as &$value) { + // Only replace in alternate array entries (i.e. non-quoted blocks) + if ($tKey = !$tKey) { + $value = preg_replace('/\[([^\.]+)\.([^\.]+):\.([^\.]+)\]/Ui', '$1!$2:$3', $value); // Cell range reference in another sheet + $value = preg_replace('/\[([^\.]+)\.([^\.]+)\]/Ui', '$1!$2', $value); // Cell reference in another sheet + $value = preg_replace('/\[\.([^\.]+):\.([^\.]+)\]/Ui', '$1:$2', $value); // Cell range reference + $value = preg_replace('/\[\.([^\.]+)\]/Ui', '$1', $value); // Simple cell reference + $value = PHPExcel_Calculation::translateSeparator(';', ',', $value, $inBraces); + } + } + unset($value); + // Then rebuild the formula string + $cellDataFormula = implode('"', $temp); +// echo 'Adjusted Formula: ', $cellDataFormula, PHP_EOL; + } + + $colRepeats = (isset($cellDataTableAttributes['number-columns-repeated'])) ? $cellDataTableAttributes['number-columns-repeated'] : 1; + if ($type !== null) { + for ($i = 0; $i < $colRepeats; ++$i) { + if ($i > 0) { + ++$columnID; + } + if ($type !== PHPExcel_Cell_DataType::TYPE_NULL) { + for ($rowAdjust = 0; $rowAdjust < $rowRepeats; ++$rowAdjust) { + $rID = $rowID + $rowAdjust; + $objPHPExcel->getActiveSheet()->getCell($columnID.$rID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue), $type); + if ($hasCalculatedValue) { +// echo 'Forumla result is '.$dataValue.'<br />'; + $objPHPExcel->getActiveSheet()->getCell($columnID.$rID)->setCalculatedValue($dataValue); + } + if ($formatting !== null) { + $objPHPExcel->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode($formatting); + } else { + $objPHPExcel->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_GENERAL); + } + if ($hyperlink !== null) { + $objPHPExcel->getActiveSheet()->getCell($columnID.$rID)->getHyperlink()->setUrl($hyperlink); + } + } + } + } + } + + // Merged cells + if ((isset($cellDataTableAttributes['number-columns-spanned'])) || (isset($cellDataTableAttributes['number-rows-spanned']))) { + if (($type !== PHPExcel_Cell_DataType::TYPE_NULL) || (!$this->readDataOnly)) { + $columnTo = $columnID; + if (isset($cellDataTableAttributes['number-columns-spanned'])) { + $columnTo = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($columnID) + $cellDataTableAttributes['number-columns-spanned'] -2); + } + $rowTo = $rowID; + if (isset($cellDataTableAttributes['number-rows-spanned'])) { + $rowTo = $rowTo + $cellDataTableAttributes['number-rows-spanned'] - 1; + } + $cellRange = $columnID.$rowID.':'.$columnTo.$rowTo; + $objPHPExcel->getActiveSheet()->mergeCells($cellRange); + } + } + + ++$columnID; + } + $rowID += $rowRepeats; + break; + } + } + ++$worksheetID; + } + } + + // Return + return $objPHPExcel; + } + + private function parseRichText($is = '') + { + $value = new PHPExcel_RichText(); + + $value->createText($is); + + return $value; + } +} diff --git a/extend/PHPExcel/PHPExcel/Reader/SYLK.php b/extend/PHPExcel/PHPExcel/Reader/SYLK.php new file mode 100644 index 0000000..eb7ef1a --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Reader/SYLK.php @@ -0,0 +1,478 @@ +<?php + +/** PHPExcel root directory */ +if (!defined('PHPEXCEL_ROOT')) { + /** + * @ignore + */ + define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../'); + require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); +} + +/** + * PHPExcel_Reader_SYLK + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Reader + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader +{ + /** + * Input encoding + * + * @var string + */ + private $inputEncoding = 'ANSI'; + + /** + * Sheet index to read + * + * @var int + */ + private $sheetIndex = 0; + + /** + * Formats + * + * @var array + */ + private $formats = array(); + + /** + * Format Count + * + * @var int + */ + private $format = 0; + + /** + * Create a new PHPExcel_Reader_SYLK + */ + public function __construct() + { + $this->readFilter = new PHPExcel_Reader_DefaultReadFilter(); + } + + /** + * Validate that the current file is a SYLK file + * + * @return boolean + */ + protected function isValidFormat() + { + // Read sample data (first 2 KB will do) + $data = fread($this->fileHandle, 2048); + + // Count delimiters in file + $delimiterCount = substr_count($data, ';'); + if ($delimiterCount < 1) { + return false; + } + + // Analyze first line looking for ID; signature + $lines = explode("\n", $data); + if (substr($lines[0], 0, 4) != 'ID;P') { + return false; + } + + return true; + } + + /** + * Set input encoding + * + * @param string $pValue Input encoding + */ + public function setInputEncoding($pValue = 'ANSI') + { + $this->inputEncoding = $pValue; + return $this; + } + + /** + * Get input encoding + * + * @return string + */ + public function getInputEncoding() + { + return $this->inputEncoding; + } + + /** + * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns) + * + * @param string $pFilename + * @throws PHPExcel_Reader_Exception + */ + public function listWorksheetInfo($pFilename) + { + // Open file + $this->openFile($pFilename); + if (!$this->isValidFormat()) { + fclose($this->fileHandle); + throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file."); + } + $fileHandle = $this->fileHandle; + rewind($fileHandle); + + $worksheetInfo = array(); + $worksheetInfo[0]['worksheetName'] = 'Worksheet'; + $worksheetInfo[0]['lastColumnLetter'] = 'A'; + $worksheetInfo[0]['lastColumnIndex'] = 0; + $worksheetInfo[0]['totalRows'] = 0; + $worksheetInfo[0]['totalColumns'] = 0; + + // Loop through file + $rowData = array(); + + // loop through one row (line) at a time in the file + $rowIndex = 0; + while (($rowData = fgets($fileHandle)) !== false) { + $columnIndex = 0; + + // convert SYLK encoded $rowData to UTF-8 + $rowData = PHPExcel_Shared_String::SYLKtoUTF8($rowData); + + // explode each row at semicolons while taking into account that literal semicolon (;) + // is escaped like this (;;) + $rowData = explode("\t", str_replace('¤', ';', str_replace(';', "\t", str_replace(';;', '¤', rtrim($rowData))))); + + $dataType = array_shift($rowData); + if ($dataType == 'C') { + // Read cell value data + foreach ($rowData as $rowDatum) { + switch ($rowDatum{0}) { + case 'C': + case 'X': + $columnIndex = substr($rowDatum, 1) - 1; + break; + case 'R': + case 'Y': + $rowIndex = substr($rowDatum, 1); + break; + } + + $worksheetInfo[0]['totalRows'] = max($worksheetInfo[0]['totalRows'], $rowIndex); + $worksheetInfo[0]['lastColumnIndex'] = max($worksheetInfo[0]['lastColumnIndex'], $columnIndex); + } + } + } + + $worksheetInfo[0]['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($worksheetInfo[0]['lastColumnIndex']); + $worksheetInfo[0]['totalColumns'] = $worksheetInfo[0]['lastColumnIndex'] + 1; + + // Close file + fclose($fileHandle); + + return $worksheetInfo; + } + + /** + * Loads PHPExcel from file + * + * @param string $pFilename + * @return PHPExcel + * @throws PHPExcel_Reader_Exception + */ + public function load($pFilename) + { + // Create new PHPExcel + $objPHPExcel = new PHPExcel(); + + // Load into this instance + return $this->loadIntoExisting($pFilename, $objPHPExcel); + } + + /** + * Loads PHPExcel from file into PHPExcel instance + * + * @param string $pFilename + * @param PHPExcel $objPHPExcel + * @return PHPExcel + * @throws PHPExcel_Reader_Exception + */ + public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) + { + // Open file + $this->openFile($pFilename); + if (!$this->isValidFormat()) { + fclose($this->fileHandle); + throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file."); + } + $fileHandle = $this->fileHandle; + rewind($fileHandle); + + // Create new PHPExcel + while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) { + $objPHPExcel->createSheet(); + } + $objPHPExcel->setActiveSheetIndex($this->sheetIndex); + + $fromFormats = array('\-', '\ '); + $toFormats = array('-', ' '); + + // Loop through file + $rowData = array(); + $column = $row = ''; + + // loop through one row (line) at a time in the file + while (($rowData = fgets($fileHandle)) !== false) { + // convert SYLK encoded $rowData to UTF-8 + $rowData = PHPExcel_Shared_String::SYLKtoUTF8($rowData); + + // explode each row at semicolons while taking into account that literal semicolon (;) + // is escaped like this (;;) + $rowData = explode("\t", str_replace('¤', ';', str_replace(';', "\t", str_replace(';;', '¤', rtrim($rowData))))); + + $dataType = array_shift($rowData); + // Read shared styles + if ($dataType == 'P') { + $formatArray = array(); + foreach ($rowData as $rowDatum) { + switch ($rowDatum{0}) { + case 'P': + $formatArray['numberformat']['code'] = str_replace($fromFormats, $toFormats, substr($rowDatum, 1)); + break; + case 'E': + case 'F': + $formatArray['font']['name'] = substr($rowDatum, 1); + break; + case 'L': + $formatArray['font']['size'] = substr($rowDatum, 1); + break; + case 'S': + $styleSettings = substr($rowDatum, 1); + for ($i=0; $i<strlen($styleSettings); ++$i) { + switch ($styleSettings{$i}) { + case 'I': + $formatArray['font']['italic'] = true; + break; + case 'D': + $formatArray['font']['bold'] = true; + break; + case 'T': + $formatArray['borders']['top']['style'] = PHPExcel_Style_Border::BORDER_THIN; + break; + case 'B': + $formatArray['borders']['bottom']['style'] = PHPExcel_Style_Border::BORDER_THIN; + break; + case 'L': + $formatArray['borders']['left']['style'] = PHPExcel_Style_Border::BORDER_THIN; + break; + case 'R': + $formatArray['borders']['right']['style'] = PHPExcel_Style_Border::BORDER_THIN; + break; + } + } + break; + } + } + $this->formats['P'.$this->format++] = $formatArray; + // Read cell value data + } elseif ($dataType == 'C') { + $hasCalculatedValue = false; + $cellData = $cellDataFormula = ''; + foreach ($rowData as $rowDatum) { + switch ($rowDatum{0}) { + case 'C': + case 'X': + $column = substr($rowDatum, 1); + break; + case 'R': + case 'Y': + $row = substr($rowDatum, 1); + break; + case 'K': + $cellData = substr($rowDatum, 1); + break; + case 'E': + $cellDataFormula = '='.substr($rowDatum, 1); + // Convert R1C1 style references to A1 style references (but only when not quoted) + $temp = explode('"', $cellDataFormula); + $key = false; + foreach ($temp as &$value) { + // Only count/replace in alternate array entries + if ($key = !$key) { + preg_match_all('/(R(\[?-?\d*\]?))(C(\[?-?\d*\]?))/', $value, $cellReferences, PREG_SET_ORDER+PREG_OFFSET_CAPTURE); + // Reverse the matches array, otherwise all our offsets will become incorrect if we modify our way + // through the formula from left to right. Reversing means that we work right to left.through + // the formula + $cellReferences = array_reverse($cellReferences); + // Loop through each R1C1 style reference in turn, converting it to its A1 style equivalent, + // then modify the formula to use that new reference + foreach ($cellReferences as $cellReference) { + $rowReference = $cellReference[2][0]; + // Empty R reference is the current row + if ($rowReference == '') { + $rowReference = $row; + } + // Bracketed R references are relative to the current row + if ($rowReference{0} == '[') { + $rowReference = $row + trim($rowReference, '[]'); + } + $columnReference = $cellReference[4][0]; + // Empty C reference is the current column + if ($columnReference == '') { + $columnReference = $column; + } + // Bracketed C references are relative to the current column + if ($columnReference{0} == '[') { + $columnReference = $column + trim($columnReference, '[]'); + } + $A1CellReference = PHPExcel_Cell::stringFromColumnIndex($columnReference-1).$rowReference; + + $value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0])); + } + } + } + unset($value); + // Then rebuild the formula string + $cellDataFormula = implode('"', $temp); + $hasCalculatedValue = true; + break; + } + } + $columnLetter = PHPExcel_Cell::stringFromColumnIndex($column-1); + $cellData = PHPExcel_Calculation::unwrapResult($cellData); + + // Set cell value + $objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData); + if ($hasCalculatedValue) { + $cellData = PHPExcel_Calculation::unwrapResult($cellData); + $objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setCalculatedValue($cellData); + } + // Read cell formatting + } elseif ($dataType == 'F') { + $formatStyle = $columnWidth = $styleSettings = ''; + $styleData = array(); + foreach ($rowData as $rowDatum) { + switch ($rowDatum{0}) { + case 'C': + case 'X': + $column = substr($rowDatum, 1); + break; + case 'R': + case 'Y': + $row = substr($rowDatum, 1); + break; + case 'P': + $formatStyle = $rowDatum; + break; + case 'W': + list($startCol, $endCol, $columnWidth) = explode(' ', substr($rowDatum, 1)); + break; + case 'S': + $styleSettings = substr($rowDatum, 1); + for ($i=0; $i<strlen($styleSettings); ++$i) { + switch ($styleSettings{$i}) { + case 'I': + $styleData['font']['italic'] = true; + break; + case 'D': + $styleData['font']['bold'] = true; + break; + case 'T': + $styleData['borders']['top']['style'] = PHPExcel_Style_Border::BORDER_THIN; + break; + case 'B': + $styleData['borders']['bottom']['style'] = PHPExcel_Style_Border::BORDER_THIN; + break; + case 'L': + $styleData['borders']['left']['style'] = PHPExcel_Style_Border::BORDER_THIN; + break; + case 'R': + $styleData['borders']['right']['style'] = PHPExcel_Style_Border::BORDER_THIN; + break; + } + } + break; + } + } + if (($formatStyle > '') && ($column > '') && ($row > '')) { + $columnLetter = PHPExcel_Cell::stringFromColumnIndex($column-1); + if (isset($this->formats[$formatStyle])) { + $objPHPExcel->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($this->formats[$formatStyle]); + } + } + if ((!empty($styleData)) && ($column > '') && ($row > '')) { + $columnLetter = PHPExcel_Cell::stringFromColumnIndex($column-1); + $objPHPExcel->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($styleData); + } + if ($columnWidth > '') { + if ($startCol == $endCol) { + $startCol = PHPExcel_Cell::stringFromColumnIndex($startCol-1); + $objPHPExcel->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth); + } else { + $startCol = PHPExcel_Cell::stringFromColumnIndex($startCol-1); + $endCol = PHPExcel_Cell::stringFromColumnIndex($endCol-1); + $objPHPExcel->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth); + do { + $objPHPExcel->getActiveSheet()->getColumnDimension(++$startCol)->setWidth($columnWidth); + } while ($startCol != $endCol); + } + } + } else { + foreach ($rowData as $rowDatum) { + switch ($rowDatum{0}) { + case 'C': + case 'X': + $column = substr($rowDatum, 1); + break; + case 'R': + case 'Y': + $row = substr($rowDatum, 1); + break; + } + } + } + } + + // Close file + fclose($fileHandle); + + // Return + return $objPHPExcel; + } + + /** + * Get sheet index + * + * @return int + */ + public function getSheetIndex() + { + return $this->sheetIndex; + } + + /** + * Set sheet index + * + * @param int $pValue Sheet index + * @return PHPExcel_Reader_SYLK + */ + public function setSheetIndex($pValue = 0) + { + $this->sheetIndex = $pValue; + return $this; + } +} diff --git a/extend/PHPExcel/PHPExcel/ReferenceHelper.php b/extend/PHPExcel/PHPExcel/ReferenceHelper.php new file mode 100644 index 0000000..7d7de93 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/ReferenceHelper.php @@ -0,0 +1,913 @@ +<?php + +/** + * PHPExcel_ReferenceHelper (Singleton) + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_ReferenceHelper +{ + /** Constants */ + /** Regular Expressions */ + const REFHELPER_REGEXP_CELLREF = '((\w*|\'[^!]*\')!)?(?<![:a-z\$])(\$?[a-z]{1,3}\$?\d+)(?=[^:!\d\'])'; + const REFHELPER_REGEXP_CELLRANGE = '((\w*|\'[^!]*\')!)?(\$?[a-z]{1,3}\$?\d+):(\$?[a-z]{1,3}\$?\d+)'; + const REFHELPER_REGEXP_ROWRANGE = '((\w*|\'[^!]*\')!)?(\$?\d+):(\$?\d+)'; + const REFHELPER_REGEXP_COLRANGE = '((\w*|\'[^!]*\')!)?(\$?[a-z]{1,3}):(\$?[a-z]{1,3})'; + + /** + * Instance of this class + * + * @var PHPExcel_ReferenceHelper + */ + private static $instance; + + /** + * Get an instance of this class + * + * @return PHPExcel_ReferenceHelper + */ + public static function getInstance() + { + if (!isset(self::$instance) || (self::$instance === null)) { + self::$instance = new PHPExcel_ReferenceHelper(); + } + + return self::$instance; + } + + /** + * Create a new PHPExcel_ReferenceHelper + */ + protected function __construct() + { + } + + /** + * Compare two column addresses + * Intended for use as a Callback function for sorting column addresses by column + * + * @param string $a First column to test (e.g. 'AA') + * @param string $b Second column to test (e.g. 'Z') + * @return integer + */ + public static function columnSort($a, $b) + { + return strcasecmp(strlen($a) . $a, strlen($b) . $b); + } + + /** + * Compare two column addresses + * Intended for use as a Callback function for reverse sorting column addresses by column + * + * @param string $a First column to test (e.g. 'AA') + * @param string $b Second column to test (e.g. 'Z') + * @return integer + */ + public static function columnReverseSort($a, $b) + { + return 1 - strcasecmp(strlen($a) . $a, strlen($b) . $b); + } + + /** + * Compare two cell addresses + * Intended for use as a Callback function for sorting cell addresses by column and row + * + * @param string $a First cell to test (e.g. 'AA1') + * @param string $b Second cell to test (e.g. 'Z1') + * @return integer + */ + public static function cellSort($a, $b) + { + sscanf($a, '%[A-Z]%d', $ac, $ar); + sscanf($b, '%[A-Z]%d', $bc, $br); + + if ($ar == $br) { + return strcasecmp(strlen($ac) . $ac, strlen($bc) . $bc); + } + return ($ar < $br) ? -1 : 1; + } + + /** + * Compare two cell addresses + * Intended for use as a Callback function for sorting cell addresses by column and row + * + * @param string $a First cell to test (e.g. 'AA1') + * @param string $b Second cell to test (e.g. 'Z1') + * @return integer + */ + public static function cellReverseSort($a, $b) + { + sscanf($a, '%[A-Z]%d', $ac, $ar); + sscanf($b, '%[A-Z]%d', $bc, $br); + + if ($ar == $br) { + return 1 - strcasecmp(strlen($ac) . $ac, strlen($bc) . $bc); + } + return ($ar < $br) ? 1 : -1; + } + + /** + * Test whether a cell address falls within a defined range of cells + * + * @param string $cellAddress Address of the cell we're testing + * @param integer $beforeRow Number of the row we're inserting/deleting before + * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) + * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before + * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) + * @return boolean + */ + private static function cellAddressInDeleteRange($cellAddress, $beforeRow, $pNumRows, $beforeColumnIndex, $pNumCols) + { + list($cellColumn, $cellRow) = PHPExcel_Cell::coordinateFromString($cellAddress); + $cellColumnIndex = PHPExcel_Cell::columnIndexFromString($cellColumn); + // Is cell within the range of rows/columns if we're deleting + if ($pNumRows < 0 && + ($cellRow >= ($beforeRow + $pNumRows)) && + ($cellRow < $beforeRow)) { + return true; + } elseif ($pNumCols < 0 && + ($cellColumnIndex >= ($beforeColumnIndex + $pNumCols)) && + ($cellColumnIndex < $beforeColumnIndex)) { + return true; + } + return false; + } + + /** + * Update page breaks when inserting/deleting rows/columns + * + * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1') + * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before + * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) + * @param integer $beforeRow Number of the row we're inserting/deleting before + * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) + */ + protected function adjustPageBreaks(PHPExcel_Worksheet $pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows) + { + $aBreaks = $pSheet->getBreaks(); + ($pNumCols > 0 || $pNumRows > 0) ? + uksort($aBreaks, array('PHPExcel_ReferenceHelper','cellReverseSort')) : + uksort($aBreaks, array('PHPExcel_ReferenceHelper','cellSort')); + + foreach ($aBreaks as $key => $value) { + if (self::cellAddressInDeleteRange($key, $beforeRow, $pNumRows, $beforeColumnIndex, $pNumCols)) { + // If we're deleting, then clear any defined breaks that are within the range + // of rows/columns that we're deleting + $pSheet->setBreak($key, PHPExcel_Worksheet::BREAK_NONE); + } else { + // Otherwise update any affected breaks by inserting a new break at the appropriate point + // and removing the old affected break + $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); + if ($key != $newReference) { + $pSheet->setBreak($newReference, $value) + ->setBreak($key, PHPExcel_Worksheet::BREAK_NONE); + } + } + } + } + + /** + * Update cell comments when inserting/deleting rows/columns + * + * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1') + * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before + * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) + * @param integer $beforeRow Number of the row we're inserting/deleting before + * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) + */ + protected function adjustComments($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows) + { + $aComments = $pSheet->getComments(); + $aNewComments = array(); // the new array of all comments + + foreach ($aComments as $key => &$value) { + // Any comments inside a deleted range will be ignored + if (!self::cellAddressInDeleteRange($key, $beforeRow, $pNumRows, $beforeColumnIndex, $pNumCols)) { + // Otherwise build a new array of comments indexed by the adjusted cell reference + $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); + $aNewComments[$newReference] = $value; + } + } + // Replace the comments array with the new set of comments + $pSheet->setComments($aNewComments); + } + + /** + * Update hyperlinks when inserting/deleting rows/columns + * + * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1') + * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before + * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) + * @param integer $beforeRow Number of the row we're inserting/deleting before + * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) + */ + protected function adjustHyperlinks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows) + { + $aHyperlinkCollection = $pSheet->getHyperlinkCollection(); + ($pNumCols > 0 || $pNumRows > 0) ? uksort($aHyperlinkCollection, array('PHPExcel_ReferenceHelper','cellReverseSort')) : uksort($aHyperlinkCollection, array('PHPExcel_ReferenceHelper','cellSort')); + + foreach ($aHyperlinkCollection as $key => $value) { + $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); + if ($key != $newReference) { + $pSheet->setHyperlink($newReference, $value); + $pSheet->setHyperlink($key, null); + } + } + } + + /** + * Update data validations when inserting/deleting rows/columns + * + * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1') + * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before + * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) + * @param integer $beforeRow Number of the row we're inserting/deleting before + * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) + */ + protected function adjustDataValidations($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows) + { + $aDataValidationCollection = $pSheet->getDataValidationCollection(); + ($pNumCols > 0 || $pNumRows > 0) ? uksort($aDataValidationCollection, array('PHPExcel_ReferenceHelper','cellReverseSort')) : uksort($aDataValidationCollection, array('PHPExcel_ReferenceHelper','cellSort')); + + foreach ($aDataValidationCollection as $key => $value) { + $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); + if ($key != $newReference) { + $pSheet->setDataValidation($newReference, $value); + $pSheet->setDataValidation($key, null); + } + } + } + + /** + * Update merged cells when inserting/deleting rows/columns + * + * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1') + * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before + * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) + * @param integer $beforeRow Number of the row we're inserting/deleting before + * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) + */ + protected function adjustMergeCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows) + { + $aMergeCells = $pSheet->getMergeCells(); + $aNewMergeCells = array(); // the new array of all merge cells + foreach ($aMergeCells as $key => &$value) { + $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); + $aNewMergeCells[$newReference] = $newReference; + } + $pSheet->setMergeCells($aNewMergeCells); // replace the merge cells array + } + + /** + * Update protected cells when inserting/deleting rows/columns + * + * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1') + * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before + * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) + * @param integer $beforeRow Number of the row we're inserting/deleting before + * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) + */ + protected function adjustProtectedCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows) + { + $aProtectedCells = $pSheet->getProtectedCells(); + ($pNumCols > 0 || $pNumRows > 0) ? + uksort($aProtectedCells, array('PHPExcel_ReferenceHelper','cellReverseSort')) : + uksort($aProtectedCells, array('PHPExcel_ReferenceHelper','cellSort')); + foreach ($aProtectedCells as $key => $value) { + $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); + if ($key != $newReference) { + $pSheet->protectCells($newReference, $value, true); + $pSheet->unprotectCells($key); + } + } + } + + /** + * Update column dimensions when inserting/deleting rows/columns + * + * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1') + * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before + * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) + * @param integer $beforeRow Number of the row we're inserting/deleting before + * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) + */ + protected function adjustColumnDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows) + { + $aColumnDimensions = array_reverse($pSheet->getColumnDimensions(), true); + if (!empty($aColumnDimensions)) { + foreach ($aColumnDimensions as $objColumnDimension) { + $newReference = $this->updateCellReference($objColumnDimension->getColumnIndex() . '1', $pBefore, $pNumCols, $pNumRows); + list($newReference) = PHPExcel_Cell::coordinateFromString($newReference); + if ($objColumnDimension->getColumnIndex() != $newReference) { + $objColumnDimension->setColumnIndex($newReference); + } + } + $pSheet->refreshColumnDimensions(); + } + } + + /** + * Update row dimensions when inserting/deleting rows/columns + * + * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1') + * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before + * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) + * @param integer $beforeRow Number of the row we're inserting/deleting before + * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) + */ + protected function adjustRowDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows) + { + $aRowDimensions = array_reverse($pSheet->getRowDimensions(), true); + if (!empty($aRowDimensions)) { + foreach ($aRowDimensions as $objRowDimension) { + $newReference = $this->updateCellReference('A' . $objRowDimension->getRowIndex(), $pBefore, $pNumCols, $pNumRows); + list(, $newReference) = PHPExcel_Cell::coordinateFromString($newReference); + if ($objRowDimension->getRowIndex() != $newReference) { + $objRowDimension->setRowIndex($newReference); + } + } + $pSheet->refreshRowDimensions(); + + $copyDimension = $pSheet->getRowDimension($beforeRow - 1); + for ($i = $beforeRow; $i <= $beforeRow - 1 + $pNumRows; ++$i) { + $newDimension = $pSheet->getRowDimension($i); + $newDimension->setRowHeight($copyDimension->getRowHeight()); + $newDimension->setVisible($copyDimension->getVisible()); + $newDimension->setOutlineLevel($copyDimension->getOutlineLevel()); + $newDimension->setCollapsed($copyDimension->getCollapsed()); + } + } + } + + /** + * Insert a new column or row, updating all possible related data + * + * @param string $pBefore Insert before this cell address (e.g. 'A1') + * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) + * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) + * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @throws PHPExcel_Exception + */ + public function insertNewBefore($pBefore = 'A1', $pNumCols = 0, $pNumRows = 0, PHPExcel_Worksheet $pSheet = null) + { + $remove = ($pNumCols < 0 || $pNumRows < 0); + $aCellCollection = $pSheet->getCellCollection(); + + // Get coordinates of $pBefore + $beforeColumn = 'A'; + $beforeRow = 1; + list($beforeColumn, $beforeRow) = PHPExcel_Cell::coordinateFromString($pBefore); + $beforeColumnIndex = PHPExcel_Cell::columnIndexFromString($beforeColumn); + + // Clear cells if we are removing columns or rows + $highestColumn = $pSheet->getHighestColumn(); + $highestRow = $pSheet->getHighestRow(); + + // 1. Clear column strips if we are removing columns + if ($pNumCols < 0 && $beforeColumnIndex - 2 + $pNumCols > 0) { + for ($i = 1; $i <= $highestRow - 1; ++$i) { + for ($j = $beforeColumnIndex - 1 + $pNumCols; $j <= $beforeColumnIndex - 2; ++$j) { + $coordinate = PHPExcel_Cell::stringFromColumnIndex($j) . $i; + $pSheet->removeConditionalStyles($coordinate); + if ($pSheet->cellExists($coordinate)) { + $pSheet->getCell($coordinate)->setValueExplicit('', PHPExcel_Cell_DataType::TYPE_NULL); + $pSheet->getCell($coordinate)->setXfIndex(0); + } + } + } + } + + // 2. Clear row strips if we are removing rows + if ($pNumRows < 0 && $beforeRow - 1 + $pNumRows > 0) { + for ($i = $beforeColumnIndex - 1; $i <= PHPExcel_Cell::columnIndexFromString($highestColumn) - 1; ++$i) { + for ($j = $beforeRow + $pNumRows; $j <= $beforeRow - 1; ++$j) { + $coordinate = PHPExcel_Cell::stringFromColumnIndex($i) . $j; + $pSheet->removeConditionalStyles($coordinate); + if ($pSheet->cellExists($coordinate)) { + $pSheet->getCell($coordinate)->setValueExplicit('', PHPExcel_Cell_DataType::TYPE_NULL); + $pSheet->getCell($coordinate)->setXfIndex(0); + } + } + } + } + + // Loop through cells, bottom-up, and change cell coordinates + if ($remove) { + // It's faster to reverse and pop than to use unshift, especially with large cell collections + $aCellCollection = array_reverse($aCellCollection); + } + while ($cellID = array_pop($aCellCollection)) { + $cell = $pSheet->getCell($cellID); + $cellIndex = PHPExcel_Cell::columnIndexFromString($cell->getColumn()); + + if ($cellIndex-1 + $pNumCols < 0) { + continue; + } + + // New coordinates + $newCoordinates = PHPExcel_Cell::stringFromColumnIndex($cellIndex-1 + $pNumCols) . ($cell->getRow() + $pNumRows); + + // Should the cell be updated? Move value and cellXf index from one cell to another. + if (($cellIndex >= $beforeColumnIndex) && ($cell->getRow() >= $beforeRow)) { + // Update cell styles + $pSheet->getCell($newCoordinates)->setXfIndex($cell->getXfIndex()); + + // Insert this cell at its new location + if ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_FORMULA) { + // Formula should be adjusted + $pSheet->getCell($newCoordinates) + ->setValue($this->updateFormulaReferences($cell->getValue(), $pBefore, $pNumCols, $pNumRows, $pSheet->getTitle())); + } else { + // Formula should not be adjusted + $pSheet->getCell($newCoordinates)->setValue($cell->getValue()); + } + + // Clear the original cell + $pSheet->getCellCacheController()->deleteCacheData($cellID); + } else { + /* We don't need to update styles for rows/columns before our insertion position, + but we do still need to adjust any formulae in those cells */ + if ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_FORMULA) { + // Formula should be adjusted + $cell->setValue($this->updateFormulaReferences($cell->getValue(), $pBefore, $pNumCols, $pNumRows, $pSheet->getTitle())); + } + + } + } + + // Duplicate styles for the newly inserted cells + $highestColumn = $pSheet->getHighestColumn(); + $highestRow = $pSheet->getHighestRow(); + + if ($pNumCols > 0 && $beforeColumnIndex - 2 > 0) { + for ($i = $beforeRow; $i <= $highestRow - 1; ++$i) { + // Style + $coordinate = PHPExcel_Cell::stringFromColumnIndex($beforeColumnIndex - 2) . $i; + if ($pSheet->cellExists($coordinate)) { + $xfIndex = $pSheet->getCell($coordinate)->getXfIndex(); + $conditionalStyles = $pSheet->conditionalStylesExists($coordinate) ? + $pSheet->getConditionalStyles($coordinate) : false; + for ($j = $beforeColumnIndex - 1; $j <= $beforeColumnIndex - 2 + $pNumCols; ++$j) { + $pSheet->getCellByColumnAndRow($j, $i)->setXfIndex($xfIndex); + if ($conditionalStyles) { + $cloned = array(); + foreach ($conditionalStyles as $conditionalStyle) { + $cloned[] = clone $conditionalStyle; + } + $pSheet->setConditionalStyles(PHPExcel_Cell::stringFromColumnIndex($j) . $i, $cloned); + } + } + } + + } + } + + if ($pNumRows > 0 && $beforeRow - 1 > 0) { + for ($i = $beforeColumnIndex - 1; $i <= PHPExcel_Cell::columnIndexFromString($highestColumn) - 1; ++$i) { + // Style + $coordinate = PHPExcel_Cell::stringFromColumnIndex($i) . ($beforeRow - 1); + if ($pSheet->cellExists($coordinate)) { + $xfIndex = $pSheet->getCell($coordinate)->getXfIndex(); + $conditionalStyles = $pSheet->conditionalStylesExists($coordinate) ? + $pSheet->getConditionalStyles($coordinate) : false; + for ($j = $beforeRow; $j <= $beforeRow - 1 + $pNumRows; ++$j) { + $pSheet->getCell(PHPExcel_Cell::stringFromColumnIndex($i) . $j)->setXfIndex($xfIndex); + if ($conditionalStyles) { + $cloned = array(); + foreach ($conditionalStyles as $conditionalStyle) { + $cloned[] = clone $conditionalStyle; + } + $pSheet->setConditionalStyles(PHPExcel_Cell::stringFromColumnIndex($i) . $j, $cloned); + } + } + } + } + } + + // Update worksheet: column dimensions + $this->adjustColumnDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows); + + // Update worksheet: row dimensions + $this->adjustRowDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows); + + // Update worksheet: page breaks + $this->adjustPageBreaks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows); + + // Update worksheet: comments + $this->adjustComments($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows); + + // Update worksheet: hyperlinks + $this->adjustHyperlinks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows); + + // Update worksheet: data validations + $this->adjustDataValidations($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows); + + // Update worksheet: merge cells + $this->adjustMergeCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows); + + // Update worksheet: protected cells + $this->adjustProtectedCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows); + + // Update worksheet: autofilter + $autoFilter = $pSheet->getAutoFilter(); + $autoFilterRange = $autoFilter->getRange(); + if (!empty($autoFilterRange)) { + if ($pNumCols != 0) { + $autoFilterColumns = array_keys($autoFilter->getColumns()); + if (count($autoFilterColumns) > 0) { + sscanf($pBefore, '%[A-Z]%d', $column, $row); + $columnIndex = PHPExcel_Cell::columnIndexFromString($column); + list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($autoFilterRange); + if ($columnIndex <= $rangeEnd[0]) { + if ($pNumCols < 0) { + // If we're actually deleting any columns that fall within the autofilter range, + // then we delete any rules for those columns + $deleteColumn = $columnIndex + $pNumCols - 1; + $deleteCount = abs($pNumCols); + for ($i = 1; $i <= $deleteCount; ++$i) { + if (in_array(PHPExcel_Cell::stringFromColumnIndex($deleteColumn), $autoFilterColumns)) { + $autoFilter->clearColumn(PHPExcel_Cell::stringFromColumnIndex($deleteColumn)); + } + ++$deleteColumn; + } + } + $startCol = ($columnIndex > $rangeStart[0]) ? $columnIndex : $rangeStart[0]; + + // Shuffle columns in autofilter range + if ($pNumCols > 0) { + // For insert, we shuffle from end to beginning to avoid overwriting + $startColID = PHPExcel_Cell::stringFromColumnIndex($startCol-1); + $toColID = PHPExcel_Cell::stringFromColumnIndex($startCol+$pNumCols-1); + $endColID = PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0]); + + $startColRef = $startCol; + $endColRef = $rangeEnd[0]; + $toColRef = $rangeEnd[0]+$pNumCols; + + do { + $autoFilter->shiftColumn(PHPExcel_Cell::stringFromColumnIndex($endColRef-1), PHPExcel_Cell::stringFromColumnIndex($toColRef-1)); + --$endColRef; + --$toColRef; + } while ($startColRef <= $endColRef); + } else { + // For delete, we shuffle from beginning to end to avoid overwriting + $startColID = PHPExcel_Cell::stringFromColumnIndex($startCol-1); + $toColID = PHPExcel_Cell::stringFromColumnIndex($startCol+$pNumCols-1); + $endColID = PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0]); + do { + $autoFilter->shiftColumn($startColID, $toColID); + ++$startColID; + ++$toColID; + } while ($startColID != $endColID); + } + } + } + } + $pSheet->setAutoFilter($this->updateCellReference($autoFilterRange, $pBefore, $pNumCols, $pNumRows)); + } + + // Update worksheet: freeze pane + if ($pSheet->getFreezePane() != '') { + $pSheet->freezePane($this->updateCellReference($pSheet->getFreezePane(), $pBefore, $pNumCols, $pNumRows)); + } + + // Page setup + if ($pSheet->getPageSetup()->isPrintAreaSet()) { + $pSheet->getPageSetup()->setPrintArea($this->updateCellReference($pSheet->getPageSetup()->getPrintArea(), $pBefore, $pNumCols, $pNumRows)); + } + + // Update worksheet: drawings + $aDrawings = $pSheet->getDrawingCollection(); + foreach ($aDrawings as $objDrawing) { + $newReference = $this->updateCellReference($objDrawing->getCoordinates(), $pBefore, $pNumCols, $pNumRows); + if ($objDrawing->getCoordinates() != $newReference) { + $objDrawing->setCoordinates($newReference); + } + } + + // Update workbook: named ranges + if (count($pSheet->getParent()->getNamedRanges()) > 0) { + foreach ($pSheet->getParent()->getNamedRanges() as $namedRange) { + if ($namedRange->getWorksheet()->getHashCode() == $pSheet->getHashCode()) { + $namedRange->setRange($this->updateCellReference($namedRange->getRange(), $pBefore, $pNumCols, $pNumRows)); + } + } + } + + // Garbage collect + $pSheet->garbageCollect(); + } + + /** + * Update references within formulas + * + * @param string $pFormula Formula to update + * @param int $pBefore Insert before this one + * @param int $pNumCols Number of columns to insert + * @param int $pNumRows Number of rows to insert + * @param string $sheetName Worksheet name/title + * @return string Updated formula + * @throws PHPExcel_Exception + */ + public function updateFormulaReferences($pFormula = '', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0, $sheetName = '') + { + // Update cell references in the formula + $formulaBlocks = explode('"', $pFormula); + $i = false; + foreach ($formulaBlocks as &$formulaBlock) { + // Ignore blocks that were enclosed in quotes (alternating entries in the $formulaBlocks array after the explode) + if ($i = !$i) { + $adjustCount = 0; + $newCellTokens = $cellTokens = array(); + // Search for row ranges (e.g. 'Sheet1'!3:5 or 3:5) with or without $ absolutes (e.g. $3:5) + $matchCount = preg_match_all('/'.self::REFHELPER_REGEXP_ROWRANGE.'/i', ' '.$formulaBlock.' ', $matches, PREG_SET_ORDER); + if ($matchCount > 0) { + foreach ($matches as $match) { + $fromString = ($match[2] > '') ? $match[2].'!' : ''; + $fromString .= $match[3].':'.$match[4]; + $modified3 = substr($this->updateCellReference('$A'.$match[3], $pBefore, $pNumCols, $pNumRows), 2); + $modified4 = substr($this->updateCellReference('$A'.$match[4], $pBefore, $pNumCols, $pNumRows), 2); + + if ($match[3].':'.$match[4] !== $modified3.':'.$modified4) { + if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) { + $toString = ($match[2] > '') ? $match[2].'!' : ''; + $toString .= $modified3.':'.$modified4; + // Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more + $column = 100000; + $row = 10000000 + trim($match[3], '$'); + $cellIndex = $column.$row; + + $newCellTokens[$cellIndex] = preg_quote($toString); + $cellTokens[$cellIndex] = '/(?<!\d\$\!)'.preg_quote($fromString).'(?!\d)/i'; + ++$adjustCount; + } + } + } + } + // Search for column ranges (e.g. 'Sheet1'!C:E or C:E) with or without $ absolutes (e.g. $C:E) + $matchCount = preg_match_all('/'.self::REFHELPER_REGEXP_COLRANGE.'/i', ' '.$formulaBlock.' ', $matches, PREG_SET_ORDER); + if ($matchCount > 0) { + foreach ($matches as $match) { + $fromString = ($match[2] > '') ? $match[2].'!' : ''; + $fromString .= $match[3].':'.$match[4]; + $modified3 = substr($this->updateCellReference($match[3].'$1', $pBefore, $pNumCols, $pNumRows), 0, -2); + $modified4 = substr($this->updateCellReference($match[4].'$1', $pBefore, $pNumCols, $pNumRows), 0, -2); + + if ($match[3].':'.$match[4] !== $modified3.':'.$modified4) { + if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) { + $toString = ($match[2] > '') ? $match[2].'!' : ''; + $toString .= $modified3.':'.$modified4; + // Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more + $column = PHPExcel_Cell::columnIndexFromString(trim($match[3], '$')) + 100000; + $row = 10000000; + $cellIndex = $column.$row; + + $newCellTokens[$cellIndex] = preg_quote($toString); + $cellTokens[$cellIndex] = '/(?<![A-Z\$\!])'.preg_quote($fromString).'(?![A-Z])/i'; + ++$adjustCount; + } + } + } + } + // Search for cell ranges (e.g. 'Sheet1'!A3:C5 or A3:C5) with or without $ absolutes (e.g. $A1:C$5) + $matchCount = preg_match_all('/'.self::REFHELPER_REGEXP_CELLRANGE.'/i', ' '.$formulaBlock.' ', $matches, PREG_SET_ORDER); + if ($matchCount > 0) { + foreach ($matches as $match) { + $fromString = ($match[2] > '') ? $match[2].'!' : ''; + $fromString .= $match[3].':'.$match[4]; + $modified3 = $this->updateCellReference($match[3], $pBefore, $pNumCols, $pNumRows); + $modified4 = $this->updateCellReference($match[4], $pBefore, $pNumCols, $pNumRows); + + if ($match[3].$match[4] !== $modified3.$modified4) { + if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) { + $toString = ($match[2] > '') ? $match[2].'!' : ''; + $toString .= $modified3.':'.$modified4; + list($column, $row) = PHPExcel_Cell::coordinateFromString($match[3]); + // Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more + $column = PHPExcel_Cell::columnIndexFromString(trim($column, '$')) + 100000; + $row = trim($row, '$') + 10000000; + $cellIndex = $column.$row; + + $newCellTokens[$cellIndex] = preg_quote($toString); + $cellTokens[$cellIndex] = '/(?<![A-Z]\$\!)'.preg_quote($fromString).'(?!\d)/i'; + ++$adjustCount; + } + } + } + } + // Search for cell references (e.g. 'Sheet1'!A3 or C5) with or without $ absolutes (e.g. $A1 or C$5) + $matchCount = preg_match_all('/'.self::REFHELPER_REGEXP_CELLREF.'/i', ' '.$formulaBlock.' ', $matches, PREG_SET_ORDER); + + if ($matchCount > 0) { + foreach ($matches as $match) { + $fromString = ($match[2] > '') ? $match[2].'!' : ''; + $fromString .= $match[3]; + + $modified3 = $this->updateCellReference($match[3], $pBefore, $pNumCols, $pNumRows); + if ($match[3] !== $modified3) { + if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) { + $toString = ($match[2] > '') ? $match[2].'!' : ''; + $toString .= $modified3; + list($column, $row) = PHPExcel_Cell::coordinateFromString($match[3]); + // Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more + $column = PHPExcel_Cell::columnIndexFromString(trim($column, '$')) + 100000; + $row = trim($row, '$') + 10000000; + $cellIndex = $row . $column; + + $newCellTokens[$cellIndex] = preg_quote($toString); + $cellTokens[$cellIndex] = '/(?<![A-Z\$\!])'.preg_quote($fromString).'(?!\d)/i'; + ++$adjustCount; + } + } + } + } + if ($adjustCount > 0) { + if ($pNumCols > 0 || $pNumRows > 0) { + krsort($cellTokens); + krsort($newCellTokens); + } else { + ksort($cellTokens); + ksort($newCellTokens); + } // Update cell references in the formula + $formulaBlock = str_replace('\\', '', preg_replace($cellTokens, $newCellTokens, $formulaBlock)); + } + } + } + unset($formulaBlock); + + // Then rebuild the formula string + return implode('"', $formulaBlocks); + } + + /** + * Update cell reference + * + * @param string $pCellRange Cell range + * @param int $pBefore Insert before this one + * @param int $pNumCols Number of columns to increment + * @param int $pNumRows Number of rows to increment + * @return string Updated cell range + * @throws PHPExcel_Exception + */ + public function updateCellReference($pCellRange = 'A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0) + { + // Is it in another worksheet? Will not have to update anything. + if (strpos($pCellRange, "!") !== false) { + return $pCellRange; + // Is it a range or a single cell? + } elseif (strpos($pCellRange, ':') === false && strpos($pCellRange, ',') === false) { + // Single cell + return $this->updateSingleCellReference($pCellRange, $pBefore, $pNumCols, $pNumRows); + } elseif (strpos($pCellRange, ':') !== false || strpos($pCellRange, ',') !== false) { + // Range + return $this->updateCellRange($pCellRange, $pBefore, $pNumCols, $pNumRows); + } else { + // Return original + return $pCellRange; + } + } + + /** + * Update named formulas (i.e. containing worksheet references / named ranges) + * + * @param PHPExcel $pPhpExcel Object to update + * @param string $oldName Old name (name to replace) + * @param string $newName New name + */ + public function updateNamedFormulas(PHPExcel $pPhpExcel, $oldName = '', $newName = '') + { + if ($oldName == '') { + return; + } + + foreach ($pPhpExcel->getWorksheetIterator() as $sheet) { + foreach ($sheet->getCellCollection(false) as $cellID) { + $cell = $sheet->getCell($cellID); + if (($cell !== null) && ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_FORMULA)) { + $formula = $cell->getValue(); + if (strpos($formula, $oldName) !== false) { + $formula = str_replace("'" . $oldName . "'!", "'" . $newName . "'!", $formula); + $formula = str_replace($oldName . "!", $newName . "!", $formula); + $cell->setValueExplicit($formula, PHPExcel_Cell_DataType::TYPE_FORMULA); + } + } + } + } + } + + /** + * Update cell range + * + * @param string $pCellRange Cell range (e.g. 'B2:D4', 'B:C' or '2:3') + * @param int $pBefore Insert before this one + * @param int $pNumCols Number of columns to increment + * @param int $pNumRows Number of rows to increment + * @return string Updated cell range + * @throws PHPExcel_Exception + */ + private function updateCellRange($pCellRange = 'A1:A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0) + { + if (strpos($pCellRange, ':') !== false || strpos($pCellRange, ',') !== false) { + // Update range + $range = PHPExcel_Cell::splitRange($pCellRange); + $ic = count($range); + for ($i = 0; $i < $ic; ++$i) { + $jc = count($range[$i]); + for ($j = 0; $j < $jc; ++$j) { + if (ctype_alpha($range[$i][$j])) { + $r = PHPExcel_Cell::coordinateFromString($this->updateSingleCellReference($range[$i][$j].'1', $pBefore, $pNumCols, $pNumRows)); + $range[$i][$j] = $r[0]; + } elseif (ctype_digit($range[$i][$j])) { + $r = PHPExcel_Cell::coordinateFromString($this->updateSingleCellReference('A'.$range[$i][$j], $pBefore, $pNumCols, $pNumRows)); + $range[$i][$j] = $r[1]; + } else { + $range[$i][$j] = $this->updateSingleCellReference($range[$i][$j], $pBefore, $pNumCols, $pNumRows); + } + } + } + + // Recreate range string + return PHPExcel_Cell::buildRange($range); + } else { + throw new PHPExcel_Exception("Only cell ranges may be passed to this method."); + } + } + + /** + * Update single cell reference + * + * @param string $pCellReference Single cell reference + * @param int $pBefore Insert before this one + * @param int $pNumCols Number of columns to increment + * @param int $pNumRows Number of rows to increment + * @return string Updated cell reference + * @throws PHPExcel_Exception + */ + private function updateSingleCellReference($pCellReference = 'A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0) + { + if (strpos($pCellReference, ':') === false && strpos($pCellReference, ',') === false) { + // Get coordinates of $pBefore + list($beforeColumn, $beforeRow) = PHPExcel_Cell::coordinateFromString($pBefore); + + // Get coordinates of $pCellReference + list($newColumn, $newRow) = PHPExcel_Cell::coordinateFromString($pCellReference); + + // Verify which parts should be updated + $updateColumn = (($newColumn{0} != '$') && ($beforeColumn{0} != '$') && (PHPExcel_Cell::columnIndexFromString($newColumn) >= PHPExcel_Cell::columnIndexFromString($beforeColumn))); + $updateRow = (($newRow{0} != '$') && ($beforeRow{0} != '$') && $newRow >= $beforeRow); + + // Create new column reference + if ($updateColumn) { + $newColumn = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($newColumn) - 1 + $pNumCols); + } + + // Create new row reference + if ($updateRow) { + $newRow = $newRow + $pNumRows; + } + + // Return new reference + return $newColumn . $newRow; + } else { + throw new PHPExcel_Exception("Only single cell references may be passed to this method."); + } + } + + /** + * __clone implementation. Cloning should not be allowed in a Singleton! + * + * @throws PHPExcel_Exception + */ + final public function __clone() + { + throw new PHPExcel_Exception("Cloning a Singleton is not allowed!"); + } +} diff --git a/extend/PHPExcel/PHPExcel/RichText.php b/extend/PHPExcel/PHPExcel/RichText.php new file mode 100644 index 0000000..74a3534 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/RichText.php @@ -0,0 +1,191 @@ +<?php + +/** + * PHPExcel_RichText + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_RichText + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_RichText implements PHPExcel_IComparable +{ + /** + * Rich text elements + * + * @var PHPExcel_RichText_ITextElement[] + */ + private $richTextElements; + + /** + * Create a new PHPExcel_RichText instance + * + * @param PHPExcel_Cell $pCell + * @throws PHPExcel_Exception + */ + public function __construct(PHPExcel_Cell $pCell = null) + { + // Initialise variables + $this->richTextElements = array(); + + // Rich-Text string attached to cell? + if ($pCell !== null) { + // Add cell text and style + if ($pCell->getValue() != "") { + $objRun = new PHPExcel_RichText_Run($pCell->getValue()); + $objRun->setFont(clone $pCell->getParent()->getStyle($pCell->getCoordinate())->getFont()); + $this->addText($objRun); + } + + // Set parent value + $pCell->setValueExplicit($this, PHPExcel_Cell_DataType::TYPE_STRING); + } + } + + /** + * Add text + * + * @param PHPExcel_RichText_ITextElement $pText Rich text element + * @throws PHPExcel_Exception + * @return PHPExcel_RichText + */ + public function addText(PHPExcel_RichText_ITextElement $pText = null) + { + $this->richTextElements[] = $pText; + return $this; + } + + /** + * Create text + * + * @param string $pText Text + * @return PHPExcel_RichText_TextElement + * @throws PHPExcel_Exception + */ + public function createText($pText = '') + { + $objText = new PHPExcel_RichText_TextElement($pText); + $this->addText($objText); + return $objText; + } + + /** + * Create text run + * + * @param string $pText Text + * @return PHPExcel_RichText_Run + * @throws PHPExcel_Exception + */ + public function createTextRun($pText = '') + { + $objText = new PHPExcel_RichText_Run($pText); + $this->addText($objText); + return $objText; + } + + /** + * Get plain text + * + * @return string + */ + public function getPlainText() + { + // Return value + $returnValue = ''; + + // Loop through all PHPExcel_RichText_ITextElement + foreach ($this->richTextElements as $text) { + $returnValue .= $text->getText(); + } + + // Return + return $returnValue; + } + + /** + * Convert to string + * + * @return string + */ + public function __toString() + { + return $this->getPlainText(); + } + + /** + * Get Rich Text elements + * + * @return PHPExcel_RichText_ITextElement[] + */ + public function getRichTextElements() + { + return $this->richTextElements; + } + + /** + * Set Rich Text elements + * + * @param PHPExcel_RichText_ITextElement[] $pElements Array of elements + * @throws PHPExcel_Exception + * @return PHPExcel_RichText + */ + public function setRichTextElements($pElements = null) + { + if (is_array($pElements)) { + $this->richTextElements = $pElements; + } else { + throw new PHPExcel_Exception("Invalid PHPExcel_RichText_ITextElement[] array passed."); + } + return $this; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + $hashElements = ''; + foreach ($this->richTextElements as $element) { + $hashElements .= $element->getHashCode(); + } + + return md5( + $hashElements . + __CLASS__ + ); + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/RichText/ITextElement.php b/extend/PHPExcel/PHPExcel/RichText/ITextElement.php new file mode 100644 index 0000000..5db3432 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/RichText/ITextElement.php @@ -0,0 +1,56 @@ +<?php + +/** + * PHPExcel_RichText_ITextElement + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_RichText + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +interface PHPExcel_RichText_ITextElement +{ + /** + * Get text + * + * @return string Text + */ + public function getText(); + + /** + * Set text + * + * @param $pText string Text + * @return PHPExcel_RichText_ITextElement + */ + public function setText($pText = ''); + + /** + * Get font + * + * @return PHPExcel_Style_Font + */ + public function getFont(); + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode(); +} diff --git a/extend/PHPExcel/PHPExcel/RichText/Run.php b/extend/PHPExcel/PHPExcel/RichText/Run.php new file mode 100644 index 0000000..5737bb0 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/RichText/Run.php @@ -0,0 +1,98 @@ +<?php + +/** + * PHPExcel_RichText_Run + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_RichText + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_RichText_Run extends PHPExcel_RichText_TextElement implements PHPExcel_RichText_ITextElement +{ + /** + * Font + * + * @var PHPExcel_Style_Font + */ + private $font; + + /** + * Create a new PHPExcel_RichText_Run instance + * + * @param string $pText Text + */ + public function __construct($pText = '') + { + // Initialise variables + $this->setText($pText); + $this->font = new PHPExcel_Style_Font(); + } + + /** + * Get font + * + * @return PHPExcel_Style_Font + */ + public function getFont() + { + return $this->font; + } + + /** + * Set font + * + * @param PHPExcel_Style_Font $pFont Font + * @throws PHPExcel_Exception + * @return PHPExcel_RichText_ITextElement + */ + public function setFont(PHPExcel_Style_Font $pFont = null) + { + $this->font = $pFont; + return $this; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + return md5( + $this->getText() . + $this->font->getHashCode() . + __CLASS__ + ); + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/RichText/TextElement.php b/extend/PHPExcel/PHPExcel/RichText/TextElement.php new file mode 100644 index 0000000..f86e703 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/RichText/TextElement.php @@ -0,0 +1,105 @@ +<?php + +/** + * PHPExcel_RichText_TextElement + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_RichText + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_RichText_TextElement implements PHPExcel_RichText_ITextElement +{ + /** + * Text + * + * @var string + */ + private $text; + + /** + * Create a new PHPExcel_RichText_TextElement instance + * + * @param string $pText Text + */ + public function __construct($pText = '') + { + // Initialise variables + $this->text = $pText; + } + + /** + * Get text + * + * @return string Text + */ + public function getText() + { + return $this->text; + } + + /** + * Set text + * + * @param $pText string Text + * @return PHPExcel_RichText_ITextElement + */ + public function setText($pText = '') + { + $this->text = $pText; + return $this; + } + + /** + * Get font + * + * @return PHPExcel_Style_Font + */ + public function getFont() + { + return null; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + return md5( + $this->text . + __CLASS__ + ); + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Settings.php b/extend/PHPExcel/PHPExcel/Settings.php new file mode 100644 index 0000000..dcbc89f --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Settings.php @@ -0,0 +1,389 @@ +<?php + +/** PHPExcel root directory */ +if (!defined('PHPEXCEL_ROOT')) { + /** + * @ignore + */ + define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../'); + require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); +} + +/** + * PHPExcel_Settings + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Settings + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Settings +{ + /** constants */ + /** Available Zip library classes */ + const PCLZIP = 'PHPExcel_Shared_ZipArchive'; + const ZIPARCHIVE = 'ZipArchive'; + + /** Optional Chart Rendering libraries */ + const CHART_RENDERER_JPGRAPH = 'jpgraph'; + + /** Optional PDF Rendering libraries */ + const PDF_RENDERER_TCPDF = 'tcPDF'; + const PDF_RENDERER_DOMPDF = 'DomPDF'; + const PDF_RENDERER_MPDF = 'mPDF'; + + + private static $chartRenderers = array( + self::CHART_RENDERER_JPGRAPH, + ); + + private static $pdfRenderers = array( + self::PDF_RENDERER_TCPDF, + self::PDF_RENDERER_DOMPDF, + self::PDF_RENDERER_MPDF, + ); + + + /** + * Name of the class used for Zip file management + * e.g. + * ZipArchive + * + * @var string + */ + private static $zipClass = self::ZIPARCHIVE; + + + /** + * Name of the external Library used for rendering charts + * e.g. + * jpgraph + * + * @var string + */ + private static $chartRendererName; + + /** + * Directory Path to the external Library used for rendering charts + * + * @var string + */ + private static $chartRendererPath; + + + /** + * Name of the external Library used for rendering PDF files + * e.g. + * mPDF + * + * @var string + */ + private static $pdfRendererName; + + /** + * Directory Path to the external Library used for rendering PDF files + * + * @var string + */ + private static $pdfRendererPath; + + /** + * Default options for libxml loader + * + * @var int + */ + private static $libXmlLoaderOptions = null; + + /** + * Set the Zip handler Class that PHPExcel should use for Zip file management (PCLZip or ZipArchive) + * + * @param string $zipClass The Zip handler class that PHPExcel should use for Zip file management + * e.g. PHPExcel_Settings::PCLZip or PHPExcel_Settings::ZipArchive + * @return boolean Success or failure + */ + public static function setZipClass($zipClass) + { + if (($zipClass === self::PCLZIP) || + ($zipClass === self::ZIPARCHIVE)) { + self::$zipClass = $zipClass; + return true; + } + return false; + } + + + /** + * Return the name of the Zip handler Class that PHPExcel is configured to use (PCLZip or ZipArchive) + * or Zip file management + * + * @return string Name of the Zip handler Class that PHPExcel is configured to use + * for Zip file management + * e.g. PHPExcel_Settings::PCLZip or PHPExcel_Settings::ZipArchive + */ + public static function getZipClass() + { + return self::$zipClass; + } + + + /** + * Return the name of the method that is currently configured for cell cacheing + * + * @return string Name of the cacheing method + */ + public static function getCacheStorageMethod() + { + return PHPExcel_CachedObjectStorageFactory::getCacheStorageMethod(); + } + + + /** + * Return the name of the class that is currently being used for cell cacheing + * + * @return string Name of the class currently being used for cacheing + */ + public static function getCacheStorageClass() + { + return PHPExcel_CachedObjectStorageFactory::getCacheStorageClass(); + } + + + /** + * Set the method that should be used for cell cacheing + * + * @param string $method Name of the cacheing method + * @param array $arguments Optional configuration arguments for the cacheing method + * @return boolean Success or failure + */ + public static function setCacheStorageMethod($method = PHPExcel_CachedObjectStorageFactory::cache_in_memory, $arguments = array()) + { + return PHPExcel_CachedObjectStorageFactory::initialize($method, $arguments); + } + + + /** + * Set the locale code to use for formula translations and any special formatting + * + * @param string $locale The locale code to use (e.g. "fr" or "pt_br" or "en_uk") + * @return boolean Success or failure + */ + public static function setLocale($locale = 'en_us') + { + return PHPExcel_Calculation::getInstance()->setLocale($locale); + } + + + /** + * Set details of the external library that PHPExcel should use for rendering charts + * + * @param string $libraryName Internal reference name of the library + * e.g. PHPExcel_Settings::CHART_RENDERER_JPGRAPH + * @param string $libraryBaseDir Directory path to the library's base folder + * + * @return boolean Success or failure + */ + public static function setChartRenderer($libraryName, $libraryBaseDir) + { + if (!self::setChartRendererName($libraryName)) { + return false; + } + return self::setChartRendererPath($libraryBaseDir); + } + + + /** + * Identify to PHPExcel the external library to use for rendering charts + * + * @param string $libraryName Internal reference name of the library + * e.g. PHPExcel_Settings::CHART_RENDERER_JPGRAPH + * + * @return boolean Success or failure + */ + public static function setChartRendererName($libraryName) + { + if (!in_array($libraryName, self::$chartRenderers)) { + return false; + } + self::$chartRendererName = $libraryName; + + return true; + } + + + /** + * Tell PHPExcel where to find the external library to use for rendering charts + * + * @param string $libraryBaseDir Directory path to the library's base folder + * @return boolean Success or failure + */ + public static function setChartRendererPath($libraryBaseDir) + { + if ((file_exists($libraryBaseDir) === false) || (is_readable($libraryBaseDir) === false)) { + return false; + } + self::$chartRendererPath = $libraryBaseDir; + + return true; + } + + + /** + * Return the Chart Rendering Library that PHPExcel is currently configured to use (e.g. jpgraph) + * + * @return string|NULL Internal reference name of the Chart Rendering Library that PHPExcel is + * currently configured to use + * e.g. PHPExcel_Settings::CHART_RENDERER_JPGRAPH + */ + public static function getChartRendererName() + { + return self::$chartRendererName; + } + + + /** + * Return the directory path to the Chart Rendering Library that PHPExcel is currently configured to use + * + * @return string|NULL Directory Path to the Chart Rendering Library that PHPExcel is + * currently configured to use + */ + public static function getChartRendererPath() + { + return self::$chartRendererPath; + } + + + /** + * Set details of the external library that PHPExcel should use for rendering PDF files + * + * @param string $libraryName Internal reference name of the library + * e.g. PHPExcel_Settings::PDF_RENDERER_TCPDF, + * PHPExcel_Settings::PDF_RENDERER_DOMPDF + * or PHPExcel_Settings::PDF_RENDERER_MPDF + * @param string $libraryBaseDir Directory path to the library's base folder + * + * @return boolean Success or failure + */ + public static function setPdfRenderer($libraryName, $libraryBaseDir) + { + if (!self::setPdfRendererName($libraryName)) { + return false; + } + return self::setPdfRendererPath($libraryBaseDir); + } + + + /** + * Identify to PHPExcel the external library to use for rendering PDF files + * + * @param string $libraryName Internal reference name of the library + * e.g. PHPExcel_Settings::PDF_RENDERER_TCPDF, + * PHPExcel_Settings::PDF_RENDERER_DOMPDF + * or PHPExcel_Settings::PDF_RENDERER_MPDF + * + * @return boolean Success or failure + */ + public static function setPdfRendererName($libraryName) + { + if (!in_array($libraryName, self::$pdfRenderers)) { + return false; + } + self::$pdfRendererName = $libraryName; + + return true; + } + + + /** + * Tell PHPExcel where to find the external library to use for rendering PDF files + * + * @param string $libraryBaseDir Directory path to the library's base folder + * @return boolean Success or failure + */ + public static function setPdfRendererPath($libraryBaseDir) + { + if ((file_exists($libraryBaseDir) === false) || (is_readable($libraryBaseDir) === false)) { + return false; + } + self::$pdfRendererPath = $libraryBaseDir; + + return true; + } + + + /** + * Return the PDF Rendering Library that PHPExcel is currently configured to use (e.g. dompdf) + * + * @return string|NULL Internal reference name of the PDF Rendering Library that PHPExcel is + * currently configured to use + * e.g. PHPExcel_Settings::PDF_RENDERER_TCPDF, + * PHPExcel_Settings::PDF_RENDERER_DOMPDF + * or PHPExcel_Settings::PDF_RENDERER_MPDF + */ + public static function getPdfRendererName() + { + return self::$pdfRendererName; + } + + /** + * Return the directory path to the PDF Rendering Library that PHPExcel is currently configured to use + * + * @return string|NULL Directory Path to the PDF Rendering Library that PHPExcel is + * currently configured to use + */ + public static function getPdfRendererPath() + { + return self::$pdfRendererPath; + } + + /** + * Set options for libxml loader + * + * @param int $options Options for libxml loader + */ + public static function setLibXmlLoaderOptions($options = null) + { + if (is_null($options) && defined('LIBXML_DTDLOAD')) { + $options = LIBXML_DTDLOAD | LIBXML_DTDATTR; + } + if (version_compare(PHP_VERSION, '5.2.11') >= 0) { + @libxml_disable_entity_loader((bool) $options); + } + self::$libXmlLoaderOptions = $options; + } + + /** + * Get defined options for libxml loader. + * Defaults to LIBXML_DTDLOAD | LIBXML_DTDATTR when not set explicitly. + * + * @return int Default options for libxml loader + */ + public static function getLibXmlLoaderOptions() + { + if (is_null(self::$libXmlLoaderOptions) && defined('LIBXML_DTDLOAD')) { + self::setLibXmlLoaderOptions(LIBXML_DTDLOAD | LIBXML_DTDATTR); + } elseif (is_null(self::$libXmlLoaderOptions)) { + self::$libXmlLoaderOptions = true; + } + if (version_compare(PHP_VERSION, '5.2.11') >= 0) { + @libxml_disable_entity_loader((bool) self::$libXmlLoaderOptions); + } + return self::$libXmlLoaderOptions; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/CodePage.php b/extend/PHPExcel/PHPExcel/Shared/CodePage.php new file mode 100644 index 0000000..b3e440e --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/CodePage.php @@ -0,0 +1,156 @@ +<?php + +/** + * PHPExcel_Shared_CodePage + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_CodePage +{ + /** + * Convert Microsoft Code Page Identifier to Code Page Name which iconv + * and mbstring understands + * + * @param integer $codePage Microsoft Code Page Indentifier + * @return string Code Page Name + * @throws PHPExcel_Exception + */ + public static function NumberToName($codePage = 1252) + { + switch ($codePage) { + case 367: + return 'ASCII'; // ASCII + case 437: + return 'CP437'; // OEM US + case 720: + throw new PHPExcel_Exception('Code page 720 not supported.'); // OEM Arabic + case 737: + return 'CP737'; // OEM Greek + case 775: + return 'CP775'; // OEM Baltic + case 850: + return 'CP850'; // OEM Latin I + case 852: + return 'CP852'; // OEM Latin II (Central European) + case 855: + return 'CP855'; // OEM Cyrillic + case 857: + return 'CP857'; // OEM Turkish + case 858: + return 'CP858'; // OEM Multilingual Latin I with Euro + case 860: + return 'CP860'; // OEM Portugese + case 861: + return 'CP861'; // OEM Icelandic + case 862: + return 'CP862'; // OEM Hebrew + case 863: + return 'CP863'; // OEM Canadian (French) + case 864: + return 'CP864'; // OEM Arabic + case 865: + return 'CP865'; // OEM Nordic + case 866: + return 'CP866'; // OEM Cyrillic (Russian) + case 869: + return 'CP869'; // OEM Greek (Modern) + case 874: + return 'CP874'; // ANSI Thai + case 932: + return 'CP932'; // ANSI Japanese Shift-JIS + case 936: + return 'CP936'; // ANSI Chinese Simplified GBK + case 949: + return 'CP949'; // ANSI Korean (Wansung) + case 950: + return 'CP950'; // ANSI Chinese Traditional BIG5 + case 1200: + return 'UTF-16LE'; // UTF-16 (BIFF8) + case 1250: + return 'CP1250'; // ANSI Latin II (Central European) + case 1251: + return 'CP1251'; // ANSI Cyrillic + case 0: + // CodePage is not always correctly set when the xls file was saved by Apple's Numbers program + case 1252: + return 'CP1252'; // ANSI Latin I (BIFF4-BIFF7) + case 1253: + return 'CP1253'; // ANSI Greek + case 1254: + return 'CP1254'; // ANSI Turkish + case 1255: + return 'CP1255'; // ANSI Hebrew + case 1256: + return 'CP1256'; // ANSI Arabic + case 1257: + return 'CP1257'; // ANSI Baltic + case 1258: + return 'CP1258'; // ANSI Vietnamese + case 1361: + return 'CP1361'; // ANSI Korean (Johab) + case 10000: + return 'MAC'; // Apple Roman + case 10001: + return 'CP932'; // Macintosh Japanese + case 10002: + return 'CP950'; // Macintosh Chinese Traditional + case 10003: + return 'CP1361'; // Macintosh Korean + case 10004: + return 'MACARABIC'; // Apple Arabic + case 10005: + return 'MACHEBREW'; // Apple Hebrew + case 10006: + return 'MACGREEK'; // Macintosh Greek + case 10007: + return 'MACCYRILLIC'; // Macintosh Cyrillic + case 10008: + return 'CP936'; // Macintosh - Simplified Chinese (GB 2312) + case 10010: + return 'MACROMANIA'; // Macintosh Romania + case 10017: + return 'MACUKRAINE'; // Macintosh Ukraine + case 10021: + return 'MACTHAI'; // Macintosh Thai + case 10029: + return 'MACCENTRALEUROPE'; // Macintosh Central Europe + case 10079: + return 'MACICELAND'; // Macintosh Icelandic + case 10081: + return 'MACTURKISH'; // Macintosh Turkish + case 10082: + return 'MACCROATIAN'; // Macintosh Croatian + case 21010: + return 'UTF-16LE'; // UTF-16 (BIFF8) This isn't correct, but some Excel writer libraries erroneously use Codepage 21010 for UTF-16LE + case 32768: + return 'MAC'; // Apple Roman + case 32769: + throw new PHPExcel_Exception('Code page 32769 not supported.'); // ANSI Latin I (BIFF2-BIFF3) + case 65000: + return 'UTF-7'; // Unicode (UTF-7) + case 65001: + return 'UTF-8'; // Unicode (UTF-8) + } + throw new PHPExcel_Exception('Unknown codepage: ' . $codePage); + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/Date.php b/extend/PHPExcel/PHPExcel/Shared/Date.php new file mode 100644 index 0000000..b00a39a --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/Date.php @@ -0,0 +1,418 @@ +<?php + +/** + * PHPExcel_Shared_Date + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_Date +{ + /** constants */ + const CALENDAR_WINDOWS_1900 = 1900; // Base date of 1st Jan 1900 = 1.0 + const CALENDAR_MAC_1904 = 1904; // Base date of 2nd Jan 1904 = 1.0 + + /* + * Names of the months of the year, indexed by shortname + * Planned usage for locale settings + * + * @public + * @var string[] + */ + public static $monthNames = array( + 'Jan' => 'January', + 'Feb' => 'February', + 'Mar' => 'March', + 'Apr' => 'April', + 'May' => 'May', + 'Jun' => 'June', + 'Jul' => 'July', + 'Aug' => 'August', + 'Sep' => 'September', + 'Oct' => 'October', + 'Nov' => 'November', + 'Dec' => 'December', + ); + + /* + * Names of the months of the year, indexed by shortname + * Planned usage for locale settings + * + * @public + * @var string[] + */ + public static $numberSuffixes = array( + 'st', + 'nd', + 'rd', + 'th', + ); + + /* + * Base calendar year to use for calculations + * + * @private + * @var int + */ + protected static $excelBaseDate = self::CALENDAR_WINDOWS_1900; + + /** + * Set the Excel calendar (Windows 1900 or Mac 1904) + * + * @param integer $baseDate Excel base date (1900 or 1904) + * @return boolean Success or failure + */ + public static function setExcelCalendar($baseDate) + { + if (($baseDate == self::CALENDAR_WINDOWS_1900) || + ($baseDate == self::CALENDAR_MAC_1904)) { + self::$excelBaseDate = $baseDate; + return true; + } + return false; + } + + + /** + * Return the Excel calendar (Windows 1900 or Mac 1904) + * + * @return integer Excel base date (1900 or 1904) + */ + public static function getExcelCalendar() + { + return self::$excelBaseDate; + } + + + /** + * Convert a date from Excel to PHP + * + * @param integer $dateValue Excel date/time value + * @param boolean $adjustToTimezone Flag indicating whether $dateValue should be treated as + * a UST timestamp, or adjusted to UST + * @param string $timezone The timezone for finding the adjustment from UST + * @return integer PHP serialized date/time + */ + public static function ExcelToPHP($dateValue = 0, $adjustToTimezone = false, $timezone = null) + { + if (self::$excelBaseDate == self::CALENDAR_WINDOWS_1900) { + $myexcelBaseDate = 25569; + // Adjust for the spurious 29-Feb-1900 (Day 60) + if ($dateValue < 60) { + --$myexcelBaseDate; + } + } else { + $myexcelBaseDate = 24107; + } + + // Perform conversion + if ($dateValue >= 1) { + $utcDays = $dateValue - $myexcelBaseDate; + $returnValue = round($utcDays * 86400); + if (($returnValue <= PHP_INT_MAX) && ($returnValue >= -PHP_INT_MAX)) { + $returnValue = (integer) $returnValue; + } + } else { + $hours = round($dateValue * 24); + $mins = round($dateValue * 1440) - round($hours * 60); + $secs = round($dateValue * 86400) - round($hours * 3600) - round($mins * 60); + $returnValue = (integer) gmmktime($hours, $mins, $secs); + } + + $timezoneAdjustment = ($adjustToTimezone) ? + PHPExcel_Shared_TimeZone::getTimezoneAdjustment($timezone, $returnValue) : + 0; + + return $returnValue + $timezoneAdjustment; + } + + + /** + * Convert a date from Excel to a PHP Date/Time object + * + * @param integer $dateValue Excel date/time value + * @return DateTime PHP date/time object + */ + public static function ExcelToPHPObject($dateValue = 0) + { + $dateTime = self::ExcelToPHP($dateValue); + $days = floor($dateTime / 86400); + $time = round((($dateTime / 86400) - $days) * 86400); + $hours = round($time / 3600); + $minutes = round($time / 60) - ($hours * 60); + $seconds = round($time) - ($hours * 3600) - ($minutes * 60); + + $dateObj = date_create('1-Jan-1970+'.$days.' days'); + $dateObj->setTime($hours, $minutes, $seconds); + + return $dateObj; + } + + + /** + * Convert a date from PHP to Excel + * + * @param mixed $dateValue PHP serialized date/time or date object + * @param boolean $adjustToTimezone Flag indicating whether $dateValue should be treated as + * a UST timestamp, or adjusted to UST + * @param string $timezone The timezone for finding the adjustment from UST + * @return mixed Excel date/time value + * or boolean FALSE on failure + */ + public static function PHPToExcel($dateValue = 0, $adjustToTimezone = false, $timezone = null) + { + $saveTimeZone = date_default_timezone_get(); + date_default_timezone_set('UTC'); + + $timezoneAdjustment = ($adjustToTimezone) ? + PHPExcel_Shared_TimeZone::getTimezoneAdjustment($timezone ? $timezone : $saveTimeZone, $dateValue) : + 0; + + $retValue = false; + if ((is_object($dateValue)) && ($dateValue instanceof DateTime)) { + $dateValue->add(new DateInterval('PT' . $timezoneAdjustment . 'S')); + $retValue = self::FormattedPHPToExcel($dateValue->format('Y'), $dateValue->format('m'), $dateValue->format('d'), $dateValue->format('H'), $dateValue->format('i'), $dateValue->format('s')); + } elseif (is_numeric($dateValue)) { + $dateValue += $timezoneAdjustment; + $retValue = self::FormattedPHPToExcel(date('Y', $dateValue), date('m', $dateValue), date('d', $dateValue), date('H', $dateValue), date('i', $dateValue), date('s', $dateValue)); + } elseif (is_string($dateValue)) { + $retValue = self::stringToExcel($dateValue); + } + date_default_timezone_set($saveTimeZone); + + return $retValue; + } + + + /** + * FormattedPHPToExcel + * + * @param integer $year + * @param integer $month + * @param integer $day + * @param integer $hours + * @param integer $minutes + * @param integer $seconds + * @return integer Excel date/time value + */ + public static function FormattedPHPToExcel($year, $month, $day, $hours = 0, $minutes = 0, $seconds = 0) + { + if (self::$excelBaseDate == self::CALENDAR_WINDOWS_1900) { + // + // Fudge factor for the erroneous fact that the year 1900 is treated as a Leap Year in MS Excel + // This affects every date following 28th February 1900 + // + $excel1900isLeapYear = true; + if (($year == 1900) && ($month <= 2)) { + $excel1900isLeapYear = false; + } + $myexcelBaseDate = 2415020; + } else { + $myexcelBaseDate = 2416481; + $excel1900isLeapYear = false; + } + + // Julian base date Adjustment + if ($month > 2) { + $month -= 3; + } else { + $month += 9; + --$year; + } + + // Calculate the Julian Date, then subtract the Excel base date (JD 2415020 = 31-Dec-1899 Giving Excel Date of 0) + $century = substr($year, 0, 2); + $decade = substr($year, 2, 2); + $excelDate = floor((146097 * $century) / 4) + floor((1461 * $decade) / 4) + floor((153 * $month + 2) / 5) + $day + 1721119 - $myexcelBaseDate + $excel1900isLeapYear; + + $excelTime = (($hours * 3600) + ($minutes * 60) + $seconds) / 86400; + + return (float) $excelDate + $excelTime; + } + + + /** + * Is a given cell a date/time? + * + * @param PHPExcel_Cell $pCell + * @return boolean + */ + public static function isDateTime(PHPExcel_Cell $pCell) + { + return self::isDateTimeFormat( + $pCell->getWorksheet()->getStyle( + $pCell->getCoordinate() + )->getNumberFormat() + ); + } + + + /** + * Is a given number format a date/time? + * + * @param PHPExcel_Style_NumberFormat $pFormat + * @return boolean + */ + public static function isDateTimeFormat(PHPExcel_Style_NumberFormat $pFormat) + { + return self::isDateTimeFormatCode($pFormat->getFormatCode()); + } + + + private static $possibleDateFormatCharacters = 'eymdHs'; + + /** + * Is a given number format code a date/time? + * + * @param string $pFormatCode + * @return boolean + */ + public static function isDateTimeFormatCode($pFormatCode = '') + { + if (strtolower($pFormatCode) === strtolower(PHPExcel_Style_NumberFormat::FORMAT_GENERAL)) { + // "General" contains an epoch letter 'e', so we trap for it explicitly here (case-insensitive check) + return false; + } + if (preg_match('/[0#]E[+-]0/i', $pFormatCode)) { + // Scientific format + return false; + } + + // Switch on formatcode + switch ($pFormatCode) { + // Explicitly defined date formats + case PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDD: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDD2: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_DDMMYYYY: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_DMYSLASH: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_DMYMINUS: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_DMMINUS: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_MYMINUS: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_DATETIME: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME1: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME2: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME3: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME5: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME6: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME7: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME8: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDDSLASH: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX14: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX15: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX16: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX17: + case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX22: + return true; + } + + // Typically number, currency or accounting (or occasionally fraction) formats + if ((substr($pFormatCode, 0, 1) == '_') || (substr($pFormatCode, 0, 2) == '0 ')) { + return false; + } + // Try checking for any of the date formatting characters that don't appear within square braces + if (preg_match('/(^|\])[^\[]*['.self::$possibleDateFormatCharacters.']/i', $pFormatCode)) { + // We might also have a format mask containing quoted strings... + // we don't want to test for any of our characters within the quoted blocks + if (strpos($pFormatCode, '"') !== false) { + $segMatcher = false; + foreach (explode('"', $pFormatCode) as $subVal) { + // Only test in alternate array entries (the non-quoted blocks) + if (($segMatcher = !$segMatcher) && + (preg_match('/(^|\])[^\[]*['.self::$possibleDateFormatCharacters.']/i', $subVal))) { + return true; + } + } + return false; + } + return true; + } + + // No date... + return false; + } + + + /** + * Convert a date/time string to Excel time + * + * @param string $dateValue Examples: '2009-12-31', '2009-12-31 15:59', '2009-12-31 15:59:10' + * @return float|FALSE Excel date/time serial value + */ + public static function stringToExcel($dateValue = '') + { + if (strlen($dateValue) < 2) { + return false; + } + if (!preg_match('/^(\d{1,4}[ \.\/\-][A-Z]{3,9}([ \.\/\-]\d{1,4})?|[A-Z]{3,9}[ \.\/\-]\d{1,4}([ \.\/\-]\d{1,4})?|\d{1,4}[ \.\/\-]\d{1,4}([ \.\/\-]\d{1,4})?)( \d{1,2}:\d{1,2}(:\d{1,2})?)?$/iu', $dateValue)) { + return false; + } + + $dateValueNew = PHPExcel_Calculation_DateTime::DATEVALUE($dateValue); + + if ($dateValueNew === PHPExcel_Calculation_Functions::VALUE()) { + return false; + } + + if (strpos($dateValue, ':') !== false) { + $timeValue = PHPExcel_Calculation_DateTime::TIMEVALUE($dateValue); + if ($timeValue === PHPExcel_Calculation_Functions::VALUE()) { + return false; + } + $dateValueNew += $timeValue; + } + return $dateValueNew; + } + + /** + * Converts a month name (either a long or a short name) to a month number + * + * @param string $month Month name or abbreviation + * @return integer|string Month number (1 - 12), or the original string argument if it isn't a valid month name + */ + public static function monthStringToNumber($month) + { + $monthIndex = 1; + foreach (self::$monthNames as $shortMonthName => $longMonthName) { + if (($month === $longMonthName) || ($month === $shortMonthName)) { + return $monthIndex; + } + ++$monthIndex; + } + return $month; + } + + /** + * Strips an ordinal froma numeric value + * + * @param string $day Day number with an ordinal + * @return integer|string The integer value with any ordinal stripped, or the original string argument if it isn't a valid numeric + */ + public static function dayStringToNumber($day) + { + $strippedDayValue = (str_replace(self::$numberSuffixes, '', $day)); + if (is_numeric($strippedDayValue)) { + return (integer) $strippedDayValue; + } + return $day; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/Drawing.php b/extend/PHPExcel/PHPExcel/Shared/Drawing.php new file mode 100644 index 0000000..3e027b4 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/Drawing.php @@ -0,0 +1,270 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_Shared_Drawing + * + * @category PHPExcel + * @package PHPExcel_Shared + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +class PHPExcel_Shared_Drawing +{ + /** + * Convert pixels to EMU + * + * @param int $pValue Value in pixels + * @return int Value in EMU + */ + public static function pixelsToEMU($pValue = 0) + { + return round($pValue * 9525); + } + + /** + * Convert EMU to pixels + * + * @param int $pValue Value in EMU + * @return int Value in pixels + */ + public static function EMUToPixels($pValue = 0) + { + if ($pValue != 0) { + return round($pValue / 9525); + } else { + return 0; + } + } + + /** + * Convert pixels to column width. Exact algorithm not known. + * By inspection of a real Excel file using Calibri 11, one finds 1000px ~ 142.85546875 + * This gives a conversion factor of 7. Also, we assume that pixels and font size are proportional. + * + * @param int $pValue Value in pixels + * @param PHPExcel_Style_Font $pDefaultFont Default font of the workbook + * @return int Value in cell dimension + */ + public static function pixelsToCellDimension($pValue = 0, PHPExcel_Style_Font $pDefaultFont) + { + // Font name and size + $name = $pDefaultFont->getName(); + $size = $pDefaultFont->getSize(); + + if (isset(PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size])) { + // Exact width can be determined + $colWidth = $pValue * PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size]['width'] / PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size]['px']; + } else { + // We don't have data for this particular font and size, use approximation by + // extrapolating from Calibri 11 + $colWidth = $pValue * 11 * PHPExcel_Shared_Font::$defaultColumnWidths['Calibri'][11]['width'] / PHPExcel_Shared_Font::$defaultColumnWidths['Calibri'][11]['px'] / $size; + } + + return $colWidth; + } + + /** + * Convert column width from (intrinsic) Excel units to pixels + * + * @param float $pValue Value in cell dimension + * @param PHPExcel_Style_Font $pDefaultFont Default font of the workbook + * @return int Value in pixels + */ + public static function cellDimensionToPixels($pValue = 0, PHPExcel_Style_Font $pDefaultFont) + { + // Font name and size + $name = $pDefaultFont->getName(); + $size = $pDefaultFont->getSize(); + + if (isset(PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size])) { + // Exact width can be determined + $colWidth = $pValue * PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size]['px'] / PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size]['width']; + } else { + // We don't have data for this particular font and size, use approximation by + // extrapolating from Calibri 11 + $colWidth = $pValue * $size * PHPExcel_Shared_Font::$defaultColumnWidths['Calibri'][11]['px'] / PHPExcel_Shared_Font::$defaultColumnWidths['Calibri'][11]['width'] / 11; + } + + // Round pixels to closest integer + $colWidth = (int) round($colWidth); + + return $colWidth; + } + + /** + * Convert pixels to points + * + * @param int $pValue Value in pixels + * @return int Value in points + */ + public static function pixelsToPoints($pValue = 0) + { + return $pValue * 0.67777777; + } + + /** + * Convert points to pixels + * + * @param int $pValue Value in points + * @return int Value in pixels + */ + public static function pointsToPixels($pValue = 0) + { + if ($pValue != 0) { + return (int) ceil($pValue * 1.333333333); + } else { + return 0; + } + } + + /** + * Convert degrees to angle + * + * @param int $pValue Degrees + * @return int Angle + */ + public static function degreesToAngle($pValue = 0) + { + return (int)round($pValue * 60000); + } + + /** + * Convert angle to degrees + * + * @param int $pValue Angle + * @return int Degrees + */ + public static function angleToDegrees($pValue = 0) + { + if ($pValue != 0) { + return round($pValue / 60000); + } else { + return 0; + } + } + + /** + * Create a new image from file. By alexander at alexauto dot nl + * + * @link http://www.php.net/manual/en/function.imagecreatefromwbmp.php#86214 + * @param string $filename Path to Windows DIB (BMP) image + * @return resource + */ + public static function imagecreatefrombmp($p_sFile) + { + // Load the image into a string + $file = fopen($p_sFile, "rb"); + $read = fread($file, 10); + while (!feof($file) && ($read<>"")) { + $read .= fread($file, 1024); + } + + $temp = unpack("H*", $read); + $hex = $temp[1]; + $header = substr($hex, 0, 108); + + // Process the header + // Structure: http://www.fastgraph.com/help/bmp_header_format.html + if (substr($header, 0, 4)=="424d") { + // Cut it in parts of 2 bytes + $header_parts = str_split($header, 2); + + // Get the width 4 bytes + $width = hexdec($header_parts[19].$header_parts[18]); + + // Get the height 4 bytes + $height = hexdec($header_parts[23].$header_parts[22]); + + // Unset the header params + unset($header_parts); + } + + // Define starting X and Y + $x = 0; + $y = 1; + + // Create newimage + $image = imagecreatetruecolor($width, $height); + + // Grab the body from the image + $body = substr($hex, 108); + + // Calculate if padding at the end-line is needed + // Divided by two to keep overview. + // 1 byte = 2 HEX-chars + $body_size = (strlen($body)/2); + $header_size = ($width*$height); + + // Use end-line padding? Only when needed + $usePadding = ($body_size>($header_size*3)+4); + + // Using a for-loop with index-calculation instaid of str_split to avoid large memory consumption + // Calculate the next DWORD-position in the body + for ($i = 0; $i < $body_size; $i += 3) { + // Calculate line-ending and padding + if ($x >= $width) { + // If padding needed, ignore image-padding + // Shift i to the ending of the current 32-bit-block + if ($usePadding) { + $i += $width%4; + } + + // Reset horizontal position + $x = 0; + + // Raise the height-position (bottom-up) + $y++; + + // Reached the image-height? Break the for-loop + if ($y > $height) { + break; + } + } + + // Calculation of the RGB-pixel (defined as BGR in image-data) + // Define $i_pos as absolute position in the body + $i_pos = $i * 2; + $r = hexdec($body[$i_pos+4].$body[$i_pos+5]); + $g = hexdec($body[$i_pos+2].$body[$i_pos+3]); + $b = hexdec($body[$i_pos].$body[$i_pos+1]); + + // Calculate and draw the pixel + $color = imagecolorallocate($image, $r, $g, $b); + imagesetpixel($image, $x, $height-$y, $color); + + // Raise the horizontal position + $x++; + } + + // Unset the body / free the memory + unset($body); + + // Return image-object + return $image; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/Escher.php b/extend/PHPExcel/PHPExcel/Shared/Escher.php new file mode 100644 index 0000000..1aedb9d --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/Escher.php @@ -0,0 +1,83 @@ +<?php + +/** + * PHPExcel_Shared_Escher + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_Escher + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_Escher +{ + /** + * Drawing Group Container + * + * @var PHPExcel_Shared_Escher_DggContainer + */ + private $dggContainer; + + /** + * Drawing Container + * + * @var PHPExcel_Shared_Escher_DgContainer + */ + private $dgContainer; + + /** + * Get Drawing Group Container + * + * @return PHPExcel_Shared_Escher_DgContainer + */ + public function getDggContainer() + { + return $this->dggContainer; + } + + /** + * Set Drawing Group Container + * + * @param PHPExcel_Shared_Escher_DggContainer $dggContainer + */ + public function setDggContainer($dggContainer) + { + return $this->dggContainer = $dggContainer; + } + + /** + * Get Drawing Container + * + * @return PHPExcel_Shared_Escher_DgContainer + */ + public function getDgContainer() + { + return $this->dgContainer; + } + + /** + * Set Drawing Container + * + * @param PHPExcel_Shared_Escher_DgContainer $dgContainer + */ + public function setDgContainer($dgContainer) + { + return $this->dgContainer = $dgContainer; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/Escher/DgContainer.php b/extend/PHPExcel/PHPExcel/Shared/Escher/DgContainer.php new file mode 100644 index 0000000..739cd90 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/Escher/DgContainer.php @@ -0,0 +1,75 @@ +<?php + +/** + * PHPExcel_Shared_Escher_DgContainer + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_Escher + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_Escher_DgContainer +{ + /** + * Drawing index, 1-based. + * + * @var int + */ + private $dgId; + + /** + * Last shape index in this drawing + * + * @var int + */ + private $lastSpId; + + private $spgrContainer = null; + + public function getDgId() + { + return $this->dgId; + } + + public function setDgId($value) + { + $this->dgId = $value; + } + + public function getLastSpId() + { + return $this->lastSpId; + } + + public function setLastSpId($value) + { + $this->lastSpId = $value; + } + + public function getSpgrContainer() + { + return $this->spgrContainer; + } + + public function setSpgrContainer($spgrContainer) + { + return $this->spgrContainer = $spgrContainer; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer.php b/extend/PHPExcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer.php new file mode 100644 index 0000000..49e7d68 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer.php @@ -0,0 +1,102 @@ +<?php + +/** + * PHPExcel_Shared_Escher_DgContainer_SpgrContainer + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_Escher + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_Escher_DgContainer_SpgrContainer +{ + /** + * Parent Shape Group Container + * + * @var PHPExcel_Shared_Escher_DgContainer_SpgrContainer + */ + private $parent; + + /** + * Shape Container collection + * + * @var array + */ + private $children = array(); + + /** + * Set parent Shape Group Container + * + * @param PHPExcel_Shared_Escher_DgContainer_SpgrContainer $parent + */ + public function setParent($parent) + { + $this->parent = $parent; + } + + /** + * Get the parent Shape Group Container if any + * + * @return PHPExcel_Shared_Escher_DgContainer_SpgrContainer|null + */ + public function getParent() + { + return $this->parent; + } + + /** + * Add a child. This will be either spgrContainer or spContainer + * + * @param mixed $child + */ + public function addChild($child) + { + $this->children[] = $child; + $child->setParent($this); + } + + /** + * Get collection of Shape Containers + */ + public function getChildren() + { + return $this->children; + } + + /** + * Recursively get all spContainers within this spgrContainer + * + * @return PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer[] + */ + public function getAllSpContainers() + { + $allSpContainers = array(); + + foreach ($this->children as $child) { + if ($child instanceof PHPExcel_Shared_Escher_DgContainer_SpgrContainer) { + $allSpContainers = array_merge($allSpContainers, $child->getAllSpContainers()); + } else { + $allSpContainers[] = $child; + } + } + + return $allSpContainers; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php b/extend/PHPExcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php new file mode 100644 index 0000000..a1f1a46 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php @@ -0,0 +1,388 @@ +<?php + +/** + * PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_Escher + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer +{ + /** + * Parent Shape Group Container + * + * @var PHPExcel_Shared_Escher_DgContainer_SpgrContainer + */ + private $parent; + + /** + * Is this a group shape? + * + * @var boolean + */ + private $spgr = false; + + /** + * Shape type + * + * @var int + */ + private $spType; + + /** + * Shape flag + * + * @var int + */ + private $spFlag; + + /** + * Shape index (usually group shape has index 0, and the rest: 1,2,3...) + * + * @var boolean + */ + private $spId; + + /** + * Array of options + * + * @var array + */ + private $OPT; + + /** + * Cell coordinates of upper-left corner of shape, e.g. 'A1' + * + * @var string + */ + private $startCoordinates; + + /** + * Horizontal offset of upper-left corner of shape measured in 1/1024 of column width + * + * @var int + */ + private $startOffsetX; + + /** + * Vertical offset of upper-left corner of shape measured in 1/256 of row height + * + * @var int + */ + private $startOffsetY; + + /** + * Cell coordinates of bottom-right corner of shape, e.g. 'B2' + * + * @var string + */ + private $endCoordinates; + + /** + * Horizontal offset of bottom-right corner of shape measured in 1/1024 of column width + * + * @var int + */ + private $endOffsetX; + + /** + * Vertical offset of bottom-right corner of shape measured in 1/256 of row height + * + * @var int + */ + private $endOffsetY; + + /** + * Set parent Shape Group Container + * + * @param PHPExcel_Shared_Escher_DgContainer_SpgrContainer $parent + */ + public function setParent($parent) + { + $this->parent = $parent; + } + + /** + * Get the parent Shape Group Container + * + * @return PHPExcel_Shared_Escher_DgContainer_SpgrContainer + */ + public function getParent() + { + return $this->parent; + } + + /** + * Set whether this is a group shape + * + * @param boolean $value + */ + public function setSpgr($value = false) + { + $this->spgr = $value; + } + + /** + * Get whether this is a group shape + * + * @return boolean + */ + public function getSpgr() + { + return $this->spgr; + } + + /** + * Set the shape type + * + * @param int $value + */ + public function setSpType($value) + { + $this->spType = $value; + } + + /** + * Get the shape type + * + * @return int + */ + public function getSpType() + { + return $this->spType; + } + + /** + * Set the shape flag + * + * @param int $value + */ + public function setSpFlag($value) + { + $this->spFlag = $value; + } + + /** + * Get the shape flag + * + * @return int + */ + public function getSpFlag() + { + return $this->spFlag; + } + + /** + * Set the shape index + * + * @param int $value + */ + public function setSpId($value) + { + $this->spId = $value; + } + + /** + * Get the shape index + * + * @return int + */ + public function getSpId() + { + return $this->spId; + } + + /** + * Set an option for the Shape Group Container + * + * @param int $property The number specifies the option + * @param mixed $value + */ + public function setOPT($property, $value) + { + $this->OPT[$property] = $value; + } + + /** + * Get an option for the Shape Group Container + * + * @param int $property The number specifies the option + * @return mixed + */ + public function getOPT($property) + { + if (isset($this->OPT[$property])) { + return $this->OPT[$property]; + } + return null; + } + + /** + * Get the collection of options + * + * @return array + */ + public function getOPTCollection() + { + return $this->OPT; + } + + /** + * Set cell coordinates of upper-left corner of shape + * + * @param string $value + */ + public function setStartCoordinates($value = 'A1') + { + $this->startCoordinates = $value; + } + + /** + * Get cell coordinates of upper-left corner of shape + * + * @return string + */ + public function getStartCoordinates() + { + return $this->startCoordinates; + } + + /** + * Set offset in x-direction of upper-left corner of shape measured in 1/1024 of column width + * + * @param int $startOffsetX + */ + public function setStartOffsetX($startOffsetX = 0) + { + $this->startOffsetX = $startOffsetX; + } + + /** + * Get offset in x-direction of upper-left corner of shape measured in 1/1024 of column width + * + * @return int + */ + public function getStartOffsetX() + { + return $this->startOffsetX; + } + + /** + * Set offset in y-direction of upper-left corner of shape measured in 1/256 of row height + * + * @param int $startOffsetY + */ + public function setStartOffsetY($startOffsetY = 0) + { + $this->startOffsetY = $startOffsetY; + } + + /** + * Get offset in y-direction of upper-left corner of shape measured in 1/256 of row height + * + * @return int + */ + public function getStartOffsetY() + { + return $this->startOffsetY; + } + + /** + * Set cell coordinates of bottom-right corner of shape + * + * @param string $value + */ + public function setEndCoordinates($value = 'A1') + { + $this->endCoordinates = $value; + } + + /** + * Get cell coordinates of bottom-right corner of shape + * + * @return string + */ + public function getEndCoordinates() + { + return $this->endCoordinates; + } + + /** + * Set offset in x-direction of bottom-right corner of shape measured in 1/1024 of column width + * + * @param int $startOffsetX + */ + public function setEndOffsetX($endOffsetX = 0) + { + $this->endOffsetX = $endOffsetX; + } + + /** + * Get offset in x-direction of bottom-right corner of shape measured in 1/1024 of column width + * + * @return int + */ + public function getEndOffsetX() + { + return $this->endOffsetX; + } + + /** + * Set offset in y-direction of bottom-right corner of shape measured in 1/256 of row height + * + * @param int $endOffsetY + */ + public function setEndOffsetY($endOffsetY = 0) + { + $this->endOffsetY = $endOffsetY; + } + + /** + * Get offset in y-direction of bottom-right corner of shape measured in 1/256 of row height + * + * @return int + */ + public function getEndOffsetY() + { + return $this->endOffsetY; + } + + /** + * Get the nesting level of this spContainer. This is the number of spgrContainers between this spContainer and + * the dgContainer. A value of 1 = immediately within first spgrContainer + * Higher nesting level occurs if and only if spContainer is part of a shape group + * + * @return int Nesting level + */ + public function getNestingLevel() + { + $nestingLevel = 0; + + $parent = $this->getParent(); + while ($parent instanceof PHPExcel_Shared_Escher_DgContainer_SpgrContainer) { + ++$nestingLevel; + $parent = $parent->getParent(); + } + + return $nestingLevel; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/Escher/DggContainer.php b/extend/PHPExcel/PHPExcel/Shared/Escher/DggContainer.php new file mode 100644 index 0000000..b116b1b --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/Escher/DggContainer.php @@ -0,0 +1,196 @@ +<?php + +/** + * PHPExcel_Shared_Escher_DggContainer + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_Escher + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_Escher_DggContainer +{ + /** + * Maximum shape index of all shapes in all drawings increased by one + * + * @var int + */ + private $spIdMax; + + /** + * Total number of drawings saved + * + * @var int + */ + private $cDgSaved; + + /** + * Total number of shapes saved (including group shapes) + * + * @var int + */ + private $cSpSaved; + + /** + * BLIP Store Container + * + * @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer + */ + private $bstoreContainer; + + /** + * Array of options for the drawing group + * + * @var array + */ + private $OPT = array(); + + /** + * Array of identifier clusters containg information about the maximum shape identifiers + * + * @var array + */ + private $IDCLs = array(); + + /** + * Get maximum shape index of all shapes in all drawings (plus one) + * + * @return int + */ + public function getSpIdMax() + { + return $this->spIdMax; + } + + /** + * Set maximum shape index of all shapes in all drawings (plus one) + * + * @param int + */ + public function setSpIdMax($value) + { + $this->spIdMax = $value; + } + + /** + * Get total number of drawings saved + * + * @return int + */ + public function getCDgSaved() + { + return $this->cDgSaved; + } + + /** + * Set total number of drawings saved + * + * @param int + */ + public function setCDgSaved($value) + { + $this->cDgSaved = $value; + } + + /** + * Get total number of shapes saved (including group shapes) + * + * @return int + */ + public function getCSpSaved() + { + return $this->cSpSaved; + } + + /** + * Set total number of shapes saved (including group shapes) + * + * @param int + */ + public function setCSpSaved($value) + { + $this->cSpSaved = $value; + } + + /** + * Get BLIP Store Container + * + * @return PHPExcel_Shared_Escher_DggContainer_BstoreContainer + */ + public function getBstoreContainer() + { + return $this->bstoreContainer; + } + + /** + * Set BLIP Store Container + * + * @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer $bstoreContainer + */ + public function setBstoreContainer($bstoreContainer) + { + $this->bstoreContainer = $bstoreContainer; + } + + /** + * Set an option for the drawing group + * + * @param int $property The number specifies the option + * @param mixed $value + */ + public function setOPT($property, $value) + { + $this->OPT[$property] = $value; + } + + /** + * Get an option for the drawing group + * + * @param int $property The number specifies the option + * @return mixed + */ + public function getOPT($property) + { + if (isset($this->OPT[$property])) { + return $this->OPT[$property]; + } + return null; + } + + /** + * Get identifier clusters + * + * @return array + */ + public function getIDCLs() + { + return $this->IDCLs; + } + + /** + * Set identifier clusters. array(<drawingId> => <max shape id>, ...) + * + * @param array $pValue + */ + public function setIDCLs($pValue) + { + $this->IDCLs = $pValue; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer.php b/extend/PHPExcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer.php new file mode 100644 index 0000000..1af2432 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer.php @@ -0,0 +1,57 @@ +<?php + +/** + * PHPExcel_Shared_Escher_DggContainer_BstoreContainer + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_Escher + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_Escher_DggContainer_BstoreContainer +{ + /** + * BLIP Store Entries. Each of them holds one BLIP (Big Large Image or Picture) + * + * @var array + */ + private $BSECollection = array(); + + /** + * Add a BLIP Store Entry + * + * @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE $BSE + */ + public function addBSE($BSE) + { + $this->BSECollection[] = $BSE; + $BSE->setParent($this); + } + + /** + * Get the collection of BLIP Store Entries + * + * @return PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE[] + */ + public function getBSECollection() + { + return $this->BSECollection; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE.php b/extend/PHPExcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE.php new file mode 100644 index 0000000..d17e91e --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE.php @@ -0,0 +1,112 @@ +<?php + +/** + * PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_Escher + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE +{ + const BLIPTYPE_ERROR = 0x00; + const BLIPTYPE_UNKNOWN = 0x01; + const BLIPTYPE_EMF = 0x02; + const BLIPTYPE_WMF = 0x03; + const BLIPTYPE_PICT = 0x04; + const BLIPTYPE_JPEG = 0x05; + const BLIPTYPE_PNG = 0x06; + const BLIPTYPE_DIB = 0x07; + const BLIPTYPE_TIFF = 0x11; + const BLIPTYPE_CMYKJPEG = 0x12; + + /** + * The parent BLIP Store Entry Container + * + * @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer + */ + private $parent; + + /** + * The BLIP (Big Large Image or Picture) + * + * @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip + */ + private $blip; + + /** + * The BLIP type + * + * @var int + */ + private $blipType; + + /** + * Set parent BLIP Store Entry Container + * + * @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer $parent + */ + public function setParent($parent) + { + $this->parent = $parent; + } + + /** + * Get the BLIP + * + * @return PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip + */ + public function getBlip() + { + return $this->blip; + } + + /** + * Set the BLIP + * + * @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip $blip + */ + public function setBlip($blip) + { + $this->blip = $blip; + $blip->setParent($this); + } + + /** + * Get the BLIP type + * + * @return int + */ + public function getBlipType() + { + return $this->blipType; + } + + /** + * Set the BLIP type + * + * @param int + */ + public function setBlipType($blipType) + { + $this->blipType = $blipType; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php b/extend/PHPExcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php new file mode 100644 index 0000000..3bcbbbe --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php @@ -0,0 +1,83 @@ +<?php + +/** + * PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_Escher + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip +{ + /** + * The parent BSE + * + * @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE + */ + private $parent; + + /** + * Raw image data + * + * @var string + */ + private $data; + + /** + * Get the raw image data + * + * @return string + */ + public function getData() + { + return $this->data; + } + + /** + * Set the raw image data + * + * @param string + */ + public function setData($data) + { + $this->data = $data; + } + + /** + * Set parent BSE + * + * @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE $parent + */ + public function setParent($parent) + { + $this->parent = $parent; + } + + /** + * Get parent BSE + * + * @return PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE $parent + */ + public function getParent() + { + return $this->parent; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/Excel5.php b/extend/PHPExcel/PHPExcel/Shared/Excel5.php new file mode 100644 index 0000000..c3ff209 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/Excel5.php @@ -0,0 +1,298 @@ +<?php + +/** + * PHPExcel_Shared_Excel5 + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_Excel5 +{ + /** + * Get the width of a column in pixels. We use the relationship y = ceil(7x) where + * x is the width in intrinsic Excel units (measuring width in number of normal characters) + * This holds for Arial 10 + * + * @param PHPExcel_Worksheet $sheet The sheet + * @param string $col The column + * @return integer The width in pixels + */ + public static function sizeCol($sheet, $col = 'A') + { + // default font of the workbook + $font = $sheet->getParent()->getDefaultStyle()->getFont(); + + $columnDimensions = $sheet->getColumnDimensions(); + + // first find the true column width in pixels (uncollapsed and unhidden) + if (isset($columnDimensions[$col]) and $columnDimensions[$col]->getWidth() != -1) { + // then we have column dimension with explicit width + $columnDimension = $columnDimensions[$col]; + $width = $columnDimension->getWidth(); + $pixelWidth = PHPExcel_Shared_Drawing::cellDimensionToPixels($width, $font); + } elseif ($sheet->getDefaultColumnDimension()->getWidth() != -1) { + // then we have default column dimension with explicit width + $defaultColumnDimension = $sheet->getDefaultColumnDimension(); + $width = $defaultColumnDimension->getWidth(); + $pixelWidth = PHPExcel_Shared_Drawing::cellDimensionToPixels($width, $font); + } else { + // we don't even have any default column dimension. Width depends on default font + $pixelWidth = PHPExcel_Shared_Font::getDefaultColumnWidthByFont($font, true); + } + + // now find the effective column width in pixels + if (isset($columnDimensions[$col]) and !$columnDimensions[$col]->getVisible()) { + $effectivePixelWidth = 0; + } else { + $effectivePixelWidth = $pixelWidth; + } + + return $effectivePixelWidth; + } + + /** + * Convert the height of a cell from user's units to pixels. By interpolation + * the relationship is: y = 4/3x. If the height hasn't been set by the user we + * use the default value. If the row is hidden we use a value of zero. + * + * @param PHPExcel_Worksheet $sheet The sheet + * @param integer $row The row index (1-based) + * @return integer The width in pixels + */ + public static function sizeRow($sheet, $row = 1) + { + // default font of the workbook + $font = $sheet->getParent()->getDefaultStyle()->getFont(); + + $rowDimensions = $sheet->getRowDimensions(); + + // first find the true row height in pixels (uncollapsed and unhidden) + if (isset($rowDimensions[$row]) and $rowDimensions[$row]->getRowHeight() != -1) { + // then we have a row dimension + $rowDimension = $rowDimensions[$row]; + $rowHeight = $rowDimension->getRowHeight(); + $pixelRowHeight = (int) ceil(4 * $rowHeight / 3); // here we assume Arial 10 + } elseif ($sheet->getDefaultRowDimension()->getRowHeight() != -1) { + // then we have a default row dimension with explicit height + $defaultRowDimension = $sheet->getDefaultRowDimension(); + $rowHeight = $defaultRowDimension->getRowHeight(); + $pixelRowHeight = PHPExcel_Shared_Drawing::pointsToPixels($rowHeight); + } else { + // we don't even have any default row dimension. Height depends on default font + $pointRowHeight = PHPExcel_Shared_Font::getDefaultRowHeightByFont($font); + $pixelRowHeight = PHPExcel_Shared_Font::fontSizeToPixels($pointRowHeight); + } + + // now find the effective row height in pixels + if (isset($rowDimensions[$row]) and !$rowDimensions[$row]->getVisible()) { + $effectivePixelRowHeight = 0; + } else { + $effectivePixelRowHeight = $pixelRowHeight; + } + + return $effectivePixelRowHeight; + } + + /** + * Get the horizontal distance in pixels between two anchors + * The distanceX is found as sum of all the spanning columns widths minus correction for the two offsets + * + * @param PHPExcel_Worksheet $sheet + * @param string $startColumn + * @param integer $startOffsetX Offset within start cell measured in 1/1024 of the cell width + * @param string $endColumn + * @param integer $endOffsetX Offset within end cell measured in 1/1024 of the cell width + * @return integer Horizontal measured in pixels + */ + public static function getDistanceX(PHPExcel_Worksheet $sheet, $startColumn = 'A', $startOffsetX = 0, $endColumn = 'A', $endOffsetX = 0) + { + $distanceX = 0; + + // add the widths of the spanning columns + $startColumnIndex = PHPExcel_Cell::columnIndexFromString($startColumn) - 1; // 1-based + $endColumnIndex = PHPExcel_Cell::columnIndexFromString($endColumn) - 1; // 1-based + for ($i = $startColumnIndex; $i <= $endColumnIndex; ++$i) { + $distanceX += self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($i)); + } + + // correct for offsetX in startcell + $distanceX -= (int) floor(self::sizeCol($sheet, $startColumn) * $startOffsetX / 1024); + + // correct for offsetX in endcell + $distanceX -= (int) floor(self::sizeCol($sheet, $endColumn) * (1 - $endOffsetX / 1024)); + + return $distanceX; + } + + /** + * Get the vertical distance in pixels between two anchors + * The distanceY is found as sum of all the spanning rows minus two offsets + * + * @param PHPExcel_Worksheet $sheet + * @param integer $startRow (1-based) + * @param integer $startOffsetY Offset within start cell measured in 1/256 of the cell height + * @param integer $endRow (1-based) + * @param integer $endOffsetY Offset within end cell measured in 1/256 of the cell height + * @return integer Vertical distance measured in pixels + */ + public static function getDistanceY(PHPExcel_Worksheet $sheet, $startRow = 1, $startOffsetY = 0, $endRow = 1, $endOffsetY = 0) + { + $distanceY = 0; + + // add the widths of the spanning rows + for ($row = $startRow; $row <= $endRow; ++$row) { + $distanceY += self::sizeRow($sheet, $row); + } + + // correct for offsetX in startcell + $distanceY -= (int) floor(self::sizeRow($sheet, $startRow) * $startOffsetY / 256); + + // correct for offsetX in endcell + $distanceY -= (int) floor(self::sizeRow($sheet, $endRow) * (1 - $endOffsetY / 256)); + + return $distanceY; + } + + /** + * Convert 1-cell anchor coordinates to 2-cell anchor coordinates + * This function is ported from PEAR Spreadsheet_Writer_Excel with small modifications + * + * Calculate the vertices that define the position of the image as required by + * the OBJ record. + * + * +------------+------------+ + * | A | B | + * +-----+------------+------------+ + * | |(x1,y1) | | + * | 1 |(A1)._______|______ | + * | | | | | + * | | | | | + * +-----+----| BITMAP |-----+ + * | | | | | + * | 2 | |______________. | + * | | | (B2)| + * | | | (x2,y2)| + * +---- +------------+------------+ + * + * Example of a bitmap that covers some of the area from cell A1 to cell B2. + * + * Based on the width and height of the bitmap we need to calculate 8 vars: + * $col_start, $row_start, $col_end, $row_end, $x1, $y1, $x2, $y2. + * The width and height of the cells are also variable and have to be taken into + * account. + * The values of $col_start and $row_start are passed in from the calling + * function. The values of $col_end and $row_end are calculated by subtracting + * the width and height of the bitmap from the width and height of the + * underlying cells. + * The vertices are expressed as a percentage of the underlying cell width as + * follows (rhs values are in pixels): + * + * x1 = X / W *1024 + * y1 = Y / H *256 + * x2 = (X-1) / W *1024 + * y2 = (Y-1) / H *256 + * + * Where: X is distance from the left side of the underlying cell + * Y is distance from the top of the underlying cell + * W is the width of the cell + * H is the height of the cell + * + * @param PHPExcel_Worksheet $sheet + * @param string $coordinates E.g. 'A1' + * @param integer $offsetX Horizontal offset in pixels + * @param integer $offsetY Vertical offset in pixels + * @param integer $width Width in pixels + * @param integer $height Height in pixels + * @return array + */ + public static function oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height) + { + list($column, $row) = PHPExcel_Cell::coordinateFromString($coordinates); + $col_start = PHPExcel_Cell::columnIndexFromString($column) - 1; + $row_start = $row - 1; + + $x1 = $offsetX; + $y1 = $offsetY; + + // Initialise end cell to the same as the start cell + $col_end = $col_start; // Col containing lower right corner of object + $row_end = $row_start; // Row containing bottom right corner of object + + // Zero the specified offset if greater than the cell dimensions + if ($x1 >= self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_start))) { + $x1 = 0; + } + if ($y1 >= self::sizeRow($sheet, $row_start + 1)) { + $y1 = 0; + } + + $width = $width + $x1 -1; + $height = $height + $y1 -1; + + // Subtract the underlying cell widths to find the end cell of the image + while ($width >= self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_end))) { + $width -= self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_end)); + ++$col_end; + } + + // Subtract the underlying cell heights to find the end cell of the image + while ($height >= self::sizeRow($sheet, $row_end + 1)) { + $height -= self::sizeRow($sheet, $row_end + 1); + ++$row_end; + } + + // Bitmap isn't allowed to start or finish in a hidden cell, i.e. a cell + // with zero height or width. + if (self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_start)) == 0) { + return; + } + if (self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_end)) == 0) { + return; + } + if (self::sizeRow($sheet, $row_start + 1) == 0) { + return; + } + if (self::sizeRow($sheet, $row_end + 1) == 0) { + return; + } + + // Convert the pixel values to the percentage value expected by Excel + $x1 = $x1 / self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_start)) * 1024; + $y1 = $y1 / self::sizeRow($sheet, $row_start + 1) * 256; + $x2 = ($width + 1) / self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object + $y2 = ($height + 1) / self::sizeRow($sheet, $row_end + 1) * 256; // Distance to bottom of object + + $startCoordinates = PHPExcel_Cell::stringFromColumnIndex($col_start) . ($row_start + 1); + $endCoordinates = PHPExcel_Cell::stringFromColumnIndex($col_end) . ($row_end + 1); + + $twoAnchor = array( + 'startCoordinates' => $startCoordinates, + 'startOffsetX' => $x1, + 'startOffsetY' => $y1, + 'endCoordinates' => $endCoordinates, + 'endOffsetX' => $x2, + 'endOffsetY' => $y2, + ); + + return $twoAnchor; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/File.php b/extend/PHPExcel/PHPExcel/Shared/File.php new file mode 100644 index 0000000..a62df75 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/File.php @@ -0,0 +1,180 @@ +<?php + +/** + * PHPExcel_Shared_File + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_File +{ + /* + * Use Temp or File Upload Temp for temporary files + * + * @protected + * @var boolean + */ + protected static $useUploadTempDirectory = false; + + + /** + * Set the flag indicating whether the File Upload Temp directory should be used for temporary files + * + * @param boolean $useUploadTempDir Use File Upload Temporary directory (true or false) + */ + public static function setUseUploadTempDirectory($useUploadTempDir = false) + { + self::$useUploadTempDirectory = (boolean) $useUploadTempDir; + } + + + /** + * Get the flag indicating whether the File Upload Temp directory should be used for temporary files + * + * @return boolean Use File Upload Temporary directory (true or false) + */ + public static function getUseUploadTempDirectory() + { + return self::$useUploadTempDirectory; + } + + + /** + * Verify if a file exists + * + * @param string $pFilename Filename + * @return bool + */ + public static function file_exists($pFilename) + { + // Sick construction, but it seems that + // file_exists returns strange values when + // doing the original file_exists on ZIP archives... + if (strtolower(substr($pFilename, 0, 3)) == 'zip') { + // Open ZIP file and verify if the file exists + $zipFile = substr($pFilename, 6, strpos($pFilename, '#') - 6); + $archiveFile = substr($pFilename, strpos($pFilename, '#') + 1); + + $zip = new ZipArchive(); + if ($zip->open($zipFile) === true) { + $returnValue = ($zip->getFromName($archiveFile) !== false); + $zip->close(); + return $returnValue; + } else { + return false; + } + } else { + // Regular file_exists + return file_exists($pFilename); + } + } + + /** + * Returns canonicalized absolute pathname, also for ZIP archives + * + * @param string $pFilename + * @return string + */ + public static function realpath($pFilename) + { + // Returnvalue + $returnValue = ''; + + // Try using realpath() + if (file_exists($pFilename)) { + $returnValue = realpath($pFilename); + } + + // Found something? + if ($returnValue == '' || ($returnValue === null)) { + $pathArray = explode('/', $pFilename); + while (in_array('..', $pathArray) && $pathArray[0] != '..') { + for ($i = 0; $i < count($pathArray); ++$i) { + if ($pathArray[$i] == '..' && $i > 0) { + unset($pathArray[$i]); + unset($pathArray[$i - 1]); + break; + } + } + } + $returnValue = implode('/', $pathArray); + } + + // Return + return $returnValue; + } + + /** + * Get the systems temporary directory. + * + * @return string + */ + public static function sys_get_temp_dir() + { + if (self::$useUploadTempDirectory) { + // use upload-directory when defined to allow running on environments having very restricted + // open_basedir configs + if (ini_get('upload_tmp_dir') !== false) { + if ($temp = ini_get('upload_tmp_dir')) { + if (file_exists($temp)) { + return realpath($temp); + } + } + } + } + + // sys_get_temp_dir is only available since PHP 5.2.1 + // http://php.net/manual/en/function.sys-get-temp-dir.php#94119 + if (!function_exists('sys_get_temp_dir')) { + if ($temp = getenv('TMP')) { + if ((!empty($temp)) && (file_exists($temp))) { + return realpath($temp); + } + } + if ($temp = getenv('TEMP')) { + if ((!empty($temp)) && (file_exists($temp))) { + return realpath($temp); + } + } + if ($temp = getenv('TMPDIR')) { + if ((!empty($temp)) && (file_exists($temp))) { + return realpath($temp); + } + } + + // trick for creating a file in system's temporary dir + // without knowing the path of the system's temporary dir + $temp = tempnam(__FILE__, ''); + if (file_exists($temp)) { + unlink($temp); + return realpath(dirname($temp)); + } + + return null; + } + + // use ordinary built-in PHP function + // There should be no problem with the 5.2.4 Suhosin realpath() bug, because this line should only + // be called if we're running 5.2.1 or earlier + return realpath(sys_get_temp_dir()); + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/Font.php b/extend/PHPExcel/PHPExcel/Shared/Font.php new file mode 100644 index 0000000..7efb3c9 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/Font.php @@ -0,0 +1,741 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_Shared_Font + * + * @category PHPExcel + * @package PHPExcel_Shared + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +class PHPExcel_Shared_Font +{ + /* Methods for resolving autosize value */ + const AUTOSIZE_METHOD_APPROX = 'approx'; + const AUTOSIZE_METHOD_EXACT = 'exact'; + + private static $autoSizeMethods = array( + self::AUTOSIZE_METHOD_APPROX, + self::AUTOSIZE_METHOD_EXACT, + ); + + /** Character set codes used by BIFF5-8 in Font records */ + const CHARSET_ANSI_LATIN = 0x00; + const CHARSET_SYSTEM_DEFAULT = 0x01; + const CHARSET_SYMBOL = 0x02; + const CHARSET_APPLE_ROMAN = 0x4D; + const CHARSET_ANSI_JAPANESE_SHIFTJIS = 0x80; + const CHARSET_ANSI_KOREAN_HANGUL = 0x81; + const CHARSET_ANSI_KOREAN_JOHAB = 0x82; + const CHARSET_ANSI_CHINESE_SIMIPLIFIED = 0x86; // gb2312 + const CHARSET_ANSI_CHINESE_TRADITIONAL = 0x88; // big5 + const CHARSET_ANSI_GREEK = 0xA1; + const CHARSET_ANSI_TURKISH = 0xA2; + const CHARSET_ANSI_VIETNAMESE = 0xA3; + const CHARSET_ANSI_HEBREW = 0xB1; + const CHARSET_ANSI_ARABIC = 0xB2; + const CHARSET_ANSI_BALTIC = 0xBA; + const CHARSET_ANSI_CYRILLIC = 0xCC; + const CHARSET_ANSI_THAI = 0xDD; + const CHARSET_ANSI_LATIN_II = 0xEE; + const CHARSET_OEM_LATIN_I = 0xFF; + + // XXX: Constants created! + /** Font filenames */ + const ARIAL = 'arial.ttf'; + const ARIAL_BOLD = 'arialbd.ttf'; + const ARIAL_ITALIC = 'ariali.ttf'; + const ARIAL_BOLD_ITALIC = 'arialbi.ttf'; + + const CALIBRI = 'CALIBRI.TTF'; + const CALIBRI_BOLD = 'CALIBRIB.TTF'; + const CALIBRI_ITALIC = 'CALIBRII.TTF'; + const CALIBRI_BOLD_ITALIC = 'CALIBRIZ.TTF'; + + const COMIC_SANS_MS = 'comic.ttf'; + const COMIC_SANS_MS_BOLD = 'comicbd.ttf'; + + const COURIER_NEW = 'cour.ttf'; + const COURIER_NEW_BOLD = 'courbd.ttf'; + const COURIER_NEW_ITALIC = 'couri.ttf'; + const COURIER_NEW_BOLD_ITALIC = 'courbi.ttf'; + + const GEORGIA = 'georgia.ttf'; + const GEORGIA_BOLD = 'georgiab.ttf'; + const GEORGIA_ITALIC = 'georgiai.ttf'; + const GEORGIA_BOLD_ITALIC = 'georgiaz.ttf'; + + const IMPACT = 'impact.ttf'; + + const LIBERATION_SANS = 'LiberationSans-Regular.ttf'; + const LIBERATION_SANS_BOLD = 'LiberationSans-Bold.ttf'; + const LIBERATION_SANS_ITALIC = 'LiberationSans-Italic.ttf'; + const LIBERATION_SANS_BOLD_ITALIC = 'LiberationSans-BoldItalic.ttf'; + + const LUCIDA_CONSOLE = 'lucon.ttf'; + const LUCIDA_SANS_UNICODE = 'l_10646.ttf'; + + const MICROSOFT_SANS_SERIF = 'micross.ttf'; + + const PALATINO_LINOTYPE = 'pala.ttf'; + const PALATINO_LINOTYPE_BOLD = 'palab.ttf'; + const PALATINO_LINOTYPE_ITALIC = 'palai.ttf'; + const PALATINO_LINOTYPE_BOLD_ITALIC = 'palabi.ttf'; + + const SYMBOL = 'symbol.ttf'; + + const TAHOMA = 'tahoma.ttf'; + const TAHOMA_BOLD = 'tahomabd.ttf'; + + const TIMES_NEW_ROMAN = 'times.ttf'; + const TIMES_NEW_ROMAN_BOLD = 'timesbd.ttf'; + const TIMES_NEW_ROMAN_ITALIC = 'timesi.ttf'; + const TIMES_NEW_ROMAN_BOLD_ITALIC = 'timesbi.ttf'; + + const TREBUCHET_MS = 'trebuc.ttf'; + const TREBUCHET_MS_BOLD = 'trebucbd.ttf'; + const TREBUCHET_MS_ITALIC = 'trebucit.ttf'; + const TREBUCHET_MS_BOLD_ITALIC = 'trebucbi.ttf'; + + const VERDANA = 'verdana.ttf'; + const VERDANA_BOLD = 'verdanab.ttf'; + const VERDANA_ITALIC = 'verdanai.ttf'; + const VERDANA_BOLD_ITALIC = 'verdanaz.ttf'; + + /** + * AutoSize method + * + * @var string + */ + private static $autoSizeMethod = self::AUTOSIZE_METHOD_APPROX; + + /** + * Path to folder containing TrueType font .ttf files + * + * @var string + */ + private static $trueTypeFontPath = null; + + /** + * How wide is a default column for a given default font and size? + * Empirical data found by inspecting real Excel files and reading off the pixel width + * in Microsoft Office Excel 2007. + * + * @var array + */ + public static $defaultColumnWidths = array( + 'Arial' => array( + 1 => array('px' => 24, 'width' => 12.00000000), + 2 => array('px' => 24, 'width' => 12.00000000), + 3 => array('px' => 32, 'width' => 10.66406250), + 4 => array('px' => 32, 'width' => 10.66406250), + 5 => array('px' => 40, 'width' => 10.00000000), + 6 => array('px' => 48, 'width' => 9.59765625), + 7 => array('px' => 48, 'width' => 9.59765625), + 8 => array('px' => 56, 'width' => 9.33203125), + 9 => array('px' => 64, 'width' => 9.14062500), + 10 => array('px' => 64, 'width' => 9.14062500), + ), + 'Calibri' => array( + 1 => array('px' => 24, 'width' => 12.00000000), + 2 => array('px' => 24, 'width' => 12.00000000), + 3 => array('px' => 32, 'width' => 10.66406250), + 4 => array('px' => 32, 'width' => 10.66406250), + 5 => array('px' => 40, 'width' => 10.00000000), + 6 => array('px' => 48, 'width' => 9.59765625), + 7 => array('px' => 48, 'width' => 9.59765625), + 8 => array('px' => 56, 'width' => 9.33203125), + 9 => array('px' => 56, 'width' => 9.33203125), + 10 => array('px' => 64, 'width' => 9.14062500), + 11 => array('px' => 64, 'width' => 9.14062500), + ), + 'Verdana' => array( + 1 => array('px' => 24, 'width' => 12.00000000), + 2 => array('px' => 24, 'width' => 12.00000000), + 3 => array('px' => 32, 'width' => 10.66406250), + 4 => array('px' => 32, 'width' => 10.66406250), + 5 => array('px' => 40, 'width' => 10.00000000), + 6 => array('px' => 48, 'width' => 9.59765625), + 7 => array('px' => 48, 'width' => 9.59765625), + 8 => array('px' => 64, 'width' => 9.14062500), + 9 => array('px' => 72, 'width' => 9.00000000), + 10 => array('px' => 72, 'width' => 9.00000000), + ), + ); + + /** + * Set autoSize method + * + * @param string $pValue + * @return boolean Success or failure + */ + public static function setAutoSizeMethod($pValue = self::AUTOSIZE_METHOD_APPROX) + { + if (!in_array($pValue, self::$autoSizeMethods)) { + return false; + } + self::$autoSizeMethod = $pValue; + + return true; + } + + /** + * Get autoSize method + * + * @return string + */ + public static function getAutoSizeMethod() + { + return self::$autoSizeMethod; + } + + /** + * Set the path to the folder containing .ttf files. There should be a trailing slash. + * Typical locations on variout some platforms: + * <ul> + * <li>C:/Windows/Fonts/</li> + * <li>/usr/share/fonts/truetype/</li> + * <li>~/.fonts/</li> + * </ul> + * + * @param string $pValue + */ + public static function setTrueTypeFontPath($pValue = '') + { + self::$trueTypeFontPath = $pValue; + } + + /** + * Get the path to the folder containing .ttf files. + * + * @return string + */ + public static function getTrueTypeFontPath() + { + return self::$trueTypeFontPath; + } + + /** + * Calculate an (approximate) OpenXML column width, based on font size and text contained + * + * @param PHPExcel_Style_Font $font Font object + * @param PHPExcel_RichText|string $cellText Text to calculate width + * @param integer $rotation Rotation angle + * @param PHPExcel_Style_Font|NULL $defaultFont Font object + * @return integer Column width + */ + public static function calculateColumnWidth(PHPExcel_Style_Font $font, $cellText = '', $rotation = 0, PHPExcel_Style_Font $defaultFont = null) + { + // If it is rich text, use plain text + if ($cellText instanceof PHPExcel_RichText) { + $cellText = $cellText->getPlainText(); + } + + // Special case if there are one or more newline characters ("\n") + if (strpos($cellText, "\n") !== false) { + $lineTexts = explode("\n", $cellText); + $lineWidths = array(); + foreach ($lineTexts as $lineText) { + $lineWidths[] = self::calculateColumnWidth($font, $lineText, $rotation = 0, $defaultFont); + } + return max($lineWidths); // width of longest line in cell + } + + // Try to get the exact text width in pixels + $approximate = self::$autoSizeMethod == self::AUTOSIZE_METHOD_APPROX; + if (!$approximate) { + $columnWidthAdjust = ceil(self::getTextWidthPixelsExact('n', $font, 0) * 1.07); + try { + // Width of text in pixels excl. padding + // and addition because Excel adds some padding, just use approx width of 'n' glyph + $columnWidth = self::getTextWidthPixelsExact($cellText, $font, $rotation) + $columnWidthAdjust; + } catch (PHPExcel_Exception $e) { + $approximate = true; + } + } + + if ($approximate) { + $columnWidthAdjust = self::getTextWidthPixelsApprox('n', $font, 0); + // Width of text in pixels excl. padding, approximation + // and addition because Excel adds some padding, just use approx width of 'n' glyph + $columnWidth = self::getTextWidthPixelsApprox($cellText, $font, $rotation) + $columnWidthAdjust; + } + + // Convert from pixel width to column width + $columnWidth = PHPExcel_Shared_Drawing::pixelsToCellDimension($columnWidth, $defaultFont); + + // Return + return round($columnWidth, 6); + } + + /** + * Get GD text width in pixels for a string of text in a certain font at a certain rotation angle + * + * @param string $text + * @param PHPExcel_Style_Font + * @param int $rotation + * @return int + * @throws PHPExcel_Exception + */ + public static function getTextWidthPixelsExact($text, PHPExcel_Style_Font $font, $rotation = 0) + { + if (!function_exists('imagettfbbox')) { + throw new PHPExcel_Exception('GD library needs to be enabled'); + } + + // font size should really be supplied in pixels in GD2, + // but since GD2 seems to assume 72dpi, pixels and points are the same + $fontFile = self::getTrueTypeFontFileFromFont($font); + $textBox = imagettfbbox($font->getSize(), $rotation, $fontFile, $text); + + // Get corners positions + $lowerLeftCornerX = $textBox[0]; +// $lowerLeftCornerY = $textBox[1]; + $lowerRightCornerX = $textBox[2]; +// $lowerRightCornerY = $textBox[3]; + $upperRightCornerX = $textBox[4]; +// $upperRightCornerY = $textBox[5]; + $upperLeftCornerX = $textBox[6]; +// $upperLeftCornerY = $textBox[7]; + + // Consider the rotation when calculating the width + $textWidth = max($lowerRightCornerX - $upperLeftCornerX, $upperRightCornerX - $lowerLeftCornerX); + + return $textWidth; + } + + /** + * Get approximate width in pixels for a string of text in a certain font at a certain rotation angle + * + * @param string $columnText + * @param PHPExcel_Style_Font $font + * @param int $rotation + * @return int Text width in pixels (no padding added) + */ + public static function getTextWidthPixelsApprox($columnText, PHPExcel_Style_Font $font = null, $rotation = 0) + { + $fontName = $font->getName(); + $fontSize = $font->getSize(); + + // Calculate column width in pixels. We assume fixed glyph width. Result varies with font name and size. + switch ($fontName) { + case 'Calibri': + // value 8.26 was found via interpolation by inspecting real Excel files with Calibri 11 font. + $columnWidth = (int) (8.26 * PHPExcel_Shared_String::CountCharacters($columnText)); + $columnWidth = $columnWidth * $fontSize / 11; // extrapolate from font size + break; + + case 'Arial': + // value 7 was found via interpolation by inspecting real Excel files with Arial 10 font. +// $columnWidth = (int) (7 * PHPExcel_Shared_String::CountCharacters($columnText)); + // value 8 was set because of experience in different exports at Arial 10 font. + $columnWidth = (int) (8 * PHPExcel_Shared_String::CountCharacters($columnText)); + $columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size + break; + + case 'Verdana': + // value 8 was found via interpolation by inspecting real Excel files with Verdana 10 font. + $columnWidth = (int) (8 * PHPExcel_Shared_String::CountCharacters($columnText)); + $columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size + break; + + default: + // just assume Calibri + $columnWidth = (int) (8.26 * PHPExcel_Shared_String::CountCharacters($columnText)); + $columnWidth = $columnWidth * $fontSize / 11; // extrapolate from font size + break; + } + + // Calculate approximate rotated column width + if ($rotation !== 0) { + if ($rotation == -165) { + // stacked text + $columnWidth = 4; // approximation + } else { + // rotated text + $columnWidth = $columnWidth * cos(deg2rad($rotation)) + + $fontSize * abs(sin(deg2rad($rotation))) / 5; // approximation + } + } + + // pixel width is an integer + return (int) $columnWidth; + } + + /** + * Calculate an (approximate) pixel size, based on a font points size + * + * @param int $fontSizeInPoints Font size (in points) + * @return int Font size (in pixels) + */ + public static function fontSizeToPixels($fontSizeInPoints = 11) + { + return (int) ((4 / 3) * $fontSizeInPoints); + } + + /** + * Calculate an (approximate) pixel size, based on inch size + * + * @param int $sizeInInch Font size (in inch) + * @return int Size (in pixels) + */ + public static function inchSizeToPixels($sizeInInch = 1) + { + return ($sizeInInch * 96); + } + + /** + * Calculate an (approximate) pixel size, based on centimeter size + * + * @param int $sizeInCm Font size (in centimeters) + * @return int Size (in pixels) + */ + public static function centimeterSizeToPixels($sizeInCm = 1) + { + return ($sizeInCm * 37.795275591); + } + + /** + * Returns the font path given the font + * + * @param PHPExcel_Style_Font + * @return string Path to TrueType font file + */ + public static function getTrueTypeFontFileFromFont($font) + { + if (!file_exists(self::$trueTypeFontPath) || !is_dir(self::$trueTypeFontPath)) { + throw new PHPExcel_Exception('Valid directory to TrueType Font files not specified'); + } + + $name = $font->getName(); + $bold = $font->getBold(); + $italic = $font->getItalic(); + + // Check if we can map font to true type font file + switch ($name) { + case 'Arial': + $fontFile = ( + $bold ? ($italic ? self::ARIAL_BOLD_ITALIC : self::ARIAL_BOLD) + : ($italic ? self::ARIAL_ITALIC : self::ARIAL) + ); + break; + case 'Calibri': + $fontFile = ( + $bold ? ($italic ? self::CALIBRI_BOLD_ITALIC : self::CALIBRI_BOLD) + : ($italic ? self::CALIBRI_ITALIC : self::CALIBRI) + ); + break; + case 'Courier New': + $fontFile = ( + $bold ? ($italic ? self::COURIER_NEW_BOLD_ITALIC : self::COURIER_NEW_BOLD) + : ($italic ? self::COURIER_NEW_ITALIC : self::COURIER_NEW) + ); + break; + case 'Comic Sans MS': + $fontFile = ( + $bold ? self::COMIC_SANS_MS_BOLD : self::COMIC_SANS_MS + ); + break; + case 'Georgia': + $fontFile = ( + $bold ? ($italic ? self::GEORGIA_BOLD_ITALIC : self::GEORGIA_BOLD) + : ($italic ? self::GEORGIA_ITALIC : self::GEORGIA) + ); + break; + case 'Impact': + $fontFile = self::IMPACT; + break; + case 'Liberation Sans': + $fontFile = ( + $bold ? ($italic ? self::LIBERATION_SANS_BOLD_ITALIC : self::LIBERATION_SANS_BOLD) + : ($italic ? self::LIBERATION_SANS_ITALIC : self::LIBERATION_SANS) + ); + break; + case 'Lucida Console': + $fontFile = self::LUCIDA_CONSOLE; + break; + case 'Lucida Sans Unicode': + $fontFile = self::LUCIDA_SANS_UNICODE; + break; + case 'Microsoft Sans Serif': + $fontFile = self::MICROSOFT_SANS_SERIF; + break; + case 'Palatino Linotype': + $fontFile = ( + $bold ? ($italic ? self::PALATINO_LINOTYPE_BOLD_ITALIC : self::PALATINO_LINOTYPE_BOLD) + : ($italic ? self::PALATINO_LINOTYPE_ITALIC : self::PALATINO_LINOTYPE) + ); + break; + case 'Symbol': + $fontFile = self::SYMBOL; + break; + case 'Tahoma': + $fontFile = ( + $bold ? self::TAHOMA_BOLD : self::TAHOMA + ); + break; + case 'Times New Roman': + $fontFile = ( + $bold ? ($italic ? self::TIMES_NEW_ROMAN_BOLD_ITALIC : self::TIMES_NEW_ROMAN_BOLD) + : ($italic ? self::TIMES_NEW_ROMAN_ITALIC : self::TIMES_NEW_ROMAN) + ); + break; + case 'Trebuchet MS': + $fontFile = ( + $bold ? ($italic ? self::TREBUCHET_MS_BOLD_ITALIC : self::TREBUCHET_MS_BOLD) + : ($italic ? self::TREBUCHET_MS_ITALIC : self::TREBUCHET_MS) + ); + break; + case 'Verdana': + $fontFile = ( + $bold ? ($italic ? self::VERDANA_BOLD_ITALIC : self::VERDANA_BOLD) + : ($italic ? self::VERDANA_ITALIC : self::VERDANA) + ); + break; + default: + throw new PHPExcel_Exception('Unknown font name "'. $name .'". Cannot map to TrueType font file'); + break; + } + + $fontFile = self::$trueTypeFontPath . $fontFile; + + // Check if file actually exists + if (!file_exists($fontFile)) { + throw new PHPExcel_Exception('TrueType Font file not found'); + } + + return $fontFile; + } + + /** + * Returns the associated charset for the font name. + * + * @param string $name Font name + * @return int Character set code + */ + public static function getCharsetFromFontName($name) + { + switch ($name) { + // Add more cases. Check FONT records in real Excel files. + case 'EucrosiaUPC': + return self::CHARSET_ANSI_THAI; + case 'Wingdings': + return self::CHARSET_SYMBOL; + case 'Wingdings 2': + return self::CHARSET_SYMBOL; + case 'Wingdings 3': + return self::CHARSET_SYMBOL; + default: + return self::CHARSET_ANSI_LATIN; + } + } + + /** + * Get the effective column width for columns without a column dimension or column with width -1 + * For example, for Calibri 11 this is 9.140625 (64 px) + * + * @param PHPExcel_Style_Font $font The workbooks default font + * @param boolean $pPixels true = return column width in pixels, false = return in OOXML units + * @return mixed Column width + */ + public static function getDefaultColumnWidthByFont(PHPExcel_Style_Font $font, $pPixels = false) + { + if (isset(self::$defaultColumnWidths[$font->getName()][$font->getSize()])) { + // Exact width can be determined + $columnWidth = $pPixels ? + self::$defaultColumnWidths[$font->getName()][$font->getSize()]['px'] + : self::$defaultColumnWidths[$font->getName()][$font->getSize()]['width']; + + } else { + // We don't have data for this particular font and size, use approximation by + // extrapolating from Calibri 11 + $columnWidth = $pPixels ? + self::$defaultColumnWidths['Calibri'][11]['px'] + : self::$defaultColumnWidths['Calibri'][11]['width']; + $columnWidth = $columnWidth * $font->getSize() / 11; + + // Round pixels to closest integer + if ($pPixels) { + $columnWidth = (int) round($columnWidth); + } + } + + return $columnWidth; + } + + /** + * Get the effective row height for rows without a row dimension or rows with height -1 + * For example, for Calibri 11 this is 15 points + * + * @param PHPExcel_Style_Font $font The workbooks default font + * @return float Row height in points + */ + public static function getDefaultRowHeightByFont(PHPExcel_Style_Font $font) + { + switch ($font->getName()) { + case 'Arial': + switch ($font->getSize()) { + case 10: + // inspection of Arial 10 workbook says 12.75pt ~17px + $rowHeight = 12.75; + break; + case 9: + // inspection of Arial 9 workbook says 12.00pt ~16px + $rowHeight = 12; + break; + case 8: + // inspection of Arial 8 workbook says 11.25pt ~15px + $rowHeight = 11.25; + break; + case 7: + // inspection of Arial 7 workbook says 9.00pt ~12px + $rowHeight = 9; + break; + case 6: + case 5: + // inspection of Arial 5,6 workbook says 8.25pt ~11px + $rowHeight = 8.25; + break; + case 4: + // inspection of Arial 4 workbook says 6.75pt ~9px + $rowHeight = 6.75; + break; + case 3: + // inspection of Arial 3 workbook says 6.00pt ~8px + $rowHeight = 6; + break; + case 2: + case 1: + // inspection of Arial 1,2 workbook says 5.25pt ~7px + $rowHeight = 5.25; + break; + default: + // use Arial 10 workbook as an approximation, extrapolation + $rowHeight = 12.75 * $font->getSize() / 10; + break; + } + break; + + case 'Calibri': + switch ($font->getSize()) { + case 11: + // inspection of Calibri 11 workbook says 15.00pt ~20px + $rowHeight = 15; + break; + case 10: + // inspection of Calibri 10 workbook says 12.75pt ~17px + $rowHeight = 12.75; + break; + case 9: + // inspection of Calibri 9 workbook says 12.00pt ~16px + $rowHeight = 12; + break; + case 8: + // inspection of Calibri 8 workbook says 11.25pt ~15px + $rowHeight = 11.25; + break; + case 7: + // inspection of Calibri 7 workbook says 9.00pt ~12px + $rowHeight = 9; + break; + case 6: + case 5: + // inspection of Calibri 5,6 workbook says 8.25pt ~11px + $rowHeight = 8.25; + break; + case 4: + // inspection of Calibri 4 workbook says 6.75pt ~9px + $rowHeight = 6.75; + break; + case 3: + // inspection of Calibri 3 workbook says 6.00pt ~8px + $rowHeight = 6.00; + break; + case 2: + case 1: + // inspection of Calibri 1,2 workbook says 5.25pt ~7px + $rowHeight = 5.25; + break; + default: + // use Calibri 11 workbook as an approximation, extrapolation + $rowHeight = 15 * $font->getSize() / 11; + break; + } + break; + + case 'Verdana': + switch ($font->getSize()) { + case 10: + // inspection of Verdana 10 workbook says 12.75pt ~17px + $rowHeight = 12.75; + break; + case 9: + // inspection of Verdana 9 workbook says 11.25pt ~15px + $rowHeight = 11.25; + break; + case 8: + // inspection of Verdana 8 workbook says 10.50pt ~14px + $rowHeight = 10.50; + break; + case 7: + // inspection of Verdana 7 workbook says 9.00pt ~12px + $rowHeight = 9.00; + break; + case 6: + case 5: + // inspection of Verdana 5,6 workbook says 8.25pt ~11px + $rowHeight = 8.25; + break; + case 4: + // inspection of Verdana 4 workbook says 6.75pt ~9px + $rowHeight = 6.75; + break; + case 3: + // inspection of Verdana 3 workbook says 6.00pt ~8px + $rowHeight = 6; + break; + case 2: + case 1: + // inspection of Verdana 1,2 workbook says 5.25pt ~7px + $rowHeight = 5.25; + break; + default: + // use Verdana 10 workbook as an approximation, extrapolation + $rowHeight = 12.75 * $font->getSize() / 10; + break; + } + break; + default: + // just use Calibri as an approximation + $rowHeight = 15 * $font->getSize() / 11; + break; + } + + return $rowHeight; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/JAMA/CHANGELOG.TXT b/extend/PHPExcel/PHPExcel/Shared/JAMA/CHANGELOG.TXT new file mode 100644 index 0000000..1c18a5d --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/JAMA/CHANGELOG.TXT @@ -0,0 +1,16 @@ +Mar 1, 2005 11:15 AST by PM + ++ For consistency, renamed Math.php to Maths.java, utils to util, + tests to test, docs to doc - + ++ Removed conditional logic from top of Matrix class. + ++ Switched to using hypo function in Maths.php for all php-hypot calls. + NOTE TO SELF: Need to make sure that all decompositions have been + switched over to using the bundled hypo. + +Feb 25, 2005 at 10:00 AST by PM + ++ Recommend using simpler Error.php instead of JAMA_Error.php but + can be persuaded otherwise. + diff --git a/extend/PHPExcel/PHPExcel/Shared/JAMA/CholeskyDecomposition.php b/extend/PHPExcel/PHPExcel/Shared/JAMA/CholeskyDecomposition.php new file mode 100644 index 0000000..d68109b --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/JAMA/CholeskyDecomposition.php @@ -0,0 +1,148 @@ +<?php +/** + * @package JAMA + * + * Cholesky decomposition class + * + * For a symmetric, positive definite matrix A, the Cholesky decomposition + * is an lower triangular matrix L so that A = L*L'. + * + * If the matrix is not symmetric or positive definite, the constructor + * returns a partial decomposition and sets an internal flag that may + * be queried by the isSPD() method. + * + * @author Paul Meagher + * @author Michael Bommarito + * @version 1.2 + */ +class CholeskyDecomposition +{ + /** + * Decomposition storage + * @var array + * @access private + */ + private $L = array(); + + /** + * Matrix row and column dimension + * @var int + * @access private + */ + private $m; + + /** + * Symmetric positive definite flag + * @var boolean + * @access private + */ + private $isspd = true; + + /** + * CholeskyDecomposition + * + * Class constructor - decomposes symmetric positive definite matrix + * @param mixed Matrix square symmetric positive definite matrix + */ + public function __construct($A = null) + { + if ($A instanceof Matrix) { + $this->L = $A->getArray(); + $this->m = $A->getRowDimension(); + + for ($i = 0; $i < $this->m; ++$i) { + for ($j = $i; $j < $this->m; ++$j) { + for ($sum = $this->L[$i][$j], $k = $i - 1; $k >= 0; --$k) { + $sum -= $this->L[$i][$k] * $this->L[$j][$k]; + } + if ($i == $j) { + if ($sum >= 0) { + $this->L[$i][$i] = sqrt($sum); + } else { + $this->isspd = false; + } + } else { + if ($this->L[$i][$i] != 0) { + $this->L[$j][$i] = $sum / $this->L[$i][$i]; + } + } + } + + for ($k = $i+1; $k < $this->m; ++$k) { + $this->L[$i][$k] = 0.0; + } + } + } else { + throw new PHPExcel_Calculation_Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION)); + } + } // function __construct() + + /** + * Is the matrix symmetric and positive definite? + * + * @return boolean + */ + public function isSPD() + { + return $this->isspd; + } // function isSPD() + + /** + * getL + * + * Return triangular factor. + * @return Matrix Lower triangular matrix + */ + public function getL() + { + return new Matrix($this->L); + } // function getL() + + /** + * Solve A*X = B + * + * @param $B Row-equal matrix + * @return Matrix L * L' * X = B + */ + public function solve($B = null) + { + if ($B instanceof Matrix) { + if ($B->getRowDimension() == $this->m) { + if ($this->isspd) { + $X = $B->getArrayCopy(); + $nx = $B->getColumnDimension(); + + for ($k = 0; $k < $this->m; ++$k) { + for ($i = $k + 1; $i < $this->m; ++$i) { + for ($j = 0; $j < $nx; ++$j) { + $X[$i][$j] -= $X[$k][$j] * $this->L[$i][$k]; + } + } + for ($j = 0; $j < $nx; ++$j) { + $X[$k][$j] /= $this->L[$k][$k]; + } + } + + for ($k = $this->m - 1; $k >= 0; --$k) { + for ($j = 0; $j < $nx; ++$j) { + $X[$k][$j] /= $this->L[$k][$k]; + } + for ($i = 0; $i < $k; ++$i) { + for ($j = 0; $j < $nx; ++$j) { + $X[$i][$j] -= $X[$k][$j] * $this->L[$k][$i]; + } + } + } + + return new Matrix($X, $this->m, $nx); + } else { + throw new PHPExcel_Calculation_Exception(JAMAError(MatrixSPDException)); + } + } else { + throw new PHPExcel_Calculation_Exception(JAMAError(MATRIX_DIMENSION_EXCEPTION)); + } + } else { + throw new PHPExcel_Calculation_Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION)); + } + } // function solve() +} diff --git a/extend/PHPExcel/PHPExcel/Shared/JAMA/EigenvalueDecomposition.php b/extend/PHPExcel/PHPExcel/Shared/JAMA/EigenvalueDecomposition.php new file mode 100644 index 0000000..d4ae397 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/JAMA/EigenvalueDecomposition.php @@ -0,0 +1,864 @@ +<?php +/** + * @package JAMA + * + * Class to obtain eigenvalues and eigenvectors of a real matrix. + * + * If A is symmetric, then A = V*D*V' where the eigenvalue matrix D + * is diagonal and the eigenvector matrix V is orthogonal (i.e. + * A = V.times(D.times(V.transpose())) and V.times(V.transpose()) + * equals the identity matrix). + * + * If A is not symmetric, then the eigenvalue matrix D is block diagonal + * with the real eigenvalues in 1-by-1 blocks and any complex eigenvalues, + * lambda + i*mu, in 2-by-2 blocks, [lambda, mu; -mu, lambda]. The + * columns of V represent the eigenvectors in the sense that A*V = V*D, + * i.e. A.times(V) equals V.times(D). The matrix V may be badly + * conditioned, or even singular, so the validity of the equation + * A = V*D*inverse(V) depends upon V.cond(). + * + * @author Paul Meagher + * @license PHP v3.0 + * @version 1.1 + */ +class EigenvalueDecomposition +{ + /** + * Row and column dimension (square matrix). + * @var int + */ + private $n; + + /** + * Internal symmetry flag. + * @var int + */ + private $issymmetric; + + /** + * Arrays for internal storage of eigenvalues. + * @var array + */ + private $d = array(); + private $e = array(); + + /** + * Array for internal storage of eigenvectors. + * @var array + */ + private $V = array(); + + /** + * Array for internal storage of nonsymmetric Hessenberg form. + * @var array + */ + private $H = array(); + + /** + * Working storage for nonsymmetric algorithm. + * @var array + */ + private $ort; + + /** + * Used for complex scalar division. + * @var float + */ + private $cdivr; + private $cdivi; + + /** + * Symmetric Householder reduction to tridiagonal form. + * + * @access private + */ + private function tred2() + { + // This is derived from the Algol procedures tred2 by + // Bowdler, Martin, Reinsch, and Wilkinson, Handbook for + // Auto. Comp., Vol.ii-Linear Algebra, and the corresponding + // Fortran subroutine in EISPACK. + $this->d = $this->V[$this->n-1]; + // Householder reduction to tridiagonal form. + for ($i = $this->n-1; $i > 0; --$i) { + $i_ = $i -1; + // Scale to avoid under/overflow. + $h = $scale = 0.0; + $scale += array_sum(array_map(abs, $this->d)); + if ($scale == 0.0) { + $this->e[$i] = $this->d[$i_]; + $this->d = array_slice($this->V[$i_], 0, $i_); + for ($j = 0; $j < $i; ++$j) { + $this->V[$j][$i] = $this->V[$i][$j] = 0.0; + } + } else { + // Generate Householder vector. + for ($k = 0; $k < $i; ++$k) { + $this->d[$k] /= $scale; + $h += pow($this->d[$k], 2); + } + $f = $this->d[$i_]; + $g = sqrt($h); + if ($f > 0) { + $g = -$g; + } + $this->e[$i] = $scale * $g; + $h = $h - $f * $g; + $this->d[$i_] = $f - $g; + for ($j = 0; $j < $i; ++$j) { + $this->e[$j] = 0.0; + } + // Apply similarity transformation to remaining columns. + for ($j = 0; $j < $i; ++$j) { + $f = $this->d[$j]; + $this->V[$j][$i] = $f; + $g = $this->e[$j] + $this->V[$j][$j] * $f; + for ($k = $j+1; $k <= $i_; ++$k) { + $g += $this->V[$k][$j] * $this->d[$k]; + $this->e[$k] += $this->V[$k][$j] * $f; + } + $this->e[$j] = $g; + } + $f = 0.0; + for ($j = 0; $j < $i; ++$j) { + $this->e[$j] /= $h; + $f += $this->e[$j] * $this->d[$j]; + } + $hh = $f / (2 * $h); + for ($j=0; $j < $i; ++$j) { + $this->e[$j] -= $hh * $this->d[$j]; + } + for ($j = 0; $j < $i; ++$j) { + $f = $this->d[$j]; + $g = $this->e[$j]; + for ($k = $j; $k <= $i_; ++$k) { + $this->V[$k][$j] -= ($f * $this->e[$k] + $g * $this->d[$k]); + } + $this->d[$j] = $this->V[$i-1][$j]; + $this->V[$i][$j] = 0.0; + } + } + $this->d[$i] = $h; + } + + // Accumulate transformations. + for ($i = 0; $i < $this->n-1; ++$i) { + $this->V[$this->n-1][$i] = $this->V[$i][$i]; + $this->V[$i][$i] = 1.0; + $h = $this->d[$i+1]; + if ($h != 0.0) { + for ($k = 0; $k <= $i; ++$k) { + $this->d[$k] = $this->V[$k][$i+1] / $h; + } + for ($j = 0; $j <= $i; ++$j) { + $g = 0.0; + for ($k = 0; $k <= $i; ++$k) { + $g += $this->V[$k][$i+1] * $this->V[$k][$j]; + } + for ($k = 0; $k <= $i; ++$k) { + $this->V[$k][$j] -= $g * $this->d[$k]; + } + } + } + for ($k = 0; $k <= $i; ++$k) { + $this->V[$k][$i+1] = 0.0; + } + } + + $this->d = $this->V[$this->n-1]; + $this->V[$this->n-1] = array_fill(0, $j, 0.0); + $this->V[$this->n-1][$this->n-1] = 1.0; + $this->e[0] = 0.0; + } + + /** + * Symmetric tridiagonal QL algorithm. + * + * This is derived from the Algol procedures tql2, by + * Bowdler, Martin, Reinsch, and Wilkinson, Handbook for + * Auto. Comp., Vol.ii-Linear Algebra, and the corresponding + * Fortran subroutine in EISPACK. + * + * @access private + */ + private function tql2() + { + for ($i = 1; $i < $this->n; ++$i) { + $this->e[$i-1] = $this->e[$i]; + } + $this->e[$this->n-1] = 0.0; + $f = 0.0; + $tst1 = 0.0; + $eps = pow(2.0, -52.0); + + for ($l = 0; $l < $this->n; ++$l) { + // Find small subdiagonal element + $tst1 = max($tst1, abs($this->d[$l]) + abs($this->e[$l])); + $m = $l; + while ($m < $this->n) { + if (abs($this->e[$m]) <= $eps * $tst1) { + break; + } + ++$m; + } + // If m == l, $this->d[l] is an eigenvalue, + // otherwise, iterate. + if ($m > $l) { + $iter = 0; + do { + // Could check iteration count here. + $iter += 1; + // Compute implicit shift + $g = $this->d[$l]; + $p = ($this->d[$l+1] - $g) / (2.0 * $this->e[$l]); + $r = hypo($p, 1.0); + if ($p < 0) { + $r *= -1; + } + $this->d[$l] = $this->e[$l] / ($p + $r); + $this->d[$l+1] = $this->e[$l] * ($p + $r); + $dl1 = $this->d[$l+1]; + $h = $g - $this->d[$l]; + for ($i = $l + 2; $i < $this->n; ++$i) { + $this->d[$i] -= $h; + } + $f += $h; + // Implicit QL transformation. + $p = $this->d[$m]; + $c = 1.0; + $c2 = $c3 = $c; + $el1 = $this->e[$l + 1]; + $s = $s2 = 0.0; + for ($i = $m-1; $i >= $l; --$i) { + $c3 = $c2; + $c2 = $c; + $s2 = $s; + $g = $c * $this->e[$i]; + $h = $c * $p; + $r = hypo($p, $this->e[$i]); + $this->e[$i+1] = $s * $r; + $s = $this->e[$i] / $r; + $c = $p / $r; + $p = $c * $this->d[$i] - $s * $g; + $this->d[$i+1] = $h + $s * ($c * $g + $s * $this->d[$i]); + // Accumulate transformation. + for ($k = 0; $k < $this->n; ++$k) { + $h = $this->V[$k][$i+1]; + $this->V[$k][$i+1] = $s * $this->V[$k][$i] + $c * $h; + $this->V[$k][$i] = $c * $this->V[$k][$i] - $s * $h; + } + } + $p = -$s * $s2 * $c3 * $el1 * $this->e[$l] / $dl1; + $this->e[$l] = $s * $p; + $this->d[$l] = $c * $p; + // Check for convergence. + } while (abs($this->e[$l]) > $eps * $tst1); + } + $this->d[$l] = $this->d[$l] + $f; + $this->e[$l] = 0.0; + } + + // Sort eigenvalues and corresponding vectors. + for ($i = 0; $i < $this->n - 1; ++$i) { + $k = $i; + $p = $this->d[$i]; + for ($j = $i+1; $j < $this->n; ++$j) { + if ($this->d[$j] < $p) { + $k = $j; + $p = $this->d[$j]; + } + } + if ($k != $i) { + $this->d[$k] = $this->d[$i]; + $this->d[$i] = $p; + for ($j = 0; $j < $this->n; ++$j) { + $p = $this->V[$j][$i]; + $this->V[$j][$i] = $this->V[$j][$k]; + $this->V[$j][$k] = $p; + } + } + } + } + + /** + * Nonsymmetric reduction to Hessenberg form. + * + * This is derived from the Algol procedures orthes and ortran, + * by Martin and Wilkinson, Handbook for Auto. Comp., + * Vol.ii-Linear Algebra, and the corresponding + * Fortran subroutines in EISPACK. + * + * @access private + */ + private function orthes() + { + $low = 0; + $high = $this->n-1; + + for ($m = $low+1; $m <= $high-1; ++$m) { + // Scale column. + $scale = 0.0; + for ($i = $m; $i <= $high; ++$i) { + $scale = $scale + abs($this->H[$i][$m-1]); + } + if ($scale != 0.0) { + // Compute Householder transformation. + $h = 0.0; + for ($i = $high; $i >= $m; --$i) { + $this->ort[$i] = $this->H[$i][$m-1] / $scale; + $h += $this->ort[$i] * $this->ort[$i]; + } + $g = sqrt($h); + if ($this->ort[$m] > 0) { + $g *= -1; + } + $h -= $this->ort[$m] * $g; + $this->ort[$m] -= $g; + // Apply Householder similarity transformation + // H = (I -u * u' / h) * H * (I -u * u') / h) + for ($j = $m; $j < $this->n; ++$j) { + $f = 0.0; + for ($i = $high; $i >= $m; --$i) { + $f += $this->ort[$i] * $this->H[$i][$j]; + } + $f /= $h; + for ($i = $m; $i <= $high; ++$i) { + $this->H[$i][$j] -= $f * $this->ort[$i]; + } + } + for ($i = 0; $i <= $high; ++$i) { + $f = 0.0; + for ($j = $high; $j >= $m; --$j) { + $f += $this->ort[$j] * $this->H[$i][$j]; + } + $f = $f / $h; + for ($j = $m; $j <= $high; ++$j) { + $this->H[$i][$j] -= $f * $this->ort[$j]; + } + } + $this->ort[$m] = $scale * $this->ort[$m]; + $this->H[$m][$m-1] = $scale * $g; + } + } + + // Accumulate transformations (Algol's ortran). + for ($i = 0; $i < $this->n; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + $this->V[$i][$j] = ($i == $j ? 1.0 : 0.0); + } + } + for ($m = $high-1; $m >= $low+1; --$m) { + if ($this->H[$m][$m-1] != 0.0) { + for ($i = $m+1; $i <= $high; ++$i) { + $this->ort[$i] = $this->H[$i][$m-1]; + } + for ($j = $m; $j <= $high; ++$j) { + $g = 0.0; + for ($i = $m; $i <= $high; ++$i) { + $g += $this->ort[$i] * $this->V[$i][$j]; + } + // Double division avoids possible underflow + $g = ($g / $this->ort[$m]) / $this->H[$m][$m-1]; + for ($i = $m; $i <= $high; ++$i) { + $this->V[$i][$j] += $g * $this->ort[$i]; + } + } + } + } + } + + /** + * Performs complex division. + * + * @access private + */ + private function cdiv($xr, $xi, $yr, $yi) + { + if (abs($yr) > abs($yi)) { + $r = $yi / $yr; + $d = $yr + $r * $yi; + $this->cdivr = ($xr + $r * $xi) / $d; + $this->cdivi = ($xi - $r * $xr) / $d; + } else { + $r = $yr / $yi; + $d = $yi + $r * $yr; + $this->cdivr = ($r * $xr + $xi) / $d; + $this->cdivi = ($r * $xi - $xr) / $d; + } + } + + /** + * Nonsymmetric reduction from Hessenberg to real Schur form. + * + * Code is derived from the Algol procedure hqr2, + * by Martin and Wilkinson, Handbook for Auto. Comp., + * Vol.ii-Linear Algebra, and the corresponding + * Fortran subroutine in EISPACK. + * + * @access private + */ + private function hqr2() + { + // Initialize + $nn = $this->n; + $n = $nn - 1; + $low = 0; + $high = $nn - 1; + $eps = pow(2.0, -52.0); + $exshift = 0.0; + $p = $q = $r = $s = $z = 0; + // Store roots isolated by balanc and compute matrix norm + $norm = 0.0; + + for ($i = 0; $i < $nn; ++$i) { + if (($i < $low) or ($i > $high)) { + $this->d[$i] = $this->H[$i][$i]; + $this->e[$i] = 0.0; + } + for ($j = max($i-1, 0); $j < $nn; ++$j) { + $norm = $norm + abs($this->H[$i][$j]); + } + } + + // Outer loop over eigenvalue index + $iter = 0; + while ($n >= $low) { + // Look for single small sub-diagonal element + $l = $n; + while ($l > $low) { + $s = abs($this->H[$l-1][$l-1]) + abs($this->H[$l][$l]); + if ($s == 0.0) { + $s = $norm; + } + if (abs($this->H[$l][$l-1]) < $eps * $s) { + break; + } + --$l; + } + // Check for convergence + // One root found + if ($l == $n) { + $this->H[$n][$n] = $this->H[$n][$n] + $exshift; + $this->d[$n] = $this->H[$n][$n]; + $this->e[$n] = 0.0; + --$n; + $iter = 0; + // Two roots found + } elseif ($l == $n-1) { + $w = $this->H[$n][$n-1] * $this->H[$n-1][$n]; + $p = ($this->H[$n-1][$n-1] - $this->H[$n][$n]) / 2.0; + $q = $p * $p + $w; + $z = sqrt(abs($q)); + $this->H[$n][$n] = $this->H[$n][$n] + $exshift; + $this->H[$n-1][$n-1] = $this->H[$n-1][$n-1] + $exshift; + $x = $this->H[$n][$n]; + // Real pair + if ($q >= 0) { + if ($p >= 0) { + $z = $p + $z; + } else { + $z = $p - $z; + } + $this->d[$n-1] = $x + $z; + $this->d[$n] = $this->d[$n-1]; + if ($z != 0.0) { + $this->d[$n] = $x - $w / $z; + } + $this->e[$n-1] = 0.0; + $this->e[$n] = 0.0; + $x = $this->H[$n][$n-1]; + $s = abs($x) + abs($z); + $p = $x / $s; + $q = $z / $s; + $r = sqrt($p * $p + $q * $q); + $p = $p / $r; + $q = $q / $r; + // Row modification + for ($j = $n-1; $j < $nn; ++$j) { + $z = $this->H[$n-1][$j]; + $this->H[$n-1][$j] = $q * $z + $p * $this->H[$n][$j]; + $this->H[$n][$j] = $q * $this->H[$n][$j] - $p * $z; + } + // Column modification + for ($i = 0; $i <= $n; ++$i) { + $z = $this->H[$i][$n-1]; + $this->H[$i][$n-1] = $q * $z + $p * $this->H[$i][$n]; + $this->H[$i][$n] = $q * $this->H[$i][$n] - $p * $z; + } + // Accumulate transformations + for ($i = $low; $i <= $high; ++$i) { + $z = $this->V[$i][$n-1]; + $this->V[$i][$n-1] = $q * $z + $p * $this->V[$i][$n]; + $this->V[$i][$n] = $q * $this->V[$i][$n] - $p * $z; + } + // Complex pair + } else { + $this->d[$n-1] = $x + $p; + $this->d[$n] = $x + $p; + $this->e[$n-1] = $z; + $this->e[$n] = -$z; + } + $n = $n - 2; + $iter = 0; + // No convergence yet + } else { + // Form shift + $x = $this->H[$n][$n]; + $y = 0.0; + $w = 0.0; + if ($l < $n) { + $y = $this->H[$n-1][$n-1]; + $w = $this->H[$n][$n-1] * $this->H[$n-1][$n]; + } + // Wilkinson's original ad hoc shift + if ($iter == 10) { + $exshift += $x; + for ($i = $low; $i <= $n; ++$i) { + $this->H[$i][$i] -= $x; + } + $s = abs($this->H[$n][$n-1]) + abs($this->H[$n-1][$n-2]); + $x = $y = 0.75 * $s; + $w = -0.4375 * $s * $s; + } + // MATLAB's new ad hoc shift + if ($iter == 30) { + $s = ($y - $x) / 2.0; + $s = $s * $s + $w; + if ($s > 0) { + $s = sqrt($s); + if ($y < $x) { + $s = -$s; + } + $s = $x - $w / (($y - $x) / 2.0 + $s); + for ($i = $low; $i <= $n; ++$i) { + $this->H[$i][$i] -= $s; + } + $exshift += $s; + $x = $y = $w = 0.964; + } + } + // Could check iteration count here. + $iter = $iter + 1; + // Look for two consecutive small sub-diagonal elements + $m = $n - 2; + while ($m >= $l) { + $z = $this->H[$m][$m]; + $r = $x - $z; + $s = $y - $z; + $p = ($r * $s - $w) / $this->H[$m+1][$m] + $this->H[$m][$m+1]; + $q = $this->H[$m+1][$m+1] - $z - $r - $s; + $r = $this->H[$m+2][$m+1]; + $s = abs($p) + abs($q) + abs($r); + $p = $p / $s; + $q = $q / $s; + $r = $r / $s; + if ($m == $l) { + break; + } + if (abs($this->H[$m][$m-1]) * (abs($q) + abs($r)) < + $eps * (abs($p) * (abs($this->H[$m-1][$m-1]) + abs($z) + abs($this->H[$m+1][$m+1])))) { + break; + } + --$m; + } + for ($i = $m + 2; $i <= $n; ++$i) { + $this->H[$i][$i-2] = 0.0; + if ($i > $m+2) { + $this->H[$i][$i-3] = 0.0; + } + } + // Double QR step involving rows l:n and columns m:n + for ($k = $m; $k <= $n-1; ++$k) { + $notlast = ($k != $n-1); + if ($k != $m) { + $p = $this->H[$k][$k-1]; + $q = $this->H[$k+1][$k-1]; + $r = ($notlast ? $this->H[$k+2][$k-1] : 0.0); + $x = abs($p) + abs($q) + abs($r); + if ($x != 0.0) { + $p = $p / $x; + $q = $q / $x; + $r = $r / $x; + } + } + if ($x == 0.0) { + break; + } + $s = sqrt($p * $p + $q * $q + $r * $r); + if ($p < 0) { + $s = -$s; + } + if ($s != 0) { + if ($k != $m) { + $this->H[$k][$k-1] = -$s * $x; + } elseif ($l != $m) { + $this->H[$k][$k-1] = -$this->H[$k][$k-1]; + } + $p = $p + $s; + $x = $p / $s; + $y = $q / $s; + $z = $r / $s; + $q = $q / $p; + $r = $r / $p; + // Row modification + for ($j = $k; $j < $nn; ++$j) { + $p = $this->H[$k][$j] + $q * $this->H[$k+1][$j]; + if ($notlast) { + $p = $p + $r * $this->H[$k+2][$j]; + $this->H[$k+2][$j] = $this->H[$k+2][$j] - $p * $z; + } + $this->H[$k][$j] = $this->H[$k][$j] - $p * $x; + $this->H[$k+1][$j] = $this->H[$k+1][$j] - $p * $y; + } + // Column modification + for ($i = 0; $i <= min($n, $k+3); ++$i) { + $p = $x * $this->H[$i][$k] + $y * $this->H[$i][$k+1]; + if ($notlast) { + $p = $p + $z * $this->H[$i][$k+2]; + $this->H[$i][$k+2] = $this->H[$i][$k+2] - $p * $r; + } + $this->H[$i][$k] = $this->H[$i][$k] - $p; + $this->H[$i][$k+1] = $this->H[$i][$k+1] - $p * $q; + } + // Accumulate transformations + for ($i = $low; $i <= $high; ++$i) { + $p = $x * $this->V[$i][$k] + $y * $this->V[$i][$k+1]; + if ($notlast) { + $p = $p + $z * $this->V[$i][$k+2]; + $this->V[$i][$k+2] = $this->V[$i][$k+2] - $p * $r; + } + $this->V[$i][$k] = $this->V[$i][$k] - $p; + $this->V[$i][$k+1] = $this->V[$i][$k+1] - $p * $q; + } + } // ($s != 0) + } // k loop + } // check convergence + } // while ($n >= $low) + + // Backsubstitute to find vectors of upper triangular form + if ($norm == 0.0) { + return; + } + + for ($n = $nn-1; $n >= 0; --$n) { + $p = $this->d[$n]; + $q = $this->e[$n]; + // Real vector + if ($q == 0) { + $l = $n; + $this->H[$n][$n] = 1.0; + for ($i = $n-1; $i >= 0; --$i) { + $w = $this->H[$i][$i] - $p; + $r = 0.0; + for ($j = $l; $j <= $n; ++$j) { + $r = $r + $this->H[$i][$j] * $this->H[$j][$n]; + } + if ($this->e[$i] < 0.0) { + $z = $w; + $s = $r; + } else { + $l = $i; + if ($this->e[$i] == 0.0) { + if ($w != 0.0) { + $this->H[$i][$n] = -$r / $w; + } else { + $this->H[$i][$n] = -$r / ($eps * $norm); + } + // Solve real equations + } else { + $x = $this->H[$i][$i+1]; + $y = $this->H[$i+1][$i]; + $q = ($this->d[$i] - $p) * ($this->d[$i] - $p) + $this->e[$i] * $this->e[$i]; + $t = ($x * $s - $z * $r) / $q; + $this->H[$i][$n] = $t; + if (abs($x) > abs($z)) { + $this->H[$i+1][$n] = (-$r - $w * $t) / $x; + } else { + $this->H[$i+1][$n] = (-$s - $y * $t) / $z; + } + } + // Overflow control + $t = abs($this->H[$i][$n]); + if (($eps * $t) * $t > 1) { + for ($j = $i; $j <= $n; ++$j) { + $this->H[$j][$n] = $this->H[$j][$n] / $t; + } + } + } + } + // Complex vector + } elseif ($q < 0) { + $l = $n-1; + // Last vector component imaginary so matrix is triangular + if (abs($this->H[$n][$n-1]) > abs($this->H[$n-1][$n])) { + $this->H[$n-1][$n-1] = $q / $this->H[$n][$n-1]; + $this->H[$n-1][$n] = -($this->H[$n][$n] - $p) / $this->H[$n][$n-1]; + } else { + $this->cdiv(0.0, -$this->H[$n-1][$n], $this->H[$n-1][$n-1] - $p, $q); + $this->H[$n-1][$n-1] = $this->cdivr; + $this->H[$n-1][$n] = $this->cdivi; + } + $this->H[$n][$n-1] = 0.0; + $this->H[$n][$n] = 1.0; + for ($i = $n-2; $i >= 0; --$i) { + // double ra,sa,vr,vi; + $ra = 0.0; + $sa = 0.0; + for ($j = $l; $j <= $n; ++$j) { + $ra = $ra + $this->H[$i][$j] * $this->H[$j][$n-1]; + $sa = $sa + $this->H[$i][$j] * $this->H[$j][$n]; + } + $w = $this->H[$i][$i] - $p; + if ($this->e[$i] < 0.0) { + $z = $w; + $r = $ra; + $s = $sa; + } else { + $l = $i; + if ($this->e[$i] == 0) { + $this->cdiv(-$ra, -$sa, $w, $q); + $this->H[$i][$n-1] = $this->cdivr; + $this->H[$i][$n] = $this->cdivi; + } else { + // Solve complex equations + $x = $this->H[$i][$i+1]; + $y = $this->H[$i+1][$i]; + $vr = ($this->d[$i] - $p) * ($this->d[$i] - $p) + $this->e[$i] * $this->e[$i] - $q * $q; + $vi = ($this->d[$i] - $p) * 2.0 * $q; + if ($vr == 0.0 & $vi == 0.0) { + $vr = $eps * $norm * (abs($w) + abs($q) + abs($x) + abs($y) + abs($z)); + } + $this->cdiv($x * $r - $z * $ra + $q * $sa, $x * $s - $z * $sa - $q * $ra, $vr, $vi); + $this->H[$i][$n-1] = $this->cdivr; + $this->H[$i][$n] = $this->cdivi; + if (abs($x) > (abs($z) + abs($q))) { + $this->H[$i+1][$n-1] = (-$ra - $w * $this->H[$i][$n-1] + $q * $this->H[$i][$n]) / $x; + $this->H[$i+1][$n] = (-$sa - $w * $this->H[$i][$n] - $q * $this->H[$i][$n-1]) / $x; + } else { + $this->cdiv(-$r - $y * $this->H[$i][$n-1], -$s - $y * $this->H[$i][$n], $z, $q); + $this->H[$i+1][$n-1] = $this->cdivr; + $this->H[$i+1][$n] = $this->cdivi; + } + } + // Overflow control + $t = max(abs($this->H[$i][$n-1]), abs($this->H[$i][$n])); + if (($eps * $t) * $t > 1) { + for ($j = $i; $j <= $n; ++$j) { + $this->H[$j][$n-1] = $this->H[$j][$n-1] / $t; + $this->H[$j][$n] = $this->H[$j][$n] / $t; + } + } + } // end else + } // end for + } // end else for complex case + } // end for + + // Vectors of isolated roots + for ($i = 0; $i < $nn; ++$i) { + if ($i < $low | $i > $high) { + for ($j = $i; $j < $nn; ++$j) { + $this->V[$i][$j] = $this->H[$i][$j]; + } + } + } + + // Back transformation to get eigenvectors of original matrix + for ($j = $nn-1; $j >= $low; --$j) { + for ($i = $low; $i <= $high; ++$i) { + $z = 0.0; + for ($k = $low; $k <= min($j, $high); ++$k) { + $z = $z + $this->V[$i][$k] * $this->H[$k][$j]; + } + $this->V[$i][$j] = $z; + } + } + } // end hqr2 + + /** + * Constructor: Check for symmetry, then construct the eigenvalue decomposition + * + * @access public + * @param A Square matrix + * @return Structure to access D and V. + */ + public function __construct($Arg) + { + $this->A = $Arg->getArray(); + $this->n = $Arg->getColumnDimension(); + + $issymmetric = true; + for ($j = 0; ($j < $this->n) & $issymmetric; ++$j) { + for ($i = 0; ($i < $this->n) & $issymmetric; ++$i) { + $issymmetric = ($this->A[$i][$j] == $this->A[$j][$i]); + } + } + + if ($issymmetric) { + $this->V = $this->A; + // Tridiagonalize. + $this->tred2(); + // Diagonalize. + $this->tql2(); + } else { + $this->H = $this->A; + $this->ort = array(); + // Reduce to Hessenberg form. + $this->orthes(); + // Reduce Hessenberg to real Schur form. + $this->hqr2(); + } + } + + /** + * Return the eigenvector matrix + * + * @access public + * @return V + */ + public function getV() + { + return new Matrix($this->V, $this->n, $this->n); + } + + /** + * Return the real parts of the eigenvalues + * + * @access public + * @return real(diag(D)) + */ + public function getRealEigenvalues() + { + return $this->d; + } + + /** + * Return the imaginary parts of the eigenvalues + * + * @access public + * @return imag(diag(D)) + */ + public function getImagEigenvalues() + { + return $this->e; + } + + /** + * Return the block diagonal eigenvalue matrix + * + * @access public + * @return D + */ + public function getD() + { + for ($i = 0; $i < $this->n; ++$i) { + $D[$i] = array_fill(0, $this->n, 0.0); + $D[$i][$i] = $this->d[$i]; + if ($this->e[$i] == 0) { + continue; + } + $o = ($this->e[$i] > 0) ? $i + 1 : $i - 1; + $D[$i][$o] = $this->e[$i]; + } + return new Matrix($D); + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/JAMA/LUDecomposition.php b/extend/PHPExcel/PHPExcel/Shared/JAMA/LUDecomposition.php new file mode 100644 index 0000000..2505d92 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/JAMA/LUDecomposition.php @@ -0,0 +1,257 @@ +<?php +/** + * @package JAMA + * + * For an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n + * unit lower triangular matrix L, an n-by-n upper triangular matrix U, + * and a permutation vector piv of length m so that A(piv,:) = L*U. + * If m < n, then L is m-by-m and U is m-by-n. + * + * The LU decompostion with pivoting always exists, even if the matrix is + * singular, so the constructor will never fail. The primary use of the + * LU decomposition is in the solution of square systems of simultaneous + * linear equations. This will fail if isNonsingular() returns false. + * + * @author Paul Meagher + * @author Bartosz Matosiuk + * @author Michael Bommarito + * @version 1.1 + * @license PHP v3.0 + */ +class PHPExcel_Shared_JAMA_LUDecomposition +{ + const MATRIX_SINGULAR_EXCEPTION = "Can only perform operation on singular matrix."; + const MATRIX_SQUARE_EXCEPTION = "Mismatched Row dimension"; + + /** + * Decomposition storage + * @var array + */ + private $LU = array(); + + /** + * Row dimension. + * @var int + */ + private $m; + + /** + * Column dimension. + * @var int + */ + private $n; + + /** + * Pivot sign. + * @var int + */ + private $pivsign; + + /** + * Internal storage of pivot vector. + * @var array + */ + private $piv = array(); + + /** + * LU Decomposition constructor. + * + * @param $A Rectangular matrix + * @return Structure to access L, U and piv. + */ + public function __construct($A) + { + if ($A instanceof PHPExcel_Shared_JAMA_Matrix) { + // Use a "left-looking", dot-product, Crout/Doolittle algorithm. + $this->LU = $A->getArray(); + $this->m = $A->getRowDimension(); + $this->n = $A->getColumnDimension(); + for ($i = 0; $i < $this->m; ++$i) { + $this->piv[$i] = $i; + } + $this->pivsign = 1; + $LUrowi = $LUcolj = array(); + + // Outer loop. + for ($j = 0; $j < $this->n; ++$j) { + // Make a copy of the j-th column to localize references. + for ($i = 0; $i < $this->m; ++$i) { + $LUcolj[$i] = &$this->LU[$i][$j]; + } + // Apply previous transformations. + for ($i = 0; $i < $this->m; ++$i) { + $LUrowi = $this->LU[$i]; + // Most of the time is spent in the following dot product. + $kmax = min($i, $j); + $s = 0.0; + for ($k = 0; $k < $kmax; ++$k) { + $s += $LUrowi[$k] * $LUcolj[$k]; + } + $LUrowi[$j] = $LUcolj[$i] -= $s; + } + // Find pivot and exchange if necessary. + $p = $j; + for ($i = $j+1; $i < $this->m; ++$i) { + if (abs($LUcolj[$i]) > abs($LUcolj[$p])) { + $p = $i; + } + } + if ($p != $j) { + for ($k = 0; $k < $this->n; ++$k) { + $t = $this->LU[$p][$k]; + $this->LU[$p][$k] = $this->LU[$j][$k]; + $this->LU[$j][$k] = $t; + } + $k = $this->piv[$p]; + $this->piv[$p] = $this->piv[$j]; + $this->piv[$j] = $k; + $this->pivsign = $this->pivsign * -1; + } + // Compute multipliers. + if (($j < $this->m) && ($this->LU[$j][$j] != 0.0)) { + for ($i = $j+1; $i < $this->m; ++$i) { + $this->LU[$i][$j] /= $this->LU[$j][$j]; + } + } + } + } else { + throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::ARGUMENT_TYPE_EXCEPTION); + } + } // function __construct() + + /** + * Get lower triangular factor. + * + * @return array Lower triangular factor + */ + public function getL() + { + for ($i = 0; $i < $this->m; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + if ($i > $j) { + $L[$i][$j] = $this->LU[$i][$j]; + } elseif ($i == $j) { + $L[$i][$j] = 1.0; + } else { + $L[$i][$j] = 0.0; + } + } + } + return new PHPExcel_Shared_JAMA_Matrix($L); + } // function getL() + + /** + * Get upper triangular factor. + * + * @return array Upper triangular factor + */ + public function getU() + { + for ($i = 0; $i < $this->n; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + if ($i <= $j) { + $U[$i][$j] = $this->LU[$i][$j]; + } else { + $U[$i][$j] = 0.0; + } + } + } + return new PHPExcel_Shared_JAMA_Matrix($U); + } // function getU() + + /** + * Return pivot permutation vector. + * + * @return array Pivot vector + */ + public function getPivot() + { + return $this->piv; + } // function getPivot() + + /** + * Alias for getPivot + * + * @see getPivot + */ + public function getDoublePivot() + { + return $this->getPivot(); + } // function getDoublePivot() + + /** + * Is the matrix nonsingular? + * + * @return true if U, and hence A, is nonsingular. + */ + public function isNonsingular() + { + for ($j = 0; $j < $this->n; ++$j) { + if ($this->LU[$j][$j] == 0) { + return false; + } + } + return true; + } // function isNonsingular() + + /** + * Count determinants + * + * @return array d matrix deterninat + */ + public function det() + { + if ($this->m == $this->n) { + $d = $this->pivsign; + for ($j = 0; $j < $this->n; ++$j) { + $d *= $this->LU[$j][$j]; + } + return $d; + } else { + throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::MATRIX_DIMENSION_EXCEPTION); + } + } // function det() + + /** + * Solve A*X = B + * + * @param $B A Matrix with as many rows as A and any number of columns. + * @return X so that L*U*X = B(piv,:) + * @PHPExcel_Calculation_Exception IllegalArgumentException Matrix row dimensions must agree. + * @PHPExcel_Calculation_Exception RuntimeException Matrix is singular. + */ + public function solve($B) + { + if ($B->getRowDimension() == $this->m) { + if ($this->isNonsingular()) { + // Copy right hand side with pivoting + $nx = $B->getColumnDimension(); + $X = $B->getMatrix($this->piv, 0, $nx-1); + // Solve L*Y = B(piv,:) + for ($k = 0; $k < $this->n; ++$k) { + for ($i = $k+1; $i < $this->n; ++$i) { + for ($j = 0; $j < $nx; ++$j) { + $X->A[$i][$j] -= $X->A[$k][$j] * $this->LU[$i][$k]; + } + } + } + // Solve U*X = Y; + for ($k = $this->n-1; $k >= 0; --$k) { + for ($j = 0; $j < $nx; ++$j) { + $X->A[$k][$j] /= $this->LU[$k][$k]; + } + for ($i = 0; $i < $k; ++$i) { + for ($j = 0; $j < $nx; ++$j) { + $X->A[$i][$j] -= $X->A[$k][$j] * $this->LU[$i][$k]; + } + } + } + return $X; + } else { + throw new PHPExcel_Calculation_Exception(self::MATRIX_SINGULAR_EXCEPTION); + } + } else { + throw new PHPExcel_Calculation_Exception(self::MATRIX_SQUARE_EXCEPTION); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/JAMA/Matrix.php b/extend/PHPExcel/PHPExcel/Shared/JAMA/Matrix.php new file mode 100644 index 0000000..82fb0fb --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/JAMA/Matrix.php @@ -0,0 +1,1159 @@ +<?php +/** + * @package JAMA + */ + +/** PHPExcel root directory */ +if (!defined('PHPEXCEL_ROOT')) { + /** + * @ignore + */ + define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../../'); + require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); +} + + +/* + * Matrix class + * + * @author Paul Meagher + * @author Michael Bommarito + * @author Lukasz Karapuda + * @author Bartek Matosiuk + * @version 1.8 + * @license PHP v3.0 + * @see http://math.nist.gov/javanumerics/jama/ + */ +class PHPExcel_Shared_JAMA_Matrix +{ + const POLYMORPHIC_ARGUMENT_EXCEPTION = "Invalid argument pattern for polymorphic function."; + const ARGUMENT_TYPE_EXCEPTION = "Invalid argument type."; + const ARGUMENT_BOUNDS_EXCEPTION = "Invalid argument range."; + const MATRIX_DIMENSION_EXCEPTION = "Matrix dimensions are not equal."; + const ARRAY_LENGTH_EXCEPTION = "Array length must be a multiple of m."; + + /** + * Matrix storage + * + * @var array + * @access public + */ + public $A = array(); + + /** + * Matrix row dimension + * + * @var int + * @access private + */ + private $m; + + /** + * Matrix column dimension + * + * @var int + * @access private + */ + private $n; + + /** + * Polymorphic constructor + * + * As PHP has no support for polymorphic constructors, we hack our own sort of polymorphism using func_num_args, func_get_arg, and gettype. In essence, we're just implementing a simple RTTI filter and calling the appropriate constructor. + */ + public function __construct() + { + if (func_num_args() > 0) { + $args = func_get_args(); + $match = implode(",", array_map('gettype', $args)); + + switch ($match) { + //Rectangular matrix - m x n initialized from 2D array + case 'array': + $this->m = count($args[0]); + $this->n = count($args[0][0]); + $this->A = $args[0]; + break; + //Square matrix - n x n + case 'integer': + $this->m = $args[0]; + $this->n = $args[0]; + $this->A = array_fill(0, $this->m, array_fill(0, $this->n, 0)); + break; + //Rectangular matrix - m x n + case 'integer,integer': + $this->m = $args[0]; + $this->n = $args[1]; + $this->A = array_fill(0, $this->m, array_fill(0, $this->n, 0)); + break; + //Rectangular matrix - m x n initialized from packed array + case 'array,integer': + $this->m = $args[1]; + if ($this->m != 0) { + $this->n = count($args[0]) / $this->m; + } else { + $this->n = 0; + } + if (($this->m * $this->n) == count($args[0])) { + for ($i = 0; $i < $this->m; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + $this->A[$i][$j] = $args[0][$i + $j * $this->m]; + } + } + } else { + throw new PHPExcel_Calculation_Exception(self::ARRAY_LENGTH_EXCEPTION); + } + break; + default: + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + break; + } + } else { + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + } + } + + /** + * getArray + * + * @return array Matrix array + */ + public function getArray() + { + return $this->A; + } + + /** + * getRowDimension + * + * @return int Row dimension + */ + public function getRowDimension() + { + return $this->m; + } + + /** + * getColumnDimension + * + * @return int Column dimension + */ + public function getColumnDimension() + { + return $this->n; + } + + /** + * get + * + * Get the i,j-th element of the matrix. + * @param int $i Row position + * @param int $j Column position + * @return mixed Element (int/float/double) + */ + public function get($i = null, $j = null) + { + return $this->A[$i][$j]; + } + + /** + * getMatrix + * + * Get a submatrix + * @param int $i0 Initial row index + * @param int $iF Final row index + * @param int $j0 Initial column index + * @param int $jF Final column index + * @return Matrix Submatrix + */ + public function getMatrix() + { + if (func_num_args() > 0) { + $args = func_get_args(); + $match = implode(",", array_map('gettype', $args)); + + switch ($match) { + //A($i0...; $j0...) + case 'integer,integer': + list($i0, $j0) = $args; + if ($i0 >= 0) { + $m = $this->m - $i0; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + } + if ($j0 >= 0) { + $n = $this->n - $j0; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + } + $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); + for ($i = $i0; $i < $this->m; ++$i) { + for ($j = $j0; $j < $this->n; ++$j) { + $R->set($i, $j, $this->A[$i][$j]); + } + } + return $R; + break; + //A($i0...$iF; $j0...$jF) + case 'integer,integer,integer,integer': + list($i0, $iF, $j0, $jF) = $args; + if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) { + $m = $iF - $i0; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + } + if (($jF > $j0) && ($this->n >= $jF) && ($j0 >= 0)) { + $n = $jF - $j0; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + } + $R = new PHPExcel_Shared_JAMA_Matrix($m+1, $n+1); + for ($i = $i0; $i <= $iF; ++$i) { + for ($j = $j0; $j <= $jF; ++$j) { + $R->set($i - $i0, $j - $j0, $this->A[$i][$j]); + } + } + return $R; + break; + //$R = array of row indices; $C = array of column indices + case 'array,array': + list($RL, $CL) = $args; + if (count($RL) > 0) { + $m = count($RL); + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + } + if (count($CL) > 0) { + $n = count($CL); + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + } + $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); + for ($i = 0; $i < $m; ++$i) { + for ($j = 0; $j < $n; ++$j) { + $R->set($i - $i0, $j - $j0, $this->A[$RL[$i]][$CL[$j]]); + } + } + return $R; + break; + //$RL = array of row indices; $CL = array of column indices + case 'array,array': + list($RL, $CL) = $args; + if (count($RL) > 0) { + $m = count($RL); + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + } + if (count($CL) > 0) { + $n = count($CL); + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + } + $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); + for ($i = 0; $i < $m; ++$i) { + for ($j = 0; $j < $n; ++$j) { + $R->set($i, $j, $this->A[$RL[$i]][$CL[$j]]); + } + } + return $R; + break; + //A($i0...$iF); $CL = array of column indices + case 'integer,integer,array': + list($i0, $iF, $CL) = $args; + if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) { + $m = $iF - $i0; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + } + if (count($CL) > 0) { + $n = count($CL); + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + } + $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); + for ($i = $i0; $i < $iF; ++$i) { + for ($j = 0; $j < $n; ++$j) { + $R->set($i - $i0, $j, $this->A[$RL[$i]][$j]); + } + } + return $R; + break; + //$RL = array of row indices + case 'array,integer,integer': + list($RL, $j0, $jF) = $args; + if (count($RL) > 0) { + $m = count($RL); + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + } + if (($jF >= $j0) && ($this->n >= $jF) && ($j0 >= 0)) { + $n = $jF - $j0; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + } + $R = new PHPExcel_Shared_JAMA_Matrix($m, $n+1); + for ($i = 0; $i < $m; ++$i) { + for ($j = $j0; $j <= $jF; ++$j) { + $R->set($i, $j - $j0, $this->A[$RL[$i]][$j]); + } + } + return $R; + break; + default: + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + break; + } + } else { + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + } + } + + /** + * checkMatrixDimensions + * + * Is matrix B the same size? + * @param Matrix $B Matrix B + * @return boolean + */ + public function checkMatrixDimensions($B = null) + { + if ($B instanceof PHPExcel_Shared_JAMA_Matrix) { + if (($this->m == $B->getRowDimension()) && ($this->n == $B->getColumnDimension())) { + return true; + } else { + throw new PHPExcel_Calculation_Exception(self::MATRIX_DIMENSION_EXCEPTION); + } + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + } + } // function checkMatrixDimensions() + + /** + * set + * + * Set the i,j-th element of the matrix. + * @param int $i Row position + * @param int $j Column position + * @param mixed $c Int/float/double value + * @return mixed Element (int/float/double) + */ + public function set($i = null, $j = null, $c = null) + { + // Optimized set version just has this + $this->A[$i][$j] = $c; + } // function set() + + /** + * identity + * + * Generate an identity matrix. + * @param int $m Row dimension + * @param int $n Column dimension + * @return Matrix Identity matrix + */ + public function identity($m = null, $n = null) + { + return $this->diagonal($m, $n, 1); + } + + /** + * diagonal + * + * Generate a diagonal matrix + * @param int $m Row dimension + * @param int $n Column dimension + * @param mixed $c Diagonal value + * @return Matrix Diagonal matrix + */ + public function diagonal($m = null, $n = null, $c = 1) + { + $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); + for ($i = 0; $i < $m; ++$i) { + $R->set($i, $i, $c); + } + return $R; + } + + /** + * getMatrixByRow + * + * Get a submatrix by row index/range + * @param int $i0 Initial row index + * @param int $iF Final row index + * @return Matrix Submatrix + */ + public function getMatrixByRow($i0 = null, $iF = null) + { + if (is_int($i0)) { + if (is_int($iF)) { + return $this->getMatrix($i0, 0, $iF + 1, $this->n); + } else { + return $this->getMatrix($i0, 0, $i0 + 1, $this->n); + } + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + } + } + + /** + * getMatrixByCol + * + * Get a submatrix by column index/range + * @param int $i0 Initial column index + * @param int $iF Final column index + * @return Matrix Submatrix + */ + public function getMatrixByCol($j0 = null, $jF = null) + { + if (is_int($j0)) { + if (is_int($jF)) { + return $this->getMatrix(0, $j0, $this->m, $jF + 1); + } else { + return $this->getMatrix(0, $j0, $this->m, $j0 + 1); + } + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + } + } + + /** + * transpose + * + * Tranpose matrix + * @return Matrix Transposed matrix + */ + public function transpose() + { + $R = new PHPExcel_Shared_JAMA_Matrix($this->n, $this->m); + for ($i = 0; $i < $this->m; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + $R->set($j, $i, $this->A[$i][$j]); + } + } + return $R; + } // function transpose() + + /** + * trace + * + * Sum of diagonal elements + * @return float Sum of diagonal elements + */ + public function trace() + { + $s = 0; + $n = min($this->m, $this->n); + for ($i = 0; $i < $n; ++$i) { + $s += $this->A[$i][$i]; + } + return $s; + } + + /** + * uminus + * + * Unary minus matrix -A + * @return Matrix Unary minus matrix + */ + public function uminus() + { + } + + /** + * plus + * + * A + B + * @param mixed $B Matrix/Array + * @return Matrix Sum + */ + public function plus() + { + if (func_num_args() > 0) { + $args = func_get_args(); + $match = implode(",", array_map('gettype', $args)); + + switch ($match) { + case 'object': + if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + $M = $args[0]; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + } + break; + case 'array': + $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + break; + default: + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + break; + } + $this->checkMatrixDimensions($M); + for ($i = 0; $i < $this->m; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + $M->set($i, $j, $M->get($i, $j) + $this->A[$i][$j]); + } + } + return $M; + } else { + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + } + } + + /** + * plusEquals + * + * A = A + B + * @param mixed $B Matrix/Array + * @return Matrix Sum + */ + public function plusEquals() + { + if (func_num_args() > 0) { + $args = func_get_args(); + $match = implode(",", array_map('gettype', $args)); + + switch ($match) { + case 'object': + if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + $M = $args[0]; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + } + break; + case 'array': + $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + break; + default: + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + break; + } + $this->checkMatrixDimensions($M); + for ($i = 0; $i < $this->m; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + $validValues = true; + $value = $M->get($i, $j); + if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { + $this->A[$i][$j] = trim($this->A[$i][$j], '"'); + $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); + } + if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { + $value = trim($value, '"'); + $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); + } + if ($validValues) { + $this->A[$i][$j] += $value; + } else { + $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN(); + } + } + } + return $this; + } else { + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + } + } + + /** + * minus + * + * A - B + * @param mixed $B Matrix/Array + * @return Matrix Sum + */ + public function minus() + { + if (func_num_args() > 0) { + $args = func_get_args(); + $match = implode(",", array_map('gettype', $args)); + + switch ($match) { + case 'object': + if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + $M = $args[0]; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + } + break; + case 'array': + $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + break; + default: + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + break; + } + $this->checkMatrixDimensions($M); + for ($i = 0; $i < $this->m; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + $M->set($i, $j, $M->get($i, $j) - $this->A[$i][$j]); + } + } + return $M; + } else { + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + } + } + + /** + * minusEquals + * + * A = A - B + * @param mixed $B Matrix/Array + * @return Matrix Sum + */ + public function minusEquals() + { + if (func_num_args() > 0) { + $args = func_get_args(); + $match = implode(",", array_map('gettype', $args)); + + switch ($match) { + case 'object': + if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + $M = $args[0]; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + } + break; + case 'array': + $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + break; + default: + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + break; + } + $this->checkMatrixDimensions($M); + for ($i = 0; $i < $this->m; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + $validValues = true; + $value = $M->get($i, $j); + if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { + $this->A[$i][$j] = trim($this->A[$i][$j], '"'); + $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); + } + if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { + $value = trim($value, '"'); + $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); + } + if ($validValues) { + $this->A[$i][$j] -= $value; + } else { + $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN(); + } + } + } + return $this; + } else { + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + } + } + + /** + * arrayTimes + * + * Element-by-element multiplication + * Cij = Aij * Bij + * @param mixed $B Matrix/Array + * @return Matrix Matrix Cij + */ + public function arrayTimes() + { + if (func_num_args() > 0) { + $args = func_get_args(); + $match = implode(",", array_map('gettype', $args)); + + switch ($match) { + case 'object': + if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + $M = $args[0]; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + } + break; + case 'array': + $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + break; + default: + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + break; + } + $this->checkMatrixDimensions($M); + for ($i = 0; $i < $this->m; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + $M->set($i, $j, $M->get($i, $j) * $this->A[$i][$j]); + } + } + return $M; + } else { + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + } + } + + /** + * arrayTimesEquals + * + * Element-by-element multiplication + * Aij = Aij * Bij + * @param mixed $B Matrix/Array + * @return Matrix Matrix Aij + */ + public function arrayTimesEquals() + { + if (func_num_args() > 0) { + $args = func_get_args(); + $match = implode(",", array_map('gettype', $args)); + + switch ($match) { + case 'object': + if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + $M = $args[0]; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + } + break; + case 'array': + $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + break; + default: + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + break; + } + $this->checkMatrixDimensions($M); + for ($i = 0; $i < $this->m; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + $validValues = true; + $value = $M->get($i, $j); + if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { + $this->A[$i][$j] = trim($this->A[$i][$j], '"'); + $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); + } + if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { + $value = trim($value, '"'); + $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); + } + if ($validValues) { + $this->A[$i][$j] *= $value; + } else { + $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN(); + } + } + } + return $this; + } else { + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + } + } + + /** + * arrayRightDivide + * + * Element-by-element right division + * A / B + * @param Matrix $B Matrix B + * @return Matrix Division result + */ + public function arrayRightDivide() + { + if (func_num_args() > 0) { + $args = func_get_args(); + $match = implode(",", array_map('gettype', $args)); + + switch ($match) { + case 'object': + if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + $M = $args[0]; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + } + break; + case 'array': + $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + break; + default: + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + break; + } + $this->checkMatrixDimensions($M); + for ($i = 0; $i < $this->m; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + $validValues = true; + $value = $M->get($i, $j); + if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { + $this->A[$i][$j] = trim($this->A[$i][$j], '"'); + $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); + } + if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { + $value = trim($value, '"'); + $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); + } + if ($validValues) { + if ($value == 0) { + // Trap for Divide by Zero error + $M->set($i, $j, '#DIV/0!'); + } else { + $M->set($i, $j, $this->A[$i][$j] / $value); + } + } else { + $M->set($i, $j, PHPExcel_Calculation_Functions::NaN()); + } + } + } + return $M; + } else { + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + } + } + + + /** + * arrayRightDivideEquals + * + * Element-by-element right division + * Aij = Aij / Bij + * @param mixed $B Matrix/Array + * @return Matrix Matrix Aij + */ + public function arrayRightDivideEquals() + { + if (func_num_args() > 0) { + $args = func_get_args(); + $match = implode(",", array_map('gettype', $args)); + + switch ($match) { + case 'object': + if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + $M = $args[0]; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + } + break; + case 'array': + $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + break; + default: + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + break; + } + $this->checkMatrixDimensions($M); + for ($i = 0; $i < $this->m; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + $this->A[$i][$j] = $this->A[$i][$j] / $M->get($i, $j); + } + } + return $M; + } else { + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + } + } + + + /** + * arrayLeftDivide + * + * Element-by-element Left division + * A / B + * @param Matrix $B Matrix B + * @return Matrix Division result + */ + public function arrayLeftDivide() + { + if (func_num_args() > 0) { + $args = func_get_args(); + $match = implode(",", array_map('gettype', $args)); + + switch ($match) { + case 'object': + if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + $M = $args[0]; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + } + break; + case 'array': + $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + break; + default: + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + break; + } + $this->checkMatrixDimensions($M); + for ($i = 0; $i < $this->m; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + $M->set($i, $j, $M->get($i, $j) / $this->A[$i][$j]); + } + } + return $M; + } else { + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + } + } + + + /** + * arrayLeftDivideEquals + * + * Element-by-element Left division + * Aij = Aij / Bij + * @param mixed $B Matrix/Array + * @return Matrix Matrix Aij + */ + public function arrayLeftDivideEquals() + { + if (func_num_args() > 0) { + $args = func_get_args(); + $match = implode(",", array_map('gettype', $args)); + + switch ($match) { + case 'object': + if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + $M = $args[0]; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + } + break; + case 'array': + $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + break; + default: + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + break; + } + $this->checkMatrixDimensions($M); + for ($i = 0; $i < $this->m; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + $this->A[$i][$j] = $M->get($i, $j) / $this->A[$i][$j]; + } + } + return $M; + } else { + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + } + } + + + /** + * times + * + * Matrix multiplication + * @param mixed $n Matrix/Array/Scalar + * @return Matrix Product + */ + public function times() + { + if (func_num_args() > 0) { + $args = func_get_args(); + $match = implode(",", array_map('gettype', $args)); + + switch ($match) { + case 'object': + if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + $B = $args[0]; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + } + if ($this->n == $B->m) { + $C = new PHPExcel_Shared_JAMA_Matrix($this->m, $B->n); + for ($j = 0; $j < $B->n; ++$j) { + for ($k = 0; $k < $this->n; ++$k) { + $Bcolj[$k] = $B->A[$k][$j]; + } + for ($i = 0; $i < $this->m; ++$i) { + $Arowi = $this->A[$i]; + $s = 0; + for ($k = 0; $k < $this->n; ++$k) { + $s += $Arowi[$k] * $Bcolj[$k]; + } + $C->A[$i][$j] = $s; + } + } + return $C; + } else { + throw new PHPExcel_Calculation_Exception(JAMAError(MatrixDimensionMismatch)); + } + break; + case 'array': + $B = new PHPExcel_Shared_JAMA_Matrix($args[0]); + if ($this->n == $B->m) { + $C = new PHPExcel_Shared_JAMA_Matrix($this->m, $B->n); + for ($i = 0; $i < $C->m; ++$i) { + for ($j = 0; $j < $C->n; ++$j) { + $s = "0"; + for ($k = 0; $k < $C->n; ++$k) { + $s += $this->A[$i][$k] * $B->A[$k][$j]; + } + $C->A[$i][$j] = $s; + } + } + return $C; + } else { + throw new PHPExcel_Calculation_Exception(JAMAError(MatrixDimensionMismatch)); + } + return $M; + break; + case 'integer': + $C = new PHPExcel_Shared_JAMA_Matrix($this->A); + for ($i = 0; $i < $C->m; ++$i) { + for ($j = 0; $j < $C->n; ++$j) { + $C->A[$i][$j] *= $args[0]; + } + } + return $C; + break; + case 'double': + $C = new PHPExcel_Shared_JAMA_Matrix($this->m, $this->n); + for ($i = 0; $i < $C->m; ++$i) { + for ($j = 0; $j < $C->n; ++$j) { + $C->A[$i][$j] = $args[0] * $this->A[$i][$j]; + } + } + return $C; + break; + case 'float': + $C = new PHPExcel_Shared_JAMA_Matrix($this->A); + for ($i = 0; $i < $C->m; ++$i) { + for ($j = 0; $j < $C->n; ++$j) { + $C->A[$i][$j] *= $args[0]; + } + } + return $C; + break; + default: + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + break; + } + } else { + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + } + } + + /** + * power + * + * A = A ^ B + * @param mixed $B Matrix/Array + * @return Matrix Sum + */ + public function power() + { + if (func_num_args() > 0) { + $args = func_get_args(); + $match = implode(",", array_map('gettype', $args)); + + switch ($match) { + case 'object': + if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + $M = $args[0]; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + } + break; + case 'array': + $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + break; + default: + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + break; + } + $this->checkMatrixDimensions($M); + for ($i = 0; $i < $this->m; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + $validValues = true; + $value = $M->get($i, $j); + if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { + $this->A[$i][$j] = trim($this->A[$i][$j], '"'); + $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); + } + if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { + $value = trim($value, '"'); + $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); + } + if ($validValues) { + $this->A[$i][$j] = pow($this->A[$i][$j], $value); + } else { + $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN(); + } + } + } + return $this; + } else { + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + } + } + + /** + * concat + * + * A = A & B + * @param mixed $B Matrix/Array + * @return Matrix Sum + */ + public function concat() + { + if (func_num_args() > 0) { + $args = func_get_args(); + $match = implode(",", array_map('gettype', $args)); + + switch ($match) { + case 'object': + if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + $M = $args[0]; + } else { + throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + } + case 'array': + $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + break; + default: + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + break; + } + $this->checkMatrixDimensions($M); + for ($i = 0; $i < $this->m; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + $this->A[$i][$j] = trim($this->A[$i][$j], '"').trim($M->get($i, $j), '"'); + } + } + return $this; + } else { + throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + } + } + + /** + * Solve A*X = B. + * + * @param Matrix $B Right hand side + * @return Matrix ... Solution if A is square, least squares solution otherwise + */ + public function solve($B) + { + if ($this->m == $this->n) { + $LU = new PHPExcel_Shared_JAMA_LUDecomposition($this); + return $LU->solve($B); + } else { + $QR = new PHPExcel_Shared_JAMA_QRDecomposition($this); + return $QR->solve($B); + } + } + + /** + * Matrix inverse or pseudoinverse. + * + * @return Matrix ... Inverse(A) if A is square, pseudoinverse otherwise. + */ + public function inverse() + { + return $this->solve($this->identity($this->m, $this->m)); + } + + /** + * det + * + * Calculate determinant + * @return float Determinant + */ + public function det() + { + $L = new PHPExcel_Shared_JAMA_LUDecomposition($this); + return $L->det(); + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/JAMA/QRDecomposition.php b/extend/PHPExcel/PHPExcel/Shared/JAMA/QRDecomposition.php new file mode 100644 index 0000000..1e43c7c --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/JAMA/QRDecomposition.php @@ -0,0 +1,235 @@ +<?php +/** + * @package JAMA + * + * For an m-by-n matrix A with m >= n, the QR decomposition is an m-by-n + * orthogonal matrix Q and an n-by-n upper triangular matrix R so that + * A = Q*R. + * + * The QR decompostion always exists, even if the matrix does not have + * full rank, so the constructor will never fail. The primary use of the + * QR decomposition is in the least squares solution of nonsquare systems + * of simultaneous linear equations. This will fail if isFullRank() + * returns false. + * + * @author Paul Meagher + * @license PHP v3.0 + * @version 1.1 + */ +class PHPExcel_Shared_JAMA_QRDecomposition +{ + const MATRIX_RANK_EXCEPTION = "Can only perform operation on full-rank matrix."; + + /** + * Array for internal storage of decomposition. + * @var array + */ + private $QR = array(); + + /** + * Row dimension. + * @var integer + */ + private $m; + + /** + * Column dimension. + * @var integer + */ + private $n; + + /** + * Array for internal storage of diagonal of R. + * @var array + */ + private $Rdiag = array(); + + + /** + * QR Decomposition computed by Householder reflections. + * + * @param matrix $A Rectangular matrix + * @return Structure to access R and the Householder vectors and compute Q. + */ + public function __construct($A) + { + if ($A instanceof PHPExcel_Shared_JAMA_Matrix) { + // Initialize. + $this->QR = $A->getArrayCopy(); + $this->m = $A->getRowDimension(); + $this->n = $A->getColumnDimension(); + // Main loop. + for ($k = 0; $k < $this->n; ++$k) { + // Compute 2-norm of k-th column without under/overflow. + $nrm = 0.0; + for ($i = $k; $i < $this->m; ++$i) { + $nrm = hypo($nrm, $this->QR[$i][$k]); + } + if ($nrm != 0.0) { + // Form k-th Householder vector. + if ($this->QR[$k][$k] < 0) { + $nrm = -$nrm; + } + for ($i = $k; $i < $this->m; ++$i) { + $this->QR[$i][$k] /= $nrm; + } + $this->QR[$k][$k] += 1.0; + // Apply transformation to remaining columns. + for ($j = $k+1; $j < $this->n; ++$j) { + $s = 0.0; + for ($i = $k; $i < $this->m; ++$i) { + $s += $this->QR[$i][$k] * $this->QR[$i][$j]; + } + $s = -$s/$this->QR[$k][$k]; + for ($i = $k; $i < $this->m; ++$i) { + $this->QR[$i][$j] += $s * $this->QR[$i][$k]; + } + } + } + $this->Rdiag[$k] = -$nrm; + } + } else { + throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::ARGUMENT_TYPE_EXCEPTION); + } + } // function __construct() + + + /** + * Is the matrix full rank? + * + * @return boolean true if R, and hence A, has full rank, else false. + */ + public function isFullRank() + { + for ($j = 0; $j < $this->n; ++$j) { + if ($this->Rdiag[$j] == 0) { + return false; + } + } + return true; + } // function isFullRank() + + /** + * Return the Householder vectors + * + * @return Matrix Lower trapezoidal matrix whose columns define the reflections + */ + public function getH() + { + for ($i = 0; $i < $this->m; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + if ($i >= $j) { + $H[$i][$j] = $this->QR[$i][$j]; + } else { + $H[$i][$j] = 0.0; + } + } + } + return new PHPExcel_Shared_JAMA_Matrix($H); + } // function getH() + + /** + * Return the upper triangular factor + * + * @return Matrix upper triangular factor + */ + public function getR() + { + for ($i = 0; $i < $this->n; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + if ($i < $j) { + $R[$i][$j] = $this->QR[$i][$j]; + } elseif ($i == $j) { + $R[$i][$j] = $this->Rdiag[$i]; + } else { + $R[$i][$j] = 0.0; + } + } + } + return new PHPExcel_Shared_JAMA_Matrix($R); + } // function getR() + + /** + * Generate and return the (economy-sized) orthogonal factor + * + * @return Matrix orthogonal factor + */ + public function getQ() + { + for ($k = $this->n-1; $k >= 0; --$k) { + for ($i = 0; $i < $this->m; ++$i) { + $Q[$i][$k] = 0.0; + } + $Q[$k][$k] = 1.0; + for ($j = $k; $j < $this->n; ++$j) { + if ($this->QR[$k][$k] != 0) { + $s = 0.0; + for ($i = $k; $i < $this->m; ++$i) { + $s += $this->QR[$i][$k] * $Q[$i][$j]; + } + $s = -$s/$this->QR[$k][$k]; + for ($i = $k; $i < $this->m; ++$i) { + $Q[$i][$j] += $s * $this->QR[$i][$k]; + } + } + } + } + /* + for($i = 0; $i < count($Q); ++$i) { + for($j = 0; $j < count($Q); ++$j) { + if (! isset($Q[$i][$j]) ) { + $Q[$i][$j] = 0; + } + } + } + */ + return new PHPExcel_Shared_JAMA_Matrix($Q); + } // function getQ() + + /** + * Least squares solution of A*X = B + * + * @param Matrix $B A Matrix with as many rows as A and any number of columns. + * @return Matrix Matrix that minimizes the two norm of Q*R*X-B. + */ + public function solve($B) + { + if ($B->getRowDimension() == $this->m) { + if ($this->isFullRank()) { + // Copy right hand side + $nx = $B->getColumnDimension(); + $X = $B->getArrayCopy(); + // Compute Y = transpose(Q)*B + for ($k = 0; $k < $this->n; ++$k) { + for ($j = 0; $j < $nx; ++$j) { + $s = 0.0; + for ($i = $k; $i < $this->m; ++$i) { + $s += $this->QR[$i][$k] * $X[$i][$j]; + } + $s = -$s/$this->QR[$k][$k]; + for ($i = $k; $i < $this->m; ++$i) { + $X[$i][$j] += $s * $this->QR[$i][$k]; + } + } + } + // Solve R*X = Y; + for ($k = $this->n-1; $k >= 0; --$k) { + for ($j = 0; $j < $nx; ++$j) { + $X[$k][$j] /= $this->Rdiag[$k]; + } + for ($i = 0; $i < $k; ++$i) { + for ($j = 0; $j < $nx; ++$j) { + $X[$i][$j] -= $X[$k][$j]* $this->QR[$i][$k]; + } + } + } + $X = new PHPExcel_Shared_JAMA_Matrix($X); + return ($X->getMatrix(0, $this->n-1, 0, $nx)); + } else { + throw new PHPExcel_Calculation_Exception(self::MATRIX_RANK_EXCEPTION); + } + } else { + throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::MATRIX_DIMENSION_EXCEPTION); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/JAMA/SingularValueDecomposition.php b/extend/PHPExcel/PHPExcel/Shared/JAMA/SingularValueDecomposition.php new file mode 100644 index 0000000..f57d122 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/JAMA/SingularValueDecomposition.php @@ -0,0 +1,528 @@ +<?php +/** + * @package JAMA + * + * For an m-by-n matrix A with m >= n, the singular value decomposition is + * an m-by-n orthogonal matrix U, an n-by-n diagonal matrix S, and + * an n-by-n orthogonal matrix V so that A = U*S*V'. + * + * The singular values, sigma[$k] = S[$k][$k], are ordered so that + * sigma[0] >= sigma[1] >= ... >= sigma[n-1]. + * + * The singular value decompostion always exists, so the constructor will + * never fail. The matrix condition number and the effective numerical + * rank can be computed from this decomposition. + * + * @author Paul Meagher + * @license PHP v3.0 + * @version 1.1 + */ +class SingularValueDecomposition +{ + /** + * Internal storage of U. + * @var array + */ + private $U = array(); + + /** + * Internal storage of V. + * @var array + */ + private $V = array(); + + /** + * Internal storage of singular values. + * @var array + */ + private $s = array(); + + /** + * Row dimension. + * @var int + */ + private $m; + + /** + * Column dimension. + * @var int + */ + private $n; + + /** + * Construct the singular value decomposition + * + * Derived from LINPACK code. + * + * @param $A Rectangular matrix + * @return Structure to access U, S and V. + */ + public function __construct($Arg) + { + // Initialize. + $A = $Arg->getArrayCopy(); + $this->m = $Arg->getRowDimension(); + $this->n = $Arg->getColumnDimension(); + $nu = min($this->m, $this->n); + $e = array(); + $work = array(); + $wantu = true; + $wantv = true; + $nct = min($this->m - 1, $this->n); + $nrt = max(0, min($this->n - 2, $this->m)); + + // Reduce A to bidiagonal form, storing the diagonal elements + // in s and the super-diagonal elements in e. + for ($k = 0; $k < max($nct, $nrt); ++$k) { + if ($k < $nct) { + // Compute the transformation for the k-th column and + // place the k-th diagonal in s[$k]. + // Compute 2-norm of k-th column without under/overflow. + $this->s[$k] = 0; + for ($i = $k; $i < $this->m; ++$i) { + $this->s[$k] = hypo($this->s[$k], $A[$i][$k]); + } + if ($this->s[$k] != 0.0) { + if ($A[$k][$k] < 0.0) { + $this->s[$k] = -$this->s[$k]; + } + for ($i = $k; $i < $this->m; ++$i) { + $A[$i][$k] /= $this->s[$k]; + } + $A[$k][$k] += 1.0; + } + $this->s[$k] = -$this->s[$k]; + } + + for ($j = $k + 1; $j < $this->n; ++$j) { + if (($k < $nct) & ($this->s[$k] != 0.0)) { + // Apply the transformation. + $t = 0; + for ($i = $k; $i < $this->m; ++$i) { + $t += $A[$i][$k] * $A[$i][$j]; + } + $t = -$t / $A[$k][$k]; + for ($i = $k; $i < $this->m; ++$i) { + $A[$i][$j] += $t * $A[$i][$k]; + } + // Place the k-th row of A into e for the + // subsequent calculation of the row transformation. + $e[$j] = $A[$k][$j]; + } + } + + if ($wantu and ($k < $nct)) { + // Place the transformation in U for subsequent back + // multiplication. + for ($i = $k; $i < $this->m; ++$i) { + $this->U[$i][$k] = $A[$i][$k]; + } + } + + if ($k < $nrt) { + // Compute the k-th row transformation and place the + // k-th super-diagonal in e[$k]. + // Compute 2-norm without under/overflow. + $e[$k] = 0; + for ($i = $k + 1; $i < $this->n; ++$i) { + $e[$k] = hypo($e[$k], $e[$i]); + } + if ($e[$k] != 0.0) { + if ($e[$k+1] < 0.0) { + $e[$k] = -$e[$k]; + } + for ($i = $k + 1; $i < $this->n; ++$i) { + $e[$i] /= $e[$k]; + } + $e[$k+1] += 1.0; + } + $e[$k] = -$e[$k]; + if (($k+1 < $this->m) and ($e[$k] != 0.0)) { + // Apply the transformation. + for ($i = $k+1; $i < $this->m; ++$i) { + $work[$i] = 0.0; + } + for ($j = $k+1; $j < $this->n; ++$j) { + for ($i = $k+1; $i < $this->m; ++$i) { + $work[$i] += $e[$j] * $A[$i][$j]; + } + } + for ($j = $k + 1; $j < $this->n; ++$j) { + $t = -$e[$j] / $e[$k+1]; + for ($i = $k + 1; $i < $this->m; ++$i) { + $A[$i][$j] += $t * $work[$i]; + } + } + } + if ($wantv) { + // Place the transformation in V for subsequent + // back multiplication. + for ($i = $k + 1; $i < $this->n; ++$i) { + $this->V[$i][$k] = $e[$i]; + } + } + } + } + + // Set up the final bidiagonal matrix or order p. + $p = min($this->n, $this->m + 1); + if ($nct < $this->n) { + $this->s[$nct] = $A[$nct][$nct]; + } + if ($this->m < $p) { + $this->s[$p-1] = 0.0; + } + if ($nrt + 1 < $p) { + $e[$nrt] = $A[$nrt][$p-1]; + } + $e[$p-1] = 0.0; + // If required, generate U. + if ($wantu) { + for ($j = $nct; $j < $nu; ++$j) { + for ($i = 0; $i < $this->m; ++$i) { + $this->U[$i][$j] = 0.0; + } + $this->U[$j][$j] = 1.0; + } + for ($k = $nct - 1; $k >= 0; --$k) { + if ($this->s[$k] != 0.0) { + for ($j = $k + 1; $j < $nu; ++$j) { + $t = 0; + for ($i = $k; $i < $this->m; ++$i) { + $t += $this->U[$i][$k] * $this->U[$i][$j]; + } + $t = -$t / $this->U[$k][$k]; + for ($i = $k; $i < $this->m; ++$i) { + $this->U[$i][$j] += $t * $this->U[$i][$k]; + } + } + for ($i = $k; $i < $this->m; ++$i) { + $this->U[$i][$k] = -$this->U[$i][$k]; + } + $this->U[$k][$k] = 1.0 + $this->U[$k][$k]; + for ($i = 0; $i < $k - 1; ++$i) { + $this->U[$i][$k] = 0.0; + } + } else { + for ($i = 0; $i < $this->m; ++$i) { + $this->U[$i][$k] = 0.0; + } + $this->U[$k][$k] = 1.0; + } + } + } + + // If required, generate V. + if ($wantv) { + for ($k = $this->n - 1; $k >= 0; --$k) { + if (($k < $nrt) and ($e[$k] != 0.0)) { + for ($j = $k + 1; $j < $nu; ++$j) { + $t = 0; + for ($i = $k + 1; $i < $this->n; ++$i) { + $t += $this->V[$i][$k]* $this->V[$i][$j]; + } + $t = -$t / $this->V[$k+1][$k]; + for ($i = $k + 1; $i < $this->n; ++$i) { + $this->V[$i][$j] += $t * $this->V[$i][$k]; + } + } + } + for ($i = 0; $i < $this->n; ++$i) { + $this->V[$i][$k] = 0.0; + } + $this->V[$k][$k] = 1.0; + } + } + + // Main iteration loop for the singular values. + $pp = $p - 1; + $iter = 0; + $eps = pow(2.0, -52.0); + + while ($p > 0) { + // Here is where a test for too many iterations would go. + // This section of the program inspects for negligible + // elements in the s and e arrays. On completion the + // variables kase and k are set as follows: + // kase = 1 if s(p) and e[k-1] are negligible and k<p + // kase = 2 if s(k) is negligible and k<p + // kase = 3 if e[k-1] is negligible, k<p, and + // s(k), ..., s(p) are not negligible (qr step). + // kase = 4 if e(p-1) is negligible (convergence). + for ($k = $p - 2; $k >= -1; --$k) { + if ($k == -1) { + break; + } + if (abs($e[$k]) <= $eps * (abs($this->s[$k]) + abs($this->s[$k+1]))) { + $e[$k] = 0.0; + break; + } + } + if ($k == $p - 2) { + $kase = 4; + } else { + for ($ks = $p - 1; $ks >= $k; --$ks) { + if ($ks == $k) { + break; + } + $t = ($ks != $p ? abs($e[$ks]) : 0.) + ($ks != $k + 1 ? abs($e[$ks-1]) : 0.); + if (abs($this->s[$ks]) <= $eps * $t) { + $this->s[$ks] = 0.0; + break; + } + } + if ($ks == $k) { + $kase = 3; + } elseif ($ks == $p-1) { + $kase = 1; + } else { + $kase = 2; + $k = $ks; + } + } + ++$k; + + // Perform the task indicated by kase. + switch ($kase) { + // Deflate negligible s(p). + case 1: + $f = $e[$p-2]; + $e[$p-2] = 0.0; + for ($j = $p - 2; $j >= $k; --$j) { + $t = hypo($this->s[$j], $f); + $cs = $this->s[$j] / $t; + $sn = $f / $t; + $this->s[$j] = $t; + if ($j != $k) { + $f = -$sn * $e[$j-1]; + $e[$j-1] = $cs * $e[$j-1]; + } + if ($wantv) { + for ($i = 0; $i < $this->n; ++$i) { + $t = $cs * $this->V[$i][$j] + $sn * $this->V[$i][$p-1]; + $this->V[$i][$p-1] = -$sn * $this->V[$i][$j] + $cs * $this->V[$i][$p-1]; + $this->V[$i][$j] = $t; + } + } + } + break; + // Split at negligible s(k). + case 2: + $f = $e[$k-1]; + $e[$k-1] = 0.0; + for ($j = $k; $j < $p; ++$j) { + $t = hypo($this->s[$j], $f); + $cs = $this->s[$j] / $t; + $sn = $f / $t; + $this->s[$j] = $t; + $f = -$sn * $e[$j]; + $e[$j] = $cs * $e[$j]; + if ($wantu) { + for ($i = 0; $i < $this->m; ++$i) { + $t = $cs * $this->U[$i][$j] + $sn * $this->U[$i][$k-1]; + $this->U[$i][$k-1] = -$sn * $this->U[$i][$j] + $cs * $this->U[$i][$k-1]; + $this->U[$i][$j] = $t; + } + } + } + break; + // Perform one qr step. + case 3: + // Calculate the shift. + $scale = max(max(max(max(abs($this->s[$p-1]), abs($this->s[$p-2])), abs($e[$p-2])), abs($this->s[$k])), abs($e[$k])); + $sp = $this->s[$p-1] / $scale; + $spm1 = $this->s[$p-2] / $scale; + $epm1 = $e[$p-2] / $scale; + $sk = $this->s[$k] / $scale; + $ek = $e[$k] / $scale; + $b = (($spm1 + $sp) * ($spm1 - $sp) + $epm1 * $epm1) / 2.0; + $c = ($sp * $epm1) * ($sp * $epm1); + $shift = 0.0; + if (($b != 0.0) || ($c != 0.0)) { + $shift = sqrt($b * $b + $c); + if ($b < 0.0) { + $shift = -$shift; + } + $shift = $c / ($b + $shift); + } + $f = ($sk + $sp) * ($sk - $sp) + $shift; + $g = $sk * $ek; + // Chase zeros. + for ($j = $k; $j < $p-1; ++$j) { + $t = hypo($f, $g); + $cs = $f/$t; + $sn = $g/$t; + if ($j != $k) { + $e[$j-1] = $t; + } + $f = $cs * $this->s[$j] + $sn * $e[$j]; + $e[$j] = $cs * $e[$j] - $sn * $this->s[$j]; + $g = $sn * $this->s[$j+1]; + $this->s[$j+1] = $cs * $this->s[$j+1]; + if ($wantv) { + for ($i = 0; $i < $this->n; ++$i) { + $t = $cs * $this->V[$i][$j] + $sn * $this->V[$i][$j+1]; + $this->V[$i][$j+1] = -$sn * $this->V[$i][$j] + $cs * $this->V[$i][$j+1]; + $this->V[$i][$j] = $t; + } + } + $t = hypo($f, $g); + $cs = $f/$t; + $sn = $g/$t; + $this->s[$j] = $t; + $f = $cs * $e[$j] + $sn * $this->s[$j+1]; + $this->s[$j+1] = -$sn * $e[$j] + $cs * $this->s[$j+1]; + $g = $sn * $e[$j+1]; + $e[$j+1] = $cs * $e[$j+1]; + if ($wantu && ($j < $this->m - 1)) { + for ($i = 0; $i < $this->m; ++$i) { + $t = $cs * $this->U[$i][$j] + $sn * $this->U[$i][$j+1]; + $this->U[$i][$j+1] = -$sn * $this->U[$i][$j] + $cs * $this->U[$i][$j+1]; + $this->U[$i][$j] = $t; + } + } + } + $e[$p-2] = $f; + $iter = $iter + 1; + break; + // Convergence. + case 4: + // Make the singular values positive. + if ($this->s[$k] <= 0.0) { + $this->s[$k] = ($this->s[$k] < 0.0 ? -$this->s[$k] : 0.0); + if ($wantv) { + for ($i = 0; $i <= $pp; ++$i) { + $this->V[$i][$k] = -$this->V[$i][$k]; + } + } + } + // Order the singular values. + while ($k < $pp) { + if ($this->s[$k] >= $this->s[$k+1]) { + break; + } + $t = $this->s[$k]; + $this->s[$k] = $this->s[$k+1]; + $this->s[$k+1] = $t; + if ($wantv and ($k < $this->n - 1)) { + for ($i = 0; $i < $this->n; ++$i) { + $t = $this->V[$i][$k+1]; + $this->V[$i][$k+1] = $this->V[$i][$k]; + $this->V[$i][$k] = $t; + } + } + if ($wantu and ($k < $this->m-1)) { + for ($i = 0; $i < $this->m; ++$i) { + $t = $this->U[$i][$k+1]; + $this->U[$i][$k+1] = $this->U[$i][$k]; + $this->U[$i][$k] = $t; + } + } + ++$k; + } + $iter = 0; + --$p; + break; + } // end switch + } // end while + + } // end constructor + + + /** + * Return the left singular vectors + * + * @access public + * @return U + */ + public function getU() + { + return new Matrix($this->U, $this->m, min($this->m + 1, $this->n)); + } + + + /** + * Return the right singular vectors + * + * @access public + * @return V + */ + public function getV() + { + return new Matrix($this->V); + } + + + /** + * Return the one-dimensional array of singular values + * + * @access public + * @return diagonal of S. + */ + public function getSingularValues() + { + return $this->s; + } + + + /** + * Return the diagonal matrix of singular values + * + * @access public + * @return S + */ + public function getS() + { + for ($i = 0; $i < $this->n; ++$i) { + for ($j = 0; $j < $this->n; ++$j) { + $S[$i][$j] = 0.0; + } + $S[$i][$i] = $this->s[$i]; + } + return new Matrix($S); + } + + + /** + * Two norm + * + * @access public + * @return max(S) + */ + public function norm2() + { + return $this->s[0]; + } + + + /** + * Two norm condition number + * + * @access public + * @return max(S)/min(S) + */ + public function cond() + { + return $this->s[0] / $this->s[min($this->m, $this->n) - 1]; + } + + + /** + * Effective numerical matrix rank + * + * @access public + * @return Number of nonnegligible singular values. + */ + public function rank() + { + $eps = pow(2.0, -52.0); + $tol = max($this->m, $this->n) * $this->s[0] * $eps; + $r = 0; + for ($i = 0; $i < count($this->s); ++$i) { + if ($this->s[$i] > $tol) { + ++$r; + } + } + return $r; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/JAMA/utils/Error.php b/extend/PHPExcel/PHPExcel/Shared/JAMA/utils/Error.php new file mode 100644 index 0000000..71b8c99 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/JAMA/utils/Error.php @@ -0,0 +1,83 @@ +<?php +/** + * @package JAMA + * + * Error handling + * @author Michael Bommarito + * @version 01292005 + */ + +//Language constant +define('JAMALANG', 'EN'); + + +//All errors may be defined by the following format: +//define('ExceptionName', N); +//$error['lang'][ExceptionName] = 'Error message'; +$error = array(); + +/* +I've used Babelfish and a little poor knowledge of Romance/Germanic languages for the translations here. +Feel free to correct anything that looks amiss to you. +*/ + +define('POLYMORPHIC_ARGUMENT_EXCEPTION', -1); +$error['EN'][POLYMORPHIC_ARGUMENT_EXCEPTION] = "Invalid argument pattern for polymorphic function."; +$error['FR'][POLYMORPHIC_ARGUMENT_EXCEPTION] = "Modèle inadmissible d'argument pour la fonction polymorphe.". +$error['DE'][POLYMORPHIC_ARGUMENT_EXCEPTION] = "Unzulässiges Argumentmuster für polymorphe Funktion."; + +define('ARGUMENT_TYPE_EXCEPTION', -2); +$error['EN'][ARGUMENT_TYPE_EXCEPTION] = "Invalid argument type."; +$error['FR'][ARGUMENT_TYPE_EXCEPTION] = "Type inadmissible d'argument."; +$error['DE'][ARGUMENT_TYPE_EXCEPTION] = "Unzulässige Argumentart."; + +define('ARGUMENT_BOUNDS_EXCEPTION', -3); +$error['EN'][ARGUMENT_BOUNDS_EXCEPTION] = "Invalid argument range."; +$error['FR'][ARGUMENT_BOUNDS_EXCEPTION] = "Gamme inadmissible d'argument."; +$error['DE'][ARGUMENT_BOUNDS_EXCEPTION] = "Unzulässige Argumentstrecke."; + +define('MATRIX_DIMENSION_EXCEPTION', -4); +$error['EN'][MATRIX_DIMENSION_EXCEPTION] = "Matrix dimensions are not equal."; +$error['FR'][MATRIX_DIMENSION_EXCEPTION] = "Les dimensions de Matrix ne sont pas égales."; +$error['DE'][MATRIX_DIMENSION_EXCEPTION] = "Matrixmaße sind nicht gleich."; + +define('PRECISION_LOSS_EXCEPTION', -5); +$error['EN'][PRECISION_LOSS_EXCEPTION] = "Significant precision loss detected."; +$error['FR'][PRECISION_LOSS_EXCEPTION] = "Perte significative de précision détectée."; +$error['DE'][PRECISION_LOSS_EXCEPTION] = "Bedeutender Präzision Verlust ermittelte."; + +define('MATRIX_SPD_EXCEPTION', -6); +$error['EN'][MATRIX_SPD_EXCEPTION] = "Can only perform operation on symmetric positive definite matrix."; +$error['FR'][MATRIX_SPD_EXCEPTION] = "Perte significative de précision détectée."; +$error['DE'][MATRIX_SPD_EXCEPTION] = "Bedeutender Präzision Verlust ermittelte."; + +define('MATRIX_SINGULAR_EXCEPTION', -7); +$error['EN'][MATRIX_SINGULAR_EXCEPTION] = "Can only perform operation on singular matrix."; + +define('MATRIX_RANK_EXCEPTION', -8); +$error['EN'][MATRIX_RANK_EXCEPTION] = "Can only perform operation on full-rank matrix."; + +define('ARRAY_LENGTH_EXCEPTION', -9); +$error['EN'][ARRAY_LENGTH_EXCEPTION] = "Array length must be a multiple of m."; + +define('ROW_LENGTH_EXCEPTION', -10); +$error['EN'][ROW_LENGTH_EXCEPTION] = "All rows must have the same length."; + +/** + * Custom error handler + * @param int $num Error number + */ +function JAMAError($errorNumber = null) +{ + global $error; + + if (isset($errorNumber)) { + if (isset($error[JAMALANG][$errorNumber])) { + return $error[JAMALANG][$errorNumber]; + } else { + return $error['EN'][$errorNumber]; + } + } else { + return ("Invalid argument to JAMAError()"); + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/JAMA/utils/Maths.php b/extend/PHPExcel/PHPExcel/Shared/JAMA/utils/Maths.php new file mode 100644 index 0000000..386c1e6 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/JAMA/utils/Maths.php @@ -0,0 +1,44 @@ +<?php +/** + * @package JAMA + * + * Pythagorean Theorem: + * + * a = 3 + * b = 4 + * r = sqrt(square(a) + square(b)) + * r = 5 + * + * r = sqrt(a^2 + b^2) without under/overflow. + */ +function hypo($a, $b) +{ + if (abs($a) > abs($b)) { + $r = $b / $a; + $r = abs($a) * sqrt(1 + $r * $r); + } elseif ($b != 0) { + $r = $a / $b; + $r = abs($b) * sqrt(1 + $r * $r); + } else { + $r = 0.0; + } + return $r; +} // function hypo() + + +/** + * Mike Bommarito's version. + * Compute n-dimensional hyotheneuse. + * +function hypot() { + $s = 0; + foreach (func_get_args() as $d) { + if (is_numeric($d)) { + $s += pow($d, 2); + } else { + throw new PHPExcel_Calculation_Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION)); + } + } + return sqrt($s); +} +*/ diff --git a/extend/PHPExcel/PHPExcel/Shared/OLE.php b/extend/PHPExcel/PHPExcel/Shared/OLE.php new file mode 100644 index 0000000..42a3c52 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/OLE.php @@ -0,0 +1,526 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +// +----------------------------------------------------------------------+ +// | PHP Version 4 | +// +----------------------------------------------------------------------+ +// | Copyright (c) 1997-2002 The PHP Group | +// +----------------------------------------------------------------------+ +// | This source file is subject to version 2.02 of the PHP license, | +// | that is bundled with this package in the file LICENSE, and is | +// | available at through the world-wide-web at | +// | http://www.php.net/license/2_02.txt. | +// | If you did not receive a copy of the PHP license and are unable to | +// | obtain it through the world-wide-web, please send a note to | +// | license@php.net so we can mail you a copy immediately. | +// +----------------------------------------------------------------------+ +// | Author: Xavier Noguer <xnoguer@php.net> | +// | Based on OLE::Storage_Lite by Kawai, Takanori | +// +----------------------------------------------------------------------+ +// +// $Id: OLE.php,v 1.13 2007/03/07 14:38:25 schmidt Exp $ + + +/** +* Array for storing OLE instances that are accessed from +* OLE_ChainedBlockStream::stream_open(). +* @var array +*/ +$GLOBALS['_OLE_INSTANCES'] = array(); + +/** +* OLE package base class. +* +* @author Xavier Noguer <xnoguer@php.net> +* @author Christian Schmidt <schmidt@php.net> +* @category PHPExcel +* @package PHPExcel_Shared_OLE +*/ +class PHPExcel_Shared_OLE +{ + const OLE_PPS_TYPE_ROOT = 5; + const OLE_PPS_TYPE_DIR = 1; + const OLE_PPS_TYPE_FILE = 2; + const OLE_DATA_SIZE_SMALL = 0x1000; + const OLE_LONG_INT_SIZE = 4; + const OLE_PPS_SIZE = 0x80; + + /** + * The file handle for reading an OLE container + * @var resource + */ + public $_file_handle; + + /** + * Array of PPS's found on the OLE container + * @var array + */ + public $_list = array(); + + /** + * Root directory of OLE container + * @var OLE_PPS_Root + */ + public $root; + + /** + * Big Block Allocation Table + * @var array (blockId => nextBlockId) + */ + public $bbat; + + /** + * Short Block Allocation Table + * @var array (blockId => nextBlockId) + */ + public $sbat; + + /** + * Size of big blocks. This is usually 512. + * @var int number of octets per block. + */ + public $bigBlockSize; + + /** + * Size of small blocks. This is usually 64. + * @var int number of octets per block + */ + public $smallBlockSize; + + /** + * Reads an OLE container from the contents of the file given. + * + * @acces public + * @param string $file + * @return mixed true on success, PEAR_Error on failure + */ + public function read($file) + { + $fh = fopen($file, "r"); + if (!$fh) { + throw new PHPExcel_Reader_Exception("Can't open file $file"); + } + $this->_file_handle = $fh; + + $signature = fread($fh, 8); + if ("\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1" != $signature) { + throw new PHPExcel_Reader_Exception("File doesn't seem to be an OLE container."); + } + fseek($fh, 28); + if (fread($fh, 2) != "\xFE\xFF") { + // This shouldn't be a problem in practice + throw new PHPExcel_Reader_Exception("Only Little-Endian encoding is supported."); + } + // Size of blocks and short blocks in bytes + $this->bigBlockSize = pow(2, self::_readInt2($fh)); + $this->smallBlockSize = pow(2, self::_readInt2($fh)); + + // Skip UID, revision number and version number + fseek($fh, 44); + // Number of blocks in Big Block Allocation Table + $bbatBlockCount = self::_readInt4($fh); + + // Root chain 1st block + $directoryFirstBlockId = self::_readInt4($fh); + + // Skip unused bytes + fseek($fh, 56); + // Streams shorter than this are stored using small blocks + $this->bigBlockThreshold = self::_readInt4($fh); + // Block id of first sector in Short Block Allocation Table + $sbatFirstBlockId = self::_readInt4($fh); + // Number of blocks in Short Block Allocation Table + $sbbatBlockCount = self::_readInt4($fh); + // Block id of first sector in Master Block Allocation Table + $mbatFirstBlockId = self::_readInt4($fh); + // Number of blocks in Master Block Allocation Table + $mbbatBlockCount = self::_readInt4($fh); + $this->bbat = array(); + + // Remaining 4 * 109 bytes of current block is beginning of Master + // Block Allocation Table + $mbatBlocks = array(); + for ($i = 0; $i < 109; ++$i) { + $mbatBlocks[] = self::_readInt4($fh); + } + + // Read rest of Master Block Allocation Table (if any is left) + $pos = $this->_getBlockOffset($mbatFirstBlockId); + for ($i = 0; $i < $mbbatBlockCount; ++$i) { + fseek($fh, $pos); + for ($j = 0; $j < $this->bigBlockSize / 4 - 1; ++$j) { + $mbatBlocks[] = self::_readInt4($fh); + } + // Last block id in each block points to next block + $pos = $this->_getBlockOffset(self::_readInt4($fh)); + } + + // Read Big Block Allocation Table according to chain specified by + // $mbatBlocks + for ($i = 0; $i < $bbatBlockCount; ++$i) { + $pos = $this->_getBlockOffset($mbatBlocks[$i]); + fseek($fh, $pos); + for ($j = 0; $j < $this->bigBlockSize / 4; ++$j) { + $this->bbat[] = self::_readInt4($fh); + } + } + + // Read short block allocation table (SBAT) + $this->sbat = array(); + $shortBlockCount = $sbbatBlockCount * $this->bigBlockSize / 4; + $sbatFh = $this->getStream($sbatFirstBlockId); + for ($blockId = 0; $blockId < $shortBlockCount; ++$blockId) { + $this->sbat[$blockId] = self::_readInt4($sbatFh); + } + fclose($sbatFh); + + $this->_readPpsWks($directoryFirstBlockId); + + return true; + } + + /** + * @param int block id + * @param int byte offset from beginning of file + * @access public + */ + public function _getBlockOffset($blockId) + { + return 512 + $blockId * $this->bigBlockSize; + } + + /** + * Returns a stream for use with fread() etc. External callers should + * use PHPExcel_Shared_OLE_PPS_File::getStream(). + * @param int|PPS block id or PPS + * @return resource read-only stream + */ + public function getStream($blockIdOrPps) + { + static $isRegistered = false; + if (!$isRegistered) { + stream_wrapper_register('ole-chainedblockstream', 'PHPExcel_Shared_OLE_ChainedBlockStream'); + $isRegistered = true; + } + + // Store current instance in global array, so that it can be accessed + // in OLE_ChainedBlockStream::stream_open(). + // Object is removed from self::$instances in OLE_Stream::close(). + $GLOBALS['_OLE_INSTANCES'][] = $this; + $instanceId = end(array_keys($GLOBALS['_OLE_INSTANCES'])); + + $path = 'ole-chainedblockstream://oleInstanceId=' . $instanceId; + if ($blockIdOrPps instanceof PHPExcel_Shared_OLE_PPS) { + $path .= '&blockId=' . $blockIdOrPps->_StartBlock; + $path .= '&size=' . $blockIdOrPps->Size; + } else { + $path .= '&blockId=' . $blockIdOrPps; + } + return fopen($path, 'r'); + } + + /** + * Reads a signed char. + * @param resource file handle + * @return int + * @access public + */ + private static function _readInt1($fh) + { + list(, $tmp) = unpack("c", fread($fh, 1)); + return $tmp; + } + + /** + * Reads an unsigned short (2 octets). + * @param resource file handle + * @return int + * @access public + */ + private static function _readInt2($fh) + { + list(, $tmp) = unpack("v", fread($fh, 2)); + return $tmp; + } + + /** + * Reads an unsigned long (4 octets). + * @param resource file handle + * @return int + * @access public + */ + private static function _readInt4($fh) + { + list(, $tmp) = unpack("V", fread($fh, 4)); + return $tmp; + } + + /** + * Gets information about all PPS's on the OLE container from the PPS WK's + * creates an OLE_PPS object for each one. + * + * @access public + * @param integer the block id of the first block + * @return mixed true on success, PEAR_Error on failure + */ + public function _readPpsWks($blockId) + { + $fh = $this->getStream($blockId); + for ($pos = 0;; $pos += 128) { + fseek($fh, $pos, SEEK_SET); + $nameUtf16 = fread($fh, 64); + $nameLength = self::_readInt2($fh); + $nameUtf16 = substr($nameUtf16, 0, $nameLength - 2); + // Simple conversion from UTF-16LE to ISO-8859-1 + $name = str_replace("\x00", "", $nameUtf16); + $type = self::_readInt1($fh); + switch ($type) { + case self::OLE_PPS_TYPE_ROOT: + $pps = new PHPExcel_Shared_OLE_PPS_Root(null, null, array()); + $this->root = $pps; + break; + case self::OLE_PPS_TYPE_DIR: + $pps = new PHPExcel_Shared_OLE_PPS(null, null, null, null, null, null, null, null, null, array()); + break; + case self::OLE_PPS_TYPE_FILE: + $pps = new PHPExcel_Shared_OLE_PPS_File($name); + break; + default: + continue; + } + fseek($fh, 1, SEEK_CUR); + $pps->Type = $type; + $pps->Name = $name; + $pps->PrevPps = self::_readInt4($fh); + $pps->NextPps = self::_readInt4($fh); + $pps->DirPps = self::_readInt4($fh); + fseek($fh, 20, SEEK_CUR); + $pps->Time1st = self::OLE2LocalDate(fread($fh, 8)); + $pps->Time2nd = self::OLE2LocalDate(fread($fh, 8)); + $pps->_StartBlock = self::_readInt4($fh); + $pps->Size = self::_readInt4($fh); + $pps->No = count($this->_list); + $this->_list[] = $pps; + + // check if the PPS tree (starting from root) is complete + if (isset($this->root) && $this->_ppsTreeComplete($this->root->No)) { + break; + } + } + fclose($fh); + + // Initialize $pps->children on directories + foreach ($this->_list as $pps) { + if ($pps->Type == self::OLE_PPS_TYPE_DIR || $pps->Type == self::OLE_PPS_TYPE_ROOT) { + $nos = array($pps->DirPps); + $pps->children = array(); + while ($nos) { + $no = array_pop($nos); + if ($no != -1) { + $childPps = $this->_list[$no]; + $nos[] = $childPps->PrevPps; + $nos[] = $childPps->NextPps; + $pps->children[] = $childPps; + } + } + } + } + + return true; + } + + /** + * It checks whether the PPS tree is complete (all PPS's read) + * starting with the given PPS (not necessarily root) + * + * @access public + * @param integer $index The index of the PPS from which we are checking + * @return boolean Whether the PPS tree for the given PPS is complete + */ + public function _ppsTreeComplete($index) + { + return isset($this->_list[$index]) && + ($pps = $this->_list[$index]) && + ($pps->PrevPps == -1 || + $this->_ppsTreeComplete($pps->PrevPps)) && + ($pps->NextPps == -1 || + $this->_ppsTreeComplete($pps->NextPps)) && + ($pps->DirPps == -1 || + $this->_ppsTreeComplete($pps->DirPps)); + } + + /** + * Checks whether a PPS is a File PPS or not. + * If there is no PPS for the index given, it will return false. + * + * @access public + * @param integer $index The index for the PPS + * @return bool true if it's a File PPS, false otherwise + */ + public function isFile($index) + { + if (isset($this->_list[$index])) { + return ($this->_list[$index]->Type == self::OLE_PPS_TYPE_FILE); + } + return false; + } + + /** + * Checks whether a PPS is a Root PPS or not. + * If there is no PPS for the index given, it will return false. + * + * @access public + * @param integer $index The index for the PPS. + * @return bool true if it's a Root PPS, false otherwise + */ + public function isRoot($index) + { + if (isset($this->_list[$index])) { + return ($this->_list[$index]->Type == self::OLE_PPS_TYPE_ROOT); + } + return false; + } + + /** + * Gives the total number of PPS's found in the OLE container. + * + * @access public + * @return integer The total number of PPS's found in the OLE container + */ + public function ppsTotal() + { + return count($this->_list); + } + + /** + * Gets data from a PPS + * If there is no PPS for the index given, it will return an empty string. + * + * @access public + * @param integer $index The index for the PPS + * @param integer $position The position from which to start reading + * (relative to the PPS) + * @param integer $length The amount of bytes to read (at most) + * @return string The binary string containing the data requested + * @see OLE_PPS_File::getStream() + */ + public function getData($index, $position, $length) + { + // if position is not valid return empty string + if (!isset($this->_list[$index]) || ($position >= $this->_list[$index]->Size) || ($position < 0)) { + return ''; + } + $fh = $this->getStream($this->_list[$index]); + $data = stream_get_contents($fh, $length, $position); + fclose($fh); + return $data; + } + + /** + * Gets the data length from a PPS + * If there is no PPS for the index given, it will return 0. + * + * @access public + * @param integer $index The index for the PPS + * @return integer The amount of bytes in data the PPS has + */ + public function getDataLength($index) + { + if (isset($this->_list[$index])) { + return $this->_list[$index]->Size; + } + return 0; + } + + /** + * Utility function to transform ASCII text to Unicode + * + * @access public + * @static + * @param string $ascii The ASCII string to transform + * @return string The string in Unicode + */ + public static function Asc2Ucs($ascii) + { + $rawname = ''; + for ($i = 0; $i < strlen($ascii); ++$i) { + $rawname .= $ascii{$i} . "\x00"; + } + return $rawname; + } + + /** + * Utility function + * Returns a string for the OLE container with the date given + * + * @access public + * @static + * @param integer $date A timestamp + * @return string The string for the OLE container + */ + public static function LocalDate2OLE($date = null) + { + if (!isset($date)) { + return "\x00\x00\x00\x00\x00\x00\x00\x00"; + } + + // factor used for separating numbers into 4 bytes parts + $factor = pow(2, 32); + + // days from 1-1-1601 until the beggining of UNIX era + $days = 134774; + // calculate seconds + $big_date = $days*24*3600 + gmmktime(date("H", $date), date("i", $date), date("s", $date), date("m", $date), date("d", $date), date("Y", $date)); + // multiply just to make MS happy + $big_date *= 10000000; + + $high_part = floor($big_date / $factor); + // lower 4 bytes + $low_part = floor((($big_date / $factor) - $high_part) * $factor); + + // Make HEX string + $res = ''; + + for ($i = 0; $i < 4; ++$i) { + $hex = $low_part % 0x100; + $res .= pack('c', $hex); + $low_part /= 0x100; + } + for ($i = 0; $i < 4; ++$i) { + $hex = $high_part % 0x100; + $res .= pack('c', $hex); + $high_part /= 0x100; + } + return $res; + } + + /** + * Returns a timestamp from an OLE container's date + * + * @access public + * @static + * @param integer $string A binary string with the encoded date + * @return string The timestamp corresponding to the string + */ + public static function OLE2LocalDate($string) + { + if (strlen($string) != 8) { + return new PEAR_Error("Expecting 8 byte string"); + } + + // factor used for separating numbers into 4 bytes parts + $factor = pow(2, 32); + list(, $high_part) = unpack('V', substr($string, 4, 4)); + list(, $low_part) = unpack('V', substr($string, 0, 4)); + + $big_date = ($high_part * $factor) + $low_part; + // translate to seconds + $big_date /= 10000000; + + // days from 1-1-1601 until the beggining of UNIX era + $days = 134774; + + // translate to seconds from beggining of UNIX era + $big_date -= $days * 24 * 3600; + return floor($big_date); + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/OLE/ChainedBlockStream.php b/extend/PHPExcel/PHPExcel/Shared/OLE/ChainedBlockStream.php new file mode 100644 index 0000000..84d2cc5 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/OLE/ChainedBlockStream.php @@ -0,0 +1,206 @@ +<?php + +/** + * PHPExcel_Shared_OLE_ChainedBlockStream + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_OLE + * @copyright Copyright (c) 2006 - 2007 Christian Schmidt + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_OLE_ChainedBlockStream +{ + /** + * The OLE container of the file that is being read. + * @var OLE + */ + public $ole; + + /** + * Parameters specified by fopen(). + * @var array + */ + public $params; + + /** + * The binary data of the file. + * @var string + */ + public $data; + + /** + * The file pointer. + * @var int byte offset + */ + public $pos; + + /** + * Implements support for fopen(). + * For creating streams using this wrapper, use OLE_PPS_File::getStream(). + * + * @param string $path resource name including scheme, e.g. + * ole-chainedblockstream://oleInstanceId=1 + * @param string $mode only "r" is supported + * @param int $options mask of STREAM_REPORT_ERRORS and STREAM_USE_PATH + * @param string &$openedPath absolute path of the opened stream (out parameter) + * @return bool true on success + */ + public function stream_open($path, $mode, $options, &$openedPath) + { + if ($mode != 'r') { + if ($options & STREAM_REPORT_ERRORS) { + trigger_error('Only reading is supported', E_USER_WARNING); + } + return false; + } + + // 25 is length of "ole-chainedblockstream://" + parse_str(substr($path, 25), $this->params); + if (!isset($this->params['oleInstanceId'], $this->params['blockId'], $GLOBALS['_OLE_INSTANCES'][$this->params['oleInstanceId']])) { + if ($options & STREAM_REPORT_ERRORS) { + trigger_error('OLE stream not found', E_USER_WARNING); + } + return false; + } + $this->ole = $GLOBALS['_OLE_INSTANCES'][$this->params['oleInstanceId']]; + + $blockId = $this->params['blockId']; + $this->data = ''; + if (isset($this->params['size']) && $this->params['size'] < $this->ole->bigBlockThreshold && $blockId != $this->ole->root->_StartBlock) { + // Block id refers to small blocks + $rootPos = $this->ole->_getBlockOffset($this->ole->root->_StartBlock); + while ($blockId != -2) { + $pos = $rootPos + $blockId * $this->ole->bigBlockSize; + $blockId = $this->ole->sbat[$blockId]; + fseek($this->ole->_file_handle, $pos); + $this->data .= fread($this->ole->_file_handle, $this->ole->bigBlockSize); + } + } else { + // Block id refers to big blocks + while ($blockId != -2) { + $pos = $this->ole->_getBlockOffset($blockId); + fseek($this->ole->_file_handle, $pos); + $this->data .= fread($this->ole->_file_handle, $this->ole->bigBlockSize); + $blockId = $this->ole->bbat[$blockId]; + } + } + if (isset($this->params['size'])) { + $this->data = substr($this->data, 0, $this->params['size']); + } + + if ($options & STREAM_USE_PATH) { + $openedPath = $path; + } + + return true; + } + + /** + * Implements support for fclose(). + * + */ + public function stream_close() + { + $this->ole = null; + unset($GLOBALS['_OLE_INSTANCES']); + } + + /** + * Implements support for fread(), fgets() etc. + * + * @param int $count maximum number of bytes to read + * @return string + */ + public function stream_read($count) + { + if ($this->stream_eof()) { + return false; + } + $s = substr($this->data, $this->pos, $count); + $this->pos += $count; + return $s; + } + + /** + * Implements support for feof(). + * + * @return bool TRUE if the file pointer is at EOF; otherwise FALSE + */ + public function stream_eof() + { + return $this->pos >= strlen($this->data); + } + + /** + * Returns the position of the file pointer, i.e. its offset into the file + * stream. Implements support for ftell(). + * + * @return int + */ + public function stream_tell() + { + return $this->pos; + } + + /** + * Implements support for fseek(). + * + * @param int $offset byte offset + * @param int $whence SEEK_SET, SEEK_CUR or SEEK_END + * @return bool + */ + public function stream_seek($offset, $whence) + { + if ($whence == SEEK_SET && $offset >= 0) { + $this->pos = $offset; + } elseif ($whence == SEEK_CUR && -$offset <= $this->pos) { + $this->pos += $offset; + } elseif ($whence == SEEK_END && -$offset <= sizeof($this->data)) { + $this->pos = strlen($this->data) + $offset; + } else { + return false; + } + return true; + } + + /** + * Implements support for fstat(). Currently the only supported field is + * "size". + * @return array + */ + public function stream_stat() + { + return array( + 'size' => strlen($this->data), + ); + } + + // Methods used by stream_wrapper_register() that are not implemented: + // bool stream_flush ( void ) + // int stream_write ( string data ) + // bool rename ( string path_from, string path_to ) + // bool mkdir ( string path, int mode, int options ) + // bool rmdir ( string path, int options ) + // bool dir_opendir ( string path, int options ) + // array url_stat ( string path, int flags ) + // string dir_readdir ( void ) + // bool dir_rewinddir ( void ) + // bool dir_closedir ( void ) +} diff --git a/extend/PHPExcel/PHPExcel/Shared/OLE/PPS.php b/extend/PHPExcel/PHPExcel/Shared/OLE/PPS.php new file mode 100644 index 0000000..608a892 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/OLE/PPS.php @@ -0,0 +1,230 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +// +----------------------------------------------------------------------+ +// | PHP Version 4 | +// +----------------------------------------------------------------------+ +// | Copyright (c) 1997-2002 The PHP Group | +// +----------------------------------------------------------------------+ +// | This source file is subject to version 2.02 of the PHP license, | +// | that is bundled with this package in the file LICENSE, and is | +// | available at through the world-wide-web at | +// | http://www.php.net/license/2_02.txt. | +// | If you did not receive a copy of the PHP license and are unable to | +// | obtain it through the world-wide-web, please send a note to | +// | license@php.net so we can mail you a copy immediately. | +// +----------------------------------------------------------------------+ +// | Author: Xavier Noguer <xnoguer@php.net> | +// | Based on OLE::Storage_Lite by Kawai, Takanori | +// +----------------------------------------------------------------------+ +// +// $Id: PPS.php,v 1.7 2007/02/13 21:00:42 schmidt Exp $ + + +/** +* Class for creating PPS's for OLE containers +* +* @author Xavier Noguer <xnoguer@php.net> +* @category PHPExcel +* @package PHPExcel_Shared_OLE +*/ +class PHPExcel_Shared_OLE_PPS +{ + /** + * The PPS index + * @var integer + */ + public $No; + + /** + * The PPS name (in Unicode) + * @var string + */ + public $Name; + + /** + * The PPS type. Dir, Root or File + * @var integer + */ + public $Type; + + /** + * The index of the previous PPS + * @var integer + */ + public $PrevPps; + + /** + * The index of the next PPS + * @var integer + */ + public $NextPps; + + /** + * The index of it's first child if this is a Dir or Root PPS + * @var integer + */ + public $DirPps; + + /** + * A timestamp + * @var integer + */ + public $Time1st; + + /** + * A timestamp + * @var integer + */ + public $Time2nd; + + /** + * Starting block (small or big) for this PPS's data inside the container + * @var integer + */ + public $_StartBlock; + + /** + * The size of the PPS's data (in bytes) + * @var integer + */ + public $Size; + + /** + * The PPS's data (only used if it's not using a temporary file) + * @var string + */ + public $_data; + + /** + * Array of child PPS's (only used by Root and Dir PPS's) + * @var array + */ + public $children = array(); + + /** + * Pointer to OLE container + * @var OLE + */ + public $ole; + + /** + * The constructor + * + * @access public + * @param integer $No The PPS index + * @param string $name The PPS name + * @param integer $type The PPS type. Dir, Root or File + * @param integer $prev The index of the previous PPS + * @param integer $next The index of the next PPS + * @param integer $dir The index of it's first child if this is a Dir or Root PPS + * @param integer $time_1st A timestamp + * @param integer $time_2nd A timestamp + * @param string $data The (usually binary) source data of the PPS + * @param array $children Array containing children PPS for this PPS + */ + public function __construct($No, $name, $type, $prev, $next, $dir, $time_1st, $time_2nd, $data, $children) + { + $this->No = $No; + $this->Name = $name; + $this->Type = $type; + $this->PrevPps = $prev; + $this->NextPps = $next; + $this->DirPps = $dir; + $this->Time1st = $time_1st; + $this->Time2nd = $time_2nd; + $this->_data = $data; + $this->children = $children; + if ($data != '') { + $this->Size = strlen($data); + } else { + $this->Size = 0; + } + } + + /** + * Returns the amount of data saved for this PPS + * + * @access public + * @return integer The amount of data (in bytes) + */ + public function _DataLen() + { + if (!isset($this->_data)) { + return 0; + } + //if (isset($this->_PPS_FILE)) { + // fseek($this->_PPS_FILE, 0); + // $stats = fstat($this->_PPS_FILE); + // return $stats[7]; + //} else { + return strlen($this->_data); + //} + } + + /** + * Returns a string with the PPS's WK (What is a WK?) + * + * @access public + * @return string The binary string + */ + public function _getPpsWk() + { + $ret = str_pad($this->Name, 64, "\x00"); + + $ret .= pack("v", strlen($this->Name) + 2) // 66 + . pack("c", $this->Type) // 67 + . pack("c", 0x00) //UK // 68 + . pack("V", $this->PrevPps) //Prev // 72 + . pack("V", $this->NextPps) //Next // 76 + . pack("V", $this->DirPps) //Dir // 80 + . "\x00\x09\x02\x00" // 84 + . "\x00\x00\x00\x00" // 88 + . "\xc0\x00\x00\x00" // 92 + . "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root + . "\x00\x00\x00\x00" // 100 + . PHPExcel_Shared_OLE::LocalDate2OLE($this->Time1st) // 108 + . PHPExcel_Shared_OLE::LocalDate2OLE($this->Time2nd) // 116 + . pack("V", isset($this->_StartBlock)? + $this->_StartBlock:0) // 120 + . pack("V", $this->Size) // 124 + . pack("V", 0); // 128 + return $ret; + } + + /** + * Updates index and pointers to previous, next and children PPS's for this + * PPS. I don't think it'll work with Dir PPS's. + * + * @access public + * @param array &$raList Reference to the array of PPS's for the whole OLE + * container + * @return integer The index for this PPS + */ + public static function _savePpsSetPnt(&$raList, $to_save, $depth = 0) + { + if (!is_array($to_save) || (empty($to_save))) { + return 0xFFFFFFFF; + } elseif (count($to_save) == 1) { + $cnt = count($raList); + // If the first entry, it's the root... Don't clone it! + $raList[$cnt] = ( $depth == 0 ) ? $to_save[0] : clone $to_save[0]; + $raList[$cnt]->No = $cnt; + $raList[$cnt]->PrevPps = 0xFFFFFFFF; + $raList[$cnt]->NextPps = 0xFFFFFFFF; + $raList[$cnt]->DirPps = self::_savePpsSetPnt($raList, @$raList[$cnt]->children, $depth++); + } else { + $iPos = floor(count($to_save) / 2); + $aPrev = array_slice($to_save, 0, $iPos); + $aNext = array_slice($to_save, $iPos + 1); + $cnt = count($raList); + // If the first entry, it's the root... Don't clone it! + $raList[$cnt] = ( $depth == 0 ) ? $to_save[$iPos] : clone $to_save[$iPos]; + $raList[$cnt]->No = $cnt; + $raList[$cnt]->PrevPps = self::_savePpsSetPnt($raList, $aPrev, $depth++); + $raList[$cnt]->NextPps = self::_savePpsSetPnt($raList, $aNext, $depth++); + $raList[$cnt]->DirPps = self::_savePpsSetPnt($raList, @$raList[$cnt]->children, $depth++); + + } + return $cnt; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/OLE/PPS/File.php b/extend/PHPExcel/PHPExcel/Shared/OLE/PPS/File.php new file mode 100644 index 0000000..1ca337c --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/OLE/PPS/File.php @@ -0,0 +1,74 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +// +----------------------------------------------------------------------+ +// | PHP Version 4 | +// +----------------------------------------------------------------------+ +// | Copyright (c) 1997-2002 The PHP Group | +// +----------------------------------------------------------------------+ +// | This source file is subject to version 2.02 of the PHP license, | +// | that is bundled with this package in the file LICENSE, and is | +// | available at through the world-wide-web at | +// | http://www.php.net/license/2_02.txt. | +// | If you did not receive a copy of the PHP license and are unable to | +// | obtain it through the world-wide-web, please send a note to | +// | license@php.net so we can mail you a copy immediately. | +// +----------------------------------------------------------------------+ +// | Author: Xavier Noguer <xnoguer@php.net> | +// | Based on OLE::Storage_Lite by Kawai, Takanori | +// +----------------------------------------------------------------------+ +// +// $Id: File.php,v 1.11 2007/02/13 21:00:42 schmidt Exp $ + + +/** +* Class for creating File PPS's for OLE containers +* +* @author Xavier Noguer <xnoguer@php.net> +* @category PHPExcel +* @package PHPExcel_Shared_OLE +*/ +class PHPExcel_Shared_OLE_PPS_File extends PHPExcel_Shared_OLE_PPS +{ + /** + * The constructor + * + * @access public + * @param string $name The name of the file (in Unicode) + * @see OLE::Asc2Ucs() + */ + public function __construct($name) + { + parent::__construct(null, $name, PHPExcel_Shared_OLE::OLE_PPS_TYPE_FILE, null, null, null, null, null, '', array()); + } + + /** + * Initialization method. Has to be called right after OLE_PPS_File(). + * + * @access public + * @return mixed true on success + */ + public function init() + { + return true; + } + + /** + * Append data to PPS + * + * @access public + * @param string $data The data to append + */ + public function append($data) + { + $this->_data .= $data; + } + + /** + * Returns a stream for reading this file using fread() etc. + * @return resource a read-only stream + */ + public function getStream() + { + $this->ole->getStream($this); + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/OLE/PPS/Root.php b/extend/PHPExcel/PHPExcel/Shared/OLE/PPS/Root.php new file mode 100644 index 0000000..5d4052f --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/OLE/PPS/Root.php @@ -0,0 +1,462 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +// +----------------------------------------------------------------------+ +// | PHP Version 4 | +// +----------------------------------------------------------------------+ +// | Copyright (c) 1997-2002 The PHP Group | +// +----------------------------------------------------------------------+ +// | This source file is subject to version 2.02 of the PHP license, | +// | that is bundled with this package in the file LICENSE, and is | +// | available at through the world-wide-web at | +// | http://www.php.net/license/2_02.txt. | +// | If you did not receive a copy of the PHP license and are unable to | +// | obtain it through the world-wide-web, please send a note to | +// | license@php.net so we can mail you a copy immediately. | +// +----------------------------------------------------------------------+ +// | Author: Xavier Noguer <xnoguer@php.net> | +// | Based on OLE::Storage_Lite by Kawai, Takanori | +// +----------------------------------------------------------------------+ +// +// $Id: Root.php,v 1.9 2005/04/23 21:53:49 dufuz Exp $ + + +/** +* Class for creating Root PPS's for OLE containers +* +* @author Xavier Noguer <xnoguer@php.net> +* @category PHPExcel +* @package PHPExcel_Shared_OLE +*/ +class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS +{ + + /** + * Directory for temporary files + * @var string + */ + protected $tempDirectory = null; + + /** + * @param integer $time_1st A timestamp + * @param integer $time_2nd A timestamp + */ + public function __construct($time_1st, $time_2nd, $raChild) + { + $this->_tempDir = PHPExcel_Shared_File::sys_get_temp_dir(); + + parent::__construct(null, PHPExcel_Shared_OLE::Asc2Ucs('Root Entry'), PHPExcel_Shared_OLE::OLE_PPS_TYPE_ROOT, null, null, null, $time_1st, $time_2nd, null, $raChild); + } + + /** + * Method for saving the whole OLE container (including files). + * In fact, if called with an empty argument (or '-'), it saves to a + * temporary file and then outputs it's contents to stdout. + * If a resource pointer to a stream created by fopen() is passed + * it will be used, but you have to close such stream by yourself. + * + * @param string|resource $filename The name of the file or stream where to save the OLE container. + * @access public + * @return mixed true on success + */ + public function save($filename) + { + // Initial Setting for saving + $this->_BIG_BLOCK_SIZE = pow( + 2, + (isset($this->_BIG_BLOCK_SIZE))? self::adjust2($this->_BIG_BLOCK_SIZE) : 9 + ); + $this->_SMALL_BLOCK_SIZE= pow( + 2, + (isset($this->_SMALL_BLOCK_SIZE))? self::adjust2($this->_SMALL_BLOCK_SIZE) : 6 + ); + + if (is_resource($filename)) { + $this->_FILEH_ = $filename; + } elseif ($filename == '-' || $filename == '') { + if ($this->tempDirectory === null) { + $this->tempDirectory = PHPExcel_Shared_File::sys_get_temp_dir(); + } + $this->_tmp_filename = tempnam($this->tempDirectory, "OLE_PPS_Root"); + $this->_FILEH_ = fopen($this->_tmp_filename, "w+b"); + if ($this->_FILEH_ == false) { + throw new PHPExcel_Writer_Exception("Can't create temporary file."); + } + } else { + $this->_FILEH_ = fopen($filename, "wb"); + } + if ($this->_FILEH_ == false) { + throw new PHPExcel_Writer_Exception("Can't open $filename. It may be in use or protected."); + } + // Make an array of PPS's (for Save) + $aList = array(); + PHPExcel_Shared_OLE_PPS::_savePpsSetPnt($aList, array($this)); + // calculate values for header + list($iSBDcnt, $iBBcnt, $iPPScnt) = $this->_calcSize($aList); //, $rhInfo); + // Save Header + $this->_saveHeader($iSBDcnt, $iBBcnt, $iPPScnt); + + // Make Small Data string (write SBD) + $this->_data = $this->_makeSmallData($aList); + + // Write BB + $this->_saveBigData($iSBDcnt, $aList); + // Write PPS + $this->_savePps($aList); + // Write Big Block Depot and BDList and Adding Header informations + $this->_saveBbd($iSBDcnt, $iBBcnt, $iPPScnt); + + if (!is_resource($filename)) { + fclose($this->_FILEH_); + } + + return true; + } + + /** + * Calculate some numbers + * + * @access public + * @param array $raList Reference to an array of PPS's + * @return array The array of numbers + */ + public function _calcSize(&$raList) + { + // Calculate Basic Setting + list($iSBDcnt, $iBBcnt, $iPPScnt) = array(0,0,0); + $iSmallLen = 0; + $iSBcnt = 0; + $iCount = count($raList); + for ($i = 0; $i < $iCount; ++$i) { + if ($raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_FILE) { + $raList[$i]->Size = $raList[$i]->_DataLen(); + if ($raList[$i]->Size < PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) { + $iSBcnt += floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) + + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0); + } else { + $iBBcnt += (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) + + (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)? 1: 0)); + } + } + } + $iSmallLen = $iSBcnt * $this->_SMALL_BLOCK_SIZE; + $iSlCnt = floor($this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE); + $iSBDcnt = floor($iSBcnt / $iSlCnt) + (($iSBcnt % $iSlCnt)? 1:0); + $iBBcnt += (floor($iSmallLen / $this->_BIG_BLOCK_SIZE) + + (( $iSmallLen % $this->_BIG_BLOCK_SIZE)? 1: 0)); + $iCnt = count($raList); + $iBdCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_PPS_SIZE; + $iPPScnt = (floor($iCnt/$iBdCnt) + (($iCnt % $iBdCnt)? 1: 0)); + + return array($iSBDcnt, $iBBcnt, $iPPScnt); + } + + /** + * Helper function for caculating a magic value for block sizes + * + * @access public + * @param integer $i2 The argument + * @see save() + * @return integer + */ + private static function adjust2($i2) + { + $iWk = log($i2)/log(2); + return ($iWk > floor($iWk))? floor($iWk)+1:$iWk; + } + + /** + * Save OLE header + * + * @access public + * @param integer $iSBDcnt + * @param integer $iBBcnt + * @param integer $iPPScnt + */ + public function _saveHeader($iSBDcnt, $iBBcnt, $iPPScnt) + { + $FILE = $this->_FILEH_; + + // Calculate Basic Setting + $iBlCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE; + $i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE; + + $iBdExL = 0; + $iAll = $iBBcnt + $iPPScnt + $iSBDcnt; + $iAllW = $iAll; + $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0); + $iBdCnt = floor(($iAll + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0); + + // Calculate BD count + if ($iBdCnt > $i1stBdL) { + while (1) { + ++$iBdExL; + ++$iAllW; + $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0); + $iBdCnt = floor(($iAllW + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0); + if ($iBdCnt <= ($iBdExL*$iBlCnt+ $i1stBdL)) { + break; + } + } + } + + // Save Header + fwrite( + $FILE, + "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1" + . "\x00\x00\x00\x00" + . "\x00\x00\x00\x00" + . "\x00\x00\x00\x00" + . "\x00\x00\x00\x00" + . pack("v", 0x3b) + . pack("v", 0x03) + . pack("v", -2) + . pack("v", 9) + . pack("v", 6) + . pack("v", 0) + . "\x00\x00\x00\x00" + . "\x00\x00\x00\x00" + . pack("V", $iBdCnt) + . pack("V", $iBBcnt+$iSBDcnt) //ROOT START + . pack("V", 0) + . pack("V", 0x1000) + . pack("V", $iSBDcnt ? 0 : -2) //Small Block Depot + . pack("V", $iSBDcnt) + ); + // Extra BDList Start, Count + if ($iBdCnt < $i1stBdL) { + fwrite( + $FILE, + pack("V", -2) // Extra BDList Start + . pack("V", 0)// Extra BDList Count + ); + } else { + fwrite($FILE, pack("V", $iAll+$iBdCnt) . pack("V", $iBdExL)); + } + + // BDList + for ($i = 0; $i < $i1stBdL && $i < $iBdCnt; ++$i) { + fwrite($FILE, pack("V", $iAll+$i)); + } + if ($i < $i1stBdL) { + $jB = $i1stBdL - $i; + for ($j = 0; $j < $jB; ++$j) { + fwrite($FILE, (pack("V", -1))); + } + } + } + + /** + * Saving big data (PPS's with data bigger than PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) + * + * @access public + * @param integer $iStBlk + * @param array &$raList Reference to array of PPS's + */ + public function _saveBigData($iStBlk, &$raList) + { + $FILE = $this->_FILEH_; + + // cycle through PPS's + $iCount = count($raList); + for ($i = 0; $i < $iCount; ++$i) { + if ($raList[$i]->Type != PHPExcel_Shared_OLE::OLE_PPS_TYPE_DIR) { + $raList[$i]->Size = $raList[$i]->_DataLen(); + if (($raList[$i]->Size >= PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) || (($raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_ROOT) && isset($raList[$i]->_data))) { + // Write Data + //if (isset($raList[$i]->_PPS_FILE)) { + // $iLen = 0; + // fseek($raList[$i]->_PPS_FILE, 0); // To The Top + // while ($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) { + // $iLen += strlen($sBuff); + // fwrite($FILE, $sBuff); + // } + //} else { + fwrite($FILE, $raList[$i]->_data); + //} + + if ($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) { + fwrite($FILE, str_repeat("\x00", $this->_BIG_BLOCK_SIZE - ($raList[$i]->Size % $this->_BIG_BLOCK_SIZE))); + } + // Set For PPS + $raList[$i]->_StartBlock = $iStBlk; + $iStBlk += + (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) + + (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)? 1: 0)); + } + // Close file for each PPS, and unlink it + //if (isset($raList[$i]->_PPS_FILE)) { + // fclose($raList[$i]->_PPS_FILE); + // $raList[$i]->_PPS_FILE = null; + // unlink($raList[$i]->_tmp_filename); + //} + } + } + } + + /** + * get small data (PPS's with data smaller than PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) + * + * @access public + * @param array &$raList Reference to array of PPS's + */ + public function _makeSmallData(&$raList) + { + $sRes = ''; + $FILE = $this->_FILEH_; + $iSmBlk = 0; + + $iCount = count($raList); + for ($i = 0; $i < $iCount; ++$i) { + // Make SBD, small data string + if ($raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_FILE) { + if ($raList[$i]->Size <= 0) { + continue; + } + if ($raList[$i]->Size < PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) { + $iSmbCnt = floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) + + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0); + // Add to SBD + $jB = $iSmbCnt - 1; + for ($j = 0; $j < $jB; ++$j) { + fwrite($FILE, pack("V", $j+$iSmBlk+1)); + } + fwrite($FILE, pack("V", -2)); + + //// Add to Data String(this will be written for RootEntry) + //if ($raList[$i]->_PPS_FILE) { + // fseek($raList[$i]->_PPS_FILE, 0); // To The Top + // while ($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) { + // $sRes .= $sBuff; + // } + //} else { + $sRes .= $raList[$i]->_data; + //} + if ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) { + $sRes .= str_repeat("\x00", $this->_SMALL_BLOCK_SIZE - ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)); + } + // Set for PPS + $raList[$i]->_StartBlock = $iSmBlk; + $iSmBlk += $iSmbCnt; + } + } + } + $iSbCnt = floor($this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE); + if ($iSmBlk % $iSbCnt) { + $iB = $iSbCnt - ($iSmBlk % $iSbCnt); + for ($i = 0; $i < $iB; ++$i) { + fwrite($FILE, pack("V", -1)); + } + } + return $sRes; + } + + /** + * Saves all the PPS's WKs + * + * @access public + * @param array $raList Reference to an array with all PPS's + */ + public function _savePps(&$raList) + { + // Save each PPS WK + $iC = count($raList); + for ($i = 0; $i < $iC; ++$i) { + fwrite($this->_FILEH_, $raList[$i]->_getPpsWk()); + } + // Adjust for Block + $iCnt = count($raList); + $iBCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_PPS_SIZE; + if ($iCnt % $iBCnt) { + fwrite($this->_FILEH_, str_repeat("\x00", ($iBCnt - ($iCnt % $iBCnt)) * PHPExcel_Shared_OLE::OLE_PPS_SIZE)); + } + } + + /** + * Saving Big Block Depot + * + * @access public + * @param integer $iSbdSize + * @param integer $iBsize + * @param integer $iPpsCnt + */ + public function _saveBbd($iSbdSize, $iBsize, $iPpsCnt) + { + $FILE = $this->_FILEH_; + // Calculate Basic Setting + $iBbCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE; + $i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE; + + $iBdExL = 0; + $iAll = $iBsize + $iPpsCnt + $iSbdSize; + $iAllW = $iAll; + $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt)? 1: 0); + $iBdCnt = floor(($iAll + $iBdCntW) / $iBbCnt) + ((($iAllW+$iBdCntW) % $iBbCnt)? 1: 0); + // Calculate BD count + if ($iBdCnt >$i1stBdL) { + while (1) { + ++$iBdExL; + ++$iAllW; + $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt)? 1: 0); + $iBdCnt = floor(($iAllW + $iBdCntW) / $iBbCnt) + ((($iAllW+$iBdCntW) % $iBbCnt)? 1: 0); + if ($iBdCnt <= ($iBdExL*$iBbCnt+ $i1stBdL)) { + break; + } + } + } + + // Making BD + // Set for SBD + if ($iSbdSize > 0) { + for ($i = 0; $i < ($iSbdSize - 1); ++$i) { + fwrite($FILE, pack("V", $i+1)); + } + fwrite($FILE, pack("V", -2)); + } + // Set for B + for ($i = 0; $i < ($iBsize - 1); ++$i) { + fwrite($FILE, pack("V", $i+$iSbdSize+1)); + } + fwrite($FILE, pack("V", -2)); + + // Set for PPS + for ($i = 0; $i < ($iPpsCnt - 1); ++$i) { + fwrite($FILE, pack("V", $i+$iSbdSize+$iBsize+1)); + } + fwrite($FILE, pack("V", -2)); + // Set for BBD itself ( 0xFFFFFFFD : BBD) + for ($i = 0; $i < $iBdCnt; ++$i) { + fwrite($FILE, pack("V", 0xFFFFFFFD)); + } + // Set for ExtraBDList + for ($i = 0; $i < $iBdExL; ++$i) { + fwrite($FILE, pack("V", 0xFFFFFFFC)); + } + // Adjust for Block + if (($iAllW + $iBdCnt) % $iBbCnt) { + $iBlock = ($iBbCnt - (($iAllW + $iBdCnt) % $iBbCnt)); + for ($i = 0; $i < $iBlock; ++$i) { + fwrite($FILE, pack("V", -1)); + } + } + // Extra BDList + if ($iBdCnt > $i1stBdL) { + $iN=0; + $iNb=0; + for ($i = $i1stBdL; $i < $iBdCnt; $i++, ++$iN) { + if ($iN >= ($iBbCnt - 1)) { + $iN = 0; + ++$iNb; + fwrite($FILE, pack("V", $iAll+$iBdCnt+$iNb)); + } + fwrite($FILE, pack("V", $iBsize+$iSbdSize+$iPpsCnt+$i)); + } + if (($iBdCnt-$i1stBdL) % ($iBbCnt-1)) { + $iB = ($iBbCnt - 1) - (($iBdCnt - $i1stBdL) % ($iBbCnt - 1)); + for ($i = 0; $i < $iB; ++$i) { + fwrite($FILE, pack("V", -1)); + } + } + fwrite($FILE, pack("V", -2)); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/OLERead.php b/extend/PHPExcel/PHPExcel/Shared/OLERead.php new file mode 100644 index 0000000..6b15d97 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/OLERead.php @@ -0,0 +1,318 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + +defined('IDENTIFIER_OLE') || + define('IDENTIFIER_OLE', pack('CCCCCCCC', 0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1)); + +class PHPExcel_Shared_OLERead +{ + private $data = ''; + + // OLE identifier + const IDENTIFIER_OLE = IDENTIFIER_OLE; + + // Size of a sector = 512 bytes + const BIG_BLOCK_SIZE = 0x200; + + // Size of a short sector = 64 bytes + const SMALL_BLOCK_SIZE = 0x40; + + // Size of a directory entry always = 128 bytes + const PROPERTY_STORAGE_BLOCK_SIZE = 0x80; + + // Minimum size of a standard stream = 4096 bytes, streams smaller than this are stored as short streams + const SMALL_BLOCK_THRESHOLD = 0x1000; + + // header offsets + const NUM_BIG_BLOCK_DEPOT_BLOCKS_POS = 0x2c; + const ROOT_START_BLOCK_POS = 0x30; + const SMALL_BLOCK_DEPOT_BLOCK_POS = 0x3c; + const EXTENSION_BLOCK_POS = 0x44; + const NUM_EXTENSION_BLOCK_POS = 0x48; + const BIG_BLOCK_DEPOT_BLOCKS_POS = 0x4c; + + // property storage offsets (directory offsets) + const SIZE_OF_NAME_POS = 0x40; + const TYPE_POS = 0x42; + const START_BLOCK_POS = 0x74; + const SIZE_POS = 0x78; + + + + public $wrkbook = null; + public $summaryInformation = null; + public $documentSummaryInformation = null; + + + /** + * Read the file + * + * @param $sFileName string Filename + * @throws PHPExcel_Reader_Exception + */ + public function read($sFileName) + { + // Check if file exists and is readable + if (!is_readable($sFileName)) { + throw new PHPExcel_Reader_Exception("Could not open " . $sFileName . " for reading! File does not exist, or it is not readable."); + } + + // Get the file identifier + // Don't bother reading the whole file until we know it's a valid OLE file + $this->data = file_get_contents($sFileName, false, null, 0, 8); + + // Check OLE identifier + if ($this->data != self::IDENTIFIER_OLE) { + throw new PHPExcel_Reader_Exception('The filename ' . $sFileName . ' is not recognised as an OLE file'); + } + + // Get the file data + $this->data = file_get_contents($sFileName); + + // Total number of sectors used for the SAT + $this->numBigBlockDepotBlocks = self::getInt4d($this->data, self::NUM_BIG_BLOCK_DEPOT_BLOCKS_POS); + + // SecID of the first sector of the directory stream + $this->rootStartBlock = self::getInt4d($this->data, self::ROOT_START_BLOCK_POS); + + // SecID of the first sector of the SSAT (or -2 if not extant) + $this->sbdStartBlock = self::getInt4d($this->data, self::SMALL_BLOCK_DEPOT_BLOCK_POS); + + // SecID of the first sector of the MSAT (or -2 if no additional sectors are used) + $this->extensionBlock = self::getInt4d($this->data, self::EXTENSION_BLOCK_POS); + + // Total number of sectors used by MSAT + $this->numExtensionBlocks = self::getInt4d($this->data, self::NUM_EXTENSION_BLOCK_POS); + + $bigBlockDepotBlocks = array(); + $pos = self::BIG_BLOCK_DEPOT_BLOCKS_POS; + + $bbdBlocks = $this->numBigBlockDepotBlocks; + + if ($this->numExtensionBlocks != 0) { + $bbdBlocks = (self::BIG_BLOCK_SIZE - self::BIG_BLOCK_DEPOT_BLOCKS_POS)/4; + } + + for ($i = 0; $i < $bbdBlocks; ++$i) { + $bigBlockDepotBlocks[$i] = self::getInt4d($this->data, $pos); + $pos += 4; + } + + for ($j = 0; $j < $this->numExtensionBlocks; ++$j) { + $pos = ($this->extensionBlock + 1) * self::BIG_BLOCK_SIZE; + $blocksToRead = min($this->numBigBlockDepotBlocks - $bbdBlocks, self::BIG_BLOCK_SIZE / 4 - 1); + + for ($i = $bbdBlocks; $i < $bbdBlocks + $blocksToRead; ++$i) { + $bigBlockDepotBlocks[$i] = self::getInt4d($this->data, $pos); + $pos += 4; + } + + $bbdBlocks += $blocksToRead; + if ($bbdBlocks < $this->numBigBlockDepotBlocks) { + $this->extensionBlock = self::getInt4d($this->data, $pos); + } + } + + $pos = 0; + $this->bigBlockChain = ''; + $bbs = self::BIG_BLOCK_SIZE / 4; + for ($i = 0; $i < $this->numBigBlockDepotBlocks; ++$i) { + $pos = ($bigBlockDepotBlocks[$i] + 1) * self::BIG_BLOCK_SIZE; + + $this->bigBlockChain .= substr($this->data, $pos, 4*$bbs); + $pos += 4*$bbs; + } + + $pos = 0; + $sbdBlock = $this->sbdStartBlock; + $this->smallBlockChain = ''; + while ($sbdBlock != -2) { + $pos = ($sbdBlock + 1) * self::BIG_BLOCK_SIZE; + + $this->smallBlockChain .= substr($this->data, $pos, 4*$bbs); + $pos += 4*$bbs; + + $sbdBlock = self::getInt4d($this->bigBlockChain, $sbdBlock*4); + } + + // read the directory stream + $block = $this->rootStartBlock; + $this->entry = $this->_readData($block); + + $this->readPropertySets(); + } + + /** + * Extract binary stream data + * + * @return string + */ + public function getStream($stream) + { + if ($stream === null) { + return null; + } + + $streamData = ''; + + if ($this->props[$stream]['size'] < self::SMALL_BLOCK_THRESHOLD) { + $rootdata = $this->_readData($this->props[$this->rootentry]['startBlock']); + + $block = $this->props[$stream]['startBlock']; + + while ($block != -2) { + $pos = $block * self::SMALL_BLOCK_SIZE; + $streamData .= substr($rootdata, $pos, self::SMALL_BLOCK_SIZE); + + $block = self::getInt4d($this->smallBlockChain, $block*4); + } + + return $streamData; + } else { + $numBlocks = $this->props[$stream]['size'] / self::BIG_BLOCK_SIZE; + if ($this->props[$stream]['size'] % self::BIG_BLOCK_SIZE != 0) { + ++$numBlocks; + } + + if ($numBlocks == 0) { + return ''; + } + + $block = $this->props[$stream]['startBlock']; + + while ($block != -2) { + $pos = ($block + 1) * self::BIG_BLOCK_SIZE; + $streamData .= substr($this->data, $pos, self::BIG_BLOCK_SIZE); + $block = self::getInt4d($this->bigBlockChain, $block*4); + } + + return $streamData; + } + } + + /** + * Read a standard stream (by joining sectors using information from SAT) + * + * @param int $bl Sector ID where the stream starts + * @return string Data for standard stream + */ + private function _readData($bl) + { + $block = $bl; + $data = ''; + + while ($block != -2) { + $pos = ($block + 1) * self::BIG_BLOCK_SIZE; + $data .= substr($this->data, $pos, self::BIG_BLOCK_SIZE); + $block = self::getInt4d($this->bigBlockChain, $block*4); + } + return $data; + } + + /** + * Read entries in the directory stream. + */ + private function readPropertySets() + { + $offset = 0; + + // loop through entires, each entry is 128 bytes + $entryLen = strlen($this->entry); + while ($offset < $entryLen) { + // entry data (128 bytes) + $d = substr($this->entry, $offset, self::PROPERTY_STORAGE_BLOCK_SIZE); + + // size in bytes of name + $nameSize = ord($d[self::SIZE_OF_NAME_POS]) | (ord($d[self::SIZE_OF_NAME_POS+1]) << 8); + + // type of entry + $type = ord($d[self::TYPE_POS]); + + // sectorID of first sector or short sector, if this entry refers to a stream (the case with workbook) + // sectorID of first sector of the short-stream container stream, if this entry is root entry + $startBlock = self::getInt4d($d, self::START_BLOCK_POS); + + $size = self::getInt4d($d, self::SIZE_POS); + + $name = str_replace("\x00", "", substr($d, 0, $nameSize)); + + $this->props[] = array( + 'name' => $name, + 'type' => $type, + 'startBlock' => $startBlock, + 'size' => $size + ); + + // tmp helper to simplify checks + $upName = strtoupper($name); + + // Workbook directory entry (BIFF5 uses Book, BIFF8 uses Workbook) + if (($upName === 'WORKBOOK') || ($upName === 'BOOK')) { + $this->wrkbook = count($this->props) - 1; + } elseif ($upName === 'ROOT ENTRY' || $upName === 'R') { + // Root entry + $this->rootentry = count($this->props) - 1; + } + + // Summary information + if ($name == chr(5) . 'SummaryInformation') { +// echo 'Summary Information<br />'; + $this->summaryInformation = count($this->props) - 1; + } + + // Additional Document Summary information + if ($name == chr(5) . 'DocumentSummaryInformation') { +// echo 'Document Summary Information<br />'; + $this->documentSummaryInformation = count($this->props) - 1; + } + + $offset += self::PROPERTY_STORAGE_BLOCK_SIZE; + } + } + + /** + * Read 4 bytes of data at specified position + * + * @param string $data + * @param int $pos + * @return int + */ + private static function getInt4d($data, $pos) + { + // FIX: represent numbers correctly on 64-bit system + // http://sourceforge.net/tracker/index.php?func=detail&aid=1487372&group_id=99160&atid=623334 + // Hacked by Andreas Rehm 2006 to ensure correct result of the <<24 block on 32 and 64bit systems + $_or_24 = ord($data[$pos + 3]); + if ($_or_24 >= 128) { + // negative number + $_ord_24 = -abs((256 - $_or_24) << 24); + } else { + $_ord_24 = ($_or_24 & 127) << 24; + } + return ord($data[$pos]) | (ord($data[$pos + 1]) << 8) | (ord($data[$pos + 2]) << 16) | $_ord_24; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/PCLZip/gnu-lgpl.txt b/extend/PHPExcel/PHPExcel/Shared/PCLZip/gnu-lgpl.txt new file mode 100644 index 0000000..b1e3f5a --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/PCLZip/gnu-lgpl.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/extend/PHPExcel/PHPExcel/Shared/PCLZip/pclzip.lib.php b/extend/PHPExcel/PHPExcel/Shared/PCLZip/pclzip.lib.php new file mode 100644 index 0000000..a5a9b0a --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/PCLZip/pclzip.lib.php @@ -0,0 +1,5173 @@ +<?php +// -------------------------------------------------------------------------------- +// PhpConcept Library - Zip Module 2.8.2 +// -------------------------------------------------------------------------------- +// License GNU/LGPL - Vincent Blavet - August 2009 +// http://www.phpconcept.net +// -------------------------------------------------------------------------------- +// +// Presentation : +// PclZip is a PHP library that manage ZIP archives. +// So far tests show that archives generated by PclZip are readable by +// WinZip application and other tools. +// +// Description : +// See readme.txt and http://www.phpconcept.net +// +// Warning : +// This library and the associated files are non commercial, non professional +// work. +// It should not have unexpected results. However if any damage is caused by +// this software the author can not be responsible. +// The use of this software is at the risk of the user. +// +// -------------------------------------------------------------------------------- +// $Id: pclzip.lib.php,v 1.60 2009/09/30 21:01:04 vblavet Exp $ +// -------------------------------------------------------------------------------- + +// ----- Constants +if (!defined('PCLZIP_READ_BLOCK_SIZE')) { + define('PCLZIP_READ_BLOCK_SIZE', 2048); +} + +// ----- File list separator +// In version 1.x of PclZip, the separator for file list is a space +// (which is not a very smart choice, specifically for windows paths !). +// A better separator should be a comma (,). This constant gives you the +// abilty to change that. +// However notice that changing this value, may have impact on existing +// scripts, using space separated filenames. +// Recommanded values for compatibility with older versions : +//define('PCLZIP_SEPARATOR', ' '); +// Recommanded values for smart separation of filenames. +if (!defined('PCLZIP_SEPARATOR')) { + define('PCLZIP_SEPARATOR', ','); +} + +// ----- Error configuration +// 0 : PclZip Class integrated error handling +// 1 : PclError external library error handling. By enabling this +// you must ensure that you have included PclError library. +// [2,...] : reserved for futur use +if (!defined('PCLZIP_ERROR_EXTERNAL')) { + define('PCLZIP_ERROR_EXTERNAL', 0); +} + +// ----- Optional static temporary directory +// By default temporary files are generated in the script current +// path. +// If defined : +// - MUST BE terminated by a '/'. +// - MUST be a valid, already created directory +// Samples : +// define('PCLZIP_TEMPORARY_DIR', '/temp/'); +// define('PCLZIP_TEMPORARY_DIR', 'C:/Temp/'); +if (!defined('PCLZIP_TEMPORARY_DIR')) { + define('PCLZIP_TEMPORARY_DIR', ''); +} + +// ----- Optional threshold ratio for use of temporary files +// Pclzip sense the size of the file to add/extract and decide to +// use or not temporary file. The algorythm is looking for +// memory_limit of PHP and apply a ratio. +// threshold = memory_limit * ratio. +// Recommended values are under 0.5. Default 0.47. +// Samples : +// define('PCLZIP_TEMPORARY_FILE_RATIO', 0.5); +if (!defined('PCLZIP_TEMPORARY_FILE_RATIO')) { + define('PCLZIP_TEMPORARY_FILE_RATIO', 0.47); +} + +// -------------------------------------------------------------------------------- +// ***** UNDER THIS LINE NOTHING NEEDS TO BE MODIFIED ***** +// -------------------------------------------------------------------------------- + +// ----- Global variables +$g_pclzip_version = "2.8.2"; + +// ----- Error codes +// -1 : Unable to open file in binary write mode +// -2 : Unable to open file in binary read mode +// -3 : Invalid parameters +// -4 : File does not exist +// -5 : Filename is too long (max. 255) +// -6 : Not a valid zip file +// -7 : Invalid extracted file size +// -8 : Unable to create directory +// -9 : Invalid archive extension +// -10 : Invalid archive format +// -11 : Unable to delete file (unlink) +// -12 : Unable to rename file (rename) +// -13 : Invalid header checksum +// -14 : Invalid archive size +define('PCLZIP_ERR_USER_ABORTED', 2); +define('PCLZIP_ERR_NO_ERROR', 0); +define('PCLZIP_ERR_WRITE_OPEN_FAIL', -1); +define('PCLZIP_ERR_READ_OPEN_FAIL', -2); +define('PCLZIP_ERR_INVALID_PARAMETER', -3); +define('PCLZIP_ERR_MISSING_FILE', -4); +define('PCLZIP_ERR_FILENAME_TOO_LONG', -5); +define('PCLZIP_ERR_INVALID_ZIP', -6); +define('PCLZIP_ERR_BAD_EXTRACTED_FILE', -7); +define('PCLZIP_ERR_DIR_CREATE_FAIL', -8); +define('PCLZIP_ERR_BAD_EXTENSION', -9); +define('PCLZIP_ERR_BAD_FORMAT', -10); +define('PCLZIP_ERR_DELETE_FILE_FAIL', -11); +define('PCLZIP_ERR_RENAME_FILE_FAIL', -12); +define('PCLZIP_ERR_BAD_CHECKSUM', -13); +define('PCLZIP_ERR_INVALID_ARCHIVE_ZIP', -14); +define('PCLZIP_ERR_MISSING_OPTION_VALUE', -15); +define('PCLZIP_ERR_INVALID_OPTION_VALUE', -16); +define('PCLZIP_ERR_ALREADY_A_DIRECTORY', -17); +define('PCLZIP_ERR_UNSUPPORTED_COMPRESSION', -18); +define('PCLZIP_ERR_UNSUPPORTED_ENCRYPTION', -19); +define('PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE', -20); +define('PCLZIP_ERR_DIRECTORY_RESTRICTION', -21); + +// ----- Options values +define('PCLZIP_OPT_PATH', 77001); +define('PCLZIP_OPT_ADD_PATH', 77002); +define('PCLZIP_OPT_REMOVE_PATH', 77003); +define('PCLZIP_OPT_REMOVE_ALL_PATH', 77004); +define('PCLZIP_OPT_SET_CHMOD', 77005); +define('PCLZIP_OPT_EXTRACT_AS_STRING', 77006); +define('PCLZIP_OPT_NO_COMPRESSION', 77007); +define('PCLZIP_OPT_BY_NAME', 77008); +define('PCLZIP_OPT_BY_INDEX', 77009); +define('PCLZIP_OPT_BY_EREG', 77010); +define('PCLZIP_OPT_BY_PREG', 77011); +define('PCLZIP_OPT_COMMENT', 77012); +define('PCLZIP_OPT_ADD_COMMENT', 77013); +define('PCLZIP_OPT_PREPEND_COMMENT', 77014); +define('PCLZIP_OPT_EXTRACT_IN_OUTPUT', 77015); +define('PCLZIP_OPT_REPLACE_NEWER', 77016); +define('PCLZIP_OPT_STOP_ON_ERROR', 77017); +// Having big trouble with crypt. Need to multiply 2 long int +// which is not correctly supported by PHP ... +//define('PCLZIP_OPT_CRYPT', 77018); +define('PCLZIP_OPT_EXTRACT_DIR_RESTRICTION', 77019); +define('PCLZIP_OPT_TEMP_FILE_THRESHOLD', 77020); +define('PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD', 77020); // alias +define('PCLZIP_OPT_TEMP_FILE_ON', 77021); +define('PCLZIP_OPT_ADD_TEMP_FILE_ON', 77021); // alias +define('PCLZIP_OPT_TEMP_FILE_OFF', 77022); +define('PCLZIP_OPT_ADD_TEMP_FILE_OFF', 77022); // alias + +// ----- File description attributes +define('PCLZIP_ATT_FILE_NAME', 79001); +define('PCLZIP_ATT_FILE_NEW_SHORT_NAME', 79002); +define('PCLZIP_ATT_FILE_NEW_FULL_NAME', 79003); +define('PCLZIP_ATT_FILE_MTIME', 79004); +define('PCLZIP_ATT_FILE_CONTENT', 79005); +define('PCLZIP_ATT_FILE_COMMENT', 79006); + +// ----- Call backs values +define('PCLZIP_CB_PRE_EXTRACT', 78001); +define('PCLZIP_CB_POST_EXTRACT', 78002); +define('PCLZIP_CB_PRE_ADD', 78003); +define('PCLZIP_CB_POST_ADD', 78004); +/* For futur use +define('PCLZIP_CB_PRE_LIST', 78005); +define('PCLZIP_CB_POST_LIST', 78006); +define('PCLZIP_CB_PRE_DELETE', 78007); +define('PCLZIP_CB_POST_DELETE', 78008); +*/ + +// -------------------------------------------------------------------------------- +// Class : PclZip +// Description : +// PclZip is the class that represent a Zip archive. +// The public methods allow the manipulation of the archive. +// Attributes : +// Attributes must not be accessed directly. +// Methods : +// PclZip() : Object creator +// create() : Creates the Zip archive +// listContent() : List the content of the Zip archive +// extract() : Extract the content of the archive +// properties() : List the properties of the archive +// -------------------------------------------------------------------------------- +class PclZip +{ + // ----- Filename of the zip file + public $zipname = ''; + + // ----- File descriptor of the zip file + public $zip_fd = 0; + + // ----- Internal error handling + public $error_code = 1; + public $error_string = ''; + + // ----- Current status of the magic_quotes_runtime + // This value store the php configuration for magic_quotes + // The class can then disable the magic_quotes and reset it after + public $magic_quotes_status; + + // -------------------------------------------------------------------------------- + // Function : PclZip() + // Description : + // Creates a PclZip object and set the name of the associated Zip archive + // filename. + // Note that no real action is taken, if the archive does not exist it is not + // created. Use create() for that. + // -------------------------------------------------------------------------------- + public function __construct($p_zipname) + { + + // ----- Tests the zlib + if (!function_exists('gzopen')) { + die('Abort '.basename(__FILE__).' : Missing zlib extensions'); + } + + // ----- Set the attributes + $this->zipname = $p_zipname; + $this->zip_fd = 0; + $this->magic_quotes_status = -1; + + // ----- Return + return; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : + // create($p_filelist, $p_add_dir="", $p_remove_dir="") + // create($p_filelist, $p_option, $p_option_value, ...) + // Description : + // This method supports two different synopsis. The first one is historical. + // This method creates a Zip Archive. The Zip file is created in the + // filesystem. The files and directories indicated in $p_filelist + // are added in the archive. See the parameters description for the + // supported format of $p_filelist. + // When a directory is in the list, the directory and its content is added + // in the archive. + // In this synopsis, the function takes an optional variable list of + // options. See bellow the supported options. + // Parameters : + // $p_filelist : An array containing file or directory names, or + // a string containing one filename or one directory name, or + // a string containing a list of filenames and/or directory + // names separated by spaces. + // $p_add_dir : A path to add before the real path of the archived file, + // in order to have it memorized in the archive. + // $p_remove_dir : A path to remove from the real path of the file to archive, + // in order to have a shorter path memorized in the archive. + // When $p_add_dir and $p_remove_dir are set, $p_remove_dir + // is removed first, before $p_add_dir is added. + // Options : + // PCLZIP_OPT_ADD_PATH : + // PCLZIP_OPT_REMOVE_PATH : + // PCLZIP_OPT_REMOVE_ALL_PATH : + // PCLZIP_OPT_COMMENT : + // PCLZIP_CB_PRE_ADD : + // PCLZIP_CB_POST_ADD : + // Return Values : + // 0 on failure, + // The list of the added files, with a status of the add action. + // (see PclZip::listContent() for list entry format) + // -------------------------------------------------------------------------------- + public function create($p_filelist) + { + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Set default values + $v_options = array(); + $v_options[PCLZIP_OPT_NO_COMPRESSION] = false; + + // ----- Look for variable options arguments + $v_size = func_num_args(); + + // ----- Look for arguments + if ($v_size > 1) { + // ----- Get the arguments + $v_arg_list = func_get_args(); + + // ----- Remove from the options list the first argument + array_shift($v_arg_list); + $v_size--; + + // ----- Look for first arg + if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { + // ----- Parse the options + $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array ( + PCLZIP_OPT_REMOVE_PATH => 'optional', + PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', + PCLZIP_OPT_ADD_PATH => 'optional', + PCLZIP_CB_PRE_ADD => 'optional', + PCLZIP_CB_POST_ADD => 'optional', + PCLZIP_OPT_NO_COMPRESSION => 'optional', + PCLZIP_OPT_COMMENT => 'optional', + PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', + PCLZIP_OPT_TEMP_FILE_ON => 'optional', + PCLZIP_OPT_TEMP_FILE_OFF => 'optional' + //, PCLZIP_OPT_CRYPT => 'optional' + )); + if ($v_result != 1) { + return 0; + } + } else { + // ----- Look for 2 args + // Here we need to support the first historic synopsis of the + // method. + // ----- Get the first argument + $v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0]; + + // ----- Look for the optional second argument + if ($v_size == 2) { + $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; + } elseif ($v_size > 2) { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); + return 0; + } + } + } + + // ----- Look for default option values + $this->privOptionDefaultThreshold($v_options); + + // ----- Init + $v_string_list = array(); + $v_att_list = array(); + $v_filedescr_list = array(); + $p_result_list = array(); + + // ----- Look if the $p_filelist is really an array + if (is_array($p_filelist)) { + // ----- Look if the first element is also an array + // This will mean that this is a file description entry + if (isset($p_filelist[0]) && is_array($p_filelist[0])) { + $v_att_list = $p_filelist; + } else { + // ----- The list is a list of string names + $v_string_list = $p_filelist; + } + } elseif (is_string($p_filelist)) { + // ----- Look if the $p_filelist is a string + // ----- Create a list from the string + $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); + } else { + // ----- Invalid variable type for $p_filelist + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist"); + return 0; + } + + // ----- Reformat the string list + if (sizeof($v_string_list) != 0) { + foreach ($v_string_list as $v_string) { + if ($v_string != '') { + $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; + } else { + } + } + } + + // ----- For each file in the list check the attributes + $v_supported_attributes = array( + PCLZIP_ATT_FILE_NAME => 'mandatory', + PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional', + PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional', + PCLZIP_ATT_FILE_MTIME => 'optional', + PCLZIP_ATT_FILE_CONTENT => 'optional', + PCLZIP_ATT_FILE_COMMENT => 'optional' + ); + foreach ($v_att_list as $v_entry) { + $v_result = $this->privFileDescrParseAtt($v_entry, $v_filedescr_list[], $v_options, $v_supported_attributes); + if ($v_result != 1) { + return 0; + } + } + + // ----- Expand the filelist (expand directories) + $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); + if ($v_result != 1) { + return 0; + } + + // ----- Call the create fct + $v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options); + if ($v_result != 1) { + return 0; + } + + // ----- Return + return $p_result_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : + // add($p_filelist, $p_add_dir="", $p_remove_dir="") + // add($p_filelist, $p_option, $p_option_value, ...) + // Description : + // This method supports two synopsis. The first one is historical. + // This methods add the list of files in an existing archive. + // If a file with the same name already exists, it is added at the end of the + // archive, the first one is still present. + // If the archive does not exist, it is created. + // Parameters : + // $p_filelist : An array containing file or directory names, or + // a string containing one filename or one directory name, or + // a string containing a list of filenames and/or directory + // names separated by spaces. + // $p_add_dir : A path to add before the real path of the archived file, + // in order to have it memorized in the archive. + // $p_remove_dir : A path to remove from the real path of the file to archive, + // in order to have a shorter path memorized in the archive. + // When $p_add_dir and $p_remove_dir are set, $p_remove_dir + // is removed first, before $p_add_dir is added. + // Options : + // PCLZIP_OPT_ADD_PATH : + // PCLZIP_OPT_REMOVE_PATH : + // PCLZIP_OPT_REMOVE_ALL_PATH : + // PCLZIP_OPT_COMMENT : + // PCLZIP_OPT_ADD_COMMENT : + // PCLZIP_OPT_PREPEND_COMMENT : + // PCLZIP_CB_PRE_ADD : + // PCLZIP_CB_POST_ADD : + // Return Values : + // 0 on failure, + // The list of the added files, with a status of the add action. + // (see PclZip::listContent() for list entry format) + // -------------------------------------------------------------------------------- + public function add($p_filelist) + { + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Set default values + $v_options = array(); + $v_options[PCLZIP_OPT_NO_COMPRESSION] = false; + + // ----- Look for variable options arguments + $v_size = func_num_args(); + + // ----- Look for arguments + if ($v_size > 1) { + // ----- Get the arguments + $v_arg_list = func_get_args(); + + // ----- Remove form the options list the first argument + array_shift($v_arg_list); + $v_size--; + + // ----- Look for first arg + if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { + // ----- Parse the options + $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array ( + PCLZIP_OPT_REMOVE_PATH => 'optional', + PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', + PCLZIP_OPT_ADD_PATH => 'optional', + PCLZIP_CB_PRE_ADD => 'optional', + PCLZIP_CB_POST_ADD => 'optional', + PCLZIP_OPT_NO_COMPRESSION => 'optional', + PCLZIP_OPT_COMMENT => 'optional', + PCLZIP_OPT_ADD_COMMENT => 'optional', + PCLZIP_OPT_PREPEND_COMMENT => 'optional', + PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', + PCLZIP_OPT_TEMP_FILE_ON => 'optional', + PCLZIP_OPT_TEMP_FILE_OFF => 'optional' + //, PCLZIP_OPT_CRYPT => 'optional' + )); + if ($v_result != 1) { + return 0; + } + } else { + // ----- Look for 2 args + // Here we need to support the first historic synopsis of the + // method. + // ----- Get the first argument + $v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0]; + + // ----- Look for the optional second argument + if ($v_size == 2) { + $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; + } elseif ($v_size > 2) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); + + // ----- Return + return 0; + } + } + } + + // ----- Look for default option values + $this->privOptionDefaultThreshold($v_options); + + // ----- Init + $v_string_list = array(); + $v_att_list = array(); + $v_filedescr_list = array(); + $p_result_list = array(); + + // ----- Look if the $p_filelist is really an array + if (is_array($p_filelist)) { + // ----- Look if the first element is also an array + // This will mean that this is a file description entry + if (isset($p_filelist[0]) && is_array($p_filelist[0])) { + $v_att_list = $p_filelist; + } else { + // ----- The list is a list of string names + $v_string_list = $p_filelist; + } + } elseif (is_string($p_filelist)) { + // ----- Look if the $p_filelist is a string + // ----- Create a list from the string + $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); + } else { + // ----- Invalid variable type for $p_filelist + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type '".gettype($p_filelist)."' for p_filelist"); + return 0; + } + + // ----- Reformat the string list + if (sizeof($v_string_list) != 0) { + foreach ($v_string_list as $v_string) { + $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; + } + } + + // ----- For each file in the list check the attributes + $v_supported_attributes = array( + PCLZIP_ATT_FILE_NAME => 'mandatory', + PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional', + PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional', + PCLZIP_ATT_FILE_MTIME => 'optional', + PCLZIP_ATT_FILE_CONTENT => 'optional', + PCLZIP_ATT_FILE_COMMENT => 'optional', + ); + foreach ($v_att_list as $v_entry) { + $v_result = $this->privFileDescrParseAtt($v_entry, $v_filedescr_list[], $v_options, $v_supported_attributes); + if ($v_result != 1) { + return 0; + } + } + + // ----- Expand the filelist (expand directories) + $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); + if ($v_result != 1) { + return 0; + } + + // ----- Call the create fct + $v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options); + if ($v_result != 1) { + return 0; + } + + // ----- Return + return $p_result_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : listContent() + // Description : + // This public method, gives the list of the files and directories, with their + // properties. + // The properties of each entries in the list are (used also in other functions) : + // filename : Name of the file. For a create or add action it is the filename + // given by the user. For an extract function it is the filename + // of the extracted file. + // stored_filename : Name of the file / directory stored in the archive. + // size : Size of the stored file. + // compressed_size : Size of the file's data compressed in the archive + // (without the headers overhead) + // mtime : Last known modification date of the file (UNIX timestamp) + // comment : Comment associated with the file + // folder : true | false + // index : index of the file in the archive + // status : status of the action (depending of the action) : + // Values are : + // ok : OK ! + // filtered : the file / dir is not extracted (filtered by user) + // already_a_directory : the file can not be extracted because a + // directory with the same name already exists + // write_protected : the file can not be extracted because a file + // with the same name already exists and is + // write protected + // newer_exist : the file was not extracted because a newer file exists + // path_creation_fail : the file is not extracted because the folder + // does not exist and can not be created + // write_error : the file was not extracted because there was a + // error while writing the file + // read_error : the file was not extracted because there was a error + // while reading the file + // invalid_header : the file was not extracted because of an archive + // format error (bad file header) + // Note that each time a method can continue operating when there + // is an action error on a file, the error is only logged in the file status. + // Return Values : + // 0 on an unrecoverable failure, + // The list of the files in the archive. + // -------------------------------------------------------------------------------- + public function listContent() + { + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + return(0); + } + + // ----- Call the extracting fct + $p_list = array(); + if (($v_result = $this->privList($p_list)) != 1) { + unset($p_list); + return(0); + } + + // ----- Return + return $p_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : + // extract($p_path="./", $p_remove_path="") + // extract([$p_option, $p_option_value, ...]) + // Description : + // This method supports two synopsis. The first one is historical. + // This method extract all the files / directories from the archive to the + // folder indicated in $p_path. + // If you want to ignore the 'root' part of path of the memorized files + // you can indicate this in the optional $p_remove_path parameter. + // By default, if a newer file with the same name already exists, the + // file is not extracted. + // + // If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH aoptions + // are used, the path indicated in PCLZIP_OPT_ADD_PATH is append + // at the end of the path value of PCLZIP_OPT_PATH. + // Parameters : + // $p_path : Path where the files and directories are to be extracted + // $p_remove_path : First part ('root' part) of the memorized path + // (if any similar) to remove while extracting. + // Options : + // PCLZIP_OPT_PATH : + // PCLZIP_OPT_ADD_PATH : + // PCLZIP_OPT_REMOVE_PATH : + // PCLZIP_OPT_REMOVE_ALL_PATH : + // PCLZIP_CB_PRE_EXTRACT : + // PCLZIP_CB_POST_EXTRACT : + // Return Values : + // 0 or a negative value on failure, + // The list of the extracted files, with a status of the action. + // (see PclZip::listContent() for list entry format) + // -------------------------------------------------------------------------------- + public function extract() + { + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + return(0); + } + + // ----- Set default values + $v_options = array(); + // $v_path = "./"; + $v_path = ''; + $v_remove_path = ""; + $v_remove_all_path = false; + + // ----- Look for variable options arguments + $v_size = func_num_args(); + + // ----- Default values for option + $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = false; + + // ----- Look for arguments + if ($v_size > 0) { + // ----- Get the arguments + $v_arg_list = func_get_args(); + + // ----- Look for first arg + if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { + // ----- Parse the options + $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array ( + PCLZIP_OPT_PATH => 'optional', + PCLZIP_OPT_REMOVE_PATH => 'optional', + PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', + PCLZIP_OPT_ADD_PATH => 'optional', + PCLZIP_CB_PRE_EXTRACT => 'optional', + PCLZIP_CB_POST_EXTRACT => 'optional', + PCLZIP_OPT_SET_CHMOD => 'optional', + PCLZIP_OPT_BY_NAME => 'optional', + PCLZIP_OPT_BY_EREG => 'optional', + PCLZIP_OPT_BY_PREG => 'optional', + PCLZIP_OPT_BY_INDEX => 'optional', + PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', + PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional', + PCLZIP_OPT_REPLACE_NEWER => 'optional', + PCLZIP_OPT_STOP_ON_ERROR => 'optional', + PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional', + PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', + PCLZIP_OPT_TEMP_FILE_ON => 'optional', + PCLZIP_OPT_TEMP_FILE_OFF => 'optional' + )); + if ($v_result != 1) { + return 0; + } + + // ----- Set the arguments + if (isset($v_options[PCLZIP_OPT_PATH])) { + $v_path = $v_options[PCLZIP_OPT_PATH]; + } + if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { + $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; + } + if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { + $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; + } + if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { + // ----- Check for '/' in last path char + if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { + $v_path .= '/'; + } + $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; + } + } else { + // ----- Look for 2 args + // Here we need to support the first historic synopsis of the + // method. + // ----- Get the first argument + $v_path = $v_arg_list[0]; + + // ----- Look for the optional second argument + if ($v_size == 2) { + $v_remove_path = $v_arg_list[1]; + } elseif ($v_size > 2) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); + + // ----- Return + return 0; + } + } + } + + // ----- Look for default option values + $this->privOptionDefaultThreshold($v_options); + + // ----- Trace + + // ----- Call the extracting fct + $p_list = array(); + $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options); + if ($v_result < 1) { + unset($p_list); + return(0); + } + + // ----- Return + return $p_list; + } + // -------------------------------------------------------------------------------- + + + // -------------------------------------------------------------------------------- + // Function : + // extractByIndex($p_index, $p_path="./", $p_remove_path="") + // extractByIndex($p_index, [$p_option, $p_option_value, ...]) + // Description : + // This method supports two synopsis. The first one is historical. + // This method is doing a partial extract of the archive. + // The extracted files or folders are identified by their index in the + // archive (from 0 to n). + // Note that if the index identify a folder, only the folder entry is + // extracted, not all the files included in the archive. + // Parameters : + // $p_index : A single index (integer) or a string of indexes of files to + // extract. The form of the string is "0,4-6,8-12" with only numbers + // and '-' for range or ',' to separate ranges. No spaces or ';' + // are allowed. + // $p_path : Path where the files and directories are to be extracted + // $p_remove_path : First part ('root' part) of the memorized path + // (if any similar) to remove while extracting. + // Options : + // PCLZIP_OPT_PATH : + // PCLZIP_OPT_ADD_PATH : + // PCLZIP_OPT_REMOVE_PATH : + // PCLZIP_OPT_REMOVE_ALL_PATH : + // PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and + // not as files. + // The resulting content is in a new field 'content' in the file + // structure. + // This option must be used alone (any other options are ignored). + // PCLZIP_CB_PRE_EXTRACT : + // PCLZIP_CB_POST_EXTRACT : + // Return Values : + // 0 on failure, + // The list of the extracted files, with a status of the action. + // (see PclZip::listContent() for list entry format) + // -------------------------------------------------------------------------------- + //function extractByIndex($p_index, options...) + public function extractByIndex($p_index) + { + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + return(0); + } + + // ----- Set default values + $v_options = array(); + // $v_path = "./"; + $v_path = ''; + $v_remove_path = ""; + $v_remove_all_path = false; + + // ----- Look for variable options arguments + $v_size = func_num_args(); + + // ----- Default values for option + $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = false; + + // ----- Look for arguments + if ($v_size > 1) { + // ----- Get the arguments + $v_arg_list = func_get_args(); + + // ----- Remove form the options list the first argument + array_shift($v_arg_list); + $v_size--; + + // ----- Look for first arg + if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { + // ----- Parse the options + $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array( + PCLZIP_OPT_PATH => 'optional', + PCLZIP_OPT_REMOVE_PATH => 'optional', + PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', + PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', + PCLZIP_OPT_ADD_PATH => 'optional', + PCLZIP_CB_PRE_EXTRACT => 'optional', + PCLZIP_CB_POST_EXTRACT => 'optional', + PCLZIP_OPT_SET_CHMOD => 'optional', + PCLZIP_OPT_REPLACE_NEWER => 'optional', + PCLZIP_OPT_STOP_ON_ERROR => 'optional', + PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional', + PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', + PCLZIP_OPT_TEMP_FILE_ON => 'optional', + PCLZIP_OPT_TEMP_FILE_OFF => 'optional' + )); + if ($v_result != 1) { + return 0; + } + + // ----- Set the arguments + if (isset($v_options[PCLZIP_OPT_PATH])) { + $v_path = $v_options[PCLZIP_OPT_PATH]; + } + if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { + $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; + } + if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { + $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; + } + if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { + // ----- Check for '/' in last path char + if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { + $v_path .= '/'; + } + $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; + } + if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) { + $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = false; + } else { + } + } else { + // ----- Look for 2 args + // Here we need to support the first historic synopsis of the + // method. + + // ----- Get the first argument + $v_path = $v_arg_list[0]; + + // ----- Look for the optional second argument + if ($v_size == 2) { + $v_remove_path = $v_arg_list[1]; + } elseif ($v_size > 2) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); + + // ----- Return + return 0; + } + } + } + + // ----- Trace + + // ----- Trick + // Here I want to reuse extractByRule(), so I need to parse the $p_index + // with privParseOptions() + $v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index); + $v_options_trick = array(); + $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick, array (PCLZIP_OPT_BY_INDEX => 'optional')); + if ($v_result != 1) { + return 0; + } + $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX]; + + // ----- Look for default option values + $this->privOptionDefaultThreshold($v_options); + + // ----- Call the extracting fct + if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) { + return(0); + } + + // ----- Return + return $p_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : + // delete([$p_option, $p_option_value, ...]) + // Description : + // This method removes files from the archive. + // If no parameters are given, then all the archive is emptied. + // Parameters : + // None or optional arguments. + // Options : + // PCLZIP_OPT_BY_INDEX : + // PCLZIP_OPT_BY_NAME : + // PCLZIP_OPT_BY_EREG : + // PCLZIP_OPT_BY_PREG : + // Return Values : + // 0 on failure, + // The list of the files which are still present in the archive. + // (see PclZip::listContent() for list entry format) + // -------------------------------------------------------------------------------- + public function delete() + { + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + return(0); + } + + // ----- Set default values + $v_options = array(); + + // ----- Look for variable options arguments + $v_size = func_num_args(); + + // ----- Look for arguments + if ($v_size > 0) { + // ----- Get the arguments + $v_arg_list = func_get_args(); + + // ----- Parse the options + $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array ( + PCLZIP_OPT_BY_NAME => 'optional', + PCLZIP_OPT_BY_EREG => 'optional', + PCLZIP_OPT_BY_PREG => 'optional', + PCLZIP_OPT_BY_INDEX => 'optional' + )); + if ($v_result != 1) { + return 0; + } + } + + // ----- Magic quotes trick + $this->privDisableMagicQuotes(); + + // ----- Call the delete fct + $v_list = array(); + if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) { + $this->privSwapBackMagicQuotes(); + unset($v_list); + return(0); + } + + // ----- Magic quotes trick + $this->privSwapBackMagicQuotes(); + + // ----- Return + return $v_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : deleteByIndex() + // Description : + // ***** Deprecated ***** + // delete(PCLZIP_OPT_BY_INDEX, $p_index) should be prefered. + // -------------------------------------------------------------------------------- + public function deleteByIndex($p_index) + { + + $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index); + + // ----- Return + return $p_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : properties() + // Description : + // This method gives the properties of the archive. + // The properties are : + // nb : Number of files in the archive + // comment : Comment associated with the archive file + // status : not_exist, ok + // Parameters : + // None + // Return Values : + // 0 on failure, + // An array with the archive properties. + // -------------------------------------------------------------------------------- + public function properties() + { + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Magic quotes trick + $this->privDisableMagicQuotes(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + $this->privSwapBackMagicQuotes(); + return(0); + } + + // ----- Default properties + $v_prop = array(); + $v_prop['comment'] = ''; + $v_prop['nb'] = 0; + $v_prop['status'] = 'not_exist'; + + // ----- Look if file exists + if (@is_file($this->zipname)) { + // ----- Open the zip file + if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) { + $this->privSwapBackMagicQuotes(); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); + + // ----- Return + return 0; + } + + // ----- Read the central directory informations + $v_central_dir = array(); + if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { + $this->privSwapBackMagicQuotes(); + return 0; + } + + // ----- Close the zip file + $this->privCloseFd(); + + // ----- Set the user attributes + $v_prop['comment'] = $v_central_dir['comment']; + $v_prop['nb'] = $v_central_dir['entries']; + $v_prop['status'] = 'ok'; + } + + // ----- Magic quotes trick + $this->privSwapBackMagicQuotes(); + + // ----- Return + return $v_prop; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : duplicate() + // Description : + // This method creates an archive by copying the content of an other one. If + // the archive already exist, it is replaced by the new one without any warning. + // Parameters : + // $p_archive : The filename of a valid archive, or + // a valid PclZip object. + // Return Values : + // 1 on success. + // 0 or a negative value on error (error code). + // -------------------------------------------------------------------------------- + public function duplicate($p_archive) + { + $v_result = 1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Look if the $p_archive is a PclZip object + if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip')) { + // ----- Duplicate the archive + $v_result = $this->privDuplicate($p_archive->zipname); + } elseif (is_string($p_archive)) { + // ----- Look if the $p_archive is a string (so a filename) + // ----- Check that $p_archive is a valid zip file + // TBC : Should also check the archive format + if (!is_file($p_archive)) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'"); + $v_result = PCLZIP_ERR_MISSING_FILE; + } else { + // ----- Duplicate the archive + $v_result = $this->privDuplicate($p_archive); + } + } else { + // ----- Invalid variable + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); + $v_result = PCLZIP_ERR_INVALID_PARAMETER; + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : merge() + // Description : + // This method merge the $p_archive_to_add archive at the end of the current + // one ($this). + // If the archive ($this) does not exist, the merge becomes a duplicate. + // If the $p_archive_to_add archive does not exist, the merge is a success. + // Parameters : + // $p_archive_to_add : It can be directly the filename of a valid zip archive, + // or a PclZip object archive. + // Return Values : + // 1 on success, + // 0 or negative values on error (see below). + // -------------------------------------------------------------------------------- + public function merge($p_archive_to_add) + { + $v_result = 1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + return(0); + } + + // ----- Look if the $p_archive_to_add is a PclZip object + if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip')) { + // ----- Merge the archive + $v_result = $this->privMerge($p_archive_to_add); + } elseif (is_string($p_archive_to_add)) { + // ----- Look if the $p_archive_to_add is a string (so a filename) + // ----- Create a temporary archive + $v_object_archive = new PclZip($p_archive_to_add); + + // ----- Merge the archive + $v_result = $this->privMerge($v_object_archive); + } else { + // ----- Invalid variable + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); + $v_result = PCLZIP_ERR_INVALID_PARAMETER; + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + + + // -------------------------------------------------------------------------------- + // Function : errorCode() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + public function errorCode() + { + if (PCLZIP_ERROR_EXTERNAL == 1) { + return(PclErrorCode()); + } else { + return($this->error_code); + } + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : errorName() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + public function errorName($p_with_code = false) + { + $v_name = array( + PCLZIP_ERR_NO_ERROR => 'PCLZIP_ERR_NO_ERROR', + PCLZIP_ERR_WRITE_OPEN_FAIL => 'PCLZIP_ERR_WRITE_OPEN_FAIL', + PCLZIP_ERR_READ_OPEN_FAIL => 'PCLZIP_ERR_READ_OPEN_FAIL', + PCLZIP_ERR_INVALID_PARAMETER => 'PCLZIP_ERR_INVALID_PARAMETER', + PCLZIP_ERR_MISSING_FILE => 'PCLZIP_ERR_MISSING_FILE', + PCLZIP_ERR_FILENAME_TOO_LONG => 'PCLZIP_ERR_FILENAME_TOO_LONG', + PCLZIP_ERR_INVALID_ZIP => 'PCLZIP_ERR_INVALID_ZIP', + PCLZIP_ERR_BAD_EXTRACTED_FILE => 'PCLZIP_ERR_BAD_EXTRACTED_FILE', + PCLZIP_ERR_DIR_CREATE_FAIL => 'PCLZIP_ERR_DIR_CREATE_FAIL', + PCLZIP_ERR_BAD_EXTENSION => 'PCLZIP_ERR_BAD_EXTENSION', + PCLZIP_ERR_BAD_FORMAT => 'PCLZIP_ERR_BAD_FORMAT', + PCLZIP_ERR_DELETE_FILE_FAIL => 'PCLZIP_ERR_DELETE_FILE_FAIL', + PCLZIP_ERR_RENAME_FILE_FAIL => 'PCLZIP_ERR_RENAME_FILE_FAIL', + PCLZIP_ERR_BAD_CHECKSUM => 'PCLZIP_ERR_BAD_CHECKSUM', + PCLZIP_ERR_INVALID_ARCHIVE_ZIP => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', + PCLZIP_ERR_MISSING_OPTION_VALUE => 'PCLZIP_ERR_MISSING_OPTION_VALUE', + PCLZIP_ERR_INVALID_OPTION_VALUE => 'PCLZIP_ERR_INVALID_OPTION_VALUE', + PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', + PCLZIP_ERR_UNSUPPORTED_ENCRYPTION => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION', + PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE => 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE', + PCLZIP_ERR_DIRECTORY_RESTRICTION => 'PCLZIP_ERR_DIRECTORY_RESTRICTION', + ); + + if (isset($v_name[$this->error_code])) { + $v_value = $v_name[$this->error_code]; + } else { + $v_value = 'NoName'; + } + + if ($p_with_code) { + return($v_value.' ('.$this->error_code.')'); + } else { + return($v_value); + } + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : errorInfo() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + public function errorInfo($p_full = false) + { + if (PCLZIP_ERROR_EXTERNAL == 1) { + return(PclErrorString()); + } else { + if ($p_full) { + return($this->errorName(true)." : ".$this->error_string); + } else { + return($this->error_string." [code ".$this->error_code."]"); + } + } + } + // -------------------------------------------------------------------------------- + + + // -------------------------------------------------------------------------------- + // ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS ***** + // ***** ***** + // ***** THESES FUNCTIONS MUST NOT BE USED DIRECTLY ***** + // -------------------------------------------------------------------------------- + + + + // -------------------------------------------------------------------------------- + // Function : privCheckFormat() + // Description : + // This method check that the archive exists and is a valid zip archive. + // Several level of check exists. (futur) + // Parameters : + // $p_level : Level of check. Default 0. + // 0 : Check the first bytes (magic codes) (default value)) + // 1 : 0 + Check the central directory (futur) + // 2 : 1 + Check each file header (futur) + // Return Values : + // true on success, + // false on error, the error code is set. + // -------------------------------------------------------------------------------- + public function privCheckFormat($p_level = 0) + { + $v_result = true; + + // ----- Reset the file system cache + clearstatcache(); + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Look if the file exits + if (!is_file($this->zipname)) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '".$this->zipname."'"); + return(false); + } + + // ----- Check that the file is readeable + if (!is_readable($this->zipname)) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->zipname."'"); + return(false); + } + + // ----- Check the magic code + // TBC + + // ----- Check the central header + // TBC + + // ----- Check each file header + // TBC + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privParseOptions() + // Description : + // This internal methods reads the variable list of arguments ($p_options_list, + // $p_size) and generate an array with the options and values ($v_result_list). + // $v_requested_options contains the options that can be present and those that + // must be present. + // $v_requested_options is an array, with the option value as key, and 'optional', + // or 'mandatory' as value. + // Parameters : + // See above. + // Return Values : + // 1 on success. + // 0 on failure. + // -------------------------------------------------------------------------------- + public function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options = false) + { + $v_result=1; + + // ----- Read the options + $i=0; + while ($i<$p_size) { + // ----- Check if the option is supported + if (!isset($v_requested_options[$p_options_list[$i]])) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid optional parameter '".$p_options_list[$i]."' for this method"); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Look for next option + switch ($p_options_list[$i]) { + // ----- Look for options that request a path value + case PCLZIP_OPT_PATH: + case PCLZIP_OPT_REMOVE_PATH: + case PCLZIP_OPT_ADD_PATH: + // ----- Check the number of parameters + if (($i+1) >= $p_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Get the value + $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], false); + $i++; + break; + + case PCLZIP_OPT_TEMP_FILE_THRESHOLD: + // ----- Check the number of parameters + if (($i+1) >= $p_size) { + PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + return PclZip::errorCode(); + } + + // ----- Check for incompatible options + if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'"); + return PclZip::errorCode(); + } + + // ----- Check the value + $v_value = $p_options_list[$i+1]; + if ((!is_integer($v_value)) || ($v_value<0)) { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Integer expected for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + return PclZip::errorCode(); + } + + // ----- Get the value (and convert it in bytes) + $v_result_list[$p_options_list[$i]] = $v_value*1048576; + $i++; + break; + + case PCLZIP_OPT_TEMP_FILE_ON: + // ----- Check for incompatible options + if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'"); + return PclZip::errorCode(); + } + + $v_result_list[$p_options_list[$i]] = true; + break; + + case PCLZIP_OPT_TEMP_FILE_OFF: + // ----- Check for incompatible options + if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_ON])) { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_ON'"); + return PclZip::errorCode(); + } + // ----- Check for incompatible options + if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_THRESHOLD'"); + return PclZip::errorCode(); + } + $v_result_list[$p_options_list[$i]] = true; + break; + + case PCLZIP_OPT_EXTRACT_DIR_RESTRICTION: + // ----- Check the number of parameters + if (($i+1) >= $p_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + // ----- Return + return PclZip::errorCode(); + } + + // ----- Get the value + if (is_string($p_options_list[$i+1]) && ($p_options_list[$i+1] != '')) { + $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], false); + $i++; + } else { + } + break; + // ----- Look for options that request an array of string for value + case PCLZIP_OPT_BY_NAME: + // ----- Check the number of parameters + if (($i+1) >= $p_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + // ----- Return + return PclZip::errorCode(); + } + + // ----- Get the value + if (is_string($p_options_list[$i+1])) { + $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1]; + } elseif (is_array($p_options_list[$i+1])) { + $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; + } else { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + // ----- Return + return PclZip::errorCode(); + } + $i++; + break; + // ----- Look for options that request an EREG or PREG expression + case PCLZIP_OPT_BY_EREG: + // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG + // to PCLZIP_OPT_BY_PREG + $p_options_list[$i] = PCLZIP_OPT_BY_PREG; + case PCLZIP_OPT_BY_PREG: + //case PCLZIP_OPT_CRYPT : + // ----- Check the number of parameters + if (($i+1) >= $p_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + // ----- Return + return PclZip::errorCode(); + } + + // ----- Get the value + if (is_string($p_options_list[$i+1])) { + $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; + } else { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + // ----- Return + return PclZip::errorCode(); + } + $i++; + break; + + // ----- Look for options that takes a string + case PCLZIP_OPT_COMMENT: + case PCLZIP_OPT_ADD_COMMENT: + case PCLZIP_OPT_PREPEND_COMMENT: + // ----- Check the number of parameters + if (($i+1) >= $p_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Get the value + if (is_string($p_options_list[$i+1])) { + $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; + } else { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '" .PclZipUtilOptionText($p_options_list[$i]) ."'"); + + // ----- Return + return PclZip::errorCode(); + } + $i++; + break; + + // ----- Look for options that request an array of index + case PCLZIP_OPT_BY_INDEX: + // ----- Check the number of parameters + if (($i+1) >= $p_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Get the value + $v_work_list = array(); + if (is_string($p_options_list[$i+1])) { + // ----- Remove spaces + $p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', ''); + + // ----- Parse items + $v_work_list = explode(",", $p_options_list[$i+1]); + } elseif (is_integer($p_options_list[$i+1])) { + $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1]; + } elseif (is_array($p_options_list[$i+1])) { + $v_work_list = $p_options_list[$i+1]; + } else { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Reduce the index list + // each index item in the list must be a couple with a start and + // an end value : [0,3], [5-5], [8-10], ... + // ----- Check the format of each item + $v_sort_flag=false; + $v_sort_value=0; + for ($j=0; $j<sizeof($v_work_list); $j++) { + // ----- Explode the item + $v_item_list = explode("-", $v_work_list[$j]); + $v_size_item_list = sizeof($v_item_list); + + // ----- TBC : Here we might check that each item is a + // real integer ... + + // ----- Look for single value + if ($v_size_item_list == 1) { + // ----- Set the option value + $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0]; + $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[0]; + } elseif ($v_size_item_list == 2) { + // ----- Set the option value + $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0]; + $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[1]; + } else { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Too many values in index range for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + + // ----- Return + return PclZip::errorCode(); + } + + + // ----- Look for list sort + if ($v_result_list[$p_options_list[$i]][$j]['start'] < $v_sort_value) { + $v_sort_flag=true; + + // ----- TBC : An automatic sort should be writen ... + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Invalid order of index range for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + + // ----- Return + return PclZip::errorCode(); + } + $v_sort_value = $v_result_list[$p_options_list[$i]][$j]['start']; + } + + // ----- Sort the items + if ($v_sort_flag) { + // TBC : To Be Completed + } + // ----- Next option + $i++; + break; + // ----- Look for options that request no value + case PCLZIP_OPT_REMOVE_ALL_PATH: + case PCLZIP_OPT_EXTRACT_AS_STRING: + case PCLZIP_OPT_NO_COMPRESSION: + case PCLZIP_OPT_EXTRACT_IN_OUTPUT: + case PCLZIP_OPT_REPLACE_NEWER: + case PCLZIP_OPT_STOP_ON_ERROR: + $v_result_list[$p_options_list[$i]] = true; + break; + // ----- Look for options that request an octal value + case PCLZIP_OPT_SET_CHMOD: + // ----- Check the number of parameters + if (($i+1) >= $p_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + // ----- Return + return PclZip::errorCode(); + } + // ----- Get the value + $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; + $i++; + break; + + // ----- Look for options that request a call-back + case PCLZIP_CB_PRE_EXTRACT: + case PCLZIP_CB_POST_EXTRACT: + case PCLZIP_CB_PRE_ADD: + case PCLZIP_CB_POST_ADD: + /* for futur use + case PCLZIP_CB_PRE_DELETE : + case PCLZIP_CB_POST_DELETE : + case PCLZIP_CB_PRE_LIST : + case PCLZIP_CB_POST_LIST : + */ + // ----- Check the number of parameters + if (($i+1) >= $p_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + // ----- Return + return PclZip::errorCode(); + } + + // ----- Get the value + $v_function_name = $p_options_list[$i+1]; + + // ----- Check that the value is a valid existing function + if (!function_exists($v_function_name)) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Function '".$v_function_name."()' is not an existing function for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + // ----- Return + return PclZip::errorCode(); + } + + // ----- Set the attribute + $v_result_list[$p_options_list[$i]] = $v_function_name; + $i++; + break; + default: + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Unknown parameter '" .$p_options_list[$i]."'"); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Next options + $i++; + } + + // ----- Look for mandatory options + if ($v_requested_options !== false) { + for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { + // ----- Look for mandatory option + if ($v_requested_options[$key] == 'mandatory') { + // ----- Look if present + if (!isset($v_result_list[$key])) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); + + // ----- Return + return PclZip::errorCode(); + } + } + } + } + + // ----- Look for default values + if (!isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) { + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privOptionDefaultThreshold() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privOptionDefaultThreshold(&$p_options) + { + $v_result=1; + + if (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) || isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) { + return $v_result; + } + + // ----- Get 'memory_limit' configuration value + $v_memory_limit = ini_get('memory_limit'); + $v_memory_limit = trim($v_memory_limit); + $last = strtolower(substr($v_memory_limit, -1)); + + if ($last == 'g') { + //$v_memory_limit = $v_memory_limit*1024*1024*1024; + $v_memory_limit = $v_memory_limit*1073741824; + } + if ($last == 'm') { + //$v_memory_limit = $v_memory_limit*1024*1024; + $v_memory_limit = $v_memory_limit*1048576; + } + if ($last == 'k') { + $v_memory_limit = $v_memory_limit*1024; + } + + $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit*PCLZIP_TEMPORARY_FILE_RATIO); + + // ----- Sanity check : No threshold if value lower than 1M + if ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] < 1048576) { + unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]); + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privFileDescrParseAtt() + // Description : + // Parameters : + // Return Values : + // 1 on success. + // 0 on failure. + // -------------------------------------------------------------------------------- + public function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options = false) + { + $v_result=1; + + // ----- For each file in the list check the attributes + foreach ($p_file_list as $v_key => $v_value) { + // ----- Check if the option is supported + if (!isset($v_requested_options[$v_key])) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file attribute '".$v_key."' for this file"); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Look for attribute + switch ($v_key) { + case PCLZIP_ATT_FILE_NAME: + if (!is_string($v_value)) { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); + return PclZip::errorCode(); + } + + $p_filedescr['filename'] = PclZipUtilPathReduction($v_value); + + if ($p_filedescr['filename'] == '') { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'"); + return PclZip::errorCode(); + } + break; + case PCLZIP_ATT_FILE_NEW_SHORT_NAME: + if (!is_string($v_value)) { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); + return PclZip::errorCode(); + } + + $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value); + + if ($p_filedescr['new_short_name'] == '') { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'"); + return PclZip::errorCode(); + } + break; + case PCLZIP_ATT_FILE_NEW_FULL_NAME: + if (!is_string($v_value)) { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); + return PclZip::errorCode(); + } + + $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value); + + if ($p_filedescr['new_full_name'] == '') { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'"); + return PclZip::errorCode(); + } + break; + // ----- Look for options that takes a string + case PCLZIP_ATT_FILE_COMMENT: + if (!is_string($v_value)) { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); + return PclZip::errorCode(); + } + $p_filedescr['comment'] = $v_value; + break; + case PCLZIP_ATT_FILE_MTIME: + if (!is_integer($v_value)) { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". Integer expected for attribute '".PclZipUtilOptionText($v_key)."'"); + return PclZip::errorCode(); + } + $p_filedescr['mtime'] = $v_value; + break; + case PCLZIP_ATT_FILE_CONTENT: + $p_filedescr['content'] = $v_value; + break; + default: + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Unknown parameter '".$v_key."'"); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Look for mandatory options + if ($v_requested_options !== false) { + for ($key = reset($v_requested_options); $key = key($v_requested_options); $key = next($v_requested_options)) { + // ----- Look for mandatory option + if ($v_requested_options[$key] == 'mandatory') { + // ----- Look if present + if (!isset($p_file_list[$key])) { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); + return PclZip::errorCode(); + } + } + } + } + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privFileDescrExpand() + // Description : + // This method look for each item of the list to see if its a file, a folder + // or a string to be added as file. For any other type of files (link, other) + // just ignore the item. + // Then prepare the information that will be stored for that file. + // When its a folder, expand the folder with all the files that are in that + // folder (recursively). + // Parameters : + // Return Values : + // 1 on success. + // 0 on failure. + // -------------------------------------------------------------------------------- + public function privFileDescrExpand(&$p_filedescr_list, &$p_options) + { + $v_result=1; + + // ----- Create a result list + $v_result_list = array(); + + // ----- Look each entry + for ($i=0; $i<sizeof($p_filedescr_list); $i++) { + // ----- Get filedescr + $v_descr = $p_filedescr_list[$i]; + + // ----- Reduce the filename + $v_descr['filename'] = PclZipUtilTranslateWinPath($v_descr['filename'], false); + $v_descr['filename'] = PclZipUtilPathReduction($v_descr['filename']); + + // ----- Look for real file or folder + if (file_exists($v_descr['filename'])) { + if (@is_file($v_descr['filename'])) { + $v_descr['type'] = 'file'; + } elseif (@is_dir($v_descr['filename'])) { + $v_descr['type'] = 'folder'; + } elseif (@is_link($v_descr['filename'])) { + // skip + continue; + } else { + // skip + continue; + } + } elseif (isset($v_descr['content'])) { + // ----- Look for string added as file + $v_descr['type'] = 'virtual_file'; + } else { + // ----- Missing file + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$v_descr['filename']."' does not exist"); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Calculate the stored filename + $this->privCalculateStoredFilename($v_descr, $p_options); + + // ----- Add the descriptor in result list + $v_result_list[sizeof($v_result_list)] = $v_descr; + + // ----- Look for folder + if ($v_descr['type'] == 'folder') { + // ----- List of items in folder + $v_dirlist_descr = array(); + $v_dirlist_nb = 0; + if ($v_folder_handler = @opendir($v_descr['filename'])) { + while (($v_item_handler = @readdir($v_folder_handler)) !== false) { + // ----- Skip '.' and '..' + if (($v_item_handler == '.') || ($v_item_handler == '..')) { + continue; + } + + // ----- Compose the full filename + $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler; + + // ----- Look for different stored filename + // Because the name of the folder was changed, the name of the + // files/sub-folders also change + if (($v_descr['stored_filename'] != $v_descr['filename']) + && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) { + if ($v_descr['stored_filename'] != '') { + $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler; + } else { + $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_item_handler; + } + } + $v_dirlist_nb++; + } + + @closedir($v_folder_handler); + } else { + // TBC : unable to open folder in read mode + } + + // ----- Expand each element of the list + if ($v_dirlist_nb != 0) { + // ----- Expand + if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) { + return $v_result; + } + + // ----- Concat the resulting list + $v_result_list = array_merge($v_result_list, $v_dirlist_descr); + } + + // ----- Free local array + unset($v_dirlist_descr); + } + } + + // ----- Get the result list + $p_filedescr_list = $v_result_list; + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privCreate() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privCreate($p_filedescr_list, &$p_result_list, &$p_options) + { + $v_result=1; + $v_list_detail = array(); + + // ----- Magic quotes trick + $this->privDisableMagicQuotes(); + + // ----- Open the file in write mode + if (($v_result = $this->privOpenFd('wb')) != 1) { + // ----- Return + return $v_result; + } + + // ----- Add the list of files + $v_result = $this->privAddList($p_filedescr_list, $p_result_list, $p_options); + + // ----- Close + $this->privCloseFd(); + + // ----- Magic quotes trick + $this->privSwapBackMagicQuotes(); + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privAdd() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privAdd($p_filedescr_list, &$p_result_list, &$p_options) + { + $v_result=1; + $v_list_detail = array(); + + // ----- Look if the archive exists or is empty + if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0)) { + // ----- Do a create + $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options); + + // ----- Return + return $v_result; + } + // ----- Magic quotes trick + $this->privDisableMagicQuotes(); + + // ----- Open the zip file + if (($v_result=$this->privOpenFd('rb')) != 1) { + // ----- Magic quotes trick + $this->privSwapBackMagicQuotes(); + + // ----- Return + return $v_result; + } + + // ----- Read the central directory informations + $v_central_dir = array(); + if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { + $this->privCloseFd(); + $this->privSwapBackMagicQuotes(); + return $v_result; + } + + // ----- Go to beginning of File + @rewind($this->zip_fd); + + // ----- Creates a temporay file + $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; + + // ----- Open the temporary file in write mode + if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) { + $this->privCloseFd(); + $this->privSwapBackMagicQuotes(); + + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Copy the files from the archive to the temporary file + // TBC : Here I should better append the file and go back to erase the central dir + $v_size = $v_central_dir['offset']; + while ($v_size != 0) { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + $v_buffer = fread($this->zip_fd, $v_read_size); + @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Swap the file descriptor + // Here is a trick : I swap the temporary fd with the zip fd, in order to use + // the following methods on the temporary fil and not the real archive + $v_swap = $this->zip_fd; + $this->zip_fd = $v_zip_temp_fd; + $v_zip_temp_fd = $v_swap; + + // ----- Add the files + $v_header_list = array(); + if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) { + fclose($v_zip_temp_fd); + $this->privCloseFd(); + @unlink($v_zip_temp_name); + $this->privSwapBackMagicQuotes(); + + // ----- Return + return $v_result; + } + + // ----- Store the offset of the central dir + $v_offset = @ftell($this->zip_fd); + + // ----- Copy the block of file headers from the old archive + $v_size = $v_central_dir['size']; + while ($v_size != 0) { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + $v_buffer = @fread($v_zip_temp_fd, $v_read_size); + @fwrite($this->zip_fd, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Create the Central Dir files header + for ($i=0, $v_count=0; $i<sizeof($v_header_list); $i++) { + // ----- Create the file header + if ($v_header_list[$i]['status'] == 'ok') { + if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) { + fclose($v_zip_temp_fd); + $this->privCloseFd(); + @unlink($v_zip_temp_name); + $this->privSwapBackMagicQuotes(); + + // ----- Return + return $v_result; + } + $v_count++; + } + + // ----- Transform the header to a 'usable' info + $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); + } + + // ----- Zip file comment + $v_comment = $v_central_dir['comment']; + if (isset($p_options[PCLZIP_OPT_COMMENT])) { + $v_comment = $p_options[PCLZIP_OPT_COMMENT]; + } + if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) { + $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT]; + } + if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) { + $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment; + } + + // ----- Calculate the size of the central header + $v_size = @ftell($this->zip_fd)-$v_offset; + + // ----- Create the central dir footer + if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1) { + // ----- Reset the file list + unset($v_header_list); + $this->privSwapBackMagicQuotes(); + + // ----- Return + return $v_result; + } + + // ----- Swap back the file descriptor + $v_swap = $this->zip_fd; + $this->zip_fd = $v_zip_temp_fd; + $v_zip_temp_fd = $v_swap; + + // ----- Close + $this->privCloseFd(); + + // ----- Close the temporary file + @fclose($v_zip_temp_fd); + + // ----- Magic quotes trick + $this->privSwapBackMagicQuotes(); + + // ----- Delete the zip file + // TBC : I should test the result ... + @unlink($this->zipname); + + // ----- Rename the temporary file + // TBC : I should test the result ... + //@rename($v_zip_temp_name, $this->zipname); + PclZipUtilRename($v_zip_temp_name, $this->zipname); + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privOpenFd() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + public function privOpenFd($p_mode) + { + $v_result=1; + + // ----- Look if already open + if ($this->zip_fd != 0) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->zipname.'\' already open'); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Open the zip file + if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in '.$p_mode.' mode'); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privCloseFd() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + public function privCloseFd() + { + $v_result=1; + + if ($this->zip_fd != 0) { + @fclose($this->zip_fd); + } + $this->zip_fd = 0; + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privAddList() + // Description : + // $p_add_dir and $p_remove_dir will give the ability to memorize a path which is + // different from the real path of the file. This is usefull if you want to have PclTar + // running in any directory, and memorize relative path from an other directory. + // Parameters : + // $p_list : An array containing the file or directory names to add in the tar + // $p_result_list : list of added files with their properties (specially the status field) + // $p_add_dir : Path to add in the filename path archived + // $p_remove_dir : Path to remove in the filename path archived + // Return Values : + // -------------------------------------------------------------------------------- + // public function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options) + public function privAddList($p_filedescr_list, &$p_result_list, &$p_options) + { + $v_result=1; + + // ----- Add the files + $v_header_list = array(); + if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) { + // ----- Return + return $v_result; + } + + // ----- Store the offset of the central dir + $v_offset = @ftell($this->zip_fd); + + // ----- Create the Central Dir files header + for ($i=0, $v_count=0; $i<sizeof($v_header_list); $i++) { + // ----- Create the file header + if ($v_header_list[$i]['status'] == 'ok') { + if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) { + // ----- Return + return $v_result; + } + $v_count++; + } + + // ----- Transform the header to a 'usable' info + $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); + } + + // ----- Zip file comment + $v_comment = ''; + if (isset($p_options[PCLZIP_OPT_COMMENT])) { + $v_comment = $p_options[PCLZIP_OPT_COMMENT]; + } + + // ----- Calculate the size of the central header + $v_size = @ftell($this->zip_fd)-$v_offset; + + // ----- Create the central dir footer + if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1) { + // ----- Reset the file list + unset($v_header_list); + + // ----- Return + return $v_result; + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privAddFileList() + // Description : + // Parameters : + // $p_filedescr_list : An array containing the file description + // or directory names to add in the zip + // $p_result_list : list of added files with their properties (specially the status field) + // Return Values : + // -------------------------------------------------------------------------------- + public function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options) + { + $v_result=1; + $v_header = array(); + + // ----- Recuperate the current number of elt in list + $v_nb = sizeof($p_result_list); + + // ----- Loop on the files + for ($j=0; ($j<sizeof($p_filedescr_list)) && ($v_result==1); $j++) { + // ----- Format the filename + $p_filedescr_list[$j]['filename'] = PclZipUtilTranslateWinPath($p_filedescr_list[$j]['filename'], false); + + // ----- Skip empty file names + // TBC : Can this be possible ? not checked in DescrParseAtt ? + if ($p_filedescr_list[$j]['filename'] == "") { + continue; + } + + // ----- Check the filename + if (($p_filedescr_list[$j]['type'] != 'virtual_file') && (!file_exists($p_filedescr_list[$j]['filename']))) { + PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$p_filedescr_list[$j]['filename']."' does not exist"); + return PclZip::errorCode(); + } + + // ----- Look if it is a file or a dir with no all path remove option + // or a dir with all its path removed + // if ( (is_file($p_filedescr_list[$j]['filename'])) + // || ( is_dir($p_filedescr_list[$j]['filename']) + if (($p_filedescr_list[$j]['type'] == 'file') || ($p_filedescr_list[$j]['type'] == 'virtual_file') || (($p_filedescr_list[$j]['type'] == 'folder') && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]) || !$p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) { + // ----- Add the file + $v_result = $this->privAddFile($p_filedescr_list[$j], $v_header, $p_options); + if ($v_result != 1) { + return $v_result; + } + + // ----- Store the file infos + $p_result_list[$v_nb++] = $v_header; + } + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privAddFile() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privAddFile($p_filedescr, &$p_header, &$p_options) + { + $v_result=1; + + // ----- Working variable + $p_filename = $p_filedescr['filename']; + + // TBC : Already done in the fileAtt check ... ? + if ($p_filename == "") { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)"); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Look for a stored different filename + /* TBC : Removed + if (isset($p_filedescr['stored_filename'])) { + $v_stored_filename = $p_filedescr['stored_filename']; + } + else { + $v_stored_filename = $p_filedescr['stored_filename']; + } + */ + + // ----- Set the file properties + clearstatcache(); + $p_header['version'] = 20; + $p_header['version_extracted'] = 10; + $p_header['flag'] = 0; + $p_header['compression'] = 0; + $p_header['crc'] = 0; + $p_header['compressed_size'] = 0; + $p_header['filename_len'] = strlen($p_filename); + $p_header['extra_len'] = 0; + $p_header['disk'] = 0; + $p_header['internal'] = 0; + $p_header['offset'] = 0; + $p_header['filename'] = $p_filename; + // TBC : Removed $p_header['stored_filename'] = $v_stored_filename; + $p_header['stored_filename'] = $p_filedescr['stored_filename']; + $p_header['extra'] = ''; + $p_header['status'] = 'ok'; + $p_header['index'] = -1; + + // ----- Look for regular file + if ($p_filedescr['type']=='file') { + $p_header['external'] = 0x00000000; + $p_header['size'] = filesize($p_filename); + } elseif ($p_filedescr['type']=='folder') { + // ----- Look for regular folder + $p_header['external'] = 0x00000010; + $p_header['mtime'] = filemtime($p_filename); + $p_header['size'] = filesize($p_filename); + } elseif ($p_filedescr['type'] == 'virtual_file') { + // ----- Look for virtual file + $p_header['external'] = 0x00000000; + $p_header['size'] = strlen($p_filedescr['content']); + } + + // ----- Look for filetime + if (isset($p_filedescr['mtime'])) { + $p_header['mtime'] = $p_filedescr['mtime']; + } elseif ($p_filedescr['type'] == 'virtual_file') { + $p_header['mtime'] = time(); + } else { + $p_header['mtime'] = filemtime($p_filename); + } + + // ------ Look for file comment + if (isset($p_filedescr['comment'])) { + $p_header['comment_len'] = strlen($p_filedescr['comment']); + $p_header['comment'] = $p_filedescr['comment']; + } else { + $p_header['comment_len'] = 0; + $p_header['comment'] = ''; + } + + // ----- Look for pre-add callback + if (isset($p_options[PCLZIP_CB_PRE_ADD])) { + // ----- Generate a local information + $v_local_header = array(); + $this->privConvertHeader2FileInfo($p_header, $v_local_header); + + // ----- Call the callback + // Here I do not use call_user_func() because I need to send a reference to the + // header. + // eval('$v_result = '.$p_options[PCLZIP_CB_PRE_ADD].'(PCLZIP_CB_PRE_ADD, $v_local_header);'); + $v_result = $p_options[PCLZIP_CB_PRE_ADD](PCLZIP_CB_PRE_ADD, $v_local_header); + if ($v_result == 0) { + // ----- Change the file status + $p_header['status'] = "skipped"; + $v_result = 1; + } + + // ----- Update the informations + // Only some fields can be modified + if ($p_header['stored_filename'] != $v_local_header['stored_filename']) { + $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']); + } + } + + // ----- Look for empty stored filename + if ($p_header['stored_filename'] == "") { + $p_header['status'] = "filtered"; + } + + // ----- Check the path length + if (strlen($p_header['stored_filename']) > 0xFF) { + $p_header['status'] = 'filename_too_long'; + } + + // ----- Look if no error, or file not skipped + if ($p_header['status'] == 'ok') { + // ----- Look for a file + if ($p_filedescr['type'] == 'file') { + // ----- Look for using temporary file to zip + if ((!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_header['size'])))) { + $v_result = $this->privAddFileUsingTempFile($p_filedescr, $p_header, $p_options); + if ($v_result < PCLZIP_ERR_NO_ERROR) { + return $v_result; + } + } else { + // ----- Use "in memory" zip algo + // ----- Open the source file + if (($v_file = @fopen($p_filename, "rb")) == 0) { + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); + return PclZip::errorCode(); + } + + // ----- Read the file content + $v_content = @fread($v_file, $p_header['size']); + + // ----- Close the file + @fclose($v_file); + + // ----- Calculate the CRC + $p_header['crc'] = @crc32($v_content); + + // ----- Look for no compression + if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { + // ----- Set header parameters + $p_header['compressed_size'] = $p_header['size']; + $p_header['compression'] = 0; + } else { + // ----- Look for normal compression + // ----- Compress the content + $v_content = @gzdeflate($v_content); + + // ----- Set header parameters + $p_header['compressed_size'] = strlen($v_content); + $p_header['compression'] = 8; + } + + // ----- Call the header generation + if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { + @fclose($v_file); + return $v_result; + } + + // ----- Write the compressed (or not) content + @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']); + } + } elseif ($p_filedescr['type'] == 'virtual_file') { + // ----- Look for a virtual file (a file from string) + $v_content = $p_filedescr['content']; + + // ----- Calculate the CRC + $p_header['crc'] = @crc32($v_content); + + // ----- Look for no compression + if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { + // ----- Set header parameters + $p_header['compressed_size'] = $p_header['size']; + $p_header['compression'] = 0; + } else { + // ----- Look for normal compression + // ----- Compress the content + $v_content = @gzdeflate($v_content); + + // ----- Set header parameters + $p_header['compressed_size'] = strlen($v_content); + $p_header['compression'] = 8; + } + + // ----- Call the header generation + if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { + @fclose($v_file); + return $v_result; + } + + // ----- Write the compressed (or not) content + @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']); + } elseif ($p_filedescr['type'] == 'folder') { + // ----- Look for a directory + // ----- Look for directory last '/' + if (@substr($p_header['stored_filename'], -1) != '/') { + $p_header['stored_filename'] .= '/'; + } + + // ----- Set the file properties + $p_header['size'] = 0; + //$p_header['external'] = 0x41FF0010; // Value for a folder : to be checked + $p_header['external'] = 0x00000010; // Value for a folder : to be checked + + // ----- Call the header generation + if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { + return $v_result; + } + } + } + + // ----- Look for post-add callback + if (isset($p_options[PCLZIP_CB_POST_ADD])) { + // ----- Generate a local information + $v_local_header = array(); + $this->privConvertHeader2FileInfo($p_header, $v_local_header); + + // ----- Call the callback + // Here I do not use call_user_func() because I need to send a reference to the + // header. + // eval('$v_result = '.$p_options[PCLZIP_CB_POST_ADD].'(PCLZIP_CB_POST_ADD, $v_local_header);'); + $v_result = $p_options[PCLZIP_CB_POST_ADD](PCLZIP_CB_POST_ADD, $v_local_header); + if ($v_result == 0) { + // ----- Ignored + $v_result = 1; + } + + // ----- Update the informations + // Nothing can be modified + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privAddFileUsingTempFile() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privAddFileUsingTempFile($p_filedescr, &$p_header, &$p_options) + { + $v_result=PCLZIP_ERR_NO_ERROR; + + // ----- Working variable + $p_filename = $p_filedescr['filename']; + + + // ----- Open the source file + if (($v_file = @fopen($p_filename, "rb")) == 0) { + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); + return PclZip::errorCode(); + } + + // ----- Creates a compressed temporary file + $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz'; + if (($v_file_compressed = @gzopen($v_gzip_temp_name, "wb")) == 0) { + fclose($v_file); + PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode'); + return PclZip::errorCode(); + } + + // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks + $v_size = filesize($p_filename); + while ($v_size != 0) { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + $v_buffer = @fread($v_file, $v_read_size); + //$v_binary_data = pack('a'.$v_read_size, $v_buffer); + @gzputs($v_file_compressed, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Close the file + @fclose($v_file); + @gzclose($v_file_compressed); + + // ----- Check the minimum file size + if (filesize($v_gzip_temp_name) < 18) { + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'gzip temporary file \''.$v_gzip_temp_name.'\' has invalid filesize - should be minimum 18 bytes'); + return PclZip::errorCode(); + } + + // ----- Extract the compressed attributes + if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) { + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); + return PclZip::errorCode(); + } + + // ----- Read the gzip file header + $v_binary_data = @fread($v_file_compressed, 10); + $v_data_header = unpack('a1id1/a1id2/a1cm/a1flag/Vmtime/a1xfl/a1os', $v_binary_data); + + // ----- Check some parameters + $v_data_header['os'] = bin2hex($v_data_header['os']); + + // ----- Read the gzip file footer + @fseek($v_file_compressed, filesize($v_gzip_temp_name)-8); + $v_binary_data = @fread($v_file_compressed, 8); + $v_data_footer = unpack('Vcrc/Vcompressed_size', $v_binary_data); + + // ----- Set the attributes + $p_header['compression'] = ord($v_data_header['cm']); + //$p_header['mtime'] = $v_data_header['mtime']; + $p_header['crc'] = $v_data_footer['crc']; + $p_header['compressed_size'] = filesize($v_gzip_temp_name)-18; + + // ----- Close the file + @fclose($v_file_compressed); + + // ----- Call the header generation + if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { + return $v_result; + } + + // ----- Add the compressed data + if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) { + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); + return PclZip::errorCode(); + } + + // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks + fseek($v_file_compressed, 10); + $v_size = $p_header['compressed_size']; + while ($v_size != 0) { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + $v_buffer = @fread($v_file_compressed, $v_read_size); + //$v_binary_data = pack('a'.$v_read_size, $v_buffer); + @fwrite($this->zip_fd, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Close the file + @fclose($v_file_compressed); + + // ----- Unlink the temporary file + @unlink($v_gzip_temp_name); + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privCalculateStoredFilename() + // Description : + // Based on file descriptor properties and global options, this method + // calculate the filename that will be stored in the archive. + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privCalculateStoredFilename(&$p_filedescr, &$p_options) + { + $v_result=1; + + // ----- Working variables + $p_filename = $p_filedescr['filename']; + if (isset($p_options[PCLZIP_OPT_ADD_PATH])) { + $p_add_dir = $p_options[PCLZIP_OPT_ADD_PATH]; + } else { + $p_add_dir = ''; + } + if (isset($p_options[PCLZIP_OPT_REMOVE_PATH])) { + $p_remove_dir = $p_options[PCLZIP_OPT_REMOVE_PATH]; + } else { + $p_remove_dir = ''; + } + if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { + $p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH]; + } else { + $p_remove_all_dir = 0; + } + + // ----- Look for full name change + if (isset($p_filedescr['new_full_name'])) { + // ----- Remove drive letter if any + $v_stored_filename = PclZipUtilTranslateWinPath($p_filedescr['new_full_name']); + } else { + // ----- Look for path and/or short name change + // ----- Look for short name change + // Its when we cahnge just the filename but not the path + if (isset($p_filedescr['new_short_name'])) { + $v_path_info = pathinfo($p_filename); + $v_dir = ''; + if ($v_path_info['dirname'] != '') { + $v_dir = $v_path_info['dirname'].'/'; + } + $v_stored_filename = $v_dir.$p_filedescr['new_short_name']; + } else { + // ----- Calculate the stored filename + $v_stored_filename = $p_filename; + } + + // ----- Look for all path to remove + if ($p_remove_all_dir) { + $v_stored_filename = basename($p_filename); + } elseif ($p_remove_dir != "") { + // ----- Look for partial path remove + if (substr($p_remove_dir, -1) != '/') { + $p_remove_dir .= "/"; + } + + if ((substr($p_filename, 0, 2) == "./") || (substr($p_remove_dir, 0, 2) == "./")) { + if ((substr($p_filename, 0, 2) == "./") && (substr($p_remove_dir, 0, 2) != "./")) { + $p_remove_dir = "./".$p_remove_dir; + } + if ((substr($p_filename, 0, 2) != "./") && (substr($p_remove_dir, 0, 2) == "./")) { + $p_remove_dir = substr($p_remove_dir, 2); + } + } + + $v_compare = PclZipUtilPathInclusion($p_remove_dir, $v_stored_filename); + if ($v_compare > 0) { + if ($v_compare == 2) { + $v_stored_filename = ""; + } else { + $v_stored_filename = substr($v_stored_filename, strlen($p_remove_dir)); + } + } + } + + // ----- Remove drive letter if any + $v_stored_filename = PclZipUtilTranslateWinPath($v_stored_filename); + + // ----- Look for path to add + if ($p_add_dir != "") { + if (substr($p_add_dir, -1) == "/") { + $v_stored_filename = $p_add_dir.$v_stored_filename; + } else { + $v_stored_filename = $p_add_dir."/".$v_stored_filename; + } + } + } + + // ----- Filename (reduce the path of stored name) + $v_stored_filename = PclZipUtilPathReduction($v_stored_filename); + $p_filedescr['stored_filename'] = $v_stored_filename; + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privWriteFileHeader() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privWriteFileHeader(&$p_header) + { + $v_result=1; + + // ----- Store the offset position of the file + $p_header['offset'] = ftell($this->zip_fd); + + // ----- Transform UNIX mtime to DOS format mdate/mtime + $v_date = getdate($p_header['mtime']); + $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; + $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; + + // ----- Packed data + $v_binary_data = pack("VvvvvvVVVvv", 0x04034b50, $p_header['version_extracted'], $p_header['flag'], $p_header['compression'], $v_mtime, $v_mdate, $p_header['crc'], $p_header['compressed_size'], $p_header['size'], strlen($p_header['stored_filename']), $p_header['extra_len']); + + // ----- Write the first 148 bytes of the header in the archive + fputs($this->zip_fd, $v_binary_data, 30); + + // ----- Write the variable fields + if (strlen($p_header['stored_filename']) != 0) { + fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); + } + if ($p_header['extra_len'] != 0) { + fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privWriteCentralFileHeader() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privWriteCentralFileHeader(&$p_header) + { + $v_result=1; + + // TBC + //for(reset($p_header); $key = key($p_header); next($p_header)) { + //} + + // ----- Transform UNIX mtime to DOS format mdate/mtime + $v_date = getdate($p_header['mtime']); + $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; + $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; + + + // ----- Packed data + $v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50, $p_header['version'], $p_header['version_extracted'], $p_header['flag'], $p_header['compression'], $v_mtime, $v_mdate, $p_header['crc'], $p_header['compressed_size'], $p_header['size'], strlen($p_header['stored_filename']), $p_header['extra_len'], $p_header['comment_len'], $p_header['disk'], $p_header['internal'], $p_header['external'], $p_header['offset']); + + // ----- Write the 42 bytes of the header in the zip file + fputs($this->zip_fd, $v_binary_data, 46); + + // ----- Write the variable fields + if (strlen($p_header['stored_filename']) != 0) { + fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); + } + if ($p_header['extra_len'] != 0) { + fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); + } + if ($p_header['comment_len'] != 0) { + fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']); + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privWriteCentralHeader() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment) + { + $v_result = 1; + + // ----- Packed data + $v_binary_data = pack("VvvvvVVv", 0x06054b50, 0, 0, $p_nb_entries, $p_nb_entries, $p_size, $p_offset, strlen($p_comment)); + + // ----- Write the 22 bytes of the header in the zip file + fputs($this->zip_fd, $v_binary_data, 22); + + // ----- Write the variable fields + if (strlen($p_comment) != 0) { + fputs($this->zip_fd, $p_comment, strlen($p_comment)); + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privList() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privList(&$p_list) + { + $v_result = 1; + + // ----- Magic quotes trick + $this->privDisableMagicQuotes(); + + // ----- Open the zip file + if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) { + // ----- Magic quotes trick + $this->privSwapBackMagicQuotes(); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Read the central directory informations + $v_central_dir = array(); + if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { + $this->privSwapBackMagicQuotes(); + return $v_result; + } + + // ----- Go to beginning of Central Dir + @rewind($this->zip_fd); + if (@fseek($this->zip_fd, $v_central_dir['offset'])) { + $this->privSwapBackMagicQuotes(); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Read each entry + for ($i=0; $i<$v_central_dir['entries']; $i++) { + // ----- Read the file header + if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) { + $this->privSwapBackMagicQuotes(); + return $v_result; + } + $v_header['index'] = $i; + + // ----- Get the only interesting attributes + $this->privConvertHeader2FileInfo($v_header, $p_list[$i]); + unset($v_header); + } + + // ----- Close the zip file + $this->privCloseFd(); + + // ----- Magic quotes trick + $this->privSwapBackMagicQuotes(); + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privConvertHeader2FileInfo() + // Description : + // This function takes the file informations from the central directory + // entries and extract the interesting parameters that will be given back. + // The resulting file infos are set in the array $p_info + // $p_info['filename'] : Filename with full path. Given by user (add), + // extracted in the filesystem (extract). + // $p_info['stored_filename'] : Stored filename in the archive. + // $p_info['size'] = Size of the file. + // $p_info['compressed_size'] = Compressed size of the file. + // $p_info['mtime'] = Last modification date of the file. + // $p_info['comment'] = Comment associated with the file. + // $p_info['folder'] = true/false : indicates if the entry is a folder or not. + // $p_info['status'] = status of the action on the file. + // $p_info['crc'] = CRC of the file content. + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privConvertHeader2FileInfo($p_header, &$p_info) + { + $v_result=1; + + // ----- Get the interesting attributes + $v_temp_path = PclZipUtilPathReduction($p_header['filename']); + $p_info['filename'] = $v_temp_path; + $v_temp_path = PclZipUtilPathReduction($p_header['stored_filename']); + $p_info['stored_filename'] = $v_temp_path; + $p_info['size'] = $p_header['size']; + $p_info['compressed_size'] = $p_header['compressed_size']; + $p_info['mtime'] = $p_header['mtime']; + $p_info['comment'] = $p_header['comment']; + $p_info['folder'] = (($p_header['external']&0x00000010)==0x00000010); + $p_info['index'] = $p_header['index']; + $p_info['status'] = $p_header['status']; + $p_info['crc'] = $p_header['crc']; + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privExtractByRule() + // Description : + // Extract a file or directory depending of rules (by index, by name, ...) + // Parameters : + // $p_file_list : An array where will be placed the properties of each + // extracted file + // $p_path : Path to add while writing the extracted files + // $p_remove_path : Path to remove (from the file memorized path) while writing the + // extracted files. If the path does not match the file path, + // the file is extracted with its memorized path. + // $p_remove_path does not apply to 'list' mode. + // $p_path and $p_remove_path are commulative. + // Return Values : + // 1 on success,0 or less on error (see error code list) + // -------------------------------------------------------------------------------- + public function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) + { + $v_result=1; + + // ----- Magic quotes trick + $this->privDisableMagicQuotes(); + + // ----- Check the path + if (($p_path == "") || ((substr($p_path, 0, 1) != "/") && (substr($p_path, 0, 3) != "../") && (substr($p_path, 1, 2)!=":/"))) { + $p_path = "./".$p_path; + } + + // ----- Reduce the path last (and duplicated) '/' + if (($p_path != "./") && ($p_path != "/")) { + // ----- Look for the path end '/' + while (substr($p_path, -1) == "/") { + $p_path = substr($p_path, 0, strlen($p_path)-1); + } + } + + // ----- Look for path to remove format (should end by /) + if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/')) { + $p_remove_path .= '/'; + } + $p_remove_path_size = strlen($p_remove_path); + + // ----- Open the zip file + if (($v_result = $this->privOpenFd('rb')) != 1) { + $this->privSwapBackMagicQuotes(); + return $v_result; + } + + // ----- Read the central directory informations + $v_central_dir = array(); + if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { + // ----- Close the zip file + $this->privCloseFd(); + $this->privSwapBackMagicQuotes(); + + return $v_result; + } + + // ----- Start at beginning of Central Dir + $v_pos_entry = $v_central_dir['offset']; + + // ----- Read each entry + $j_start = 0; + for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) { + // ----- Read next Central dir entry + @rewind($this->zip_fd); + if (@fseek($this->zip_fd, $v_pos_entry)) { + // ----- Close the zip file + $this->privCloseFd(); + $this->privSwapBackMagicQuotes(); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Read the file header + $v_header = array(); + if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) { + // ----- Close the zip file + $this->privCloseFd(); + $this->privSwapBackMagicQuotes(); + + return $v_result; + } + + // ----- Store the index + $v_header['index'] = $i; + + // ----- Store the file position + $v_pos_entry = ftell($this->zip_fd); + + // ----- Look for the specific extract rules + $v_extract = false; + + // ----- Look for extract by name rule + if ((isset($p_options[PCLZIP_OPT_BY_NAME])) && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { + // ----- Look if the filename is in the list + for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_extract); $j++) { + // ----- Look for a directory + if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == "/") { + // ----- Look if the directory is in the filename path + if ((strlen($v_header['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { + $v_extract = true; + } + } elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { + // ----- Look for a filename + $v_extract = true; + } + } + } elseif ((isset($p_options[PCLZIP_OPT_BY_PREG])) && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { + // ----- Look for extract by preg rule + if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) { + $v_extract = true; + } + } elseif ((isset($p_options[PCLZIP_OPT_BY_INDEX])) && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { + // ----- Look for extract by index rule + // ----- Look if the index is in the list + for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_extract); $j++) { + if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { + $v_extract = true; + } + if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { + $j_start = $j+1; + } + + if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { + break; + } + } + } else { + // ----- Look for no rule, which means extract all the archive + $v_extract = true; + } + + // ----- Check compression method + if (($v_extract) && (($v_header['compression'] != 8) && ($v_header['compression'] != 0))) { + $v_header['status'] = 'unsupported_compression'; + + // ----- Look for PCLZIP_OPT_STOP_ON_ERROR + if ((isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR] === true)) { + $this->privSwapBackMagicQuotes(); + + PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION, "Filename '".$v_header['stored_filename']."' is compressed by an unsupported compression method (".$v_header['compression'].") "); + + return PclZip::errorCode(); + } + } + + // ----- Check encrypted files + if (($v_extract) && (($v_header['flag'] & 1) == 1)) { + $v_header['status'] = 'unsupported_encryption'; + // ----- Look for PCLZIP_OPT_STOP_ON_ERROR + if ((isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR] === true)) { + $this->privSwapBackMagicQuotes(); + + PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, "Unsupported encryption for filename '".$v_header['stored_filename']."'"); + + return PclZip::errorCode(); + } + } + + // ----- Look for real extraction + if (($v_extract) && ($v_header['status'] != 'ok')) { + $v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++]); + if ($v_result != 1) { + $this->privCloseFd(); + $this->privSwapBackMagicQuotes(); + return $v_result; + } + + $v_extract = false; + } + + // ----- Look for real extraction + if ($v_extract) { + // ----- Go to the file position + @rewind($this->zip_fd); + if (@fseek($this->zip_fd, $v_header['offset'])) { + // ----- Close the zip file + $this->privCloseFd(); + + $this->privSwapBackMagicQuotes(); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Look for extraction as string + if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) { + $v_string = ''; + + // ----- Extracting the file + $v_result1 = $this->privExtractFileAsString($v_header, $v_string, $p_options); + if ($v_result1 < 1) { + $this->privCloseFd(); + $this->privSwapBackMagicQuotes(); + return $v_result1; + } + + // ----- Get the only interesting attributes + if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted])) != 1) { + // ----- Close the zip file + $this->privCloseFd(); + $this->privSwapBackMagicQuotes(); + + return $v_result; + } + + // ----- Set the file content + $p_file_list[$v_nb_extracted]['content'] = $v_string; + + // ----- Next extracted file + $v_nb_extracted++; + + // ----- Look for user callback abort + if ($v_result1 == 2) { + break; + } + } elseif ((isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) { + // ----- Look for extraction in standard output + // ----- Extracting the file in standard output + $v_result1 = $this->privExtractFileInOutput($v_header, $p_options); + if ($v_result1 < 1) { + $this->privCloseFd(); + $this->privSwapBackMagicQuotes(); + return $v_result1; + } + + // ----- Get the only interesting attributes + if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) { + $this->privCloseFd(); + $this->privSwapBackMagicQuotes(); + return $v_result; + } + + // ----- Look for user callback abort + if ($v_result1 == 2) { + break; + } + } else { + // ----- Look for normal extraction + // ----- Extracting the file + $v_result1 = $this->privExtractFile($v_header, $p_path, $p_remove_path, $p_remove_all_path, $p_options); + if ($v_result1 < 1) { + $this->privCloseFd(); + $this->privSwapBackMagicQuotes(); + return $v_result1; + } + + // ----- Get the only interesting attributes + if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) { + // ----- Close the zip file + $this->privCloseFd(); + $this->privSwapBackMagicQuotes(); + + return $v_result; + } + + // ----- Look for user callback abort + if ($v_result1 == 2) { + break; + } + } + } + } + + // ----- Close the zip file + $this->privCloseFd(); + $this->privSwapBackMagicQuotes(); + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privExtractFile() + // Description : + // Parameters : + // Return Values : + // + // 1 : ... ? + // PCLZIP_ERR_USER_ABORTED(2) : User ask for extraction stop in callback + // -------------------------------------------------------------------------------- + public function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) + { + $v_result=1; + + // ----- Read the file header + if (($v_result = $this->privReadFileHeader($v_header)) != 1) { + // ----- Return + return $v_result; + } + + + // ----- Check that the file header is coherent with $p_entry info + if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { + // TBC + } + + // ----- Look for all path to remove + if ($p_remove_all_path == true) { + // ----- Look for folder entry that not need to be extracted + if (($p_entry['external']&0x00000010)==0x00000010) { + $p_entry['status'] = "filtered"; + + return $v_result; + } + + // ----- Get the basename of the path + $p_entry['filename'] = basename($p_entry['filename']); + } elseif ($p_remove_path != "") { + // ----- Look for path to remove + if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2) { + // ----- Change the file status + $p_entry['status'] = "filtered"; + + // ----- Return + return $v_result; + } + + $p_remove_path_size = strlen($p_remove_path); + if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path) { + // ----- Remove the path + $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size); + } + } + + // ----- Add the path + if ($p_path != '') { + $p_entry['filename'] = $p_path."/".$p_entry['filename']; + } + + // ----- Check a base_dir_restriction + if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) { + $v_inclusion = PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION], $p_entry['filename']); + if ($v_inclusion == 0) { + PclZip::privErrorLog(PCLZIP_ERR_DIRECTORY_RESTRICTION, "Filename '".$p_entry['filename']."' is outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION"); + + return PclZip::errorCode(); + } + } + + // ----- Look for pre-extract callback + if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { + // ----- Generate a local information + $v_local_header = array(); + $this->privConvertHeader2FileInfo($p_entry, $v_local_header); + + // ----- Call the callback + // Here I do not use call_user_func() because I need to send a reference to the + // header. + // eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); + $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); + if ($v_result == 0) { + // ----- Change the file status + $p_entry['status'] = "skipped"; + $v_result = 1; + } + + // ----- Look for abort result + if ($v_result == 2) { + // ----- This status is internal and will be changed in 'skipped' + $p_entry['status'] = "aborted"; + $v_result = PCLZIP_ERR_USER_ABORTED; + } + + // ----- Update the informations + // Only some fields can be modified + $p_entry['filename'] = $v_local_header['filename']; + } + + // ----- Look if extraction should be done + if ($p_entry['status'] == 'ok') { + // ----- Look for specific actions while the file exist + if (file_exists($p_entry['filename'])) { + // ----- Look if file is a directory + if (is_dir($p_entry['filename'])) { + // ----- Change the file status + $p_entry['status'] = "already_a_directory"; + + // ----- Look for PCLZIP_OPT_STOP_ON_ERROR + // For historical reason first PclZip implementation does not stop + // when this kind of error occurs. + if ((isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { + PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY, "Filename '".$p_entry['filename']."' is already used by an existing directory"); + return PclZip::errorCode(); + } + } elseif (!is_writeable($p_entry['filename'])) { + // ----- Look if file is write protected + // ----- Change the file status + $p_entry['status'] = "write_protected"; + + // ----- Look for PCLZIP_OPT_STOP_ON_ERROR + // For historical reason first PclZip implementation does not stop + // when this kind of error occurs. + if ((isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR] === true)) { + PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, "Filename '".$p_entry['filename']."' exists and is write protected"); + return PclZip::errorCode(); + } + } elseif (filemtime($p_entry['filename']) > $p_entry['mtime']) { + // ----- Look if the extracted file is older + // ----- Change the file status + if ((isset($p_options[PCLZIP_OPT_REPLACE_NEWER])) && ($p_options[PCLZIP_OPT_REPLACE_NEWER] === true)) { + } else { + $p_entry['status'] = "newer_exist"; + + // ----- Look for PCLZIP_OPT_STOP_ON_ERROR + // For historical reason first PclZip implementation does not stop + // when this kind of error occurs. + if ((isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR] === true)) { + PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, "Newer version of '".$p_entry['filename']."' exists and option PCLZIP_OPT_REPLACE_NEWER is not selected"); + return PclZip::errorCode(); + } + } + } else { + } + } else { + // ----- Check the directory availability and create it if necessary + if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/')) { + $v_dir_to_check = $p_entry['filename']; + } elseif (!strstr($p_entry['filename'], "/")) { + $v_dir_to_check = ""; + } else { + $v_dir_to_check = dirname($p_entry['filename']); + } + + if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) { + // ----- Change the file status + $p_entry['status'] = "path_creation_fail"; + + // ----- Return + //return $v_result; + $v_result = 1; + } + } + } + + // ----- Look if extraction should be done + if ($p_entry['status'] == 'ok') { + // ----- Do the extraction (if not a folder) + if (!(($p_entry['external']&0x00000010) == 0x00000010)) { + // ----- Look for not compressed file + if ($p_entry['compression'] == 0) { + // ----- Opening destination file + if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { + // ----- Change the file status + $p_entry['status'] = "write_error"; + + // ----- Return + return $v_result; + } + + // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks + $v_size = $p_entry['compressed_size']; + while ($v_size != 0) { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + $v_buffer = @fread($this->zip_fd, $v_read_size); + /* Try to speed up the code + $v_binary_data = pack('a'.$v_read_size, $v_buffer); + @fwrite($v_dest_file, $v_binary_data, $v_read_size); + */ + @fwrite($v_dest_file, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Closing the destination file + fclose($v_dest_file); + + // ----- Change the file mtime + touch($p_entry['filename'], $p_entry['mtime']); + } else { + // ----- TBC + // Need to be finished + if (($p_entry['flag'] & 1) == 1) { + PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, 'File \''.$p_entry['filename'].'\' is encrypted. Encrypted files are not supported.'); + return PclZip::errorCode(); + } + + // ----- Look for using temporary file to unzip + if ((!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_entry['size'])))) { + $v_result = $this->privExtractFileUsingTempFile($p_entry, $p_options); + if ($v_result < PCLZIP_ERR_NO_ERROR) { + return $v_result; + } + } else { + // ----- Look for extract in memory + // ----- Read the compressed file in a buffer (one shot) + $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); + + // ----- Decompress the file + $v_file_content = @gzinflate($v_buffer); + unset($v_buffer); + if ($v_file_content === false) { + // ----- Change the file status + // TBC + $p_entry['status'] = "error"; + + return $v_result; + } + + // ----- Opening destination file + if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { + // ----- Change the file status + $p_entry['status'] = "write_error"; + + return $v_result; + } + + // ----- Write the uncompressed data + @fwrite($v_dest_file, $v_file_content, $p_entry['size']); + unset($v_file_content); + + // ----- Closing the destination file + @fclose($v_dest_file); + } + + // ----- Change the file mtime + @touch($p_entry['filename'], $p_entry['mtime']); + } + + // ----- Look for chmod option + if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) { + // ----- Change the mode of the file + @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]); + } + } + } + + // ----- Change abort status + if ($p_entry['status'] == "aborted") { + $p_entry['status'] = "skipped"; + } elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { + // ----- Look for post-extract callback + // ----- Generate a local information + $v_local_header = array(); + $this->privConvertHeader2FileInfo($p_entry, $v_local_header); + + // ----- Call the callback + // Here I do not use call_user_func() because I need to send a reference to the + // header. + // eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); + $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); + + // ----- Look for abort result + if ($v_result == 2) { + $v_result = PCLZIP_ERR_USER_ABORTED; + } + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privExtractFileUsingTempFile() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privExtractFileUsingTempFile(&$p_entry, &$p_options) + { + $v_result=1; + + // ----- Creates a temporary file + $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz'; + if (($v_dest_file = @fopen($v_gzip_temp_name, "wb")) == 0) { + fclose($v_file); + PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode'); + return PclZip::errorCode(); + } + + // ----- Write gz file format header + $v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x00), time(), Chr(0x00), Chr(3)); + @fwrite($v_dest_file, $v_binary_data, 10); + + // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks + $v_size = $p_entry['compressed_size']; + while ($v_size != 0) { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + $v_buffer = @fread($this->zip_fd, $v_read_size); + //$v_binary_data = pack('a'.$v_read_size, $v_buffer); + @fwrite($v_dest_file, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Write gz file format footer + $v_binary_data = pack('VV', $p_entry['crc'], $p_entry['size']); + @fwrite($v_dest_file, $v_binary_data, 8); + + // ----- Close the temporary file + @fclose($v_dest_file); + + // ----- Opening destination file + if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { + $p_entry['status'] = "write_error"; + return $v_result; + } + + // ----- Open the temporary gz file + if (($v_src_file = @gzopen($v_gzip_temp_name, 'rb')) == 0) { + @fclose($v_dest_file); + $p_entry['status'] = "read_error"; + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); + return PclZip::errorCode(); + } + + // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks + $v_size = $p_entry['size']; + while ($v_size != 0) { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + $v_buffer = @gzread($v_src_file, $v_read_size); + //$v_binary_data = pack('a'.$v_read_size, $v_buffer); + @fwrite($v_dest_file, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + @fclose($v_dest_file); + @gzclose($v_src_file); + + // ----- Delete the temporary file + @unlink($v_gzip_temp_name); + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privExtractFileInOutput() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privExtractFileInOutput(&$p_entry, &$p_options) + { + $v_result=1; + + // ----- Read the file header + if (($v_result = $this->privReadFileHeader($v_header)) != 1) { + return $v_result; + } + + // ----- Check that the file header is coherent with $p_entry info + if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { + // TBC + } + + // ----- Look for pre-extract callback + if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { + // ----- Generate a local information + $v_local_header = array(); + $this->privConvertHeader2FileInfo($p_entry, $v_local_header); + + // ----- Call the callback + // Here I do not use call_user_func() because I need to send a reference to the + // header. + // eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); + $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); + if ($v_result == 0) { + // ----- Change the file status + $p_entry['status'] = "skipped"; + $v_result = 1; + } + + // ----- Look for abort result + if ($v_result == 2) { + // ----- This status is internal and will be changed in 'skipped' + $p_entry['status'] = "aborted"; + $v_result = PCLZIP_ERR_USER_ABORTED; + } + + // ----- Update the informations + // Only some fields can be modified + $p_entry['filename'] = $v_local_header['filename']; + } + + // ----- Trace + + // ----- Look if extraction should be done + if ($p_entry['status'] == 'ok') { + // ----- Do the extraction (if not a folder) + if (!(($p_entry['external']&0x00000010)==0x00000010)) { + // ----- Look for not compressed file + if ($p_entry['compressed_size'] == $p_entry['size']) { + // ----- Read the file in a buffer (one shot) + $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); + + // ----- Send the file to the output + echo $v_buffer; + unset($v_buffer); + } else { + // ----- Read the compressed file in a buffer (one shot) + $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); + + // ----- Decompress the file + $v_file_content = gzinflate($v_buffer); + unset($v_buffer); + + // ----- Send the file to the output + echo $v_file_content; + unset($v_file_content); + } + } + } + + // ----- Change abort status + if ($p_entry['status'] == "aborted") { + $p_entry['status'] = "skipped"; + } elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { + // ----- Look for post-extract callback + + // ----- Generate a local information + $v_local_header = array(); + $this->privConvertHeader2FileInfo($p_entry, $v_local_header); + + // ----- Call the callback + // Here I do not use call_user_func() because I need to send a reference to the + // header. + // eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); + $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); + + // ----- Look for abort result + if ($v_result == 2) { + $v_result = PCLZIP_ERR_USER_ABORTED; + } + } + + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privExtractFileAsString() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privExtractFileAsString(&$p_entry, &$p_string, &$p_options) + { + $v_result=1; + + // ----- Read the file header + $v_header = array(); + if (($v_result = $this->privReadFileHeader($v_header)) != 1) { + // ----- Return + return $v_result; + } + + // ----- Check that the file header is coherent with $p_entry info + if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { + // TBC + } + + // ----- Look for pre-extract callback + if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { + // ----- Generate a local information + $v_local_header = array(); + $this->privConvertHeader2FileInfo($p_entry, $v_local_header); + + // ----- Call the callback + // Here I do not use call_user_func() because I need to send a reference to the + // header. + // eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); + $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); + if ($v_result == 0) { + // ----- Change the file status + $p_entry['status'] = "skipped"; + $v_result = 1; + } + + // ----- Look for abort result + if ($v_result == 2) { + // ----- This status is internal and will be changed in 'skipped' + $p_entry['status'] = "aborted"; + $v_result = PCLZIP_ERR_USER_ABORTED; + } + + // ----- Update the informations + // Only some fields can be modified + $p_entry['filename'] = $v_local_header['filename']; + } + + // ----- Look if extraction should be done + if ($p_entry['status'] == 'ok') { + // ----- Do the extraction (if not a folder) + if (!(($p_entry['external']&0x00000010)==0x00000010)) { + // ----- Look for not compressed file + // if ($p_entry['compressed_size'] == $p_entry['size']) + if ($p_entry['compression'] == 0) { + // ----- Reading the file + $p_string = @fread($this->zip_fd, $p_entry['compressed_size']); + } else { + // ----- Reading the file + $v_data = @fread($this->zip_fd, $p_entry['compressed_size']); + + // ----- Decompress the file + if (($p_string = @gzinflate($v_data)) === false) { + // TBC + } + } + // ----- Trace + } else { + // TBC : error : can not extract a folder in a string + } + } + + // ----- Change abort status + if ($p_entry['status'] == "aborted") { + $p_entry['status'] = "skipped"; + } elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { + // ----- Look for post-extract callback + // ----- Generate a local information + $v_local_header = array(); + $this->privConvertHeader2FileInfo($p_entry, $v_local_header); + + // ----- Swap the content to header + $v_local_header['content'] = $p_string; + $p_string = ''; + + // ----- Call the callback + // Here I do not use call_user_func() because I need to send a reference to the + // header. + // eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); + $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); + + // ----- Swap back the content to header + $p_string = $v_local_header['content']; + unset($v_local_header['content']); + + // ----- Look for abort result + if ($v_result == 2) { + $v_result = PCLZIP_ERR_USER_ABORTED; + } + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privReadFileHeader() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privReadFileHeader(&$p_header) + { + $v_result=1; + + // ----- Read the 4 bytes signature + $v_binary_data = @fread($this->zip_fd, 4); + $v_data = unpack('Vid', $v_binary_data); + + // ----- Check signature + if ($v_data['id'] != 0x04034b50) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Read the first 42 bytes of the header + $v_binary_data = fread($this->zip_fd, 26); + + // ----- Look for invalid block size + if (strlen($v_binary_data) != 26) { + $p_header['filename'] = ""; + $p_header['status'] = "invalid_header"; + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Extract the values + $v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data); + + // ----- Get filename + $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']); + + // ----- Get extra_fields + if ($v_data['extra_len'] != 0) { + $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']); + } else { + $p_header['extra'] = ''; + } + + // ----- Extract properties + $p_header['version_extracted'] = $v_data['version']; + $p_header['compression'] = $v_data['compression']; + $p_header['size'] = $v_data['size']; + $p_header['compressed_size'] = $v_data['compressed_size']; + $p_header['crc'] = $v_data['crc']; + $p_header['flag'] = $v_data['flag']; + $p_header['filename_len'] = $v_data['filename_len']; + + // ----- Recuperate date in UNIX format + $p_header['mdate'] = $v_data['mdate']; + $p_header['mtime'] = $v_data['mtime']; + if ($p_header['mdate'] && $p_header['mtime']) { + // ----- Extract time + $v_hour = ($p_header['mtime'] & 0xF800) >> 11; + $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; + $v_seconde = ($p_header['mtime'] & 0x001F)*2; + + // ----- Extract date + $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; + $v_month = ($p_header['mdate'] & 0x01E0) >> 5; + $v_day = $p_header['mdate'] & 0x001F; + + // ----- Get UNIX date format + $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); + + } else { + $p_header['mtime'] = time(); + } + + // TBC + //for(reset($v_data); $key = key($v_data); next($v_data)) { + //} + + // ----- Set the stored filename + $p_header['stored_filename'] = $p_header['filename']; + + // ----- Set the status field + $p_header['status'] = "ok"; + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privReadCentralFileHeader() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privReadCentralFileHeader(&$p_header) + { + $v_result = 1; + + // ----- Read the 4 bytes signature + $v_binary_data = @fread($this->zip_fd, 4); + $v_data = unpack('Vid', $v_binary_data); + + // ----- Check signature + if ($v_data['id'] != 0x02014b50) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Read the first 42 bytes of the header + $v_binary_data = fread($this->zip_fd, 42); + + // ----- Look for invalid block size + if (strlen($v_binary_data) != 42) { + $p_header['filename'] = ""; + $p_header['status'] = "invalid_header"; + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Extract the values + $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data); + + // ----- Get filename + if ($p_header['filename_len'] != 0) { + $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']); + } else { + $p_header['filename'] = ''; + } + + // ----- Get extra + if ($p_header['extra_len'] != 0) { + $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']); + } else { + $p_header['extra'] = ''; + } + + // ----- Get comment + if ($p_header['comment_len'] != 0) { + $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']); + } else { + $p_header['comment'] = ''; + } + + // ----- Extract properties + + // ----- Recuperate date in UNIX format + //if ($p_header['mdate'] && $p_header['mtime']) + // TBC : bug : this was ignoring time with 0/0/0 + if (1) { + // ----- Extract time + $v_hour = ($p_header['mtime'] & 0xF800) >> 11; + $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; + $v_seconde = ($p_header['mtime'] & 0x001F)*2; + + // ----- Extract date + $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; + $v_month = ($p_header['mdate'] & 0x01E0) >> 5; + $v_day = $p_header['mdate'] & 0x001F; + + // ----- Get UNIX date format + $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); + + } else { + $p_header['mtime'] = time(); + } + + // ----- Set the stored filename + $p_header['stored_filename'] = $p_header['filename']; + + // ----- Set default status to ok + $p_header['status'] = 'ok'; + + // ----- Look if it is a directory + if (substr($p_header['filename'], -1) == '/') { + //$p_header['external'] = 0x41FF0010; + $p_header['external'] = 0x00000010; + } + + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privCheckFileHeaders() + // Description : + // Parameters : + // Return Values : + // 1 on success, + // 0 on error; + // -------------------------------------------------------------------------------- + public function privCheckFileHeaders(&$p_local_header, &$p_central_header) + { + $v_result=1; + + // ----- Check the static values + // TBC + if ($p_local_header['filename'] != $p_central_header['filename']) { + } + if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) { + } + if ($p_local_header['flag'] != $p_central_header['flag']) { + } + if ($p_local_header['compression'] != $p_central_header['compression']) { + } + if ($p_local_header['mtime'] != $p_central_header['mtime']) { + } + if ($p_local_header['filename_len'] != $p_central_header['filename_len']) { + } + + // ----- Look for flag bit 3 + if (($p_local_header['flag'] & 8) == 8) { + $p_local_header['size'] = $p_central_header['size']; + $p_local_header['compressed_size'] = $p_central_header['compressed_size']; + $p_local_header['crc'] = $p_central_header['crc']; + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privReadEndCentralDir() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privReadEndCentralDir(&$p_central_dir) + { + $v_result=1; + + // ----- Go to the end of the zip file + $v_size = filesize($this->zipname); + @fseek($this->zip_fd, $v_size); + if (@ftell($this->zip_fd) != $v_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\''); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- First try : look if this is an archive with no commentaries (most of the time) + // in this case the end of central dir is at 22 bytes of the file end + $v_found = 0; + if ($v_size > 26) { + @fseek($this->zip_fd, $v_size-22); + if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22)) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Read for bytes + $v_binary_data = @fread($this->zip_fd, 4); + $v_data = @unpack('Vid', $v_binary_data); + + // ----- Check signature + if ($v_data['id'] == 0x06054b50) { + $v_found = 1; + } + + $v_pos = ftell($this->zip_fd); + } + + // ----- Go back to the maximum possible size of the Central Dir End Record + if (!$v_found) { + $v_maximum_size = 65557; // 0xFFFF + 22; + if ($v_maximum_size > $v_size) { + $v_maximum_size = $v_size; + } + @fseek($this->zip_fd, $v_size-$v_maximum_size); + if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size)) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Read byte per byte in order to find the signature + $v_pos = ftell($this->zip_fd); + $v_bytes = 0x00000000; + while ($v_pos < $v_size) { + // ----- Read a byte + $v_byte = @fread($this->zip_fd, 1); + + // ----- Add the byte + //$v_bytes = ($v_bytes << 8) | Ord($v_byte); + // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number + // Otherwise on systems where we have 64bit integers the check below for the magic number will fail. + $v_bytes = (($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte); + + // ----- Compare the bytes + if ($v_bytes == 0x504b0506) { + $v_pos++; + break; + } + + $v_pos++; + } + + // ----- Look if not found end of central dir + if ($v_pos == $v_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature"); + + // ----- Return + return PclZip::errorCode(); + } + } + + // ----- Read the first 18 bytes of the header + $v_binary_data = fread($this->zip_fd, 18); + + // ----- Look for invalid block size + if (strlen($v_binary_data) != 18) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data)); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Extract the values + $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data); + + // ----- Check the global size + if (($v_pos + $v_data['comment_size'] + 18) != $v_size) { + // ----- Removed in release 2.2 see readme file + // The check of the file size is a little too strict. + // Some bugs where found when a zip is encrypted/decrypted with 'crypt'. + // While decrypted, zip has training 0 bytes + if (0) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'The central dir is not at the end of the archive. Some trailing bytes exists after the archive.'); + + // ----- Return + return PclZip::errorCode(); + } + } + + // ----- Get comment + if ($v_data['comment_size'] != 0) { + $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']); + } else { + $p_central_dir['comment'] = ''; + } + + $p_central_dir['entries'] = $v_data['entries']; + $p_central_dir['disk_entries'] = $v_data['disk_entries']; + $p_central_dir['offset'] = $v_data['offset']; + $p_central_dir['size'] = $v_data['size']; + $p_central_dir['disk'] = $v_data['disk']; + $p_central_dir['disk_start'] = $v_data['disk_start']; + + // TBC + //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) { + //} + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privDeleteByRule() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privDeleteByRule(&$p_result_list, &$p_options) + { + $v_result=1; + $v_list_detail = array(); + + // ----- Open the zip file + if (($v_result=$this->privOpenFd('rb')) != 1) { + // ----- Return + return $v_result; + } + + // ----- Read the central directory informations + $v_central_dir = array(); + if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { + $this->privCloseFd(); + return $v_result; + } + + // ----- Go to beginning of File + @rewind($this->zip_fd); + + // ----- Scan all the files + // ----- Start at beginning of Central Dir + $v_pos_entry = $v_central_dir['offset']; + @rewind($this->zip_fd); + if (@fseek($this->zip_fd, $v_pos_entry)) { + // ----- Close the zip file + $this->privCloseFd(); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Read each entry + $v_header_list = array(); + $j_start = 0; + for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) { + // ----- Read the file header + $v_header_list[$v_nb_extracted] = array(); + if (($v_result = $this->privReadCentralFileHeader($v_header_list[$v_nb_extracted])) != 1) { + // ----- Close the zip file + $this->privCloseFd(); + + return $v_result; + } + + + // ----- Store the index + $v_header_list[$v_nb_extracted]['index'] = $i; + + // ----- Look for the specific extract rules + $v_found = false; + + // ----- Look for extract by name rule + if ((isset($p_options[PCLZIP_OPT_BY_NAME])) && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { + // ----- Look if the filename is in the list + for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_found); $j++) { + // ----- Look for a directory + if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == "/") { + // ----- Look if the directory is in the filename path + if ((strlen($v_header_list[$v_nb_extracted]['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { + $v_found = true; + } elseif ((($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */ && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) { + $v_found = true; + } + } elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { + // ----- Look for a filename + $v_found = true; + } + } + } elseif ((isset($p_options[PCLZIP_OPT_BY_PREG])) && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { + // ----- Look for extract by preg rule + if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { + $v_found = true; + } + } elseif ((isset($p_options[PCLZIP_OPT_BY_INDEX])) && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { + // ----- Look for extract by index rule + // ----- Look if the index is in the list + for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_found); $j++) { + if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { + $v_found = true; + } + if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { + $j_start = $j+1; + } + if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { + break; + } + } + } else { + $v_found = true; + } + + // ----- Look for deletion + if ($v_found) { + unset($v_header_list[$v_nb_extracted]); + } else { + $v_nb_extracted++; + } + } + + // ----- Look if something need to be deleted + if ($v_nb_extracted > 0) { + // ----- Creates a temporay file + $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; + + // ----- Creates a temporary zip archive + $v_temp_zip = new PclZip($v_zip_temp_name); + + // ----- Open the temporary zip file in write mode + if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) { + $this->privCloseFd(); + + // ----- Return + return $v_result; + } + + // ----- Look which file need to be kept + for ($i=0; $i<sizeof($v_header_list); $i++) { + // ----- Calculate the position of the header + @rewind($this->zip_fd); + if (@fseek($this->zip_fd, $v_header_list[$i]['offset'])) { + // ----- Close the zip file + $this->privCloseFd(); + $v_temp_zip->privCloseFd(); + @unlink($v_zip_temp_name); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Read the file header + $v_local_header = array(); + if (($v_result = $this->privReadFileHeader($v_local_header)) != 1) { + // ----- Close the zip file + $this->privCloseFd(); + $v_temp_zip->privCloseFd(); + @unlink($v_zip_temp_name); + + // ----- Return + return $v_result; + } + + // ----- Check that local file header is same as central file header + if ($this->privCheckFileHeaders($v_local_header, $v_header_list[$i]) != 1) { + // TBC + } + unset($v_local_header); + + // ----- Write the file header + if (($v_result = $v_temp_zip->privWriteFileHeader($v_header_list[$i])) != 1) { + // ----- Close the zip file + $this->privCloseFd(); + $v_temp_zip->privCloseFd(); + @unlink($v_zip_temp_name); + + // ----- Return + return $v_result; + } + + // ----- Read/write the data block + if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) { + // ----- Close the zip file + $this->privCloseFd(); + $v_temp_zip->privCloseFd(); + @unlink($v_zip_temp_name); + + // ----- Return + return $v_result; + } + } + + // ----- Store the offset of the central dir + $v_offset = @ftell($v_temp_zip->zip_fd); + + // ----- Re-Create the Central Dir files header + for ($i=0; $i<sizeof($v_header_list); $i++) { + // ----- Create the file header + if (($v_result = $v_temp_zip->privWriteCentralFileHeader($v_header_list[$i])) != 1) { + $v_temp_zip->privCloseFd(); + $this->privCloseFd(); + @unlink($v_zip_temp_name); + + // ----- Return + return $v_result; + } + + // ----- Transform the header to a 'usable' info + $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); + } + + + // ----- Zip file comment + $v_comment = ''; + if (isset($p_options[PCLZIP_OPT_COMMENT])) { + $v_comment = $p_options[PCLZIP_OPT_COMMENT]; + } + + // ----- Calculate the size of the central header + $v_size = @ftell($v_temp_zip->zip_fd)-$v_offset; + + // ----- Create the central dir footer + if (($v_result = $v_temp_zip->privWriteCentralHeader(sizeof($v_header_list), $v_size, $v_offset, $v_comment)) != 1) { + // ----- Reset the file list + unset($v_header_list); + $v_temp_zip->privCloseFd(); + $this->privCloseFd(); + @unlink($v_zip_temp_name); + + // ----- Return + return $v_result; + } + + // ----- Close + $v_temp_zip->privCloseFd(); + $this->privCloseFd(); + + // ----- Delete the zip file + // TBC : I should test the result ... + @unlink($this->zipname); + + // ----- Rename the temporary file + // TBC : I should test the result ... + //@rename($v_zip_temp_name, $this->zipname); + PclZipUtilRename($v_zip_temp_name, $this->zipname); + + // ----- Destroy the temporary archive + unset($v_temp_zip); + } elseif ($v_central_dir['entries'] != 0) { + // ----- Remove every files : reset the file + $this->privCloseFd(); + + if (($v_result = $this->privOpenFd('wb')) != 1) { + return $v_result; + } + + if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) { + return $v_result; + } + + $this->privCloseFd(); + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privDirCheck() + // Description : + // Check if a directory exists, if not it creates it and all the parents directory + // which may be useful. + // Parameters : + // $p_dir : Directory path to check. + // Return Values : + // 1 : OK + // -1 : Unable to create directory + // -------------------------------------------------------------------------------- + public function privDirCheck($p_dir, $p_is_dir = false) + { + $v_result = 1; + + // ----- Remove the final '/' + if (($p_is_dir) && (substr($p_dir, -1)=='/')) { + $p_dir = substr($p_dir, 0, strlen($p_dir)-1); + } + + // ----- Check the directory availability + if ((is_dir($p_dir)) || ($p_dir == "")) { + return 1; + } + + // ----- Extract parent directory + $p_parent_dir = dirname($p_dir); + + // ----- Just a check + if ($p_parent_dir != $p_dir) { + // ----- Look for parent directory + if ($p_parent_dir != "") { + if (($v_result = $this->privDirCheck($p_parent_dir)) != 1) { + return $v_result; + } + } + } + + // ----- Create the directory + if (!@mkdir($p_dir, 0777)) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, "Unable to create directory '$p_dir'"); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privMerge() + // Description : + // If $p_archive_to_add does not exist, the function exit with a success result. + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privMerge(&$p_archive_to_add) + { + $v_result=1; + + // ----- Look if the archive_to_add exists + if (!is_file($p_archive_to_add->zipname)) { + // ----- Nothing to merge, so merge is a success + $v_result = 1; + + // ----- Return + return $v_result; + } + + // ----- Look if the archive exists + if (!is_file($this->zipname)) { + // ----- Do a duplicate + $v_result = $this->privDuplicate($p_archive_to_add->zipname); + + // ----- Return + return $v_result; + } + + // ----- Open the zip file + if (($v_result=$this->privOpenFd('rb')) != 1) { + // ----- Return + return $v_result; + } + + // ----- Read the central directory informations + $v_central_dir = array(); + if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { + $this->privCloseFd(); + return $v_result; + } + + // ----- Go to beginning of File + @rewind($this->zip_fd); + + // ----- Open the archive_to_add file + if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1) { + $this->privCloseFd(); + + // ----- Return + return $v_result; + } + + // ----- Read the central directory informations + $v_central_dir_to_add = array(); + if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1) { + $this->privCloseFd(); + $p_archive_to_add->privCloseFd(); + + return $v_result; + } + + // ----- Go to beginning of File + @rewind($p_archive_to_add->zip_fd); + + // ----- Creates a temporay file + $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; + + // ----- Open the temporary file in write mode + if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) { + $this->privCloseFd(); + $p_archive_to_add->privCloseFd(); + + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Copy the files from the archive to the temporary file + // TBC : Here I should better append the file and go back to erase the central dir + $v_size = $v_central_dir['offset']; + while ($v_size != 0) { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + $v_buffer = fread($this->zip_fd, $v_read_size); + @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Copy the files from the archive_to_add into the temporary file + $v_size = $v_central_dir_to_add['offset']; + while ($v_size != 0) { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size); + @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Store the offset of the central dir + $v_offset = @ftell($v_zip_temp_fd); + + // ----- Copy the block of file headers from the old archive + $v_size = $v_central_dir['size']; + while ($v_size != 0) { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + $v_buffer = @fread($this->zip_fd, $v_read_size); + @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Copy the block of file headers from the archive_to_add + $v_size = $v_central_dir_to_add['size']; + while ($v_size != 0) { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size); + @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Merge the file comments + $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment']; + + // ----- Calculate the size of the (new) central header + $v_size = @ftell($v_zip_temp_fd)-$v_offset; + + // ----- Swap the file descriptor + // Here is a trick : I swap the temporary fd with the zip fd, in order to use + // the following methods on the temporary fil and not the real archive fd + $v_swap = $this->zip_fd; + $this->zip_fd = $v_zip_temp_fd; + $v_zip_temp_fd = $v_swap; + + // ----- Create the central dir footer + if (($v_result = $this->privWriteCentralHeader($v_central_dir['entries']+$v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment)) != 1) { + $this->privCloseFd(); + $p_archive_to_add->privCloseFd(); + @fclose($v_zip_temp_fd); + $this->zip_fd = null; + + // ----- Reset the file list + unset($v_header_list); + + // ----- Return + return $v_result; + } + + // ----- Swap back the file descriptor + $v_swap = $this->zip_fd; + $this->zip_fd = $v_zip_temp_fd; + $v_zip_temp_fd = $v_swap; + + // ----- Close + $this->privCloseFd(); + $p_archive_to_add->privCloseFd(); + + // ----- Close the temporary file + @fclose($v_zip_temp_fd); + + // ----- Delete the zip file + // TBC : I should test the result ... + @unlink($this->zipname); + + // ----- Rename the temporary file + // TBC : I should test the result ... + //@rename($v_zip_temp_name, $this->zipname); + PclZipUtilRename($v_zip_temp_name, $this->zipname); + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privDuplicate() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privDuplicate($p_archive_filename) + { + $v_result=1; + + // ----- Look if the $p_archive_filename exists + if (!is_file($p_archive_filename)) { + // ----- Nothing to duplicate, so duplicate is a success. + $v_result = 1; + + // ----- Return + return $v_result; + } + + // ----- Open the zip file + if (($v_result=$this->privOpenFd('wb')) != 1) { + // ----- Return + return $v_result; + } + + // ----- Open the temporary file in write mode + if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0) { + $this->privCloseFd(); + + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode'); + + // ----- Return + return PclZip::errorCode(); + } + + // ----- Copy the files from the archive to the temporary file + // TBC : Here I should better append the file and go back to erase the central dir + $v_size = filesize($p_archive_filename); + while ($v_size != 0) { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + $v_buffer = fread($v_zip_temp_fd, $v_read_size); + @fwrite($this->zip_fd, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Close + $this->privCloseFd(); + + // ----- Close the temporary file + @fclose($v_zip_temp_fd); + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privErrorLog() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + public function privErrorLog($p_error_code = 0, $p_error_string = '') + { + if (PCLZIP_ERROR_EXTERNAL == 1) { + PclError($p_error_code, $p_error_string); + } else { + $this->error_code = $p_error_code; + $this->error_string = $p_error_string; + } + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privErrorReset() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + public function privErrorReset() + { + if (PCLZIP_ERROR_EXTERNAL == 1) { + PclErrorReset(); + } else { + $this->error_code = 0; + $this->error_string = ''; + } + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privDisableMagicQuotes() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privDisableMagicQuotes() + { + $v_result=1; + + // ----- Look if function exists + if ((!function_exists("get_magic_quotes_runtime")) || (!function_exists("set_magic_quotes_runtime"))) { + return $v_result; + } + + // ----- Look if already done + if ($this->magic_quotes_status != -1) { + return $v_result; + } + + // ----- Get and memorize the magic_quote value + $this->magic_quotes_status = @get_magic_quotes_runtime(); + + // ----- Disable magic_quotes + if ($this->magic_quotes_status == 1) { + @set_magic_quotes_runtime(0); + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privSwapBackMagicQuotes() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + public function privSwapBackMagicQuotes() + { + $v_result=1; + + // ----- Look if function exists + if ((!function_exists("get_magic_quotes_runtime")) || (!function_exists("set_magic_quotes_runtime"))) { + return $v_result; + } + + // ----- Look if something to do + if ($this->magic_quotes_status != -1) { + return $v_result; + } + + // ----- Swap back magic_quotes + if ($this->magic_quotes_status == 1) { + @set_magic_quotes_runtime($this->magic_quotes_status); + } + + // ----- Return + return $v_result; + } + // -------------------------------------------------------------------------------- +} +// End of class +// -------------------------------------------------------------------------------- + +// -------------------------------------------------------------------------------- +// Function : PclZipUtilPathReduction() +// Description : +// Parameters : +// Return Values : +// -------------------------------------------------------------------------------- +function PclZipUtilPathReduction($p_dir) +{ + $v_result = ""; + + // ----- Look for not empty path + if ($p_dir != "") { + // ----- Explode path by directory names + $v_list = explode("/", $p_dir); + + // ----- Study directories from last to first + $v_skip = 0; + for ($i=sizeof($v_list)-1; $i>=0; $i--) { + // ----- Look for current path + if ($v_list[$i] == ".") { + // ----- Ignore this directory + // Should be the first $i=0, but no check is done + } elseif ($v_list[$i] == "..") { + $v_skip++; + } elseif ($v_list[$i] == "") { + // ----- First '/' i.e. root slash + if ($i == 0) { + $v_result = "/".$v_result; + if ($v_skip > 0) { + // ----- It is an invalid path, so the path is not modified + // TBC + $v_result = $p_dir; + $v_skip = 0; + } + } elseif ($i == (sizeof($v_list)-1)) { + // ----- Last '/' i.e. indicates a directory + $v_result = $v_list[$i]; + } else { + // ----- Double '/' inside the path + // ----- Ignore only the double '//' in path, + // but not the first and last '/' + } + } else { + // ----- Look for item to skip + if ($v_skip > 0) { + $v_skip--; + } else { + $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:""); + } + } + } + + // ----- Look for skip + if ($v_skip > 0) { + while ($v_skip > 0) { + $v_result = '../'.$v_result; + $v_skip--; + } + } + } + + // ----- Return + return $v_result; +} +// -------------------------------------------------------------------------------- + +// -------------------------------------------------------------------------------- +// Function : PclZipUtilPathInclusion() +// Description : +// This function indicates if the path $p_path is under the $p_dir tree. Or, +// said in an other way, if the file or sub-dir $p_path is inside the dir +// $p_dir. +// The function indicates also if the path is exactly the same as the dir. +// This function supports path with duplicated '/' like '//', but does not +// support '.' or '..' statements. +// Parameters : +// Return Values : +// 0 if $p_path is not inside directory $p_dir +// 1 if $p_path is inside directory $p_dir +// 2 if $p_path is exactly the same as $p_dir +// -------------------------------------------------------------------------------- +function PclZipUtilPathInclusion($p_dir, $p_path) +{ + $v_result = 1; + + // ----- Look for path beginning by ./ + if (($p_dir == '.') || ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) { + $p_dir = PclZipUtilTranslateWinPath(getcwd(), false).'/'.substr($p_dir, 1); + } + if (($p_path == '.') || ((strlen($p_path) >=2) && (substr($p_path, 0, 2) == './'))) { + $p_path = PclZipUtilTranslateWinPath(getcwd(), false).'/'.substr($p_path, 1); + } + + // ----- Explode dir and path by directory separator + $v_list_dir = explode("/", $p_dir); + $v_list_dir_size = sizeof($v_list_dir); + $v_list_path = explode("/", $p_path); + $v_list_path_size = sizeof($v_list_path); + + // ----- Study directories paths + $i = 0; + $j = 0; + while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) { + // ----- Look for empty dir (path reduction) + if ($v_list_dir[$i] == '') { + $i++; + continue; + } + if ($v_list_path[$j] == '') { + $j++; + continue; + } + + // ----- Compare the items + if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ($v_list_path[$j] != '')) { + $v_result = 0; + } + + // ----- Next items + $i++; + $j++; + } + + // ----- Look if everything seems to be the same + if ($v_result) { + // ----- Skip all the empty items + while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) { + $j++; + } + while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) { + $i++; + } + + if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) { + // ----- There are exactly the same + $v_result = 2; + } elseif ($i < $v_list_dir_size) { + // ----- The path is shorter than the dir + $v_result = 0; + } + } + + // ----- Return + return $v_result; +} +// -------------------------------------------------------------------------------- + +// -------------------------------------------------------------------------------- +// Function : PclZipUtilCopyBlock() +// Description : +// Parameters : +// $p_mode : read/write compression mode +// 0 : src & dest normal +// 1 : src gzip, dest normal +// 2 : src normal, dest gzip +// 3 : src & dest gzip +// Return Values : +// -------------------------------------------------------------------------------- +function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode = 0) +{ + $v_result = 1; + + if ($p_mode==0) { + while ($p_size != 0) { + $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); + $v_buffer = @fread($p_src, $v_read_size); + @fwrite($p_dest, $v_buffer, $v_read_size); + $p_size -= $v_read_size; + } + } elseif ($p_mode==1) { + while ($p_size != 0) { + $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); + $v_buffer = @gzread($p_src, $v_read_size); + @fwrite($p_dest, $v_buffer, $v_read_size); + $p_size -= $v_read_size; + } + } elseif ($p_mode==2) { + while ($p_size != 0) { + $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); + $v_buffer = @fread($p_src, $v_read_size); + @gzwrite($p_dest, $v_buffer, $v_read_size); + $p_size -= $v_read_size; + } + } elseif ($p_mode==3) { + while ($p_size != 0) { + $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); + $v_buffer = @gzread($p_src, $v_read_size); + @gzwrite($p_dest, $v_buffer, $v_read_size); + $p_size -= $v_read_size; + } + } + + // ----- Return + return $v_result; +} +// -------------------------------------------------------------------------------- + +// -------------------------------------------------------------------------------- +// Function : PclZipUtilRename() +// Description : +// This function tries to do a simple rename() function. If it fails, it +// tries to copy the $p_src file in a new $p_dest file and then unlink the +// first one. +// Parameters : +// $p_src : Old filename +// $p_dest : New filename +// Return Values : +// 1 on success, 0 on failure. +// -------------------------------------------------------------------------------- +function PclZipUtilRename($p_src, $p_dest) +{ + $v_result = 1; + + // ----- Try to rename the files + if (!@rename($p_src, $p_dest)) { + // ----- Try to copy & unlink the src + if (!@copy($p_src, $p_dest)) { + $v_result = 0; + } elseif (!@unlink($p_src)) { + $v_result = 0; + } + } + + // ----- Return + return $v_result; +} +// -------------------------------------------------------------------------------- + +// -------------------------------------------------------------------------------- +// Function : PclZipUtilOptionText() +// Description : +// Translate option value in text. Mainly for debug purpose. +// Parameters : +// $p_option : the option value. +// Return Values : +// The option text value. +// -------------------------------------------------------------------------------- +function PclZipUtilOptionText($p_option) +{ + $v_list = get_defined_constants(); + for (reset($v_list); $v_key = key($v_list); next($v_list)) { + $v_prefix = substr($v_key, 0, 10); + if ((($v_prefix == 'PCLZIP_OPT') || ($v_prefix == 'PCLZIP_CB_') || ($v_prefix == 'PCLZIP_ATT')) && ($v_list[$v_key] == $p_option)) { + return $v_key; + } + } + + $v_result = 'Unknown'; + + return $v_result; +} +// -------------------------------------------------------------------------------- + +// -------------------------------------------------------------------------------- +// Function : PclZipUtilTranslateWinPath() +// Description : +// Translate windows path by replacing '\' by '/' and optionally removing +// drive letter. +// Parameters : +// $p_path : path to translate. +// $p_remove_disk_letter : true | false +// Return Values : +// The path translated. +// -------------------------------------------------------------------------------- +function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter = true) +{ + if (stristr(php_uname(), 'windows')) { + // ----- Look for potential disk letter + if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) { + $p_path = substr($p_path, $v_position+1); + } + // ----- Change potential windows directory separator + if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0, 1) == '\\')) { + $p_path = strtr($p_path, '\\', '/'); + } + } + return $p_path; +} diff --git a/extend/PHPExcel/PHPExcel/Shared/PCLZip/readme.txt b/extend/PHPExcel/PHPExcel/Shared/PCLZip/readme.txt new file mode 100644 index 0000000..d1b11e2 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/PCLZip/readme.txt @@ -0,0 +1,421 @@ +// -------------------------------------------------------------------------------- +// PclZip 2.8.2 - readme.txt +// -------------------------------------------------------------------------------- +// License GNU/LGPL - August 2009 +// Vincent Blavet - vincent@phpconcept.net +// http://www.phpconcept.net +// -------------------------------------------------------------------------------- +// $Id: readme.txt,v 1.60 2009/09/30 20:35:21 vblavet Exp $ +// -------------------------------------------------------------------------------- + + + +0 - Sommaire +============ + 1 - Introduction + 2 - What's new + 3 - Corrected bugs + 4 - Known bugs or limitations + 5 - License + 6 - Warning + 7 - Documentation + 8 - Author + 9 - Contribute + +1 - Introduction +================ + + PclZip is a library that allow you to manage a Zip archive. + + Full documentation about PclZip can be found here : http://www.phpconcept.net/pclzip + +2 - What's new +============== + + Version 2.8.2 : + - PCLZIP_CB_PRE_EXTRACT and PCLZIP_CB_POST_EXTRACT are now supported with + extraction as a string (PCLZIP_OPT_EXTRACT_AS_STRING). The string + can also be modified in the post-extract call back. + **Bugs correction : + - PCLZIP_OPT_REMOVE_ALL_PATH was not working correctly + - Remove use of eval() and do direct call to callback functions + - Correct support of 64bits systems (Thanks to WordPress team) + + Version 2.8.1 : + - Move option PCLZIP_OPT_BY_EREG to PCLZIP_OPT_BY_PREG because ereg() is + deprecated in PHP 5.3. When using option PCLZIP_OPT_BY_EREG, PclZip will + automatically replace it by PCLZIP_OPT_BY_PREG. + + Version 2.8 : + - Improve extraction of zip archive for large files by using temporary files + This feature is working like the one defined in r2.7. + Options are renamed : PCLZIP_OPT_TEMP_FILE_ON, PCLZIP_OPT_TEMP_FILE_OFF, + PCLZIP_OPT_TEMP_FILE_THRESHOLD + - Add a ratio constant PCLZIP_TEMPORARY_FILE_RATIO to configure the auto + sense of temporary file use. + - Bug correction : Reduce filepath in returned file list to remove ennoying + './/' preambule in file path. + + Version 2.7 : + - Improve creation of zip archive for large files : + PclZip will now autosense the configured memory and use temporary files + when large file is suspected. + This feature can also ne triggered by manual options in create() and add() + methods. 'PCLZIP_OPT_ADD_TEMP_FILE_ON' force the use of temporary files, + 'PCLZIP_OPT_ADD_TEMP_FILE_OFF' disable the autosense technic, + 'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD' allow for configuration of a size + threshold to use temporary files. + Using "temporary files" rather than "memory" might take more time, but + might give the ability to zip very large files : + Tested on my win laptop with a 88Mo file : + Zip "in-memory" : 18sec (max_execution_time=30, memory_limit=180Mo) + Zip "tmporary-files" : 23sec (max_execution_time=30, memory_limit=30Mo) + - Replace use of mktime() by time() to limit the E_STRICT error messages. + - Bug correction : When adding files with full windows path (drive letter) + PclZip is now working. Before, if the drive letter is not the default + path, PclZip was not able to add the file. + + Version 2.6 : + - Code optimisation + - New attributes PCLZIP_ATT_FILE_COMMENT gives the ability to + add a comment for a specific file. (Don't really know if this is usefull) + - New attribute PCLZIP_ATT_FILE_CONTENT gives the ability to add a string + as a file. + - New attribute PCLZIP_ATT_FILE_MTIME modify the timestamp associated with + a file. + - Correct a bug. Files archived with a timestamp with 0h0m0s were extracted + with current time + - Add CRC value in the informations returned back for each file after an + action. + - Add missing closedir() statement. + - When adding a folder, and removing the path of this folder, files were + incorrectly added with a '/' at the beginning. Which means files are + related to root in unix systems. Corrected. + - Add conditional if before constant definition. This will allow users + to redefine constants without changing the file, and then improve + upgrade of pclzip code for new versions. + + Version 2.5 : + - Introduce the ability to add file/folder with individual properties (file descriptor). + This gives for example the ability to change the filename of a zipped file. + . Able to add files individually + . Able to change full name + . Able to change short name + . Compatible with global options + - New attributes : PCLZIP_ATT_FILE_NAME, PCLZIP_ATT_FILE_NEW_SHORT_NAME, PCLZIP_ATT_FILE_NEW_FULL_NAME + - New error code : PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE + - Add a security control feature. PclZip can extract any file in any folder + of a system. People may use this to upload a zip file and try to override + a system file. The PCLZIP_OPT_EXTRACT_DIR_RESTRICTION will give the + ability to forgive any directory transversal behavior. + - New PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : check extraction path + - New error code : PCLZIP_ERR_DIRECTORY_RESTRICTION + - Modification in PclZipUtilPathInclusion() : dir and path beginning with ./ will be prepend + by current path (getcwd()) + + Version 2.4 : + - Code improvment : try to speed up the code by removing unusefull call to pack() + - Correct bug in delete() : delete() should be called with no argument. This was not + the case in 2.3. This is corrected in 2.4. + - Correct a bug in path_inclusion function. When the path has several '../../', the + result was bad. + - Add a check for magic_quotes_runtime configuration. If enabled, PclZip will + disable it while working and det it back to its original value. + This resolve a lots of bad formated archive errors. + - Bug correction : PclZip now correctly unzip file in some specific situation, + when compressed content has same size as uncompressed content. + - Bug correction : When selecting option 'PCLZIP_OPT_REMOVE_ALL_PATH', + directories are not any more created. + - Code improvment : correct unclosed opendir(), better handling of . and .. in + loops. + + + Version 2.3 : + - Correct a bug with PHP5 : affecting the value 0xFE49FFE0 to a variable does not + give the same result in PHP4 and PHP5 .... + + Version 2.2 : + - Try development of PCLZIP_OPT_CRYPT ..... + However this becomes to a stop. To crypt/decrypt I need to multiply 2 long integers, + the result (greater than a long) is not supported by PHP. Even the use of bcmath + functions does not help. I did not find yet a solution ...; + - Add missing '/' at end of directory entries + - Check is a file is encrypted or not. Returns status 'unsupported_encryption' and/or + error code PCLZIP_ERR_UNSUPPORTED_ENCRYPTION. + - Corrected : Bad "version need to extract" field in local file header + - Add private method privCheckFileHeaders() in order to check local and central + file headers. PclZip is now supporting purpose bit flag bit 3. Purpose bit flag bit 3 gives + the ability to have a local file header without size, compressed size and crc filled. + - Add a generic status 'error' for file status + - Add control of compression type. PclZip only support deflate compression method. + Before v2.2, PclZip does not check the compression method used in an archive while + extracting. With v2.2 PclZip returns a new error status for a file using an unsupported + compression method. New status is "unsupported_compression". New error code is + PCLZIP_ERR_UNSUPPORTED_COMPRESSION. + - Add optional attribute PCLZIP_OPT_STOP_ON_ERROR. This will stop the extract of files + when errors like 'a folder with same name exists' or 'a newer file exists' or + 'a write protected file' exists, rather than set a status for the concerning file + and resume the extract of the zip. + - Add optional attribute PCLZIP_OPT_REPLACE_NEWER. This will force, during an extract' the + replacement of the file, even if a newer version of the file exists. + Note that today if a file with the same name already exists but is older it will be + replaced by the extracted one. + - Improve PclZipUtilOption() + - Support of zip archive with trailing bytes. Before 2.2, PclZip checks that the central + directory structure is the last data in the archive. Crypt encryption/decryption of + zip archive put trailing 0 bytes after decryption. PclZip is now supporting this. + + Version 2.1 : + - Add the ability to abort the extraction by using a user callback function. + The user can now return the value '2' in its callback which indicates to stop the + extraction. For a pre call-back extract is stopped before the extration of the current + file. For a post call back, the extraction is stopped after. + - Add the ability to extract a file (or several files) directly in the standard output. + This is done by the new parameter PCLZIP_OPT_EXTRACT_IN_OUTPUT with method extract(). + - Add support for parameters PCLZIP_OPT_COMMENT, PCLZIP_OPT_ADD_COMMENT, + PCLZIP_OPT_PREPEND_COMMENT. This will create, replace, add, or prepend comments + in the zip archive. + - When merging two archives, the comments are not any more lost, but merged, with a + blank space separator. + - Corrected bug : Files are not deleted when all files are asked to be deleted. + - Corrected bug : Folders with name '0' made PclZip to abort the create or add feature. + + + Version 2.0 : + ***** Warning : Some new features may break the backward compatibility for your scripts. + Please carefully read the readme file. + - Add the ability to delete by Index, name and regular expression. This feature is + performed by the method delete(), which uses the optional parameters + PCLZIP_OPT_BY_INDEX, PCLZIP_OPT_BY_NAME, PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG. + - Add the ability to extract by regular expression. To extract by regexp you must use the method + extract(), with the option PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG + (depending if you want to use ereg() or preg_match() syntax) followed by the + regular expression pattern. + - Add the ability to extract by index, directly with the extract() method. This is a + code improvment of the extractByIndex() method. + - Add the ability to extract by name. To extract by name you must use the method + extract(), with the option PCLZIP_OPT_BY_NAME followed by the filename to + extract or an array of filenames to extract. To extract all a folder, use the folder + name rather than the filename with a '/' at the end. + - Add the ability to add files without compression. This is done with a new attribute + which is PCLZIP_OPT_NO_COMPRESSION. + - Add the attribute PCLZIP_OPT_EXTRACT_AS_STRING, which allow to extract a file directly + in a string without using any file (or temporary file). + - Add constant PCLZIP_SEPARATOR for static configuration of filename separators in a single string. + The default separator is now a comma (,) and not any more a blank space. + THIS BREAK THE BACKWARD COMPATIBILITY : Please check if this may have an impact with + your script. + - Improve algorythm performance by removing the use of temporary files when adding or + extracting files in an archive. + - Add (correct) detection of empty filename zipping. This can occurs when the removed + path is the same + as a zipped dir. The dir is not zipped (['status'] = filtered), only its content. + - Add better support for windows paths (thanks for help from manus@manusfreedom.com). + - Corrected bug : When the archive file already exists with size=0, the add() method + fails. Corrected in 2.0. + - Remove the use of OS_WINDOWS constant. Use php_uname() function rather. + - Control the order of index ranges in extract by index feature. + - Change the internal management of folders (better handling of internal flag). + + + Version 1.3 : + - Removing the double include check. This is now done by include_once() and require_once() + PHP directives. + - Changing the error handling mecanism : Remove the use of an external error library. + The former PclError...() functions are replaced by internal equivalent methods. + By changing the environment variable PCLZIP_ERROR_EXTERNAL you can still use the former library. + Introducing the use of constants for error codes rather than integer values. This will help + in futur improvment. + Introduction of error handling functions like errorCode(), errorName() and errorInfo(). + - Remove the deprecated use of calling function with arguments passed by reference. + - Add the calling of extract(), extractByIndex(), create() and add() functions + with variable options rather than fixed arguments. + - Add the ability to remove all the file path while extracting or adding, + without any need to specify the path to remove. + This is available for extract(), extractByIndex(), create() and add() functionS by using + the new variable options parameters : + - PCLZIP_OPT_REMOVE_ALL_PATH : by indicating this option while calling the fct. + - Ability to change the mode of a file after the extraction (chmod()). + This is available for extract() and extractByIndex() functionS by using + the new variable options parameters. + - PCLZIP_OPT_SET_CHMOD : by setting the value of this option. + - Ability to definition call-back options. These call-back will be called during the adding, + or the extracting of file (extract(), extractByIndex(), create() and add() functions) : + - PCLZIP_CB_PRE_EXTRACT : will be called before each extraction of a file. The user + can trigerred the change the filename of the extracted file. The user can triggered the + skip of the extraction. This is adding a 'skipped' status in the file list result value. + - PCLZIP_CB_POST_EXTRACT : will be called after each extraction of a file. + Nothing can be triggered from that point. + - PCLZIP_CB_PRE_ADD : will be called before each add of a file. The user + can trigerred the change the stored filename of the added file. The user can triggered the + skip of the add. This is adding a 'skipped' status in the file list result value. + - PCLZIP_CB_POST_ADD : will be called after each add of a file. + Nothing can be triggered from that point. + - Two status are added in the file list returned as function result : skipped & filename_too_long + 'skipped' is used when a call-back function ask for skipping the file. + 'filename_too_long' is used while adding a file with a too long filename to archive (the file is + not added) + - Adding the function PclZipUtilPathInclusion(), that check the inclusion of a path into + a directory. + - Add a check of the presence of the archive file before some actions (like list, ...) + - Add the initialisation of field "index" in header array. This means that by + default index will be -1 when not explicitly set by the methods. + + Version 1.2 : + - Adding a duplicate function. + - Adding a merge function. The merge function is a "quick merge" function, + it just append the content of an archive at the end of the first one. There + is no check for duplicate files or more recent files. + - Improve the search of the central directory end. + + Version 1.1.2 : + + - Changing the license of PclZip. PclZip is now released under the GNU / LGPL license + (see License section). + - Adding the optional support of a static temporary directory. You will need to configure + the constant PCLZIP_TEMPORARY_DIR if you want to use this feature. + - Improving the rename() function. In some cases rename() does not work (different + Filesystems), so it will be replaced by a copy() + unlink() functions. + + Version 1.1.1 : + + - Maintenance release, no new feature. + + Version 1.1 : + + - New method Add() : adding files in the archive + - New method ExtractByIndex() : partial extract of the archive, files are identified by + their index in the archive + - New method DeleteByIndex() : delete some files/folder entries from the archive, + files are identified by their index in the archive. + - Adding a test of the zlib extension presence. If not present abort the script. + + Version 1.0.1 : + + - No new feature + + +3 - Corrected bugs +================== + + Corrected in Version 2.0 : + - Corrected : During an extraction, if a call-back fucntion is used and try to skip + a file, all the extraction process is stopped. + + Corrected in Version 1.3 : + - Corrected : Support of static synopsis for method extract() is broken. + - Corrected : invalid size of archive content field (0xFF) should be (0xFFFF). + - Corrected : When an extract is done with a remove_path parameter, the entry for + the directory with exactly the same path is not skipped/filtered. + - Corrected : extractByIndex() and deleteByIndex() were not managing index in the + right way. For example indexes '1,3-5,11' will only extract files 1 and 11. This + is due to a sort of the index resulting table that puts 11 before 3-5 (sort on + string and not interger). The sort is temporarilly removed, this means that + you must provide a sorted list of index ranges. + + Corrected in Version 1.2 : + + - Nothing. + + Corrected in Version 1.1.2 : + + - Corrected : Winzip is unable to delete or add new files in a PclZip created archives. + + Corrected in Version 1.1.1 : + + - Corrected : When archived file is not compressed (0% compression), the + extract method fails. + + Corrected in Version 1.1 : + + - Corrected : Adding a complete tree of folder may result in a bad archive + creation. + + Corrected in Version 1.0.1 : + + - Corrected : Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024). + + +4 - Known bugs or limitations +============================= + + Please publish bugs reports in SourceForge : + http://sourceforge.net/tracker/?group_id=40254&atid=427564 + + In Version 2.x : + - PclZip does only support file uncompressed or compressed with deflate (compression method 8) + - PclZip does not support password protected zip archive + - Some concern were seen when changing mtime of a file while archiving. + Seems to be linked to Daylight Saving Time (PclTest_changing_mtime). + + In Version 1.2 : + + - merge() methods does not check for duplicate files or last date of modifications. + + In Version 1.1 : + + - Limitation : Using 'extract' fields in the file header in the zip archive is not supported. + - WinZip is unable to delete a single file in a PclZip created archive. It is also unable to + add a file in a PclZip created archive. (Corrected in v.1.2) + + In Version 1.0.1 : + + - Adding a complete tree of folder may result in a bad archive + creation. (Corrected in V.1.1). + - Path given to methods must be in the unix format (/) and not the Windows format (\). + Workaround : Use only / directory separators. + - PclZip is using temporary files that are sometime the name of the file with a .tmp or .gz + added suffix. Files with these names may already exist and may be overwritten. + Workaround : none. + - PclZip does not check if the zlib extension is present. If it is absent, the zip + file is not created and the lib abort without warning. + Workaround : enable the zlib extension on the php install + + In Version 1.0 : + + - Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024). + (Corrected in v.1.0.1) + - Limitation : Multi-disk zip archive are not supported. + + +5 - License +=========== + + Since version 1.1.2, PclZip Library is released under GNU/LGPL license. + This library is free, so you can use it at no cost. + + HOWEVER, if you release a script, an application, a library or any kind of + code using PclZip library (or a part of it), YOU MUST : + - Indicate in the documentation (or a readme file), that your work + uses PclZip Library, and make a reference to the author and the web site + http://www.phpconcept.net + - Gives the ability to the final user to update the PclZip libary. + + I will also appreciate that you send me a mail (vincent@phpconcept.net), just to + be aware that someone is using PclZip. + + For more information about GNU/LGPL license : http://www.gnu.org + +6 - Warning +================= + + This library and the associated files are non commercial, non professional work. + It should not have unexpected results. However if any damage is caused by this software + the author can not be responsible. + The use of this software is at the risk of the user. + +7 - Documentation +================= + PclZip User Manuel is available in English on PhpConcept : http://www.phpconcept.net/pclzip/man/en/index.php + A Russian translation was done by Feskov Kuzma : http://php.russofile.ru/ru/authors/unsort/zip/ + +8 - Author +========== + + This software was written by Vincent Blavet (vincent@phpconcept.net) on its leasure time. + +9 - Contribute +============== + If you want to contribute to the development of PclZip, please contact vincent@phpconcept.net. + If you can help in financing PhpConcept hosting service, please go to + http://www.phpconcept.net/soutien.php diff --git a/extend/PHPExcel/PHPExcel/Shared/PasswordHasher.php b/extend/PHPExcel/PHPExcel/Shared/PasswordHasher.php new file mode 100644 index 0000000..946742b --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/PasswordHasher.php @@ -0,0 +1,67 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_Shared_PasswordHasher + * + * @category PHPExcel + * @package PHPExcel_Shared + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +class PHPExcel_Shared_PasswordHasher +{ + /** + * Create a password hash from a given string. + * + * This method is based on the algorithm provided by + * Daniel Rentz of OpenOffice and the PEAR package + * Spreadsheet_Excel_Writer by Xavier Noguer <xnoguer@rezebra.com>. + * + * @param string $pPassword Password to hash + * @return string Hashed password + */ + public static function hashPassword($pPassword = '') + { + $password = 0x0000; + $charPos = 1; // char position + + // split the plain text password in its component characters + $chars = preg_split('//', $pPassword, -1, PREG_SPLIT_NO_EMPTY); + foreach ($chars as $char) { + $value = ord($char) << $charPos++; // shifted ASCII value + $rotated_bits = $value >> 15; // rotated bits beyond bit 15 + $value &= 0x7fff; // first 15 bits + $password ^= ($value | $rotated_bits); + } + + $password ^= strlen($pPassword); + $password ^= 0xCE4B; + + return(strtoupper(dechex($password))); + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/String.php b/extend/PHPExcel/PHPExcel/Shared/String.php new file mode 100644 index 0000000..fa1a64e --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/String.php @@ -0,0 +1,819 @@ +<?php + +/** + * PHPExcel_Shared_String + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_String +{ + /** Constants */ + /** Regular Expressions */ + // Fraction + const STRING_REGEXP_FRACTION = '(-?)(\d+)\s+(\d+\/\d+)'; + + + /** + * Control characters array + * + * @var string[] + */ + private static $controlCharacters = array(); + + /** + * SYLK Characters array + * + * $var array + */ + private static $SYLKCharacters = array(); + + /** + * Decimal separator + * + * @var string + */ + private static $decimalSeparator; + + /** + * Thousands separator + * + * @var string + */ + private static $thousandsSeparator; + + /** + * Currency code + * + * @var string + */ + private static $currencyCode; + + /** + * Is mbstring extension avalable? + * + * @var boolean + */ + private static $isMbstringEnabled; + + /** + * Is iconv extension avalable? + * + * @var boolean + */ + private static $isIconvEnabled; + + /** + * Build control characters array + */ + private static function buildControlCharacters() + { + for ($i = 0; $i <= 31; ++$i) { + if ($i != 9 && $i != 10 && $i != 13) { + $find = '_x' . sprintf('%04s', strtoupper(dechex($i))) . '_'; + $replace = chr($i); + self::$controlCharacters[$find] = $replace; + } + } + } + + /** + * Build SYLK characters array + */ + private static function buildSYLKCharacters() + { + self::$SYLKCharacters = array( + "\x1B 0" => chr(0), + "\x1B 1" => chr(1), + "\x1B 2" => chr(2), + "\x1B 3" => chr(3), + "\x1B 4" => chr(4), + "\x1B 5" => chr(5), + "\x1B 6" => chr(6), + "\x1B 7" => chr(7), + "\x1B 8" => chr(8), + "\x1B 9" => chr(9), + "\x1B :" => chr(10), + "\x1B ;" => chr(11), + "\x1B <" => chr(12), + "\x1B :" => chr(13), + "\x1B >" => chr(14), + "\x1B ?" => chr(15), + "\x1B!0" => chr(16), + "\x1B!1" => chr(17), + "\x1B!2" => chr(18), + "\x1B!3" => chr(19), + "\x1B!4" => chr(20), + "\x1B!5" => chr(21), + "\x1B!6" => chr(22), + "\x1B!7" => chr(23), + "\x1B!8" => chr(24), + "\x1B!9" => chr(25), + "\x1B!:" => chr(26), + "\x1B!;" => chr(27), + "\x1B!<" => chr(28), + "\x1B!=" => chr(29), + "\x1B!>" => chr(30), + "\x1B!?" => chr(31), + "\x1B'?" => chr(127), + "\x1B(0" => '€', // 128 in CP1252 + "\x1B(2" => '‚', // 130 in CP1252 + "\x1B(3" => 'ƒ', // 131 in CP1252 + "\x1B(4" => '„', // 132 in CP1252 + "\x1B(5" => '…', // 133 in CP1252 + "\x1B(6" => '†', // 134 in CP1252 + "\x1B(7" => '‡', // 135 in CP1252 + "\x1B(8" => 'ˆ', // 136 in CP1252 + "\x1B(9" => '‰', // 137 in CP1252 + "\x1B(:" => 'Š', // 138 in CP1252 + "\x1B(;" => '‹', // 139 in CP1252 + "\x1BNj" => 'Œ', // 140 in CP1252 + "\x1B(>" => 'Ž', // 142 in CP1252 + "\x1B)1" => '‘', // 145 in CP1252 + "\x1B)2" => '’', // 146 in CP1252 + "\x1B)3" => '“', // 147 in CP1252 + "\x1B)4" => '”', // 148 in CP1252 + "\x1B)5" => '•', // 149 in CP1252 + "\x1B)6" => '–', // 150 in CP1252 + "\x1B)7" => '—', // 151 in CP1252 + "\x1B)8" => '˜', // 152 in CP1252 + "\x1B)9" => '™', // 153 in CP1252 + "\x1B):" => 'š', // 154 in CP1252 + "\x1B);" => '›', // 155 in CP1252 + "\x1BNz" => 'œ', // 156 in CP1252 + "\x1B)>" => 'ž', // 158 in CP1252 + "\x1B)?" => 'Ÿ', // 159 in CP1252 + "\x1B*0" => ' ', // 160 in CP1252 + "\x1BN!" => '¡', // 161 in CP1252 + "\x1BN\"" => '¢', // 162 in CP1252 + "\x1BN#" => '£', // 163 in CP1252 + "\x1BN(" => '¤', // 164 in CP1252 + "\x1BN%" => '¥', // 165 in CP1252 + "\x1B*6" => '¦', // 166 in CP1252 + "\x1BN'" => '§', // 167 in CP1252 + "\x1BNH " => '¨', // 168 in CP1252 + "\x1BNS" => '©', // 169 in CP1252 + "\x1BNc" => 'ª', // 170 in CP1252 + "\x1BN+" => '«', // 171 in CP1252 + "\x1B*<" => '¬', // 172 in CP1252 + "\x1B*=" => '­', // 173 in CP1252 + "\x1BNR" => '®', // 174 in CP1252 + "\x1B*?" => '¯', // 175 in CP1252 + "\x1BN0" => '°', // 176 in CP1252 + "\x1BN1" => '±', // 177 in CP1252 + "\x1BN2" => '²', // 178 in CP1252 + "\x1BN3" => '³', // 179 in CP1252 + "\x1BNB " => '´', // 180 in CP1252 + "\x1BN5" => 'µ', // 181 in CP1252 + "\x1BN6" => '¶', // 182 in CP1252 + "\x1BN7" => '·', // 183 in CP1252 + "\x1B+8" => '¸', // 184 in CP1252 + "\x1BNQ" => '¹', // 185 in CP1252 + "\x1BNk" => 'º', // 186 in CP1252 + "\x1BN;" => '»', // 187 in CP1252 + "\x1BN<" => '¼', // 188 in CP1252 + "\x1BN=" => '½', // 189 in CP1252 + "\x1BN>" => '¾', // 190 in CP1252 + "\x1BN?" => '¿', // 191 in CP1252 + "\x1BNAA" => 'À', // 192 in CP1252 + "\x1BNBA" => 'Á', // 193 in CP1252 + "\x1BNCA" => 'Â', // 194 in CP1252 + "\x1BNDA" => 'Ã', // 195 in CP1252 + "\x1BNHA" => 'Ä', // 196 in CP1252 + "\x1BNJA" => 'Å', // 197 in CP1252 + "\x1BNa" => 'Æ', // 198 in CP1252 + "\x1BNKC" => 'Ç', // 199 in CP1252 + "\x1BNAE" => 'È', // 200 in CP1252 + "\x1BNBE" => 'É', // 201 in CP1252 + "\x1BNCE" => 'Ê', // 202 in CP1252 + "\x1BNHE" => 'Ë', // 203 in CP1252 + "\x1BNAI" => 'Ì', // 204 in CP1252 + "\x1BNBI" => 'Í', // 205 in CP1252 + "\x1BNCI" => 'Î', // 206 in CP1252 + "\x1BNHI" => 'Ï', // 207 in CP1252 + "\x1BNb" => 'Ð', // 208 in CP1252 + "\x1BNDN" => 'Ñ', // 209 in CP1252 + "\x1BNAO" => 'Ò', // 210 in CP1252 + "\x1BNBO" => 'Ó', // 211 in CP1252 + "\x1BNCO" => 'Ô', // 212 in CP1252 + "\x1BNDO" => 'Õ', // 213 in CP1252 + "\x1BNHO" => 'Ö', // 214 in CP1252 + "\x1B-7" => '×', // 215 in CP1252 + "\x1BNi" => 'Ø', // 216 in CP1252 + "\x1BNAU" => 'Ù', // 217 in CP1252 + "\x1BNBU" => 'Ú', // 218 in CP1252 + "\x1BNCU" => 'Û', // 219 in CP1252 + "\x1BNHU" => 'Ü', // 220 in CP1252 + "\x1B-=" => 'Ý', // 221 in CP1252 + "\x1BNl" => 'Þ', // 222 in CP1252 + "\x1BN{" => 'ß', // 223 in CP1252 + "\x1BNAa" => 'à', // 224 in CP1252 + "\x1BNBa" => 'á', // 225 in CP1252 + "\x1BNCa" => 'â', // 226 in CP1252 + "\x1BNDa" => 'ã', // 227 in CP1252 + "\x1BNHa" => 'ä', // 228 in CP1252 + "\x1BNJa" => 'å', // 229 in CP1252 + "\x1BNq" => 'æ', // 230 in CP1252 + "\x1BNKc" => 'ç', // 231 in CP1252 + "\x1BNAe" => 'è', // 232 in CP1252 + "\x1BNBe" => 'é', // 233 in CP1252 + "\x1BNCe" => 'ê', // 234 in CP1252 + "\x1BNHe" => 'ë', // 235 in CP1252 + "\x1BNAi" => 'ì', // 236 in CP1252 + "\x1BNBi" => 'í', // 237 in CP1252 + "\x1BNCi" => 'î', // 238 in CP1252 + "\x1BNHi" => 'ï', // 239 in CP1252 + "\x1BNs" => 'ð', // 240 in CP1252 + "\x1BNDn" => 'ñ', // 241 in CP1252 + "\x1BNAo" => 'ò', // 242 in CP1252 + "\x1BNBo" => 'ó', // 243 in CP1252 + "\x1BNCo" => 'ô', // 244 in CP1252 + "\x1BNDo" => 'õ', // 245 in CP1252 + "\x1BNHo" => 'ö', // 246 in CP1252 + "\x1B/7" => '÷', // 247 in CP1252 + "\x1BNy" => 'ø', // 248 in CP1252 + "\x1BNAu" => 'ù', // 249 in CP1252 + "\x1BNBu" => 'ú', // 250 in CP1252 + "\x1BNCu" => 'û', // 251 in CP1252 + "\x1BNHu" => 'ü', // 252 in CP1252 + "\x1B/=" => 'ý', // 253 in CP1252 + "\x1BN|" => 'þ', // 254 in CP1252 + "\x1BNHy" => 'ÿ', // 255 in CP1252 + ); + } + + /** + * Get whether mbstring extension is available + * + * @return boolean + */ + public static function getIsMbstringEnabled() + { + if (isset(self::$isMbstringEnabled)) { + return self::$isMbstringEnabled; + } + + self::$isMbstringEnabled = function_exists('mb_convert_encoding') ? + true : false; + + return self::$isMbstringEnabled; + } + + /** + * Get whether iconv extension is available + * + * @return boolean + */ + public static function getIsIconvEnabled() + { + if (isset(self::$isIconvEnabled)) { + return self::$isIconvEnabled; + } + + // Fail if iconv doesn't exist + if (!function_exists('iconv')) { + self::$isIconvEnabled = false; + return false; + } + + // Sometimes iconv is not working, and e.g. iconv('UTF-8', 'UTF-16LE', 'x') just returns false, + if (!@iconv('UTF-8', 'UTF-16LE', 'x')) { + self::$isIconvEnabled = false; + return false; + } + + // Sometimes iconv_substr('A', 0, 1, 'UTF-8') just returns false in PHP 5.2.0 + // we cannot use iconv in that case either (http://bugs.php.net/bug.php?id=37773) + if (!@iconv_substr('A', 0, 1, 'UTF-8')) { + self::$isIconvEnabled = false; + return false; + } + + // CUSTOM: IBM AIX iconv() does not work + if (defined('PHP_OS') && @stristr(PHP_OS, 'AIX') && defined('ICONV_IMPL') && (@strcasecmp(ICONV_IMPL, 'unknown') == 0) && defined('ICONV_VERSION') && (@strcasecmp(ICONV_VERSION, 'unknown') == 0)) { + self::$isIconvEnabled = false; + return false; + } + + // If we reach here no problems were detected with iconv + self::$isIconvEnabled = true; + return true; + } + + public static function buildCharacterSets() + { + if (empty(self::$controlCharacters)) { + self::buildControlCharacters(); + } + if (empty(self::$SYLKCharacters)) { + self::buildSYLKCharacters(); + } + } + + /** + * Convert from OpenXML escaped control character to PHP control character + * + * Excel 2007 team: + * ---------------- + * That's correct, control characters are stored directly in the shared-strings table. + * We do encode characters that cannot be represented in XML using the following escape sequence: + * _xHHHH_ where H represents a hexadecimal character in the character's value... + * So you could end up with something like _x0008_ in a string (either in a cell value (<v>) + * element or in the shared string <t> element. + * + * @param string $value Value to unescape + * @return string + */ + public static function ControlCharacterOOXML2PHP($value = '') + { + return str_replace(array_keys(self::$controlCharacters), array_values(self::$controlCharacters), $value); + } + + /** + * Convert from PHP control character to OpenXML escaped control character + * + * Excel 2007 team: + * ---------------- + * That's correct, control characters are stored directly in the shared-strings table. + * We do encode characters that cannot be represented in XML using the following escape sequence: + * _xHHHH_ where H represents a hexadecimal character in the character's value... + * So you could end up with something like _x0008_ in a string (either in a cell value (<v>) + * element or in the shared string <t> element. + * + * @param string $value Value to escape + * @return string + */ + public static function ControlCharacterPHP2OOXML($value = '') + { + return str_replace(array_values(self::$controlCharacters), array_keys(self::$controlCharacters), $value); + } + + /** + * Try to sanitize UTF8, stripping invalid byte sequences. Not perfect. Does not surrogate characters. + * + * @param string $value + * @return string + */ + public static function SanitizeUTF8($value) + { + if (self::getIsIconvEnabled()) { + $value = @iconv('UTF-8', 'UTF-8', $value); + return $value; + } + + if (self::getIsMbstringEnabled()) { + $value = mb_convert_encoding($value, 'UTF-8', 'UTF-8'); + return $value; + } + + // else, no conversion + return $value; + } + + /** + * Check if a string contains UTF8 data + * + * @param string $value + * @return boolean + */ + public static function IsUTF8($value = '') + { + return $value === '' || preg_match('/^./su', $value) === 1; + } + + /** + * Formats a numeric value as a string for output in various output writers forcing + * point as decimal separator in case locale is other than English. + * + * @param mixed $value + * @return string + */ + public static function FormatNumber($value) + { + if (is_float($value)) { + return str_replace(',', '.', $value); + } + return (string) $value; + } + + /** + * Converts a UTF-8 string into BIFF8 Unicode string data (8-bit string length) + * Writes the string using uncompressed notation, no rich text, no Asian phonetics + * If mbstring extension is not available, ASCII is assumed, and compressed notation is used + * although this will give wrong results for non-ASCII strings + * see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect. 2.5.3 + * + * @param string $value UTF-8 encoded string + * @param mixed[] $arrcRuns Details of rich text runs in $value + * @return string + */ + public static function UTF8toBIFF8UnicodeShort($value, $arrcRuns = array()) + { + // character count + $ln = self::CountCharacters($value, 'UTF-8'); + // option flags + if (empty($arrcRuns)) { + $opt = (self::getIsIconvEnabled() || self::getIsMbstringEnabled()) ? + 0x0001 : 0x0000; + $data = pack('CC', $ln, $opt); + // characters + $data .= self::ConvertEncoding($value, 'UTF-16LE', 'UTF-8'); + } else { + $data = pack('vC', $ln, 0x09); + $data .= pack('v', count($arrcRuns)); + // characters + $data .= self::ConvertEncoding($value, 'UTF-16LE', 'UTF-8'); + foreach ($arrcRuns as $cRun) { + $data .= pack('v', $cRun['strlen']); + $data .= pack('v', $cRun['fontidx']); + } + } + return $data; + } + + /** + * Converts a UTF-8 string into BIFF8 Unicode string data (16-bit string length) + * Writes the string using uncompressed notation, no rich text, no Asian phonetics + * If mbstring extension is not available, ASCII is assumed, and compressed notation is used + * although this will give wrong results for non-ASCII strings + * see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect. 2.5.3 + * + * @param string $value UTF-8 encoded string + * @return string + */ + public static function UTF8toBIFF8UnicodeLong($value) + { + // character count + $ln = self::CountCharacters($value, 'UTF-8'); + + // option flags + $opt = (self::getIsIconvEnabled() || self::getIsMbstringEnabled()) ? + 0x0001 : 0x0000; + + // characters + $chars = self::ConvertEncoding($value, 'UTF-16LE', 'UTF-8'); + + $data = pack('vC', $ln, $opt) . $chars; + return $data; + } + + /** + * Convert string from one encoding to another. First try mbstring, then iconv, finally strlen + * + * @param string $value + * @param string $to Encoding to convert to, e.g. 'UTF-8' + * @param string $from Encoding to convert from, e.g. 'UTF-16LE' + * @return string + */ + public static function ConvertEncoding($value, $to, $from) + { + if (self::getIsIconvEnabled()) { + return iconv($from, $to, $value); + } + + if (self::getIsMbstringEnabled()) { + return mb_convert_encoding($value, $to, $from); + } + + if ($from == 'UTF-16LE') { + return self::utf16_decode($value, false); + } elseif ($from == 'UTF-16BE') { + return self::utf16_decode($value); + } + // else, no conversion + return $value; + } + + /** + * Decode UTF-16 encoded strings. + * + * Can handle both BOM'ed data and un-BOM'ed data. + * Assumes Big-Endian byte order if no BOM is available. + * This function was taken from http://php.net/manual/en/function.utf8-decode.php + * and $bom_be parameter added. + * + * @param string $str UTF-16 encoded data to decode. + * @return string UTF-8 / ISO encoded data. + * @access public + * @version 0.2 / 2010-05-13 + * @author Rasmus Andersson {@link http://rasmusandersson.se/} + * @author vadik56 + */ + public static function utf16_decode($str, $bom_be = true) + { + if (strlen($str) < 2) { + return $str; + } + $c0 = ord($str{0}); + $c1 = ord($str{1}); + if ($c0 == 0xfe && $c1 == 0xff) { + $str = substr($str, 2); + } elseif ($c0 == 0xff && $c1 == 0xfe) { + $str = substr($str, 2); + $bom_be = false; + } + $len = strlen($str); + $newstr = ''; + for ($i=0; $i<$len; $i+=2) { + if ($bom_be) { + $val = ord($str{$i}) << 4; + $val += ord($str{$i+1}); + } else { + $val = ord($str{$i+1}) << 4; + $val += ord($str{$i}); + } + $newstr .= ($val == 0x228) ? "\n" : chr($val); + } + return $newstr; + } + + /** + * Get character count. First try mbstring, then iconv, finally strlen + * + * @param string $value + * @param string $enc Encoding + * @return int Character count + */ + public static function CountCharacters($value, $enc = 'UTF-8') + { + if (self::getIsMbstringEnabled()) { + return mb_strlen($value, $enc); + } + + if (self::getIsIconvEnabled()) { + return iconv_strlen($value, $enc); + } + + // else strlen + return strlen($value); + } + + /** + * Get a substring of a UTF-8 encoded string. First try mbstring, then iconv, finally strlen + * + * @param string $pValue UTF-8 encoded string + * @param int $pStart Start offset + * @param int $pLength Maximum number of characters in substring + * @return string + */ + public static function Substring($pValue = '', $pStart = 0, $pLength = 0) + { + if (self::getIsMbstringEnabled()) { + return mb_substr($pValue, $pStart, $pLength, 'UTF-8'); + } + + if (self::getIsIconvEnabled()) { + return iconv_substr($pValue, $pStart, $pLength, 'UTF-8'); + } + + // else substr + return substr($pValue, $pStart, $pLength); + } + + /** + * Convert a UTF-8 encoded string to upper case + * + * @param string $pValue UTF-8 encoded string + * @return string + */ + public static function StrToUpper($pValue = '') + { + if (function_exists('mb_convert_case')) { + return mb_convert_case($pValue, MB_CASE_UPPER, "UTF-8"); + } + return strtoupper($pValue); + } + + /** + * Convert a UTF-8 encoded string to lower case + * + * @param string $pValue UTF-8 encoded string + * @return string + */ + public static function StrToLower($pValue = '') + { + if (function_exists('mb_convert_case')) { + return mb_convert_case($pValue, MB_CASE_LOWER, "UTF-8"); + } + return strtolower($pValue); + } + + /** + * Convert a UTF-8 encoded string to title/proper case + * (uppercase every first character in each word, lower case all other characters) + * + * @param string $pValue UTF-8 encoded string + * @return string + */ + public static function StrToTitle($pValue = '') + { + if (function_exists('mb_convert_case')) { + return mb_convert_case($pValue, MB_CASE_TITLE, "UTF-8"); + } + return ucwords($pValue); + } + + public static function mb_is_upper($char) + { + return mb_strtolower($char, "UTF-8") != $char; + } + + public static function mb_str_split($string) + { + # Split at all position not after the start: ^ + # and not before the end: $ + return preg_split('/(?<!^)(?!$)/u', $string); + } + + /** + * Reverse the case of a string, so that all uppercase characters become lowercase + * and all lowercase characters become uppercase + * + * @param string $pValue UTF-8 encoded string + * @return string + */ + public static function StrCaseReverse($pValue = '') + { + if (self::getIsMbstringEnabled()) { + $characters = self::mb_str_split($pValue); + foreach ($characters as &$character) { + if (self::mb_is_upper($character)) { + $character = mb_strtolower($character, 'UTF-8'); + } else { + $character = mb_strtoupper($character, 'UTF-8'); + } + } + return implode('', $characters); + } + return strtolower($pValue) ^ strtoupper($pValue) ^ $pValue; + } + + /** + * Identify whether a string contains a fractional numeric value, + * and convert it to a numeric if it is + * + * @param string &$operand string value to test + * @return boolean + */ + public static function convertToNumberIfFraction(&$operand) + { + if (preg_match('/^'.self::STRING_REGEXP_FRACTION.'$/i', $operand, $match)) { + $sign = ($match[1] == '-') ? '-' : '+'; + $fractionFormula = '='.$sign.$match[2].$sign.$match[3]; + $operand = PHPExcel_Calculation::getInstance()->_calculateFormulaValue($fractionFormula); + return true; + } + return false; + } // function convertToNumberIfFraction() + + /** + * Get the decimal separator. If it has not yet been set explicitly, try to obtain number + * formatting information from locale. + * + * @return string + */ + public static function getDecimalSeparator() + { + if (!isset(self::$decimalSeparator)) { + $localeconv = localeconv(); + self::$decimalSeparator = ($localeconv['decimal_point'] != '') + ? $localeconv['decimal_point'] : $localeconv['mon_decimal_point']; + + if (self::$decimalSeparator == '') { + // Default to . + self::$decimalSeparator = '.'; + } + } + return self::$decimalSeparator; + } + + /** + * Set the decimal separator. Only used by PHPExcel_Style_NumberFormat::toFormattedString() + * to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF + * + * @param string $pValue Character for decimal separator + */ + public static function setDecimalSeparator($pValue = '.') + { + self::$decimalSeparator = $pValue; + } + + /** + * Get the thousands separator. If it has not yet been set explicitly, try to obtain number + * formatting information from locale. + * + * @return string + */ + public static function getThousandsSeparator() + { + if (!isset(self::$thousandsSeparator)) { + $localeconv = localeconv(); + self::$thousandsSeparator = ($localeconv['thousands_sep'] != '') + ? $localeconv['thousands_sep'] : $localeconv['mon_thousands_sep']; + + if (self::$thousandsSeparator == '') { + // Default to . + self::$thousandsSeparator = ','; + } + } + return self::$thousandsSeparator; + } + + /** + * Set the thousands separator. Only used by PHPExcel_Style_NumberFormat::toFormattedString() + * to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF + * + * @param string $pValue Character for thousands separator + */ + public static function setThousandsSeparator($pValue = ',') + { + self::$thousandsSeparator = $pValue; + } + + /** + * Get the currency code. If it has not yet been set explicitly, try to obtain the + * symbol information from locale. + * + * @return string + */ + public static function getCurrencyCode() + { + if (!isset(self::$currencyCode)) { + $localeconv = localeconv(); + self::$currencyCode = ($localeconv['currency_symbol'] != '') + ? $localeconv['currency_symbol'] : $localeconv['int_curr_symbol']; + + if (self::$currencyCode == '') { + // Default to $ + self::$currencyCode = '$'; + } + } + return self::$currencyCode; + } + + /** + * Set the currency code. Only used by PHPExcel_Style_NumberFormat::toFormattedString() + * to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF + * + * @param string $pValue Character for currency code + */ + public static function setCurrencyCode($pValue = '$') + { + self::$currencyCode = $pValue; + } + + /** + * Convert SYLK encoded string to UTF-8 + * + * @param string $pValue + * @return string UTF-8 encoded string + */ + public static function SYLKtoUTF8($pValue = '') + { + // If there is no escape character in the string there is nothing to do + if (strpos($pValue, '') === false) { + return $pValue; + } + + foreach (self::$SYLKCharacters as $k => $v) { + $pValue = str_replace($k, $v, $pValue); + } + + return $pValue; + } + + /** + * Retrieve any leading numeric part of a string, or return the full string if no leading numeric + * (handles basic integer or float, but not exponent or non decimal) + * + * @param string $value + * @return mixed string or only the leading numeric part of the string + */ + public static function testStringAsNumeric($value) + { + if (is_numeric($value)) { + return $value; + } + $v = floatval($value); + return (is_numeric(substr($value, 0, strlen($v)))) ? $v : $value; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/TimeZone.php b/extend/PHPExcel/PHPExcel/Shared/TimeZone.php new file mode 100644 index 0000000..73373e0 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/TimeZone.php @@ -0,0 +1,144 @@ +<?php + +/** + * PHPExcel + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_Shared_TimeZone + * + * @category PHPExcel + * @package PHPExcel_Shared + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +class PHPExcel_Shared_TimeZone +{ + /* + * Default Timezone used for date/time conversions + * + * @private + * @var string + */ + protected static $timezone = 'UTC'; + + /** + * Validate a Timezone name + * + * @param string $timezone Time zone (e.g. 'Europe/London') + * @return boolean Success or failure + */ + public static function _validateTimeZone($timezone) + { + if (in_array($timezone, DateTimeZone::listIdentifiers())) { + return true; + } + return false; + } + + /** + * Set the Default Timezone used for date/time conversions + * + * @param string $timezone Time zone (e.g. 'Europe/London') + * @return boolean Success or failure + */ + public static function setTimeZone($timezone) + { + if (self::_validateTimezone($timezone)) { + self::$timezone = $timezone; + return true; + } + return false; + } + + + /** + * Return the Default Timezone used for date/time conversions + * + * @return string Timezone (e.g. 'Europe/London') + */ + public static function getTimeZone() + { + return self::$timezone; + } + + + /** + * Return the Timezone transition for the specified timezone and timestamp + * + * @param DateTimeZone $objTimezone The timezone for finding the transitions + * @param integer $timestamp PHP date/time value for finding the current transition + * @return array The current transition details + */ + private static function getTimezoneTransitions($objTimezone, $timestamp) + { + $allTransitions = $objTimezone->getTransitions(); + $transitions = array(); + foreach ($allTransitions as $key => $transition) { + if ($transition['ts'] > $timestamp) { + $transitions[] = ($key > 0) ? $allTransitions[$key - 1] : $transition; + break; + } + if (empty($transitions)) { + $transitions[] = end($allTransitions); + } + } + + return $transitions; + } + + /** + * Return the Timezone offset used for date/time conversions to/from UST + * This requires both the timezone and the calculated date/time to allow for local DST + * + * @param string $timezone The timezone for finding the adjustment to UST + * @param integer $timestamp PHP date/time value + * @return integer Number of seconds for timezone adjustment + * @throws PHPExcel_Exception + */ + public static function getTimeZoneAdjustment($timezone, $timestamp) + { + if ($timezone !== null) { + if (!self::_validateTimezone($timezone)) { + throw new PHPExcel_Exception("Invalid timezone " . $timezone); + } + } else { + $timezone = self::$timezone; + } + + if ($timezone == 'UST') { + return 0; + } + + $objTimezone = new DateTimeZone($timezone); + if (version_compare(PHP_VERSION, '5.3.0') >= 0) { + $transitions = $objTimezone->getTransitions($timestamp, $timestamp); + } else { + $transitions = self::getTimezoneTransitions($objTimezone, $timestamp); + } + + return (count($transitions) > 0) ? $transitions[0]['offset'] : 0; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/XMLWriter.php b/extend/PHPExcel/PHPExcel/Shared/XMLWriter.php new file mode 100644 index 0000000..1dc119b --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/XMLWriter.php @@ -0,0 +1,124 @@ +<?php + +if (!defined('DATE_W3C')) { + define('DATE_W3C', 'Y-m-d\TH:i:sP'); +} + +if (!defined('DEBUGMODE_ENABLED')) { + define('DEBUGMODE_ENABLED', false); +} + +/** + * PHPExcel_Shared_XMLWriter + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_XMLWriter extends XMLWriter +{ + /** Temporary storage method */ + const STORAGE_MEMORY = 1; + const STORAGE_DISK = 2; + + /** + * Temporary filename + * + * @var string + */ + private $tempFileName = ''; + + /** + * Create a new PHPExcel_Shared_XMLWriter instance + * + * @param int $pTemporaryStorage Temporary storage location + * @param string $pTemporaryStorageFolder Temporary storage folder + */ + public function __construct($pTemporaryStorage = self::STORAGE_MEMORY, $pTemporaryStorageFolder = null) + { + // Open temporary storage + if ($pTemporaryStorage == self::STORAGE_MEMORY) { + $this->openMemory(); + } else { + // Create temporary filename + if ($pTemporaryStorageFolder === null) { + $pTemporaryStorageFolder = PHPExcel_Shared_File::sys_get_temp_dir(); + } + $this->tempFileName = @tempnam($pTemporaryStorageFolder, 'xml'); + + // Open storage + if ($this->openUri($this->tempFileName) === false) { + // Fallback to memory... + $this->openMemory(); + } + } + + // Set default values + if (DEBUGMODE_ENABLED) { + $this->setIndent(true); + } + } + + /** + * Destructor + */ + public function __destruct() + { + // Unlink temporary files + if ($this->tempFileName != '') { + @unlink($this->tempFileName); + } + } + + /** + * Get written data + * + * @return $data + */ + public function getData() + { + if ($this->tempFileName == '') { + return $this->outputMemory(true); + } else { + $this->flush(); + return file_get_contents($this->tempFileName); + } + } + + /** + * Fallback method for writeRaw, introduced in PHP 5.2 + * + * @param string $text + * @return string + */ + public function writeRawData($text) + { + if (is_array($text)) { + $text = implode("\n", $text); + } + + if (method_exists($this, 'writeRaw')) { + return $this->writeRaw(htmlspecialchars($text)); + } + + return $this->text($text); + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/ZipArchive.php b/extend/PHPExcel/PHPExcel/Shared/ZipArchive.php new file mode 100644 index 0000000..9eac8ca --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/ZipArchive.php @@ -0,0 +1,163 @@ +<?php + +if (!defined('PCLZIP_TEMPORARY_DIR')) { + define('PCLZIP_TEMPORARY_DIR', PHPExcel_Shared_File::sys_get_temp_dir() . DIRECTORY_SEPARATOR); +} +require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/PCLZip/pclzip.lib.php'; + +/** + * PHPExcel_Shared_ZipArchive + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_ZipArchive + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_ZipArchive +{ + + /** constants */ + const OVERWRITE = 'OVERWRITE'; + const CREATE = 'CREATE'; + + + /** + * Temporary storage directory + * + * @var string + */ + private $tempDir; + + /** + * Zip Archive Stream Handle + * + * @var string + */ + private $zip; + + + /** + * Open a new zip archive + * + * @param string $fileName Filename for the zip archive + * @return boolean + */ + public function open($fileName) + { + $this->tempDir = PHPExcel_Shared_File::sys_get_temp_dir(); + $this->zip = new PclZip($fileName); + + return true; + } + + + /** + * Close this zip archive + * + */ + public function close() + { + } + + + /** + * Add a new file to the zip archive from a string of raw data. + * + * @param string $localname Directory/Name of the file to add to the zip archive + * @param string $contents String of data to add to the zip archive + */ + public function addFromString($localname, $contents) + { + $filenameParts = pathinfo($localname); + + $handle = fopen($this->tempDir.'/'.$filenameParts["basename"], "wb"); + fwrite($handle, $contents); + fclose($handle); + + $res = $this->zip->add($this->tempDir.'/'.$filenameParts["basename"], PCLZIP_OPT_REMOVE_PATH, $this->tempDir, PCLZIP_OPT_ADD_PATH, $filenameParts["dirname"]); + if ($res == 0) { + throw new PHPExcel_Writer_Exception("Error zipping files : " . $this->zip->errorInfo(true)); + } + + unlink($this->tempDir.'/'.$filenameParts["basename"]); + } + + /** + * Find if given fileName exist in archive (Emulate ZipArchive locateName()) + * + * @param string $fileName Filename for the file in zip archive + * @return boolean + */ + public function locateName($fileName) + { + $fileName = strtolower($fileName); + + $list = $this->zip->listContent(); + $listCount = count($list); + $index = -1; + for ($i = 0; $i < $listCount; ++$i) { + if (strtolower($list[$i]["filename"]) == $fileName || + strtolower($list[$i]["stored_filename"]) == $fileName) { + $index = $i; + break; + } + } + return ($index > -1) ? $index : false; + } + + /** + * Extract file from archive by given fileName (Emulate ZipArchive getFromName()) + * + * @param string $fileName Filename for the file in zip archive + * @return string $contents File string contents + */ + public function getFromName($fileName) + { + $index = $this->locateName($fileName); + + if ($index !== false) { + $extracted = $this->getFromIndex($index); + } else { + $fileName = substr($fileName, 1); + $index = $this->locateName($fileName); + if ($index === false) { + return false; + } + $extracted = $this->zip->getFromIndex($index); + } + + $contents = $extracted; + if ((is_array($extracted)) && ($extracted != 0)) { + $contents = $extracted[0]["content"]; + } + + return $contents; + } + + public function getFromIndex($index) { + $extracted = $this->zip->extractByIndex($index, PCLZIP_OPT_EXTRACT_AS_STRING); + $contents = ''; + if ((is_array($extracted)) && ($extracted != 0)) { + $contents = $extracted[0]["content"]; + } + + return $contents; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/ZipStreamWrapper.php b/extend/PHPExcel/PHPExcel/Shared/ZipStreamWrapper.php new file mode 100644 index 0000000..2e0324c --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/ZipStreamWrapper.php @@ -0,0 +1,200 @@ +<?php + +/** + * PHPExcel_Shared_ZipStreamWrapper + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Shared_ZipStreamWrapper +{ + /** + * Internal ZipAcrhive + * + * @var ZipArchive + */ + private $archive; + + /** + * Filename in ZipAcrhive + * + * @var string + */ + private $fileNameInArchive = ''; + + /** + * Position in file + * + * @var int + */ + private $position = 0; + + /** + * Data + * + * @var mixed + */ + private $data = ''; + + /** + * Register wrapper + */ + public static function register() + { + @stream_wrapper_unregister('zip'); + @stream_wrapper_register('zip', __CLASS__); + } + + /** + * Implements support for fopen(). + * + * @param string $path resource name including scheme, e.g. + * @param string $mode only "r" is supported + * @param int $options mask of STREAM_REPORT_ERRORS and STREAM_USE_PATH + * @param string &$openedPath absolute path of the opened stream (out parameter) + * @return bool true on success + */ + public function stream_open($path, $mode, $options, &$opened_path) + { + // Check for mode + if ($mode{0} != 'r') { + throw new PHPExcel_Reader_Exception('Mode ' . $mode . ' is not supported. Only read mode is supported.'); + } + + $pos = strrpos($path, '#'); + $url['host'] = substr($path, 6, $pos - 6); // 6: strlen('zip://') + $url['fragment'] = substr($path, $pos + 1); + + // Open archive + $this->archive = new ZipArchive(); + $this->archive->open($url['host']); + + $this->fileNameInArchive = $url['fragment']; + $this->position = 0; + $this->data = $this->archive->getFromName($this->fileNameInArchive); + + return true; + } + + /** + * Implements support for fstat(). + * + * @return boolean + */ + public function statName() + { + return $this->fileNameInArchive; + } + + /** + * Implements support for fstat(). + * + * @return boolean + */ + public function url_stat() + { + return $this->statName($this->fileNameInArchive); + } + + /** + * Implements support for fstat(). + * + * @return boolean + */ + public function stream_stat() + { + return $this->archive->statName($this->fileNameInArchive); + } + + /** + * Implements support for fread(), fgets() etc. + * + * @param int $count maximum number of bytes to read + * @return string + */ + public function stream_read($count) + { + $ret = substr($this->data, $this->position, $count); + $this->position += strlen($ret); + return $ret; + } + + /** + * Returns the position of the file pointer, i.e. its offset into the file + * stream. Implements support for ftell(). + * + * @return int + */ + public function stream_tell() + { + return $this->position; + } + + /** + * EOF stream + * + * @return bool + */ + public function stream_eof() + { + return $this->position >= strlen($this->data); + } + + /** + * Seek stream + * + * @param int $offset byte offset + * @param int $whence SEEK_SET, SEEK_CUR or SEEK_END + * @return bool + */ + public function stream_seek($offset, $whence) + { + switch ($whence) { + case SEEK_SET: + if ($offset < strlen($this->data) && $offset >= 0) { + $this->position = $offset; + return true; + } else { + return false; + } + break; + case SEEK_CUR: + if ($offset >= 0) { + $this->position += $offset; + return true; + } else { + return false; + } + break; + case SEEK_END: + if (strlen($this->data) + $offset >= 0) { + $this->position = strlen($this->data) + $offset; + return true; + } else { + return false; + } + break; + default: + return false; + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/trend/bestFitClass.php b/extend/PHPExcel/PHPExcel/Shared/trend/bestFitClass.php new file mode 100644 index 0000000..2de029f --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/trend/bestFitClass.php @@ -0,0 +1,425 @@ +<?php + +/** + * PHPExcel_Best_Fit + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_Trend + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Best_Fit +{ + /** + * Indicator flag for a calculation error + * + * @var boolean + **/ + protected $error = false; + + /** + * Algorithm type to use for best-fit + * + * @var string + **/ + protected $bestFitType = 'undetermined'; + + /** + * Number of entries in the sets of x- and y-value arrays + * + * @var int + **/ + protected $valueCount = 0; + + /** + * X-value dataseries of values + * + * @var float[] + **/ + protected $xValues = array(); + + /** + * Y-value dataseries of values + * + * @var float[] + **/ + protected $yValues = array(); + + /** + * Flag indicating whether values should be adjusted to Y=0 + * + * @var boolean + **/ + protected $adjustToZero = false; + + /** + * Y-value series of best-fit values + * + * @var float[] + **/ + protected $yBestFitValues = array(); + + protected $goodnessOfFit = 1; + + protected $stdevOfResiduals = 0; + + protected $covariance = 0; + + protected $correlation = 0; + + protected $SSRegression = 0; + + protected $SSResiduals = 0; + + protected $DFResiduals = 0; + + protected $f = 0; + + protected $slope = 0; + + protected $slopeSE = 0; + + protected $intersect = 0; + + protected $intersectSE = 0; + + protected $xOffset = 0; + + protected $yOffset = 0; + + + public function getError() + { + return $this->error; + } + + + public function getBestFitType() + { + return $this->bestFitType; + } + + /** + * Return the Y-Value for a specified value of X + * + * @param float $xValue X-Value + * @return float Y-Value + */ + public function getValueOfYForX($xValue) + { + return false; + } + + /** + * Return the X-Value for a specified value of Y + * + * @param float $yValue Y-Value + * @return float X-Value + */ + public function getValueOfXForY($yValue) + { + return false; + } + + /** + * Return the original set of X-Values + * + * @return float[] X-Values + */ + public function getXValues() + { + return $this->xValues; + } + + /** + * Return the Equation of the best-fit line + * + * @param int $dp Number of places of decimal precision to display + * @return string + */ + public function getEquation($dp = 0) + { + return false; + } + + /** + * Return the Slope of the line + * + * @param int $dp Number of places of decimal precision to display + * @return string + */ + public function getSlope($dp = 0) + { + if ($dp != 0) { + return round($this->slope, $dp); + } + return $this->slope; + } + + /** + * Return the standard error of the Slope + * + * @param int $dp Number of places of decimal precision to display + * @return string + */ + public function getSlopeSE($dp = 0) + { + if ($dp != 0) { + return round($this->slopeSE, $dp); + } + return $this->slopeSE; + } + + /** + * Return the Value of X where it intersects Y = 0 + * + * @param int $dp Number of places of decimal precision to display + * @return string + */ + public function getIntersect($dp = 0) + { + if ($dp != 0) { + return round($this->intersect, $dp); + } + return $this->intersect; + } + + /** + * Return the standard error of the Intersect + * + * @param int $dp Number of places of decimal precision to display + * @return string + */ + public function getIntersectSE($dp = 0) + { + if ($dp != 0) { + return round($this->intersectSE, $dp); + } + return $this->intersectSE; + } + + /** + * Return the goodness of fit for this regression + * + * @param int $dp Number of places of decimal precision to return + * @return float + */ + public function getGoodnessOfFit($dp = 0) + { + if ($dp != 0) { + return round($this->goodnessOfFit, $dp); + } + return $this->goodnessOfFit; + } + + public function getGoodnessOfFitPercent($dp = 0) + { + if ($dp != 0) { + return round($this->goodnessOfFit * 100, $dp); + } + return $this->goodnessOfFit * 100; + } + + /** + * Return the standard deviation of the residuals for this regression + * + * @param int $dp Number of places of decimal precision to return + * @return float + */ + public function getStdevOfResiduals($dp = 0) + { + if ($dp != 0) { + return round($this->stdevOfResiduals, $dp); + } + return $this->stdevOfResiduals; + } + + public function getSSRegression($dp = 0) + { + if ($dp != 0) { + return round($this->SSRegression, $dp); + } + return $this->SSRegression; + } + + public function getSSResiduals($dp = 0) + { + if ($dp != 0) { + return round($this->SSResiduals, $dp); + } + return $this->SSResiduals; + } + + public function getDFResiduals($dp = 0) + { + if ($dp != 0) { + return round($this->DFResiduals, $dp); + } + return $this->DFResiduals; + } + + public function getF($dp = 0) + { + if ($dp != 0) { + return round($this->f, $dp); + } + return $this->f; + } + + public function getCovariance($dp = 0) + { + if ($dp != 0) { + return round($this->covariance, $dp); + } + return $this->covariance; + } + + public function getCorrelation($dp = 0) + { + if ($dp != 0) { + return round($this->correlation, $dp); + } + return $this->correlation; + } + + public function getYBestFitValues() + { + return $this->yBestFitValues; + } + + protected function calculateGoodnessOfFit($sumX, $sumY, $sumX2, $sumY2, $sumXY, $meanX, $meanY, $const) + { + $SSres = $SScov = $SScor = $SStot = $SSsex = 0.0; + foreach ($this->xValues as $xKey => $xValue) { + $bestFitY = $this->yBestFitValues[$xKey] = $this->getValueOfYForX($xValue); + + $SSres += ($this->yValues[$xKey] - $bestFitY) * ($this->yValues[$xKey] - $bestFitY); + if ($const) { + $SStot += ($this->yValues[$xKey] - $meanY) * ($this->yValues[$xKey] - $meanY); + } else { + $SStot += $this->yValues[$xKey] * $this->yValues[$xKey]; + } + $SScov += ($this->xValues[$xKey] - $meanX) * ($this->yValues[$xKey] - $meanY); + if ($const) { + $SSsex += ($this->xValues[$xKey] - $meanX) * ($this->xValues[$xKey] - $meanX); + } else { + $SSsex += $this->xValues[$xKey] * $this->xValues[$xKey]; + } + } + + $this->SSResiduals = $SSres; + $this->DFResiduals = $this->valueCount - 1 - $const; + + if ($this->DFResiduals == 0.0) { + $this->stdevOfResiduals = 0.0; + } else { + $this->stdevOfResiduals = sqrt($SSres / $this->DFResiduals); + } + if (($SStot == 0.0) || ($SSres == $SStot)) { + $this->goodnessOfFit = 1; + } else { + $this->goodnessOfFit = 1 - ($SSres / $SStot); + } + + $this->SSRegression = $this->goodnessOfFit * $SStot; + $this->covariance = $SScov / $this->valueCount; + $this->correlation = ($this->valueCount * $sumXY - $sumX * $sumY) / sqrt(($this->valueCount * $sumX2 - pow($sumX, 2)) * ($this->valueCount * $sumY2 - pow($sumY, 2))); + $this->slopeSE = $this->stdevOfResiduals / sqrt($SSsex); + $this->intersectSE = $this->stdevOfResiduals * sqrt(1 / ($this->valueCount - ($sumX * $sumX) / $sumX2)); + if ($this->SSResiduals != 0.0) { + if ($this->DFResiduals == 0.0) { + $this->f = 0.0; + } else { + $this->f = $this->SSRegression / ($this->SSResiduals / $this->DFResiduals); + } + } else { + if ($this->DFResiduals == 0.0) { + $this->f = 0.0; + } else { + $this->f = $this->SSRegression / $this->DFResiduals; + } + } + } + + protected function leastSquareFit($yValues, $xValues, $const) + { + // calculate sums + $x_sum = array_sum($xValues); + $y_sum = array_sum($yValues); + $meanX = $x_sum / $this->valueCount; + $meanY = $y_sum / $this->valueCount; + $mBase = $mDivisor = $xx_sum = $xy_sum = $yy_sum = 0.0; + for ($i = 0; $i < $this->valueCount; ++$i) { + $xy_sum += $xValues[$i] * $yValues[$i]; + $xx_sum += $xValues[$i] * $xValues[$i]; + $yy_sum += $yValues[$i] * $yValues[$i]; + + if ($const) { + $mBase += ($xValues[$i] - $meanX) * ($yValues[$i] - $meanY); + $mDivisor += ($xValues[$i] - $meanX) * ($xValues[$i] - $meanX); + } else { + $mBase += $xValues[$i] * $yValues[$i]; + $mDivisor += $xValues[$i] * $xValues[$i]; + } + } + + // calculate slope +// $this->slope = (($this->valueCount * $xy_sum) - ($x_sum * $y_sum)) / (($this->valueCount * $xx_sum) - ($x_sum * $x_sum)); + $this->slope = $mBase / $mDivisor; + + // calculate intersect +// $this->intersect = ($y_sum - ($this->slope * $x_sum)) / $this->valueCount; + if ($const) { + $this->intersect = $meanY - ($this->slope * $meanX); + } else { + $this->intersect = 0; + } + + $this->calculateGoodnessOfFit($x_sum, $y_sum, $xx_sum, $yy_sum, $xy_sum, $meanX, $meanY, $const); + } + + /** + * Define the regression + * + * @param float[] $yValues The set of Y-values for this regression + * @param float[] $xValues The set of X-values for this regression + * @param boolean $const + */ + public function __construct($yValues, $xValues = array(), $const = true) + { + // Calculate number of points + $nY = count($yValues); + $nX = count($xValues); + + // Define X Values if necessary + if ($nX == 0) { + $xValues = range(1, $nY); + $nX = $nY; + } elseif ($nY != $nX) { + // Ensure both arrays of points are the same size + $this->error = true; + return false; + } + + $this->valueCount = $nY; + $this->xValues = $xValues; + $this->yValues = $yValues; + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/trend/exponentialBestFitClass.php b/extend/PHPExcel/PHPExcel/Shared/trend/exponentialBestFitClass.php new file mode 100644 index 0000000..4448735 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/trend/exponentialBestFitClass.php @@ -0,0 +1,138 @@ +<?php + +require_once(PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/bestFitClass.php'); + +/** + * PHPExcel_Exponential_Best_Fit + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_Trend + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Exponential_Best_Fit extends PHPExcel_Best_Fit +{ + /** + * Algorithm type to use for best-fit + * (Name of this trend class) + * + * @var string + **/ + protected $bestFitType = 'exponential'; + + /** + * Return the Y-Value for a specified value of X + * + * @param float $xValue X-Value + * @return float Y-Value + **/ + public function getValueOfYForX($xValue) + { + return $this->getIntersect() * pow($this->getSlope(), ($xValue - $this->xOffset)); + } + + /** + * Return the X-Value for a specified value of Y + * + * @param float $yValue Y-Value + * @return float X-Value + **/ + public function getValueOfXForY($yValue) + { + return log(($yValue + $this->yOffset) / $this->getIntersect()) / log($this->getSlope()); + } + + /** + * Return the Equation of the best-fit line + * + * @param int $dp Number of places of decimal precision to display + * @return string + **/ + public function getEquation($dp = 0) + { + $slope = $this->getSlope($dp); + $intersect = $this->getIntersect($dp); + + return 'Y = ' . $intersect . ' * ' . $slope . '^X'; + } + + /** + * Return the Slope of the line + * + * @param int $dp Number of places of decimal precision to display + * @return string + **/ + public function getSlope($dp = 0) + { + if ($dp != 0) { + return round(exp($this->_slope), $dp); + } + return exp($this->_slope); + } + + /** + * Return the Value of X where it intersects Y = 0 + * + * @param int $dp Number of places of decimal precision to display + * @return string + **/ + public function getIntersect($dp = 0) + { + if ($dp != 0) { + return round(exp($this->intersect), $dp); + } + return exp($this->intersect); + } + + /** + * Execute the regression and calculate the goodness of fit for a set of X and Y data values + * + * @param float[] $yValues The set of Y-values for this regression + * @param float[] $xValues The set of X-values for this regression + * @param boolean $const + */ + private function exponentialRegression($yValues, $xValues, $const) + { + foreach ($yValues as &$value) { + if ($value < 0.0) { + $value = 0 - log(abs($value)); + } elseif ($value > 0.0) { + $value = log($value); + } + } + unset($value); + + $this->leastSquareFit($yValues, $xValues, $const); + } + + /** + * Define the regression and calculate the goodness of fit for a set of X and Y data values + * + * @param float[] $yValues The set of Y-values for this regression + * @param float[] $xValues The set of X-values for this regression + * @param boolean $const + */ + public function __construct($yValues, $xValues = array(), $const = true) + { + if (parent::__construct($yValues, $xValues) !== false) { + $this->exponentialRegression($yValues, $xValues, $const); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/trend/linearBestFitClass.php b/extend/PHPExcel/PHPExcel/Shared/trend/linearBestFitClass.php new file mode 100644 index 0000000..76b55b3 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/trend/linearBestFitClass.php @@ -0,0 +1,102 @@ +<?php + +require_once(PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/bestFitClass.php'); + +/** + * PHPExcel_Linear_Best_Fit + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_Trend + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Linear_Best_Fit extends PHPExcel_Best_Fit +{ + /** + * Algorithm type to use for best-fit + * (Name of this trend class) + * + * @var string + **/ + protected $bestFitType = 'linear'; + + /** + * Return the Y-Value for a specified value of X + * + * @param float $xValue X-Value + * @return float Y-Value + **/ + public function getValueOfYForX($xValue) + { + return $this->getIntersect() + $this->getSlope() * $xValue; + } + + /** + * Return the X-Value for a specified value of Y + * + * @param float $yValue Y-Value + * @return float X-Value + **/ + public function getValueOfXForY($yValue) + { + return ($yValue - $this->getIntersect()) / $this->getSlope(); + } + + + /** + * Return the Equation of the best-fit line + * + * @param int $dp Number of places of decimal precision to display + * @return string + **/ + public function getEquation($dp = 0) + { + $slope = $this->getSlope($dp); + $intersect = $this->getIntersect($dp); + + return 'Y = ' . $intersect . ' + ' . $slope . ' * X'; + } + + /** + * Execute the regression and calculate the goodness of fit for a set of X and Y data values + * + * @param float[] $yValues The set of Y-values for this regression + * @param float[] $xValues The set of X-values for this regression + * @param boolean $const + */ + private function linearRegression($yValues, $xValues, $const) + { + $this->leastSquareFit($yValues, $xValues, $const); + } + + /** + * Define the regression and calculate the goodness of fit for a set of X and Y data values + * + * @param float[] $yValues The set of Y-values for this regression + * @param float[] $xValues The set of X-values for this regression + * @param boolean $const + */ + public function __construct($yValues, $xValues = array(), $const = true) + { + if (parent::__construct($yValues, $xValues) !== false) { + $this->linearRegression($yValues, $xValues, $const); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/trend/logarithmicBestFitClass.php b/extend/PHPExcel/PHPExcel/Shared/trend/logarithmicBestFitClass.php new file mode 100644 index 0000000..221c538 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/trend/logarithmicBestFitClass.php @@ -0,0 +1,110 @@ +<?php + +require_once(PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/bestFitClass.php'); + +/** + * PHPExcel_Logarithmic_Best_Fit + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_Trend + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Logarithmic_Best_Fit extends PHPExcel_Best_Fit +{ + /** + * Algorithm type to use for best-fit + * (Name of this trend class) + * + * @var string + **/ + protected $bestFitType = 'logarithmic'; + + /** + * Return the Y-Value for a specified value of X + * + * @param float $xValue X-Value + * @return float Y-Value + **/ + public function getValueOfYForX($xValue) + { + return $this->getIntersect() + $this->getSlope() * log($xValue - $this->xOffset); + } + + /** + * Return the X-Value for a specified value of Y + * + * @param float $yValue Y-Value + * @return float X-Value + **/ + public function getValueOfXForY($yValue) + { + return exp(($yValue - $this->getIntersect()) / $this->getSlope()); + } + + /** + * Return the Equation of the best-fit line + * + * @param int $dp Number of places of decimal precision to display + * @return string + **/ + public function getEquation($dp = 0) + { + $slope = $this->getSlope($dp); + $intersect = $this->getIntersect($dp); + + return 'Y = '.$intersect.' + '.$slope.' * log(X)'; + } + + /** + * Execute the regression and calculate the goodness of fit for a set of X and Y data values + * + * @param float[] $yValues The set of Y-values for this regression + * @param float[] $xValues The set of X-values for this regression + * @param boolean $const + */ + private function logarithmicRegression($yValues, $xValues, $const) + { + foreach ($xValues as &$value) { + if ($value < 0.0) { + $value = 0 - log(abs($value)); + } elseif ($value > 0.0) { + $value = log($value); + } + } + unset($value); + + $this->leastSquareFit($yValues, $xValues, $const); + } + + /** + * Define the regression and calculate the goodness of fit for a set of X and Y data values + * + * @param float[] $yValues The set of Y-values for this regression + * @param float[] $xValues The set of X-values for this regression + * @param boolean $const + */ + public function __construct($yValues, $xValues = array(), $const = true) + { + if (parent::__construct($yValues, $xValues) !== false) { + $this->logarithmicRegression($yValues, $xValues, $const); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/trend/polynomialBestFitClass.php b/extend/PHPExcel/PHPExcel/Shared/trend/polynomialBestFitClass.php new file mode 100644 index 0000000..8a882b7 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/trend/polynomialBestFitClass.php @@ -0,0 +1,222 @@ +<?php + +require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/bestFitClass.php'; +require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/JAMA/Matrix.php'; + +/** + * PHPExcel_Polynomial_Best_Fit + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_Trend + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Polynomial_Best_Fit extends PHPExcel_Best_Fit +{ + /** + * Algorithm type to use for best-fit + * (Name of this trend class) + * + * @var string + **/ + protected $bestFitType = 'polynomial'; + + /** + * Polynomial order + * + * @protected + * @var int + **/ + protected $order = 0; + + + /** + * Return the order of this polynomial + * + * @return int + **/ + public function getOrder() + { + return $this->order; + } + + + /** + * Return the Y-Value for a specified value of X + * + * @param float $xValue X-Value + * @return float Y-Value + **/ + public function getValueOfYForX($xValue) + { + $retVal = $this->getIntersect(); + $slope = $this->getSlope(); + foreach ($slope as $key => $value) { + if ($value != 0.0) { + $retVal += $value * pow($xValue, $key + 1); + } + } + return $retVal; + } + + + /** + * Return the X-Value for a specified value of Y + * + * @param float $yValue Y-Value + * @return float X-Value + **/ + public function getValueOfXForY($yValue) + { + return ($yValue - $this->getIntersect()) / $this->getSlope(); + } + + + /** + * Return the Equation of the best-fit line + * + * @param int $dp Number of places of decimal precision to display + * @return string + **/ + public function getEquation($dp = 0) + { + $slope = $this->getSlope($dp); + $intersect = $this->getIntersect($dp); + + $equation = 'Y = ' . $intersect; + foreach ($slope as $key => $value) { + if ($value != 0.0) { + $equation .= ' + ' . $value . ' * X'; + if ($key > 0) { + $equation .= '^' . ($key + 1); + } + } + } + return $equation; + } + + + /** + * Return the Slope of the line + * + * @param int $dp Number of places of decimal precision to display + * @return string + **/ + public function getSlope($dp = 0) + { + if ($dp != 0) { + $coefficients = array(); + foreach ($this->_slope as $coefficient) { + $coefficients[] = round($coefficient, $dp); + } + return $coefficients; + } + return $this->_slope; + } + + + public function getCoefficients($dp = 0) + { + return array_merge(array($this->getIntersect($dp)), $this->getSlope($dp)); + } + + + /** + * Execute the regression and calculate the goodness of fit for a set of X and Y data values + * + * @param int $order Order of Polynomial for this regression + * @param float[] $yValues The set of Y-values for this regression + * @param float[] $xValues The set of X-values for this regression + * @param boolean $const + */ + private function polynomialRegression($order, $yValues, $xValues, $const) + { + // calculate sums + $x_sum = array_sum($xValues); + $y_sum = array_sum($yValues); + $xx_sum = $xy_sum = 0; + for ($i = 0; $i < $this->valueCount; ++$i) { + $xy_sum += $xValues[$i] * $yValues[$i]; + $xx_sum += $xValues[$i] * $xValues[$i]; + $yy_sum += $yValues[$i] * $yValues[$i]; + } + /* + * This routine uses logic from the PHP port of polyfit version 0.1 + * written by Michael Bommarito and Paul Meagher + * + * The function fits a polynomial function of order $order through + * a series of x-y data points using least squares. + * + */ + for ($i = 0; $i < $this->valueCount; ++$i) { + for ($j = 0; $j <= $order; ++$j) { + $A[$i][$j] = pow($xValues[$i], $j); + } + } + for ($i=0; $i < $this->valueCount; ++$i) { + $B[$i] = array($yValues[$i]); + } + $matrixA = new Matrix($A); + $matrixB = new Matrix($B); + $C = $matrixA->solve($matrixB); + + $coefficients = array(); + for ($i = 0; $i < $C->m; ++$i) { + $r = $C->get($i, 0); + if (abs($r) <= pow(10, -9)) { + $r = 0; + } + $coefficients[] = $r; + } + + $this->intersect = array_shift($coefficients); + $this->_slope = $coefficients; + + $this->calculateGoodnessOfFit($x_sum, $y_sum, $xx_sum, $yy_sum, $xy_sum); + foreach ($this->xValues as $xKey => $xValue) { + $this->yBestFitValues[$xKey] = $this->getValueOfYForX($xValue); + } + } + + + /** + * Define the regression and calculate the goodness of fit for a set of X and Y data values + * + * @param int $order Order of Polynomial for this regression + * @param float[] $yValues The set of Y-values for this regression + * @param float[] $xValues The set of X-values for this regression + * @param boolean $const + */ + public function __construct($order, $yValues, $xValues = array(), $const = true) + { + if (parent::__construct($yValues, $xValues) !== false) { + if ($order < $this->valueCount) { + $this->bestFitType .= '_'.$order; + $this->order = $order; + $this->polynomialRegression($order, $yValues, $xValues, $const); + if (($this->getGoodnessOfFit() < 0.0) || ($this->getGoodnessOfFit() > 1.0)) { + $this->_error = true; + } + } else { + $this->_error = true; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/trend/powerBestFitClass.php b/extend/PHPExcel/PHPExcel/Shared/trend/powerBestFitClass.php new file mode 100644 index 0000000..77c4734 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/trend/powerBestFitClass.php @@ -0,0 +1,138 @@ +<?php + +require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/bestFitClass.php'; + +/** + * PHPExcel_Power_Best_Fit + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_Trend + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Power_Best_Fit extends PHPExcel_Best_Fit +{ + /** + * Algorithm type to use for best-fit + * (Name of this trend class) + * + * @var string + **/ + protected $bestFitType = 'power'; + + + /** + * Return the Y-Value for a specified value of X + * + * @param float $xValue X-Value + * @return float Y-Value + **/ + public function getValueOfYForX($xValue) + { + return $this->getIntersect() * pow(($xValue - $this->xOffset), $this->getSlope()); + } + + + /** + * Return the X-Value for a specified value of Y + * + * @param float $yValue Y-Value + * @return float X-Value + **/ + public function getValueOfXForY($yValue) + { + return pow((($yValue + $this->yOffset) / $this->getIntersect()), (1 / $this->getSlope())); + } + + + /** + * Return the Equation of the best-fit line + * + * @param int $dp Number of places of decimal precision to display + * @return string + **/ + public function getEquation($dp = 0) + { + $slope = $this->getSlope($dp); + $intersect = $this->getIntersect($dp); + + return 'Y = ' . $intersect . ' * X^' . $slope; + } + + + /** + * Return the Value of X where it intersects Y = 0 + * + * @param int $dp Number of places of decimal precision to display + * @return string + **/ + public function getIntersect($dp = 0) + { + if ($dp != 0) { + return round(exp($this->intersect), $dp); + } + return exp($this->intersect); + } + + + /** + * Execute the regression and calculate the goodness of fit for a set of X and Y data values + * + * @param float[] $yValues The set of Y-values for this regression + * @param float[] $xValues The set of X-values for this regression + * @param boolean $const + */ + private function powerRegression($yValues, $xValues, $const) + { + foreach ($xValues as &$value) { + if ($value < 0.0) { + $value = 0 - log(abs($value)); + } elseif ($value > 0.0) { + $value = log($value); + } + } + unset($value); + foreach ($yValues as &$value) { + if ($value < 0.0) { + $value = 0 - log(abs($value)); + } elseif ($value > 0.0) { + $value = log($value); + } + } + unset($value); + + $this->leastSquareFit($yValues, $xValues, $const); + } + + + /** + * Define the regression and calculate the goodness of fit for a set of X and Y data values + * + * @param float[] $yValues The set of Y-values for this regression + * @param float[] $xValues The set of X-values for this regression + * @param boolean $const + */ + public function __construct($yValues, $xValues = array(), $const = true) + { + if (parent::__construct($yValues, $xValues) !== false) { + $this->powerRegression($yValues, $xValues, $const); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Shared/trend/trendClass.php b/extend/PHPExcel/PHPExcel/Shared/trend/trendClass.php new file mode 100644 index 0000000..715cd41 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Shared/trend/trendClass.php @@ -0,0 +1,147 @@ +<?php + +require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/linearBestFitClass.php'; +require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/logarithmicBestFitClass.php'; +require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/exponentialBestFitClass.php'; +require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/powerBestFitClass.php'; +require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/polynomialBestFitClass.php'; + +/** + * PHPExcel_trendClass + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Shared_Trend + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class trendClass +{ + const TREND_LINEAR = 'Linear'; + const TREND_LOGARITHMIC = 'Logarithmic'; + const TREND_EXPONENTIAL = 'Exponential'; + const TREND_POWER = 'Power'; + const TREND_POLYNOMIAL_2 = 'Polynomial_2'; + const TREND_POLYNOMIAL_3 = 'Polynomial_3'; + const TREND_POLYNOMIAL_4 = 'Polynomial_4'; + const TREND_POLYNOMIAL_5 = 'Polynomial_5'; + const TREND_POLYNOMIAL_6 = 'Polynomial_6'; + const TREND_BEST_FIT = 'Bestfit'; + const TREND_BEST_FIT_NO_POLY = 'Bestfit_no_Polynomials'; + + /** + * Names of the best-fit trend analysis methods + * + * @var string[] + **/ + private static $trendTypes = array( + self::TREND_LINEAR, + self::TREND_LOGARITHMIC, + self::TREND_EXPONENTIAL, + self::TREND_POWER + ); + + /** + * Names of the best-fit trend polynomial orders + * + * @var string[] + **/ + private static $trendTypePolynomialOrders = array( + self::TREND_POLYNOMIAL_2, + self::TREND_POLYNOMIAL_3, + self::TREND_POLYNOMIAL_4, + self::TREND_POLYNOMIAL_5, + self::TREND_POLYNOMIAL_6 + ); + + /** + * Cached results for each method when trying to identify which provides the best fit + * + * @var PHPExcel_Best_Fit[] + **/ + private static $trendCache = array(); + + + public static function calculate($trendType = self::TREND_BEST_FIT, $yValues, $xValues = array(), $const = true) + { + // Calculate number of points in each dataset + $nY = count($yValues); + $nX = count($xValues); + + // Define X Values if necessary + if ($nX == 0) { + $xValues = range(1, $nY); + $nX = $nY; + } elseif ($nY != $nX) { + // Ensure both arrays of points are the same size + trigger_error("trend(): Number of elements in coordinate arrays do not match.", E_USER_ERROR); + } + + $key = md5($trendType.$const.serialize($yValues).serialize($xValues)); + // Determine which trend method has been requested + switch ($trendType) { + // Instantiate and return the class for the requested trend method + case self::TREND_LINEAR: + case self::TREND_LOGARITHMIC: + case self::TREND_EXPONENTIAL: + case self::TREND_POWER: + if (!isset(self::$trendCache[$key])) { + $className = 'PHPExcel_'.$trendType.'_Best_Fit'; + self::$trendCache[$key] = new $className($yValues, $xValues, $const); + } + return self::$trendCache[$key]; + case self::TREND_POLYNOMIAL_2: + case self::TREND_POLYNOMIAL_3: + case self::TREND_POLYNOMIAL_4: + case self::TREND_POLYNOMIAL_5: + case self::TREND_POLYNOMIAL_6: + if (!isset(self::$trendCache[$key])) { + $order = substr($trendType, -1); + self::$trendCache[$key] = new PHPExcel_Polynomial_Best_Fit($order, $yValues, $xValues, $const); + } + return self::$trendCache[$key]; + case self::TREND_BEST_FIT: + case self::TREND_BEST_FIT_NO_POLY: + // If the request is to determine the best fit regression, then we test each trend line in turn + // Start by generating an instance of each available trend method + foreach (self::$trendTypes as $trendMethod) { + $className = 'PHPExcel_'.$trendMethod.'BestFit'; + $bestFit[$trendMethod] = new $className($yValues, $xValues, $const); + $bestFitValue[$trendMethod] = $bestFit[$trendMethod]->getGoodnessOfFit(); + } + if ($trendType != self::TREND_BEST_FIT_NO_POLY) { + foreach (self::$trendTypePolynomialOrders as $trendMethod) { + $order = substr($trendMethod, -1); + $bestFit[$trendMethod] = new PHPExcel_Polynomial_Best_Fit($order, $yValues, $xValues, $const); + if ($bestFit[$trendMethod]->getError()) { + unset($bestFit[$trendMethod]); + } else { + $bestFitValue[$trendMethod] = $bestFit[$trendMethod]->getGoodnessOfFit(); + } + } + } + // Determine which of our trend lines is the best fit, and then we return the instance of that trend class + arsort($bestFitValue); + $bestFitType = key($bestFitValue); + return $bestFit[$bestFitType]; + default: + return false; + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Style.php b/extend/PHPExcel/PHPExcel/Style.php new file mode 100644 index 0000000..6b952ef --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Style.php @@ -0,0 +1,644 @@ +<?php + +/** + * PHPExcel_Style + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Style + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable +{ + /** + * Font + * + * @var PHPExcel_Style_Font + */ + protected $font; + + /** + * Fill + * + * @var PHPExcel_Style_Fill + */ + protected $fill; + + /** + * Borders + * + * @var PHPExcel_Style_Borders + */ + protected $borders; + + /** + * Alignment + * + * @var PHPExcel_Style_Alignment + */ + protected $alignment; + + /** + * Number Format + * + * @var PHPExcel_Style_NumberFormat + */ + protected $numberFormat; + + /** + * Conditional styles + * + * @var PHPExcel_Style_Conditional[] + */ + protected $conditionalStyles; + + /** + * Protection + * + * @var PHPExcel_Style_Protection + */ + protected $protection; + + /** + * Index of style in collection. Only used for real style. + * + * @var int + */ + protected $index; + + /** + * Use Quote Prefix when displaying in cell editor. Only used for real style. + * + * @var boolean + */ + protected $quotePrefix = false; + + /** + * Create a new PHPExcel_Style + * + * @param boolean $isSupervisor Flag indicating if this is a supervisor or not + * Leave this value at default unless you understand exactly what + * its ramifications are + * @param boolean $isConditional Flag indicating if this is a conditional style or not + * Leave this value at default unless you understand exactly what + * its ramifications are + */ + public function __construct($isSupervisor = false, $isConditional = false) + { + // Supervisor? + $this->isSupervisor = $isSupervisor; + + // Initialise values + $this->conditionalStyles = array(); + $this->font = new PHPExcel_Style_Font($isSupervisor, $isConditional); + $this->fill = new PHPExcel_Style_Fill($isSupervisor, $isConditional); + $this->borders = new PHPExcel_Style_Borders($isSupervisor, $isConditional); + $this->alignment = new PHPExcel_Style_Alignment($isSupervisor, $isConditional); + $this->numberFormat = new PHPExcel_Style_NumberFormat($isSupervisor, $isConditional); + $this->protection = new PHPExcel_Style_Protection($isSupervisor, $isConditional); + + // bind parent if we are a supervisor + if ($isSupervisor) { + $this->font->bindParent($this); + $this->fill->bindParent($this); + $this->borders->bindParent($this); + $this->alignment->bindParent($this); + $this->numberFormat->bindParent($this); + $this->protection->bindParent($this); + } + } + + /** + * Get the shared style component for the currently active cell in currently active sheet. + * Only used for style supervisor + * + * @return PHPExcel_Style + */ + public function getSharedComponent() + { + $activeSheet = $this->getActiveSheet(); + $selectedCell = $this->getActiveCell(); // e.g. 'A1' + + if ($activeSheet->cellExists($selectedCell)) { + $xfIndex = $activeSheet->getCell($selectedCell)->getXfIndex(); + } else { + $xfIndex = 0; + } + + return $this->parent->getCellXfByIndex($xfIndex); + } + + /** + * Get parent. Only used for style supervisor + * + * @return PHPExcel + */ + public function getParent() + { + return $this->parent; + } + + /** + * Build style array from subcomponents + * + * @param array $array + * @return array + */ + public function getStyleArray($array) + { + return array('quotePrefix' => $array); + } + + /** + * Apply styles from array + * + * <code> + * $objPHPExcel->getActiveSheet()->getStyle('B2')->applyFromArray( + * array( + * 'font' => array( + * 'name' => 'Arial', + * 'bold' => true, + * 'italic' => false, + * 'underline' => PHPExcel_Style_Font::UNDERLINE_DOUBLE, + * 'strike' => false, + * 'color' => array( + * 'rgb' => '808080' + * ) + * ), + * 'borders' => array( + * 'bottom' => array( + * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, + * 'color' => array( + * 'rgb' => '808080' + * ) + * ), + * 'top' => array( + * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, + * 'color' => array( + * 'rgb' => '808080' + * ) + * ) + * ), + * 'quotePrefix' => true + * ) + * ); + * </code> + * + * @param array $pStyles Array containing style information + * @param boolean $pAdvanced Advanced mode for setting borders. + * @throws PHPExcel_Exception + * @return PHPExcel_Style + */ + public function applyFromArray($pStyles = null, $pAdvanced = true) + { + if (is_array($pStyles)) { + if ($this->isSupervisor) { + $pRange = $this->getSelectedCells(); + + // Uppercase coordinate + $pRange = strtoupper($pRange); + + // Is it a cell range or a single cell? + if (strpos($pRange, ':') === false) { + $rangeA = $pRange; + $rangeB = $pRange; + } else { + list($rangeA, $rangeB) = explode(':', $pRange); + } + + // Calculate range outer borders + $rangeStart = PHPExcel_Cell::coordinateFromString($rangeA); + $rangeEnd = PHPExcel_Cell::coordinateFromString($rangeB); + + // Translate column into index + $rangeStart[0] = PHPExcel_Cell::columnIndexFromString($rangeStart[0]) - 1; + $rangeEnd[0] = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]) - 1; + + // Make sure we can loop upwards on rows and columns + if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) { + $tmp = $rangeStart; + $rangeStart = $rangeEnd; + $rangeEnd = $tmp; + } + + // ADVANCED MODE: + if ($pAdvanced && isset($pStyles['borders'])) { + // 'allborders' is a shorthand property for 'outline' and 'inside' and + // it applies to components that have not been set explicitly + if (isset($pStyles['borders']['allborders'])) { + foreach (array('outline', 'inside') as $component) { + if (!isset($pStyles['borders'][$component])) { + $pStyles['borders'][$component] = $pStyles['borders']['allborders']; + } + } + unset($pStyles['borders']['allborders']); // not needed any more + } + // 'outline' is a shorthand property for 'top', 'right', 'bottom', 'left' + // it applies to components that have not been set explicitly + if (isset($pStyles['borders']['outline'])) { + foreach (array('top', 'right', 'bottom', 'left') as $component) { + if (!isset($pStyles['borders'][$component])) { + $pStyles['borders'][$component] = $pStyles['borders']['outline']; + } + } + unset($pStyles['borders']['outline']); // not needed any more + } + // 'inside' is a shorthand property for 'vertical' and 'horizontal' + // it applies to components that have not been set explicitly + if (isset($pStyles['borders']['inside'])) { + foreach (array('vertical', 'horizontal') as $component) { + if (!isset($pStyles['borders'][$component])) { + $pStyles['borders'][$component] = $pStyles['borders']['inside']; + } + } + unset($pStyles['borders']['inside']); // not needed any more + } + // width and height characteristics of selection, 1, 2, or 3 (for 3 or more) + $xMax = min($rangeEnd[0] - $rangeStart[0] + 1, 3); + $yMax = min($rangeEnd[1] - $rangeStart[1] + 1, 3); + + // loop through up to 3 x 3 = 9 regions + for ($x = 1; $x <= $xMax; ++$x) { + // start column index for region + $colStart = ($x == 3) ? + PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0]) + : PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] + $x - 1); + // end column index for region + $colEnd = ($x == 1) ? + PHPExcel_Cell::stringFromColumnIndex($rangeStart[0]) + : PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0] - $xMax + $x); + + for ($y = 1; $y <= $yMax; ++$y) { + // which edges are touching the region + $edges = array(); + if ($x == 1) { + // are we at left edge + $edges[] = 'left'; + } + if ($x == $xMax) { + // are we at right edge + $edges[] = 'right'; + } + if ($y == 1) { + // are we at top edge? + $edges[] = 'top'; + } + if ($y == $yMax) { + // are we at bottom edge? + $edges[] = 'bottom'; + } + + // start row index for region + $rowStart = ($y == 3) ? + $rangeEnd[1] : $rangeStart[1] + $y - 1; + + // end row index for region + $rowEnd = ($y == 1) ? + $rangeStart[1] : $rangeEnd[1] - $yMax + $y; + + // build range for region + $range = $colStart . $rowStart . ':' . $colEnd . $rowEnd; + + // retrieve relevant style array for region + $regionStyles = $pStyles; + unset($regionStyles['borders']['inside']); + + // what are the inner edges of the region when looking at the selection + $innerEdges = array_diff(array('top', 'right', 'bottom', 'left'), $edges); + + // inner edges that are not touching the region should take the 'inside' border properties if they have been set + foreach ($innerEdges as $innerEdge) { + switch ($innerEdge) { + case 'top': + case 'bottom': + // should pick up 'horizontal' border property if set + if (isset($pStyles['borders']['horizontal'])) { + $regionStyles['borders'][$innerEdge] = $pStyles['borders']['horizontal']; + } else { + unset($regionStyles['borders'][$innerEdge]); + } + break; + case 'left': + case 'right': + // should pick up 'vertical' border property if set + if (isset($pStyles['borders']['vertical'])) { + $regionStyles['borders'][$innerEdge] = $pStyles['borders']['vertical']; + } else { + unset($regionStyles['borders'][$innerEdge]); + } + break; + } + } + + // apply region style to region by calling applyFromArray() in simple mode + $this->getActiveSheet()->getStyle($range)->applyFromArray($regionStyles, false); + } + } + return $this; + } + + // SIMPLE MODE: + // Selection type, inspect + if (preg_match('/^[A-Z]+1:[A-Z]+1048576$/', $pRange)) { + $selectionType = 'COLUMN'; + } elseif (preg_match('/^A[0-9]+:XFD[0-9]+$/', $pRange)) { + $selectionType = 'ROW'; + } else { + $selectionType = 'CELL'; + } + + // First loop through columns, rows, or cells to find out which styles are affected by this operation + switch ($selectionType) { + case 'COLUMN': + $oldXfIndexes = array(); + for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) { + $oldXfIndexes[$this->getActiveSheet()->getColumnDimensionByColumn($col)->getXfIndex()] = true; + } + break; + case 'ROW': + $oldXfIndexes = array(); + for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) { + if ($this->getActiveSheet()->getRowDimension($row)->getXfIndex() == null) { + $oldXfIndexes[0] = true; // row without explicit style should be formatted based on default style + } else { + $oldXfIndexes[$this->getActiveSheet()->getRowDimension($row)->getXfIndex()] = true; + } + } + break; + case 'CELL': + $oldXfIndexes = array(); + for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) { + for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) { + $oldXfIndexes[$this->getActiveSheet()->getCellByColumnAndRow($col, $row)->getXfIndex()] = true; + } + } + break; + } + + // clone each of the affected styles, apply the style array, and add the new styles to the workbook + $workbook = $this->getActiveSheet()->getParent(); + foreach ($oldXfIndexes as $oldXfIndex => $dummy) { + $style = $workbook->getCellXfByIndex($oldXfIndex); + $newStyle = clone $style; + $newStyle->applyFromArray($pStyles); + + if ($existingStyle = $workbook->getCellXfByHashCode($newStyle->getHashCode())) { + // there is already such cell Xf in our collection + $newXfIndexes[$oldXfIndex] = $existingStyle->getIndex(); + } else { + // we don't have such a cell Xf, need to add + $workbook->addCellXf($newStyle); + $newXfIndexes[$oldXfIndex] = $newStyle->getIndex(); + } + } + + // Loop through columns, rows, or cells again and update the XF index + switch ($selectionType) { + case 'COLUMN': + for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) { + $columnDimension = $this->getActiveSheet()->getColumnDimensionByColumn($col); + $oldXfIndex = $columnDimension->getXfIndex(); + $columnDimension->setXfIndex($newXfIndexes[$oldXfIndex]); + } + break; + + case 'ROW': + for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) { + $rowDimension = $this->getActiveSheet()->getRowDimension($row); + $oldXfIndex = $rowDimension->getXfIndex() === null ? + 0 : $rowDimension->getXfIndex(); // row without explicit style should be formatted based on default style + $rowDimension->setXfIndex($newXfIndexes[$oldXfIndex]); + } + break; + + case 'CELL': + for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) { + for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) { + $cell = $this->getActiveSheet()->getCellByColumnAndRow($col, $row); + $oldXfIndex = $cell->getXfIndex(); + $cell->setXfIndex($newXfIndexes[$oldXfIndex]); + } + } + break; + } + + } else { + // not a supervisor, just apply the style array directly on style object + if (array_key_exists('fill', $pStyles)) { + $this->getFill()->applyFromArray($pStyles['fill']); + } + if (array_key_exists('font', $pStyles)) { + $this->getFont()->applyFromArray($pStyles['font']); + } + if (array_key_exists('borders', $pStyles)) { + $this->getBorders()->applyFromArray($pStyles['borders']); + } + if (array_key_exists('alignment', $pStyles)) { + $this->getAlignment()->applyFromArray($pStyles['alignment']); + } + if (array_key_exists('numberformat', $pStyles)) { + $this->getNumberFormat()->applyFromArray($pStyles['numberformat']); + } + if (array_key_exists('protection', $pStyles)) { + $this->getProtection()->applyFromArray($pStyles['protection']); + } + if (array_key_exists('quotePrefix', $pStyles)) { + $this->quotePrefix = $pStyles['quotePrefix']; + } + } + } else { + throw new PHPExcel_Exception("Invalid style array passed."); + } + return $this; + } + + /** + * Get Fill + * + * @return PHPExcel_Style_Fill + */ + public function getFill() + { + return $this->fill; + } + + /** + * Get Font + * + * @return PHPExcel_Style_Font + */ + public function getFont() + { + return $this->font; + } + + /** + * Set font + * + * @param PHPExcel_Style_Font $font + * @return PHPExcel_Style + */ + public function setFont(PHPExcel_Style_Font $font) + { + $this->font = $font; + return $this; + } + + /** + * Get Borders + * + * @return PHPExcel_Style_Borders + */ + public function getBorders() + { + return $this->borders; + } + + /** + * Get Alignment + * + * @return PHPExcel_Style_Alignment + */ + public function getAlignment() + { + return $this->alignment; + } + + /** + * Get Number Format + * + * @return PHPExcel_Style_NumberFormat + */ + public function getNumberFormat() + { + return $this->numberFormat; + } + + /** + * Get Conditional Styles. Only used on supervisor. + * + * @return PHPExcel_Style_Conditional[] + */ + public function getConditionalStyles() + { + return $this->getActiveSheet()->getConditionalStyles($this->getActiveCell()); + } + + /** + * Set Conditional Styles. Only used on supervisor. + * + * @param PHPExcel_Style_Conditional[] $pValue Array of condtional styles + * @return PHPExcel_Style + */ + public function setConditionalStyles($pValue = null) + { + if (is_array($pValue)) { + $this->getActiveSheet()->setConditionalStyles($this->getSelectedCells(), $pValue); + } + return $this; + } + + /** + * Get Protection + * + * @return PHPExcel_Style_Protection + */ + public function getProtection() + { + return $this->protection; + } + + /** + * Get quote prefix + * + * @return boolean + */ + public function getQuotePrefix() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getQuotePrefix(); + } + return $this->quotePrefix; + } + + /** + * Set quote prefix + * + * @param boolean $pValue + */ + public function setQuotePrefix($pValue) + { + if ($pValue == '') { + $pValue = false; + } + if ($this->isSupervisor) { + $styleArray = array('quotePrefix' => $pValue); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->quotePrefix = (boolean) $pValue; + } + return $this; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + $hashConditionals = ''; + foreach ($this->conditionalStyles as $conditional) { + $hashConditionals .= $conditional->getHashCode(); + } + + return md5( + $this->fill->getHashCode() . + $this->font->getHashCode() . + $this->borders->getHashCode() . + $this->alignment->getHashCode() . + $this->numberFormat->getHashCode() . + $hashConditionals . + $this->protection->getHashCode() . + ($this->quotePrefix ? 't' : 'f') . + __CLASS__ + ); + } + + /** + * Get own index in style collection + * + * @return int + */ + public function getIndex() + { + return $this->index; + } + + /** + * Set own index in style collection + * + * @param int $pValue + */ + public function setIndex($pValue) + { + $this->index = $pValue; + } +} diff --git a/extend/PHPExcel/PHPExcel/Style/Alignment.php b/extend/PHPExcel/PHPExcel/Style/Alignment.php new file mode 100644 index 0000000..bfc4947 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Style/Alignment.php @@ -0,0 +1,464 @@ +<?php +/** + * PHPExcel_Style_Alignment + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Style + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Style_Alignment extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable +{ + /* Horizontal alignment styles */ + const HORIZONTAL_GENERAL = 'general'; + const HORIZONTAL_LEFT = 'left'; + const HORIZONTAL_RIGHT = 'right'; + const HORIZONTAL_CENTER = 'center'; + const HORIZONTAL_CENTER_CONTINUOUS = 'centerContinuous'; + const HORIZONTAL_JUSTIFY = 'justify'; + const HORIZONTAL_FILL = 'fill'; + const HORIZONTAL_DISTRIBUTED = 'distributed'; // Excel2007 only + + /* Vertical alignment styles */ + const VERTICAL_BOTTOM = 'bottom'; + const VERTICAL_TOP = 'top'; + const VERTICAL_CENTER = 'center'; + const VERTICAL_JUSTIFY = 'justify'; + const VERTICAL_DISTRIBUTED = 'distributed'; // Excel2007 only + + /* Read order */ + const READORDER_CONTEXT = 0; + const READORDER_LTR = 1; + const READORDER_RTL = 2; + + /** + * Horizontal alignment + * + * @var string + */ + protected $horizontal = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; + + /** + * Vertical alignment + * + * @var string + */ + protected $vertical = PHPExcel_Style_Alignment::VERTICAL_BOTTOM; + + /** + * Text rotation + * + * @var integer + */ + protected $textRotation = 0; + + /** + * Wrap text + * + * @var boolean + */ + protected $wrapText = false; + + /** + * Shrink to fit + * + * @var boolean + */ + protected $shrinkToFit = false; + + /** + * Indent - only possible with horizontal alignment left and right + * + * @var integer + */ + protected $indent = 0; + + /** + * Read order + * + * @var integer + */ + protected $readorder = 0; + + /** + * Create a new PHPExcel_Style_Alignment + * + * @param boolean $isSupervisor Flag indicating if this is a supervisor or not + * Leave this value at default unless you understand exactly what + * its ramifications are + * @param boolean $isConditional Flag indicating if this is a conditional style or not + * Leave this value at default unless you understand exactly what + * its ramifications are + */ + public function __construct($isSupervisor = false, $isConditional = false) + { + // Supervisor? + parent::__construct($isSupervisor); + + if ($isConditional) { + $this->horizontal = null; + $this->vertical = null; + $this->textRotation = null; + } + } + + /** + * Get the shared style component for the currently active cell in currently active sheet. + * Only used for style supervisor + * + * @return PHPExcel_Style_Alignment + */ + public function getSharedComponent() + { + return $this->parent->getSharedComponent()->getAlignment(); + } + + /** + * Build style array from subcomponents + * + * @param array $array + * @return array + */ + public function getStyleArray($array) + { + return array('alignment' => $array); + } + + /** + * Apply styles from array + * + * <code> + * $objPHPExcel->getActiveSheet()->getStyle('B2')->getAlignment()->applyFromArray( + * array( + * 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + * 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER, + * 'rotation' => 0, + * 'wrap' => TRUE + * ) + * ); + * </code> + * + * @param array $pStyles Array containing style information + * @throws PHPExcel_Exception + * @return PHPExcel_Style_Alignment + */ + public function applyFromArray($pStyles = null) + { + if (is_array($pStyles)) { + if ($this->isSupervisor) { + $this->getActiveSheet()->getStyle($this->getSelectedCells()) + ->applyFromArray($this->getStyleArray($pStyles)); + } else { + if (isset($pStyles['horizontal'])) { + $this->setHorizontal($pStyles['horizontal']); + } + if (isset($pStyles['vertical'])) { + $this->setVertical($pStyles['vertical']); + } + if (isset($pStyles['rotation'])) { + $this->setTextRotation($pStyles['rotation']); + } + if (isset($pStyles['wrap'])) { + $this->setWrapText($pStyles['wrap']); + } + if (isset($pStyles['shrinkToFit'])) { + $this->setShrinkToFit($pStyles['shrinkToFit']); + } + if (isset($pStyles['indent'])) { + $this->setIndent($pStyles['indent']); + } + if (isset($pStyles['readorder'])) { + $this->setReadorder($pStyles['readorder']); + } + } + } else { + throw new PHPExcel_Exception("Invalid style array passed."); + } + return $this; + } + + /** + * Get Horizontal + * + * @return string + */ + public function getHorizontal() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getHorizontal(); + } + return $this->horizontal; + } + + /** + * Set Horizontal + * + * @param string $pValue + * @return PHPExcel_Style_Alignment + */ + public function setHorizontal($pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL) + { + if ($pValue == '') { + $pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; + } + + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('horizontal' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->horizontal = $pValue; + } + return $this; + } + + /** + * Get Vertical + * + * @return string + */ + public function getVertical() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getVertical(); + } + return $this->vertical; + } + + /** + * Set Vertical + * + * @param string $pValue + * @return PHPExcel_Style_Alignment + */ + public function setVertical($pValue = PHPExcel_Style_Alignment::VERTICAL_BOTTOM) + { + if ($pValue == '') { + $pValue = PHPExcel_Style_Alignment::VERTICAL_BOTTOM; + } + + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('vertical' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->vertical = $pValue; + } + return $this; + } + + /** + * Get TextRotation + * + * @return int + */ + public function getTextRotation() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getTextRotation(); + } + return $this->textRotation; + } + + /** + * Set TextRotation + * + * @param int $pValue + * @throws PHPExcel_Exception + * @return PHPExcel_Style_Alignment + */ + public function setTextRotation($pValue = 0) + { + // Excel2007 value 255 => PHPExcel value -165 + if ($pValue == 255) { + $pValue = -165; + } + + // Set rotation + if (($pValue >= -90 && $pValue <= 90) || $pValue == -165) { + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('rotation' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->textRotation = $pValue; + } + } else { + throw new PHPExcel_Exception("Text rotation should be a value between -90 and 90."); + } + + return $this; + } + + /** + * Get Wrap Text + * + * @return boolean + */ + public function getWrapText() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getWrapText(); + } + return $this->wrapText; + } + + /** + * Set Wrap Text + * + * @param boolean $pValue + * @return PHPExcel_Style_Alignment + */ + public function setWrapText($pValue = false) + { + if ($pValue == '') { + $pValue = false; + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('wrap' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->wrapText = $pValue; + } + return $this; + } + + /** + * Get Shrink to fit + * + * @return boolean + */ + public function getShrinkToFit() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getShrinkToFit(); + } + return $this->shrinkToFit; + } + + /** + * Set Shrink to fit + * + * @param boolean $pValue + * @return PHPExcel_Style_Alignment + */ + public function setShrinkToFit($pValue = false) + { + if ($pValue == '') { + $pValue = false; + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('shrinkToFit' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->shrinkToFit = $pValue; + } + return $this; + } + + /** + * Get indent + * + * @return int + */ + public function getIndent() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getIndent(); + } + return $this->indent; + } + + /** + * Set indent + * + * @param int $pValue + * @return PHPExcel_Style_Alignment + */ + public function setIndent($pValue = 0) + { + if ($pValue > 0) { + if ($this->getHorizontal() != self::HORIZONTAL_GENERAL && + $this->getHorizontal() != self::HORIZONTAL_LEFT && + $this->getHorizontal() != self::HORIZONTAL_RIGHT) { + $pValue = 0; // indent not supported + } + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('indent' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->indent = $pValue; + } + return $this; + } + + /** + * Get read order + * + * @return integer + */ + public function getReadorder() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getReadorder(); + } + return $this->readorder; + } + + /** + * Set read order + * + * @param int $pValue + * @return PHPExcel_Style_Alignment + */ + public function setReadorder($pValue = 0) + { + if ($pValue < 0 || $pValue > 2) { + $pValue = 0; + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('readorder' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->readorder = $pValue; + } + return $this; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getHashCode(); + } + return md5( + $this->horizontal . + $this->vertical . + $this->textRotation . + ($this->wrapText ? 't' : 'f') . + ($this->shrinkToFit ? 't' : 'f') . + $this->indent . + $this->readorder . + __CLASS__ + ); + } +} diff --git a/extend/PHPExcel/PHPExcel/Style/Border.php b/extend/PHPExcel/PHPExcel/Style/Border.php new file mode 100644 index 0000000..55efc50 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Style/Border.php @@ -0,0 +1,282 @@ +<?php + +/** + * PHPExcel_Style_Border + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Style + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable +{ + /* Border style */ + const BORDER_NONE = 'none'; + const BORDER_DASHDOT = 'dashDot'; + const BORDER_DASHDOTDOT = 'dashDotDot'; + const BORDER_DASHED = 'dashed'; + const BORDER_DOTTED = 'dotted'; + const BORDER_DOUBLE = 'double'; + const BORDER_HAIR = 'hair'; + const BORDER_MEDIUM = 'medium'; + const BORDER_MEDIUMDASHDOT = 'mediumDashDot'; + const BORDER_MEDIUMDASHDOTDOT = 'mediumDashDotDot'; + const BORDER_MEDIUMDASHED = 'mediumDashed'; + const BORDER_SLANTDASHDOT = 'slantDashDot'; + const BORDER_THICK = 'thick'; + const BORDER_THIN = 'thin'; + + /** + * Border style + * + * @var string + */ + protected $borderStyle = PHPExcel_Style_Border::BORDER_NONE; + + /** + * Border color + * + * @var PHPExcel_Style_Color + */ + protected $color; + + /** + * Parent property name + * + * @var string + */ + protected $parentPropertyName; + + /** + * Create a new PHPExcel_Style_Border + * + * @param boolean $isSupervisor Flag indicating if this is a supervisor or not + * Leave this value at default unless you understand exactly what + * its ramifications are + * @param boolean $isConditional Flag indicating if this is a conditional style or not + * Leave this value at default unless you understand exactly what + * its ramifications are + */ + public function __construct($isSupervisor = false, $isConditional = false) + { + // Supervisor? + parent::__construct($isSupervisor); + + // Initialise values + $this->color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor); + + // bind parent if we are a supervisor + if ($isSupervisor) { + $this->color->bindParent($this, 'color'); + } + } + + /** + * Bind parent. Only used for supervisor + * + * @param PHPExcel_Style_Borders $parent + * @param string $parentPropertyName + * @return PHPExcel_Style_Border + */ + public function bindParent($parent, $parentPropertyName = null) + { + $this->parent = $parent; + $this->parentPropertyName = $parentPropertyName; + return $this; + } + + /** + * Get the shared style component for the currently active cell in currently active sheet. + * Only used for style supervisor + * + * @return PHPExcel_Style_Border + * @throws PHPExcel_Exception + */ + public function getSharedComponent() + { + switch ($this->parentPropertyName) { + case 'allBorders': + case 'horizontal': + case 'inside': + case 'outline': + case 'vertical': + throw new PHPExcel_Exception('Cannot get shared component for a pseudo-border.'); + break; + case 'bottom': + return $this->parent->getSharedComponent()->getBottom(); + case 'diagonal': + return $this->parent->getSharedComponent()->getDiagonal(); + case 'left': + return $this->parent->getSharedComponent()->getLeft(); + case 'right': + return $this->parent->getSharedComponent()->getRight(); + case 'top': + return $this->parent->getSharedComponent()->getTop(); + } + } + + /** + * Build style array from subcomponents + * + * @param array $array + * @return array + */ + public function getStyleArray($array) + { + switch ($this->parentPropertyName) { + case 'allBorders': + case 'bottom': + case 'diagonal': + case 'horizontal': + case 'inside': + case 'left': + case 'outline': + case 'right': + case 'top': + case 'vertical': + $key = strtolower('vertical'); + break; + } + return $this->parent->getStyleArray(array($key => $array)); + } + + /** + * Apply styles from array + * + * <code> + * $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray( + * array( + * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, + * 'color' => array( + * 'rgb' => '808080' + * ) + * ) + * ); + * </code> + * + * @param array $pStyles Array containing style information + * @throws PHPExcel_Exception + * @return PHPExcel_Style_Border + */ + public function applyFromArray($pStyles = null) + { + if (is_array($pStyles)) { + if ($this->isSupervisor) { + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles)); + } else { + if (isset($pStyles['style'])) { + $this->setBorderStyle($pStyles['style']); + } + if (isset($pStyles['color'])) { + $this->getColor()->applyFromArray($pStyles['color']); + } + } + } else { + throw new PHPExcel_Exception("Invalid style array passed."); + } + return $this; + } + + /** + * Get Border style + * + * @return string + */ + public function getBorderStyle() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getBorderStyle(); + } + return $this->borderStyle; + } + + /** + * Set Border style + * + * @param string|boolean $pValue + * When passing a boolean, FALSE equates PHPExcel_Style_Border::BORDER_NONE + * and TRUE to PHPExcel_Style_Border::BORDER_MEDIUM + * @return PHPExcel_Style_Border + */ + public function setBorderStyle($pValue = PHPExcel_Style_Border::BORDER_NONE) + { + + if (empty($pValue)) { + $pValue = PHPExcel_Style_Border::BORDER_NONE; + } elseif (is_bool($pValue) && $pValue) { + $pValue = PHPExcel_Style_Border::BORDER_MEDIUM; + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('style' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->borderStyle = $pValue; + } + return $this; + } + + /** + * Get Border Color + * + * @return PHPExcel_Style_Color + */ + public function getColor() + { + return $this->color; + } + + /** + * Set Border Color + * + * @param PHPExcel_Style_Color $pValue + * @throws PHPExcel_Exception + * @return PHPExcel_Style_Border + */ + public function setColor(PHPExcel_Style_Color $pValue = null) + { + // make sure parameter is a real color and not a supervisor + $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue; + + if ($this->isSupervisor) { + $styleArray = $this->getColor()->getStyleArray(array('argb' => $color->getARGB())); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->color = $color; + } + return $this; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getHashCode(); + } + return md5( + $this->borderStyle . + $this->color->getHashCode() . + __CLASS__ + ); + } +} diff --git a/extend/PHPExcel/PHPExcel/Style/Borders.php b/extend/PHPExcel/PHPExcel/Style/Borders.php new file mode 100644 index 0000000..27c40a4 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Style/Borders.php @@ -0,0 +1,429 @@ +<?php + +/** + * PHPExcel_Style_Borders + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Style + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable +{ + /* Diagonal directions */ + const DIAGONAL_NONE = 0; + const DIAGONAL_UP = 1; + const DIAGONAL_DOWN = 2; + const DIAGONAL_BOTH = 3; + + /** + * Left + * + * @var PHPExcel_Style_Border + */ + protected $left; + + /** + * Right + * + * @var PHPExcel_Style_Border + */ + protected $right; + + /** + * Top + * + * @var PHPExcel_Style_Border + */ + protected $top; + + /** + * Bottom + * + * @var PHPExcel_Style_Border + */ + protected $bottom; + + /** + * Diagonal + * + * @var PHPExcel_Style_Border + */ + protected $diagonal; + + /** + * DiagonalDirection + * + * @var int + */ + protected $diagonalDirection; + + /** + * All borders psedo-border. Only applies to supervisor. + * + * @var PHPExcel_Style_Border + */ + protected $allBorders; + + /** + * Outline psedo-border. Only applies to supervisor. + * + * @var PHPExcel_Style_Border + */ + protected $outline; + + /** + * Inside psedo-border. Only applies to supervisor. + * + * @var PHPExcel_Style_Border + */ + protected $inside; + + /** + * Vertical pseudo-border. Only applies to supervisor. + * + * @var PHPExcel_Style_Border + */ + protected $vertical; + + /** + * Horizontal pseudo-border. Only applies to supervisor. + * + * @var PHPExcel_Style_Border + */ + protected $horizontal; + + /** + * Create a new PHPExcel_Style_Borders + * + * @param boolean $isSupervisor Flag indicating if this is a supervisor or not + * Leave this value at default unless you understand exactly what + * its ramifications are + * @param boolean $isConditional Flag indicating if this is a conditional style or not + * Leave this value at default unless you understand exactly what + * its ramifications are + */ + public function __construct($isSupervisor = false, $isConditional = false) + { + // Supervisor? + parent::__construct($isSupervisor); + + // Initialise values + $this->left = new PHPExcel_Style_Border($isSupervisor, $isConditional); + $this->right = new PHPExcel_Style_Border($isSupervisor, $isConditional); + $this->top = new PHPExcel_Style_Border($isSupervisor, $isConditional); + $this->bottom = new PHPExcel_Style_Border($isSupervisor, $isConditional); + $this->diagonal = new PHPExcel_Style_Border($isSupervisor, $isConditional); + $this->diagonalDirection = PHPExcel_Style_Borders::DIAGONAL_NONE; + + // Specially for supervisor + if ($isSupervisor) { + // Initialize pseudo-borders + $this->allBorders = new PHPExcel_Style_Border(true); + $this->outline = new PHPExcel_Style_Border(true); + $this->inside = new PHPExcel_Style_Border(true); + $this->vertical = new PHPExcel_Style_Border(true); + $this->horizontal = new PHPExcel_Style_Border(true); + + // bind parent if we are a supervisor + $this->left->bindParent($this, 'left'); + $this->right->bindParent($this, 'right'); + $this->top->bindParent($this, 'top'); + $this->bottom->bindParent($this, 'bottom'); + $this->diagonal->bindParent($this, 'diagonal'); + $this->allBorders->bindParent($this, 'allBorders'); + $this->outline->bindParent($this, 'outline'); + $this->inside->bindParent($this, 'inside'); + $this->vertical->bindParent($this, 'vertical'); + $this->horizontal->bindParent($this, 'horizontal'); + } + } + + /** + * Get the shared style component for the currently active cell in currently active sheet. + * Only used for style supervisor + * + * @return PHPExcel_Style_Borders + */ + public function getSharedComponent() + { + return $this->parent->getSharedComponent()->getBorders(); + } + + /** + * Build style array from subcomponents + * + * @param array $array + * @return array + */ + public function getStyleArray($array) + { + return array('borders' => $array); + } + + /** + * Apply styles from array + * + * <code> + * $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray( + * array( + * 'bottom' => array( + * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, + * 'color' => array( + * 'rgb' => '808080' + * ) + * ), + * 'top' => array( + * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, + * 'color' => array( + * 'rgb' => '808080' + * ) + * ) + * ) + * ); + * </code> + * <code> + * $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray( + * array( + * 'allborders' => array( + * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, + * 'color' => array( + * 'rgb' => '808080' + * ) + * ) + * ) + * ); + * </code> + * + * @param array $pStyles Array containing style information + * @throws PHPExcel_Exception + * @return PHPExcel_Style_Borders + */ + public function applyFromArray($pStyles = null) + { + if (is_array($pStyles)) { + if ($this->isSupervisor) { + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles)); + } else { + if (array_key_exists('left', $pStyles)) { + $this->getLeft()->applyFromArray($pStyles['left']); + } + if (array_key_exists('right', $pStyles)) { + $this->getRight()->applyFromArray($pStyles['right']); + } + if (array_key_exists('top', $pStyles)) { + $this->getTop()->applyFromArray($pStyles['top']); + } + if (array_key_exists('bottom', $pStyles)) { + $this->getBottom()->applyFromArray($pStyles['bottom']); + } + if (array_key_exists('diagonal', $pStyles)) { + $this->getDiagonal()->applyFromArray($pStyles['diagonal']); + } + if (array_key_exists('diagonaldirection', $pStyles)) { + $this->setDiagonalDirection($pStyles['diagonaldirection']); + } + if (array_key_exists('allborders', $pStyles)) { + $this->getLeft()->applyFromArray($pStyles['allborders']); + $this->getRight()->applyFromArray($pStyles['allborders']); + $this->getTop()->applyFromArray($pStyles['allborders']); + $this->getBottom()->applyFromArray($pStyles['allborders']); + } + } + } else { + throw new PHPExcel_Exception("Invalid style array passed."); + } + return $this; + } + + /** + * Get Left + * + * @return PHPExcel_Style_Border + */ + public function getLeft() + { + return $this->left; + } + + /** + * Get Right + * + * @return PHPExcel_Style_Border + */ + public function getRight() + { + return $this->right; + } + + /** + * Get Top + * + * @return PHPExcel_Style_Border + */ + public function getTop() + { + return $this->top; + } + + /** + * Get Bottom + * + * @return PHPExcel_Style_Border + */ + public function getBottom() + { + return $this->bottom; + } + + /** + * Get Diagonal + * + * @return PHPExcel_Style_Border + */ + public function getDiagonal() + { + return $this->diagonal; + } + + /** + * Get AllBorders (pseudo-border). Only applies to supervisor. + * + * @return PHPExcel_Style_Border + * @throws PHPExcel_Exception + */ + public function getAllBorders() + { + if (!$this->isSupervisor) { + throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.'); + } + return $this->allBorders; + } + + /** + * Get Outline (pseudo-border). Only applies to supervisor. + * + * @return boolean + * @throws PHPExcel_Exception + */ + public function getOutline() + { + if (!$this->isSupervisor) { + throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.'); + } + return $this->outline; + } + + /** + * Get Inside (pseudo-border). Only applies to supervisor. + * + * @return boolean + * @throws PHPExcel_Exception + */ + public function getInside() + { + if (!$this->isSupervisor) { + throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.'); + } + return $this->inside; + } + + /** + * Get Vertical (pseudo-border). Only applies to supervisor. + * + * @return PHPExcel_Style_Border + * @throws PHPExcel_Exception + */ + public function getVertical() + { + if (!$this->isSupervisor) { + throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.'); + } + return $this->vertical; + } + + /** + * Get Horizontal (pseudo-border). Only applies to supervisor. + * + * @return PHPExcel_Style_Border + * @throws PHPExcel_Exception + */ + public function getHorizontal() + { + if (!$this->isSupervisor) { + throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.'); + } + return $this->horizontal; + } + + /** + * Get DiagonalDirection + * + * @return int + */ + public function getDiagonalDirection() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getDiagonalDirection(); + } + return $this->diagonalDirection; + } + + /** + * Set DiagonalDirection + * + * @param int $pValue + * @return PHPExcel_Style_Borders + */ + public function setDiagonalDirection($pValue = PHPExcel_Style_Borders::DIAGONAL_NONE) + { + if ($pValue == '') { + $pValue = PHPExcel_Style_Borders::DIAGONAL_NONE; + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('diagonaldirection' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->diagonalDirection = $pValue; + } + return $this; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getHashcode(); + } + return md5( + $this->getLeft()->getHashCode() . + $this->getRight()->getHashCode() . + $this->getTop()->getHashCode() . + $this->getBottom()->getHashCode() . + $this->getDiagonal()->getHashCode() . + $this->getDiagonalDirection() . + __CLASS__ + ); + } +} diff --git a/extend/PHPExcel/PHPExcel/Style/Color.php b/extend/PHPExcel/PHPExcel/Style/Color.php new file mode 100644 index 0000000..9c7790f --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Style/Color.php @@ -0,0 +1,443 @@ +<?php + +/** + * PHPExcel_Style_Color + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Style + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Style_Color extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable +{ + /* Colors */ + const COLOR_BLACK = 'FF000000'; + const COLOR_WHITE = 'FFFFFFFF'; + const COLOR_RED = 'FFFF0000'; + const COLOR_DARKRED = 'FF800000'; + const COLOR_BLUE = 'FF0000FF'; + const COLOR_DARKBLUE = 'FF000080'; + const COLOR_GREEN = 'FF00FF00'; + const COLOR_DARKGREEN = 'FF008000'; + const COLOR_YELLOW = 'FFFFFF00'; + const COLOR_DARKYELLOW = 'FF808000'; + + /** + * Indexed colors array + * + * @var array + */ + protected static $indexedColors; + + /** + * ARGB - Alpha RGB + * + * @var string + */ + protected $argb = null; + + /** + * Parent property name + * + * @var string + */ + protected $parentPropertyName; + + + /** + * Create a new PHPExcel_Style_Color + * + * @param string $pARGB ARGB value for the colour + * @param boolean $isSupervisor Flag indicating if this is a supervisor or not + * Leave this value at default unless you understand exactly what + * its ramifications are + * @param boolean $isConditional Flag indicating if this is a conditional style or not + * Leave this value at default unless you understand exactly what + * its ramifications are + */ + public function __construct($pARGB = PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor = false, $isConditional = false) + { + // Supervisor? + parent::__construct($isSupervisor); + + // Initialise values + if (!$isConditional) { + $this->argb = $pARGB; + } + } + + /** + * Bind parent. Only used for supervisor + * + * @param mixed $parent + * @param string $parentPropertyName + * @return PHPExcel_Style_Color + */ + public function bindParent($parent, $parentPropertyName = null) + { + $this->parent = $parent; + $this->parentPropertyName = $parentPropertyName; + return $this; + } + + /** + * Get the shared style component for the currently active cell in currently active sheet. + * Only used for style supervisor + * + * @return PHPExcel_Style_Color + */ + public function getSharedComponent() + { + switch ($this->parentPropertyName) { + case 'endColor': + return $this->parent->getSharedComponent()->getEndColor(); + case 'color': + return $this->parent->getSharedComponent()->getColor(); + case 'startColor': + return $this->parent->getSharedComponent()->getStartColor(); + } + } + + /** + * Build style array from subcomponents + * + * @param array $array + * @return array + */ + public function getStyleArray($array) + { + switch ($this->parentPropertyName) { + case 'endColor': + $key = 'endcolor'; + break; + case 'color': + $key = 'color'; + break; + case 'startColor': + $key = 'startcolor'; + break; + + } + return $this->parent->getStyleArray(array($key => $array)); + } + + /** + * Apply styles from array + * + * <code> + * $objPHPExcel->getActiveSheet()->getStyle('B2')->getFont()->getColor()->applyFromArray( array('rgb' => '808080') ); + * </code> + * + * @param array $pStyles Array containing style information + * @throws PHPExcel_Exception + * @return PHPExcel_Style_Color + */ + public function applyFromArray($pStyles = null) + { + if (is_array($pStyles)) { + if ($this->isSupervisor) { + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles)); + } else { + if (array_key_exists('rgb', $pStyles)) { + $this->setRGB($pStyles['rgb']); + } + if (array_key_exists('argb', $pStyles)) { + $this->setARGB($pStyles['argb']); + } + } + } else { + throw new PHPExcel_Exception("Invalid style array passed."); + } + return $this; + } + + /** + * Get ARGB + * + * @return string + */ + public function getARGB() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getARGB(); + } + return $this->argb; + } + + /** + * Set ARGB + * + * @param string $pValue + * @return PHPExcel_Style_Color + */ + public function setARGB($pValue = PHPExcel_Style_Color::COLOR_BLACK) + { + if ($pValue == '') { + $pValue = PHPExcel_Style_Color::COLOR_BLACK; + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('argb' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->argb = $pValue; + } + return $this; + } + + /** + * Get RGB + * + * @return string + */ + public function getRGB() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getRGB(); + } + return substr($this->argb, 2); + } + + /** + * Set RGB + * + * @param string $pValue RGB value + * @return PHPExcel_Style_Color + */ + public function setRGB($pValue = '000000') + { + if ($pValue == '') { + $pValue = '000000'; + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('argb' => 'FF' . $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->argb = 'FF' . $pValue; + } + return $this; + } + + /** + * Get a specified colour component of an RGB value + * + * @private + * @param string $RGB The colour as an RGB value (e.g. FF00CCCC or CCDDEE + * @param int $offset Position within the RGB value to extract + * @param boolean $hex Flag indicating whether the component should be returned as a hex or a + * decimal value + * @return string The extracted colour component + */ + private static function getColourComponent($RGB, $offset, $hex = true) + { + $colour = substr($RGB, $offset, 2); + if (!$hex) { + $colour = hexdec($colour); + } + return $colour; + } + + /** + * Get the red colour component of an RGB value + * + * @param string $RGB The colour as an RGB value (e.g. FF00CCCC or CCDDEE + * @param boolean $hex Flag indicating whether the component should be returned as a hex or a + * decimal value + * @return string The red colour component + */ + public static function getRed($RGB, $hex = true) + { + return self::getColourComponent($RGB, strlen($RGB) - 6, $hex); + } + + /** + * Get the green colour component of an RGB value + * + * @param string $RGB The colour as an RGB value (e.g. FF00CCCC or CCDDEE + * @param boolean $hex Flag indicating whether the component should be returned as a hex or a + * decimal value + * @return string The green colour component + */ + public static function getGreen($RGB, $hex = true) + { + return self::getColourComponent($RGB, strlen($RGB) - 4, $hex); + } + + /** + * Get the blue colour component of an RGB value + * + * @param string $RGB The colour as an RGB value (e.g. FF00CCCC or CCDDEE + * @param boolean $hex Flag indicating whether the component should be returned as a hex or a + * decimal value + * @return string The blue colour component + */ + public static function getBlue($RGB, $hex = true) + { + return self::getColourComponent($RGB, strlen($RGB) - 2, $hex); + } + + /** + * Adjust the brightness of a color + * + * @param string $hex The colour as an RGBA or RGB value (e.g. FF00CCCC or CCDDEE) + * @param float $adjustPercentage The percentage by which to adjust the colour as a float from -1 to 1 + * @return string The adjusted colour as an RGBA or RGB value (e.g. FF00CCCC or CCDDEE) + */ + public static function changeBrightness($hex, $adjustPercentage) + { + $rgba = (strlen($hex) == 8); + + $red = self::getRed($hex, false); + $green = self::getGreen($hex, false); + $blue = self::getBlue($hex, false); + if ($adjustPercentage > 0) { + $red += (255 - $red) * $adjustPercentage; + $green += (255 - $green) * $adjustPercentage; + $blue += (255 - $blue) * $adjustPercentage; + } else { + $red += $red * $adjustPercentage; + $green += $green * $adjustPercentage; + $blue += $blue * $adjustPercentage; + } + + if ($red < 0) { + $red = 0; + } elseif ($red > 255) { + $red = 255; + } + if ($green < 0) { + $green = 0; + } elseif ($green > 255) { + $green = 255; + } + if ($blue < 0) { + $blue = 0; + } elseif ($blue > 255) { + $blue = 255; + } + + $rgb = strtoupper( + str_pad(dechex($red), 2, '0', 0) . + str_pad(dechex($green), 2, '0', 0) . + str_pad(dechex($blue), 2, '0', 0) + ); + return (($rgba) ? 'FF' : '') . $rgb; + } + + /** + * Get indexed color + * + * @param int $pIndex Index entry point into the colour array + * @param boolean $background Flag to indicate whether default background or foreground colour + * should be returned if the indexed colour doesn't exist + * @return PHPExcel_Style_Color + */ + public static function indexedColor($pIndex, $background = false) + { + // Clean parameter + $pIndex = intval($pIndex); + + // Indexed colors + if (is_null(self::$indexedColors)) { + self::$indexedColors = array( + 1 => 'FF000000', // System Colour #1 - Black + 2 => 'FFFFFFFF', // System Colour #2 - White + 3 => 'FFFF0000', // System Colour #3 - Red + 4 => 'FF00FF00', // System Colour #4 - Green + 5 => 'FF0000FF', // System Colour #5 - Blue + 6 => 'FFFFFF00', // System Colour #6 - Yellow + 7 => 'FFFF00FF', // System Colour #7- Magenta + 8 => 'FF00FFFF', // System Colour #8- Cyan + 9 => 'FF800000', // Standard Colour #9 + 10 => 'FF008000', // Standard Colour #10 + 11 => 'FF000080', // Standard Colour #11 + 12 => 'FF808000', // Standard Colour #12 + 13 => 'FF800080', // Standard Colour #13 + 14 => 'FF008080', // Standard Colour #14 + 15 => 'FFC0C0C0', // Standard Colour #15 + 16 => 'FF808080', // Standard Colour #16 + 17 => 'FF9999FF', // Chart Fill Colour #17 + 18 => 'FF993366', // Chart Fill Colour #18 + 19 => 'FFFFFFCC', // Chart Fill Colour #19 + 20 => 'FFCCFFFF', // Chart Fill Colour #20 + 21 => 'FF660066', // Chart Fill Colour #21 + 22 => 'FFFF8080', // Chart Fill Colour #22 + 23 => 'FF0066CC', // Chart Fill Colour #23 + 24 => 'FFCCCCFF', // Chart Fill Colour #24 + 25 => 'FF000080', // Chart Line Colour #25 + 26 => 'FFFF00FF', // Chart Line Colour #26 + 27 => 'FFFFFF00', // Chart Line Colour #27 + 28 => 'FF00FFFF', // Chart Line Colour #28 + 29 => 'FF800080', // Chart Line Colour #29 + 30 => 'FF800000', // Chart Line Colour #30 + 31 => 'FF008080', // Chart Line Colour #31 + 32 => 'FF0000FF', // Chart Line Colour #32 + 33 => 'FF00CCFF', // Standard Colour #33 + 34 => 'FFCCFFFF', // Standard Colour #34 + 35 => 'FFCCFFCC', // Standard Colour #35 + 36 => 'FFFFFF99', // Standard Colour #36 + 37 => 'FF99CCFF', // Standard Colour #37 + 38 => 'FFFF99CC', // Standard Colour #38 + 39 => 'FFCC99FF', // Standard Colour #39 + 40 => 'FFFFCC99', // Standard Colour #40 + 41 => 'FF3366FF', // Standard Colour #41 + 42 => 'FF33CCCC', // Standard Colour #42 + 43 => 'FF99CC00', // Standard Colour #43 + 44 => 'FFFFCC00', // Standard Colour #44 + 45 => 'FFFF9900', // Standard Colour #45 + 46 => 'FFFF6600', // Standard Colour #46 + 47 => 'FF666699', // Standard Colour #47 + 48 => 'FF969696', // Standard Colour #48 + 49 => 'FF003366', // Standard Colour #49 + 50 => 'FF339966', // Standard Colour #50 + 51 => 'FF003300', // Standard Colour #51 + 52 => 'FF333300', // Standard Colour #52 + 53 => 'FF993300', // Standard Colour #53 + 54 => 'FF993366', // Standard Colour #54 + 55 => 'FF333399', // Standard Colour #55 + 56 => 'FF333333' // Standard Colour #56 + ); + } + + if (array_key_exists($pIndex, self::$indexedColors)) { + return new PHPExcel_Style_Color(self::$indexedColors[$pIndex]); + } + + if ($background) { + return new PHPExcel_Style_Color(self::COLOR_WHITE); + } + return new PHPExcel_Style_Color(self::COLOR_BLACK); + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getHashCode(); + } + return md5( + $this->argb . + __CLASS__ + ); + } +} diff --git a/extend/PHPExcel/PHPExcel/Style/Conditional.php b/extend/PHPExcel/PHPExcel/Style/Conditional.php new file mode 100644 index 0000000..331362b --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Style/Conditional.php @@ -0,0 +1,293 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Style + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_Style_Conditional + * + * @category PHPExcel + * @package PHPExcel_Style + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +class PHPExcel_Style_Conditional implements PHPExcel_IComparable +{ + /* Condition types */ + const CONDITION_NONE = 'none'; + const CONDITION_CELLIS = 'cellIs'; + const CONDITION_CONTAINSTEXT = 'containsText'; + const CONDITION_EXPRESSION = 'expression'; + + /* Operator types */ + const OPERATOR_NONE = ''; + const OPERATOR_BEGINSWITH = 'beginsWith'; + const OPERATOR_ENDSWITH = 'endsWith'; + const OPERATOR_EQUAL = 'equal'; + const OPERATOR_GREATERTHAN = 'greaterThan'; + const OPERATOR_GREATERTHANOREQUAL = 'greaterThanOrEqual'; + const OPERATOR_LESSTHAN = 'lessThan'; + const OPERATOR_LESSTHANOREQUAL = 'lessThanOrEqual'; + const OPERATOR_NOTEQUAL = 'notEqual'; + const OPERATOR_CONTAINSTEXT = 'containsText'; + const OPERATOR_NOTCONTAINS = 'notContains'; + const OPERATOR_BETWEEN = 'between'; + + /** + * Condition type + * + * @var int + */ + private $conditionType; + + /** + * Operator type + * + * @var int + */ + private $operatorType; + + /** + * Text + * + * @var string + */ + private $text; + + /** + * Condition + * + * @var string[] + */ + private $condition = array(); + + /** + * Style + * + * @var PHPExcel_Style + */ + private $style; + + /** + * Create a new PHPExcel_Style_Conditional + */ + public function __construct() + { + // Initialise values + $this->conditionType = PHPExcel_Style_Conditional::CONDITION_NONE; + $this->operatorType = PHPExcel_Style_Conditional::OPERATOR_NONE; + $this->text = null; + $this->condition = array(); + $this->style = new PHPExcel_Style(false, true); + } + + /** + * Get Condition type + * + * @return string + */ + public function getConditionType() + { + return $this->conditionType; + } + + /** + * Set Condition type + * + * @param string $pValue PHPExcel_Style_Conditional condition type + * @return PHPExcel_Style_Conditional + */ + public function setConditionType($pValue = PHPExcel_Style_Conditional::CONDITION_NONE) + { + $this->conditionType = $pValue; + return $this; + } + + /** + * Get Operator type + * + * @return string + */ + public function getOperatorType() + { + return $this->operatorType; + } + + /** + * Set Operator type + * + * @param string $pValue PHPExcel_Style_Conditional operator type + * @return PHPExcel_Style_Conditional + */ + public function setOperatorType($pValue = PHPExcel_Style_Conditional::OPERATOR_NONE) + { + $this->operatorType = $pValue; + return $this; + } + + /** + * Get text + * + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Set text + * + * @param string $value + * @return PHPExcel_Style_Conditional + */ + public function setText($value = null) + { + $this->text = $value; + return $this; + } + + /** + * Get Condition + * + * @deprecated Deprecated, use getConditions instead + * @return string + */ + public function getCondition() + { + if (isset($this->condition[0])) { + return $this->condition[0]; + } + + return ''; + } + + /** + * Set Condition + * + * @deprecated Deprecated, use setConditions instead + * @param string $pValue Condition + * @return PHPExcel_Style_Conditional + */ + public function setCondition($pValue = '') + { + if (!is_array($pValue)) { + $pValue = array($pValue); + } + + return $this->setConditions($pValue); + } + + /** + * Get Conditions + * + * @return string[] + */ + public function getConditions() + { + return $this->condition; + } + + /** + * Set Conditions + * + * @param string[] $pValue Condition + * @return PHPExcel_Style_Conditional + */ + public function setConditions($pValue) + { + if (!is_array($pValue)) { + $pValue = array($pValue); + } + $this->condition = $pValue; + return $this; + } + + /** + * Add Condition + * + * @param string $pValue Condition + * @return PHPExcel_Style_Conditional + */ + public function addCondition($pValue = '') + { + $this->condition[] = $pValue; + return $this; + } + + /** + * Get Style + * + * @return PHPExcel_Style + */ + public function getStyle() + { + return $this->style; + } + + /** + * Set Style + * + * @param PHPExcel_Style $pValue + * @throws PHPExcel_Exception + * @return PHPExcel_Style_Conditional + */ + public function setStyle(PHPExcel_Style $pValue = null) + { + $this->style = $pValue; + return $this; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + return md5( + $this->conditionType . + $this->operatorType . + implode(';', $this->condition) . + $this->style->getHashCode() . + __CLASS__ + ); + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Style/Fill.php b/extend/PHPExcel/PHPExcel/Style/Fill.php new file mode 100644 index 0000000..26343ff --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Style/Fill.php @@ -0,0 +1,322 @@ +<?php + +/** + * PHPExcel_Style_Fill + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Style + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable +{ + /* Fill types */ + const FILL_NONE = 'none'; + const FILL_SOLID = 'solid'; + const FILL_GRADIENT_LINEAR = 'linear'; + const FILL_GRADIENT_PATH = 'path'; + const FILL_PATTERN_DARKDOWN = 'darkDown'; + const FILL_PATTERN_DARKGRAY = 'darkGray'; + const FILL_PATTERN_DARKGRID = 'darkGrid'; + const FILL_PATTERN_DARKHORIZONTAL = 'darkHorizontal'; + const FILL_PATTERN_DARKTRELLIS = 'darkTrellis'; + const FILL_PATTERN_DARKUP = 'darkUp'; + const FILL_PATTERN_DARKVERTICAL = 'darkVertical'; + const FILL_PATTERN_GRAY0625 = 'gray0625'; + const FILL_PATTERN_GRAY125 = 'gray125'; + const FILL_PATTERN_LIGHTDOWN = 'lightDown'; + const FILL_PATTERN_LIGHTGRAY = 'lightGray'; + const FILL_PATTERN_LIGHTGRID = 'lightGrid'; + const FILL_PATTERN_LIGHTHORIZONTAL = 'lightHorizontal'; + const FILL_PATTERN_LIGHTTRELLIS = 'lightTrellis'; + const FILL_PATTERN_LIGHTUP = 'lightUp'; + const FILL_PATTERN_LIGHTVERTICAL = 'lightVertical'; + const FILL_PATTERN_MEDIUMGRAY = 'mediumGray'; + + /** + * Fill type + * + * @var string + */ + protected $fillType = PHPExcel_Style_Fill::FILL_NONE; + + /** + * Rotation + * + * @var double + */ + protected $rotation = 0; + + /** + * Start color + * + * @var PHPExcel_Style_Color + */ + protected $startColor; + + /** + * End color + * + * @var PHPExcel_Style_Color + */ + protected $endColor; + + /** + * Create a new PHPExcel_Style_Fill + * + * @param boolean $isSupervisor Flag indicating if this is a supervisor or not + * Leave this value at default unless you understand exactly what + * its ramifications are + * @param boolean $isConditional Flag indicating if this is a conditional style or not + * Leave this value at default unless you understand exactly what + * its ramifications are + */ + public function __construct($isSupervisor = false, $isConditional = false) + { + // Supervisor? + parent::__construct($isSupervisor); + + // Initialise values + if ($isConditional) { + $this->fillType = null; + } + $this->startColor = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_WHITE, $isSupervisor, $isConditional); + $this->endColor = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor, $isConditional); + + // bind parent if we are a supervisor + if ($isSupervisor) { + $this->startColor->bindParent($this, 'startColor'); + $this->endColor->bindParent($this, 'endColor'); + } + } + + /** + * Get the shared style component for the currently active cell in currently active sheet. + * Only used for style supervisor + * + * @return PHPExcel_Style_Fill + */ + public function getSharedComponent() + { + return $this->parent->getSharedComponent()->getFill(); + } + + /** + * Build style array from subcomponents + * + * @param array $array + * @return array + */ + public function getStyleArray($array) + { + return array('fill' => $array); + } + + /** + * Apply styles from array + * + * <code> + * $objPHPExcel->getActiveSheet()->getStyle('B2')->getFill()->applyFromArray( + * array( + * 'type' => PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR, + * 'rotation' => 0, + * 'startcolor' => array( + * 'rgb' => '000000' + * ), + * 'endcolor' => array( + * 'argb' => 'FFFFFFFF' + * ) + * ) + * ); + * </code> + * + * @param array $pStyles Array containing style information + * @throws PHPExcel_Exception + * @return PHPExcel_Style_Fill + */ + public function applyFromArray($pStyles = null) + { + if (is_array($pStyles)) { + if ($this->isSupervisor) { + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles)); + } else { + if (array_key_exists('type', $pStyles)) { + $this->setFillType($pStyles['type']); + } + if (array_key_exists('rotation', $pStyles)) { + $this->setRotation($pStyles['rotation']); + } + if (array_key_exists('startcolor', $pStyles)) { + $this->getStartColor()->applyFromArray($pStyles['startcolor']); + } + if (array_key_exists('endcolor', $pStyles)) { + $this->getEndColor()->applyFromArray($pStyles['endcolor']); + } + if (array_key_exists('color', $pStyles)) { + $this->getStartColor()->applyFromArray($pStyles['color']); + } + } + } else { + throw new PHPExcel_Exception("Invalid style array passed."); + } + return $this; + } + + /** + * Get Fill Type + * + * @return string + */ + public function getFillType() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getFillType(); + } + return $this->fillType; + } + + /** + * Set Fill Type + * + * @param string $pValue PHPExcel_Style_Fill fill type + * @return PHPExcel_Style_Fill + */ + public function setFillType($pValue = PHPExcel_Style_Fill::FILL_NONE) + { + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('type' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->fillType = $pValue; + } + return $this; + } + + /** + * Get Rotation + * + * @return double + */ + public function getRotation() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getRotation(); + } + return $this->rotation; + } + + /** + * Set Rotation + * + * @param double $pValue + * @return PHPExcel_Style_Fill + */ + public function setRotation($pValue = 0) + { + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('rotation' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->rotation = $pValue; + } + return $this; + } + + /** + * Get Start Color + * + * @return PHPExcel_Style_Color + */ + public function getStartColor() + { + return $this->startColor; + } + + /** + * Set Start Color + * + * @param PHPExcel_Style_Color $pValue + * @throws PHPExcel_Exception + * @return PHPExcel_Style_Fill + */ + public function setStartColor(PHPExcel_Style_Color $pValue = null) + { + // make sure parameter is a real color and not a supervisor + $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue; + + if ($this->isSupervisor) { + $styleArray = $this->getStartColor()->getStyleArray(array('argb' => $color->getARGB())); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->startColor = $color; + } + return $this; + } + + /** + * Get End Color + * + * @return PHPExcel_Style_Color + */ + public function getEndColor() + { + return $this->endColor; + } + + /** + * Set End Color + * + * @param PHPExcel_Style_Color $pValue + * @throws PHPExcel_Exception + * @return PHPExcel_Style_Fill + */ + public function setEndColor(PHPExcel_Style_Color $pValue = null) + { + // make sure parameter is a real color and not a supervisor + $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue; + + if ($this->isSupervisor) { + $styleArray = $this->getEndColor()->getStyleArray(array('argb' => $color->getARGB())); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->endColor = $color; + } + return $this; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getHashCode(); + } + return md5( + $this->getFillType() . + $this->getRotation() . + $this->getStartColor()->getHashCode() . + $this->getEndColor()->getHashCode() . + __CLASS__ + ); + } +} diff --git a/extend/PHPExcel/PHPExcel/Style/Font.php b/extend/PHPExcel/PHPExcel/Style/Font.php new file mode 100644 index 0000000..9566e1d --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Style/Font.php @@ -0,0 +1,543 @@ +<?php + +/** + * PHPExcel_Style_Font + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Style + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable +{ + /* Underline types */ + const UNDERLINE_NONE = 'none'; + const UNDERLINE_DOUBLE = 'double'; + const UNDERLINE_DOUBLEACCOUNTING = 'doubleAccounting'; + const UNDERLINE_SINGLE = 'single'; + const UNDERLINE_SINGLEACCOUNTING = 'singleAccounting'; + + /** + * Font Name + * + * @var string + */ + protected $name = 'Calibri'; + + /** + * Font Size + * + * @var float + */ + protected $size = 11; + + /** + * Bold + * + * @var boolean + */ + protected $bold = false; + + /** + * Italic + * + * @var boolean + */ + protected $italic = false; + + /** + * Superscript + * + * @var boolean + */ + protected $superScript = false; + + /** + * Subscript + * + * @var boolean + */ + protected $subScript = false; + + /** + * Underline + * + * @var string + */ + protected $underline = self::UNDERLINE_NONE; + + /** + * Strikethrough + * + * @var boolean + */ + protected $strikethrough = false; + + /** + * Foreground color + * + * @var PHPExcel_Style_Color + */ + protected $color; + + /** + * Create a new PHPExcel_Style_Font + * + * @param boolean $isSupervisor Flag indicating if this is a supervisor or not + * Leave this value at default unless you understand exactly what + * its ramifications are + * @param boolean $isConditional Flag indicating if this is a conditional style or not + * Leave this value at default unless you understand exactly what + * its ramifications are + */ + public function __construct($isSupervisor = false, $isConditional = false) + { + // Supervisor? + parent::__construct($isSupervisor); + + // Initialise values + if ($isConditional) { + $this->name = null; + $this->size = null; + $this->bold = null; + $this->italic = null; + $this->superScript = null; + $this->subScript = null; + $this->underline = null; + $this->strikethrough = null; + $this->color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor, $isConditional); + } else { + $this->color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor); + } + // bind parent if we are a supervisor + if ($isSupervisor) { + $this->color->bindParent($this, 'color'); + } + } + + /** + * Get the shared style component for the currently active cell in currently active sheet. + * Only used for style supervisor + * + * @return PHPExcel_Style_Font + */ + public function getSharedComponent() + { + return $this->parent->getSharedComponent()->getFont(); + } + + /** + * Build style array from subcomponents + * + * @param array $array + * @return array + */ + public function getStyleArray($array) + { + return array('font' => $array); + } + + /** + * Apply styles from array + * + * <code> + * $objPHPExcel->getActiveSheet()->getStyle('B2')->getFont()->applyFromArray( + * array( + * 'name' => 'Arial', + * 'bold' => TRUE, + * 'italic' => FALSE, + * 'underline' => PHPExcel_Style_Font::UNDERLINE_DOUBLE, + * 'strike' => FALSE, + * 'color' => array( + * 'rgb' => '808080' + * ) + * ) + * ); + * </code> + * + * @param array $pStyles Array containing style information + * @throws PHPExcel_Exception + * @return PHPExcel_Style_Font + */ + public function applyFromArray($pStyles = null) + { + if (is_array($pStyles)) { + if ($this->isSupervisor) { + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles)); + } else { + if (array_key_exists('name', $pStyles)) { + $this->setName($pStyles['name']); + } + if (array_key_exists('bold', $pStyles)) { + $this->setBold($pStyles['bold']); + } + if (array_key_exists('italic', $pStyles)) { + $this->setItalic($pStyles['italic']); + } + if (array_key_exists('superScript', $pStyles)) { + $this->setSuperScript($pStyles['superScript']); + } + if (array_key_exists('subScript', $pStyles)) { + $this->setSubScript($pStyles['subScript']); + } + if (array_key_exists('underline', $pStyles)) { + $this->setUnderline($pStyles['underline']); + } + if (array_key_exists('strike', $pStyles)) { + $this->setStrikethrough($pStyles['strike']); + } + if (array_key_exists('color', $pStyles)) { + $this->getColor()->applyFromArray($pStyles['color']); + } + if (array_key_exists('size', $pStyles)) { + $this->setSize($pStyles['size']); + } + } + } else { + throw new PHPExcel_Exception("Invalid style array passed."); + } + return $this; + } + + /** + * Get Name + * + * @return string + */ + public function getName() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getName(); + } + return $this->name; + } + + /** + * Set Name + * + * @param string $pValue + * @return PHPExcel_Style_Font + */ + public function setName($pValue = 'Calibri') + { + if ($pValue == '') { + $pValue = 'Calibri'; + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('name' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->name = $pValue; + } + return $this; + } + + /** + * Get Size + * + * @return double + */ + public function getSize() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getSize(); + } + return $this->size; + } + + /** + * Set Size + * + * @param double $pValue + * @return PHPExcel_Style_Font + */ + public function setSize($pValue = 10) + { + if ($pValue == '') { + $pValue = 10; + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('size' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->size = $pValue; + } + return $this; + } + + /** + * Get Bold + * + * @return boolean + */ + public function getBold() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getBold(); + } + return $this->bold; + } + + /** + * Set Bold + * + * @param boolean $pValue + * @return PHPExcel_Style_Font + */ + public function setBold($pValue = false) + { + if ($pValue == '') { + $pValue = false; + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('bold' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->bold = $pValue; + } + return $this; + } + + /** + * Get Italic + * + * @return boolean + */ + public function getItalic() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getItalic(); + } + return $this->italic; + } + + /** + * Set Italic + * + * @param boolean $pValue + * @return PHPExcel_Style_Font + */ + public function setItalic($pValue = false) + { + if ($pValue == '') { + $pValue = false; + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('italic' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->italic = $pValue; + } + return $this; + } + + /** + * Get SuperScript + * + * @return boolean + */ + public function getSuperScript() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getSuperScript(); + } + return $this->superScript; + } + + /** + * Set SuperScript + * + * @param boolean $pValue + * @return PHPExcel_Style_Font + */ + public function setSuperScript($pValue = false) + { + if ($pValue == '') { + $pValue = false; + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('superScript' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->superScript = $pValue; + $this->subScript = !$pValue; + } + return $this; + } + + /** + * Get SubScript + * + * @return boolean + */ + public function getSubScript() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getSubScript(); + } + return $this->subScript; + } + + /** + * Set SubScript + * + * @param boolean $pValue + * @return PHPExcel_Style_Font + */ + public function setSubScript($pValue = false) + { + if ($pValue == '') { + $pValue = false; + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('subScript' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->subScript = $pValue; + $this->superScript = !$pValue; + } + return $this; + } + + /** + * Get Underline + * + * @return string + */ + public function getUnderline() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getUnderline(); + } + return $this->underline; + } + + /** + * Set Underline + * + * @param string|boolean $pValue PHPExcel_Style_Font underline type + * If a boolean is passed, then TRUE equates to UNDERLINE_SINGLE, + * false equates to UNDERLINE_NONE + * @return PHPExcel_Style_Font + */ + public function setUnderline($pValue = self::UNDERLINE_NONE) + { + if (is_bool($pValue)) { + $pValue = ($pValue) ? self::UNDERLINE_SINGLE : self::UNDERLINE_NONE; + } elseif ($pValue == '') { + $pValue = self::UNDERLINE_NONE; + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('underline' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->underline = $pValue; + } + return $this; + } + + /** + * Get Strikethrough + * + * @return boolean + */ + public function getStrikethrough() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getStrikethrough(); + } + return $this->strikethrough; + } + + /** + * Set Strikethrough + * + * @param boolean $pValue + * @return PHPExcel_Style_Font + */ + public function setStrikethrough($pValue = false) + { + if ($pValue == '') { + $pValue = false; + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('strike' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->strikethrough = $pValue; + } + return $this; + } + + /** + * Get Color + * + * @return PHPExcel_Style_Color + */ + public function getColor() + { + return $this->color; + } + + /** + * Set Color + * + * @param PHPExcel_Style_Color $pValue + * @throws PHPExcel_Exception + * @return PHPExcel_Style_Font + */ + public function setColor(PHPExcel_Style_Color $pValue = null) + { + // make sure parameter is a real color and not a supervisor + $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue; + + if ($this->isSupervisor) { + $styleArray = $this->getColor()->getStyleArray(array('argb' => $color->getARGB())); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->color = $color; + } + return $this; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getHashCode(); + } + return md5( + $this->name . + $this->size . + ($this->bold ? 't' : 'f') . + ($this->italic ? 't' : 'f') . + ($this->superScript ? 't' : 'f') . + ($this->subScript ? 't' : 'f') . + $this->underline . + ($this->strikethrough ? 't' : 'f') . + $this->color->getHashCode() . + __CLASS__ + ); + } +} diff --git a/extend/PHPExcel/PHPExcel/Style/NumberFormat.php b/extend/PHPExcel/PHPExcel/Style/NumberFormat.php new file mode 100644 index 0000000..1b72cda --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Style/NumberFormat.php @@ -0,0 +1,751 @@ +<?php + +/** + * PHPExcel_Style_NumberFormat + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Style + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable +{ + /* Pre-defined formats */ + const FORMAT_GENERAL = 'General'; + + const FORMAT_TEXT = '@'; + + const FORMAT_NUMBER = '0'; + const FORMAT_NUMBER_00 = '0.00'; + const FORMAT_NUMBER_COMMA_SEPARATED1 = '#,##0.00'; + const FORMAT_NUMBER_COMMA_SEPARATED2 = '#,##0.00_-'; + + const FORMAT_PERCENTAGE = '0%'; + const FORMAT_PERCENTAGE_00 = '0.00%'; + + const FORMAT_DATE_YYYYMMDD2 = 'yyyy-mm-dd'; + const FORMAT_DATE_YYYYMMDD = 'yy-mm-dd'; + const FORMAT_DATE_DDMMYYYY = 'dd/mm/yy'; + const FORMAT_DATE_DMYSLASH = 'd/m/y'; + const FORMAT_DATE_DMYMINUS = 'd-m-y'; + const FORMAT_DATE_DMMINUS = 'd-m'; + const FORMAT_DATE_MYMINUS = 'm-y'; + const FORMAT_DATE_XLSX14 = 'mm-dd-yy'; + const FORMAT_DATE_XLSX15 = 'd-mmm-yy'; + const FORMAT_DATE_XLSX16 = 'd-mmm'; + const FORMAT_DATE_XLSX17 = 'mmm-yy'; + const FORMAT_DATE_XLSX22 = 'm/d/yy h:mm'; + const FORMAT_DATE_DATETIME = 'd/m/y h:mm'; + const FORMAT_DATE_TIME1 = 'h:mm AM/PM'; + const FORMAT_DATE_TIME2 = 'h:mm:ss AM/PM'; + const FORMAT_DATE_TIME3 = 'h:mm'; + const FORMAT_DATE_TIME4 = 'h:mm:ss'; + const FORMAT_DATE_TIME5 = 'mm:ss'; + const FORMAT_DATE_TIME6 = 'h:mm:ss'; + const FORMAT_DATE_TIME7 = 'i:s.S'; + const FORMAT_DATE_TIME8 = 'h:mm:ss;@'; + const FORMAT_DATE_YYYYMMDDSLASH = 'yy/mm/dd;@'; + + const FORMAT_CURRENCY_USD_SIMPLE = '"$"#,##0.00_-'; + const FORMAT_CURRENCY_USD = '$#,##0_-'; + const FORMAT_CURRENCY_EUR_SIMPLE = '[$EUR ]#,##0.00_-'; + + /** + * Excel built-in number formats + * + * @var array + */ + protected static $builtInFormats; + + /** + * Excel built-in number formats (flipped, for faster lookups) + * + * @var array + */ + protected static $flippedBuiltInFormats; + + /** + * Format Code + * + * @var string + */ + protected $formatCode = PHPExcel_Style_NumberFormat::FORMAT_GENERAL; + + /** + * Built-in format Code + * + * @var string + */ + protected $builtInFormatCode = 0; + + /** + * Create a new PHPExcel_Style_NumberFormat + * + * @param boolean $isSupervisor Flag indicating if this is a supervisor or not + * Leave this value at default unless you understand exactly what + * its ramifications are + * @param boolean $isConditional Flag indicating if this is a conditional style or not + * Leave this value at default unless you understand exactly what + * its ramifications are + */ + public function __construct($isSupervisor = false, $isConditional = false) + { + // Supervisor? + parent::__construct($isSupervisor); + + if ($isConditional) { + $this->formatCode = null; + $this->builtInFormatCode = false; + } + } + + /** + * Get the shared style component for the currently active cell in currently active sheet. + * Only used for style supervisor + * + * @return PHPExcel_Style_NumberFormat + */ + public function getSharedComponent() + { + return $this->parent->getSharedComponent()->getNumberFormat(); + } + + /** + * Build style array from subcomponents + * + * @param array $array + * @return array + */ + public function getStyleArray($array) + { + return array('numberformat' => $array); + } + + /** + * Apply styles from array + * + * <code> + * $objPHPExcel->getActiveSheet()->getStyle('B2')->getNumberFormat()->applyFromArray( + * array( + * 'code' => PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE + * ) + * ); + * </code> + * + * @param array $pStyles Array containing style information + * @throws PHPExcel_Exception + * @return PHPExcel_Style_NumberFormat + */ + public function applyFromArray($pStyles = null) + { + if (is_array($pStyles)) { + if ($this->isSupervisor) { + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles)); + } else { + if (array_key_exists('code', $pStyles)) { + $this->setFormatCode($pStyles['code']); + } + } + } else { + throw new PHPExcel_Exception("Invalid style array passed."); + } + return $this; + } + + /** + * Get Format Code + * + * @return string + */ + public function getFormatCode() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getFormatCode(); + } + if ($this->builtInFormatCode !== false) { + return self::builtInFormatCode($this->builtInFormatCode); + } + return $this->formatCode; + } + + /** + * Set Format Code + * + * @param string $pValue + * @return PHPExcel_Style_NumberFormat + */ + public function setFormatCode($pValue = PHPExcel_Style_NumberFormat::FORMAT_GENERAL) + { + if ($pValue == '') { + $pValue = PHPExcel_Style_NumberFormat::FORMAT_GENERAL; + } + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('code' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->formatCode = $pValue; + $this->builtInFormatCode = self::builtInFormatCodeIndex($pValue); + } + return $this; + } + + /** + * Get Built-In Format Code + * + * @return int + */ + public function getBuiltInFormatCode() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getBuiltInFormatCode(); + } + return $this->builtInFormatCode; + } + + /** + * Set Built-In Format Code + * + * @param int $pValue + * @return PHPExcel_Style_NumberFormat + */ + public function setBuiltInFormatCode($pValue = 0) + { + + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('code' => self::builtInFormatCode($pValue))); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->builtInFormatCode = $pValue; + $this->formatCode = self::builtInFormatCode($pValue); + } + return $this; + } + + /** + * Fill built-in format codes + */ + private static function fillBuiltInFormatCodes() + { + // [MS-OI29500: Microsoft Office Implementation Information for ISO/IEC-29500 Standard Compliance] + // 18.8.30. numFmt (Number Format) + // + // The ECMA standard defines built-in format IDs + // 14: "mm-dd-yy" + // 22: "m/d/yy h:mm" + // 37: "#,##0 ;(#,##0)" + // 38: "#,##0 ;[Red](#,##0)" + // 39: "#,##0.00;(#,##0.00)" + // 40: "#,##0.00;[Red](#,##0.00)" + // 47: "mmss.0" + // KOR fmt 55: "yyyy-mm-dd" + // Excel defines built-in format IDs + // 14: "m/d/yyyy" + // 22: "m/d/yyyy h:mm" + // 37: "#,##0_);(#,##0)" + // 38: "#,##0_);[Red](#,##0)" + // 39: "#,##0.00_);(#,##0.00)" + // 40: "#,##0.00_);[Red](#,##0.00)" + // 47: "mm:ss.0" + // KOR fmt 55: "yyyy/mm/dd" + + // Built-in format codes + if (is_null(self::$builtInFormats)) { + self::$builtInFormats = array(); + + // General + self::$builtInFormats[0] = PHPExcel_Style_NumberFormat::FORMAT_GENERAL; + self::$builtInFormats[1] = '0'; + self::$builtInFormats[2] = '0.00'; + self::$builtInFormats[3] = '#,##0'; + self::$builtInFormats[4] = '#,##0.00'; + + self::$builtInFormats[9] = '0%'; + self::$builtInFormats[10] = '0.00%'; + self::$builtInFormats[11] = '0.00E+00'; + self::$builtInFormats[12] = '# ?/?'; + self::$builtInFormats[13] = '# ??/??'; + self::$builtInFormats[14] = 'm/d/yyyy'; // Despite ECMA 'mm-dd-yy'; + self::$builtInFormats[15] = 'd-mmm-yy'; + self::$builtInFormats[16] = 'd-mmm'; + self::$builtInFormats[17] = 'mmm-yy'; + self::$builtInFormats[18] = 'h:mm AM/PM'; + self::$builtInFormats[19] = 'h:mm:ss AM/PM'; + self::$builtInFormats[20] = 'h:mm'; + self::$builtInFormats[21] = 'h:mm:ss'; + self::$builtInFormats[22] = 'm/d/yyyy h:mm'; // Despite ECMA 'm/d/yy h:mm'; + + self::$builtInFormats[37] = '#,##0_);(#,##0)'; // Despite ECMA '#,##0 ;(#,##0)'; + self::$builtInFormats[38] = '#,##0_);[Red](#,##0)'; // Despite ECMA '#,##0 ;[Red](#,##0)'; + self::$builtInFormats[39] = '#,##0.00_);(#,##0.00)'; // Despite ECMA '#,##0.00;(#,##0.00)'; + self::$builtInFormats[40] = '#,##0.00_);[Red](#,##0.00)'; // Despite ECMA '#,##0.00;[Red](#,##0.00)'; + + self::$builtInFormats[44] = '_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)'; + self::$builtInFormats[45] = 'mm:ss'; + self::$builtInFormats[46] = '[h]:mm:ss'; + self::$builtInFormats[47] = 'mm:ss.0'; // Despite ECMA 'mmss.0'; + self::$builtInFormats[48] = '##0.0E+0'; + self::$builtInFormats[49] = '@'; + + // CHT + self::$builtInFormats[27] = '[$-404]e/m/d'; + self::$builtInFormats[30] = 'm/d/yy'; + self::$builtInFormats[36] = '[$-404]e/m/d'; + self::$builtInFormats[50] = '[$-404]e/m/d'; + self::$builtInFormats[57] = '[$-404]e/m/d'; + + // THA + self::$builtInFormats[59] = 't0'; + self::$builtInFormats[60] = 't0.00'; + self::$builtInFormats[61] = 't#,##0'; + self::$builtInFormats[62] = 't#,##0.00'; + self::$builtInFormats[67] = 't0%'; + self::$builtInFormats[68] = 't0.00%'; + self::$builtInFormats[69] = 't# ?/?'; + self::$builtInFormats[70] = 't# ??/??'; + + // Flip array (for faster lookups) + self::$flippedBuiltInFormats = array_flip(self::$builtInFormats); + } + } + + /** + * Get built-in format code + * + * @param int $pIndex + * @return string + */ + public static function builtInFormatCode($pIndex) + { + // Clean parameter + $pIndex = intval($pIndex); + + // Ensure built-in format codes are available + self::fillBuiltInFormatCodes(); + // Lookup format code + if (isset(self::$builtInFormats[$pIndex])) { + return self::$builtInFormats[$pIndex]; + } + + return ''; + } + + /** + * Get built-in format code index + * + * @param string $formatCode + * @return int|boolean + */ + public static function builtInFormatCodeIndex($formatCode) + { + // Ensure built-in format codes are available + self::fillBuiltInFormatCodes(); + + // Lookup format code + if (isset(self::$flippedBuiltInFormats[$formatCode])) { + return self::$flippedBuiltInFormats[$formatCode]; + } + + return false; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getHashCode(); + } + return md5( + $this->formatCode . + $this->builtInFormatCode . + __CLASS__ + ); + } + + /** + * Search/replace values to convert Excel date/time format masks to PHP format masks + * + * @var array + */ + private static $dateFormatReplacements = array( + // first remove escapes related to non-format characters + '\\' => '', + // 12-hour suffix + 'am/pm' => 'A', + // 4-digit year + 'e' => 'Y', + 'yyyy' => 'Y', + // 2-digit year + 'yy' => 'y', + // first letter of month - no php equivalent + 'mmmmm' => 'M', + // full month name + 'mmmm' => 'F', + // short month name + 'mmm' => 'M', + // mm is minutes if time, but can also be month w/leading zero + // so we try to identify times be the inclusion of a : separator in the mask + // It isn't perfect, but the best way I know how + ':mm' => ':i', + 'mm:' => 'i:', + // month leading zero + 'mm' => 'm', + // month no leading zero + 'm' => 'n', + // full day of week name + 'dddd' => 'l', + // short day of week name + 'ddd' => 'D', + // days leading zero + 'dd' => 'd', + // days no leading zero + 'd' => 'j', + // seconds + 'ss' => 's', + // fractional seconds - no php equivalent + '.s' => '' + ); + /** + * Search/replace values to convert Excel date/time format masks hours to PHP format masks (24 hr clock) + * + * @var array + */ + private static $dateFormatReplacements24 = array( + 'hh' => 'H', + 'h' => 'G' + ); + /** + * Search/replace values to convert Excel date/time format masks hours to PHP format masks (12 hr clock) + * + * @var array + */ + private static $dateFormatReplacements12 = array( + 'hh' => 'h', + 'h' => 'g' + ); + + private static function setLowercaseCallback($matches) { + return mb_strtolower($matches[0]); + } + + private static function escapeQuotesCallback($matches) { + return '\\' . implode('\\', str_split($matches[1])); + } + + private static function formatAsDate(&$value, &$format) + { + // strip off first part containing e.g. [$-F800] or [$USD-409] + // general syntax: [$<Currency string>-<language info>] + // language info is in hexadecimal + $format = preg_replace('/^(\[\$[A-Z]*-[0-9A-F]*\])/i', '', $format); + + // OpenOffice.org uses upper-case number formats, e.g. 'YYYY', convert to lower-case; + // but we don't want to change any quoted strings + $format = preg_replace_callback('/(?:^|")([^"]*)(?:$|")/', array('self', 'setLowercaseCallback'), $format); + + // Only process the non-quoted blocks for date format characters + $blocks = explode('"', $format); + foreach($blocks as $key => &$block) { + if ($key % 2 == 0) { + $block = strtr($block, self::$dateFormatReplacements); + if (!strpos($block, 'A')) { + // 24-hour time format + $block = strtr($block, self::$dateFormatReplacements24); + } else { + // 12-hour time format + $block = strtr($block, self::$dateFormatReplacements12); + } + } + } + $format = implode('"', $blocks); + + // escape any quoted characters so that DateTime format() will render them correctly + $format = preg_replace_callback('/"(.*)"/U', array('self', 'escapeQuotesCallback'), $format); + + $dateObj = PHPExcel_Shared_Date::ExcelToPHPObject($value); + $value = $dateObj->format($format); + } + + private static function formatAsPercentage(&$value, &$format) + { + if ($format === self::FORMAT_PERCENTAGE) { + $value = round((100 * $value), 0) . '%'; + } else { + if (preg_match('/\.[#0]+/i', $format, $m)) { + $s = substr($m[0], 0, 1) . (strlen($m[0]) - 1); + $format = str_replace($m[0], $s, $format); + } + if (preg_match('/^[#0]+/', $format, $m)) { + $format = str_replace($m[0], strlen($m[0]), $format); + } + $format = '%' . str_replace('%', 'f%%', $format); + + $value = sprintf($format, 100 * $value); + } + } + + private static function formatAsFraction(&$value, &$format) + { + $sign = ($value < 0) ? '-' : ''; + + $integerPart = floor(abs($value)); + $decimalPart = trim(fmod(abs($value), 1), '0.'); + $decimalLength = strlen($decimalPart); + $decimalDivisor = pow(10, $decimalLength); + + $GCD = PHPExcel_Calculation_MathTrig::GCD($decimalPart, $decimalDivisor); + + $adjustedDecimalPart = $decimalPart/$GCD; + $adjustedDecimalDivisor = $decimalDivisor/$GCD; + + if ((strpos($format, '0') !== false) || (strpos($format, '#') !== false) || (substr($format, 0, 3) == '? ?')) { + if ($integerPart == 0) { + $integerPart = ''; + } + $value = "$sign$integerPart $adjustedDecimalPart/$adjustedDecimalDivisor"; + } else { + $adjustedDecimalPart += $integerPart * $adjustedDecimalDivisor; + $value = "$sign$adjustedDecimalPart/$adjustedDecimalDivisor"; + } + } + + private static function complexNumberFormatMask($number, $mask, $level = 0) + { + $sign = ($number < 0.0); + $number = abs($number); + if (strpos($mask, '.') !== false) { + $numbers = explode('.', $number . '.0'); + $masks = explode('.', $mask . '.0'); + $result1 = self::complexNumberFormatMask($numbers[0], $masks[0], 1); + $result2 = strrev(self::complexNumberFormatMask(strrev($numbers[1]), strrev($masks[1]), 1)); + return (($sign) ? '-' : '') . $result1 . '.' . $result2; + } + + $r = preg_match_all('/0+/', $mask, $result, PREG_OFFSET_CAPTURE); + if ($r > 1) { + $result = array_reverse($result[0]); + + foreach ($result as $block) { + $divisor = 1 . $block[0]; + $size = strlen($block[0]); + $offset = $block[1]; + + $blockValue = sprintf( + '%0' . $size . 'd', + fmod($number, $divisor) + ); + $number = floor($number / $divisor); + $mask = substr_replace($mask, $blockValue, $offset, $size); + } + if ($number > 0) { + $mask = substr_replace($mask, $number, $offset, 0); + } + $result = $mask; + } else { + $result = $number; + } + + return (($sign) ? '-' : '') . $result; + } + + /** + * Convert a value in a pre-defined format to a PHP string + * + * @param mixed $value Value to format + * @param string $format Format code + * @param array $callBack Callback function for additional formatting of string + * @return string Formatted string + */ + public static function toFormattedString($value = '0', $format = PHPExcel_Style_NumberFormat::FORMAT_GENERAL, $callBack = null) + { + // For now we do not treat strings although section 4 of a format code affects strings + if (!is_numeric($value)) { + return $value; + } + + // For 'General' format code, we just pass the value although this is not entirely the way Excel does it, + // it seems to round numbers to a total of 10 digits. + if (($format === PHPExcel_Style_NumberFormat::FORMAT_GENERAL) || ($format === PHPExcel_Style_NumberFormat::FORMAT_TEXT)) { + return $value; + } + + // Convert any other escaped characters to quoted strings, e.g. (\T to "T") + $format = preg_replace('/(\\\(.))(?=(?:[^"]|"[^"]*")*$)/u', '"${2}"', $format); + + // Get the sections, there can be up to four sections, separated with a semi-colon (but only if not a quoted literal) + $sections = preg_split('/(;)(?=(?:[^"]|"[^"]*")*$)/u', $format); + + // Extract the relevant section depending on whether number is positive, negative, or zero? + // Text not supported yet. + // Here is how the sections apply to various values in Excel: + // 1 section: [POSITIVE/NEGATIVE/ZERO/TEXT] + // 2 sections: [POSITIVE/ZERO/TEXT] [NEGATIVE] + // 3 sections: [POSITIVE/TEXT] [NEGATIVE] [ZERO] + // 4 sections: [POSITIVE] [NEGATIVE] [ZERO] [TEXT] + switch (count($sections)) { + case 1: + $format = $sections[0]; + break; + case 2: + $format = ($value >= 0) ? $sections[0] : $sections[1]; + $value = abs($value); // Use the absolute value + break; + case 3: + $format = ($value > 0) ? + $sections[0] : ( ($value < 0) ? + $sections[1] : $sections[2]); + $value = abs($value); // Use the absolute value + break; + case 4: + $format = ($value > 0) ? + $sections[0] : ( ($value < 0) ? + $sections[1] : $sections[2]); + $value = abs($value); // Use the absolute value + break; + default: + // something is wrong, just use first section + $format = $sections[0]; + break; + } + + // In Excel formats, "_" is used to add spacing, + // The following character indicates the size of the spacing, which we can't do in HTML, so we just use a standard space + $format = preg_replace('/_./', ' ', $format); + + // Save format with color information for later use below + $formatColor = $format; + + // Strip color information + $color_regex = '/^\\[[a-zA-Z]+\\]/'; + $format = preg_replace($color_regex, '', $format); + + // Let's begin inspecting the format and converting the value to a formatted string + + // Check for date/time characters (not inside quotes) + if (preg_match('/(\[\$[A-Z]*-[0-9A-F]*\])*[hmsdy](?=(?:[^"]|"[^"]*")*$)/miu', $format, $matches)) { + // datetime format + self::formatAsDate($value, $format); + } elseif (preg_match('/%$/', $format)) { + // % number format + self::formatAsPercentage($value, $format); + } else { + if ($format === self::FORMAT_CURRENCY_EUR_SIMPLE) { + $value = 'EUR ' . sprintf('%1.2f', $value); + } else { + // Some non-number strings are quoted, so we'll get rid of the quotes, likewise any positional * symbols + $format = str_replace(array('"', '*'), '', $format); + + // Find out if we need thousands separator + // This is indicated by a comma enclosed by a digit placeholder: + // #,# or 0,0 + $useThousands = preg_match('/(#,#|0,0)/', $format); + if ($useThousands) { + $format = preg_replace('/0,0/', '00', $format); + $format = preg_replace('/#,#/', '##', $format); + } + + // Scale thousands, millions,... + // This is indicated by a number of commas after a digit placeholder: + // #, or 0.0,, + $scale = 1; // same as no scale + $matches = array(); + if (preg_match('/(#|0)(,+)/', $format, $matches)) { + $scale = pow(1000, strlen($matches[2])); + + // strip the commas + $format = preg_replace('/0,+/', '0', $format); + $format = preg_replace('/#,+/', '#', $format); + } + + if (preg_match('/#?.*\?\/\?/', $format, $m)) { + //echo 'Format mask is fractional '.$format.' <br />'; + if ($value != (int)$value) { + self::formatAsFraction($value, $format); + } + + } else { + // Handle the number itself + + // scale number + $value = $value / $scale; + + // Strip # + $format = preg_replace('/\\#/', '0', $format); + + $n = "/\[[^\]]+\]/"; + $m = preg_replace($n, '', $format); + $number_regex = "/(0+)(\.?)(0*)/"; + if (preg_match($number_regex, $m, $matches)) { + $left = $matches[1]; + $dec = $matches[2]; + $right = $matches[3]; + + // minimun width of formatted number (including dot) + $minWidth = strlen($left) + strlen($dec) + strlen($right); + if ($useThousands) { + $value = number_format( + $value, + strlen($right), + PHPExcel_Shared_String::getDecimalSeparator(), + PHPExcel_Shared_String::getThousandsSeparator() + ); + $value = preg_replace($number_regex, $value, $format); + } else { + if (preg_match('/[0#]E[+-]0/i', $format)) { + // Scientific format + $value = sprintf('%5.2E', $value); + } elseif (preg_match('/0([^\d\.]+)0/', $format)) { + $value = self::complexNumberFormatMask($value, $format); + } else { + $sprintf_pattern = "%0$minWidth." . strlen($right) . "f"; + $value = sprintf($sprintf_pattern, $value); + $value = preg_replace($number_regex, $value, $format); + } + } + } + } + if (preg_match('/\[\$(.*)\]/u', $format, $m)) { + // Currency or Accounting + $currencyFormat = $m[0]; + $currencyCode = $m[1]; + list($currencyCode) = explode('-', $currencyCode); + if ($currencyCode == '') { + $currencyCode = PHPExcel_Shared_String::getCurrencyCode(); + } + $value = preg_replace('/\[\$([^\]]*)\]/u', $currencyCode, $value); + } + } + } + + // Escape any escaped slashes to a single slash + $format = preg_replace("/\\\\/u", '\\', $format); + + // Additional formatting provided by callback function + if ($callBack !== null) { + list($writerInstance, $function) = $callBack; + $value = $writerInstance->$function($value, $formatColor); + } + + return $value; + } +} diff --git a/extend/PHPExcel/PHPExcel/Style/Protection.php b/extend/PHPExcel/PHPExcel/Style/Protection.php new file mode 100644 index 0000000..d5568f6 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Style/Protection.php @@ -0,0 +1,204 @@ +<?php + +/** + * PHPExcel_Style_Protection + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Style + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Style_Protection extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable +{ + /** Protection styles */ + const PROTECTION_INHERIT = 'inherit'; + const PROTECTION_PROTECTED = 'protected'; + const PROTECTION_UNPROTECTED = 'unprotected'; + + /** + * Locked + * + * @var string + */ + protected $locked; + + /** + * Hidden + * + * @var string + */ + protected $hidden; + + /** + * Create a new PHPExcel_Style_Protection + * + * @param boolean $isSupervisor Flag indicating if this is a supervisor or not + * Leave this value at default unless you understand exactly what + * its ramifications are + * @param boolean $isConditional Flag indicating if this is a conditional style or not + * Leave this value at default unless you understand exactly what + * its ramifications are + */ + public function __construct($isSupervisor = false, $isConditional = false) + { + // Supervisor? + parent::__construct($isSupervisor); + + // Initialise values + if (!$isConditional) { + $this->locked = self::PROTECTION_INHERIT; + $this->hidden = self::PROTECTION_INHERIT; + } + } + + /** + * Get the shared style component for the currently active cell in currently active sheet. + * Only used for style supervisor + * + * @return PHPExcel_Style_Protection + */ + public function getSharedComponent() + { + return $this->parent->getSharedComponent()->getProtection(); + } + + /** + * Build style array from subcomponents + * + * @param array $array + * @return array + */ + public function getStyleArray($array) + { + return array('protection' => $array); + } + + /** + * Apply styles from array + * + * <code> + * $objPHPExcel->getActiveSheet()->getStyle('B2')->getLocked()->applyFromArray( + * array( + * 'locked' => TRUE, + * 'hidden' => FALSE + * ) + * ); + * </code> + * + * @param array $pStyles Array containing style information + * @throws PHPExcel_Exception + * @return PHPExcel_Style_Protection + */ + public function applyFromArray($pStyles = null) + { + if (is_array($pStyles)) { + if ($this->isSupervisor) { + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles)); + } else { + if (isset($pStyles['locked'])) { + $this->setLocked($pStyles['locked']); + } + if (isset($pStyles['hidden'])) { + $this->setHidden($pStyles['hidden']); + } + } + } else { + throw new PHPExcel_Exception("Invalid style array passed."); + } + return $this; + } + + /** + * Get locked + * + * @return string + */ + public function getLocked() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getLocked(); + } + return $this->locked; + } + + /** + * Set locked + * + * @param string $pValue + * @return PHPExcel_Style_Protection + */ + public function setLocked($pValue = self::PROTECTION_INHERIT) + { + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('locked' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->locked = $pValue; + } + return $this; + } + + /** + * Get hidden + * + * @return string + */ + public function getHidden() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getHidden(); + } + return $this->hidden; + } + + /** + * Set hidden + * + * @param string $pValue + * @return PHPExcel_Style_Protection + */ + public function setHidden($pValue = self::PROTECTION_INHERIT) + { + if ($this->isSupervisor) { + $styleArray = $this->getStyleArray(array('hidden' => $pValue)); + $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); + } else { + $this->hidden = $pValue; + } + return $this; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + if ($this->isSupervisor) { + return $this->getSharedComponent()->getHashCode(); + } + return md5( + $this->locked . + $this->hidden . + __CLASS__ + ); + } +} diff --git a/extend/PHPExcel/PHPExcel/Style/Supervisor.php b/extend/PHPExcel/PHPExcel/Style/Supervisor.php new file mode 100644 index 0000000..a90e1c6 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Style/Supervisor.php @@ -0,0 +1,125 @@ +<?php + +/** + * PHPExcel_Style_Supervisor + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Style + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +abstract class PHPExcel_Style_Supervisor +{ + /** + * Supervisor? + * + * @var boolean + */ + protected $isSupervisor; + + /** + * Parent. Only used for supervisor + * + * @var PHPExcel_Style + */ + protected $parent; + + /** + * Create a new PHPExcel_Style_Alignment + * + * @param boolean $isSupervisor Flag indicating if this is a supervisor or not + * Leave this value at default unless you understand exactly what + * its ramifications are + */ + public function __construct($isSupervisor = false) + { + // Supervisor? + $this->isSupervisor = $isSupervisor; + } + + /** + * Bind parent. Only used for supervisor + * + * @param PHPExcel $parent + * @return PHPExcel_Style_Supervisor + */ + public function bindParent($parent, $parentPropertyName = null) + { + $this->parent = $parent; + return $this; + } + + /** + * Is this a supervisor or a cell style component? + * + * @return boolean + */ + public function getIsSupervisor() + { + return $this->isSupervisor; + } + + /** + * Get the currently active sheet. Only used for supervisor + * + * @return PHPExcel_Worksheet + */ + public function getActiveSheet() + { + return $this->parent->getActiveSheet(); + } + + /** + * Get the currently active cell coordinate in currently active sheet. + * Only used for supervisor + * + * @return string E.g. 'A1' + */ + public function getSelectedCells() + { + return $this->getActiveSheet()->getSelectedCells(); + } + + /** + * Get the currently active cell coordinate in currently active sheet. + * Only used for supervisor + * + * @return string E.g. 'A1' + */ + public function getActiveCell() + { + return $this->getActiveSheet()->getActiveCell(); + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if ((is_object($value)) && ($key != 'parent')) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet.php b/extend/PHPExcel/PHPExcel/Worksheet.php new file mode 100644 index 0000000..483aa00 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet.php @@ -0,0 +1,2968 @@ +<?php + +/** + * PHPExcel_Worksheet + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet implements PHPExcel_IComparable +{ + /* Break types */ + const BREAK_NONE = 0; + const BREAK_ROW = 1; + const BREAK_COLUMN = 2; + + /* Sheet state */ + const SHEETSTATE_VISIBLE = 'visible'; + const SHEETSTATE_HIDDEN = 'hidden'; + const SHEETSTATE_VERYHIDDEN = 'veryHidden'; + + /** + * Invalid characters in sheet title + * + * @var array + */ + private static $invalidCharacters = array('*', ':', '/', '\\', '?', '[', ']'); + + /** + * Parent spreadsheet + * + * @var PHPExcel + */ + private $parent; + + /** + * Cacheable collection of cells + * + * @var PHPExcel_CachedObjectStorage_xxx + */ + private $cellCollection; + + /** + * Collection of row dimensions + * + * @var PHPExcel_Worksheet_RowDimension[] + */ + private $rowDimensions = array(); + + /** + * Default row dimension + * + * @var PHPExcel_Worksheet_RowDimension + */ + private $defaultRowDimension; + + /** + * Collection of column dimensions + * + * @var PHPExcel_Worksheet_ColumnDimension[] + */ + private $columnDimensions = array(); + + /** + * Default column dimension + * + * @var PHPExcel_Worksheet_ColumnDimension + */ + private $defaultColumnDimension = null; + + /** + * Collection of drawings + * + * @var PHPExcel_Worksheet_BaseDrawing[] + */ + private $drawingCollection = null; + + /** + * Collection of Chart objects + * + * @var PHPExcel_Chart[] + */ + private $chartCollection = array(); + + /** + * Worksheet title + * + * @var string + */ + private $title; + + /** + * Sheet state + * + * @var string + */ + private $sheetState; + + /** + * Page setup + * + * @var PHPExcel_Worksheet_PageSetup + */ + private $pageSetup; + + /** + * Page margins + * + * @var PHPExcel_Worksheet_PageMargins + */ + private $pageMargins; + + /** + * Page header/footer + * + * @var PHPExcel_Worksheet_HeaderFooter + */ + private $headerFooter; + + /** + * Sheet view + * + * @var PHPExcel_Worksheet_SheetView + */ + private $sheetView; + + /** + * Protection + * + * @var PHPExcel_Worksheet_Protection + */ + private $protection; + + /** + * Collection of styles + * + * @var PHPExcel_Style[] + */ + private $styles = array(); + + /** + * Conditional styles. Indexed by cell coordinate, e.g. 'A1' + * + * @var array + */ + private $conditionalStylesCollection = array(); + + /** + * Is the current cell collection sorted already? + * + * @var boolean + */ + private $cellCollectionIsSorted = false; + + /** + * Collection of breaks + * + * @var array + */ + private $breaks = array(); + + /** + * Collection of merged cell ranges + * + * @var array + */ + private $mergeCells = array(); + + /** + * Collection of protected cell ranges + * + * @var array + */ + private $protectedCells = array(); + + /** + * Autofilter Range and selection + * + * @var PHPExcel_Worksheet_AutoFilter + */ + private $autoFilter; + + /** + * Freeze pane + * + * @var string + */ + private $freezePane = ''; + + /** + * Show gridlines? + * + * @var boolean + */ + private $showGridlines = true; + + /** + * Print gridlines? + * + * @var boolean + */ + private $printGridlines = false; + + /** + * Show row and column headers? + * + * @var boolean + */ + private $showRowColHeaders = true; + + /** + * Show summary below? (Row/Column outline) + * + * @var boolean + */ + private $showSummaryBelow = true; + + /** + * Show summary right? (Row/Column outline) + * + * @var boolean + */ + private $showSummaryRight = true; + + /** + * Collection of comments + * + * @var PHPExcel_Comment[] + */ + private $comments = array(); + + /** + * Active cell. (Only one!) + * + * @var string + */ + private $activeCell = 'A1'; + + /** + * Selected cells + * + * @var string + */ + private $selectedCells = 'A1'; + + /** + * Cached highest column + * + * @var string + */ + private $cachedHighestColumn = 'A'; + + /** + * Cached highest row + * + * @var int + */ + private $cachedHighestRow = 1; + + /** + * Right-to-left? + * + * @var boolean + */ + private $rightToLeft = false; + + /** + * Hyperlinks. Indexed by cell coordinate, e.g. 'A1' + * + * @var array + */ + private $hyperlinkCollection = array(); + + /** + * Data validation objects. Indexed by cell coordinate, e.g. 'A1' + * + * @var array + */ + private $dataValidationCollection = array(); + + /** + * Tab color + * + * @var PHPExcel_Style_Color + */ + private $tabColor; + + /** + * Dirty flag + * + * @var boolean + */ + private $dirty = true; + + /** + * Hash + * + * @var string + */ + private $hash; + + /** + * CodeName + * + * @var string + */ + private $codeName = null; + + /** + * Create a new worksheet + * + * @param PHPExcel $pParent + * @param string $pTitle + */ + public function __construct(PHPExcel $pParent = null, $pTitle = 'Worksheet') + { + // Set parent and title + $this->parent = $pParent; + $this->setTitle($pTitle, false); + // setTitle can change $pTitle + $this->setCodeName($this->getTitle()); + $this->setSheetState(PHPExcel_Worksheet::SHEETSTATE_VISIBLE); + + $this->cellCollection = PHPExcel_CachedObjectStorageFactory::getInstance($this); + // Set page setup + $this->pageSetup = new PHPExcel_Worksheet_PageSetup(); + // Set page margins + $this->pageMargins = new PHPExcel_Worksheet_PageMargins(); + // Set page header/footer + $this->headerFooter = new PHPExcel_Worksheet_HeaderFooter(); + // Set sheet view + $this->sheetView = new PHPExcel_Worksheet_SheetView(); + // Drawing collection + $this->drawingCollection = new ArrayObject(); + // Chart collection + $this->chartCollection = new ArrayObject(); + // Protection + $this->protection = new PHPExcel_Worksheet_Protection(); + // Default row dimension + $this->defaultRowDimension = new PHPExcel_Worksheet_RowDimension(null); + // Default column dimension + $this->defaultColumnDimension = new PHPExcel_Worksheet_ColumnDimension(null); + $this->autoFilter = new PHPExcel_Worksheet_AutoFilter(null, $this); + } + + + /** + * Disconnect all cells from this PHPExcel_Worksheet object, + * typically so that the worksheet object can be unset + * + */ + public function disconnectCells() + { + if ($this->cellCollection !== null) { + $this->cellCollection->unsetWorksheetCells(); + $this->cellCollection = null; + } + // detach ourself from the workbook, so that it can then delete this worksheet successfully + $this->parent = null; + } + + /** + * Code to execute when this worksheet is unset() + * + */ + public function __destruct() + { + PHPExcel_Calculation::getInstance($this->parent)->clearCalculationCacheForWorksheet($this->title); + + $this->disconnectCells(); + } + + /** + * Return the cache controller for the cell collection + * + * @return PHPExcel_CachedObjectStorage_xxx + */ + public function getCellCacheController() + { + return $this->cellCollection; + } + + + /** + * Get array of invalid characters for sheet title + * + * @return array + */ + public static function getInvalidCharacters() + { + return self::$invalidCharacters; + } + + /** + * Check sheet code name for valid Excel syntax + * + * @param string $pValue The string to check + * @return string The valid string + * @throws Exception + */ + private static function checkSheetCodeName($pValue) + { + $CharCount = PHPExcel_Shared_String::CountCharacters($pValue); + if ($CharCount == 0) { + throw new PHPExcel_Exception('Sheet code name cannot be empty.'); + } + // Some of the printable ASCII characters are invalid: * : / \ ? [ ] and first and last characters cannot be a "'" + if ((str_replace(self::$invalidCharacters, '', $pValue) !== $pValue) || + (PHPExcel_Shared_String::Substring($pValue, -1, 1)=='\'') || + (PHPExcel_Shared_String::Substring($pValue, 0, 1)=='\'')) { + throw new PHPExcel_Exception('Invalid character found in sheet code name'); + } + + // Maximum 31 characters allowed for sheet title + if ($CharCount > 31) { + throw new PHPExcel_Exception('Maximum 31 characters allowed in sheet code name.'); + } + + return $pValue; + } + + /** + * Check sheet title for valid Excel syntax + * + * @param string $pValue The string to check + * @return string The valid string + * @throws PHPExcel_Exception + */ + private static function checkSheetTitle($pValue) + { + // Some of the printable ASCII characters are invalid: * : / \ ? [ ] + if (str_replace(self::$invalidCharacters, '', $pValue) !== $pValue) { + throw new PHPExcel_Exception('Invalid character found in sheet title'); + } + + // Maximum 31 characters allowed for sheet title + if (PHPExcel_Shared_String::CountCharacters($pValue) > 31) { + throw new PHPExcel_Exception('Maximum 31 characters allowed in sheet title.'); + } + + return $pValue; + } + + /** + * Get collection of cells + * + * @param boolean $pSorted Also sort the cell collection? + * @return PHPExcel_Cell[] + */ + public function getCellCollection($pSorted = true) + { + if ($pSorted) { + // Re-order cell collection + return $this->sortCellCollection(); + } + if ($this->cellCollection !== null) { + return $this->cellCollection->getCellList(); + } + return array(); + } + + /** + * Sort collection of cells + * + * @return PHPExcel_Worksheet + */ + public function sortCellCollection() + { + if ($this->cellCollection !== null) { + return $this->cellCollection->getSortedCellList(); + } + return array(); + } + + /** + * Get collection of row dimensions + * + * @return PHPExcel_Worksheet_RowDimension[] + */ + public function getRowDimensions() + { + return $this->rowDimensions; + } + + /** + * Get default row dimension + * + * @return PHPExcel_Worksheet_RowDimension + */ + public function getDefaultRowDimension() + { + return $this->defaultRowDimension; + } + + /** + * Get collection of column dimensions + * + * @return PHPExcel_Worksheet_ColumnDimension[] + */ + public function getColumnDimensions() + { + return $this->columnDimensions; + } + + /** + * Get default column dimension + * + * @return PHPExcel_Worksheet_ColumnDimension + */ + public function getDefaultColumnDimension() + { + return $this->defaultColumnDimension; + } + + /** + * Get collection of drawings + * + * @return PHPExcel_Worksheet_BaseDrawing[] + */ + public function getDrawingCollection() + { + return $this->drawingCollection; + } + + /** + * Get collection of charts + * + * @return PHPExcel_Chart[] + */ + public function getChartCollection() + { + return $this->chartCollection; + } + + /** + * Add chart + * + * @param PHPExcel_Chart $pChart + * @param int|null $iChartIndex Index where chart should go (0,1,..., or null for last) + * @return PHPExcel_Chart + */ + public function addChart(PHPExcel_Chart $pChart = null, $iChartIndex = null) + { + $pChart->setWorksheet($this); + if (is_null($iChartIndex)) { + $this->chartCollection[] = $pChart; + } else { + // Insert the chart at the requested index + array_splice($this->chartCollection, $iChartIndex, 0, array($pChart)); + } + + return $pChart; + } + + /** + * Return the count of charts on this worksheet + * + * @return int The number of charts + */ + public function getChartCount() + { + return count($this->chartCollection); + } + + /** + * Get a chart by its index position + * + * @param string $index Chart index position + * @return false|PHPExcel_Chart + * @throws PHPExcel_Exception + */ + public function getChartByIndex($index = null) + { + $chartCount = count($this->chartCollection); + if ($chartCount == 0) { + return false; + } + if (is_null($index)) { + $index = --$chartCount; + } + if (!isset($this->chartCollection[$index])) { + return false; + } + + return $this->chartCollection[$index]; + } + + /** + * Return an array of the names of charts on this worksheet + * + * @return string[] The names of charts + * @throws PHPExcel_Exception + */ + public function getChartNames() + { + $chartNames = array(); + foreach ($this->chartCollection as $chart) { + $chartNames[] = $chart->getName(); + } + return $chartNames; + } + + /** + * Get a chart by name + * + * @param string $chartName Chart name + * @return false|PHPExcel_Chart + * @throws PHPExcel_Exception + */ + public function getChartByName($chartName = '') + { + $chartCount = count($this->chartCollection); + if ($chartCount == 0) { + return false; + } + foreach ($this->chartCollection as $index => $chart) { + if ($chart->getName() == $chartName) { + return $this->chartCollection[$index]; + } + } + return false; + } + + /** + * Refresh column dimensions + * + * @return PHPExcel_Worksheet + */ + public function refreshColumnDimensions() + { + $currentColumnDimensions = $this->getColumnDimensions(); + $newColumnDimensions = array(); + + foreach ($currentColumnDimensions as $objColumnDimension) { + $newColumnDimensions[$objColumnDimension->getColumnIndex()] = $objColumnDimension; + } + + $this->columnDimensions = $newColumnDimensions; + + return $this; + } + + /** + * Refresh row dimensions + * + * @return PHPExcel_Worksheet + */ + public function refreshRowDimensions() + { + $currentRowDimensions = $this->getRowDimensions(); + $newRowDimensions = array(); + + foreach ($currentRowDimensions as $objRowDimension) { + $newRowDimensions[$objRowDimension->getRowIndex()] = $objRowDimension; + } + + $this->rowDimensions = $newRowDimensions; + + return $this; + } + + /** + * Calculate worksheet dimension + * + * @return string String containing the dimension of this worksheet + */ + public function calculateWorksheetDimension() + { + // Return + return 'A1' . ':' . $this->getHighestColumn() . $this->getHighestRow(); + } + + /** + * Calculate worksheet data dimension + * + * @return string String containing the dimension of this worksheet that actually contain data + */ + public function calculateWorksheetDataDimension() + { + // Return + return 'A1' . ':' . $this->getHighestDataColumn() . $this->getHighestDataRow(); + } + + /** + * Calculate widths for auto-size columns + * + * @param boolean $calculateMergeCells Calculate merge cell width + * @return PHPExcel_Worksheet; + */ + public function calculateColumnWidths($calculateMergeCells = false) + { + // initialize $autoSizes array + $autoSizes = array(); + foreach ($this->getColumnDimensions() as $colDimension) { + if ($colDimension->getAutoSize()) { + $autoSizes[$colDimension->getColumnIndex()] = -1; + } + } + + // There is only something to do if there are some auto-size columns + if (!empty($autoSizes)) { + // build list of cells references that participate in a merge + $isMergeCell = array(); + foreach ($this->getMergeCells() as $cells) { + foreach (PHPExcel_Cell::extractAllCellReferencesInRange($cells) as $cellReference) { + $isMergeCell[$cellReference] = true; + } + } + + // loop through all cells in the worksheet + foreach ($this->getCellCollection(false) as $cellID) { + $cell = $this->getCell($cellID, false); + if ($cell !== null && isset($autoSizes[$this->cellCollection->getCurrentColumn()])) { + // Determine width if cell does not participate in a merge + if (!isset($isMergeCell[$this->cellCollection->getCurrentAddress()])) { + // Calculated value + // To formatted string + $cellValue = PHPExcel_Style_NumberFormat::toFormattedString( + $cell->getCalculatedValue(), + $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode() + ); + + $autoSizes[$this->cellCollection->getCurrentColumn()] = max( + (float) $autoSizes[$this->cellCollection->getCurrentColumn()], + (float)PHPExcel_Shared_Font::calculateColumnWidth( + $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont(), + $cellValue, + $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getAlignment()->getTextRotation(), + $this->getDefaultStyle()->getFont() + ) + ); + } + } + } + + // adjust column widths + foreach ($autoSizes as $columnIndex => $width) { + if ($width == -1) { + $width = $this->getDefaultColumnDimension()->getWidth(); + } + $this->getColumnDimension($columnIndex)->setWidth($width); + } + } + + return $this; + } + + /** + * Get parent + * + * @return PHPExcel + */ + public function getParent() + { + return $this->parent; + } + + /** + * Re-bind parent + * + * @param PHPExcel $parent + * @return PHPExcel_Worksheet + */ + public function rebindParent(PHPExcel $parent) + { + if ($this->parent !== null) { + $namedRanges = $this->parent->getNamedRanges(); + foreach ($namedRanges as $namedRange) { + $parent->addNamedRange($namedRange); + } + + $this->parent->removeSheetByIndex( + $this->parent->getIndex($this) + ); + } + $this->parent = $parent; + + return $this; + } + + /** + * Get title + * + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Set title + * + * @param string $pValue String containing the dimension of this worksheet + * @param string $updateFormulaCellReferences boolean Flag indicating whether cell references in formulae should + * be updated to reflect the new sheet name. + * This should be left as the default true, unless you are + * certain that no formula cells on any worksheet contain + * references to this worksheet + * @return PHPExcel_Worksheet + */ + public function setTitle($pValue = 'Worksheet', $updateFormulaCellReferences = true) + { + // Is this a 'rename' or not? + if ($this->getTitle() == $pValue) { + return $this; + } + + // Syntax check + self::checkSheetTitle($pValue); + + // Old title + $oldTitle = $this->getTitle(); + + if ($this->parent) { + // Is there already such sheet name? + if ($this->parent->sheetNameExists($pValue)) { + // Use name, but append with lowest possible integer + + if (PHPExcel_Shared_String::CountCharacters($pValue) > 29) { + $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 29); + } + $i = 1; + while ($this->parent->sheetNameExists($pValue . ' ' . $i)) { + ++$i; + if ($i == 10) { + if (PHPExcel_Shared_String::CountCharacters($pValue) > 28) { + $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 28); + } + } elseif ($i == 100) { + if (PHPExcel_Shared_String::CountCharacters($pValue) > 27) { + $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 27); + } + } + } + + $altTitle = $pValue . ' ' . $i; + return $this->setTitle($altTitle, $updateFormulaCellReferences); + } + } + + // Set title + $this->title = $pValue; + $this->dirty = true; + + if ($this->parent && $this->parent->getCalculationEngine()) { + // New title + $newTitle = $this->getTitle(); + $this->parent->getCalculationEngine() + ->renameCalculationCacheForWorksheet($oldTitle, $newTitle); + if ($updateFormulaCellReferences) { + PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->parent, $oldTitle, $newTitle); + } + } + + return $this; + } + + /** + * Get sheet state + * + * @return string Sheet state (visible, hidden, veryHidden) + */ + public function getSheetState() + { + return $this->sheetState; + } + + /** + * Set sheet state + * + * @param string $value Sheet state (visible, hidden, veryHidden) + * @return PHPExcel_Worksheet + */ + public function setSheetState($value = PHPExcel_Worksheet::SHEETSTATE_VISIBLE) + { + $this->sheetState = $value; + return $this; + } + + /** + * Get page setup + * + * @return PHPExcel_Worksheet_PageSetup + */ + public function getPageSetup() + { + return $this->pageSetup; + } + + /** + * Set page setup + * + * @param PHPExcel_Worksheet_PageSetup $pValue + * @return PHPExcel_Worksheet + */ + public function setPageSetup(PHPExcel_Worksheet_PageSetup $pValue) + { + $this->pageSetup = $pValue; + return $this; + } + + /** + * Get page margins + * + * @return PHPExcel_Worksheet_PageMargins + */ + public function getPageMargins() + { + return $this->pageMargins; + } + + /** + * Set page margins + * + * @param PHPExcel_Worksheet_PageMargins $pValue + * @return PHPExcel_Worksheet + */ + public function setPageMargins(PHPExcel_Worksheet_PageMargins $pValue) + { + $this->pageMargins = $pValue; + return $this; + } + + /** + * Get page header/footer + * + * @return PHPExcel_Worksheet_HeaderFooter + */ + public function getHeaderFooter() + { + return $this->headerFooter; + } + + /** + * Set page header/footer + * + * @param PHPExcel_Worksheet_HeaderFooter $pValue + * @return PHPExcel_Worksheet + */ + public function setHeaderFooter(PHPExcel_Worksheet_HeaderFooter $pValue) + { + $this->headerFooter = $pValue; + return $this; + } + + /** + * Get sheet view + * + * @return PHPExcel_Worksheet_SheetView + */ + public function getSheetView() + { + return $this->sheetView; + } + + /** + * Set sheet view + * + * @param PHPExcel_Worksheet_SheetView $pValue + * @return PHPExcel_Worksheet + */ + public function setSheetView(PHPExcel_Worksheet_SheetView $pValue) + { + $this->sheetView = $pValue; + return $this; + } + + /** + * Get Protection + * + * @return PHPExcel_Worksheet_Protection + */ + public function getProtection() + { + return $this->protection; + } + + /** + * Set Protection + * + * @param PHPExcel_Worksheet_Protection $pValue + * @return PHPExcel_Worksheet + */ + public function setProtection(PHPExcel_Worksheet_Protection $pValue) + { + $this->protection = $pValue; + $this->dirty = true; + + return $this; + } + + /** + * Get highest worksheet column + * + * @param string $row Return the data highest column for the specified row, + * or the highest column of any row if no row number is passed + * @return string Highest column name + */ + public function getHighestColumn($row = null) + { + if ($row == null) { + return $this->cachedHighestColumn; + } + return $this->getHighestDataColumn($row); + } + + /** + * Get highest worksheet column that contains data + * + * @param string $row Return the highest data column for the specified row, + * or the highest data column of any row if no row number is passed + * @return string Highest column name that contains data + */ + public function getHighestDataColumn($row = null) + { + return $this->cellCollection->getHighestColumn($row); + } + + /** + * Get highest worksheet row + * + * @param string $column Return the highest data row for the specified column, + * or the highest row of any column if no column letter is passed + * @return int Highest row number + */ + public function getHighestRow($column = null) + { + if ($column == null) { + return $this->cachedHighestRow; + } + return $this->getHighestDataRow($column); + } + + /** + * Get highest worksheet row that contains data + * + * @param string $column Return the highest data row for the specified column, + * or the highest data row of any column if no column letter is passed + * @return string Highest row number that contains data + */ + public function getHighestDataRow($column = null) + { + return $this->cellCollection->getHighestRow($column); + } + + /** + * Get highest worksheet column and highest row that have cell records + * + * @return array Highest column name and highest row number + */ + public function getHighestRowAndColumn() + { + return $this->cellCollection->getHighestRowAndColumn(); + } + + /** + * Set a cell value + * + * @param string $pCoordinate Coordinate of the cell + * @param mixed $pValue Value of the cell + * @param bool $returnCell Return the worksheet (false, default) or the cell (true) + * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified + */ + public function setCellValue($pCoordinate = 'A1', $pValue = null, $returnCell = false) + { + $cell = $this->getCell(strtoupper($pCoordinate))->setValue($pValue); + return ($returnCell) ? $cell : $this; + } + + /** + * Set a cell value by using numeric cell coordinates + * + * @param string $pColumn Numeric column coordinate of the cell (A = 0) + * @param string $pRow Numeric row coordinate of the cell + * @param mixed $pValue Value of the cell + * @param bool $returnCell Return the worksheet (false, default) or the cell (true) + * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified + */ + public function setCellValueByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $returnCell = false) + { + $cell = $this->getCellByColumnAndRow($pColumn, $pRow)->setValue($pValue); + return ($returnCell) ? $cell : $this; + } + + /** + * Set a cell value + * + * @param string $pCoordinate Coordinate of the cell + * @param mixed $pValue Value of the cell + * @param string $pDataType Explicit data type + * @param bool $returnCell Return the worksheet (false, default) or the cell (true) + * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified + */ + public function setCellValueExplicit($pCoordinate = 'A1', $pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING, $returnCell = false) + { + // Set value + $cell = $this->getCell(strtoupper($pCoordinate))->setValueExplicit($pValue, $pDataType); + return ($returnCell) ? $cell : $this; + } + + /** + * Set a cell value by using numeric cell coordinates + * + * @param string $pColumn Numeric column coordinate of the cell + * @param string $pRow Numeric row coordinate of the cell + * @param mixed $pValue Value of the cell + * @param string $pDataType Explicit data type + * @param bool $returnCell Return the worksheet (false, default) or the cell (true) + * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified + */ + public function setCellValueExplicitByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING, $returnCell = false) + { + $cell = $this->getCellByColumnAndRow($pColumn, $pRow)->setValueExplicit($pValue, $pDataType); + return ($returnCell) ? $cell : $this; + } + + /** + * Get cell at a specific coordinate + * + * @param string $pCoordinate Coordinate of the cell + * @param boolean $createIfNotExists Flag indicating whether a new cell should be created if it doesn't + * already exist, or a null should be returned instead + * @throws PHPExcel_Exception + * @return null|PHPExcel_Cell Cell that was found/created or null + */ + public function getCell($pCoordinate = 'A1', $createIfNotExists = true) + { + // Check cell collection + if ($this->cellCollection->isDataSet(strtoupper($pCoordinate))) { + return $this->cellCollection->getCacheData($pCoordinate); + } + + // Worksheet reference? + if (strpos($pCoordinate, '!') !== false) { + $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true); + return $this->parent->getSheetByName($worksheetReference[0])->getCell(strtoupper($worksheetReference[1]), $createIfNotExists); + } + + // Named range? + if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) && + (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $pCoordinate, $matches))) { + $namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this); + if ($namedRange !== null) { + $pCoordinate = $namedRange->getRange(); + return $namedRange->getWorksheet()->getCell($pCoordinate, $createIfNotExists); + } + } + + // Uppercase coordinate + $pCoordinate = strtoupper($pCoordinate); + + if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) { + throw new PHPExcel_Exception('Cell coordinate can not be a range of cells.'); + } elseif (strpos($pCoordinate, '$') !== false) { + throw new PHPExcel_Exception('Cell coordinate must not be absolute.'); + } + + // Create new cell object, if required + return $createIfNotExists ? $this->createNewCell($pCoordinate) : null; + } + + /** + * Get cell at a specific coordinate by using numeric cell coordinates + * + * @param string $pColumn Numeric column coordinate of the cell (starting from 0) + * @param string $pRow Numeric row coordinate of the cell + * @param boolean $createIfNotExists Flag indicating whether a new cell should be created if it doesn't + * already exist, or a null should be returned instead + * @return null|PHPExcel_Cell Cell that was found/created or null + */ + public function getCellByColumnAndRow($pColumn = 0, $pRow = 1, $createIfNotExists = true) + { + $columnLetter = PHPExcel_Cell::stringFromColumnIndex($pColumn); + $coordinate = $columnLetter . $pRow; + + if ($this->cellCollection->isDataSet($coordinate)) { + return $this->cellCollection->getCacheData($coordinate); + } + + // Create new cell object, if required + return $createIfNotExists ? $this->createNewCell($coordinate) : null; + } + + /** + * Create a new cell at the specified coordinate + * + * @param string $pCoordinate Coordinate of the cell + * @return PHPExcel_Cell Cell that was created + */ + private function createNewCell($pCoordinate) + { + $cell = $this->cellCollection->addCacheData( + $pCoordinate, + new PHPExcel_Cell(null, PHPExcel_Cell_DataType::TYPE_NULL, $this) + ); + $this->cellCollectionIsSorted = false; + + // Coordinates + $aCoordinates = PHPExcel_Cell::coordinateFromString($pCoordinate); + if (PHPExcel_Cell::columnIndexFromString($this->cachedHighestColumn) < PHPExcel_Cell::columnIndexFromString($aCoordinates[0])) { + $this->cachedHighestColumn = $aCoordinates[0]; + } + $this->cachedHighestRow = max($this->cachedHighestRow, $aCoordinates[1]); + + // Cell needs appropriate xfIndex from dimensions records + // but don't create dimension records if they don't already exist + $rowDimension = $this->getRowDimension($aCoordinates[1], false); + $columnDimension = $this->getColumnDimension($aCoordinates[0], false); + + if ($rowDimension !== null && $rowDimension->getXfIndex() > 0) { + // then there is a row dimension with explicit style, assign it to the cell + $cell->setXfIndex($rowDimension->getXfIndex()); + } elseif ($columnDimension !== null && $columnDimension->getXfIndex() > 0) { + // then there is a column dimension, assign it to the cell + $cell->setXfIndex($columnDimension->getXfIndex()); + } + + return $cell; + } + + /** + * Does the cell at a specific coordinate exist? + * + * @param string $pCoordinate Coordinate of the cell + * @throws PHPExcel_Exception + * @return boolean + */ + public function cellExists($pCoordinate = 'A1') + { + // Worksheet reference? + if (strpos($pCoordinate, '!') !== false) { + $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true); + return $this->parent->getSheetByName($worksheetReference[0])->cellExists(strtoupper($worksheetReference[1])); + } + + // Named range? + if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) && + (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $pCoordinate, $matches))) { + $namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this); + if ($namedRange !== null) { + $pCoordinate = $namedRange->getRange(); + if ($this->getHashCode() != $namedRange->getWorksheet()->getHashCode()) { + if (!$namedRange->getLocalOnly()) { + return $namedRange->getWorksheet()->cellExists($pCoordinate); + } else { + throw new PHPExcel_Exception('Named range ' . $namedRange->getName() . ' is not accessible from within sheet ' . $this->getTitle()); + } + } + } else { + return false; + } + } + + // Uppercase coordinate + $pCoordinate = strtoupper($pCoordinate); + + if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) { + throw new PHPExcel_Exception('Cell coordinate can not be a range of cells.'); + } elseif (strpos($pCoordinate, '$') !== false) { + throw new PHPExcel_Exception('Cell coordinate must not be absolute.'); + } else { + // Coordinates + $aCoordinates = PHPExcel_Cell::coordinateFromString($pCoordinate); + + // Cell exists? + return $this->cellCollection->isDataSet($pCoordinate); + } + } + + /** + * Cell at a specific coordinate by using numeric cell coordinates exists? + * + * @param string $pColumn Numeric column coordinate of the cell + * @param string $pRow Numeric row coordinate of the cell + * @return boolean + */ + public function cellExistsByColumnAndRow($pColumn = 0, $pRow = 1) + { + return $this->cellExists(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow); + } + + /** + * Get row dimension at a specific row + * + * @param int $pRow Numeric index of the row + * @return PHPExcel_Worksheet_RowDimension + */ + public function getRowDimension($pRow = 1, $create = true) + { + // Found + $found = null; + + // Get row dimension + if (!isset($this->rowDimensions[$pRow])) { + if (!$create) { + return null; + } + $this->rowDimensions[$pRow] = new PHPExcel_Worksheet_RowDimension($pRow); + + $this->cachedHighestRow = max($this->cachedHighestRow, $pRow); + } + return $this->rowDimensions[$pRow]; + } + + /** + * Get column dimension at a specific column + * + * @param string $pColumn String index of the column + * @return PHPExcel_Worksheet_ColumnDimension + */ + public function getColumnDimension($pColumn = 'A', $create = true) + { + // Uppercase coordinate + $pColumn = strtoupper($pColumn); + + // Fetch dimensions + if (!isset($this->columnDimensions[$pColumn])) { + if (!$create) { + return null; + } + $this->columnDimensions[$pColumn] = new PHPExcel_Worksheet_ColumnDimension($pColumn); + + if (PHPExcel_Cell::columnIndexFromString($this->cachedHighestColumn) < PHPExcel_Cell::columnIndexFromString($pColumn)) { + $this->cachedHighestColumn = $pColumn; + } + } + return $this->columnDimensions[$pColumn]; + } + + /** + * Get column dimension at a specific column by using numeric cell coordinates + * + * @param string $pColumn Numeric column coordinate of the cell + * @return PHPExcel_Worksheet_ColumnDimension + */ + public function getColumnDimensionByColumn($pColumn = 0) + { + return $this->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($pColumn)); + } + + /** + * Get styles + * + * @return PHPExcel_Style[] + */ + public function getStyles() + { + return $this->styles; + } + + /** + * Get default style of workbook. + * + * @deprecated + * @return PHPExcel_Style + * @throws PHPExcel_Exception + */ + public function getDefaultStyle() + { + return $this->parent->getDefaultStyle(); + } + + /** + * Set default style - should only be used by PHPExcel_IReader implementations! + * + * @deprecated + * @param PHPExcel_Style $pValue + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function setDefaultStyle(PHPExcel_Style $pValue) + { + $this->parent->getDefaultStyle()->applyFromArray(array( + 'font' => array( + 'name' => $pValue->getFont()->getName(), + 'size' => $pValue->getFont()->getSize(), + ), + )); + return $this; + } + + /** + * Get style for cell + * + * @param string $pCellCoordinate Cell coordinate (or range) to get style for + * @return PHPExcel_Style + * @throws PHPExcel_Exception + */ + public function getStyle($pCellCoordinate = 'A1') + { + // set this sheet as active + $this->parent->setActiveSheetIndex($this->parent->getIndex($this)); + + // set cell coordinate as active + $this->setSelectedCells(strtoupper($pCellCoordinate)); + + return $this->parent->getCellXfSupervisor(); + } + + /** + * Get conditional styles for a cell + * + * @param string $pCoordinate + * @return PHPExcel_Style_Conditional[] + */ + public function getConditionalStyles($pCoordinate = 'A1') + { + $pCoordinate = strtoupper($pCoordinate); + if (!isset($this->conditionalStylesCollection[$pCoordinate])) { + $this->conditionalStylesCollection[$pCoordinate] = array(); + } + return $this->conditionalStylesCollection[$pCoordinate]; + } + + /** + * Do conditional styles exist for this cell? + * + * @param string $pCoordinate + * @return boolean + */ + public function conditionalStylesExists($pCoordinate = 'A1') + { + if (isset($this->conditionalStylesCollection[strtoupper($pCoordinate)])) { + return true; + } + return false; + } + + /** + * Removes conditional styles for a cell + * + * @param string $pCoordinate + * @return PHPExcel_Worksheet + */ + public function removeConditionalStyles($pCoordinate = 'A1') + { + unset($this->conditionalStylesCollection[strtoupper($pCoordinate)]); + return $this; + } + + /** + * Get collection of conditional styles + * + * @return array + */ + public function getConditionalStylesCollection() + { + return $this->conditionalStylesCollection; + } + + /** + * Set conditional styles + * + * @param $pCoordinate string E.g. 'A1' + * @param $pValue PHPExcel_Style_Conditional[] + * @return PHPExcel_Worksheet + */ + public function setConditionalStyles($pCoordinate = 'A1', $pValue) + { + $this->conditionalStylesCollection[strtoupper($pCoordinate)] = $pValue; + return $this; + } + + /** + * Get style for cell by using numeric cell coordinates + * + * @param int $pColumn Numeric column coordinate of the cell + * @param int $pRow Numeric row coordinate of the cell + * @param int pColumn2 Numeric column coordinate of the range cell + * @param int pRow2 Numeric row coordinate of the range cell + * @return PHPExcel_Style + */ + public function getStyleByColumnAndRow($pColumn = 0, $pRow = 1, $pColumn2 = null, $pRow2 = null) + { + if (!is_null($pColumn2) && !is_null($pRow2)) { + $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; + return $this->getStyle($cellRange); + } + + return $this->getStyle(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow); + } + + /** + * Set shared cell style to a range of cells + * + * Please note that this will overwrite existing cell styles for cells in range! + * + * @deprecated + * @param PHPExcel_Style $pSharedCellStyle Cell style to share + * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function setSharedStyle(PHPExcel_Style $pSharedCellStyle = null, $pRange = '') + { + $this->duplicateStyle($pSharedCellStyle, $pRange); + return $this; + } + + /** + * Duplicate cell style to a range of cells + * + * Please note that this will overwrite existing cell styles for cells in range! + * + * @param PHPExcel_Style $pCellStyle Cell style to duplicate + * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function duplicateStyle(PHPExcel_Style $pCellStyle = null, $pRange = '') + { + // make sure we have a real style and not supervisor + $style = $pCellStyle->getIsSupervisor() ? $pCellStyle->getSharedComponent() : $pCellStyle; + + // Add the style to the workbook if necessary + $workbook = $this->parent; + if ($existingStyle = $this->parent->getCellXfByHashCode($pCellStyle->getHashCode())) { + // there is already such cell Xf in our collection + $xfIndex = $existingStyle->getIndex(); + } else { + // we don't have such a cell Xf, need to add + $workbook->addCellXf($pCellStyle); + $xfIndex = $pCellStyle->getIndex(); + } + + // Calculate range outer borders + list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange . ':' . $pRange); + + // Make sure we can loop upwards on rows and columns + if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) { + $tmp = $rangeStart; + $rangeStart = $rangeEnd; + $rangeEnd = $tmp; + } + + // Loop through cells and apply styles + for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) { + for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) { + $this->getCell(PHPExcel_Cell::stringFromColumnIndex($col - 1) . $row)->setXfIndex($xfIndex); + } + } + + return $this; + } + + /** + * Duplicate conditional style to a range of cells + * + * Please note that this will overwrite existing cell styles for cells in range! + * + * @param array of PHPExcel_Style_Conditional $pCellStyle Cell style to duplicate + * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function duplicateConditionalStyle(array $pCellStyle = null, $pRange = '') + { + foreach ($pCellStyle as $cellStyle) { + if (!($cellStyle instanceof PHPExcel_Style_Conditional)) { + throw new PHPExcel_Exception('Style is not a conditional style'); + } + } + + // Calculate range outer borders + list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange . ':' . $pRange); + + // Make sure we can loop upwards on rows and columns + if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) { + $tmp = $rangeStart; + $rangeStart = $rangeEnd; + $rangeEnd = $tmp; + } + + // Loop through cells and apply styles + for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) { + for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) { + $this->setConditionalStyles(PHPExcel_Cell::stringFromColumnIndex($col - 1) . $row, $pCellStyle); + } + } + + return $this; + } + + /** + * Duplicate cell style array to a range of cells + * + * Please note that this will overwrite existing cell styles for cells in range, + * if they are in the styles array. For example, if you decide to set a range of + * cells to font bold, only include font bold in the styles array. + * + * @deprecated + * @param array $pStyles Array containing style information + * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") + * @param boolean $pAdvanced Advanced mode for setting borders. + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function duplicateStyleArray($pStyles = null, $pRange = '', $pAdvanced = true) + { + $this->getStyle($pRange)->applyFromArray($pStyles, $pAdvanced); + return $this; + } + + /** + * Set break on a cell + * + * @param string $pCell Cell coordinate (e.g. A1) + * @param int $pBreak Break type (type of PHPExcel_Worksheet::BREAK_*) + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function setBreak($pCell = 'A1', $pBreak = PHPExcel_Worksheet::BREAK_NONE) + { + // Uppercase coordinate + $pCell = strtoupper($pCell); + + if ($pCell != '') { + if ($pBreak == PHPExcel_Worksheet::BREAK_NONE) { + if (isset($this->breaks[$pCell])) { + unset($this->breaks[$pCell]); + } + } else { + $this->breaks[$pCell] = $pBreak; + } + } else { + throw new PHPExcel_Exception('No cell coordinate specified.'); + } + + return $this; + } + + /** + * Set break on a cell by using numeric cell coordinates + * + * @param integer $pColumn Numeric column coordinate of the cell + * @param integer $pRow Numeric row coordinate of the cell + * @param integer $pBreak Break type (type of PHPExcel_Worksheet::BREAK_*) + * @return PHPExcel_Worksheet + */ + public function setBreakByColumnAndRow($pColumn = 0, $pRow = 1, $pBreak = PHPExcel_Worksheet::BREAK_NONE) + { + return $this->setBreak(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow, $pBreak); + } + + /** + * Get breaks + * + * @return array[] + */ + public function getBreaks() + { + return $this->breaks; + } + + /** + * Set merge on a cell range + * + * @param string $pRange Cell range (e.g. A1:E1) + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function mergeCells($pRange = 'A1:A1') + { + // Uppercase coordinate + $pRange = strtoupper($pRange); + + if (strpos($pRange, ':') !== false) { + $this->mergeCells[$pRange] = $pRange; + + // make sure cells are created + + // get the cells in the range + $aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($pRange); + + // create upper left cell if it does not already exist + $upperLeft = $aReferences[0]; + if (!$this->cellExists($upperLeft)) { + $this->getCell($upperLeft)->setValueExplicit(null, PHPExcel_Cell_DataType::TYPE_NULL); + } + + // Blank out the rest of the cells in the range (if they exist) + $count = count($aReferences); + for ($i = 1; $i < $count; $i++) { + if ($this->cellExists($aReferences[$i])) { + $this->getCell($aReferences[$i])->setValueExplicit(null, PHPExcel_Cell_DataType::TYPE_NULL); + } + } + } else { + throw new PHPExcel_Exception('Merge must be set on a range of cells.'); + } + + return $this; + } + + /** + * Set merge on a cell range by using numeric cell coordinates + * + * @param int $pColumn1 Numeric column coordinate of the first cell + * @param int $pRow1 Numeric row coordinate of the first cell + * @param int $pColumn2 Numeric column coordinate of the last cell + * @param int $pRow2 Numeric row coordinate of the last cell + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function mergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) + { + $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; + return $this->mergeCells($cellRange); + } + + /** + * Remove merge on a cell range + * + * @param string $pRange Cell range (e.g. A1:E1) + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function unmergeCells($pRange = 'A1:A1') + { + // Uppercase coordinate + $pRange = strtoupper($pRange); + + if (strpos($pRange, ':') !== false) { + if (isset($this->mergeCells[$pRange])) { + unset($this->mergeCells[$pRange]); + } else { + throw new PHPExcel_Exception('Cell range ' . $pRange . ' not known as merged.'); + } + } else { + throw new PHPExcel_Exception('Merge can only be removed from a range of cells.'); + } + + return $this; + } + + /** + * Remove merge on a cell range by using numeric cell coordinates + * + * @param int $pColumn1 Numeric column coordinate of the first cell + * @param int $pRow1 Numeric row coordinate of the first cell + * @param int $pColumn2 Numeric column coordinate of the last cell + * @param int $pRow2 Numeric row coordinate of the last cell + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function unmergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) + { + $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; + return $this->unmergeCells($cellRange); + } + + /** + * Get merge cells array. + * + * @return array[] + */ + public function getMergeCells() + { + return $this->mergeCells; + } + + /** + * Set merge cells array for the entire sheet. Use instead mergeCells() to merge + * a single cell range. + * + * @param array + */ + public function setMergeCells($pValue = array()) + { + $this->mergeCells = $pValue; + return $this; + } + + /** + * Set protection on a cell range + * + * @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1) + * @param string $pPassword Password to unlock the protection + * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function protectCells($pRange = 'A1', $pPassword = '', $pAlreadyHashed = false) + { + // Uppercase coordinate + $pRange = strtoupper($pRange); + + if (!$pAlreadyHashed) { + $pPassword = PHPExcel_Shared_PasswordHasher::hashPassword($pPassword); + } + $this->protectedCells[$pRange] = $pPassword; + + return $this; + } + + /** + * Set protection on a cell range by using numeric cell coordinates + * + * @param int $pColumn1 Numeric column coordinate of the first cell + * @param int $pRow1 Numeric row coordinate of the first cell + * @param int $pColumn2 Numeric column coordinate of the last cell + * @param int $pRow2 Numeric row coordinate of the last cell + * @param string $pPassword Password to unlock the protection + * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function protectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false) + { + $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; + return $this->protectCells($cellRange, $pPassword, $pAlreadyHashed); + } + + /** + * Remove protection on a cell range + * + * @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1) + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function unprotectCells($pRange = 'A1') + { + // Uppercase coordinate + $pRange = strtoupper($pRange); + + if (isset($this->protectedCells[$pRange])) { + unset($this->protectedCells[$pRange]); + } else { + throw new PHPExcel_Exception('Cell range ' . $pRange . ' not known as protected.'); + } + return $this; + } + + /** + * Remove protection on a cell range by using numeric cell coordinates + * + * @param int $pColumn1 Numeric column coordinate of the first cell + * @param int $pRow1 Numeric row coordinate of the first cell + * @param int $pColumn2 Numeric column coordinate of the last cell + * @param int $pRow2 Numeric row coordinate of the last cell + * @param string $pPassword Password to unlock the protection + * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function unprotectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false) + { + $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; + return $this->unprotectCells($cellRange, $pPassword, $pAlreadyHashed); + } + + /** + * Get protected cells + * + * @return array[] + */ + public function getProtectedCells() + { + return $this->protectedCells; + } + + /** + * Get Autofilter + * + * @return PHPExcel_Worksheet_AutoFilter + */ + public function getAutoFilter() + { + return $this->autoFilter; + } + + /** + * Set AutoFilter + * + * @param PHPExcel_Worksheet_AutoFilter|string $pValue + * A simple string containing a Cell range like 'A1:E10' is permitted for backward compatibility + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function setAutoFilter($pValue) + { + $pRange = strtoupper($pValue); + if (is_string($pValue)) { + $this->autoFilter->setRange($pValue); + } elseif (is_object($pValue) && ($pValue instanceof PHPExcel_Worksheet_AutoFilter)) { + $this->autoFilter = $pValue; + } + return $this; + } + + /** + * Set Autofilter Range by using numeric cell coordinates + * + * @param integer $pColumn1 Numeric column coordinate of the first cell + * @param integer $pRow1 Numeric row coordinate of the first cell + * @param integer $pColumn2 Numeric column coordinate of the second cell + * @param integer $pRow2 Numeric row coordinate of the second cell + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function setAutoFilterByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) + { + return $this->setAutoFilter( + PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 + . ':' . + PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2 + ); + } + + /** + * Remove autofilter + * + * @return PHPExcel_Worksheet + */ + public function removeAutoFilter() + { + $this->autoFilter->setRange(null); + return $this; + } + + /** + * Get Freeze Pane + * + * @return string + */ + public function getFreezePane() + { + return $this->freezePane; + } + + /** + * Freeze Pane + * + * @param string $pCell Cell (i.e. A2) + * Examples: + * A2 will freeze the rows above cell A2 (i.e row 1) + * B1 will freeze the columns to the left of cell B1 (i.e column A) + * B2 will freeze the rows above and to the left of cell A2 + * (i.e row 1 and column A) + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function freezePane($pCell = '') + { + // Uppercase coordinate + $pCell = strtoupper($pCell); + if (strpos($pCell, ':') === false && strpos($pCell, ',') === false) { + $this->freezePane = $pCell; + } else { + throw new PHPExcel_Exception('Freeze pane can not be set on a range of cells.'); + } + return $this; + } + + /** + * Freeze Pane by using numeric cell coordinates + * + * @param int $pColumn Numeric column coordinate of the cell + * @param int $pRow Numeric row coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function freezePaneByColumnAndRow($pColumn = 0, $pRow = 1) + { + return $this->freezePane(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow); + } + + /** + * Unfreeze Pane + * + * @return PHPExcel_Worksheet + */ + public function unfreezePane() + { + return $this->freezePane(''); + } + + /** + * Insert a new row, updating all possible related data + * + * @param int $pBefore Insert before this one + * @param int $pNumRows Number of rows to insert + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function insertNewRowBefore($pBefore = 1, $pNumRows = 1) + { + if ($pBefore >= 1) { + $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance(); + $objReferenceHelper->insertNewBefore('A' . $pBefore, 0, $pNumRows, $this); + } else { + throw new PHPExcel_Exception("Rows can only be inserted before at least row 1."); + } + return $this; + } + + /** + * Insert a new column, updating all possible related data + * + * @param int $pBefore Insert before this one + * @param int $pNumCols Number of columns to insert + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function insertNewColumnBefore($pBefore = 'A', $pNumCols = 1) + { + if (!is_numeric($pBefore)) { + $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance(); + $objReferenceHelper->insertNewBefore($pBefore . '1', $pNumCols, 0, $this); + } else { + throw new PHPExcel_Exception("Column references should not be numeric."); + } + return $this; + } + + /** + * Insert a new column, updating all possible related data + * + * @param int $pBefore Insert before this one (numeric column coordinate of the cell) + * @param int $pNumCols Number of columns to insert + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function insertNewColumnBeforeByIndex($pBefore = 0, $pNumCols = 1) + { + if ($pBefore >= 0) { + return $this->insertNewColumnBefore(PHPExcel_Cell::stringFromColumnIndex($pBefore), $pNumCols); + } else { + throw new PHPExcel_Exception("Columns can only be inserted before at least column A (0)."); + } + } + + /** + * Delete a row, updating all possible related data + * + * @param int $pRow Remove starting with this one + * @param int $pNumRows Number of rows to remove + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function removeRow($pRow = 1, $pNumRows = 1) + { + if ($pRow >= 1) { + $highestRow = $this->getHighestDataRow(); + $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance(); + $objReferenceHelper->insertNewBefore('A' . ($pRow + $pNumRows), 0, -$pNumRows, $this); + for ($r = 0; $r < $pNumRows; ++$r) { + $this->getCellCacheController()->removeRow($highestRow); + --$highestRow; + } + } else { + throw new PHPExcel_Exception("Rows to be deleted should at least start from row 1."); + } + return $this; + } + + /** + * Remove a column, updating all possible related data + * + * @param string $pColumn Remove starting with this one + * @param int $pNumCols Number of columns to remove + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function removeColumn($pColumn = 'A', $pNumCols = 1) + { + if (!is_numeric($pColumn)) { + $highestColumn = $this->getHighestDataColumn(); + $pColumn = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($pColumn) - 1 + $pNumCols); + $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance(); + $objReferenceHelper->insertNewBefore($pColumn . '1', -$pNumCols, 0, $this); + for ($c = 0; $c < $pNumCols; ++$c) { + $this->getCellCacheController()->removeColumn($highestColumn); + $highestColumn = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($highestColumn) - 2); + } + } else { + throw new PHPExcel_Exception("Column references should not be numeric."); + } + return $this; + } + + /** + * Remove a column, updating all possible related data + * + * @param int $pColumn Remove starting with this one (numeric column coordinate of the cell) + * @param int $pNumCols Number of columns to remove + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function removeColumnByIndex($pColumn = 0, $pNumCols = 1) + { + if ($pColumn >= 0) { + return $this->removeColumn(PHPExcel_Cell::stringFromColumnIndex($pColumn), $pNumCols); + } else { + throw new PHPExcel_Exception("Columns to be deleted should at least start from column 0"); + } + } + + /** + * Show gridlines? + * + * @return boolean + */ + public function getShowGridlines() + { + return $this->showGridlines; + } + + /** + * Set show gridlines + * + * @param boolean $pValue Show gridlines (true/false) + * @return PHPExcel_Worksheet + */ + public function setShowGridlines($pValue = false) + { + $this->showGridlines = $pValue; + return $this; + } + + /** + * Print gridlines? + * + * @return boolean + */ + public function getPrintGridlines() + { + return $this->printGridlines; + } + + /** + * Set print gridlines + * + * @param boolean $pValue Print gridlines (true/false) + * @return PHPExcel_Worksheet + */ + public function setPrintGridlines($pValue = false) + { + $this->printGridlines = $pValue; + return $this; + } + + /** + * Show row and column headers? + * + * @return boolean + */ + public function getShowRowColHeaders() + { + return $this->showRowColHeaders; + } + + /** + * Set show row and column headers + * + * @param boolean $pValue Show row and column headers (true/false) + * @return PHPExcel_Worksheet + */ + public function setShowRowColHeaders($pValue = false) + { + $this->showRowColHeaders = $pValue; + return $this; + } + + /** + * Show summary below? (Row/Column outlining) + * + * @return boolean + */ + public function getShowSummaryBelow() + { + return $this->showSummaryBelow; + } + + /** + * Set show summary below + * + * @param boolean $pValue Show summary below (true/false) + * @return PHPExcel_Worksheet + */ + public function setShowSummaryBelow($pValue = true) + { + $this->showSummaryBelow = $pValue; + return $this; + } + + /** + * Show summary right? (Row/Column outlining) + * + * @return boolean + */ + public function getShowSummaryRight() + { + return $this->showSummaryRight; + } + + /** + * Set show summary right + * + * @param boolean $pValue Show summary right (true/false) + * @return PHPExcel_Worksheet + */ + public function setShowSummaryRight($pValue = true) + { + $this->showSummaryRight = $pValue; + return $this; + } + + /** + * Get comments + * + * @return PHPExcel_Comment[] + */ + public function getComments() + { + return $this->comments; + } + + /** + * Set comments array for the entire sheet. + * + * @param array of PHPExcel_Comment + * @return PHPExcel_Worksheet + */ + public function setComments($pValue = array()) + { + $this->comments = $pValue; + + return $this; + } + + /** + * Get comment for cell + * + * @param string $pCellCoordinate Cell coordinate to get comment for + * @return PHPExcel_Comment + * @throws PHPExcel_Exception + */ + public function getComment($pCellCoordinate = 'A1') + { + // Uppercase coordinate + $pCellCoordinate = strtoupper($pCellCoordinate); + + if (strpos($pCellCoordinate, ':') !== false || strpos($pCellCoordinate, ',') !== false) { + throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells.'); + } elseif (strpos($pCellCoordinate, '$') !== false) { + throw new PHPExcel_Exception('Cell coordinate string must not be absolute.'); + } elseif ($pCellCoordinate == '') { + throw new PHPExcel_Exception('Cell coordinate can not be zero-length string.'); + } else { + // Check if we already have a comment for this cell. + // If not, create a new comment. + if (isset($this->comments[$pCellCoordinate])) { + return $this->comments[$pCellCoordinate]; + } else { + $newComment = new PHPExcel_Comment(); + $this->comments[$pCellCoordinate] = $newComment; + return $newComment; + } + } + } + + /** + * Get comment for cell by using numeric cell coordinates + * + * @param int $pColumn Numeric column coordinate of the cell + * @param int $pRow Numeric row coordinate of the cell + * @return PHPExcel_Comment + */ + public function getCommentByColumnAndRow($pColumn = 0, $pRow = 1) + { + return $this->getComment(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow); + } + + /** + * Get selected cell + * + * @deprecated + * @return string + */ + public function getSelectedCell() + { + return $this->getSelectedCells(); + } + + /** + * Get active cell + * + * @return string Example: 'A1' + */ + public function getActiveCell() + { + return $this->activeCell; + } + + /** + * Get selected cells + * + * @return string + */ + public function getSelectedCells() + { + return $this->selectedCells; + } + + /** + * Selected cell + * + * @param string $pCoordinate Cell (i.e. A1) + * @return PHPExcel_Worksheet + */ + public function setSelectedCell($pCoordinate = 'A1') + { + return $this->setSelectedCells($pCoordinate); + } + + /** + * Select a range of cells. + * + * @param string $pCoordinate Cell range, examples: 'A1', 'B2:G5', 'A:C', '3:6' + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function setSelectedCells($pCoordinate = 'A1') + { + // Uppercase coordinate + $pCoordinate = strtoupper($pCoordinate); + + // Convert 'A' to 'A:A' + $pCoordinate = preg_replace('/^([A-Z]+)$/', '${1}:${1}', $pCoordinate); + + // Convert '1' to '1:1' + $pCoordinate = preg_replace('/^([0-9]+)$/', '${1}:${1}', $pCoordinate); + + // Convert 'A:C' to 'A1:C1048576' + $pCoordinate = preg_replace('/^([A-Z]+):([A-Z]+)$/', '${1}1:${2}1048576', $pCoordinate); + + // Convert '1:3' to 'A1:XFD3' + $pCoordinate = preg_replace('/^([0-9]+):([0-9]+)$/', 'A${1}:XFD${2}', $pCoordinate); + + if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) { + list($first, ) = PHPExcel_Cell::splitRange($pCoordinate); + $this->activeCell = $first[0]; + } else { + $this->activeCell = $pCoordinate; + } + $this->selectedCells = $pCoordinate; + return $this; + } + + /** + * Selected cell by using numeric cell coordinates + * + * @param int $pColumn Numeric column coordinate of the cell + * @param int $pRow Numeric row coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function setSelectedCellByColumnAndRow($pColumn = 0, $pRow = 1) + { + return $this->setSelectedCells(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow); + } + + /** + * Get right-to-left + * + * @return boolean + */ + public function getRightToLeft() + { + return $this->rightToLeft; + } + + /** + * Set right-to-left + * + * @param boolean $value Right-to-left true/false + * @return PHPExcel_Worksheet + */ + public function setRightToLeft($value = false) + { + $this->rightToLeft = $value; + return $this; + } + + /** + * Fill worksheet from values in array + * + * @param array $source Source array + * @param mixed $nullValue Value in source array that stands for blank cell + * @param string $startCell Insert array starting from this cell address as the top left coordinate + * @param boolean $strictNullComparison Apply strict comparison when testing for null values in the array + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet + */ + public function fromArray($source = null, $nullValue = null, $startCell = 'A1', $strictNullComparison = false) + { + if (is_array($source)) { + // Convert a 1-D array to 2-D (for ease of looping) + if (!is_array(end($source))) { + $source = array($source); + } + + // start coordinate + list ($startColumn, $startRow) = PHPExcel_Cell::coordinateFromString($startCell); + + // Loop through $source + foreach ($source as $rowData) { + $currentColumn = $startColumn; + foreach ($rowData as $cellValue) { + if ($strictNullComparison) { + if ($cellValue !== $nullValue) { + // Set cell value + $this->getCell($currentColumn . $startRow)->setValue($cellValue); + } + } else { + if ($cellValue != $nullValue) { + // Set cell value + $this->getCell($currentColumn . $startRow)->setValue($cellValue); + } + } + ++$currentColumn; + } + ++$startRow; + } + } else { + throw new PHPExcel_Exception("Parameter \$source should be an array."); + } + return $this; + } + + /** + * Create array from a range of cells + * + * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") + * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist + * @param boolean $calculateFormulas Should formulas be calculated? + * @param boolean $formatData Should formatting be applied to cell values? + * @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero + * True - Return rows and columns indexed by their actual row and column IDs + * @return array + */ + public function rangeToArray($pRange = 'A1', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) + { + // Returnvalue + $returnValue = array(); + // Identify the range that we need to extract from the worksheet + list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange); + $minCol = PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] -1); + $minRow = $rangeStart[1]; + $maxCol = PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0] -1); + $maxRow = $rangeEnd[1]; + + $maxCol++; + // Loop through rows + $r = -1; + for ($row = $minRow; $row <= $maxRow; ++$row) { + $rRef = ($returnCellRef) ? $row : ++$r; + $c = -1; + // Loop through columns in the current row + for ($col = $minCol; $col != $maxCol; ++$col) { + $cRef = ($returnCellRef) ? $col : ++$c; + // Using getCell() will create a new cell if it doesn't already exist. We don't want that to happen + // so we test and retrieve directly against cellCollection + if ($this->cellCollection->isDataSet($col.$row)) { + // Cell exists + $cell = $this->cellCollection->getCacheData($col.$row); + if ($cell->getValue() !== null) { + if ($cell->getValue() instanceof PHPExcel_RichText) { + $returnValue[$rRef][$cRef] = $cell->getValue()->getPlainText(); + } else { + if ($calculateFormulas) { + $returnValue[$rRef][$cRef] = $cell->getCalculatedValue(); + } else { + $returnValue[$rRef][$cRef] = $cell->getValue(); + } + } + + if ($formatData) { + $style = $this->parent->getCellXfByIndex($cell->getXfIndex()); + $returnValue[$rRef][$cRef] = PHPExcel_Style_NumberFormat::toFormattedString( + $returnValue[$rRef][$cRef], + ($style && $style->getNumberFormat()) ? $style->getNumberFormat()->getFormatCode() : PHPExcel_Style_NumberFormat::FORMAT_GENERAL + ); + } + } else { + // Cell holds a NULL + $returnValue[$rRef][$cRef] = $nullValue; + } + } else { + // Cell doesn't exist + $returnValue[$rRef][$cRef] = $nullValue; + } + } + } + + // Return + return $returnValue; + } + + + /** + * Create array from a range of cells + * + * @param string $pNamedRange Name of the Named Range + * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist + * @param boolean $calculateFormulas Should formulas be calculated? + * @param boolean $formatData Should formatting be applied to cell values? + * @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero + * True - Return rows and columns indexed by their actual row and column IDs + * @return array + * @throws PHPExcel_Exception + */ + public function namedRangeToArray($pNamedRange = '', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) + { + $namedRange = PHPExcel_NamedRange::resolveRange($pNamedRange, $this); + if ($namedRange !== null) { + $pWorkSheet = $namedRange->getWorksheet(); + $pCellRange = $namedRange->getRange(); + + return $pWorkSheet->rangeToArray($pCellRange, $nullValue, $calculateFormulas, $formatData, $returnCellRef); + } + + throw new PHPExcel_Exception('Named Range '.$pNamedRange.' does not exist.'); + } + + + /** + * Create array from worksheet + * + * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist + * @param boolean $calculateFormulas Should formulas be calculated? + * @param boolean $formatData Should formatting be applied to cell values? + * @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero + * True - Return rows and columns indexed by their actual row and column IDs + * @return array + */ + public function toArray($nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) + { + // Garbage collect... + $this->garbageCollect(); + + // Identify the range that we need to extract from the worksheet + $maxCol = $this->getHighestColumn(); + $maxRow = $this->getHighestRow(); + // Return + return $this->rangeToArray('A1:'.$maxCol.$maxRow, $nullValue, $calculateFormulas, $formatData, $returnCellRef); + } + + /** + * Get row iterator + * + * @param integer $startRow The row number at which to start iterating + * @param integer $endRow The row number at which to stop iterating + * + * @return PHPExcel_Worksheet_RowIterator + */ + public function getRowIterator($startRow = 1, $endRow = null) + { + return new PHPExcel_Worksheet_RowIterator($this, $startRow, $endRow); + } + + /** + * Get column iterator + * + * @param string $startColumn The column address at which to start iterating + * @param string $endColumn The column address at which to stop iterating + * + * @return PHPExcel_Worksheet_ColumnIterator + */ + public function getColumnIterator($startColumn = 'A', $endColumn = null) + { + return new PHPExcel_Worksheet_ColumnIterator($this, $startColumn, $endColumn); + } + + /** + * Run PHPExcel garabage collector. + * + * @return PHPExcel_Worksheet + */ + public function garbageCollect() + { + // Flush cache + $this->cellCollection->getCacheData('A1'); + // Build a reference table from images +// $imageCoordinates = array(); +// $iterator = $this->getDrawingCollection()->getIterator(); +// while ($iterator->valid()) { +// $imageCoordinates[$iterator->current()->getCoordinates()] = true; +// +// $iterator->next(); +// } +// + // Lookup highest column and highest row if cells are cleaned + $colRow = $this->cellCollection->getHighestRowAndColumn(); + $highestRow = $colRow['row']; + $highestColumn = PHPExcel_Cell::columnIndexFromString($colRow['column']); + + // Loop through column dimensions + foreach ($this->columnDimensions as $dimension) { + $highestColumn = max($highestColumn, PHPExcel_Cell::columnIndexFromString($dimension->getColumnIndex())); + } + + // Loop through row dimensions + foreach ($this->rowDimensions as $dimension) { + $highestRow = max($highestRow, $dimension->getRowIndex()); + } + + // Cache values + if ($highestColumn < 0) { + $this->cachedHighestColumn = 'A'; + } else { + $this->cachedHighestColumn = PHPExcel_Cell::stringFromColumnIndex(--$highestColumn); + } + $this->cachedHighestRow = $highestRow; + + // Return + return $this; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + if ($this->dirty) { + $this->hash = md5($this->title . $this->autoFilter . ($this->protection->isProtectionEnabled() ? 't' : 'f') . __CLASS__); + $this->dirty = false; + } + return $this->hash; + } + + /** + * Extract worksheet title from range. + * + * Example: extractSheetTitle("testSheet!A1") ==> 'A1' + * Example: extractSheetTitle("'testSheet 1'!A1", true) ==> array('testSheet 1', 'A1'); + * + * @param string $pRange Range to extract title from + * @param bool $returnRange Return range? (see example) + * @return mixed + */ + public static function extractSheetTitle($pRange, $returnRange = false) + { + // Sheet title included? + if (($sep = strpos($pRange, '!')) === false) { + return ''; + } + + if ($returnRange) { + return array(trim(substr($pRange, 0, $sep), "'"), substr($pRange, $sep + 1)); + } + + return substr($pRange, $sep + 1); + } + + /** + * Get hyperlink + * + * @param string $pCellCoordinate Cell coordinate to get hyperlink for + */ + public function getHyperlink($pCellCoordinate = 'A1') + { + // return hyperlink if we already have one + if (isset($this->hyperlinkCollection[$pCellCoordinate])) { + return $this->hyperlinkCollection[$pCellCoordinate]; + } + + // else create hyperlink + $this->hyperlinkCollection[$pCellCoordinate] = new PHPExcel_Cell_Hyperlink(); + return $this->hyperlinkCollection[$pCellCoordinate]; + } + + /** + * Set hyperlnk + * + * @param string $pCellCoordinate Cell coordinate to insert hyperlink + * @param PHPExcel_Cell_Hyperlink $pHyperlink + * @return PHPExcel_Worksheet + */ + public function setHyperlink($pCellCoordinate = 'A1', PHPExcel_Cell_Hyperlink $pHyperlink = null) + { + if ($pHyperlink === null) { + unset($this->hyperlinkCollection[$pCellCoordinate]); + } else { + $this->hyperlinkCollection[$pCellCoordinate] = $pHyperlink; + } + return $this; + } + + /** + * Hyperlink at a specific coordinate exists? + * + * @param string $pCoordinate + * @return boolean + */ + public function hyperlinkExists($pCoordinate = 'A1') + { + return isset($this->hyperlinkCollection[$pCoordinate]); + } + + /** + * Get collection of hyperlinks + * + * @return PHPExcel_Cell_Hyperlink[] + */ + public function getHyperlinkCollection() + { + return $this->hyperlinkCollection; + } + + /** + * Get data validation + * + * @param string $pCellCoordinate Cell coordinate to get data validation for + */ + public function getDataValidation($pCellCoordinate = 'A1') + { + // return data validation if we already have one + if (isset($this->dataValidationCollection[$pCellCoordinate])) { + return $this->dataValidationCollection[$pCellCoordinate]; + } + + // else create data validation + $this->dataValidationCollection[$pCellCoordinate] = new PHPExcel_Cell_DataValidation(); + return $this->dataValidationCollection[$pCellCoordinate]; + } + + /** + * Set data validation + * + * @param string $pCellCoordinate Cell coordinate to insert data validation + * @param PHPExcel_Cell_DataValidation $pDataValidation + * @return PHPExcel_Worksheet + */ + public function setDataValidation($pCellCoordinate = 'A1', PHPExcel_Cell_DataValidation $pDataValidation = null) + { + if ($pDataValidation === null) { + unset($this->dataValidationCollection[$pCellCoordinate]); + } else { + $this->dataValidationCollection[$pCellCoordinate] = $pDataValidation; + } + return $this; + } + + /** + * Data validation at a specific coordinate exists? + * + * @param string $pCoordinate + * @return boolean + */ + public function dataValidationExists($pCoordinate = 'A1') + { + return isset($this->dataValidationCollection[$pCoordinate]); + } + + /** + * Get collection of data validations + * + * @return PHPExcel_Cell_DataValidation[] + */ + public function getDataValidationCollection() + { + return $this->dataValidationCollection; + } + + /** + * Accepts a range, returning it as a range that falls within the current highest row and column of the worksheet + * + * @param string $range + * @return string Adjusted range value + */ + public function shrinkRangeToFit($range) + { + $maxCol = $this->getHighestColumn(); + $maxRow = $this->getHighestRow(); + $maxCol = PHPExcel_Cell::columnIndexFromString($maxCol); + + $rangeBlocks = explode(' ', $range); + foreach ($rangeBlocks as &$rangeSet) { + $rangeBoundaries = PHPExcel_Cell::getRangeBoundaries($rangeSet); + + if (PHPExcel_Cell::columnIndexFromString($rangeBoundaries[0][0]) > $maxCol) { + $rangeBoundaries[0][0] = PHPExcel_Cell::stringFromColumnIndex($maxCol); + } + if ($rangeBoundaries[0][1] > $maxRow) { + $rangeBoundaries[0][1] = $maxRow; + } + if (PHPExcel_Cell::columnIndexFromString($rangeBoundaries[1][0]) > $maxCol) { + $rangeBoundaries[1][0] = PHPExcel_Cell::stringFromColumnIndex($maxCol); + } + if ($rangeBoundaries[1][1] > $maxRow) { + $rangeBoundaries[1][1] = $maxRow; + } + $rangeSet = $rangeBoundaries[0][0].$rangeBoundaries[0][1].':'.$rangeBoundaries[1][0].$rangeBoundaries[1][1]; + } + unset($rangeSet); + $stRange = implode(' ', $rangeBlocks); + + return $stRange; + } + + /** + * Get tab color + * + * @return PHPExcel_Style_Color + */ + public function getTabColor() + { + if ($this->tabColor === null) { + $this->tabColor = new PHPExcel_Style_Color(); + } + return $this->tabColor; + } + + /** + * Reset tab color + * + * @return PHPExcel_Worksheet + */ + public function resetTabColor() + { + $this->tabColor = null; + unset($this->tabColor); + + return $this; + } + + /** + * Tab color set? + * + * @return boolean + */ + public function isTabColorSet() + { + return ($this->tabColor !== null); + } + + /** + * Copy worksheet (!= clone!) + * + * @return PHPExcel_Worksheet + */ + public function copy() + { + $copied = clone $this; + + return $copied; + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + foreach ($this as $key => $val) { + if ($key == 'parent') { + continue; + } + + if (is_object($val) || (is_array($val))) { + if ($key == 'cellCollection') { + $newCollection = clone $this->cellCollection; + $newCollection->copyCellCollection($this); + $this->cellCollection = $newCollection; + } elseif ($key == 'drawingCollection') { + $newCollection = clone $this->drawingCollection; + $this->drawingCollection = $newCollection; + } elseif (($key == 'autoFilter') && ($this->autoFilter instanceof PHPExcel_Worksheet_AutoFilter)) { + $newAutoFilter = clone $this->autoFilter; + $this->autoFilter = $newAutoFilter; + $this->autoFilter->setParent($this); + } else { + $this->{$key} = unserialize(serialize($val)); + } + } + } + } +/** + * Define the code name of the sheet + * + * @param null|string Same rule as Title minus space not allowed (but, like Excel, change silently space to underscore) + * @return objWorksheet + * @throws PHPExcel_Exception + */ + public function setCodeName($pValue = null) + { + // Is this a 'rename' or not? + if ($this->getCodeName() == $pValue) { + return $this; + } + $pValue = str_replace(' ', '_', $pValue);//Excel does this automatically without flinching, we are doing the same + // Syntax check + // throw an exception if not valid + self::checkSheetCodeName($pValue); + + // We use the same code that setTitle to find a valid codeName else not using a space (Excel don't like) but a '_' + + if ($this->getParent()) { + // Is there already such sheet name? + if ($this->getParent()->sheetCodeNameExists($pValue)) { + // Use name, but append with lowest possible integer + + if (PHPExcel_Shared_String::CountCharacters($pValue) > 29) { + $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 29); + } + $i = 1; + while ($this->getParent()->sheetCodeNameExists($pValue . '_' . $i)) { + ++$i; + if ($i == 10) { + if (PHPExcel_Shared_String::CountCharacters($pValue) > 28) { + $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 28); + } + } elseif ($i == 100) { + if (PHPExcel_Shared_String::CountCharacters($pValue) > 27) { + $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 27); + } + } + } + + $pValue = $pValue . '_' . $i;// ok, we have a valid name + //codeName is'nt used in formula : no need to call for an update + //return $this->setTitle($altTitle, $updateFormulaCellReferences); + } + } + + $this->codeName=$pValue; + return $this; + } + /** + * Return the code name of the sheet + * + * @return null|string + */ + public function getCodeName() + { + return $this->codeName; + } + /** + * Sheet has a code name ? + * @return boolean + */ + public function hasCodeName() + { + return !(is_null($this->codeName)); + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/AutoFilter.php b/extend/PHPExcel/PHPExcel/Worksheet/AutoFilter.php new file mode 100644 index 0000000..6ec8a44 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/AutoFilter.php @@ -0,0 +1,846 @@ +<?php + +/** + * PHPExcel_Worksheet_AutoFilter + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_AutoFilter +{ + /** + * Autofilter Worksheet + * + * @var PHPExcel_Worksheet + */ + private $workSheet; + + + /** + * Autofilter Range + * + * @var string + */ + private $range = ''; + + + /** + * Autofilter Column Ruleset + * + * @var array of PHPExcel_Worksheet_AutoFilter_Column + */ + private $columns = array(); + + + /** + * Create a new PHPExcel_Worksheet_AutoFilter + * + * @param string $pRange Cell range (i.e. A1:E10) + * @param PHPExcel_Worksheet $pSheet + */ + public function __construct($pRange = '', PHPExcel_Worksheet $pSheet = null) + { + $this->range = $pRange; + $this->workSheet = $pSheet; + } + + /** + * Get AutoFilter Parent Worksheet + * + * @return PHPExcel_Worksheet + */ + public function getParent() + { + return $this->workSheet; + } + + /** + * Set AutoFilter Parent Worksheet + * + * @param PHPExcel_Worksheet $pSheet + * @return PHPExcel_Worksheet_AutoFilter + */ + public function setParent(PHPExcel_Worksheet $pSheet = null) + { + $this->workSheet = $pSheet; + + return $this; + } + + /** + * Get AutoFilter Range + * + * @return string + */ + public function getRange() + { + return $this->range; + } + + /** + * Set AutoFilter Range + * + * @param string $pRange Cell range (i.e. A1:E10) + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_AutoFilter + */ + public function setRange($pRange = '') + { + // Uppercase coordinate + $cellAddress = explode('!', strtoupper($pRange)); + if (count($cellAddress) > 1) { + list($worksheet, $pRange) = $cellAddress; + } + + if (strpos($pRange, ':') !== false) { + $this->range = $pRange; + } elseif (empty($pRange)) { + $this->range = ''; + } else { + throw new PHPExcel_Exception('Autofilter must be set on a range of cells.'); + } + + if (empty($pRange)) { + // Discard all column rules + $this->columns = array(); + } else { + // Discard any column rules that are no longer valid within this range + list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->range); + foreach ($this->columns as $key => $value) { + $colIndex = PHPExcel_Cell::columnIndexFromString($key); + if (($rangeStart[0] > $colIndex) || ($rangeEnd[0] < $colIndex)) { + unset($this->columns[$key]); + } + } + } + + return $this; + } + + /** + * Get all AutoFilter Columns + * + * @throws PHPExcel_Exception + * @return array of PHPExcel_Worksheet_AutoFilter_Column + */ + public function getColumns() + { + return $this->columns; + } + + /** + * Validate that the specified column is in the AutoFilter range + * + * @param string $column Column name (e.g. A) + * @throws PHPExcel_Exception + * @return integer The column offset within the autofilter range + */ + public function testColumnInRange($column) + { + if (empty($this->range)) { + throw new PHPExcel_Exception("No autofilter range is defined."); + } + + $columnIndex = PHPExcel_Cell::columnIndexFromString($column); + list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->range); + if (($rangeStart[0] > $columnIndex) || ($rangeEnd[0] < $columnIndex)) { + throw new PHPExcel_Exception("Column is outside of current autofilter range."); + } + + return $columnIndex - $rangeStart[0]; + } + + /** + * Get a specified AutoFilter Column Offset within the defined AutoFilter range + * + * @param string $pColumn Column name (e.g. A) + * @throws PHPExcel_Exception + * @return integer The offset of the specified column within the autofilter range + */ + public function getColumnOffset($pColumn) + { + return $this->testColumnInRange($pColumn); + } + + /** + * Get a specified AutoFilter Column + * + * @param string $pColumn Column name (e.g. A) + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_AutoFilter_Column + */ + public function getColumn($pColumn) + { + $this->testColumnInRange($pColumn); + + if (!isset($this->columns[$pColumn])) { + $this->columns[$pColumn] = new PHPExcel_Worksheet_AutoFilter_Column($pColumn, $this); + } + + return $this->columns[$pColumn]; + } + + /** + * Get a specified AutoFilter Column by it's offset + * + * @param integer $pColumnOffset Column offset within range (starting from 0) + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_AutoFilter_Column + */ + public function getColumnByOffset($pColumnOffset = 0) + { + list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->range); + $pColumn = PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] + $pColumnOffset - 1); + + return $this->getColumn($pColumn); + } + + /** + * Set AutoFilter + * + * @param PHPExcel_Worksheet_AutoFilter_Column|string $pColumn + * A simple string containing a Column ID like 'A' is permitted + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_AutoFilter + */ + public function setColumn($pColumn) + { + if ((is_string($pColumn)) && (!empty($pColumn))) { + $column = $pColumn; + } elseif (is_object($pColumn) && ($pColumn instanceof PHPExcel_Worksheet_AutoFilter_Column)) { + $column = $pColumn->getColumnIndex(); + } else { + throw new PHPExcel_Exception("Column is not within the autofilter range."); + } + $this->testColumnInRange($column); + + if (is_string($pColumn)) { + $this->columns[$pColumn] = new PHPExcel_Worksheet_AutoFilter_Column($pColumn, $this); + } elseif (is_object($pColumn) && ($pColumn instanceof PHPExcel_Worksheet_AutoFilter_Column)) { + $pColumn->setParent($this); + $this->columns[$column] = $pColumn; + } + ksort($this->columns); + + return $this; + } + + /** + * Clear a specified AutoFilter Column + * + * @param string $pColumn Column name (e.g. A) + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_AutoFilter + */ + public function clearColumn($pColumn) + { + $this->testColumnInRange($pColumn); + + if (isset($this->columns[$pColumn])) { + unset($this->columns[$pColumn]); + } + + return $this; + } + + /** + * Shift an AutoFilter Column Rule to a different column + * + * Note: This method bypasses validation of the destination column to ensure it is within this AutoFilter range. + * Nor does it verify whether any column rule already exists at $toColumn, but will simply overrideany existing value. + * Use with caution. + * + * @param string $fromColumn Column name (e.g. A) + * @param string $toColumn Column name (e.g. B) + * @return PHPExcel_Worksheet_AutoFilter + */ + public function shiftColumn($fromColumn = null, $toColumn = null) + { + $fromColumn = strtoupper($fromColumn); + $toColumn = strtoupper($toColumn); + + if (($fromColumn !== null) && (isset($this->columns[$fromColumn])) && ($toColumn !== null)) { + $this->columns[$fromColumn]->setParent(); + $this->columns[$fromColumn]->setColumnIndex($toColumn); + $this->columns[$toColumn] = $this->columns[$fromColumn]; + $this->columns[$toColumn]->setParent($this); + unset($this->columns[$fromColumn]); + + ksort($this->columns); + } + + return $this; + } + + + /** + * Test if cell value is in the defined set of values + * + * @param mixed $cellValue + * @param mixed[] $dataSet + * @return boolean + */ + private static function filterTestInSimpleDataSet($cellValue, $dataSet) + { + $dataSetValues = $dataSet['filterValues']; + $blanks = $dataSet['blanks']; + if (($cellValue == '') || ($cellValue === null)) { + return $blanks; + } + return in_array($cellValue, $dataSetValues); + } + + /** + * Test if cell value is in the defined set of Excel date values + * + * @param mixed $cellValue + * @param mixed[] $dataSet + * @return boolean + */ + private static function filterTestInDateGroupSet($cellValue, $dataSet) + { + $dateSet = $dataSet['filterValues']; + $blanks = $dataSet['blanks']; + if (($cellValue == '') || ($cellValue === null)) { + return $blanks; + } + + if (is_numeric($cellValue)) { + $dateValue = PHPExcel_Shared_Date::ExcelToPHP($cellValue); + if ($cellValue < 1) { + // Just the time part + $dtVal = date('His', $dateValue); + $dateSet = $dateSet['time']; + } elseif ($cellValue == floor($cellValue)) { + // Just the date part + $dtVal = date('Ymd', $dateValue); + $dateSet = $dateSet['date']; + } else { + // date and time parts + $dtVal = date('YmdHis', $dateValue); + $dateSet = $dateSet['dateTime']; + } + foreach ($dateSet as $dateValue) { + // Use of substr to extract value at the appropriate group level + if (substr($dtVal, 0, strlen($dateValue)) == $dateValue) { + return true; + } + } + } + return false; + } + + /** + * Test if cell value is within a set of values defined by a ruleset + * + * @param mixed $cellValue + * @param mixed[] $ruleSet + * @return boolean + */ + private static function filterTestInCustomDataSet($cellValue, $ruleSet) + { + $dataSet = $ruleSet['filterRules']; + $join = $ruleSet['join']; + $customRuleForBlanks = isset($ruleSet['customRuleForBlanks']) ? $ruleSet['customRuleForBlanks'] : false; + + if (!$customRuleForBlanks) { + // Blank cells are always ignored, so return a FALSE + if (($cellValue == '') || ($cellValue === null)) { + return false; + } + } + $returnVal = ($join == PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND); + foreach ($dataSet as $rule) { + if (is_numeric($rule['value'])) { + // Numeric values are tested using the appropriate operator + switch ($rule['operator']) { + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL: + $retVal = ($cellValue == $rule['value']); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_NOTEQUAL: + $retVal = ($cellValue != $rule['value']); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHAN: + $retVal = ($cellValue > $rule['value']); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL: + $retVal = ($cellValue >= $rule['value']); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN: + $retVal = ($cellValue < $rule['value']); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL: + $retVal = ($cellValue <= $rule['value']); + break; + } + } elseif ($rule['value'] == '') { + switch ($rule['operator']) { + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL: + $retVal = (($cellValue == '') || ($cellValue === null)); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_NOTEQUAL: + $retVal = (($cellValue != '') && ($cellValue !== null)); + break; + default: + $retVal = true; + break; + } + } else { + // String values are always tested for equality, factoring in for wildcards (hence a regexp test) + $retVal = preg_match('/^'.$rule['value'].'$/i', $cellValue); + } + // If there are multiple conditions, then we need to test both using the appropriate join operator + switch ($join) { + case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_OR: + $returnVal = $returnVal || $retVal; + // Break as soon as we have a TRUE match for OR joins, + // to avoid unnecessary additional code execution + if ($returnVal) { + return $returnVal; + } + break; + case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND: + $returnVal = $returnVal && $retVal; + break; + } + } + + return $returnVal; + } + + /** + * Test if cell date value is matches a set of values defined by a set of months + * + * @param mixed $cellValue + * @param mixed[] $monthSet + * @return boolean + */ + private static function filterTestInPeriodDateSet($cellValue, $monthSet) + { + // Blank cells are always ignored, so return a FALSE + if (($cellValue == '') || ($cellValue === null)) { + return false; + } + + if (is_numeric($cellValue)) { + $dateValue = date('m', PHPExcel_Shared_Date::ExcelToPHP($cellValue)); + if (in_array($dateValue, $monthSet)) { + return true; + } + } + + return false; + } + + /** + * Search/Replace arrays to convert Excel wildcard syntax to a regexp syntax for preg_matching + * + * @var array + */ + private static $fromReplace = array('\*', '\?', '~~', '~.*', '~.?'); + private static $toReplace = array('.*', '.', '~', '\*', '\?'); + + + /** + * Convert a dynamic rule daterange to a custom filter range expression for ease of calculation + * + * @param string $dynamicRuleType + * @param PHPExcel_Worksheet_AutoFilter_Column &$filterColumn + * @return mixed[] + */ + private function dynamicFilterDateRange($dynamicRuleType, &$filterColumn) + { + $rDateType = PHPExcel_Calculation_Functions::getReturnDateType(); + PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC); + $val = $maxVal = null; + + $ruleValues = array(); + $baseDate = PHPExcel_Calculation_DateTime::DATENOW(); + // Calculate start/end dates for the required date range based on current date + switch ($dynamicRuleType) { + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK: + $baseDate = strtotime('-7 days', $baseDate); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK: + $baseDate = strtotime('-7 days', $baseDate); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH: + $baseDate = strtotime('-1 month', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate))); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH: + $baseDate = strtotime('+1 month', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate))); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER: + $baseDate = strtotime('-3 month', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate))); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER: + $baseDate = strtotime('+3 month', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate))); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR: + $baseDate = strtotime('-1 year', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate))); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR: + $baseDate = strtotime('+1 year', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate))); + break; + } + + switch ($dynamicRuleType) { + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_TODAY: + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY: + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW: + $maxVal = (int) PHPExcel_Shared_Date::PHPtoExcel(strtotime('+1 day', $baseDate)); + $val = (int) PHPExcel_Shared_Date::PHPToExcel($baseDate); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE: + $maxVal = (int) PHPExcel_Shared_Date::PHPtoExcel(strtotime('+1 day', $baseDate)); + $val = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1, date('Y', $baseDate))); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISYEAR: + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR: + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR: + $maxVal = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0, 0, 0, 31, 12, date('Y', $baseDate))); + ++$maxVal; + $val = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1, date('Y', $baseDate))); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISQUARTER: + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER: + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER: + $thisMonth = date('m', $baseDate); + $thisQuarter = floor(--$thisMonth / 3); + $maxVal = (int) PHPExcel_Shared_Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), (1+$thisQuarter)*3, date('Y', $baseDate))); + ++$maxVal; + $val = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1+$thisQuarter*3, date('Y', $baseDate))); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISMONTH: + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH: + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH: + $maxVal = (int) PHPExcel_Shared_Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), date('m', $baseDate), date('Y', $baseDate))); + ++$maxVal; + $val = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate))); + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISWEEK: + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK: + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK: + $dayOfWeek = date('w', $baseDate); + $val = (int) PHPExcel_Shared_Date::PHPToExcel($baseDate) - $dayOfWeek; + $maxVal = $val + 7; + break; + } + + switch ($dynamicRuleType) { + // Adjust Today dates for Yesterday and Tomorrow + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY: + --$maxVal; + --$val; + break; + case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW: + ++$maxVal; + ++$val; + break; + } + + // Set the filter column rule attributes ready for writing + $filterColumn->setAttributes(array('val' => $val, 'maxVal' => $maxVal)); + + // Set the rules for identifying rows for hide/show + $ruleValues[] = array('operator' => PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL, 'value' => $val); + $ruleValues[] = array('operator' => PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN, 'value' => $maxVal); + PHPExcel_Calculation_Functions::setReturnDateType($rDateType); + + return array('method' => 'filterTestInCustomDataSet', 'arguments' => array('filterRules' => $ruleValues, 'join' => PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND)); + } + + private function calculateTopTenValue($columnID, $startRow, $endRow, $ruleType, $ruleValue) + { + $range = $columnID.$startRow.':'.$columnID.$endRow; + $dataValues = PHPExcel_Calculation_Functions::flattenArray($this->workSheet->rangeToArray($range, null, true, false)); + + $dataValues = array_filter($dataValues); + if ($ruleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) { + rsort($dataValues); + } else { + sort($dataValues); + } + + return array_pop(array_slice($dataValues, 0, $ruleValue)); + } + + /** + * Apply the AutoFilter rules to the AutoFilter Range + * + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_AutoFilter + */ + public function showHideRows() + { + list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->range); + + // The heading row should always be visible +// echo 'AutoFilter Heading Row ', $rangeStart[1],' is always SHOWN',PHP_EOL; + $this->workSheet->getRowDimension($rangeStart[1])->setVisible(true); + + $columnFilterTests = array(); + foreach ($this->columns as $columnID => $filterColumn) { + $rules = $filterColumn->getRules(); + switch ($filterColumn->getFilterType()) { + case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER: + $ruleValues = array(); + // Build a list of the filter value selections + foreach ($rules as $rule) { + $ruleType = $rule->getRuleType(); + $ruleValues[] = $rule->getValue(); + } + // Test if we want to include blanks in our filter criteria + $blanks = false; + $ruleDataSet = array_filter($ruleValues); + if (count($ruleValues) != count($ruleDataSet)) { + $blanks = true; + } + if ($ruleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER) { + // Filter on absolute values + $columnFilterTests[$columnID] = array( + 'method' => 'filterTestInSimpleDataSet', + 'arguments' => array('filterValues' => $ruleDataSet, 'blanks' => $blanks) + ); + } else { + // Filter on date group values + $arguments = array( + 'date' => array(), + 'time' => array(), + 'dateTime' => array(), + ); + foreach ($ruleDataSet as $ruleValue) { + $date = $time = ''; + if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR])) && + ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR] !== '')) { + $date .= sprintf('%04d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR]); + } + if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH])) && + ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH] != '')) { + $date .= sprintf('%02d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH]); + } + if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY])) && + ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY] !== '')) { + $date .= sprintf('%02d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY]); + } + if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR])) && + ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR] !== '')) { + $time .= sprintf('%02d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR]); + } + if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE])) && + ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE] !== '')) { + $time .= sprintf('%02d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE]); + } + if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND])) && + ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND] !== '')) { + $time .= sprintf('%02d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND]); + } + $dateTime = $date . $time; + $arguments['date'][] = $date; + $arguments['time'][] = $time; + $arguments['dateTime'][] = $dateTime; + } + // Remove empty elements + $arguments['date'] = array_filter($arguments['date']); + $arguments['time'] = array_filter($arguments['time']); + $arguments['dateTime'] = array_filter($arguments['dateTime']); + $columnFilterTests[$columnID] = array( + 'method' => 'filterTestInDateGroupSet', + 'arguments' => array('filterValues' => $arguments, 'blanks' => $blanks) + ); + } + break; + case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER: + $customRuleForBlanks = false; + $ruleValues = array(); + // Build a list of the filter value selections + foreach ($rules as $rule) { + $ruleType = $rule->getRuleType(); + $ruleValue = $rule->getValue(); + if (!is_numeric($ruleValue)) { + // Convert to a regexp allowing for regexp reserved characters, wildcards and escaped wildcards + $ruleValue = preg_quote($ruleValue); + $ruleValue = str_replace(self::$fromReplace, self::$toReplace, $ruleValue); + if (trim($ruleValue) == '') { + $customRuleForBlanks = true; + $ruleValue = trim($ruleValue); + } + } + $ruleValues[] = array('operator' => $rule->getOperator(), 'value' => $ruleValue); + } + $join = $filterColumn->getJoin(); + $columnFilterTests[$columnID] = array( + 'method' => 'filterTestInCustomDataSet', + 'arguments' => array('filterRules' => $ruleValues, 'join' => $join, 'customRuleForBlanks' => $customRuleForBlanks) + ); + break; + case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER: + $ruleValues = array(); + foreach ($rules as $rule) { + // We should only ever have one Dynamic Filter Rule anyway + $dynamicRuleType = $rule->getGrouping(); + if (($dynamicRuleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE) || + ($dynamicRuleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_BELOWAVERAGE)) { + // Number (Average) based + // Calculate the average + $averageFormula = '=AVERAGE('.$columnID.($rangeStart[1]+1).':'.$columnID.$rangeEnd[1].')'; + $average = PHPExcel_Calculation::getInstance()->calculateFormula($averageFormula, null, $this->workSheet->getCell('A1')); + // Set above/below rule based on greaterThan or LessTan + $operator = ($dynamicRuleType === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE) + ? PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHAN + : PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN; + $ruleValues[] = array('operator' => $operator, + 'value' => $average + ); + $columnFilterTests[$columnID] = array( + 'method' => 'filterTestInCustomDataSet', + 'arguments' => array('filterRules' => $ruleValues, 'join' => PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_OR) + ); + } else { + // Date based + if ($dynamicRuleType{0} == 'M' || $dynamicRuleType{0} == 'Q') { + // Month or Quarter + sscanf($dynamicRuleType, '%[A-Z]%d', $periodType, $period); + if ($periodType == 'M') { + $ruleValues = array($period); + } else { + --$period; + $periodEnd = (1+$period)*3; + $periodStart = 1+$period*3; + $ruleValues = range($periodStart, $periodEnd); + } + $columnFilterTests[$columnID] = array( + 'method' => 'filterTestInPeriodDateSet', + 'arguments' => $ruleValues + ); + $filterColumn->setAttributes(array()); + } else { + // Date Range + $columnFilterTests[$columnID] = $this->dynamicFilterDateRange($dynamicRuleType, $filterColumn); + break; + } + } + } + break; + case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER: + $ruleValues = array(); + $dataRowCount = $rangeEnd[1] - $rangeStart[1]; + foreach ($rules as $rule) { + // We should only ever have one Dynamic Filter Rule anyway + $toptenRuleType = $rule->getGrouping(); + $ruleValue = $rule->getValue(); + $ruleOperator = $rule->getOperator(); + } + if ($ruleOperator === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) { + $ruleValue = floor($ruleValue * ($dataRowCount / 100)); + } + if ($ruleValue < 1) { + $ruleValue = 1; + } + if ($ruleValue > 500) { + $ruleValue = 500; + } + + $maxVal = $this->calculateTopTenValue($columnID, $rangeStart[1]+1, $rangeEnd[1], $toptenRuleType, $ruleValue); + + $operator = ($toptenRuleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) + ? PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL + : PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL; + $ruleValues[] = array('operator' => $operator, 'value' => $maxVal); + $columnFilterTests[$columnID] = array( + 'method' => 'filterTestInCustomDataSet', + 'arguments' => array('filterRules' => $ruleValues, 'join' => PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_OR) + ); + $filterColumn->setAttributes(array('maxVal' => $maxVal)); + break; + } + } + +// echo 'Column Filter Test CRITERIA',PHP_EOL; +// var_dump($columnFilterTests); +// + // Execute the column tests for each row in the autoFilter range to determine show/hide, + for ($row = $rangeStart[1]+1; $row <= $rangeEnd[1]; ++$row) { +// echo 'Testing Row = ', $row,PHP_EOL; + $result = true; + foreach ($columnFilterTests as $columnID => $columnFilterTest) { +// echo 'Testing cell ', $columnID.$row,PHP_EOL; + $cellValue = $this->workSheet->getCell($columnID.$row)->getCalculatedValue(); +// echo 'Value is ', $cellValue,PHP_EOL; + // Execute the filter test + $result = $result && + call_user_func_array( + array('PHPExcel_Worksheet_AutoFilter', $columnFilterTest['method']), + array($cellValue, $columnFilterTest['arguments']) + ); +// echo (($result) ? 'VALID' : 'INVALID'),PHP_EOL; + // If filter test has resulted in FALSE, exit the loop straightaway rather than running any more tests + if (!$result) { + break; + } + } + // Set show/hide for the row based on the result of the autoFilter result +// echo (($result) ? 'SHOW' : 'HIDE'),PHP_EOL; + $this->workSheet->getRowDimension($row)->setVisible($result); + } + + return $this; + } + + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + if ($key == 'workSheet') { + // Detach from worksheet + $this->{$key} = null; + } else { + $this->{$key} = clone $value; + } + } elseif ((is_array($value)) && ($key == 'columns')) { + // The columns array of PHPExcel_Worksheet_AutoFilter objects + $this->{$key} = array(); + foreach ($value as $k => $v) { + $this->{$key}[$k] = clone $v; + // attach the new cloned Column to this new cloned Autofilter object + $this->{$key}[$k]->setParent($this); + } + } else { + $this->{$key} = $value; + } + } + } + + /** + * toString method replicates previous behavior by returning the range if object is + * referenced as a property of its parent. + */ + public function __toString() + { + return (string) $this->range; + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/AutoFilter/Column.php b/extend/PHPExcel/PHPExcel/Worksheet/AutoFilter/Column.php new file mode 100644 index 0000000..d64fd81 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/AutoFilter/Column.php @@ -0,0 +1,405 @@ +<?php + +/** + * PHPExcel_Worksheet_AutoFilter_Column + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_AutoFilter_Column +{ + const AUTOFILTER_FILTERTYPE_FILTER = 'filters'; + const AUTOFILTER_FILTERTYPE_CUSTOMFILTER = 'customFilters'; + // Supports no more than 2 rules, with an And/Or join criteria + // if more than 1 rule is defined + const AUTOFILTER_FILTERTYPE_DYNAMICFILTER = 'dynamicFilter'; + // Even though the filter rule is constant, the filtered data can vary + // e.g. filtered by date = TODAY + const AUTOFILTER_FILTERTYPE_TOPTENFILTER = 'top10'; + + /** + * Types of autofilter rules + * + * @var string[] + */ + private static $filterTypes = array( + // Currently we're not handling + // colorFilter + // extLst + // iconFilter + self::AUTOFILTER_FILTERTYPE_FILTER, + self::AUTOFILTER_FILTERTYPE_CUSTOMFILTER, + self::AUTOFILTER_FILTERTYPE_DYNAMICFILTER, + self::AUTOFILTER_FILTERTYPE_TOPTENFILTER, + ); + + /* Multiple Rule Connections */ + const AUTOFILTER_COLUMN_JOIN_AND = 'and'; + const AUTOFILTER_COLUMN_JOIN_OR = 'or'; + + /** + * Join options for autofilter rules + * + * @var string[] + */ + private static $ruleJoins = array( + self::AUTOFILTER_COLUMN_JOIN_AND, + self::AUTOFILTER_COLUMN_JOIN_OR, + ); + + /** + * Autofilter + * + * @var PHPExcel_Worksheet_AutoFilter + */ + private $parent; + + + /** + * Autofilter Column Index + * + * @var string + */ + private $columnIndex = ''; + + + /** + * Autofilter Column Filter Type + * + * @var string + */ + private $filterType = self::AUTOFILTER_FILTERTYPE_FILTER; + + + /** + * Autofilter Multiple Rules And/Or + * + * @var string + */ + private $join = self::AUTOFILTER_COLUMN_JOIN_OR; + + + /** + * Autofilter Column Rules + * + * @var array of PHPExcel_Worksheet_AutoFilter_Column_Rule + */ + private $ruleset = array(); + + + /** + * Autofilter Column Dynamic Attributes + * + * @var array of mixed + */ + private $attributes = array(); + + + /** + * Create a new PHPExcel_Worksheet_AutoFilter_Column + * + * @param string $pColumn Column (e.g. A) + * @param PHPExcel_Worksheet_AutoFilter $pParent Autofilter for this column + */ + public function __construct($pColumn, PHPExcel_Worksheet_AutoFilter $pParent = null) + { + $this->columnIndex = $pColumn; + $this->parent = $pParent; + } + + /** + * Get AutoFilter Column Index + * + * @return string + */ + public function getColumnIndex() + { + return $this->columnIndex; + } + + /** + * Set AutoFilter Column Index + * + * @param string $pColumn Column (e.g. A) + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_AutoFilter_Column + */ + public function setColumnIndex($pColumn) + { + // Uppercase coordinate + $pColumn = strtoupper($pColumn); + if ($this->parent !== null) { + $this->parent->testColumnInRange($pColumn); + } + + $this->columnIndex = $pColumn; + + return $this; + } + + /** + * Get this Column's AutoFilter Parent + * + * @return PHPExcel_Worksheet_AutoFilter + */ + public function getParent() + { + return $this->parent; + } + + /** + * Set this Column's AutoFilter Parent + * + * @param PHPExcel_Worksheet_AutoFilter + * @return PHPExcel_Worksheet_AutoFilter_Column + */ + public function setParent(PHPExcel_Worksheet_AutoFilter $pParent = null) + { + $this->parent = $pParent; + + return $this; + } + + /** + * Get AutoFilter Type + * + * @return string + */ + public function getFilterType() + { + return $this->filterType; + } + + /** + * Set AutoFilter Type + * + * @param string $pFilterType + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_AutoFilter_Column + */ + public function setFilterType($pFilterType = self::AUTOFILTER_FILTERTYPE_FILTER) + { + if (!in_array($pFilterType, self::$filterTypes)) { + throw new PHPExcel_Exception('Invalid filter type for column AutoFilter.'); + } + + $this->filterType = $pFilterType; + + return $this; + } + + /** + * Get AutoFilter Multiple Rules And/Or Join + * + * @return string + */ + public function getJoin() + { + return $this->join; + } + + /** + * Set AutoFilter Multiple Rules And/Or + * + * @param string $pJoin And/Or + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_AutoFilter_Column + */ + public function setJoin($pJoin = self::AUTOFILTER_COLUMN_JOIN_OR) + { + // Lowercase And/Or + $pJoin = strtolower($pJoin); + if (!in_array($pJoin, self::$ruleJoins)) { + throw new PHPExcel_Exception('Invalid rule connection for column AutoFilter.'); + } + + $this->join = $pJoin; + + return $this; + } + + /** + * Set AutoFilter Attributes + * + * @param string[] $pAttributes + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_AutoFilter_Column + */ + public function setAttributes($pAttributes = array()) + { + $this->attributes = $pAttributes; + + return $this; + } + + /** + * Set An AutoFilter Attribute + * + * @param string $pName Attribute Name + * @param string $pValue Attribute Value + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_AutoFilter_Column + */ + public function setAttribute($pName, $pValue) + { + $this->attributes[$pName] = $pValue; + + return $this; + } + + /** + * Get AutoFilter Column Attributes + * + * @return string + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Get specific AutoFilter Column Attribute + * + * @param string $pName Attribute Name + * @return string + */ + public function getAttribute($pName) + { + if (isset($this->attributes[$pName])) { + return $this->attributes[$pName]; + } + return null; + } + + /** + * Get all AutoFilter Column Rules + * + * @throws PHPExcel_Exception + * @return array of PHPExcel_Worksheet_AutoFilter_Column_Rule + */ + public function getRules() + { + return $this->ruleset; + } + + /** + * Get a specified AutoFilter Column Rule + * + * @param integer $pIndex Rule index in the ruleset array + * @return PHPExcel_Worksheet_AutoFilter_Column_Rule + */ + public function getRule($pIndex) + { + if (!isset($this->ruleset[$pIndex])) { + $this->ruleset[$pIndex] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this); + } + return $this->ruleset[$pIndex]; + } + + /** + * Create a new AutoFilter Column Rule in the ruleset + * + * @return PHPExcel_Worksheet_AutoFilter_Column_Rule + */ + public function createRule() + { + $this->ruleset[] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this); + + return end($this->ruleset); + } + + /** + * Add a new AutoFilter Column Rule to the ruleset + * + * @param PHPExcel_Worksheet_AutoFilter_Column_Rule $pRule + * @param boolean $returnRule Flag indicating whether the rule object or the column object should be returned + * @return PHPExcel_Worksheet_AutoFilter_Column|PHPExcel_Worksheet_AutoFilter_Column_Rule + */ + public function addRule(PHPExcel_Worksheet_AutoFilter_Column_Rule $pRule, $returnRule = true) + { + $pRule->setParent($this); + $this->ruleset[] = $pRule; + + return ($returnRule) ? $pRule : $this; + } + + /** + * Delete a specified AutoFilter Column Rule + * If the number of rules is reduced to 1, then we reset And/Or logic to Or + * + * @param integer $pIndex Rule index in the ruleset array + * @return PHPExcel_Worksheet_AutoFilter_Column + */ + public function deleteRule($pIndex) + { + if (isset($this->ruleset[$pIndex])) { + unset($this->ruleset[$pIndex]); + // If we've just deleted down to a single rule, then reset And/Or joining to Or + if (count($this->ruleset) <= 1) { + $this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR); + } + } + + return $this; + } + + /** + * Delete all AutoFilter Column Rules + * + * @return PHPExcel_Worksheet_AutoFilter_Column + */ + public function clearRules() + { + $this->ruleset = array(); + $this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR); + + return $this; + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + if ($key == 'parent') { + // Detach from autofilter parent + $this->$key = null; + } else { + $this->$key = clone $value; + } + } elseif ((is_array($value)) && ($key == 'ruleset')) { + // The columns array of PHPExcel_Worksheet_AutoFilter objects + $this->$key = array(); + foreach ($value as $k => $v) { + $this->$key[$k] = clone $v; + // attach the new cloned Rule to this new cloned Autofilter Cloned object + $this->$key[$k]->setParent($this); + } + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/AutoFilter/Column/Rule.php b/extend/PHPExcel/PHPExcel/Worksheet/AutoFilter/Column/Rule.php new file mode 100644 index 0000000..39ad18b --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/AutoFilter/Column/Rule.php @@ -0,0 +1,468 @@ +<?php + +/** + * PHPExcel_Worksheet_AutoFilter_Column_Rule + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_AutoFilter_Column_Rule +{ + const AUTOFILTER_RULETYPE_FILTER = 'filter'; + const AUTOFILTER_RULETYPE_DATEGROUP = 'dateGroupItem'; + const AUTOFILTER_RULETYPE_CUSTOMFILTER = 'customFilter'; + const AUTOFILTER_RULETYPE_DYNAMICFILTER = 'dynamicFilter'; + const AUTOFILTER_RULETYPE_TOPTENFILTER = 'top10Filter'; + + private static $ruleTypes = array( + // Currently we're not handling + // colorFilter + // extLst + // iconFilter + self::AUTOFILTER_RULETYPE_FILTER, + self::AUTOFILTER_RULETYPE_DATEGROUP, + self::AUTOFILTER_RULETYPE_CUSTOMFILTER, + self::AUTOFILTER_RULETYPE_DYNAMICFILTER, + self::AUTOFILTER_RULETYPE_TOPTENFILTER, + ); + + const AUTOFILTER_RULETYPE_DATEGROUP_YEAR = 'year'; + const AUTOFILTER_RULETYPE_DATEGROUP_MONTH = 'month'; + const AUTOFILTER_RULETYPE_DATEGROUP_DAY = 'day'; + const AUTOFILTER_RULETYPE_DATEGROUP_HOUR = 'hour'; + const AUTOFILTER_RULETYPE_DATEGROUP_MINUTE = 'minute'; + const AUTOFILTER_RULETYPE_DATEGROUP_SECOND = 'second'; + + private static $dateTimeGroups = array( + self::AUTOFILTER_RULETYPE_DATEGROUP_YEAR, + self::AUTOFILTER_RULETYPE_DATEGROUP_MONTH, + self::AUTOFILTER_RULETYPE_DATEGROUP_DAY, + self::AUTOFILTER_RULETYPE_DATEGROUP_HOUR, + self::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE, + self::AUTOFILTER_RULETYPE_DATEGROUP_SECOND, + ); + + const AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY = 'yesterday'; + const AUTOFILTER_RULETYPE_DYNAMIC_TODAY = 'today'; + const AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW = 'tomorrow'; + const AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE = 'yearToDate'; + const AUTOFILTER_RULETYPE_DYNAMIC_THISYEAR = 'thisYear'; + const AUTOFILTER_RULETYPE_DYNAMIC_THISQUARTER = 'thisQuarter'; + const AUTOFILTER_RULETYPE_DYNAMIC_THISMONTH = 'thisMonth'; + const AUTOFILTER_RULETYPE_DYNAMIC_THISWEEK = 'thisWeek'; + const AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR = 'lastYear'; + const AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER = 'lastQuarter'; + const AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH = 'lastMonth'; + const AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK = 'lastWeek'; + const AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR = 'nextYear'; + const AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER = 'nextQuarter'; + const AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH = 'nextMonth'; + const AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK = 'nextWeek'; + const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_1 = 'M1'; + const AUTOFILTER_RULETYPE_DYNAMIC_JANUARY = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_1; + const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_2 = 'M2'; + const AUTOFILTER_RULETYPE_DYNAMIC_FEBRUARY = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_2; + const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_3 = 'M3'; + const AUTOFILTER_RULETYPE_DYNAMIC_MARCH = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_3; + const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_4 = 'M4'; + const AUTOFILTER_RULETYPE_DYNAMIC_APRIL = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_4; + const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_5 = 'M5'; + const AUTOFILTER_RULETYPE_DYNAMIC_MAY = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_5; + const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_6 = 'M6'; + const AUTOFILTER_RULETYPE_DYNAMIC_JUNE = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_6; + const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_7 = 'M7'; + const AUTOFILTER_RULETYPE_DYNAMIC_JULY = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_7; + const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_8 = 'M8'; + const AUTOFILTER_RULETYPE_DYNAMIC_AUGUST = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_8; + const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_9 = 'M9'; + const AUTOFILTER_RULETYPE_DYNAMIC_SEPTEMBER = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_9; + const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_10 = 'M10'; + const AUTOFILTER_RULETYPE_DYNAMIC_OCTOBER = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_10; + const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_11 = 'M11'; + const AUTOFILTER_RULETYPE_DYNAMIC_NOVEMBER = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_11; + const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_12 = 'M12'; + const AUTOFILTER_RULETYPE_DYNAMIC_DECEMBER = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_12; + const AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_1 = 'Q1'; + const AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_2 = 'Q2'; + const AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_3 = 'Q3'; + const AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_4 = 'Q4'; + const AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE = 'aboveAverage'; + const AUTOFILTER_RULETYPE_DYNAMIC_BELOWAVERAGE = 'belowAverage'; + + private static $dynamicTypes = array( + self::AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY, + self::AUTOFILTER_RULETYPE_DYNAMIC_TODAY, + self::AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW, + self::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE, + self::AUTOFILTER_RULETYPE_DYNAMIC_THISYEAR, + self::AUTOFILTER_RULETYPE_DYNAMIC_THISQUARTER, + self::AUTOFILTER_RULETYPE_DYNAMIC_THISMONTH, + self::AUTOFILTER_RULETYPE_DYNAMIC_THISWEEK, + self::AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR, + self::AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER, + self::AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH, + self::AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK, + self::AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR, + self::AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER, + self::AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH, + self::AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK, + self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_1, + self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_2, + self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_3, + self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_4, + self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_5, + self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_6, + self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_7, + self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_8, + self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_9, + self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_10, + self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_11, + self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_12, + self::AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_1, + self::AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_2, + self::AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_3, + self::AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_4, + self::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE, + self::AUTOFILTER_RULETYPE_DYNAMIC_BELOWAVERAGE, + ); + + /* + * The only valid filter rule operators for filter and customFilter types are: + * <xsd:enumeration value="equal"/> + * <xsd:enumeration value="lessThan"/> + * <xsd:enumeration value="lessThanOrEqual"/> + * <xsd:enumeration value="notEqual"/> + * <xsd:enumeration value="greaterThanOrEqual"/> + * <xsd:enumeration value="greaterThan"/> + */ + const AUTOFILTER_COLUMN_RULE_EQUAL = 'equal'; + const AUTOFILTER_COLUMN_RULE_NOTEQUAL = 'notEqual'; + const AUTOFILTER_COLUMN_RULE_GREATERTHAN = 'greaterThan'; + const AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL = 'greaterThanOrEqual'; + const AUTOFILTER_COLUMN_RULE_LESSTHAN = 'lessThan'; + const AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL = 'lessThanOrEqual'; + + private static $operators = array( + self::AUTOFILTER_COLUMN_RULE_EQUAL, + self::AUTOFILTER_COLUMN_RULE_NOTEQUAL, + self::AUTOFILTER_COLUMN_RULE_GREATERTHAN, + self::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL, + self::AUTOFILTER_COLUMN_RULE_LESSTHAN, + self::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL, + ); + + const AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE = 'byValue'; + const AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT = 'byPercent'; + + private static $topTenValue = array( + self::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE, + self::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT, + ); + + const AUTOFILTER_COLUMN_RULE_TOPTEN_TOP = 'top'; + const AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM = 'bottom'; + + private static $topTenType = array( + self::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP, + self::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM, + ); + + + /* Rule Operators (Numeric, Boolean etc) */ +// const AUTOFILTER_COLUMN_RULE_BETWEEN = 'between'; // greaterThanOrEqual 1 && lessThanOrEqual 2 + /* Rule Operators (Numeric Special) which are translated to standard numeric operators with calculated values */ +// const AUTOFILTER_COLUMN_RULE_TOPTEN = 'topTen'; // greaterThan calculated value +// const AUTOFILTER_COLUMN_RULE_TOPTENPERCENT = 'topTenPercent'; // greaterThan calculated value +// const AUTOFILTER_COLUMN_RULE_ABOVEAVERAGE = 'aboveAverage'; // Value is calculated as the average +// const AUTOFILTER_COLUMN_RULE_BELOWAVERAGE = 'belowAverage'; // Value is calculated as the average + /* Rule Operators (String) which are set as wild-carded values */ +// const AUTOFILTER_COLUMN_RULE_BEGINSWITH = 'beginsWith'; // A* +// const AUTOFILTER_COLUMN_RULE_ENDSWITH = 'endsWith'; // *Z +// const AUTOFILTER_COLUMN_RULE_CONTAINS = 'contains'; // *B* +// const AUTOFILTER_COLUMN_RULE_DOESNTCONTAIN = 'notEqual'; // notEqual *B* + /* Rule Operators (Date Special) which are translated to standard numeric operators with calculated values */ +// const AUTOFILTER_COLUMN_RULE_BEFORE = 'lessThan'; +// const AUTOFILTER_COLUMN_RULE_AFTER = 'greaterThan'; +// const AUTOFILTER_COLUMN_RULE_YESTERDAY = 'yesterday'; +// const AUTOFILTER_COLUMN_RULE_TODAY = 'today'; +// const AUTOFILTER_COLUMN_RULE_TOMORROW = 'tomorrow'; +// const AUTOFILTER_COLUMN_RULE_LASTWEEK = 'lastWeek'; +// const AUTOFILTER_COLUMN_RULE_THISWEEK = 'thisWeek'; +// const AUTOFILTER_COLUMN_RULE_NEXTWEEK = 'nextWeek'; +// const AUTOFILTER_COLUMN_RULE_LASTMONTH = 'lastMonth'; +// const AUTOFILTER_COLUMN_RULE_THISMONTH = 'thisMonth'; +// const AUTOFILTER_COLUMN_RULE_NEXTMONTH = 'nextMonth'; +// const AUTOFILTER_COLUMN_RULE_LASTQUARTER = 'lastQuarter'; +// const AUTOFILTER_COLUMN_RULE_THISQUARTER = 'thisQuarter'; +// const AUTOFILTER_COLUMN_RULE_NEXTQUARTER = 'nextQuarter'; +// const AUTOFILTER_COLUMN_RULE_LASTYEAR = 'lastYear'; +// const AUTOFILTER_COLUMN_RULE_THISYEAR = 'thisYear'; +// const AUTOFILTER_COLUMN_RULE_NEXTYEAR = 'nextYear'; +// const AUTOFILTER_COLUMN_RULE_YEARTODATE = 'yearToDate'; // <dynamicFilter val="40909" type="yearToDate" maxVal="41113"/> +// const AUTOFILTER_COLUMN_RULE_ALLDATESINMONTH = 'allDatesInMonth'; // <dynamicFilter type="M2"/> for Month/February +// const AUTOFILTER_COLUMN_RULE_ALLDATESINQUARTER = 'allDatesInQuarter'; // <dynamicFilter type="Q2"/> for Quarter 2 + + /** + * Autofilter Column + * + * @var PHPExcel_Worksheet_AutoFilter_Column + */ + private $parent = null; + + + /** + * Autofilter Rule Type + * + * @var string + */ + private $ruleType = self::AUTOFILTER_RULETYPE_FILTER; + + + /** + * Autofilter Rule Value + * + * @var string + */ + private $value = ''; + + /** + * Autofilter Rule Operator + * + * @var string + */ + private $operator = self::AUTOFILTER_COLUMN_RULE_EQUAL; + + /** + * DateTimeGrouping Group Value + * + * @var string + */ + private $grouping = ''; + + + /** + * Create a new PHPExcel_Worksheet_AutoFilter_Column_Rule + * + * @param PHPExcel_Worksheet_AutoFilter_Column $pParent + */ + public function __construct(PHPExcel_Worksheet_AutoFilter_Column $pParent = null) + { + $this->parent = $pParent; + } + + /** + * Get AutoFilter Rule Type + * + * @return string + */ + public function getRuleType() + { + return $this->ruleType; + } + + /** + * Set AutoFilter Rule Type + * + * @param string $pRuleType + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_AutoFilter_Column + */ + public function setRuleType($pRuleType = self::AUTOFILTER_RULETYPE_FILTER) + { + if (!in_array($pRuleType, self::$ruleTypes)) { + throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.'); + } + + $this->ruleType = $pRuleType; + + return $this; + } + + /** + * Get AutoFilter Rule Value + * + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Set AutoFilter Rule Value + * + * @param string|string[] $pValue + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_AutoFilter_Column_Rule + */ + public function setValue($pValue = '') + { + if (is_array($pValue)) { + $grouping = -1; + foreach ($pValue as $key => $value) { + // Validate array entries + if (!in_array($key, self::$dateTimeGroups)) { + // Remove any invalid entries from the value array + unset($pValue[$key]); + } else { + // Work out what the dateTime grouping will be + $grouping = max($grouping, array_search($key, self::$dateTimeGroups)); + } + } + if (count($pValue) == 0) { + throw new PHPExcel_Exception('Invalid rule value for column AutoFilter Rule.'); + } + // Set the dateTime grouping that we've anticipated + $this->setGrouping(self::$dateTimeGroups[$grouping]); + } + $this->value = $pValue; + + return $this; + } + + /** + * Get AutoFilter Rule Operator + * + * @return string + */ + public function getOperator() + { + return $this->operator; + } + + /** + * Set AutoFilter Rule Operator + * + * @param string $pOperator + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_AutoFilter_Column_Rule + */ + public function setOperator($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL) + { + if (empty($pOperator)) { + $pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL; + } + if ((!in_array($pOperator, self::$operators)) && + (!in_array($pOperator, self::$topTenValue))) { + throw new PHPExcel_Exception('Invalid operator for column AutoFilter Rule.'); + } + $this->operator = $pOperator; + + return $this; + } + + /** + * Get AutoFilter Rule Grouping + * + * @return string + */ + public function getGrouping() + { + return $this->grouping; + } + + /** + * Set AutoFilter Rule Grouping + * + * @param string $pGrouping + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_AutoFilter_Column_Rule + */ + public function setGrouping($pGrouping = null) + { + if (($pGrouping !== null) && + (!in_array($pGrouping, self::$dateTimeGroups)) && + (!in_array($pGrouping, self::$dynamicTypes)) && + (!in_array($pGrouping, self::$topTenType))) { + throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.'); + } + $this->grouping = $pGrouping; + + return $this; + } + + /** + * Set AutoFilter Rule + * + * @param string $pOperator + * @param string|string[] $pValue + * @param string $pGrouping + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_AutoFilter_Column_Rule + */ + public function setRule($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL, $pValue = '', $pGrouping = null) + { + $this->setOperator($pOperator); + $this->setValue($pValue); + // Only set grouping if it's been passed in as a user-supplied argument, + // otherwise we're calculating it when we setValue() and don't want to overwrite that + // If the user supplies an argumnet for grouping, then on their own head be it + if ($pGrouping !== null) { + $this->setGrouping($pGrouping); + } + + return $this; + } + + /** + * Get this Rule's AutoFilter Column Parent + * + * @return PHPExcel_Worksheet_AutoFilter_Column + */ + public function getParent() + { + return $this->parent; + } + + /** + * Set this Rule's AutoFilter Column Parent + * + * @param PHPExcel_Worksheet_AutoFilter_Column + * @return PHPExcel_Worksheet_AutoFilter_Column_Rule + */ + public function setParent(PHPExcel_Worksheet_AutoFilter_Column $pParent = null) + { + $this->parent = $pParent; + + return $this; + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + if ($key == 'parent') { + // Detach from autofilter column parent + $this->$key = null; + } else { + $this->$key = clone $value; + } + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/BaseDrawing.php b/extend/PHPExcel/PHPExcel/Worksheet/BaseDrawing.php new file mode 100644 index 0000000..9ad15c7 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/BaseDrawing.php @@ -0,0 +1,507 @@ +<?php + +/** + * PHPExcel_Worksheet_BaseDrawing + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable +{ + /** + * Image counter + * + * @var int + */ + private static $imageCounter = 0; + + /** + * Image index + * + * @var int + */ + private $imageIndex = 0; + + /** + * Name + * + * @var string + */ + protected $name; + + /** + * Description + * + * @var string + */ + protected $description; + + /** + * Worksheet + * + * @var PHPExcel_Worksheet + */ + protected $worksheet; + + /** + * Coordinates + * + * @var string + */ + protected $coordinates; + + /** + * Offset X + * + * @var int + */ + protected $offsetX; + + /** + * Offset Y + * + * @var int + */ + protected $offsetY; + + /** + * Width + * + * @var int + */ + protected $width; + + /** + * Height + * + * @var int + */ + protected $height; + + /** + * Proportional resize + * + * @var boolean + */ + protected $resizeProportional; + + /** + * Rotation + * + * @var int + */ + protected $rotation; + + /** + * Shadow + * + * @var PHPExcel_Worksheet_Drawing_Shadow + */ + protected $shadow; + + /** + * Create a new PHPExcel_Worksheet_BaseDrawing + */ + public function __construct() + { + // Initialise values + $this->name = ''; + $this->description = ''; + $this->worksheet = null; + $this->coordinates = 'A1'; + $this->offsetX = 0; + $this->offsetY = 0; + $this->width = 0; + $this->height = 0; + $this->resizeProportional = true; + $this->rotation = 0; + $this->shadow = new PHPExcel_Worksheet_Drawing_Shadow(); + + // Set image index + self::$imageCounter++; + $this->imageIndex = self::$imageCounter; + } + + /** + * Get image index + * + * @return int + */ + public function getImageIndex() + { + return $this->imageIndex; + } + + /** + * Get Name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set Name + * + * @param string $pValue + * @return PHPExcel_Worksheet_BaseDrawing + */ + public function setName($pValue = '') + { + $this->name = $pValue; + return $this; + } + + /** + * Get Description + * + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Set Description + * + * @param string $pValue + * @return PHPExcel_Worksheet_BaseDrawing + */ + public function setDescription($pValue = '') + { + $this->description = $pValue; + return $this; + } + + /** + * Get Worksheet + * + * @return PHPExcel_Worksheet + */ + public function getWorksheet() + { + return $this->worksheet; + } + + /** + * Set Worksheet + * + * @param PHPExcel_Worksheet $pValue + * @param bool $pOverrideOld If a Worksheet has already been assigned, overwrite it and remove image from old Worksheet? + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_BaseDrawing + */ + public function setWorksheet(PHPExcel_Worksheet $pValue = null, $pOverrideOld = false) + { + if (is_null($this->worksheet)) { + // Add drawing to PHPExcel_Worksheet + $this->worksheet = $pValue; + $this->worksheet->getCell($this->coordinates); + $this->worksheet->getDrawingCollection()->append($this); + } else { + if ($pOverrideOld) { + // Remove drawing from old PHPExcel_Worksheet + $iterator = $this->worksheet->getDrawingCollection()->getIterator(); + + while ($iterator->valid()) { + if ($iterator->current()->getHashCode() == $this->getHashCode()) { + $this->worksheet->getDrawingCollection()->offsetUnset($iterator->key()); + $this->worksheet = null; + break; + } + } + + // Set new PHPExcel_Worksheet + $this->setWorksheet($pValue); + } else { + throw new PHPExcel_Exception("A PHPExcel_Worksheet has already been assigned. Drawings can only exist on one PHPExcel_Worksheet."); + } + } + return $this; + } + + /** + * Get Coordinates + * + * @return string + */ + public function getCoordinates() + { + return $this->coordinates; + } + + /** + * Set Coordinates + * + * @param string $pValue + * @return PHPExcel_Worksheet_BaseDrawing + */ + public function setCoordinates($pValue = 'A1') + { + $this->coordinates = $pValue; + return $this; + } + + /** + * Get OffsetX + * + * @return int + */ + public function getOffsetX() + { + return $this->offsetX; + } + + /** + * Set OffsetX + * + * @param int $pValue + * @return PHPExcel_Worksheet_BaseDrawing + */ + public function setOffsetX($pValue = 0) + { + $this->offsetX = $pValue; + return $this; + } + + /** + * Get OffsetY + * + * @return int + */ + public function getOffsetY() + { + return $this->offsetY; + } + + /** + * Set OffsetY + * + * @param int $pValue + * @return PHPExcel_Worksheet_BaseDrawing + */ + public function setOffsetY($pValue = 0) + { + $this->offsetY = $pValue; + return $this; + } + + /** + * Get Width + * + * @return int + */ + public function getWidth() + { + return $this->width; + } + + /** + * Set Width + * + * @param int $pValue + * @return PHPExcel_Worksheet_BaseDrawing + */ + public function setWidth($pValue = 0) + { + // Resize proportional? + if ($this->resizeProportional && $pValue != 0) { + $ratio = $this->height / ($this->width != 0 ? $this->width : 1); + $this->height = round($ratio * $pValue); + } + + // Set width + $this->width = $pValue; + + return $this; + } + + /** + * Get Height + * + * @return int + */ + public function getHeight() + { + return $this->height; + } + + /** + * Set Height + * + * @param int $pValue + * @return PHPExcel_Worksheet_BaseDrawing + */ + public function setHeight($pValue = 0) + { + // Resize proportional? + if ($this->resizeProportional && $pValue != 0) { + $ratio = $this->width / ($this->height != 0 ? $this->height : 1); + $this->width = round($ratio * $pValue); + } + + // Set height + $this->height = $pValue; + + return $this; + } + + /** + * Set width and height with proportional resize + * Example: + * <code> + * $objDrawing->setResizeProportional(true); + * $objDrawing->setWidthAndHeight(160,120); + * </code> + * + * @author Vincent@luo MSN:kele_100@hotmail.com + * @param int $width + * @param int $height + * @return PHPExcel_Worksheet_BaseDrawing + */ + public function setWidthAndHeight($width = 0, $height = 0) + { + $xratio = $width / ($this->width != 0 ? $this->width : 1); + $yratio = $height / ($this->height != 0 ? $this->height : 1); + if ($this->resizeProportional && !($width == 0 || $height == 0)) { + if (($xratio * $this->height) < $height) { + $this->height = ceil($xratio * $this->height); + $this->width = $width; + } else { + $this->width = ceil($yratio * $this->width); + $this->height = $height; + } + } else { + $this->width = $width; + $this->height = $height; + } + + return $this; + } + + /** + * Get ResizeProportional + * + * @return boolean + */ + public function getResizeProportional() + { + return $this->resizeProportional; + } + + /** + * Set ResizeProportional + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_BaseDrawing + */ + public function setResizeProportional($pValue = true) + { + $this->resizeProportional = $pValue; + return $this; + } + + /** + * Get Rotation + * + * @return int + */ + public function getRotation() + { + return $this->rotation; + } + + /** + * Set Rotation + * + * @param int $pValue + * @return PHPExcel_Worksheet_BaseDrawing + */ + public function setRotation($pValue = 0) + { + $this->rotation = $pValue; + return $this; + } + + /** + * Get Shadow + * + * @return PHPExcel_Worksheet_Drawing_Shadow + */ + public function getShadow() + { + return $this->shadow; + } + + /** + * Set Shadow + * + * @param PHPExcel_Worksheet_Drawing_Shadow $pValue + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_BaseDrawing + */ + public function setShadow(PHPExcel_Worksheet_Drawing_Shadow $pValue = null) + { + $this->shadow = $pValue; + return $this; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + return md5( + $this->name . + $this->description . + $this->worksheet->getHashCode() . + $this->coordinates . + $this->offsetX . + $this->offsetY . + $this->width . + $this->height . + $this->rotation . + $this->shadow->getHashCode() . + __CLASS__ + ); + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/CellIterator.php b/extend/PHPExcel/PHPExcel/Worksheet/CellIterator.php new file mode 100644 index 0000000..151c17f --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/CellIterator.php @@ -0,0 +1,88 @@ +<?php + +/** + * PHPExcel_Worksheet_CellIterator + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +abstract class PHPExcel_Worksheet_CellIterator +{ + /** + * PHPExcel_Worksheet to iterate + * + * @var PHPExcel_Worksheet + */ + protected $subject; + + /** + * Current iterator position + * + * @var mixed + */ + protected $position = null; + + /** + * Iterate only existing cells + * + * @var boolean + */ + protected $onlyExistingCells = false; + + /** + * Destructor + */ + public function __destruct() + { + unset($this->subject); + } + + /** + * Get loop only existing cells + * + * @return boolean + */ + public function getIterateOnlyExistingCells() + { + return $this->onlyExistingCells; + } + + /** + * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary + * + * @throws PHPExcel_Exception + */ + abstract protected function adjustForExistingOnlyRange(); + + /** + * Set the iterator to loop only existing cells + * + * @param boolean $value + * @throws PHPExcel_Exception + */ + public function setIterateOnlyExistingCells($value = true) + { + $this->onlyExistingCells = (boolean) $value; + + $this->adjustForExistingOnlyRange(); + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/Column.php b/extend/PHPExcel/PHPExcel/Worksheet/Column.php new file mode 100644 index 0000000..6d3f36d --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/Column.php @@ -0,0 +1,86 @@ +<?php + +/** + * PHPExcel_Worksheet_Column + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_Column +{ + /** + * PHPExcel_Worksheet + * + * @var PHPExcel_Worksheet + */ + private $parent; + + /** + * Column index + * + * @var string + */ + private $columnIndex; + + /** + * Create a new column + * + * @param PHPExcel_Worksheet $parent + * @param string $columnIndex + */ + public function __construct(PHPExcel_Worksheet $parent = null, $columnIndex = 'A') + { + // Set parent and column index + $this->parent = $parent; + $this->columnIndex = $columnIndex; + } + + /** + * Destructor + */ + public function __destruct() + { + unset($this->parent); + } + + /** + * Get column index + * + * @return string + */ + public function getColumnIndex() + { + return $this->columnIndex; + } + + /** + * Get cell iterator + * + * @param integer $startRow The row number at which to start iterating + * @param integer $endRow Optionally, the row number at which to stop iterating + * @return PHPExcel_Worksheet_CellIterator + */ + public function getCellIterator($startRow = 1, $endRow = null) + { + return new PHPExcel_Worksheet_ColumnCellIterator($this->parent, $this->columnIndex, $startRow, $endRow); + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/ColumnCellIterator.php b/extend/PHPExcel/PHPExcel/Worksheet/ColumnCellIterator.php new file mode 100644 index 0000000..7b8c219 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/ColumnCellIterator.php @@ -0,0 +1,216 @@ +<?php + +/** + * PHPExcel_Worksheet_ColumnCellIterator + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_ColumnCellIterator extends PHPExcel_Worksheet_CellIterator implements Iterator +{ + /** + * Column index + * + * @var string + */ + protected $columnIndex; + + /** + * Start position + * + * @var int + */ + protected $startRow = 1; + + /** + * End position + * + * @var int + */ + protected $endRow = 1; + + /** + * Create a new row iterator + * + * @param PHPExcel_Worksheet $subject The worksheet to iterate over + * @param string $columnIndex The column that we want to iterate + * @param integer $startRow The row number at which to start iterating + * @param integer $endRow Optionally, the row number at which to stop iterating + */ + public function __construct(PHPExcel_Worksheet $subject = null, $columnIndex = 'A', $startRow = 1, $endRow = null) + { + // Set subject + $this->subject = $subject; + $this->columnIndex = PHPExcel_Cell::columnIndexFromString($columnIndex) - 1; + $this->resetEnd($endRow); + $this->resetStart($startRow); + } + + /** + * Destructor + */ + public function __destruct() + { + unset($this->subject); + } + + /** + * (Re)Set the start row and the current row pointer + * + * @param integer $startRow The row number at which to start iterating + * @return PHPExcel_Worksheet_ColumnCellIterator + * @throws PHPExcel_Exception + */ + public function resetStart($startRow = 1) + { + $this->startRow = $startRow; + $this->adjustForExistingOnlyRange(); + $this->seek($startRow); + + return $this; + } + + /** + * (Re)Set the end row + * + * @param integer $endRow The row number at which to stop iterating + * @return PHPExcel_Worksheet_ColumnCellIterator + * @throws PHPExcel_Exception + */ + public function resetEnd($endRow = null) + { + $this->endRow = ($endRow) ? $endRow : $this->subject->getHighestRow(); + $this->adjustForExistingOnlyRange(); + + return $this; + } + + /** + * Set the row pointer to the selected row + * + * @param integer $row The row number to set the current pointer at + * @return PHPExcel_Worksheet_ColumnCellIterator + * @throws PHPExcel_Exception + */ + public function seek($row = 1) + { + if (($row < $this->startRow) || ($row > $this->endRow)) { + throw new PHPExcel_Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})"); + } elseif ($this->onlyExistingCells && !($this->subject->cellExistsByColumnAndRow($this->columnIndex, $row))) { + throw new PHPExcel_Exception('In "IterateOnlyExistingCells" mode and Cell does not exist'); + } + $this->position = $row; + + return $this; + } + + /** + * Rewind the iterator to the starting row + */ + public function rewind() + { + $this->position = $this->startRow; + } + + /** + * Return the current cell in this worksheet column + * + * @return PHPExcel_Worksheet_Row + */ + public function current() + { + return $this->subject->getCellByColumnAndRow($this->columnIndex, $this->position); + } + + /** + * Return the current iterator key + * + * @return int + */ + public function key() + { + return $this->position; + } + + /** + * Set the iterator to its next value + */ + public function next() + { + do { + ++$this->position; + } while (($this->onlyExistingCells) && + (!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->position)) && + ($this->position <= $this->endRow)); + } + + /** + * Set the iterator to its previous value + */ + public function prev() + { + if ($this->position <= $this->startRow) { + throw new PHPExcel_Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})"); + } + + do { + --$this->position; + } while (($this->onlyExistingCells) && + (!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->position)) && + ($this->position >= $this->startRow)); + } + + /** + * Indicate if more rows exist in the worksheet range of rows that we're iterating + * + * @return boolean + */ + public function valid() + { + return $this->position <= $this->endRow; + } + + /** + * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary + * + * @throws PHPExcel_Exception + */ + protected function adjustForExistingOnlyRange() + { + if ($this->onlyExistingCells) { + while ((!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->startRow)) && + ($this->startRow <= $this->endRow)) { + ++$this->startRow; + } + if ($this->startRow > $this->endRow) { + throw new PHPExcel_Exception('No cells exist within the specified range'); + } + while ((!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->endRow)) && + ($this->endRow >= $this->startRow)) { + --$this->endRow; + } + if ($this->endRow < $this->startRow) { + throw new PHPExcel_Exception('No cells exist within the specified range'); + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/ColumnDimension.php b/extend/PHPExcel/PHPExcel/Worksheet/ColumnDimension.php new file mode 100644 index 0000000..405b825 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/ColumnDimension.php @@ -0,0 +1,132 @@ +<?php + +/** + * PHPExcel_Worksheet_ColumnDimension + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_ColumnDimension extends PHPExcel_Worksheet_Dimension +{ + /** + * Column index + * + * @var int + */ + private $columnIndex; + + /** + * Column width + * + * When this is set to a negative value, the column width should be ignored by IWriter + * + * @var double + */ + private $width = -1; + + /** + * Auto size? + * + * @var bool + */ + private $autoSize = false; + + /** + * Create a new PHPExcel_Worksheet_ColumnDimension + * + * @param string $pIndex Character column index + */ + public function __construct($pIndex = 'A') + { + // Initialise values + $this->columnIndex = $pIndex; + + // set dimension as unformatted by default + parent::__construct(0); + } + + /** + * Get ColumnIndex + * + * @return string + */ + public function getColumnIndex() + { + return $this->columnIndex; + } + + /** + * Set ColumnIndex + * + * @param string $pValue + * @return PHPExcel_Worksheet_ColumnDimension + */ + public function setColumnIndex($pValue) + { + $this->columnIndex = $pValue; + return $this; + } + + /** + * Get Width + * + * @return double + */ + public function getWidth() + { + return $this->width; + } + + /** + * Set Width + * + * @param double $pValue + * @return PHPExcel_Worksheet_ColumnDimension + */ + public function setWidth($pValue = -1) + { + $this->width = $pValue; + return $this; + } + + /** + * Get Auto Size + * + * @return bool + */ + public function getAutoSize() + { + return $this->autoSize; + } + + /** + * Set Auto Size + * + * @param bool $pValue + * @return PHPExcel_Worksheet_ColumnDimension + */ + public function setAutoSize($pValue = false) + { + $this->autoSize = $pValue; + return $this; + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/ColumnIterator.php b/extend/PHPExcel/PHPExcel/Worksheet/ColumnIterator.php new file mode 100644 index 0000000..0db3e53 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/ColumnIterator.php @@ -0,0 +1,201 @@ +<?php + +/** + * PHPExcel_Worksheet_ColumnIterator + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_ColumnIterator implements Iterator +{ + /** + * PHPExcel_Worksheet to iterate + * + * @var PHPExcel_Worksheet + */ + private $subject; + + /** + * Current iterator position + * + * @var int + */ + private $position = 0; + + /** + * Start position + * + * @var int + */ + private $startColumn = 0; + + + /** + * End position + * + * @var int + */ + private $endColumn = 0; + + + /** + * Create a new column iterator + * + * @param PHPExcel_Worksheet $subject The worksheet to iterate over + * @param string $startColumn The column address at which to start iterating + * @param string $endColumn Optionally, the column address at which to stop iterating + */ + public function __construct(PHPExcel_Worksheet $subject = null, $startColumn = 'A', $endColumn = null) + { + // Set subject + $this->subject = $subject; + $this->resetEnd($endColumn); + $this->resetStart($startColumn); + } + + /** + * Destructor + */ + public function __destruct() + { + unset($this->subject); + } + + /** + * (Re)Set the start column and the current column pointer + * + * @param integer $startColumn The column address at which to start iterating + * @return PHPExcel_Worksheet_ColumnIterator + * @throws PHPExcel_Exception + */ + public function resetStart($startColumn = 'A') + { + $startColumnIndex = PHPExcel_Cell::columnIndexFromString($startColumn) - 1; + if ($startColumnIndex > PHPExcel_Cell::columnIndexFromString($this->subject->getHighestColumn()) - 1) { + throw new PHPExcel_Exception("Start column ({$startColumn}) is beyond highest column ({$this->subject->getHighestColumn()})"); + } + + $this->startColumn = $startColumnIndex; + if ($this->endColumn < $this->startColumn) { + $this->endColumn = $this->startColumn; + } + $this->seek($startColumn); + + return $this; + } + + /** + * (Re)Set the end column + * + * @param string $endColumn The column address at which to stop iterating + * @return PHPExcel_Worksheet_ColumnIterator + */ + public function resetEnd($endColumn = null) + { + $endColumn = ($endColumn) ? $endColumn : $this->subject->getHighestColumn(); + $this->endColumn = PHPExcel_Cell::columnIndexFromString($endColumn) - 1; + + return $this; + } + + /** + * Set the column pointer to the selected column + * + * @param string $column The column address to set the current pointer at + * @return PHPExcel_Worksheet_ColumnIterator + * @throws PHPExcel_Exception + */ + public function seek($column = 'A') + { + $column = PHPExcel_Cell::columnIndexFromString($column) - 1; + if (($column < $this->startColumn) || ($column > $this->endColumn)) { + throw new PHPExcel_Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})"); + } + $this->position = $column; + + return $this; + } + + /** + * Rewind the iterator to the starting column + */ + public function rewind() + { + $this->position = $this->startColumn; + } + + /** + * Return the current column in this worksheet + * + * @return PHPExcel_Worksheet_Column + */ + public function current() + { + return new PHPExcel_Worksheet_Column($this->subject, PHPExcel_Cell::stringFromColumnIndex($this->position)); + } + + /** + * Return the current iterator key + * + * @return string + */ + public function key() + { + return PHPExcel_Cell::stringFromColumnIndex($this->position); + } + + /** + * Set the iterator to its next value + */ + public function next() + { + ++$this->position; + } + + /** + * Set the iterator to its previous value + * + * @throws PHPExcel_Exception + */ + public function prev() + { + if ($this->position <= $this->startColumn) { + throw new PHPExcel_Exception( + "Column is already at the beginning of range (" . + PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . " - " . + PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . ")" + ); + } + + --$this->position; + } + + /** + * Indicate if more columns exist in the worksheet range of columns that we're iterating + * + * @return boolean + */ + public function valid() + { + return $this->position <= $this->endColumn; + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/Dimension.php b/extend/PHPExcel/PHPExcel/Worksheet/Dimension.php new file mode 100644 index 0000000..84f692c --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/Dimension.php @@ -0,0 +1,178 @@ +<?php + +/** + * PHPExcel_Worksheet_Dimension + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +abstract class PHPExcel_Worksheet_Dimension +{ + /** + * Visible? + * + * @var bool + */ + private $visible = true; + + /** + * Outline level + * + * @var int + */ + private $outlineLevel = 0; + + /** + * Collapsed + * + * @var bool + */ + private $collapsed = false; + + /** + * Index to cellXf. Null value means row has no explicit cellXf format. + * + * @var int|null + */ + private $xfIndex; + + /** + * Create a new PHPExcel_Worksheet_Dimension + * + * @param int $pIndex Numeric row index + */ + public function __construct($initialValue = null) + { + // set dimension as unformatted by default + $this->xfIndex = $initialValue; + } + + /** + * Get Visible + * + * @return bool + */ + public function getVisible() + { + return $this->visible; + } + + /** + * Set Visible + * + * @param bool $pValue + * @return PHPExcel_Worksheet_Dimension + */ + public function setVisible($pValue = true) + { + $this->visible = $pValue; + return $this; + } + + /** + * Get Outline Level + * + * @return int + */ + public function getOutlineLevel() + { + return $this->outlineLevel; + } + + /** + * Set Outline Level + * + * Value must be between 0 and 7 + * + * @param int $pValue + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_Dimension + */ + public function setOutlineLevel($pValue) + { + if ($pValue < 0 || $pValue > 7) { + throw new PHPExcel_Exception("Outline level must range between 0 and 7."); + } + + $this->outlineLevel = $pValue; + return $this; + } + + /** + * Get Collapsed + * + * @return bool + */ + public function getCollapsed() + { + return $this->collapsed; + } + + /** + * Set Collapsed + * + * @param bool $pValue + * @return PHPExcel_Worksheet_Dimension + */ + public function setCollapsed($pValue = true) + { + $this->collapsed = $pValue; + return $this; + } + + /** + * Get index to cellXf + * + * @return int + */ + public function getXfIndex() + { + return $this->xfIndex; + } + + /** + * Set index to cellXf + * + * @param int $pValue + * @return PHPExcel_Worksheet_Dimension + */ + public function setXfIndex($pValue = 0) + { + $this->xfIndex = $pValue; + return $this; + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/Drawing.php b/extend/PHPExcel/PHPExcel/Worksheet/Drawing.php new file mode 100644 index 0000000..e39d3eb --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/Drawing.php @@ -0,0 +1,147 @@ +<?php + +/** + * PHPExcel_Worksheet_Drawing + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet_Drawing + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_Drawing extends PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable +{ + /** + * Path + * + * @var string + */ + private $path; + + /** + * Create a new PHPExcel_Worksheet_Drawing + */ + public function __construct() + { + // Initialise values + $this->path = ''; + + // Initialize parent + parent::__construct(); + } + + /** + * Get Filename + * + * @return string + */ + public function getFilename() + { + return basename($this->path); + } + + /** + * Get indexed filename (using image index) + * + * @return string + */ + public function getIndexedFilename() + { + $fileName = $this->getFilename(); + $fileName = str_replace(' ', '_', $fileName); + return str_replace('.' . $this->getExtension(), '', $fileName) . $this->getImageIndex() . '.' . $this->getExtension(); + } + + /** + * Get Extension + * + * @return string + */ + public function getExtension() + { + $exploded = explode(".", basename($this->path)); + return $exploded[count($exploded) - 1]; + } + + /** + * Get Path + * + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Set Path + * + * @param string $pValue File path + * @param boolean $pVerifyFile Verify file + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_Drawing + */ + public function setPath($pValue = '', $pVerifyFile = true) + { + if ($pVerifyFile) { + if (file_exists($pValue)) { + $this->path = $pValue; + + if ($this->width == 0 && $this->height == 0) { + // Get width/height + list($this->width, $this->height) = getimagesize($pValue); + } + } else { + throw new PHPExcel_Exception("File $pValue not found!"); + } + } else { + $this->path = $pValue; + } + return $this; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + return md5( + $this->path . + parent::getHashCode() . + __CLASS__ + ); + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/Drawing/Shadow.php b/extend/PHPExcel/PHPExcel/Worksheet/Drawing/Shadow.php new file mode 100644 index 0000000..84db91d --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/Drawing/Shadow.php @@ -0,0 +1,296 @@ +<?php + +/** + * PHPExcel_Worksheet_Drawing_Shadow + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet_Drawing + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable +{ + /* Shadow alignment */ + const SHADOW_BOTTOM = 'b'; + const SHADOW_BOTTOM_LEFT = 'bl'; + const SHADOW_BOTTOM_RIGHT = 'br'; + const SHADOW_CENTER = 'ctr'; + const SHADOW_LEFT = 'l'; + const SHADOW_TOP = 't'; + const SHADOW_TOP_LEFT = 'tl'; + const SHADOW_TOP_RIGHT = 'tr'; + + /** + * Visible + * + * @var boolean + */ + private $visible; + + /** + * Blur radius + * + * Defaults to 6 + * + * @var int + */ + private $blurRadius; + + /** + * Shadow distance + * + * Defaults to 2 + * + * @var int + */ + private $distance; + + /** + * Shadow direction (in degrees) + * + * @var int + */ + private $direction; + + /** + * Shadow alignment + * + * @var int + */ + private $alignment; + + /** + * Color + * + * @var PHPExcel_Style_Color + */ + private $color; + + /** + * Alpha + * + * @var int + */ + private $alpha; + + /** + * Create a new PHPExcel_Worksheet_Drawing_Shadow + */ + public function __construct() + { + // Initialise values + $this->visible = false; + $this->blurRadius = 6; + $this->distance = 2; + $this->direction = 0; + $this->alignment = PHPExcel_Worksheet_Drawing_Shadow::SHADOW_BOTTOM_RIGHT; + $this->color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK); + $this->alpha = 50; + } + + /** + * Get Visible + * + * @return boolean + */ + public function getVisible() + { + return $this->visible; + } + + /** + * Set Visible + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Drawing_Shadow + */ + public function setVisible($pValue = false) + { + $this->visible = $pValue; + return $this; + } + + /** + * Get Blur radius + * + * @return int + */ + public function getBlurRadius() + { + return $this->blurRadius; + } + + /** + * Set Blur radius + * + * @param int $pValue + * @return PHPExcel_Worksheet_Drawing_Shadow + */ + public function setBlurRadius($pValue = 6) + { + $this->blurRadius = $pValue; + return $this; + } + + /** + * Get Shadow distance + * + * @return int + */ + public function getDistance() + { + return $this->distance; + } + + /** + * Set Shadow distance + * + * @param int $pValue + * @return PHPExcel_Worksheet_Drawing_Shadow + */ + public function setDistance($pValue = 2) + { + $this->distance = $pValue; + return $this; + } + + /** + * Get Shadow direction (in degrees) + * + * @return int + */ + public function getDirection() + { + return $this->direction; + } + + /** + * Set Shadow direction (in degrees) + * + * @param int $pValue + * @return PHPExcel_Worksheet_Drawing_Shadow + */ + public function setDirection($pValue = 0) + { + $this->direction = $pValue; + return $this; + } + + /** + * Get Shadow alignment + * + * @return int + */ + public function getAlignment() + { + return $this->alignment; + } + + /** + * Set Shadow alignment + * + * @param int $pValue + * @return PHPExcel_Worksheet_Drawing_Shadow + */ + public function setAlignment($pValue = 0) + { + $this->alignment = $pValue; + return $this; + } + + /** + * Get Color + * + * @return PHPExcel_Style_Color + */ + public function getColor() + { + return $this->color; + } + + /** + * Set Color + * + * @param PHPExcel_Style_Color $pValue + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_Drawing_Shadow + */ + public function setColor(PHPExcel_Style_Color $pValue = null) + { + $this->color = $pValue; + return $this; + } + + /** + * Get Alpha + * + * @return int + */ + public function getAlpha() + { + return $this->alpha; + } + + /** + * Set Alpha + * + * @param int $pValue + * @return PHPExcel_Worksheet_Drawing_Shadow + */ + public function setAlpha($pValue = 0) + { + $this->alpha = $pValue; + return $this; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + return md5( + ($this->visible ? 't' : 'f') . + $this->blurRadius . + $this->distance . + $this->direction . + $this->alignment . + $this->color->getHashCode() . + $this->alpha . + __CLASS__ + ); + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/HeaderFooter.php b/extend/PHPExcel/PHPExcel/Worksheet/HeaderFooter.php new file mode 100644 index 0000000..3a88923 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/HeaderFooter.php @@ -0,0 +1,494 @@ +<?php +/** + * PHPExcel_Worksheet_HeaderFooter + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not,241 write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + * + * <code> + * Header/Footer Formatting Syntax taken from Office Open XML Part 4 - Markup Language Reference, page 1970: + * + * There are a number of formatting codes that can be written inline with the actual header / footer text, which + * affect the formatting in the header or footer. + * + * Example: This example shows the text "Center Bold Header" on the first line (center section), and the date on + * the second line (center section). + * &CCenter &"-,Bold"Bold&"-,Regular"Header_x000A_&D + * + * General Rules: + * There is no required order in which these codes must appear. + * + * The first occurrence of the following codes turns the formatting ON, the second occurrence turns it OFF again: + * - strikethrough + * - superscript + * - subscript + * Superscript and subscript cannot both be ON at same time. Whichever comes first wins and the other is ignored, + * while the first is ON. + * &L - code for "left section" (there are three header / footer locations, "left", "center", and "right"). When + * two or more occurrences of this section marker exist, the contents from all markers are concatenated, in the + * order of appearance, and placed into the left section. + * &P - code for "current page #" + * &N - code for "total pages" + * &font size - code for "text font size", where font size is a font size in points. + * &K - code for "text font color" + * RGB Color is specified as RRGGBB + * Theme Color is specifed as TTSNN where TT is the theme color Id, S is either "+" or "-" of the tint/shade + * value, NN is the tint/shade value. + * &S - code for "text strikethrough" on / off + * &X - code for "text super script" on / off + * &Y - code for "text subscript" on / off + * &C - code for "center section". When two or more occurrences of this section marker exist, the contents + * from all markers are concatenated, in the order of appearance, and placed into the center section. + * + * &D - code for "date" + * &T - code for "time" + * &G - code for "picture as background" + * &U - code for "text single underline" + * &E - code for "double underline" + * &R - code for "right section". When two or more occurrences of this section marker exist, the contents + * from all markers are concatenated, in the order of appearance, and placed into the right section. + * &Z - code for "this workbook's file path" + * &F - code for "this workbook's file name" + * &A - code for "sheet tab name" + * &+ - code for add to page #. + * &- - code for subtract from page #. + * &"font name,font type" - code for "text font name" and "text font type", where font name and font type + * are strings specifying the name and type of the font, separated by a comma. When a hyphen appears in font + * name, it means "none specified". Both of font name and font type can be localized values. + * &"-,Bold" - code for "bold font style" + * &B - also means "bold font style". + * &"-,Regular" - code for "regular font style" + * &"-,Italic" - code for "italic font style" + * &I - also means "italic font style" + * &"-,Bold Italic" code for "bold italic font style" + * &O - code for "outline style" + * &H - code for "shadow style" + * </code> + * + */ +class PHPExcel_Worksheet_HeaderFooter +{ + /* Header/footer image location */ + const IMAGE_HEADER_LEFT = 'LH'; + const IMAGE_HEADER_CENTER = 'CH'; + const IMAGE_HEADER_RIGHT = 'RH'; + const IMAGE_FOOTER_LEFT = 'LF'; + const IMAGE_FOOTER_CENTER = 'CF'; + const IMAGE_FOOTER_RIGHT = 'RF'; + + /** + * OddHeader + * + * @var string + */ + private $oddHeader = ''; + + /** + * OddFooter + * + * @var string + */ + private $oddFooter = ''; + + /** + * EvenHeader + * + * @var string + */ + private $evenHeader = ''; + + /** + * EvenFooter + * + * @var string + */ + private $evenFooter = ''; + + /** + * FirstHeader + * + * @var string + */ + private $firstHeader = ''; + + /** + * FirstFooter + * + * @var string + */ + private $firstFooter = ''; + + /** + * Different header for Odd/Even, defaults to false + * + * @var boolean + */ + private $differentOddEven = false; + + /** + * Different header for first page, defaults to false + * + * @var boolean + */ + private $differentFirst = false; + + /** + * Scale with document, defaults to true + * + * @var boolean + */ + private $scaleWithDocument = true; + + /** + * Align with margins, defaults to true + * + * @var boolean + */ + private $alignWithMargins = true; + + /** + * Header/footer images + * + * @var PHPExcel_Worksheet_HeaderFooterDrawing[] + */ + private $headerFooterImages = array(); + + /** + * Create a new PHPExcel_Worksheet_HeaderFooter + */ + public function __construct() + { + } + + /** + * Get OddHeader + * + * @return string + */ + public function getOddHeader() + { + return $this->oddHeader; + } + + /** + * Set OddHeader + * + * @param string $pValue + * @return PHPExcel_Worksheet_HeaderFooter + */ + public function setOddHeader($pValue) + { + $this->oddHeader = $pValue; + return $this; + } + + /** + * Get OddFooter + * + * @return string + */ + public function getOddFooter() + { + return $this->oddFooter; + } + + /** + * Set OddFooter + * + * @param string $pValue + * @return PHPExcel_Worksheet_HeaderFooter + */ + public function setOddFooter($pValue) + { + $this->oddFooter = $pValue; + return $this; + } + + /** + * Get EvenHeader + * + * @return string + */ + public function getEvenHeader() + { + return $this->evenHeader; + } + + /** + * Set EvenHeader + * + * @param string $pValue + * @return PHPExcel_Worksheet_HeaderFooter + */ + public function setEvenHeader($pValue) + { + $this->evenHeader = $pValue; + return $this; + } + + /** + * Get EvenFooter + * + * @return string + */ + public function getEvenFooter() + { + return $this->evenFooter; + } + + /** + * Set EvenFooter + * + * @param string $pValue + * @return PHPExcel_Worksheet_HeaderFooter + */ + public function setEvenFooter($pValue) + { + $this->evenFooter = $pValue; + return $this; + } + + /** + * Get FirstHeader + * + * @return string + */ + public function getFirstHeader() + { + return $this->firstHeader; + } + + /** + * Set FirstHeader + * + * @param string $pValue + * @return PHPExcel_Worksheet_HeaderFooter + */ + public function setFirstHeader($pValue) + { + $this->firstHeader = $pValue; + return $this; + } + + /** + * Get FirstFooter + * + * @return string + */ + public function getFirstFooter() + { + return $this->firstFooter; + } + + /** + * Set FirstFooter + * + * @param string $pValue + * @return PHPExcel_Worksheet_HeaderFooter + */ + public function setFirstFooter($pValue) + { + $this->firstFooter = $pValue; + return $this; + } + + /** + * Get DifferentOddEven + * + * @return boolean + */ + public function getDifferentOddEven() + { + return $this->differentOddEven; + } + + /** + * Set DifferentOddEven + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_HeaderFooter + */ + public function setDifferentOddEven($pValue = false) + { + $this->differentOddEven = $pValue; + return $this; + } + + /** + * Get DifferentFirst + * + * @return boolean + */ + public function getDifferentFirst() + { + return $this->differentFirst; + } + + /** + * Set DifferentFirst + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_HeaderFooter + */ + public function setDifferentFirst($pValue = false) + { + $this->differentFirst = $pValue; + return $this; + } + + /** + * Get ScaleWithDocument + * + * @return boolean + */ + public function getScaleWithDocument() + { + return $this->scaleWithDocument; + } + + /** + * Set ScaleWithDocument + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_HeaderFooter + */ + public function setScaleWithDocument($pValue = true) + { + $this->scaleWithDocument = $pValue; + return $this; + } + + /** + * Get AlignWithMargins + * + * @return boolean + */ + public function getAlignWithMargins() + { + return $this->alignWithMargins; + } + + /** + * Set AlignWithMargins + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_HeaderFooter + */ + public function setAlignWithMargins($pValue = true) + { + $this->alignWithMargins = $pValue; + return $this; + } + + /** + * Add header/footer image + * + * @param PHPExcel_Worksheet_HeaderFooterDrawing $image + * @param string $location + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_HeaderFooter + */ + public function addImage(PHPExcel_Worksheet_HeaderFooterDrawing $image = null, $location = self::IMAGE_HEADER_LEFT) + { + $this->headerFooterImages[$location] = $image; + return $this; + } + + /** + * Remove header/footer image + * + * @param string $location + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_HeaderFooter + */ + public function removeImage($location = self::IMAGE_HEADER_LEFT) + { + if (isset($this->headerFooterImages[$location])) { + unset($this->headerFooterImages[$location]); + } + return $this; + } + + /** + * Set header/footer images + * + * @param PHPExcel_Worksheet_HeaderFooterDrawing[] $images + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_HeaderFooter + */ + public function setImages($images) + { + if (!is_array($images)) { + throw new PHPExcel_Exception('Invalid parameter!'); + } + + $this->headerFooterImages = $images; + return $this; + } + + /** + * Get header/footer images + * + * @return PHPExcel_Worksheet_HeaderFooterDrawing[] + */ + public function getImages() + { + // Sort array + $images = array(); + if (isset($this->headerFooterImages[self::IMAGE_HEADER_LEFT])) { + $images[self::IMAGE_HEADER_LEFT] = $this->headerFooterImages[self::IMAGE_HEADER_LEFT]; + } + if (isset($this->headerFooterImages[self::IMAGE_HEADER_CENTER])) { + $images[self::IMAGE_HEADER_CENTER] = $this->headerFooterImages[self::IMAGE_HEADER_CENTER]; + } + if (isset($this->headerFooterImages[self::IMAGE_HEADER_RIGHT])) { + $images[self::IMAGE_HEADER_RIGHT] = $this->headerFooterImages[self::IMAGE_HEADER_RIGHT]; + } + if (isset($this->headerFooterImages[self::IMAGE_FOOTER_LEFT])) { + $images[self::IMAGE_FOOTER_LEFT] = $this->headerFooterImages[self::IMAGE_FOOTER_LEFT]; + } + if (isset($this->headerFooterImages[self::IMAGE_FOOTER_CENTER])) { + $images[self::IMAGE_FOOTER_CENTER] = $this->headerFooterImages[self::IMAGE_FOOTER_CENTER]; + } + if (isset($this->headerFooterImages[self::IMAGE_FOOTER_RIGHT])) { + $images[self::IMAGE_FOOTER_RIGHT] = $this->headerFooterImages[self::IMAGE_FOOTER_RIGHT]; + } + $this->headerFooterImages = $images; + + return $this->headerFooterImages; + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/HeaderFooterDrawing.php b/extend/PHPExcel/PHPExcel/Worksheet/HeaderFooterDrawing.php new file mode 100644 index 0000000..a491f4b --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/HeaderFooterDrawing.php @@ -0,0 +1,361 @@ +<?php + +/** + * PHPExcel_Worksheet_HeaderFooterDrawing + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing implements PHPExcel_IComparable +{ + /** + * Path + * + * @var string + */ + private $path; + + /** + * Name + * + * @var string + */ + protected $name; + + /** + * Offset X + * + * @var int + */ + protected $offsetX; + + /** + * Offset Y + * + * @var int + */ + protected $offsetY; + + /** + * Width + * + * @var int + */ + protected $width; + + /** + * Height + * + * @var int + */ + protected $height; + + /** + * Proportional resize + * + * @var boolean + */ + protected $resizeProportional; + + /** + * Create a new PHPExcel_Worksheet_HeaderFooterDrawing + */ + public function __construct() + { + // Initialise values + $this->path = ''; + $this->name = ''; + $this->offsetX = 0; + $this->offsetY = 0; + $this->width = 0; + $this->height = 0; + $this->resizeProportional = true; + } + + /** + * Get Name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set Name + * + * @param string $pValue + * @return PHPExcel_Worksheet_HeaderFooterDrawing + */ + public function setName($pValue = '') + { + $this->name = $pValue; + return $this; + } + + /** + * Get OffsetX + * + * @return int + */ + public function getOffsetX() + { + return $this->offsetX; + } + + /** + * Set OffsetX + * + * @param int $pValue + * @return PHPExcel_Worksheet_HeaderFooterDrawing + */ + public function setOffsetX($pValue = 0) + { + $this->offsetX = $pValue; + return $this; + } + + /** + * Get OffsetY + * + * @return int + */ + public function getOffsetY() + { + return $this->offsetY; + } + + /** + * Set OffsetY + * + * @param int $pValue + * @return PHPExcel_Worksheet_HeaderFooterDrawing + */ + public function setOffsetY($pValue = 0) + { + $this->offsetY = $pValue; + return $this; + } + + /** + * Get Width + * + * @return int + */ + public function getWidth() + { + return $this->width; + } + + /** + * Set Width + * + * @param int $pValue + * @return PHPExcel_Worksheet_HeaderFooterDrawing + */ + public function setWidth($pValue = 0) + { + // Resize proportional? + if ($this->resizeProportional && $pValue != 0) { + $ratio = $this->width / $this->height; + $this->height = round($ratio * $pValue); + } + + // Set width + $this->width = $pValue; + + return $this; + } + + /** + * Get Height + * + * @return int + */ + public function getHeight() + { + return $this->height; + } + + /** + * Set Height + * + * @param int $pValue + * @return PHPExcel_Worksheet_HeaderFooterDrawing + */ + public function setHeight($pValue = 0) + { + // Resize proportional? + if ($this->resizeProportional && $pValue != 0) { + $ratio = $this->width / $this->height; + $this->width = round($ratio * $pValue); + } + + // Set height + $this->height = $pValue; + + return $this; + } + + /** + * Set width and height with proportional resize + * Example: + * <code> + * $objDrawing->setResizeProportional(true); + * $objDrawing->setWidthAndHeight(160,120); + * </code> + * + * @author Vincent@luo MSN:kele_100@hotmail.com + * @param int $width + * @param int $height + * @return PHPExcel_Worksheet_HeaderFooterDrawing + */ + public function setWidthAndHeight($width = 0, $height = 0) + { + $xratio = $width / $this->width; + $yratio = $height / $this->height; + if ($this->resizeProportional && !($width == 0 || $height == 0)) { + if (($xratio * $this->height) < $height) { + $this->height = ceil($xratio * $this->height); + $this->width = $width; + } else { + $this->width = ceil($yratio * $this->width); + $this->height = $height; + } + } + return $this; + } + + /** + * Get ResizeProportional + * + * @return boolean + */ + public function getResizeProportional() + { + return $this->resizeProportional; + } + + /** + * Set ResizeProportional + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_HeaderFooterDrawing + */ + public function setResizeProportional($pValue = true) + { + $this->resizeProportional = $pValue; + return $this; + } + + /** + * Get Filename + * + * @return string + */ + public function getFilename() + { + return basename($this->path); + } + + /** + * Get Extension + * + * @return string + */ + public function getExtension() + { + $parts = explode(".", basename($this->path)); + return end($parts); + } + + /** + * Get Path + * + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Set Path + * + * @param string $pValue File path + * @param boolean $pVerifyFile Verify file + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_HeaderFooterDrawing + */ + public function setPath($pValue = '', $pVerifyFile = true) + { + if ($pVerifyFile) { + if (file_exists($pValue)) { + $this->path = $pValue; + + if ($this->width == 0 && $this->height == 0) { + // Get width/height + list($this->width, $this->height) = getimagesize($pValue); + } + } else { + throw new PHPExcel_Exception("File $pValue not found!"); + } + } else { + $this->path = $pValue; + } + return $this; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + return md5( + $this->path . + $this->name . + $this->offsetX . + $this->offsetY . + $this->width . + $this->height . + __CLASS__ + ); + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/MemoryDrawing.php b/extend/PHPExcel/PHPExcel/Worksheet/MemoryDrawing.php new file mode 100644 index 0000000..438ed2c --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/MemoryDrawing.php @@ -0,0 +1,201 @@ +<?php + +/** + * PHPExcel_Worksheet_MemoryDrawing + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable +{ + /* Rendering functions */ + const RENDERING_DEFAULT = 'imagepng'; + const RENDERING_PNG = 'imagepng'; + const RENDERING_GIF = 'imagegif'; + const RENDERING_JPEG = 'imagejpeg'; + + /* MIME types */ + const MIMETYPE_DEFAULT = 'image/png'; + const MIMETYPE_PNG = 'image/png'; + const MIMETYPE_GIF = 'image/gif'; + const MIMETYPE_JPEG = 'image/jpeg'; + + /** + * Image resource + * + * @var resource + */ + private $imageResource; + + /** + * Rendering function + * + * @var string + */ + private $renderingFunction; + + /** + * Mime type + * + * @var string + */ + private $mimeType; + + /** + * Unique name + * + * @var string + */ + private $uniqueName; + + /** + * Create a new PHPExcel_Worksheet_MemoryDrawing + */ + public function __construct() + { + // Initialise values + $this->imageResource = null; + $this->renderingFunction = self::RENDERING_DEFAULT; + $this->mimeType = self::MIMETYPE_DEFAULT; + $this->uniqueName = md5(rand(0, 9999). time() . rand(0, 9999)); + + // Initialize parent + parent::__construct(); + } + + /** + * Get image resource + * + * @return resource + */ + public function getImageResource() + { + return $this->imageResource; + } + + /** + * Set image resource + * + * @param $value resource + * @return PHPExcel_Worksheet_MemoryDrawing + */ + public function setImageResource($value = null) + { + $this->imageResource = $value; + + if (!is_null($this->imageResource)) { + // Get width/height + $this->width = imagesx($this->imageResource); + $this->height = imagesy($this->imageResource); + } + return $this; + } + + /** + * Get rendering function + * + * @return string + */ + public function getRenderingFunction() + { + return $this->renderingFunction; + } + + /** + * Set rendering function + * + * @param string $value + * @return PHPExcel_Worksheet_MemoryDrawing + */ + public function setRenderingFunction($value = PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT) + { + $this->renderingFunction = $value; + return $this; + } + + /** + * Get mime type + * + * @return string + */ + public function getMimeType() + { + return $this->mimeType; + } + + /** + * Set mime type + * + * @param string $value + * @return PHPExcel_Worksheet_MemoryDrawing + */ + public function setMimeType($value = PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT) + { + $this->mimeType = $value; + return $this; + } + + /** + * Get indexed filename (using image index) + * + * @return string + */ + public function getIndexedFilename() + { + $extension = strtolower($this->getMimeType()); + $extension = explode('/', $extension); + $extension = $extension[1]; + + return $this->uniqueName . $this->getImageIndex() . '.' . $extension; + } + + /** + * Get hash code + * + * @return string Hash code + */ + public function getHashCode() + { + return md5( + $this->renderingFunction . + $this->mimeType . + $this->uniqueName . + parent::getHashCode() . + __CLASS__ + ); + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/PageMargins.php b/extend/PHPExcel/PHPExcel/Worksheet/PageMargins.php new file mode 100644 index 0000000..70f5ee0 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/PageMargins.php @@ -0,0 +1,233 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_Worksheet_PageMargins + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +class PHPExcel_Worksheet_PageMargins +{ + /** + * Left + * + * @var double + */ + private $left = 0.7; + + /** + * Right + * + * @var double + */ + private $right = 0.7; + + /** + * Top + * + * @var double + */ + private $top = 0.75; + + /** + * Bottom + * + * @var double + */ + private $bottom = 0.75; + + /** + * Header + * + * @var double + */ + private $header = 0.3; + + /** + * Footer + * + * @var double + */ + private $footer = 0.3; + + /** + * Create a new PHPExcel_Worksheet_PageMargins + */ + public function __construct() + { + } + + /** + * Get Left + * + * @return double + */ + public function getLeft() + { + return $this->left; + } + + /** + * Set Left + * + * @param double $pValue + * @return PHPExcel_Worksheet_PageMargins + */ + public function setLeft($pValue) + { + $this->left = $pValue; + return $this; + } + + /** + * Get Right + * + * @return double + */ + public function getRight() + { + return $this->right; + } + + /** + * Set Right + * + * @param double $pValue + * @return PHPExcel_Worksheet_PageMargins + */ + public function setRight($pValue) + { + $this->right = $pValue; + return $this; + } + + /** + * Get Top + * + * @return double + */ + public function getTop() + { + return $this->top; + } + + /** + * Set Top + * + * @param double $pValue + * @return PHPExcel_Worksheet_PageMargins + */ + public function setTop($pValue) + { + $this->top = $pValue; + return $this; + } + + /** + * Get Bottom + * + * @return double + */ + public function getBottom() + { + return $this->bottom; + } + + /** + * Set Bottom + * + * @param double $pValue + * @return PHPExcel_Worksheet_PageMargins + */ + public function setBottom($pValue) + { + $this->bottom = $pValue; + return $this; + } + + /** + * Get Header + * + * @return double + */ + public function getHeader() + { + return $this->header; + } + + /** + * Set Header + * + * @param double $pValue + * @return PHPExcel_Worksheet_PageMargins + */ + public function setHeader($pValue) + { + $this->header = $pValue; + return $this; + } + + /** + * Get Footer + * + * @return double + */ + public function getFooter() + { + return $this->footer; + } + + /** + * Set Footer + * + * @param double $pValue + * @return PHPExcel_Worksheet_PageMargins + */ + public function setFooter($pValue) + { + $this->footer = $pValue; + return $this; + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/PageSetup.php b/extend/PHPExcel/PHPExcel/Worksheet/PageSetup.php new file mode 100644 index 0000000..c67053e --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/PageSetup.php @@ -0,0 +1,839 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_Worksheet_PageSetup + * + * <code> + * Paper size taken from Office Open XML Part 4 - Markup Language Reference, page 1988: + * + * 1 = Letter paper (8.5 in. by 11 in.) + * 2 = Letter small paper (8.5 in. by 11 in.) + * 3 = Tabloid paper (11 in. by 17 in.) + * 4 = Ledger paper (17 in. by 11 in.) + * 5 = Legal paper (8.5 in. by 14 in.) + * 6 = Statement paper (5.5 in. by 8.5 in.) + * 7 = Executive paper (7.25 in. by 10.5 in.) + * 8 = A3 paper (297 mm by 420 mm) + * 9 = A4 paper (210 mm by 297 mm) + * 10 = A4 small paper (210 mm by 297 mm) + * 11 = A5 paper (148 mm by 210 mm) + * 12 = B4 paper (250 mm by 353 mm) + * 13 = B5 paper (176 mm by 250 mm) + * 14 = Folio paper (8.5 in. by 13 in.) + * 15 = Quarto paper (215 mm by 275 mm) + * 16 = Standard paper (10 in. by 14 in.) + * 17 = Standard paper (11 in. by 17 in.) + * 18 = Note paper (8.5 in. by 11 in.) + * 19 = #9 envelope (3.875 in. by 8.875 in.) + * 20 = #10 envelope (4.125 in. by 9.5 in.) + * 21 = #11 envelope (4.5 in. by 10.375 in.) + * 22 = #12 envelope (4.75 in. by 11 in.) + * 23 = #14 envelope (5 in. by 11.5 in.) + * 24 = C paper (17 in. by 22 in.) + * 25 = D paper (22 in. by 34 in.) + * 26 = E paper (34 in. by 44 in.) + * 27 = DL envelope (110 mm by 220 mm) + * 28 = C5 envelope (162 mm by 229 mm) + * 29 = C3 envelope (324 mm by 458 mm) + * 30 = C4 envelope (229 mm by 324 mm) + * 31 = C6 envelope (114 mm by 162 mm) + * 32 = C65 envelope (114 mm by 229 mm) + * 33 = B4 envelope (250 mm by 353 mm) + * 34 = B5 envelope (176 mm by 250 mm) + * 35 = B6 envelope (176 mm by 125 mm) + * 36 = Italy envelope (110 mm by 230 mm) + * 37 = Monarch envelope (3.875 in. by 7.5 in.). + * 38 = 6 3/4 envelope (3.625 in. by 6.5 in.) + * 39 = US standard fanfold (14.875 in. by 11 in.) + * 40 = German standard fanfold (8.5 in. by 12 in.) + * 41 = German legal fanfold (8.5 in. by 13 in.) + * 42 = ISO B4 (250 mm by 353 mm) + * 43 = Japanese double postcard (200 mm by 148 mm) + * 44 = Standard paper (9 in. by 11 in.) + * 45 = Standard paper (10 in. by 11 in.) + * 46 = Standard paper (15 in. by 11 in.) + * 47 = Invite envelope (220 mm by 220 mm) + * 50 = Letter extra paper (9.275 in. by 12 in.) + * 51 = Legal extra paper (9.275 in. by 15 in.) + * 52 = Tabloid extra paper (11.69 in. by 18 in.) + * 53 = A4 extra paper (236 mm by 322 mm) + * 54 = Letter transverse paper (8.275 in. by 11 in.) + * 55 = A4 transverse paper (210 mm by 297 mm) + * 56 = Letter extra transverse paper (9.275 in. by 12 in.) + * 57 = SuperA/SuperA/A4 paper (227 mm by 356 mm) + * 58 = SuperB/SuperB/A3 paper (305 mm by 487 mm) + * 59 = Letter plus paper (8.5 in. by 12.69 in.) + * 60 = A4 plus paper (210 mm by 330 mm) + * 61 = A5 transverse paper (148 mm by 210 mm) + * 62 = JIS B5 transverse paper (182 mm by 257 mm) + * 63 = A3 extra paper (322 mm by 445 mm) + * 64 = A5 extra paper (174 mm by 235 mm) + * 65 = ISO B5 extra paper (201 mm by 276 mm) + * 66 = A2 paper (420 mm by 594 mm) + * 67 = A3 transverse paper (297 mm by 420 mm) + * 68 = A3 extra transverse paper (322 mm by 445 mm) + * </code> + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +class PHPExcel_Worksheet_PageSetup +{ + /* Paper size */ + const PAPERSIZE_LETTER = 1; + const PAPERSIZE_LETTER_SMALL = 2; + const PAPERSIZE_TABLOID = 3; + const PAPERSIZE_LEDGER = 4; + const PAPERSIZE_LEGAL = 5; + const PAPERSIZE_STATEMENT = 6; + const PAPERSIZE_EXECUTIVE = 7; + const PAPERSIZE_A3 = 8; + const PAPERSIZE_A4 = 9; + const PAPERSIZE_A4_SMALL = 10; + const PAPERSIZE_A5 = 11; + const PAPERSIZE_B4 = 12; + const PAPERSIZE_B5 = 13; + const PAPERSIZE_FOLIO = 14; + const PAPERSIZE_QUARTO = 15; + const PAPERSIZE_STANDARD_1 = 16; + const PAPERSIZE_STANDARD_2 = 17; + const PAPERSIZE_NOTE = 18; + const PAPERSIZE_NO9_ENVELOPE = 19; + const PAPERSIZE_NO10_ENVELOPE = 20; + const PAPERSIZE_NO11_ENVELOPE = 21; + const PAPERSIZE_NO12_ENVELOPE = 22; + const PAPERSIZE_NO14_ENVELOPE = 23; + const PAPERSIZE_C = 24; + const PAPERSIZE_D = 25; + const PAPERSIZE_E = 26; + const PAPERSIZE_DL_ENVELOPE = 27; + const PAPERSIZE_C5_ENVELOPE = 28; + const PAPERSIZE_C3_ENVELOPE = 29; + const PAPERSIZE_C4_ENVELOPE = 30; + const PAPERSIZE_C6_ENVELOPE = 31; + const PAPERSIZE_C65_ENVELOPE = 32; + const PAPERSIZE_B4_ENVELOPE = 33; + const PAPERSIZE_B5_ENVELOPE = 34; + const PAPERSIZE_B6_ENVELOPE = 35; + const PAPERSIZE_ITALY_ENVELOPE = 36; + const PAPERSIZE_MONARCH_ENVELOPE = 37; + const PAPERSIZE_6_3_4_ENVELOPE = 38; + const PAPERSIZE_US_STANDARD_FANFOLD = 39; + const PAPERSIZE_GERMAN_STANDARD_FANFOLD = 40; + const PAPERSIZE_GERMAN_LEGAL_FANFOLD = 41; + const PAPERSIZE_ISO_B4 = 42; + const PAPERSIZE_JAPANESE_DOUBLE_POSTCARD = 43; + const PAPERSIZE_STANDARD_PAPER_1 = 44; + const PAPERSIZE_STANDARD_PAPER_2 = 45; + const PAPERSIZE_STANDARD_PAPER_3 = 46; + const PAPERSIZE_INVITE_ENVELOPE = 47; + const PAPERSIZE_LETTER_EXTRA_PAPER = 48; + const PAPERSIZE_LEGAL_EXTRA_PAPER = 49; + const PAPERSIZE_TABLOID_EXTRA_PAPER = 50; + const PAPERSIZE_A4_EXTRA_PAPER = 51; + const PAPERSIZE_LETTER_TRANSVERSE_PAPER = 52; + const PAPERSIZE_A4_TRANSVERSE_PAPER = 53; + const PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER = 54; + const PAPERSIZE_SUPERA_SUPERA_A4_PAPER = 55; + const PAPERSIZE_SUPERB_SUPERB_A3_PAPER = 56; + const PAPERSIZE_LETTER_PLUS_PAPER = 57; + const PAPERSIZE_A4_PLUS_PAPER = 58; + const PAPERSIZE_A5_TRANSVERSE_PAPER = 59; + const PAPERSIZE_JIS_B5_TRANSVERSE_PAPER = 60; + const PAPERSIZE_A3_EXTRA_PAPER = 61; + const PAPERSIZE_A5_EXTRA_PAPER = 62; + const PAPERSIZE_ISO_B5_EXTRA_PAPER = 63; + const PAPERSIZE_A2_PAPER = 64; + const PAPERSIZE_A3_TRANSVERSE_PAPER = 65; + const PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER = 66; + + /* Page orientation */ + const ORIENTATION_DEFAULT = 'default'; + const ORIENTATION_LANDSCAPE = 'landscape'; + const ORIENTATION_PORTRAIT = 'portrait'; + + /* Print Range Set Method */ + const SETPRINTRANGE_OVERWRITE = 'O'; + const SETPRINTRANGE_INSERT = 'I'; + + + /** + * Paper size + * + * @var int + */ + private $paperSize = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER; + + /** + * Orientation + * + * @var string + */ + private $orientation = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT; + + /** + * Scale (Print Scale) + * + * Print scaling. Valid values range from 10 to 400 + * This setting is overridden when fitToWidth and/or fitToHeight are in use + * + * @var int? + */ + private $scale = 100; + + /** + * Fit To Page + * Whether scale or fitToWith / fitToHeight applies + * + * @var boolean + */ + private $fitToPage = false; + + /** + * Fit To Height + * Number of vertical pages to fit on + * + * @var int? + */ + private $fitToHeight = 1; + + /** + * Fit To Width + * Number of horizontal pages to fit on + * + * @var int? + */ + private $fitToWidth = 1; + + /** + * Columns to repeat at left + * + * @var array Containing start column and end column, empty array if option unset + */ + private $columnsToRepeatAtLeft = array('', ''); + + /** + * Rows to repeat at top + * + * @var array Containing start row number and end row number, empty array if option unset + */ + private $rowsToRepeatAtTop = array(0, 0); + + /** + * Center page horizontally + * + * @var boolean + */ + private $horizontalCentered = false; + + /** + * Center page vertically + * + * @var boolean + */ + private $verticalCentered = false; + + /** + * Print area + * + * @var string + */ + private $printArea = null; + + /** + * First page number + * + * @var int + */ + private $firstPageNumber = null; + + /** + * Create a new PHPExcel_Worksheet_PageSetup + */ + public function __construct() + { + } + + /** + * Get Paper Size + * + * @return int + */ + public function getPaperSize() + { + return $this->paperSize; + } + + /** + * Set Paper Size + * + * @param int $pValue + * @return PHPExcel_Worksheet_PageSetup + */ + public function setPaperSize($pValue = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER) + { + $this->paperSize = $pValue; + return $this; + } + + /** + * Get Orientation + * + * @return string + */ + public function getOrientation() + { + return $this->orientation; + } + + /** + * Set Orientation + * + * @param string $pValue + * @return PHPExcel_Worksheet_PageSetup + */ + public function setOrientation($pValue = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT) + { + $this->orientation = $pValue; + return $this; + } + + /** + * Get Scale + * + * @return int? + */ + public function getScale() + { + return $this->scale; + } + + /** + * Set Scale + * + * Print scaling. Valid values range from 10 to 400 + * This setting is overridden when fitToWidth and/or fitToHeight are in use + * + * @param int? $pValue + * @param boolean $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth + * @return PHPExcel_Worksheet_PageSetup + * @throws PHPExcel_Exception + */ + public function setScale($pValue = 100, $pUpdate = true) + { + // Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface, + // but it is apparently still able to handle any scale >= 0, where 0 results in 100 + if (($pValue >= 0) || is_null($pValue)) { + $this->scale = $pValue; + if ($pUpdate) { + $this->fitToPage = false; + } + } else { + throw new PHPExcel_Exception("Scale must not be negative"); + } + return $this; + } + + /** + * Get Fit To Page + * + * @return boolean + */ + public function getFitToPage() + { + return $this->fitToPage; + } + + /** + * Set Fit To Page + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_PageSetup + */ + public function setFitToPage($pValue = true) + { + $this->fitToPage = $pValue; + return $this; + } + + /** + * Get Fit To Height + * + * @return int? + */ + public function getFitToHeight() + { + return $this->fitToHeight; + } + + /** + * Set Fit To Height + * + * @param int? $pValue + * @param boolean $pUpdate Update fitToPage so it applies rather than scaling + * @return PHPExcel_Worksheet_PageSetup + */ + public function setFitToHeight($pValue = 1, $pUpdate = true) + { + $this->fitToHeight = $pValue; + if ($pUpdate) { + $this->fitToPage = true; + } + return $this; + } + + /** + * Get Fit To Width + * + * @return int? + */ + public function getFitToWidth() + { + return $this->fitToWidth; + } + + /** + * Set Fit To Width + * + * @param int? $pValue + * @param boolean $pUpdate Update fitToPage so it applies rather than scaling + * @return PHPExcel_Worksheet_PageSetup + */ + public function setFitToWidth($pValue = 1, $pUpdate = true) + { + $this->fitToWidth = $pValue; + if ($pUpdate) { + $this->fitToPage = true; + } + return $this; + } + + /** + * Is Columns to repeat at left set? + * + * @return boolean + */ + public function isColumnsToRepeatAtLeftSet() + { + if (is_array($this->columnsToRepeatAtLeft)) { + if ($this->columnsToRepeatAtLeft[0] != '' && $this->columnsToRepeatAtLeft[1] != '') { + return true; + } + } + + return false; + } + + /** + * Get Columns to repeat at left + * + * @return array Containing start column and end column, empty array if option unset + */ + public function getColumnsToRepeatAtLeft() + { + return $this->columnsToRepeatAtLeft; + } + + /** + * Set Columns to repeat at left + * + * @param array $pValue Containing start column and end column, empty array if option unset + * @return PHPExcel_Worksheet_PageSetup + */ + public function setColumnsToRepeatAtLeft($pValue = null) + { + if (is_array($pValue)) { + $this->columnsToRepeatAtLeft = $pValue; + } + return $this; + } + + /** + * Set Columns to repeat at left by start and end + * + * @param string $pStart + * @param string $pEnd + * @return PHPExcel_Worksheet_PageSetup + */ + public function setColumnsToRepeatAtLeftByStartAndEnd($pStart = 'A', $pEnd = 'A') + { + $this->columnsToRepeatAtLeft = array($pStart, $pEnd); + return $this; + } + + /** + * Is Rows to repeat at top set? + * + * @return boolean + */ + public function isRowsToRepeatAtTopSet() + { + if (is_array($this->rowsToRepeatAtTop)) { + if ($this->rowsToRepeatAtTop[0] != 0 && $this->rowsToRepeatAtTop[1] != 0) { + return true; + } + } + + return false; + } + + /** + * Get Rows to repeat at top + * + * @return array Containing start column and end column, empty array if option unset + */ + public function getRowsToRepeatAtTop() + { + return $this->rowsToRepeatAtTop; + } + + /** + * Set Rows to repeat at top + * + * @param array $pValue Containing start column and end column, empty array if option unset + * @return PHPExcel_Worksheet_PageSetup + */ + public function setRowsToRepeatAtTop($pValue = null) + { + if (is_array($pValue)) { + $this->rowsToRepeatAtTop = $pValue; + } + return $this; + } + + /** + * Set Rows to repeat at top by start and end + * + * @param int $pStart + * @param int $pEnd + * @return PHPExcel_Worksheet_PageSetup + */ + public function setRowsToRepeatAtTopByStartAndEnd($pStart = 1, $pEnd = 1) + { + $this->rowsToRepeatAtTop = array($pStart, $pEnd); + return $this; + } + + /** + * Get center page horizontally + * + * @return bool + */ + public function getHorizontalCentered() + { + return $this->horizontalCentered; + } + + /** + * Set center page horizontally + * + * @param bool $value + * @return PHPExcel_Worksheet_PageSetup + */ + public function setHorizontalCentered($value = false) + { + $this->horizontalCentered = $value; + return $this; + } + + /** + * Get center page vertically + * + * @return bool + */ + public function getVerticalCentered() + { + return $this->verticalCentered; + } + + /** + * Set center page vertically + * + * @param bool $value + * @return PHPExcel_Worksheet_PageSetup + */ + public function setVerticalCentered($value = false) + { + $this->verticalCentered = $value; + return $this; + } + + /** + * Get print area + * + * @param int $index Identifier for a specific print area range if several ranges have been set + * Default behaviour, or a index value of 0, will return all ranges as a comma-separated string + * Otherwise, the specific range identified by the value of $index will be returned + * Print areas are numbered from 1 + * @throws PHPExcel_Exception + * @return string + */ + public function getPrintArea($index = 0) + { + if ($index == 0) { + return $this->printArea; + } + $printAreas = explode(',', $this->printArea); + if (isset($printAreas[$index-1])) { + return $printAreas[$index-1]; + } + throw new PHPExcel_Exception("Requested Print Area does not exist"); + } + + /** + * Is print area set? + * + * @param int $index Identifier for a specific print area range if several ranges have been set + * Default behaviour, or an index value of 0, will identify whether any print range is set + * Otherwise, existence of the range identified by the value of $index will be returned + * Print areas are numbered from 1 + * @return boolean + */ + public function isPrintAreaSet($index = 0) + { + if ($index == 0) { + return !is_null($this->printArea); + } + $printAreas = explode(',', $this->printArea); + return isset($printAreas[$index-1]); + } + + /** + * Clear a print area + * + * @param int $index Identifier for a specific print area range if several ranges have been set + * Default behaviour, or an index value of 0, will clear all print ranges that are set + * Otherwise, the range identified by the value of $index will be removed from the series + * Print areas are numbered from 1 + * @return PHPExcel_Worksheet_PageSetup + */ + public function clearPrintArea($index = 0) + { + if ($index == 0) { + $this->printArea = null; + } else { + $printAreas = explode(',', $this->printArea); + if (isset($printAreas[$index-1])) { + unset($printAreas[$index-1]); + $this->printArea = implode(',', $printAreas); + } + } + + return $this; + } + + /** + * Set print area. e.g. 'A1:D10' or 'A1:D10,G5:M20' + * + * @param string $value + * @param int $index Identifier for a specific print area range allowing several ranges to be set + * When the method is "O"verwrite, then a positive integer index will overwrite that indexed + * entry in the print areas list; a negative index value will identify which entry to + * overwrite working bacward through the print area to the list, with the last entry as -1. + * Specifying an index value of 0, will overwrite <b>all</b> existing print ranges. + * When the method is "I"nsert, then a positive index will insert after that indexed entry in + * the print areas list, while a negative index will insert before the indexed entry. + * Specifying an index value of 0, will always append the new print range at the end of the + * list. + * Print areas are numbered from 1 + * @param string $method Determines the method used when setting multiple print areas + * Default behaviour, or the "O" method, overwrites existing print area + * The "I" method, inserts the new print area before any specified index, or at the end of the list + * @return PHPExcel_Worksheet_PageSetup + * @throws PHPExcel_Exception + */ + public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) + { + if (strpos($value, '!') !== false) { + throw new PHPExcel_Exception('Cell coordinate must not specify a worksheet.'); + } elseif (strpos($value, ':') === false) { + throw new PHPExcel_Exception('Cell coordinate must be a range of cells.'); + } elseif (strpos($value, '$') !== false) { + throw new PHPExcel_Exception('Cell coordinate must not be absolute.'); + } + $value = strtoupper($value); + + if ($method == self::SETPRINTRANGE_OVERWRITE) { + if ($index == 0) { + $this->printArea = $value; + } else { + $printAreas = explode(',', $this->printArea); + if ($index < 0) { + $index = count($printAreas) - abs($index) + 1; + } + if (($index <= 0) || ($index > count($printAreas))) { + throw new PHPExcel_Exception('Invalid index for setting print range.'); + } + $printAreas[$index-1] = $value; + $this->printArea = implode(',', $printAreas); + } + } elseif ($method == self::SETPRINTRANGE_INSERT) { + if ($index == 0) { + $this->printArea .= ($this->printArea == '') ? $value : ','.$value; + } else { + $printAreas = explode(',', $this->printArea); + if ($index < 0) { + $index = abs($index) - 1; + } + if ($index > count($printAreas)) { + throw new PHPExcel_Exception('Invalid index for setting print range.'); + } + $printAreas = array_merge(array_slice($printAreas, 0, $index), array($value), array_slice($printAreas, $index)); + $this->printArea = implode(',', $printAreas); + } + } else { + throw new PHPExcel_Exception('Invalid method for setting print range.'); + } + + return $this; + } + + /** + * Add a new print area (e.g. 'A1:D10' or 'A1:D10,G5:M20') to the list of print areas + * + * @param string $value + * @param int $index Identifier for a specific print area range allowing several ranges to be set + * A positive index will insert after that indexed entry in the print areas list, while a + * negative index will insert before the indexed entry. + * Specifying an index value of 0, will always append the new print range at the end of the + * list. + * Print areas are numbered from 1 + * @return PHPExcel_Worksheet_PageSetup + * @throws PHPExcel_Exception + */ + public function addPrintArea($value, $index = -1) + { + return $this->setPrintArea($value, $index, self::SETPRINTRANGE_INSERT); + } + + /** + * Set print area + * + * @param int $column1 Column 1 + * @param int $row1 Row 1 + * @param int $column2 Column 2 + * @param int $row2 Row 2 + * @param int $index Identifier for a specific print area range allowing several ranges to be set + * When the method is "O"verwrite, then a positive integer index will overwrite that indexed + * entry in the print areas list; a negative index value will identify which entry to + * overwrite working bacward through the print area to the list, with the last entry as -1. + * Specifying an index value of 0, will overwrite <b>all</b> existing print ranges. + * When the method is "I"nsert, then a positive index will insert after that indexed entry in + * the print areas list, while a negative index will insert before the indexed entry. + * Specifying an index value of 0, will always append the new print range at the end of the + * list. + * Print areas are numbered from 1 + * @param string $method Determines the method used when setting multiple print areas + * Default behaviour, or the "O" method, overwrites existing print area + * The "I" method, inserts the new print area before any specified index, or at the end of the list + * @return PHPExcel_Worksheet_PageSetup + * @throws PHPExcel_Exception + */ + public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) + { + return $this->setPrintArea( + PHPExcel_Cell::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell::stringFromColumnIndex($column2) . $row2, + $index, + $method + ); + } + + /** + * Add a new print area to the list of print areas + * + * @param int $column1 Start Column for the print area + * @param int $row1 Start Row for the print area + * @param int $column2 End Column for the print area + * @param int $row2 End Row for the print area + * @param int $index Identifier for a specific print area range allowing several ranges to be set + * A positive index will insert after that indexed entry in the print areas list, while a + * negative index will insert before the indexed entry. + * Specifying an index value of 0, will always append the new print range at the end of the + * list. + * Print areas are numbered from 1 + * @return PHPExcel_Worksheet_PageSetup + * @throws PHPExcel_Exception + */ + public function addPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = -1) + { + return $this->setPrintArea( + PHPExcel_Cell::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell::stringFromColumnIndex($column2) . $row2, + $index, + self::SETPRINTRANGE_INSERT + ); + } + + /** + * Get first page number + * + * @return int + */ + public function getFirstPageNumber() + { + return $this->firstPageNumber; + } + + /** + * Set first page number + * + * @param int $value + * @return PHPExcel_Worksheet_HeaderFooter + */ + public function setFirstPageNumber($value = null) + { + $this->firstPageNumber = $value; + return $this; + } + + /** + * Reset first page number + * + * @return PHPExcel_Worksheet_HeaderFooter + */ + public function resetFirstPageNumber() + { + return $this->setFirstPageNumber(null); + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/Protection.php b/extend/PHPExcel/PHPExcel/Worksheet/Protection.php new file mode 100644 index 0000000..00633ee --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/Protection.php @@ -0,0 +1,581 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_Worksheet_Protection + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +class PHPExcel_Worksheet_Protection +{ + /** + * Sheet + * + * @var boolean + */ + private $sheet = false; + + /** + * Objects + * + * @var boolean + */ + private $objects = false; + + /** + * Scenarios + * + * @var boolean + */ + private $scenarios = false; + + /** + * Format cells + * + * @var boolean + */ + private $formatCells = false; + + /** + * Format columns + * + * @var boolean + */ + private $formatColumns = false; + + /** + * Format rows + * + * @var boolean + */ + private $formatRows = false; + + /** + * Insert columns + * + * @var boolean + */ + private $insertColumns = false; + + /** + * Insert rows + * + * @var boolean + */ + private $insertRows = false; + + /** + * Insert hyperlinks + * + * @var boolean + */ + private $insertHyperlinks = false; + + /** + * Delete columns + * + * @var boolean + */ + private $deleteColumns = false; + + /** + * Delete rows + * + * @var boolean + */ + private $deleteRows = false; + + /** + * Select locked cells + * + * @var boolean + */ + private $selectLockedCells = false; + + /** + * Sort + * + * @var boolean + */ + private $sort = false; + + /** + * AutoFilter + * + * @var boolean + */ + private $autoFilter = false; + + /** + * Pivot tables + * + * @var boolean + */ + private $pivotTables = false; + + /** + * Select unlocked cells + * + * @var boolean + */ + private $selectUnlockedCells = false; + + /** + * Password + * + * @var string + */ + private $password = ''; + + /** + * Create a new PHPExcel_Worksheet_Protection + */ + public function __construct() + { + } + + /** + * Is some sort of protection enabled? + * + * @return boolean + */ + public function isProtectionEnabled() + { + return $this->sheet || + $this->objects || + $this->scenarios || + $this->formatCells || + $this->formatColumns || + $this->formatRows || + $this->insertColumns || + $this->insertRows || + $this->insertHyperlinks || + $this->deleteColumns || + $this->deleteRows || + $this->selectLockedCells || + $this->sort || + $this->autoFilter || + $this->pivotTables || + $this->selectUnlockedCells; + } + + /** + * Get Sheet + * + * @return boolean + */ + public function getSheet() + { + return $this->sheet; + } + + /** + * Set Sheet + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Protection + */ + public function setSheet($pValue = false) + { + $this->sheet = $pValue; + return $this; + } + + /** + * Get Objects + * + * @return boolean + */ + public function getObjects() + { + return $this->objects; + } + + /** + * Set Objects + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Protection + */ + public function setObjects($pValue = false) + { + $this->objects = $pValue; + return $this; + } + + /** + * Get Scenarios + * + * @return boolean + */ + public function getScenarios() + { + return $this->scenarios; + } + + /** + * Set Scenarios + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Protection + */ + public function setScenarios($pValue = false) + { + $this->scenarios = $pValue; + return $this; + } + + /** + * Get FormatCells + * + * @return boolean + */ + public function getFormatCells() + { + return $this->formatCells; + } + + /** + * Set FormatCells + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Protection + */ + public function setFormatCells($pValue = false) + { + $this->formatCells = $pValue; + return $this; + } + + /** + * Get FormatColumns + * + * @return boolean + */ + public function getFormatColumns() + { + return $this->formatColumns; + } + + /** + * Set FormatColumns + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Protection + */ + public function setFormatColumns($pValue = false) + { + $this->formatColumns = $pValue; + return $this; + } + + /** + * Get FormatRows + * + * @return boolean + */ + public function getFormatRows() + { + return $this->formatRows; + } + + /** + * Set FormatRows + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Protection + */ + public function setFormatRows($pValue = false) + { + $this->formatRows = $pValue; + return $this; + } + + /** + * Get InsertColumns + * + * @return boolean + */ + public function getInsertColumns() + { + return $this->insertColumns; + } + + /** + * Set InsertColumns + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Protection + */ + public function setInsertColumns($pValue = false) + { + $this->insertColumns = $pValue; + return $this; + } + + /** + * Get InsertRows + * + * @return boolean + */ + public function getInsertRows() + { + return $this->insertRows; + } + + /** + * Set InsertRows + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Protection + */ + public function setInsertRows($pValue = false) + { + $this->insertRows = $pValue; + return $this; + } + + /** + * Get InsertHyperlinks + * + * @return boolean + */ + public function getInsertHyperlinks() + { + return $this->insertHyperlinks; + } + + /** + * Set InsertHyperlinks + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Protection + */ + public function setInsertHyperlinks($pValue = false) + { + $this->insertHyperlinks = $pValue; + return $this; + } + + /** + * Get DeleteColumns + * + * @return boolean + */ + public function getDeleteColumns() + { + return $this->deleteColumns; + } + + /** + * Set DeleteColumns + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Protection + */ + public function setDeleteColumns($pValue = false) + { + $this->deleteColumns = $pValue; + return $this; + } + + /** + * Get DeleteRows + * + * @return boolean + */ + public function getDeleteRows() + { + return $this->deleteRows; + } + + /** + * Set DeleteRows + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Protection + */ + public function setDeleteRows($pValue = false) + { + $this->deleteRows = $pValue; + return $this; + } + + /** + * Get SelectLockedCells + * + * @return boolean + */ + public function getSelectLockedCells() + { + return $this->selectLockedCells; + } + + /** + * Set SelectLockedCells + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Protection + */ + public function setSelectLockedCells($pValue = false) + { + $this->selectLockedCells = $pValue; + return $this; + } + + /** + * Get Sort + * + * @return boolean + */ + public function getSort() + { + return $this->sort; + } + + /** + * Set Sort + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Protection + */ + public function setSort($pValue = false) + { + $this->sort = $pValue; + return $this; + } + + /** + * Get AutoFilter + * + * @return boolean + */ + public function getAutoFilter() + { + return $this->autoFilter; + } + + /** + * Set AutoFilter + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Protection + */ + public function setAutoFilter($pValue = false) + { + $this->autoFilter = $pValue; + return $this; + } + + /** + * Get PivotTables + * + * @return boolean + */ + public function getPivotTables() + { + return $this->pivotTables; + } + + /** + * Set PivotTables + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Protection + */ + public function setPivotTables($pValue = false) + { + $this->pivotTables = $pValue; + return $this; + } + + /** + * Get SelectUnlockedCells + * + * @return boolean + */ + public function getSelectUnlockedCells() + { + return $this->selectUnlockedCells; + } + + /** + * Set SelectUnlockedCells + * + * @param boolean $pValue + * @return PHPExcel_Worksheet_Protection + */ + public function setSelectUnlockedCells($pValue = false) + { + $this->selectUnlockedCells = $pValue; + return $this; + } + + /** + * Get Password (hashed) + * + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * Set Password + * + * @param string $pValue + * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true + * @return PHPExcel_Worksheet_Protection + */ + public function setPassword($pValue = '', $pAlreadyHashed = false) + { + if (!$pAlreadyHashed) { + $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue); + } + $this->password = $pValue; + return $this; + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/Row.php b/extend/PHPExcel/PHPExcel/Worksheet/Row.php new file mode 100644 index 0000000..4f6034f --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/Row.php @@ -0,0 +1,86 @@ +<?php + +/** + * PHPExcel_Worksheet_Row + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_Row +{ + /** + * PHPExcel_Worksheet + * + * @var PHPExcel_Worksheet + */ + private $parent; + + /** + * Row index + * + * @var int + */ + private $rowIndex = 0; + + /** + * Create a new row + * + * @param PHPExcel_Worksheet $parent + * @param int $rowIndex + */ + public function __construct(PHPExcel_Worksheet $parent = null, $rowIndex = 1) + { + // Set parent and row index + $this->parent = $parent; + $this->rowIndex = $rowIndex; + } + + /** + * Destructor + */ + public function __destruct() + { + unset($this->parent); + } + + /** + * Get row index + * + * @return int + */ + public function getRowIndex() + { + return $this->rowIndex; + } + + /** + * Get cell iterator + * + * @param string $startColumn The column address at which to start iterating + * @param string $endColumn Optionally, the column address at which to stop iterating + * @return PHPExcel_Worksheet_CellIterator + */ + public function getCellIterator($startColumn = 'A', $endColumn = null) + { + return new PHPExcel_Worksheet_RowCellIterator($this->parent, $this->rowIndex, $startColumn, $endColumn); + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/RowCellIterator.php b/extend/PHPExcel/PHPExcel/Worksheet/RowCellIterator.php new file mode 100644 index 0000000..90eb9c9 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/RowCellIterator.php @@ -0,0 +1,225 @@ +<?php + +/** + * PHPExcel_Worksheet_RowCellIterator + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_RowCellIterator extends PHPExcel_Worksheet_CellIterator implements Iterator +{ + /** + * Row index + * + * @var int + */ + protected $rowIndex; + + /** + * Start position + * + * @var int + */ + protected $startColumn = 0; + + /** + * End position + * + * @var int + */ + protected $endColumn = 0; + + /** + * Create a new column iterator + * + * @param PHPExcel_Worksheet $subject The worksheet to iterate over + * @param integer $rowIndex The row that we want to iterate + * @param string $startColumn The column address at which to start iterating + * @param string $endColumn Optionally, the column address at which to stop iterating + */ + public function __construct(PHPExcel_Worksheet $subject = null, $rowIndex = 1, $startColumn = 'A', $endColumn = null) + { + // Set subject and row index + $this->subject = $subject; + $this->rowIndex = $rowIndex; + $this->resetEnd($endColumn); + $this->resetStart($startColumn); + } + + /** + * Destructor + */ + public function __destruct() + { + unset($this->subject); + } + + /** + * (Re)Set the start column and the current column pointer + * + * @param integer $startColumn The column address at which to start iterating + * @return PHPExcel_Worksheet_RowCellIterator + * @throws PHPExcel_Exception + */ + public function resetStart($startColumn = 'A') + { + $startColumnIndex = PHPExcel_Cell::columnIndexFromString($startColumn) - 1; + $this->startColumn = $startColumnIndex; + $this->adjustForExistingOnlyRange(); + $this->seek(PHPExcel_Cell::stringFromColumnIndex($this->startColumn)); + + return $this; + } + + /** + * (Re)Set the end column + * + * @param string $endColumn The column address at which to stop iterating + * @return PHPExcel_Worksheet_RowCellIterator + * @throws PHPExcel_Exception + */ + public function resetEnd($endColumn = null) + { + $endColumn = ($endColumn) ? $endColumn : $this->subject->getHighestColumn(); + $this->endColumn = PHPExcel_Cell::columnIndexFromString($endColumn) - 1; + $this->adjustForExistingOnlyRange(); + + return $this; + } + + /** + * Set the column pointer to the selected column + * + * @param string $column The column address to set the current pointer at + * @return PHPExcel_Worksheet_RowCellIterator + * @throws PHPExcel_Exception + */ + public function seek($column = 'A') + { + $column = PHPExcel_Cell::columnIndexFromString($column) - 1; + if (($column < $this->startColumn) || ($column > $this->endColumn)) { + throw new PHPExcel_Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})"); + } elseif ($this->onlyExistingCells && !($this->subject->cellExistsByColumnAndRow($column, $this->rowIndex))) { + throw new PHPExcel_Exception('In "IterateOnlyExistingCells" mode and Cell does not exist'); + } + $this->position = $column; + + return $this; + } + + /** + * Rewind the iterator to the starting column + */ + public function rewind() + { + $this->position = $this->startColumn; + } + + /** + * Return the current cell in this worksheet row + * + * @return PHPExcel_Cell + */ + public function current() + { + return $this->subject->getCellByColumnAndRow($this->position, $this->rowIndex); + } + + /** + * Return the current iterator key + * + * @return string + */ + public function key() + { + return PHPExcel_Cell::stringFromColumnIndex($this->position); + } + + /** + * Set the iterator to its next value + */ + public function next() + { + do { + ++$this->position; + } while (($this->onlyExistingCells) && + (!$this->subject->cellExistsByColumnAndRow($this->position, $this->rowIndex)) && + ($this->position <= $this->endColumn)); + } + + /** + * Set the iterator to its previous value + * + * @throws PHPExcel_Exception + */ + public function prev() + { + if ($this->position <= $this->startColumn) { + throw new PHPExcel_Exception( + "Column is already at the beginning of range (" . + PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . " - " . + PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . ")" + ); + } + + do { + --$this->position; + } while (($this->onlyExistingCells) && + (!$this->subject->cellExistsByColumnAndRow($this->position, $this->rowIndex)) && + ($this->position >= $this->startColumn)); + } + + /** + * Indicate if more columns exist in the worksheet range of columns that we're iterating + * + * @return boolean + */ + public function valid() + { + return $this->position <= $this->endColumn; + } + + /** + * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary + * + * @throws PHPExcel_Exception + */ + protected function adjustForExistingOnlyRange() + { + if ($this->onlyExistingCells) { + while ((!$this->subject->cellExistsByColumnAndRow($this->startColumn, $this->rowIndex)) && + ($this->startColumn <= $this->endColumn)) { + ++$this->startColumn; + } + if ($this->startColumn > $this->endColumn) { + throw new PHPExcel_Exception('No cells exist within the specified range'); + } + while ((!$this->subject->cellExistsByColumnAndRow($this->endColumn, $this->rowIndex)) && + ($this->endColumn >= $this->startColumn)) { + --$this->endColumn; + } + if ($this->endColumn < $this->startColumn) { + throw new PHPExcel_Exception('No cells exist within the specified range'); + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/RowDimension.php b/extend/PHPExcel/PHPExcel/Worksheet/RowDimension.php new file mode 100644 index 0000000..c147486 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/RowDimension.php @@ -0,0 +1,132 @@ +<?php + +/** + * PHPExcel_Worksheet_RowDimension + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_RowDimension extends PHPExcel_Worksheet_Dimension +{ + /** + * Row index + * + * @var int + */ + private $rowIndex; + + /** + * Row height (in pt) + * + * When this is set to a negative value, the row height should be ignored by IWriter + * + * @var double + */ + private $height = -1; + + /** + * ZeroHeight for Row? + * + * @var bool + */ + private $zeroHeight = false; + + /** + * Create a new PHPExcel_Worksheet_RowDimension + * + * @param int $pIndex Numeric row index + */ + public function __construct($pIndex = 0) + { + // Initialise values + $this->rowIndex = $pIndex; + + // set dimension as unformatted by default + parent::__construct(null); + } + + /** + * Get Row Index + * + * @return int + */ + public function getRowIndex() + { + return $this->rowIndex; + } + + /** + * Set Row Index + * + * @param int $pValue + * @return PHPExcel_Worksheet_RowDimension + */ + public function setRowIndex($pValue) + { + $this->rowIndex = $pValue; + return $this; + } + + /** + * Get Row Height + * + * @return double + */ + public function getRowHeight() + { + return $this->height; + } + + /** + * Set Row Height + * + * @param double $pValue + * @return PHPExcel_Worksheet_RowDimension + */ + public function setRowHeight($pValue = -1) + { + $this->height = $pValue; + return $this; + } + + /** + * Get ZeroHeight + * + * @return bool + */ + public function getZeroHeight() + { + return $this->zeroHeight; + } + + /** + * Set ZeroHeight + * + * @param bool $pValue + * @return PHPExcel_Worksheet_RowDimension + */ + public function setZeroHeight($pValue = false) + { + $this->zeroHeight = $pValue; + return $this; + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/RowIterator.php b/extend/PHPExcel/PHPExcel/Worksheet/RowIterator.php new file mode 100644 index 0000000..9ddb3e0 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/RowIterator.php @@ -0,0 +1,192 @@ +<?php + +/** + * PHPExcel_Worksheet_RowIterator + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_RowIterator implements Iterator +{ + /** + * PHPExcel_Worksheet to iterate + * + * @var PHPExcel_Worksheet + */ + private $subject; + + /** + * Current iterator position + * + * @var int + */ + private $position = 1; + + /** + * Start position + * + * @var int + */ + private $startRow = 1; + + + /** + * End position + * + * @var int + */ + private $endRow = 1; + + + /** + * Create a new row iterator + * + * @param PHPExcel_Worksheet $subject The worksheet to iterate over + * @param integer $startRow The row number at which to start iterating + * @param integer $endRow Optionally, the row number at which to stop iterating + */ + public function __construct(PHPExcel_Worksheet $subject, $startRow = 1, $endRow = null) + { + // Set subject + $this->subject = $subject; + $this->resetEnd($endRow); + $this->resetStart($startRow); + } + + /** + * Destructor + */ + public function __destruct() + { + unset($this->subject); + } + + /** + * (Re)Set the start row and the current row pointer + * + * @param integer $startRow The row number at which to start iterating + * @return PHPExcel_Worksheet_RowIterator + * @throws PHPExcel_Exception + */ + public function resetStart($startRow = 1) + { + if ($startRow > $this->subject->getHighestRow()) { + throw new PHPExcel_Exception("Start row ({$startRow}) is beyond highest row ({$this->subject->getHighestRow()})"); + } + + $this->startRow = $startRow; + if ($this->endRow < $this->startRow) { + $this->endRow = $this->startRow; + } + $this->seek($startRow); + + return $this; + } + + /** + * (Re)Set the end row + * + * @param integer $endRow The row number at which to stop iterating + * @return PHPExcel_Worksheet_RowIterator + */ + public function resetEnd($endRow = null) + { + $this->endRow = ($endRow) ? $endRow : $this->subject->getHighestRow(); + + return $this; + } + + /** + * Set the row pointer to the selected row + * + * @param integer $row The row number to set the current pointer at + * @return PHPExcel_Worksheet_RowIterator + * @throws PHPExcel_Exception + */ + public function seek($row = 1) + { + if (($row < $this->startRow) || ($row > $this->endRow)) { + throw new PHPExcel_Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})"); + } + $this->position = $row; + + return $this; + } + + /** + * Rewind the iterator to the starting row + */ + public function rewind() + { + $this->position = $this->startRow; + } + + /** + * Return the current row in this worksheet + * + * @return PHPExcel_Worksheet_Row + */ + public function current() + { + return new PHPExcel_Worksheet_Row($this->subject, $this->position); + } + + /** + * Return the current iterator key + * + * @return int + */ + public function key() + { + return $this->position; + } + + /** + * Set the iterator to its next value + */ + public function next() + { + ++$this->position; + } + + /** + * Set the iterator to its previous value + */ + public function prev() + { + if ($this->position <= $this->startRow) { + throw new PHPExcel_Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})"); + } + + --$this->position; + } + + /** + * Indicate if more rows exist in the worksheet range of rows that we're iterating + * + * @return boolean + */ + public function valid() + { + return $this->position <= $this->endRow; + } +} diff --git a/extend/PHPExcel/PHPExcel/Worksheet/SheetView.php b/extend/PHPExcel/PHPExcel/Worksheet/SheetView.php new file mode 100644 index 0000000..5aaef3b --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Worksheet/SheetView.php @@ -0,0 +1,187 @@ +<?php + +/** + * PHPExcel_Worksheet_SheetView + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Worksheet + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Worksheet_SheetView +{ + + /* Sheet View types */ + const SHEETVIEW_NORMAL = 'normal'; + const SHEETVIEW_PAGE_LAYOUT = 'pageLayout'; + const SHEETVIEW_PAGE_BREAK_PREVIEW = 'pageBreakPreview'; + + private static $sheetViewTypes = array( + self::SHEETVIEW_NORMAL, + self::SHEETVIEW_PAGE_LAYOUT, + self::SHEETVIEW_PAGE_BREAK_PREVIEW, + ); + + /** + * ZoomScale + * + * Valid values range from 10 to 400. + * + * @var int + */ + private $zoomScale = 100; + + /** + * ZoomScaleNormal + * + * Valid values range from 10 to 400. + * + * @var int + */ + private $zoomScaleNormal = 100; + + /** + * View + * + * Valid values range from 10 to 400. + * + * @var string + */ + private $sheetviewType = self::SHEETVIEW_NORMAL; + + /** + * Create a new PHPExcel_Worksheet_SheetView + */ + public function __construct() + { + } + + /** + * Get ZoomScale + * + * @return int + */ + public function getZoomScale() + { + return $this->zoomScale; + } + + /** + * Set ZoomScale + * + * Valid values range from 10 to 400. + * + * @param int $pValue + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_SheetView + */ + public function setZoomScale($pValue = 100) + { + // Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface, + // but it is apparently still able to handle any scale >= 1 + if (($pValue >= 1) || is_null($pValue)) { + $this->zoomScale = $pValue; + } else { + throw new PHPExcel_Exception("Scale must be greater than or equal to 1."); + } + return $this; + } + + /** + * Get ZoomScaleNormal + * + * @return int + */ + public function getZoomScaleNormal() + { + return $this->zoomScaleNormal; + } + + /** + * Set ZoomScale + * + * Valid values range from 10 to 400. + * + * @param int $pValue + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_SheetView + */ + public function setZoomScaleNormal($pValue = 100) + { + if (($pValue >= 1) || is_null($pValue)) { + $this->zoomScaleNormal = $pValue; + } else { + throw new PHPExcel_Exception("Scale must be greater than or equal to 1."); + } + return $this; + } + + /** + * Get View + * + * @return string + */ + public function getView() + { + return $this->sheetviewType; + } + + /** + * Set View + * + * Valid values are + * 'normal' self::SHEETVIEW_NORMAL + * 'pageLayout' self::SHEETVIEW_PAGE_LAYOUT + * 'pageBreakPreview' self::SHEETVIEW_PAGE_BREAK_PREVIEW + * + * @param string $pValue + * @throws PHPExcel_Exception + * @return PHPExcel_Worksheet_SheetView + */ + public function setView($pValue = null) + { + // MS Excel 2007 allows setting the view to 'normal', 'pageLayout' or 'pageBreakPreview' via the user interface + if ($pValue === null) { + $pValue = self::SHEETVIEW_NORMAL; + } + if (in_array($pValue, self::$sheetViewTypes)) { + $this->sheetviewType = $pValue; + } else { + throw new PHPExcel_Exception("Invalid sheetview layout type."); + } + + return $this; + } + + /** + * Implement PHP __clone to create a deep clone, not just a shallow copy. + */ + public function __clone() + { + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + if (is_object($value)) { + $this->$key = clone $value; + } else { + $this->$key = $value; + } + } + } +} diff --git a/extend/PHPExcel/PHPExcel/WorksheetIterator.php b/extend/PHPExcel/PHPExcel/WorksheetIterator.php new file mode 100644 index 0000000..cb1b281 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/WorksheetIterator.php @@ -0,0 +1,108 @@ +<?php + +/** + * PHPExcel_WorksheetIterator + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_WorksheetIterator implements Iterator +{ + /** + * Spreadsheet to iterate + * + * @var PHPExcel + */ + private $subject; + + /** + * Current iterator position + * + * @var int + */ + private $position = 0; + + /** + * Create a new worksheet iterator + * + * @param PHPExcel $subject + */ + public function __construct(PHPExcel $subject = null) + { + // Set subject + $this->subject = $subject; + } + + /** + * Destructor + */ + public function __destruct() + { + unset($this->subject); + } + + /** + * Rewind iterator + */ + public function rewind() + { + $this->position = 0; + } + + /** + * Current PHPExcel_Worksheet + * + * @return PHPExcel_Worksheet + */ + public function current() + { + return $this->subject->getSheet($this->position); + } + + /** + * Current key + * + * @return int + */ + public function key() + { + return $this->position; + } + + /** + * Next value + */ + public function next() + { + ++$this->position; + } + + /** + * More PHPExcel_Worksheet instances available? + * + * @return boolean + */ + public function valid() + { + return $this->position < $this->subject->getSheetCount(); + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Abstract.php b/extend/PHPExcel/PHPExcel/Writer/Abstract.php new file mode 100644 index 0000000..2a797a9 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Abstract.php @@ -0,0 +1,157 @@ +<?php + +/** + * PHPExcel_Writer_Abstract + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +abstract class PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter +{ + /** + * Write charts that are defined in the workbook? + * Identifies whether the Writer should write definitions for any charts that exist in the PHPExcel object; + * + * @var boolean + */ + protected $includeCharts = false; + + /** + * Pre-calculate formulas + * Forces PHPExcel to recalculate all formulae in a workbook when saving, so that the pre-calculated values are + * immediately available to MS Excel or other office spreadsheet viewer when opening the file + * + * @var boolean + */ + protected $preCalculateFormulas = true; + + /** + * Use disk caching where possible? + * + * @var boolean + */ + protected $_useDiskCaching = false; + + /** + * Disk caching directory + * + * @var string + */ + protected $_diskCachingDirectory = './'; + + /** + * Write charts in workbook? + * If this is true, then the Writer will write definitions for any charts that exist in the PHPExcel object. + * If false (the default) it will ignore any charts defined in the PHPExcel object. + * + * @return boolean + */ + public function getIncludeCharts() + { + return $this->includeCharts; + } + + /** + * Set write charts in workbook + * Set to true, to advise the Writer to include any charts that exist in the PHPExcel object. + * Set to false (the default) to ignore charts. + * + * @param boolean $pValue + * @return PHPExcel_Writer_IWriter + */ + public function setIncludeCharts($pValue = false) + { + $this->includeCharts = (boolean) $pValue; + return $this; + } + + /** + * Get Pre-Calculate Formulas flag + * If this is true (the default), then the writer will recalculate all formulae in a workbook when saving, + * so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet + * viewer when opening the file + * If false, then formulae are not calculated on save. This is faster for saving in PHPExcel, but slower + * when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself + * + * @return boolean + */ + public function getPreCalculateFormulas() + { + return $this->preCalculateFormulas; + } + + /** + * Set Pre-Calculate Formulas + * Set to true (the default) to advise the Writer to calculate all formulae on save + * Set to false to prevent precalculation of formulae on save. + * + * @param boolean $pValue Pre-Calculate Formulas? + * @return PHPExcel_Writer_IWriter + */ + public function setPreCalculateFormulas($pValue = true) + { + $this->preCalculateFormulas = (boolean) $pValue; + return $this; + } + + /** + * Get use disk caching where possible? + * + * @return boolean + */ + public function getUseDiskCaching() + { + return $this->_useDiskCaching; + } + + /** + * Set use disk caching where possible? + * + * @param boolean $pValue + * @param string $pDirectory Disk caching directory + * @throws PHPExcel_Writer_Exception when directory does not exist + * @return PHPExcel_Writer_Excel2007 + */ + public function setUseDiskCaching($pValue = false, $pDirectory = null) + { + $this->_useDiskCaching = $pValue; + + if ($pDirectory !== null) { + if (is_dir($pDirectory)) { + $this->_diskCachingDirectory = $pDirectory; + } else { + throw new PHPExcel_Writer_Exception("Directory does not exist: $pDirectory"); + } + } + return $this; + } + + /** + * Get disk caching directory + * + * @return string + */ + public function getDiskCachingDirectory() + { + return $this->_diskCachingDirectory; + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/CSV.php b/extend/PHPExcel/PHPExcel/Writer/CSV.php new file mode 100644 index 0000000..e59c301 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/CSV.php @@ -0,0 +1,352 @@ +<?php + +/** + * PHPExcel_Writer_CSV + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_CSV + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter +{ + /** + * PHPExcel object + * + * @var PHPExcel + */ + private $phpExcel; + + /** + * Delimiter + * + * @var string + */ + private $delimiter = ','; + + /** + * Enclosure + * + * @var string + */ + private $enclosure = '"'; + + /** + * Line ending + * + * @var string + */ + private $lineEnding = PHP_EOL; + + /** + * Sheet index to write + * + * @var int + */ + private $sheetIndex = 0; + + /** + * Whether to write a BOM (for UTF8). + * + * @var boolean + */ + private $useBOM = false; + + /** + * Whether to write a Separator line as the first line of the file + * sep=x + * + * @var boolean + */ + private $includeSeparatorLine = false; + + /** + * Whether to write a fully Excel compatible CSV file. + * + * @var boolean + */ + private $excelCompatibility = false; + + /** + * Create a new PHPExcel_Writer_CSV + * + * @param PHPExcel $phpExcel PHPExcel object + */ + public function __construct(PHPExcel $phpExcel) + { + $this->phpExcel = $phpExcel; + } + + /** + * Save PHPExcel to file + * + * @param string $pFilename + * @throws PHPExcel_Writer_Exception + */ + public function save($pFilename = null) + { + // Fetch sheet + $sheet = $this->phpExcel->getSheet($this->sheetIndex); + + $saveDebugLog = PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->getWriteDebugLog(); + PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog(false); + $saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType(); + PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE); + + // Open file + $fileHandle = fopen($pFilename, 'wb+'); + if ($fileHandle === false) { + throw new PHPExcel_Writer_Exception("Could not open file $pFilename for writing."); + } + + if ($this->excelCompatibility) { + $this->setUseBOM(true); // Enforce UTF-8 BOM Header + $this->setIncludeSeparatorLine(true); // Set separator line + $this->setEnclosure('"'); // Set enclosure to " + $this->setDelimiter(";"); // Set delimiter to a semi-colon + $this->setLineEnding("\r\n"); + } + if ($this->useBOM) { + // Write the UTF-8 BOM code if required + fwrite($fileHandle, "\xEF\xBB\xBF"); + } + if ($this->includeSeparatorLine) { + // Write the separator line if required + fwrite($fileHandle, 'sep=' . $this->getDelimiter() . $this->lineEnding); + } + + // Identify the range that we need to extract from the worksheet + $maxCol = $sheet->getHighestDataColumn(); + $maxRow = $sheet->getHighestDataRow(); + + // Write rows to file + for ($row = 1; $row <= $maxRow; ++$row) { + // Convert the row to an array... + $cellsArray = $sheet->rangeToArray('A'.$row.':'.$maxCol.$row, '', $this->preCalculateFormulas); + // ... and write to the file + $this->writeLine($fileHandle, $cellsArray[0]); + } + + // Close file + fclose($fileHandle); + + PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType); + PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog($saveDebugLog); + } + + /** + * Get delimiter + * + * @return string + */ + public function getDelimiter() + { + return $this->delimiter; + } + + /** + * Set delimiter + * + * @param string $pValue Delimiter, defaults to , + * @return PHPExcel_Writer_CSV + */ + public function setDelimiter($pValue = ',') + { + $this->delimiter = $pValue; + return $this; + } + + /** + * Get enclosure + * + * @return string + */ + public function getEnclosure() + { + return $this->enclosure; + } + + /** + * Set enclosure + * + * @param string $pValue Enclosure, defaults to " + * @return PHPExcel_Writer_CSV + */ + public function setEnclosure($pValue = '"') + { + if ($pValue == '') { + $pValue = null; + } + $this->enclosure = $pValue; + return $this; + } + + /** + * Get line ending + * + * @return string + */ + public function getLineEnding() + { + return $this->lineEnding; + } + + /** + * Set line ending + * + * @param string $pValue Line ending, defaults to OS line ending (PHP_EOL) + * @return PHPExcel_Writer_CSV + */ + public function setLineEnding($pValue = PHP_EOL) + { + $this->lineEnding = $pValue; + return $this; + } + + /** + * Get whether BOM should be used + * + * @return boolean + */ + public function getUseBOM() + { + return $this->useBOM; + } + + /** + * Set whether BOM should be used + * + * @param boolean $pValue Use UTF-8 byte-order mark? Defaults to false + * @return PHPExcel_Writer_CSV + */ + public function setUseBOM($pValue = false) + { + $this->useBOM = $pValue; + return $this; + } + + /** + * Get whether a separator line should be included + * + * @return boolean + */ + public function getIncludeSeparatorLine() + { + return $this->includeSeparatorLine; + } + + /** + * Set whether a separator line should be included as the first line of the file + * + * @param boolean $pValue Use separator line? Defaults to false + * @return PHPExcel_Writer_CSV + */ + public function setIncludeSeparatorLine($pValue = false) + { + $this->includeSeparatorLine = $pValue; + return $this; + } + + /** + * Get whether the file should be saved with full Excel Compatibility + * + * @return boolean + */ + public function getExcelCompatibility() + { + return $this->excelCompatibility; + } + + /** + * Set whether the file should be saved with full Excel Compatibility + * + * @param boolean $pValue Set the file to be written as a fully Excel compatible csv file + * Note that this overrides other settings such as useBOM, enclosure and delimiter + * @return PHPExcel_Writer_CSV + */ + public function setExcelCompatibility($pValue = false) + { + $this->excelCompatibility = $pValue; + return $this; + } + + /** + * Get sheet index + * + * @return int + */ + public function getSheetIndex() + { + return $this->sheetIndex; + } + + /** + * Set sheet index + * + * @param int $pValue Sheet index + * @return PHPExcel_Writer_CSV + */ + public function setSheetIndex($pValue = 0) + { + $this->sheetIndex = $pValue; + return $this; + } + + /** + * Write line to CSV file + * + * @param mixed $pFileHandle PHP filehandle + * @param array $pValues Array containing values in a row + * @throws PHPExcel_Writer_Exception + */ + private function writeLine($pFileHandle = null, $pValues = null) + { + if (is_array($pValues)) { + // No leading delimiter + $writeDelimiter = false; + + // Build the line + $line = ''; + + foreach ($pValues as $element) { + // Escape enclosures + $element = str_replace($this->enclosure, $this->enclosure . $this->enclosure, $element); + + // Add delimiter + if ($writeDelimiter) { + $line .= $this->delimiter; + } else { + $writeDelimiter = true; + } + + // Add enclosed string + $line .= $this->enclosure . $element . $this->enclosure; + } + + // Add line ending + $line .= $this->lineEnding; + + // Write to file + fwrite($pFileHandle, $line); + } else { + throw new PHPExcel_Writer_Exception("Invalid data row passed to CSV writer."); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel2007.php b/extend/PHPExcel/PHPExcel/Writer/Excel2007.php new file mode 100644 index 0000000..11d354b --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel2007.php @@ -0,0 +1,533 @@ +<?php + +/** + * PHPExcel_Writer_Excel2007 + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter +{ + /** + * Pre-calculate formulas + * Forces PHPExcel to recalculate all formulae in a workbook when saving, so that the pre-calculated values are + * immediately available to MS Excel or other office spreadsheet viewer when opening the file + * + * Overrides the default TRUE for this specific writer for performance reasons + * + * @var boolean + */ + protected $preCalculateFormulas = false; + + /** + * Office2003 compatibility + * + * @var boolean + */ + private $office2003compatibility = false; + + /** + * Private writer parts + * + * @var PHPExcel_Writer_Excel2007_WriterPart[] + */ + private $writerParts = array(); + + /** + * Private PHPExcel + * + * @var PHPExcel + */ + private $spreadSheet; + + /** + * Private string table + * + * @var string[] + */ + private $stringTable = array(); + + /** + * Private unique PHPExcel_Style_Conditional HashTable + * + * @var PHPExcel_HashTable + */ + private $stylesConditionalHashTable; + + /** + * Private unique PHPExcel_Style HashTable + * + * @var PHPExcel_HashTable + */ + private $styleHashTable; + + /** + * Private unique PHPExcel_Style_Fill HashTable + * + * @var PHPExcel_HashTable + */ + private $fillHashTable; + + /** + * Private unique PHPExcel_Style_Font HashTable + * + * @var PHPExcel_HashTable + */ + private $fontHashTable; + + /** + * Private unique PHPExcel_Style_Borders HashTable + * + * @var PHPExcel_HashTable + */ + private $bordersHashTable ; + + /** + * Private unique PHPExcel_Style_NumberFormat HashTable + * + * @var PHPExcel_HashTable + */ + private $numFmtHashTable; + + /** + * Private unique PHPExcel_Worksheet_BaseDrawing HashTable + * + * @var PHPExcel_HashTable + */ + private $drawingHashTable; + + /** + * Create a new PHPExcel_Writer_Excel2007 + * + * @param PHPExcel $pPHPExcel + */ + public function __construct(PHPExcel $pPHPExcel = null) + { + // Assign PHPExcel + $this->setPHPExcel($pPHPExcel); + + $writerPartsArray = array( 'stringtable' => 'PHPExcel_Writer_Excel2007_StringTable', + 'contenttypes' => 'PHPExcel_Writer_Excel2007_ContentTypes', + 'docprops' => 'PHPExcel_Writer_Excel2007_DocProps', + 'rels' => 'PHPExcel_Writer_Excel2007_Rels', + 'theme' => 'PHPExcel_Writer_Excel2007_Theme', + 'style' => 'PHPExcel_Writer_Excel2007_Style', + 'workbook' => 'PHPExcel_Writer_Excel2007_Workbook', + 'worksheet' => 'PHPExcel_Writer_Excel2007_Worksheet', + 'drawing' => 'PHPExcel_Writer_Excel2007_Drawing', + 'comments' => 'PHPExcel_Writer_Excel2007_Comments', + 'chart' => 'PHPExcel_Writer_Excel2007_Chart', + 'relsvba' => 'PHPExcel_Writer_Excel2007_RelsVBA', + 'relsribbonobjects' => 'PHPExcel_Writer_Excel2007_RelsRibbon' + ); + + // Initialise writer parts + // and Assign their parent IWriters + foreach ($writerPartsArray as $writer => $class) { + $this->writerParts[$writer] = new $class($this); + } + + $hashTablesArray = array( 'stylesConditionalHashTable', 'fillHashTable', 'fontHashTable', + 'bordersHashTable', 'numFmtHashTable', 'drawingHashTable', + 'styleHashTable' + ); + + // Set HashTable variables + foreach ($hashTablesArray as $tableName) { + $this->$tableName = new PHPExcel_HashTable(); + } + } + + /** + * Get writer part + * + * @param string $pPartName Writer part name + * @return PHPExcel_Writer_Excel2007_WriterPart + */ + public function getWriterPart($pPartName = '') + { + if ($pPartName != '' && isset($this->writerParts[strtolower($pPartName)])) { + return $this->writerParts[strtolower($pPartName)]; + } else { + return null; + } + } + + /** + * Save PHPExcel to file + * + * @param string $pFilename + * @throws PHPExcel_Writer_Exception + */ + public function save($pFilename = null) + { + if ($this->spreadSheet !== null) { + // garbage collect + $this->spreadSheet->garbageCollect(); + + // If $pFilename is php://output or php://stdout, make it a temporary file... + $originalFilename = $pFilename; + if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') { + $pFilename = @tempnam(PHPExcel_Shared_File::sys_get_temp_dir(), 'phpxltmp'); + if ($pFilename == '') { + $pFilename = $originalFilename; + } + } + + $saveDebugLog = PHPExcel_Calculation::getInstance($this->spreadSheet)->getDebugLog()->getWriteDebugLog(); + PHPExcel_Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog(false); + $saveDateReturnType = PHPExcel_Calculation_Functions::getReturnDateType(); + PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); + + // Create string lookup table + $this->stringTable = array(); + for ($i = 0; $i < $this->spreadSheet->getSheetCount(); ++$i) { + $this->stringTable = $this->getWriterPart('StringTable')->createStringTable($this->spreadSheet->getSheet($i), $this->stringTable); + } + + // Create styles dictionaries + $this->styleHashTable->addFromSource($this->getWriterPart('Style')->allStyles($this->spreadSheet)); + $this->stylesConditionalHashTable->addFromSource($this->getWriterPart('Style')->allConditionalStyles($this->spreadSheet)); + $this->fillHashTable->addFromSource($this->getWriterPart('Style')->allFills($this->spreadSheet)); + $this->fontHashTable->addFromSource($this->getWriterPart('Style')->allFonts($this->spreadSheet)); + $this->bordersHashTable->addFromSource($this->getWriterPart('Style')->allBorders($this->spreadSheet)); + $this->numFmtHashTable->addFromSource($this->getWriterPart('Style')->allNumberFormats($this->spreadSheet)); + + // Create drawing dictionary + $this->drawingHashTable->addFromSource($this->getWriterPart('Drawing')->allDrawings($this->spreadSheet)); + + // Create new ZIP file and open it for writing + $zipClass = PHPExcel_Settings::getZipClass(); + $objZip = new $zipClass(); + + // Retrieve OVERWRITE and CREATE constants from the instantiated zip class + // This method of accessing constant values from a dynamic class should work with all appropriate versions of PHP + $ro = new ReflectionObject($objZip); + $zipOverWrite = $ro->getConstant('OVERWRITE'); + $zipCreate = $ro->getConstant('CREATE'); + + if (file_exists($pFilename)) { + unlink($pFilename); + } + // Try opening the ZIP file + if ($objZip->open($pFilename, $zipOverWrite) !== true) { + if ($objZip->open($pFilename, $zipCreate) !== true) { + throw new PHPExcel_Writer_Exception("Could not open " . $pFilename . " for writing."); + } + } + + // Add [Content_Types].xml to ZIP file + $objZip->addFromString('[Content_Types].xml', $this->getWriterPart('ContentTypes')->writeContentTypes($this->spreadSheet, $this->includeCharts)); + + //if hasMacros, add the vbaProject.bin file, Certificate file(if exists) + if ($this->spreadSheet->hasMacros()) { + $macrosCode=$this->spreadSheet->getMacrosCode(); + if (!is_null($macrosCode)) {// we have the code ? + $objZip->addFromString('xl/vbaProject.bin', $macrosCode);//allways in 'xl', allways named vbaProject.bin + if ($this->spreadSheet->hasMacrosCertificate()) {//signed macros ? + // Yes : add the certificate file and the related rels file + $objZip->addFromString('xl/vbaProjectSignature.bin', $this->spreadSheet->getMacrosCertificate()); + $objZip->addFromString('xl/_rels/vbaProject.bin.rels', $this->getWriterPart('RelsVBA')->writeVBARelationships($this->spreadSheet)); + } + } + } + //a custom UI in this workbook ? add it ("base" xml and additional objects (pictures) and rels) + if ($this->spreadSheet->hasRibbon()) { + $tmpRibbonTarget=$this->spreadSheet->getRibbonXMLData('target'); + $objZip->addFromString($tmpRibbonTarget, $this->spreadSheet->getRibbonXMLData('data')); + if ($this->spreadSheet->hasRibbonBinObjects()) { + $tmpRootPath=dirname($tmpRibbonTarget).'/'; + $ribbonBinObjects=$this->spreadSheet->getRibbonBinObjects('data');//the files to write + foreach ($ribbonBinObjects as $aPath => $aContent) { + $objZip->addFromString($tmpRootPath.$aPath, $aContent); + } + //the rels for files + $objZip->addFromString($tmpRootPath.'_rels/'.basename($tmpRibbonTarget).'.rels', $this->getWriterPart('RelsRibbonObjects')->writeRibbonRelationships($this->spreadSheet)); + } + } + + // Add relationships to ZIP file + $objZip->addFromString('_rels/.rels', $this->getWriterPart('Rels')->writeRelationships($this->spreadSheet)); + $objZip->addFromString('xl/_rels/workbook.xml.rels', $this->getWriterPart('Rels')->writeWorkbookRelationships($this->spreadSheet)); + + // Add document properties to ZIP file + $objZip->addFromString('docProps/app.xml', $this->getWriterPart('DocProps')->writeDocPropsApp($this->spreadSheet)); + $objZip->addFromString('docProps/core.xml', $this->getWriterPart('DocProps')->writeDocPropsCore($this->spreadSheet)); + $customPropertiesPart = $this->getWriterPart('DocProps')->writeDocPropsCustom($this->spreadSheet); + if ($customPropertiesPart !== null) { + $objZip->addFromString('docProps/custom.xml', $customPropertiesPart); + } + + // Add theme to ZIP file + $objZip->addFromString('xl/theme/theme1.xml', $this->getWriterPart('Theme')->writeTheme($this->spreadSheet)); + + // Add string table to ZIP file + $objZip->addFromString('xl/sharedStrings.xml', $this->getWriterPart('StringTable')->writeStringTable($this->stringTable)); + + // Add styles to ZIP file + $objZip->addFromString('xl/styles.xml', $this->getWriterPart('Style')->writeStyles($this->spreadSheet)); + + // Add workbook to ZIP file + $objZip->addFromString('xl/workbook.xml', $this->getWriterPart('Workbook')->writeWorkbook($this->spreadSheet, $this->preCalculateFormulas)); + + $chartCount = 0; + // Add worksheets + for ($i = 0; $i < $this->spreadSheet->getSheetCount(); ++$i) { + $objZip->addFromString('xl/worksheets/sheet' . ($i + 1) . '.xml', $this->getWriterPart('Worksheet')->writeWorksheet($this->spreadSheet->getSheet($i), $this->stringTable, $this->includeCharts)); + if ($this->includeCharts) { + $charts = $this->spreadSheet->getSheet($i)->getChartCollection(); + if (count($charts) > 0) { + foreach ($charts as $chart) { + $objZip->addFromString('xl/charts/chart' . ($chartCount + 1) . '.xml', $this->getWriterPart('Chart')->writeChart($chart, $this->preCalculateFormulas)); + $chartCount++; + } + } + } + } + + $chartRef1 = $chartRef2 = 0; + // Add worksheet relationships (drawings, ...) + for ($i = 0; $i < $this->spreadSheet->getSheetCount(); ++$i) { + // Add relationships + $objZip->addFromString('xl/worksheets/_rels/sheet' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeWorksheetRelationships($this->spreadSheet->getSheet($i), ($i + 1), $this->includeCharts)); + + $drawings = $this->spreadSheet->getSheet($i)->getDrawingCollection(); + $drawingCount = count($drawings); + if ($this->includeCharts) { + $chartCount = $this->spreadSheet->getSheet($i)->getChartCount(); + } + + // Add drawing and image relationship parts + if (($drawingCount > 0) || ($chartCount > 0)) { + // Drawing relationships + $objZip->addFromString('xl/drawings/_rels/drawing' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeDrawingRelationships($this->spreadSheet->getSheet($i), $chartRef1, $this->includeCharts)); + + // Drawings + $objZip->addFromString('xl/drawings/drawing' . ($i + 1) . '.xml', $this->getWriterPart('Drawing')->writeDrawings($this->spreadSheet->getSheet($i), $chartRef2, $this->includeCharts)); + } + + // Add comment relationship parts + if (count($this->spreadSheet->getSheet($i)->getComments()) > 0) { + // VML Comments + $objZip->addFromString('xl/drawings/vmlDrawing' . ($i + 1) . '.vml', $this->getWriterPart('Comments')->writeVMLComments($this->spreadSheet->getSheet($i))); + + // Comments + $objZip->addFromString('xl/comments' . ($i + 1) . '.xml', $this->getWriterPart('Comments')->writeComments($this->spreadSheet->getSheet($i))); + } + + // Add header/footer relationship parts + if (count($this->spreadSheet->getSheet($i)->getHeaderFooter()->getImages()) > 0) { + // VML Drawings + $objZip->addFromString('xl/drawings/vmlDrawingHF' . ($i + 1) . '.vml', $this->getWriterPart('Drawing')->writeVMLHeaderFooterImages($this->spreadSheet->getSheet($i))); + + // VML Drawing relationships + $objZip->addFromString('xl/drawings/_rels/vmlDrawingHF' . ($i + 1) . '.vml.rels', $this->getWriterPart('Rels')->writeHeaderFooterDrawingRelationships($this->spreadSheet->getSheet($i))); + + // Media + foreach ($this->spreadSheet->getSheet($i)->getHeaderFooter()->getImages() as $image) { + $objZip->addFromString('xl/media/' . $image->getIndexedFilename(), file_get_contents($image->getPath())); + } + } + } + + // Add media + for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) { + if ($this->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_Drawing) { + $imageContents = null; + $imagePath = $this->getDrawingHashTable()->getByIndex($i)->getPath(); + if (strpos($imagePath, 'zip://') !== false) { + $imagePath = substr($imagePath, 6); + $imagePathSplitted = explode('#', $imagePath); + + $imageZip = new ZipArchive(); + $imageZip->open($imagePathSplitted[0]); + $imageContents = $imageZip->getFromName($imagePathSplitted[1]); + $imageZip->close(); + unset($imageZip); + } else { + $imageContents = file_get_contents($imagePath); + } + + $objZip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents); + } elseif ($this->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_MemoryDrawing) { + ob_start(); + call_user_func( + $this->getDrawingHashTable()->getByIndex($i)->getRenderingFunction(), + $this->getDrawingHashTable()->getByIndex($i)->getImageResource() + ); + $imageContents = ob_get_contents(); + ob_end_clean(); + + $objZip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents); + } + } + + PHPExcel_Calculation_Functions::setReturnDateType($saveDateReturnType); + PHPExcel_Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog($saveDebugLog); + + // Close file + if ($objZip->close() === false) { + throw new PHPExcel_Writer_Exception("Could not close zip file $pFilename."); + } + + // If a temporary file was used, copy it to the correct file stream + if ($originalFilename != $pFilename) { + if (copy($pFilename, $originalFilename) === false) { + throw new PHPExcel_Writer_Exception("Could not copy temporary zip file $pFilename to $originalFilename."); + } + @unlink($pFilename); + } + } else { + throw new PHPExcel_Writer_Exception("PHPExcel object unassigned."); + } + } + + /** + * Get PHPExcel object + * + * @return PHPExcel + * @throws PHPExcel_Writer_Exception + */ + public function getPHPExcel() + { + if ($this->spreadSheet !== null) { + return $this->spreadSheet; + } else { + throw new PHPExcel_Writer_Exception("No PHPExcel object assigned."); + } + } + + /** + * Set PHPExcel object + * + * @param PHPExcel $pPHPExcel PHPExcel object + * @throws PHPExcel_Writer_Exception + * @return PHPExcel_Writer_Excel2007 + */ + public function setPHPExcel(PHPExcel $pPHPExcel = null) + { + $this->spreadSheet = $pPHPExcel; + return $this; + } + + /** + * Get string table + * + * @return string[] + */ + public function getStringTable() + { + return $this->stringTable; + } + + /** + * Get PHPExcel_Style HashTable + * + * @return PHPExcel_HashTable + */ + public function getStyleHashTable() + { + return $this->styleHashTable; + } + + /** + * Get PHPExcel_Style_Conditional HashTable + * + * @return PHPExcel_HashTable + */ + public function getStylesConditionalHashTable() + { + return $this->stylesConditionalHashTable; + } + + /** + * Get PHPExcel_Style_Fill HashTable + * + * @return PHPExcel_HashTable + */ + public function getFillHashTable() + { + return $this->fillHashTable; + } + + /** + * Get PHPExcel_Style_Font HashTable + * + * @return PHPExcel_HashTable + */ + public function getFontHashTable() + { + return $this->fontHashTable; + } + + /** + * Get PHPExcel_Style_Borders HashTable + * + * @return PHPExcel_HashTable + */ + public function getBordersHashTable() + { + return $this->bordersHashTable; + } + + /** + * Get PHPExcel_Style_NumberFormat HashTable + * + * @return PHPExcel_HashTable + */ + public function getNumFmtHashTable() + { + return $this->numFmtHashTable; + } + + /** + * Get PHPExcel_Worksheet_BaseDrawing HashTable + * + * @return PHPExcel_HashTable + */ + public function getDrawingHashTable() + { + return $this->drawingHashTable; + } + + /** + * Get Office2003 compatibility + * + * @return boolean + */ + public function getOffice2003Compatibility() + { + return $this->office2003compatibility; + } + + /** + * Set Office2003 compatibility + * + * @param boolean $pValue Office2003 compatibility? + * @return PHPExcel_Writer_Excel2007 + */ + public function setOffice2003Compatibility($pValue = false) + { + $this->office2003compatibility = $pValue; + return $this; + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel2007/Chart.php b/extend/PHPExcel/PHPExcel/Writer/Excel2007/Chart.php new file mode 100644 index 0000000..92fa215 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel2007/Chart.php @@ -0,0 +1,1520 @@ +<?php + +/** + * PHPExcel_Writer_Excel2007_Chart + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPart +{ + protected $calculateCellValues; + + /** + * Write charts to XML format + * + * @param PHPExcel_Chart $pChart + * + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeChart(PHPExcel_Chart $pChart = null, $calculateCellValues = true) + { + $this->calculateCellValues = $calculateCellValues; + + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + // Ensure that data series values are up-to-date before we save + if ($this->calculateCellValues) { + $pChart->refresh(); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // c:chartSpace + $objWriter->startElement('c:chartSpace'); + $objWriter->writeAttribute('xmlns:c', 'http://schemas.openxmlformats.org/drawingml/2006/chart'); + $objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main'); + $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); + + $objWriter->startElement('c:date1904'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + $objWriter->startElement('c:lang'); + $objWriter->writeAttribute('val', "en-GB"); + $objWriter->endElement(); + $objWriter->startElement('c:roundedCorners'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + + $this->writeAlternateContent($objWriter); + + $objWriter->startElement('c:chart'); + + $this->writeTitle($pChart->getTitle(), $objWriter); + + $objWriter->startElement('c:autoTitleDeleted'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + + $this->writePlotArea($pChart->getPlotArea(), $pChart->getXAxisLabel(), $pChart->getYAxisLabel(), $objWriter, $pChart->getWorksheet(), $pChart->getChartAxisX(), $pChart->getChartAxisY(), $pChart->getMajorGridlines(), $pChart->getMinorGridlines()); + + $this->writeLegend($pChart->getLegend(), $objWriter); + + $objWriter->startElement('c:plotVisOnly'); + $objWriter->writeAttribute('val', 1); + $objWriter->endElement(); + + $objWriter->startElement('c:dispBlanksAs'); + $objWriter->writeAttribute('val', "gap"); + $objWriter->endElement(); + + $objWriter->startElement('c:showDLblsOverMax'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + + $objWriter->endElement(); + + $this->writePrintSettings($objWriter); + + $objWriter->endElement(); + + // Return + return $objWriter->getData(); + } + + /** + * Write Chart Title + * + * @param PHPExcel_Chart_Title $title + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * + * @throws PHPExcel_Writer_Exception + */ + private function writeTitle(PHPExcel_Chart_Title $title = null, $objWriter) + { + if (is_null($title)) { + return; + } + + $objWriter->startElement('c:title'); + $objWriter->startElement('c:tx'); + $objWriter->startElement('c:rich'); + + $objWriter->startElement('a:bodyPr'); + $objWriter->endElement(); + + $objWriter->startElement('a:lstStyle'); + $objWriter->endElement(); + + $objWriter->startElement('a:p'); + + $caption = $title->getCaption(); + if ((is_array($caption)) && (count($caption) > 0)) { + $caption = $caption[0]; + } + $this->getParentWriter()->getWriterPart('stringtable')->writeRichTextForCharts($objWriter, $caption, 'a'); + + $objWriter->endElement(); + $objWriter->endElement(); + $objWriter->endElement(); + + $this->writeLayout($title->getLayout(), $objWriter); + + $objWriter->startElement('c:overlay'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + + $objWriter->endElement(); + } + + /** + * Write Chart Legend + * + * @param PHPExcel_Chart_Legend $legend + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * + * @throws PHPExcel_Writer_Exception + */ + private function writeLegend(PHPExcel_Chart_Legend $legend = null, $objWriter) + { + if (is_null($legend)) { + return; + } + + $objWriter->startElement('c:legend'); + + $objWriter->startElement('c:legendPos'); + $objWriter->writeAttribute('val', $legend->getPosition()); + $objWriter->endElement(); + + $this->writeLayout($legend->getLayout(), $objWriter); + + $objWriter->startElement('c:overlay'); + $objWriter->writeAttribute('val', ($legend->getOverlay()) ? '1' : '0'); + $objWriter->endElement(); + + $objWriter->startElement('c:txPr'); + $objWriter->startElement('a:bodyPr'); + $objWriter->endElement(); + + $objWriter->startElement('a:lstStyle'); + $objWriter->endElement(); + + $objWriter->startElement('a:p'); + $objWriter->startElement('a:pPr'); + $objWriter->writeAttribute('rtl', 0); + + $objWriter->startElement('a:defRPr'); + $objWriter->endElement(); + $objWriter->endElement(); + + $objWriter->startElement('a:endParaRPr'); + $objWriter->writeAttribute('lang', "en-US"); + $objWriter->endElement(); + + $objWriter->endElement(); + $objWriter->endElement(); + + $objWriter->endElement(); + } + + /** + * Write Chart Plot Area + * + * @param PHPExcel_Chart_PlotArea $plotArea + * @param PHPExcel_Chart_Title $xAxisLabel + * @param PHPExcel_Chart_Title $yAxisLabel + * @param PHPExcel_Chart_Axis $xAxis + * @param PHPExcel_Chart_Axis $yAxis + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * + * @throws PHPExcel_Writer_Exception + */ + private function writePlotArea(PHPExcel_Chart_PlotArea $plotArea, PHPExcel_Chart_Title $xAxisLabel = null, PHPExcel_Chart_Title $yAxisLabel = null, $objWriter, PHPExcel_Worksheet $pSheet, PHPExcel_Chart_Axis $xAxis, PHPExcel_Chart_Axis $yAxis, PHPExcel_Chart_GridLines $majorGridlines, PHPExcel_Chart_GridLines $minorGridlines) + { + if (is_null($plotArea)) { + return; + } + + $id1 = $id2 = 0; + $this->_seriesIndex = 0; + $objWriter->startElement('c:plotArea'); + + $layout = $plotArea->getLayout(); + + $this->writeLayout($layout, $objWriter); + + $chartTypes = self::getChartType($plotArea); + $catIsMultiLevelSeries = $valIsMultiLevelSeries = false; + $plotGroupingType = ''; + foreach ($chartTypes as $chartType) { + $objWriter->startElement('c:' . $chartType); + + $groupCount = $plotArea->getPlotGroupCount(); + for ($i = 0; $i < $groupCount; ++$i) { + $plotGroup = $plotArea->getPlotGroupByIndex($i); + $groupType = $plotGroup->getPlotType(); + if ($groupType == $chartType) { + $plotStyle = $plotGroup->getPlotStyle(); + if ($groupType === PHPExcel_Chart_DataSeries::TYPE_RADARCHART) { + $objWriter->startElement('c:radarStyle'); + $objWriter->writeAttribute('val', $plotStyle); + $objWriter->endElement(); + } elseif ($groupType === PHPExcel_Chart_DataSeries::TYPE_SCATTERCHART) { + $objWriter->startElement('c:scatterStyle'); + $objWriter->writeAttribute('val', $plotStyle); + $objWriter->endElement(); + } + + $this->writePlotGroup($plotGroup, $chartType, $objWriter, $catIsMultiLevelSeries, $valIsMultiLevelSeries, $plotGroupingType, $pSheet); + } + } + + $this->writeDataLabels($objWriter, $layout); + + if ($chartType === PHPExcel_Chart_DataSeries::TYPE_LINECHART) { + // Line only, Line3D can't be smoothed + + $objWriter->startElement('c:smooth'); + $objWriter->writeAttribute('val', (integer) $plotGroup->getSmoothLine()); + $objWriter->endElement(); + } elseif (($chartType === PHPExcel_Chart_DataSeries::TYPE_BARCHART) ||($chartType === PHPExcel_Chart_DataSeries::TYPE_BARCHART_3D)) { + $objWriter->startElement('c:gapWidth'); + $objWriter->writeAttribute('val', 150); + $objWriter->endElement(); + + if ($plotGroupingType == 'percentStacked' || $plotGroupingType == 'stacked') { + $objWriter->startElement('c:overlap'); + $objWriter->writeAttribute('val', 100); + $objWriter->endElement(); + } + } elseif ($chartType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) { + $objWriter->startElement('c:bubbleScale'); + $objWriter->writeAttribute('val', 25); + $objWriter->endElement(); + + $objWriter->startElement('c:showNegBubbles'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + } elseif ($chartType === PHPExcel_Chart_DataSeries::TYPE_STOCKCHART) { + $objWriter->startElement('c:hiLowLines'); + $objWriter->endElement(); + + $objWriter->startElement('c:upDownBars'); + + $objWriter->startElement('c:gapWidth'); + $objWriter->writeAttribute('val', 300); + $objWriter->endElement(); + + $objWriter->startElement('c:upBars'); + $objWriter->endElement(); + + $objWriter->startElement('c:downBars'); + $objWriter->endElement(); + + $objWriter->endElement(); + } + + // Generate 2 unique numbers to use for axId values + // $id1 = $id2 = rand(10000000,99999999); + // do { + // $id2 = rand(10000000,99999999); + // } while ($id1 == $id2); + $id1 = '75091328'; + $id2 = '75089408'; + + if (($chartType !== PHPExcel_Chart_DataSeries::TYPE_PIECHART) && ($chartType !== PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) && ($chartType !== PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)) { + $objWriter->startElement('c:axId'); + $objWriter->writeAttribute('val', $id1); + $objWriter->endElement(); + $objWriter->startElement('c:axId'); + $objWriter->writeAttribute('val', $id2); + $objWriter->endElement(); + } else { + $objWriter->startElement('c:firstSliceAng'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + + if ($chartType === PHPExcel_Chart_DataSeries::TYPE_DONUTCHART) { + $objWriter->startElement('c:holeSize'); + $objWriter->writeAttribute('val', 50); + $objWriter->endElement(); + } + } + + $objWriter->endElement(); + } + + if (($chartType !== PHPExcel_Chart_DataSeries::TYPE_PIECHART) && ($chartType !== PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) && ($chartType !== PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)) { + if ($chartType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) { + $this->writeValueAxis($objWriter, $plotArea, $xAxisLabel, $chartType, $id1, $id2, $catIsMultiLevelSeries, $xAxis, $yAxis, $majorGridlines, $minorGridlines); + } else { + $this->writeCategoryAxis($objWriter, $plotArea, $xAxisLabel, $chartType, $id1, $id2, $catIsMultiLevelSeries, $xAxis, $yAxis); + } + + $this->writeValueAxis($objWriter, $plotArea, $yAxisLabel, $chartType, $id1, $id2, $valIsMultiLevelSeries, $xAxis, $yAxis, $majorGridlines, $minorGridlines); + } + + $objWriter->endElement(); + } + + /** + * Write Data Labels + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Chart_Layout $chartLayout Chart layout + * + * @throws PHPExcel_Writer_Exception + */ + private function writeDataLabels($objWriter, $chartLayout) + { + $objWriter->startElement('c:dLbls'); + + $objWriter->startElement('c:showLegendKey'); + $showLegendKey = (empty($chartLayout)) ? 0 : $chartLayout->getShowLegendKey(); + $objWriter->writeAttribute('val', ((empty($showLegendKey)) ? 0 : 1)); + $objWriter->endElement(); + + $objWriter->startElement('c:showVal'); + $showVal = (empty($chartLayout)) ? 0 : $chartLayout->getShowVal(); + $objWriter->writeAttribute('val', ((empty($showVal)) ? 0 : 1)); + $objWriter->endElement(); + + $objWriter->startElement('c:showCatName'); + $showCatName = (empty($chartLayout)) ? 0 : $chartLayout->getShowCatName(); + $objWriter->writeAttribute('val', ((empty($showCatName)) ? 0 : 1)); + $objWriter->endElement(); + + $objWriter->startElement('c:showSerName'); + $showSerName = (empty($chartLayout)) ? 0 : $chartLayout->getShowSerName(); + $objWriter->writeAttribute('val', ((empty($showSerName)) ? 0 : 1)); + $objWriter->endElement(); + + $objWriter->startElement('c:showPercent'); + $showPercent = (empty($chartLayout)) ? 0 : $chartLayout->getShowPercent(); + $objWriter->writeAttribute('val', ((empty($showPercent)) ? 0 : 1)); + $objWriter->endElement(); + + $objWriter->startElement('c:showBubbleSize'); + $showBubbleSize = (empty($chartLayout)) ? 0 : $chartLayout->getShowBubbleSize(); + $objWriter->writeAttribute('val', ((empty($showBubbleSize)) ? 0 : 1)); + $objWriter->endElement(); + + $objWriter->startElement('c:showLeaderLines'); + $showLeaderLines = (empty($chartLayout)) ? 1 : $chartLayout->getShowLeaderLines(); + $objWriter->writeAttribute('val', ((empty($showLeaderLines)) ? 0 : 1)); + $objWriter->endElement(); + + $objWriter->endElement(); + } + + /** + * Write Category Axis + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Chart_PlotArea $plotArea + * @param PHPExcel_Chart_Title $xAxisLabel + * @param string $groupType Chart type + * @param string $id1 + * @param string $id2 + * @param boolean $isMultiLevelSeries + * + * @throws PHPExcel_Writer_Exception + */ + private function writeCategoryAxis($objWriter, PHPExcel_Chart_PlotArea $plotArea, $xAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis) + { + $objWriter->startElement('c:catAx'); + + if ($id1 > 0) { + $objWriter->startElement('c:axId'); + $objWriter->writeAttribute('val', $id1); + $objWriter->endElement(); + } + + $objWriter->startElement('c:scaling'); + $objWriter->startElement('c:orientation'); + $objWriter->writeAttribute('val', $yAxis->getAxisOptionsProperty('orientation')); + $objWriter->endElement(); + $objWriter->endElement(); + + $objWriter->startElement('c:delete'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + + $objWriter->startElement('c:axPos'); + $objWriter->writeAttribute('val', "b"); + $objWriter->endElement(); + + if (!is_null($xAxisLabel)) { + $objWriter->startElement('c:title'); + $objWriter->startElement('c:tx'); + $objWriter->startElement('c:rich'); + + $objWriter->startElement('a:bodyPr'); + $objWriter->endElement(); + + $objWriter->startElement('a:lstStyle'); + $objWriter->endElement(); + + $objWriter->startElement('a:p'); + $objWriter->startElement('a:r'); + + $caption = $xAxisLabel->getCaption(); + if (is_array($caption)) { + $caption = $caption[0]; + } + $objWriter->startElement('a:t'); + // $objWriter->writeAttribute('xml:space', 'preserve'); + $objWriter->writeRawData(PHPExcel_Shared_String::ControlCharacterPHP2OOXML($caption)); + $objWriter->endElement(); + + $objWriter->endElement(); + $objWriter->endElement(); + $objWriter->endElement(); + $objWriter->endElement(); + + $layout = $xAxisLabel->getLayout(); + $this->writeLayout($layout, $objWriter); + + $objWriter->startElement('c:overlay'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + + $objWriter->endElement(); + } + + $objWriter->startElement('c:numFmt'); + $objWriter->writeAttribute('formatCode', $yAxis->getAxisNumberFormat()); + $objWriter->writeAttribute('sourceLinked', $yAxis->getAxisNumberSourceLinked()); + $objWriter->endElement(); + + $objWriter->startElement('c:majorTickMark'); + $objWriter->writeAttribute('val', $yAxis->getAxisOptionsProperty('major_tick_mark')); + $objWriter->endElement(); + + $objWriter->startElement('c:minorTickMark'); + $objWriter->writeAttribute('val', $yAxis->getAxisOptionsProperty('minor_tick_mark')); + $objWriter->endElement(); + + $objWriter->startElement('c:tickLblPos'); + $objWriter->writeAttribute('val', $yAxis->getAxisOptionsProperty('axis_labels')); + $objWriter->endElement(); + + if ($id2 > 0) { + $objWriter->startElement('c:crossAx'); + $objWriter->writeAttribute('val', $id2); + $objWriter->endElement(); + + $objWriter->startElement('c:crosses'); + $objWriter->writeAttribute('val', $yAxis->getAxisOptionsProperty('horizontal_crosses')); + $objWriter->endElement(); + } + + $objWriter->startElement('c:auto'); + $objWriter->writeAttribute('val', 1); + $objWriter->endElement(); + + $objWriter->startElement('c:lblAlgn'); + $objWriter->writeAttribute('val', "ctr"); + $objWriter->endElement(); + + $objWriter->startElement('c:lblOffset'); + $objWriter->writeAttribute('val', 100); + $objWriter->endElement(); + + if ($isMultiLevelSeries) { + $objWriter->startElement('c:noMultiLvlLbl'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + } + $objWriter->endElement(); + } + + /** + * Write Value Axis + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Chart_PlotArea $plotArea + * @param PHPExcel_Chart_Title $yAxisLabel + * @param string $groupType Chart type + * @param string $id1 + * @param string $id2 + * @param boolean $isMultiLevelSeries + * + * @throws PHPExcel_Writer_Exception + */ + private function writeValueAxis($objWriter, PHPExcel_Chart_PlotArea $plotArea, $yAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis, $majorGridlines, $minorGridlines) + { + $objWriter->startElement('c:valAx'); + + if ($id2 > 0) { + $objWriter->startElement('c:axId'); + $objWriter->writeAttribute('val', $id2); + $objWriter->endElement(); + } + + $objWriter->startElement('c:scaling'); + + if (!is_null($xAxis->getAxisOptionsProperty('maximum'))) { + $objWriter->startElement('c:max'); + $objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('maximum')); + $objWriter->endElement(); + } + + if (!is_null($xAxis->getAxisOptionsProperty('minimum'))) { + $objWriter->startElement('c:min'); + $objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('minimum')); + $objWriter->endElement(); + } + + $objWriter->startElement('c:orientation'); + $objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('orientation')); + + + $objWriter->endElement(); + $objWriter->endElement(); + + $objWriter->startElement('c:delete'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + + $objWriter->startElement('c:axPos'); + $objWriter->writeAttribute('val', "l"); + $objWriter->endElement(); + + $objWriter->startElement('c:majorGridlines'); + $objWriter->startElement('c:spPr'); + + if (!is_null($majorGridlines->getLineColorProperty('value'))) { + $objWriter->startElement('a:ln'); + $objWriter->writeAttribute('w', $majorGridlines->getLineStyleProperty('width')); + $objWriter->startElement('a:solidFill'); + $objWriter->startElement("a:{$majorGridlines->getLineColorProperty('type')}"); + $objWriter->writeAttribute('val', $majorGridlines->getLineColorProperty('value')); + $objWriter->startElement('a:alpha'); + $objWriter->writeAttribute('val', $majorGridlines->getLineColorProperty('alpha')); + $objWriter->endElement(); //end alpha + $objWriter->endElement(); //end srgbClr + $objWriter->endElement(); //end solidFill + + $objWriter->startElement('a:prstDash'); + $objWriter->writeAttribute('val', $majorGridlines->getLineStyleProperty('dash')); + $objWriter->endElement(); + + if ($majorGridlines->getLineStyleProperty('join') == 'miter') { + $objWriter->startElement('a:miter'); + $objWriter->writeAttribute('lim', '800000'); + $objWriter->endElement(); + } else { + $objWriter->startElement('a:bevel'); + $objWriter->endElement(); + } + + if (!is_null($majorGridlines->getLineStyleProperty(array('arrow', 'head', 'type')))) { + $objWriter->startElement('a:headEnd'); + $objWriter->writeAttribute('type', $majorGridlines->getLineStyleProperty(array('arrow', 'head', 'type'))); + $objWriter->writeAttribute('w', $majorGridlines->getLineStyleArrowParameters('head', 'w')); + $objWriter->writeAttribute('len', $majorGridlines->getLineStyleArrowParameters('head', 'len')); + $objWriter->endElement(); + } + + if (!is_null($majorGridlines->getLineStyleProperty(array('arrow', 'end', 'type')))) { + $objWriter->startElement('a:tailEnd'); + $objWriter->writeAttribute('type', $majorGridlines->getLineStyleProperty(array('arrow', 'end', 'type'))); + $objWriter->writeAttribute('w', $majorGridlines->getLineStyleArrowParameters('end', 'w')); + $objWriter->writeAttribute('len', $majorGridlines->getLineStyleArrowParameters('end', 'len')); + $objWriter->endElement(); + } + $objWriter->endElement(); //end ln + } + $objWriter->startElement('a:effectLst'); + + if (!is_null($majorGridlines->getGlowSize())) { + $objWriter->startElement('a:glow'); + $objWriter->writeAttribute('rad', $majorGridlines->getGlowSize()); + $objWriter->startElement("a:{$majorGridlines->getGlowColor('type')}"); + $objWriter->writeAttribute('val', $majorGridlines->getGlowColor('value')); + $objWriter->startElement('a:alpha'); + $objWriter->writeAttribute('val', $majorGridlines->getGlowColor('alpha')); + $objWriter->endElement(); //end alpha + $objWriter->endElement(); //end schemeClr + $objWriter->endElement(); //end glow + } + + if (!is_null($majorGridlines->getShadowProperty('presets'))) { + $objWriter->startElement("a:{$majorGridlines->getShadowProperty('effect')}"); + if (!is_null($majorGridlines->getShadowProperty('blur'))) { + $objWriter->writeAttribute('blurRad', $majorGridlines->getShadowProperty('blur')); + } + if (!is_null($majorGridlines->getShadowProperty('distance'))) { + $objWriter->writeAttribute('dist', $majorGridlines->getShadowProperty('distance')); + } + if (!is_null($majorGridlines->getShadowProperty('direction'))) { + $objWriter->writeAttribute('dir', $majorGridlines->getShadowProperty('direction')); + } + if (!is_null($majorGridlines->getShadowProperty('algn'))) { + $objWriter->writeAttribute('algn', $majorGridlines->getShadowProperty('algn')); + } + if (!is_null($majorGridlines->getShadowProperty(array('size', 'sx')))) { + $objWriter->writeAttribute('sx', $majorGridlines->getShadowProperty(array('size', 'sx'))); + } + if (!is_null($majorGridlines->getShadowProperty(array('size', 'sy')))) { + $objWriter->writeAttribute('sy', $majorGridlines->getShadowProperty(array('size', 'sy'))); + } + if (!is_null($majorGridlines->getShadowProperty(array('size', 'kx')))) { + $objWriter->writeAttribute('kx', $majorGridlines->getShadowProperty(array('size', 'kx'))); + } + if (!is_null($majorGridlines->getShadowProperty('rotWithShape'))) { + $objWriter->writeAttribute('rotWithShape', $majorGridlines->getShadowProperty('rotWithShape')); + } + $objWriter->startElement("a:{$majorGridlines->getShadowProperty(array('color', 'type'))}"); + $objWriter->writeAttribute('val', $majorGridlines->getShadowProperty(array('color', 'value'))); + + $objWriter->startElement('a:alpha'); + $objWriter->writeAttribute('val', $majorGridlines->getShadowProperty(array('color', 'alpha'))); + $objWriter->endElement(); //end alpha + + $objWriter->endElement(); //end color:type + $objWriter->endElement(); //end shadow + } + + if (!is_null($majorGridlines->getSoftEdgesSize())) { + $objWriter->startElement('a:softEdge'); + $objWriter->writeAttribute('rad', $majorGridlines->getSoftEdgesSize()); + $objWriter->endElement(); //end softEdge + } + + $objWriter->endElement(); //end effectLst + $objWriter->endElement(); //end spPr + $objWriter->endElement(); //end majorGridLines + + if ($minorGridlines->getObjectState()) { + $objWriter->startElement('c:minorGridlines'); + $objWriter->startElement('c:spPr'); + + if (!is_null($minorGridlines->getLineColorProperty('value'))) { + $objWriter->startElement('a:ln'); + $objWriter->writeAttribute('w', $minorGridlines->getLineStyleProperty('width')); + $objWriter->startElement('a:solidFill'); + $objWriter->startElement("a:{$minorGridlines->getLineColorProperty('type')}"); + $objWriter->writeAttribute('val', $minorGridlines->getLineColorProperty('value')); + $objWriter->startElement('a:alpha'); + $objWriter->writeAttribute('val', $minorGridlines->getLineColorProperty('alpha')); + $objWriter->endElement(); //end alpha + $objWriter->endElement(); //end srgbClr + $objWriter->endElement(); //end solidFill + + $objWriter->startElement('a:prstDash'); + $objWriter->writeAttribute('val', $minorGridlines->getLineStyleProperty('dash')); + $objWriter->endElement(); + + if ($minorGridlines->getLineStyleProperty('join') == 'miter') { + $objWriter->startElement('a:miter'); + $objWriter->writeAttribute('lim', '800000'); + $objWriter->endElement(); + } else { + $objWriter->startElement('a:bevel'); + $objWriter->endElement(); + } + + if (!is_null($minorGridlines->getLineStyleProperty(array('arrow', 'head', 'type')))) { + $objWriter->startElement('a:headEnd'); + $objWriter->writeAttribute('type', $minorGridlines->getLineStyleProperty(array('arrow', 'head', 'type'))); + $objWriter->writeAttribute('w', $minorGridlines->getLineStyleArrowParameters('head', 'w')); + $objWriter->writeAttribute('len', $minorGridlines->getLineStyleArrowParameters('head', 'len')); + $objWriter->endElement(); + } + + if (!is_null($minorGridlines->getLineStyleProperty(array('arrow', 'end', 'type')))) { + $objWriter->startElement('a:tailEnd'); + $objWriter->writeAttribute('type', $minorGridlines->getLineStyleProperty(array('arrow', 'end', 'type'))); + $objWriter->writeAttribute('w', $minorGridlines->getLineStyleArrowParameters('end', 'w')); + $objWriter->writeAttribute('len', $minorGridlines->getLineStyleArrowParameters('end', 'len')); + $objWriter->endElement(); + } + $objWriter->endElement(); //end ln + } + + $objWriter->startElement('a:effectLst'); + + if (!is_null($minorGridlines->getGlowSize())) { + $objWriter->startElement('a:glow'); + $objWriter->writeAttribute('rad', $minorGridlines->getGlowSize()); + $objWriter->startElement("a:{$minorGridlines->getGlowColor('type')}"); + $objWriter->writeAttribute('val', $minorGridlines->getGlowColor('value')); + $objWriter->startElement('a:alpha'); + $objWriter->writeAttribute('val', $minorGridlines->getGlowColor('alpha')); + $objWriter->endElement(); //end alpha + $objWriter->endElement(); //end schemeClr + $objWriter->endElement(); //end glow + } + + if (!is_null($minorGridlines->getShadowProperty('presets'))) { + $objWriter->startElement("a:{$minorGridlines->getShadowProperty('effect')}"); + if (!is_null($minorGridlines->getShadowProperty('blur'))) { + $objWriter->writeAttribute('blurRad', $minorGridlines->getShadowProperty('blur')); + } + if (!is_null($minorGridlines->getShadowProperty('distance'))) { + $objWriter->writeAttribute('dist', $minorGridlines->getShadowProperty('distance')); + } + if (!is_null($minorGridlines->getShadowProperty('direction'))) { + $objWriter->writeAttribute('dir', $minorGridlines->getShadowProperty('direction')); + } + if (!is_null($minorGridlines->getShadowProperty('algn'))) { + $objWriter->writeAttribute('algn', $minorGridlines->getShadowProperty('algn')); + } + if (!is_null($minorGridlines->getShadowProperty(array('size', 'sx')))) { + $objWriter->writeAttribute('sx', $minorGridlines->getShadowProperty(array('size', 'sx'))); + } + if (!is_null($minorGridlines->getShadowProperty(array('size', 'sy')))) { + $objWriter->writeAttribute('sy', $minorGridlines->getShadowProperty(array('size', 'sy'))); + } + if (!is_null($minorGridlines->getShadowProperty(array('size', 'kx')))) { + $objWriter->writeAttribute('kx', $minorGridlines->getShadowProperty(array('size', 'kx'))); + } + if (!is_null($minorGridlines->getShadowProperty('rotWithShape'))) { + $objWriter->writeAttribute('rotWithShape', $minorGridlines->getShadowProperty('rotWithShape')); + } + $objWriter->startElement("a:{$minorGridlines->getShadowProperty(array('color', 'type'))}"); + $objWriter->writeAttribute('val', $minorGridlines->getShadowProperty(array('color', 'value'))); + $objWriter->startElement('a:alpha'); + $objWriter->writeAttribute('val', $minorGridlines->getShadowProperty(array('color', 'alpha'))); + $objWriter->endElement(); //end alpha + $objWriter->endElement(); //end color:type + $objWriter->endElement(); //end shadow + } + + if (!is_null($minorGridlines->getSoftEdgesSize())) { + $objWriter->startElement('a:softEdge'); + $objWriter->writeAttribute('rad', $minorGridlines->getSoftEdgesSize()); + $objWriter->endElement(); //end softEdge + } + + $objWriter->endElement(); //end effectLst + $objWriter->endElement(); //end spPr + $objWriter->endElement(); //end minorGridLines + } + + if (!is_null($yAxisLabel)) { + $objWriter->startElement('c:title'); + $objWriter->startElement('c:tx'); + $objWriter->startElement('c:rich'); + + $objWriter->startElement('a:bodyPr'); + $objWriter->endElement(); + + $objWriter->startElement('a:lstStyle'); + $objWriter->endElement(); + + $objWriter->startElement('a:p'); + $objWriter->startElement('a:r'); + + $caption = $yAxisLabel->getCaption(); + if (is_array($caption)) { + $caption = $caption[0]; + } + + $objWriter->startElement('a:t'); + // $objWriter->writeAttribute('xml:space', 'preserve'); + $objWriter->writeRawData(PHPExcel_Shared_String::ControlCharacterPHP2OOXML($caption)); + $objWriter->endElement(); + + $objWriter->endElement(); + $objWriter->endElement(); + $objWriter->endElement(); + $objWriter->endElement(); + + if ($groupType !== PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) { + $layout = $yAxisLabel->getLayout(); + $this->writeLayout($layout, $objWriter); + } + + $objWriter->startElement('c:overlay'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + + $objWriter->endElement(); + } + + $objWriter->startElement('c:numFmt'); + $objWriter->writeAttribute('formatCode', $xAxis->getAxisNumberFormat()); + $objWriter->writeAttribute('sourceLinked', $xAxis->getAxisNumberSourceLinked()); + $objWriter->endElement(); + + $objWriter->startElement('c:majorTickMark'); + $objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('major_tick_mark')); + $objWriter->endElement(); + + $objWriter->startElement('c:minorTickMark'); + $objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('minor_tick_mark')); + $objWriter->endElement(); + + $objWriter->startElement('c:tickLblPos'); + $objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('axis_labels')); + $objWriter->endElement(); + + $objWriter->startElement('c:spPr'); + + if (!is_null($xAxis->getFillProperty('value'))) { + $objWriter->startElement('a:solidFill'); + $objWriter->startElement("a:" . $xAxis->getFillProperty('type')); + $objWriter->writeAttribute('val', $xAxis->getFillProperty('value')); + $objWriter->startElement('a:alpha'); + $objWriter->writeAttribute('val', $xAxis->getFillProperty('alpha')); + $objWriter->endElement(); + $objWriter->endElement(); + $objWriter->endElement(); + } + + $objWriter->startElement('a:ln'); + + $objWriter->writeAttribute('w', $xAxis->getLineStyleProperty('width')); + $objWriter->writeAttribute('cap', $xAxis->getLineStyleProperty('cap')); + $objWriter->writeAttribute('cmpd', $xAxis->getLineStyleProperty('compound')); + + if (!is_null($xAxis->getLineProperty('value'))) { + $objWriter->startElement('a:solidFill'); + $objWriter->startElement("a:" . $xAxis->getLineProperty('type')); + $objWriter->writeAttribute('val', $xAxis->getLineProperty('value')); + $objWriter->startElement('a:alpha'); + $objWriter->writeAttribute('val', $xAxis->getLineProperty('alpha')); + $objWriter->endElement(); + $objWriter->endElement(); + $objWriter->endElement(); + } + + $objWriter->startElement('a:prstDash'); + $objWriter->writeAttribute('val', $xAxis->getLineStyleProperty('dash')); + $objWriter->endElement(); + + if ($xAxis->getLineStyleProperty('join') == 'miter') { + $objWriter->startElement('a:miter'); + $objWriter->writeAttribute('lim', '800000'); + $objWriter->endElement(); + } else { + $objWriter->startElement('a:bevel'); + $objWriter->endElement(); + } + + if (!is_null($xAxis->getLineStyleProperty(array('arrow', 'head', 'type')))) { + $objWriter->startElement('a:headEnd'); + $objWriter->writeAttribute('type', $xAxis->getLineStyleProperty(array('arrow', 'head', 'type'))); + $objWriter->writeAttribute('w', $xAxis->getLineStyleArrowWidth('head')); + $objWriter->writeAttribute('len', $xAxis->getLineStyleArrowLength('head')); + $objWriter->endElement(); + } + + if (!is_null($xAxis->getLineStyleProperty(array('arrow', 'end', 'type')))) { + $objWriter->startElement('a:tailEnd'); + $objWriter->writeAttribute('type', $xAxis->getLineStyleProperty(array('arrow', 'end', 'type'))); + $objWriter->writeAttribute('w', $xAxis->getLineStyleArrowWidth('end')); + $objWriter->writeAttribute('len', $xAxis->getLineStyleArrowLength('end')); + $objWriter->endElement(); + } + + $objWriter->endElement(); + + $objWriter->startElement('a:effectLst'); + + if (!is_null($xAxis->getGlowProperty('size'))) { + $objWriter->startElement('a:glow'); + $objWriter->writeAttribute('rad', $xAxis->getGlowProperty('size')); + $objWriter->startElement("a:{$xAxis->getGlowProperty(array('color','type'))}"); + $objWriter->writeAttribute('val', $xAxis->getGlowProperty(array('color','value'))); + $objWriter->startElement('a:alpha'); + $objWriter->writeAttribute('val', $xAxis->getGlowProperty(array('color','alpha'))); + $objWriter->endElement(); + $objWriter->endElement(); + $objWriter->endElement(); + } + + if (!is_null($xAxis->getShadowProperty('presets'))) { + $objWriter->startElement("a:{$xAxis->getShadowProperty('effect')}"); + + if (!is_null($xAxis->getShadowProperty('blur'))) { + $objWriter->writeAttribute('blurRad', $xAxis->getShadowProperty('blur')); + } + if (!is_null($xAxis->getShadowProperty('distance'))) { + $objWriter->writeAttribute('dist', $xAxis->getShadowProperty('distance')); + } + if (!is_null($xAxis->getShadowProperty('direction'))) { + $objWriter->writeAttribute('dir', $xAxis->getShadowProperty('direction')); + } + if (!is_null($xAxis->getShadowProperty('algn'))) { + $objWriter->writeAttribute('algn', $xAxis->getShadowProperty('algn')); + } + if (!is_null($xAxis->getShadowProperty(array('size','sx')))) { + $objWriter->writeAttribute('sx', $xAxis->getShadowProperty(array('size','sx'))); + } + if (!is_null($xAxis->getShadowProperty(array('size','sy')))) { + $objWriter->writeAttribute('sy', $xAxis->getShadowProperty(array('size','sy'))); + } + if (!is_null($xAxis->getShadowProperty(array('size','kx')))) { + $objWriter->writeAttribute('kx', $xAxis->getShadowProperty(array('size','kx'))); + } + if (!is_null($xAxis->getShadowProperty('rotWithShape'))) { + $objWriter->writeAttribute('rotWithShape', $xAxis->getShadowProperty('rotWithShape')); + } + + $objWriter->startElement("a:{$xAxis->getShadowProperty(array('color','type'))}"); + $objWriter->writeAttribute('val', $xAxis->getShadowProperty(array('color','value'))); + $objWriter->startElement('a:alpha'); + $objWriter->writeAttribute('val', $xAxis->getShadowProperty(array('color','alpha'))); + $objWriter->endElement(); + $objWriter->endElement(); + + $objWriter->endElement(); + } + + if (!is_null($xAxis->getSoftEdgesSize())) { + $objWriter->startElement('a:softEdge'); + $objWriter->writeAttribute('rad', $xAxis->getSoftEdgesSize()); + $objWriter->endElement(); + } + + $objWriter->endElement(); //effectList + $objWriter->endElement(); //end spPr + + if ($id1 > 0) { + $objWriter->startElement('c:crossAx'); + $objWriter->writeAttribute('val', $id2); + $objWriter->endElement(); + + if (!is_null($xAxis->getAxisOptionsProperty('horizontal_crosses_value'))) { + $objWriter->startElement('c:crossesAt'); + $objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('horizontal_crosses_value')); + $objWriter->endElement(); + } else { + $objWriter->startElement('c:crosses'); + $objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('horizontal_crosses')); + $objWriter->endElement(); + } + + $objWriter->startElement('c:crossBetween'); + $objWriter->writeAttribute('val', "midCat"); + $objWriter->endElement(); + + if (!is_null($xAxis->getAxisOptionsProperty('major_unit'))) { + $objWriter->startElement('c:majorUnit'); + $objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('major_unit')); + $objWriter->endElement(); + } + + if (!is_null($xAxis->getAxisOptionsProperty('minor_unit'))) { + $objWriter->startElement('c:minorUnit'); + $objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('minor_unit')); + $objWriter->endElement(); + } + } + + if ($isMultiLevelSeries) { + if ($groupType !== PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) { + $objWriter->startElement('c:noMultiLvlLbl'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + } + } + + $objWriter->endElement(); + } + + /** + * Get the data series type(s) for a chart plot series + * + * @param PHPExcel_Chart_PlotArea $plotArea + * + * @return string|array + * @throws PHPExcel_Writer_Exception + */ + private static function getChartType($plotArea) + { + $groupCount = $plotArea->getPlotGroupCount(); + + if ($groupCount == 1) { + $chartType = array($plotArea->getPlotGroupByIndex(0)->getPlotType()); + } else { + $chartTypes = array(); + for ($i = 0; $i < $groupCount; ++$i) { + $chartTypes[] = $plotArea->getPlotGroupByIndex($i)->getPlotType(); + } + $chartType = array_unique($chartTypes); + if (count($chartTypes) == 0) { + throw new PHPExcel_Writer_Exception('Chart is not yet implemented'); + } + } + + return $chartType; + } + + /** + * Write Plot Group (series of related plots) + * + * @param PHPExcel_Chart_DataSeries $plotGroup + * @param string $groupType Type of plot for dataseries + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param boolean &$catIsMultiLevelSeries Is category a multi-series category + * @param boolean &$valIsMultiLevelSeries Is value set a multi-series set + * @param string &$plotGroupingType Type of grouping for multi-series values + * @param PHPExcel_Worksheet $pSheet + * + * @throws PHPExcel_Writer_Exception + */ + private function writePlotGroup($plotGroup, $groupType, $objWriter, &$catIsMultiLevelSeries, &$valIsMultiLevelSeries, &$plotGroupingType, PHPExcel_Worksheet $pSheet) + { + if (is_null($plotGroup)) { + return; + } + + if (($groupType == PHPExcel_Chart_DataSeries::TYPE_BARCHART) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_BARCHART_3D)) { + $objWriter->startElement('c:barDir'); + $objWriter->writeAttribute('val', $plotGroup->getPlotDirection()); + $objWriter->endElement(); + } + + if (!is_null($plotGroup->getPlotGrouping())) { + $plotGroupingType = $plotGroup->getPlotGrouping(); + $objWriter->startElement('c:grouping'); + $objWriter->writeAttribute('val', $plotGroupingType); + $objWriter->endElement(); + } + + // Get these details before the loop, because we can use the count to check for varyColors + $plotSeriesOrder = $plotGroup->getPlotOrder(); + $plotSeriesCount = count($plotSeriesOrder); + + if (($groupType !== PHPExcel_Chart_DataSeries::TYPE_RADARCHART) && ($groupType !== PHPExcel_Chart_DataSeries::TYPE_STOCKCHART)) { + if ($groupType !== PHPExcel_Chart_DataSeries::TYPE_LINECHART) { + if (($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_DONUTCHART) || ($plotSeriesCount > 1)) { + $objWriter->startElement('c:varyColors'); + $objWriter->writeAttribute('val', 1); + $objWriter->endElement(); + } else { + $objWriter->startElement('c:varyColors'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + } + } + } + + foreach ($plotSeriesOrder as $plotSeriesIdx => $plotSeriesRef) { + $objWriter->startElement('c:ser'); + + $objWriter->startElement('c:idx'); + $objWriter->writeAttribute('val', $this->_seriesIndex + $plotSeriesIdx); + $objWriter->endElement(); + + $objWriter->startElement('c:order'); + $objWriter->writeAttribute('val', $this->_seriesIndex + $plotSeriesRef); + $objWriter->endElement(); + + if (($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)) { + $objWriter->startElement('c:dPt'); + $objWriter->startElement('c:idx'); + $objWriter->writeAttribute('val', 3); + $objWriter->endElement(); + + $objWriter->startElement('c:bubble3D'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + + $objWriter->startElement('c:spPr'); + $objWriter->startElement('a:solidFill'); + $objWriter->startElement('a:srgbClr'); + $objWriter->writeAttribute('val', 'FF9900'); + $objWriter->endElement(); + $objWriter->endElement(); + $objWriter->endElement(); + $objWriter->endElement(); + } + + // Labels + $plotSeriesLabel = $plotGroup->getPlotLabelByIndex($plotSeriesRef); + if ($plotSeriesLabel && ($plotSeriesLabel->getPointCount() > 0)) { + $objWriter->startElement('c:tx'); + $objWriter->startElement('c:strRef'); + $this->writePlotSeriesLabel($plotSeriesLabel, $objWriter); + $objWriter->endElement(); + $objWriter->endElement(); + } + + // Formatting for the points + if (($groupType == PHPExcel_Chart_DataSeries::TYPE_LINECHART) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_STOCKCHART)) { + $objWriter->startElement('c:spPr'); + $objWriter->startElement('a:ln'); + $objWriter->writeAttribute('w', 12700); + if ($groupType == PHPExcel_Chart_DataSeries::TYPE_STOCKCHART) { + $objWriter->startElement('a:noFill'); + $objWriter->endElement(); + } + $objWriter->endElement(); + $objWriter->endElement(); + } + + $plotSeriesValues = $plotGroup->getPlotValuesByIndex($plotSeriesRef); + if ($plotSeriesValues) { + $plotSeriesMarker = $plotSeriesValues->getPointMarker(); + if ($plotSeriesMarker) { + $objWriter->startElement('c:marker'); + $objWriter->startElement('c:symbol'); + $objWriter->writeAttribute('val', $plotSeriesMarker); + $objWriter->endElement(); + + if ($plotSeriesMarker !== 'none') { + $objWriter->startElement('c:size'); + $objWriter->writeAttribute('val', 3); + $objWriter->endElement(); + } + + $objWriter->endElement(); + } + } + + if (($groupType === PHPExcel_Chart_DataSeries::TYPE_BARCHART) || ($groupType === PHPExcel_Chart_DataSeries::TYPE_BARCHART_3D) || ($groupType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART)) { + $objWriter->startElement('c:invertIfNegative'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + } + + // Category Labels + $plotSeriesCategory = $plotGroup->getPlotCategoryByIndex($plotSeriesRef); + if ($plotSeriesCategory && ($plotSeriesCategory->getPointCount() > 0)) { + $catIsMultiLevelSeries = $catIsMultiLevelSeries || $plotSeriesCategory->isMultiLevelSeries(); + + if (($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)) { + if (!is_null($plotGroup->getPlotStyle())) { + $plotStyle = $plotGroup->getPlotStyle(); + if ($plotStyle) { + $objWriter->startElement('c:explosion'); + $objWriter->writeAttribute('val', 25); + $objWriter->endElement(); + } + } + } + + if (($groupType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) || ($groupType === PHPExcel_Chart_DataSeries::TYPE_SCATTERCHART)) { + $objWriter->startElement('c:xVal'); + } else { + $objWriter->startElement('c:cat'); + } + + $this->writePlotSeriesValues($plotSeriesCategory, $objWriter, $groupType, 'str', $pSheet); + $objWriter->endElement(); + } + + // Values + if ($plotSeriesValues) { + $valIsMultiLevelSeries = $valIsMultiLevelSeries || $plotSeriesValues->isMultiLevelSeries(); + + if (($groupType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) || ($groupType === PHPExcel_Chart_DataSeries::TYPE_SCATTERCHART)) { + $objWriter->startElement('c:yVal'); + } else { + $objWriter->startElement('c:val'); + } + + $this->writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, 'num', $pSheet); + $objWriter->endElement(); + } + + if ($groupType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) { + $this->writeBubbles($plotSeriesValues, $objWriter, $pSheet); + } + + $objWriter->endElement(); + } + + $this->_seriesIndex += $plotSeriesIdx + 1; + } + + /** + * Write Plot Series Label + * + * @param PHPExcel_Chart_DataSeriesValues $plotSeriesLabel + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * + * @throws PHPExcel_Writer_Exception + */ + private function writePlotSeriesLabel($plotSeriesLabel, $objWriter) + { + if (is_null($plotSeriesLabel)) { + return; + } + + $objWriter->startElement('c:f'); + $objWriter->writeRawData($plotSeriesLabel->getDataSource()); + $objWriter->endElement(); + + $objWriter->startElement('c:strCache'); + $objWriter->startElement('c:ptCount'); + $objWriter->writeAttribute('val', $plotSeriesLabel->getPointCount()); + $objWriter->endElement(); + + foreach ($plotSeriesLabel->getDataValues() as $plotLabelKey => $plotLabelValue) { + $objWriter->startElement('c:pt'); + $objWriter->writeAttribute('idx', $plotLabelKey); + + $objWriter->startElement('c:v'); + $objWriter->writeRawData($plotLabelValue); + $objWriter->endElement(); + $objWriter->endElement(); + } + $objWriter->endElement(); + } + + /** + * Write Plot Series Values + * + * @param PHPExcel_Chart_DataSeriesValues $plotSeriesValues + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param string $groupType Type of plot for dataseries + * @param string $dataType Datatype of series values + * @param PHPExcel_Worksheet $pSheet + * + * @throws PHPExcel_Writer_Exception + */ + private function writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, $dataType = 'str', PHPExcel_Worksheet $pSheet) + { + if (is_null($plotSeriesValues)) { + return; + } + + if ($plotSeriesValues->isMultiLevelSeries()) { + $levelCount = $plotSeriesValues->multiLevelCount(); + + $objWriter->startElement('c:multiLvlStrRef'); + + $objWriter->startElement('c:f'); + $objWriter->writeRawData($plotSeriesValues->getDataSource()); + $objWriter->endElement(); + + $objWriter->startElement('c:multiLvlStrCache'); + + $objWriter->startElement('c:ptCount'); + $objWriter->writeAttribute('val', $plotSeriesValues->getPointCount()); + $objWriter->endElement(); + + for ($level = 0; $level < $levelCount; ++$level) { + $objWriter->startElement('c:lvl'); + + foreach ($plotSeriesValues->getDataValues() as $plotSeriesKey => $plotSeriesValue) { + if (isset($plotSeriesValue[$level])) { + $objWriter->startElement('c:pt'); + $objWriter->writeAttribute('idx', $plotSeriesKey); + + $objWriter->startElement('c:v'); + $objWriter->writeRawData($plotSeriesValue[$level]); + $objWriter->endElement(); + $objWriter->endElement(); + } + } + + $objWriter->endElement(); + } + + $objWriter->endElement(); + + $objWriter->endElement(); + } else { + $objWriter->startElement('c:' . $dataType . 'Ref'); + + $objWriter->startElement('c:f'); + $objWriter->writeRawData($plotSeriesValues->getDataSource()); + $objWriter->endElement(); + + $objWriter->startElement('c:' . $dataType . 'Cache'); + + if (($groupType != PHPExcel_Chart_DataSeries::TYPE_PIECHART) && ($groupType != PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) && ($groupType != PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)) { + if (($plotSeriesValues->getFormatCode() !== null) && ($plotSeriesValues->getFormatCode() !== '')) { + $objWriter->startElement('c:formatCode'); + $objWriter->writeRawData($plotSeriesValues->getFormatCode()); + $objWriter->endElement(); + } + } + + $objWriter->startElement('c:ptCount'); + $objWriter->writeAttribute('val', $plotSeriesValues->getPointCount()); + $objWriter->endElement(); + + $dataValues = $plotSeriesValues->getDataValues(); + if (!empty($dataValues)) { + if (is_array($dataValues)) { + foreach ($dataValues as $plotSeriesKey => $plotSeriesValue) { + $objWriter->startElement('c:pt'); + $objWriter->writeAttribute('idx', $plotSeriesKey); + + $objWriter->startElement('c:v'); + $objWriter->writeRawData($plotSeriesValue); + $objWriter->endElement(); + $objWriter->endElement(); + } + } + } + + $objWriter->endElement(); + + $objWriter->endElement(); + } + } + + /** + * Write Bubble Chart Details + * + * @param PHPExcel_Chart_DataSeriesValues $plotSeriesValues + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * + * @throws PHPExcel_Writer_Exception + */ + private function writeBubbles($plotSeriesValues, $objWriter, PHPExcel_Worksheet $pSheet) + { + if (is_null($plotSeriesValues)) { + return; + } + + $objWriter->startElement('c:bubbleSize'); + $objWriter->startElement('c:numLit'); + + $objWriter->startElement('c:formatCode'); + $objWriter->writeRawData('General'); + $objWriter->endElement(); + + $objWriter->startElement('c:ptCount'); + $objWriter->writeAttribute('val', $plotSeriesValues->getPointCount()); + $objWriter->endElement(); + + $dataValues = $plotSeriesValues->getDataValues(); + if (!empty($dataValues)) { + if (is_array($dataValues)) { + foreach ($dataValues as $plotSeriesKey => $plotSeriesValue) { + $objWriter->startElement('c:pt'); + $objWriter->writeAttribute('idx', $plotSeriesKey); + $objWriter->startElement('c:v'); + $objWriter->writeRawData(1); + $objWriter->endElement(); + $objWriter->endElement(); + } + } + } + + $objWriter->endElement(); + $objWriter->endElement(); + + $objWriter->startElement('c:bubble3D'); + $objWriter->writeAttribute('val', 0); + $objWriter->endElement(); + } + + /** + * Write Layout + * + * @param PHPExcel_Chart_Layout $layout + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * + * @throws PHPExcel_Writer_Exception + */ + private function writeLayout(PHPExcel_Chart_Layout $layout = null, $objWriter) + { + $objWriter->startElement('c:layout'); + + if (!is_null($layout)) { + $objWriter->startElement('c:manualLayout'); + + $layoutTarget = $layout->getLayoutTarget(); + if (!is_null($layoutTarget)) { + $objWriter->startElement('c:layoutTarget'); + $objWriter->writeAttribute('val', $layoutTarget); + $objWriter->endElement(); + } + + $xMode = $layout->getXMode(); + if (!is_null($xMode)) { + $objWriter->startElement('c:xMode'); + $objWriter->writeAttribute('val', $xMode); + $objWriter->endElement(); + } + + $yMode = $layout->getYMode(); + if (!is_null($yMode)) { + $objWriter->startElement('c:yMode'); + $objWriter->writeAttribute('val', $yMode); + $objWriter->endElement(); + } + + $x = $layout->getXPosition(); + if (!is_null($x)) { + $objWriter->startElement('c:x'); + $objWriter->writeAttribute('val', $x); + $objWriter->endElement(); + } + + $y = $layout->getYPosition(); + if (!is_null($y)) { + $objWriter->startElement('c:y'); + $objWriter->writeAttribute('val', $y); + $objWriter->endElement(); + } + + $w = $layout->getWidth(); + if (!is_null($w)) { + $objWriter->startElement('c:w'); + $objWriter->writeAttribute('val', $w); + $objWriter->endElement(); + } + + $h = $layout->getHeight(); + if (!is_null($h)) { + $objWriter->startElement('c:h'); + $objWriter->writeAttribute('val', $h); + $objWriter->endElement(); + } + + $objWriter->endElement(); + } + + $objWriter->endElement(); + } + + /** + * Write Alternate Content block + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * + * @throws PHPExcel_Writer_Exception + */ + private function writeAlternateContent($objWriter) + { + $objWriter->startElement('mc:AlternateContent'); + $objWriter->writeAttribute('xmlns:mc', 'http://schemas.openxmlformats.org/markup-compatibility/2006'); + + $objWriter->startElement('mc:Choice'); + $objWriter->writeAttribute('xmlns:c14', 'http://schemas.microsoft.com/office/drawing/2007/8/2/chart'); + $objWriter->writeAttribute('Requires', 'c14'); + + $objWriter->startElement('c14:style'); + $objWriter->writeAttribute('val', '102'); + $objWriter->endElement(); + $objWriter->endElement(); + + $objWriter->startElement('mc:Fallback'); + $objWriter->startElement('c:style'); + $objWriter->writeAttribute('val', '2'); + $objWriter->endElement(); + $objWriter->endElement(); + + $objWriter->endElement(); + } + + /** + * Write Printer Settings + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * + * @throws PHPExcel_Writer_Exception + */ + private function writePrintSettings($objWriter) + { + $objWriter->startElement('c:printSettings'); + + $objWriter->startElement('c:headerFooter'); + $objWriter->endElement(); + + $objWriter->startElement('c:pageMargins'); + $objWriter->writeAttribute('footer', 0.3); + $objWriter->writeAttribute('header', 0.3); + $objWriter->writeAttribute('r', 0.7); + $objWriter->writeAttribute('l', 0.7); + $objWriter->writeAttribute('t', 0.75); + $objWriter->writeAttribute('b', 0.75); + $objWriter->endElement(); + + $objWriter->startElement('c:pageSetup'); + $objWriter->writeAttribute('orientation', "portrait"); + $objWriter->endElement(); + + $objWriter->endElement(); + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel2007/Comments.php b/extend/PHPExcel/PHPExcel/Writer/Excel2007/Comments.php new file mode 100644 index 0000000..7139f6c --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel2007/Comments.php @@ -0,0 +1,260 @@ +<?php + +/** + * PHPExcel_Writer_Excel2007_Comments + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_Excel2007_Comments extends PHPExcel_Writer_Excel2007_WriterPart +{ + /** + * Write comments to XML format + * + * @param PHPExcel_Worksheet $pWorksheet + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeComments(PHPExcel_Worksheet $pWorksheet = null) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // Comments cache + $comments = $pWorksheet->getComments(); + + // Authors cache + $authors = array(); + $authorId = 0; + foreach ($comments as $comment) { + if (!isset($authors[$comment->getAuthor()])) { + $authors[$comment->getAuthor()] = $authorId++; + } + } + + // comments + $objWriter->startElement('comments'); + $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'); + + // Loop through authors + $objWriter->startElement('authors'); + foreach ($authors as $author => $index) { + $objWriter->writeElement('author', $author); + } + $objWriter->endElement(); + + // Loop through comments + $objWriter->startElement('commentList'); + foreach ($comments as $key => $value) { + $this->writeComment($objWriter, $key, $value, $authors); + } + $objWriter->endElement(); + + $objWriter->endElement(); + + // Return + return $objWriter->getData(); + } + + /** + * Write comment to XML format + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param string $pCellReference Cell reference + * @param PHPExcel_Comment $pComment Comment + * @param array $pAuthors Array of authors + * @throws PHPExcel_Writer_Exception + */ + private function writeComment(PHPExcel_Shared_XMLWriter $objWriter = null, $pCellReference = 'A1', PHPExcel_Comment $pComment = null, $pAuthors = null) + { + // comment + $objWriter->startElement('comment'); + $objWriter->writeAttribute('ref', $pCellReference); + $objWriter->writeAttribute('authorId', $pAuthors[$pComment->getAuthor()]); + + // text + $objWriter->startElement('text'); + $this->getParentWriter()->getWriterPart('stringtable')->writeRichText($objWriter, $pComment->getText()); + $objWriter->endElement(); + + $objWriter->endElement(); + } + + /** + * Write VML comments to XML format + * + * @param PHPExcel_Worksheet $pWorksheet + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeVMLComments(PHPExcel_Worksheet $pWorksheet = null) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // Comments cache + $comments = $pWorksheet->getComments(); + + // xml + $objWriter->startElement('xml'); + $objWriter->writeAttribute('xmlns:v', 'urn:schemas-microsoft-com:vml'); + $objWriter->writeAttribute('xmlns:o', 'urn:schemas-microsoft-com:office:office'); + $objWriter->writeAttribute('xmlns:x', 'urn:schemas-microsoft-com:office:excel'); + + // o:shapelayout + $objWriter->startElement('o:shapelayout'); + $objWriter->writeAttribute('v:ext', 'edit'); + + // o:idmap + $objWriter->startElement('o:idmap'); + $objWriter->writeAttribute('v:ext', 'edit'); + $objWriter->writeAttribute('data', '1'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // v:shapetype + $objWriter->startElement('v:shapetype'); + $objWriter->writeAttribute('id', '_x0000_t202'); + $objWriter->writeAttribute('coordsize', '21600,21600'); + $objWriter->writeAttribute('o:spt', '202'); + $objWriter->writeAttribute('path', 'm,l,21600r21600,l21600,xe'); + + // v:stroke + $objWriter->startElement('v:stroke'); + $objWriter->writeAttribute('joinstyle', 'miter'); + $objWriter->endElement(); + + // v:path + $objWriter->startElement('v:path'); + $objWriter->writeAttribute('gradientshapeok', 't'); + $objWriter->writeAttribute('o:connecttype', 'rect'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // Loop through comments + foreach ($comments as $key => $value) { + $this->writeVMLComment($objWriter, $key, $value); + } + + $objWriter->endElement(); + + // Return + return $objWriter->getData(); + } + + /** + * Write VML comment to XML format + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param string $pCellReference Cell reference + * @param PHPExcel_Comment $pComment Comment + * @throws PHPExcel_Writer_Exception + */ + private function writeVMLComment(PHPExcel_Shared_XMLWriter $objWriter = null, $pCellReference = 'A1', PHPExcel_Comment $pComment = null) + { + // Metadata + list($column, $row) = PHPExcel_Cell::coordinateFromString($pCellReference); + $column = PHPExcel_Cell::columnIndexFromString($column); + $id = 1024 + $column + $row; + $id = substr($id, 0, 4); + + // v:shape + $objWriter->startElement('v:shape'); + $objWriter->writeAttribute('id', '_x0000_s' . $id); + $objWriter->writeAttribute('type', '#_x0000_t202'); + $objWriter->writeAttribute('style', 'position:absolute;margin-left:' . $pComment->getMarginLeft() . ';margin-top:' . $pComment->getMarginTop() . ';width:' . $pComment->getWidth() . ';height:' . $pComment->getHeight() . ';z-index:1;visibility:' . ($pComment->getVisible() ? 'visible' : 'hidden')); + $objWriter->writeAttribute('fillcolor', '#' . $pComment->getFillColor()->getRGB()); + $objWriter->writeAttribute('o:insetmode', 'auto'); + + // v:fill + $objWriter->startElement('v:fill'); + $objWriter->writeAttribute('color2', '#' . $pComment->getFillColor()->getRGB()); + $objWriter->endElement(); + + // v:shadow + $objWriter->startElement('v:shadow'); + $objWriter->writeAttribute('on', 't'); + $objWriter->writeAttribute('color', 'black'); + $objWriter->writeAttribute('obscured', 't'); + $objWriter->endElement(); + + // v:path + $objWriter->startElement('v:path'); + $objWriter->writeAttribute('o:connecttype', 'none'); + $objWriter->endElement(); + + // v:textbox + $objWriter->startElement('v:textbox'); + $objWriter->writeAttribute('style', 'mso-direction-alt:auto'); + + // div + $objWriter->startElement('div'); + $objWriter->writeAttribute('style', 'text-align:left'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // x:ClientData + $objWriter->startElement('x:ClientData'); + $objWriter->writeAttribute('ObjectType', 'Note'); + + // x:MoveWithCells + $objWriter->writeElement('x:MoveWithCells', ''); + + // x:SizeWithCells + $objWriter->writeElement('x:SizeWithCells', ''); + + // x:Anchor + //$objWriter->writeElement('x:Anchor', $column . ', 15, ' . ($row - 2) . ', 10, ' . ($column + 4) . ', 15, ' . ($row + 5) . ', 18'); + + // x:AutoFill + $objWriter->writeElement('x:AutoFill', 'False'); + + // x:Row + $objWriter->writeElement('x:Row', ($row - 1)); + + // x:Column + $objWriter->writeElement('x:Column', ($column - 1)); + + $objWriter->endElement(); + + $objWriter->endElement(); + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel2007/ContentTypes.php b/extend/PHPExcel/PHPExcel/Writer/Excel2007/ContentTypes.php new file mode 100644 index 0000000..0d91189 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel2007/ContentTypes.php @@ -0,0 +1,240 @@ +<?php + +/** + * PHPExcel_Writer_Excel2007_ContentTypes + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_WriterPart +{ + /** + * Write content types to XML format + * + * @param PHPExcel $pPHPExcel + * @param boolean $includeCharts Flag indicating if we should include drawing details for charts + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeContentTypes(PHPExcel $pPHPExcel = null, $includeCharts = false) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // Types + $objWriter->startElement('Types'); + $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/content-types'); + + // Theme + $this->writeOverrideContentType($objWriter, '/xl/theme/theme1.xml', 'application/vnd.openxmlformats-officedocument.theme+xml'); + + // Styles + $this->writeOverrideContentType($objWriter, '/xl/styles.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'); + + // Rels + $this->writeDefaultContentType($objWriter, 'rels', 'application/vnd.openxmlformats-package.relationships+xml'); + + // XML + $this->writeDefaultContentType($objWriter, 'xml', 'application/xml'); + + // VML + $this->writeDefaultContentType($objWriter, 'vml', 'application/vnd.openxmlformats-officedocument.vmlDrawing'); + + // Workbook + if ($pPHPExcel->hasMacros()) { //Macros in workbook ? + // Yes : not standard content but "macroEnabled" + $this->writeOverrideContentType($objWriter, '/xl/workbook.xml', 'application/vnd.ms-excel.sheet.macroEnabled.main+xml'); + //... and define a new type for the VBA project + $this->writeDefaultContentType($objWriter, 'bin', 'application/vnd.ms-office.vbaProject'); + if ($pPHPExcel->hasMacrosCertificate()) {// signed macros ? + // Yes : add needed information + $this->writeOverrideContentType($objWriter, '/xl/vbaProjectSignature.bin', 'application/vnd.ms-office.vbaProjectSignature'); + } + } else {// no macros in workbook, so standard type + $this->writeOverrideContentType($objWriter, '/xl/workbook.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml'); + } + + // DocProps + $this->writeOverrideContentType($objWriter, '/docProps/app.xml', 'application/vnd.openxmlformats-officedocument.extended-properties+xml'); + + $this->writeOverrideContentType($objWriter, '/docProps/core.xml', 'application/vnd.openxmlformats-package.core-properties+xml'); + + $customPropertyList = $pPHPExcel->getProperties()->getCustomProperties(); + if (!empty($customPropertyList)) { + $this->writeOverrideContentType($objWriter, '/docProps/custom.xml', 'application/vnd.openxmlformats-officedocument.custom-properties+xml'); + } + + // Worksheets + $sheetCount = $pPHPExcel->getSheetCount(); + for ($i = 0; $i < $sheetCount; ++$i) { + $this->writeOverrideContentType($objWriter, '/xl/worksheets/sheet' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'); + } + + // Shared strings + $this->writeOverrideContentType($objWriter, '/xl/sharedStrings.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml'); + + // Add worksheet relationship content types + $chart = 1; + for ($i = 0; $i < $sheetCount; ++$i) { + $drawings = $pPHPExcel->getSheet($i)->getDrawingCollection(); + $drawingCount = count($drawings); + $chartCount = ($includeCharts) ? $pPHPExcel->getSheet($i)->getChartCount() : 0; + + // We need a drawing relationship for the worksheet if we have either drawings or charts + if (($drawingCount > 0) || ($chartCount > 0)) { + $this->writeOverrideContentType($objWriter, '/xl/drawings/drawing' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.drawing+xml'); + } + + // If we have charts, then we need a chart relationship for every individual chart + if ($chartCount > 0) { + for ($c = 0; $c < $chartCount; ++$c) { + $this->writeOverrideContentType($objWriter, '/xl/charts/chart' . $chart++ . '.xml', 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml'); + } + } + } + + // Comments + for ($i = 0; $i < $sheetCount; ++$i) { + if (count($pPHPExcel->getSheet($i)->getComments()) > 0) { + $this->writeOverrideContentType($objWriter, '/xl/comments' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml'); + } + } + + // Add media content-types + $aMediaContentTypes = array(); + $mediaCount = $this->getParentWriter()->getDrawingHashTable()->count(); + for ($i = 0; $i < $mediaCount; ++$i) { + $extension = ''; + $mimeType = ''; + + if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_Drawing) { + $extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getExtension()); + $mimeType = $this->getImageMimeType($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getPath()); + } elseif ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_MemoryDrawing) { + $extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType()); + $extension = explode('/', $extension); + $extension = $extension[1]; + + $mimeType = $this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType(); + } + + if (!isset( $aMediaContentTypes[$extension])) { + $aMediaContentTypes[$extension] = $mimeType; + + $this->writeDefaultContentType($objWriter, $extension, $mimeType); + } + } + if ($pPHPExcel->hasRibbonBinObjects()) { + // Some additional objects in the ribbon ? + // we need to write "Extension" but not already write for media content + $tabRibbonTypes=array_diff($pPHPExcel->getRibbonBinObjects('types'), array_keys($aMediaContentTypes)); + foreach ($tabRibbonTypes as $aRibbonType) { + $mimeType='image/.'.$aRibbonType;//we wrote $mimeType like customUI Editor + $this->writeDefaultContentType($objWriter, $aRibbonType, $mimeType); + } + } + $sheetCount = $pPHPExcel->getSheetCount(); + for ($i = 0; $i < $sheetCount; ++$i) { + if (count($pPHPExcel->getSheet()->getHeaderFooter()->getImages()) > 0) { + foreach ($pPHPExcel->getSheet()->getHeaderFooter()->getImages() as $image) { + if (!isset( $aMediaContentTypes[strtolower($image->getExtension())])) { + $aMediaContentTypes[strtolower($image->getExtension())] = $this->getImageMimeType($image->getPath()); + + $this->writeDefaultContentType($objWriter, strtolower($image->getExtension()), $aMediaContentTypes[strtolower($image->getExtension())]); + } + } + } + } + + $objWriter->endElement(); + + // Return + return $objWriter->getData(); + } + + /** + * Get image mime type + * + * @param string $pFile Filename + * @return string Mime Type + * @throws PHPExcel_Writer_Exception + */ + private function getImageMimeType($pFile = '') + { + if (PHPExcel_Shared_File::file_exists($pFile)) { + $image = getimagesize($pFile); + return image_type_to_mime_type($image[2]); + } else { + throw new PHPExcel_Writer_Exception("File $pFile does not exist"); + } + } + + /** + * Write Default content type + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param string $pPartname Part name + * @param string $pContentType Content type + * @throws PHPExcel_Writer_Exception + */ + private function writeDefaultContentType(PHPExcel_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') + { + if ($pPartname != '' && $pContentType != '') { + // Write content type + $objWriter->startElement('Default'); + $objWriter->writeAttribute('Extension', $pPartname); + $objWriter->writeAttribute('ContentType', $pContentType); + $objWriter->endElement(); + } else { + throw new PHPExcel_Writer_Exception("Invalid parameters passed."); + } + } + + /** + * Write Override content type + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param string $pPartname Part name + * @param string $pContentType Content type + * @throws PHPExcel_Writer_Exception + */ + private function writeOverrideContentType(PHPExcel_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') + { + if ($pPartname != '' && $pContentType != '') { + // Write content type + $objWriter->startElement('Override'); + $objWriter->writeAttribute('PartName', $pPartname); + $objWriter->writeAttribute('ContentType', $pContentType); + $objWriter->endElement(); + } else { + throw new PHPExcel_Writer_Exception("Invalid parameters passed."); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel2007/DocProps.php b/extend/PHPExcel/PHPExcel/Writer/Excel2007/DocProps.php new file mode 100644 index 0000000..fef3d93 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel2007/DocProps.php @@ -0,0 +1,262 @@ +<?php + +/** + * PHPExcel_Writer_Excel2007_DocProps + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_WriterPart +{ + /** + * Write docProps/app.xml to XML format + * + * @param PHPExcel $pPHPExcel + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeDocPropsApp(PHPExcel $pPHPExcel = null) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // Properties + $objWriter->startElement('Properties'); + $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties'); + $objWriter->writeAttribute('xmlns:vt', 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'); + + // Application + $objWriter->writeElement('Application', 'Microsoft Excel'); + + // DocSecurity + $objWriter->writeElement('DocSecurity', '0'); + + // ScaleCrop + $objWriter->writeElement('ScaleCrop', 'false'); + + // HeadingPairs + $objWriter->startElement('HeadingPairs'); + + // Vector + $objWriter->startElement('vt:vector'); + $objWriter->writeAttribute('size', '2'); + $objWriter->writeAttribute('baseType', 'variant'); + + // Variant + $objWriter->startElement('vt:variant'); + $objWriter->writeElement('vt:lpstr', 'Worksheets'); + $objWriter->endElement(); + + // Variant + $objWriter->startElement('vt:variant'); + $objWriter->writeElement('vt:i4', $pPHPExcel->getSheetCount()); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // TitlesOfParts + $objWriter->startElement('TitlesOfParts'); + + // Vector + $objWriter->startElement('vt:vector'); + $objWriter->writeAttribute('size', $pPHPExcel->getSheetCount()); + $objWriter->writeAttribute('baseType', 'lpstr'); + + $sheetCount = $pPHPExcel->getSheetCount(); + for ($i = 0; $i < $sheetCount; ++$i) { + $objWriter->writeElement('vt:lpstr', $pPHPExcel->getSheet($i)->getTitle()); + } + + $objWriter->endElement(); + + $objWriter->endElement(); + + // Company + $objWriter->writeElement('Company', $pPHPExcel->getProperties()->getCompany()); + + // Company + $objWriter->writeElement('Manager', $pPHPExcel->getProperties()->getManager()); + + // LinksUpToDate + $objWriter->writeElement('LinksUpToDate', 'false'); + + // SharedDoc + $objWriter->writeElement('SharedDoc', 'false'); + + // HyperlinksChanged + $objWriter->writeElement('HyperlinksChanged', 'false'); + + // AppVersion + $objWriter->writeElement('AppVersion', '12.0000'); + + $objWriter->endElement(); + + // Return + return $objWriter->getData(); + } + + /** + * Write docProps/core.xml to XML format + * + * @param PHPExcel $pPHPExcel + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeDocPropsCore(PHPExcel $pPHPExcel = null) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // cp:coreProperties + $objWriter->startElement('cp:coreProperties'); + $objWriter->writeAttribute('xmlns:cp', 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties'); + $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/'); + $objWriter->writeAttribute('xmlns:dcterms', 'http://purl.org/dc/terms/'); + $objWriter->writeAttribute('xmlns:dcmitype', 'http://purl.org/dc/dcmitype/'); + $objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); + + // dc:creator + $objWriter->writeElement('dc:creator', $pPHPExcel->getProperties()->getCreator()); + + // cp:lastModifiedBy + $objWriter->writeElement('cp:lastModifiedBy', $pPHPExcel->getProperties()->getLastModifiedBy()); + + // dcterms:created + $objWriter->startElement('dcterms:created'); + $objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF'); + $objWriter->writeRawData(date(DATE_W3C, $pPHPExcel->getProperties()->getCreated())); + $objWriter->endElement(); + + // dcterms:modified + $objWriter->startElement('dcterms:modified'); + $objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF'); + $objWriter->writeRawData(date(DATE_W3C, $pPHPExcel->getProperties()->getModified())); + $objWriter->endElement(); + + // dc:title + $objWriter->writeElement('dc:title', $pPHPExcel->getProperties()->getTitle()); + + // dc:description + $objWriter->writeElement('dc:description', $pPHPExcel->getProperties()->getDescription()); + + // dc:subject + $objWriter->writeElement('dc:subject', $pPHPExcel->getProperties()->getSubject()); + + // cp:keywords + $objWriter->writeElement('cp:keywords', $pPHPExcel->getProperties()->getKeywords()); + + // cp:category + $objWriter->writeElement('cp:category', $pPHPExcel->getProperties()->getCategory()); + + $objWriter->endElement(); + + // Return + return $objWriter->getData(); + } + + /** + * Write docProps/custom.xml to XML format + * + * @param PHPExcel $pPHPExcel + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeDocPropsCustom(PHPExcel $pPHPExcel = null) + { + $customPropertyList = $pPHPExcel->getProperties()->getCustomProperties(); + if (empty($customPropertyList)) { + return; + } + + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // cp:coreProperties + $objWriter->startElement('Properties'); + $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/officeDocument/2006/custom-properties'); + $objWriter->writeAttribute('xmlns:vt', 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'); + + + foreach ($customPropertyList as $key => $customProperty) { + $propertyValue = $pPHPExcel->getProperties()->getCustomPropertyValue($customProperty); + $propertyType = $pPHPExcel->getProperties()->getCustomPropertyType($customProperty); + + $objWriter->startElement('property'); + $objWriter->writeAttribute('fmtid', '{D5CDD505-2E9C-101B-9397-08002B2CF9AE}'); + $objWriter->writeAttribute('pid', $key+2); + $objWriter->writeAttribute('name', $customProperty); + + switch ($propertyType) { + case 'i': + $objWriter->writeElement('vt:i4', $propertyValue); + break; + case 'f': + $objWriter->writeElement('vt:r8', $propertyValue); + break; + case 'b': + $objWriter->writeElement('vt:bool', ($propertyValue) ? 'true' : 'false'); + break; + case 'd': + $objWriter->startElement('vt:filetime'); + $objWriter->writeRawData(date(DATE_W3C, $propertyValue)); + $objWriter->endElement(); + break; + default: + $objWriter->writeElement('vt:lpwstr', $propertyValue); + break; + } + + $objWriter->endElement(); + } + + + $objWriter->endElement(); + + return $objWriter->getData(); + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel2007/Drawing.php b/extend/PHPExcel/PHPExcel/Writer/Excel2007/Drawing.php new file mode 100644 index 0000000..2814388 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel2007/Drawing.php @@ -0,0 +1,589 @@ +<?php + +/** + * PHPExcel_Writer_Excel2007_Drawing + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_WriterPart +{ + /** + * Write drawings to XML format + * + * @param PHPExcel_Worksheet $pWorksheet + * @param int &$chartRef Chart ID + * @param boolean $includeCharts Flag indicating if we should include drawing details for charts + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeDrawings(PHPExcel_Worksheet $pWorksheet = null, &$chartRef, $includeCharts = false) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // xdr:wsDr + $objWriter->startElement('xdr:wsDr'); + $objWriter->writeAttribute('xmlns:xdr', 'http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing'); + $objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main'); + + // Loop through images and write drawings + $i = 1; + $iterator = $pWorksheet->getDrawingCollection()->getIterator(); + while ($iterator->valid()) { + $this->writeDrawing($objWriter, $iterator->current(), $i); + + $iterator->next(); + ++$i; + } + + if ($includeCharts) { + $chartCount = $pWorksheet->getChartCount(); + // Loop through charts and write the chart position + if ($chartCount > 0) { + for ($c = 0; $c < $chartCount; ++$c) { + $this->writeChart($objWriter, $pWorksheet->getChartByIndex($c), $c+$i); + } + } + } + + $objWriter->endElement(); + + // Return + return $objWriter->getData(); + } + + /** + * Write drawings to XML format + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Chart $pChart + * @param int $pRelationId + * @throws PHPExcel_Writer_Exception + */ + public function writeChart(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Chart $pChart = null, $pRelationId = -1) + { + $tl = $pChart->getTopLeftPosition(); + $tl['colRow'] = PHPExcel_Cell::coordinateFromString($tl['cell']); + $br = $pChart->getBottomRightPosition(); + $br['colRow'] = PHPExcel_Cell::coordinateFromString($br['cell']); + + $objWriter->startElement('xdr:twoCellAnchor'); + + $objWriter->startElement('xdr:from'); + $objWriter->writeElement('xdr:col', PHPExcel_Cell::columnIndexFromString($tl['colRow'][0]) - 1); + $objWriter->writeElement('xdr:colOff', PHPExcel_Shared_Drawing::pixelsToEMU($tl['xOffset'])); + $objWriter->writeElement('xdr:row', $tl['colRow'][1] - 1); + $objWriter->writeElement('xdr:rowOff', PHPExcel_Shared_Drawing::pixelsToEMU($tl['yOffset'])); + $objWriter->endElement(); + $objWriter->startElement('xdr:to'); + $objWriter->writeElement('xdr:col', PHPExcel_Cell::columnIndexFromString($br['colRow'][0]) - 1); + $objWriter->writeElement('xdr:colOff', PHPExcel_Shared_Drawing::pixelsToEMU($br['xOffset'])); + $objWriter->writeElement('xdr:row', $br['colRow'][1] - 1); + $objWriter->writeElement('xdr:rowOff', PHPExcel_Shared_Drawing::pixelsToEMU($br['yOffset'])); + $objWriter->endElement(); + + $objWriter->startElement('xdr:graphicFrame'); + $objWriter->writeAttribute('macro', ''); + $objWriter->startElement('xdr:nvGraphicFramePr'); + $objWriter->startElement('xdr:cNvPr'); + $objWriter->writeAttribute('name', 'Chart '.$pRelationId); + $objWriter->writeAttribute('id', 1025 * $pRelationId); + $objWriter->endElement(); + $objWriter->startElement('xdr:cNvGraphicFramePr'); + $objWriter->startElement('a:graphicFrameLocks'); + $objWriter->endElement(); + $objWriter->endElement(); + $objWriter->endElement(); + + $objWriter->startElement('xdr:xfrm'); + $objWriter->startElement('a:off'); + $objWriter->writeAttribute('x', '0'); + $objWriter->writeAttribute('y', '0'); + $objWriter->endElement(); + $objWriter->startElement('a:ext'); + $objWriter->writeAttribute('cx', '0'); + $objWriter->writeAttribute('cy', '0'); + $objWriter->endElement(); + $objWriter->endElement(); + + $objWriter->startElement('a:graphic'); + $objWriter->startElement('a:graphicData'); + $objWriter->writeAttribute('uri', 'http://schemas.openxmlformats.org/drawingml/2006/chart'); + $objWriter->startElement('c:chart'); + $objWriter->writeAttribute('xmlns:c', 'http://schemas.openxmlformats.org/drawingml/2006/chart'); + $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); + $objWriter->writeAttribute('r:id', 'rId'.$pRelationId); + $objWriter->endElement(); + $objWriter->endElement(); + $objWriter->endElement(); + $objWriter->endElement(); + + $objWriter->startElement('xdr:clientData'); + $objWriter->endElement(); + + $objWriter->endElement(); + } + + /** + * Write drawings to XML format + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet_BaseDrawing $pDrawing + * @param int $pRelationId + * @throws PHPExcel_Writer_Exception + */ + public function writeDrawing(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet_BaseDrawing $pDrawing = null, $pRelationId = -1) + { + if ($pRelationId >= 0) { + // xdr:oneCellAnchor + $objWriter->startElement('xdr:oneCellAnchor'); + // Image location + $aCoordinates = PHPExcel_Cell::coordinateFromString($pDrawing->getCoordinates()); + $aCoordinates[0] = PHPExcel_Cell::columnIndexFromString($aCoordinates[0]); + + // xdr:from + $objWriter->startElement('xdr:from'); + $objWriter->writeElement('xdr:col', $aCoordinates[0] - 1); + $objWriter->writeElement('xdr:colOff', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getOffsetX())); + $objWriter->writeElement('xdr:row', $aCoordinates[1] - 1); + $objWriter->writeElement('xdr:rowOff', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getOffsetY())); + $objWriter->endElement(); + + // xdr:ext + $objWriter->startElement('xdr:ext'); + $objWriter->writeAttribute('cx', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getWidth())); + $objWriter->writeAttribute('cy', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getHeight())); + $objWriter->endElement(); + + // xdr:pic + $objWriter->startElement('xdr:pic'); + + // xdr:nvPicPr + $objWriter->startElement('xdr:nvPicPr'); + + // xdr:cNvPr + $objWriter->startElement('xdr:cNvPr'); + $objWriter->writeAttribute('id', $pRelationId); + $objWriter->writeAttribute('name', $pDrawing->getName()); + $objWriter->writeAttribute('descr', $pDrawing->getDescription()); + $objWriter->endElement(); + + // xdr:cNvPicPr + $objWriter->startElement('xdr:cNvPicPr'); + + // a:picLocks + $objWriter->startElement('a:picLocks'); + $objWriter->writeAttribute('noChangeAspect', '1'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // xdr:blipFill + $objWriter->startElement('xdr:blipFill'); + + // a:blip + $objWriter->startElement('a:blip'); + $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); + $objWriter->writeAttribute('r:embed', 'rId' . $pRelationId); + $objWriter->endElement(); + + // a:stretch + $objWriter->startElement('a:stretch'); + $objWriter->writeElement('a:fillRect', null); + $objWriter->endElement(); + + $objWriter->endElement(); + + // xdr:spPr + $objWriter->startElement('xdr:spPr'); + + // a:xfrm + $objWriter->startElement('a:xfrm'); + $objWriter->writeAttribute('rot', PHPExcel_Shared_Drawing::degreesToAngle($pDrawing->getRotation())); + $objWriter->endElement(); + + // a:prstGeom + $objWriter->startElement('a:prstGeom'); + $objWriter->writeAttribute('prst', 'rect'); + + // a:avLst + $objWriter->writeElement('a:avLst', null); + + $objWriter->endElement(); + +// // a:solidFill +// $objWriter->startElement('a:solidFill'); + +// // a:srgbClr +// $objWriter->startElement('a:srgbClr'); +// $objWriter->writeAttribute('val', 'FFFFFF'); + +///* SHADE +// // a:shade +// $objWriter->startElement('a:shade'); +// $objWriter->writeAttribute('val', '85000'); +// $objWriter->endElement(); +//*/ + +// $objWriter->endElement(); + +// $objWriter->endElement(); +/* + // a:ln + $objWriter->startElement('a:ln'); + $objWriter->writeAttribute('w', '88900'); + $objWriter->writeAttribute('cap', 'sq'); + + // a:solidFill + $objWriter->startElement('a:solidFill'); + + // a:srgbClr + $objWriter->startElement('a:srgbClr'); + $objWriter->writeAttribute('val', 'FFFFFF'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:miter + $objWriter->startElement('a:miter'); + $objWriter->writeAttribute('lim', '800000'); + $objWriter->endElement(); + + $objWriter->endElement(); +*/ + + if ($pDrawing->getShadow()->getVisible()) { + // a:effectLst + $objWriter->startElement('a:effectLst'); + + // a:outerShdw + $objWriter->startElement('a:outerShdw'); + $objWriter->writeAttribute('blurRad', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getShadow()->getBlurRadius())); + $objWriter->writeAttribute('dist', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getShadow()->getDistance())); + $objWriter->writeAttribute('dir', PHPExcel_Shared_Drawing::degreesToAngle($pDrawing->getShadow()->getDirection())); + $objWriter->writeAttribute('algn', $pDrawing->getShadow()->getAlignment()); + $objWriter->writeAttribute('rotWithShape', '0'); + + // a:srgbClr + $objWriter->startElement('a:srgbClr'); + $objWriter->writeAttribute('val', $pDrawing->getShadow()->getColor()->getRGB()); + + // a:alpha + $objWriter->startElement('a:alpha'); + $objWriter->writeAttribute('val', $pDrawing->getShadow()->getAlpha() * 1000); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + } +/* + + // a:scene3d + $objWriter->startElement('a:scene3d'); + + // a:camera + $objWriter->startElement('a:camera'); + $objWriter->writeAttribute('prst', 'orthographicFront'); + $objWriter->endElement(); + + // a:lightRig + $objWriter->startElement('a:lightRig'); + $objWriter->writeAttribute('rig', 'twoPt'); + $objWriter->writeAttribute('dir', 't'); + + // a:rot + $objWriter->startElement('a:rot'); + $objWriter->writeAttribute('lat', '0'); + $objWriter->writeAttribute('lon', '0'); + $objWriter->writeAttribute('rev', '0'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); +*/ +/* + // a:sp3d + $objWriter->startElement('a:sp3d'); + + // a:bevelT + $objWriter->startElement('a:bevelT'); + $objWriter->writeAttribute('w', '25400'); + $objWriter->writeAttribute('h', '19050'); + $objWriter->endElement(); + + // a:contourClr + $objWriter->startElement('a:contourClr'); + + // a:srgbClr + $objWriter->startElement('a:srgbClr'); + $objWriter->writeAttribute('val', 'FFFFFF'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); +*/ + $objWriter->endElement(); + + $objWriter->endElement(); + + // xdr:clientData + $objWriter->writeElement('xdr:clientData', null); + + $objWriter->endElement(); + } else { + throw new PHPExcel_Writer_Exception("Invalid parameters passed."); + } + } + + /** + * Write VML header/footer images to XML format + * + * @param PHPExcel_Worksheet $pWorksheet + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeVMLHeaderFooterImages(PHPExcel_Worksheet $pWorksheet = null) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // Header/footer images + $images = $pWorksheet->getHeaderFooter()->getImages(); + + // xml + $objWriter->startElement('xml'); + $objWriter->writeAttribute('xmlns:v', 'urn:schemas-microsoft-com:vml'); + $objWriter->writeAttribute('xmlns:o', 'urn:schemas-microsoft-com:office:office'); + $objWriter->writeAttribute('xmlns:x', 'urn:schemas-microsoft-com:office:excel'); + + // o:shapelayout + $objWriter->startElement('o:shapelayout'); + $objWriter->writeAttribute('v:ext', 'edit'); + + // o:idmap + $objWriter->startElement('o:idmap'); + $objWriter->writeAttribute('v:ext', 'edit'); + $objWriter->writeAttribute('data', '1'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // v:shapetype + $objWriter->startElement('v:shapetype'); + $objWriter->writeAttribute('id', '_x0000_t75'); + $objWriter->writeAttribute('coordsize', '21600,21600'); + $objWriter->writeAttribute('o:spt', '75'); + $objWriter->writeAttribute('o:preferrelative', 't'); + $objWriter->writeAttribute('path', 'm@4@5l@4@11@9@11@9@5xe'); + $objWriter->writeAttribute('filled', 'f'); + $objWriter->writeAttribute('stroked', 'f'); + + // v:stroke + $objWriter->startElement('v:stroke'); + $objWriter->writeAttribute('joinstyle', 'miter'); + $objWriter->endElement(); + + // v:formulas + $objWriter->startElement('v:formulas'); + + // v:f + $objWriter->startElement('v:f'); + $objWriter->writeAttribute('eqn', 'if lineDrawn pixelLineWidth 0'); + $objWriter->endElement(); + + // v:f + $objWriter->startElement('v:f'); + $objWriter->writeAttribute('eqn', 'sum @0 1 0'); + $objWriter->endElement(); + + // v:f + $objWriter->startElement('v:f'); + $objWriter->writeAttribute('eqn', 'sum 0 0 @1'); + $objWriter->endElement(); + + // v:f + $objWriter->startElement('v:f'); + $objWriter->writeAttribute('eqn', 'prod @2 1 2'); + $objWriter->endElement(); + + // v:f + $objWriter->startElement('v:f'); + $objWriter->writeAttribute('eqn', 'prod @3 21600 pixelWidth'); + $objWriter->endElement(); + + // v:f + $objWriter->startElement('v:f'); + $objWriter->writeAttribute('eqn', 'prod @3 21600 pixelHeight'); + $objWriter->endElement(); + + // v:f + $objWriter->startElement('v:f'); + $objWriter->writeAttribute('eqn', 'sum @0 0 1'); + $objWriter->endElement(); + + // v:f + $objWriter->startElement('v:f'); + $objWriter->writeAttribute('eqn', 'prod @6 1 2'); + $objWriter->endElement(); + + // v:f + $objWriter->startElement('v:f'); + $objWriter->writeAttribute('eqn', 'prod @7 21600 pixelWidth'); + $objWriter->endElement(); + + // v:f + $objWriter->startElement('v:f'); + $objWriter->writeAttribute('eqn', 'sum @8 21600 0'); + $objWriter->endElement(); + + // v:f + $objWriter->startElement('v:f'); + $objWriter->writeAttribute('eqn', 'prod @7 21600 pixelHeight'); + $objWriter->endElement(); + + // v:f + $objWriter->startElement('v:f'); + $objWriter->writeAttribute('eqn', 'sum @10 21600 0'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // v:path + $objWriter->startElement('v:path'); + $objWriter->writeAttribute('o:extrusionok', 'f'); + $objWriter->writeAttribute('gradientshapeok', 't'); + $objWriter->writeAttribute('o:connecttype', 'rect'); + $objWriter->endElement(); + + // o:lock + $objWriter->startElement('o:lock'); + $objWriter->writeAttribute('v:ext', 'edit'); + $objWriter->writeAttribute('aspectratio', 't'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // Loop through images + foreach ($images as $key => $value) { + $this->writeVMLHeaderFooterImage($objWriter, $key, $value); + } + + $objWriter->endElement(); + + // Return + return $objWriter->getData(); + } + + /** + * Write VML comment to XML format + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param string $pReference Reference + * @param PHPExcel_Worksheet_HeaderFooterDrawing $pImage Image + * @throws PHPExcel_Writer_Exception + */ + private function writeVMLHeaderFooterImage(PHPExcel_Shared_XMLWriter $objWriter = null, $pReference = '', PHPExcel_Worksheet_HeaderFooterDrawing $pImage = null) + { + // Calculate object id + preg_match('{(\d+)}', md5($pReference), $m); + $id = 1500 + (substr($m[1], 0, 2) * 1); + + // Calculate offset + $width = $pImage->getWidth(); + $height = $pImage->getHeight(); + $marginLeft = $pImage->getOffsetX(); + $marginTop = $pImage->getOffsetY(); + + // v:shape + $objWriter->startElement('v:shape'); + $objWriter->writeAttribute('id', $pReference); + $objWriter->writeAttribute('o:spid', '_x0000_s' . $id); + $objWriter->writeAttribute('type', '#_x0000_t75'); + $objWriter->writeAttribute('style', "position:absolute;margin-left:{$marginLeft}px;margin-top:{$marginTop}px;width:{$width}px;height:{$height}px;z-index:1"); + + // v:imagedata + $objWriter->startElement('v:imagedata'); + $objWriter->writeAttribute('o:relid', 'rId' . $pReference); + $objWriter->writeAttribute('o:title', $pImage->getName()); + $objWriter->endElement(); + + // o:lock + $objWriter->startElement('o:lock'); + $objWriter->writeAttribute('v:ext', 'edit'); + $objWriter->writeAttribute('rotation', 't'); + $objWriter->endElement(); + + $objWriter->endElement(); + } + + + /** + * Get an array of all drawings + * + * @param PHPExcel $pPHPExcel + * @return PHPExcel_Worksheet_Drawing[] All drawings in PHPExcel + * @throws PHPExcel_Writer_Exception + */ + public function allDrawings(PHPExcel $pPHPExcel = null) + { + // Get an array of all drawings + $aDrawings = array(); + + // Loop through PHPExcel + $sheetCount = $pPHPExcel->getSheetCount(); + for ($i = 0; $i < $sheetCount; ++$i) { + // Loop through images and add to array + $iterator = $pPHPExcel->getSheet($i)->getDrawingCollection()->getIterator(); + while ($iterator->valid()) { + $aDrawings[] = $iterator->current(); + + $iterator->next(); + } + } + + return $aDrawings; + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel2007/Rels.php b/extend/PHPExcel/PHPExcel/Writer/Excel2007/Rels.php new file mode 100644 index 0000000..14ff337 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel2007/Rels.php @@ -0,0 +1,424 @@ +<?php + +/** + * PHPExcel_Writer_Excel2007_Rels + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPart +{ + /** + * Write relationships to XML format + * + * @param PHPExcel $pPHPExcel + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeRelationships(PHPExcel $pPHPExcel = null) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // Relationships + $objWriter->startElement('Relationships'); + $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); + + $customPropertyList = $pPHPExcel->getProperties()->getCustomProperties(); + if (!empty($customPropertyList)) { + // Relationship docProps/app.xml + $this->writeRelationship( + $objWriter, + 4, + 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties', + 'docProps/custom.xml' + ); + + } + + // Relationship docProps/app.xml + $this->writeRelationship( + $objWriter, + 3, + 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties', + 'docProps/app.xml' + ); + + // Relationship docProps/core.xml + $this->writeRelationship( + $objWriter, + 2, + 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties', + 'docProps/core.xml' + ); + + // Relationship xl/workbook.xml + $this->writeRelationship( + $objWriter, + 1, + 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument', + 'xl/workbook.xml' + ); + // a custom UI in workbook ? + if ($pPHPExcel->hasRibbon()) { + $this->writeRelationShip( + $objWriter, + 5, + 'http://schemas.microsoft.com/office/2006/relationships/ui/extensibility', + $pPHPExcel->getRibbonXMLData('target') + ); + } + + $objWriter->endElement(); + + return $objWriter->getData(); + } + + /** + * Write workbook relationships to XML format + * + * @param PHPExcel $pPHPExcel + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeWorkbookRelationships(PHPExcel $pPHPExcel = null) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // Relationships + $objWriter->startElement('Relationships'); + $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); + + // Relationship styles.xml + $this->writeRelationship( + $objWriter, + 1, + 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles', + 'styles.xml' + ); + + // Relationship theme/theme1.xml + $this->writeRelationship( + $objWriter, + 2, + 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme', + 'theme/theme1.xml' + ); + + // Relationship sharedStrings.xml + $this->writeRelationship( + $objWriter, + 3, + 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings', + 'sharedStrings.xml' + ); + + // Relationships with sheets + $sheetCount = $pPHPExcel->getSheetCount(); + for ($i = 0; $i < $sheetCount; ++$i) { + $this->writeRelationship( + $objWriter, + ($i + 1 + 3), + 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet', + 'worksheets/sheet' . ($i + 1) . '.xml' + ); + } + // Relationships for vbaProject if needed + // id : just after the last sheet + if ($pPHPExcel->hasMacros()) { + $this->writeRelationShip( + $objWriter, + ($i + 1 + 3), + 'http://schemas.microsoft.com/office/2006/relationships/vbaProject', + 'vbaProject.bin' + ); + ++$i;//increment i if needed for an another relation + } + + $objWriter->endElement(); + + return $objWriter->getData(); + } + + /** + * Write worksheet relationships to XML format + * + * Numbering is as follows: + * rId1 - Drawings + * rId_hyperlink_x - Hyperlinks + * + * @param PHPExcel_Worksheet $pWorksheet + * @param int $pWorksheetId + * @param boolean $includeCharts Flag indicating if we should write charts + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeWorksheetRelationships(PHPExcel_Worksheet $pWorksheet = null, $pWorksheetId = 1, $includeCharts = false) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // Relationships + $objWriter->startElement('Relationships'); + $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); + + // Write drawing relationships? + $d = 0; + if ($includeCharts) { + $charts = $pWorksheet->getChartCollection(); + } else { + $charts = array(); + } + if (($pWorksheet->getDrawingCollection()->count() > 0) || + (count($charts) > 0)) { + $this->writeRelationship( + $objWriter, + ++$d, + 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing', + '../drawings/drawing' . $pWorksheetId . '.xml' + ); + } + + // Write chart relationships? +// $chartCount = 0; +// $charts = $pWorksheet->getChartCollection(); +// echo 'Chart Rels: ' , count($charts) , '<br />'; +// if (count($charts) > 0) { +// foreach ($charts as $chart) { +// $this->writeRelationship( +// $objWriter, +// ++$d, +// 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart', +// '../charts/chart' . ++$chartCount . '.xml' +// ); +// } +// } +// + // Write hyperlink relationships? + $i = 1; + foreach ($pWorksheet->getHyperlinkCollection() as $hyperlink) { + if (!$hyperlink->isInternal()) { + $this->writeRelationship( + $objWriter, + '_hyperlink_' . $i, + 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink', + $hyperlink->getUrl(), + 'External' + ); + + ++$i; + } + } + + // Write comments relationship? + $i = 1; + if (count($pWorksheet->getComments()) > 0) { + $this->writeRelationship( + $objWriter, + '_comments_vml' . $i, + 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing', + '../drawings/vmlDrawing' . $pWorksheetId . '.vml' + ); + + $this->writeRelationship( + $objWriter, + '_comments' . $i, + 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments', + '../comments' . $pWorksheetId . '.xml' + ); + } + + // Write header/footer relationship? + $i = 1; + if (count($pWorksheet->getHeaderFooter()->getImages()) > 0) { + $this->writeRelationship( + $objWriter, + '_headerfooter_vml' . $i, + 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing', + '../drawings/vmlDrawingHF' . $pWorksheetId . '.vml' + ); + } + + $objWriter->endElement(); + + return $objWriter->getData(); + } + + /** + * Write drawing relationships to XML format + * + * @param PHPExcel_Worksheet $pWorksheet + * @param int &$chartRef Chart ID + * @param boolean $includeCharts Flag indicating if we should write charts + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeDrawingRelationships(PHPExcel_Worksheet $pWorksheet = null, &$chartRef, $includeCharts = false) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // Relationships + $objWriter->startElement('Relationships'); + $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); + + // Loop through images and write relationships + $i = 1; + $iterator = $pWorksheet->getDrawingCollection()->getIterator(); + while ($iterator->valid()) { + if ($iterator->current() instanceof PHPExcel_Worksheet_Drawing + || $iterator->current() instanceof PHPExcel_Worksheet_MemoryDrawing) { + // Write relationship for image drawing + $this->writeRelationship( + $objWriter, + $i, + 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image', + '../media/' . str_replace(' ', '', $iterator->current()->getIndexedFilename()) + ); + } + + $iterator->next(); + ++$i; + } + + if ($includeCharts) { + // Loop through charts and write relationships + $chartCount = $pWorksheet->getChartCount(); + if ($chartCount > 0) { + for ($c = 0; $c < $chartCount; ++$c) { + $this->writeRelationship( + $objWriter, + $i++, + 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart', + '../charts/chart' . ++$chartRef . '.xml' + ); + } + } + } + + $objWriter->endElement(); + + return $objWriter->getData(); + } + + /** + * Write header/footer drawing relationships to XML format + * + * @param PHPExcel_Worksheet $pWorksheet + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeHeaderFooterDrawingRelationships(PHPExcel_Worksheet $pWorksheet = null) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // Relationships + $objWriter->startElement('Relationships'); + $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); + + // Loop through images and write relationships + foreach ($pWorksheet->getHeaderFooter()->getImages() as $key => $value) { + // Write relationship for image drawing + $this->writeRelationship( + $objWriter, + $key, + 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image', + '../media/' . $value->getIndexedFilename() + ); + } + + $objWriter->endElement(); + + return $objWriter->getData(); + } + + /** + * Write Override content type + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param int $pId Relationship ID. rId will be prepended! + * @param string $pType Relationship type + * @param string $pTarget Relationship target + * @param string $pTargetMode Relationship target mode + * @throws PHPExcel_Writer_Exception + */ + private function writeRelationship(PHPExcel_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') + { + if ($pType != '' && $pTarget != '') { + // Write relationship + $objWriter->startElement('Relationship'); + $objWriter->writeAttribute('Id', 'rId' . $pId); + $objWriter->writeAttribute('Type', $pType); + $objWriter->writeAttribute('Target', $pTarget); + + if ($pTargetMode != '') { + $objWriter->writeAttribute('TargetMode', $pTargetMode); + } + + $objWriter->endElement(); + } else { + throw new PHPExcel_Writer_Exception("Invalid parameters passed."); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel2007/RelsRibbon.php b/extend/PHPExcel/PHPExcel/Writer/Excel2007/RelsRibbon.php new file mode 100644 index 0000000..5a4a9fc --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel2007/RelsRibbon.php @@ -0,0 +1,67 @@ +<?php + +/** + * PHPExcel_Writer_Excel2007_RelsRibbon + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_Excel2007_RelsRibbon extends PHPExcel_Writer_Excel2007_WriterPart +{ + /** + * Write relationships for additional objects of custom UI (ribbon) + * + * @param PHPExcel $pPHPExcel + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeRibbonRelationships(PHPExcel $pPHPExcel = null) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // Relationships + $objWriter->startElement('Relationships'); + $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); + $localRels = $pPHPExcel->getRibbonBinObjects('names'); + if (is_array($localRels)) { + foreach ($localRels as $aId => $aTarget) { + $objWriter->startElement('Relationship'); + $objWriter->writeAttribute('Id', $aId); + $objWriter->writeAttribute('Type', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image'); + $objWriter->writeAttribute('Target', $aTarget); + $objWriter->endElement(); + } + } + $objWriter->endElement(); + + return $objWriter->getData(); + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel2007/RelsVBA.php b/extend/PHPExcel/PHPExcel/Writer/Excel2007/RelsVBA.php new file mode 100644 index 0000000..bee0e64 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel2007/RelsVBA.php @@ -0,0 +1,63 @@ +<?php + +/** + * PHPExcel_Writer_Excel2007_RelsVBA + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_Excel2007_RelsVBA extends PHPExcel_Writer_Excel2007_WriterPart +{ + /** + * Write relationships for a signed VBA Project + * + * @param PHPExcel $pPHPExcel + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeVBARelationships(PHPExcel $pPHPExcel = null) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // Relationships + $objWriter->startElement('Relationships'); + $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); + $objWriter->startElement('Relationship'); + $objWriter->writeAttribute('Id', 'rId1'); + $objWriter->writeAttribute('Type', 'http://schemas.microsoft.com/office/2006/relationships/vbaProjectSignature'); + $objWriter->writeAttribute('Target', 'vbaProjectSignature.bin'); + $objWriter->endElement(); + $objWriter->endElement(); + + return $objWriter->getData(); + + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel2007/StringTable.php b/extend/PHPExcel/PHPExcel/Writer/Excel2007/StringTable.php new file mode 100644 index 0000000..fccec66 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel2007/StringTable.php @@ -0,0 +1,313 @@ +<?php + +/** + * PHPExcel_Writer_Excel2007_StringTable + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_WriterPart +{ + /** + * Create worksheet stringtable + * + * @param PHPExcel_Worksheet $pSheet Worksheet + * @param string[] $pExistingTable Existing table to eventually merge with + * @return string[] String table for worksheet + * @throws PHPExcel_Writer_Exception + */ + public function createStringTable($pSheet = null, $pExistingTable = null) + { + if ($pSheet !== null) { + // Create string lookup table + $aStringTable = array(); + $cellCollection = null; + $aFlippedStringTable = null; // For faster lookup + + // Is an existing table given? + if (($pExistingTable !== null) && is_array($pExistingTable)) { + $aStringTable = $pExistingTable; + } + + // Fill index array + $aFlippedStringTable = $this->flipStringTable($aStringTable); + + // Loop through cells + foreach ($pSheet->getCellCollection() as $cellID) { + $cell = $pSheet->getCell($cellID); + $cellValue = $cell->getValue(); + if (!is_object($cellValue) && + ($cellValue !== null) && + $cellValue !== '' && + !isset($aFlippedStringTable[$cellValue]) && + ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_STRING || $cell->getDataType() == PHPExcel_Cell_DataType::TYPE_STRING2 || $cell->getDataType() == PHPExcel_Cell_DataType::TYPE_NULL)) { + $aStringTable[] = $cellValue; + $aFlippedStringTable[$cellValue] = true; + } elseif ($cellValue instanceof PHPExcel_RichText && + ($cellValue !== null) && + !isset($aFlippedStringTable[$cellValue->getHashCode()])) { + $aStringTable[] = $cellValue; + $aFlippedStringTable[$cellValue->getHashCode()] = true; + } + } + + return $aStringTable; + } else { + throw new PHPExcel_Writer_Exception("Invalid PHPExcel_Worksheet object passed."); + } + } + + /** + * Write string table to XML format + * + * @param string[] $pStringTable + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeStringTable($pStringTable = null) + { + if ($pStringTable !== null) { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // String table + $objWriter->startElement('sst'); + $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'); + $objWriter->writeAttribute('uniqueCount', count($pStringTable)); + + // Loop through string table + foreach ($pStringTable as $textElement) { + $objWriter->startElement('si'); + + if (! $textElement instanceof PHPExcel_RichText) { + $textToWrite = PHPExcel_Shared_String::ControlCharacterPHP2OOXML($textElement); + $objWriter->startElement('t'); + if ($textToWrite !== trim($textToWrite)) { + $objWriter->writeAttribute('xml:space', 'preserve'); + } + $objWriter->writeRawData($textToWrite); + $objWriter->endElement(); + } elseif ($textElement instanceof PHPExcel_RichText) { + $this->writeRichText($objWriter, $textElement); + } + + $objWriter->endElement(); + } + + $objWriter->endElement(); + + return $objWriter->getData(); + } else { + throw new PHPExcel_Writer_Exception("Invalid string table array passed."); + } + } + + /** + * Write Rich Text + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_RichText $pRichText Rich text + * @param string $prefix Optional Namespace prefix + * @throws PHPExcel_Writer_Exception + */ + public function writeRichText(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_RichText $pRichText = null, $prefix = null) + { + if ($prefix !== null) { + $prefix .= ':'; + } + + // Loop through rich text elements + $elements = $pRichText->getRichTextElements(); + foreach ($elements as $element) { + // r + $objWriter->startElement($prefix.'r'); + + // rPr + if ($element instanceof PHPExcel_RichText_Run) { + // rPr + $objWriter->startElement($prefix.'rPr'); + + // rFont + $objWriter->startElement($prefix.'rFont'); + $objWriter->writeAttribute('val', $element->getFont()->getName()); + $objWriter->endElement(); + + // Bold + $objWriter->startElement($prefix.'b'); + $objWriter->writeAttribute('val', ($element->getFont()->getBold() ? 'true' : 'false')); + $objWriter->endElement(); + + // Italic + $objWriter->startElement($prefix.'i'); + $objWriter->writeAttribute('val', ($element->getFont()->getItalic() ? 'true' : 'false')); + $objWriter->endElement(); + + // Superscript / subscript + if ($element->getFont()->getSuperScript() || $element->getFont()->getSubScript()) { + $objWriter->startElement($prefix.'vertAlign'); + if ($element->getFont()->getSuperScript()) { + $objWriter->writeAttribute('val', 'superscript'); + } elseif ($element->getFont()->getSubScript()) { + $objWriter->writeAttribute('val', 'subscript'); + } + $objWriter->endElement(); + } + + // Strikethrough + $objWriter->startElement($prefix.'strike'); + $objWriter->writeAttribute('val', ($element->getFont()->getStrikethrough() ? 'true' : 'false')); + $objWriter->endElement(); + + // Color + $objWriter->startElement($prefix.'color'); + $objWriter->writeAttribute('rgb', $element->getFont()->getColor()->getARGB()); + $objWriter->endElement(); + + // Size + $objWriter->startElement($prefix.'sz'); + $objWriter->writeAttribute('val', $element->getFont()->getSize()); + $objWriter->endElement(); + + // Underline + $objWriter->startElement($prefix.'u'); + $objWriter->writeAttribute('val', $element->getFont()->getUnderline()); + $objWriter->endElement(); + + $objWriter->endElement(); + } + + // t + $objWriter->startElement($prefix.'t'); + $objWriter->writeAttribute('xml:space', 'preserve'); + $objWriter->writeRawData(PHPExcel_Shared_String::ControlCharacterPHP2OOXML($element->getText())); + $objWriter->endElement(); + + $objWriter->endElement(); + } + } + + /** + * Write Rich Text + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param string|PHPExcel_RichText $pRichText text string or Rich text + * @param string $prefix Optional Namespace prefix + * @throws PHPExcel_Writer_Exception + */ + public function writeRichTextForCharts(PHPExcel_Shared_XMLWriter $objWriter = null, $pRichText = null, $prefix = null) + { + if (!$pRichText instanceof PHPExcel_RichText) { + $textRun = $pRichText; + $pRichText = new PHPExcel_RichText(); + $pRichText->createTextRun($textRun); + } + + if ($prefix !== null) { + $prefix .= ':'; + } + + // Loop through rich text elements + $elements = $pRichText->getRichTextElements(); + foreach ($elements as $element) { + // r + $objWriter->startElement($prefix.'r'); + + // rPr + $objWriter->startElement($prefix.'rPr'); + + // Bold + $objWriter->writeAttribute('b', ($element->getFont()->getBold() ? 1 : 0)); + // Italic + $objWriter->writeAttribute('i', ($element->getFont()->getItalic() ? 1 : 0)); + // Underline + $underlineType = $element->getFont()->getUnderline(); + switch ($underlineType) { + case 'single': + $underlineType = 'sng'; + break; + case 'double': + $underlineType = 'dbl'; + break; + } + $objWriter->writeAttribute('u', $underlineType); + // Strikethrough + $objWriter->writeAttribute('strike', ($element->getFont()->getStrikethrough() ? 'sngStrike' : 'noStrike')); + + // rFont + $objWriter->startElement($prefix.'latin'); + $objWriter->writeAttribute('typeface', $element->getFont()->getName()); + $objWriter->endElement(); + + // Superscript / subscript +// if ($element->getFont()->getSuperScript() || $element->getFont()->getSubScript()) { +// $objWriter->startElement($prefix.'vertAlign'); +// if ($element->getFont()->getSuperScript()) { +// $objWriter->writeAttribute('val', 'superscript'); +// } elseif ($element->getFont()->getSubScript()) { +// $objWriter->writeAttribute('val', 'subscript'); +// } +// $objWriter->endElement(); +// } +// + $objWriter->endElement(); + + // t + $objWriter->startElement($prefix.'t'); +// $objWriter->writeAttribute('xml:space', 'preserve'); // Excel2010 accepts, Excel2007 complains + $objWriter->writeRawData(PHPExcel_Shared_String::ControlCharacterPHP2OOXML($element->getText())); + $objWriter->endElement(); + + $objWriter->endElement(); + } + } + + /** + * Flip string table (for index searching) + * + * @param array $stringTable Stringtable + * @return array + */ + public function flipStringTable($stringTable = array()) + { + // Return value + $returnValue = array(); + + // Loop through stringtable and add flipped items to $returnValue + foreach ($stringTable as $key => $value) { + if (! $value instanceof PHPExcel_RichText) { + $returnValue[$value] = $key; + } elseif ($value instanceof PHPExcel_RichText) { + $returnValue[$value->getHashCode()] = $key; + } + } + + return $returnValue; + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel2007/Style.php b/extend/PHPExcel/PHPExcel/Writer/Excel2007/Style.php new file mode 100644 index 0000000..d3f0af7 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel2007/Style.php @@ -0,0 +1,696 @@ +<?php + +/** + * PHPExcel_Writer_Excel2007_Style + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPart +{ + /** + * Write styles to XML format + * + * @param PHPExcel $pPHPExcel + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeStyles(PHPExcel $pPHPExcel = null) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // styleSheet + $objWriter->startElement('styleSheet'); + $objWriter->writeAttribute('xml:space', 'preserve'); + $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'); + + // numFmts + $objWriter->startElement('numFmts'); + $objWriter->writeAttribute('count', $this->getParentWriter()->getNumFmtHashTable()->count()); + + // numFmt + for ($i = 0; $i < $this->getParentWriter()->getNumFmtHashTable()->count(); ++$i) { + $this->writeNumFmt($objWriter, $this->getParentWriter()->getNumFmtHashTable()->getByIndex($i), $i); + } + + $objWriter->endElement(); + + // fonts + $objWriter->startElement('fonts'); + $objWriter->writeAttribute('count', $this->getParentWriter()->getFontHashTable()->count()); + + // font + for ($i = 0; $i < $this->getParentWriter()->getFontHashTable()->count(); ++$i) { + $this->writeFont($objWriter, $this->getParentWriter()->getFontHashTable()->getByIndex($i)); + } + + $objWriter->endElement(); + + // fills + $objWriter->startElement('fills'); + $objWriter->writeAttribute('count', $this->getParentWriter()->getFillHashTable()->count()); + + // fill + for ($i = 0; $i < $this->getParentWriter()->getFillHashTable()->count(); ++$i) { + $this->writeFill($objWriter, $this->getParentWriter()->getFillHashTable()->getByIndex($i)); + } + + $objWriter->endElement(); + + // borders + $objWriter->startElement('borders'); + $objWriter->writeAttribute('count', $this->getParentWriter()->getBordersHashTable()->count()); + + // border + for ($i = 0; $i < $this->getParentWriter()->getBordersHashTable()->count(); ++$i) { + $this->writeBorder($objWriter, $this->getParentWriter()->getBordersHashTable()->getByIndex($i)); + } + + $objWriter->endElement(); + + // cellStyleXfs + $objWriter->startElement('cellStyleXfs'); + $objWriter->writeAttribute('count', 1); + + // xf + $objWriter->startElement('xf'); + $objWriter->writeAttribute('numFmtId', 0); + $objWriter->writeAttribute('fontId', 0); + $objWriter->writeAttribute('fillId', 0); + $objWriter->writeAttribute('borderId', 0); + $objWriter->endElement(); + + $objWriter->endElement(); + + // cellXfs + $objWriter->startElement('cellXfs'); + $objWriter->writeAttribute('count', count($pPHPExcel->getCellXfCollection())); + + // xf + foreach ($pPHPExcel->getCellXfCollection() as $cellXf) { + $this->writeCellStyleXf($objWriter, $cellXf, $pPHPExcel); + } + + $objWriter->endElement(); + + // cellStyles + $objWriter->startElement('cellStyles'); + $objWriter->writeAttribute('count', 1); + + // cellStyle + $objWriter->startElement('cellStyle'); + $objWriter->writeAttribute('name', 'Normal'); + $objWriter->writeAttribute('xfId', 0); + $objWriter->writeAttribute('builtinId', 0); + $objWriter->endElement(); + + $objWriter->endElement(); + + // dxfs + $objWriter->startElement('dxfs'); + $objWriter->writeAttribute('count', $this->getParentWriter()->getStylesConditionalHashTable()->count()); + + // dxf + for ($i = 0; $i < $this->getParentWriter()->getStylesConditionalHashTable()->count(); ++$i) { + $this->writeCellStyleDxf($objWriter, $this->getParentWriter()->getStylesConditionalHashTable()->getByIndex($i)->getStyle()); + } + + $objWriter->endElement(); + + // tableStyles + $objWriter->startElement('tableStyles'); + $objWriter->writeAttribute('defaultTableStyle', 'TableStyleMedium9'); + $objWriter->writeAttribute('defaultPivotStyle', 'PivotTableStyle1'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // Return + return $objWriter->getData(); + } + + /** + * Write Fill + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Style_Fill $pFill Fill style + * @throws PHPExcel_Writer_Exception + */ + private function writeFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null) + { + // Check if this is a pattern type or gradient type + if ($pFill->getFillType() === PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR || + $pFill->getFillType() === PHPExcel_Style_Fill::FILL_GRADIENT_PATH) { + // Gradient fill + $this->writeGradientFill($objWriter, $pFill); + } elseif ($pFill->getFillType() !== null) { + // Pattern fill + $this->writePatternFill($objWriter, $pFill); + } + } + + /** + * Write Gradient Fill + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Style_Fill $pFill Fill style + * @throws PHPExcel_Writer_Exception + */ + private function writeGradientFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null) + { + // fill + $objWriter->startElement('fill'); + + // gradientFill + $objWriter->startElement('gradientFill'); + $objWriter->writeAttribute('type', $pFill->getFillType()); + $objWriter->writeAttribute('degree', $pFill->getRotation()); + + // stop + $objWriter->startElement('stop'); + $objWriter->writeAttribute('position', '0'); + + // color + $objWriter->startElement('color'); + $objWriter->writeAttribute('rgb', $pFill->getStartColor()->getARGB()); + $objWriter->endElement(); + + $objWriter->endElement(); + + // stop + $objWriter->startElement('stop'); + $objWriter->writeAttribute('position', '1'); + + // color + $objWriter->startElement('color'); + $objWriter->writeAttribute('rgb', $pFill->getEndColor()->getARGB()); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + } + + /** + * Write Pattern Fill + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Style_Fill $pFill Fill style + * @throws PHPExcel_Writer_Exception + */ + private function writePatternFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null) + { + // fill + $objWriter->startElement('fill'); + + // patternFill + $objWriter->startElement('patternFill'); + $objWriter->writeAttribute('patternType', $pFill->getFillType()); + + if ($pFill->getFillType() !== PHPExcel_Style_Fill::FILL_NONE) { + // fgColor + if ($pFill->getStartColor()->getARGB()) { + $objWriter->startElement('fgColor'); + $objWriter->writeAttribute('rgb', $pFill->getStartColor()->getARGB()); + $objWriter->endElement(); + } + } + if ($pFill->getFillType() !== PHPExcel_Style_Fill::FILL_NONE) { + // bgColor + if ($pFill->getEndColor()->getARGB()) { + $objWriter->startElement('bgColor'); + $objWriter->writeAttribute('rgb', $pFill->getEndColor()->getARGB()); + $objWriter->endElement(); + } + } + + $objWriter->endElement(); + + $objWriter->endElement(); + } + + /** + * Write Font + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Style_Font $pFont Font style + * @throws PHPExcel_Writer_Exception + */ + private function writeFont(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Font $pFont = null) + { + // font + $objWriter->startElement('font'); + // Weird! The order of these elements actually makes a difference when opening Excel2007 + // files in Excel2003 with the compatibility pack. It's not documented behaviour, + // and makes for a real WTF! + + // Bold. We explicitly write this element also when false (like MS Office Excel 2007 does + // for conditional formatting). Otherwise it will apparently not be picked up in conditional + // formatting style dialog + if ($pFont->getBold() !== null) { + $objWriter->startElement('b'); + $objWriter->writeAttribute('val', $pFont->getBold() ? '1' : '0'); + $objWriter->endElement(); + } + + // Italic + if ($pFont->getItalic() !== null) { + $objWriter->startElement('i'); + $objWriter->writeAttribute('val', $pFont->getItalic() ? '1' : '0'); + $objWriter->endElement(); + } + + // Strikethrough + if ($pFont->getStrikethrough() !== null) { + $objWriter->startElement('strike'); + $objWriter->writeAttribute('val', $pFont->getStrikethrough() ? '1' : '0'); + $objWriter->endElement(); + } + + // Underline + if ($pFont->getUnderline() !== null) { + $objWriter->startElement('u'); + $objWriter->writeAttribute('val', $pFont->getUnderline()); + $objWriter->endElement(); + } + + // Superscript / subscript + if ($pFont->getSuperScript() === true || $pFont->getSubScript() === true) { + $objWriter->startElement('vertAlign'); + if ($pFont->getSuperScript() === true) { + $objWriter->writeAttribute('val', 'superscript'); + } elseif ($pFont->getSubScript() === true) { + $objWriter->writeAttribute('val', 'subscript'); + } + $objWriter->endElement(); + } + + // Size + if ($pFont->getSize() !== null) { + $objWriter->startElement('sz'); + $objWriter->writeAttribute('val', $pFont->getSize()); + $objWriter->endElement(); + } + + // Foreground color + if ($pFont->getColor()->getARGB() !== null) { + $objWriter->startElement('color'); + $objWriter->writeAttribute('rgb', $pFont->getColor()->getARGB()); + $objWriter->endElement(); + } + + // Name + if ($pFont->getName() !== null) { + $objWriter->startElement('name'); + $objWriter->writeAttribute('val', $pFont->getName()); + $objWriter->endElement(); + } + + $objWriter->endElement(); + } + + /** + * Write Border + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Style_Borders $pBorders Borders style + * @throws PHPExcel_Writer_Exception + */ + private function writeBorder(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Borders $pBorders = null) + { + // Write border + $objWriter->startElement('border'); + // Diagonal? + switch ($pBorders->getDiagonalDirection()) { + case PHPExcel_Style_Borders::DIAGONAL_UP: + $objWriter->writeAttribute('diagonalUp', 'true'); + $objWriter->writeAttribute('diagonalDown', 'false'); + break; + case PHPExcel_Style_Borders::DIAGONAL_DOWN: + $objWriter->writeAttribute('diagonalUp', 'false'); + $objWriter->writeAttribute('diagonalDown', 'true'); + break; + case PHPExcel_Style_Borders::DIAGONAL_BOTH: + $objWriter->writeAttribute('diagonalUp', 'true'); + $objWriter->writeAttribute('diagonalDown', 'true'); + break; + } + + // BorderPr + $this->writeBorderPr($objWriter, 'left', $pBorders->getLeft()); + $this->writeBorderPr($objWriter, 'right', $pBorders->getRight()); + $this->writeBorderPr($objWriter, 'top', $pBorders->getTop()); + $this->writeBorderPr($objWriter, 'bottom', $pBorders->getBottom()); + $this->writeBorderPr($objWriter, 'diagonal', $pBorders->getDiagonal()); + $objWriter->endElement(); + } + + /** + * Write Cell Style Xf + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Style $pStyle Style + * @param PHPExcel $pPHPExcel Workbook + * @throws PHPExcel_Writer_Exception + */ + private function writeCellStyleXf(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style $pStyle = null, PHPExcel $pPHPExcel = null) + { + // xf + $objWriter->startElement('xf'); + $objWriter->writeAttribute('xfId', 0); + $objWriter->writeAttribute('fontId', (int)$this->getParentWriter()->getFontHashTable()->getIndexForHashCode($pStyle->getFont()->getHashCode())); + if ($pStyle->getQuotePrefix()) { + $objWriter->writeAttribute('quotePrefix', 1); + } + + if ($pStyle->getNumberFormat()->getBuiltInFormatCode() === false) { + $objWriter->writeAttribute('numFmtId', (int)($this->getParentWriter()->getNumFmtHashTable()->getIndexForHashCode($pStyle->getNumberFormat()->getHashCode()) + 164)); + } else { + $objWriter->writeAttribute('numFmtId', (int)$pStyle->getNumberFormat()->getBuiltInFormatCode()); + } + + $objWriter->writeAttribute('fillId', (int)$this->getParentWriter()->getFillHashTable()->getIndexForHashCode($pStyle->getFill()->getHashCode())); + $objWriter->writeAttribute('borderId', (int)$this->getParentWriter()->getBordersHashTable()->getIndexForHashCode($pStyle->getBorders()->getHashCode())); + + // Apply styles? + $objWriter->writeAttribute('applyFont', ($pPHPExcel->getDefaultStyle()->getFont()->getHashCode() != $pStyle->getFont()->getHashCode()) ? '1' : '0'); + $objWriter->writeAttribute('applyNumberFormat', ($pPHPExcel->getDefaultStyle()->getNumberFormat()->getHashCode() != $pStyle->getNumberFormat()->getHashCode()) ? '1' : '0'); + $objWriter->writeAttribute('applyFill', ($pPHPExcel->getDefaultStyle()->getFill()->getHashCode() != $pStyle->getFill()->getHashCode()) ? '1' : '0'); + $objWriter->writeAttribute('applyBorder', ($pPHPExcel->getDefaultStyle()->getBorders()->getHashCode() != $pStyle->getBorders()->getHashCode()) ? '1' : '0'); + $objWriter->writeAttribute('applyAlignment', ($pPHPExcel->getDefaultStyle()->getAlignment()->getHashCode() != $pStyle->getAlignment()->getHashCode()) ? '1' : '0'); + if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) { + $objWriter->writeAttribute('applyProtection', 'true'); + } + + // alignment + $objWriter->startElement('alignment'); + $objWriter->writeAttribute('horizontal', $pStyle->getAlignment()->getHorizontal()); + $objWriter->writeAttribute('vertical', $pStyle->getAlignment()->getVertical()); + + $textRotation = 0; + if ($pStyle->getAlignment()->getTextRotation() >= 0) { + $textRotation = $pStyle->getAlignment()->getTextRotation(); + } elseif ($pStyle->getAlignment()->getTextRotation() < 0) { + $textRotation = 90 - $pStyle->getAlignment()->getTextRotation(); + } + $objWriter->writeAttribute('textRotation', $textRotation); + + $objWriter->writeAttribute('wrapText', ($pStyle->getAlignment()->getWrapText() ? 'true' : 'false')); + $objWriter->writeAttribute('shrinkToFit', ($pStyle->getAlignment()->getShrinkToFit() ? 'true' : 'false')); + + if ($pStyle->getAlignment()->getIndent() > 0) { + $objWriter->writeAttribute('indent', $pStyle->getAlignment()->getIndent()); + } + if ($pStyle->getAlignment()->getReadorder() > 0) { + $objWriter->writeAttribute('readingOrder', $pStyle->getAlignment()->getReadorder()); + } + $objWriter->endElement(); + + // protection + if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) { + $objWriter->startElement('protection'); + if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT) { + $objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false')); + } + if ($pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) { + $objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false')); + } + $objWriter->endElement(); + } + + $objWriter->endElement(); + } + + /** + * Write Cell Style Dxf + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Style $pStyle Style + * @throws PHPExcel_Writer_Exception + */ + private function writeCellStyleDxf(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style $pStyle = null) + { + // dxf + $objWriter->startElement('dxf'); + + // font + $this->writeFont($objWriter, $pStyle->getFont()); + + // numFmt + $this->writeNumFmt($objWriter, $pStyle->getNumberFormat()); + + // fill + $this->writeFill($objWriter, $pStyle->getFill()); + + // alignment + $objWriter->startElement('alignment'); + if ($pStyle->getAlignment()->getHorizontal() !== null) { + $objWriter->writeAttribute('horizontal', $pStyle->getAlignment()->getHorizontal()); + } + if ($pStyle->getAlignment()->getVertical() !== null) { + $objWriter->writeAttribute('vertical', $pStyle->getAlignment()->getVertical()); + } + + if ($pStyle->getAlignment()->getTextRotation() !== null) { + $textRotation = 0; + if ($pStyle->getAlignment()->getTextRotation() >= 0) { + $textRotation = $pStyle->getAlignment()->getTextRotation(); + } elseif ($pStyle->getAlignment()->getTextRotation() < 0) { + $textRotation = 90 - $pStyle->getAlignment()->getTextRotation(); + } + $objWriter->writeAttribute('textRotation', $textRotation); + } + $objWriter->endElement(); + + // border + $this->writeBorder($objWriter, $pStyle->getBorders()); + + // protection + if (($pStyle->getProtection()->getLocked() !== null) || ($pStyle->getProtection()->getHidden() !== null)) { + if ($pStyle->getProtection()->getLocked() !== PHPExcel_Style_Protection::PROTECTION_INHERIT || + $pStyle->getProtection()->getHidden() !== PHPExcel_Style_Protection::PROTECTION_INHERIT) { + $objWriter->startElement('protection'); + if (($pStyle->getProtection()->getLocked() !== null) && + ($pStyle->getProtection()->getLocked() !== PHPExcel_Style_Protection::PROTECTION_INHERIT)) { + $objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false')); + } + if (($pStyle->getProtection()->getHidden() !== null) && + ($pStyle->getProtection()->getHidden() !== PHPExcel_Style_Protection::PROTECTION_INHERIT)) { + $objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false')); + } + $objWriter->endElement(); + } + } + + $objWriter->endElement(); + } + + /** + * Write BorderPr + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param string $pName Element name + * @param PHPExcel_Style_Border $pBorder Border style + * @throws PHPExcel_Writer_Exception + */ + private function writeBorderPr(PHPExcel_Shared_XMLWriter $objWriter = null, $pName = 'left', PHPExcel_Style_Border $pBorder = null) + { + // Write BorderPr + if ($pBorder->getBorderStyle() != PHPExcel_Style_Border::BORDER_NONE) { + $objWriter->startElement($pName); + $objWriter->writeAttribute('style', $pBorder->getBorderStyle()); + + // color + $objWriter->startElement('color'); + $objWriter->writeAttribute('rgb', $pBorder->getColor()->getARGB()); + $objWriter->endElement(); + + $objWriter->endElement(); + } + } + + /** + * Write NumberFormat + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Style_NumberFormat $pNumberFormat Number Format + * @param int $pId Number Format identifier + * @throws PHPExcel_Writer_Exception + */ + private function writeNumFmt(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_NumberFormat $pNumberFormat = null, $pId = 0) + { + // Translate formatcode + $formatCode = $pNumberFormat->getFormatCode(); + + // numFmt + if ($formatCode !== null) { + $objWriter->startElement('numFmt'); + $objWriter->writeAttribute('numFmtId', ($pId + 164)); + $objWriter->writeAttribute('formatCode', $formatCode); + $objWriter->endElement(); + } + } + + /** + * Get an array of all styles + * + * @param PHPExcel $pPHPExcel + * @return PHPExcel_Style[] All styles in PHPExcel + * @throws PHPExcel_Writer_Exception + */ + public function allStyles(PHPExcel $pPHPExcel = null) + { + return $pPHPExcel->getCellXfCollection(); + } + + /** + * Get an array of all conditional styles + * + * @param PHPExcel $pPHPExcel + * @return PHPExcel_Style_Conditional[] All conditional styles in PHPExcel + * @throws PHPExcel_Writer_Exception + */ + public function allConditionalStyles(PHPExcel $pPHPExcel = null) + { + // Get an array of all styles + $aStyles = array(); + + $sheetCount = $pPHPExcel->getSheetCount(); + for ($i = 0; $i < $sheetCount; ++$i) { + foreach ($pPHPExcel->getSheet($i)->getConditionalStylesCollection() as $conditionalStyles) { + foreach ($conditionalStyles as $conditionalStyle) { + $aStyles[] = $conditionalStyle; + } + } + } + + return $aStyles; + } + + /** + * Get an array of all fills + * + * @param PHPExcel $pPHPExcel + * @return PHPExcel_Style_Fill[] All fills in PHPExcel + * @throws PHPExcel_Writer_Exception + */ + public function allFills(PHPExcel $pPHPExcel = null) + { + // Get an array of unique fills + $aFills = array(); + + // Two first fills are predefined + $fill0 = new PHPExcel_Style_Fill(); + $fill0->setFillType(PHPExcel_Style_Fill::FILL_NONE); + $aFills[] = $fill0; + + $fill1 = new PHPExcel_Style_Fill(); + $fill1->setFillType(PHPExcel_Style_Fill::FILL_PATTERN_GRAY125); + $aFills[] = $fill1; + // The remaining fills + $aStyles = $this->allStyles($pPHPExcel); + foreach ($aStyles as $style) { + if (!array_key_exists($style->getFill()->getHashCode(), $aFills)) { + $aFills[ $style->getFill()->getHashCode() ] = $style->getFill(); + } + } + + return $aFills; + } + + /** + * Get an array of all fonts + * + * @param PHPExcel $pPHPExcel + * @return PHPExcel_Style_Font[] All fonts in PHPExcel + * @throws PHPExcel_Writer_Exception + */ + public function allFonts(PHPExcel $pPHPExcel = null) + { + // Get an array of unique fonts + $aFonts = array(); + $aStyles = $this->allStyles($pPHPExcel); + + foreach ($aStyles as $style) { + if (!array_key_exists($style->getFont()->getHashCode(), $aFonts)) { + $aFonts[ $style->getFont()->getHashCode() ] = $style->getFont(); + } + } + + return $aFonts; + } + + /** + * Get an array of all borders + * + * @param PHPExcel $pPHPExcel + * @return PHPExcel_Style_Borders[] All borders in PHPExcel + * @throws PHPExcel_Writer_Exception + */ + public function allBorders(PHPExcel $pPHPExcel = null) + { + // Get an array of unique borders + $aBorders = array(); + $aStyles = $this->allStyles($pPHPExcel); + + foreach ($aStyles as $style) { + if (!array_key_exists($style->getBorders()->getHashCode(), $aBorders)) { + $aBorders[ $style->getBorders()->getHashCode() ] = $style->getBorders(); + } + } + + return $aBorders; + } + + /** + * Get an array of all number formats + * + * @param PHPExcel $pPHPExcel + * @return PHPExcel_Style_NumberFormat[] All number formats in PHPExcel + * @throws PHPExcel_Writer_Exception + */ + public function allNumberFormats(PHPExcel $pPHPExcel = null) + { + // Get an array of unique number formats + $aNumFmts = array(); + $aStyles = $this->allStyles($pPHPExcel); + + foreach ($aStyles as $style) { + if ($style->getNumberFormat()->getBuiltInFormatCode() === false && !array_key_exists($style->getNumberFormat()->getHashCode(), $aNumFmts)) { + $aNumFmts[ $style->getNumberFormat()->getHashCode() ] = $style->getNumberFormat(); + } + } + + return $aNumFmts; + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel2007/Theme.php b/extend/PHPExcel/PHPExcel/Writer/Excel2007/Theme.php new file mode 100644 index 0000000..223e402 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel2007/Theme.php @@ -0,0 +1,869 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_Writer_Excel2007_Theme + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +class PHPExcel_Writer_Excel2007_Theme extends PHPExcel_Writer_Excel2007_WriterPart +{ + /** + * Map of Major fonts to write + * @static array of string + * + */ + private static $majorFonts = array( + 'Jpan' => 'MS Pゴシック', + 'Hang' => '맑은 고딕', + 'Hans' => '宋体', + 'Hant' => '新細明體', + 'Arab' => 'Times New Roman', + 'Hebr' => 'Times New Roman', + 'Thai' => 'Tahoma', + 'Ethi' => 'Nyala', + 'Beng' => 'Vrinda', + 'Gujr' => 'Shruti', + 'Khmr' => 'MoolBoran', + 'Knda' => 'Tunga', + 'Guru' => 'Raavi', + 'Cans' => 'Euphemia', + 'Cher' => 'Plantagenet Cherokee', + 'Yiii' => 'Microsoft Yi Baiti', + 'Tibt' => 'Microsoft Himalaya', + 'Thaa' => 'MV Boli', + 'Deva' => 'Mangal', + 'Telu' => 'Gautami', + 'Taml' => 'Latha', + 'Syrc' => 'Estrangelo Edessa', + 'Orya' => 'Kalinga', + 'Mlym' => 'Kartika', + 'Laoo' => 'DokChampa', + 'Sinh' => 'Iskoola Pota', + 'Mong' => 'Mongolian Baiti', + 'Viet' => 'Times New Roman', + 'Uigh' => 'Microsoft Uighur', + 'Geor' => 'Sylfaen', + ); + + /** + * Map of Minor fonts to write + * @static array of string + * + */ + private static $minorFonts = array( + 'Jpan' => 'MS Pゴシック', + 'Hang' => '맑은 고딕', + 'Hans' => '宋体', + 'Hant' => '新細明體', + 'Arab' => 'Arial', + 'Hebr' => 'Arial', + 'Thai' => 'Tahoma', + 'Ethi' => 'Nyala', + 'Beng' => 'Vrinda', + 'Gujr' => 'Shruti', + 'Khmr' => 'DaunPenh', + 'Knda' => 'Tunga', + 'Guru' => 'Raavi', + 'Cans' => 'Euphemia', + 'Cher' => 'Plantagenet Cherokee', + 'Yiii' => 'Microsoft Yi Baiti', + 'Tibt' => 'Microsoft Himalaya', + 'Thaa' => 'MV Boli', + 'Deva' => 'Mangal', + 'Telu' => 'Gautami', + 'Taml' => 'Latha', + 'Syrc' => 'Estrangelo Edessa', + 'Orya' => 'Kalinga', + 'Mlym' => 'Kartika', + 'Laoo' => 'DokChampa', + 'Sinh' => 'Iskoola Pota', + 'Mong' => 'Mongolian Baiti', + 'Viet' => 'Arial', + 'Uigh' => 'Microsoft Uighur', + 'Geor' => 'Sylfaen', + ); + + /** + * Map of core colours + * @static array of string + * + */ + private static $colourScheme = array( + 'dk2' => '1F497D', + 'lt2' => 'EEECE1', + 'accent1' => '4F81BD', + 'accent2' => 'C0504D', + 'accent3' => '9BBB59', + 'accent4' => '8064A2', + 'accent5' => '4BACC6', + 'accent6' => 'F79646', + 'hlink' => '0000FF', + 'folHlink' => '800080', + ); + + /** + * Write theme to XML format + * + * @param PHPExcel $pPHPExcel + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeTheme(PHPExcel $pPHPExcel = null) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // a:theme + $objWriter->startElement('a:theme'); + $objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main'); + $objWriter->writeAttribute('name', 'Office Theme'); + + // a:themeElements + $objWriter->startElement('a:themeElements'); + + // a:clrScheme + $objWriter->startElement('a:clrScheme'); + $objWriter->writeAttribute('name', 'Office'); + + // a:dk1 + $objWriter->startElement('a:dk1'); + + // a:sysClr + $objWriter->startElement('a:sysClr'); + $objWriter->writeAttribute('val', 'windowText'); + $objWriter->writeAttribute('lastClr', '000000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:lt1 + $objWriter->startElement('a:lt1'); + + // a:sysClr + $objWriter->startElement('a:sysClr'); + $objWriter->writeAttribute('val', 'window'); + $objWriter->writeAttribute('lastClr', 'FFFFFF'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:dk2 + $this->writeColourScheme($objWriter); + + $objWriter->endElement(); + + // a:fontScheme + $objWriter->startElement('a:fontScheme'); + $objWriter->writeAttribute('name', 'Office'); + + // a:majorFont + $objWriter->startElement('a:majorFont'); + $this->writeFonts($objWriter, 'Cambria', self::$majorFonts); + $objWriter->endElement(); + + // a:minorFont + $objWriter->startElement('a:minorFont'); + $this->writeFonts($objWriter, 'Calibri', self::$minorFonts); + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:fmtScheme + $objWriter->startElement('a:fmtScheme'); + $objWriter->writeAttribute('name', 'Office'); + + // a:fillStyleLst + $objWriter->startElement('a:fillStyleLst'); + + // a:solidFill + $objWriter->startElement('a:solidFill'); + + // a:schemeClr + $objWriter->startElement('a:schemeClr'); + $objWriter->writeAttribute('val', 'phClr'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:gradFill + $objWriter->startElement('a:gradFill'); + $objWriter->writeAttribute('rotWithShape', '1'); + + // a:gsLst + $objWriter->startElement('a:gsLst'); + + // a:gs + $objWriter->startElement('a:gs'); + $objWriter->writeAttribute('pos', '0'); + + // a:schemeClr + $objWriter->startElement('a:schemeClr'); + $objWriter->writeAttribute('val', 'phClr'); + + // a:tint + $objWriter->startElement('a:tint'); + $objWriter->writeAttribute('val', '50000'); + $objWriter->endElement(); + + // a:satMod + $objWriter->startElement('a:satMod'); + $objWriter->writeAttribute('val', '300000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:gs + $objWriter->startElement('a:gs'); + $objWriter->writeAttribute('pos', '35000'); + + // a:schemeClr + $objWriter->startElement('a:schemeClr'); + $objWriter->writeAttribute('val', 'phClr'); + + // a:tint + $objWriter->startElement('a:tint'); + $objWriter->writeAttribute('val', '37000'); + $objWriter->endElement(); + + // a:satMod + $objWriter->startElement('a:satMod'); + $objWriter->writeAttribute('val', '300000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:gs + $objWriter->startElement('a:gs'); + $objWriter->writeAttribute('pos', '100000'); + + // a:schemeClr + $objWriter->startElement('a:schemeClr'); + $objWriter->writeAttribute('val', 'phClr'); + + // a:tint + $objWriter->startElement('a:tint'); + $objWriter->writeAttribute('val', '15000'); + $objWriter->endElement(); + + // a:satMod + $objWriter->startElement('a:satMod'); + $objWriter->writeAttribute('val', '350000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:lin + $objWriter->startElement('a:lin'); + $objWriter->writeAttribute('ang', '16200000'); + $objWriter->writeAttribute('scaled', '1'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:gradFill + $objWriter->startElement('a:gradFill'); + $objWriter->writeAttribute('rotWithShape', '1'); + + // a:gsLst + $objWriter->startElement('a:gsLst'); + + // a:gs + $objWriter->startElement('a:gs'); + $objWriter->writeAttribute('pos', '0'); + + // a:schemeClr + $objWriter->startElement('a:schemeClr'); + $objWriter->writeAttribute('val', 'phClr'); + + // a:shade + $objWriter->startElement('a:shade'); + $objWriter->writeAttribute('val', '51000'); + $objWriter->endElement(); + + // a:satMod + $objWriter->startElement('a:satMod'); + $objWriter->writeAttribute('val', '130000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:gs + $objWriter->startElement('a:gs'); + $objWriter->writeAttribute('pos', '80000'); + + // a:schemeClr + $objWriter->startElement('a:schemeClr'); + $objWriter->writeAttribute('val', 'phClr'); + + // a:shade + $objWriter->startElement('a:shade'); + $objWriter->writeAttribute('val', '93000'); + $objWriter->endElement(); + + // a:satMod + $objWriter->startElement('a:satMod'); + $objWriter->writeAttribute('val', '130000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:gs + $objWriter->startElement('a:gs'); + $objWriter->writeAttribute('pos', '100000'); + + // a:schemeClr + $objWriter->startElement('a:schemeClr'); + $objWriter->writeAttribute('val', 'phClr'); + + // a:shade + $objWriter->startElement('a:shade'); + $objWriter->writeAttribute('val', '94000'); + $objWriter->endElement(); + + // a:satMod + $objWriter->startElement('a:satMod'); + $objWriter->writeAttribute('val', '135000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:lin + $objWriter->startElement('a:lin'); + $objWriter->writeAttribute('ang', '16200000'); + $objWriter->writeAttribute('scaled', '0'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:lnStyleLst + $objWriter->startElement('a:lnStyleLst'); + + // a:ln + $objWriter->startElement('a:ln'); + $objWriter->writeAttribute('w', '9525'); + $objWriter->writeAttribute('cap', 'flat'); + $objWriter->writeAttribute('cmpd', 'sng'); + $objWriter->writeAttribute('algn', 'ctr'); + + // a:solidFill + $objWriter->startElement('a:solidFill'); + + // a:schemeClr + $objWriter->startElement('a:schemeClr'); + $objWriter->writeAttribute('val', 'phClr'); + + // a:shade + $objWriter->startElement('a:shade'); + $objWriter->writeAttribute('val', '95000'); + $objWriter->endElement(); + + // a:satMod + $objWriter->startElement('a:satMod'); + $objWriter->writeAttribute('val', '105000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:prstDash + $objWriter->startElement('a:prstDash'); + $objWriter->writeAttribute('val', 'solid'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:ln + $objWriter->startElement('a:ln'); + $objWriter->writeAttribute('w', '25400'); + $objWriter->writeAttribute('cap', 'flat'); + $objWriter->writeAttribute('cmpd', 'sng'); + $objWriter->writeAttribute('algn', 'ctr'); + + // a:solidFill + $objWriter->startElement('a:solidFill'); + + // a:schemeClr + $objWriter->startElement('a:schemeClr'); + $objWriter->writeAttribute('val', 'phClr'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:prstDash + $objWriter->startElement('a:prstDash'); + $objWriter->writeAttribute('val', 'solid'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:ln + $objWriter->startElement('a:ln'); + $objWriter->writeAttribute('w', '38100'); + $objWriter->writeAttribute('cap', 'flat'); + $objWriter->writeAttribute('cmpd', 'sng'); + $objWriter->writeAttribute('algn', 'ctr'); + + // a:solidFill + $objWriter->startElement('a:solidFill'); + + // a:schemeClr + $objWriter->startElement('a:schemeClr'); + $objWriter->writeAttribute('val', 'phClr'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:prstDash + $objWriter->startElement('a:prstDash'); + $objWriter->writeAttribute('val', 'solid'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + + + // a:effectStyleLst + $objWriter->startElement('a:effectStyleLst'); + + // a:effectStyle + $objWriter->startElement('a:effectStyle'); + + // a:effectLst + $objWriter->startElement('a:effectLst'); + + // a:outerShdw + $objWriter->startElement('a:outerShdw'); + $objWriter->writeAttribute('blurRad', '40000'); + $objWriter->writeAttribute('dist', '20000'); + $objWriter->writeAttribute('dir', '5400000'); + $objWriter->writeAttribute('rotWithShape', '0'); + + // a:srgbClr + $objWriter->startElement('a:srgbClr'); + $objWriter->writeAttribute('val', '000000'); + + // a:alpha + $objWriter->startElement('a:alpha'); + $objWriter->writeAttribute('val', '38000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:effectStyle + $objWriter->startElement('a:effectStyle'); + + // a:effectLst + $objWriter->startElement('a:effectLst'); + + // a:outerShdw + $objWriter->startElement('a:outerShdw'); + $objWriter->writeAttribute('blurRad', '40000'); + $objWriter->writeAttribute('dist', '23000'); + $objWriter->writeAttribute('dir', '5400000'); + $objWriter->writeAttribute('rotWithShape', '0'); + + // a:srgbClr + $objWriter->startElement('a:srgbClr'); + $objWriter->writeAttribute('val', '000000'); + + // a:alpha + $objWriter->startElement('a:alpha'); + $objWriter->writeAttribute('val', '35000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:effectStyle + $objWriter->startElement('a:effectStyle'); + + // a:effectLst + $objWriter->startElement('a:effectLst'); + + // a:outerShdw + $objWriter->startElement('a:outerShdw'); + $objWriter->writeAttribute('blurRad', '40000'); + $objWriter->writeAttribute('dist', '23000'); + $objWriter->writeAttribute('dir', '5400000'); + $objWriter->writeAttribute('rotWithShape', '0'); + + // a:srgbClr + $objWriter->startElement('a:srgbClr'); + $objWriter->writeAttribute('val', '000000'); + + // a:alpha + $objWriter->startElement('a:alpha'); + $objWriter->writeAttribute('val', '35000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:scene3d + $objWriter->startElement('a:scene3d'); + + // a:camera + $objWriter->startElement('a:camera'); + $objWriter->writeAttribute('prst', 'orthographicFront'); + + // a:rot + $objWriter->startElement('a:rot'); + $objWriter->writeAttribute('lat', '0'); + $objWriter->writeAttribute('lon', '0'); + $objWriter->writeAttribute('rev', '0'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:lightRig + $objWriter->startElement('a:lightRig'); + $objWriter->writeAttribute('rig', 'threePt'); + $objWriter->writeAttribute('dir', 't'); + + // a:rot + $objWriter->startElement('a:rot'); + $objWriter->writeAttribute('lat', '0'); + $objWriter->writeAttribute('lon', '0'); + $objWriter->writeAttribute('rev', '1200000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:sp3d + $objWriter->startElement('a:sp3d'); + + // a:bevelT + $objWriter->startElement('a:bevelT'); + $objWriter->writeAttribute('w', '63500'); + $objWriter->writeAttribute('h', '25400'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:bgFillStyleLst + $objWriter->startElement('a:bgFillStyleLst'); + + // a:solidFill + $objWriter->startElement('a:solidFill'); + + // a:schemeClr + $objWriter->startElement('a:schemeClr'); + $objWriter->writeAttribute('val', 'phClr'); + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:gradFill + $objWriter->startElement('a:gradFill'); + $objWriter->writeAttribute('rotWithShape', '1'); + + // a:gsLst + $objWriter->startElement('a:gsLst'); + + // a:gs + $objWriter->startElement('a:gs'); + $objWriter->writeAttribute('pos', '0'); + + // a:schemeClr + $objWriter->startElement('a:schemeClr'); + $objWriter->writeAttribute('val', 'phClr'); + + // a:tint + $objWriter->startElement('a:tint'); + $objWriter->writeAttribute('val', '40000'); + $objWriter->endElement(); + + // a:satMod + $objWriter->startElement('a:satMod'); + $objWriter->writeAttribute('val', '350000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:gs + $objWriter->startElement('a:gs'); + $objWriter->writeAttribute('pos', '40000'); + + // a:schemeClr + $objWriter->startElement('a:schemeClr'); + $objWriter->writeAttribute('val', 'phClr'); + + // a:tint + $objWriter->startElement('a:tint'); + $objWriter->writeAttribute('val', '45000'); + $objWriter->endElement(); + + // a:shade + $objWriter->startElement('a:shade'); + $objWriter->writeAttribute('val', '99000'); + $objWriter->endElement(); + + // a:satMod + $objWriter->startElement('a:satMod'); + $objWriter->writeAttribute('val', '350000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:gs + $objWriter->startElement('a:gs'); + $objWriter->writeAttribute('pos', '100000'); + + // a:schemeClr + $objWriter->startElement('a:schemeClr'); + $objWriter->writeAttribute('val', 'phClr'); + + // a:shade + $objWriter->startElement('a:shade'); + $objWriter->writeAttribute('val', '20000'); + $objWriter->endElement(); + + // a:satMod + $objWriter->startElement('a:satMod'); + $objWriter->writeAttribute('val', '255000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:path + $objWriter->startElement('a:path'); + $objWriter->writeAttribute('path', 'circle'); + + // a:fillToRect + $objWriter->startElement('a:fillToRect'); + $objWriter->writeAttribute('l', '50000'); + $objWriter->writeAttribute('t', '-80000'); + $objWriter->writeAttribute('r', '50000'); + $objWriter->writeAttribute('b', '180000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:gradFill + $objWriter->startElement('a:gradFill'); + $objWriter->writeAttribute('rotWithShape', '1'); + + // a:gsLst + $objWriter->startElement('a:gsLst'); + + // a:gs + $objWriter->startElement('a:gs'); + $objWriter->writeAttribute('pos', '0'); + + // a:schemeClr + $objWriter->startElement('a:schemeClr'); + $objWriter->writeAttribute('val', 'phClr'); + + // a:tint + $objWriter->startElement('a:tint'); + $objWriter->writeAttribute('val', '80000'); + $objWriter->endElement(); + + // a:satMod + $objWriter->startElement('a:satMod'); + $objWriter->writeAttribute('val', '300000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:gs + $objWriter->startElement('a:gs'); + $objWriter->writeAttribute('pos', '100000'); + + // a:schemeClr + $objWriter->startElement('a:schemeClr'); + $objWriter->writeAttribute('val', 'phClr'); + + // a:shade + $objWriter->startElement('a:shade'); + $objWriter->writeAttribute('val', '30000'); + $objWriter->endElement(); + + // a:satMod + $objWriter->startElement('a:satMod'); + $objWriter->writeAttribute('val', '200000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:path + $objWriter->startElement('a:path'); + $objWriter->writeAttribute('path', 'circle'); + + // a:fillToRect + $objWriter->startElement('a:fillToRect'); + $objWriter->writeAttribute('l', '50000'); + $objWriter->writeAttribute('t', '50000'); + $objWriter->writeAttribute('r', '50000'); + $objWriter->writeAttribute('b', '50000'); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + // a:objectDefaults + $objWriter->writeElement('a:objectDefaults', null); + + // a:extraClrSchemeLst + $objWriter->writeElement('a:extraClrSchemeLst', null); + + $objWriter->endElement(); + + // Return + return $objWriter->getData(); + } + + /** + * Write fonts to XML format + * + * @param PHPExcel_Shared_XMLWriter $objWriter + * @param string $latinFont + * @param array of string $fontSet + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + private function writeFonts($objWriter, $latinFont, $fontSet) + { + // a:latin + $objWriter->startElement('a:latin'); + $objWriter->writeAttribute('typeface', $latinFont); + $objWriter->endElement(); + + // a:ea + $objWriter->startElement('a:ea'); + $objWriter->writeAttribute('typeface', ''); + $objWriter->endElement(); + + // a:cs + $objWriter->startElement('a:cs'); + $objWriter->writeAttribute('typeface', ''); + $objWriter->endElement(); + + foreach ($fontSet as $fontScript => $typeface) { + $objWriter->startElement('a:font'); + $objWriter->writeAttribute('script', $fontScript); + $objWriter->writeAttribute('typeface', $typeface); + $objWriter->endElement(); + } + } + + /** + * Write colour scheme to XML format + * + * @param PHPExcel_Shared_XMLWriter $objWriter + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + private function writeColourScheme($objWriter) + { + foreach (self::$colourScheme as $colourName => $colourValue) { + $objWriter->startElement('a:'.$colourName); + + $objWriter->startElement('a:srgbClr'); + $objWriter->writeAttribute('val', $colourValue); + $objWriter->endElement(); + + $objWriter->endElement(); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel2007/Workbook.php b/extend/PHPExcel/PHPExcel/Writer/Excel2007/Workbook.php new file mode 100644 index 0000000..87c877e --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel2007/Workbook.php @@ -0,0 +1,448 @@ +<?php + +/** + * PHPExcel_Writer_Excel2007_Workbook + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_WriterPart +{ + /** + * Write workbook to XML format + * + * @param PHPExcel $pPHPExcel + * @param boolean $recalcRequired Indicate whether formulas should be recalculated before writing + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeWorkbook(PHPExcel $pPHPExcel = null, $recalcRequired = false) + { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // workbook + $objWriter->startElement('workbook'); + $objWriter->writeAttribute('xml:space', 'preserve'); + $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'); + $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); + + // fileVersion + $this->writeFileVersion($objWriter); + + // workbookPr + $this->writeWorkbookPr($objWriter); + + // workbookProtection + $this->writeWorkbookProtection($objWriter, $pPHPExcel); + + // bookViews + if ($this->getParentWriter()->getOffice2003Compatibility() === false) { + $this->writeBookViews($objWriter, $pPHPExcel); + } + + // sheets + $this->writeSheets($objWriter, $pPHPExcel); + + // definedNames + $this->writeDefinedNames($objWriter, $pPHPExcel); + + // calcPr + $this->writeCalcPr($objWriter, $recalcRequired); + + $objWriter->endElement(); + + // Return + return $objWriter->getData(); + } + + /** + * Write file version + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @throws PHPExcel_Writer_Exception + */ + private function writeFileVersion(PHPExcel_Shared_XMLWriter $objWriter = null) + { + $objWriter->startElement('fileVersion'); + $objWriter->writeAttribute('appName', 'xl'); + $objWriter->writeAttribute('lastEdited', '4'); + $objWriter->writeAttribute('lowestEdited', '4'); + $objWriter->writeAttribute('rupBuild', '4505'); + $objWriter->endElement(); + } + + /** + * Write WorkbookPr + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @throws PHPExcel_Writer_Exception + */ + private function writeWorkbookPr(PHPExcel_Shared_XMLWriter $objWriter = null) + { + $objWriter->startElement('workbookPr'); + + if (PHPExcel_Shared_Date::getExcelCalendar() == PHPExcel_Shared_Date::CALENDAR_MAC_1904) { + $objWriter->writeAttribute('date1904', '1'); + } + + $objWriter->writeAttribute('codeName', 'ThisWorkbook'); + + $objWriter->endElement(); + } + + /** + * Write BookViews + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel $pPHPExcel + * @throws PHPExcel_Writer_Exception + */ + private function writeBookViews(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null) + { + // bookViews + $objWriter->startElement('bookViews'); + + // workbookView + $objWriter->startElement('workbookView'); + + $objWriter->writeAttribute('activeTab', $pPHPExcel->getActiveSheetIndex()); + $objWriter->writeAttribute('autoFilterDateGrouping', '1'); + $objWriter->writeAttribute('firstSheet', '0'); + $objWriter->writeAttribute('minimized', '0'); + $objWriter->writeAttribute('showHorizontalScroll', '1'); + $objWriter->writeAttribute('showSheetTabs', '1'); + $objWriter->writeAttribute('showVerticalScroll', '1'); + $objWriter->writeAttribute('tabRatio', '600'); + $objWriter->writeAttribute('visibility', 'visible'); + + $objWriter->endElement(); + + $objWriter->endElement(); + } + + /** + * Write WorkbookProtection + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel $pPHPExcel + * @throws PHPExcel_Writer_Exception + */ + private function writeWorkbookProtection(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null) + { + if ($pPHPExcel->getSecurity()->isSecurityEnabled()) { + $objWriter->startElement('workbookProtection'); + $objWriter->writeAttribute('lockRevision', ($pPHPExcel->getSecurity()->getLockRevision() ? 'true' : 'false')); + $objWriter->writeAttribute('lockStructure', ($pPHPExcel->getSecurity()->getLockStructure() ? 'true' : 'false')); + $objWriter->writeAttribute('lockWindows', ($pPHPExcel->getSecurity()->getLockWindows() ? 'true' : 'false')); + + if ($pPHPExcel->getSecurity()->getRevisionsPassword() != '') { + $objWriter->writeAttribute('revisionsPassword', $pPHPExcel->getSecurity()->getRevisionsPassword()); + } + + if ($pPHPExcel->getSecurity()->getWorkbookPassword() != '') { + $objWriter->writeAttribute('workbookPassword', $pPHPExcel->getSecurity()->getWorkbookPassword()); + } + + $objWriter->endElement(); + } + } + + /** + * Write calcPr + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param boolean $recalcRequired Indicate whether formulas should be recalculated before writing + * @throws PHPExcel_Writer_Exception + */ + private function writeCalcPr(PHPExcel_Shared_XMLWriter $objWriter = null, $recalcRequired = true) + { + $objWriter->startElement('calcPr'); + + // Set the calcid to a higher value than Excel itself will use, otherwise Excel will always recalc + // If MS Excel does do a recalc, then users opening a file in MS Excel will be prompted to save on exit + // because the file has changed + $objWriter->writeAttribute('calcId', '999999'); + $objWriter->writeAttribute('calcMode', 'auto'); + // fullCalcOnLoad isn't needed if we've recalculating for the save + $objWriter->writeAttribute('calcCompleted', ($recalcRequired) ? 1 : 0); + $objWriter->writeAttribute('fullCalcOnLoad', ($recalcRequired) ? 0 : 1); + + $objWriter->endElement(); + } + + /** + * Write sheets + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel $pPHPExcel + * @throws PHPExcel_Writer_Exception + */ + private function writeSheets(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null) + { + // Write sheets + $objWriter->startElement('sheets'); + $sheetCount = $pPHPExcel->getSheetCount(); + for ($i = 0; $i < $sheetCount; ++$i) { + // sheet + $this->writeSheet( + $objWriter, + $pPHPExcel->getSheet($i)->getTitle(), + ($i + 1), + ($i + 1 + 3), + $pPHPExcel->getSheet($i)->getSheetState() + ); + } + + $objWriter->endElement(); + } + + /** + * Write sheet + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param string $pSheetname Sheet name + * @param int $pSheetId Sheet id + * @param int $pRelId Relationship ID + * @param string $sheetState Sheet state (visible, hidden, veryHidden) + * @throws PHPExcel_Writer_Exception + */ + private function writeSheet(PHPExcel_Shared_XMLWriter $objWriter = null, $pSheetname = '', $pSheetId = 1, $pRelId = 1, $sheetState = 'visible') + { + if ($pSheetname != '') { + // Write sheet + $objWriter->startElement('sheet'); + $objWriter->writeAttribute('name', $pSheetname); + $objWriter->writeAttribute('sheetId', $pSheetId); + if ($sheetState != 'visible' && $sheetState != '') { + $objWriter->writeAttribute('state', $sheetState); + } + $objWriter->writeAttribute('r:id', 'rId' . $pRelId); + $objWriter->endElement(); + } else { + throw new PHPExcel_Writer_Exception("Invalid parameters passed."); + } + } + + /** + * Write Defined Names + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel $pPHPExcel + * @throws PHPExcel_Writer_Exception + */ + private function writeDefinedNames(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null) + { + // Write defined names + $objWriter->startElement('definedNames'); + + // Named ranges + if (count($pPHPExcel->getNamedRanges()) > 0) { + // Named ranges + $this->writeNamedRanges($objWriter, $pPHPExcel); + } + + // Other defined names + $sheetCount = $pPHPExcel->getSheetCount(); + for ($i = 0; $i < $sheetCount; ++$i) { + // definedName for autoFilter + $this->writeDefinedNameForAutofilter($objWriter, $pPHPExcel->getSheet($i), $i); + + // definedName for Print_Titles + $this->writeDefinedNameForPrintTitles($objWriter, $pPHPExcel->getSheet($i), $i); + + // definedName for Print_Area + $this->writeDefinedNameForPrintArea($objWriter, $pPHPExcel->getSheet($i), $i); + } + + $objWriter->endElement(); + } + + /** + * Write named ranges + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel $pPHPExcel + * @throws PHPExcel_Writer_Exception + */ + private function writeNamedRanges(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel) + { + // Loop named ranges + $namedRanges = $pPHPExcel->getNamedRanges(); + foreach ($namedRanges as $namedRange) { + $this->writeDefinedNameForNamedRange($objWriter, $namedRange); + } + } + + /** + * Write Defined Name for named range + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_NamedRange $pNamedRange + * @throws PHPExcel_Writer_Exception + */ + private function writeDefinedNameForNamedRange(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_NamedRange $pNamedRange) + { + // definedName for named range + $objWriter->startElement('definedName'); + $objWriter->writeAttribute('name', $pNamedRange->getName()); + if ($pNamedRange->getLocalOnly()) { + $objWriter->writeAttribute('localSheetId', $pNamedRange->getScope()->getParent()->getIndex($pNamedRange->getScope())); + } + + // Create absolute coordinate and write as raw text + $range = PHPExcel_Cell::splitRange($pNamedRange->getRange()); + for ($i = 0; $i < count($range); $i++) { + $range[$i][0] = '\'' . str_replace("'", "''", $pNamedRange->getWorksheet()->getTitle()) . '\'!' . PHPExcel_Cell::absoluteReference($range[$i][0]); + if (isset($range[$i][1])) { + $range[$i][1] = PHPExcel_Cell::absoluteReference($range[$i][1]); + } + } + $range = PHPExcel_Cell::buildRange($range); + + $objWriter->writeRawData($range); + + $objWriter->endElement(); + } + + /** + * Write Defined Name for autoFilter + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet + * @param int $pSheetId + * @throws PHPExcel_Writer_Exception + */ + private function writeDefinedNameForAutofilter(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pSheetId = 0) + { + // definedName for autoFilter + $autoFilterRange = $pSheet->getAutoFilter()->getRange(); + if (!empty($autoFilterRange)) { + $objWriter->startElement('definedName'); + $objWriter->writeAttribute('name', '_xlnm._FilterDatabase'); + $objWriter->writeAttribute('localSheetId', $pSheetId); + $objWriter->writeAttribute('hidden', '1'); + + // Create absolute coordinate and write as raw text + $range = PHPExcel_Cell::splitRange($autoFilterRange); + $range = $range[0]; + // Strip any worksheet ref so we can make the cell ref absolute + if (strpos($range[0], '!') !== false) { + list($ws, $range[0]) = explode('!', $range[0]); + } + + $range[0] = PHPExcel_Cell::absoluteCoordinate($range[0]); + $range[1] = PHPExcel_Cell::absoluteCoordinate($range[1]); + $range = implode(':', $range); + + $objWriter->writeRawData('\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . $range); + + $objWriter->endElement(); + } + } + + /** + * Write Defined Name for PrintTitles + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet + * @param int $pSheetId + * @throws PHPExcel_Writer_Exception + */ + private function writeDefinedNameForPrintTitles(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pSheetId = 0) + { + // definedName for PrintTitles + if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet() || $pSheet->getPageSetup()->isRowsToRepeatAtTopSet()) { + $objWriter->startElement('definedName'); + $objWriter->writeAttribute('name', '_xlnm.Print_Titles'); + $objWriter->writeAttribute('localSheetId', $pSheetId); + + // Setting string + $settingString = ''; + + // Columns to repeat + if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet()) { + $repeat = $pSheet->getPageSetup()->getColumnsToRepeatAtLeft(); + + $settingString .= '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!$' . $repeat[0] . ':$' . $repeat[1]; + } + + // Rows to repeat + if ($pSheet->getPageSetup()->isRowsToRepeatAtTopSet()) { + if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet()) { + $settingString .= ','; + } + + $repeat = $pSheet->getPageSetup()->getRowsToRepeatAtTop(); + + $settingString .= '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!$' . $repeat[0] . ':$' . $repeat[1]; + } + + $objWriter->writeRawData($settingString); + + $objWriter->endElement(); + } + } + + /** + * Write Defined Name for PrintTitles + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet + * @param int $pSheetId + * @throws PHPExcel_Writer_Exception + */ + private function writeDefinedNameForPrintArea(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pSheetId = 0) + { + // definedName for PrintArea + if ($pSheet->getPageSetup()->isPrintAreaSet()) { + $objWriter->startElement('definedName'); + $objWriter->writeAttribute('name', '_xlnm.Print_Area'); + $objWriter->writeAttribute('localSheetId', $pSheetId); + + // Setting string + $settingString = ''; + + // Print area + $printArea = PHPExcel_Cell::splitRange($pSheet->getPageSetup()->getPrintArea()); + + $chunks = array(); + foreach ($printArea as $printAreaRect) { + $printAreaRect[0] = PHPExcel_Cell::absoluteReference($printAreaRect[0]); + $printAreaRect[1] = PHPExcel_Cell::absoluteReference($printAreaRect[1]); + $chunks[] = '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . implode(':', $printAreaRect); + } + + $objWriter->writeRawData(implode(',', $chunks)); + + $objWriter->endElement(); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel2007/Worksheet.php b/extend/PHPExcel/PHPExcel/Writer/Excel2007/Worksheet.php new file mode 100644 index 0000000..c211403 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel2007/Worksheet.php @@ -0,0 +1,1219 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_Writer_Excel2007_Worksheet + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_WriterPart +{ + /** + * Write worksheet to XML format + * + * @param PHPExcel_Worksheet $pSheet + * @param string[] $pStringTable + * @param boolean $includeCharts Flag indicating if we should write charts + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeWorksheet($pSheet = null, $pStringTable = null, $includeCharts = false) + { + if (!is_null($pSheet)) { + // Create XML writer + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8', 'yes'); + + // Worksheet + $objWriter->startElement('worksheet'); + $objWriter->writeAttribute('xml:space', 'preserve'); + $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'); + $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); + + // sheetPr + $this->writeSheetPr($objWriter, $pSheet); + + // Dimension + $this->writeDimension($objWriter, $pSheet); + + // sheetViews + $this->writeSheetViews($objWriter, $pSheet); + + // sheetFormatPr + $this->writeSheetFormatPr($objWriter, $pSheet); + + // cols + $this->writeCols($objWriter, $pSheet); + + // sheetData + $this->writeSheetData($objWriter, $pSheet, $pStringTable); + + // sheetProtection + $this->writeSheetProtection($objWriter, $pSheet); + + // protectedRanges + $this->writeProtectedRanges($objWriter, $pSheet); + + // autoFilter + $this->writeAutoFilter($objWriter, $pSheet); + + // mergeCells + $this->writeMergeCells($objWriter, $pSheet); + + // conditionalFormatting + $this->writeConditionalFormatting($objWriter, $pSheet); + + // dataValidations + $this->writeDataValidations($objWriter, $pSheet); + + // hyperlinks + $this->writeHyperlinks($objWriter, $pSheet); + + // Print options + $this->writePrintOptions($objWriter, $pSheet); + + // Page margins + $this->writePageMargins($objWriter, $pSheet); + + // Page setup + $this->writePageSetup($objWriter, $pSheet); + + // Header / footer + $this->writeHeaderFooter($objWriter, $pSheet); + + // Breaks + $this->writeBreaks($objWriter, $pSheet); + + // Drawings and/or Charts + $this->writeDrawings($objWriter, $pSheet, $includeCharts); + + // LegacyDrawing + $this->writeLegacyDrawing($objWriter, $pSheet); + + // LegacyDrawingHF + $this->writeLegacyDrawingHF($objWriter, $pSheet); + + $objWriter->endElement(); + + // Return + return $objWriter->getData(); + } else { + throw new PHPExcel_Writer_Exception("Invalid PHPExcel_Worksheet object passed."); + } + } + + /** + * Write SheetPr + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writeSheetPr(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + // sheetPr + $objWriter->startElement('sheetPr'); + //$objWriter->writeAttribute('codeName', $pSheet->getTitle()); + if ($pSheet->getParent()->hasMacros()) {//if the workbook have macros, we need to have codeName for the sheet + if ($pSheet->hasCodeName()==false) { + $pSheet->setCodeName($pSheet->getTitle()); + } + $objWriter->writeAttribute('codeName', $pSheet->getCodeName()); + } + $autoFilterRange = $pSheet->getAutoFilter()->getRange(); + if (!empty($autoFilterRange)) { + $objWriter->writeAttribute('filterMode', 1); + $pSheet->getAutoFilter()->showHideRows(); + } + + // tabColor + if ($pSheet->isTabColorSet()) { + $objWriter->startElement('tabColor'); + $objWriter->writeAttribute('rgb', $pSheet->getTabColor()->getARGB()); + $objWriter->endElement(); + } + + // outlinePr + $objWriter->startElement('outlinePr'); + $objWriter->writeAttribute('summaryBelow', ($pSheet->getShowSummaryBelow() ? '1' : '0')); + $objWriter->writeAttribute('summaryRight', ($pSheet->getShowSummaryRight() ? '1' : '0')); + $objWriter->endElement(); + + // pageSetUpPr + if ($pSheet->getPageSetup()->getFitToPage()) { + $objWriter->startElement('pageSetUpPr'); + $objWriter->writeAttribute('fitToPage', '1'); + $objWriter->endElement(); + } + + $objWriter->endElement(); + } + + /** + * Write Dimension + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writeDimension(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + // dimension + $objWriter->startElement('dimension'); + $objWriter->writeAttribute('ref', $pSheet->calculateWorksheetDimension()); + $objWriter->endElement(); + } + + /** + * Write SheetViews + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writeSheetViews(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + // sheetViews + $objWriter->startElement('sheetViews'); + + // Sheet selected? + $sheetSelected = false; + if ($this->getParentWriter()->getPHPExcel()->getIndex($pSheet) == $this->getParentWriter()->getPHPExcel()->getActiveSheetIndex()) { + $sheetSelected = true; + } + + // sheetView + $objWriter->startElement('sheetView'); + $objWriter->writeAttribute('tabSelected', $sheetSelected ? '1' : '0'); + $objWriter->writeAttribute('workbookViewId', '0'); + + // Zoom scales + if ($pSheet->getSheetView()->getZoomScale() != 100) { + $objWriter->writeAttribute('zoomScale', $pSheet->getSheetView()->getZoomScale()); + } + if ($pSheet->getSheetView()->getZoomScaleNormal() != 100) { + $objWriter->writeAttribute('zoomScaleNormal', $pSheet->getSheetView()->getZoomScaleNormal()); + } + + // View Layout Type + if ($pSheet->getSheetView()->getView() !== PHPExcel_Worksheet_SheetView::SHEETVIEW_NORMAL) { + $objWriter->writeAttribute('view', $pSheet->getSheetView()->getView()); + } + + // Gridlines + if ($pSheet->getShowGridlines()) { + $objWriter->writeAttribute('showGridLines', 'true'); + } else { + $objWriter->writeAttribute('showGridLines', 'false'); + } + + // Row and column headers + if ($pSheet->getShowRowColHeaders()) { + $objWriter->writeAttribute('showRowColHeaders', '1'); + } else { + $objWriter->writeAttribute('showRowColHeaders', '0'); + } + + // Right-to-left + if ($pSheet->getRightToLeft()) { + $objWriter->writeAttribute('rightToLeft', 'true'); + } + + $activeCell = $pSheet->getActiveCell(); + + // Pane + $pane = ''; + $topLeftCell = $pSheet->getFreezePane(); + if (($topLeftCell != '') && ($topLeftCell != 'A1')) { + $activeCell = empty($activeCell) ? $topLeftCell : $activeCell; + // Calculate freeze coordinates + $xSplit = $ySplit = 0; + + list($xSplit, $ySplit) = PHPExcel_Cell::coordinateFromString($topLeftCell); + $xSplit = PHPExcel_Cell::columnIndexFromString($xSplit); + + // pane + $pane = 'topRight'; + $objWriter->startElement('pane'); + if ($xSplit > 1) { + $objWriter->writeAttribute('xSplit', $xSplit - 1); + } + if ($ySplit > 1) { + $objWriter->writeAttribute('ySplit', $ySplit - 1); + $pane = ($xSplit > 1) ? 'bottomRight' : 'bottomLeft'; + } + $objWriter->writeAttribute('topLeftCell', $topLeftCell); + $objWriter->writeAttribute('activePane', $pane); + $objWriter->writeAttribute('state', 'frozen'); + $objWriter->endElement(); + + if (($xSplit > 1) && ($ySplit > 1)) { + // Write additional selections if more than two panes (ie both an X and a Y split) + $objWriter->startElement('selection'); + $objWriter->writeAttribute('pane', 'topRight'); + $objWriter->endElement(); + $objWriter->startElement('selection'); + $objWriter->writeAttribute('pane', 'bottomLeft'); + $objWriter->endElement(); + } + } + + // Selection +// if ($pane != '') { + // Only need to write selection element if we have a split pane + // We cheat a little by over-riding the active cell selection, setting it to the split cell + $objWriter->startElement('selection'); + if ($pane != '') { + $objWriter->writeAttribute('pane', $pane); + } + $objWriter->writeAttribute('activeCell', $activeCell); + $objWriter->writeAttribute('sqref', $activeCell); + $objWriter->endElement(); +// } + + $objWriter->endElement(); + + $objWriter->endElement(); + } + + /** + * Write SheetFormatPr + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writeSheetFormatPr(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + // sheetFormatPr + $objWriter->startElement('sheetFormatPr'); + + // Default row height + if ($pSheet->getDefaultRowDimension()->getRowHeight() >= 0) { + $objWriter->writeAttribute('customHeight', 'true'); + $objWriter->writeAttribute('defaultRowHeight', PHPExcel_Shared_String::FormatNumber($pSheet->getDefaultRowDimension()->getRowHeight())); + } else { + $objWriter->writeAttribute('defaultRowHeight', '14.4'); + } + + // Set Zero Height row + if ((string)$pSheet->getDefaultRowDimension()->getZeroHeight() == '1' || + strtolower((string)$pSheet->getDefaultRowDimension()->getZeroHeight()) == 'true') { + $objWriter->writeAttribute('zeroHeight', '1'); + } + + // Default column width + if ($pSheet->getDefaultColumnDimension()->getWidth() >= 0) { + $objWriter->writeAttribute('defaultColWidth', PHPExcel_Shared_String::FormatNumber($pSheet->getDefaultColumnDimension()->getWidth())); + } + + // Outline level - row + $outlineLevelRow = 0; + foreach ($pSheet->getRowDimensions() as $dimension) { + if ($dimension->getOutlineLevel() > $outlineLevelRow) { + $outlineLevelRow = $dimension->getOutlineLevel(); + } + } + $objWriter->writeAttribute('outlineLevelRow', (int)$outlineLevelRow); + + // Outline level - column + $outlineLevelCol = 0; + foreach ($pSheet->getColumnDimensions() as $dimension) { + if ($dimension->getOutlineLevel() > $outlineLevelCol) { + $outlineLevelCol = $dimension->getOutlineLevel(); + } + } + $objWriter->writeAttribute('outlineLevelCol', (int)$outlineLevelCol); + + $objWriter->endElement(); + } + + /** + * Write Cols + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writeCols(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + // cols + if (count($pSheet->getColumnDimensions()) > 0) { + $objWriter->startElement('cols'); + + $pSheet->calculateColumnWidths(); + + // Loop through column dimensions + foreach ($pSheet->getColumnDimensions() as $colDimension) { + // col + $objWriter->startElement('col'); + $objWriter->writeAttribute('min', PHPExcel_Cell::columnIndexFromString($colDimension->getColumnIndex())); + $objWriter->writeAttribute('max', PHPExcel_Cell::columnIndexFromString($colDimension->getColumnIndex())); + + if ($colDimension->getWidth() < 0) { + // No width set, apply default of 10 + $objWriter->writeAttribute('width', '9.10'); + } else { + // Width set + $objWriter->writeAttribute('width', PHPExcel_Shared_String::FormatNumber($colDimension->getWidth())); + } + + // Column visibility + if ($colDimension->getVisible() == false) { + $objWriter->writeAttribute('hidden', 'true'); + } + + // Auto size? + if ($colDimension->getAutoSize()) { + $objWriter->writeAttribute('bestFit', 'true'); + } + + // Custom width? + if ($colDimension->getWidth() != $pSheet->getDefaultColumnDimension()->getWidth()) { + $objWriter->writeAttribute('customWidth', 'true'); + } + + // Collapsed + if ($colDimension->getCollapsed() == true) { + $objWriter->writeAttribute('collapsed', 'true'); + } + + // Outline level + if ($colDimension->getOutlineLevel() > 0) { + $objWriter->writeAttribute('outlineLevel', $colDimension->getOutlineLevel()); + } + + // Style + $objWriter->writeAttribute('style', $colDimension->getXfIndex()); + + $objWriter->endElement(); + } + + $objWriter->endElement(); + } + } + + /** + * Write SheetProtection + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writeSheetProtection(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + // sheetProtection + $objWriter->startElement('sheetProtection'); + + if ($pSheet->getProtection()->getPassword() != '') { + $objWriter->writeAttribute('password', $pSheet->getProtection()->getPassword()); + } + + $objWriter->writeAttribute('sheet', ($pSheet->getProtection()->getSheet() ? 'true' : 'false')); + $objWriter->writeAttribute('objects', ($pSheet->getProtection()->getObjects() ? 'true' : 'false')); + $objWriter->writeAttribute('scenarios', ($pSheet->getProtection()->getScenarios() ? 'true' : 'false')); + $objWriter->writeAttribute('formatCells', ($pSheet->getProtection()->getFormatCells() ? 'true' : 'false')); + $objWriter->writeAttribute('formatColumns', ($pSheet->getProtection()->getFormatColumns() ? 'true' : 'false')); + $objWriter->writeAttribute('formatRows', ($pSheet->getProtection()->getFormatRows() ? 'true' : 'false')); + $objWriter->writeAttribute('insertColumns', ($pSheet->getProtection()->getInsertColumns() ? 'true' : 'false')); + $objWriter->writeAttribute('insertRows', ($pSheet->getProtection()->getInsertRows() ? 'true' : 'false')); + $objWriter->writeAttribute('insertHyperlinks', ($pSheet->getProtection()->getInsertHyperlinks() ? 'true' : 'false')); + $objWriter->writeAttribute('deleteColumns', ($pSheet->getProtection()->getDeleteColumns() ? 'true' : 'false')); + $objWriter->writeAttribute('deleteRows', ($pSheet->getProtection()->getDeleteRows() ? 'true' : 'false')); + $objWriter->writeAttribute('selectLockedCells', ($pSheet->getProtection()->getSelectLockedCells() ? 'true' : 'false')); + $objWriter->writeAttribute('sort', ($pSheet->getProtection()->getSort() ? 'true' : 'false')); + $objWriter->writeAttribute('autoFilter', ($pSheet->getProtection()->getAutoFilter() ? 'true' : 'false')); + $objWriter->writeAttribute('pivotTables', ($pSheet->getProtection()->getPivotTables() ? 'true' : 'false')); + $objWriter->writeAttribute('selectUnlockedCells', ($pSheet->getProtection()->getSelectUnlockedCells() ? 'true' : 'false')); + $objWriter->endElement(); + } + + /** + * Write ConditionalFormatting + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writeConditionalFormatting(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + // Conditional id + $id = 1; + + // Loop through styles in the current worksheet + foreach ($pSheet->getConditionalStylesCollection() as $cellCoordinate => $conditionalStyles) { + foreach ($conditionalStyles as $conditional) { + // WHY was this again? + // if ($this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode()) == '') { + // continue; + // } + if ($conditional->getConditionType() != PHPExcel_Style_Conditional::CONDITION_NONE) { + // conditionalFormatting + $objWriter->startElement('conditionalFormatting'); + $objWriter->writeAttribute('sqref', $cellCoordinate); + + // cfRule + $objWriter->startElement('cfRule'); + $objWriter->writeAttribute('type', $conditional->getConditionType()); + $objWriter->writeAttribute('dxfId', $this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode())); + $objWriter->writeAttribute('priority', $id++); + + if (($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS || $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT) + && $conditional->getOperatorType() != PHPExcel_Style_Conditional::OPERATOR_NONE) { + $objWriter->writeAttribute('operator', $conditional->getOperatorType()); + } + + if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT + && !is_null($conditional->getText())) { + $objWriter->writeAttribute('text', $conditional->getText()); + } + + if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT + && $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_CONTAINSTEXT + && !is_null($conditional->getText())) { + $objWriter->writeElement('formula', 'NOT(ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . ')))'); + } elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT + && $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_BEGINSWITH + && !is_null($conditional->getText())) { + $objWriter->writeElement('formula', 'LEFT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"'); + } elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT + && $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_ENDSWITH + && !is_null($conditional->getText())) { + $objWriter->writeElement('formula', 'RIGHT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"'); + } elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT + && $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_NOTCONTAINS + && !is_null($conditional->getText())) { + $objWriter->writeElement('formula', 'ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . '))'); + } elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS + || $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT + || $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_EXPRESSION) { + foreach ($conditional->getConditions() as $formula) { + // Formula + $objWriter->writeElement('formula', $formula); + } + } + + $objWriter->endElement(); + + $objWriter->endElement(); + } + } + } + } + + /** + * Write DataValidations + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writeDataValidations(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + // Datavalidation collection + $dataValidationCollection = $pSheet->getDataValidationCollection(); + + // Write data validations? + if (!empty($dataValidationCollection)) { + $objWriter->startElement('dataValidations'); + $objWriter->writeAttribute('count', count($dataValidationCollection)); + + foreach ($dataValidationCollection as $coordinate => $dv) { + $objWriter->startElement('dataValidation'); + + if ($dv->getType() != '') { + $objWriter->writeAttribute('type', $dv->getType()); + } + + if ($dv->getErrorStyle() != '') { + $objWriter->writeAttribute('errorStyle', $dv->getErrorStyle()); + } + + if ($dv->getOperator() != '') { + $objWriter->writeAttribute('operator', $dv->getOperator()); + } + + $objWriter->writeAttribute('allowBlank', ($dv->getAllowBlank() ? '1' : '0')); + $objWriter->writeAttribute('showDropDown', (!$dv->getShowDropDown() ? '1' : '0')); + $objWriter->writeAttribute('showInputMessage', ($dv->getShowInputMessage() ? '1' : '0')); + $objWriter->writeAttribute('showErrorMessage', ($dv->getShowErrorMessage() ? '1' : '0')); + + if ($dv->getErrorTitle() !== '') { + $objWriter->writeAttribute('errorTitle', $dv->getErrorTitle()); + } + if ($dv->getError() !== '') { + $objWriter->writeAttribute('error', $dv->getError()); + } + if ($dv->getPromptTitle() !== '') { + $objWriter->writeAttribute('promptTitle', $dv->getPromptTitle()); + } + if ($dv->getPrompt() !== '') { + $objWriter->writeAttribute('prompt', $dv->getPrompt()); + } + + $objWriter->writeAttribute('sqref', $coordinate); + + if ($dv->getFormula1() !== '') { + $objWriter->writeElement('formula1', $dv->getFormula1()); + } + if ($dv->getFormula2() !== '') { + $objWriter->writeElement('formula2', $dv->getFormula2()); + } + + $objWriter->endElement(); + } + + $objWriter->endElement(); + } + } + + /** + * Write Hyperlinks + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writeHyperlinks(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + // Hyperlink collection + $hyperlinkCollection = $pSheet->getHyperlinkCollection(); + + // Relation ID + $relationId = 1; + + // Write hyperlinks? + if (!empty($hyperlinkCollection)) { + $objWriter->startElement('hyperlinks'); + + foreach ($hyperlinkCollection as $coordinate => $hyperlink) { + $objWriter->startElement('hyperlink'); + + $objWriter->writeAttribute('ref', $coordinate); + if (!$hyperlink->isInternal()) { + $objWriter->writeAttribute('r:id', 'rId_hyperlink_' . $relationId); + ++$relationId; + } else { + $objWriter->writeAttribute('location', str_replace('sheet://', '', $hyperlink->getUrl())); + } + + if ($hyperlink->getTooltip() != '') { + $objWriter->writeAttribute('tooltip', $hyperlink->getTooltip()); + } + + $objWriter->endElement(); + } + + $objWriter->endElement(); + } + } + + /** + * Write ProtectedRanges + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writeProtectedRanges(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + if (count($pSheet->getProtectedCells()) > 0) { + // protectedRanges + $objWriter->startElement('protectedRanges'); + + // Loop protectedRanges + foreach ($pSheet->getProtectedCells() as $protectedCell => $passwordHash) { + // protectedRange + $objWriter->startElement('protectedRange'); + $objWriter->writeAttribute('name', 'p' . md5($protectedCell)); + $objWriter->writeAttribute('sqref', $protectedCell); + if (!empty($passwordHash)) { + $objWriter->writeAttribute('password', $passwordHash); + } + $objWriter->endElement(); + } + + $objWriter->endElement(); + } + } + + /** + * Write MergeCells + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writeMergeCells(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + if (count($pSheet->getMergeCells()) > 0) { + // mergeCells + $objWriter->startElement('mergeCells'); + + // Loop mergeCells + foreach ($pSheet->getMergeCells() as $mergeCell) { + // mergeCell + $objWriter->startElement('mergeCell'); + $objWriter->writeAttribute('ref', $mergeCell); + $objWriter->endElement(); + } + + $objWriter->endElement(); + } + } + + /** + * Write PrintOptions + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writePrintOptions(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + // printOptions + $objWriter->startElement('printOptions'); + + $objWriter->writeAttribute('gridLines', ($pSheet->getPrintGridlines() ? 'true': 'false')); + $objWriter->writeAttribute('gridLinesSet', 'true'); + + if ($pSheet->getPageSetup()->getHorizontalCentered()) { + $objWriter->writeAttribute('horizontalCentered', 'true'); + } + + if ($pSheet->getPageSetup()->getVerticalCentered()) { + $objWriter->writeAttribute('verticalCentered', 'true'); + } + + $objWriter->endElement(); + } + + /** + * Write PageMargins + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writePageMargins(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + // pageMargins + $objWriter->startElement('pageMargins'); + $objWriter->writeAttribute('left', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getLeft())); + $objWriter->writeAttribute('right', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getRight())); + $objWriter->writeAttribute('top', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getTop())); + $objWriter->writeAttribute('bottom', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getBottom())); + $objWriter->writeAttribute('header', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getHeader())); + $objWriter->writeAttribute('footer', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getFooter())); + $objWriter->endElement(); + } + + /** + * Write AutoFilter + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writeAutoFilter(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + $autoFilterRange = $pSheet->getAutoFilter()->getRange(); + if (!empty($autoFilterRange)) { + // autoFilter + $objWriter->startElement('autoFilter'); + + // Strip any worksheet reference from the filter coordinates + $range = PHPExcel_Cell::splitRange($autoFilterRange); + $range = $range[0]; + // Strip any worksheet ref + if (strpos($range[0], '!') !== false) { + list($ws, $range[0]) = explode('!', $range[0]); + } + $range = implode(':', $range); + + $objWriter->writeAttribute('ref', str_replace('$', '', $range)); + + $columns = $pSheet->getAutoFilter()->getColumns(); + if (count($columns > 0)) { + foreach ($columns as $columnID => $column) { + $rules = $column->getRules(); + if (count($rules) > 0) { + $objWriter->startElement('filterColumn'); + $objWriter->writeAttribute('colId', $pSheet->getAutoFilter()->getColumnOffset($columnID)); + + $objWriter->startElement($column->getFilterType()); + if ($column->getJoin() == PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND) { + $objWriter->writeAttribute('and', 1); + } + + foreach ($rules as $rule) { + if (($column->getFilterType() === PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER) && + ($rule->getOperator() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL) && + ($rule->getValue() === '')) { + // Filter rule for Blanks + $objWriter->writeAttribute('blank', 1); + } elseif ($rule->getRuleType() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER) { + // Dynamic Filter Rule + $objWriter->writeAttribute('type', $rule->getGrouping()); + $val = $column->getAttribute('val'); + if ($val !== null) { + $objWriter->writeAttribute('val', $val); + } + $maxVal = $column->getAttribute('maxVal'); + if ($maxVal !== null) { + $objWriter->writeAttribute('maxVal', $maxVal); + } + } elseif ($rule->getRuleType() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_TOPTENFILTER) { + // Top 10 Filter Rule + $objWriter->writeAttribute('val', $rule->getValue()); + $objWriter->writeAttribute('percent', (($rule->getOperator() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) ? '1' : '0')); + $objWriter->writeAttribute('top', (($rule->getGrouping() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) ? '1': '0')); + } else { + // Filter, DateGroupItem or CustomFilter + $objWriter->startElement($rule->getRuleType()); + + if ($rule->getOperator() !== PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL) { + $objWriter->writeAttribute('operator', $rule->getOperator()); + } + if ($rule->getRuleType() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP) { + // Date Group filters + foreach ($rule->getValue() as $key => $value) { + if ($value > '') { + $objWriter->writeAttribute($key, $value); + } + } + $objWriter->writeAttribute('dateTimeGrouping', $rule->getGrouping()); + } else { + $objWriter->writeAttribute('val', $rule->getValue()); + } + + $objWriter->endElement(); + } + } + + $objWriter->endElement(); + + $objWriter->endElement(); + } + } + } + $objWriter->endElement(); + } + } + + /** + * Write PageSetup + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writePageSetup(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + // pageSetup + $objWriter->startElement('pageSetup'); + $objWriter->writeAttribute('paperSize', $pSheet->getPageSetup()->getPaperSize()); + $objWriter->writeAttribute('orientation', $pSheet->getPageSetup()->getOrientation()); + + if (!is_null($pSheet->getPageSetup()->getScale())) { + $objWriter->writeAttribute('scale', $pSheet->getPageSetup()->getScale()); + } + if (!is_null($pSheet->getPageSetup()->getFitToHeight())) { + $objWriter->writeAttribute('fitToHeight', $pSheet->getPageSetup()->getFitToHeight()); + } else { + $objWriter->writeAttribute('fitToHeight', '0'); + } + if (!is_null($pSheet->getPageSetup()->getFitToWidth())) { + $objWriter->writeAttribute('fitToWidth', $pSheet->getPageSetup()->getFitToWidth()); + } else { + $objWriter->writeAttribute('fitToWidth', '0'); + } + if (!is_null($pSheet->getPageSetup()->getFirstPageNumber())) { + $objWriter->writeAttribute('firstPageNumber', $pSheet->getPageSetup()->getFirstPageNumber()); + $objWriter->writeAttribute('useFirstPageNumber', '1'); + } + + $objWriter->endElement(); + } + + /** + * Write Header / Footer + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writeHeaderFooter(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + // headerFooter + $objWriter->startElement('headerFooter'); + $objWriter->writeAttribute('differentOddEven', ($pSheet->getHeaderFooter()->getDifferentOddEven() ? 'true' : 'false')); + $objWriter->writeAttribute('differentFirst', ($pSheet->getHeaderFooter()->getDifferentFirst() ? 'true' : 'false')); + $objWriter->writeAttribute('scaleWithDoc', ($pSheet->getHeaderFooter()->getScaleWithDocument() ? 'true' : 'false')); + $objWriter->writeAttribute('alignWithMargins', ($pSheet->getHeaderFooter()->getAlignWithMargins() ? 'true' : 'false')); + + $objWriter->writeElement('oddHeader', $pSheet->getHeaderFooter()->getOddHeader()); + $objWriter->writeElement('oddFooter', $pSheet->getHeaderFooter()->getOddFooter()); + $objWriter->writeElement('evenHeader', $pSheet->getHeaderFooter()->getEvenHeader()); + $objWriter->writeElement('evenFooter', $pSheet->getHeaderFooter()->getEvenFooter()); + $objWriter->writeElement('firstHeader', $pSheet->getHeaderFooter()->getFirstHeader()); + $objWriter->writeElement('firstFooter', $pSheet->getHeaderFooter()->getFirstFooter()); + $objWriter->endElement(); + } + + /** + * Write Breaks + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writeBreaks(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + // Get row and column breaks + $aRowBreaks = array(); + $aColumnBreaks = array(); + foreach ($pSheet->getBreaks() as $cell => $breakType) { + if ($breakType == PHPExcel_Worksheet::BREAK_ROW) { + $aRowBreaks[] = $cell; + } elseif ($breakType == PHPExcel_Worksheet::BREAK_COLUMN) { + $aColumnBreaks[] = $cell; + } + } + + // rowBreaks + if (!empty($aRowBreaks)) { + $objWriter->startElement('rowBreaks'); + $objWriter->writeAttribute('count', count($aRowBreaks)); + $objWriter->writeAttribute('manualBreakCount', count($aRowBreaks)); + + foreach ($aRowBreaks as $cell) { + $coords = PHPExcel_Cell::coordinateFromString($cell); + + $objWriter->startElement('brk'); + $objWriter->writeAttribute('id', $coords[1]); + $objWriter->writeAttribute('man', '1'); + $objWriter->endElement(); + } + + $objWriter->endElement(); + } + + // Second, write column breaks + if (!empty($aColumnBreaks)) { + $objWriter->startElement('colBreaks'); + $objWriter->writeAttribute('count', count($aColumnBreaks)); + $objWriter->writeAttribute('manualBreakCount', count($aColumnBreaks)); + + foreach ($aColumnBreaks as $cell) { + $coords = PHPExcel_Cell::coordinateFromString($cell); + + $objWriter->startElement('brk'); + $objWriter->writeAttribute('id', PHPExcel_Cell::columnIndexFromString($coords[0]) - 1); + $objWriter->writeAttribute('man', '1'); + $objWriter->endElement(); + } + + $objWriter->endElement(); + } + } + + /** + * Write SheetData + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @param string[] $pStringTable String table + * @throws PHPExcel_Writer_Exception + */ + private function writeSheetData(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pStringTable = null) + { + if (is_array($pStringTable)) { + // Flipped stringtable, for faster index searching + $aFlippedStringTable = $this->getParentWriter()->getWriterPart('stringtable')->flipStringTable($pStringTable); + + // sheetData + $objWriter->startElement('sheetData'); + + // Get column count + $colCount = PHPExcel_Cell::columnIndexFromString($pSheet->getHighestColumn()); + + // Highest row number + $highestRow = $pSheet->getHighestRow(); + + // Loop through cells + $cellsByRow = array(); + foreach ($pSheet->getCellCollection() as $cellID) { + $cellAddress = PHPExcel_Cell::coordinateFromString($cellID); + $cellsByRow[$cellAddress[1]][] = $cellID; + } + + $currentRow = 0; + while ($currentRow++ < $highestRow) { + // Get row dimension + $rowDimension = $pSheet->getRowDimension($currentRow); + + // Write current row? + $writeCurrentRow = isset($cellsByRow[$currentRow]) || $rowDimension->getRowHeight() >= 0 || $rowDimension->getVisible() == false || $rowDimension->getCollapsed() == true || $rowDimension->getOutlineLevel() > 0 || $rowDimension->getXfIndex() !== null; + + if ($writeCurrentRow) { + // Start a new row + $objWriter->startElement('row'); + $objWriter->writeAttribute('r', $currentRow); + $objWriter->writeAttribute('spans', '1:' . $colCount); + + // Row dimensions + if ($rowDimension->getRowHeight() >= 0) { + $objWriter->writeAttribute('customHeight', '1'); + $objWriter->writeAttribute('ht', PHPExcel_Shared_String::FormatNumber($rowDimension->getRowHeight())); + } + + // Row visibility + if ($rowDimension->getVisible() == false) { + $objWriter->writeAttribute('hidden', 'true'); + } + + // Collapsed + if ($rowDimension->getCollapsed() == true) { + $objWriter->writeAttribute('collapsed', 'true'); + } + + // Outline level + if ($rowDimension->getOutlineLevel() > 0) { + $objWriter->writeAttribute('outlineLevel', $rowDimension->getOutlineLevel()); + } + + // Style + if ($rowDimension->getXfIndex() !== null) { + $objWriter->writeAttribute('s', $rowDimension->getXfIndex()); + $objWriter->writeAttribute('customFormat', '1'); + } + + // Write cells + if (isset($cellsByRow[$currentRow])) { + foreach ($cellsByRow[$currentRow] as $cellAddress) { + // Write cell + $this->writeCell($objWriter, $pSheet, $cellAddress, $pStringTable, $aFlippedStringTable); + } + } + + // End row + $objWriter->endElement(); + } + } + + $objWriter->endElement(); + } else { + throw new PHPExcel_Writer_Exception("Invalid parameters passed."); + } + } + + /** + * Write Cell + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @param PHPExcel_Cell $pCellAddress Cell Address + * @param string[] $pStringTable String table + * @param string[] $pFlippedStringTable String table (flipped), for faster index searching + * @throws PHPExcel_Writer_Exception + */ + private function writeCell(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pCellAddress = null, $pStringTable = null, $pFlippedStringTable = null) + { + if (is_array($pStringTable) && is_array($pFlippedStringTable)) { + // Cell + $pCell = $pSheet->getCell($pCellAddress); + $objWriter->startElement('c'); + $objWriter->writeAttribute('r', $pCellAddress); + + // Sheet styles + if ($pCell->getXfIndex() != '') { + $objWriter->writeAttribute('s', $pCell->getXfIndex()); + } + + // If cell value is supplied, write cell value + $cellValue = $pCell->getValue(); + if (is_object($cellValue) || $cellValue !== '') { + // Map type + $mappedType = $pCell->getDataType(); + + // Write data type depending on its type + switch (strtolower($mappedType)) { + case 'inlinestr': // Inline string + case 's': // String + case 'b': // Boolean + $objWriter->writeAttribute('t', $mappedType); + break; + case 'f': // Formula + $calculatedValue = ($this->getParentWriter()->getPreCalculateFormulas()) ? + $pCell->getCalculatedValue() : + $cellValue; + if (is_string($calculatedValue)) { + $objWriter->writeAttribute('t', 'str'); + } + break; + case 'e': // Error + $objWriter->writeAttribute('t', $mappedType); + } + + // Write data depending on its type + switch (strtolower($mappedType)) { + case 'inlinestr': // Inline string + if (! $cellValue instanceof PHPExcel_RichText) { + $objWriter->writeElement('t', PHPExcel_Shared_String::ControlCharacterPHP2OOXML(htmlspecialchars($cellValue))); + } elseif ($cellValue instanceof PHPExcel_RichText) { + $objWriter->startElement('is'); + $this->getParentWriter()->getWriterPart('stringtable')->writeRichText($objWriter, $cellValue); + $objWriter->endElement(); + } + + break; + case 's': // String + if (! $cellValue instanceof PHPExcel_RichText) { + if (isset($pFlippedStringTable[$cellValue])) { + $objWriter->writeElement('v', $pFlippedStringTable[$cellValue]); + } + } elseif ($cellValue instanceof PHPExcel_RichText) { + $objWriter->writeElement('v', $pFlippedStringTable[$cellValue->getHashCode()]); + } + + break; + case 'f': // Formula + $attributes = $pCell->getFormulaAttributes(); + if ($attributes['t'] == 'array') { + $objWriter->startElement('f'); + $objWriter->writeAttribute('t', 'array'); + $objWriter->writeAttribute('ref', $pCellAddress); + $objWriter->writeAttribute('aca', '1'); + $objWriter->writeAttribute('ca', '1'); + $objWriter->text(substr($cellValue, 1)); + $objWriter->endElement(); + } else { + $objWriter->writeElement('f', substr($cellValue, 1)); + } + if ($this->getParentWriter()->getOffice2003Compatibility() === false) { + if ($this->getParentWriter()->getPreCalculateFormulas()) { +// $calculatedValue = $pCell->getCalculatedValue(); + if (!is_array($calculatedValue) && substr($calculatedValue, 0, 1) != '#') { + $objWriter->writeElement('v', PHPExcel_Shared_String::FormatNumber($calculatedValue)); + } else { + $objWriter->writeElement('v', '0'); + } + } else { + $objWriter->writeElement('v', '0'); + } + } + break; + case 'n': // Numeric + // force point as decimal separator in case current locale uses comma + $objWriter->writeElement('v', str_replace(',', '.', $cellValue)); + break; + case 'b': // Boolean + $objWriter->writeElement('v', ($cellValue ? '1' : '0')); + break; + case 'e': // Error + if (substr($cellValue, 0, 1) == '=') { + $objWriter->writeElement('f', substr($cellValue, 1)); + $objWriter->writeElement('v', substr($cellValue, 1)); + } else { + $objWriter->writeElement('v', $cellValue); + } + + break; + } + } + + $objWriter->endElement(); + } else { + throw new PHPExcel_Writer_Exception("Invalid parameters passed."); + } + } + + /** + * Write Drawings + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @param boolean $includeCharts Flag indicating if we should include drawing details for charts + * @throws PHPExcel_Writer_Exception + */ + private function writeDrawings(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $includeCharts = false) + { + $chartCount = ($includeCharts) ? $pSheet->getChartCollection()->count() : 0; + // If sheet contains drawings, add the relationships + if (($pSheet->getDrawingCollection()->count() > 0) || + ($chartCount > 0)) { + $objWriter->startElement('drawing'); + $objWriter->writeAttribute('r:id', 'rId1'); + $objWriter->endElement(); + } + } + + /** + * Write LegacyDrawing + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writeLegacyDrawing(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + // If sheet contains comments, add the relationships + if (count($pSheet->getComments()) > 0) { + $objWriter->startElement('legacyDrawing'); + $objWriter->writeAttribute('r:id', 'rId_comments_vml1'); + $objWriter->endElement(); + } + } + + /** + * Write LegacyDrawingHF + * + * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer + * @param PHPExcel_Worksheet $pSheet Worksheet + * @throws PHPExcel_Writer_Exception + */ + private function writeLegacyDrawingHF(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) + { + // If sheet contains images, add the relationships + if (count($pSheet->getHeaderFooter()->getImages()) > 0) { + $objWriter->startElement('legacyDrawingHF'); + $objWriter->writeAttribute('r:id', 'rId_headerfooter_vml1'); + $objWriter->endElement(); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel2007/WriterPart.php b/extend/PHPExcel/PHPExcel/Writer/Excel2007/WriterPart.php new file mode 100644 index 0000000..806ebe5 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel2007/WriterPart.php @@ -0,0 +1,75 @@ +<?php + +/** + * PHPExcel_Writer_Excel2007_WriterPart + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel2007 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +abstract class PHPExcel_Writer_Excel2007_WriterPart +{ + /** + * Parent IWriter object + * + * @var PHPExcel_Writer_IWriter + */ + private $parentWriter; + + /** + * Set parent IWriter object + * + * @param PHPExcel_Writer_IWriter $pWriter + * @throws PHPExcel_Writer_Exception + */ + public function setParentWriter(PHPExcel_Writer_IWriter $pWriter = null) + { + $this->parentWriter = $pWriter; + } + + /** + * Get parent IWriter object + * + * @return PHPExcel_Writer_IWriter + * @throws PHPExcel_Writer_Exception + */ + public function getParentWriter() + { + if (!is_null($this->parentWriter)) { + return $this->parentWriter; + } else { + throw new PHPExcel_Writer_Exception("No parent PHPExcel_Writer_IWriter assigned."); + } + } + + /** + * Set parent IWriter object + * + * @param PHPExcel_Writer_IWriter $pWriter + * @throws PHPExcel_Writer_Exception + */ + public function __construct(PHPExcel_Writer_IWriter $pWriter = null) + { + if (!is_null($pWriter)) { + $this->parentWriter = $pWriter; + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel5.php b/extend/PHPExcel/PHPExcel/Writer/Excel5.php new file mode 100644 index 0000000..2dede81 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel5.php @@ -0,0 +1,904 @@ +<?php + +/** + * PHPExcel_Writer_Excel5 + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel5 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter +{ + /** + * PHPExcel object + * + * @var PHPExcel + */ + private $phpExcel; + + /** + * Total number of shared strings in workbook + * + * @var int + */ + private $strTotal = 0; + + /** + * Number of unique shared strings in workbook + * + * @var int + */ + private $strUnique = 0; + + /** + * Array of unique shared strings in workbook + * + * @var array + */ + private $strTable = array(); + + /** + * Color cache. Mapping between RGB value and color index. + * + * @var array + */ + private $colors; + + /** + * Formula parser + * + * @var PHPExcel_Writer_Excel5_Parser + */ + private $parser; + + /** + * Identifier clusters for drawings. Used in MSODRAWINGGROUP record. + * + * @var array + */ + private $IDCLs; + + /** + * Basic OLE object summary information + * + * @var array + */ + private $summaryInformation; + + /** + * Extended OLE object document summary information + * + * @var array + */ + private $documentSummaryInformation; + + /** + * Create a new PHPExcel_Writer_Excel5 + * + * @param PHPExcel $phpExcel PHPExcel object + */ + public function __construct(PHPExcel $phpExcel) + { + $this->phpExcel = $phpExcel; + + $this->parser = new PHPExcel_Writer_Excel5_Parser(); + } + + /** + * Save PHPExcel to file + * + * @param string $pFilename + * @throws PHPExcel_Writer_Exception + */ + public function save($pFilename = null) + { + + // garbage collect + $this->phpExcel->garbageCollect(); + + $saveDebugLog = PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->getWriteDebugLog(); + PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog(false); + $saveDateReturnType = PHPExcel_Calculation_Functions::getReturnDateType(); + PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); + + // initialize colors array + $this->colors = array(); + + // Initialise workbook writer + $this->writerWorkbook = new PHPExcel_Writer_Excel5_Workbook($this->phpExcel, $this->strTotal, $this->strUnique, $this->strTable, $this->colors, $this->parser); + + // Initialise worksheet writers + $countSheets = $this->phpExcel->getSheetCount(); + for ($i = 0; $i < $countSheets; ++$i) { + $this->writerWorksheets[$i] = new PHPExcel_Writer_Excel5_Worksheet($this->strTotal, $this->strUnique, $this->strTable, $this->colors, $this->parser, $this->preCalculateFormulas, $this->phpExcel->getSheet($i)); + } + + // build Escher objects. Escher objects for workbooks needs to be build before Escher object for workbook. + $this->buildWorksheetEschers(); + $this->buildWorkbookEscher(); + + // add 15 identical cell style Xfs + // for now, we use the first cellXf instead of cellStyleXf + $cellXfCollection = $this->phpExcel->getCellXfCollection(); + for ($i = 0; $i < 15; ++$i) { + $this->writerWorkbook->addXfWriter($cellXfCollection[0], true); + } + + // add all the cell Xfs + foreach ($this->phpExcel->getCellXfCollection() as $style) { + $this->writerWorkbook->addXfWriter($style, false); + } + + // add fonts from rich text eleemnts + for ($i = 0; $i < $countSheets; ++$i) { + foreach ($this->writerWorksheets[$i]->phpSheet->getCellCollection() as $cellID) { + $cell = $this->writerWorksheets[$i]->phpSheet->getCell($cellID); + $cVal = $cell->getValue(); + if ($cVal instanceof PHPExcel_RichText) { + $elements = $cVal->getRichTextElements(); + foreach ($elements as $element) { + if ($element instanceof PHPExcel_RichText_Run) { + $font = $element->getFont(); + $this->writerWorksheets[$i]->fontHashIndex[$font->getHashCode()] = $this->writerWorkbook->addFont($font); + } + } + } + } + } + + // initialize OLE file + $workbookStreamName = 'Workbook'; + $OLE = new PHPExcel_Shared_OLE_PPS_File(PHPExcel_Shared_OLE::Asc2Ucs($workbookStreamName)); + + // Write the worksheet streams before the global workbook stream, + // because the byte sizes of these are needed in the global workbook stream + $worksheetSizes = array(); + for ($i = 0; $i < $countSheets; ++$i) { + $this->writerWorksheets[$i]->close(); + $worksheetSizes[] = $this->writerWorksheets[$i]->_datasize; + } + + // add binary data for global workbook stream + $OLE->append($this->writerWorkbook->writeWorkbook($worksheetSizes)); + + // add binary data for sheet streams + for ($i = 0; $i < $countSheets; ++$i) { + $OLE->append($this->writerWorksheets[$i]->getData()); + } + + $this->documentSummaryInformation = $this->writeDocumentSummaryInformation(); + // initialize OLE Document Summary Information + if (isset($this->documentSummaryInformation) && !empty($this->documentSummaryInformation)) { + $OLE_DocumentSummaryInformation = new PHPExcel_Shared_OLE_PPS_File(PHPExcel_Shared_OLE::Asc2Ucs(chr(5) . 'DocumentSummaryInformation')); + $OLE_DocumentSummaryInformation->append($this->documentSummaryInformation); + } + + $this->summaryInformation = $this->writeSummaryInformation(); + // initialize OLE Summary Information + if (isset($this->summaryInformation) && !empty($this->summaryInformation)) { + $OLE_SummaryInformation = new PHPExcel_Shared_OLE_PPS_File(PHPExcel_Shared_OLE::Asc2Ucs(chr(5) . 'SummaryInformation')); + $OLE_SummaryInformation->append($this->summaryInformation); + } + + // define OLE Parts + $arrRootData = array($OLE); + // initialize OLE Properties file + if (isset($OLE_SummaryInformation)) { + $arrRootData[] = $OLE_SummaryInformation; + } + // initialize OLE Extended Properties file + if (isset($OLE_DocumentSummaryInformation)) { + $arrRootData[] = $OLE_DocumentSummaryInformation; + } + + $root = new PHPExcel_Shared_OLE_PPS_Root(time(), time(), $arrRootData); + // save the OLE file + $res = $root->save($pFilename); + + PHPExcel_Calculation_Functions::setReturnDateType($saveDateReturnType); + PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog($saveDebugLog); + } + + /** + * Set temporary storage directory + * + * @deprecated + * @param string $pValue Temporary storage directory + * @throws PHPExcel_Writer_Exception when directory does not exist + * @return PHPExcel_Writer_Excel5 + */ + public function setTempDir($pValue = '') + { + return $this; + } + + /** + * Build the Worksheet Escher objects + * + */ + private function buildWorksheetEschers() + { + // 1-based index to BstoreContainer + $blipIndex = 0; + $lastReducedSpId = 0; + $lastSpId = 0; + + foreach ($this->phpExcel->getAllsheets() as $sheet) { + // sheet index + $sheetIndex = $sheet->getParent()->getIndex($sheet); + + $escher = null; + + // check if there are any shapes for this sheet + $filterRange = $sheet->getAutoFilter()->getRange(); + if (count($sheet->getDrawingCollection()) == 0 && empty($filterRange)) { + continue; + } + + // create intermediate Escher object + $escher = new PHPExcel_Shared_Escher(); + + // dgContainer + $dgContainer = new PHPExcel_Shared_Escher_DgContainer(); + + // set the drawing index (we use sheet index + 1) + $dgId = $sheet->getParent()->getIndex($sheet) + 1; + $dgContainer->setDgId($dgId); + $escher->setDgContainer($dgContainer); + + // spgrContainer + $spgrContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer(); + $dgContainer->setSpgrContainer($spgrContainer); + + // add one shape which is the group shape + $spContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer(); + $spContainer->setSpgr(true); + $spContainer->setSpType(0); + $spContainer->setSpId(($sheet->getParent()->getIndex($sheet) + 1) << 10); + $spgrContainer->addChild($spContainer); + + // add the shapes + + $countShapes[$sheetIndex] = 0; // count number of shapes (minus group shape), in sheet + + foreach ($sheet->getDrawingCollection() as $drawing) { + ++$blipIndex; + + ++$countShapes[$sheetIndex]; + + // add the shape + $spContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer(); + + // set the shape type + $spContainer->setSpType(0x004B); + // set the shape flag + $spContainer->setSpFlag(0x02); + + // set the shape index (we combine 1-based sheet index and $countShapes to create unique shape index) + $reducedSpId = $countShapes[$sheetIndex]; + $spId = $reducedSpId + | ($sheet->getParent()->getIndex($sheet) + 1) << 10; + $spContainer->setSpId($spId); + + // keep track of last reducedSpId + $lastReducedSpId = $reducedSpId; + + // keep track of last spId + $lastSpId = $spId; + + // set the BLIP index + $spContainer->setOPT(0x4104, $blipIndex); + + // set coordinates and offsets, client anchor + $coordinates = $drawing->getCoordinates(); + $offsetX = $drawing->getOffsetX(); + $offsetY = $drawing->getOffsetY(); + $width = $drawing->getWidth(); + $height = $drawing->getHeight(); + + $twoAnchor = PHPExcel_Shared_Excel5::oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height); + + $spContainer->setStartCoordinates($twoAnchor['startCoordinates']); + $spContainer->setStartOffsetX($twoAnchor['startOffsetX']); + $spContainer->setStartOffsetY($twoAnchor['startOffsetY']); + $spContainer->setEndCoordinates($twoAnchor['endCoordinates']); + $spContainer->setEndOffsetX($twoAnchor['endOffsetX']); + $spContainer->setEndOffsetY($twoAnchor['endOffsetY']); + + $spgrContainer->addChild($spContainer); + } + + // AutoFilters + if (!empty($filterRange)) { + $rangeBounds = PHPExcel_Cell::rangeBoundaries($filterRange); + $iNumColStart = $rangeBounds[0][0]; + $iNumColEnd = $rangeBounds[1][0]; + + $iInc = $iNumColStart; + while ($iInc <= $iNumColEnd) { + ++$countShapes[$sheetIndex]; + + // create an Drawing Object for the dropdown + $oDrawing = new PHPExcel_Worksheet_BaseDrawing(); + // get the coordinates of drawing + $cDrawing = PHPExcel_Cell::stringFromColumnIndex($iInc - 1) . $rangeBounds[0][1]; + $oDrawing->setCoordinates($cDrawing); + $oDrawing->setWorksheet($sheet); + + // add the shape + $spContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer(); + // set the shape type + $spContainer->setSpType(0x00C9); + // set the shape flag + $spContainer->setSpFlag(0x01); + + // set the shape index (we combine 1-based sheet index and $countShapes to create unique shape index) + $reducedSpId = $countShapes[$sheetIndex]; + $spId = $reducedSpId + | ($sheet->getParent()->getIndex($sheet) + 1) << 10; + $spContainer->setSpId($spId); + + // keep track of last reducedSpId + $lastReducedSpId = $reducedSpId; + + // keep track of last spId + $lastSpId = $spId; + + $spContainer->setOPT(0x007F, 0x01040104); // Protection -> fLockAgainstGrouping + $spContainer->setOPT(0x00BF, 0x00080008); // Text -> fFitTextToShape + $spContainer->setOPT(0x01BF, 0x00010000); // Fill Style -> fNoFillHitTest + $spContainer->setOPT(0x01FF, 0x00080000); // Line Style -> fNoLineDrawDash + $spContainer->setOPT(0x03BF, 0x000A0000); // Group Shape -> fPrint + + // set coordinates and offsets, client anchor + $endCoordinates = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::stringFromColumnIndex($iInc - 1)); + $endCoordinates .= $rangeBounds[0][1] + 1; + + $spContainer->setStartCoordinates($cDrawing); + $spContainer->setStartOffsetX(0); + $spContainer->setStartOffsetY(0); + $spContainer->setEndCoordinates($endCoordinates); + $spContainer->setEndOffsetX(0); + $spContainer->setEndOffsetY(0); + + $spgrContainer->addChild($spContainer); + $iInc++; + } + } + + // identifier clusters, used for workbook Escher object + $this->IDCLs[$dgId] = $lastReducedSpId; + + // set last shape index + $dgContainer->setLastSpId($lastSpId); + + // set the Escher object + $this->writerWorksheets[$sheetIndex]->setEscher($escher); + } + } + + /** + * Build the Escher object corresponding to the MSODRAWINGGROUP record + */ + private function buildWorkbookEscher() + { + $escher = null; + + // any drawings in this workbook? + $found = false; + foreach ($this->phpExcel->getAllSheets() as $sheet) { + if (count($sheet->getDrawingCollection()) > 0) { + $found = true; + break; + } + } + + // nothing to do if there are no drawings + if (!$found) { + return; + } + + // if we reach here, then there are drawings in the workbook + $escher = new PHPExcel_Shared_Escher(); + + // dggContainer + $dggContainer = new PHPExcel_Shared_Escher_DggContainer(); + $escher->setDggContainer($dggContainer); + + // set IDCLs (identifier clusters) + $dggContainer->setIDCLs($this->IDCLs); + + // this loop is for determining maximum shape identifier of all drawing + $spIdMax = 0; + $totalCountShapes = 0; + $countDrawings = 0; + + foreach ($this->phpExcel->getAllsheets() as $sheet) { + $sheetCountShapes = 0; // count number of shapes (minus group shape), in sheet + + if (count($sheet->getDrawingCollection()) > 0) { + ++$countDrawings; + + foreach ($sheet->getDrawingCollection() as $drawing) { + ++$sheetCountShapes; + ++$totalCountShapes; + + $spId = $sheetCountShapes | ($this->phpExcel->getIndex($sheet) + 1) << 10; + $spIdMax = max($spId, $spIdMax); + } + } + } + + $dggContainer->setSpIdMax($spIdMax + 1); + $dggContainer->setCDgSaved($countDrawings); + $dggContainer->setCSpSaved($totalCountShapes + $countDrawings); // total number of shapes incl. one group shapes per drawing + + // bstoreContainer + $bstoreContainer = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer(); + $dggContainer->setBstoreContainer($bstoreContainer); + + // the BSE's (all the images) + foreach ($this->phpExcel->getAllsheets() as $sheet) { + foreach ($sheet->getDrawingCollection() as $drawing) { + if ($drawing instanceof PHPExcel_Worksheet_Drawing) { + $filename = $drawing->getPath(); + + list($imagesx, $imagesy, $imageFormat) = getimagesize($filename); + + switch ($imageFormat) { + case 1: // GIF, not supported by BIFF8, we convert to PNG + $blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG; + ob_start(); + imagepng(imagecreatefromgif($filename)); + $blipData = ob_get_contents(); + ob_end_clean(); + break; + case 2: // JPEG + $blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG; + $blipData = file_get_contents($filename); + break; + case 3: // PNG + $blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG; + $blipData = file_get_contents($filename); + break; + case 6: // Windows DIB (BMP), we convert to PNG + $blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG; + ob_start(); + imagepng(PHPExcel_Shared_Drawing::imagecreatefrombmp($filename)); + $blipData = ob_get_contents(); + ob_end_clean(); + break; + default: + continue 2; + } + + $blip = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip(); + $blip->setData($blipData); + + $BSE = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE(); + $BSE->setBlipType($blipType); + $BSE->setBlip($blip); + + $bstoreContainer->addBSE($BSE); + } elseif ($drawing instanceof PHPExcel_Worksheet_MemoryDrawing) { + switch ($drawing->getRenderingFunction()) { + case PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG: + $blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG; + $renderingFunction = 'imagejpeg'; + break; + case PHPExcel_Worksheet_MemoryDrawing::RENDERING_GIF: + case PHPExcel_Worksheet_MemoryDrawing::RENDERING_PNG: + case PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT: + $blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG; + $renderingFunction = 'imagepng'; + break; + } + + ob_start(); + call_user_func($renderingFunction, $drawing->getImageResource()); + $blipData = ob_get_contents(); + ob_end_clean(); + + $blip = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip(); + $blip->setData($blipData); + + $BSE = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE(); + $BSE->setBlipType($blipType); + $BSE->setBlip($blip); + + $bstoreContainer->addBSE($BSE); + } + } + } + + // Set the Escher object + $this->writerWorkbook->setEscher($escher); + } + + /** + * Build the OLE Part for DocumentSummary Information + * @return string + */ + private function writeDocumentSummaryInformation() + { + // offset: 0; size: 2; must be 0xFE 0xFF (UTF-16 LE byte order mark) + $data = pack('v', 0xFFFE); + // offset: 2; size: 2; + $data .= pack('v', 0x0000); + // offset: 4; size: 2; OS version + $data .= pack('v', 0x0106); + // offset: 6; size: 2; OS indicator + $data .= pack('v', 0x0002); + // offset: 8; size: 16 + $data .= pack('VVVV', 0x00, 0x00, 0x00, 0x00); + // offset: 24; size: 4; section count + $data .= pack('V', 0x0001); + + // offset: 28; size: 16; first section's class id: 02 d5 cd d5 9c 2e 1b 10 93 97 08 00 2b 2c f9 ae + $data .= pack('vvvvvvvv', 0xD502, 0xD5CD, 0x2E9C, 0x101B, 0x9793, 0x0008, 0x2C2B, 0xAEF9); + // offset: 44; size: 4; offset of the start + $data .= pack('V', 0x30); + + // SECTION + $dataSection = array(); + $dataSection_NumProps = 0; + $dataSection_Summary = ''; + $dataSection_Content = ''; + + // GKPIDDSI_CODEPAGE: CodePage + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x01), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x02), // 2 byte signed integer + 'data' => array('data' => 1252)); + $dataSection_NumProps++; + + // GKPIDDSI_CATEGORY : Category + if ($this->phpExcel->getProperties()->getCategory()) { + $dataProp = $this->phpExcel->getProperties()->getCategory(); + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x02), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x1E), + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); + $dataSection_NumProps++; + } + // GKPIDDSI_VERSION :Version of the application that wrote the property storage + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x17), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x03), + 'data' => array('pack' => 'V', 'data' => 0x000C0000)); + $dataSection_NumProps++; + // GKPIDDSI_SCALE : FALSE + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0B), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x0B), + 'data' => array('data' => false)); + $dataSection_NumProps++; + // GKPIDDSI_LINKSDIRTY : True if any of the values for the linked properties have changed outside of the application + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x10), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x0B), + 'data' => array('data' => false)); + $dataSection_NumProps++; + // GKPIDDSI_SHAREDOC : FALSE + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x13), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x0B), + 'data' => array('data' => false)); + $dataSection_NumProps++; + // GKPIDDSI_HYPERLINKSCHANGED : True if any of the values for the _PID_LINKS (hyperlink text) have changed outside of the application + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x16), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x0B), + 'data' => array('data' => false)); + $dataSection_NumProps++; + + // GKPIDDSI_DOCSPARTS + // MS-OSHARED p75 (2.3.3.2.2.1) + // Structure is VtVecUnalignedLpstrValue (2.3.3.1.9) + // cElements + $dataProp = pack('v', 0x0001); + $dataProp .= pack('v', 0x0000); + // array of UnalignedLpstr + // cch + $dataProp .= pack('v', 0x000A); + $dataProp .= pack('v', 0x0000); + // value + $dataProp .= 'Worksheet'.chr(0); + + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0D), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x101E), + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); + $dataSection_NumProps++; + + // GKPIDDSI_HEADINGPAIR + // VtVecHeadingPairValue + // cElements + $dataProp = pack('v', 0x0002); + $dataProp .= pack('v', 0x0000); + // Array of vtHeadingPair + // vtUnalignedString - headingString + // stringType + $dataProp .= pack('v', 0x001E); + // padding + $dataProp .= pack('v', 0x0000); + // UnalignedLpstr + // cch + $dataProp .= pack('v', 0x0013); + $dataProp .= pack('v', 0x0000); + // value + $dataProp .= 'Feuilles de calcul'; + // vtUnalignedString - headingParts + // wType : 0x0003 = 32 bit signed integer + $dataProp .= pack('v', 0x0300); + // padding + $dataProp .= pack('v', 0x0000); + // value + $dataProp .= pack('v', 0x0100); + $dataProp .= pack('v', 0x0000); + $dataProp .= pack('v', 0x0000); + $dataProp .= pack('v', 0x0000); + + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0C), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x100C), + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); + $dataSection_NumProps++; + + // 4 Section Length + // 4 Property count + // 8 * $dataSection_NumProps (8 = ID (4) + OffSet(4)) + $dataSection_Content_Offset = 8 + $dataSection_NumProps * 8; + foreach ($dataSection as $dataProp) { + // Summary + $dataSection_Summary .= pack($dataProp['summary']['pack'], $dataProp['summary']['data']); + // Offset + $dataSection_Summary .= pack($dataProp['offset']['pack'], $dataSection_Content_Offset); + // DataType + $dataSection_Content .= pack($dataProp['type']['pack'], $dataProp['type']['data']); + // Data + if ($dataProp['type']['data'] == 0x02) { // 2 byte signed integer + $dataSection_Content .= pack('V', $dataProp['data']['data']); + + $dataSection_Content_Offset += 4 + 4; + } elseif ($dataProp['type']['data'] == 0x03) { // 4 byte signed integer + $dataSection_Content .= pack('V', $dataProp['data']['data']); + + $dataSection_Content_Offset += 4 + 4; + } elseif ($dataProp['type']['data'] == 0x0B) { // Boolean + if ($dataProp['data']['data'] == false) { + $dataSection_Content .= pack('V', 0x0000); + } else { + $dataSection_Content .= pack('V', 0x0001); + } + $dataSection_Content_Offset += 4 + 4; + } elseif ($dataProp['type']['data'] == 0x1E) { // null-terminated string prepended by dword string length + // Null-terminated string + $dataProp['data']['data'] .= chr(0); + $dataProp['data']['length'] += 1; + // Complete the string with null string for being a %4 + $dataProp['data']['length'] = $dataProp['data']['length'] + ((4 - $dataProp['data']['length'] % 4)==4 ? 0 : (4 - $dataProp['data']['length'] % 4)); + $dataProp['data']['data'] = str_pad($dataProp['data']['data'], $dataProp['data']['length'], chr(0), STR_PAD_RIGHT); + + $dataSection_Content .= pack('V', $dataProp['data']['length']); + $dataSection_Content .= $dataProp['data']['data']; + + $dataSection_Content_Offset += 4 + 4 + strlen($dataProp['data']['data']); + } elseif ($dataProp['type']['data'] == 0x40) { // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) + $dataSection_Content .= $dataProp['data']['data']; + + $dataSection_Content_Offset += 4 + 8; + } else { + // Data Type Not Used at the moment + $dataSection_Content .= $dataProp['data']['data']; + + $dataSection_Content_Offset += 4 + $dataProp['data']['length']; + } + } + // Now $dataSection_Content_Offset contains the size of the content + + // section header + // offset: $secOffset; size: 4; section length + // + x Size of the content (summary + content) + $data .= pack('V', $dataSection_Content_Offset); + // offset: $secOffset+4; size: 4; property count + $data .= pack('V', $dataSection_NumProps); + // Section Summary + $data .= $dataSection_Summary; + // Section Content + $data .= $dataSection_Content; + + return $data; + } + + /** + * Build the OLE Part for Summary Information + * @return string + */ + private function writeSummaryInformation() + { + // offset: 0; size: 2; must be 0xFE 0xFF (UTF-16 LE byte order mark) + $data = pack('v', 0xFFFE); + // offset: 2; size: 2; + $data .= pack('v', 0x0000); + // offset: 4; size: 2; OS version + $data .= pack('v', 0x0106); + // offset: 6; size: 2; OS indicator + $data .= pack('v', 0x0002); + // offset: 8; size: 16 + $data .= pack('VVVV', 0x00, 0x00, 0x00, 0x00); + // offset: 24; size: 4; section count + $data .= pack('V', 0x0001); + + // offset: 28; size: 16; first section's class id: e0 85 9f f2 f9 4f 68 10 ab 91 08 00 2b 27 b3 d9 + $data .= pack('vvvvvvvv', 0x85E0, 0xF29F, 0x4FF9, 0x1068, 0x91AB, 0x0008, 0x272B, 0xD9B3); + // offset: 44; size: 4; offset of the start + $data .= pack('V', 0x30); + + // SECTION + $dataSection = array(); + $dataSection_NumProps = 0; + $dataSection_Summary = ''; + $dataSection_Content = ''; + + // CodePage : CP-1252 + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x01), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x02), // 2 byte signed integer + 'data' => array('data' => 1252)); + $dataSection_NumProps++; + + // Title + if ($this->phpExcel->getProperties()->getTitle()) { + $dataProp = $this->phpExcel->getProperties()->getTitle(); + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x02), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); + $dataSection_NumProps++; + } + // Subject + if ($this->phpExcel->getProperties()->getSubject()) { + $dataProp = $this->phpExcel->getProperties()->getSubject(); + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x03), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); + $dataSection_NumProps++; + } + // Author (Creator) + if ($this->phpExcel->getProperties()->getCreator()) { + $dataProp = $this->phpExcel->getProperties()->getCreator(); + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x04), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); + $dataSection_NumProps++; + } + // Keywords + if ($this->phpExcel->getProperties()->getKeywords()) { + $dataProp = $this->phpExcel->getProperties()->getKeywords(); + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x05), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); + $dataSection_NumProps++; + } + // Comments (Description) + if ($this->phpExcel->getProperties()->getDescription()) { + $dataProp = $this->phpExcel->getProperties()->getDescription(); + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x06), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); + $dataSection_NumProps++; + } + // Last Saved By (LastModifiedBy) + if ($this->phpExcel->getProperties()->getLastModifiedBy()) { + $dataProp = $this->phpExcel->getProperties()->getLastModifiedBy(); + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x08), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); + $dataSection_NumProps++; + } + // Created Date/Time + if ($this->phpExcel->getProperties()->getCreated()) { + $dataProp = $this->phpExcel->getProperties()->getCreated(); + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0C), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) + 'data' => array('data' => PHPExcel_Shared_OLE::LocalDate2OLE($dataProp))); + $dataSection_NumProps++; + } + // Modified Date/Time + if ($this->phpExcel->getProperties()->getModified()) { + $dataProp = $this->phpExcel->getProperties()->getModified(); + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0D), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) + 'data' => array('data' => PHPExcel_Shared_OLE::LocalDate2OLE($dataProp))); + $dataSection_NumProps++; + } + // Security + $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x13), + 'offset' => array('pack' => 'V'), + 'type' => array('pack' => 'V', 'data' => 0x03), // 4 byte signed integer + 'data' => array('data' => 0x00)); + $dataSection_NumProps++; + + + // 4 Section Length + // 4 Property count + // 8 * $dataSection_NumProps (8 = ID (4) + OffSet(4)) + $dataSection_Content_Offset = 8 + $dataSection_NumProps * 8; + foreach ($dataSection as $dataProp) { + // Summary + $dataSection_Summary .= pack($dataProp['summary']['pack'], $dataProp['summary']['data']); + // Offset + $dataSection_Summary .= pack($dataProp['offset']['pack'], $dataSection_Content_Offset); + // DataType + $dataSection_Content .= pack($dataProp['type']['pack'], $dataProp['type']['data']); + // Data + if ($dataProp['type']['data'] == 0x02) { // 2 byte signed integer + $dataSection_Content .= pack('V', $dataProp['data']['data']); + + $dataSection_Content_Offset += 4 + 4; + } elseif ($dataProp['type']['data'] == 0x03) { // 4 byte signed integer + $dataSection_Content .= pack('V', $dataProp['data']['data']); + + $dataSection_Content_Offset += 4 + 4; + } elseif ($dataProp['type']['data'] == 0x1E) { // null-terminated string prepended by dword string length + // Null-terminated string + $dataProp['data']['data'] .= chr(0); + $dataProp['data']['length'] += 1; + // Complete the string with null string for being a %4 + $dataProp['data']['length'] = $dataProp['data']['length'] + ((4 - $dataProp['data']['length'] % 4)==4 ? 0 : (4 - $dataProp['data']['length'] % 4)); + $dataProp['data']['data'] = str_pad($dataProp['data']['data'], $dataProp['data']['length'], chr(0), STR_PAD_RIGHT); + + $dataSection_Content .= pack('V', $dataProp['data']['length']); + $dataSection_Content .= $dataProp['data']['data']; + + $dataSection_Content_Offset += 4 + 4 + strlen($dataProp['data']['data']); + } elseif ($dataProp['type']['data'] == 0x40) { // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) + $dataSection_Content .= $dataProp['data']['data']; + + $dataSection_Content_Offset += 4 + 8; + } else { + // Data Type Not Used at the moment + } + } + // Now $dataSection_Content_Offset contains the size of the content + + // section header + // offset: $secOffset; size: 4; section length + // + x Size of the content (summary + content) + $data .= pack('V', $dataSection_Content_Offset); + // offset: $secOffset+4; size: 4; property count + $data .= pack('V', $dataSection_NumProps); + // Section Summary + $data .= $dataSection_Summary; + // Section Content + $data .= $dataSection_Content; + + return $data; + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel5/BIFFwriter.php b/extend/PHPExcel/PHPExcel/Writer/Excel5/BIFFwriter.php new file mode 100644 index 0000000..a795752 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel5/BIFFwriter.php @@ -0,0 +1,246 @@ +<?php + +/** + * PHPExcel_Writer_Excel5_BIFFwriter + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel5 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + +// Original file header of PEAR::Spreadsheet_Excel_Writer_BIFFwriter (used as the base for this class): +// ----------------------------------------------------------------------------------------- +// * Module written/ported by Xavier Noguer <xnoguer@rezebra.com> +// * +// * The majority of this is _NOT_ my code. I simply ported it from the +// * PERL Spreadsheet::WriteExcel module. +// * +// * The author of the Spreadsheet::WriteExcel module is John McNamara +// * <jmcnamara@cpan.org> +// * +// * I _DO_ maintain this code, and John McNamara has nothing to do with the +// * porting of this code to PHP. Any questions directly related to this +// * class library should be directed to me. +// * +// * License Information: +// * +// * Spreadsheet_Excel_Writer: A library for generating Excel Spreadsheets +// * Copyright (c) 2002-2003 Xavier Noguer xnoguer@rezebra.com +// * +// * This library is free software; you can redistribute it and/or +// * modify it under the terms of the GNU Lesser General Public +// * License as published by the Free Software Foundation; either +// * version 2.1 of the License, or (at your option) any later version. +// * +// * This library is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// * Lesser General Public License for more details. +// * +// * You should have received a copy of the GNU Lesser General Public +// * License along with this library; if not, write to the Free Software +// * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// */ +class PHPExcel_Writer_Excel5_BIFFwriter +{ + /** + * The byte order of this architecture. 0 => little endian, 1 => big endian + * @var integer + */ + private static $byteOrder; + + /** + * The string containing the data of the BIFF stream + * @var string + */ + public $_data; + + /** + * The size of the data in bytes. Should be the same as strlen($this->_data) + * @var integer + */ + public $_datasize; + + /** + * The maximum length for a BIFF record (excluding record header and length field). See addContinue() + * @var integer + * @see addContinue() + */ + private $limit = 8224; + + /** + * Constructor + */ + public function __construct() + { + $this->_data = ''; + $this->_datasize = 0; +// $this->limit = 8224; + } + + /** + * Determine the byte order and store it as class data to avoid + * recalculating it for each call to new(). + * + * @return int + */ + public static function getByteOrder() + { + if (!isset(self::$byteOrder)) { + // Check if "pack" gives the required IEEE 64bit float + $teststr = pack("d", 1.2345); + $number = pack("C8", 0x8D, 0x97, 0x6E, 0x12, 0x83, 0xC0, 0xF3, 0x3F); + if ($number == $teststr) { + $byte_order = 0; // Little Endian + } elseif ($number == strrev($teststr)) { + $byte_order = 1; // Big Endian + } else { + // Give up. I'll fix this in a later version. + throw new PHPExcel_Writer_Exception("Required floating point format not supported on this platform."); + } + self::$byteOrder = $byte_order; + } + + return self::$byteOrder; + } + + /** + * General storage function + * + * @param string $data binary data to append + * @access private + */ + protected function append($data) + { + if (strlen($data) - 4 > $this->limit) { + $data = $this->addContinue($data); + } + $this->_data .= $data; + $this->_datasize += strlen($data); + } + + /** + * General storage function like append, but returns string instead of modifying $this->_data + * + * @param string $data binary data to write + * @return string + */ + public function writeData($data) + { + if (strlen($data) - 4 > $this->limit) { + $data = $this->addContinue($data); + } + $this->_datasize += strlen($data); + + return $data; + } + + /** + * Writes Excel BOF record to indicate the beginning of a stream or + * sub-stream in the BIFF file. + * + * @param integer $type Type of BIFF file to write: 0x0005 Workbook, + * 0x0010 Worksheet. + * @access private + */ + protected function storeBof($type) + { + $record = 0x0809; // Record identifier (BIFF5-BIFF8) + $length = 0x0010; + + // by inspection of real files, MS Office Excel 2007 writes the following + $unknown = pack("VV", 0x000100D1, 0x00000406); + + $build = 0x0DBB; // Excel 97 + $year = 0x07CC; // Excel 97 + + $version = 0x0600; // BIFF8 + + $header = pack("vv", $record, $length); + $data = pack("vvvv", $version, $type, $build, $year); + $this->append($header . $data . $unknown); + } + + /** + * Writes Excel EOF record to indicate the end of a BIFF stream. + * + * @access private + */ + protected function storeEof() + { + $record = 0x000A; // Record identifier + $length = 0x0000; // Number of bytes to follow + + $header = pack("vv", $record, $length); + $this->append($header); + } + + /** + * Writes Excel EOF record to indicate the end of a BIFF stream. + * + * @access private + */ + public function writeEof() + { + $record = 0x000A; // Record identifier + $length = 0x0000; // Number of bytes to follow + $header = pack("vv", $record, $length); + return $this->writeData($header); + } + + /** + * Excel limits the size of BIFF records. In Excel 5 the limit is 2084 bytes. In + * Excel 97 the limit is 8228 bytes. Records that are longer than these limits + * must be split up into CONTINUE blocks. + * + * This function takes a long BIFF record and inserts CONTINUE records as + * necessary. + * + * @param string $data The original binary data to be written + * @return string A very convenient string of continue blocks + * @access private + */ + private function addContinue($data) + { + $limit = $this->limit; + $record = 0x003C; // Record identifier + + // The first 2080/8224 bytes remain intact. However, we have to change + // the length field of the record. + $tmp = substr($data, 0, 2) . pack("v", $limit) . substr($data, 4, $limit); + + $header = pack("vv", $record, $limit); // Headers for continue records + + // Retrieve chunks of 2080/8224 bytes +4 for the header. + $data_length = strlen($data); + for ($i = $limit + 4; $i < ($data_length - $limit); $i += $limit) { + $tmp .= $header; + $tmp .= substr($data, $i, $limit); + } + + // Retrieve the last chunk of data + $header = pack("vv", $record, strlen($data) - $i); + $tmp .= $header; + $tmp .= substr($data, $i, strlen($data) - $i); + + return $tmp; + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel5/Escher.php b/extend/PHPExcel/PHPExcel/Writer/Excel5/Escher.php new file mode 100644 index 0000000..c37fda9 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel5/Escher.php @@ -0,0 +1,523 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel5 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_Shared_Escher_DggContainer_BstoreContainer + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel5 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +class PHPExcel_Writer_Excel5_Escher +{ + /** + * The object we are writing + */ + private $object; + + /** + * The written binary data + */ + private $data; + + /** + * Shape offsets. Positions in binary stream where a new shape record begins + * + * @var array + */ + private $spOffsets; + + /** + * Shape types. + * + * @var array + */ + private $spTypes; + + /** + * Constructor + * + * @param mixed + */ + public function __construct($object) + { + $this->object = $object; + } + + /** + * Process the object to be written + */ + public function close() + { + // initialize + $this->data = ''; + + switch (get_class($this->object)) { + case 'PHPExcel_Shared_Escher': + if ($dggContainer = $this->object->getDggContainer()) { + $writer = new PHPExcel_Writer_Excel5_Escher($dggContainer); + $this->data = $writer->close(); + } elseif ($dgContainer = $this->object->getDgContainer()) { + $writer = new PHPExcel_Writer_Excel5_Escher($dgContainer); + $this->data = $writer->close(); + $this->spOffsets = $writer->getSpOffsets(); + $this->spTypes = $writer->getSpTypes(); + } + break; + case 'PHPExcel_Shared_Escher_DggContainer': + // this is a container record + + // initialize + $innerData = ''; + + // write the dgg + $recVer = 0x0; + $recInstance = 0x0000; + $recType = 0xF006; + + $recVerInstance = $recVer; + $recVerInstance |= $recInstance << 4; + + // dgg data + $dggData = + pack( + 'VVVV', + $this->object->getSpIdMax(), // maximum shape identifier increased by one + $this->object->getCDgSaved() + 1, // number of file identifier clusters increased by one + $this->object->getCSpSaved(), + $this->object->getCDgSaved() // count total number of drawings saved + ); + + // add file identifier clusters (one per drawing) + $IDCLs = $this->object->getIDCLs(); + + foreach ($IDCLs as $dgId => $maxReducedSpId) { + $dggData .= pack('VV', $dgId, $maxReducedSpId + 1); + } + + $header = pack('vvV', $recVerInstance, $recType, strlen($dggData)); + $innerData .= $header . $dggData; + + // write the bstoreContainer + if ($bstoreContainer = $this->object->getBstoreContainer()) { + $writer = new PHPExcel_Writer_Excel5_Escher($bstoreContainer); + $innerData .= $writer->close(); + } + + // write the record + $recVer = 0xF; + $recInstance = 0x0000; + $recType = 0xF000; + $length = strlen($innerData); + + $recVerInstance = $recVer; + $recVerInstance |= $recInstance << 4; + + $header = pack('vvV', $recVerInstance, $recType, $length); + + $this->data = $header . $innerData; + break; + case 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer': + // this is a container record + + // initialize + $innerData = ''; + + // treat the inner data + if ($BSECollection = $this->object->getBSECollection()) { + foreach ($BSECollection as $BSE) { + $writer = new PHPExcel_Writer_Excel5_Escher($BSE); + $innerData .= $writer->close(); + } + } + + // write the record + $recVer = 0xF; + $recInstance = count($this->object->getBSECollection()); + $recType = 0xF001; + $length = strlen($innerData); + + $recVerInstance = $recVer; + $recVerInstance |= $recInstance << 4; + + $header = pack('vvV', $recVerInstance, $recType, $length); + + $this->data = $header . $innerData; + break; + case 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE': + // this is a semi-container record + + // initialize + $innerData = ''; + + // here we treat the inner data + if ($blip = $this->object->getBlip()) { + $writer = new PHPExcel_Writer_Excel5_Escher($blip); + $innerData .= $writer->close(); + } + + // initialize + $data = ''; + + $btWin32 = $this->object->getBlipType(); + $btMacOS = $this->object->getBlipType(); + $data .= pack('CC', $btWin32, $btMacOS); + + $rgbUid = pack('VVVV', 0, 0, 0, 0); // todo + $data .= $rgbUid; + + $tag = 0; + $size = strlen($innerData); + $cRef = 1; + $foDelay = 0; //todo + $unused1 = 0x0; + $cbName = 0x0; + $unused2 = 0x0; + $unused3 = 0x0; + $data .= pack('vVVVCCCC', $tag, $size, $cRef, $foDelay, $unused1, $cbName, $unused2, $unused3); + + $data .= $innerData; + + // write the record + $recVer = 0x2; + $recInstance = $this->object->getBlipType(); + $recType = 0xF007; + $length = strlen($data); + + $recVerInstance = $recVer; + $recVerInstance |= $recInstance << 4; + + $header = pack('vvV', $recVerInstance, $recType, $length); + + $this->data = $header; + + $this->data .= $data; + break; + case 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip': + // this is an atom record + + // write the record + switch ($this->object->getParent()->getBlipType()) { + case PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG: + // initialize + $innerData = ''; + + $rgbUid1 = pack('VVVV', 0, 0, 0, 0); // todo + $innerData .= $rgbUid1; + + $tag = 0xFF; // todo + $innerData .= pack('C', $tag); + + $innerData .= $this->object->getData(); + + $recVer = 0x0; + $recInstance = 0x46A; + $recType = 0xF01D; + $length = strlen($innerData); + + $recVerInstance = $recVer; + $recVerInstance |= $recInstance << 4; + + $header = pack('vvV', $recVerInstance, $recType, $length); + + $this->data = $header; + + $this->data .= $innerData; + break; + + case PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG: + // initialize + $innerData = ''; + + $rgbUid1 = pack('VVVV', 0, 0, 0, 0); // todo + $innerData .= $rgbUid1; + + $tag = 0xFF; // todo + $innerData .= pack('C', $tag); + + $innerData .= $this->object->getData(); + + $recVer = 0x0; + $recInstance = 0x6E0; + $recType = 0xF01E; + $length = strlen($innerData); + + $recVerInstance = $recVer; + $recVerInstance |= $recInstance << 4; + + $header = pack('vvV', $recVerInstance, $recType, $length); + + $this->data = $header; + + $this->data .= $innerData; + break; + } + break; + case 'PHPExcel_Shared_Escher_DgContainer': + // this is a container record + + // initialize + $innerData = ''; + + // write the dg + $recVer = 0x0; + $recInstance = $this->object->getDgId(); + $recType = 0xF008; + $length = 8; + + $recVerInstance = $recVer; + $recVerInstance |= $recInstance << 4; + + $header = pack('vvV', $recVerInstance, $recType, $length); + + // number of shapes in this drawing (including group shape) + $countShapes = count($this->object->getSpgrContainer()->getChildren()); + $innerData .= $header . pack('VV', $countShapes, $this->object->getLastSpId()); + //$innerData .= $header . pack('VV', 0, 0); + + // write the spgrContainer + if ($spgrContainer = $this->object->getSpgrContainer()) { + $writer = new PHPExcel_Writer_Excel5_Escher($spgrContainer); + $innerData .= $writer->close(); + + // get the shape offsets relative to the spgrContainer record + $spOffsets = $writer->getSpOffsets(); + $spTypes = $writer->getSpTypes(); + + // save the shape offsets relative to dgContainer + foreach ($spOffsets as & $spOffset) { + $spOffset += 24; // add length of dgContainer header data (8 bytes) plus dg data (16 bytes) + } + + $this->spOffsets = $spOffsets; + $this->spTypes = $spTypes; + } + + // write the record + $recVer = 0xF; + $recInstance = 0x0000; + $recType = 0xF002; + $length = strlen($innerData); + + $recVerInstance = $recVer; + $recVerInstance |= $recInstance << 4; + + $header = pack('vvV', $recVerInstance, $recType, $length); + + $this->data = $header . $innerData; + break; + case 'PHPExcel_Shared_Escher_DgContainer_SpgrContainer': + // this is a container record + + // initialize + $innerData = ''; + + // initialize spape offsets + $totalSize = 8; + $spOffsets = array(); + $spTypes = array(); + + // treat the inner data + foreach ($this->object->getChildren() as $spContainer) { + $writer = new PHPExcel_Writer_Excel5_Escher($spContainer); + $spData = $writer->close(); + $innerData .= $spData; + + // save the shape offsets (where new shape records begin) + $totalSize += strlen($spData); + $spOffsets[] = $totalSize; + + $spTypes = array_merge($spTypes, $writer->getSpTypes()); + } + + // write the record + $recVer = 0xF; + $recInstance = 0x0000; + $recType = 0xF003; + $length = strlen($innerData); + + $recVerInstance = $recVer; + $recVerInstance |= $recInstance << 4; + + $header = pack('vvV', $recVerInstance, $recType, $length); + + $this->data = $header . $innerData; + $this->spOffsets = $spOffsets; + $this->spTypes = $spTypes; + break; + case 'PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer': + // initialize + $data = ''; + + // build the data + + // write group shape record, if necessary? + if ($this->object->getSpgr()) { + $recVer = 0x1; + $recInstance = 0x0000; + $recType = 0xF009; + $length = 0x00000010; + + $recVerInstance = $recVer; + $recVerInstance |= $recInstance << 4; + + $header = pack('vvV', $recVerInstance, $recType, $length); + + $data .= $header . pack('VVVV', 0, 0, 0, 0); + } + $this->spTypes[] = ($this->object->getSpType()); + + // write the shape record + $recVer = 0x2; + $recInstance = $this->object->getSpType(); // shape type + $recType = 0xF00A; + $length = 0x00000008; + + $recVerInstance = $recVer; + $recVerInstance |= $recInstance << 4; + + $header = pack('vvV', $recVerInstance, $recType, $length); + + $data .= $header . pack('VV', $this->object->getSpId(), $this->object->getSpgr() ? 0x0005 : 0x0A00); + + + // the options + if ($this->object->getOPTCollection()) { + $optData = ''; + + $recVer = 0x3; + $recInstance = count($this->object->getOPTCollection()); + $recType = 0xF00B; + foreach ($this->object->getOPTCollection() as $property => $value) { + $optData .= pack('vV', $property, $value); + } + $length = strlen($optData); + + $recVerInstance = $recVer; + $recVerInstance |= $recInstance << 4; + + $header = pack('vvV', $recVerInstance, $recType, $length); + $data .= $header . $optData; + } + + // the client anchor + if ($this->object->getStartCoordinates()) { + $clientAnchorData = ''; + + $recVer = 0x0; + $recInstance = 0x0; + $recType = 0xF010; + + // start coordinates + list($column, $row) = PHPExcel_Cell::coordinateFromString($this->object->getStartCoordinates()); + $c1 = PHPExcel_Cell::columnIndexFromString($column) - 1; + $r1 = $row - 1; + + // start offsetX + $startOffsetX = $this->object->getStartOffsetX(); + + // start offsetY + $startOffsetY = $this->object->getStartOffsetY(); + + // end coordinates + list($column, $row) = PHPExcel_Cell::coordinateFromString($this->object->getEndCoordinates()); + $c2 = PHPExcel_Cell::columnIndexFromString($column) - 1; + $r2 = $row - 1; + + // end offsetX + $endOffsetX = $this->object->getEndOffsetX(); + + // end offsetY + $endOffsetY = $this->object->getEndOffsetY(); + + $clientAnchorData = pack('vvvvvvvvv', $this->object->getSpFlag(), $c1, $startOffsetX, $r1, $startOffsetY, $c2, $endOffsetX, $r2, $endOffsetY); + + $length = strlen($clientAnchorData); + + $recVerInstance = $recVer; + $recVerInstance |= $recInstance << 4; + + $header = pack('vvV', $recVerInstance, $recType, $length); + $data .= $header . $clientAnchorData; + } + + // the client data, just empty for now + if (!$this->object->getSpgr()) { + $clientDataData = ''; + + $recVer = 0x0; + $recInstance = 0x0; + $recType = 0xF011; + + $length = strlen($clientDataData); + + $recVerInstance = $recVer; + $recVerInstance |= $recInstance << 4; + + $header = pack('vvV', $recVerInstance, $recType, $length); + $data .= $header . $clientDataData; + } + + // write the record + $recVer = 0xF; + $recInstance = 0x0000; + $recType = 0xF004; + $length = strlen($data); + + $recVerInstance = $recVer; + $recVerInstance |= $recInstance << 4; + + $header = pack('vvV', $recVerInstance, $recType, $length); + + $this->data = $header . $data; + break; + } + + return $this->data; + } + + /** + * Gets the shape offsets + * + * @return array + */ + public function getSpOffsets() + { + return $this->spOffsets; + } + + /** + * Gets the shape types + * + * @return array + */ + public function getSpTypes() + { + return $this->spTypes; + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel5/Font.php b/extend/PHPExcel/PHPExcel/Writer/Excel5/Font.php new file mode 100644 index 0000000..ed85ff4 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel5/Font.php @@ -0,0 +1,166 @@ +<?php + +/** + * PHPExcel_Writer_Excel5_Font + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel5 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_Excel5_Font +{ + /** + * Color index + * + * @var int + */ + private $colorIndex; + + /** + * Font + * + * @var PHPExcel_Style_Font + */ + private $font; + + /** + * Constructor + * + * @param PHPExcel_Style_Font $font + */ + public function __construct(PHPExcel_Style_Font $font = null) + { + $this->colorIndex = 0x7FFF; + $this->font = $font; + } + + /** + * Set the color index + * + * @param int $colorIndex + */ + public function setColorIndex($colorIndex) + { + $this->colorIndex = $colorIndex; + } + + /** + * Get font record data + * + * @return string + */ + public function writeFont() + { + $font_outline = 0; + $font_shadow = 0; + + $icv = $this->colorIndex; // Index to color palette + if ($this->font->getSuperScript()) { + $sss = 1; + } elseif ($this->font->getSubScript()) { + $sss = 2; + } else { + $sss = 0; + } + $bFamily = 0; // Font family + $bCharSet = PHPExcel_Shared_Font::getCharsetFromFontName($this->font->getName()); // Character set + + $record = 0x31; // Record identifier + $reserved = 0x00; // Reserved + $grbit = 0x00; // Font attributes + if ($this->font->getItalic()) { + $grbit |= 0x02; + } + if ($this->font->getStrikethrough()) { + $grbit |= 0x08; + } + if ($font_outline) { + $grbit |= 0x10; + } + if ($font_shadow) { + $grbit |= 0x20; + } + + $data = pack( + "vvvvvCCCC", + // Fontsize (in twips) + $this->font->getSize() * 20, + $grbit, + // Colour + $icv, + // Font weight + self::mapBold($this->font->getBold()), + // Superscript/Subscript + $sss, + self::mapUnderline($this->font->getUnderline()), + $bFamily, + $bCharSet, + $reserved + ); + $data .= PHPExcel_Shared_String::UTF8toBIFF8UnicodeShort($this->font->getName()); + + $length = strlen($data); + $header = pack("vv", $record, $length); + + return($header . $data); + } + + /** + * Map to BIFF5-BIFF8 codes for bold + * + * @param boolean $bold + * @return int + */ + private static function mapBold($bold) + { + if ($bold) { + return 0x2BC; // 700 = Bold font weight + } + return 0x190; // 400 = Normal font weight + } + + /** + * Map of BIFF2-BIFF8 codes for underline styles + * @static array of int + * + */ + private static $mapUnderline = array( + PHPExcel_Style_Font::UNDERLINE_NONE => 0x00, + PHPExcel_Style_Font::UNDERLINE_SINGLE => 0x01, + PHPExcel_Style_Font::UNDERLINE_DOUBLE => 0x02, + PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING => 0x21, + PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING => 0x22, + ); + + /** + * Map underline + * + * @param string + * @return int + */ + private static function mapUnderline($underline) + { + if (isset(self::$mapUnderline[$underline])) { + return self::$mapUnderline[$underline]; + } + return 0x00; + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel5/Parser.php b/extend/PHPExcel/PHPExcel/Writer/Excel5/Parser.php new file mode 100644 index 0000000..0cf1c1d --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel5/Parser.php @@ -0,0 +1,1531 @@ +<?php + +/** + * PHPExcel_Writer_Excel5_Parser + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel5 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + +// Original file header of PEAR::Spreadsheet_Excel_Writer_Parser (used as the base for this class): +// ----------------------------------------------------------------------------------------- +// * Class for parsing Excel formulas +// * +// * License Information: +// * +// * Spreadsheet_Excel_Writer: A library for generating Excel Spreadsheets +// * Copyright (c) 2002-2003 Xavier Noguer xnoguer@rezebra.com +// * +// * This library is free software; you can redistribute it and/or +// * modify it under the terms of the GNU Lesser General Public +// * License as published by the Free Software Foundation; either +// * version 2.1 of the License, or (at your option) any later version. +// * +// * This library is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// * Lesser General Public License for more details. +// * +// * You should have received a copy of the GNU Lesser General Public +// * License along with this library; if not, write to the Free Software +// * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// */ +class PHPExcel_Writer_Excel5_Parser +{ + /** Constants */ + // Sheet title in unquoted form + // Invalid sheet title characters cannot occur in the sheet title: + // *:/\?[] + // Moreover, there are valid sheet title characters that cannot occur in unquoted form (there may be more?) + // +-% '^&<>=,;#()"{} + const REGEX_SHEET_TITLE_UNQUOTED = '[^\*\:\/\\\\\?\[\]\+\-\% \\\'\^\&\<\>\=\,\;\#\(\)\"\{\}]+'; + + // Sheet title in quoted form (without surrounding quotes) + // Invalid sheet title characters cannot occur in the sheet title: + // *:/\?[] (usual invalid sheet title characters) + // Single quote is represented as a pair '' + const REGEX_SHEET_TITLE_QUOTED = '(([^\*\:\/\\\\\?\[\]\\\'])+|(\\\'\\\')+)+'; + + /** + * The index of the character we are currently looking at + * @var integer + */ + public $currentCharacter; + + /** + * The token we are working on. + * @var string + */ + public $currentToken; + + /** + * The formula to parse + * @var string + */ + private $formula; + + /** + * The character ahead of the current char + * @var string + */ + public $lookAhead; + + /** + * The parse tree to be generated + * @var string + */ + private $parseTree; + + /** + * Array of external sheets + * @var array + */ + private $externalSheets; + + /** + * Array of sheet references in the form of REF structures + * @var array + */ + public $references; + + /** + * The class constructor + * + */ + public function __construct() + { + $this->currentCharacter = 0; + $this->currentToken = ''; // The token we are working on. + $this->formula = ''; // The formula to parse. + $this->lookAhead = ''; // The character ahead of the current char. + $this->parseTree = ''; // The parse tree to be generated. + $this->initializeHashes(); // Initialize the hashes: ptg's and function's ptg's + $this->externalSheets = array(); + $this->references = array(); + } + + /** + * Initialize the ptg and function hashes. + * + * @access private + */ + private function initializeHashes() + { + // The Excel ptg indices + $this->ptg = array( + 'ptgExp' => 0x01, + 'ptgTbl' => 0x02, + 'ptgAdd' => 0x03, + 'ptgSub' => 0x04, + 'ptgMul' => 0x05, + 'ptgDiv' => 0x06, + 'ptgPower' => 0x07, + 'ptgConcat' => 0x08, + 'ptgLT' => 0x09, + 'ptgLE' => 0x0A, + 'ptgEQ' => 0x0B, + 'ptgGE' => 0x0C, + 'ptgGT' => 0x0D, + 'ptgNE' => 0x0E, + 'ptgIsect' => 0x0F, + 'ptgUnion' => 0x10, + 'ptgRange' => 0x11, + 'ptgUplus' => 0x12, + 'ptgUminus' => 0x13, + 'ptgPercent' => 0x14, + 'ptgParen' => 0x15, + 'ptgMissArg' => 0x16, + 'ptgStr' => 0x17, + 'ptgAttr' => 0x19, + 'ptgSheet' => 0x1A, + 'ptgEndSheet' => 0x1B, + 'ptgErr' => 0x1C, + 'ptgBool' => 0x1D, + 'ptgInt' => 0x1E, + 'ptgNum' => 0x1F, + 'ptgArray' => 0x20, + 'ptgFunc' => 0x21, + 'ptgFuncVar' => 0x22, + 'ptgName' => 0x23, + 'ptgRef' => 0x24, + 'ptgArea' => 0x25, + 'ptgMemArea' => 0x26, + 'ptgMemErr' => 0x27, + 'ptgMemNoMem' => 0x28, + 'ptgMemFunc' => 0x29, + 'ptgRefErr' => 0x2A, + 'ptgAreaErr' => 0x2B, + 'ptgRefN' => 0x2C, + 'ptgAreaN' => 0x2D, + 'ptgMemAreaN' => 0x2E, + 'ptgMemNoMemN' => 0x2F, + 'ptgNameX' => 0x39, + 'ptgRef3d' => 0x3A, + 'ptgArea3d' => 0x3B, + 'ptgRefErr3d' => 0x3C, + 'ptgAreaErr3d' => 0x3D, + 'ptgArrayV' => 0x40, + 'ptgFuncV' => 0x41, + 'ptgFuncVarV' => 0x42, + 'ptgNameV' => 0x43, + 'ptgRefV' => 0x44, + 'ptgAreaV' => 0x45, + 'ptgMemAreaV' => 0x46, + 'ptgMemErrV' => 0x47, + 'ptgMemNoMemV' => 0x48, + 'ptgMemFuncV' => 0x49, + 'ptgRefErrV' => 0x4A, + 'ptgAreaErrV' => 0x4B, + 'ptgRefNV' => 0x4C, + 'ptgAreaNV' => 0x4D, + 'ptgMemAreaNV' => 0x4E, + 'ptgMemNoMemN' => 0x4F, + 'ptgFuncCEV' => 0x58, + 'ptgNameXV' => 0x59, + 'ptgRef3dV' => 0x5A, + 'ptgArea3dV' => 0x5B, + 'ptgRefErr3dV' => 0x5C, + 'ptgAreaErr3d' => 0x5D, + 'ptgArrayA' => 0x60, + 'ptgFuncA' => 0x61, + 'ptgFuncVarA' => 0x62, + 'ptgNameA' => 0x63, + 'ptgRefA' => 0x64, + 'ptgAreaA' => 0x65, + 'ptgMemAreaA' => 0x66, + 'ptgMemErrA' => 0x67, + 'ptgMemNoMemA' => 0x68, + 'ptgMemFuncA' => 0x69, + 'ptgRefErrA' => 0x6A, + 'ptgAreaErrA' => 0x6B, + 'ptgRefNA' => 0x6C, + 'ptgAreaNA' => 0x6D, + 'ptgMemAreaNA' => 0x6E, + 'ptgMemNoMemN' => 0x6F, + 'ptgFuncCEA' => 0x78, + 'ptgNameXA' => 0x79, + 'ptgRef3dA' => 0x7A, + 'ptgArea3dA' => 0x7B, + 'ptgRefErr3dA' => 0x7C, + 'ptgAreaErr3d' => 0x7D + ); + + // Thanks to Michael Meeks and Gnumeric for the initial arg values. + // + // The following hash was generated by "function_locale.pl" in the distro. + // Refer to function_locale.pl for non-English function names. + // + // The array elements are as follow: + // ptg: The Excel function ptg code. + // args: The number of arguments that the function takes: + // >=0 is a fixed number of arguments. + // -1 is a variable number of arguments. + // class: The reference, value or array class of the function args. + // vol: The function is volatile. + // + $this->functions = array( + // function ptg args class vol + 'COUNT' => array( 0, -1, 0, 0 ), + 'IF' => array( 1, -1, 1, 0 ), + 'ISNA' => array( 2, 1, 1, 0 ), + 'ISERROR' => array( 3, 1, 1, 0 ), + 'SUM' => array( 4, -1, 0, 0 ), + 'AVERAGE' => array( 5, -1, 0, 0 ), + 'MIN' => array( 6, -1, 0, 0 ), + 'MAX' => array( 7, -1, 0, 0 ), + 'ROW' => array( 8, -1, 0, 0 ), + 'COLUMN' => array( 9, -1, 0, 0 ), + 'NA' => array( 10, 0, 0, 0 ), + 'NPV' => array( 11, -1, 1, 0 ), + 'STDEV' => array( 12, -1, 0, 0 ), + 'DOLLAR' => array( 13, -1, 1, 0 ), + 'FIXED' => array( 14, -1, 1, 0 ), + 'SIN' => array( 15, 1, 1, 0 ), + 'COS' => array( 16, 1, 1, 0 ), + 'TAN' => array( 17, 1, 1, 0 ), + 'ATAN' => array( 18, 1, 1, 0 ), + 'PI' => array( 19, 0, 1, 0 ), + 'SQRT' => array( 20, 1, 1, 0 ), + 'EXP' => array( 21, 1, 1, 0 ), + 'LN' => array( 22, 1, 1, 0 ), + 'LOG10' => array( 23, 1, 1, 0 ), + 'ABS' => array( 24, 1, 1, 0 ), + 'INT' => array( 25, 1, 1, 0 ), + 'SIGN' => array( 26, 1, 1, 0 ), + 'ROUND' => array( 27, 2, 1, 0 ), + 'LOOKUP' => array( 28, -1, 0, 0 ), + 'INDEX' => array( 29, -1, 0, 1 ), + 'REPT' => array( 30, 2, 1, 0 ), + 'MID' => array( 31, 3, 1, 0 ), + 'LEN' => array( 32, 1, 1, 0 ), + 'VALUE' => array( 33, 1, 1, 0 ), + 'TRUE' => array( 34, 0, 1, 0 ), + 'FALSE' => array( 35, 0, 1, 0 ), + 'AND' => array( 36, -1, 0, 0 ), + 'OR' => array( 37, -1, 0, 0 ), + 'NOT' => array( 38, 1, 1, 0 ), + 'MOD' => array( 39, 2, 1, 0 ), + 'DCOUNT' => array( 40, 3, 0, 0 ), + 'DSUM' => array( 41, 3, 0, 0 ), + 'DAVERAGE' => array( 42, 3, 0, 0 ), + 'DMIN' => array( 43, 3, 0, 0 ), + 'DMAX' => array( 44, 3, 0, 0 ), + 'DSTDEV' => array( 45, 3, 0, 0 ), + 'VAR' => array( 46, -1, 0, 0 ), + 'DVAR' => array( 47, 3, 0, 0 ), + 'TEXT' => array( 48, 2, 1, 0 ), + 'LINEST' => array( 49, -1, 0, 0 ), + 'TREND' => array( 50, -1, 0, 0 ), + 'LOGEST' => array( 51, -1, 0, 0 ), + 'GROWTH' => array( 52, -1, 0, 0 ), + 'PV' => array( 56, -1, 1, 0 ), + 'FV' => array( 57, -1, 1, 0 ), + 'NPER' => array( 58, -1, 1, 0 ), + 'PMT' => array( 59, -1, 1, 0 ), + 'RATE' => array( 60, -1, 1, 0 ), + 'MIRR' => array( 61, 3, 0, 0 ), + 'IRR' => array( 62, -1, 0, 0 ), + 'RAND' => array( 63, 0, 1, 1 ), + 'MATCH' => array( 64, -1, 0, 0 ), + 'DATE' => array( 65, 3, 1, 0 ), + 'TIME' => array( 66, 3, 1, 0 ), + 'DAY' => array( 67, 1, 1, 0 ), + 'MONTH' => array( 68, 1, 1, 0 ), + 'YEAR' => array( 69, 1, 1, 0 ), + 'WEEKDAY' => array( 70, -1, 1, 0 ), + 'HOUR' => array( 71, 1, 1, 0 ), + 'MINUTE' => array( 72, 1, 1, 0 ), + 'SECOND' => array( 73, 1, 1, 0 ), + 'NOW' => array( 74, 0, 1, 1 ), + 'AREAS' => array( 75, 1, 0, 1 ), + 'ROWS' => array( 76, 1, 0, 1 ), + 'COLUMNS' => array( 77, 1, 0, 1 ), + 'OFFSET' => array( 78, -1, 0, 1 ), + 'SEARCH' => array( 82, -1, 1, 0 ), + 'TRANSPOSE' => array( 83, 1, 1, 0 ), + 'TYPE' => array( 86, 1, 1, 0 ), + 'ATAN2' => array( 97, 2, 1, 0 ), + 'ASIN' => array( 98, 1, 1, 0 ), + 'ACOS' => array( 99, 1, 1, 0 ), + 'CHOOSE' => array( 100, -1, 1, 0 ), + 'HLOOKUP' => array( 101, -1, 0, 0 ), + 'VLOOKUP' => array( 102, -1, 0, 0 ), + 'ISREF' => array( 105, 1, 0, 0 ), + 'LOG' => array( 109, -1, 1, 0 ), + 'CHAR' => array( 111, 1, 1, 0 ), + 'LOWER' => array( 112, 1, 1, 0 ), + 'UPPER' => array( 113, 1, 1, 0 ), + 'PROPER' => array( 114, 1, 1, 0 ), + 'LEFT' => array( 115, -1, 1, 0 ), + 'RIGHT' => array( 116, -1, 1, 0 ), + 'EXACT' => array( 117, 2, 1, 0 ), + 'TRIM' => array( 118, 1, 1, 0 ), + 'REPLACE' => array( 119, 4, 1, 0 ), + 'SUBSTITUTE' => array( 120, -1, 1, 0 ), + 'CODE' => array( 121, 1, 1, 0 ), + 'FIND' => array( 124, -1, 1, 0 ), + 'CELL' => array( 125, -1, 0, 1 ), + 'ISERR' => array( 126, 1, 1, 0 ), + 'ISTEXT' => array( 127, 1, 1, 0 ), + 'ISNUMBER' => array( 128, 1, 1, 0 ), + 'ISBLANK' => array( 129, 1, 1, 0 ), + 'T' => array( 130, 1, 0, 0 ), + 'N' => array( 131, 1, 0, 0 ), + 'DATEVALUE' => array( 140, 1, 1, 0 ), + 'TIMEVALUE' => array( 141, 1, 1, 0 ), + 'SLN' => array( 142, 3, 1, 0 ), + 'SYD' => array( 143, 4, 1, 0 ), + 'DDB' => array( 144, -1, 1, 0 ), + 'INDIRECT' => array( 148, -1, 1, 1 ), + 'CALL' => array( 150, -1, 1, 0 ), + 'CLEAN' => array( 162, 1, 1, 0 ), + 'MDETERM' => array( 163, 1, 2, 0 ), + 'MINVERSE' => array( 164, 1, 2, 0 ), + 'MMULT' => array( 165, 2, 2, 0 ), + 'IPMT' => array( 167, -1, 1, 0 ), + 'PPMT' => array( 168, -1, 1, 0 ), + 'COUNTA' => array( 169, -1, 0, 0 ), + 'PRODUCT' => array( 183, -1, 0, 0 ), + 'FACT' => array( 184, 1, 1, 0 ), + 'DPRODUCT' => array( 189, 3, 0, 0 ), + 'ISNONTEXT' => array( 190, 1, 1, 0 ), + 'STDEVP' => array( 193, -1, 0, 0 ), + 'VARP' => array( 194, -1, 0, 0 ), + 'DSTDEVP' => array( 195, 3, 0, 0 ), + 'DVARP' => array( 196, 3, 0, 0 ), + 'TRUNC' => array( 197, -1, 1, 0 ), + 'ISLOGICAL' => array( 198, 1, 1, 0 ), + 'DCOUNTA' => array( 199, 3, 0, 0 ), + 'USDOLLAR' => array( 204, -1, 1, 0 ), + 'FINDB' => array( 205, -1, 1, 0 ), + 'SEARCHB' => array( 206, -1, 1, 0 ), + 'REPLACEB' => array( 207, 4, 1, 0 ), + 'LEFTB' => array( 208, -1, 1, 0 ), + 'RIGHTB' => array( 209, -1, 1, 0 ), + 'MIDB' => array( 210, 3, 1, 0 ), + 'LENB' => array( 211, 1, 1, 0 ), + 'ROUNDUP' => array( 212, 2, 1, 0 ), + 'ROUNDDOWN' => array( 213, 2, 1, 0 ), + 'ASC' => array( 214, 1, 1, 0 ), + 'DBCS' => array( 215, 1, 1, 0 ), + 'RANK' => array( 216, -1, 0, 0 ), + 'ADDRESS' => array( 219, -1, 1, 0 ), + 'DAYS360' => array( 220, -1, 1, 0 ), + 'TODAY' => array( 221, 0, 1, 1 ), + 'VDB' => array( 222, -1, 1, 0 ), + 'MEDIAN' => array( 227, -1, 0, 0 ), + 'SUMPRODUCT' => array( 228, -1, 2, 0 ), + 'SINH' => array( 229, 1, 1, 0 ), + 'COSH' => array( 230, 1, 1, 0 ), + 'TANH' => array( 231, 1, 1, 0 ), + 'ASINH' => array( 232, 1, 1, 0 ), + 'ACOSH' => array( 233, 1, 1, 0 ), + 'ATANH' => array( 234, 1, 1, 0 ), + 'DGET' => array( 235, 3, 0, 0 ), + 'INFO' => array( 244, 1, 1, 1 ), + 'DB' => array( 247, -1, 1, 0 ), + 'FREQUENCY' => array( 252, 2, 0, 0 ), + 'ERROR.TYPE' => array( 261, 1, 1, 0 ), + 'REGISTER.ID' => array( 267, -1, 1, 0 ), + 'AVEDEV' => array( 269, -1, 0, 0 ), + 'BETADIST' => array( 270, -1, 1, 0 ), + 'GAMMALN' => array( 271, 1, 1, 0 ), + 'BETAINV' => array( 272, -1, 1, 0 ), + 'BINOMDIST' => array( 273, 4, 1, 0 ), + 'CHIDIST' => array( 274, 2, 1, 0 ), + 'CHIINV' => array( 275, 2, 1, 0 ), + 'COMBIN' => array( 276, 2, 1, 0 ), + 'CONFIDENCE' => array( 277, 3, 1, 0 ), + 'CRITBINOM' => array( 278, 3, 1, 0 ), + 'EVEN' => array( 279, 1, 1, 0 ), + 'EXPONDIST' => array( 280, 3, 1, 0 ), + 'FDIST' => array( 281, 3, 1, 0 ), + 'FINV' => array( 282, 3, 1, 0 ), + 'FISHER' => array( 283, 1, 1, 0 ), + 'FISHERINV' => array( 284, 1, 1, 0 ), + 'FLOOR' => array( 285, 2, 1, 0 ), + 'GAMMADIST' => array( 286, 4, 1, 0 ), + 'GAMMAINV' => array( 287, 3, 1, 0 ), + 'CEILING' => array( 288, 2, 1, 0 ), + 'HYPGEOMDIST' => array( 289, 4, 1, 0 ), + 'LOGNORMDIST' => array( 290, 3, 1, 0 ), + 'LOGINV' => array( 291, 3, 1, 0 ), + 'NEGBINOMDIST' => array( 292, 3, 1, 0 ), + 'NORMDIST' => array( 293, 4, 1, 0 ), + 'NORMSDIST' => array( 294, 1, 1, 0 ), + 'NORMINV' => array( 295, 3, 1, 0 ), + 'NORMSINV' => array( 296, 1, 1, 0 ), + 'STANDARDIZE' => array( 297, 3, 1, 0 ), + 'ODD' => array( 298, 1, 1, 0 ), + 'PERMUT' => array( 299, 2, 1, 0 ), + 'POISSON' => array( 300, 3, 1, 0 ), + 'TDIST' => array( 301, 3, 1, 0 ), + 'WEIBULL' => array( 302, 4, 1, 0 ), + 'SUMXMY2' => array( 303, 2, 2, 0 ), + 'SUMX2MY2' => array( 304, 2, 2, 0 ), + 'SUMX2PY2' => array( 305, 2, 2, 0 ), + 'CHITEST' => array( 306, 2, 2, 0 ), + 'CORREL' => array( 307, 2, 2, 0 ), + 'COVAR' => array( 308, 2, 2, 0 ), + 'FORECAST' => array( 309, 3, 2, 0 ), + 'FTEST' => array( 310, 2, 2, 0 ), + 'INTERCEPT' => array( 311, 2, 2, 0 ), + 'PEARSON' => array( 312, 2, 2, 0 ), + 'RSQ' => array( 313, 2, 2, 0 ), + 'STEYX' => array( 314, 2, 2, 0 ), + 'SLOPE' => array( 315, 2, 2, 0 ), + 'TTEST' => array( 316, 4, 2, 0 ), + 'PROB' => array( 317, -1, 2, 0 ), + 'DEVSQ' => array( 318, -1, 0, 0 ), + 'GEOMEAN' => array( 319, -1, 0, 0 ), + 'HARMEAN' => array( 320, -1, 0, 0 ), + 'SUMSQ' => array( 321, -1, 0, 0 ), + 'KURT' => array( 322, -1, 0, 0 ), + 'SKEW' => array( 323, -1, 0, 0 ), + 'ZTEST' => array( 324, -1, 0, 0 ), + 'LARGE' => array( 325, 2, 0, 0 ), + 'SMALL' => array( 326, 2, 0, 0 ), + 'QUARTILE' => array( 327, 2, 0, 0 ), + 'PERCENTILE' => array( 328, 2, 0, 0 ), + 'PERCENTRANK' => array( 329, -1, 0, 0 ), + 'MODE' => array( 330, -1, 2, 0 ), + 'TRIMMEAN' => array( 331, 2, 0, 0 ), + 'TINV' => array( 332, 2, 1, 0 ), + 'CONCATENATE' => array( 336, -1, 1, 0 ), + 'POWER' => array( 337, 2, 1, 0 ), + 'RADIANS' => array( 342, 1, 1, 0 ), + 'DEGREES' => array( 343, 1, 1, 0 ), + 'SUBTOTAL' => array( 344, -1, 0, 0 ), + 'SUMIF' => array( 345, -1, 0, 0 ), + 'COUNTIF' => array( 346, 2, 0, 0 ), + 'COUNTBLANK' => array( 347, 1, 0, 0 ), + 'ISPMT' => array( 350, 4, 1, 0 ), + 'DATEDIF' => array( 351, 3, 1, 0 ), + 'DATESTRING' => array( 352, 1, 1, 0 ), + 'NUMBERSTRING' => array( 353, 2, 1, 0 ), + 'ROMAN' => array( 354, -1, 1, 0 ), + 'GETPIVOTDATA' => array( 358, -1, 0, 0 ), + 'HYPERLINK' => array( 359, -1, 1, 0 ), + 'PHONETIC' => array( 360, 1, 0, 0 ), + 'AVERAGEA' => array( 361, -1, 0, 0 ), + 'MAXA' => array( 362, -1, 0, 0 ), + 'MINA' => array( 363, -1, 0, 0 ), + 'STDEVPA' => array( 364, -1, 0, 0 ), + 'VARPA' => array( 365, -1, 0, 0 ), + 'STDEVA' => array( 366, -1, 0, 0 ), + 'VARA' => array( 367, -1, 0, 0 ), + 'BAHTTEXT' => array( 368, 1, 0, 0 ), + ); + } + + /** + * Convert a token to the proper ptg value. + * + * @access private + * @param mixed $token The token to convert. + * @return mixed the converted token on success + */ + private function convert($token) + { + if (preg_match("/\"([^\"]|\"\"){0,255}\"/", $token)) { + return $this->convertString($token); + + } elseif (is_numeric($token)) { + return $this->convertNumber($token); + + // match references like A1 or $A$1 + } elseif (preg_match('/^\$?([A-Ia-i]?[A-Za-z])\$?(\d+)$/', $token)) { + return $this->convertRef2d($token); + + // match external references like Sheet1!A1 or Sheet1:Sheet2!A1 or Sheet1!$A$1 or Sheet1:Sheet2!$A$1 + } elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?[A-Ia-i]?[A-Za-z]\\$?(\d+)$/u", $token)) { + return $this->convertRef3d($token); + + // match external references like 'Sheet1'!A1 or 'Sheet1:Sheet2'!A1 or 'Sheet1'!$A$1 or 'Sheet1:Sheet2'!$A$1 + } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?[A-Ia-i]?[A-Za-z]\\$?(\d+)$/u", $token)) { + return $this->convertRef3d($token); + + // match ranges like A1:B2 or $A$1:$B$2 + } elseif (preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?(\d+)\:(\$)?[A-Ia-i]?[A-Za-z](\$)?(\d+)$/', $token)) { + return $this->convertRange2d($token); + + // match external ranges like Sheet1!A1:B2 or Sheet1:Sheet2!A1:B2 or Sheet1!$A$1:$B$2 or Sheet1:Sheet2!$A$1:$B$2 + } elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?(\d+)\:\\$?([A-Ia-i]?[A-Za-z])?\\$?(\d+)$/u", $token)) { + return $this->convertRange3d($token); + + // match external ranges like 'Sheet1'!A1:B2 or 'Sheet1:Sheet2'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1:Sheet2'!$A$1:$B$2 + } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?(\d+)\:\\$?([A-Ia-i]?[A-Za-z])?\\$?(\d+)$/u", $token)) { + return $this->convertRange3d($token); + + // operators (including parentheses) + } elseif (isset($this->ptg[$token])) { + return pack("C", $this->ptg[$token]); + + // match error codes + } elseif (preg_match("/^#[A-Z0\/]{3,5}[!?]{1}$/", $token) or $token == '#N/A') { + return $this->convertError($token); + + // commented so argument number can be processed correctly. See toReversePolish(). + /*elseif (preg_match("/[A-Z0-9\xc0-\xdc\.]+/", $token)) + { + return($this->convertFunction($token, $this->_func_args)); + }*/ + + // if it's an argument, ignore the token (the argument remains) + } elseif ($token == 'arg') { + return ''; + } + + // TODO: use real error codes + throw new PHPExcel_Writer_Exception("Unknown token $token"); + } + + /** + * Convert a number token to ptgInt or ptgNum + * + * @access private + * @param mixed $num an integer or double for conversion to its ptg value + */ + private function convertNumber($num) + { + // Integer in the range 0..2**16-1 + if ((preg_match("/^\d+$/", $num)) and ($num <= 65535)) { + return pack("Cv", $this->ptg['ptgInt'], $num); + } else { // A float + if (PHPExcel_Writer_Excel5_BIFFwriter::getByteOrder()) { // if it's Big Endian + $num = strrev($num); + } + return pack("Cd", $this->ptg['ptgNum'], $num); + } + } + + /** + * Convert a string token to ptgStr + * + * @access private + * @param string $string A string for conversion to its ptg value. + * @return mixed the converted token on success + */ + private function convertString($string) + { + // chop away beggining and ending quotes + $string = substr($string, 1, strlen($string) - 2); + if (strlen($string) > 255) { + throw new PHPExcel_Writer_Exception("String is too long"); + } + + return pack('C', $this->ptg['ptgStr']) . PHPExcel_Shared_String::UTF8toBIFF8UnicodeShort($string); + } + + /** + * Convert a function to a ptgFunc or ptgFuncVarV depending on the number of + * args that it takes. + * + * @access private + * @param string $token The name of the function for convertion to ptg value. + * @param integer $num_args The number of arguments the function receives. + * @return string The packed ptg for the function + */ + private function convertFunction($token, $num_args) + { + $args = $this->functions[$token][1]; +// $volatile = $this->functions[$token][3]; + + // Fixed number of args eg. TIME($i, $j, $k). + if ($args >= 0) { + return pack("Cv", $this->ptg['ptgFuncV'], $this->functions[$token][0]); + } + // Variable number of args eg. SUM($i, $j, $k, ..). + if ($args == -1) { + return pack("CCv", $this->ptg['ptgFuncVarV'], $num_args, $this->functions[$token][0]); + } + } + + /** + * Convert an Excel range such as A1:D4 to a ptgRefV. + * + * @access private + * @param string $range An Excel range in the A1:A2 + * @param int $class + */ + private function convertRange2d($range, $class = 0) + { + + // TODO: possible class value 0,1,2 check Formula.pm + // Split the range into 2 cell refs + if (preg_match('/^(\$)?([A-Ia-i]?[A-Za-z])(\$)?(\d+)\:(\$)?([A-Ia-i]?[A-Za-z])(\$)?(\d+)$/', $range)) { + list($cell1, $cell2) = explode(':', $range); + } else { + // TODO: use real error codes + throw new PHPExcel_Writer_Exception("Unknown range separator"); + } + + // Convert the cell references + list($row1, $col1) = $this->cellToPackedRowcol($cell1); + list($row2, $col2) = $this->cellToPackedRowcol($cell2); + + // The ptg value depends on the class of the ptg. + if ($class == 0) { + $ptgArea = pack("C", $this->ptg['ptgArea']); + } elseif ($class == 1) { + $ptgArea = pack("C", $this->ptg['ptgAreaV']); + } elseif ($class == 2) { + $ptgArea = pack("C", $this->ptg['ptgAreaA']); + } else { + // TODO: use real error codes + throw new PHPExcel_Writer_Exception("Unknown class $class"); + } + return $ptgArea . $row1 . $row2 . $col1. $col2; + } + + /** + * Convert an Excel 3d range such as "Sheet1!A1:D4" or "Sheet1:Sheet2!A1:D4" to + * a ptgArea3d. + * + * @access private + * @param string $token An Excel range in the Sheet1!A1:A2 format. + * @return mixed The packed ptgArea3d token on success. + */ + private function convertRange3d($token) + { +// $class = 0; // formulas like Sheet1!$A$1:$A$2 in list type data validation need this class (0x3B) + + // Split the ref at the ! symbol + list($ext_ref, $range) = explode('!', $token); + + // Convert the external reference part (different for BIFF8) + $ext_ref = $this->getRefIndex($ext_ref); + + // Split the range into 2 cell refs + list($cell1, $cell2) = explode(':', $range); + + // Convert the cell references + if (preg_match("/^(\\$)?[A-Ia-i]?[A-Za-z](\\$)?(\d+)$/", $cell1)) { + list($row1, $col1) = $this->cellToPackedRowcol($cell1); + list($row2, $col2) = $this->cellToPackedRowcol($cell2); + } else { // It's a rows range (like 26:27) + list($row1, $col1, $row2, $col2) = $this->rangeToPackedRange($cell1.':'.$cell2); + } + + // The ptg value depends on the class of the ptg. +// if ($class == 0) { + $ptgArea = pack("C", $this->ptg['ptgArea3d']); +// } elseif ($class == 1) { +// $ptgArea = pack("C", $this->ptg['ptgArea3dV']); +// } elseif ($class == 2) { +// $ptgArea = pack("C", $this->ptg['ptgArea3dA']); +// } else { +// throw new PHPExcel_Writer_Exception("Unknown class $class"); +// } + + return $ptgArea . $ext_ref . $row1 . $row2 . $col1. $col2; + } + + /** + * Convert an Excel reference such as A1, $B2, C$3 or $D$4 to a ptgRefV. + * + * @access private + * @param string $cell An Excel cell reference + * @return string The cell in packed() format with the corresponding ptg + */ + private function convertRef2d($cell) + { +// $class = 2; // as far as I know, this is magick. + + // Convert the cell reference + $cell_array = $this->cellToPackedRowcol($cell); + list($row, $col) = $cell_array; + + // The ptg value depends on the class of the ptg. +// if ($class == 0) { +// $ptgRef = pack("C", $this->ptg['ptgRef']); +// } elseif ($class == 1) { +// $ptgRef = pack("C", $this->ptg['ptgRefV']); +// } elseif ($class == 2) { + $ptgRef = pack("C", $this->ptg['ptgRefA']); +// } else { +// // TODO: use real error codes +// throw new PHPExcel_Writer_Exception("Unknown class $class"); +// } + return $ptgRef.$row.$col; + } + + /** + * Convert an Excel 3d reference such as "Sheet1!A1" or "Sheet1:Sheet2!A1" to a + * ptgRef3d. + * + * @access private + * @param string $cell An Excel cell reference + * @return mixed The packed ptgRef3d token on success. + */ + private function convertRef3d($cell) + { +// $class = 2; // as far as I know, this is magick. + + // Split the ref at the ! symbol + list($ext_ref, $cell) = explode('!', $cell); + + // Convert the external reference part (different for BIFF8) + $ext_ref = $this->getRefIndex($ext_ref); + + // Convert the cell reference part + list($row, $col) = $this->cellToPackedRowcol($cell); + + // The ptg value depends on the class of the ptg. +// if ($class == 0) { +// $ptgRef = pack("C", $this->ptg['ptgRef3d']); +// } elseif ($class == 1) { +// $ptgRef = pack("C", $this->ptg['ptgRef3dV']); +// } elseif ($class == 2) { + $ptgRef = pack("C", $this->ptg['ptgRef3dA']); +// } else { +// throw new PHPExcel_Writer_Exception("Unknown class $class"); +// } + + return $ptgRef . $ext_ref. $row . $col; + } + + /** + * Convert an error code to a ptgErr + * + * @access private + * @param string $errorCode The error code for conversion to its ptg value + * @return string The error code ptgErr + */ + private function convertError($errorCode) + { + switch ($errorCode) { + case '#NULL!': + return pack("C", 0x00); + case '#DIV/0!': + return pack("C", 0x07); + case '#VALUE!': + return pack("C", 0x0F); + case '#REF!': + return pack("C", 0x17); + case '#NAME?': + return pack("C", 0x1D); + case '#NUM!': + return pack("C", 0x24); + case '#N/A': + return pack("C", 0x2A); + } + return pack("C", 0xFF); + } + + /** + * Convert the sheet name part of an external reference, for example "Sheet1" or + * "Sheet1:Sheet2", to a packed structure. + * + * @access private + * @param string $ext_ref The name of the external reference + * @return string The reference index in packed() format + */ + private function packExtRef($ext_ref) + { + $ext_ref = preg_replace("/^'/", '', $ext_ref); // Remove leading ' if any. + $ext_ref = preg_replace("/'$/", '', $ext_ref); // Remove trailing ' if any. + + // Check if there is a sheet range eg., Sheet1:Sheet2. + if (preg_match("/:/", $ext_ref)) { + list($sheet_name1, $sheet_name2) = explode(':', $ext_ref); + + $sheet1 = $this->getSheetIndex($sheet_name1); + if ($sheet1 == -1) { + throw new PHPExcel_Writer_Exception("Unknown sheet name $sheet_name1 in formula"); + } + $sheet2 = $this->getSheetIndex($sheet_name2); + if ($sheet2 == -1) { + throw new PHPExcel_Writer_Exception("Unknown sheet name $sheet_name2 in formula"); + } + + // Reverse max and min sheet numbers if necessary + if ($sheet1 > $sheet2) { + list($sheet1, $sheet2) = array($sheet2, $sheet1); + } + } else { // Single sheet name only. + $sheet1 = $this->getSheetIndex($ext_ref); + if ($sheet1 == -1) { + throw new PHPExcel_Writer_Exception("Unknown sheet name $ext_ref in formula"); + } + $sheet2 = $sheet1; + } + + // References are stored relative to 0xFFFF. + $offset = -1 - $sheet1; + + return pack('vdvv', $offset, 0x00, $sheet1, $sheet2); + } + + /** + * Look up the REF index that corresponds to an external sheet name + * (or range). If it doesn't exist yet add it to the workbook's references + * array. It assumes all sheet names given must exist. + * + * @access private + * @param string $ext_ref The name of the external reference + * @return mixed The reference index in packed() format on success + */ + private function getRefIndex($ext_ref) + { + $ext_ref = preg_replace("/^'/", '', $ext_ref); // Remove leading ' if any. + $ext_ref = preg_replace("/'$/", '', $ext_ref); // Remove trailing ' if any. + $ext_ref = str_replace('\'\'', '\'', $ext_ref); // Replace escaped '' with ' + + // Check if there is a sheet range eg., Sheet1:Sheet2. + if (preg_match("/:/", $ext_ref)) { + list($sheet_name1, $sheet_name2) = explode(':', $ext_ref); + + $sheet1 = $this->getSheetIndex($sheet_name1); + if ($sheet1 == -1) { + throw new PHPExcel_Writer_Exception("Unknown sheet name $sheet_name1 in formula"); + } + $sheet2 = $this->getSheetIndex($sheet_name2); + if ($sheet2 == -1) { + throw new PHPExcel_Writer_Exception("Unknown sheet name $sheet_name2 in formula"); + } + + // Reverse max and min sheet numbers if necessary + if ($sheet1 > $sheet2) { + list($sheet1, $sheet2) = array($sheet2, $sheet1); + } + } else { // Single sheet name only. + $sheet1 = $this->getSheetIndex($ext_ref); + if ($sheet1 == -1) { + throw new PHPExcel_Writer_Exception("Unknown sheet name $ext_ref in formula"); + } + $sheet2 = $sheet1; + } + + // assume all references belong to this document + $supbook_index = 0x00; + $ref = pack('vvv', $supbook_index, $sheet1, $sheet2); + $totalreferences = count($this->references); + $index = -1; + for ($i = 0; $i < $totalreferences; ++$i) { + if ($ref == $this->references[$i]) { + $index = $i; + break; + } + } + // if REF was not found add it to references array + if ($index == -1) { + $this->references[$totalreferences] = $ref; + $index = $totalreferences; + } + + return pack('v', $index); + } + + /** + * Look up the index that corresponds to an external sheet name. The hash of + * sheet names is updated by the addworksheet() method of the + * PHPExcel_Writer_Excel5_Workbook class. + * + * @access private + * @param string $sheet_name Sheet name + * @return integer The sheet index, -1 if the sheet was not found + */ + private function getSheetIndex($sheet_name) + { + if (!isset($this->externalSheets[$sheet_name])) { + return -1; + } else { + return $this->externalSheets[$sheet_name]; + } + } + + /** + * This method is used to update the array of sheet names. It is + * called by the addWorksheet() method of the + * PHPExcel_Writer_Excel5_Workbook class. + * + * @access public + * @see PHPExcel_Writer_Excel5_Workbook::addWorksheet() + * @param string $name The name of the worksheet being added + * @param integer $index The index of the worksheet being added + */ + public function setExtSheet($name, $index) + { + $this->externalSheets[$name] = $index; + } + + /** + * pack() row and column into the required 3 or 4 byte format. + * + * @access private + * @param string $cell The Excel cell reference to be packed + * @return array Array containing the row and column in packed() format + */ + private function cellToPackedRowcol($cell) + { + $cell = strtoupper($cell); + list($row, $col, $row_rel, $col_rel) = $this->cellToRowcol($cell); + if ($col >= 256) { + throw new PHPExcel_Writer_Exception("Column in: $cell greater than 255"); + } + if ($row >= 65536) { + throw new PHPExcel_Writer_Exception("Row in: $cell greater than 65536 "); + } + + // Set the high bits to indicate if row or col are relative. + $col |= $col_rel << 14; + $col |= $row_rel << 15; + $col = pack('v', $col); + + $row = pack('v', $row); + + return array($row, $col); + } + + /** + * pack() row range into the required 3 or 4 byte format. + * Just using maximum col/rows, which is probably not the correct solution + * + * @access private + * @param string $range The Excel range to be packed + * @return array Array containing (row1,col1,row2,col2) in packed() format + */ + private function rangeToPackedRange($range) + { + preg_match('/(\$)?(\d+)\:(\$)?(\d+)/', $range, $match); + // return absolute rows if there is a $ in the ref + $row1_rel = empty($match[1]) ? 1 : 0; + $row1 = $match[2]; + $row2_rel = empty($match[3]) ? 1 : 0; + $row2 = $match[4]; + // Convert 1-index to zero-index + --$row1; + --$row2; + // Trick poor inocent Excel + $col1 = 0; + $col2 = 65535; // FIXME: maximum possible value for Excel 5 (change this!!!) + + // FIXME: this changes for BIFF8 + if (($row1 >= 65536) or ($row2 >= 65536)) { + throw new PHPExcel_Writer_Exception("Row in: $range greater than 65536 "); + } + + // Set the high bits to indicate if rows are relative. + $col1 |= $row1_rel << 15; + $col2 |= $row2_rel << 15; + $col1 = pack('v', $col1); + $col2 = pack('v', $col2); + + $row1 = pack('v', $row1); + $row2 = pack('v', $row2); + + return array($row1, $col1, $row2, $col2); + } + + /** + * Convert an Excel cell reference such as A1 or $B2 or C$3 or $D$4 to a zero + * indexed row and column number. Also returns two (0,1) values to indicate + * whether the row or column are relative references. + * + * @access private + * @param string $cell The Excel cell reference in A1 format. + * @return array + */ + private function cellToRowcol($cell) + { + preg_match('/(\$)?([A-I]?[A-Z])(\$)?(\d+)/', $cell, $match); + // return absolute column if there is a $ in the ref + $col_rel = empty($match[1]) ? 1 : 0; + $col_ref = $match[2]; + $row_rel = empty($match[3]) ? 1 : 0; + $row = $match[4]; + + // Convert base26 column string to a number. + $expn = strlen($col_ref) - 1; + $col = 0; + $col_ref_length = strlen($col_ref); + for ($i = 0; $i < $col_ref_length; ++$i) { + $col += (ord($col_ref{$i}) - 64) * pow(26, $expn); + --$expn; + } + + // Convert 1-index to zero-index + --$row; + --$col; + + return array($row, $col, $row_rel, $col_rel); + } + + /** + * Advance to the next valid token. + * + * @access private + */ + private function advance() + { + $i = $this->currentCharacter; + $formula_length = strlen($this->formula); + // eat up white spaces + if ($i < $formula_length) { + while ($this->formula{$i} == " ") { + ++$i; + } + + if ($i < ($formula_length - 1)) { + $this->lookAhead = $this->formula{$i+1}; + } + $token = ''; + } + + while ($i < $formula_length) { + $token .= $this->formula{$i}; + + if ($i < ($formula_length - 1)) { + $this->lookAhead = $this->formula{$i+1}; + } else { + $this->lookAhead = ''; + } + + if ($this->match($token) != '') { + //if ($i < strlen($this->formula) - 1) { + // $this->lookAhead = $this->formula{$i+1}; + //} + $this->currentCharacter = $i + 1; + $this->currentToken = $token; + return 1; + } + + if ($i < ($formula_length - 2)) { + $this->lookAhead = $this->formula{$i+2}; + } else { // if we run out of characters lookAhead becomes empty + $this->lookAhead = ''; + } + ++$i; + } + //die("Lexical error ".$this->currentCharacter); + } + + /** + * Checks if it's a valid token. + * + * @access private + * @param mixed $token The token to check. + * @return mixed The checked token or false on failure + */ + private function match($token) + { + switch ($token) { + case "+": + case "-": + case "*": + case "/": + case "(": + case ")": + case ",": + case ";": + case ">=": + case "<=": + case "=": + case "<>": + case "^": + case "&": + case "%": + return $token; + break; + case ">": + if ($this->lookAhead == '=') { // it's a GE token + break; + } + return $token; + break; + case "<": + // it's a LE or a NE token + if (($this->lookAhead == '=') or ($this->lookAhead == '>')) { + break; + } + return $token; + break; + default: + // if it's a reference A1 or $A$1 or $A1 or A$1 + if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?[0-9]+$/', $token) and !preg_match("/[0-9]/", $this->lookAhead) and ($this->lookAhead != ':') and ($this->lookAhead != '.') and ($this->lookAhead != '!')) { + return $token; + } elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $token) and !preg_match("/[0-9]/", $this->lookAhead) and ($this->lookAhead != ':') and ($this->lookAhead != '.')) { + // If it's an external reference (Sheet1!A1 or Sheet1:Sheet2!A1 or Sheet1!$A$1 or Sheet1:Sheet2!$A$1) + return $token; + } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $token) and !preg_match("/[0-9]/", $this->lookAhead) and ($this->lookAhead != ':') and ($this->lookAhead != '.')) { + // If it's an external reference ('Sheet1'!A1 or 'Sheet1:Sheet2'!A1 or 'Sheet1'!$A$1 or 'Sheet1:Sheet2'!$A$1) + return $token; + } elseif (preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/', $token) && !preg_match("/[0-9]/", $this->lookAhead)) { + // if it's a range A1:A2 or $A$1:$A$2 + return $token; + } elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $token) and !preg_match("/[0-9]/", $this->lookAhead)) { + // If it's an external range like Sheet1!A1:B2 or Sheet1:Sheet2!A1:B2 or Sheet1!$A$1:$B$2 or Sheet1:Sheet2!$A$1:$B$2 + return $token; + } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $token) and !preg_match("/[0-9]/", $this->lookAhead)) { + // If it's an external range like 'Sheet1'!A1:B2 or 'Sheet1:Sheet2'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1:Sheet2'!$A$1:$B$2 + return $token; + } elseif (is_numeric($token) and (!is_numeric($token.$this->lookAhead) or ($this->lookAhead == '')) and ($this->lookAhead != '!') and ($this->lookAhead != ':')) { + // If it's a number (check that it's not a sheet name or range) + return $token; + } elseif (preg_match("/\"([^\"]|\"\"){0,255}\"/", $token) and $this->lookAhead != '"' and (substr_count($token, '"')%2 == 0)) { + // If it's a string (of maximum 255 characters) + return $token; + } elseif (preg_match("/^#[A-Z0\/]{3,5}[!?]{1}$/", $token) or $token == '#N/A') { + // If it's an error code + return $token; + } elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i", $token) and ($this->lookAhead == "(")) { + // if it's a function call + return $token; + } elseif (substr($token, -1) == ')') { + // It's an argument of some description (e.g. a named range), + // precise nature yet to be determined + return $token; + } + return ''; + } + } + + /** + * The parsing method. It parses a formula. + * + * @access public + * @param string $formula The formula to parse, without the initial equal + * sign (=). + * @return mixed true on success + */ + public function parse($formula) + { + $this->currentCharacter = 0; + $this->formula = $formula; + $this->lookAhead = isset($formula{1}) ? $formula{1} : ''; + $this->advance(); + $this->parseTree = $this->condition(); + return true; + } + + /** + * It parses a condition. It assumes the following rule: + * Cond -> Expr [(">" | "<") Expr] + * + * @access private + * @return mixed The parsed ptg'd tree on success + */ + private function condition() + { + $result = $this->expression(); + if ($this->currentToken == "<") { + $this->advance(); + $result2 = $this->expression(); + $result = $this->createTree('ptgLT', $result, $result2); + } elseif ($this->currentToken == ">") { + $this->advance(); + $result2 = $this->expression(); + $result = $this->createTree('ptgGT', $result, $result2); + } elseif ($this->currentToken == "<=") { + $this->advance(); + $result2 = $this->expression(); + $result = $this->createTree('ptgLE', $result, $result2); + } elseif ($this->currentToken == ">=") { + $this->advance(); + $result2 = $this->expression(); + $result = $this->createTree('ptgGE', $result, $result2); + } elseif ($this->currentToken == "=") { + $this->advance(); + $result2 = $this->expression(); + $result = $this->createTree('ptgEQ', $result, $result2); + } elseif ($this->currentToken == "<>") { + $this->advance(); + $result2 = $this->expression(); + $result = $this->createTree('ptgNE', $result, $result2); + } elseif ($this->currentToken == "&") { + $this->advance(); + $result2 = $this->expression(); + $result = $this->createTree('ptgConcat', $result, $result2); + } + return $result; + } + + /** + * It parses a expression. It assumes the following rule: + * Expr -> Term [("+" | "-") Term] + * -> "string" + * -> "-" Term : Negative value + * -> "+" Term : Positive value + * -> Error code + * + * @access private + * @return mixed The parsed ptg'd tree on success + */ + private function expression() + { + // If it's a string return a string node + if (preg_match("/\"([^\"]|\"\"){0,255}\"/", $this->currentToken)) { + $tmp = str_replace('""', '"', $this->currentToken); + if (($tmp == '"') || ($tmp == '')) { + // Trap for "" that has been used for an empty string + $tmp = '""'; + } + $result = $this->createTree($tmp, '', ''); + $this->advance(); + return $result; + // If it's an error code + } elseif (preg_match("/^#[A-Z0\/]{3,5}[!?]{1}$/", $this->currentToken) or $this->currentToken == '#N/A') { + $result = $this->createTree($this->currentToken, 'ptgErr', ''); + $this->advance(); + return $result; + // If it's a negative value + } elseif ($this->currentToken == "-") { + // catch "-" Term + $this->advance(); + $result2 = $this->expression(); + $result = $this->createTree('ptgUminus', $result2, ''); + return $result; + // If it's a positive value + } elseif ($this->currentToken == "+") { + // catch "+" Term + $this->advance(); + $result2 = $this->expression(); + $result = $this->createTree('ptgUplus', $result2, ''); + return $result; + } + $result = $this->term(); + while (($this->currentToken == "+") or + ($this->currentToken == "-") or + ($this->currentToken == "^")) { + /**/ + if ($this->currentToken == "+") { + $this->advance(); + $result2 = $this->term(); + $result = $this->createTree('ptgAdd', $result, $result2); + } elseif ($this->currentToken == "-") { + $this->advance(); + $result2 = $this->term(); + $result = $this->createTree('ptgSub', $result, $result2); + } else { + $this->advance(); + $result2 = $this->term(); + $result = $this->createTree('ptgPower', $result, $result2); + } + } + return $result; + } + + /** + * This function just introduces a ptgParen element in the tree, so that Excel + * doesn't get confused when working with a parenthesized formula afterwards. + * + * @access private + * @see fact() + * @return array The parsed ptg'd tree + */ + private function parenthesizedExpression() + { + $result = $this->createTree('ptgParen', $this->expression(), ''); + return $result; + } + + /** + * It parses a term. It assumes the following rule: + * Term -> Fact [("*" | "/") Fact] + * + * @access private + * @return mixed The parsed ptg'd tree on success + */ + private function term() + { + $result = $this->fact(); + while (($this->currentToken == "*") or + ($this->currentToken == "/")) { + /**/ + if ($this->currentToken == "*") { + $this->advance(); + $result2 = $this->fact(); + $result = $this->createTree('ptgMul', $result, $result2); + } else { + $this->advance(); + $result2 = $this->fact(); + $result = $this->createTree('ptgDiv', $result, $result2); + } + } + return $result; + } + + /** + * It parses a factor. It assumes the following rule: + * Fact -> ( Expr ) + * | CellRef + * | CellRange + * | Number + * | Function + * + * @access private + * @return mixed The parsed ptg'd tree on success + */ + private function fact() + { + if ($this->currentToken == "(") { + $this->advance(); // eat the "(" + $result = $this->parenthesizedExpression(); + if ($this->currentToken != ")") { + throw new PHPExcel_Writer_Exception("')' token expected."); + } + $this->advance(); // eat the ")" + return $result; + } + // if it's a reference + if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?[0-9]+$/', $this->currentToken)) { + $result = $this->createTree($this->currentToken, '', ''); + $this->advance(); + return $result; + } elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $this->currentToken)) { + // If it's an external reference (Sheet1!A1 or Sheet1:Sheet2!A1 or Sheet1!$A$1 or Sheet1:Sheet2!$A$1) + $result = $this->createTree($this->currentToken, '', ''); + $this->advance(); + return $result; + } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $this->currentToken)) { + // If it's an external reference ('Sheet1'!A1 or 'Sheet1:Sheet2'!A1 or 'Sheet1'!$A$1 or 'Sheet1:Sheet2'!$A$1) + $result = $this->createTree($this->currentToken, '', ''); + $this->advance(); + return $result; + } elseif (preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/', $this->currentToken) or + preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+\.\.(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/', $this->currentToken)) { + // if it's a range A1:B2 or $A$1:$B$2 + // must be an error? + $result = $this->createTree($this->currentToken, '', ''); + $this->advance(); + return $result; + } elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $this->currentToken)) { + // If it's an external range (Sheet1!A1:B2 or Sheet1:Sheet2!A1:B2 or Sheet1!$A$1:$B$2 or Sheet1:Sheet2!$A$1:$B$2) + // must be an error? + //$result = $this->currentToken; + $result = $this->createTree($this->currentToken, '', ''); + $this->advance(); + return $result; + } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $this->currentToken)) { + // If it's an external range ('Sheet1'!A1:B2 or 'Sheet1'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1'!$A$1:$B$2) + // must be an error? + //$result = $this->currentToken; + $result = $this->createTree($this->currentToken, '', ''); + $this->advance(); + return $result; + } elseif (is_numeric($this->currentToken)) { + // If it's a number or a percent + if ($this->lookAhead == '%') { + $result = $this->createTree('ptgPercent', $this->currentToken, ''); + $this->advance(); // Skip the percentage operator once we've pre-built that tree + } else { + $result = $this->createTree($this->currentToken, '', ''); + } + $this->advance(); + return $result; + } elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i", $this->currentToken)) { + // if it's a function call + $result = $this->func(); + return $result; + } + throw new PHPExcel_Writer_Exception("Syntax error: ".$this->currentToken.", lookahead: ".$this->lookAhead.", current char: ".$this->currentCharacter); + } + + /** + * It parses a function call. It assumes the following rule: + * Func -> ( Expr [,Expr]* ) + * + * @access private + * @return mixed The parsed ptg'd tree on success + */ + private function func() + { + $num_args = 0; // number of arguments received + $function = strtoupper($this->currentToken); + $result = ''; // initialize result + $this->advance(); + $this->advance(); // eat the "(" + while ($this->currentToken != ')') { + /**/ + if ($num_args > 0) { + if ($this->currentToken == "," || $this->currentToken == ";") { + $this->advance(); // eat the "," or ";" + } else { + throw new PHPExcel_Writer_Exception("Syntax error: comma expected in function $function, arg #{$num_args}"); + } + $result2 = $this->condition(); + $result = $this->createTree('arg', $result, $result2); + } else { // first argument + $result2 = $this->condition(); + $result = $this->createTree('arg', '', $result2); + } + ++$num_args; + } + if (!isset($this->functions[$function])) { + throw new PHPExcel_Writer_Exception("Function $function() doesn't exist"); + } + $args = $this->functions[$function][1]; + // If fixed number of args eg. TIME($i, $j, $k). Check that the number of args is valid. + if (($args >= 0) and ($args != $num_args)) { + throw new PHPExcel_Writer_Exception("Incorrect number of arguments in function $function() "); + } + + $result = $this->createTree($function, $result, $num_args); + $this->advance(); // eat the ")" + return $result; + } + + /** + * Creates a tree. In fact an array which may have one or two arrays (sub-trees) + * as elements. + * + * @access private + * @param mixed $value The value of this node. + * @param mixed $left The left array (sub-tree) or a final node. + * @param mixed $right The right array (sub-tree) or a final node. + * @return array A tree + */ + private function createTree($value, $left, $right) + { + return array('value' => $value, 'left' => $left, 'right' => $right); + } + + /** + * Builds a string containing the tree in reverse polish notation (What you + * would use in a HP calculator stack). + * The following tree: + * + * + + * / \ + * 2 3 + * + * produces: "23+" + * + * The following tree: + * + * + + * / \ + * 3 * + * / \ + * 6 A1 + * + * produces: "36A1*+" + * + * In fact all operands, functions, references, etc... are written as ptg's + * + * @access public + * @param array $tree The optional tree to convert. + * @return string The tree in reverse polish notation + */ + public function toReversePolish($tree = array()) + { + $polish = ""; // the string we are going to return + if (empty($tree)) { // If it's the first call use parseTree + $tree = $this->parseTree; + } + + if (is_array($tree['left'])) { + $converted_tree = $this->toReversePolish($tree['left']); + $polish .= $converted_tree; + } elseif ($tree['left'] != '') { // It's a final node + $converted_tree = $this->convert($tree['left']); + $polish .= $converted_tree; + } + if (is_array($tree['right'])) { + $converted_tree = $this->toReversePolish($tree['right']); + $polish .= $converted_tree; + } elseif ($tree['right'] != '') { // It's a final node + $converted_tree = $this->convert($tree['right']); + $polish .= $converted_tree; + } + // if it's a function convert it here (so we can set it's arguments) + if (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/", $tree['value']) and + !preg_match('/^([A-Ia-i]?[A-Za-z])(\d+)$/', $tree['value']) and + !preg_match("/^[A-Ia-i]?[A-Za-z](\d+)\.\.[A-Ia-i]?[A-Za-z](\d+)$/", $tree['value']) and + !is_numeric($tree['value']) and + !isset($this->ptg[$tree['value']])) { + // left subtree for a function is always an array. + if ($tree['left'] != '') { + $left_tree = $this->toReversePolish($tree['left']); + } else { + $left_tree = ''; + } + // add it's left subtree and return. + return $left_tree.$this->convertFunction($tree['value'], $tree['right']); + } else { + $converted_tree = $this->convert($tree['value']); + } + $polish .= $converted_tree; + return $polish; + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel5/Workbook.php b/extend/PHPExcel/PHPExcel/Writer/Excel5/Workbook.php new file mode 100644 index 0000000..8b06843 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel5/Workbook.php @@ -0,0 +1,1444 @@ +<?php + +/** + * PHPExcel_Writer_Excel5_Workbook + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel5 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + +// Original file header of PEAR::Spreadsheet_Excel_Writer_Workbook (used as the base for this class): +// ----------------------------------------------------------------------------------------- +// /* +// * Module written/ported by Xavier Noguer <xnoguer@rezebra.com> +// * +// * The majority of this is _NOT_ my code. I simply ported it from the +// * PERL Spreadsheet::WriteExcel module. +// * +// * The author of the Spreadsheet::WriteExcel module is John McNamara +// * <jmcnamara@cpan.org> +// * +// * I _DO_ maintain this code, and John McNamara has nothing to do with the +// * porting of this code to PHP. Any questions directly related to this +// * class library should be directed to me. +// * +// * License Information: +// * +// * Spreadsheet_Excel_Writer: A library for generating Excel Spreadsheets +// * Copyright (c) 2002-2003 Xavier Noguer xnoguer@rezebra.com +// * +// * This library is free software; you can redistribute it and/or +// * modify it under the terms of the GNU Lesser General Public +// * License as published by the Free Software Foundation; either +// * version 2.1 of the License, or (at your option) any later version. +// * +// * This library is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// * Lesser General Public License for more details. +// * +// * You should have received a copy of the GNU Lesser General Public +// * License along with this library; if not, write to the Free Software +// * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// */ +class PHPExcel_Writer_Excel5_Workbook extends PHPExcel_Writer_Excel5_BIFFwriter +{ + /** + * Formula parser + * + * @var PHPExcel_Writer_Excel5_Parser + */ + private $parser; + + /** + * The BIFF file size for the workbook. + * @var integer + * @see calcSheetOffsets() + */ + private $biffSize; + + /** + * XF Writers + * @var PHPExcel_Writer_Excel5_Xf[] + */ + private $xfWriters = array(); + + /** + * Array containing the colour palette + * @var array + */ + private $palette; + + /** + * The codepage indicates the text encoding used for strings + * @var integer + */ + private $codepage; + + /** + * The country code used for localization + * @var integer + */ + private $countryCode; + + /** + * Workbook + * @var PHPExcel + */ + private $phpExcel; + + /** + * Fonts writers + * + * @var PHPExcel_Writer_Excel5_Font[] + */ + private $fontWriters = array(); + + /** + * Added fonts. Maps from font's hash => index in workbook + * + * @var array + */ + private $addedFonts = array(); + + /** + * Shared number formats + * + * @var array + */ + private $numberFormats = array(); + + /** + * Added number formats. Maps from numberFormat's hash => index in workbook + * + * @var array + */ + private $addedNumberFormats = array(); + + /** + * Sizes of the binary worksheet streams + * + * @var array + */ + private $worksheetSizes = array(); + + /** + * Offsets of the binary worksheet streams relative to the start of the global workbook stream + * + * @var array + */ + private $worksheetOffsets = array(); + + /** + * Total number of shared strings in workbook + * + * @var int + */ + private $stringTotal; + + /** + * Number of unique shared strings in workbook + * + * @var int + */ + private $stringUnique; + + /** + * Array of unique shared strings in workbook + * + * @var array + */ + private $stringTable; + + /** + * Color cache + */ + private $colors; + + /** + * Escher object corresponding to MSODRAWINGGROUP + * + * @var PHPExcel_Shared_Escher + */ + private $escher; + + + /** + * Class constructor + * + * @param PHPExcel $phpExcel The Workbook + * @param int &$str_total Total number of strings + * @param int &$str_unique Total number of unique strings + * @param array &$str_table String Table + * @param array &$colors Colour Table + * @param mixed $parser The formula parser created for the Workbook + */ + public function __construct(PHPExcel $phpExcel = null, &$str_total, &$str_unique, &$str_table, &$colors, $parser) + { + // It needs to call its parent's constructor explicitly + parent::__construct(); + + $this->parser = $parser; + $this->biffSize = 0; + $this->palette = array(); + $this->countryCode = -1; + + $this->stringTotal = &$str_total; + $this->stringUnique = &$str_unique; + $this->stringTable = &$str_table; + $this->colors = &$colors; + $this->setPaletteXl97(); + + $this->phpExcel = $phpExcel; + + // set BIFFwriter limit for CONTINUE records + // $this->_limit = 8224; + $this->codepage = 0x04B0; + + // Add empty sheets and Build color cache + $countSheets = $phpExcel->getSheetCount(); + for ($i = 0; $i < $countSheets; ++$i) { + $phpSheet = $phpExcel->getSheet($i); + + $this->parser->setExtSheet($phpSheet->getTitle(), $i); // Register worksheet name with parser + + $supbook_index = 0x00; + $ref = pack('vvv', $supbook_index, $i, $i); + $this->parser->references[] = $ref; // Register reference with parser + + // Sheet tab colors? + if ($phpSheet->isTabColorSet()) { + $this->addColor($phpSheet->getTabColor()->getRGB()); + } + } + + } + + /** + * Add a new XF writer + * + * @param PHPExcel_Style + * @param boolean Is it a style XF? + * @return int Index to XF record + */ + public function addXfWriter($style, $isStyleXf = false) + { + $xfWriter = new PHPExcel_Writer_Excel5_Xf($style); + $xfWriter->setIsStyleXf($isStyleXf); + + // Add the font if not already added + $fontIndex = $this->addFont($style->getFont()); + + // Assign the font index to the xf record + $xfWriter->setFontIndex($fontIndex); + + // Background colors, best to treat these after the font so black will come after white in custom palette + $xfWriter->setFgColor($this->addColor($style->getFill()->getStartColor()->getRGB())); + $xfWriter->setBgColor($this->addColor($style->getFill()->getEndColor()->getRGB())); + $xfWriter->setBottomColor($this->addColor($style->getBorders()->getBottom()->getColor()->getRGB())); + $xfWriter->setTopColor($this->addColor($style->getBorders()->getTop()->getColor()->getRGB())); + $xfWriter->setRightColor($this->addColor($style->getBorders()->getRight()->getColor()->getRGB())); + $xfWriter->setLeftColor($this->addColor($style->getBorders()->getLeft()->getColor()->getRGB())); + $xfWriter->setDiagColor($this->addColor($style->getBorders()->getDiagonal()->getColor()->getRGB())); + + // Add the number format if it is not a built-in one and not already added + if ($style->getNumberFormat()->getBuiltInFormatCode() === false) { + $numberFormatHashCode = $style->getNumberFormat()->getHashCode(); + + if (isset($this->addedNumberFormats[$numberFormatHashCode])) { + $numberFormatIndex = $this->addedNumberFormats[$numberFormatHashCode]; + } else { + $numberFormatIndex = 164 + count($this->numberFormats); + $this->numberFormats[$numberFormatIndex] = $style->getNumberFormat(); + $this->addedNumberFormats[$numberFormatHashCode] = $numberFormatIndex; + } + } else { + $numberFormatIndex = (int) $style->getNumberFormat()->getBuiltInFormatCode(); + } + + // Assign the number format index to xf record + $xfWriter->setNumberFormatIndex($numberFormatIndex); + + $this->xfWriters[] = $xfWriter; + + $xfIndex = count($this->xfWriters) - 1; + return $xfIndex; + } + + /** + * Add a font to added fonts + * + * @param PHPExcel_Style_Font $font + * @return int Index to FONT record + */ + public function addFont(PHPExcel_Style_Font $font) + { + $fontHashCode = $font->getHashCode(); + if (isset($this->addedFonts[$fontHashCode])) { + $fontIndex = $this->addedFonts[$fontHashCode]; + } else { + $countFonts = count($this->fontWriters); + $fontIndex = ($countFonts < 4) ? $countFonts : $countFonts + 1; + + $fontWriter = new PHPExcel_Writer_Excel5_Font($font); + $fontWriter->setColorIndex($this->addColor($font->getColor()->getRGB())); + $this->fontWriters[] = $fontWriter; + + $this->addedFonts[$fontHashCode] = $fontIndex; + } + return $fontIndex; + } + + /** + * Alter color palette adding a custom color + * + * @param string $rgb E.g. 'FF00AA' + * @return int Color index + */ + private function addColor($rgb) + { + if (!isset($this->colors[$rgb])) { + if (count($this->colors) < 57) { + // then we add a custom color altering the palette + $colorIndex = 8 + count($this->colors); + $this->palette[$colorIndex] = + array( + hexdec(substr($rgb, 0, 2)), + hexdec(substr($rgb, 2, 2)), + hexdec(substr($rgb, 4)), + 0 + ); + $this->colors[$rgb] = $colorIndex; + } else { + // no room for more custom colors, just map to black + $colorIndex = 0; + } + } else { + // fetch already added custom color + $colorIndex = $this->colors[$rgb]; + } + + return $colorIndex; + } + + /** + * Sets the colour palette to the Excel 97+ default. + * + * @access private + */ + private function setPaletteXl97() + { + $this->palette = array( + 0x08 => array(0x00, 0x00, 0x00, 0x00), + 0x09 => array(0xff, 0xff, 0xff, 0x00), + 0x0A => array(0xff, 0x00, 0x00, 0x00), + 0x0B => array(0x00, 0xff, 0x00, 0x00), + 0x0C => array(0x00, 0x00, 0xff, 0x00), + 0x0D => array(0xff, 0xff, 0x00, 0x00), + 0x0E => array(0xff, 0x00, 0xff, 0x00), + 0x0F => array(0x00, 0xff, 0xff, 0x00), + 0x10 => array(0x80, 0x00, 0x00, 0x00), + 0x11 => array(0x00, 0x80, 0x00, 0x00), + 0x12 => array(0x00, 0x00, 0x80, 0x00), + 0x13 => array(0x80, 0x80, 0x00, 0x00), + 0x14 => array(0x80, 0x00, 0x80, 0x00), + 0x15 => array(0x00, 0x80, 0x80, 0x00), + 0x16 => array(0xc0, 0xc0, 0xc0, 0x00), + 0x17 => array(0x80, 0x80, 0x80, 0x00), + 0x18 => array(0x99, 0x99, 0xff, 0x00), + 0x19 => array(0x99, 0x33, 0x66, 0x00), + 0x1A => array(0xff, 0xff, 0xcc, 0x00), + 0x1B => array(0xcc, 0xff, 0xff, 0x00), + 0x1C => array(0x66, 0x00, 0x66, 0x00), + 0x1D => array(0xff, 0x80, 0x80, 0x00), + 0x1E => array(0x00, 0x66, 0xcc, 0x00), + 0x1F => array(0xcc, 0xcc, 0xff, 0x00), + 0x20 => array(0x00, 0x00, 0x80, 0x00), + 0x21 => array(0xff, 0x00, 0xff, 0x00), + 0x22 => array(0xff, 0xff, 0x00, 0x00), + 0x23 => array(0x00, 0xff, 0xff, 0x00), + 0x24 => array(0x80, 0x00, 0x80, 0x00), + 0x25 => array(0x80, 0x00, 0x00, 0x00), + 0x26 => array(0x00, 0x80, 0x80, 0x00), + 0x27 => array(0x00, 0x00, 0xff, 0x00), + 0x28 => array(0x00, 0xcc, 0xff, 0x00), + 0x29 => array(0xcc, 0xff, 0xff, 0x00), + 0x2A => array(0xcc, 0xff, 0xcc, 0x00), + 0x2B => array(0xff, 0xff, 0x99, 0x00), + 0x2C => array(0x99, 0xcc, 0xff, 0x00), + 0x2D => array(0xff, 0x99, 0xcc, 0x00), + 0x2E => array(0xcc, 0x99, 0xff, 0x00), + 0x2F => array(0xff, 0xcc, 0x99, 0x00), + 0x30 => array(0x33, 0x66, 0xff, 0x00), + 0x31 => array(0x33, 0xcc, 0xcc, 0x00), + 0x32 => array(0x99, 0xcc, 0x00, 0x00), + 0x33 => array(0xff, 0xcc, 0x00, 0x00), + 0x34 => array(0xff, 0x99, 0x00, 0x00), + 0x35 => array(0xff, 0x66, 0x00, 0x00), + 0x36 => array(0x66, 0x66, 0x99, 0x00), + 0x37 => array(0x96, 0x96, 0x96, 0x00), + 0x38 => array(0x00, 0x33, 0x66, 0x00), + 0x39 => array(0x33, 0x99, 0x66, 0x00), + 0x3A => array(0x00, 0x33, 0x00, 0x00), + 0x3B => array(0x33, 0x33, 0x00, 0x00), + 0x3C => array(0x99, 0x33, 0x00, 0x00), + 0x3D => array(0x99, 0x33, 0x66, 0x00), + 0x3E => array(0x33, 0x33, 0x99, 0x00), + 0x3F => array(0x33, 0x33, 0x33, 0x00), + ); + } + + /** + * Assemble worksheets into a workbook and send the BIFF data to an OLE + * storage. + * + * @param array $pWorksheetSizes The sizes in bytes of the binary worksheet streams + * @return string Binary data for workbook stream + */ + public function writeWorkbook($pWorksheetSizes = null) + { + $this->worksheetSizes = $pWorksheetSizes; + + // Calculate the number of selected worksheet tabs and call the finalization + // methods for each worksheet + $total_worksheets = $this->phpExcel->getSheetCount(); + + // Add part 1 of the Workbook globals, what goes before the SHEET records + $this->storeBof(0x0005); + $this->writeCodepage(); + $this->writeWindow1(); + + $this->writeDateMode(); + $this->writeAllFonts(); + $this->writeAllNumberFormats(); + $this->writeAllXfs(); + $this->writeAllStyles(); + $this->writePalette(); + + // Prepare part 3 of the workbook global stream, what goes after the SHEET records + $part3 = ''; + if ($this->countryCode != -1) { + $part3 .= $this->writeCountry(); + } + $part3 .= $this->writeRecalcId(); + + $part3 .= $this->writeSupbookInternal(); + /* TODO: store external SUPBOOK records and XCT and CRN records + in case of external references for BIFF8 */ + $part3 .= $this->writeExternalsheetBiff8(); + $part3 .= $this->writeAllDefinedNamesBiff8(); + $part3 .= $this->writeMsoDrawingGroup(); + $part3 .= $this->writeSharedStringsTable(); + + $part3 .= $this->writeEof(); + + // Add part 2 of the Workbook globals, the SHEET records + $this->calcSheetOffsets(); + for ($i = 0; $i < $total_worksheets; ++$i) { + $this->writeBoundSheet($this->phpExcel->getSheet($i), $this->worksheetOffsets[$i]); + } + + // Add part 3 of the Workbook globals + $this->_data .= $part3; + + return $this->_data; + } + + /** + * Calculate offsets for Worksheet BOF records. + * + * @access private + */ + private function calcSheetOffsets() + { + $boundsheet_length = 10; // fixed length for a BOUNDSHEET record + + // size of Workbook globals part 1 + 3 + $offset = $this->_datasize; + + // add size of Workbook globals part 2, the length of the SHEET records + $total_worksheets = count($this->phpExcel->getAllSheets()); + foreach ($this->phpExcel->getWorksheetIterator() as $sheet) { + $offset += $boundsheet_length + strlen(PHPExcel_Shared_String::UTF8toBIFF8UnicodeShort($sheet->getTitle())); + } + + // add the sizes of each of the Sheet substreams, respectively + for ($i = 0; $i < $total_worksheets; ++$i) { + $this->worksheetOffsets[$i] = $offset; + $offset += $this->worksheetSizes[$i]; + } + $this->biffSize = $offset; + } + + /** + * Store the Excel FONT records. + */ + private function writeAllFonts() + { + foreach ($this->fontWriters as $fontWriter) { + $this->append($fontWriter->writeFont()); + } + } + + /** + * Store user defined numerical formats i.e. FORMAT records + */ + private function writeAllNumberFormats() + { + foreach ($this->numberFormats as $numberFormatIndex => $numberFormat) { + $this->writeNumberFormat($numberFormat->getFormatCode(), $numberFormatIndex); + } + } + + /** + * Write all XF records. + */ + private function writeAllXfs() + { + foreach ($this->xfWriters as $xfWriter) { + $this->append($xfWriter->writeXf()); + } + } + + /** + * Write all STYLE records. + */ + private function writeAllStyles() + { + $this->writeStyle(); + } + + /** + * Write the EXTERNCOUNT and EXTERNSHEET records. These are used as indexes for + * the NAME records. + */ + private function writeExternals() + { + $countSheets = $this->phpExcel->getSheetCount(); + // Create EXTERNCOUNT with number of worksheets + $this->writeExternalCount($countSheets); + + // Create EXTERNSHEET for each worksheet + for ($i = 0; $i < $countSheets; ++$i) { + $this->writeExternalSheet($this->phpExcel->getSheet($i)->getTitle()); + } + } + + /** + * Write the NAME record to define the print area and the repeat rows and cols. + */ + private function writeNames() + { + // total number of sheets + $total_worksheets = $this->phpExcel->getSheetCount(); + + // Create the print area NAME records + for ($i = 0; $i < $total_worksheets; ++$i) { + $sheetSetup = $this->phpExcel->getSheet($i)->getPageSetup(); + // Write a Name record if the print area has been defined + if ($sheetSetup->isPrintAreaSet()) { + // Print area + $printArea = PHPExcel_Cell::splitRange($sheetSetup->getPrintArea()); + $printArea = $printArea[0]; + $printArea[0] = PHPExcel_Cell::coordinateFromString($printArea[0]); + $printArea[1] = PHPExcel_Cell::coordinateFromString($printArea[1]); + + $print_rowmin = $printArea[0][1] - 1; + $print_rowmax = $printArea[1][1] - 1; + $print_colmin = PHPExcel_Cell::columnIndexFromString($printArea[0][0]) - 1; + $print_colmax = PHPExcel_Cell::columnIndexFromString($printArea[1][0]) - 1; + + $this->writeNameShort( + $i, // sheet index + 0x06, // NAME type + $print_rowmin, + $print_rowmax, + $print_colmin, + $print_colmax + ); + } + } + + // Create the print title NAME records + for ($i = 0; $i < $total_worksheets; ++$i) { + $sheetSetup = $this->phpExcel->getSheet($i)->getPageSetup(); + + // simultaneous repeatColumns repeatRows + if ($sheetSetup->isColumnsToRepeatAtLeftSet() && $sheetSetup->isRowsToRepeatAtTopSet()) { + $repeat = $sheetSetup->getColumnsToRepeatAtLeft(); + $colmin = PHPExcel_Cell::columnIndexFromString($repeat[0]) - 1; + $colmax = PHPExcel_Cell::columnIndexFromString($repeat[1]) - 1; + + $repeat = $sheetSetup->getRowsToRepeatAtTop(); + $rowmin = $repeat[0] - 1; + $rowmax = $repeat[1] - 1; + + $this->writeNameLong( + $i, // sheet index + 0x07, // NAME type + $rowmin, + $rowmax, + $colmin, + $colmax + ); + + // (exclusive) either repeatColumns or repeatRows + } elseif ($sheetSetup->isColumnsToRepeatAtLeftSet() || $sheetSetup->isRowsToRepeatAtTopSet()) { + // Columns to repeat + if ($sheetSetup->isColumnsToRepeatAtLeftSet()) { + $repeat = $sheetSetup->getColumnsToRepeatAtLeft(); + $colmin = PHPExcel_Cell::columnIndexFromString($repeat[0]) - 1; + $colmax = PHPExcel_Cell::columnIndexFromString($repeat[1]) - 1; + } else { + $colmin = 0; + $colmax = 255; + } + + // Rows to repeat + if ($sheetSetup->isRowsToRepeatAtTopSet()) { + $repeat = $sheetSetup->getRowsToRepeatAtTop(); + $rowmin = $repeat[0] - 1; + $rowmax = $repeat[1] - 1; + } else { + $rowmin = 0; + $rowmax = 65535; + } + + $this->writeNameShort( + $i, // sheet index + 0x07, // NAME type + $rowmin, + $rowmax, + $colmin, + $colmax + ); + } + } + } + + /** + * Writes all the DEFINEDNAME records (BIFF8). + * So far this is only used for repeating rows/columns (print titles) and print areas + */ + private function writeAllDefinedNamesBiff8() + { + $chunk = ''; + + // Named ranges + if (count($this->phpExcel->getNamedRanges()) > 0) { + // Loop named ranges + $namedRanges = $this->phpExcel->getNamedRanges(); + foreach ($namedRanges as $namedRange) { + // Create absolute coordinate + $range = PHPExcel_Cell::splitRange($namedRange->getRange()); + for ($i = 0; $i < count($range); $i++) { + $range[$i][0] = '\'' . str_replace("'", "''", $namedRange->getWorksheet()->getTitle()) . '\'!' . PHPExcel_Cell::absoluteCoordinate($range[$i][0]); + if (isset($range[$i][1])) { + $range[$i][1] = PHPExcel_Cell::absoluteCoordinate($range[$i][1]); + } + } + $range = PHPExcel_Cell::buildRange($range); // e.g. Sheet1!$A$1:$B$2 + + // parse formula + try { + $error = $this->parser->parse($range); + $formulaData = $this->parser->toReversePolish(); + + // make sure tRef3d is of type tRef3dR (0x3A) + if (isset($formulaData{0}) and ($formulaData{0} == "\x7A" or $formulaData{0} == "\x5A")) { + $formulaData = "\x3A" . substr($formulaData, 1); + } + + if ($namedRange->getLocalOnly()) { + // local scope + $scope = $this->phpExcel->getIndex($namedRange->getScope()) + 1; + } else { + // global scope + $scope = 0; + } + $chunk .= $this->writeData($this->writeDefinedNameBiff8($namedRange->getName(), $formulaData, $scope, false)); + + } catch (PHPExcel_Exception $e) { + // do nothing + } + } + } + + // total number of sheets + $total_worksheets = $this->phpExcel->getSheetCount(); + + // write the print titles (repeating rows, columns), if any + for ($i = 0; $i < $total_worksheets; ++$i) { + $sheetSetup = $this->phpExcel->getSheet($i)->getPageSetup(); + // simultaneous repeatColumns repeatRows + if ($sheetSetup->isColumnsToRepeatAtLeftSet() && $sheetSetup->isRowsToRepeatAtTopSet()) { + $repeat = $sheetSetup->getColumnsToRepeatAtLeft(); + $colmin = PHPExcel_Cell::columnIndexFromString($repeat[0]) - 1; + $colmax = PHPExcel_Cell::columnIndexFromString($repeat[1]) - 1; + + $repeat = $sheetSetup->getRowsToRepeatAtTop(); + $rowmin = $repeat[0] - 1; + $rowmax = $repeat[1] - 1; + + // construct formula data manually + $formulaData = pack('Cv', 0x29, 0x17); // tMemFunc + $formulaData .= pack('Cvvvvv', 0x3B, $i, 0, 65535, $colmin, $colmax); // tArea3d + $formulaData .= pack('Cvvvvv', 0x3B, $i, $rowmin, $rowmax, 0, 255); // tArea3d + $formulaData .= pack('C', 0x10); // tList + + // store the DEFINEDNAME record + $chunk .= $this->writeData($this->writeDefinedNameBiff8(pack('C', 0x07), $formulaData, $i + 1, true)); + + // (exclusive) either repeatColumns or repeatRows + } elseif ($sheetSetup->isColumnsToRepeatAtLeftSet() || $sheetSetup->isRowsToRepeatAtTopSet()) { + // Columns to repeat + if ($sheetSetup->isColumnsToRepeatAtLeftSet()) { + $repeat = $sheetSetup->getColumnsToRepeatAtLeft(); + $colmin = PHPExcel_Cell::columnIndexFromString($repeat[0]) - 1; + $colmax = PHPExcel_Cell::columnIndexFromString($repeat[1]) - 1; + } else { + $colmin = 0; + $colmax = 255; + } + // Rows to repeat + if ($sheetSetup->isRowsToRepeatAtTopSet()) { + $repeat = $sheetSetup->getRowsToRepeatAtTop(); + $rowmin = $repeat[0] - 1; + $rowmax = $repeat[1] - 1; + } else { + $rowmin = 0; + $rowmax = 65535; + } + + // construct formula data manually because parser does not recognize absolute 3d cell references + $formulaData = pack('Cvvvvv', 0x3B, $i, $rowmin, $rowmax, $colmin, $colmax); + + // store the DEFINEDNAME record + $chunk .= $this->writeData($this->writeDefinedNameBiff8(pack('C', 0x07), $formulaData, $i + 1, true)); + } + } + + // write the print areas, if any + for ($i = 0; $i < $total_worksheets; ++$i) { + $sheetSetup = $this->phpExcel->getSheet($i)->getPageSetup(); + if ($sheetSetup->isPrintAreaSet()) { + // Print area, e.g. A3:J6,H1:X20 + $printArea = PHPExcel_Cell::splitRange($sheetSetup->getPrintArea()); + $countPrintArea = count($printArea); + + $formulaData = ''; + for ($j = 0; $j < $countPrintArea; ++$j) { + $printAreaRect = $printArea[$j]; // e.g. A3:J6 + $printAreaRect[0] = PHPExcel_Cell::coordinateFromString($printAreaRect[0]); + $printAreaRect[1] = PHPExcel_Cell::coordinateFromString($printAreaRect[1]); + + $print_rowmin = $printAreaRect[0][1] - 1; + $print_rowmax = $printAreaRect[1][1] - 1; + $print_colmin = PHPExcel_Cell::columnIndexFromString($printAreaRect[0][0]) - 1; + $print_colmax = PHPExcel_Cell::columnIndexFromString($printAreaRect[1][0]) - 1; + + // construct formula data manually because parser does not recognize absolute 3d cell references + $formulaData .= pack('Cvvvvv', 0x3B, $i, $print_rowmin, $print_rowmax, $print_colmin, $print_colmax); + + if ($j > 0) { + $formulaData .= pack('C', 0x10); // list operator token ',' + } + } + + // store the DEFINEDNAME record + $chunk .= $this->writeData($this->writeDefinedNameBiff8(pack('C', 0x06), $formulaData, $i + 1, true)); + } + } + + // write autofilters, if any + for ($i = 0; $i < $total_worksheets; ++$i) { + $sheetAutoFilter = $this->phpExcel->getSheet($i)->getAutoFilter(); + $autoFilterRange = $sheetAutoFilter->getRange(); + if (!empty($autoFilterRange)) { + $rangeBounds = PHPExcel_Cell::rangeBoundaries($autoFilterRange); + + //Autofilter built in name + $name = pack('C', 0x0D); + + $chunk .= $this->writeData($this->writeShortNameBiff8($name, $i + 1, $rangeBounds, true)); + } + } + + return $chunk; + } + + /** + * Write a DEFINEDNAME record for BIFF8 using explicit binary formula data + * + * @param string $name The name in UTF-8 + * @param string $formulaData The binary formula data + * @param string $sheetIndex 1-based sheet index the defined name applies to. 0 = global + * @param boolean $isBuiltIn Built-in name? + * @return string Complete binary record data + */ + private function writeDefinedNameBiff8($name, $formulaData, $sheetIndex = 0, $isBuiltIn = false) + { + $record = 0x0018; + + // option flags + $options = $isBuiltIn ? 0x20 : 0x00; + + // length of the name, character count + $nlen = PHPExcel_Shared_String::CountCharacters($name); + + // name with stripped length field + $name = substr(PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($name), 2); + + // size of the formula (in bytes) + $sz = strlen($formulaData); + + // combine the parts + $data = pack('vCCvvvCCCC', $options, 0, $nlen, $sz, 0, $sheetIndex, 0, 0, 0, 0) + . $name . $formulaData; + $length = strlen($data); + + $header = pack('vv', $record, $length); + + return $header . $data; + } + + /** + * Write a short NAME record + * + * @param string $name + * @param string $sheetIndex 1-based sheet index the defined name applies to. 0 = global + * @param integer[][] $rangeBounds range boundaries + * @param boolean $isHidden + * @return string Complete binary record data + * */ + private function writeShortNameBiff8($name, $sheetIndex = 0, $rangeBounds, $isHidden = false) + { + $record = 0x0018; + + // option flags + $options = ($isHidden ? 0x21 : 0x00); + + $extra = pack( + 'Cvvvvv', + 0x3B, + $sheetIndex - 1, + $rangeBounds[0][1] - 1, + $rangeBounds[1][1] - 1, + $rangeBounds[0][0] - 1, + $rangeBounds[1][0] - 1 + ); + + // size of the formula (in bytes) + $sz = strlen($extra); + + // combine the parts + $data = pack('vCCvvvCCCCC', $options, 0, 1, $sz, 0, $sheetIndex, 0, 0, 0, 0, 0) + . $name . $extra; + $length = strlen($data); + + $header = pack('vv', $record, $length); + + return $header . $data; + } + + /** + * Stores the CODEPAGE biff record. + */ + private function writeCodepage() + { + $record = 0x0042; // Record identifier + $length = 0x0002; // Number of bytes to follow + $cv = $this->codepage; // The code page + + $header = pack('vv', $record, $length); + $data = pack('v', $cv); + + $this->append($header . $data); + } + + /** + * Write Excel BIFF WINDOW1 record. + */ + private function writeWindow1() + { + $record = 0x003D; // Record identifier + $length = 0x0012; // Number of bytes to follow + + $xWn = 0x0000; // Horizontal position of window + $yWn = 0x0000; // Vertical position of window + $dxWn = 0x25BC; // Width of window + $dyWn = 0x1572; // Height of window + + $grbit = 0x0038; // Option flags + + // not supported by PHPExcel, so there is only one selected sheet, the active + $ctabsel = 1; // Number of workbook tabs selected + + $wTabRatio = 0x0258; // Tab to scrollbar ratio + + // not supported by PHPExcel, set to 0 + $itabFirst = 0; // 1st displayed worksheet + $itabCur = $this->phpExcel->getActiveSheetIndex(); // Active worksheet + + $header = pack("vv", $record, $length); + $data = pack("vvvvvvvvv", $xWn, $yWn, $dxWn, $dyWn, $grbit, $itabCur, $itabFirst, $ctabsel, $wTabRatio); + $this->append($header . $data); + } + + /** + * Writes Excel BIFF BOUNDSHEET record. + * + * @param PHPExcel_Worksheet $sheet Worksheet name + * @param integer $offset Location of worksheet BOF + */ + private function writeBoundSheet($sheet, $offset) + { + $sheetname = $sheet->getTitle(); + $record = 0x0085; // Record identifier + + // sheet state + switch ($sheet->getSheetState()) { + case PHPExcel_Worksheet::SHEETSTATE_VISIBLE: + $ss = 0x00; + break; + case PHPExcel_Worksheet::SHEETSTATE_HIDDEN: + $ss = 0x01; + break; + case PHPExcel_Worksheet::SHEETSTATE_VERYHIDDEN: + $ss = 0x02; + break; + default: + $ss = 0x00; + break; + } + + // sheet type + $st = 0x00; + + $grbit = 0x0000; // Visibility and sheet type + + $data = pack("VCC", $offset, $ss, $st); + $data .= PHPExcel_Shared_String::UTF8toBIFF8UnicodeShort($sheetname); + + $length = strlen($data); + $header = pack("vv", $record, $length); + $this->append($header . $data); + } + + /** + * Write Internal SUPBOOK record + */ + private function writeSupbookInternal() + { + $record = 0x01AE; // Record identifier + $length = 0x0004; // Bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("vv", $this->phpExcel->getSheetCount(), 0x0401); + return $this->writeData($header . $data); + } + + /** + * Writes the Excel BIFF EXTERNSHEET record. These references are used by + * formulas. + * + */ + private function writeExternalsheetBiff8() + { + $totalReferences = count($this->parser->references); + $record = 0x0017; // Record identifier + $length = 2 + 6 * $totalReferences; // Number of bytes to follow + + $supbook_index = 0; // FIXME: only using internal SUPBOOK record + $header = pack("vv", $record, $length); + $data = pack('v', $totalReferences); + for ($i = 0; $i < $totalReferences; ++$i) { + $data .= $this->parser->references[$i]; + } + return $this->writeData($header . $data); + } + + /** + * Write Excel BIFF STYLE records. + */ + private function writeStyle() + { + $record = 0x0293; // Record identifier + $length = 0x0004; // Bytes to follow + + $ixfe = 0x8000; // Index to cell style XF + $BuiltIn = 0x00; // Built-in style + $iLevel = 0xff; // Outline style level + + $header = pack("vv", $record, $length); + $data = pack("vCC", $ixfe, $BuiltIn, $iLevel); + $this->append($header . $data); + } + + /** + * Writes Excel FORMAT record for non "built-in" numerical formats. + * + * @param string $format Custom format string + * @param integer $ifmt Format index code + */ + private function writeNumberFormat($format, $ifmt) + { + $record = 0x041E; // Record identifier + + $numberFormatString = PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($format); + $length = 2 + strlen($numberFormatString); // Number of bytes to follow + + + $header = pack("vv", $record, $length); + $data = pack("v", $ifmt) . $numberFormatString; + $this->append($header . $data); + } + + /** + * Write DATEMODE record to indicate the date system in use (1904 or 1900). + */ + private function writeDateMode() + { + $record = 0x0022; // Record identifier + $length = 0x0002; // Bytes to follow + + $f1904 = (PHPExcel_Shared_Date::getExcelCalendar() == PHPExcel_Shared_Date::CALENDAR_MAC_1904) + ? 1 + : 0; // Flag for 1904 date system + + $header = pack("vv", $record, $length); + $data = pack("v", $f1904); + $this->append($header . $data); + } + + /** + * Write BIFF record EXTERNCOUNT to indicate the number of external sheet + * references in the workbook. + * + * Excel only stores references to external sheets that are used in NAME. + * The workbook NAME record is required to define the print area and the repeat + * rows and columns. + * + * A similar method is used in Worksheet.php for a slightly different purpose. + * + * @param integer $cxals Number of external references + */ + private function writeExternalCount($cxals) + { + $record = 0x0016; // Record identifier + $length = 0x0002; // Number of bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("v", $cxals); + $this->append($header . $data); + } + + /** + * Writes the Excel BIFF EXTERNSHEET record. These references are used by + * formulas. NAME record is required to define the print area and the repeat + * rows and columns. + * + * A similar method is used in Worksheet.php for a slightly different purpose. + * + * @param string $sheetname Worksheet name + */ + private function writeExternalSheet($sheetname) + { + $record = 0x0017; // Record identifier + $length = 0x02 + strlen($sheetname); // Number of bytes to follow + + $cch = strlen($sheetname); // Length of sheet name + $rgch = 0x03; // Filename encoding + + $header = pack("vv", $record, $length); + $data = pack("CC", $cch, $rgch); + $this->append($header . $data . $sheetname); + } + + /** + * Store the NAME record in the short format that is used for storing the print + * area, repeat rows only and repeat columns only. + * + * @param integer $index Sheet index + * @param integer $type Built-in name type + * @param integer $rowmin Start row + * @param integer $rowmax End row + * @param integer $colmin Start colum + * @param integer $colmax End column + */ + private function writeNameShort($index, $type, $rowmin, $rowmax, $colmin, $colmax) + { + $record = 0x0018; // Record identifier + $length = 0x0024; // Number of bytes to follow + + $grbit = 0x0020; // Option flags + $chKey = 0x00; // Keyboard shortcut + $cch = 0x01; // Length of text name + $cce = 0x0015; // Length of text definition + $ixals = $index + 1; // Sheet index + $itab = $ixals; // Equal to ixals + $cchCustMenu = 0x00; // Length of cust menu text + $cchDescription = 0x00; // Length of description text + $cchHelptopic = 0x00; // Length of help topic text + $cchStatustext = 0x00; // Length of status bar text + $rgch = $type; // Built-in name type + + $unknown03 = 0x3b; + $unknown04 = 0xffff - $index; + $unknown05 = 0x0000; + $unknown06 = 0x0000; + $unknown07 = 0x1087; + $unknown08 = 0x8005; + + $header = pack("vv", $record, $length); + $data = pack("v", $grbit); + $data .= pack("C", $chKey); + $data .= pack("C", $cch); + $data .= pack("v", $cce); + $data .= pack("v", $ixals); + $data .= pack("v", $itab); + $data .= pack("C", $cchCustMenu); + $data .= pack("C", $cchDescription); + $data .= pack("C", $cchHelptopic); + $data .= pack("C", $cchStatustext); + $data .= pack("C", $rgch); + $data .= pack("C", $unknown03); + $data .= pack("v", $unknown04); + $data .= pack("v", $unknown05); + $data .= pack("v", $unknown06); + $data .= pack("v", $unknown07); + $data .= pack("v", $unknown08); + $data .= pack("v", $index); + $data .= pack("v", $index); + $data .= pack("v", $rowmin); + $data .= pack("v", $rowmax); + $data .= pack("C", $colmin); + $data .= pack("C", $colmax); + $this->append($header . $data); + } + + /** + * Store the NAME record in the long format that is used for storing the repeat + * rows and columns when both are specified. This shares a lot of code with + * writeNameShort() but we use a separate method to keep the code clean. + * Code abstraction for reuse can be carried too far, and I should know. ;-) + * + * @param integer $index Sheet index + * @param integer $type Built-in name type + * @param integer $rowmin Start row + * @param integer $rowmax End row + * @param integer $colmin Start colum + * @param integer $colmax End column + */ + private function writeNameLong($index, $type, $rowmin, $rowmax, $colmin, $colmax) + { + $record = 0x0018; // Record identifier + $length = 0x003d; // Number of bytes to follow + $grbit = 0x0020; // Option flags + $chKey = 0x00; // Keyboard shortcut + $cch = 0x01; // Length of text name + $cce = 0x002e; // Length of text definition + $ixals = $index + 1; // Sheet index + $itab = $ixals; // Equal to ixals + $cchCustMenu = 0x00; // Length of cust menu text + $cchDescription = 0x00; // Length of description text + $cchHelptopic = 0x00; // Length of help topic text + $cchStatustext = 0x00; // Length of status bar text + $rgch = $type; // Built-in name type + + $unknown01 = 0x29; + $unknown02 = 0x002b; + $unknown03 = 0x3b; + $unknown04 = 0xffff-$index; + $unknown05 = 0x0000; + $unknown06 = 0x0000; + $unknown07 = 0x1087; + $unknown08 = 0x8008; + + $header = pack("vv", $record, $length); + $data = pack("v", $grbit); + $data .= pack("C", $chKey); + $data .= pack("C", $cch); + $data .= pack("v", $cce); + $data .= pack("v", $ixals); + $data .= pack("v", $itab); + $data .= pack("C", $cchCustMenu); + $data .= pack("C", $cchDescription); + $data .= pack("C", $cchHelptopic); + $data .= pack("C", $cchStatustext); + $data .= pack("C", $rgch); + $data .= pack("C", $unknown01); + $data .= pack("v", $unknown02); + // Column definition + $data .= pack("C", $unknown03); + $data .= pack("v", $unknown04); + $data .= pack("v", $unknown05); + $data .= pack("v", $unknown06); + $data .= pack("v", $unknown07); + $data .= pack("v", $unknown08); + $data .= pack("v", $index); + $data .= pack("v", $index); + $data .= pack("v", 0x0000); + $data .= pack("v", 0x3fff); + $data .= pack("C", $colmin); + $data .= pack("C", $colmax); + // Row definition + $data .= pack("C", $unknown03); + $data .= pack("v", $unknown04); + $data .= pack("v", $unknown05); + $data .= pack("v", $unknown06); + $data .= pack("v", $unknown07); + $data .= pack("v", $unknown08); + $data .= pack("v", $index); + $data .= pack("v", $index); + $data .= pack("v", $rowmin); + $data .= pack("v", $rowmax); + $data .= pack("C", 0x00); + $data .= pack("C", 0xff); + // End of data + $data .= pack("C", 0x10); + $this->append($header . $data); + } + + /** + * Stores the COUNTRY record for localization + * + * @return string + */ + private function writeCountry() + { + $record = 0x008C; // Record identifier + $length = 4; // Number of bytes to follow + + $header = pack('vv', $record, $length); + /* using the same country code always for simplicity */ + $data = pack('vv', $this->countryCode, $this->countryCode); + //$this->append($header . $data); + return $this->writeData($header . $data); + } + + /** + * Write the RECALCID record + * + * @return string + */ + private function writeRecalcId() + { + $record = 0x01C1; // Record identifier + $length = 8; // Number of bytes to follow + + $header = pack('vv', $record, $length); + + // by inspection of real Excel files, MS Office Excel 2007 writes this + $data = pack('VV', 0x000001C1, 0x00001E667); + + return $this->writeData($header . $data); + } + + /** + * Stores the PALETTE biff record. + */ + private function writePalette() + { + $aref = $this->palette; + + $record = 0x0092; // Record identifier + $length = 2 + 4 * count($aref); // Number of bytes to follow + $ccv = count($aref); // Number of RGB values to follow + $data = ''; // The RGB data + + // Pack the RGB data + foreach ($aref as $color) { + foreach ($color as $byte) { + $data .= pack("C", $byte); + } + } + + $header = pack("vvv", $record, $length, $ccv); + $this->append($header . $data); + } + + /** + * Handling of the SST continue blocks is complicated by the need to include an + * additional continuation byte depending on whether the string is split between + * blocks or whether it starts at the beginning of the block. (There are also + * additional complications that will arise later when/if Rich Strings are + * supported). + * + * The Excel documentation says that the SST record should be followed by an + * EXTSST record. The EXTSST record is a hash table that is used to optimise + * access to SST. However, despite the documentation it doesn't seem to be + * required so we will ignore it. + * + * @return string Binary data + */ + private function writeSharedStringsTable() + { + // maximum size of record data (excluding record header) + $continue_limit = 8224; + + // initialize array of record data blocks + $recordDatas = array(); + + // start SST record data block with total number of strings, total number of unique strings + $recordData = pack("VV", $this->stringTotal, $this->stringUnique); + + // loop through all (unique) strings in shared strings table + foreach (array_keys($this->stringTable) as $string) { + // here $string is a BIFF8 encoded string + + // length = character count + $headerinfo = unpack("vlength/Cencoding", $string); + + // currently, this is always 1 = uncompressed + $encoding = $headerinfo["encoding"]; + + // initialize finished writing current $string + $finished = false; + + while ($finished === false) { + // normally, there will be only one cycle, but if string cannot immediately be written as is + // there will be need for more than one cylcle, if string longer than one record data block, there + // may be need for even more cycles + + if (strlen($recordData) + strlen($string) <= $continue_limit) { + // then we can write the string (or remainder of string) without any problems + $recordData .= $string; + + if (strlen($recordData) + strlen($string) == $continue_limit) { + // we close the record data block, and initialize a new one + $recordDatas[] = $recordData; + $recordData = ''; + } + + // we are finished writing this string + $finished = true; + } else { + // special treatment writing the string (or remainder of the string) + // If the string is very long it may need to be written in more than one CONTINUE record. + + // check how many bytes more there is room for in the current record + $space_remaining = $continue_limit - strlen($recordData); + + // minimum space needed + // uncompressed: 2 byte string length length field + 1 byte option flags + 2 byte character + // compressed: 2 byte string length length field + 1 byte option flags + 1 byte character + $min_space_needed = ($encoding == 1) ? 5 : 4; + + // We have two cases + // 1. space remaining is less than minimum space needed + // here we must waste the space remaining and move to next record data block + // 2. space remaining is greater than or equal to minimum space needed + // here we write as much as we can in the current block, then move to next record data block + + // 1. space remaining is less than minimum space needed + if ($space_remaining < $min_space_needed) { + // we close the block, store the block data + $recordDatas[] = $recordData; + + // and start new record data block where we start writing the string + $recordData = ''; + + // 2. space remaining is greater than or equal to minimum space needed + } else { + // initialize effective remaining space, for Unicode strings this may need to be reduced by 1, see below + $effective_space_remaining = $space_remaining; + + // for uncompressed strings, sometimes effective space remaining is reduced by 1 + if ($encoding == 1 && (strlen($string) - $space_remaining) % 2 == 1) { + --$effective_space_remaining; + } + + // one block fininshed, store the block data + $recordData .= substr($string, 0, $effective_space_remaining); + + $string = substr($string, $effective_space_remaining); // for next cycle in while loop + $recordDatas[] = $recordData; + + // start new record data block with the repeated option flags + $recordData = pack('C', $encoding); + } + } + } + } + + // Store the last record data block unless it is empty + // if there was no need for any continue records, this will be the for SST record data block itself + if (strlen($recordData) > 0) { + $recordDatas[] = $recordData; + } + + // combine into one chunk with all the blocks SST, CONTINUE,... + $chunk = ''; + foreach ($recordDatas as $i => $recordData) { + // first block should have the SST record header, remaing should have CONTINUE header + $record = ($i == 0) ? 0x00FC : 0x003C; + + $header = pack("vv", $record, strlen($recordData)); + $data = $header . $recordData; + + $chunk .= $this->writeData($data); + } + + return $chunk; + } + + /** + * Writes the MSODRAWINGGROUP record if needed. Possibly split using CONTINUE records. + */ + private function writeMsoDrawingGroup() + { + // write the Escher stream if necessary + if (isset($this->escher)) { + $writer = new PHPExcel_Writer_Excel5_Escher($this->escher); + $data = $writer->close(); + + $record = 0x00EB; + $length = strlen($data); + $header = pack("vv", $record, $length); + + return $this->writeData($header . $data); + } else { + return ''; + } + } + + /** + * Get Escher object + * + * @return PHPExcel_Shared_Escher + */ + public function getEscher() + { + return $this->escher; + } + + /** + * Set Escher object + * + * @param PHPExcel_Shared_Escher $pValue + */ + public function setEscher(PHPExcel_Shared_Escher $pValue = null) + { + $this->escher = $pValue; + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel5/Worksheet.php b/extend/PHPExcel/PHPExcel/Writer/Excel5/Worksheet.php new file mode 100644 index 0000000..be965e2 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel5/Worksheet.php @@ -0,0 +1,4240 @@ +<?php + +/** + * PHPExcel_Writer_Excel5_Worksheet + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel5 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + +// Original file header of PEAR::Spreadsheet_Excel_Writer_Worksheet (used as the base for this class): +// ----------------------------------------------------------------------------------------- +// /* +// * Module written/ported by Xavier Noguer <xnoguer@rezebra.com> +// * +// * The majority of this is _NOT_ my code. I simply ported it from the +// * PERL Spreadsheet::WriteExcel module. +// * +// * The author of the Spreadsheet::WriteExcel module is John McNamara +// * <jmcnamara@cpan.org> +// * +// * I _DO_ maintain this code, and John McNamara has nothing to do with the +// * porting of this code to PHP. Any questions directly related to this +// * class library should be directed to me. +// * +// * License Information: +// * +// * Spreadsheet_Excel_Writer: A library for generating Excel Spreadsheets +// * Copyright (c) 2002-2003 Xavier Noguer xnoguer@rezebra.com +// * +// * This library is free software; you can redistribute it and/or +// * modify it under the terms of the GNU Lesser General Public +// * License as published by the Free Software Foundation; either +// * version 2.1 of the License, or (at your option) any later version. +// * +// * This library is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// * Lesser General Public License for more details. +// * +// * You should have received a copy of the GNU Lesser General Public +// * License along with this library; if not, write to the Free Software +// * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// */ +class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter +{ + /** + * Formula parser + * + * @var PHPExcel_Writer_Excel5_Parser + */ + private $parser; + + /** + * Maximum number of characters for a string (LABEL record in BIFF5) + * @var integer + */ + private $xlsStringMaxLength; + + /** + * Array containing format information for columns + * @var array + */ + private $columnInfo; + + /** + * Array containing the selected area for the worksheet + * @var array + */ + private $selection; + + /** + * The active pane for the worksheet + * @var integer + */ + private $activePane; + + /** + * Whether to use outline. + * @var integer + */ + private $outlineOn; + + /** + * Auto outline styles. + * @var bool + */ + private $outlineStyle; + + /** + * Whether to have outline summary below. + * @var bool + */ + private $outlineBelow; + + /** + * Whether to have outline summary at the right. + * @var bool + */ + private $outlineRight; + + /** + * Reference to the total number of strings in the workbook + * @var integer + */ + private $stringTotal; + + /** + * Reference to the number of unique strings in the workbook + * @var integer + */ + private $stringUnique; + + /** + * Reference to the array containing all the unique strings in the workbook + * @var array + */ + private $stringTable; + + /** + * Color cache + */ + private $colors; + + /** + * Index of first used row (at least 0) + * @var int + */ + private $firstRowIndex; + + /** + * Index of last used row. (no used rows means -1) + * @var int + */ + private $lastRowIndex; + + /** + * Index of first used column (at least 0) + * @var int + */ + private $firstColumnIndex; + + /** + * Index of last used column (no used columns means -1) + * @var int + */ + private $lastColumnIndex; + + /** + * Sheet object + * @var PHPExcel_Worksheet + */ + public $phpSheet; + + /** + * Count cell style Xfs + * + * @var int + */ + private $countCellStyleXfs; + + /** + * Escher object corresponding to MSODRAWING + * + * @var PHPExcel_Shared_Escher + */ + private $escher; + + /** + * Array of font hashes associated to FONT records index + * + * @var array + */ + public $fontHashIndex; + + /** + * Constructor + * + * @param int &$str_total Total number of strings + * @param int &$str_unique Total number of unique strings + * @param array &$str_table String Table + * @param array &$colors Colour Table + * @param mixed $parser The formula parser created for the Workbook + * @param boolean $preCalculateFormulas Flag indicating whether formulas should be calculated or just written + * @param string $phpSheet The worksheet to write + * @param PHPExcel_Worksheet $phpSheet + */ + public function __construct(&$str_total, &$str_unique, &$str_table, &$colors, $parser, $preCalculateFormulas, $phpSheet) + { + // It needs to call its parent's constructor explicitly + parent::__construct(); + + // change BIFFwriter limit for CONTINUE records +// $this->_limit = 8224; + + + $this->_preCalculateFormulas = $preCalculateFormulas; + $this->stringTotal = &$str_total; + $this->stringUnique = &$str_unique; + $this->stringTable = &$str_table; + $this->colors = &$colors; + $this->parser = $parser; + + $this->phpSheet = $phpSheet; + + //$this->ext_sheets = array(); + //$this->offset = 0; + $this->xlsStringMaxLength = 255; + $this->columnInfo = array(); + $this->selection = array(0,0,0,0); + $this->activePane = 3; + + $this->_print_headers = 0; + + $this->outlineStyle = 0; + $this->outlineBelow = 1; + $this->outlineRight = 1; + $this->outlineOn = 1; + + $this->fontHashIndex = array(); + + // calculate values for DIMENSIONS record + $minR = 1; + $minC = 'A'; + + $maxR = $this->phpSheet->getHighestRow(); + $maxC = $this->phpSheet->getHighestColumn(); + + // Determine lowest and highest column and row +// $this->firstRowIndex = ($minR > 65535) ? 65535 : $minR; + $this->lastRowIndex = ($maxR > 65535) ? 65535 : $maxR ; + + $this->firstColumnIndex = PHPExcel_Cell::columnIndexFromString($minC); + $this->lastColumnIndex = PHPExcel_Cell::columnIndexFromString($maxC); + +// if ($this->firstColumnIndex > 255) $this->firstColumnIndex = 255; + if ($this->lastColumnIndex > 255) { + $this->lastColumnIndex = 255; + } + + $this->countCellStyleXfs = count($phpSheet->getParent()->getCellStyleXfCollection()); + } + + /** + * Add data to the beginning of the workbook (note the reverse order) + * and to the end of the workbook. + * + * @access public + * @see PHPExcel_Writer_Excel5_Workbook::storeWorkbook() + */ + public function close() + { + $phpSheet = $this->phpSheet; + + $num_sheets = $phpSheet->getParent()->getSheetCount(); + + // Write BOF record + $this->storeBof(0x0010); + + // Write PRINTHEADERS + $this->writePrintHeaders(); + + // Write PRINTGRIDLINES + $this->writePrintGridlines(); + + // Write GRIDSET + $this->writeGridset(); + + // Calculate column widths + $phpSheet->calculateColumnWidths(); + + // Column dimensions + if (($defaultWidth = $phpSheet->getDefaultColumnDimension()->getWidth()) < 0) { + $defaultWidth = PHPExcel_Shared_Font::getDefaultColumnWidthByFont($phpSheet->getParent()->getDefaultStyle()->getFont()); + } + + $columnDimensions = $phpSheet->getColumnDimensions(); + $maxCol = $this->lastColumnIndex -1; + for ($i = 0; $i <= $maxCol; ++$i) { + $hidden = 0; + $level = 0; + $xfIndex = 15; // there are 15 cell style Xfs + + $width = $defaultWidth; + + $columnLetter = PHPExcel_Cell::stringFromColumnIndex($i); + if (isset($columnDimensions[$columnLetter])) { + $columnDimension = $columnDimensions[$columnLetter]; + if ($columnDimension->getWidth() >= 0) { + $width = $columnDimension->getWidth(); + } + $hidden = $columnDimension->getVisible() ? 0 : 1; + $level = $columnDimension->getOutlineLevel(); + $xfIndex = $columnDimension->getXfIndex() + 15; // there are 15 cell style Xfs + } + + // Components of columnInfo: + // $firstcol first column on the range + // $lastcol last column on the range + // $width width to set + // $xfIndex The optional cell style Xf index to apply to the columns + // $hidden The optional hidden atribute + // $level The optional outline level + $this->columnInfo[] = array($i, $i, $width, $xfIndex, $hidden, $level); + } + + // Write GUTS + $this->writeGuts(); + + // Write DEFAULTROWHEIGHT + $this->writeDefaultRowHeight(); + // Write WSBOOL + $this->writeWsbool(); + // Write horizontal and vertical page breaks + $this->writeBreaks(); + // Write page header + $this->writeHeader(); + // Write page footer + $this->writeFooter(); + // Write page horizontal centering + $this->writeHcenter(); + // Write page vertical centering + $this->writeVcenter(); + // Write left margin + $this->writeMarginLeft(); + // Write right margin + $this->writeMarginRight(); + // Write top margin + $this->writeMarginTop(); + // Write bottom margin + $this->writeMarginBottom(); + // Write page setup + $this->writeSetup(); + // Write sheet protection + $this->writeProtect(); + // Write SCENPROTECT + $this->writeScenProtect(); + // Write OBJECTPROTECT + $this->writeObjectProtect(); + // Write sheet password + $this->writePassword(); + // Write DEFCOLWIDTH record + $this->writeDefcol(); + + // Write the COLINFO records if they exist + if (!empty($this->columnInfo)) { + $colcount = count($this->columnInfo); + for ($i = 0; $i < $colcount; ++$i) { + $this->writeColinfo($this->columnInfo[$i]); + } + } + $autoFilterRange = $phpSheet->getAutoFilter()->getRange(); + if (!empty($autoFilterRange)) { + // Write AUTOFILTERINFO + $this->writeAutoFilterInfo(); + } + + // Write sheet dimensions + $this->writeDimensions(); + + // Row dimensions + foreach ($phpSheet->getRowDimensions() as $rowDimension) { + $xfIndex = $rowDimension->getXfIndex() + 15; // there are 15 cellXfs + $this->writeRow($rowDimension->getRowIndex() - 1, $rowDimension->getRowHeight(), $xfIndex, ($rowDimension->getVisible() ? '0' : '1'), $rowDimension->getOutlineLevel()); + } + + // Write Cells + foreach ($phpSheet->getCellCollection() as $cellID) { + $cell = $phpSheet->getCell($cellID); + $row = $cell->getRow() - 1; + $column = PHPExcel_Cell::columnIndexFromString($cell->getColumn()) - 1; + + // Don't break Excel! +// if ($row + 1 > 65536 or $column + 1 > 256) { + if ($row > 65535 || $column > 255) { + break; + } + + // Write cell value + $xfIndex = $cell->getXfIndex() + 15; // there are 15 cell style Xfs + + $cVal = $cell->getValue(); + if ($cVal instanceof PHPExcel_RichText) { + // $this->writeString($row, $column, $cVal->getPlainText(), $xfIndex); + $arrcRun = array(); + $str_len = PHPExcel_Shared_String::CountCharacters($cVal->getPlainText(), 'UTF-8'); + $str_pos = 0; + $elements = $cVal->getRichTextElements(); + foreach ($elements as $element) { + // FONT Index + if ($element instanceof PHPExcel_RichText_Run) { + $str_fontidx = $this->fontHashIndex[$element->getFont()->getHashCode()]; + } else { + $str_fontidx = 0; + } + $arrcRun[] = array('strlen' => $str_pos, 'fontidx' => $str_fontidx); + // Position FROM + $str_pos += PHPExcel_Shared_String::CountCharacters($element->getText(), 'UTF-8'); + } + $this->writeRichTextString($row, $column, $cVal->getPlainText(), $xfIndex, $arrcRun); + } else { + switch ($cell->getDatatype()) { + case PHPExcel_Cell_DataType::TYPE_STRING: + case PHPExcel_Cell_DataType::TYPE_NULL: + if ($cVal === '' || $cVal === null) { + $this->writeBlank($row, $column, $xfIndex); + } else { + $this->writeString($row, $column, $cVal, $xfIndex); + } + break; + + case PHPExcel_Cell_DataType::TYPE_NUMERIC: + $this->writeNumber($row, $column, $cVal, $xfIndex); + break; + + case PHPExcel_Cell_DataType::TYPE_FORMULA: + $calculatedValue = $this->_preCalculateFormulas ? + $cell->getCalculatedValue() : null; + $this->writeFormula($row, $column, $cVal, $xfIndex, $calculatedValue); + break; + + case PHPExcel_Cell_DataType::TYPE_BOOL: + $this->writeBoolErr($row, $column, $cVal, 0, $xfIndex); + break; + + case PHPExcel_Cell_DataType::TYPE_ERROR: + $this->writeBoolErr($row, $column, self::mapErrorCode($cVal), 1, $xfIndex); + break; + + } + } + } + + // Append + $this->writeMsoDrawing(); + + // Write WINDOW2 record + $this->writeWindow2(); + + // Write PLV record + $this->writePageLayoutView(); + + // Write ZOOM record + $this->writeZoom(); + if ($phpSheet->getFreezePane()) { + $this->writePanes(); + } + + // Write SELECTION record + $this->writeSelection(); + + // Write MergedCellsTable Record + $this->writeMergedCells(); + + // Hyperlinks + foreach ($phpSheet->getHyperLinkCollection() as $coordinate => $hyperlink) { + list($column, $row) = PHPExcel_Cell::coordinateFromString($coordinate); + + $url = $hyperlink->getUrl(); + + if (strpos($url, 'sheet://') !== false) { + // internal to current workbook + $url = str_replace('sheet://', 'internal:', $url); + + } elseif (preg_match('/^(http:|https:|ftp:|mailto:)/', $url)) { + // URL + // $url = $url; + + } else { + // external (local file) + $url = 'external:' . $url; + } + + $this->writeUrl($row - 1, PHPExcel_Cell::columnIndexFromString($column) - 1, $url); + } + + $this->writeDataValidity(); + $this->writeSheetLayout(); + + // Write SHEETPROTECTION record + $this->writeSheetProtection(); + $this->writeRangeProtection(); + + $arrConditionalStyles = $phpSheet->getConditionalStylesCollection(); + if (!empty($arrConditionalStyles)) { + $arrConditional = array(); + // @todo CFRule & CFHeader + // Write CFHEADER record + $this->writeCFHeader(); + // Write ConditionalFormattingTable records + foreach ($arrConditionalStyles as $cellCoordinate => $conditionalStyles) { + foreach ($conditionalStyles as $conditional) { + if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_EXPRESSION + || $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS) { + if (!in_array($conditional->getHashCode(), $arrConditional)) { + $arrConditional[] = $conditional->getHashCode(); + // Write CFRULE record + $this->writeCFRule($conditional); + } + } + } + } + } + + $this->storeEof(); + } + + /** + * Write a cell range address in BIFF8 + * always fixed range + * See section 2.5.14 in OpenOffice.org's Documentation of the Microsoft Excel File Format + * + * @param string $range E.g. 'A1' or 'A1:B6' + * @return string Binary data + */ + private function writeBIFF8CellRangeAddressFixed($range = 'A1') + { + $explodes = explode(':', $range); + + // extract first cell, e.g. 'A1' + $firstCell = $explodes[0]; + + // extract last cell, e.g. 'B6' + if (count($explodes) == 1) { + $lastCell = $firstCell; + } else { + $lastCell = $explodes[1]; + } + + $firstCellCoordinates = PHPExcel_Cell::coordinateFromString($firstCell); // e.g. array(0, 1) + $lastCellCoordinates = PHPExcel_Cell::coordinateFromString($lastCell); // e.g. array(1, 6) + + return pack('vvvv', $firstCellCoordinates[1] - 1, $lastCellCoordinates[1] - 1, PHPExcel_Cell::columnIndexFromString($firstCellCoordinates[0]) - 1, PHPExcel_Cell::columnIndexFromString($lastCellCoordinates[0]) - 1); + } + + /** + * Retrieves data from memory in one chunk, or from disk in $buffer + * sized chunks. + * + * @return string The data + */ + public function getData() + { + $buffer = 4096; + + // Return data stored in memory + if (isset($this->_data)) { + $tmp = $this->_data; + unset($this->_data); + return $tmp; + } + // No data to return + return false; + } + + /** + * Set the option to print the row and column headers on the printed page. + * + * @access public + * @param integer $print Whether to print the headers or not. Defaults to 1 (print). + */ + public function printRowColHeaders($print = 1) + { + $this->_print_headers = $print; + } + + /** + * This method sets the properties for outlining and grouping. The defaults + * correspond to Excel's defaults. + * + * @param bool $visible + * @param bool $symbols_below + * @param bool $symbols_right + * @param bool $auto_style + */ + public function setOutline($visible = true, $symbols_below = true, $symbols_right = true, $auto_style = false) + { + $this->outlineOn = $visible; + $this->outlineBelow = $symbols_below; + $this->outlineRight = $symbols_right; + $this->outlineStyle = $auto_style; + + // Ensure this is a boolean vale for Window2 + if ($this->outlineOn) { + $this->outlineOn = 1; + } + } + + /** + * Write a double to the specified row and column (zero indexed). + * An integer can be written as a double. Excel will display an + * integer. $format is optional. + * + * Returns 0 : normal termination + * -2 : row or column out of range + * + * @param integer $row Zero indexed row + * @param integer $col Zero indexed column + * @param float $num The number to write + * @param mixed $xfIndex The optional XF format + * @return integer + */ + private function writeNumber($row, $col, $num, $xfIndex) + { + $record = 0x0203; // Record identifier + $length = 0x000E; // Number of bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("vvv", $row, $col, $xfIndex); + $xl_double = pack("d", $num); + if (self::getByteOrder()) { // if it's Big Endian + $xl_double = strrev($xl_double); + } + + $this->append($header.$data.$xl_double); + return(0); + } + + /** + * Write a LABELSST record or a LABEL record. Which one depends on BIFF version + * + * @param int $row Row index (0-based) + * @param int $col Column index (0-based) + * @param string $str The string + * @param int $xfIndex Index to XF record + */ + private function writeString($row, $col, $str, $xfIndex) + { + $this->writeLabelSst($row, $col, $str, $xfIndex); + } + + /** + * Write a LABELSST record or a LABEL record. Which one depends on BIFF version + * It differs from writeString by the writing of rich text strings. + * @param int $row Row index (0-based) + * @param int $col Column index (0-based) + * @param string $str The string + * @param mixed $xfIndex The XF format index for the cell + * @param array $arrcRun Index to Font record and characters beginning + */ + private function writeRichTextString($row, $col, $str, $xfIndex, $arrcRun) + { + $record = 0x00FD; // Record identifier + $length = 0x000A; // Bytes to follow + $str = PHPExcel_Shared_String::UTF8toBIFF8UnicodeShort($str, $arrcRun); + + /* check if string is already present */ + if (!isset($this->stringTable[$str])) { + $this->stringTable[$str] = $this->stringUnique++; + } + $this->stringTotal++; + + $header = pack('vv', $record, $length); + $data = pack('vvvV', $row, $col, $xfIndex, $this->stringTable[$str]); + $this->append($header.$data); + } + + /** + * Write a string to the specified row and column (zero indexed). + * NOTE: there is an Excel 5 defined limit of 255 characters. + * $format is optional. + * Returns 0 : normal termination + * -2 : row or column out of range + * -3 : long string truncated to 255 chars + * + * @access public + * @param integer $row Zero indexed row + * @param integer $col Zero indexed column + * @param string $str The string to write + * @param mixed $xfIndex The XF format index for the cell + * @return integer + */ + private function writeLabel($row, $col, $str, $xfIndex) + { + $strlen = strlen($str); + $record = 0x0204; // Record identifier + $length = 0x0008 + $strlen; // Bytes to follow + + $str_error = 0; + + if ($strlen > $this->xlsStringMaxLength) { // LABEL must be < 255 chars + $str = substr($str, 0, $this->xlsStringMaxLength); + $length = 0x0008 + $this->xlsStringMaxLength; + $strlen = $this->xlsStringMaxLength; + $str_error = -3; + } + + $header = pack("vv", $record, $length); + $data = pack("vvvv", $row, $col, $xfIndex, $strlen); + $this->append($header . $data . $str); + return($str_error); + } + + /** + * Write a string to the specified row and column (zero indexed). + * This is the BIFF8 version (no 255 chars limit). + * $format is optional. + * Returns 0 : normal termination + * -2 : row or column out of range + * -3 : long string truncated to 255 chars + * + * @access public + * @param integer $row Zero indexed row + * @param integer $col Zero indexed column + * @param string $str The string to write + * @param mixed $xfIndex The XF format index for the cell + * @return integer + */ + private function writeLabelSst($row, $col, $str, $xfIndex) + { + $record = 0x00FD; // Record identifier + $length = 0x000A; // Bytes to follow + + $str = PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($str); + + /* check if string is already present */ + if (!isset($this->stringTable[$str])) { + $this->stringTable[$str] = $this->stringUnique++; + } + $this->stringTotal++; + + $header = pack('vv', $record, $length); + $data = pack('vvvV', $row, $col, $xfIndex, $this->stringTable[$str]); + $this->append($header.$data); + } + + /** + * Writes a note associated with the cell given by the row and column. + * NOTE records don't have a length limit. + * + * @param integer $row Zero indexed row + * @param integer $col Zero indexed column + * @param string $note The note to write + */ + private function writeNote($row, $col, $note) + { + $note_length = strlen($note); + $record = 0x001C; // Record identifier + $max_length = 2048; // Maximun length for a NOTE record + + // Length for this record is no more than 2048 + 6 + $length = 0x0006 + min($note_length, 2048); + $header = pack("vv", $record, $length); + $data = pack("vvv", $row, $col, $note_length); + $this->append($header . $data . substr($note, 0, 2048)); + + for ($i = $max_length; $i < $note_length; $i += $max_length) { + $chunk = substr($note, $i, $max_length); + $length = 0x0006 + strlen($chunk); + $header = pack("vv", $record, $length); + $data = pack("vvv", -1, 0, strlen($chunk)); + $this->append($header.$data.$chunk); + } + return(0); + } + + /** + * Write a blank cell to the specified row and column (zero indexed). + * A blank cell is used to specify formatting without adding a string + * or a number. + * + * A blank cell without a format serves no purpose. Therefore, we don't write + * a BLANK record unless a format is specified. + * + * Returns 0 : normal termination (including no format) + * -1 : insufficient number of arguments + * -2 : row or column out of range + * + * @param integer $row Zero indexed row + * @param integer $col Zero indexed column + * @param mixed $xfIndex The XF format index + */ + public function writeBlank($row, $col, $xfIndex) + { + $record = 0x0201; // Record identifier + $length = 0x0006; // Number of bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("vvv", $row, $col, $xfIndex); + $this->append($header . $data); + return 0; + } + + /** + * Write a boolean or an error type to the specified row and column (zero indexed) + * + * @param int $row Row index (0-based) + * @param int $col Column index (0-based) + * @param int $value + * @param boolean $isError Error or Boolean? + * @param int $xfIndex + */ + private function writeBoolErr($row, $col, $value, $isError, $xfIndex) + { + $record = 0x0205; + $length = 8; + + $header = pack("vv", $record, $length); + $data = pack("vvvCC", $row, $col, $xfIndex, $value, $isError); + $this->append($header . $data); + return 0; + } + + /** + * Write a formula to the specified row and column (zero indexed). + * The textual representation of the formula is passed to the parser in + * Parser.php which returns a packed binary string. + * + * Returns 0 : normal termination + * -1 : formula errors (bad formula) + * -2 : row or column out of range + * + * @param integer $row Zero indexed row + * @param integer $col Zero indexed column + * @param string $formula The formula text string + * @param mixed $xfIndex The XF format index + * @param mixed $calculatedValue Calculated value + * @return integer + */ + private function writeFormula($row, $col, $formula, $xfIndex, $calculatedValue) + { + $record = 0x0006; // Record identifier + + // Initialize possible additional value for STRING record that should be written after the FORMULA record? + $stringValue = null; + + // calculated value + if (isset($calculatedValue)) { + // Since we can't yet get the data type of the calculated value, + // we use best effort to determine data type + if (is_bool($calculatedValue)) { + // Boolean value + $num = pack('CCCvCv', 0x01, 0x00, (int)$calculatedValue, 0x00, 0x00, 0xFFFF); + } elseif (is_int($calculatedValue) || is_float($calculatedValue)) { + // Numeric value + $num = pack('d', $calculatedValue); + } elseif (is_string($calculatedValue)) { + if (array_key_exists($calculatedValue, PHPExcel_Cell_DataType::getErrorCodes())) { + // Error value + $num = pack('CCCvCv', 0x02, 0x00, self::mapErrorCode($calculatedValue), 0x00, 0x00, 0xFFFF); + } elseif ($calculatedValue === '') { + // Empty string (and BIFF8) + $num = pack('CCCvCv', 0x03, 0x00, 0x00, 0x00, 0x00, 0xFFFF); + } else { + // Non-empty string value (or empty string BIFF5) + $stringValue = $calculatedValue; + $num = pack('CCCvCv', 0x00, 0x00, 0x00, 0x00, 0x00, 0xFFFF); + } + } else { + // We are really not supposed to reach here + $num = pack('d', 0x00); + } + } else { + $num = pack('d', 0x00); + } + + $grbit = 0x03; // Option flags + $unknown = 0x0000; // Must be zero + + // Strip the '=' or '@' sign at the beginning of the formula string + if ($formula{0} == '=') { + $formula = substr($formula, 1); + } else { + // Error handling + $this->writeString($row, $col, 'Unrecognised character for formula'); + return -1; + } + + // Parse the formula using the parser in Parser.php + try { + $error = $this->parser->parse($formula); + $formula = $this->parser->toReversePolish(); + + $formlen = strlen($formula); // Length of the binary string + $length = 0x16 + $formlen; // Length of the record data + + $header = pack("vv", $record, $length); + + $data = pack("vvv", $row, $col, $xfIndex) + . $num + . pack("vVv", $grbit, $unknown, $formlen); + $this->append($header . $data . $formula); + + // Append also a STRING record if necessary + if ($stringValue !== null) { + $this->writeStringRecord($stringValue); + } + + return 0; + + } catch (PHPExcel_Exception $e) { + // do nothing + } + + } + + /** + * Write a STRING record. This + * + * @param string $stringValue + */ + private function writeStringRecord($stringValue) + { + $record = 0x0207; // Record identifier + $data = PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($stringValue); + + $length = strlen($data); + $header = pack('vv', $record, $length); + + $this->append($header . $data); + } + + /** + * Write a hyperlink. + * This is comprised of two elements: the visible label and + * the invisible link. The visible label is the same as the link unless an + * alternative string is specified. The label is written using the + * writeString() method. Therefore the 255 characters string limit applies. + * $string and $format are optional. + * + * The hyperlink can be to a http, ftp, mail, internal sheet (not yet), or external + * directory url. + * + * Returns 0 : normal termination + * -2 : row or column out of range + * -3 : long string truncated to 255 chars + * + * @param integer $row Row + * @param integer $col Column + * @param string $url URL string + * @return integer + */ + private function writeUrl($row, $col, $url) + { + // Add start row and col to arg list + return($this->writeUrlRange($row, $col, $row, $col, $url)); + } + + /** + * This is the more general form of writeUrl(). It allows a hyperlink to be + * written to a range of cells. This function also decides the type of hyperlink + * to be written. These are either, Web (http, ftp, mailto), Internal + * (Sheet1!A1) or external ('c:\temp\foo.xls#Sheet1!A1'). + * + * @access private + * @see writeUrl() + * @param integer $row1 Start row + * @param integer $col1 Start column + * @param integer $row2 End row + * @param integer $col2 End column + * @param string $url URL string + * @return integer + */ + public function writeUrlRange($row1, $col1, $row2, $col2, $url) + { + // Check for internal/external sheet links or default to web link + if (preg_match('[^internal:]', $url)) { + return($this->writeUrlInternal($row1, $col1, $row2, $col2, $url)); + } + if (preg_match('[^external:]', $url)) { + return($this->writeUrlExternal($row1, $col1, $row2, $col2, $url)); + } + return($this->writeUrlWeb($row1, $col1, $row2, $col2, $url)); + } + + /** + * Used to write http, ftp and mailto hyperlinks. + * The link type ($options) is 0x03 is the same as absolute dir ref without + * sheet. However it is differentiated by the $unknown2 data stream. + * + * @access private + * @see writeUrl() + * @param integer $row1 Start row + * @param integer $col1 Start column + * @param integer $row2 End row + * @param integer $col2 End column + * @param string $url URL string + * @return integer + */ + public function writeUrlWeb($row1, $col1, $row2, $col2, $url) + { + $record = 0x01B8; // Record identifier + $length = 0x00000; // Bytes to follow + + // Pack the undocumented parts of the hyperlink stream + $unknown1 = pack("H*", "D0C9EA79F9BACE118C8200AA004BA90B02000000"); + $unknown2 = pack("H*", "E0C9EA79F9BACE118C8200AA004BA90B"); + + // Pack the option flags + $options = pack("V", 0x03); + + // Convert URL to a null terminated wchar string + $url = join("\0", preg_split("''", $url, -1, PREG_SPLIT_NO_EMPTY)); + $url = $url . "\0\0\0"; + + // Pack the length of the URL + $url_len = pack("V", strlen($url)); + + // Calculate the data length + $length = 0x34 + strlen($url); + + // Pack the header data + $header = pack("vv", $record, $length); + $data = pack("vvvv", $row1, $row2, $col1, $col2); + + // Write the packed data + $this->append($header . $data . + $unknown1 . $options . + $unknown2 . $url_len . $url); + return 0; + } + + /** + * Used to write internal reference hyperlinks such as "Sheet1!A1". + * + * @access private + * @see writeUrl() + * @param integer $row1 Start row + * @param integer $col1 Start column + * @param integer $row2 End row + * @param integer $col2 End column + * @param string $url URL string + * @return integer + */ + public function writeUrlInternal($row1, $col1, $row2, $col2, $url) + { + $record = 0x01B8; // Record identifier + $length = 0x00000; // Bytes to follow + + // Strip URL type + $url = preg_replace('/^internal:/', '', $url); + + // Pack the undocumented parts of the hyperlink stream + $unknown1 = pack("H*", "D0C9EA79F9BACE118C8200AA004BA90B02000000"); + + // Pack the option flags + $options = pack("V", 0x08); + + // Convert the URL type and to a null terminated wchar string + $url .= "\0"; + + // character count + $url_len = PHPExcel_Shared_String::CountCharacters($url); + $url_len = pack('V', $url_len); + + $url = PHPExcel_Shared_String::ConvertEncoding($url, 'UTF-16LE', 'UTF-8'); + + // Calculate the data length + $length = 0x24 + strlen($url); + + // Pack the header data + $header = pack("vv", $record, $length); + $data = pack("vvvv", $row1, $row2, $col1, $col2); + + // Write the packed data + $this->append($header . $data . + $unknown1 . $options . + $url_len . $url); + return 0; + } + + /** + * Write links to external directory names such as 'c:\foo.xls', + * c:\foo.xls#Sheet1!A1', '../../foo.xls'. and '../../foo.xls#Sheet1!A1'. + * + * Note: Excel writes some relative links with the $dir_long string. We ignore + * these cases for the sake of simpler code. + * + * @access private + * @see writeUrl() + * @param integer $row1 Start row + * @param integer $col1 Start column + * @param integer $row2 End row + * @param integer $col2 End column + * @param string $url URL string + * @return integer + */ + public function writeUrlExternal($row1, $col1, $row2, $col2, $url) + { + // Network drives are different. We will handle them separately + // MS/Novell network drives and shares start with \\ + if (preg_match('[^external:\\\\]', $url)) { + return; //($this->writeUrlExternal_net($row1, $col1, $row2, $col2, $url, $str, $format)); + } + + $record = 0x01B8; // Record identifier + $length = 0x00000; // Bytes to follow + + // Strip URL type and change Unix dir separator to Dos style (if needed) + // + $url = preg_replace('/^external:/', '', $url); + $url = preg_replace('/\//', "\\", $url); + + // Determine if the link is relative or absolute: + // relative if link contains no dir separator, "somefile.xls" + // relative if link starts with up-dir, "..\..\somefile.xls" + // otherwise, absolute + + $absolute = 0x00; // relative path + if (preg_match('/^[A-Z]:/', $url)) { + $absolute = 0x02; // absolute path on Windows, e.g. C:\... + } + $link_type = 0x01 | $absolute; + + // Determine if the link contains a sheet reference and change some of the + // parameters accordingly. + // Split the dir name and sheet name (if it exists) + $dir_long = $url; + if (preg_match("/\#/", $url)) { + $link_type |= 0x08; + } + + + // Pack the link type + $link_type = pack("V", $link_type); + + // Calculate the up-level dir count e.g.. (..\..\..\ == 3) + $up_count = preg_match_all("/\.\.\\\/", $dir_long, $useless); + $up_count = pack("v", $up_count); + + // Store the short dos dir name (null terminated) + $dir_short = preg_replace("/\.\.\\\/", '', $dir_long) . "\0"; + + // Store the long dir name as a wchar string (non-null terminated) + $dir_long = $dir_long . "\0"; + + // Pack the lengths of the dir strings + $dir_short_len = pack("V", strlen($dir_short)); + $dir_long_len = pack("V", strlen($dir_long)); + $stream_len = pack("V", 0); //strlen($dir_long) + 0x06); + + // Pack the undocumented parts of the hyperlink stream + $unknown1 = pack("H*", 'D0C9EA79F9BACE118C8200AA004BA90B02000000'); + $unknown2 = pack("H*", '0303000000000000C000000000000046'); + $unknown3 = pack("H*", 'FFFFADDE000000000000000000000000000000000000000'); + $unknown4 = pack("v", 0x03); + + // Pack the main data stream + $data = pack("vvvv", $row1, $row2, $col1, $col2) . + $unknown1 . + $link_type . + $unknown2 . + $up_count . + $dir_short_len. + $dir_short . + $unknown3 . + $stream_len ;/*. + $dir_long_len . + $unknown4 . + $dir_long . + $sheet_len . + $sheet ;*/ + + // Pack the header data + $length = strlen($data); + $header = pack("vv", $record, $length); + + // Write the packed data + $this->append($header. $data); + return 0; + } + + /** + * This method is used to set the height and format for a row. + * + * @param integer $row The row to set + * @param integer $height Height we are giving to the row. + * Use null to set XF without setting height + * @param integer $xfIndex The optional cell style Xf index to apply to the columns + * @param bool $hidden The optional hidden attribute + * @param integer $level The optional outline level for row, in range [0,7] + */ + private function writeRow($row, $height, $xfIndex, $hidden = false, $level = 0) + { + $record = 0x0208; // Record identifier + $length = 0x0010; // Number of bytes to follow + + $colMic = 0x0000; // First defined column + $colMac = 0x0000; // Last defined column + $irwMac = 0x0000; // Used by Excel to optimise loading + $reserved = 0x0000; // Reserved + $grbit = 0x0000; // Option flags + $ixfe = $xfIndex; + + if ($height < 0) { + $height = null; + } + + // Use writeRow($row, null, $XF) to set XF format without setting height + if ($height != null) { + $miyRw = $height * 20; // row height + } else { + $miyRw = 0xff; // default row height is 256 + } + + // Set the options flags. fUnsynced is used to show that the font and row + // heights are not compatible. This is usually the case for WriteExcel. + // The collapsed flag 0x10 doesn't seem to be used to indicate that a row + // is collapsed. Instead it is used to indicate that the previous row is + // collapsed. The zero height flag, 0x20, is used to collapse a row. + + $grbit |= $level; + if ($hidden) { + $grbit |= 0x0030; + } + if ($height !== null) { + $grbit |= 0x0040; // fUnsynced + } + if ($xfIndex !== 0xF) { + $grbit |= 0x0080; + } + $grbit |= 0x0100; + + $header = pack("vv", $record, $length); + $data = pack("vvvvvvvv", $row, $colMic, $colMac, $miyRw, $irwMac, $reserved, $grbit, $ixfe); + $this->append($header.$data); + } + + /** + * Writes Excel DIMENSIONS to define the area in which there is data. + */ + private function writeDimensions() + { + $record = 0x0200; // Record identifier + + $length = 0x000E; + $data = pack('VVvvv', $this->firstRowIndex, $this->lastRowIndex + 1, $this->firstColumnIndex, $this->lastColumnIndex + 1, 0x0000); // reserved + + $header = pack("vv", $record, $length); + $this->append($header.$data); + } + + /** + * Write BIFF record Window2. + */ + private function writeWindow2() + { + $record = 0x023E; // Record identifier + $length = 0x0012; + + $grbit = 0x00B6; // Option flags + $rwTop = 0x0000; // Top row visible in window + $colLeft = 0x0000; // Leftmost column visible in window + + + // The options flags that comprise $grbit + $fDspFmla = 0; // 0 - bit + $fDspGrid = $this->phpSheet->getShowGridlines() ? 1 : 0; // 1 + $fDspRwCol = $this->phpSheet->getShowRowColHeaders() ? 1 : 0; // 2 + $fFrozen = $this->phpSheet->getFreezePane() ? 1 : 0; // 3 + $fDspZeros = 1; // 4 + $fDefaultHdr = 1; // 5 + $fArabic = $this->phpSheet->getRightToLeft() ? 1 : 0; // 6 + $fDspGuts = $this->outlineOn; // 7 + $fFrozenNoSplit = 0; // 0 - bit + // no support in PHPExcel for selected sheet, therefore sheet is only selected if it is the active sheet + $fSelected = ($this->phpSheet === $this->phpSheet->getParent()->getActiveSheet()) ? 1 : 0; + $fPaged = 1; // 2 + $fPageBreakPreview = $this->phpSheet->getSheetView()->getView() === PHPExcel_Worksheet_SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW; + + $grbit = $fDspFmla; + $grbit |= $fDspGrid << 1; + $grbit |= $fDspRwCol << 2; + $grbit |= $fFrozen << 3; + $grbit |= $fDspZeros << 4; + $grbit |= $fDefaultHdr << 5; + $grbit |= $fArabic << 6; + $grbit |= $fDspGuts << 7; + $grbit |= $fFrozenNoSplit << 8; + $grbit |= $fSelected << 9; + $grbit |= $fPaged << 10; + $grbit |= $fPageBreakPreview << 11; + + $header = pack("vv", $record, $length); + $data = pack("vvv", $grbit, $rwTop, $colLeft); + + // FIXME !!! + $rgbHdr = 0x0040; // Row/column heading and gridline color index + $zoom_factor_page_break = ($fPageBreakPreview ? $this->phpSheet->getSheetView()->getZoomScale() : 0x0000); + $zoom_factor_normal = $this->phpSheet->getSheetView()->getZoomScaleNormal(); + + $data .= pack("vvvvV", $rgbHdr, 0x0000, $zoom_factor_page_break, $zoom_factor_normal, 0x00000000); + + $this->append($header.$data); + } + + /** + * Write BIFF record DEFAULTROWHEIGHT. + */ + private function writeDefaultRowHeight() + { + $defaultRowHeight = $this->phpSheet->getDefaultRowDimension()->getRowHeight(); + + if ($defaultRowHeight < 0) { + return; + } + + // convert to twips + $defaultRowHeight = (int) 20 * $defaultRowHeight; + + $record = 0x0225; // Record identifier + $length = 0x0004; // Number of bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("vv", 1, $defaultRowHeight); + $this->append($header . $data); + } + + /** + * Write BIFF record DEFCOLWIDTH if COLINFO records are in use. + */ + private function writeDefcol() + { + $defaultColWidth = 8; + + $record = 0x0055; // Record identifier + $length = 0x0002; // Number of bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("v", $defaultColWidth); + $this->append($header . $data); + } + + /** + * Write BIFF record COLINFO to define column widths + * + * Note: The SDK says the record length is 0x0B but Excel writes a 0x0C + * length record. + * + * @param array $col_array This is the only parameter received and is composed of the following: + * 0 => First formatted column, + * 1 => Last formatted column, + * 2 => Col width (8.43 is Excel default), + * 3 => The optional XF format of the column, + * 4 => Option flags. + * 5 => Optional outline level + */ + private function writeColinfo($col_array) + { + if (isset($col_array[0])) { + $colFirst = $col_array[0]; + } + if (isset($col_array[1])) { + $colLast = $col_array[1]; + } + if (isset($col_array[2])) { + $coldx = $col_array[2]; + } else { + $coldx = 8.43; + } + if (isset($col_array[3])) { + $xfIndex = $col_array[3]; + } else { + $xfIndex = 15; + } + if (isset($col_array[4])) { + $grbit = $col_array[4]; + } else { + $grbit = 0; + } + if (isset($col_array[5])) { + $level = $col_array[5]; + } else { + $level = 0; + } + $record = 0x007D; // Record identifier + $length = 0x000C; // Number of bytes to follow + + $coldx *= 256; // Convert to units of 1/256 of a char + + $ixfe = $xfIndex; + $reserved = 0x0000; // Reserved + + $level = max(0, min($level, 7)); + $grbit |= $level << 8; + + $header = pack("vv", $record, $length); + $data = pack("vvvvvv", $colFirst, $colLast, $coldx, $ixfe, $grbit, $reserved); + $this->append($header.$data); + } + + /** + * Write BIFF record SELECTION. + */ + private function writeSelection() + { + // look up the selected cell range + $selectedCells = $this->phpSheet->getSelectedCells(); + $selectedCells = PHPExcel_Cell::splitRange($this->phpSheet->getSelectedCells()); + $selectedCells = $selectedCells[0]; + if (count($selectedCells) == 2) { + list($first, $last) = $selectedCells; + } else { + $first = $selectedCells[0]; + $last = $selectedCells[0]; + } + + list($colFirst, $rwFirst) = PHPExcel_Cell::coordinateFromString($first); + $colFirst = PHPExcel_Cell::columnIndexFromString($colFirst) - 1; // base 0 column index + --$rwFirst; // base 0 row index + + list($colLast, $rwLast) = PHPExcel_Cell::coordinateFromString($last); + $colLast = PHPExcel_Cell::columnIndexFromString($colLast) - 1; // base 0 column index + --$rwLast; // base 0 row index + + // make sure we are not out of bounds + $colFirst = min($colFirst, 255); + $colLast = min($colLast, 255); + + $rwFirst = min($rwFirst, 65535); + $rwLast = min($rwLast, 65535); + + $record = 0x001D; // Record identifier + $length = 0x000F; // Number of bytes to follow + + $pnn = $this->activePane; // Pane position + $rwAct = $rwFirst; // Active row + $colAct = $colFirst; // Active column + $irefAct = 0; // Active cell ref + $cref = 1; // Number of refs + + if (!isset($rwLast)) { + $rwLast = $rwFirst; // Last row in reference + } + if (!isset($colLast)) { + $colLast = $colFirst; // Last col in reference + } + + // Swap last row/col for first row/col as necessary + if ($rwFirst > $rwLast) { + list($rwFirst, $rwLast) = array($rwLast, $rwFirst); + } + + if ($colFirst > $colLast) { + list($colFirst, $colLast) = array($colLast, $colFirst); + } + + $header = pack("vv", $record, $length); + $data = pack("CvvvvvvCC", $pnn, $rwAct, $colAct, $irefAct, $cref, $rwFirst, $rwLast, $colFirst, $colLast); + $this->append($header . $data); + } + + /** + * Store the MERGEDCELLS records for all ranges of merged cells + */ + private function writeMergedCells() + { + $mergeCells = $this->phpSheet->getMergeCells(); + $countMergeCells = count($mergeCells); + + if ($countMergeCells == 0) { + return; + } + + // maximum allowed number of merged cells per record + $maxCountMergeCellsPerRecord = 1027; + + // record identifier + $record = 0x00E5; + + // counter for total number of merged cells treated so far by the writer + $i = 0; + + // counter for number of merged cells written in record currently being written + $j = 0; + + // initialize record data + $recordData = ''; + + // loop through the merged cells + foreach ($mergeCells as $mergeCell) { + ++$i; + ++$j; + + // extract the row and column indexes + $range = PHPExcel_Cell::splitRange($mergeCell); + list($first, $last) = $range[0]; + list($firstColumn, $firstRow) = PHPExcel_Cell::coordinateFromString($first); + list($lastColumn, $lastRow) = PHPExcel_Cell::coordinateFromString($last); + + $recordData .= pack('vvvv', $firstRow - 1, $lastRow - 1, PHPExcel_Cell::columnIndexFromString($firstColumn) - 1, PHPExcel_Cell::columnIndexFromString($lastColumn) - 1); + + // flush record if we have reached limit for number of merged cells, or reached final merged cell + if ($j == $maxCountMergeCellsPerRecord or $i == $countMergeCells) { + $recordData = pack('v', $j) . $recordData; + $length = strlen($recordData); + $header = pack('vv', $record, $length); + $this->append($header . $recordData); + + // initialize for next record, if any + $recordData = ''; + $j = 0; + } + } + } + + /** + * Write SHEETLAYOUT record + */ + private function writeSheetLayout() + { + if (!$this->phpSheet->isTabColorSet()) { + return; + } + + $recordData = pack( + 'vvVVVvv', + 0x0862, + 0x0000, // unused + 0x00000000, // unused + 0x00000000, // unused + 0x00000014, // size of record data + $this->colors[$this->phpSheet->getTabColor()->getRGB()], // color index + 0x0000 // unused + ); + + $length = strlen($recordData); + + $record = 0x0862; // Record identifier + $header = pack('vv', $record, $length); + $this->append($header . $recordData); + } + + /** + * Write SHEETPROTECTION + */ + private function writeSheetProtection() + { + // record identifier + $record = 0x0867; + + // prepare options + $options = (int) !$this->phpSheet->getProtection()->getObjects() + | (int) !$this->phpSheet->getProtection()->getScenarios() << 1 + | (int) !$this->phpSheet->getProtection()->getFormatCells() << 2 + | (int) !$this->phpSheet->getProtection()->getFormatColumns() << 3 + | (int) !$this->phpSheet->getProtection()->getFormatRows() << 4 + | (int) !$this->phpSheet->getProtection()->getInsertColumns() << 5 + | (int) !$this->phpSheet->getProtection()->getInsertRows() << 6 + | (int) !$this->phpSheet->getProtection()->getInsertHyperlinks() << 7 + | (int) !$this->phpSheet->getProtection()->getDeleteColumns() << 8 + | (int) !$this->phpSheet->getProtection()->getDeleteRows() << 9 + | (int) !$this->phpSheet->getProtection()->getSelectLockedCells() << 10 + | (int) !$this->phpSheet->getProtection()->getSort() << 11 + | (int) !$this->phpSheet->getProtection()->getAutoFilter() << 12 + | (int) !$this->phpSheet->getProtection()->getPivotTables() << 13 + | (int) !$this->phpSheet->getProtection()->getSelectUnlockedCells() << 14 ; + + // record data + $recordData = pack( + 'vVVCVVvv', + 0x0867, // repeated record identifier + 0x0000, // not used + 0x0000, // not used + 0x00, // not used + 0x01000200, // unknown data + 0xFFFFFFFF, // unknown data + $options, // options + 0x0000 // not used + ); + + $length = strlen($recordData); + $header = pack('vv', $record, $length); + + $this->append($header . $recordData); + } + + /** + * Write BIFF record RANGEPROTECTION + * + * Openoffice.org's Documentaion of the Microsoft Excel File Format uses term RANGEPROTECTION for these records + * Microsoft Office Excel 97-2007 Binary File Format Specification uses term FEAT for these records + */ + private function writeRangeProtection() + { + foreach ($this->phpSheet->getProtectedCells() as $range => $password) { + // number of ranges, e.g. 'A1:B3 C20:D25' + $cellRanges = explode(' ', $range); + $cref = count($cellRanges); + + $recordData = pack( + 'vvVVvCVvVv', + 0x0868, + 0x00, + 0x0000, + 0x0000, + 0x02, + 0x0, + 0x0000, + $cref, + 0x0000, + 0x00 + ); + + foreach ($cellRanges as $cellRange) { + $recordData .= $this->writeBIFF8CellRangeAddressFixed($cellRange); + } + + // the rgbFeat structure + $recordData .= pack( + 'VV', + 0x0000, + hexdec($password) + ); + + $recordData .= PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong('p' . md5($recordData)); + + $length = strlen($recordData); + + $record = 0x0868; // Record identifier + $header = pack("vv", $record, $length); + $this->append($header . $recordData); + } + } + + /** + * Write BIFF record EXTERNCOUNT to indicate the number of external sheet + * references in a worksheet. + * + * Excel only stores references to external sheets that are used in formulas. + * For simplicity we store references to all the sheets in the workbook + * regardless of whether they are used or not. This reduces the overall + * complexity and eliminates the need for a two way dialogue between the formula + * parser the worksheet objects. + * + * @param integer $count The number of external sheet references in this worksheet + */ + private function writeExterncount($count) + { + $record = 0x0016; // Record identifier + $length = 0x0002; // Number of bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("v", $count); + $this->append($header . $data); + } + + /** + * Writes the Excel BIFF EXTERNSHEET record. These references are used by + * formulas. A formula references a sheet name via an index. Since we store a + * reference to all of the external worksheets the EXTERNSHEET index is the same + * as the worksheet index. + * + * @param string $sheetname The name of a external worksheet + */ + private function writeExternsheet($sheetname) + { + $record = 0x0017; // Record identifier + + // References to the current sheet are encoded differently to references to + // external sheets. + // + if ($this->phpSheet->getTitle() == $sheetname) { + $sheetname = ''; + $length = 0x02; // The following 2 bytes + $cch = 1; // The following byte + $rgch = 0x02; // Self reference + } else { + $length = 0x02 + strlen($sheetname); + $cch = strlen($sheetname); + $rgch = 0x03; // Reference to a sheet in the current workbook + } + + $header = pack("vv", $record, $length); + $data = pack("CC", $cch, $rgch); + $this->append($header . $data . $sheetname); + } + + /** + * Writes the Excel BIFF PANE record. + * The panes can either be frozen or thawed (unfrozen). + * Frozen panes are specified in terms of an integer number of rows and columns. + * Thawed panes are specified in terms of Excel's units for rows and columns. + */ + private function writePanes() + { + $panes = array(); + if ($freezePane = $this->phpSheet->getFreezePane()) { + list($column, $row) = PHPExcel_Cell::coordinateFromString($freezePane); + $panes[0] = $row - 1; + $panes[1] = PHPExcel_Cell::columnIndexFromString($column) - 1; + } else { + // thaw panes + return; + } + + $y = isset($panes[0]) ? $panes[0] : null; + $x = isset($panes[1]) ? $panes[1] : null; + $rwTop = isset($panes[2]) ? $panes[2] : null; + $colLeft = isset($panes[3]) ? $panes[3] : null; + if (count($panes) > 4) { // if Active pane was received + $pnnAct = $panes[4]; + } else { + $pnnAct = null; + } + $record = 0x0041; // Record identifier + $length = 0x000A; // Number of bytes to follow + + // Code specific to frozen or thawed panes. + if ($this->phpSheet->getFreezePane()) { + // Set default values for $rwTop and $colLeft + if (!isset($rwTop)) { + $rwTop = $y; + } + if (!isset($colLeft)) { + $colLeft = $x; + } + } else { + // Set default values for $rwTop and $colLeft + if (!isset($rwTop)) { + $rwTop = 0; + } + if (!isset($colLeft)) { + $colLeft = 0; + } + + // Convert Excel's row and column units to the internal units. + // The default row height is 12.75 + // The default column width is 8.43 + // The following slope and intersection values were interpolated. + // + $y = 20*$y + 255; + $x = 113.879*$x + 390; + } + + + // Determine which pane should be active. There is also the undocumented + // option to override this should it be necessary: may be removed later. + // + if (!isset($pnnAct)) { + if ($x != 0 && $y != 0) { + $pnnAct = 0; // Bottom right + } + if ($x != 0 && $y == 0) { + $pnnAct = 1; // Top right + } + if ($x == 0 && $y != 0) { + $pnnAct = 2; // Bottom left + } + if ($x == 0 && $y == 0) { + $pnnAct = 3; // Top left + } + } + + $this->activePane = $pnnAct; // Used in writeSelection + + $header = pack("vv", $record, $length); + $data = pack("vvvvv", $x, $y, $rwTop, $colLeft, $pnnAct); + $this->append($header . $data); + } + + /** + * Store the page setup SETUP BIFF record. + */ + private function writeSetup() + { + $record = 0x00A1; // Record identifier + $length = 0x0022; // Number of bytes to follow + + $iPaperSize = $this->phpSheet->getPageSetup()->getPaperSize(); // Paper size + + $iScale = $this->phpSheet->getPageSetup()->getScale() ? + $this->phpSheet->getPageSetup()->getScale() : 100; // Print scaling factor + + $iPageStart = 0x01; // Starting page number + $iFitWidth = (int) $this->phpSheet->getPageSetup()->getFitToWidth(); // Fit to number of pages wide + $iFitHeight = (int) $this->phpSheet->getPageSetup()->getFitToHeight(); // Fit to number of pages high + $grbit = 0x00; // Option flags + $iRes = 0x0258; // Print resolution + $iVRes = 0x0258; // Vertical print resolution + + $numHdr = $this->phpSheet->getPageMargins()->getHeader(); // Header Margin + + $numFtr = $this->phpSheet->getPageMargins()->getFooter(); // Footer Margin + $iCopies = 0x01; // Number of copies + + $fLeftToRight = 0x0; // Print over then down + + // Page orientation + $fLandscape = ($this->phpSheet->getPageSetup()->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? + 0x0 : 0x1; + + $fNoPls = 0x0; // Setup not read from printer + $fNoColor = 0x0; // Print black and white + $fDraft = 0x0; // Print draft quality + $fNotes = 0x0; // Print notes + $fNoOrient = 0x0; // Orientation not set + $fUsePage = 0x0; // Use custom starting page + + $grbit = $fLeftToRight; + $grbit |= $fLandscape << 1; + $grbit |= $fNoPls << 2; + $grbit |= $fNoColor << 3; + $grbit |= $fDraft << 4; + $grbit |= $fNotes << 5; + $grbit |= $fNoOrient << 6; + $grbit |= $fUsePage << 7; + + $numHdr = pack("d", $numHdr); + $numFtr = pack("d", $numFtr); + if (self::getByteOrder()) { // if it's Big Endian + $numHdr = strrev($numHdr); + $numFtr = strrev($numFtr); + } + + $header = pack("vv", $record, $length); + $data1 = pack("vvvvvvvv", $iPaperSize, $iScale, $iPageStart, $iFitWidth, $iFitHeight, $grbit, $iRes, $iVRes); + $data2 = $numHdr.$numFtr; + $data3 = pack("v", $iCopies); + $this->append($header . $data1 . $data2 . $data3); + } + + /** + * Store the header caption BIFF record. + */ + private function writeHeader() + { + $record = 0x0014; // Record identifier + + /* removing for now + // need to fix character count (multibyte!) + if (strlen($this->phpSheet->getHeaderFooter()->getOddHeader()) <= 255) { + $str = $this->phpSheet->getHeaderFooter()->getOddHeader(); // header string + } else { + $str = ''; + } + */ + + $recordData = PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader()); + $length = strlen($recordData); + + $header = pack("vv", $record, $length); + + $this->append($header . $recordData); + } + + /** + * Store the footer caption BIFF record. + */ + private function writeFooter() + { + $record = 0x0015; // Record identifier + + /* removing for now + // need to fix character count (multibyte!) + if (strlen($this->phpSheet->getHeaderFooter()->getOddFooter()) <= 255) { + $str = $this->phpSheet->getHeaderFooter()->getOddFooter(); + } else { + $str = ''; + } + */ + + $recordData = PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddFooter()); + $length = strlen($recordData); + + $header = pack("vv", $record, $length); + + $this->append($header . $recordData); + } + + /** + * Store the horizontal centering HCENTER BIFF record. + * + * @access private + */ + private function writeHcenter() + { + $record = 0x0083; // Record identifier + $length = 0x0002; // Bytes to follow + + $fHCenter = $this->phpSheet->getPageSetup()->getHorizontalCentered() ? 1 : 0; // Horizontal centering + + $header = pack("vv", $record, $length); + $data = pack("v", $fHCenter); + + $this->append($header.$data); + } + + /** + * Store the vertical centering VCENTER BIFF record. + */ + private function writeVcenter() + { + $record = 0x0084; // Record identifier + $length = 0x0002; // Bytes to follow + + $fVCenter = $this->phpSheet->getPageSetup()->getVerticalCentered() ? 1 : 0; // Horizontal centering + + $header = pack("vv", $record, $length); + $data = pack("v", $fVCenter); + $this->append($header . $data); + } + + /** + * Store the LEFTMARGIN BIFF record. + */ + private function writeMarginLeft() + { + $record = 0x0026; // Record identifier + $length = 0x0008; // Bytes to follow + + $margin = $this->phpSheet->getPageMargins()->getLeft(); // Margin in inches + + $header = pack("vv", $record, $length); + $data = pack("d", $margin); + if (self::getByteOrder()) { // if it's Big Endian + $data = strrev($data); + } + + $this->append($header . $data); + } + + /** + * Store the RIGHTMARGIN BIFF record. + */ + private function writeMarginRight() + { + $record = 0x0027; // Record identifier + $length = 0x0008; // Bytes to follow + + $margin = $this->phpSheet->getPageMargins()->getRight(); // Margin in inches + + $header = pack("vv", $record, $length); + $data = pack("d", $margin); + if (self::getByteOrder()) { // if it's Big Endian + $data = strrev($data); + } + + $this->append($header . $data); + } + + /** + * Store the TOPMARGIN BIFF record. + */ + private function writeMarginTop() + { + $record = 0x0028; // Record identifier + $length = 0x0008; // Bytes to follow + + $margin = $this->phpSheet->getPageMargins()->getTop(); // Margin in inches + + $header = pack("vv", $record, $length); + $data = pack("d", $margin); + if (self::getByteOrder()) { // if it's Big Endian + $data = strrev($data); + } + + $this->append($header . $data); + } + + /** + * Store the BOTTOMMARGIN BIFF record. + */ + private function writeMarginBottom() + { + $record = 0x0029; // Record identifier + $length = 0x0008; // Bytes to follow + + $margin = $this->phpSheet->getPageMargins()->getBottom(); // Margin in inches + + $header = pack("vv", $record, $length); + $data = pack("d", $margin); + if (self::getByteOrder()) { // if it's Big Endian + $data = strrev($data); + } + + $this->append($header . $data); + } + + /** + * Write the PRINTHEADERS BIFF record. + */ + private function writePrintHeaders() + { + $record = 0x002a; // Record identifier + $length = 0x0002; // Bytes to follow + + $fPrintRwCol = $this->_print_headers; // Boolean flag + + $header = pack("vv", $record, $length); + $data = pack("v", $fPrintRwCol); + $this->append($header . $data); + } + + /** + * Write the PRINTGRIDLINES BIFF record. Must be used in conjunction with the + * GRIDSET record. + */ + private function writePrintGridlines() + { + $record = 0x002b; // Record identifier + $length = 0x0002; // Bytes to follow + + $fPrintGrid = $this->phpSheet->getPrintGridlines() ? 1 : 0; // Boolean flag + + $header = pack("vv", $record, $length); + $data = pack("v", $fPrintGrid); + $this->append($header . $data); + } + + /** + * Write the GRIDSET BIFF record. Must be used in conjunction with the + * PRINTGRIDLINES record. + */ + private function writeGridset() + { + $record = 0x0082; // Record identifier + $length = 0x0002; // Bytes to follow + + $fGridSet = !$this->phpSheet->getPrintGridlines(); // Boolean flag + + $header = pack("vv", $record, $length); + $data = pack("v", $fGridSet); + $this->append($header . $data); + } + + /** + * Write the AUTOFILTERINFO BIFF record. This is used to configure the number of autofilter select used in the sheet. + */ + private function writeAutoFilterInfo() + { + $record = 0x009D; // Record identifier + $length = 0x0002; // Bytes to follow + + $rangeBounds = PHPExcel_Cell::rangeBoundaries($this->phpSheet->getAutoFilter()->getRange()); + $iNumFilters = 1 + $rangeBounds[1][0] - $rangeBounds[0][0]; + + $header = pack("vv", $record, $length); + $data = pack("v", $iNumFilters); + $this->append($header . $data); + } + + /** + * Write the GUTS BIFF record. This is used to configure the gutter margins + * where Excel outline symbols are displayed. The visibility of the gutters is + * controlled by a flag in WSBOOL. + * + * @see writeWsbool() + */ + private function writeGuts() + { + $record = 0x0080; // Record identifier + $length = 0x0008; // Bytes to follow + + $dxRwGut = 0x0000; // Size of row gutter + $dxColGut = 0x0000; // Size of col gutter + + // determine maximum row outline level + $maxRowOutlineLevel = 0; + foreach ($this->phpSheet->getRowDimensions() as $rowDimension) { + $maxRowOutlineLevel = max($maxRowOutlineLevel, $rowDimension->getOutlineLevel()); + } + + $col_level = 0; + + // Calculate the maximum column outline level. The equivalent calculation + // for the row outline level is carried out in writeRow(). + $colcount = count($this->columnInfo); + for ($i = 0; $i < $colcount; ++$i) { + $col_level = max($this->columnInfo[$i][5], $col_level); + } + + // Set the limits for the outline levels (0 <= x <= 7). + $col_level = max(0, min($col_level, 7)); + + // The displayed level is one greater than the max outline levels + if ($maxRowOutlineLevel) { + ++$maxRowOutlineLevel; + } + if ($col_level) { + ++$col_level; + } + + $header = pack("vv", $record, $length); + $data = pack("vvvv", $dxRwGut, $dxColGut, $maxRowOutlineLevel, $col_level); + + $this->append($header.$data); + } + + /** + * Write the WSBOOL BIFF record, mainly for fit-to-page. Used in conjunction + * with the SETUP record. + */ + private function writeWsbool() + { + $record = 0x0081; // Record identifier + $length = 0x0002; // Bytes to follow + $grbit = 0x0000; + + // The only option that is of interest is the flag for fit to page. So we + // set all the options in one go. + // + // Set the option flags + $grbit |= 0x0001; // Auto page breaks visible + if ($this->outlineStyle) { + $grbit |= 0x0020; // Auto outline styles + } + if ($this->phpSheet->getShowSummaryBelow()) { + $grbit |= 0x0040; // Outline summary below + } + if ($this->phpSheet->getShowSummaryRight()) { + $grbit |= 0x0080; // Outline summary right + } + if ($this->phpSheet->getPageSetup()->getFitToPage()) { + $grbit |= 0x0100; // Page setup fit to page + } + if ($this->outlineOn) { + $grbit |= 0x0400; // Outline symbols displayed + } + + $header = pack("vv", $record, $length); + $data = pack("v", $grbit); + $this->append($header . $data); + } + + /** + * Write the HORIZONTALPAGEBREAKS and VERTICALPAGEBREAKS BIFF records. + */ + private function writeBreaks() + { + // initialize + $vbreaks = array(); + $hbreaks = array(); + + foreach ($this->phpSheet->getBreaks() as $cell => $breakType) { + // Fetch coordinates + $coordinates = PHPExcel_Cell::coordinateFromString($cell); + + // Decide what to do by the type of break + switch ($breakType) { + case PHPExcel_Worksheet::BREAK_COLUMN: + // Add to list of vertical breaks + $vbreaks[] = PHPExcel_Cell::columnIndexFromString($coordinates[0]) - 1; + break; + case PHPExcel_Worksheet::BREAK_ROW: + // Add to list of horizontal breaks + $hbreaks[] = $coordinates[1]; + break; + case PHPExcel_Worksheet::BREAK_NONE: + default: + // Nothing to do + break; + } + } + + //horizontal page breaks + if (!empty($hbreaks)) { + // Sort and filter array of page breaks + sort($hbreaks, SORT_NUMERIC); + if ($hbreaks[0] == 0) { // don't use first break if it's 0 + array_shift($hbreaks); + } + + $record = 0x001b; // Record identifier + $cbrk = count($hbreaks); // Number of page breaks + $length = 2 + 6 * $cbrk; // Bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("v", $cbrk); + + // Append each page break + foreach ($hbreaks as $hbreak) { + $data .= pack("vvv", $hbreak, 0x0000, 0x00ff); + } + + $this->append($header . $data); + } + + // vertical page breaks + if (!empty($vbreaks)) { + // 1000 vertical pagebreaks appears to be an internal Excel 5 limit. + // It is slightly higher in Excel 97/200, approx. 1026 + $vbreaks = array_slice($vbreaks, 0, 1000); + + // Sort and filter array of page breaks + sort($vbreaks, SORT_NUMERIC); + if ($vbreaks[0] == 0) { // don't use first break if it's 0 + array_shift($vbreaks); + } + + $record = 0x001a; // Record identifier + $cbrk = count($vbreaks); // Number of page breaks + $length = 2 + 6 * $cbrk; // Bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("v", $cbrk); + + // Append each page break + foreach ($vbreaks as $vbreak) { + $data .= pack("vvv", $vbreak, 0x0000, 0xffff); + } + + $this->append($header . $data); + } + } + + /** + * Set the Biff PROTECT record to indicate that the worksheet is protected. + */ + private function writeProtect() + { + // Exit unless sheet protection has been specified + if (!$this->phpSheet->getProtection()->getSheet()) { + return; + } + + $record = 0x0012; // Record identifier + $length = 0x0002; // Bytes to follow + + $fLock = 1; // Worksheet is protected + + $header = pack("vv", $record, $length); + $data = pack("v", $fLock); + + $this->append($header.$data); + } + + /** + * Write SCENPROTECT + */ + private function writeScenProtect() + { + // Exit if sheet protection is not active + if (!$this->phpSheet->getProtection()->getSheet()) { + return; + } + + // Exit if scenarios are not protected + if (!$this->phpSheet->getProtection()->getScenarios()) { + return; + } + + $record = 0x00DD; // Record identifier + $length = 0x0002; // Bytes to follow + + $header = pack('vv', $record, $length); + $data = pack('v', 1); + + $this->append($header . $data); + } + + /** + * Write OBJECTPROTECT + */ + private function writeObjectProtect() + { + // Exit if sheet protection is not active + if (!$this->phpSheet->getProtection()->getSheet()) { + return; + } + + // Exit if objects are not protected + if (!$this->phpSheet->getProtection()->getObjects()) { + return; + } + + $record = 0x0063; // Record identifier + $length = 0x0002; // Bytes to follow + + $header = pack('vv', $record, $length); + $data = pack('v', 1); + + $this->append($header . $data); + } + + /** + * Write the worksheet PASSWORD record. + */ + private function writePassword() + { + // Exit unless sheet protection and password have been specified + if (!$this->phpSheet->getProtection()->getSheet() || !$this->phpSheet->getProtection()->getPassword()) { + return; + } + + $record = 0x0013; // Record identifier + $length = 0x0002; // Bytes to follow + + $wPassword = hexdec($this->phpSheet->getProtection()->getPassword()); // Encoded password + + $header = pack("vv", $record, $length); + $data = pack("v", $wPassword); + + $this->append($header . $data); + } + + /** + * Insert a 24bit bitmap image in a worksheet. + * + * @access public + * @param integer $row The row we are going to insert the bitmap into + * @param integer $col The column we are going to insert the bitmap into + * @param mixed $bitmap The bitmap filename or GD-image resource + * @param integer $x The horizontal position (offset) of the image inside the cell. + * @param integer $y The vertical position (offset) of the image inside the cell. + * @param float $scale_x The horizontal scale + * @param float $scale_y The vertical scale + */ + public function insertBitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1) + { + $bitmap_array = (is_resource($bitmap) ? $this->processBitmapGd($bitmap) : $this->processBitmap($bitmap)); + list($width, $height, $size, $data) = $bitmap_array; //$this->processBitmap($bitmap); + + // Scale the frame of the image. + $width *= $scale_x; + $height *= $scale_y; + + // Calculate the vertices of the image and write the OBJ record + $this->positionImage($col, $row, $x, $y, $width, $height); + + // Write the IMDATA record to store the bitmap data + $record = 0x007f; + $length = 8 + $size; + $cf = 0x09; + $env = 0x01; + $lcb = $size; + + $header = pack("vvvvV", $record, $length, $cf, $env, $lcb); + $this->append($header.$data); + } + + /** + * Calculate the vertices that define the position of the image as required by + * the OBJ record. + * + * +------------+------------+ + * | A | B | + * +-----+------------+------------+ + * | |(x1,y1) | | + * | 1 |(A1)._______|______ | + * | | | | | + * | | | | | + * +-----+----| BITMAP |-----+ + * | | | | | + * | 2 | |______________. | + * | | | (B2)| + * | | | (x2,y2)| + * +---- +------------+------------+ + * + * Example of a bitmap that covers some of the area from cell A1 to cell B2. + * + * Based on the width and height of the bitmap we need to calculate 8 vars: + * $col_start, $row_start, $col_end, $row_end, $x1, $y1, $x2, $y2. + * The width and height of the cells are also variable and have to be taken into + * account. + * The values of $col_start and $row_start are passed in from the calling + * function. The values of $col_end and $row_end are calculated by subtracting + * the width and height of the bitmap from the width and height of the + * underlying cells. + * The vertices are expressed as a percentage of the underlying cell width as + * follows (rhs values are in pixels): + * + * x1 = X / W *1024 + * y1 = Y / H *256 + * x2 = (X-1) / W *1024 + * y2 = (Y-1) / H *256 + * + * Where: X is distance from the left side of the underlying cell + * Y is distance from the top of the underlying cell + * W is the width of the cell + * H is the height of the cell + * The SDK incorrectly states that the height should be expressed as a + * percentage of 1024. + * + * @access private + * @param integer $col_start Col containing upper left corner of object + * @param integer $row_start Row containing top left corner of object + * @param integer $x1 Distance to left side of object + * @param integer $y1 Distance to top of object + * @param integer $width Width of image frame + * @param integer $height Height of image frame + */ + public function positionImage($col_start, $row_start, $x1, $y1, $width, $height) + { + // Initialise end cell to the same as the start cell + $col_end = $col_start; // Col containing lower right corner of object + $row_end = $row_start; // Row containing bottom right corner of object + + // Zero the specified offset if greater than the cell dimensions + if ($x1 >= PHPExcel_Shared_Excel5::sizeCol($this->phpSheet, PHPExcel_Cell::stringFromColumnIndex($col_start))) { + $x1 = 0; + } + if ($y1 >= PHPExcel_Shared_Excel5::sizeRow($this->phpSheet, $row_start + 1)) { + $y1 = 0; + } + + $width = $width + $x1 -1; + $height = $height + $y1 -1; + + // Subtract the underlying cell widths to find the end cell of the image + while ($width >= PHPExcel_Shared_Excel5::sizeCol($this->phpSheet, PHPExcel_Cell::stringFromColumnIndex($col_end))) { + $width -= PHPExcel_Shared_Excel5::sizeCol($this->phpSheet, PHPExcel_Cell::stringFromColumnIndex($col_end)); + ++$col_end; + } + + // Subtract the underlying cell heights to find the end cell of the image + while ($height >= PHPExcel_Shared_Excel5::sizeRow($this->phpSheet, $row_end + 1)) { + $height -= PHPExcel_Shared_Excel5::sizeRow($this->phpSheet, $row_end + 1); + ++$row_end; + } + + // Bitmap isn't allowed to start or finish in a hidden cell, i.e. a cell + // with zero eight or width. + // + if (PHPExcel_Shared_Excel5::sizeCol($this->phpSheet, PHPExcel_Cell::stringFromColumnIndex($col_start)) == 0) { + return; + } + if (PHPExcel_Shared_Excel5::sizeCol($this->phpSheet, PHPExcel_Cell::stringFromColumnIndex($col_end)) == 0) { + return; + } + if (PHPExcel_Shared_Excel5::sizeRow($this->phpSheet, $row_start + 1) == 0) { + return; + } + if (PHPExcel_Shared_Excel5::sizeRow($this->phpSheet, $row_end + 1) == 0) { + return; + } + + // Convert the pixel values to the percentage value expected by Excel + $x1 = $x1 / PHPExcel_Shared_Excel5::sizeCol($this->phpSheet, PHPExcel_Cell::stringFromColumnIndex($col_start)) * 1024; + $y1 = $y1 / PHPExcel_Shared_Excel5::sizeRow($this->phpSheet, $row_start + 1) * 256; + $x2 = $width / PHPExcel_Shared_Excel5::sizeCol($this->phpSheet, PHPExcel_Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object + $y2 = $height / PHPExcel_Shared_Excel5::sizeRow($this->phpSheet, $row_end + 1) * 256; // Distance to bottom of object + + $this->writeObjPicture($col_start, $x1, $row_start, $y1, $col_end, $x2, $row_end, $y2); + } + + /** + * Store the OBJ record that precedes an IMDATA record. This could be generalise + * to support other Excel objects. + * + * @param integer $colL Column containing upper left corner of object + * @param integer $dxL Distance from left side of cell + * @param integer $rwT Row containing top left corner of object + * @param integer $dyT Distance from top of cell + * @param integer $colR Column containing lower right corner of object + * @param integer $dxR Distance from right of cell + * @param integer $rwB Row containing bottom right corner of object + * @param integer $dyB Distance from bottom of cell + */ + private function writeObjPicture($colL, $dxL, $rwT, $dyT, $colR, $dxR, $rwB, $dyB) + { + $record = 0x005d; // Record identifier + $length = 0x003c; // Bytes to follow + + $cObj = 0x0001; // Count of objects in file (set to 1) + $OT = 0x0008; // Object type. 8 = Picture + $id = 0x0001; // Object ID + $grbit = 0x0614; // Option flags + + $cbMacro = 0x0000; // Length of FMLA structure + $Reserved1 = 0x0000; // Reserved + $Reserved2 = 0x0000; // Reserved + + $icvBack = 0x09; // Background colour + $icvFore = 0x09; // Foreground colour + $fls = 0x00; // Fill pattern + $fAuto = 0x00; // Automatic fill + $icv = 0x08; // Line colour + $lns = 0xff; // Line style + $lnw = 0x01; // Line weight + $fAutoB = 0x00; // Automatic border + $frs = 0x0000; // Frame style + $cf = 0x0009; // Image format, 9 = bitmap + $Reserved3 = 0x0000; // Reserved + $cbPictFmla = 0x0000; // Length of FMLA structure + $Reserved4 = 0x0000; // Reserved + $grbit2 = 0x0001; // Option flags + $Reserved5 = 0x0000; // Reserved + + + $header = pack("vv", $record, $length); + $data = pack("V", $cObj); + $data .= pack("v", $OT); + $data .= pack("v", $id); + $data .= pack("v", $grbit); + $data .= pack("v", $colL); + $data .= pack("v", $dxL); + $data .= pack("v", $rwT); + $data .= pack("v", $dyT); + $data .= pack("v", $colR); + $data .= pack("v", $dxR); + $data .= pack("v", $rwB); + $data .= pack("v", $dyB); + $data .= pack("v", $cbMacro); + $data .= pack("V", $Reserved1); + $data .= pack("v", $Reserved2); + $data .= pack("C", $icvBack); + $data .= pack("C", $icvFore); + $data .= pack("C", $fls); + $data .= pack("C", $fAuto); + $data .= pack("C", $icv); + $data .= pack("C", $lns); + $data .= pack("C", $lnw); + $data .= pack("C", $fAutoB); + $data .= pack("v", $frs); + $data .= pack("V", $cf); + $data .= pack("v", $Reserved3); + $data .= pack("v", $cbPictFmla); + $data .= pack("v", $Reserved4); + $data .= pack("v", $grbit2); + $data .= pack("V", $Reserved5); + + $this->append($header . $data); + } + + /** + * Convert a GD-image into the internal format. + * + * @access private + * @param resource $image The image to process + * @return array Array with data and properties of the bitmap + */ + public function processBitmapGd($image) + { + $width = imagesx($image); + $height = imagesy($image); + + $data = pack("Vvvvv", 0x000c, $width, $height, 0x01, 0x18); + for ($j=$height; $j--;) { + for ($i=0; $i < $width; ++$i) { + $color = imagecolorsforindex($image, imagecolorat($image, $i, $j)); + foreach (array("red", "green", "blue") as $key) { + $color[$key] = $color[$key] + round((255 - $color[$key]) * $color["alpha"] / 127); + } + $data .= chr($color["blue"]) . chr($color["green"]) . chr($color["red"]); + } + if (3*$width % 4) { + $data .= str_repeat("\x00", 4 - 3*$width % 4); + } + } + + return array($width, $height, strlen($data), $data); + } + + /** + * Convert a 24 bit bitmap into the modified internal format used by Windows. + * This is described in BITMAPCOREHEADER and BITMAPCOREINFO structures in the + * MSDN library. + * + * @access private + * @param string $bitmap The bitmap to process + * @return array Array with data and properties of the bitmap + */ + public function processBitmap($bitmap) + { + // Open file. + $bmp_fd = @fopen($bitmap, "rb"); + if (!$bmp_fd) { + throw new PHPExcel_Writer_Exception("Couldn't import $bitmap"); + } + + // Slurp the file into a string. + $data = fread($bmp_fd, filesize($bitmap)); + + // Check that the file is big enough to be a bitmap. + if (strlen($data) <= 0x36) { + throw new PHPExcel_Writer_Exception("$bitmap doesn't contain enough data.\n"); + } + + // The first 2 bytes are used to identify the bitmap. + $identity = unpack("A2ident", $data); + if ($identity['ident'] != "BM") { + throw new PHPExcel_Writer_Exception("$bitmap doesn't appear to be a valid bitmap image.\n"); + } + + // Remove bitmap data: ID. + $data = substr($data, 2); + + // Read and remove the bitmap size. This is more reliable than reading + // the data size at offset 0x22. + // + $size_array = unpack("Vsa", substr($data, 0, 4)); + $size = $size_array['sa']; + $data = substr($data, 4); + $size -= 0x36; // Subtract size of bitmap header. + $size += 0x0C; // Add size of BIFF header. + + // Remove bitmap data: reserved, offset, header length. + $data = substr($data, 12); + + // Read and remove the bitmap width and height. Verify the sizes. + $width_and_height = unpack("V2", substr($data, 0, 8)); + $width = $width_and_height[1]; + $height = $width_and_height[2]; + $data = substr($data, 8); + if ($width > 0xFFFF) { + throw new PHPExcel_Writer_Exception("$bitmap: largest image width supported is 65k.\n"); + } + if ($height > 0xFFFF) { + throw new PHPExcel_Writer_Exception("$bitmap: largest image height supported is 65k.\n"); + } + + // Read and remove the bitmap planes and bpp data. Verify them. + $planes_and_bitcount = unpack("v2", substr($data, 0, 4)); + $data = substr($data, 4); + if ($planes_and_bitcount[2] != 24) { // Bitcount + throw new PHPExcel_Writer_Exception("$bitmap isn't a 24bit true color bitmap.\n"); + } + if ($planes_and_bitcount[1] != 1) { + throw new PHPExcel_Writer_Exception("$bitmap: only 1 plane supported in bitmap image.\n"); + } + + // Read and remove the bitmap compression. Verify compression. + $compression = unpack("Vcomp", substr($data, 0, 4)); + $data = substr($data, 4); + + //$compression = 0; + if ($compression['comp'] != 0) { + throw new PHPExcel_Writer_Exception("$bitmap: compression not supported in bitmap image.\n"); + } + + // Remove bitmap data: data size, hres, vres, colours, imp. colours. + $data = substr($data, 20); + + // Add the BITMAPCOREHEADER data + $header = pack("Vvvvv", 0x000c, $width, $height, 0x01, 0x18); + $data = $header . $data; + + return (array($width, $height, $size, $data)); + } + + /** + * Store the window zoom factor. This should be a reduced fraction but for + * simplicity we will store all fractions with a numerator of 100. + */ + private function writeZoom() + { + // If scale is 100 we don't need to write a record + if ($this->phpSheet->getSheetView()->getZoomScale() == 100) { + return; + } + + $record = 0x00A0; // Record identifier + $length = 0x0004; // Bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("vv", $this->phpSheet->getSheetView()->getZoomScale(), 100); + $this->append($header . $data); + } + + /** + * Get Escher object + * + * @return PHPExcel_Shared_Escher + */ + public function getEscher() + { + return $this->escher; + } + + /** + * Set Escher object + * + * @param PHPExcel_Shared_Escher $pValue + */ + public function setEscher(PHPExcel_Shared_Escher $pValue = null) + { + $this->escher = $pValue; + } + + /** + * Write MSODRAWING record + */ + private function writeMsoDrawing() + { + // write the Escher stream if necessary + if (isset($this->escher)) { + $writer = new PHPExcel_Writer_Excel5_Escher($this->escher); + $data = $writer->close(); + $spOffsets = $writer->getSpOffsets(); + $spTypes = $writer->getSpTypes(); + // write the neccesary MSODRAWING, OBJ records + + // split the Escher stream + $spOffsets[0] = 0; + $nm = count($spOffsets) - 1; // number of shapes excluding first shape + for ($i = 1; $i <= $nm; ++$i) { + // MSODRAWING record + $record = 0x00EC; // Record identifier + + // chunk of Escher stream for one shape + $dataChunk = substr($data, $spOffsets[$i -1], $spOffsets[$i] - $spOffsets[$i - 1]); + + $length = strlen($dataChunk); + $header = pack("vv", $record, $length); + + $this->append($header . $dataChunk); + + // OBJ record + $record = 0x005D; // record identifier + $objData = ''; + + // ftCmo + if ($spTypes[$i] == 0x00C9) { + // Add ftCmo (common object data) subobject + $objData .= + pack( + 'vvvvvVVV', + 0x0015, // 0x0015 = ftCmo + 0x0012, // length of ftCmo data + 0x0014, // object type, 0x0014 = filter + $i, // object id number, Excel seems to use 1-based index, local for the sheet + 0x2101, // option flags, 0x2001 is what OpenOffice.org uses + 0, // reserved + 0, // reserved + 0 // reserved + ); + + // Add ftSbs Scroll bar subobject + $objData .= pack('vv', 0x00C, 0x0014); + $objData .= pack('H*', '0000000000000000640001000A00000010000100'); + // Add ftLbsData (List box data) subobject + $objData .= pack('vv', 0x0013, 0x1FEE); + $objData .= pack('H*', '00000000010001030000020008005700'); + } else { + // Add ftCmo (common object data) subobject + $objData .= + pack( + 'vvvvvVVV', + 0x0015, // 0x0015 = ftCmo + 0x0012, // length of ftCmo data + 0x0008, // object type, 0x0008 = picture + $i, // object id number, Excel seems to use 1-based index, local for the sheet + 0x6011, // option flags, 0x6011 is what OpenOffice.org uses + 0, // reserved + 0, // reserved + 0 // reserved + ); + } + + // ftEnd + $objData .= + pack( + 'vv', + 0x0000, // 0x0000 = ftEnd + 0x0000 // length of ftEnd data + ); + + $length = strlen($objData); + $header = pack('vv', $record, $length); + $this->append($header . $objData); + } + } + } + + /** + * Store the DATAVALIDATIONS and DATAVALIDATION records. + */ + private function writeDataValidity() + { + // Datavalidation collection + $dataValidationCollection = $this->phpSheet->getDataValidationCollection(); + + // Write data validations? + if (!empty($dataValidationCollection)) { + // DATAVALIDATIONS record + $record = 0x01B2; // Record identifier + $length = 0x0012; // Bytes to follow + + $grbit = 0x0000; // Prompt box at cell, no cached validity data at DV records + $horPos = 0x00000000; // Horizontal position of prompt box, if fixed position + $verPos = 0x00000000; // Vertical position of prompt box, if fixed position + $objId = 0xFFFFFFFF; // Object identifier of drop down arrow object, or -1 if not visible + + $header = pack('vv', $record, $length); + $data = pack('vVVVV', $grbit, $horPos, $verPos, $objId, count($dataValidationCollection)); + $this->append($header.$data); + + // DATAVALIDATION records + $record = 0x01BE; // Record identifier + + foreach ($dataValidationCollection as $cellCoordinate => $dataValidation) { + // initialize record data + $data = ''; + + // options + $options = 0x00000000; + + // data type + $type = $dataValidation->getType(); + switch ($type) { + case PHPExcel_Cell_DataValidation::TYPE_NONE: + $type = 0x00; + break; + case PHPExcel_Cell_DataValidation::TYPE_WHOLE: + $type = 0x01; + break; + case PHPExcel_Cell_DataValidation::TYPE_DECIMAL: + $type = 0x02; + break; + case PHPExcel_Cell_DataValidation::TYPE_LIST: + $type = 0x03; + break; + case PHPExcel_Cell_DataValidation::TYPE_DATE: + $type = 0x04; + break; + case PHPExcel_Cell_DataValidation::TYPE_TIME: + $type = 0x05; + break; + case PHPExcel_Cell_DataValidation::TYPE_TEXTLENGTH: + $type = 0x06; + break; + case PHPExcel_Cell_DataValidation::TYPE_CUSTOM: + $type = 0x07; + break; + } + $options |= $type << 0; + + // error style + $errorStyle = $dataValidation->getType(); + switch ($errorStyle) { + case PHPExcel_Cell_DataValidation::STYLE_STOP: + $errorStyle = 0x00; + break; + case PHPExcel_Cell_DataValidation::STYLE_WARNING: + $errorStyle = 0x01; + break; + case PHPExcel_Cell_DataValidation::STYLE_INFORMATION: + $errorStyle = 0x02; + break; + } + $options |= $errorStyle << 4; + + // explicit formula? + if ($type == 0x03 && preg_match('/^\".*\"$/', $dataValidation->getFormula1())) { + $options |= 0x01 << 7; + } + + // empty cells allowed + $options |= $dataValidation->getAllowBlank() << 8; + + // show drop down + $options |= (!$dataValidation->getShowDropDown()) << 9; + + // show input message + $options |= $dataValidation->getShowInputMessage() << 18; + + // show error message + $options |= $dataValidation->getShowErrorMessage() << 19; + + // condition operator + $operator = $dataValidation->getOperator(); + switch ($operator) { + case PHPExcel_Cell_DataValidation::OPERATOR_BETWEEN: + $operator = 0x00; + break; + case PHPExcel_Cell_DataValidation::OPERATOR_NOTBETWEEN: + $operator = 0x01; + break; + case PHPExcel_Cell_DataValidation::OPERATOR_EQUAL: + $operator = 0x02; + break; + case PHPExcel_Cell_DataValidation::OPERATOR_NOTEQUAL: + $operator = 0x03; + break; + case PHPExcel_Cell_DataValidation::OPERATOR_GREATERTHAN: + $operator = 0x04; + break; + case PHPExcel_Cell_DataValidation::OPERATOR_LESSTHAN: + $operator = 0x05; + break; + case PHPExcel_Cell_DataValidation::OPERATOR_GREATERTHANOREQUAL: + $operator = 0x06; + break; + case PHPExcel_Cell_DataValidation::OPERATOR_LESSTHANOREQUAL: + $operator = 0x07; + break; + } + $options |= $operator << 20; + + $data = pack('V', $options); + + // prompt title + $promptTitle = $dataValidation->getPromptTitle() !== '' ? + $dataValidation->getPromptTitle() : chr(0); + $data .= PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($promptTitle); + + // error title + $errorTitle = $dataValidation->getErrorTitle() !== '' ? + $dataValidation->getErrorTitle() : chr(0); + $data .= PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($errorTitle); + + // prompt text + $prompt = $dataValidation->getPrompt() !== '' ? + $dataValidation->getPrompt() : chr(0); + $data .= PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($prompt); + + // error text + $error = $dataValidation->getError() !== '' ? + $dataValidation->getError() : chr(0); + $data .= PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($error); + + // formula 1 + try { + $formula1 = $dataValidation->getFormula1(); + if ($type == 0x03) { // list type + $formula1 = str_replace(',', chr(0), $formula1); + } + $this->parser->parse($formula1); + $formula1 = $this->parser->toReversePolish(); + $sz1 = strlen($formula1); + } catch (PHPExcel_Exception $e) { + $sz1 = 0; + $formula1 = ''; + } + $data .= pack('vv', $sz1, 0x0000); + $data .= $formula1; + + // formula 2 + try { + $formula2 = $dataValidation->getFormula2(); + if ($formula2 === '') { + throw new PHPExcel_Writer_Exception('No formula2'); + } + $this->parser->parse($formula2); + $formula2 = $this->parser->toReversePolish(); + $sz2 = strlen($formula2); + } catch (PHPExcel_Exception $e) { + $sz2 = 0; + $formula2 = ''; + } + $data .= pack('vv', $sz2, 0x0000); + $data .= $formula2; + + // cell range address list + $data .= pack('v', 0x0001); + $data .= $this->writeBIFF8CellRangeAddressFixed($cellCoordinate); + + $length = strlen($data); + $header = pack("vv", $record, $length); + + $this->append($header . $data); + } + } + } + + /** + * Map Error code + * + * @param string $errorCode + * @return int + */ + private static function mapErrorCode($errorCode) + { + switch ($errorCode) { + case '#NULL!': + return 0x00; + case '#DIV/0!': + return 0x07; + case '#VALUE!': + return 0x0F; + case '#REF!': + return 0x17; + case '#NAME?': + return 0x1D; + case '#NUM!': + return 0x24; + case '#N/A': + return 0x2A; + } + + return 0; + } + + /** + * Write PLV Record + */ + private function writePageLayoutView() + { + $record = 0x088B; // Record identifier + $length = 0x0010; // Bytes to follow + + $rt = 0x088B; // 2 + $grbitFrt = 0x0000; // 2 + $reserved = 0x0000000000000000; // 8 + $wScalvePLV = $this->phpSheet->getSheetView()->getZoomScale(); // 2 + + // The options flags that comprise $grbit + if ($this->phpSheet->getSheetView()->getView() == PHPExcel_Worksheet_SheetView::SHEETVIEW_PAGE_LAYOUT) { + $fPageLayoutView = 1; + } else { + $fPageLayoutView = 0; + } + $fRulerVisible = 0; + $fWhitespaceHidden = 0; + + $grbit = $fPageLayoutView; // 2 + $grbit |= $fRulerVisible << 1; + $grbit |= $fWhitespaceHidden << 3; + + $header = pack("vv", $record, $length); + $data = pack("vvVVvv", $rt, $grbitFrt, 0x00000000, 0x00000000, $wScalvePLV, $grbit); + $this->append($header . $data); + } + + /** + * Write CFRule Record + * @param PHPExcel_Style_Conditional $conditional + */ + private function writeCFRule(PHPExcel_Style_Conditional $conditional) + { + $record = 0x01B1; // Record identifier + + // $type : Type of the CF + // $operatorType : Comparison operator + if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_EXPRESSION) { + $type = 0x02; + $operatorType = 0x00; + } elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS) { + $type = 0x01; + + switch ($conditional->getOperatorType()) { + case PHPExcel_Style_Conditional::OPERATOR_NONE: + $operatorType = 0x00; + break; + case PHPExcel_Style_Conditional::OPERATOR_EQUAL: + $operatorType = 0x03; + break; + case PHPExcel_Style_Conditional::OPERATOR_GREATERTHAN: + $operatorType = 0x05; + break; + case PHPExcel_Style_Conditional::OPERATOR_GREATERTHANOREQUAL: + $operatorType = 0x07; + break; + case PHPExcel_Style_Conditional::OPERATOR_LESSTHAN: + $operatorType = 0x06; + break; + case PHPExcel_Style_Conditional::OPERATOR_LESSTHANOREQUAL: + $operatorType = 0x08; + break; + case PHPExcel_Style_Conditional::OPERATOR_NOTEQUAL: + $operatorType = 0x04; + break; + case PHPExcel_Style_Conditional::OPERATOR_BETWEEN: + $operatorType = 0x01; + break; + // not OPERATOR_NOTBETWEEN 0x02 + } + } + + // $szValue1 : size of the formula data for first value or formula + // $szValue2 : size of the formula data for second value or formula + $arrConditions = $conditional->getConditions(); + $numConditions = sizeof($arrConditions); + if ($numConditions == 1) { + $szValue1 = ($arrConditions[0] <= 65535 ? 3 : 0x0000); + $szValue2 = 0x0000; + $operand1 = pack('Cv', 0x1E, $arrConditions[0]); + $operand2 = null; + } elseif ($numConditions == 2 && ($conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_BETWEEN)) { + $szValue1 = ($arrConditions[0] <= 65535 ? 3 : 0x0000); + $szValue2 = ($arrConditions[1] <= 65535 ? 3 : 0x0000); + $operand1 = pack('Cv', 0x1E, $arrConditions[0]); + $operand2 = pack('Cv', 0x1E, $arrConditions[1]); + } else { + $szValue1 = 0x0000; + $szValue2 = 0x0000; + $operand1 = null; + $operand2 = null; + } + + // $flags : Option flags + // Alignment + $bAlignHz = ($conditional->getStyle()->getAlignment()->getHorizontal() == null ? 1 : 0); + $bAlignVt = ($conditional->getStyle()->getAlignment()->getVertical() == null ? 1 : 0); + $bAlignWrapTx = ($conditional->getStyle()->getAlignment()->getWrapText() == false ? 1 : 0); + $bTxRotation = ($conditional->getStyle()->getAlignment()->getTextRotation() == null ? 1 : 0); + $bIndent = ($conditional->getStyle()->getAlignment()->getIndent() == 0 ? 1 : 0); + $bShrinkToFit = ($conditional->getStyle()->getAlignment()->getShrinkToFit() == false ? 1 : 0); + if ($bAlignHz == 0 || $bAlignVt == 0 || $bAlignWrapTx == 0 || $bTxRotation == 0 || $bIndent == 0 || $bShrinkToFit == 0) { + $bFormatAlign = 1; + } else { + $bFormatAlign = 0; + } + // Protection + $bProtLocked = ($conditional->getStyle()->getProtection()->getLocked() == null ? 1 : 0); + $bProtHidden = ($conditional->getStyle()->getProtection()->getHidden() == null ? 1 : 0); + if ($bProtLocked == 0 || $bProtHidden == 0) { + $bFormatProt = 1; + } else { + $bFormatProt = 0; + } + // Border + $bBorderLeft = ($conditional->getStyle()->getBorders()->getLeft()->getColor()->getARGB() == PHPExcel_Style_Color::COLOR_BLACK + && $conditional->getStyle()->getBorders()->getLeft()->getBorderStyle() == PHPExcel_Style_Border::BORDER_NONE ? 1 : 0); + $bBorderRight = ($conditional->getStyle()->getBorders()->getRight()->getColor()->getARGB() == PHPExcel_Style_Color::COLOR_BLACK + && $conditional->getStyle()->getBorders()->getRight()->getBorderStyle() == PHPExcel_Style_Border::BORDER_NONE ? 1 : 0); + $bBorderTop = ($conditional->getStyle()->getBorders()->getTop()->getColor()->getARGB() == PHPExcel_Style_Color::COLOR_BLACK + && $conditional->getStyle()->getBorders()->getTop()->getBorderStyle() == PHPExcel_Style_Border::BORDER_NONE ? 1 : 0); + $bBorderBottom = ($conditional->getStyle()->getBorders()->getBottom()->getColor()->getARGB() == PHPExcel_Style_Color::COLOR_BLACK + && $conditional->getStyle()->getBorders()->getBottom()->getBorderStyle() == PHPExcel_Style_Border::BORDER_NONE ? 1 : 0); + if ($bBorderLeft == 0 || $bBorderRight == 0 || $bBorderTop == 0 || $bBorderBottom == 0) { + $bFormatBorder = 1; + } else { + $bFormatBorder = 0; + } + // Pattern + $bFillStyle = ($conditional->getStyle()->getFill()->getFillType() == null ? 0 : 1); + $bFillColor = ($conditional->getStyle()->getFill()->getStartColor()->getARGB() == null ? 0 : 1); + $bFillColorBg = ($conditional->getStyle()->getFill()->getEndColor()->getARGB() == null ? 0 : 1); + if ($bFillStyle == 0 || $bFillColor == 0 || $bFillColorBg == 0) { + $bFormatFill = 1; + } else { + $bFormatFill = 0; + } + // Font + if ($conditional->getStyle()->getFont()->getName() != null + || $conditional->getStyle()->getFont()->getSize() != null + || $conditional->getStyle()->getFont()->getBold() != null + || $conditional->getStyle()->getFont()->getItalic() != null + || $conditional->getStyle()->getFont()->getSuperScript() != null + || $conditional->getStyle()->getFont()->getSubScript() != null + || $conditional->getStyle()->getFont()->getUnderline() != null + || $conditional->getStyle()->getFont()->getStrikethrough() != null + || $conditional->getStyle()->getFont()->getColor()->getARGB() != null) { + $bFormatFont = 1; + } else { + $bFormatFont = 0; + } + // Alignment + $flags = 0; + $flags |= (1 == $bAlignHz ? 0x00000001 : 0); + $flags |= (1 == $bAlignVt ? 0x00000002 : 0); + $flags |= (1 == $bAlignWrapTx ? 0x00000004 : 0); + $flags |= (1 == $bTxRotation ? 0x00000008 : 0); + // Justify last line flag + $flags |= (1 == 1 ? 0x00000010 : 0); + $flags |= (1 == $bIndent ? 0x00000020 : 0); + $flags |= (1 == $bShrinkToFit ? 0x00000040 : 0); + // Default + $flags |= (1 == 1 ? 0x00000080 : 0); + // Protection + $flags |= (1 == $bProtLocked ? 0x00000100 : 0); + $flags |= (1 == $bProtHidden ? 0x00000200 : 0); + // Border + $flags |= (1 == $bBorderLeft ? 0x00000400 : 0); + $flags |= (1 == $bBorderRight ? 0x00000800 : 0); + $flags |= (1 == $bBorderTop ? 0x00001000 : 0); + $flags |= (1 == $bBorderBottom ? 0x00002000 : 0); + $flags |= (1 == 1 ? 0x00004000 : 0); // Top left to Bottom right border + $flags |= (1 == 1 ? 0x00008000 : 0); // Bottom left to Top right border + // Pattern + $flags |= (1 == $bFillStyle ? 0x00010000 : 0); + $flags |= (1 == $bFillColor ? 0x00020000 : 0); + $flags |= (1 == $bFillColorBg ? 0x00040000 : 0); + $flags |= (1 == 1 ? 0x00380000 : 0); + // Font + $flags |= (1 == $bFormatFont ? 0x04000000 : 0); + // Alignment: + $flags |= (1 == $bFormatAlign ? 0x08000000 : 0); + // Border + $flags |= (1 == $bFormatBorder ? 0x10000000 : 0); + // Pattern + $flags |= (1 == $bFormatFill ? 0x20000000 : 0); + // Protection + $flags |= (1 == $bFormatProt ? 0x40000000 : 0); + // Text direction + $flags |= (1 == 0 ? 0x80000000 : 0); + + // Data Blocks + if ($bFormatFont == 1) { + // Font Name + if ($conditional->getStyle()->getFont()->getName() == null) { + $dataBlockFont = pack('VVVVVVVV', 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000); + $dataBlockFont .= pack('VVVVVVVV', 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000); + } else { + $dataBlockFont = PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($conditional->getStyle()->getFont()->getName()); + } + // Font Size + if ($conditional->getStyle()->getFont()->getSize() == null) { + $dataBlockFont .= pack('V', 20 * 11); + } else { + $dataBlockFont .= pack('V', 20 * $conditional->getStyle()->getFont()->getSize()); + } + // Font Options + $dataBlockFont .= pack('V', 0); + // Font weight + if ($conditional->getStyle()->getFont()->getBold() == true) { + $dataBlockFont .= pack('v', 0x02BC); + } else { + $dataBlockFont .= pack('v', 0x0190); + } + // Escapement type + if ($conditional->getStyle()->getFont()->getSubScript() == true) { + $dataBlockFont .= pack('v', 0x02); + $fontEscapement = 0; + } elseif ($conditional->getStyle()->getFont()->getSuperScript() == true) { + $dataBlockFont .= pack('v', 0x01); + $fontEscapement = 0; + } else { + $dataBlockFont .= pack('v', 0x00); + $fontEscapement = 1; + } + // Underline type + switch ($conditional->getStyle()->getFont()->getUnderline()) { + case PHPExcel_Style_Font::UNDERLINE_NONE: + $dataBlockFont .= pack('C', 0x00); + $fontUnderline = 0; + break; + case PHPExcel_Style_Font::UNDERLINE_DOUBLE: + $dataBlockFont .= pack('C', 0x02); + $fontUnderline = 0; + break; + case PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING: + $dataBlockFont .= pack('C', 0x22); + $fontUnderline = 0; + break; + case PHPExcel_Style_Font::UNDERLINE_SINGLE: + $dataBlockFont .= pack('C', 0x01); + $fontUnderline = 0; + break; + case PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING: + $dataBlockFont .= pack('C', 0x21); + $fontUnderline = 0; + break; + default: $dataBlockFont .= pack('C', 0x00); + $fontUnderline = 1; + break; + } + // Not used (3) + $dataBlockFont .= pack('vC', 0x0000, 0x00); + // Font color index + switch ($conditional->getStyle()->getFont()->getColor()->getRGB()) { + case '000000': + $colorIdx = 0x08; + break; + case 'FFFFFF': + $colorIdx = 0x09; + break; + case 'FF0000': + $colorIdx = 0x0A; + break; + case '00FF00': + $colorIdx = 0x0B; + break; + case '0000FF': + $colorIdx = 0x0C; + break; + case 'FFFF00': + $colorIdx = 0x0D; + break; + case 'FF00FF': + $colorIdx = 0x0E; + break; + case '00FFFF': + $colorIdx = 0x0F; + break; + case '800000': + $colorIdx = 0x10; + break; + case '008000': + $colorIdx = 0x11; + break; + case '000080': + $colorIdx = 0x12; + break; + case '808000': + $colorIdx = 0x13; + break; + case '800080': + $colorIdx = 0x14; + break; + case '008080': + $colorIdx = 0x15; + break; + case 'C0C0C0': + $colorIdx = 0x16; + break; + case '808080': + $colorIdx = 0x17; + break; + case '9999FF': + $colorIdx = 0x18; + break; + case '993366': + $colorIdx = 0x19; + break; + case 'FFFFCC': + $colorIdx = 0x1A; + break; + case 'CCFFFF': + $colorIdx = 0x1B; + break; + case '660066': + $colorIdx = 0x1C; + break; + case 'FF8080': + $colorIdx = 0x1D; + break; + case '0066CC': + $colorIdx = 0x1E; + break; + case 'CCCCFF': + $colorIdx = 0x1F; + break; + case '000080': + $colorIdx = 0x20; + break; + case 'FF00FF': + $colorIdx = 0x21; + break; + case 'FFFF00': + $colorIdx = 0x22; + break; + case '00FFFF': + $colorIdx = 0x23; + break; + case '800080': + $colorIdx = 0x24; + break; + case '800000': + $colorIdx = 0x25; + break; + case '008080': + $colorIdx = 0x26; + break; + case '0000FF': + $colorIdx = 0x27; + break; + case '00CCFF': + $colorIdx = 0x28; + break; + case 'CCFFFF': + $colorIdx = 0x29; + break; + case 'CCFFCC': + $colorIdx = 0x2A; + break; + case 'FFFF99': + $colorIdx = 0x2B; + break; + case '99CCFF': + $colorIdx = 0x2C; + break; + case 'FF99CC': + $colorIdx = 0x2D; + break; + case 'CC99FF': + $colorIdx = 0x2E; + break; + case 'FFCC99': + $colorIdx = 0x2F; + break; + case '3366FF': + $colorIdx = 0x30; + break; + case '33CCCC': + $colorIdx = 0x31; + break; + case '99CC00': + $colorIdx = 0x32; + break; + case 'FFCC00': + $colorIdx = 0x33; + break; + case 'FF9900': + $colorIdx = 0x34; + break; + case 'FF6600': + $colorIdx = 0x35; + break; + case '666699': + $colorIdx = 0x36; + break; + case '969696': + $colorIdx = 0x37; + break; + case '003366': + $colorIdx = 0x38; + break; + case '339966': + $colorIdx = 0x39; + break; + case '003300': + $colorIdx = 0x3A; + break; + case '333300': + $colorIdx = 0x3B; + break; + case '993300': + $colorIdx = 0x3C; + break; + case '993366': + $colorIdx = 0x3D; + break; + case '333399': + $colorIdx = 0x3E; + break; + case '333333': + $colorIdx = 0x3F; + break; + default: + $colorIdx = 0x00; + break; + } + $dataBlockFont .= pack('V', $colorIdx); + // Not used (4) + $dataBlockFont .= pack('V', 0x00000000); + // Options flags for modified font attributes + $optionsFlags = 0; + $optionsFlagsBold = ($conditional->getStyle()->getFont()->getBold() == null ? 1 : 0); + $optionsFlags |= (1 == $optionsFlagsBold ? 0x00000002 : 0); + $optionsFlags |= (1 == 1 ? 0x00000008 : 0); + $optionsFlags |= (1 == 1 ? 0x00000010 : 0); + $optionsFlags |= (1 == 0 ? 0x00000020 : 0); + $optionsFlags |= (1 == 1 ? 0x00000080 : 0); + $dataBlockFont .= pack('V', $optionsFlags); + // Escapement type + $dataBlockFont .= pack('V', $fontEscapement); + // Underline type + $dataBlockFont .= pack('V', $fontUnderline); + // Always + $dataBlockFont .= pack('V', 0x00000000); + // Always + $dataBlockFont .= pack('V', 0x00000000); + // Not used (8) + $dataBlockFont .= pack('VV', 0x00000000, 0x00000000); + // Always + $dataBlockFont .= pack('v', 0x0001); + } + if ($bFormatAlign == 1) { + $blockAlign = 0; + // Alignment and text break + switch ($conditional->getStyle()->getAlignment()->getHorizontal()) { + case PHPExcel_Style_Alignment::HORIZONTAL_GENERAL: + $blockAlign = 0; + break; + case PHPExcel_Style_Alignment::HORIZONTAL_LEFT: + $blockAlign = 1; + break; + case PHPExcel_Style_Alignment::HORIZONTAL_RIGHT: + $blockAlign = 3; + break; + case PHPExcel_Style_Alignment::HORIZONTAL_CENTER: + $blockAlign = 2; + break; + case PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS: + $blockAlign = 6; + break; + case PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY: + $blockAlign = 5; + break; + } + if ($conditional->getStyle()->getAlignment()->getWrapText() == true) { + $blockAlign |= 1 << 3; + } else { + $blockAlign |= 0 << 3; + } + switch ($conditional->getStyle()->getAlignment()->getVertical()) { + case PHPExcel_Style_Alignment::VERTICAL_BOTTOM: + $blockAlign = 2 << 4; + break; + case PHPExcel_Style_Alignment::VERTICAL_TOP: + $blockAlign = 0 << 4; + break; + case PHPExcel_Style_Alignment::VERTICAL_CENTER: + $blockAlign = 1 << 4; + break; + case PHPExcel_Style_Alignment::VERTICAL_JUSTIFY: + $blockAlign = 3 << 4; + break; + } + $blockAlign |= 0 << 7; + + // Text rotation angle + $blockRotation = $conditional->getStyle()->getAlignment()->getTextRotation(); + + // Indentation + $blockIndent = $conditional->getStyle()->getAlignment()->getIndent(); + if ($conditional->getStyle()->getAlignment()->getShrinkToFit() == true) { + $blockIndent |= 1 << 4; + } else { + $blockIndent |= 0 << 4; + } + $blockIndent |= 0 << 6; + + // Relative indentation + $blockIndentRelative = 255; + + $dataBlockAlign = pack('CCvvv', $blockAlign, $blockRotation, $blockIndent, $blockIndentRelative, 0x0000); + } + if ($bFormatBorder == 1) { + $blockLineStyle = 0; + switch ($conditional->getStyle()->getBorders()->getLeft()->getBorderStyle()) { + case PHPExcel_Style_Border::BORDER_NONE: + $blockLineStyle |= 0x00; + break; + case PHPExcel_Style_Border::BORDER_THIN: + $blockLineStyle |= 0x01; + break; + case PHPExcel_Style_Border::BORDER_MEDIUM: + $blockLineStyle |= 0x02; + break; + case PHPExcel_Style_Border::BORDER_DASHED: + $blockLineStyle |= 0x03; + break; + case PHPExcel_Style_Border::BORDER_DOTTED: + $blockLineStyle |= 0x04; + break; + case PHPExcel_Style_Border::BORDER_THICK: + $blockLineStyle |= 0x05; + break; + case PHPExcel_Style_Border::BORDER_DOUBLE: + $blockLineStyle |= 0x06; + break; + case PHPExcel_Style_Border::BORDER_HAIR: + $blockLineStyle |= 0x07; + break; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHED: + $blockLineStyle |= 0x08; + break; + case PHPExcel_Style_Border::BORDER_DASHDOT: + $blockLineStyle |= 0x09; + break; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT: + $blockLineStyle |= 0x0A; + break; + case PHPExcel_Style_Border::BORDER_DASHDOTDOT: + $blockLineStyle |= 0x0B; + break; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT: + $blockLineStyle |= 0x0C; + break; + case PHPExcel_Style_Border::BORDER_SLANTDASHDOT: + $blockLineStyle |= 0x0D; + break; + } + switch ($conditional->getStyle()->getBorders()->getRight()->getBorderStyle()) { + case PHPExcel_Style_Border::BORDER_NONE: + $blockLineStyle |= 0x00 << 4; + break; + case PHPExcel_Style_Border::BORDER_THIN: + $blockLineStyle |= 0x01 << 4; + break; + case PHPExcel_Style_Border::BORDER_MEDIUM: + $blockLineStyle |= 0x02 << 4; + break; + case PHPExcel_Style_Border::BORDER_DASHED: + $blockLineStyle |= 0x03 << 4; + break; + case PHPExcel_Style_Border::BORDER_DOTTED: + $blockLineStyle |= 0x04 << 4; + break; + case PHPExcel_Style_Border::BORDER_THICK: + $blockLineStyle |= 0x05 << 4; + break; + case PHPExcel_Style_Border::BORDER_DOUBLE: + $blockLineStyle |= 0x06 << 4; + break; + case PHPExcel_Style_Border::BORDER_HAIR: + $blockLineStyle |= 0x07 << 4; + break; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHED: + $blockLineStyle |= 0x08 << 4; + break; + case PHPExcel_Style_Border::BORDER_DASHDOT: + $blockLineStyle |= 0x09 << 4; + break; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT: + $blockLineStyle |= 0x0A << 4; + break; + case PHPExcel_Style_Border::BORDER_DASHDOTDOT: + $blockLineStyle |= 0x0B << 4; + break; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT: + $blockLineStyle |= 0x0C << 4; + break; + case PHPExcel_Style_Border::BORDER_SLANTDASHDOT: + $blockLineStyle |= 0x0D << 4; + break; + } + switch ($conditional->getStyle()->getBorders()->getTop()->getBorderStyle()) { + case PHPExcel_Style_Border::BORDER_NONE: + $blockLineStyle |= 0x00 << 8; + break; + case PHPExcel_Style_Border::BORDER_THIN: + $blockLineStyle |= 0x01 << 8; + break; + case PHPExcel_Style_Border::BORDER_MEDIUM: + $blockLineStyle |= 0x02 << 8; + break; + case PHPExcel_Style_Border::BORDER_DASHED: + $blockLineStyle |= 0x03 << 8; + break; + case PHPExcel_Style_Border::BORDER_DOTTED: + $blockLineStyle |= 0x04 << 8; + break; + case PHPExcel_Style_Border::BORDER_THICK: + $blockLineStyle |= 0x05 << 8; + break; + case PHPExcel_Style_Border::BORDER_DOUBLE: + $blockLineStyle |= 0x06 << 8; + break; + case PHPExcel_Style_Border::BORDER_HAIR: + $blockLineStyle |= 0x07 << 8; + break; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHED: + $blockLineStyle |= 0x08 << 8; + break; + case PHPExcel_Style_Border::BORDER_DASHDOT: + $blockLineStyle |= 0x09 << 8; + break; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT: + $blockLineStyle |= 0x0A << 8; + break; + case PHPExcel_Style_Border::BORDER_DASHDOTDOT: + $blockLineStyle |= 0x0B << 8; + break; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT: + $blockLineStyle |= 0x0C << 8; + break; + case PHPExcel_Style_Border::BORDER_SLANTDASHDOT: + $blockLineStyle |= 0x0D << 8; + break; + } + switch ($conditional->getStyle()->getBorders()->getBottom()->getBorderStyle()) { + case PHPExcel_Style_Border::BORDER_NONE: + $blockLineStyle |= 0x00 << 12; + break; + case PHPExcel_Style_Border::BORDER_THIN: + $blockLineStyle |= 0x01 << 12; + break; + case PHPExcel_Style_Border::BORDER_MEDIUM: + $blockLineStyle |= 0x02 << 12; + break; + case PHPExcel_Style_Border::BORDER_DASHED: + $blockLineStyle |= 0x03 << 12; + break; + case PHPExcel_Style_Border::BORDER_DOTTED: + $blockLineStyle |= 0x04 << 12; + break; + case PHPExcel_Style_Border::BORDER_THICK: + $blockLineStyle |= 0x05 << 12; + break; + case PHPExcel_Style_Border::BORDER_DOUBLE: + $blockLineStyle |= 0x06 << 12; + break; + case PHPExcel_Style_Border::BORDER_HAIR: + $blockLineStyle |= 0x07 << 12; + break; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHED: + $blockLineStyle |= 0x08 << 12; + break; + case PHPExcel_Style_Border::BORDER_DASHDOT: + $blockLineStyle |= 0x09 << 12; + break; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT: + $blockLineStyle |= 0x0A << 12; + break; + case PHPExcel_Style_Border::BORDER_DASHDOTDOT: + $blockLineStyle |= 0x0B << 12; + break; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT: + $blockLineStyle |= 0x0C << 12; + break; + case PHPExcel_Style_Border::BORDER_SLANTDASHDOT: + $blockLineStyle |= 0x0D << 12; + break; + } + //@todo writeCFRule() => $blockLineStyle => Index Color for left line + //@todo writeCFRule() => $blockLineStyle => Index Color for right line + //@todo writeCFRule() => $blockLineStyle => Top-left to bottom-right on/off + //@todo writeCFRule() => $blockLineStyle => Bottom-left to top-right on/off + $blockColor = 0; + //@todo writeCFRule() => $blockColor => Index Color for top line + //@todo writeCFRule() => $blockColor => Index Color for bottom line + //@todo writeCFRule() => $blockColor => Index Color for diagonal line + switch ($conditional->getStyle()->getBorders()->getDiagonal()->getBorderStyle()) { + case PHPExcel_Style_Border::BORDER_NONE: + $blockColor |= 0x00 << 21; + break; + case PHPExcel_Style_Border::BORDER_THIN: + $blockColor |= 0x01 << 21; + break; + case PHPExcel_Style_Border::BORDER_MEDIUM: + $blockColor |= 0x02 << 21; + break; + case PHPExcel_Style_Border::BORDER_DASHED: + $blockColor |= 0x03 << 21; + break; + case PHPExcel_Style_Border::BORDER_DOTTED: + $blockColor |= 0x04 << 21; + break; + case PHPExcel_Style_Border::BORDER_THICK: + $blockColor |= 0x05 << 21; + break; + case PHPExcel_Style_Border::BORDER_DOUBLE: + $blockColor |= 0x06 << 21; + break; + case PHPExcel_Style_Border::BORDER_HAIR: + $blockColor |= 0x07 << 21; + break; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHED: + $blockColor |= 0x08 << 21; + break; + case PHPExcel_Style_Border::BORDER_DASHDOT: + $blockColor |= 0x09 << 21; + break; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT: + $blockColor |= 0x0A << 21; + break; + case PHPExcel_Style_Border::BORDER_DASHDOTDOT: + $blockColor |= 0x0B << 21; + break; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT: + $blockColor |= 0x0C << 21; + break; + case PHPExcel_Style_Border::BORDER_SLANTDASHDOT: + $blockColor |= 0x0D << 21; + break; + } + $dataBlockBorder = pack('vv', $blockLineStyle, $blockColor); + } + if ($bFormatFill == 1) { + // Fill Patern Style + $blockFillPatternStyle = 0; + switch ($conditional->getStyle()->getFill()->getFillType()) { + case PHPExcel_Style_Fill::FILL_NONE: + $blockFillPatternStyle = 0x00; + break; + case PHPExcel_Style_Fill::FILL_SOLID: + $blockFillPatternStyle = 0x01; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY: + $blockFillPatternStyle = 0x02; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY: + $blockFillPatternStyle = 0x03; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY: + $blockFillPatternStyle = 0x04; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL: + $blockFillPatternStyle = 0x05; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL: + $blockFillPatternStyle = 0x06; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN: + $blockFillPatternStyle = 0x07; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_DARKUP: + $blockFillPatternStyle = 0x08; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID: + $blockFillPatternStyle = 0x09; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS: + $blockFillPatternStyle = 0x0A; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL: + $blockFillPatternStyle = 0x0B; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL: + $blockFillPatternStyle = 0x0C; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN: + $blockFillPatternStyle = 0x0D; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP: + $blockFillPatternStyle = 0x0E; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID: + $blockFillPatternStyle = 0x0F; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS: + $blockFillPatternStyle = 0x10; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_GRAY125: + $blockFillPatternStyle = 0x11; + break; + case PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625: + $blockFillPatternStyle = 0x12; + break; + case PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR: + $blockFillPatternStyle = 0x00; + break; // does not exist in BIFF8 + case PHPExcel_Style_Fill::FILL_GRADIENT_PATH: + $blockFillPatternStyle = 0x00; + break; // does not exist in BIFF8 + default: + $blockFillPatternStyle = 0x00; + break; + } + // Color + switch ($conditional->getStyle()->getFill()->getStartColor()->getRGB()) { + case '000000': + $colorIdxBg = 0x08; + break; + case 'FFFFFF': + $colorIdxBg = 0x09; + break; + case 'FF0000': + $colorIdxBg = 0x0A; + break; + case '00FF00': + $colorIdxBg = 0x0B; + break; + case '0000FF': + $colorIdxBg = 0x0C; + break; + case 'FFFF00': + $colorIdxBg = 0x0D; + break; + case 'FF00FF': + $colorIdxBg = 0x0E; + break; + case '00FFFF': + $colorIdxBg = 0x0F; + break; + case '800000': + $colorIdxBg = 0x10; + break; + case '008000': + $colorIdxBg = 0x11; + break; + case '000080': + $colorIdxBg = 0x12; + break; + case '808000': + $colorIdxBg = 0x13; + break; + case '800080': + $colorIdxBg = 0x14; + break; + case '008080': + $colorIdxBg = 0x15; + break; + case 'C0C0C0': + $colorIdxBg = 0x16; + break; + case '808080': + $colorIdxBg = 0x17; + break; + case '9999FF': + $colorIdxBg = 0x18; + break; + case '993366': + $colorIdxBg = 0x19; + break; + case 'FFFFCC': + $colorIdxBg = 0x1A; + break; + case 'CCFFFF': + $colorIdxBg = 0x1B; + break; + case '660066': + $colorIdxBg = 0x1C; + break; + case 'FF8080': + $colorIdxBg = 0x1D; + break; + case '0066CC': + $colorIdxBg = 0x1E; + break; + case 'CCCCFF': + $colorIdxBg = 0x1F; + break; + case '000080': + $colorIdxBg = 0x20; + break; + case 'FF00FF': + $colorIdxBg = 0x21; + break; + case 'FFFF00': + $colorIdxBg = 0x22; + break; + case '00FFFF': + $colorIdxBg = 0x23; + break; + case '800080': + $colorIdxBg = 0x24; + break; + case '800000': + $colorIdxBg = 0x25; + break; + case '008080': + $colorIdxBg = 0x26; + break; + case '0000FF': + $colorIdxBg = 0x27; + break; + case '00CCFF': + $colorIdxBg = 0x28; + break; + case 'CCFFFF': + $colorIdxBg = 0x29; + break; + case 'CCFFCC': + $colorIdxBg = 0x2A; + break; + case 'FFFF99': + $colorIdxBg = 0x2B; + break; + case '99CCFF': + $colorIdxBg = 0x2C; + break; + case 'FF99CC': + $colorIdxBg = 0x2D; + break; + case 'CC99FF': + $colorIdxBg = 0x2E; + break; + case 'FFCC99': + $colorIdxBg = 0x2F; + break; + case '3366FF': + $colorIdxBg = 0x30; + break; + case '33CCCC': + $colorIdxBg = 0x31; + break; + case '99CC00': + $colorIdxBg = 0x32; + break; + case 'FFCC00': + $colorIdxBg = 0x33; + break; + case 'FF9900': + $colorIdxBg = 0x34; + break; + case 'FF6600': + $colorIdxBg = 0x35; + break; + case '666699': + $colorIdxBg = 0x36; + break; + case '969696': + $colorIdxBg = 0x37; + break; + case '003366': + $colorIdxBg = 0x38; + break; + case '339966': + $colorIdxBg = 0x39; + break; + case '003300': + $colorIdxBg = 0x3A; + break; + case '333300': + $colorIdxBg = 0x3B; + break; + case '993300': + $colorIdxBg = 0x3C; + break; + case '993366': + $colorIdxBg = 0x3D; + break; + case '333399': + $colorIdxBg = 0x3E; + break; + case '333333': + $colorIdxBg = 0x3F; + break; + default: + $colorIdxBg = 0x41; + break; + } + // Fg Color + switch ($conditional->getStyle()->getFill()->getEndColor()->getRGB()) { + case '000000': + $colorIdxFg = 0x08; + break; + case 'FFFFFF': + $colorIdxFg = 0x09; + break; + case 'FF0000': + $colorIdxFg = 0x0A; + break; + case '00FF00': + $colorIdxFg = 0x0B; + break; + case '0000FF': + $colorIdxFg = 0x0C; + break; + case 'FFFF00': + $colorIdxFg = 0x0D; + break; + case 'FF00FF': + $colorIdxFg = 0x0E; + break; + case '00FFFF': + $colorIdxFg = 0x0F; + break; + case '800000': + $colorIdxFg = 0x10; + break; + case '008000': + $colorIdxFg = 0x11; + break; + case '000080': + $colorIdxFg = 0x12; + break; + case '808000': + $colorIdxFg = 0x13; + break; + case '800080': + $colorIdxFg = 0x14; + break; + case '008080': + $colorIdxFg = 0x15; + break; + case 'C0C0C0': + $colorIdxFg = 0x16; + break; + case '808080': + $colorIdxFg = 0x17; + break; + case '9999FF': + $colorIdxFg = 0x18; + break; + case '993366': + $colorIdxFg = 0x19; + break; + case 'FFFFCC': + $colorIdxFg = 0x1A; + break; + case 'CCFFFF': + $colorIdxFg = 0x1B; + break; + case '660066': + $colorIdxFg = 0x1C; + break; + case 'FF8080': + $colorIdxFg = 0x1D; + break; + case '0066CC': + $colorIdxFg = 0x1E; + break; + case 'CCCCFF': + $colorIdxFg = 0x1F; + break; + case '000080': + $colorIdxFg = 0x20; + break; + case 'FF00FF': + $colorIdxFg = 0x21; + break; + case 'FFFF00': + $colorIdxFg = 0x22; + break; + case '00FFFF': + $colorIdxFg = 0x23; + break; + case '800080': + $colorIdxFg = 0x24; + break; + case '800000': + $colorIdxFg = 0x25; + break; + case '008080': + $colorIdxFg = 0x26; + break; + case '0000FF': + $colorIdxFg = 0x27; + break; + case '00CCFF': + $colorIdxFg = 0x28; + break; + case 'CCFFFF': + $colorIdxFg = 0x29; + break; + case 'CCFFCC': + $colorIdxFg = 0x2A; + break; + case 'FFFF99': + $colorIdxFg = 0x2B; + break; + case '99CCFF': + $colorIdxFg = 0x2C; + break; + case 'FF99CC': + $colorIdxFg = 0x2D; + break; + case 'CC99FF': + $colorIdxFg = 0x2E; + break; + case 'FFCC99': + $colorIdxFg = 0x2F; + break; + case '3366FF': + $colorIdxFg = 0x30; + break; + case '33CCCC': + $colorIdxFg = 0x31; + break; + case '99CC00': + $colorIdxFg = 0x32; + break; + case 'FFCC00': + $colorIdxFg = 0x33; + break; + case 'FF9900': + $colorIdxFg = 0x34; + break; + case 'FF6600': + $colorIdxFg = 0x35; + break; + case '666699': + $colorIdxFg = 0x36; + break; + case '969696': + $colorIdxFg = 0x37; + break; + case '003366': + $colorIdxFg = 0x38; + break; + case '339966': + $colorIdxFg = 0x39; + break; + case '003300': + $colorIdxFg = 0x3A; + break; + case '333300': + $colorIdxFg = 0x3B; + break; + case '993300': + $colorIdxFg = 0x3C; + break; + case '993366': + $colorIdxFg = 0x3D; + break; + case '333399': + $colorIdxFg = 0x3E; + break; + case '333333': + $colorIdxFg = 0x3F; + break; + default: + $colorIdxFg = 0x40; + break; + } + $dataBlockFill = pack('v', $blockFillPatternStyle); + $dataBlockFill .= pack('v', $colorIdxFg | ($colorIdxBg << 7)); + } + if ($bFormatProt == 1) { + $dataBlockProtection = 0; + if ($conditional->getStyle()->getProtection()->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED) { + $dataBlockProtection = 1; + } + if ($conditional->getStyle()->getProtection()->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED) { + $dataBlockProtection = 1 << 1; + } + } + + $data = pack('CCvvVv', $type, $operatorType, $szValue1, $szValue2, $flags, 0x0000); + if ($bFormatFont == 1) { // Block Formatting : OK + $data .= $dataBlockFont; + } + if ($bFormatAlign == 1) { + $data .= $dataBlockAlign; + } + if ($bFormatBorder == 1) { + $data .= $dataBlockBorder; + } + if ($bFormatFill == 1) { // Block Formatting : OK + $data .= $dataBlockFill; + } + if ($bFormatProt == 1) { + $data .= $dataBlockProtection; + } + if (!is_null($operand1)) { + $data .= $operand1; + } + if (!is_null($operand2)) { + $data .= $operand2; + } + $header = pack('vv', $record, strlen($data)); + $this->append($header . $data); + } + + /** + * Write CFHeader record + */ + private function writeCFHeader() + { + $record = 0x01B0; // Record identifier + $length = 0x0016; // Bytes to follow + + $numColumnMin = null; + $numColumnMax = null; + $numRowMin = null; + $numRowMax = null; + $arrConditional = array(); + foreach ($this->phpSheet->getConditionalStylesCollection() as $cellCoordinate => $conditionalStyles) { + foreach ($conditionalStyles as $conditional) { + if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_EXPRESSION + || $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS) { + if (!in_array($conditional->getHashCode(), $arrConditional)) { + $arrConditional[] = $conditional->getHashCode(); + } + // Cells + $arrCoord = PHPExcel_Cell::coordinateFromString($cellCoordinate); + if (!is_numeric($arrCoord[0])) { + $arrCoord[0] = PHPExcel_Cell::columnIndexFromString($arrCoord[0]); + } + if (is_null($numColumnMin) || ($numColumnMin > $arrCoord[0])) { + $numColumnMin = $arrCoord[0]; + } + if (is_null($numColumnMax) || ($numColumnMax < $arrCoord[0])) { + $numColumnMax = $arrCoord[0]; + } + if (is_null($numRowMin) || ($numRowMin > $arrCoord[1])) { + $numRowMin = $arrCoord[1]; + } + if (is_null($numRowMax) || ($numRowMax < $arrCoord[1])) { + $numRowMax = $arrCoord[1]; + } + } + } + } + $needRedraw = 1; + $cellRange = pack('vvvv', $numRowMin-1, $numRowMax-1, $numColumnMin-1, $numColumnMax-1); + + $header = pack('vv', $record, $length); + $data = pack('vv', count($arrConditional), $needRedraw); + $data .= $cellRange; + $data .= pack('v', 0x0001); + $data .= $cellRange; + $this->append($header . $data); + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Excel5/Xf.php b/extend/PHPExcel/PHPExcel/Writer/Excel5/Xf.php new file mode 100644 index 0000000..e41589a --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Excel5/Xf.php @@ -0,0 +1,557 @@ +<?php + +/** + * PHPExcel_Writer_Excel5_Xf + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_Excel5 + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + +// Original file header of PEAR::Spreadsheet_Excel_Writer_Format (used as the base for this class): +// ----------------------------------------------------------------------------------------- +// /* +// * Module written/ported by Xavier Noguer <xnoguer@rezebra.com> +// * +// * The majority of this is _NOT_ my code. I simply ported it from the +// * PERL Spreadsheet::WriteExcel module. +// * +// * The author of the Spreadsheet::WriteExcel module is John McNamara +// * <jmcnamara@cpan.org> +// * +// * I _DO_ maintain this code, and John McNamara has nothing to do with the +// * porting of this code to PHP. Any questions directly related to this +// * class library should be directed to me. +// * +// * License Information: +// * +// * Spreadsheet_Excel_Writer: A library for generating Excel Spreadsheets +// * Copyright (c) 2002-2003 Xavier Noguer xnoguer@rezebra.com +// * +// * This library is free software; you can redistribute it and/or +// * modify it under the terms of the GNU Lesser General Public +// * License as published by the Free Software Foundation; either +// * version 2.1 of the License, or (at your option) any later version. +// * +// * This library is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// * Lesser General Public License for more details. +// * +// * You should have received a copy of the GNU Lesser General Public +// * License along with this library; if not, write to the Free Software +// * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// */ +class PHPExcel_Writer_Excel5_Xf +{ + /** + * Style XF or a cell XF ? + * + * @var boolean + */ + private $isStyleXf; + + /** + * Index to the FONT record. Index 4 does not exist + * @var integer + */ + private $fontIndex; + + /** + * An index (2 bytes) to a FORMAT record (number format). + * @var integer + */ + private $numberFormatIndex; + + /** + * 1 bit, apparently not used. + * @var integer + */ + private $textJustLast; + + /** + * The cell's foreground color. + * @var integer + */ + private $foregroundColor; + + /** + * The cell's background color. + * @var integer + */ + private $backgroundColor; + + /** + * Color of the bottom border of the cell. + * @var integer + */ + private $bottomBorderColor; + + /** + * Color of the top border of the cell. + * @var integer + */ + private $topBorderColor; + + /** + * Color of the left border of the cell. + * @var integer + */ + private $leftBorderColor; + + /** + * Color of the right border of the cell. + * @var integer + */ + private $rightBorderColor; + + /** + * Constructor + * + * @access public + * @param PHPExcel_Style The XF format + */ + public function __construct(PHPExcel_Style $style = null) + { + $this->isStyleXf = false; + $this->fontIndex = 0; + + $this->numberFormatIndex = 0; + + $this->textJustLast = 0; + + $this->foregroundColor = 0x40; + $this->backgroundColor = 0x41; + + $this->_diag = 0; + + $this->bottomBorderColor = 0x40; + $this->topBorderColor = 0x40; + $this->leftBorderColor = 0x40; + $this->rightBorderColor = 0x40; + $this->_diag_color = 0x40; + $this->_style = $style; + + } + + + /** + * Generate an Excel BIFF XF record (style or cell). + * + * @return string The XF record + */ + public function writeXf() + { + // Set the type of the XF record and some of the attributes. + if ($this->isStyleXf) { + $style = 0xFFF5; + } else { + $style = self::mapLocked($this->_style->getProtection()->getLocked()); + $style |= self::mapHidden($this->_style->getProtection()->getHidden()) << 1; + } + + // Flags to indicate if attributes have been set. + $atr_num = ($this->numberFormatIndex != 0)?1:0; + $atr_fnt = ($this->fontIndex != 0)?1:0; + $atr_alc = ((int) $this->_style->getAlignment()->getWrapText()) ? 1 : 0; + $atr_bdr = (self::mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) || + self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) || + self::mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) || + self::mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()))?1:0; + $atr_pat = (($this->foregroundColor != 0x40) || + ($this->backgroundColor != 0x41) || + self::mapFillType($this->_style->getFill()->getFillType()))?1:0; + $atr_prot = self::mapLocked($this->_style->getProtection()->getLocked()) + | self::mapHidden($this->_style->getProtection()->getHidden()); + + // Zero the default border colour if the border has not been set. + if (self::mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) == 0) { + $this->bottomBorderColor = 0; + } + if (self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) == 0) { + $this->topBorderColor = 0; + } + if (self::mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()) == 0) { + $this->rightBorderColor = 0; + } + if (self::mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) == 0) { + $this->leftBorderColor = 0; + } + if (self::mapBorderStyle($this->_style->getBorders()->getDiagonal()->getBorderStyle()) == 0) { + $this->_diag_color = 0; + } + + $record = 0x00E0; // Record identifier + $length = 0x0014; // Number of bytes to follow + + $ifnt = $this->fontIndex; // Index to FONT record + $ifmt = $this->numberFormatIndex; // Index to FORMAT record + + $align = $this->mapHAlign($this->_style->getAlignment()->getHorizontal()); // Alignment + $align |= (int) $this->_style->getAlignment()->getWrapText() << 3; + $align |= self::mapVAlign($this->_style->getAlignment()->getVertical()) << 4; + $align |= $this->textJustLast << 7; + + $used_attrib = $atr_num << 2; + $used_attrib |= $atr_fnt << 3; + $used_attrib |= $atr_alc << 4; + $used_attrib |= $atr_bdr << 5; + $used_attrib |= $atr_pat << 6; + $used_attrib |= $atr_prot << 7; + + $icv = $this->foregroundColor; // fg and bg pattern colors + $icv |= $this->backgroundColor << 7; + + $border1 = self::mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()); // Border line style and color + $border1 |= self::mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()) << 4; + $border1 |= self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) << 8; + $border1 |= self::mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) << 12; + $border1 |= $this->leftBorderColor << 16; + $border1 |= $this->rightBorderColor << 23; + + $diagonalDirection = $this->_style->getBorders()->getDiagonalDirection(); + $diag_tl_to_rb = $diagonalDirection == PHPExcel_Style_Borders::DIAGONAL_BOTH + || $diagonalDirection == PHPExcel_Style_Borders::DIAGONAL_DOWN; + $diag_tr_to_lb = $diagonalDirection == PHPExcel_Style_Borders::DIAGONAL_BOTH + || $diagonalDirection == PHPExcel_Style_Borders::DIAGONAL_UP; + $border1 |= $diag_tl_to_rb << 30; + $border1 |= $diag_tr_to_lb << 31; + + $border2 = $this->topBorderColor; // Border color + $border2 |= $this->bottomBorderColor << 7; + $border2 |= $this->_diag_color << 14; + $border2 |= self::mapBorderStyle($this->_style->getBorders()->getDiagonal()->getBorderStyle()) << 21; + $border2 |= self::mapFillType($this->_style->getFill()->getFillType()) << 26; + + $header = pack("vv", $record, $length); + + //BIFF8 options: identation, shrinkToFit and text direction + $biff8_options = $this->_style->getAlignment()->getIndent(); + $biff8_options |= (int) $this->_style->getAlignment()->getShrinkToFit() << 4; + + $data = pack("vvvC", $ifnt, $ifmt, $style, $align); + $data .= pack("CCC", self::mapTextRotation($this->_style->getAlignment()->getTextRotation()), $biff8_options, $used_attrib); + $data .= pack("VVv", $border1, $border2, $icv); + + return($header . $data); + } + + /** + * Is this a style XF ? + * + * @param boolean $value + */ + public function setIsStyleXf($value) + { + $this->isStyleXf = $value; + } + + /** + * Sets the cell's bottom border color + * + * @access public + * @param int $colorIndex Color index + */ + public function setBottomColor($colorIndex) + { + $this->bottomBorderColor = $colorIndex; + } + + /** + * Sets the cell's top border color + * + * @access public + * @param int $colorIndex Color index + */ + public function setTopColor($colorIndex) + { + $this->topBorderColor = $colorIndex; + } + + /** + * Sets the cell's left border color + * + * @access public + * @param int $colorIndex Color index + */ + public function setLeftColor($colorIndex) + { + $this->leftBorderColor = $colorIndex; + } + + /** + * Sets the cell's right border color + * + * @access public + * @param int $colorIndex Color index + */ + public function setRightColor($colorIndex) + { + $this->rightBorderColor = $colorIndex; + } + + /** + * Sets the cell's diagonal border color + * + * @access public + * @param int $colorIndex Color index + */ + public function setDiagColor($colorIndex) + { + $this->_diag_color = $colorIndex; + } + + + /** + * Sets the cell's foreground color + * + * @access public + * @param int $colorIndex Color index + */ + public function setFgColor($colorIndex) + { + $this->foregroundColor = $colorIndex; + } + + /** + * Sets the cell's background color + * + * @access public + * @param int $colorIndex Color index + */ + public function setBgColor($colorIndex) + { + $this->backgroundColor = $colorIndex; + } + + /** + * Sets the index to the number format record + * It can be date, time, currency, etc... + * + * @access public + * @param integer $numberFormatIndex Index to format record + */ + public function setNumberFormatIndex($numberFormatIndex) + { + $this->numberFormatIndex = $numberFormatIndex; + } + + /** + * Set the font index. + * + * @param int $value Font index, note that value 4 does not exist + */ + public function setFontIndex($value) + { + $this->fontIndex = $value; + } + + /** + * Map of BIFF2-BIFF8 codes for border styles + * @static array of int + * + */ + private static $mapBorderStyles = array( + PHPExcel_Style_Border::BORDER_NONE => 0x00, + PHPExcel_Style_Border::BORDER_THIN => 0x01, + PHPExcel_Style_Border::BORDER_MEDIUM => 0x02, + PHPExcel_Style_Border::BORDER_DASHED => 0x03, + PHPExcel_Style_Border::BORDER_DOTTED => 0x04, + PHPExcel_Style_Border::BORDER_THICK => 0x05, + PHPExcel_Style_Border::BORDER_DOUBLE => 0x06, + PHPExcel_Style_Border::BORDER_HAIR => 0x07, + PHPExcel_Style_Border::BORDER_MEDIUMDASHED => 0x08, + PHPExcel_Style_Border::BORDER_DASHDOT => 0x09, + PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT => 0x0A, + PHPExcel_Style_Border::BORDER_DASHDOTDOT => 0x0B, + PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT => 0x0C, + PHPExcel_Style_Border::BORDER_SLANTDASHDOT => 0x0D, + ); + + /** + * Map border style + * + * @param string $borderStyle + * @return int + */ + private static function mapBorderStyle($borderStyle) + { + if (isset(self::$mapBorderStyles[$borderStyle])) { + return self::$mapBorderStyles[$borderStyle]; + } + return 0x00; + } + + /** + * Map of BIFF2-BIFF8 codes for fill types + * @static array of int + * + */ + private static $mapFillTypes = array( + PHPExcel_Style_Fill::FILL_NONE => 0x00, + PHPExcel_Style_Fill::FILL_SOLID => 0x01, + PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY => 0x02, + PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY => 0x03, + PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY => 0x04, + PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL => 0x05, + PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL => 0x06, + PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN => 0x07, + PHPExcel_Style_Fill::FILL_PATTERN_DARKUP => 0x08, + PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID => 0x09, + PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS => 0x0A, + PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL => 0x0B, + PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL => 0x0C, + PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN => 0x0D, + PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP => 0x0E, + PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID => 0x0F, + PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS => 0x10, + PHPExcel_Style_Fill::FILL_PATTERN_GRAY125 => 0x11, + PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625 => 0x12, + PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR => 0x00, // does not exist in BIFF8 + PHPExcel_Style_Fill::FILL_GRADIENT_PATH => 0x00, // does not exist in BIFF8 + ); + + /** + * Map fill type + * + * @param string $fillType + * @return int + */ + private static function mapFillType($fillType) + { + if (isset(self::$mapFillTypes[$fillType])) { + return self::$mapFillTypes[$fillType]; + } + return 0x00; + } + + /** + * Map of BIFF2-BIFF8 codes for horizontal alignment + * @static array of int + * + */ + private static $mapHAlignments = array( + PHPExcel_Style_Alignment::HORIZONTAL_GENERAL => 0, + PHPExcel_Style_Alignment::HORIZONTAL_LEFT => 1, + PHPExcel_Style_Alignment::HORIZONTAL_CENTER => 2, + PHPExcel_Style_Alignment::HORIZONTAL_RIGHT => 3, + PHPExcel_Style_Alignment::HORIZONTAL_FILL => 4, + PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY => 5, + PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS => 6, + ); + + /** + * Map to BIFF2-BIFF8 codes for horizontal alignment + * + * @param string $hAlign + * @return int + */ + private function mapHAlign($hAlign) + { + if (isset(self::$mapHAlignments[$hAlign])) { + return self::$mapHAlignments[$hAlign]; + } + return 0; + } + + /** + * Map of BIFF2-BIFF8 codes for vertical alignment + * @static array of int + * + */ + private static $mapVAlignments = array( + PHPExcel_Style_Alignment::VERTICAL_TOP => 0, + PHPExcel_Style_Alignment::VERTICAL_CENTER => 1, + PHPExcel_Style_Alignment::VERTICAL_BOTTOM => 2, + PHPExcel_Style_Alignment::VERTICAL_JUSTIFY => 3, + ); + + /** + * Map to BIFF2-BIFF8 codes for vertical alignment + * + * @param string $vAlign + * @return int + */ + private static function mapVAlign($vAlign) + { + if (isset(self::$mapVAlignments[$vAlign])) { + return self::$mapVAlignments[$vAlign]; + } + return 2; + } + + /** + * Map to BIFF8 codes for text rotation angle + * + * @param int $textRotation + * @return int + */ + private static function mapTextRotation($textRotation) + { + if ($textRotation >= 0) { + return $textRotation; + } elseif ($textRotation == -165) { + return 255; + } elseif ($textRotation < 0) { + return 90 - $textRotation; + } + } + + /** + * Map locked + * + * @param string + * @return int + */ + private static function mapLocked($locked) + { + switch ($locked) { + case PHPExcel_Style_Protection::PROTECTION_INHERIT: + return 1; + case PHPExcel_Style_Protection::PROTECTION_PROTECTED: + return 1; + case PHPExcel_Style_Protection::PROTECTION_UNPROTECTED: + return 0; + default: + return 1; + } + } + + /** + * Map hidden + * + * @param string + * @return int + */ + private static function mapHidden($hidden) + { + switch ($hidden) { + case PHPExcel_Style_Protection::PROTECTION_INHERIT: + return 0; + case PHPExcel_Style_Protection::PROTECTION_PROTECTED: + return 1; + case PHPExcel_Style_Protection::PROTECTION_UNPROTECTED: + return 0; + default: + return 0; + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/Exception.php b/extend/PHPExcel/PHPExcel/Writer/Exception.php new file mode 100644 index 0000000..bfa0056 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/Exception.php @@ -0,0 +1,46 @@ +<?php + +/** + * PHPExcel_Writer_Exception + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_Exception extends PHPExcel_Exception +{ + /** + * Error handler callback + * + * @param mixed $code + * @param mixed $string + * @param mixed $file + * @param mixed $line + * @param mixed $context + */ + public static function errorHandlerCallback($code, $string, $file, $line, $context) + { + $e = new self($string, $code); + $e->line = $line; + $e->file = $file; + throw $e; + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/HTML.php b/extend/PHPExcel/PHPExcel/Writer/HTML.php new file mode 100644 index 0000000..31d7c63 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/HTML.php @@ -0,0 +1,1612 @@ +<?php + +/** + * PHPExcel_Writer_HTML + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_HTML + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter +{ + /** + * PHPExcel object + * + * @var PHPExcel + */ + protected $phpExcel; + + /** + * Sheet index to write + * + * @var int + */ + private $sheetIndex = 0; + + /** + * Images root + * + * @var string + */ + private $imagesRoot = '.'; + + /** + * embed images, or link to images + * + * @var boolean + */ + private $embedImages = false; + + /** + * Use inline CSS? + * + * @var boolean + */ + private $useInlineCss = false; + + /** + * Array of CSS styles + * + * @var array + */ + private $cssStyles; + + /** + * Array of column widths in points + * + * @var array + */ + private $columnWidths; + + /** + * Default font + * + * @var PHPExcel_Style_Font + */ + private $defaultFont; + + /** + * Flag whether spans have been calculated + * + * @var boolean + */ + private $spansAreCalculated = false; + + /** + * Excel cells that should not be written as HTML cells + * + * @var array + */ + private $isSpannedCell = array(); + + /** + * Excel cells that are upper-left corner in a cell merge + * + * @var array + */ + private $isBaseCell = array(); + + /** + * Excel rows that should not be written as HTML rows + * + * @var array + */ + private $isSpannedRow = array(); + + /** + * Is the current writer creating PDF? + * + * @var boolean + */ + protected $isPdf = false; + + /** + * Generate the Navigation block + * + * @var boolean + */ + private $generateSheetNavigationBlock = true; + + /** + * Create a new PHPExcel_Writer_HTML + * + * @param PHPExcel $phpExcel PHPExcel object + */ + public function __construct(PHPExcel $phpExcel) + { + $this->phpExcel = $phpExcel; + $this->defaultFont = $this->phpExcel->getDefaultStyle()->getFont(); + } + + /** + * Save PHPExcel to file + * + * @param string $pFilename + * @throws PHPExcel_Writer_Exception + */ + public function save($pFilename = null) + { + // garbage collect + $this->phpExcel->garbageCollect(); + + $saveDebugLog = PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->getWriteDebugLog(); + PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog(false); + $saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType(); + PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE); + + // Build CSS + $this->buildCSS(!$this->useInlineCss); + + // Open file + $fileHandle = fopen($pFilename, 'wb+'); + if ($fileHandle === false) { + throw new PHPExcel_Writer_Exception("Could not open file $pFilename for writing."); + } + + // Write headers + fwrite($fileHandle, $this->generateHTMLHeader(!$this->useInlineCss)); + + // Write navigation (tabs) + if ((!$this->isPdf) && ($this->generateSheetNavigationBlock)) { + fwrite($fileHandle, $this->generateNavigation()); + } + + // Write data + fwrite($fileHandle, $this->generateSheetData()); + + // Write footer + fwrite($fileHandle, $this->generateHTMLFooter()); + + // Close file + fclose($fileHandle); + + PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType); + PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog($saveDebugLog); + } + + /** + * Map VAlign + * + * @param string $vAlign Vertical alignment + * @return string + */ + private function mapVAlign($vAlign) + { + switch ($vAlign) { + case PHPExcel_Style_Alignment::VERTICAL_BOTTOM: + return 'bottom'; + case PHPExcel_Style_Alignment::VERTICAL_TOP: + return 'top'; + case PHPExcel_Style_Alignment::VERTICAL_CENTER: + case PHPExcel_Style_Alignment::VERTICAL_JUSTIFY: + return 'middle'; + default: + return 'baseline'; + } + } + + /** + * Map HAlign + * + * @param string $hAlign Horizontal alignment + * @return string|false + */ + private function mapHAlign($hAlign) + { + switch ($hAlign) { + case PHPExcel_Style_Alignment::HORIZONTAL_GENERAL: + return false; + case PHPExcel_Style_Alignment::HORIZONTAL_LEFT: + return 'left'; + case PHPExcel_Style_Alignment::HORIZONTAL_RIGHT: + return 'right'; + case PHPExcel_Style_Alignment::HORIZONTAL_CENTER: + case PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS: + return 'center'; + case PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY: + return 'justify'; + default: + return false; + } + } + + /** + * Map border style + * + * @param int $borderStyle Sheet index + * @return string + */ + private function mapBorderStyle($borderStyle) + { + switch ($borderStyle) { + case PHPExcel_Style_Border::BORDER_NONE: + return 'none'; + case PHPExcel_Style_Border::BORDER_DASHDOT: + return '1px dashed'; + case PHPExcel_Style_Border::BORDER_DASHDOTDOT: + return '1px dotted'; + case PHPExcel_Style_Border::BORDER_DASHED: + return '1px dashed'; + case PHPExcel_Style_Border::BORDER_DOTTED: + return '1px dotted'; + case PHPExcel_Style_Border::BORDER_DOUBLE: + return '3px double'; + case PHPExcel_Style_Border::BORDER_HAIR: + return '1px solid'; + case PHPExcel_Style_Border::BORDER_MEDIUM: + return '2px solid'; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT: + return '2px dashed'; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT: + return '2px dotted'; + case PHPExcel_Style_Border::BORDER_MEDIUMDASHED: + return '2px dashed'; + case PHPExcel_Style_Border::BORDER_SLANTDASHDOT: + return '2px dashed'; + case PHPExcel_Style_Border::BORDER_THICK: + return '3px solid'; + case PHPExcel_Style_Border::BORDER_THIN: + return '1px solid'; + default: + // map others to thin + return '1px solid'; + } + } + + /** + * Get sheet index + * + * @return int + */ + public function getSheetIndex() + { + return $this->sheetIndex; + } + + /** + * Set sheet index + * + * @param int $pValue Sheet index + * @return PHPExcel_Writer_HTML + */ + public function setSheetIndex($pValue = 0) + { + $this->sheetIndex = $pValue; + return $this; + } + + /** + * Get sheet index + * + * @return boolean + */ + public function getGenerateSheetNavigationBlock() + { + return $this->generateSheetNavigationBlock; + } + + /** + * Set sheet index + * + * @param boolean $pValue Flag indicating whether the sheet navigation block should be generated or not + * @return PHPExcel_Writer_HTML + */ + public function setGenerateSheetNavigationBlock($pValue = true) + { + $this->generateSheetNavigationBlock = (bool) $pValue; + return $this; + } + + /** + * Write all sheets (resets sheetIndex to NULL) + */ + public function writeAllSheets() + { + $this->sheetIndex = null; + return $this; + } + + /** + * Generate HTML header + * + * @param boolean $pIncludeStyles Include styles? + * @return string + * @throws PHPExcel_Writer_Exception + */ + public function generateHTMLHeader($pIncludeStyles = false) + { + // PHPExcel object known? + if (is_null($this->phpExcel)) { + throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.'); + } + + // Construct HTML + $properties = $this->phpExcel->getProperties(); + $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">' . PHP_EOL; + $html .= '<!-- Generated by PHPExcel - http://www.phpexcel.net -->' . PHP_EOL; + $html .= '<html>' . PHP_EOL; + $html .= ' <head>' . PHP_EOL; + $html .= ' <meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . PHP_EOL; + if ($properties->getTitle() > '') { + $html .= ' <title>' . htmlspecialchars($properties->getTitle()) . '</title>' . PHP_EOL; + } + if ($properties->getCreator() > '') { + $html .= ' <meta name="author" content="' . htmlspecialchars($properties->getCreator()) . '" />' . PHP_EOL; + } + if ($properties->getTitle() > '') { + $html .= ' <meta name="title" content="' . htmlspecialchars($properties->getTitle()) . '" />' . PHP_EOL; + } + if ($properties->getDescription() > '') { + $html .= ' <meta name="description" content="' . htmlspecialchars($properties->getDescription()) . '" />' . PHP_EOL; + } + if ($properties->getSubject() > '') { + $html .= ' <meta name="subject" content="' . htmlspecialchars($properties->getSubject()) . '" />' . PHP_EOL; + } + if ($properties->getKeywords() > '') { + $html .= ' <meta name="keywords" content="' . htmlspecialchars($properties->getKeywords()) . '" />' . PHP_EOL; + } + if ($properties->getCategory() > '') { + $html .= ' <meta name="category" content="' . htmlspecialchars($properties->getCategory()) . '" />' . PHP_EOL; + } + if ($properties->getCompany() > '') { + $html .= ' <meta name="company" content="' . htmlspecialchars($properties->getCompany()) . '" />' . PHP_EOL; + } + if ($properties->getManager() > '') { + $html .= ' <meta name="manager" content="' . htmlspecialchars($properties->getManager()) . '" />' . PHP_EOL; + } + + if ($pIncludeStyles) { + $html .= $this->generateStyles(true); + } + + $html .= ' </head>' . PHP_EOL; + $html .= '' . PHP_EOL; + $html .= ' <body>' . PHP_EOL; + + return $html; + } + + /** + * Generate sheet data + * + * @return string + * @throws PHPExcel_Writer_Exception + */ + public function generateSheetData() + { + // PHPExcel object known? + if (is_null($this->phpExcel)) { + throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.'); + } + + // Ensure that Spans have been calculated? + if ($this->sheetIndex !== null || !$this->spansAreCalculated) { + $this->calculateSpans(); + } + + // Fetch sheets + $sheets = array(); + if (is_null($this->sheetIndex)) { + $sheets = $this->phpExcel->getAllSheets(); + } else { + $sheets[] = $this->phpExcel->getSheet($this->sheetIndex); + } + + // Construct HTML + $html = ''; + + // Loop all sheets + $sheetId = 0; + foreach ($sheets as $sheet) { + // Write table header + $html .= $this->generateTableHeader($sheet); + + // Get worksheet dimension + $dimension = explode(':', $sheet->calculateWorksheetDimension()); + $dimension[0] = PHPExcel_Cell::coordinateFromString($dimension[0]); + $dimension[0][0] = PHPExcel_Cell::columnIndexFromString($dimension[0][0]) - 1; + $dimension[1] = PHPExcel_Cell::coordinateFromString($dimension[1]); + $dimension[1][0] = PHPExcel_Cell::columnIndexFromString($dimension[1][0]) - 1; + + // row min,max + $rowMin = $dimension[0][1]; + $rowMax = $dimension[1][1]; + + // calculate start of <tbody>, <thead> + $tbodyStart = $rowMin; + $theadStart = $theadEnd = 0; // default: no <thead> no </thead> + if ($sheet->getPageSetup()->isRowsToRepeatAtTopSet()) { + $rowsToRepeatAtTop = $sheet->getPageSetup()->getRowsToRepeatAtTop(); + + // we can only support repeating rows that start at top row + if ($rowsToRepeatAtTop[0] == 1) { + $theadStart = $rowsToRepeatAtTop[0]; + $theadEnd = $rowsToRepeatAtTop[1]; + $tbodyStart = $rowsToRepeatAtTop[1] + 1; + } + } + + // Loop through cells + $row = $rowMin-1; + while ($row++ < $rowMax) { + // <thead> ? + if ($row == $theadStart) { + $html .= ' <thead>' . PHP_EOL; + $cellType = 'th'; + } + + // <tbody> ? + if ($row == $tbodyStart) { + $html .= ' <tbody>' . PHP_EOL; + $cellType = 'td'; + } + + // Write row if there are HTML table cells in it + if (!isset($this->isSpannedRow[$sheet->getParent()->getIndex($sheet)][$row])) { + // Start a new rowData + $rowData = array(); + // Loop through columns + $column = $dimension[0][0] - 1; + while ($column++ < $dimension[1][0]) { + // Cell exists? + if ($sheet->cellExistsByColumnAndRow($column, $row)) { + $rowData[$column] = PHPExcel_Cell::stringFromColumnIndex($column) . $row; + } else { + $rowData[$column] = ''; + } + } + $html .= $this->generateRow($sheet, $rowData, $row - 1, $cellType); + } + + // </thead> ? + if ($row == $theadEnd) { + $html .= ' </thead>' . PHP_EOL; + } + } + $html .= $this->extendRowsForChartsAndImages($sheet, $row); + + // Close table body. + $html .= ' </tbody>' . PHP_EOL; + + // Write table footer + $html .= $this->generateTableFooter(); + + // Writing PDF? + if ($this->isPdf) { + if (is_null($this->sheetIndex) && $sheetId + 1 < $this->phpExcel->getSheetCount()) { + $html .= '<div style="page-break-before:always" />'; + } + } + + // Next sheet + ++$sheetId; + } + + return $html; + } + + /** + * Generate sheet tabs + * + * @return string + * @throws PHPExcel_Writer_Exception + */ + public function generateNavigation() + { + // PHPExcel object known? + if (is_null($this->phpExcel)) { + throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.'); + } + + // Fetch sheets + $sheets = array(); + if (is_null($this->sheetIndex)) { + $sheets = $this->phpExcel->getAllSheets(); + } else { + $sheets[] = $this->phpExcel->getSheet($this->sheetIndex); + } + + // Construct HTML + $html = ''; + + // Only if there are more than 1 sheets + if (count($sheets) > 1) { + // Loop all sheets + $sheetId = 0; + + $html .= '<ul class="navigation">' . PHP_EOL; + + foreach ($sheets as $sheet) { + $html .= ' <li class="sheet' . $sheetId . '"><a href="#sheet' . $sheetId . '">' . $sheet->getTitle() . '</a></li>' . PHP_EOL; + ++$sheetId; + } + + $html .= '</ul>' . PHP_EOL; + } + + return $html; + } + + private function extendRowsForChartsAndImages(PHPExcel_Worksheet $pSheet, $row) + { + $rowMax = $row; + $colMax = 'A'; + if ($this->includeCharts) { + foreach ($pSheet->getChartCollection() as $chart) { + if ($chart instanceof PHPExcel_Chart) { + $chartCoordinates = $chart->getTopLeftPosition(); + $chartTL = PHPExcel_Cell::coordinateFromString($chartCoordinates['cell']); + $chartCol = PHPExcel_Cell::columnIndexFromString($chartTL[0]); + if ($chartTL[1] > $rowMax) { + $rowMax = $chartTL[1]; + if ($chartCol > PHPExcel_Cell::columnIndexFromString($colMax)) { + $colMax = $chartTL[0]; + } + } + } + } + } + + foreach ($pSheet->getDrawingCollection() as $drawing) { + if ($drawing instanceof PHPExcel_Worksheet_Drawing) { + $imageTL = PHPExcel_Cell::coordinateFromString($drawing->getCoordinates()); + $imageCol = PHPExcel_Cell::columnIndexFromString($imageTL[0]); + if ($imageTL[1] > $rowMax) { + $rowMax = $imageTL[1]; + if ($imageCol > PHPExcel_Cell::columnIndexFromString($colMax)) { + $colMax = $imageTL[0]; + } + } + } + } + + $html = ''; + $colMax++; + while ($row <= $rowMax) { + $html .= '<tr>'; + for ($col = 'A'; $col != $colMax; ++$col) { + $html .= '<td>'; + $html .= $this->writeImageInCell($pSheet, $col.$row); + if ($this->includeCharts) { + $html .= $this->writeChartInCell($pSheet, $col.$row); + } + $html .= '</td>'; + } + ++$row; + $html .= '</tr>'; + } + return $html; + } + + + /** + * Generate image tag in cell + * + * @param PHPExcel_Worksheet $pSheet PHPExcel_Worksheet + * @param string $coordinates Cell coordinates + * @return string + * @throws PHPExcel_Writer_Exception + */ + private function writeImageInCell(PHPExcel_Worksheet $pSheet, $coordinates) + { + // Construct HTML + $html = ''; + + // Write images + foreach ($pSheet->getDrawingCollection() as $drawing) { + if ($drawing instanceof PHPExcel_Worksheet_Drawing) { + if ($drawing->getCoordinates() == $coordinates) { + $filename = $drawing->getPath(); + + // Strip off eventual '.' + if (substr($filename, 0, 1) == '.') { + $filename = substr($filename, 1); + } + + // Prepend images root + $filename = $this->getImagesRoot() . $filename; + + // Strip off eventual '.' + if (substr($filename, 0, 1) == '.' && substr($filename, 0, 2) != './') { + $filename = substr($filename, 1); + } + + // Convert UTF8 data to PCDATA + $filename = htmlspecialchars($filename); + + $html .= PHP_EOL; + if ((!$this->embedImages) || ($this->isPdf)) { + $imageData = $filename; + } else { + $imageDetails = getimagesize($filename); + if ($fp = fopen($filename, "rb", 0)) { + $picture = fread($fp, filesize($filename)); + fclose($fp); + // base64 encode the binary data, then break it + // into chunks according to RFC 2045 semantics + $base64 = chunk_split(base64_encode($picture)); + $imageData = 'data:'.$imageDetails['mime'].';base64,' . $base64; + } else { + $imageData = $filename; + } + } + + $html .= '<div style="position: relative;">'; + $html .= '<img style="position: absolute; z-index: 1; left: ' . + $drawing->getOffsetX() . 'px; top: ' . $drawing->getOffsetY() . 'px; width: ' . + $drawing->getWidth() . 'px; height: ' . $drawing->getHeight() . 'px;" src="' . + $imageData . '" border="0" />'; + $html .= '</div>'; + } + } elseif ($drawing instanceof PHPExcel_Worksheet_MemoryDrawing) { + if ($drawing->getCoordinates() != $coordinates) { + continue; + } + ob_start(); // Let's start output buffering. + imagepng($drawing->getImageResource()); // This will normally output the image, but because of ob_start(), it won't. + $contents = ob_get_contents(); // Instead, output above is saved to $contents + ob_end_clean(); // End the output buffer. + + $dataUri = "data:image/jpeg;base64," . base64_encode($contents); + + // Because of the nature of tables, width is more important than height. + // max-width: 100% ensures that image doesnt overflow containing cell + // width: X sets width of supplied image. + // As a result, images bigger than cell will be contained and images smaller will not get stretched + $html .= '<img src="'.$dataUri.'" style="max-width:100%;width:'.$drawing->getWidth().'px;" />'; + } + } + + return $html; + } + + /** + * Generate chart tag in cell + * + * @param PHPExcel_Worksheet $pSheet PHPExcel_Worksheet + * @param string $coordinates Cell coordinates + * @return string + * @throws PHPExcel_Writer_Exception + */ + private function writeChartInCell(PHPExcel_Worksheet $pSheet, $coordinates) + { + // Construct HTML + $html = ''; + + // Write charts + foreach ($pSheet->getChartCollection() as $chart) { + if ($chart instanceof PHPExcel_Chart) { + $chartCoordinates = $chart->getTopLeftPosition(); + if ($chartCoordinates['cell'] == $coordinates) { + $chartFileName = PHPExcel_Shared_File::sys_get_temp_dir().'/'.uniqid().'.png'; + if (!$chart->render($chartFileName)) { + return; + } + + $html .= PHP_EOL; + $imageDetails = getimagesize($chartFileName); + if ($fp = fopen($chartFileName, "rb", 0)) { + $picture = fread($fp, filesize($chartFileName)); + fclose($fp); + // base64 encode the binary data, then break it + // into chunks according to RFC 2045 semantics + $base64 = chunk_split(base64_encode($picture)); + $imageData = 'data:'.$imageDetails['mime'].';base64,' . $base64; + + $html .= '<div style="position: relative;">'; + $html .= '<img style="position: absolute; z-index: 1; left: ' . $chartCoordinates['xOffset'] . 'px; top: ' . $chartCoordinates['yOffset'] . 'px; width: ' . $imageDetails[0] . 'px; height: ' . $imageDetails[1] . 'px;" src="' . $imageData . '" border="0" />' . PHP_EOL; + $html .= '</div>'; + + unlink($chartFileName); + } + } + } + } + + // Return + return $html; + } + + /** + * Generate CSS styles + * + * @param boolean $generateSurroundingHTML Generate surrounding HTML tags? (&lt;style&gt; and &lt;/style&gt;) + * @return string + * @throws PHPExcel_Writer_Exception + */ + public function generateStyles($generateSurroundingHTML = true) + { + // PHPExcel object known? + if (is_null($this->phpExcel)) { + throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.'); + } + + // Build CSS + $css = $this->buildCSS($generateSurroundingHTML); + + // Construct HTML + $html = ''; + + // Start styles + if ($generateSurroundingHTML) { + $html .= ' <style type="text/css">' . PHP_EOL; + $html .= ' html { ' . $this->assembleCSS($css['html']) . ' }' . PHP_EOL; + } + + // Write all other styles + foreach ($css as $styleName => $styleDefinition) { + if ($styleName != 'html') { + $html .= ' ' . $styleName . ' { ' . $this->assembleCSS($styleDefinition) . ' }' . PHP_EOL; + } + } + + // End styles + if ($generateSurroundingHTML) { + $html .= ' </style>' . PHP_EOL; + } + + // Return + return $html; + } + + /** + * Build CSS styles + * + * @param boolean $generateSurroundingHTML Generate surrounding HTML style? (html { }) + * @return array + * @throws PHPExcel_Writer_Exception + */ + public function buildCSS($generateSurroundingHTML = true) + { + // PHPExcel object known? + if (is_null($this->phpExcel)) { + throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.'); + } + + // Cached? + if (!is_null($this->cssStyles)) { + return $this->cssStyles; + } + + // Ensure that spans have been calculated + if (!$this->spansAreCalculated) { + $this->calculateSpans(); + } + + // Construct CSS + $css = array(); + + // Start styles + if ($generateSurroundingHTML) { + // html { } + $css['html']['font-family'] = 'Calibri, Arial, Helvetica, sans-serif'; + $css['html']['font-size'] = '11pt'; + $css['html']['background-color'] = 'white'; + } + + + // table { } + $css['table']['border-collapse'] = 'collapse'; + if (!$this->isPdf) { + $css['table']['page-break-after'] = 'always'; + } + + // .gridlines td { } + $css['.gridlines td']['border'] = '1px dotted black'; + $css['.gridlines th']['border'] = '1px dotted black'; + + // .b {} + $css['.b']['text-align'] = 'center'; // BOOL + + // .e {} + $css['.e']['text-align'] = 'center'; // ERROR + + // .f {} + $css['.f']['text-align'] = 'right'; // FORMULA + + // .inlineStr {} + $css['.inlineStr']['text-align'] = 'left'; // INLINE + + // .n {} + $css['.n']['text-align'] = 'right'; // NUMERIC + + // .s {} + $css['.s']['text-align'] = 'left'; // STRING + + // Calculate cell style hashes + foreach ($this->phpExcel->getCellXfCollection() as $index => $style) { + $css['td.style' . $index] = $this->createCSSStyle($style); + $css['th.style' . $index] = $this->createCSSStyle($style); + } + + // Fetch sheets + $sheets = array(); + if (is_null($this->sheetIndex)) { + $sheets = $this->phpExcel->getAllSheets(); + } else { + $sheets[] = $this->phpExcel->getSheet($this->sheetIndex); + } + + // Build styles per sheet + foreach ($sheets as $sheet) { + // Calculate hash code + $sheetIndex = $sheet->getParent()->getIndex($sheet); + + // Build styles + // Calculate column widths + $sheet->calculateColumnWidths(); + + // col elements, initialize + $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($sheet->getHighestColumn()) - 1; + $column = -1; + while ($column++ < $highestColumnIndex) { + $this->columnWidths[$sheetIndex][$column] = 42; // approximation + $css['table.sheet' . $sheetIndex . ' col.col' . $column]['width'] = '42pt'; + } + + // col elements, loop through columnDimensions and set width + foreach ($sheet->getColumnDimensions() as $columnDimension) { + if (($width = PHPExcel_Shared_Drawing::cellDimensionToPixels($columnDimension->getWidth(), $this->defaultFont)) >= 0) { + $width = PHPExcel_Shared_Drawing::pixelsToPoints($width); + $column = PHPExcel_Cell::columnIndexFromString($columnDimension->getColumnIndex()) - 1; + $this->columnWidths[$sheetIndex][$column] = $width; + $css['table.sheet' . $sheetIndex . ' col.col' . $column]['width'] = $width . 'pt'; + + if ($columnDimension->getVisible() === false) { + $css['table.sheet' . $sheetIndex . ' col.col' . $column]['visibility'] = 'collapse'; + $css['table.sheet' . $sheetIndex . ' col.col' . $column]['*display'] = 'none'; // target IE6+7 + } + } + } + + // Default row height + $rowDimension = $sheet->getDefaultRowDimension(); + + // table.sheetN tr { } + $css['table.sheet' . $sheetIndex . ' tr'] = array(); + + if ($rowDimension->getRowHeight() == -1) { + $pt_height = PHPExcel_Shared_Font::getDefaultRowHeightByFont($this->phpExcel->getDefaultStyle()->getFont()); + } else { + $pt_height = $rowDimension->getRowHeight(); + } + $css['table.sheet' . $sheetIndex . ' tr']['height'] = $pt_height . 'pt'; + if ($rowDimension->getVisible() === false) { + $css['table.sheet' . $sheetIndex . ' tr']['display'] = 'none'; + $css['table.sheet' . $sheetIndex . ' tr']['visibility'] = 'hidden'; + } + + // Calculate row heights + foreach ($sheet->getRowDimensions() as $rowDimension) { + $row = $rowDimension->getRowIndex() - 1; + + // table.sheetN tr.rowYYYYYY { } + $css['table.sheet' . $sheetIndex . ' tr.row' . $row] = array(); + + if ($rowDimension->getRowHeight() == -1) { + $pt_height = PHPExcel_Shared_Font::getDefaultRowHeightByFont($this->phpExcel->getDefaultStyle()->getFont()); + } else { + $pt_height = $rowDimension->getRowHeight(); + } + $css['table.sheet' . $sheetIndex . ' tr.row' . $row]['height'] = $pt_height . 'pt'; + if ($rowDimension->getVisible() === false) { + $css['table.sheet' . $sheetIndex . ' tr.row' . $row]['display'] = 'none'; + $css['table.sheet' . $sheetIndex . ' tr.row' . $row]['visibility'] = 'hidden'; + } + } + } + + // Cache + if (is_null($this->cssStyles)) { + $this->cssStyles = $css; + } + + // Return + return $css; + } + + /** + * Create CSS style + * + * @param PHPExcel_Style $pStyle PHPExcel_Style + * @return array + */ + private function createCSSStyle(PHPExcel_Style $pStyle) + { + // Construct CSS + $css = ''; + + // Create CSS + $css = array_merge( + $this->createCSSStyleAlignment($pStyle->getAlignment()), + $this->createCSSStyleBorders($pStyle->getBorders()), + $this->createCSSStyleFont($pStyle->getFont()), + $this->createCSSStyleFill($pStyle->getFill()) + ); + + // Return + return $css; + } + + /** + * Create CSS style (PHPExcel_Style_Alignment) + * + * @param PHPExcel_Style_Alignment $pStyle PHPExcel_Style_Alignment + * @return array + */ + private function createCSSStyleAlignment(PHPExcel_Style_Alignment $pStyle) + { + // Construct CSS + $css = array(); + + // Create CSS + $css['vertical-align'] = $this->mapVAlign($pStyle->getVertical()); + if ($textAlign = $this->mapHAlign($pStyle->getHorizontal())) { + $css['text-align'] = $textAlign; + if (in_array($textAlign, array('left', 'right'))) { + $css['padding-'.$textAlign] = (string)((int)$pStyle->getIndent() * 9).'px'; + } + } + + return $css; + } + + /** + * Create CSS style (PHPExcel_Style_Font) + * + * @param PHPExcel_Style_Font $pStyle PHPExcel_Style_Font + * @return array + */ + private function createCSSStyleFont(PHPExcel_Style_Font $pStyle) + { + // Construct CSS + $css = array(); + + // Create CSS + if ($pStyle->getBold()) { + $css['font-weight'] = 'bold'; + } + if ($pStyle->getUnderline() != PHPExcel_Style_Font::UNDERLINE_NONE && $pStyle->getStrikethrough()) { + $css['text-decoration'] = 'underline line-through'; + } elseif ($pStyle->getUnderline() != PHPExcel_Style_Font::UNDERLINE_NONE) { + $css['text-decoration'] = 'underline'; + } elseif ($pStyle->getStrikethrough()) { + $css['text-decoration'] = 'line-through'; + } + if ($pStyle->getItalic()) { + $css['font-style'] = 'italic'; + } + + $css['color'] = '#' . $pStyle->getColor()->getRGB(); + $css['font-family'] = '\'' . $pStyle->getName() . '\''; + $css['font-size'] = $pStyle->getSize() . 'pt'; + + return $css; + } + + /** + * Create CSS style (PHPExcel_Style_Borders) + * + * @param PHPExcel_Style_Borders $pStyle PHPExcel_Style_Borders + * @return array + */ + private function createCSSStyleBorders(PHPExcel_Style_Borders $pStyle) + { + // Construct CSS + $css = array(); + + // Create CSS + $css['border-bottom'] = $this->createCSSStyleBorder($pStyle->getBottom()); + $css['border-top'] = $this->createCSSStyleBorder($pStyle->getTop()); + $css['border-left'] = $this->createCSSStyleBorder($pStyle->getLeft()); + $css['border-right'] = $this->createCSSStyleBorder($pStyle->getRight()); + + return $css; + } + + /** + * Create CSS style (PHPExcel_Style_Border) + * + * @param PHPExcel_Style_Border $pStyle PHPExcel_Style_Border + * @return string + */ + private function createCSSStyleBorder(PHPExcel_Style_Border $pStyle) + { + // Create CSS +// $css = $this->mapBorderStyle($pStyle->getBorderStyle()) . ' #' . $pStyle->getColor()->getRGB(); + // Create CSS - add !important to non-none border styles for merged cells + $borderStyle = $this->mapBorderStyle($pStyle->getBorderStyle()); + $css = $borderStyle . ' #' . $pStyle->getColor()->getRGB() . (($borderStyle == 'none') ? '' : ' !important'); + + return $css; + } + + /** + * Create CSS style (PHPExcel_Style_Fill) + * + * @param PHPExcel_Style_Fill $pStyle PHPExcel_Style_Fill + * @return array + */ + private function createCSSStyleFill(PHPExcel_Style_Fill $pStyle) + { + // Construct HTML + $css = array(); + + // Create CSS + $value = $pStyle->getFillType() == PHPExcel_Style_Fill::FILL_NONE ? + 'white' : '#' . $pStyle->getStartColor()->getRGB(); + $css['background-color'] = $value; + + return $css; + } + + /** + * Generate HTML footer + */ + public function generateHTMLFooter() + { + // Construct HTML + $html = ''; + $html .= ' </body>' . PHP_EOL; + $html .= '</html>' . PHP_EOL; + + return $html; + } + + /** + * Generate table header + * + * @param PHPExcel_Worksheet $pSheet The worksheet for the table we are writing + * @return string + * @throws PHPExcel_Writer_Exception + */ + private function generateTableHeader($pSheet) + { + $sheetIndex = $pSheet->getParent()->getIndex($pSheet); + + // Construct HTML + $html = ''; + $html .= $this->setMargins($pSheet); + + if (!$this->useInlineCss) { + $gridlines = $pSheet->getShowGridlines() ? ' gridlines' : ''; + $html .= ' <table border="0" cellpadding="0" cellspacing="0" id="sheet' . $sheetIndex . '" class="sheet' . $sheetIndex . $gridlines . '">' . PHP_EOL; + } else { + $style = isset($this->cssStyles['table']) ? + $this->assembleCSS($this->cssStyles['table']) : ''; + + if ($this->isPdf && $pSheet->getShowGridlines()) { + $html .= ' <table border="1" cellpadding="1" id="sheet' . $sheetIndex . '" cellspacing="1" style="' . $style . '">' . PHP_EOL; + } else { + $html .= ' <table border="0" cellpadding="1" id="sheet' . $sheetIndex . '" cellspacing="0" style="' . $style . '">' . PHP_EOL; + } + } + + // Write <col> elements + $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($pSheet->getHighestColumn()) - 1; + $i = -1; + while ($i++ < $highestColumnIndex) { + if (!$this->isPdf) { + if (!$this->useInlineCss) { + $html .= ' <col class="col' . $i . '">' . PHP_EOL; + } else { + $style = isset($this->cssStyles['table.sheet' . $sheetIndex . ' col.col' . $i]) ? + $this->assembleCSS($this->cssStyles['table.sheet' . $sheetIndex . ' col.col' . $i]) : ''; + $html .= ' <col style="' . $style . '">' . PHP_EOL; + } + } + } + + return $html; + } + + /** + * Generate table footer + * + * @throws PHPExcel_Writer_Exception + */ + private function generateTableFooter() + { + $html = ' </table>' . PHP_EOL; + + return $html; + } + + /** + * Generate row + * + * @param PHPExcel_Worksheet $pSheet PHPExcel_Worksheet + * @param array $pValues Array containing cells in a row + * @param int $pRow Row number (0-based) + * @return string + * @throws PHPExcel_Writer_Exception + */ + private function generateRow(PHPExcel_Worksheet $pSheet, $pValues = null, $pRow = 0, $cellType = 'td') + { + if (is_array($pValues)) { + // Construct HTML + $html = ''; + + // Sheet index + $sheetIndex = $pSheet->getParent()->getIndex($pSheet); + + // DomPDF and breaks + if ($this->isPdf && count($pSheet->getBreaks()) > 0) { + $breaks = $pSheet->getBreaks(); + + // check if a break is needed before this row + if (isset($breaks['A' . $pRow])) { + // close table: </table> + $html .= $this->generateTableFooter(); + + // insert page break + $html .= '<div style="page-break-before:always" />'; + + // open table again: <table> + <col> etc. + $html .= $this->generateTableHeader($pSheet); + } + } + + // Write row start + if (!$this->useInlineCss) { + $html .= ' <tr class="row' . $pRow . '">' . PHP_EOL; + } else { + $style = isset($this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]) + ? $this->assembleCSS($this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]) : ''; + + $html .= ' <tr style="' . $style . '">' . PHP_EOL; + } + + // Write cells + $colNum = 0; + foreach ($pValues as $cellAddress) { + $cell = ($cellAddress > '') ? $pSheet->getCell($cellAddress) : ''; + $coordinate = PHPExcel_Cell::stringFromColumnIndex($colNum) . ($pRow + 1); + if (!$this->useInlineCss) { + $cssClass = ''; + $cssClass = 'column' . $colNum; + } else { + $cssClass = array(); + if ($cellType == 'th') { + if (isset($this->cssStyles['table.sheet' . $sheetIndex . ' th.column' . $colNum])) { + $this->cssStyles['table.sheet' . $sheetIndex . ' th.column' . $colNum]; + } + } else { + if (isset($this->cssStyles['table.sheet' . $sheetIndex . ' td.column' . $colNum])) { + $this->cssStyles['table.sheet' . $sheetIndex . ' td.column' . $colNum]; + } + } + } + $colSpan = 1; + $rowSpan = 1; + + // initialize + $cellData = '&nbsp;'; + + // PHPExcel_Cell + if ($cell instanceof PHPExcel_Cell) { + $cellData = ''; + if (is_null($cell->getParent())) { + $cell->attach($pSheet); + } + // Value + if ($cell->getValue() instanceof PHPExcel_RichText) { + // Loop through rich text elements + $elements = $cell->getValue()->getRichTextElements(); + foreach ($elements as $element) { + // Rich text start? + if ($element instanceof PHPExcel_RichText_Run) { + $cellData .= '<span style="' . $this->assembleCSS($this->createCSSStyleFont($element->getFont())) . '">'; + + if ($element->getFont()->getSuperScript()) { + $cellData .= '<sup>'; + } elseif ($element->getFont()->getSubScript()) { + $cellData .= '<sub>'; + } + } + + // Convert UTF8 data to PCDATA + $cellText = $element->getText(); + $cellData .= htmlspecialchars($cellText); + + if ($element instanceof PHPExcel_RichText_Run) { + if ($element->getFont()->getSuperScript()) { + $cellData .= '</sup>'; + } elseif ($element->getFont()->getSubScript()) { + $cellData .= '</sub>'; + } + + $cellData .= '</span>'; + } + } + } else { + if ($this->preCalculateFormulas) { + $cellData = PHPExcel_Style_NumberFormat::toFormattedString( + $cell->getCalculatedValue(), + $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(), + array($this, 'formatColor') + ); + } else { + $cellData = PHPExcel_Style_NumberFormat::toFormattedString( + $cell->getValue(), + $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(), + array($this, 'formatColor') + ); + } + $cellData = htmlspecialchars($cellData); + if ($pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont()->getSuperScript()) { + $cellData = '<sup>'.$cellData.'</sup>'; + } elseif ($pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont()->getSubScript()) { + $cellData = '<sub>'.$cellData.'</sub>'; + } + } + + // Converts the cell content so that spaces occuring at beginning of each new line are replaced by &nbsp; + // Example: " Hello\n to the world" is converted to "&nbsp;&nbsp;Hello\n&nbsp;to the world" + $cellData = preg_replace("/(?m)(?:^|\\G) /", '&nbsp;', $cellData); + + // convert newline "\n" to '<br>' + $cellData = nl2br($cellData); + + // Extend CSS class? + if (!$this->useInlineCss) { + $cssClass .= ' style' . $cell->getXfIndex(); + $cssClass .= ' ' . $cell->getDataType(); + } else { + if ($cellType == 'th') { + if (isset($this->cssStyles['th.style' . $cell->getXfIndex()])) { + $cssClass = array_merge($cssClass, $this->cssStyles['th.style' . $cell->getXfIndex()]); + } + } else { + if (isset($this->cssStyles['td.style' . $cell->getXfIndex()])) { + $cssClass = array_merge($cssClass, $this->cssStyles['td.style' . $cell->getXfIndex()]); + } + } + + // General horizontal alignment: Actual horizontal alignment depends on dataType + $sharedStyle = $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex()); + if ($sharedStyle->getAlignment()->getHorizontal() == PHPExcel_Style_Alignment::HORIZONTAL_GENERAL + && isset($this->cssStyles['.' . $cell->getDataType()]['text-align'])) { + $cssClass['text-align'] = $this->cssStyles['.' . $cell->getDataType()]['text-align']; + } + } + } + + // Hyperlink? + if ($pSheet->hyperlinkExists($coordinate) && !$pSheet->getHyperlink($coordinate)->isInternal()) { + $cellData = '<a href="' . htmlspecialchars($pSheet->getHyperlink($coordinate)->getUrl()) . '" title="' . htmlspecialchars($pSheet->getHyperlink($coordinate)->getTooltip()) . '">' . $cellData . '</a>'; + } + + // Should the cell be written or is it swallowed by a rowspan or colspan? + $writeCell = !(isset($this->isSpannedCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum]) + && $this->isSpannedCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum]); + + // Colspan and Rowspan + $colspan = 1; + $rowspan = 1; + if (isset($this->isBaseCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum])) { + $spans = $this->isBaseCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum]; + $rowSpan = $spans['rowspan']; + $colSpan = $spans['colspan']; + + // Also apply style from last cell in merge to fix borders - + // relies on !important for non-none border declarations in createCSSStyleBorder + $endCellCoord = PHPExcel_Cell::stringFromColumnIndex($colNum + $colSpan - 1) . ($pRow + $rowSpan); + if (!$this->useInlineCss) { + $cssClass .= ' style' . $pSheet->getCell($endCellCoord)->getXfIndex(); + } + } + + // Write + if ($writeCell) { + // Column start + $html .= ' <' . $cellType; + if (!$this->useInlineCss) { + $html .= ' class="' . $cssClass . '"'; + } else { + //** Necessary redundant code for the sake of PHPExcel_Writer_PDF ** + // We must explicitly write the width of the <td> element because TCPDF + // does not recognize e.g. <col style="width:42pt"> + $width = 0; + $i = $colNum - 1; + $e = $colNum + $colSpan - 1; + while ($i++ < $e) { + if (isset($this->columnWidths[$sheetIndex][$i])) { + $width += $this->columnWidths[$sheetIndex][$i]; + } + } + $cssClass['width'] = $width . 'pt'; + + // We must also explicitly write the height of the <td> element because TCPDF + // does not recognize e.g. <tr style="height:50pt"> + if (isset($this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]['height'])) { + $height = $this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]['height']; + $cssClass['height'] = $height; + } + //** end of redundant code ** + + $html .= ' style="' . $this->assembleCSS($cssClass) . '"'; + } + if ($colSpan > 1) { + $html .= ' colspan="' . $colSpan . '"'; + } + if ($rowSpan > 1) { + $html .= ' rowspan="' . $rowSpan . '"'; + } + $html .= '>'; + + // Image? + $html .= $this->writeImageInCell($pSheet, $coordinate); + + // Chart? + if ($this->includeCharts) { + $html .= $this->writeChartInCell($pSheet, $coordinate); + } + + // Cell data + $html .= $cellData; + + // Column end + $html .= '</'.$cellType.'>' . PHP_EOL; + } + + // Next column + ++$colNum; + } + + // Write row end + $html .= ' </tr>' . PHP_EOL; + + // Return + return $html; + } else { + throw new PHPExcel_Writer_Exception("Invalid parameters passed."); + } + } + + /** + * Takes array where of CSS properties / values and converts to CSS string + * + * @param array + * @return string + */ + private function assembleCSS($pValue = array()) + { + $pairs = array(); + foreach ($pValue as $property => $value) { + $pairs[] = $property . ':' . $value; + } + $string = implode('; ', $pairs); + + return $string; + } + + /** + * Get images root + * + * @return string + */ + public function getImagesRoot() + { + return $this->imagesRoot; + } + + /** + * Set images root + * + * @param string $pValue + * @return PHPExcel_Writer_HTML + */ + public function setImagesRoot($pValue = '.') + { + $this->imagesRoot = $pValue; + return $this; + } + + /** + * Get embed images + * + * @return boolean + */ + public function getEmbedImages() + { + return $this->embedImages; + } + + /** + * Set embed images + * + * @param boolean $pValue + * @return PHPExcel_Writer_HTML + */ + public function setEmbedImages($pValue = '.') + { + $this->embedImages = $pValue; + return $this; + } + + /** + * Get use inline CSS? + * + * @return boolean + */ + public function getUseInlineCss() + { + return $this->useInlineCss; + } + + /** + * Set use inline CSS? + * + * @param boolean $pValue + * @return PHPExcel_Writer_HTML + */ + public function setUseInlineCss($pValue = false) + { + $this->useInlineCss = $pValue; + return $this; + } + + /** + * Add color to formatted string as inline style + * + * @param string $pValue Plain formatted value without color + * @param string $pFormat Format code + * @return string + */ + public function formatColor($pValue, $pFormat) + { + // Color information, e.g. [Red] is always at the beginning + $color = null; // initialize + $matches = array(); + + $color_regex = '/^\\[[a-zA-Z]+\\]/'; + if (preg_match($color_regex, $pFormat, $matches)) { + $color = str_replace('[', '', $matches[0]); + $color = str_replace(']', '', $color); + $color = strtolower($color); + } + + // convert to PCDATA + $value = htmlspecialchars($pValue); + + // color span tag + if ($color !== null) { + $value = '<span style="color:' . $color . '">' . $value . '</span>'; + } + + return $value; + } + + /** + * Calculate information about HTML colspan and rowspan which is not always the same as Excel's + */ + private function calculateSpans() + { + // Identify all cells that should be omitted in HTML due to cell merge. + // In HTML only the upper-left cell should be written and it should have + // appropriate rowspan / colspan attribute + $sheetIndexes = $this->sheetIndex !== null ? + array($this->sheetIndex) : range(0, $this->phpExcel->getSheetCount() - 1); + + foreach ($sheetIndexes as $sheetIndex) { + $sheet = $this->phpExcel->getSheet($sheetIndex); + + $candidateSpannedRow = array(); + + // loop through all Excel merged cells + foreach ($sheet->getMergeCells() as $cells) { + list($cells,) = PHPExcel_Cell::splitRange($cells); + $first = $cells[0]; + $last = $cells[1]; + + list($fc, $fr) = PHPExcel_Cell::coordinateFromString($first); + $fc = PHPExcel_Cell::columnIndexFromString($fc) - 1; + + list($lc, $lr) = PHPExcel_Cell::coordinateFromString($last); + $lc = PHPExcel_Cell::columnIndexFromString($lc) - 1; + + // loop through the individual cells in the individual merge + $r = $fr - 1; + while ($r++ < $lr) { + // also, flag this row as a HTML row that is candidate to be omitted + $candidateSpannedRow[$r] = $r; + + $c = $fc - 1; + while ($c++ < $lc) { + if (!($c == $fc && $r == $fr)) { + // not the upper-left cell (should not be written in HTML) + $this->isSpannedCell[$sheetIndex][$r][$c] = array( + 'baseCell' => array($fr, $fc), + ); + } else { + // upper-left is the base cell that should hold the colspan/rowspan attribute + $this->isBaseCell[$sheetIndex][$r][$c] = array( + 'xlrowspan' => $lr - $fr + 1, // Excel rowspan + 'rowspan' => $lr - $fr + 1, // HTML rowspan, value may change + 'xlcolspan' => $lc - $fc + 1, // Excel colspan + 'colspan' => $lc - $fc + 1, // HTML colspan, value may change + ); + } + } + } + } + + // Identify which rows should be omitted in HTML. These are the rows where all the cells + // participate in a merge and the where base cells are somewhere above. + $countColumns = PHPExcel_Cell::columnIndexFromString($sheet->getHighestColumn()); + foreach ($candidateSpannedRow as $rowIndex) { + if (isset($this->isSpannedCell[$sheetIndex][$rowIndex])) { + if (count($this->isSpannedCell[$sheetIndex][$rowIndex]) == $countColumns) { + $this->isSpannedRow[$sheetIndex][$rowIndex] = $rowIndex; + }; + } + } + + // For each of the omitted rows we found above, the affected rowspans should be subtracted by 1 + if (isset($this->isSpannedRow[$sheetIndex])) { + foreach ($this->isSpannedRow[$sheetIndex] as $rowIndex) { + $adjustedBaseCells = array(); + $c = -1; + $e = $countColumns - 1; + while ($c++ < $e) { + $baseCell = $this->isSpannedCell[$sheetIndex][$rowIndex][$c]['baseCell']; + + if (!in_array($baseCell, $adjustedBaseCells)) { + // subtract rowspan by 1 + --$this->isBaseCell[$sheetIndex][ $baseCell[0] ][ $baseCell[1] ]['rowspan']; + $adjustedBaseCells[] = $baseCell; + } + } + } + } + + // TODO: Same for columns + } + + // We have calculated the spans + $this->spansAreCalculated = true; + } + + private function setMargins(PHPExcel_Worksheet $pSheet) + { + $htmlPage = '@page { '; + $htmlBody = 'body { '; + + $left = PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getLeft()) . 'in; '; + $htmlPage .= 'margin-left: ' . $left; + $htmlBody .= 'margin-left: ' . $left; + $right = PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getRight()) . 'in; '; + $htmlPage .= 'margin-right: ' . $right; + $htmlBody .= 'margin-right: ' . $right; + $top = PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getTop()) . 'in; '; + $htmlPage .= 'margin-top: ' . $top; + $htmlBody .= 'margin-top: ' . $top; + $bottom = PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getBottom()) . 'in; '; + $htmlPage .= 'margin-bottom: ' . $bottom; + $htmlBody .= 'margin-bottom: ' . $bottom; + + $htmlPage .= "}\n"; + $htmlBody .= "}\n"; + + return "<style>\n" . $htmlPage . $htmlBody . "</style>\n"; + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/IWriter.php b/extend/PHPExcel/PHPExcel/Writer/IWriter.php new file mode 100644 index 0000000..c7cfe74 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/IWriter.php @@ -0,0 +1,37 @@ +<?php + +/** + * PHPExcel_Writer_IWriter + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +interface PHPExcel_Writer_IWriter +{ + /** + * Save PHPExcel to file + * + * @param string $pFilename Name of the file to save + * @throws PHPExcel_Writer_Exception + */ + public function save($pFilename = null); +} diff --git a/extend/PHPExcel/PHPExcel/Writer/OpenDocument.php b/extend/PHPExcel/PHPExcel/Writer/OpenDocument.php new file mode 100644 index 0000000..912ba9d --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/OpenDocument.php @@ -0,0 +1,190 @@ +<?php + +/** + * PHPExcel_Writer_OpenDocument + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_OpenDocument + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_OpenDocument extends PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter +{ + /** + * Private writer parts + * + * @var PHPExcel_Writer_OpenDocument_WriterPart[] + */ + private $writerParts = array(); + + /** + * Private PHPExcel + * + * @var PHPExcel + */ + private $spreadSheet; + + /** + * Create a new PHPExcel_Writer_OpenDocument + * + * @param PHPExcel $pPHPExcel + */ + public function __construct(PHPExcel $pPHPExcel = null) + { + $this->setPHPExcel($pPHPExcel); + + $writerPartsArray = array( + 'content' => 'PHPExcel_Writer_OpenDocument_Content', + 'meta' => 'PHPExcel_Writer_OpenDocument_Meta', + 'meta_inf' => 'PHPExcel_Writer_OpenDocument_MetaInf', + 'mimetype' => 'PHPExcel_Writer_OpenDocument_Mimetype', + 'settings' => 'PHPExcel_Writer_OpenDocument_Settings', + 'styles' => 'PHPExcel_Writer_OpenDocument_Styles', + 'thumbnails' => 'PHPExcel_Writer_OpenDocument_Thumbnails' + ); + + foreach ($writerPartsArray as $writer => $class) { + $this->writerParts[$writer] = new $class($this); + } + } + + /** + * Get writer part + * + * @param string $pPartName Writer part name + * @return PHPExcel_Writer_Excel2007_WriterPart + */ + public function getWriterPart($pPartName = '') + { + if ($pPartName != '' && isset($this->writerParts[strtolower($pPartName)])) { + return $this->writerParts[strtolower($pPartName)]; + } else { + return null; + } + } + + /** + * Save PHPExcel to file + * + * @param string $pFilename + * @throws PHPExcel_Writer_Exception + */ + public function save($pFilename = null) + { + if (!$this->spreadSheet) { + throw new PHPExcel_Writer_Exception('PHPExcel object unassigned.'); + } + + // garbage collect + $this->spreadSheet->garbageCollect(); + + // If $pFilename is php://output or php://stdout, make it a temporary file... + $originalFilename = $pFilename; + if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') { + $pFilename = @tempnam(PHPExcel_Shared_File::sys_get_temp_dir(), 'phpxltmp'); + if ($pFilename == '') { + $pFilename = $originalFilename; + } + } + + $objZip = $this->createZip($pFilename); + + $objZip->addFromString('META-INF/manifest.xml', $this->getWriterPart('meta_inf')->writeManifest()); + $objZip->addFromString('Thumbnails/thumbnail.png', $this->getWriterPart('thumbnails')->writeThumbnail()); + $objZip->addFromString('content.xml', $this->getWriterPart('content')->write()); + $objZip->addFromString('meta.xml', $this->getWriterPart('meta')->write()); + $objZip->addFromString('mimetype', $this->getWriterPart('mimetype')->write()); + $objZip->addFromString('settings.xml', $this->getWriterPart('settings')->write()); + $objZip->addFromString('styles.xml', $this->getWriterPart('styles')->write()); + + // Close file + if ($objZip->close() === false) { + throw new PHPExcel_Writer_Exception("Could not close zip file $pFilename."); + } + + // If a temporary file was used, copy it to the correct file stream + if ($originalFilename != $pFilename) { + if (copy($pFilename, $originalFilename) === false) { + throw new PHPExcel_Writer_Exception("Could not copy temporary zip file $pFilename to $originalFilename."); + } + @unlink($pFilename); + } + } + + /** + * Create zip object + * + * @param string $pFilename + * @throws PHPExcel_Writer_Exception + * @return ZipArchive + */ + private function createZip($pFilename) + { + // Create new ZIP file and open it for writing + $zipClass = PHPExcel_Settings::getZipClass(); + $objZip = new $zipClass(); + + // Retrieve OVERWRITE and CREATE constants from the instantiated zip class + // This method of accessing constant values from a dynamic class should work with all appropriate versions of PHP + $ro = new ReflectionObject($objZip); + $zipOverWrite = $ro->getConstant('OVERWRITE'); + $zipCreate = $ro->getConstant('CREATE'); + + if (file_exists($pFilename)) { + unlink($pFilename); + } + // Try opening the ZIP file + if ($objZip->open($pFilename, $zipOverWrite) !== true) { + if ($objZip->open($pFilename, $zipCreate) !== true) { + throw new PHPExcel_Writer_Exception("Could not open $pFilename for writing."); + } + } + + return $objZip; + } + + /** + * Get PHPExcel object + * + * @return PHPExcel + * @throws PHPExcel_Writer_Exception + */ + public function getPHPExcel() + { + if ($this->spreadSheet !== null) { + return $this->spreadSheet; + } else { + throw new PHPExcel_Writer_Exception('No PHPExcel assigned.'); + } + } + + /** + * Set PHPExcel object + * + * @param PHPExcel $pPHPExcel PHPExcel object + * @throws PHPExcel_Writer_Exception + * @return PHPExcel_Writer_Excel2007 + */ + public function setPHPExcel(PHPExcel $pPHPExcel = null) + { + $this->spreadSheet = $pPHPExcel; + return $this; + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Cell/Comment.php b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Cell/Comment.php new file mode 100644 index 0000000..f1e98a1 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Cell/Comment.php @@ -0,0 +1,63 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_OpenDocument + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_Writer_OpenDocument_Cell_Comment + * + * @category PHPExcel + * @package PHPExcel_Writer_OpenDocument + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @author Alexander Pervakov <frost-nzcr4@jagmort.com> + */ +class PHPExcel_Writer_OpenDocument_Cell_Comment +{ + public static function write(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Cell $cell) + { + $comments = $cell->getWorksheet()->getComments(); + if (!isset($comments[$cell->getCoordinate()])) { + return; + } + $comment = $comments[$cell->getCoordinate()]; + + $objWriter->startElement('office:annotation'); + //$objWriter->writeAttribute('draw:style-name', 'gr1'); + //$objWriter->writeAttribute('draw:text-style-name', 'P1'); + $objWriter->writeAttribute('svg:width', $comment->getWidth()); + $objWriter->writeAttribute('svg:height', $comment->getHeight()); + $objWriter->writeAttribute('svg:x', $comment->getMarginLeft()); + $objWriter->writeAttribute('svg:y', $comment->getMarginTop()); + //$objWriter->writeAttribute('draw:caption-point-x', $comment->getMarginLeft()); + //$objWriter->writeAttribute('draw:caption-point-y', $comment->getMarginTop()); + $objWriter->writeElement('dc:creator', $comment->getAuthor()); + // TODO: Not realized in PHPExcel_Comment yet. + //$objWriter->writeElement('dc:date', $comment->getDate()); + $objWriter->writeElement('text:p', $comment->getText()->getPlainText()); + //$objWriter->writeAttribute('draw:text-style-name', 'P1'); + $objWriter->endElement(); + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Content.php b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Content.php new file mode 100644 index 0000000..a34b167 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Content.php @@ -0,0 +1,272 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_OpenDocument + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_Writer_OpenDocument_Content + * + * @category PHPExcel + * @package PHPExcel_Writer_OpenDocument + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @author Alexander Pervakov <frost-nzcr4@jagmort.com> + */ +class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_WriterPart +{ + const NUMBER_COLS_REPEATED_MAX = 1024; + const NUMBER_ROWS_REPEATED_MAX = 1048576; + + /** + * Write content.xml to XML format + * + * @param PHPExcel $pPHPExcel + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function write(PHPExcel $pPHPExcel = null) + { + if (!$pPHPExcel) { + $pPHPExcel = $this->getParentWriter()->getPHPExcel(); /* @var $pPHPExcel PHPExcel */ + } + + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8'); + + // Content + $objWriter->startElement('office:document-content'); + $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0'); + $objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0'); + $objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0'); + $objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0'); + $objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0'); + $objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0'); + $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink'); + $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/'); + $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0'); + $objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0'); + $objWriter->writeAttribute('xmlns:presentation', 'urn:oasis:names:tc:opendocument:xmlns:presentation:1.0'); + $objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0'); + $objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0'); + $objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0'); + $objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML'); + $objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0'); + $objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0'); + $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office'); + $objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer'); + $objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc'); + $objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events'); + $objWriter->writeAttribute('xmlns:xforms', 'http://www.w3.org/2002/xforms'); + $objWriter->writeAttribute('xmlns:xsd', 'http://www.w3.org/2001/XMLSchema'); + $objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); + $objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report'); + $objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2'); + $objWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml'); + $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#'); + $objWriter->writeAttribute('xmlns:tableooo', 'http://openoffice.org/2009/table'); + $objWriter->writeAttribute('xmlns:field', 'urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0'); + $objWriter->writeAttribute('xmlns:formx', 'urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0'); + $objWriter->writeAttribute('xmlns:css3t', 'http://www.w3.org/TR/css3-text/'); + $objWriter->writeAttribute('office:version', '1.2'); + + $objWriter->writeElement('office:scripts'); + $objWriter->writeElement('office:font-face-decls'); + $objWriter->writeElement('office:automatic-styles'); + + $objWriter->startElement('office:body'); + $objWriter->startElement('office:spreadsheet'); + $objWriter->writeElement('table:calculation-settings'); + $this->writeSheets($objWriter); + $objWriter->writeElement('table:named-expressions'); + $objWriter->endElement(); + $objWriter->endElement(); + $objWriter->endElement(); + + return $objWriter->getData(); + } + + /** + * Write sheets + * + * @param PHPExcel_Shared_XMLWriter $objWriter + */ + private function writeSheets(PHPExcel_Shared_XMLWriter $objWriter) + { + $pPHPExcel = $this->getParentWriter()->getPHPExcel(); /* @var $pPHPExcel PHPExcel */ + + $sheet_count = $pPHPExcel->getSheetCount(); + for ($i = 0; $i < $sheet_count; $i++) { + //$this->getWriterPart('Worksheet')->writeWorksheet()); + $objWriter->startElement('table:table'); + $objWriter->writeAttribute('table:name', $pPHPExcel->getSheet($i)->getTitle()); + $objWriter->writeElement('office:forms'); + $objWriter->startElement('table:table-column'); + $objWriter->writeAttribute('table:number-columns-repeated', self::NUMBER_COLS_REPEATED_MAX); + $objWriter->endElement(); + $this->writeRows($objWriter, $pPHPExcel->getSheet($i)); + $objWriter->endElement(); + } + } + + /** + * Write rows of the specified sheet + * + * @param PHPExcel_Shared_XMLWriter $objWriter + * @param PHPExcel_Worksheet $sheet + */ + private function writeRows(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Worksheet $sheet) + { + $number_rows_repeated = self::NUMBER_ROWS_REPEATED_MAX; + $span_row = 0; + $rows = $sheet->getRowIterator(); + while ($rows->valid()) { + $number_rows_repeated--; + $row = $rows->current(); + if ($row->getCellIterator()->valid()) { + if ($span_row) { + $objWriter->startElement('table:table-row'); + if ($span_row > 1) { + $objWriter->writeAttribute('table:number-rows-repeated', $span_row); + } + $objWriter->startElement('table:table-cell'); + $objWriter->writeAttribute('table:number-columns-repeated', self::NUMBER_COLS_REPEATED_MAX); + $objWriter->endElement(); + $objWriter->endElement(); + $span_row = 0; + } + $objWriter->startElement('table:table-row'); + $this->writeCells($objWriter, $row); + $objWriter->endElement(); + } else { + $span_row++; + } + $rows->next(); + } + } + + /** + * Write cells of the specified row + * + * @param PHPExcel_Shared_XMLWriter $objWriter + * @param PHPExcel_Worksheet_Row $row + * @throws PHPExcel_Writer_Exception + */ + private function writeCells(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Worksheet_Row $row) + { + $number_cols_repeated = self::NUMBER_COLS_REPEATED_MAX; + $prev_column = -1; + $cells = $row->getCellIterator(); + while ($cells->valid()) { + $cell = $cells->current(); + $column = PHPExcel_Cell::columnIndexFromString($cell->getColumn()) - 1; + + $this->writeCellSpan($objWriter, $column, $prev_column); + $objWriter->startElement('table:table-cell'); + + switch ($cell->getDataType()) { + case PHPExcel_Cell_DataType::TYPE_BOOL: + $objWriter->writeAttribute('office:value-type', 'boolean'); + $objWriter->writeAttribute('office:value', $cell->getValue()); + $objWriter->writeElement('text:p', $cell->getValue()); + break; + + case PHPExcel_Cell_DataType::TYPE_ERROR: + throw new PHPExcel_Writer_Exception('Writing of error not implemented yet.'); + break; + + case PHPExcel_Cell_DataType::TYPE_FORMULA: + try { + $formula_value = $cell->getCalculatedValue(); + } catch (Exception $e) { + $formula_value = $cell->getValue(); + } + $objWriter->writeAttribute('table:formula', 'of:' . $cell->getValue()); + if (is_numeric($formula_value)) { + $objWriter->writeAttribute('office:value-type', 'float'); + } else { + $objWriter->writeAttribute('office:value-type', 'string'); + } + $objWriter->writeAttribute('office:value', $formula_value); + $objWriter->writeElement('text:p', $formula_value); + break; + + case PHPExcel_Cell_DataType::TYPE_INLINE: + throw new PHPExcel_Writer_Exception('Writing of inline not implemented yet.'); + break; + + case PHPExcel_Cell_DataType::TYPE_NUMERIC: + $objWriter->writeAttribute('office:value-type', 'float'); + $objWriter->writeAttribute('office:value', $cell->getValue()); + $objWriter->writeElement('text:p', $cell->getValue()); + break; + + case PHPExcel_Cell_DataType::TYPE_STRING: + $objWriter->writeAttribute('office:value-type', 'string'); + $objWriter->writeElement('text:p', $cell->getValue()); + break; + } + PHPExcel_Writer_OpenDocument_Cell_Comment::write($objWriter, $cell); + $objWriter->endElement(); + $prev_column = $column; + $cells->next(); + } + $number_cols_repeated = $number_cols_repeated - $prev_column - 1; + if ($number_cols_repeated > 0) { + if ($number_cols_repeated > 1) { + $objWriter->startElement('table:table-cell'); + $objWriter->writeAttribute('table:number-columns-repeated', $number_cols_repeated); + $objWriter->endElement(); + } else { + $objWriter->writeElement('table:table-cell'); + } + } + } + + /** + * Write span + * + * @param PHPExcel_Shared_XMLWriter $objWriter + * @param integer $curColumn + * @param integer $prevColumn + */ + private function writeCellSpan(PHPExcel_Shared_XMLWriter $objWriter, $curColumn, $prevColumn) + { + $diff = $curColumn - $prevColumn - 1; + if (1 === $diff) { + $objWriter->writeElement('table:table-cell'); + } elseif ($diff > 1) { + $objWriter->startElement('table:table-cell'); + $objWriter->writeAttribute('table:number-columns-repeated', $diff); + $objWriter->endElement(); + } + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Meta.php b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Meta.php new file mode 100644 index 0000000..1a5c5fd --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Meta.php @@ -0,0 +1,95 @@ +<?php + +/** + * PHPExcel_Writer_OpenDocument_Meta + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_OpenDocument + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_OpenDocument_Meta extends PHPExcel_Writer_OpenDocument_WriterPart +{ + /** + * Write meta.xml to XML format + * + * @param PHPExcel $pPHPExcel + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function write(PHPExcel $pPHPExcel = null) + { + if (!$pPHPExcel) { + $pPHPExcel = $this->getParentWriter()->getPHPExcel(); + } + + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8'); + + // Meta + $objWriter->startElement('office:document-meta'); + + $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0'); + $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink'); + $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/'); + $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0'); + $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office'); + $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#'); + $objWriter->writeAttribute('office:version', '1.2'); + + $objWriter->startElement('office:meta'); + + $objWriter->writeElement('meta:initial-creator', $pPHPExcel->getProperties()->getCreator()); + $objWriter->writeElement('dc:creator', $pPHPExcel->getProperties()->getCreator()); + $objWriter->writeElement('meta:creation-date', date(DATE_W3C, $pPHPExcel->getProperties()->getCreated())); + $objWriter->writeElement('dc:date', date(DATE_W3C, $pPHPExcel->getProperties()->getCreated())); + $objWriter->writeElement('dc:title', $pPHPExcel->getProperties()->getTitle()); + $objWriter->writeElement('dc:description', $pPHPExcel->getProperties()->getDescription()); + $objWriter->writeElement('dc:subject', $pPHPExcel->getProperties()->getSubject()); + $keywords = explode(' ', $pPHPExcel->getProperties()->getKeywords()); + foreach ($keywords as $keyword) { + $objWriter->writeElement('meta:keyword', $keyword); + } + + //<meta:document-statistic meta:table-count="XXX" meta:cell-count="XXX" meta:object-count="XXX"/> + $objWriter->startElement('meta:user-defined'); + $objWriter->writeAttribute('meta:name', 'Company'); + $objWriter->writeRaw($pPHPExcel->getProperties()->getCompany()); + $objWriter->endElement(); + + $objWriter->startElement('meta:user-defined'); + $objWriter->writeAttribute('meta:name', 'category'); + $objWriter->writeRaw($pPHPExcel->getProperties()->getCategory()); + $objWriter->endElement(); + + $objWriter->endElement(); + + $objWriter->endElement(); + + return $objWriter->getData(); + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/OpenDocument/MetaInf.php b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/MetaInf.php new file mode 100644 index 0000000..c43b723 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/MetaInf.php @@ -0,0 +1,87 @@ +<?php + +/** + * PHPExcel_Writer_OpenDocument_MetaInf + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_OpenDocument + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_OpenDocument_MetaInf extends PHPExcel_Writer_OpenDocument_WriterPart +{ + /** + * Write META-INF/manifest.xml to XML format + * + * @param PHPExcel $pPHPExcel + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeManifest(PHPExcel $pPHPExcel = null) + { + if (!$pPHPExcel) { + $pPHPExcel = $this->getParentWriter()->getPHPExcel(); + } + + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8'); + + // Manifest + $objWriter->startElement('manifest:manifest'); + $objWriter->writeAttribute('xmlns:manifest', 'urn:oasis:names:tc:opendocument:xmlns:manifest:1.0'); + $objWriter->writeAttribute('manifest:version', '1.2'); + + $objWriter->startElement('manifest:file-entry'); + $objWriter->writeAttribute('manifest:full-path', '/'); + $objWriter->writeAttribute('manifest:version', '1.2'); + $objWriter->writeAttribute('manifest:media-type', 'application/vnd.oasis.opendocument.spreadsheet'); + $objWriter->endElement(); + $objWriter->startElement('manifest:file-entry'); + $objWriter->writeAttribute('manifest:full-path', 'meta.xml'); + $objWriter->writeAttribute('manifest:media-type', 'text/xml'); + $objWriter->endElement(); + $objWriter->startElement('manifest:file-entry'); + $objWriter->writeAttribute('manifest:full-path', 'settings.xml'); + $objWriter->writeAttribute('manifest:media-type', 'text/xml'); + $objWriter->endElement(); + $objWriter->startElement('manifest:file-entry'); + $objWriter->writeAttribute('manifest:full-path', 'content.xml'); + $objWriter->writeAttribute('manifest:media-type', 'text/xml'); + $objWriter->endElement(); + $objWriter->startElement('manifest:file-entry'); + $objWriter->writeAttribute('manifest:full-path', 'Thumbnails/thumbnail.png'); + $objWriter->writeAttribute('manifest:media-type', 'image/png'); + $objWriter->endElement(); + $objWriter->startElement('manifest:file-entry'); + $objWriter->writeAttribute('manifest:full-path', 'styles.xml'); + $objWriter->writeAttribute('manifest:media-type', 'text/xml'); + $objWriter->endElement(); + $objWriter->endElement(); + + return $objWriter->getData(); + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Mimetype.php b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Mimetype.php new file mode 100644 index 0000000..d51a8b9 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Mimetype.php @@ -0,0 +1,41 @@ +<?php + +/** + * PHPExcel + * + * PHPExcel_Writer_OpenDocument_Mimetype + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_OpenDocument + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_OpenDocument_Mimetype extends PHPExcel_Writer_OpenDocument_WriterPart +{ + /** + * Write mimetype to plain text format + * + * @param PHPExcel $pPHPExcel + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function write(PHPExcel $pPHPExcel = null) + { + return 'application/vnd.oasis.opendocument.spreadsheet'; + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Settings.php b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Settings.php new file mode 100644 index 0000000..84161b6 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Settings.php @@ -0,0 +1,76 @@ +<?php + +/** + * PHPExcel_Writer_OpenDocument_Settings + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_OpenDocument + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_OpenDocument_Settings extends PHPExcel_Writer_OpenDocument_WriterPart +{ + /** + * Write settings.xml to XML format + * + * @param PHPExcel $pPHPExcel + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function write(PHPExcel $pPHPExcel = null) + { + if (!$pPHPExcel) { + $pPHPExcel = $this->getParentWriter()->getPHPExcel(); + } + + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8'); + + // Settings + $objWriter->startElement('office:document-settings'); + $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0'); + $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink'); + $objWriter->writeAttribute('xmlns:config', 'urn:oasis:names:tc:opendocument:xmlns:config:1.0'); + $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office'); + $objWriter->writeAttribute('office:version', '1.2'); + + $objWriter->startElement('office:settings'); + $objWriter->startElement('config:config-item-set'); + $objWriter->writeAttribute('config:name', 'ooo:view-settings'); + $objWriter->startElement('config:config-item-map-indexed'); + $objWriter->writeAttribute('config:name', 'Views'); + $objWriter->endElement(); + $objWriter->endElement(); + $objWriter->startElement('config:config-item-set'); + $objWriter->writeAttribute('config:name', 'ooo:configuration-settings'); + $objWriter->endElement(); + $objWriter->endElement(); + $objWriter->endElement(); + + return $objWriter->getData(); + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Styles.php b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Styles.php new file mode 100644 index 0000000..cc6e25b --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Styles.php @@ -0,0 +1,92 @@ +<?php + +/** + * PHPExcel_Writer_OpenDocument_Styles + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_OpenDocument + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_OpenDocument_Styles extends PHPExcel_Writer_OpenDocument_WriterPart +{ + /** + * Write styles.xml to XML format + * + * @param PHPExcel $pPHPExcel + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function write(PHPExcel $pPHPExcel = null) + { + if (!$pPHPExcel) { + $pPHPExcel = $this->getParentWriter()->getPHPExcel(); + } + + $objWriter = null; + if ($this->getParentWriter()->getUseDiskCaching()) { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + } else { + $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + } + + // XML header + $objWriter->startDocument('1.0', 'UTF-8'); + + // Content + $objWriter->startElement('office:document-styles'); + $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0'); + $objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0'); + $objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0'); + $objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0'); + $objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0'); + $objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0'); + $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink'); + $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/'); + $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0'); + $objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0'); + $objWriter->writeAttribute('xmlns:presentation', 'urn:oasis:names:tc:opendocument:xmlns:presentation:1.0'); + $objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0'); + $objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0'); + $objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0'); + $objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML'); + $objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0'); + $objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0'); + $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office'); + $objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer'); + $objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc'); + $objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events'); + $objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report'); + $objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2'); + $objWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml'); + $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#'); + $objWriter->writeAttribute('xmlns:tableooo', 'http://openoffice.org/2009/table'); + $objWriter->writeAttribute('xmlns:css3t', 'http://www.w3.org/TR/css3-text/'); + $objWriter->writeAttribute('office:version', '1.2'); + + $objWriter->writeElement('office:font-face-decls'); + $objWriter->writeElement('office:styles'); + $objWriter->writeElement('office:automatic-styles'); + $objWriter->writeElement('office:master-styles'); + $objWriter->endElement(); + + return $objWriter->getData(); + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Thumbnails.php b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Thumbnails.php new file mode 100644 index 0000000..54247ae --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/Thumbnails.php @@ -0,0 +1,41 @@ +<?php + +/** + * PHPExcel_Writer_OpenDocument_Thumbnails + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_OpenDocument + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_OpenDocument_Thumbnails extends PHPExcel_Writer_OpenDocument_WriterPart +{ + /** + * Write Thumbnails/thumbnail.png to PNG format + * + * @param PHPExcel $pPHPExcel + * @return string XML Output + * @throws PHPExcel_Writer_Exception + */ + public function writeThumbnail(PHPExcel $pPHPExcel = null) + { + return ''; + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/OpenDocument/WriterPart.php b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/WriterPart.php new file mode 100644 index 0000000..562787a --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/OpenDocument/WriterPart.php @@ -0,0 +1,30 @@ +<?php + +/** + * PHPExcel_Writer_OpenDocument_WriterPart + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_OpenDocument + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +abstract class PHPExcel_Writer_OpenDocument_WriterPart extends PHPExcel_Writer_Excel2007_WriterPart +{ +} diff --git a/extend/PHPExcel/PHPExcel/Writer/PDF.php b/extend/PHPExcel/PHPExcel/Writer/PDF.php new file mode 100644 index 0000000..579edfa --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/PDF.php @@ -0,0 +1,89 @@ +<?php + +/** + * PHPExcel_Writer_PDF + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_PDF + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_PDF implements PHPExcel_Writer_IWriter +{ + + /** + * The wrapper for the requested PDF rendering engine + * + * @var PHPExcel_Writer_PDF_Core + */ + private $renderer = null; + + /** + * Instantiate a new renderer of the configured type within this container class + * + * @param PHPExcel $phpExcel PHPExcel object + * @throws PHPExcel_Writer_Exception when PDF library is not configured + */ + public function __construct(PHPExcel $phpExcel) + { + $pdfLibraryName = PHPExcel_Settings::getPdfRendererName(); + if (is_null($pdfLibraryName)) { + throw new PHPExcel_Writer_Exception("PDF Rendering library has not been defined."); + } + + $pdfLibraryPath = PHPExcel_Settings::getPdfRendererPath(); + if (is_null($pdfLibraryName)) { + throw new PHPExcel_Writer_Exception("PDF Rendering library path has not been defined."); + } + $includePath = str_replace('\\', '/', get_include_path()); + $rendererPath = str_replace('\\', '/', $pdfLibraryPath); + if (strpos($rendererPath, $includePath) === false) { + set_include_path(get_include_path() . PATH_SEPARATOR . $pdfLibraryPath); + } + + $rendererName = 'PHPExcel_Writer_PDF_' . $pdfLibraryName; + $this->renderer = new $rendererName($phpExcel); + } + + + /** + * Magic method to handle direct calls to the configured PDF renderer wrapper class. + * + * @param string $name Renderer library method name + * @param mixed[] $arguments Array of arguments to pass to the renderer method + * @return mixed Returned data from the PDF renderer wrapper method + */ + public function __call($name, $arguments) + { + if ($this->renderer === null) { + throw new PHPExcel_Writer_Exception("PDF Rendering library has not been defined."); + } + + return call_user_func_array(array($this->renderer, $name), $arguments); + } + + /** + * {@inheritdoc} + */ + public function save($pFilename = null) + { + $this->renderer->save($pFilename); + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/PDF/Core.php b/extend/PHPExcel/PHPExcel/Writer/PDF/Core.php new file mode 100644 index 0000000..4fed84a --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/PDF/Core.php @@ -0,0 +1,355 @@ +<?php + +/** + * PHPExcel_Writer_PDF_Core + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_PDF + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML +{ + /** + * Temporary storage directory + * + * @var string + */ + protected $tempDir = ''; + + /** + * Font + * + * @var string + */ + protected $font = 'freesans'; + + /** + * Orientation (Over-ride) + * + * @var string + */ + protected $orientation; + + /** + * Paper size (Over-ride) + * + * @var int + */ + protected $paperSize; + + + /** + * Temporary storage for Save Array Return type + * + * @var string + */ + private $saveArrayReturnType; + + /** + * Paper Sizes xRef List + * + * @var array + */ + protected static $paperSizes = array( + PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER + => 'LETTER', // (8.5 in. by 11 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_SMALL + => 'LETTER', // (8.5 in. by 11 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_TABLOID + => array(792.00, 1224.00), // (11 in. by 17 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_LEDGER + => array(1224.00, 792.00), // (17 in. by 11 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_LEGAL + => 'LEGAL', // (8.5 in. by 14 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_STATEMENT + => array(396.00, 612.00), // (5.5 in. by 8.5 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_EXECUTIVE + => 'EXECUTIVE', // (7.25 in. by 10.5 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3 + => 'A3', // (297 mm by 420 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4 + => 'A4', // (210 mm by 297 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_SMALL + => 'A4', // (210 mm by 297 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5 + => 'A5', // (148 mm by 210 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_B4 + => 'B4', // (250 mm by 353 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_B5 + => 'B5', // (176 mm by 250 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_FOLIO + => 'FOLIO', // (8.5 in. by 13 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_QUARTO + => array(609.45, 779.53), // (215 mm by 275 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_1 + => array(720.00, 1008.00), // (10 in. by 14 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_2 + => array(792.00, 1224.00), // (11 in. by 17 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_NOTE + => 'LETTER', // (8.5 in. by 11 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO9_ENVELOPE + => array(279.00, 639.00), // (3.875 in. by 8.875 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO10_ENVELOPE + => array(297.00, 684.00), // (4.125 in. by 9.5 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO11_ENVELOPE + => array(324.00, 747.00), // (4.5 in. by 10.375 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO12_ENVELOPE + => array(342.00, 792.00), // (4.75 in. by 11 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO14_ENVELOPE + => array(360.00, 828.00), // (5 in. by 11.5 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_C + => array(1224.00, 1584.00), // (17 in. by 22 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_D + => array(1584.00, 2448.00), // (22 in. by 34 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_E + => array(2448.00, 3168.00), // (34 in. by 44 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_DL_ENVELOPE + => array(311.81, 623.62), // (110 mm by 220 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_C5_ENVELOPE + => 'C5', // (162 mm by 229 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_C3_ENVELOPE + => 'C3', // (324 mm by 458 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_C4_ENVELOPE + => 'C4', // (229 mm by 324 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_C6_ENVELOPE + => 'C6', // (114 mm by 162 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_C65_ENVELOPE + => array(323.15, 649.13), // (114 mm by 229 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_B4_ENVELOPE + => 'B4', // (250 mm by 353 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_B5_ENVELOPE + => 'B5', // (176 mm by 250 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_B6_ENVELOPE + => array(498.90, 354.33), // (176 mm by 125 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_ITALY_ENVELOPE + => array(311.81, 651.97), // (110 mm by 230 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_MONARCH_ENVELOPE + => array(279.00, 540.00), // (3.875 in. by 7.5 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_6_3_4_ENVELOPE + => array(261.00, 468.00), // (3.625 in. by 6.5 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_US_STANDARD_FANFOLD + => array(1071.00, 792.00), // (14.875 in. by 11 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_GERMAN_STANDARD_FANFOLD + => array(612.00, 864.00), // (8.5 in. by 12 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_GERMAN_LEGAL_FANFOLD + => 'FOLIO', // (8.5 in. by 13 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_ISO_B4 + => 'B4', // (250 mm by 353 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_JAPANESE_DOUBLE_POSTCARD + => array(566.93, 419.53), // (200 mm by 148 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_PAPER_1 + => array(648.00, 792.00), // (9 in. by 11 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_PAPER_2 + => array(720.00, 792.00), // (10 in. by 11 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_PAPER_3 + => array(1080.00, 792.00), // (15 in. by 11 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_INVITE_ENVELOPE + => array(623.62, 623.62), // (220 mm by 220 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_EXTRA_PAPER + => array(667.80, 864.00), // (9.275 in. by 12 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_LEGAL_EXTRA_PAPER + => array(667.80, 1080.00), // (9.275 in. by 15 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_TABLOID_EXTRA_PAPER + => array(841.68, 1296.00), // (11.69 in. by 18 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_EXTRA_PAPER + => array(668.98, 912.76), // (236 mm by 322 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_TRANSVERSE_PAPER + => array(595.80, 792.00), // (8.275 in. by 11 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_TRANSVERSE_PAPER + => 'A4', // (210 mm by 297 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER + => array(667.80, 864.00), // (9.275 in. by 12 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_SUPERA_SUPERA_A4_PAPER + => array(643.46, 1009.13), // (227 mm by 356 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_SUPERB_SUPERB_A3_PAPER + => array(864.57, 1380.47), // (305 mm by 487 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_PLUS_PAPER + => array(612.00, 913.68), // (8.5 in. by 12.69 in.) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_PLUS_PAPER + => array(595.28, 935.43), // (210 mm by 330 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5_TRANSVERSE_PAPER + => 'A5', // (148 mm by 210 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_JIS_B5_TRANSVERSE_PAPER + => array(515.91, 728.50), // (182 mm by 257 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3_EXTRA_PAPER + => array(912.76, 1261.42), // (322 mm by 445 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5_EXTRA_PAPER + => array(493.23, 666.14), // (174 mm by 235 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_ISO_B5_EXTRA_PAPER + => array(569.76, 782.36), // (201 mm by 276 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_A2_PAPER + => 'A2', // (420 mm by 594 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3_TRANSVERSE_PAPER + => 'A3', // (297 mm by 420 mm) + PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER + => array(912.76, 1261.42) // (322 mm by 445 mm) + ); + + /** + * Create a new PHPExcel_Writer_PDF + * + * @param PHPExcel $phpExcel PHPExcel object + */ + public function __construct(PHPExcel $phpExcel) + { + parent::__construct($phpExcel); + $this->setUseInlineCss(true); + $this->tempDir = PHPExcel_Shared_File::sys_get_temp_dir(); + } + + /** + * Get Font + * + * @return string + */ + public function getFont() + { + return $this->font; + } + + /** + * Set font. Examples: + * 'arialunicid0-chinese-simplified' + * 'arialunicid0-chinese-traditional' + * 'arialunicid0-korean' + * 'arialunicid0-japanese' + * + * @param string $fontName + */ + public function setFont($fontName) + { + $this->font = $fontName; + return $this; + } + + /** + * Get Paper Size + * + * @return int + */ + public function getPaperSize() + { + return $this->paperSize; + } + + /** + * Set Paper Size + * + * @param string $pValue Paper size + * @return PHPExcel_Writer_PDF + */ + public function setPaperSize($pValue = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER) + { + $this->paperSize = $pValue; + return $this; + } + + /** + * Get Orientation + * + * @return string + */ + public function getOrientation() + { + return $this->orientation; + } + + /** + * Set Orientation + * + * @param string $pValue Page orientation + * @return PHPExcel_Writer_PDF + */ + public function setOrientation($pValue = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT) + { + $this->orientation = $pValue; + return $this; + } + + /** + * Get temporary storage directory + * + * @return string + */ + public function getTempDir() + { + return $this->tempDir; + } + + /** + * Set temporary storage directory + * + * @param string $pValue Temporary storage directory + * @throws PHPExcel_Writer_Exception when directory does not exist + * @return PHPExcel_Writer_PDF + */ + public function setTempDir($pValue = '') + { + if (is_dir($pValue)) { + $this->tempDir = $pValue; + } else { + throw new PHPExcel_Writer_Exception("Directory does not exist: $pValue"); + } + return $this; + } + + /** + * Save PHPExcel to PDF file, pre-save + * + * @param string $pFilename Name of the file to save as + * @throws PHPExcel_Writer_Exception + */ + protected function prepareForSave($pFilename = null) + { + // garbage collect + $this->phpExcel->garbageCollect(); + + $this->saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType(); + PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE); + + // Open file + $fileHandle = fopen($pFilename, 'w'); + if ($fileHandle === false) { + throw new PHPExcel_Writer_Exception("Could not open file $pFilename for writing."); + } + + // Set PDF + $this->isPdf = true; + // Build CSS + $this->buildCSS(true); + + return $fileHandle; + } + + /** + * Save PHPExcel to PDF file, post-save + * + * @param resource $fileHandle + * @throws PHPExcel_Writer_Exception + */ + protected function restoreStateAfterSave($fileHandle) + { + // Close file + fclose($fileHandle); + + PHPExcel_Calculation::setArrayReturnType($this->saveArrayReturnType); + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/PDF/DomPDF.php b/extend/PHPExcel/PHPExcel/Writer/PDF/DomPDF.php new file mode 100644 index 0000000..83761ac --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/PDF/DomPDF.php @@ -0,0 +1,108 @@ +<?php + +/** Require DomPDF library */ +$pdfRendererClassFile = PHPExcel_Settings::getPdfRendererPath() . '/dompdf_config.inc.php'; +if (file_exists($pdfRendererClassFile)) { + require_once $pdfRendererClassFile; +} else { + throw new PHPExcel_Writer_Exception('Unable to load PDF Rendering library'); +} + +/** + * PHPExcel_Writer_PDF_DomPDF + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_PDF + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_PDF_DomPDF extends PHPExcel_Writer_PDF_Core implements PHPExcel_Writer_IWriter +{ + /** + * Create a new PHPExcel_Writer_PDF + * + * @param PHPExcel $phpExcel PHPExcel object + */ + public function __construct(PHPExcel $phpExcel) + { + parent::__construct($phpExcel); + } + + /** + * Save PHPExcel to file + * + * @param string $pFilename Name of the file to save as + * @throws PHPExcel_Writer_Exception + */ + public function save($pFilename = null) + { + $fileHandle = parent::prepareForSave($pFilename); + + // Default PDF paper size + $paperSize = 'LETTER'; // Letter (8.5 in. by 11 in.) + + // Check for paper size and page orientation + if (is_null($this->getSheetIndex())) { + $orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation() + == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + $printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize(); + $printMargins = $this->phpExcel->getSheet(0)->getPageMargins(); + } else { + $orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() + == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + $printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); + $printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins(); + } + + $orientation = ($orientation == 'L') ? 'landscape' : 'portrait'; + + // Override Page Orientation + if (!is_null($this->getOrientation())) { + $orientation = ($this->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT) + ? PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT + : $this->getOrientation(); + } + // Override Paper Size + if (!is_null($this->getPaperSize())) { + $printPaperSize = $this->getPaperSize(); + } + + if (isset(self::$paperSizes[$printPaperSize])) { + $paperSize = self::$paperSizes[$printPaperSize]; + } + + + // Create PDF + $pdf = new DOMPDF(); + $pdf->set_paper(strtolower($paperSize), $orientation); + + $pdf->load_html( + $this->generateHTMLHeader(false) . + $this->generateSheetData() . + $this->generateHTMLFooter() + ); + $pdf->render(); + + // Write to file + fwrite($fileHandle, $pdf->output()); + + parent::restoreStateAfterSave($fileHandle); + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/PDF/mPDF.php b/extend/PHPExcel/PHPExcel/Writer/PDF/mPDF.php new file mode 100644 index 0000000..e4e6057 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/PDF/mPDF.php @@ -0,0 +1,118 @@ +<?php + +/** Require mPDF library */ +$pdfRendererClassFile = PHPExcel_Settings::getPdfRendererPath() . '/mpdf.php'; +if (file_exists($pdfRendererClassFile)) { + require_once $pdfRendererClassFile; +} else { + throw new PHPExcel_Writer_Exception('Unable to load PDF Rendering library'); +} + +/** + * PHPExcel_Writer_PDF_mPDF + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_PDF + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_PDF_mPDF extends PHPExcel_Writer_PDF_Core implements PHPExcel_Writer_IWriter +{ + /** + * Create a new PHPExcel_Writer_PDF + * + * @param PHPExcel $phpExcel PHPExcel object + */ + public function __construct(PHPExcel $phpExcel) + { + parent::__construct($phpExcel); + } + + /** + * Save PHPExcel to file + * + * @param string $pFilename Name of the file to save as + * @throws PHPExcel_Writer_Exception + */ + public function save($pFilename = null) + { + $fileHandle = parent::prepareForSave($pFilename); + + // Default PDF paper size + $paperSize = 'LETTER'; // Letter (8.5 in. by 11 in.) + + // Check for paper size and page orientation + if (is_null($this->getSheetIndex())) { + $orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation() + == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + $printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize(); + $printMargins = $this->phpExcel->getSheet(0)->getPageMargins(); + } else { + $orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() + == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + $printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); + $printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins(); + } + $this->setOrientation($orientation); + + // Override Page Orientation + if (!is_null($this->getOrientation())) { + $orientation = ($this->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT) + ? PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT + : $this->getOrientation(); + } + $orientation = strtoupper($orientation); + + // Override Paper Size + if (!is_null($this->getPaperSize())) { + $printPaperSize = $this->getPaperSize(); + } + + if (isset(self::$paperSizes[$printPaperSize])) { + $paperSize = self::$paperSizes[$printPaperSize]; + } + + + // Create PDF + $pdf = new mpdf(); + $ortmp = $orientation; + $pdf->_setPageSize(strtoupper($paperSize), $ortmp); + $pdf->DefOrientation = $orientation; + $pdf->AddPage($orientation); + + // Document info + $pdf->SetTitle($this->phpExcel->getProperties()->getTitle()); + $pdf->SetAuthor($this->phpExcel->getProperties()->getCreator()); + $pdf->SetSubject($this->phpExcel->getProperties()->getSubject()); + $pdf->SetKeywords($this->phpExcel->getProperties()->getKeywords()); + $pdf->SetCreator($this->phpExcel->getProperties()->getCreator()); + + $pdf->WriteHTML( + $this->generateHTMLHeader(false) . + $this->generateSheetData() . + $this->generateHTMLFooter() + ); + + // Write to file + fwrite($fileHandle, $pdf->Output('', 'S')); + + parent::restoreStateAfterSave($fileHandle); + } +} diff --git a/extend/PHPExcel/PHPExcel/Writer/PDF/tcPDF.php b/extend/PHPExcel/PHPExcel/Writer/PDF/tcPDF.php new file mode 100644 index 0000000..dea33a3 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/Writer/PDF/tcPDF.php @@ -0,0 +1,123 @@ +<?php + +/** Require tcPDF library */ +$pdfRendererClassFile = PHPExcel_Settings::getPdfRendererPath() . '/tcpdf.php'; +if (file_exists($pdfRendererClassFile)) { + $k_path_url = PHPExcel_Settings::getPdfRendererPath(); + require_once $pdfRendererClassFile; +} else { + throw new PHPExcel_Writer_Exception('Unable to load PDF Rendering library'); +} + +/** + * PHPExcel_Writer_PDF_tcPDF + * + * Copyright (c) 2006 - 2015 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_Writer_PDF + * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ +class PHPExcel_Writer_PDF_tcPDF extends PHPExcel_Writer_PDF_Core implements PHPExcel_Writer_IWriter +{ + /** + * Create a new PHPExcel_Writer_PDF + * + * @param PHPExcel $phpExcel PHPExcel object + */ + public function __construct(PHPExcel $phpExcel) + { + parent::__construct($phpExcel); + } + + /** + * Save PHPExcel to file + * + * @param string $pFilename Name of the file to save as + * @throws PHPExcel_Writer_Exception + */ + public function save($pFilename = null) + { + $fileHandle = parent::prepareForSave($pFilename); + + // Default PDF paper size + $paperSize = 'LETTER'; // Letter (8.5 in. by 11 in.) + + // Check for paper size and page orientation + if (is_null($this->getSheetIndex())) { + $orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation() + == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + $printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize(); + $printMargins = $this->phpExcel->getSheet(0)->getPageMargins(); + } else { + $orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() + == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + $printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); + $printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins(); + } + + // Override Page Orientation + if (!is_null($this->getOrientation())) { + $orientation = ($this->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) + ? 'L' + : 'P'; + } + // Override Paper Size + if (!is_null($this->getPaperSize())) { + $printPaperSize = $this->getPaperSize(); + } + + if (isset(self::$paperSizes[$printPaperSize])) { + $paperSize = self::$paperSizes[$printPaperSize]; + } + + + // Create PDF + $pdf = new TCPDF($orientation, 'pt', $paperSize); + $pdf->setFontSubsetting(false); + // Set margins, converting inches to points (using 72 dpi) + $pdf->SetMargins($printMargins->getLeft() * 72, $printMargins->getTop() * 72, $printMargins->getRight() * 72); + $pdf->SetAutoPageBreak(true, $printMargins->getBottom() * 72); + + $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); + + $pdf->AddPage(); + + // Set the appropriate font + $pdf->SetFont($this->getFont()); + $pdf->writeHTML( + $this->generateHTMLHeader(false) . + $this->generateSheetData() . + $this->generateHTMLFooter() + ); + + // Document info + $pdf->SetTitle($this->phpExcel->getProperties()->getTitle()); + $pdf->SetAuthor($this->phpExcel->getProperties()->getCreator()); + $pdf->SetSubject($this->phpExcel->getProperties()->getSubject()); + $pdf->SetKeywords($this->phpExcel->getProperties()->getKeywords()); + $pdf->SetCreator($this->phpExcel->getProperties()->getCreator()); + + // Write to file + fwrite($fileHandle, $pdf->output($pFilename, 'S')); + + parent::restoreStateAfterSave($fileHandle); + } +} diff --git a/extend/PHPExcel/PHPExcel/locale/bg/config b/extend/PHPExcel/PHPExcel/locale/bg/config new file mode 100644 index 0000000..4cecddb --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/bg/config @@ -0,0 +1,49 @@ +## +## PHPExcel +## + +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = лв + + +## +## Excel Error Codes (For future use) + +## +NULL = #ПРАЗНО! +DIV0 = #ДЕЛ/0! +VALUE = #СТОЙНОСТ! +REF = #РЕФ! +NAME = #ИМЕ? +NUM = #ЧИСЛО! +NA = #Н/Д diff --git a/extend/PHPExcel/PHPExcel/locale/cs/config b/extend/PHPExcel/PHPExcel/locale/cs/config new file mode 100644 index 0000000..42cdf32 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/cs/config @@ -0,0 +1,47 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = Kč + + +## +## Excel Error Codes (For future use) +## +NULL = #NULL! +DIV0 = #DIV/0! +VALUE = #HODNOTA! +REF = #REF! +NAME = #NÁZEV? +NUM = #NUM! +NA = #N/A diff --git a/extend/PHPExcel/PHPExcel/locale/cs/functions b/extend/PHPExcel/PHPExcel/locale/cs/functions new file mode 100644 index 0000000..c0a3cbb --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/cs/functions @@ -0,0 +1,438 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Calculation +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ +## +## + + +## +## Add-in and Automation functions Funkce doplňků a automatizace +## +GETPIVOTDATA = ZÍSKATKONTDATA ## Vrátí data uložená v kontingenční tabulce. Pomocí funkce ZÍSKATKONTDATA můžete načíst souhrnná data z kontingenční tabulky, pokud jsou tato data v kontingenční sestavě zobrazena. + + +## +## Cube functions Funkce pro práci s krychlemi +## +CUBEKPIMEMBER = CUBEKPIMEMBER ## Vrátí název, vlastnost a velikost klíčového ukazatele výkonu (KUV) a zobrazí v buňce název a vlastnost. Klíčový ukazatel výkonu je kvantifikovatelná veličina, například hrubý měsíční zisk nebo čtvrtletní obrat na zaměstnance, která se používá pro sledování výkonnosti organizace. +CUBEMEMBER = CUBEMEMBER ## Vrátí člen nebo n-tici v hierarchii krychle. Slouží k ověření, zda v krychli existuje člen nebo n-tice. +CUBEMEMBERPROPERTY = CUBEMEMBERPROPERTY ## Vrátí hodnotu vlastnosti člena v krychli. Slouží k ověření, zda v krychli existuje člen s daným názvem, a k vrácení konkrétní vlastnosti tohoto člena. +CUBERANKEDMEMBER = CUBERANKEDMEMBER ## Vrátí n-tý nebo pořadový člen sady. Použijte ji pro vrácení jednoho nebo více prvků sady, například obchodníka s nejvyšším obratem nebo deseti nejlepších studentů. +CUBESET = CUBESET ## Definuje vypočtenou sadu členů nebo n-tic odesláním výrazu sady do krychle na serveru, který vytvoří sadu a potom ji vrátí do aplikace Microsoft Office Excel. +CUBESETCOUNT = CUBESETCOUNT ## Vrátí počet položek v množině +CUBEVALUE = CUBEVALUE ## Vrátí úhrnnou hodnotu z krychle. + + +## +## Database functions Funkce databáze +## +DAVERAGE = DPRŮMĚR ## Vrátí průměr vybraných položek databáze. +DCOUNT = DPOČET ## Spočítá buňky databáze obsahující čísla. +DCOUNTA = DPOČET2 ## Spočítá buňky databáze, které nejsou prázdné. +DGET = DZÍSKAT ## Extrahuje z databáze jeden záznam splňující zadaná kritéria. +DMAX = DMAX ## Vrátí maximální hodnotu z vybraných položek databáze. +DMIN = DMIN ## Vrátí minimální hodnotu z vybraných položek databáze. +DPRODUCT = DSOUČIN ## Vynásobí hodnoty určitého pole záznamů v databázi, které splňují daná kritéria. +DSTDEV = DSMODCH.VÝBĚR ## Odhadne směrodatnou odchylku výběru vybraných položek databáze. +DSTDEVP = DSMODCH ## Vypočte směrodatnou odchylku základního souboru vybraných položek databáze. +DSUM = DSUMA ## Sečte čísla ve sloupcovém poli záznamů databáze, která splňují daná kritéria. +DVAR = DVAR.VÝBĚR ## Odhadne rozptyl výběru vybraných položek databáze. +DVARP = DVAR ## Vypočte rozptyl základního souboru vybraných položek databáze. + + +## +## Date and time functions Funkce data a času +## +DATE = DATUM ## Vrátí pořadové číslo určitého data. +DATEVALUE = DATUMHODN ## Převede datum ve formě textu na pořadové číslo. +DAY = DEN ## Převede pořadové číslo na den v měsíci. +DAYS360 = ROK360 ## Vrátí počet dní mezi dvěma daty na základě roku s 360 dny. +EDATE = EDATE ## Vrátí pořadové číslo data, které označuje určený počet měsíců před nebo po počátečním datu. +EOMONTH = EOMONTH ## Vrátí pořadové číslo posledního dne měsíce před nebo po zadaném počtu měsíců. +HOUR = HODINA ## Převede pořadové číslo na hodinu. +MINUTE = MINUTA ## Převede pořadové číslo na minutu. +MONTH = MĚSÍC ## Převede pořadové číslo na měsíc. +NETWORKDAYS = NETWORKDAYS ## Vrátí počet celých pracovních dní mezi dvěma daty. +NOW = NYNÍ ## Vrátí pořadové číslo aktuálního data a času. +SECOND = SEKUNDA ## Převede pořadové číslo na sekundu. +TIME = ČAS ## Vrátí pořadové číslo určitého času. +TIMEVALUE = ČASHODN ## Převede čas ve formě textu na pořadové číslo. +TODAY = DNES ## Vrátí pořadové číslo dnešního data. +WEEKDAY = DENTÝDNE ## Převede pořadové číslo na den v týdnu. +WEEKNUM = WEEKNUM ## Převede pořadové číslo na číslo představující číselnou pozici týdne v roce. +WORKDAY = WORKDAY ## Vrátí pořadové číslo data před nebo po zadaném počtu pracovních dní. +YEAR = ROK ## Převede pořadové číslo na rok. +YEARFRAC = YEARFRAC ## Vrátí část roku vyjádřenou zlomkem a představující počet celých dní mezi počátečním a koncovým datem. + + +## +## Engineering functions Inženýrské funkce (Technické funkce) +## +BESSELI = BESSELI ## Vrátí modifikovanou Besselovu funkci In(x). +BESSELJ = BESSELJ ## Vrátí modifikovanou Besselovu funkci Jn(x). +BESSELK = BESSELK ## Vrátí modifikovanou Besselovu funkci Kn(x). +BESSELY = BESSELY ## Vrátí Besselovu funkci Yn(x). +BIN2DEC = BIN2DEC ## Převede binární číslo na desítkové. +BIN2HEX = BIN2HEX ## Převede binární číslo na šestnáctkové. +BIN2OCT = BIN2OCT ## Převede binární číslo na osmičkové. +COMPLEX = COMPLEX ## Převede reálnou a imaginární část na komplexní číslo. +CONVERT = CONVERT ## Převede číslo do jiného jednotkového měrného systému. +DEC2BIN = DEC2BIN ## Převede desítkového čísla na dvojkové +DEC2HEX = DEC2HEX ## Převede desítkové číslo na šestnáctkové. +DEC2OCT = DEC2OCT ## Převede desítkové číslo na osmičkové. +DELTA = DELTA ## Testuje rovnost dvou hodnot. +ERF = ERF ## Vrátí chybovou funkci. +ERFC = ERFC ## Vrátí doplňkovou chybovou funkci. +GESTEP = GESTEP ## Testuje, zda je číslo větší než mezní hodnota. +HEX2BIN = HEX2BIN ## Převede šestnáctkové číslo na binární. +HEX2DEC = HEX2DEC ## Převede šestnáctkové číslo na desítkové. +HEX2OCT = HEX2OCT ## Převede šestnáctkové číslo na osmičkové. +IMABS = IMABS ## Vrátí absolutní hodnotu (modul) komplexního čísla. +IMAGINARY = IMAGINARY ## Vrátí imaginární část komplexního čísla. +IMARGUMENT = IMARGUMENT ## Vrátí argument théta, úhel vyjádřený v radiánech. +IMCONJUGATE = IMCONJUGATE ## Vrátí komplexně sdružené číslo ke komplexnímu číslu. +IMCOS = IMCOS ## Vrátí kosinus komplexního čísla. +IMDIV = IMDIV ## Vrátí podíl dvou komplexních čísel. +IMEXP = IMEXP ## Vrátí exponenciální tvar komplexního čísla. +IMLN = IMLN ## Vrátí přirozený logaritmus komplexního čísla. +IMLOG10 = IMLOG10 ## Vrátí dekadický logaritmus komplexního čísla. +IMLOG2 = IMLOG2 ## Vrátí logaritmus komplexního čísla při základu 2. +IMPOWER = IMPOWER ## Vrátí komplexní číslo umocněné na celé číslo. +IMPRODUCT = IMPRODUCT ## Vrátí součin komplexních čísel. +IMREAL = IMREAL ## Vrátí reálnou část komplexního čísla. +IMSIN = IMSIN ## Vrátí sinus komplexního čísla. +IMSQRT = IMSQRT ## Vrátí druhou odmocninu komplexního čísla. +IMSUB = IMSUB ## Vrátí rozdíl mezi dvěma komplexními čísly. +IMSUM = IMSUM ## Vrátí součet dvou komplexních čísel. +OCT2BIN = OCT2BIN ## Převede osmičkové číslo na binární. +OCT2DEC = OCT2DEC ## Převede osmičkové číslo na desítkové. +OCT2HEX = OCT2HEX ## Převede osmičkové číslo na šestnáctkové. + + +## +## Financial functions Finanční funkce +## +ACCRINT = ACCRINT ## Vrátí nahromaděný úrok z cenného papíru, ze kterého je úrok placen v pravidelných termínech. +ACCRINTM = ACCRINTM ## Vrátí nahromaděný úrok z cenného papíru, ze kterého je úrok placen k datu splatnosti. +AMORDEGRC = AMORDEGRC ## Vrátí lineární amortizaci v každém účetním období pomocí koeficientu amortizace. +AMORLINC = AMORLINC ## Vrátí lineární amortizaci v každém účetním období. +COUPDAYBS = COUPDAYBS ## Vrátí počet dnů od začátku období placení kupónů do data splatnosti. +COUPDAYS = COUPDAYS ## Vrátí počet dnů v období placení kupónů, které obsahuje den zúčtování. +COUPDAYSNC = COUPDAYSNC ## Vrátí počet dnů od data zúčtování do následujícího data placení kupónu. +COUPNCD = COUPNCD ## Vrátí následující datum placení kupónu po datu zúčtování. +COUPNUM = COUPNUM ## Vrátí počet kupónů splatných mezi datem zúčtování a datem splatnosti. +COUPPCD = COUPPCD ## Vrátí předchozí datum placení kupónu před datem zúčtování. +CUMIPMT = CUMIPMT ## Vrátí kumulativní úrok splacený mezi dvěma obdobími. +CUMPRINC = CUMPRINC ## Vrátí kumulativní jistinu splacenou mezi dvěma obdobími půjčky. +DB = ODPIS.ZRYCH ## Vrátí odpis aktiva za určité období pomocí degresivní metody odpisu s pevným zůstatkem. +DDB = ODPIS.ZRYCH2 ## Vrátí odpis aktiva za určité období pomocí dvojité degresivní metody odpisu nebo jiné metody, kterou zadáte. +DISC = DISC ## Vrátí diskontní sazbu cenného papíru. +DOLLARDE = DOLLARDE ## Převede částku v korunách vyjádřenou zlomkem na částku v korunách vyjádřenou desetinným číslem. +DOLLARFR = DOLLARFR ## Převede částku v korunách vyjádřenou desetinným číslem na částku v korunách vyjádřenou zlomkem. +DURATION = DURATION ## Vrátí roční dobu cenného papíru s pravidelnými úrokovými sazbami. +EFFECT = EFFECT ## Vrátí efektivní roční úrokovou sazbu. +FV = BUDHODNOTA ## Vrátí budoucí hodnotu investice. +FVSCHEDULE = FVSCHEDULE ## Vrátí budoucí hodnotu počáteční jistiny po použití série sazeb složitého úroku. +INTRATE = INTRATE ## Vrátí úrokovou sazbu plně investovaného cenného papíru. +IPMT = PLATBA.ÚROK ## Vrátí výšku úroku investice za dané období. +IRR = MÍRA.VÝNOSNOSTI ## Vrátí vnitřní výnosové procento série peněžních toků. +ISPMT = ISPMT ## Vypočte výši úroku z investice zaplaceného během určitého období. +MDURATION = MDURATION ## Vrátí Macauleyho modifikovanou dobu cenného papíru o nominální hodnotě 100 Kč. +MIRR = MOD.MÍRA.VÝNOSNOSTI ## Vrátí vnitřní sazbu výnosu, přičemž kladné a záporné hodnoty peněžních prostředků jsou financovány podle různých sazeb. +NOMINAL = NOMINAL ## Vrátí nominální roční úrokovou sazbu. +NPER = POČET.OBDOBÍ ## Vrátí počet období pro investici. +NPV = ČISTÁ.SOUČHODNOTA ## Vrátí čistou současnou hodnotu investice vypočítanou na základě série pravidelných peněžních toků a diskontní sazby. +ODDFPRICE = ODDFPRICE ## Vrátí cenu cenného papíru o nominální hodnotě 100 Kč s odlišným prvním obdobím. +ODDFYIELD = ODDFYIELD ## Vrátí výnos cenného papíru s odlišným prvním obdobím. +ODDLPRICE = ODDLPRICE ## Vrátí cenu cenného papíru o nominální hodnotě 100 Kč s odlišným posledním obdobím. +ODDLYIELD = ODDLYIELD ## Vrátí výnos cenného papíru s odlišným posledním obdobím. +PMT = PLATBA ## Vrátí hodnotu pravidelné splátky anuity. +PPMT = PLATBA.ZÁKLAD ## Vrátí hodnotu splátky jistiny pro zadanou investici za dané období. +PRICE = PRICE ## Vrátí cenu cenného papíru o nominální hodnotě 100 Kč, ze kterého je úrok placen v pravidelných termínech. +PRICEDISC = PRICEDISC ## Vrátí cenu diskontního cenného papíru o nominální hodnotě 100 Kč. +PRICEMAT = PRICEMAT ## Vrátí cenu cenného papíru o nominální hodnotě 100 Kč, ze kterého je úrok placen k datu splatnosti. +PV = SOUČHODNOTA ## Vrátí současnou hodnotu investice. +RATE = ÚROKOVÁ.MÍRA ## Vrátí úrokovou sazbu vztaženou na období anuity. +RECEIVED = RECEIVED ## Vrátí částku obdrženou k datu splatnosti plně investovaného cenného papíru. +SLN = ODPIS.LIN ## Vrátí přímé odpisy aktiva pro jedno období. +SYD = ODPIS.NELIN ## Vrátí směrné číslo ročních odpisů aktiva pro zadané období. +TBILLEQ = TBILLEQ ## Vrátí výnos směnky státní pokladny ekvivalentní výnosu obligace. +TBILLPRICE = TBILLPRICE ## Vrátí cenu směnky státní pokladny o nominální hodnotě 100 Kč. +TBILLYIELD = TBILLYIELD ## Vrátí výnos směnky státní pokladny. +VDB = ODPIS.ZA.INT ## Vrátí odpis aktiva pro určité období nebo část období pomocí degresivní metody odpisu. +XIRR = XIRR ## Vrátí vnitřní výnosnost pro harmonogram peněžních toků, který nemusí být nutně periodický. +XNPV = XNPV ## Vrátí čistou současnou hodnotu pro harmonogram peněžních toků, který nemusí být nutně periodický. +YIELD = YIELD ## Vrátí výnos cenného papíru, ze kterého je úrok placen v pravidelných termínech. +YIELDDISC = YIELDDISC ## Vrátí roční výnos diskontního cenného papíru, například směnky státní pokladny. +YIELDMAT = YIELDMAT ## Vrátí roční výnos cenného papíru, ze kterého je úrok placen k datu splatnosti. + + +## +## Information functions Informační funkce +## +CELL = POLÍČKO ## Vrátí informace o formátování, umístění nebo obsahu buňky. +ERROR.TYPE = CHYBA.TYP ## Vrátí číslo odpovídající typu chyby. +INFO = O.PROSTŘEDÍ ## Vrátí informace o aktuálním pracovním prostředí. +ISBLANK = JE.PRÁZDNÉ ## Vrátí hodnotu PRAVDA, pokud se argument hodnota odkazuje na prázdnou buňku. +ISERR = JE.CHYBA ## Vrátí hodnotu PRAVDA, pokud je argument hodnota libovolná chybová hodnota (kromě #N/A). +ISERROR = JE.CHYBHODN ## Vrátí hodnotu PRAVDA, pokud je argument hodnota libovolná chybová hodnota. +ISEVEN = ISEVEN ## Vrátí hodnotu PRAVDA, pokud je číslo sudé. +ISLOGICAL = JE.LOGHODN ## Vrátí hodnotu PRAVDA, pokud je argument hodnota logická hodnota. +ISNA = JE.NEDEF ## Vrátí hodnotu PRAVDA, pokud je argument hodnota chybová hodnota #N/A. +ISNONTEXT = JE.NETEXT ## Vrátí hodnotu PRAVDA, pokud argument hodnota není text. +ISNUMBER = JE.ČÍSLO ## Vrátí hodnotu PRAVDA, pokud je argument hodnota číslo. +ISODD = ISODD ## Vrátí hodnotu PRAVDA, pokud je číslo liché. +ISREF = JE.ODKAZ ## Vrátí hodnotu PRAVDA, pokud je argument hodnota odkaz. +ISTEXT = JE.TEXT ## Vrátí hodnotu PRAVDA, pokud je argument hodnota text. +N = N ## Vrátí hodnotu převedenou na číslo. +NA = NEDEF ## Vrátí chybovou hodnotu #N/A. +TYPE = TYP ## Vrátí číslo označující datový typ hodnoty. + + +## +## Logical functions Logické funkce +## +AND = A ## Vrátí hodnotu PRAVDA, mají-li všechny argumenty hodnotu PRAVDA. +FALSE = NEPRAVDA ## Vrátí logickou hodnotu NEPRAVDA. +IF = KDYŽ ## Určí, který logický test má proběhnout. +IFERROR = IFERROR ## Pokud je vzorec vyhodnocen jako chyba, vrátí zadanou hodnotu. V opačném případě vrátí výsledek vzorce. +NOT = NE ## Provede logickou negaci argumentu funkce. +OR = NEBO ## Vrátí hodnotu PRAVDA, je-li alespoň jeden argument roven hodnotě PRAVDA. +TRUE = PRAVDA ## Vrátí logickou hodnotu PRAVDA. + + +## +## Lookup and reference functions Vyhledávací funkce +## +ADDRESS = ODKAZ ## Vrátí textový odkaz na jednu buňku listu. +AREAS = POČET.BLOKŮ ## Vrátí počet oblastí v odkazu. +CHOOSE = ZVOLIT ## Zvolí hodnotu ze seznamu hodnot. +COLUMN = SLOUPEC ## Vrátí číslo sloupce odkazu. +COLUMNS = SLOUPCE ## Vrátí počet sloupců v odkazu. +HLOOKUP = VVYHLEDAT ## Prohledá horní řádek matice a vrátí hodnotu určené buňky. +HYPERLINK = HYPERTEXTOVÝ.ODKAZ ## Vytvoří zástupce nebo odkaz, který otevře dokument uložený na síťovém serveru, v síti intranet nebo Internet. +INDEX = INDEX ## Pomocí rejstříku zvolí hodnotu z odkazu nebo matice. +INDIRECT = NEPŘÍMÝ.ODKAZ ## Vrátí odkaz určený textovou hodnotou. +LOOKUP = VYHLEDAT ## Vyhledá hodnoty ve vektoru nebo matici. +MATCH = POZVYHLEDAT ## Vyhledá hodnoty v odkazu nebo matici. +OFFSET = POSUN ## Vrátí posun odkazu od zadaného odkazu. +ROW = ŘÁDEK ## Vrátí číslo řádku odkazu. +ROWS = ŘÁDKY ## Vrátí počet řádků v odkazu. +RTD = RTD ## Načte data reálného času z programu, který podporuje automatizaci modelu COM (Automatizace: Způsob práce s objekty určité aplikace z jiné aplikace nebo nástroje pro vývoj. Automatizace (dříve nazývaná automatizace OLE) je počítačovým standardem a je funkcí modelu COM (Component Object Model).). +TRANSPOSE = TRANSPOZICE ## Vrátí transponovanou matici. +VLOOKUP = SVYHLEDAT ## Prohledá první sloupec matice, přesune kurzor v řádku a vrátí hodnotu buňky. + + +## +## Math and trigonometry functions Matematické a trigonometrické funkce +## +ABS = ABS ## Vrátí absolutní hodnotu čísla. +ACOS = ARCCOS ## Vrátí arkuskosinus čísla. +ACOSH = ARCCOSH ## Vrátí hyperbolický arkuskosinus čísla. +ASIN = ARCSIN ## Vrátí arkussinus čísla. +ASINH = ARCSINH ## Vrátí hyperbolický arkussinus čísla. +ATAN = ARCTG ## Vrátí arkustangens čísla. +ATAN2 = ARCTG2 ## Vrátí arkustangens x-ové a y-ové souřadnice. +ATANH = ARCTGH ## Vrátí hyperbolický arkustangens čísla. +CEILING = ZAOKR.NAHORU ## Zaokrouhlí číslo na nejbližší celé číslo nebo na nejbližší násobek zadané hodnoty. +COMBIN = KOMBINACE ## Vrátí počet kombinací pro daný počet položek. +COS = COS ## Vrátí kosinus čísla. +COSH = COSH ## Vrátí hyperbolický kosinus čísla. +DEGREES = DEGREES ## Převede radiány na stupně. +EVEN = ZAOKROUHLIT.NA.SUDÉ ## Zaokrouhlí číslo nahoru na nejbližší celé sudé číslo. +EXP = EXP ## Vrátí základ přirozeného logaritmu e umocněný na zadané číslo. +FACT = FAKTORIÁL ## Vrátí faktoriál čísla. +FACTDOUBLE = FACTDOUBLE ## Vrátí dvojitý faktoriál čísla. +FLOOR = ZAOKR.DOLŮ ## Zaokrouhlí číslo dolů, směrem k nule. +GCD = GCD ## Vrátí největší společný dělitel. +INT = CELÁ.ČÁST ## Zaokrouhlí číslo dolů na nejbližší celé číslo. +LCM = LCM ## Vrátí nejmenší společný násobek. +LN = LN ## Vrátí přirozený logaritmus čísla. +LOG = LOGZ ## Vrátí logaritmus čísla při zadaném základu. +LOG10 = LOG ## Vrátí dekadický logaritmus čísla. +MDETERM = DETERMINANT ## Vrátí determinant matice. +MINVERSE = INVERZE ## Vrátí inverzní matici. +MMULT = SOUČIN.MATIC ## Vrátí součin dvou matic. +MOD = MOD ## Vrátí zbytek po dělení. +MROUND = MROUND ## Vrátí číslo zaokrouhlené na požadovaný násobek. +MULTINOMIAL = MULTINOMIAL ## Vrátí mnohočlen z množiny čísel. +ODD = ZAOKROUHLIT.NA.LICHÉ ## Zaokrouhlí číslo nahoru na nejbližší celé liché číslo. +PI = PI ## Vrátí hodnotu čísla pí. +POWER = POWER ## Umocní číslo na zadanou mocninu. +PRODUCT = SOUČIN ## Vynásobí argumenty funkce. +QUOTIENT = QUOTIENT ## Vrátí celou část dělení. +RADIANS = RADIANS ## Převede stupně na radiány. +RAND = NÁHČÍSLO ## Vrátí náhodné číslo mezi 0 a 1. +RANDBETWEEN = RANDBETWEEN ## Vrátí náhodné číslo mezi zadanými čísly. +ROMAN = ROMAN ## Převede arabskou číslici na římskou ve formátu textu. +ROUND = ZAOKROUHLIT ## Zaokrouhlí číslo na zadaný počet číslic. +ROUNDDOWN = ROUNDDOWN ## Zaokrouhlí číslo dolů, směrem k nule. +ROUNDUP = ROUNDUP ## Zaokrouhlí číslo nahoru, směrem od nuly. +SERIESSUM = SERIESSUM ## Vrátí součet mocninné řady určené podle vzorce. +SIGN = SIGN ## Vrátí znaménko čísla. +SIN = SIN ## Vrátí sinus daného úhlu. +SINH = SINH ## Vrátí hyperbolický sinus čísla. +SQRT = ODMOCNINA ## Vrátí kladnou druhou odmocninu. +SQRTPI = SQRTPI ## Vrátí druhou odmocninu výrazu (číslo * pí). +SUBTOTAL = SUBTOTAL ## Vrátí souhrn v seznamu nebo databázi. +SUM = SUMA ## Sečte argumenty funkce. +SUMIF = SUMIF ## Sečte buňky vybrané podle zadaných kritérií. +SUMIFS = SUMIFS ## Sečte buňky určené více zadanými podmínkami. +SUMPRODUCT = SOUČIN.SKALÁRNÍ ## Vrátí součet součinů odpovídajících prvků matic. +SUMSQ = SUMA.ČTVERCŮ ## Vrátí součet čtverců argumentů. +SUMX2MY2 = SUMX2MY2 ## Vrátí součet rozdílu čtverců odpovídajících hodnot ve dvou maticích. +SUMX2PY2 = SUMX2PY2 ## Vrátí součet součtu čtverců odpovídajících hodnot ve dvou maticích. +SUMXMY2 = SUMXMY2 ## Vrátí součet čtverců rozdílů odpovídajících hodnot ve dvou maticích. +TAN = TGTG ## Vrátí tangens čísla. +TANH = TGH ## Vrátí hyperbolický tangens čísla. +TRUNC = USEKNOUT ## Zkrátí číslo na celé číslo. + + +## +## Statistical functions Statistické funkce +## +AVEDEV = PRŮMODCHYLKA ## Vrátí průměrnou hodnotu absolutních odchylek datových bodů od jejich střední hodnoty. +AVERAGE = PRŮMĚR ## Vrátí průměrnou hodnotu argumentů. +AVERAGEA = AVERAGEA ## Vrátí průměrnou hodnotu argumentů včetně čísel, textu a logických hodnot. +AVERAGEIF = AVERAGEIF ## Vrátí průměrnou hodnotu (aritmetický průměr) všech buněk v oblasti, které vyhovují příslušné podmínce. +AVERAGEIFS = AVERAGEIFS ## Vrátí průměrnou hodnotu (aritmetický průměr) všech buněk vyhovujících několika podmínkám. +BETADIST = BETADIST ## Vrátí hodnotu součtového rozdělení beta. +BETAINV = BETAINV ## Vrátí inverzní hodnotu součtového rozdělení pro zadané rozdělení beta. +BINOMDIST = BINOMDIST ## Vrátí hodnotu binomického rozdělení pravděpodobnosti jednotlivých veličin. +CHIDIST = CHIDIST ## Vrátí jednostrannou pravděpodobnost rozdělení chí-kvadrát. +CHIINV = CHIINV ## Vrátí hodnotu funkce inverzní k distribuční funkci jednostranné pravděpodobnosti rozdělení chí-kvadrát. +CHITEST = CHITEST ## Vrátí test nezávislosti. +CONFIDENCE = CONFIDENCE ## Vrátí interval spolehlivosti pro střední hodnotu základního souboru. +CORREL = CORREL ## Vrátí korelační koeficient mezi dvěma množinami dat. +COUNT = POČET ## Vrátí počet čísel v seznamu argumentů. +COUNTA = POČET2 ## Vrátí počet hodnot v seznamu argumentů. +COUNTBLANK = COUNTBLANK ## Spočítá počet prázdných buněk v oblasti. +COUNTIF = COUNTIF ## Spočítá buňky v oblasti, které odpovídají zadaným kritériím. +COUNTIFS = COUNTIFS ## Spočítá buňky v oblasti, které odpovídají více kritériím. +COVAR = COVAR ## Vrátí hodnotu kovariance, průměrnou hodnotu součinů párových odchylek +CRITBINOM = CRITBINOM ## Vrátí nejmenší hodnotu, pro kterou má součtové binomické rozdělení hodnotu větší nebo rovnu hodnotě kritéria. +DEVSQ = DEVSQ ## Vrátí součet čtverců odchylek. +EXPONDIST = EXPONDIST ## Vrátí hodnotu exponenciálního rozdělení. +FDIST = FDIST ## Vrátí hodnotu rozdělení pravděpodobnosti F. +FINV = FINV ## Vrátí hodnotu inverzní funkce k distribuční funkci rozdělení F. +FISHER = FISHER ## Vrátí hodnotu Fisherovy transformace. +FISHERINV = FISHERINV ## Vrátí hodnotu inverzní funkce k Fisherově transformaci. +FORECAST = FORECAST ## Vrátí hodnotu lineárního trendu. +FREQUENCY = ČETNOSTI ## Vrátí četnost rozdělení jako svislou matici. +FTEST = FTEST ## Vrátí výsledek F-testu. +GAMMADIST = GAMMADIST ## Vrátí hodnotu rozdělení gama. +GAMMAINV = GAMMAINV ## Vrátí hodnotu inverzní funkce k distribuční funkci součtového rozdělení gama. +GAMMALN = GAMMALN ## Vrátí přirozený logaritmus funkce gama, Γ(x). +GEOMEAN = GEOMEAN ## Vrátí geometrický průměr. +GROWTH = LOGLINTREND ## Vrátí hodnoty exponenciálního trendu. +HARMEAN = HARMEAN ## Vrátí harmonický průměr. +HYPGEOMDIST = HYPGEOMDIST ## Vrátí hodnotu hypergeometrického rozdělení. +INTERCEPT = INTERCEPT ## Vrátí úsek lineární regresní čáry. +KURT = KURT ## Vrátí hodnotu excesu množiny dat. +LARGE = LARGE ## Vrátí k-tou největší hodnotu množiny dat. +LINEST = LINREGRESE ## Vrátí parametry lineárního trendu. +LOGEST = LOGLINREGRESE ## Vrátí parametry exponenciálního trendu. +LOGINV = LOGINV ## Vrátí inverzní funkci k distribuční funkci logaritmicko-normálního rozdělení. +LOGNORMDIST = LOGNORMDIST ## Vrátí hodnotu součtového logaritmicko-normálního rozdělení. +MAX = MAX ## Vrátí maximální hodnotu seznamu argumentů. +MAXA = MAXA ## Vrátí maximální hodnotu seznamu argumentů včetně čísel, textu a logických hodnot. +MEDIAN = MEDIAN ## Vrátí střední hodnotu zadaných čísel. +MIN = MIN ## Vrátí minimální hodnotu seznamu argumentů. +MINA = MINA ## Vrátí nejmenší hodnotu v seznamu argumentů včetně čísel, textu a logických hodnot. +MODE = MODE ## Vrátí hodnotu, která se v množině dat vyskytuje nejčastěji. +NEGBINOMDIST = NEGBINOMDIST ## Vrátí hodnotu negativního binomického rozdělení. +NORMDIST = NORMDIST ## Vrátí hodnotu normálního součtového rozdělení. +NORMINV = NORMINV ## Vrátí inverzní funkci k funkci normálního součtového rozdělení. +NORMSDIST = NORMSDIST ## Vrátí hodnotu standardního normálního součtového rozdělení. +NORMSINV = NORMSINV ## Vrátí inverzní funkci k funkci standardního normálního součtového rozdělení. +PEARSON = PEARSON ## Vrátí Pearsonův výsledný momentový korelační koeficient. +PERCENTILE = PERCENTIL ## Vrátí hodnotu k-tého percentilu hodnot v oblasti. +PERCENTRANK = PERCENTRANK ## Vrátí pořadí hodnoty v množině dat vyjádřené procentuální částí množiny dat. +PERMUT = PERMUTACE ## Vrátí počet permutací pro zadaný počet objektů. +POISSON = POISSON ## Vrátí hodnotu distribuční funkce Poissonova rozdělení. +PROB = PROB ## Vrátí pravděpodobnost výskytu hodnot v oblasti mezi dvěma mezními hodnotami. +QUARTILE = QUARTIL ## Vrátí hodnotu kvartilu množiny dat. +RANK = RANK ## Vrátí pořadí čísla v seznamu čísel. +RSQ = RKQ ## Vrátí druhou mocninu Pearsonova výsledného momentového korelačního koeficientu. +SKEW = SKEW ## Vrátí zešikmení rozdělení. +SLOPE = SLOPE ## Vrátí směrnici lineární regresní čáry. +SMALL = SMALL ## Vrátí k-tou nejmenší hodnotu množiny dat. +STANDARDIZE = STANDARDIZE ## Vrátí normalizovanou hodnotu. +STDEV = SMODCH.VÝBĚR ## Vypočte směrodatnou odchylku výběru. +STDEVA = STDEVA ## Vypočte směrodatnou odchylku výběru včetně čísel, textu a logických hodnot. +STDEVP = SMODCH ## Vypočte směrodatnou odchylku základního souboru. +STDEVPA = STDEVPA ## Vypočte směrodatnou odchylku základního souboru včetně čísel, textu a logických hodnot. +STEYX = STEYX ## Vrátí standardní chybu předpovězené hodnoty y pro každou hodnotu x v regresi. +TDIST = TDIST ## Vrátí hodnotu Studentova t-rozdělení. +TINV = TINV ## Vrátí inverzní funkci k distribuční funkci Studentova t-rozdělení. +TREND = LINTREND ## Vrátí hodnoty lineárního trendu. +TRIMMEAN = TRIMMEAN ## Vrátí střední hodnotu vnitřní části množiny dat. +TTEST = TTEST ## Vrátí pravděpodobnost spojenou se Studentovým t-testem. +VAR = VAR.VÝBĚR ## Vypočte rozptyl výběru. +VARA = VARA ## Vypočte rozptyl výběru včetně čísel, textu a logických hodnot. +VARP = VAR ## Vypočte rozptyl základního souboru. +VARPA = VARPA ## Vypočte rozptyl základního souboru včetně čísel, textu a logických hodnot. +WEIBULL = WEIBULL ## Vrátí hodnotu Weibullova rozdělení. +ZTEST = ZTEST ## Vrátí jednostrannou P-hodnotu z-testu. + + +## +## Text functions Textové funkce +## +ASC = ASC ## Změní znaky s plnou šířkou (dvoubajtové)v řetězci znaků na znaky s poloviční šířkou (jednobajtové). +BAHTTEXT = BAHTTEXT ## Převede číslo na text ve formátu, měny ß (baht). +CHAR = ZNAK ## Vrátí znak určený číslem kódu. +CLEAN = VYČISTIT ## Odebere z textu všechny netisknutelné znaky. +CODE = KÓD ## Vrátí číselný kód prvního znaku zadaného textového řetězce. +CONCATENATE = CONCATENATE ## Spojí několik textových položek do jedné. +DOLLAR = KČ ## Převede číslo na text ve formátu měny Kč (česká koruna). +EXACT = STEJNÉ ## Zkontroluje, zda jsou dvě textové hodnoty shodné. +FIND = NAJÍT ## Nalezne textovou hodnotu uvnitř jiné (rozlišuje malá a velká písmena). +FINDB = FINDB ## Nalezne textovou hodnotu uvnitř jiné (rozlišuje malá a velká písmena). +FIXED = ZAOKROUHLIT.NA.TEXT ## Zformátuje číslo jako text s pevným počtem desetinných míst. +JIS = JIS ## Změní znaky s poloviční šířkou (jednobajtové) v řetězci znaků na znaky s plnou šířkou (dvoubajtové). +LEFT = ZLEVA ## Vrátí první znaky textové hodnoty umístěné nejvíce vlevo. +LEFTB = LEFTB ## Vrátí první znaky textové hodnoty umístěné nejvíce vlevo. +LEN = DÉLKA ## Vrátí počet znaků textového řetězce. +LENB = LENB ## Vrátí počet znaků textového řetězce. +LOWER = MALÁ ## Převede text na malá písmena. +MID = ČÁST ## Vrátí určitý počet znaků textového řetězce počínaje zadaným místem. +MIDB = MIDB ## Vrátí určitý počet znaků textového řetězce počínaje zadaným místem. +PHONETIC = ZVUKOVÉ ## Extrahuje fonetické znaky (furigana) z textového řetězce. +PROPER = VELKÁ2 ## Převede první písmeno každého slova textové hodnoty na velké. +REPLACE = NAHRADIT ## Nahradí znaky uvnitř textu. +REPLACEB = NAHRADITB ## Nahradí znaky uvnitř textu. +REPT = OPAKOVAT ## Zopakuje text podle zadaného počtu opakování. +RIGHT = ZPRAVA ## Vrátí první znaky textové hodnoty umístěné nejvíce vpravo. +RIGHTB = RIGHTB ## Vrátí první znaky textové hodnoty umístěné nejvíce vpravo. +SEARCH = HLEDAT ## Nalezne textovou hodnotu uvnitř jiné (malá a velká písmena nejsou rozlišována). +SEARCHB = SEARCHB ## Nalezne textovou hodnotu uvnitř jiné (malá a velká písmena nejsou rozlišována). +SUBSTITUTE = DOSADIT ## V textovém řetězci nahradí starý text novým. +T = T ## Převede argumenty na text. +TEXT = HODNOTA.NA.TEXT ## Zformátuje číslo a převede ho na text. +TRIM = PROČISTIT ## Odstraní z textu mezery. +UPPER = VELKÁ ## Převede text na velká písmena. +VALUE = HODNOTA ## Převede textový argument na číslo. diff --git a/extend/PHPExcel/PHPExcel/locale/da/config b/extend/PHPExcel/PHPExcel/locale/da/config new file mode 100644 index 0000000..ae59003 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/da/config @@ -0,0 +1,48 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = kr + + + +## +## Excel Error Codes (For future use) +## +NULL = #NUL! +DIV0 = #DIVISION/0! +VALUE = #VÆRDI! +REF = #REFERENCE! +NAME = #NAVN? +NUM = #NUM! +NA = #I/T diff --git a/extend/PHPExcel/PHPExcel/locale/da/functions b/extend/PHPExcel/PHPExcel/locale/da/functions new file mode 100644 index 0000000..26e0310 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/da/functions @@ -0,0 +1,438 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Calculation +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ +## +## + + +## +## Add-in and Automation functions Tilføjelsesprogram- og automatiseringsfunktioner +## +GETPIVOTDATA = HENTPIVOTDATA ## Returnerer data, der er lagret i en pivottabelrapport + + +## +## Cube functions Kubefunktioner +## +CUBEKPIMEMBER = KUBE.KPI.MEDLEM ## Returnerer navn, egenskab og mål for en KPI-indikator og viser navnet og egenskaben i cellen. En KPI-indikator er en målbar størrelse, f.eks. bruttooverskud pr. måned eller personaleudskiftning pr. kvartal, der bruges til at overvåge en organisations præstationer. +CUBEMEMBER = KUBE.MEDLEM ## Returnerer et medlem eller en tupel fra kubehierarkiet. Bruges til at validere, om et medlem eller en tupel findes i kuben. +CUBEMEMBERPROPERTY = KUBEMEDLEM.EGENSKAB ## Returnerer værdien af en egenskab for et medlem i kuben. Bruges til at validere, om et medlemsnavn findes i kuben, og returnere den angivne egenskab for medlemmet. +CUBERANKEDMEMBER = KUBEMEDLEM.RANG ## Returnerer det n'te eller rangordnede medlem i et sæt. Bruges til at returnere et eller flere elementer i et sæt, f.eks. topsælgere eller de 10 bedste elever. +CUBESET = KUBESÆT ## Definerer et beregnet sæt medlemmer eller tupler ved at sende et sætudtryk til kuben på serveren, som opretter sættet og returnerer det til Microsoft Office Excel. +CUBESETCOUNT = KUBESÆT.TÆL ## Returnerer antallet af elementer i et sæt. +CUBEVALUE = KUBEVÆRDI ## Returnerer en sammenlagt (aggregeret) værdi fra en kube. + + +## +## Database functions Databasefunktioner +## +DAVERAGE = DMIDDEL ## Returnerer gennemsnittet af markerede databaseposter +DCOUNT = DTÆL ## Tæller de celler, der indeholder tal, i en database +DCOUNTA = DTÆLV ## Tæller udfyldte celler i en database +DGET = DHENT ## Uddrager en enkelt post, der opfylder de angivne kriterier, fra en database +DMAX = DMAKS ## Returnerer den største værdi blandt markerede databaseposter +DMIN = DMIN ## Returnerer den mindste værdi blandt markerede databaseposter +DPRODUCT = DPRODUKT ## Ganger værdierne i et bestemt felt med poster, der opfylder kriterierne i en database +DSTDEV = DSTDAFV ## Beregner et skøn over standardafvigelsen baseret på en stikprøve af markerede databaseposter +DSTDEVP = DSTDAFVP ## Beregner standardafvigelsen baseret på hele populationen af markerede databaseposter +DSUM = DSUM ## Sammenlægger de tal i feltkolonnen i databasen, der opfylder kriterierne +DVAR = DVARIANS ## Beregner varians baseret på en stikprøve af markerede databaseposter +DVARP = DVARIANSP ## Beregner varians baseret på hele populationen af markerede databaseposter + + +## +## Date and time functions Dato- og klokkeslætsfunktioner +## +DATE = DATO ## Returnerer serienummeret for en bestemt dato +DATEVALUE = DATOVÆRDI ## Konverterer en dato i form af tekst til et serienummer +DAY = DAG ## Konverterer et serienummer til en dag i måneden +DAYS360 = DAGE360 ## Beregner antallet af dage mellem to datoer på grundlag af et år med 360 dage +EDATE = EDATO ## Returnerer serienummeret for den dato, der ligger det angivne antal måneder før eller efter startdatoen +EOMONTH = SLUT.PÅ.MÅNED ## Returnerer serienummeret på den sidste dag i måneden før eller efter et angivet antal måneder +HOUR = TIME ## Konverterer et serienummer til en time +MINUTE = MINUT ## Konverterer et serienummer til et minut +MONTH = MÅNED ## Konverterer et serienummer til en måned +NETWORKDAYS = ANTAL.ARBEJDSDAGE ## Returnerer antallet af hele arbejdsdage mellem to datoer +NOW = NU ## Returnerer serienummeret for den aktuelle dato eller det aktuelle klokkeslæt +SECOND = SEKUND ## Konverterer et serienummer til et sekund +TIME = KLOKKESLÆT ## Returnerer serienummeret for et bestemt klokkeslæt +TIMEVALUE = TIDSVÆRDI ## Konverterer et klokkeslæt i form af tekst til et serienummer +TODAY = IDAG ## Returnerer serienummeret for dags dato +WEEKDAY = UGEDAG ## Konverterer et serienummer til en ugedag +WEEKNUM = UGE.NR ## Konverterer et serienummer til et tal, der angiver ugenummeret i året +WORKDAY = ARBEJDSDAG ## Returnerer serienummeret for dagen før eller efter det angivne antal arbejdsdage +YEAR = ÅR ## Konverterer et serienummer til et år +YEARFRAC = ÅR.BRØK ## Returnerer årsbrøken, der repræsenterer antallet af hele dage mellem startdato og slutdato + + +## +## Engineering functions Tekniske funktioner +## +BESSELI = BESSELI ## Returnerer den modificerede Bessel-funktion In(x) +BESSELJ = BESSELJ ## Returnerer Bessel-funktionen Jn(x) +BESSELK = BESSELK ## Returnerer den modificerede Bessel-funktion Kn(x) +BESSELY = BESSELY ## Returnerer Bessel-funktionen Yn(x) +BIN2DEC = BIN.TIL.DEC ## Konverterer et binært tal til et decimaltal +BIN2HEX = BIN.TIL.HEX ## Konverterer et binært tal til et heksadecimalt tal +BIN2OCT = BIN.TIL.OKT ## Konverterer et binært tal til et oktaltal. +COMPLEX = KOMPLEKS ## Konverterer reelle og imaginære koefficienter til et komplekst tal +CONVERT = KONVERTER ## Konverterer et tal fra én måleenhed til en anden +DEC2BIN = DEC.TIL.BIN ## Konverterer et decimaltal til et binært tal +DEC2HEX = DEC.TIL.HEX ## Konverterer et decimaltal til et heksadecimalt tal +DEC2OCT = DEC.TIL.OKT ## Konverterer et decimaltal til et oktaltal +DELTA = DELTA ## Tester, om to værdier er ens +ERF = FEJLFUNK ## Returner fejlfunktionen +ERFC = FEJLFUNK.KOMP ## Returnerer den komplementære fejlfunktion +GESTEP = GETRIN ## Tester, om et tal er større end en grænseværdi +HEX2BIN = HEX.TIL.BIN ## Konverterer et heksadecimalt tal til et binært tal +HEX2DEC = HEX.TIL.DEC ## Konverterer et decimaltal til et heksadecimalt tal +HEX2OCT = HEX.TIL.OKT ## Konverterer et heksadecimalt tal til et oktaltal +IMABS = IMAGABS ## Returnerer den absolutte værdi (modulus) for et komplekst tal +IMAGINARY = IMAGINÆR ## Returnerer den imaginære koefficient for et komplekst tal +IMARGUMENT = IMAGARGUMENT ## Returnerer argumentet theta, en vinkel udtrykt i radianer +IMCONJUGATE = IMAGKONJUGERE ## Returnerer den komplekse konjugation af et komplekst tal +IMCOS = IMAGCOS ## Returnerer et komplekst tals cosinus +IMDIV = IMAGDIV ## Returnerer kvotienten for to komplekse tal +IMEXP = IMAGEKSP ## Returnerer et komplekst tals eksponentialfunktion +IMLN = IMAGLN ## Returnerer et komplekst tals naturlige logaritme +IMLOG10 = IMAGLOG10 ## Returnerer et komplekst tals sædvanlige logaritme (titalslogaritme) +IMLOG2 = IMAGLOG2 ## Returnerer et komplekst tals sædvanlige logaritme (totalslogaritme) +IMPOWER = IMAGPOTENS ## Returnerer et komplekst tal opløftet i en heltalspotens +IMPRODUCT = IMAGPRODUKT ## Returnerer produktet af komplekse tal +IMREAL = IMAGREELT ## Returnerer den reelle koefficient for et komplekst tal +IMSIN = IMAGSIN ## Returnerer et komplekst tals sinus +IMSQRT = IMAGKVROD ## Returnerer et komplekst tals kvadratrod +IMSUB = IMAGSUB ## Returnerer forskellen mellem to komplekse tal +IMSUM = IMAGSUM ## Returnerer summen af komplekse tal +OCT2BIN = OKT.TIL.BIN ## Konverterer et oktaltal til et binært tal +OCT2DEC = OKT.TIL.DEC ## Konverterer et oktaltal til et decimaltal +OCT2HEX = OKT.TIL.HEX ## Konverterer et oktaltal til et heksadecimalt tal + + +## +## Financial functions Finansielle funktioner +## +ACCRINT = PÅLØBRENTE ## Returnerer den påløbne rente for et værdipapir med periodiske renteudbetalinger +ACCRINTM = PÅLØBRENTE.UDLØB ## Returnerer den påløbne rente for et værdipapir, hvor renteudbetalingen finder sted ved papirets udløb +AMORDEGRC = AMORDEGRC ## Returnerer afskrivningsbeløbet for hver regnskabsperiode ved hjælp af en afskrivningskoefficient +AMORLINC = AMORLINC ## Returnerer afskrivningsbeløbet for hver regnskabsperiode +COUPDAYBS = KUPONDAGE.SA ## Returnerer antallet af dage fra starten af kuponperioden til afregningsdatoen +COUPDAYS = KUPONDAGE.A ## Returnerer antallet af dage fra begyndelsen af kuponperioden til afregningsdatoen +COUPDAYSNC = KUPONDAGE.ANK ## Returnerer antallet af dage i den kuponperiode, der indeholder afregningsdatoen +COUPNCD = KUPONDAG.NÆSTE ## Returnerer den næste kupondato efter afregningsdatoen +COUPNUM = KUPONBETALINGER ## Returnerer antallet af kuponudbetalinger mellem afregnings- og udløbsdatoen +COUPPCD = KUPONDAG.FORRIGE ## Returnerer den forrige kupondato før afregningsdatoen +CUMIPMT = AKKUM.RENTE ## Returnerer den akkumulerede rente, der betales på et lån mellem to perioder +CUMPRINC = AKKUM.HOVEDSTOL ## Returnerer den akkumulerede nedbringelse af hovedstol mellem to perioder +DB = DB ## Returnerer afskrivningen på et aktiv i en angivet periode ved anvendelse af saldometoden +DDB = DSA ## Returnerer afskrivningsbeløbet for et aktiv over en bestemt periode ved anvendelse af dobbeltsaldometoden eller en anden afskrivningsmetode, som du angiver +DISC = DISKONTO ## Returnerer et værdipapirs diskonto +DOLLARDE = KR.DECIMAL ## Konverterer en kronepris udtrykt som brøk til en kronepris udtrykt som decimaltal +DOLLARFR = KR.BRØK ## Konverterer en kronepris udtrykt som decimaltal til en kronepris udtrykt som brøk +DURATION = VARIGHED ## Returnerer den årlige løbetid for et værdipapir med periodiske renteudbetalinger +EFFECT = EFFEKTIV.RENTE ## Returnerer den årlige effektive rente +FV = FV ## Returnerer fremtidsværdien af en investering +FVSCHEDULE = FVTABEL ## Returnerer den fremtidige værdi af en hovedstol, når der er tilskrevet rente og rentes rente efter forskellige rentesatser +INTRATE = RENTEFOD ## Returnerer renten på et fuldt ud investeret værdipapir +IPMT = R.YDELSE ## Returnerer renten fra en investering for en given periode +IRR = IA ## Returnerer den interne rente for en række pengestrømme +ISPMT = ISPMT ## Beregner den betalte rente i løbet af en bestemt investeringsperiode +MDURATION = MVARIGHED ## Returnerer Macauleys modificerede løbetid for et værdipapir med en formodet pari på kr. 100 +MIRR = MIA ## Returnerer den interne forrentning, hvor positive og negative pengestrømme finansieres til forskellig rente +NOMINAL = NOMINEL ## Returnerer den årlige nominelle rente +NPER = NPER ## Returnerer antallet af perioder for en investering +NPV = NUTIDSVÆRDI ## Returnerer nettonutidsværdien for en investering baseret på en række periodiske pengestrømme og en diskonteringssats +ODDFPRICE = ULIGE.KURS.PÅLYDENDE ## Returnerer kursen pr. kr. 100 nominel værdi for et værdipapir med en ulige (kort eller lang) første periode +ODDFYIELD = ULIGE.FØRSTE.AFKAST ## Returnerer afkastet for et værdipapir med ulige første periode +ODDLPRICE = ULIGE.SIDSTE.KURS ## Returnerer kursen pr. kr. 100 nominel værdi for et værdipapir med ulige sidste periode +ODDLYIELD = ULIGE.SIDSTE.AFKAST ## Returnerer afkastet for et værdipapir med ulige sidste periode +PMT = YDELSE ## Returnerer renten fra en investering for en given periode +PPMT = H.YDELSE ## Returnerer ydelsen på hovedstolen for en investering i en given periode +PRICE = KURS ## Returnerer kursen pr. kr 100 nominel værdi for et værdipapir med periodiske renteudbetalinger +PRICEDISC = KURS.DISKONTO ## Returnerer kursen pr. kr 100 nominel værdi for et diskonteret værdipapir +PRICEMAT = KURS.UDLØB ## Returnerer kursen pr. kr 100 nominel værdi for et værdipapir, hvor renten udbetales ved papirets udløb +PV = NV ## Returnerer den nuværende værdi af en investering +RATE = RENTE ## Returnerer renten i hver periode for en annuitet +RECEIVED = MODTAGET.VED.UDLØB ## Returnerer det beløb, der modtages ved udløbet af et fuldt ud investeret værdipapir +SLN = LA ## Returnerer den lineære afskrivning for et aktiv i en enkelt periode +SYD = ÅRSAFSKRIVNING ## Returnerer den årlige afskrivning på et aktiv i en bestemt periode +TBILLEQ = STATSOBLIGATION ## Returnerer det obligationsækvivalente afkast for en statsobligation +TBILLPRICE = STATSOBLIGATION.KURS ## Returnerer kursen pr. kr 100 nominel værdi for en statsobligation +TBILLYIELD = STATSOBLIGATION.AFKAST ## Returnerer en afkastet på en statsobligation +VDB = VSA ## Returnerer afskrivningen på et aktiv i en angivet periode, herunder delperioder, ved brug af dobbeltsaldometoden +XIRR = INTERN.RENTE ## Returnerer den interne rente for en plan over pengestrømme, der ikke behøver at være periodiske +XNPV = NETTO.NUTIDSVÆRDI ## Returnerer nutidsværdien for en plan over pengestrømme, der ikke behøver at være periodiske +YIELD = AFKAST ## Returnerer afkastet for et værdipapir med periodiske renteudbetalinger +YIELDDISC = AFKAST.DISKONTO ## Returnerer det årlige afkast for et diskonteret værdipapir, f.eks. en statsobligation +YIELDMAT = AFKAST.UDLØBSDATO ## Returnerer det årlige afkast for et værdipapir, hvor renten udbetales ved papirets udløb + + +## +## Information functions Informationsfunktioner +## +CELL = CELLE ## Returnerer oplysninger om formatering, placering eller indhold af en celle +ERROR.TYPE = FEJLTYPE ## Returnerer et tal, der svarer til en fejltype +INFO = INFO ## Returnerer oplysninger om det aktuelle operativmiljø +ISBLANK = ER.TOM ## Returnerer SAND, hvis værdien er tom +ISERR = ER.FJL ## Returnerer SAND, hvis værdien er en fejlværdi undtagen #I/T +ISERROR = ER.FEJL ## Returnerer SAND, hvis værdien er en fejlværdi +ISEVEN = ER.LIGE ## Returnerer SAND, hvis tallet er lige +ISLOGICAL = ER.LOGISK ## Returnerer SAND, hvis værdien er en logisk værdi +ISNA = ER.IKKE.TILGÆNGELIG ## Returnerer SAND, hvis værdien er fejlværdien #I/T +ISNONTEXT = ER.IKKE.TEKST ## Returnerer SAND, hvis værdien ikke er tekst +ISNUMBER = ER.TAL ## Returnerer SAND, hvis værdien er et tal +ISODD = ER.ULIGE ## Returnerer SAND, hvis tallet er ulige +ISREF = ER.REFERENCE ## Returnerer SAND, hvis værdien er en reference +ISTEXT = ER.TEKST ## Returnerer SAND, hvis værdien er tekst +N = TAL ## Returnerer en værdi konverteret til et tal +NA = IKKE.TILGÆNGELIG ## Returnerer fejlværdien #I/T +TYPE = VÆRDITYPE ## Returnerer et tal, der angiver datatypen for en værdi + + +## +## Logical functions Logiske funktioner +## +AND = OG ## Returnerer SAND, hvis alle argumenterne er sande +FALSE = FALSK ## Returnerer den logiske værdi FALSK +IF = HVIS ## Angiver en logisk test, der skal udføres +IFERROR = HVIS.FEJL ## Returnerer en værdi, du angiver, hvis en formel evauleres som en fejl. Returnerer i modsat fald resultatet af formlen +NOT = IKKE ## Vender argumentets logik om +OR = ELLER ## Returneret værdien SAND, hvis mindst ét argument er sandt +TRUE = SAND ## Returnerer den logiske værdi SAND + + +## +## Lookup and reference functions Opslags- og referencefunktioner +## +ADDRESS = ADRESSE ## Returnerer en reference som tekst til en enkelt celle i et regneark +AREAS = OMRÅDER ## Returnerer antallet af områder i en reference +CHOOSE = VÆLG ## Vælger en værdi på en liste med værdier +COLUMN = KOLONNE ## Returnerer kolonnenummeret i en reference +COLUMNS = KOLONNER ## Returnerer antallet af kolonner i en reference +HLOOKUP = VOPSLAG ## Søger i den øverste række af en matrix og returnerer værdien af den angivne celle +HYPERLINK = HYPERLINK ## Opretter en genvej kaldet et hyperlink, der åbner et dokument, som er lagret på en netværksserver, på et intranet eller på internettet +INDEX = INDEKS ## Anvender et indeks til at vælge en værdi fra en reference eller en matrix +INDIRECT = INDIREKTE ## Returnerer en reference, der er angivet af en tekstværdi +LOOKUP = SLÅ.OP ## Søger værdier i en vektor eller en matrix +MATCH = SAMMENLIGN ## Søger værdier i en reference eller en matrix +OFFSET = FORSKYDNING ## Returnerer en reference forskudt i forhold til en given reference +ROW = RÆKKE ## Returnerer rækkenummeret for en reference +ROWS = RÆKKER ## Returnerer antallet af rækker i en reference +RTD = RTD ## Henter realtidsdata fra et program, der understøtter COM-automatisering (Automation: En metode til at arbejde med objekter fra et andet program eller udviklingsværktøj. Automation, som tidligere blev kaldt OLE Automation, er en industristandard og en funktion i COM (Component Object Model).) +TRANSPOSE = TRANSPONER ## Returnerer en transponeret matrix +VLOOKUP = LOPSLAG ## Søger i øverste række af en matrix og flytter på tværs af rækken for at returnere en celleværdi + + +## +## Math and trigonometry functions Matematiske og trigonometriske funktioner +## +ABS = ABS ## Returnerer den absolutte værdi af et tal +ACOS = ARCCOS ## Returnerer et tals arcus cosinus +ACOSH = ARCCOSH ## Returnerer den inverse hyperbolske cosinus af tal +ASIN = ARCSIN ## Returnerer et tals arcus sinus +ASINH = ARCSINH ## Returnerer den inverse hyperbolske sinus for tal +ATAN = ARCTAN ## Returnerer et tals arcus tangens +ATAN2 = ARCTAN2 ## Returnerer de angivne x- og y-koordinaters arcus tangens +ATANH = ARCTANH ## Returnerer et tals inverse hyperbolske tangens +CEILING = AFRUND.LOFT ## Afrunder et tal til nærmeste heltal eller til nærmeste multiplum af betydning +COMBIN = KOMBIN ## Returnerer antallet af kombinationer for et givet antal objekter +COS = COS ## Returnerer et tals cosinus +COSH = COSH ## Returnerer den inverse hyperbolske cosinus af et tal +DEGREES = GRADER ## Konverterer radianer til grader +EVEN = LIGE ## Runder et tal op til nærmeste lige heltal +EXP = EKSP ## Returnerer e opløftet til en potens af et angivet tal +FACT = FAKULTET ## Returnerer et tals fakultet +FACTDOUBLE = DOBBELT.FAKULTET ## Returnerer et tals dobbelte fakultet +FLOOR = AFRUND.GULV ## Runder et tal ned mod nul +GCD = STØRSTE.FÆLLES.DIVISOR ## Returnerer den største fælles divisor +INT = HELTAL ## Nedrunder et tal til det nærmeste heltal +LCM = MINDSTE.FÆLLES.MULTIPLUM ## Returnerer det mindste fælles multiplum +LN = LN ## Returnerer et tals naturlige logaritme +LOG = LOG ## Returnerer logaritmen for et tal på grundlag af et angivet grundtal +LOG10 = LOG10 ## Returnerer titalslogaritmen af et tal +MDETERM = MDETERM ## Returnerer determinanten for en matrix +MINVERSE = MINVERT ## Returnerer den inverse matrix for en matrix +MMULT = MPRODUKT ## Returnerer matrixproduktet af to matrixer +MOD = REST ## Returnerer restværdien fra division +MROUND = MAFRUND ## Returnerer et tal afrundet til det ønskede multiplum +MULTINOMIAL = MULTINOMIAL ## Returnerer et multinomialt talsæt +ODD = ULIGE ## Runder et tal op til nærmeste ulige heltal +PI = PI ## Returnerer værdien af pi +POWER = POTENS ## Returnerer resultatet af et tal opløftet til en potens +PRODUCT = PRODUKT ## Multiplicerer argumenterne +QUOTIENT = KVOTIENT ## Returnerer heltalsdelen ved division +RADIANS = RADIANER ## Konverterer grader til radianer +RAND = SLUMP ## Returnerer et tilfældigt tal mellem 0 og 1 +RANDBETWEEN = SLUMP.MELLEM ## Returnerer et tilfældigt tal mellem de tal, der angives +ROMAN = ROMERTAL ## Konverterer et arabertal til romertal som tekst +ROUND = AFRUND ## Afrunder et tal til et angivet antal decimaler +ROUNDDOWN = RUND.NED ## Runder et tal ned mod nul +ROUNDUP = RUND.OP ## Runder et tal op, væk fra 0 (nul) +SERIESSUM = SERIESUM ## Returnerer summen af en potensserie baseret på en formel +SIGN = FORTEGN ## Returnerer et tals fortegn +SIN = SIN ## Returnerer en given vinkels sinusværdi +SINH = SINH ## Returnerer den hyperbolske sinus af et tal +SQRT = KVROD ## Returnerer en positiv kvadratrod +SQRTPI = KVRODPI ## Returnerer kvadratroden af (tal * pi;) +SUBTOTAL = SUBTOTAL ## Returnerer en subtotal på en liste eller i en database +SUM = SUM ## Lægger argumenterne sammen +SUMIF = SUM.HVIS ## Lægger de celler sammen, der er specificeret af et givet kriterium. +SUMIFS = SUM.HVISER ## Lægger de celler i et område sammen, der opfylder flere kriterier. +SUMPRODUCT = SUMPRODUKT ## Returnerer summen af produkter af ens matrixkomponenter +SUMSQ = SUMKV ## Returnerer summen af argumenternes kvadrater +SUMX2MY2 = SUMX2MY2 ## Returnerer summen af differensen mellem kvadrater af ens værdier i to matrixer +SUMX2PY2 = SUMX2PY2 ## Returnerer summen af summen af kvadrater af tilsvarende værdier i to matrixer +SUMXMY2 = SUMXMY2 ## Returnerer summen af kvadrater af differenser mellem ens værdier i to matrixer +TAN = TAN ## Returnerer et tals tangens +TANH = TANH ## Returnerer et tals hyperbolske tangens +TRUNC = AFKORT ## Afkorter et tal til et heltal + + +## +## Statistical functions Statistiske funktioner +## +AVEDEV = MAD ## Returnerer den gennemsnitlige numeriske afvigelse fra stikprøvens middelværdi +AVERAGE = MIDDEL ## Returnerer middelværdien af argumenterne +AVERAGEA = MIDDELV ## Returnerer middelværdien af argumenterne og medtager tal, tekst og logiske værdier +AVERAGEIF = MIDDEL.HVIS ## Returnerer gennemsnittet (den aritmetiske middelværdi) af alle de celler, der opfylder et givet kriterium, i et område +AVERAGEIFS = MIDDEL.HVISER ## Returnerer gennemsnittet (den aritmetiske middelværdi) af alle de celler, der opfylder flere kriterier. +BETADIST = BETAFORDELING ## Returnerer den kumulative betafordelingsfunktion +BETAINV = BETAINV ## Returnerer den inverse kumulative fordelingsfunktion for en angivet betafordeling +BINOMDIST = BINOMIALFORDELING ## Returnerer punktsandsynligheden for binomialfordelingen +CHIDIST = CHIFORDELING ## Returnerer fraktilsandsynligheden for en chi2-fordeling +CHIINV = CHIINV ## Returnerer den inverse fraktilsandsynlighed for en chi2-fordeling +CHITEST = CHITEST ## Foretager en test for uafhængighed +CONFIDENCE = KONFIDENSINTERVAL ## Returnerer et konfidensinterval for en population +CORREL = KORRELATION ## Returnerer korrelationskoefficienten mellem to datasæt +COUNT = TÆL ## Tæller antallet af tal på en liste med argumenter +COUNTA = TÆLV ## Tæller antallet af værdier på en liste med argumenter +COUNTBLANK = ANTAL.BLANKE ## Tæller antallet af tomme celler i et område +COUNTIF = TÆLHVIS ## Tæller antallet af celler, som opfylder de givne kriterier, i et område +COUNTIFS = TÆL.HVISER ## Tæller antallet af de celler, som opfylder flere kriterier, i et område +COVAR = KOVARIANS ## Beregner kovariansen mellem to stokastiske variabler +CRITBINOM = KRITBINOM ## Returnerer den mindste værdi for x, for hvilken det gælder, at fordelingsfunktionen er mindre end eller lig med kriterieværdien. +DEVSQ = SAK ## Returnerer summen af de kvadrerede afvigelser fra middelværdien +EXPONDIST = EKSPFORDELING ## Returnerer eksponentialfordelingen +FDIST = FFORDELING ## Returnerer fraktilsandsynligheden for F-fordelingen +FINV = FINV ## Returnerer den inverse fraktilsandsynlighed for F-fordelingen +FISHER = FISHER ## Returnerer Fisher-transformationen +FISHERINV = FISHERINV ## Returnerer den inverse Fisher-transformation +FORECAST = PROGNOSE ## Returnerer en prognoseværdi baseret på lineær tendens +FREQUENCY = FREKVENS ## Returnerer en frekvensfordeling i en søjlevektor +FTEST = FTEST ## Returnerer resultatet af en F-test til sammenligning af varians +GAMMADIST = GAMMAFORDELING ## Returnerer fordelingsfunktionen for gammafordelingen +GAMMAINV = GAMMAINV ## Returnerer den inverse fordelingsfunktion for gammafordelingen +GAMMALN = GAMMALN ## Returnerer den naturlige logaritme til gammafordelingen, G(x) +GEOMEAN = GEOMIDDELVÆRDI ## Returnerer det geometriske gennemsnit +GROWTH = FORØGELSE ## Returnerer værdier langs en eksponentiel tendens +HARMEAN = HARMIDDELVÆRDI ## Returnerer det harmoniske gennemsnit +HYPGEOMDIST = HYPGEOFORDELING ## Returnerer punktsandsynligheden i en hypergeometrisk fordeling +INTERCEPT = SKÆRING ## Returnerer afskæringsværdien på y-aksen i en lineær regression +KURT = TOPSTEJL ## Returnerer kurtosisværdien for en stokastisk variabel +LARGE = STOR ## Returnerer den k'te største værdi i et datasæt +LINEST = LINREGR ## Returnerer parameterestimaterne for en lineær tendens +LOGEST = LOGREGR ## Returnerer parameterestimaterne for en eksponentiel tendens +LOGINV = LOGINV ## Returnerer den inverse fordelingsfunktion for lognormalfordelingen +LOGNORMDIST = LOGNORMFORDELING ## Returnerer fordelingsfunktionen for lognormalfordelingen +MAX = MAKS ## Returnerer den maksimale værdi på en liste med argumenter. +MAXA = MAKSV ## Returnerer den maksimale værdi på en liste med argumenter og medtager tal, tekst og logiske værdier +MEDIAN = MEDIAN ## Returnerer medianen for de angivne tal +MIN = MIN ## Returnerer den mindste værdi på en liste med argumenter. +MINA = MINV ## Returnerer den mindste værdi på en liste med argumenter og medtager tal, tekst og logiske værdier +MODE = HYPPIGST ## Returnerer den hyppigste værdi i et datasæt +NEGBINOMDIST = NEGBINOMFORDELING ## Returnerer den negative binomialfordeling +NORMDIST = NORMFORDELING ## Returnerer fordelingsfunktionen for normalfordelingen +NORMINV = NORMINV ## Returnerer den inverse fordelingsfunktion for normalfordelingen +NORMSDIST = STANDARDNORMFORDELING ## Returnerer fordelingsfunktionen for standardnormalfordelingen +NORMSINV = STANDARDNORMINV ## Returnerer den inverse fordelingsfunktion for standardnormalfordelingen +PEARSON = PEARSON ## Returnerer Pearsons korrelationskoefficient +PERCENTILE = FRAKTIL ## Returnerer den k'te fraktil for datasættet +PERCENTRANK = PROCENTPLADS ## Returnerer den procentuelle rang for en given værdi i et datasæt +PERMUT = PERMUT ## Returnerer antallet af permutationer for et givet sæt objekter +POISSON = POISSON ## Returnerer fordelingsfunktionen for en Poisson-fordeling +PROB = SANDSYNLIGHED ## Returnerer intervalsandsynligheden +QUARTILE = KVARTIL ## Returnerer kvartilen i et givet datasæt +RANK = PLADS ## Returnerer rangen for et tal på en liste med tal +RSQ = FORKLARINGSGRAD ## Returnerer R2-værdien fra en simpel lineær regression +SKEW = SKÆVHED ## Returnerer skævheden for en stokastisk variabel +SLOPE = HÆLDNING ## Returnerer estimatet på hældningen fra en simpel lineær regression +SMALL = MINDSTE ## Returnerer den k'te mindste værdi i datasættet +STANDARDIZE = STANDARDISER ## Returnerer en standardiseret værdi +STDEV = STDAFV ## Estimerer standardafvigelsen på basis af en stikprøve +STDEVA = STDAFVV ## Beregner standardafvigelsen på basis af en prøve og medtager tal, tekst og logiske værdier +STDEVP = STDAFVP ## Beregner standardafvigelsen på basis af en hel population +STDEVPA = STDAFVPV ## Beregner standardafvigelsen på basis af en hel population og medtager tal, tekst og logiske værdier +STEYX = STFYX ## Returnerer standardafvigelsen for de estimerede y-værdier i den simple lineære regression +TDIST = TFORDELING ## Returnerer fordelingsfunktionen for Student's t-fordeling +TINV = TINV ## Returnerer den inverse fordelingsfunktion for Student's t-fordeling +TREND = TENDENS ## Returnerer værdi under antagelse af en lineær tendens +TRIMMEAN = TRIMMIDDELVÆRDI ## Returnerer den trimmede middelværdi for datasættet +TTEST = TTEST ## Returnerer den sandsynlighed, der er forbundet med Student's t-test +VAR = VARIANS ## Beregner variansen på basis af en prøve +VARA = VARIANSV ## Beregner variansen på basis af en prøve og medtager tal, tekst og logiske værdier +VARP = VARIANSP ## Beregner variansen på basis af hele populationen +VARPA = VARIANSPV ## Beregner variansen på basis af hele populationen og medtager tal, tekst og logiske værdier +WEIBULL = WEIBULL ## Returnerer fordelingsfunktionen for Weibull-fordelingen +ZTEST = ZTEST ## Returnerer sandsynlighedsværdien ved en en-sidet z-test + + +## +## Text functions Tekstfunktioner +## +ASC = ASC ## Ændrer engelske tegn i fuld bredde (dobbelt-byte) eller katakana i en tegnstreng til tegn i halv bredde (enkelt-byte) +BAHTTEXT = BAHTTEKST ## Konverterer et tal til tekst ved hjælp af valutaformatet ß (baht) +CHAR = TEGN ## Returnerer det tegn, der svarer til kodenummeret +CLEAN = RENS ## Fjerner alle tegn, der ikke kan udskrives, fra tekst +CODE = KODE ## Returnerer en numerisk kode for det første tegn i en tekststreng +CONCATENATE = SAMMENKÆDNING ## Sammenkæder adskillige tekstelementer til ét tekstelement +DOLLAR = KR ## Konverterer et tal til tekst ved hjælp af valutaformatet kr. (kroner) +EXACT = EKSAKT ## Kontrollerer, om to tekstværdier er identiske +FIND = FIND ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes mellem store og små bogstaver) +FINDB = FINDB ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes mellem store og små bogstaver) +FIXED = FAST ## Formaterer et tal som tekst med et fast antal decimaler +JIS = JIS ## Ændrer engelske tegn i halv bredde (enkelt-byte) eller katakana i en tegnstreng til tegn i fuld bredde (dobbelt-byte) +LEFT = VENSTRE ## Returnerer tegnet længst til venstre i en tekstværdi +LEFTB = VENSTREB ## Returnerer tegnet længst til venstre i en tekstværdi +LEN = LÆNGDE ## Returnerer antallet af tegn i en tekststreng +LENB = LÆNGDEB ## Returnerer antallet af tegn i en tekststreng +LOWER = SMÅ.BOGSTAVER ## Konverterer tekst til små bogstaver +MID = MIDT ## Returnerer et bestemt antal tegn fra en tekststreng fra og med den angivne startposition +MIDB = MIDTB ## Returnerer et bestemt antal tegn fra en tekststreng fra og med den angivne startposition +PHONETIC = FONETISK ## Uddrager de fonetiske (furigana) tegn fra en tekststreng +PROPER = STORT.FORBOGSTAV ## Konverterer første bogstav i hvert ord i teksten til stort bogstav +REPLACE = ERSTAT ## Erstatter tegn i tekst +REPLACEB = ERSTATB ## Erstatter tegn i tekst +REPT = GENTAG ## Gentager tekst et givet antal gange +RIGHT = HØJRE ## Returnerer tegnet længste til højre i en tekstværdi +RIGHTB = HØJREB ## Returnerer tegnet længste til højre i en tekstværdi +SEARCH = SØG ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes ikke mellem store og små bogstaver) +SEARCHB = SØGB ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes ikke mellem store og små bogstaver) +SUBSTITUTE = UDSKIFT ## Udskifter gammel tekst med ny tekst i en tekststreng +T = T ## Konverterer argumenterne til tekst +TEXT = TEKST ## Formaterer et tal og konverterer det til tekst +TRIM = FJERN.OVERFLØDIGE.BLANKE ## Fjerner mellemrum fra tekst +UPPER = STORE.BOGSTAVER ## Konverterer tekst til store bogstaver +VALUE = VÆRDI ## Konverterer et tekstargument til et tal diff --git a/extend/PHPExcel/PHPExcel/locale/de/config b/extend/PHPExcel/PHPExcel/locale/de/config new file mode 100644 index 0000000..aa0228e --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/de/config @@ -0,0 +1,47 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = € + + +## +## Excel Error Codes (For future use) +## +NULL = #NULL! +DIV0 = #DIV/0! +VALUE = #WERT! +REF = #BEZUG! +NAME = #NAME? +NUM = #ZAHL! +NA = #NV diff --git a/extend/PHPExcel/PHPExcel/locale/de/functions b/extend/PHPExcel/PHPExcel/locale/de/functions new file mode 100644 index 0000000..3147f9c --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/de/functions @@ -0,0 +1,438 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Calculation +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ +## +## + + +## +## Add-in and Automation functions Add-In- und Automatisierungsfunktionen +## +GETPIVOTDATA = PIVOTDATENZUORDNEN ## In einem PivotTable-Bericht gespeicherte Daten werden zurückgegeben. + + +## +## Cube functions Cubefunktionen +## +CUBEKPIMEMBER = CUBEKPIELEMENT ## Gibt Name, Eigenschaft und Measure eines Key Performance Indicators (KPI) zurück und zeigt den Namen und die Eigenschaft in der Zelle an. Ein KPI ist ein quantifizierbares Maß, wie z. B. der monatliche Bruttogewinn oder die vierteljährliche Mitarbeiterfluktuation, mit dessen Hilfe das Leistungsverhalten eines Unternehmens überwacht werden kann. +CUBEMEMBER = CUBEELEMENT ## Gibt ein Element oder ein Tuple in einer Cubehierarchie zurück. Wird verwendet, um zu überprüfen, ob das Element oder Tuple im Cube vorhanden ist. +CUBEMEMBERPROPERTY = CUBEELEMENTEIGENSCHAFT ## Gibt den Wert einer Elementeigenschaft im Cube zurück. Wird verwendet, um zu überprüfen, ob ein Elementname im Cube vorhanden ist, und um die für dieses Element angegebene Eigenschaft zurückzugeben. +CUBERANKEDMEMBER = CUBERANGELEMENT ## Gibt das n-te oder n-rangige Element in einer Menge zurück. Wird verwendet, um mindestens ein Element in einer Menge zurückzugeben, wie z. B. bester Vertriebsmitarbeiter oder 10 beste Kursteilnehmer. +CUBESET = CUBEMENGE ## Definiert eine berechnete Menge Elemente oder Tuples durch Senden eines Mengenausdrucks an den Cube auf dem Server, der die Menge erstellt und an Microsoft Office Excel zurückgibt. +CUBESETCOUNT = CUBEMENGENANZAHL ## Gibt die Anzahl der Elemente in einer Menge zurück. +CUBEVALUE = CUBEWERT ## Gibt einen Aggregatwert aus einem Cube zurück. + + +## +## Database functions Datenbankfunktionen +## +DAVERAGE = DBMITTELWERT ## Gibt den Mittelwert der ausgewählten Datenbankeinträge zurück +DCOUNT = DBANZAHL ## Zählt die Zellen mit Zahlen in einer Datenbank +DCOUNTA = DBANZAHL2 ## Zählt nicht leere Zellen in einer Datenbank +DGET = DBAUSZUG ## Extrahiert aus einer Datenbank einen einzelnen Datensatz, der den angegebenen Kriterien entspricht +DMAX = DBMAX ## Gibt den größten Wert aus ausgewählten Datenbankeinträgen zurück +DMIN = DBMIN ## Gibt den kleinsten Wert aus ausgewählten Datenbankeinträgen zurück +DPRODUCT = DBPRODUKT ## Multipliziert die Werte in einem bestimmten Feld mit Datensätzen, die den Kriterien in einer Datenbank entsprechen +DSTDEV = DBSTDABW ## Schätzt die Standardabweichung auf der Grundlage einer Stichprobe aus ausgewählten Datenbankeinträgen +DSTDEVP = DBSTDABWN ## Berechnet die Standardabweichung auf der Grundlage der Grundgesamtheit ausgewählter Datenbankeinträge +DSUM = DBSUMME ## Addiert die Zahlen in der Feldspalte mit Datensätzen in der Datenbank, die den Kriterien entsprechen +DVAR = DBVARIANZ ## Schätzt die Varianz auf der Grundlage ausgewählter Datenbankeinträge +DVARP = DBVARIANZEN ## Berechnet die Varianz auf der Grundlage der Grundgesamtheit ausgewählter Datenbankeinträge + + +## +## Date and time functions Datums- und Zeitfunktionen +## +DATE = DATUM ## Gibt die fortlaufende Zahl eines bestimmten Datums zurück +DATEVALUE = DATWERT ## Wandelt ein Datum in Form von Text in eine fortlaufende Zahl um +DAY = TAG ## Wandelt eine fortlaufende Zahl in den Tag des Monats um +DAYS360 = TAGE360 ## Berechnet die Anzahl der Tage zwischen zwei Datumsangaben ausgehend von einem Jahr, das 360 Tage hat +EDATE = EDATUM ## Gibt die fortlaufende Zahl des Datums zurück, bei dem es sich um die angegebene Anzahl von Monaten vor oder nach dem Anfangstermin handelt +EOMONTH = MONATSENDE ## Gibt die fortlaufende Zahl des letzten Tags des Monats vor oder nach einer festgelegten Anzahl von Monaten zurück +HOUR = STUNDE ## Wandelt eine fortlaufende Zahl in eine Stunde um +MINUTE = MINUTE ## Wandelt eine fortlaufende Zahl in eine Minute um +MONTH = MONAT ## Wandelt eine fortlaufende Zahl in einen Monat um +NETWORKDAYS = NETTOARBEITSTAGE ## Gibt die Anzahl von ganzen Arbeitstagen zwischen zwei Datumswerten zurück +NOW = JETZT ## Gibt die fortlaufende Zahl des aktuellen Datums und der aktuellen Uhrzeit zurück +SECOND = SEKUNDE ## Wandelt eine fortlaufende Zahl in eine Sekunde um +TIME = ZEIT ## Gibt die fortlaufende Zahl einer bestimmten Uhrzeit zurück +TIMEVALUE = ZEITWERT ## Wandelt eine Uhrzeit in Form von Text in eine fortlaufende Zahl um +TODAY = HEUTE ## Gibt die fortlaufende Zahl des heutigen Datums zurück +WEEKDAY = WOCHENTAG ## Wandelt eine fortlaufende Zahl in den Wochentag um +WEEKNUM = KALENDERWOCHE ## Wandelt eine fortlaufende Zahl in eine Zahl um, die angibt, in welche Woche eines Jahres das angegebene Datum fällt +WORKDAY = ARBEITSTAG ## Gibt die fortlaufende Zahl des Datums vor oder nach einer bestimmten Anzahl von Arbeitstagen zurück +YEAR = JAHR ## Wandelt eine fortlaufende Zahl in ein Jahr um +YEARFRAC = BRTEILJAHRE ## Gibt die Anzahl der ganzen Tage zwischen Ausgangsdatum und Enddatum in Bruchteilen von Jahren zurück + + +## +## Engineering functions Konstruktionsfunktionen +## +BESSELI = BESSELI ## Gibt die geänderte Besselfunktion In(x) zurück +BESSELJ = BESSELJ ## Gibt die Besselfunktion Jn(x) zurück +BESSELK = BESSELK ## Gibt die geänderte Besselfunktion Kn(x) zurück +BESSELY = BESSELY ## Gibt die Besselfunktion Yn(x) zurück +BIN2DEC = BININDEZ ## Wandelt eine binäre Zahl (Dualzahl) in eine dezimale Zahl um +BIN2HEX = BININHEX ## Wandelt eine binäre Zahl (Dualzahl) in eine hexadezimale Zahl um +BIN2OCT = BININOKT ## Wandelt eine binäre Zahl (Dualzahl) in eine oktale Zahl um +COMPLEX = KOMPLEXE ## Wandelt den Real- und Imaginärteil in eine komplexe Zahl um +CONVERT = UMWANDELN ## Wandelt eine Zahl von einem Maßsystem in ein anderes um +DEC2BIN = DEZINBIN ## Wandelt eine dezimale Zahl in eine binäre Zahl (Dualzahl) um +DEC2HEX = DEZINHEX ## Wandelt eine dezimale Zahl in eine hexadezimale Zahl um +DEC2OCT = DEZINOKT ## Wandelt eine dezimale Zahl in eine oktale Zahl um +DELTA = DELTA ## Überprüft, ob zwei Werte gleich sind +ERF = GAUSSFEHLER ## Gibt die Gauss'sche Fehlerfunktion zurück +ERFC = GAUSSFKOMPL ## Gibt das Komplement zur Gauss'schen Fehlerfunktion zurück +GESTEP = GGANZZAHL ## Überprüft, ob eine Zahl größer als ein gegebener Schwellenwert ist +HEX2BIN = HEXINBIN ## Wandelt eine hexadezimale Zahl in eine Binärzahl um +HEX2DEC = HEXINDEZ ## Wandelt eine hexadezimale Zahl in eine dezimale Zahl um +HEX2OCT = HEXINOKT ## Wandelt eine hexadezimale Zahl in eine Oktalzahl um +IMABS = IMABS ## Gibt den Absolutbetrag (Modulo) einer komplexen Zahl zurück +IMAGINARY = IMAGINÄRTEIL ## Gibt den Imaginärteil einer komplexen Zahl zurück +IMARGUMENT = IMARGUMENT ## Gibt das Argument Theta zurück, einen Winkel, der als Bogenmaß ausgedrückt wird +IMCONJUGATE = IMKONJUGIERTE ## Gibt die konjugierte komplexe Zahl zu einer komplexen Zahl zurück +IMCOS = IMCOS ## Gibt den Kosinus einer komplexen Zahl zurück +IMDIV = IMDIV ## Gibt den Quotienten zweier komplexer Zahlen zurück +IMEXP = IMEXP ## Gibt die algebraische Form einer in exponentieller Schreibweise vorliegenden komplexen Zahl zurück +IMLN = IMLN ## Gibt den natürlichen Logarithmus einer komplexen Zahl zurück +IMLOG10 = IMLOG10 ## Gibt den Logarithmus einer komplexen Zahl zur Basis 10 zurück +IMLOG2 = IMLOG2 ## Gibt den Logarithmus einer komplexen Zahl zur Basis 2 zurück +IMPOWER = IMAPOTENZ ## Potenziert eine komplexe Zahl mit einer ganzen Zahl +IMPRODUCT = IMPRODUKT ## Gibt das Produkt von komplexen Zahlen zurück +IMREAL = IMREALTEIL ## Gibt den Realteil einer komplexen Zahl zurück +IMSIN = IMSIN ## Gibt den Sinus einer komplexen Zahl zurück +IMSQRT = IMWURZEL ## Gibt die Quadratwurzel einer komplexen Zahl zurück +IMSUB = IMSUB ## Gibt die Differenz zwischen zwei komplexen Zahlen zurück +IMSUM = IMSUMME ## Gibt die Summe von komplexen Zahlen zurück +OCT2BIN = OKTINBIN ## Wandelt eine oktale Zahl in eine binäre Zahl (Dualzahl) um +OCT2DEC = OKTINDEZ ## Wandelt eine oktale Zahl in eine dezimale Zahl um +OCT2HEX = OKTINHEX ## Wandelt eine oktale Zahl in eine hexadezimale Zahl um + + +## +## Financial functions Finanzmathematische Funktionen +## +ACCRINT = AUFGELZINS ## Gibt die aufgelaufenen Zinsen (Stückzinsen) eines Wertpapiers mit periodischen Zinszahlungen zurück +ACCRINTM = AUFGELZINSF ## Gibt die aufgelaufenen Zinsen (Stückzinsen) eines Wertpapiers zurück, die bei Fälligkeit ausgezahlt werden +AMORDEGRC = AMORDEGRK ## Gibt die Abschreibung für die einzelnen Abschreibungszeiträume mithilfe eines Abschreibungskoeffizienten zurück +AMORLINC = AMORLINEARK ## Gibt die Abschreibung für die einzelnen Abschreibungszeiträume zurück +COUPDAYBS = ZINSTERMTAGVA ## Gibt die Anzahl der Tage vom Anfang des Zinstermins bis zum Abrechnungstermin zurück +COUPDAYS = ZINSTERMTAGE ## Gibt die Anzahl der Tage der Zinsperiode zurück, die den Abrechnungstermin einschließt +COUPDAYSNC = ZINSTERMTAGNZ ## Gibt die Anzahl der Tage vom Abrechnungstermin bis zum nächsten Zinstermin zurück +COUPNCD = ZINSTERMNZ ## Gibt das Datum des ersten Zinstermins nach dem Abrechnungstermin zurück +COUPNUM = ZINSTERMZAHL ## Gibt die Anzahl der Zinstermine zwischen Abrechnungs- und Fälligkeitsdatum zurück +COUPPCD = ZINSTERMVZ ## Gibt das Datum des letzten Zinstermins vor dem Abrechnungstermin zurück +CUMIPMT = KUMZINSZ ## Berechnet die kumulierten Zinsen, die zwischen zwei Perioden zu zahlen sind +CUMPRINC = KUMKAPITAL ## Berechnet die aufgelaufene Tilgung eines Darlehens, die zwischen zwei Perioden zu zahlen ist +DB = GDA2 ## Gibt die geometrisch-degressive Abschreibung eines Wirtschaftsguts für eine bestimmte Periode zurück +DDB = GDA ## Gibt die Abschreibung eines Anlageguts für einen angegebenen Zeitraum unter Verwendung der degressiven Doppelraten-Abschreibung oder eines anderen von Ihnen angegebenen Abschreibungsverfahrens zurück +DISC = DISAGIO ## Gibt den in Prozent ausgedrückten Abzinsungssatz eines Wertpapiers zurück +DOLLARDE = NOTIERUNGDEZ ## Wandelt eine Notierung, die als Dezimalbruch ausgedrückt wurde, in eine Dezimalzahl um +DOLLARFR = NOTIERUNGBRU ## Wandelt eine Notierung, die als Dezimalzahl ausgedrückt wurde, in einen Dezimalbruch um +DURATION = DURATION ## Gibt die jährliche Duration eines Wertpapiers mit periodischen Zinszahlungen zurück +EFFECT = EFFEKTIV ## Gibt die jährliche Effektivverzinsung zurück +FV = ZW ## Gibt den zukünftigen Wert (Endwert) einer Investition zurück +FVSCHEDULE = ZW2 ## Gibt den aufgezinsten Wert des Anfangskapitals für eine Reihe periodisch unterschiedlicher Zinssätze zurück +INTRATE = ZINSSATZ ## Gibt den Zinssatz eines voll investierten Wertpapiers zurück +IPMT = ZINSZ ## Gibt die Zinszahlung einer Investition für die angegebene Periode zurück +IRR = IKV ## Gibt den internen Zinsfuß einer Investition ohne Finanzierungskosten oder Reinvestitionsgewinne zurück +ISPMT = ISPMT ## Berechnet die während eines bestimmten Zeitraums für eine Investition gezahlten Zinsen +MDURATION = MDURATION ## Gibt die geänderte Dauer für ein Wertpapier mit einem angenommenen Nennwert von 100 € zurück +MIRR = QIKV ## Gibt den internen Zinsfuß zurück, wobei positive und negative Zahlungen zu unterschiedlichen Sätzen finanziert werden +NOMINAL = NOMINAL ## Gibt die jährliche Nominalverzinsung zurück +NPER = ZZR ## Gibt die Anzahl der Zahlungsperioden einer Investition zurück +NPV = NBW ## Gibt den Nettobarwert einer Investition auf Basis periodisch anfallender Zahlungen und eines Abzinsungsfaktors zurück +ODDFPRICE = UNREGER.KURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers mit einem unregelmäßigen ersten Zinstermin zurück +ODDFYIELD = UNREGER.REND ## Gibt die Rendite eines Wertpapiers mit einem unregelmäßigen ersten Zinstermin zurück +ODDLPRICE = UNREGLE.KURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers mit einem unregelmäßigen letzten Zinstermin zurück +ODDLYIELD = UNREGLE.REND ## Gibt die Rendite eines Wertpapiers mit einem unregelmäßigen letzten Zinstermin zurück +PMT = RMZ ## Gibt die periodische Zahlung für eine Annuität zurück +PPMT = KAPZ ## Gibt die Kapitalrückzahlung einer Investition für eine angegebene Periode zurück +PRICE = KURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers zurück, das periodisch Zinsen auszahlt +PRICEDISC = KURSDISAGIO ## Gibt den Kurs pro 100 € Nennwert eines unverzinslichen Wertpapiers zurück +PRICEMAT = KURSFÄLLIG ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers zurück, das Zinsen am Fälligkeitsdatum auszahlt +PV = BW ## Gibt den Barwert einer Investition zurück +RATE = ZINS ## Gibt den Zinssatz pro Zeitraum einer Annuität zurück +RECEIVED = AUSZAHLUNG ## Gibt den Auszahlungsbetrag eines voll investierten Wertpapiers am Fälligkeitstermin zurück +SLN = LIA ## Gibt die lineare Abschreibung eines Wirtschaftsguts pro Periode zurück +SYD = DIA ## Gibt die arithmetisch-degressive Abschreibung eines Wirtschaftsguts für eine bestimmte Periode zurück +TBILLEQ = TBILLÄQUIV ## Gibt die Rendite für ein Wertpapier zurück +TBILLPRICE = TBILLKURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers zurück +TBILLYIELD = TBILLRENDITE ## Gibt die Rendite für ein Wertpapier zurück +VDB = VDB ## Gibt die degressive Abschreibung eines Wirtschaftsguts für eine bestimmte Periode oder Teilperiode zurück +XIRR = XINTZINSFUSS ## Gibt den internen Zinsfuß einer Reihe nicht periodisch anfallender Zahlungen zurück +XNPV = XKAPITALWERT ## Gibt den Nettobarwert (Kapitalwert) einer Reihe nicht periodisch anfallender Zahlungen zurück +YIELD = RENDITE ## Gibt die Rendite eines Wertpapiers zurück, das periodisch Zinsen auszahlt +YIELDDISC = RENDITEDIS ## Gibt die jährliche Rendite eines unverzinslichen Wertpapiers zurück +YIELDMAT = RENDITEFÄLL ## Gibt die jährliche Rendite eines Wertpapiers zurück, das Zinsen am Fälligkeitsdatum auszahlt + + +## +## Information functions Informationsfunktionen +## +CELL = ZELLE ## Gibt Informationen zu Formatierung, Position oder Inhalt einer Zelle zurück +ERROR.TYPE = FEHLER.TYP ## Gibt eine Zahl zurück, die einem Fehlertyp entspricht +INFO = INFO ## Gibt Informationen zur aktuellen Betriebssystemumgebung zurück +ISBLANK = ISTLEER ## Gibt WAHR zurück, wenn der Wert leer ist +ISERR = ISTFEHL ## Gibt WAHR zurück, wenn der Wert ein beliebiger Fehlerwert außer #N/V ist +ISERROR = ISTFEHLER ## Gibt WAHR zurück, wenn der Wert ein beliebiger Fehlerwert ist +ISEVEN = ISTGERADE ## Gibt WAHR zurück, wenn es sich um eine gerade Zahl handelt +ISLOGICAL = ISTLOG ## Gibt WAHR zurück, wenn der Wert ein Wahrheitswert ist +ISNA = ISTNV ## Gibt WAHR zurück, wenn der Wert der Fehlerwert #N/V ist +ISNONTEXT = ISTKTEXT ## Gibt WAHR zurück, wenn der Wert ein Element ist, das keinen Text enthält +ISNUMBER = ISTZAHL ## Gibt WAHR zurück, wenn der Wert eine Zahl ist +ISODD = ISTUNGERADE ## Gibt WAHR zurück, wenn es sich um eine ungerade Zahl handelt +ISREF = ISTBEZUG ## Gibt WAHR zurück, wenn der Wert ein Bezug ist +ISTEXT = ISTTEXT ## Gibt WAHR zurück, wenn der Wert ein Element ist, das Text enthält +N = N ## Gibt den in eine Zahl umgewandelten Wert zurück +NA = NV ## Gibt den Fehlerwert #NV zurück +TYPE = TYP ## Gibt eine Zahl zurück, die den Datentyp des angegebenen Werts anzeigt + + +## +## Logical functions Logische Funktionen +## +AND = UND ## Gibt WAHR zurück, wenn alle zugehörigen Argumente WAHR sind +FALSE = FALSCH ## Gibt den Wahrheitswert FALSCH zurück +IF = WENN ## Gibt einen logischen Test zum Ausführen an +IFERROR = WENNFEHLER ## Gibt einen von Ihnen festgelegten Wert zurück, wenn die Auswertung der Formel zu einem Fehler führt; andernfalls wird das Ergebnis der Formel zurückgegeben +NOT = NICHT ## Kehrt den Wahrheitswert der zugehörigen Argumente um +OR = ODER ## Gibt WAHR zurück, wenn ein Argument WAHR ist +TRUE = WAHR ## Gibt den Wahrheitswert WAHR zurück + + +## +## Lookup and reference functions Nachschlage- und Verweisfunktionen +## +ADDRESS = ADRESSE ## Gibt einen Bezug auf eine einzelne Zelle in einem Tabellenblatt als Text zurück +AREAS = BEREICHE ## Gibt die Anzahl der innerhalb eines Bezugs aufgeführten Bereiche zurück +CHOOSE = WAHL ## Wählt einen Wert aus eine Liste mit Werten aus +COLUMN = SPALTE ## Gibt die Spaltennummer eines Bezugs zurück +COLUMNS = SPALTEN ## Gibt die Anzahl der Spalten in einem Bezug zurück +HLOOKUP = HVERWEIS ## Sucht in der obersten Zeile einer Matrix und gibt den Wert der angegebenen Zelle zurück +HYPERLINK = HYPERLINK ## Erstellt eine Verknüpfung, über die ein auf einem Netzwerkserver, in einem Intranet oder im Internet gespeichertes Dokument geöffnet wird +INDEX = INDEX ## Verwendet einen Index, um einen Wert aus einem Bezug oder einer Matrix auszuwählen +INDIRECT = INDIREKT ## Gibt einen Bezug zurück, der von einem Textwert angegeben wird +LOOKUP = LOOKUP ## Sucht Werte in einem Vektor oder einer Matrix +MATCH = VERGLEICH ## Sucht Werte in einem Bezug oder einer Matrix +OFFSET = BEREICH.VERSCHIEBEN ## Gibt einen Bezugoffset aus einem gegebenen Bezug zurück +ROW = ZEILE ## Gibt die Zeilennummer eines Bezugs zurück +ROWS = ZEILEN ## Gibt die Anzahl der Zeilen in einem Bezug zurück +RTD = RTD ## Ruft Echtzeitdaten von einem Programm ab, das die COM-Automatisierung (Automatisierung: Ein Verfahren, bei dem aus einer Anwendung oder einem Entwicklungstool heraus mit den Objekten einer anderen Anwendung gearbeitet wird. Die früher als OLE-Automatisierung bezeichnete Automatisierung ist ein Industriestandard und eine Funktion von COM (Component Object Model).) unterstützt +TRANSPOSE = MTRANS ## Gibt die transponierte Matrix einer Matrix zurück +VLOOKUP = SVERWEIS ## Sucht in der ersten Spalte einer Matrix und arbeitet sich durch die Zeile, um den Wert einer Zelle zurückzugeben + + +## +## Math and trigonometry functions Mathematische und trigonometrische Funktionen +## +ABS = ABS ## Gibt den Absolutwert einer Zahl zurück +ACOS = ARCCOS ## Gibt den Arkuskosinus einer Zahl zurück +ACOSH = ARCCOSHYP ## Gibt den umgekehrten hyperbolischen Kosinus einer Zahl zurück +ASIN = ARCSIN ## Gibt den Arkussinus einer Zahl zurück +ASINH = ARCSINHYP ## Gibt den umgekehrten hyperbolischen Sinus einer Zahl zurück +ATAN = ARCTAN ## Gibt den Arkustangens einer Zahl zurück +ATAN2 = ARCTAN2 ## Gibt den Arkustangens einer x- und einer y-Koordinate zurück +ATANH = ARCTANHYP ## Gibt den umgekehrten hyperbolischen Tangens einer Zahl zurück +CEILING = OBERGRENZE ## Rundet eine Zahl auf die nächste ganze Zahl oder das nächste Vielfache von Schritt +COMBIN = KOMBINATIONEN ## Gibt die Anzahl der Kombinationen für eine bestimmte Anzahl von Objekten zurück +COS = COS ## Gibt den Kosinus einer Zahl zurück +COSH = COSHYP ## Gibt den hyperbolischen Kosinus einer Zahl zurück +DEGREES = GRAD ## Wandelt Bogenmaß (Radiant) in Grad um +EVEN = GERADE ## Rundet eine Zahl auf die nächste gerade ganze Zahl auf +EXP = EXP ## Potenziert die Basis e mit der als Argument angegebenen Zahl +FACT = FAKULTÄT ## Gibt die Fakultät einer Zahl zurück +FACTDOUBLE = ZWEIFAKULTÄT ## Gibt die Fakultät zu Zahl mit Schrittlänge 2 zurück +FLOOR = UNTERGRENZE ## Rundet die Zahl auf Anzahl_Stellen ab +GCD = GGT ## Gibt den größten gemeinsamen Teiler zurück +INT = GANZZAHL ## Rundet eine Zahl auf die nächstkleinere ganze Zahl ab +LCM = KGV ## Gibt das kleinste gemeinsame Vielfache zurück +LN = LN ## Gibt den natürlichen Logarithmus einer Zahl zurück +LOG = LOG ## Gibt den Logarithmus einer Zahl zu der angegebenen Basis zurück +LOG10 = LOG10 ## Gibt den Logarithmus einer Zahl zur Basis 10 zurück +MDETERM = MDET ## Gibt die Determinante einer Matrix zurück +MINVERSE = MINV ## Gibt die inverse Matrix einer Matrix zurück +MMULT = MMULT ## Gibt das Produkt zweier Matrizen zurück +MOD = REST ## Gibt den Rest einer Division zurück +MROUND = VRUNDEN ## Gibt eine auf das gewünschte Vielfache gerundete Zahl zurück +MULTINOMIAL = POLYNOMIAL ## Gibt den Polynomialkoeffizienten einer Gruppe von Zahlen zurück +ODD = UNGERADE ## Rundet eine Zahl auf die nächste ungerade ganze Zahl auf +PI = PI ## Gibt den Wert Pi zurück +POWER = POTENZ ## Gibt als Ergebnis eine potenzierte Zahl zurück +PRODUCT = PRODUKT ## Multipliziert die zugehörigen Argumente +QUOTIENT = QUOTIENT ## Gibt den ganzzahligen Anteil einer Division zurück +RADIANS = BOGENMASS ## Wandelt Grad in Bogenmaß (Radiant) um +RAND = ZUFALLSZAHL ## Gibt eine Zufallszahl zwischen 0 und 1 zurück +RANDBETWEEN = ZUFALLSBEREICH ## Gibt eine Zufallszahl aus dem festgelegten Bereich zurück +ROMAN = RÖMISCH ## Wandelt eine arabische Zahl in eine römische Zahl als Text um +ROUND = RUNDEN ## Rundet eine Zahl auf eine bestimmte Anzahl von Dezimalstellen +ROUNDDOWN = ABRUNDEN ## Rundet die Zahl auf Anzahl_Stellen ab +ROUNDUP = AUFRUNDEN ## Rundet die Zahl auf Anzahl_Stellen auf +SERIESSUM = POTENZREIHE ## Gibt die Summe von Potenzen (zur Berechnung von Potenzreihen und dichotomen Wahrscheinlichkeiten) zurück +SIGN = VORZEICHEN ## Gibt das Vorzeichen einer Zahl zurück +SIN = SIN ## Gibt den Sinus einer Zahl zurück +SINH = SINHYP ## Gibt den hyperbolischen Sinus einer Zahl zurück +SQRT = WURZEL ## Gibt die Quadratwurzel einer Zahl zurück +SQRTPI = WURZELPI ## Gibt die Wurzel aus der mit Pi (pi) multiplizierten Zahl zurück +SUBTOTAL = TEILERGEBNIS ## Gibt ein Teilergebnis in einer Liste oder Datenbank zurück +SUM = SUMME ## Addiert die zugehörigen Argumente +SUMIF = SUMMEWENN ## Addiert Zahlen, die mit den Suchkriterien übereinstimmen +SUMIFS = SUMMEWENNS ## Die Zellen, die mehrere Kriterien erfüllen, werden in einem Bereich hinzugefügt +SUMPRODUCT = SUMMENPRODUKT ## Gibt die Summe der Produkte zusammengehöriger Matrixkomponenten zurück +SUMSQ = QUADRATESUMME ## Gibt die Summe der quadrierten Argumente zurück +SUMX2MY2 = SUMMEX2MY2 ## Gibt die Summe der Differenzen der Quadrate für zusammengehörige Komponenten zweier Matrizen zurück +SUMX2PY2 = SUMMEX2PY2 ## Gibt die Summe der Quadrate für zusammengehörige Komponenten zweier Matrizen zurück +SUMXMY2 = SUMMEXMY2 ## Gibt die Summe der quadrierten Differenzen für zusammengehörige Komponenten zweier Matrizen zurück +TAN = TAN ## Gibt den Tangens einer Zahl zurück +TANH = TANHYP ## Gibt den hyperbolischen Tangens einer Zahl zurück +TRUNC = KÜRZEN ## Schneidet die Kommastellen einer Zahl ab und gibt als Ergebnis eine ganze Zahl zurück + + +## +## Statistical functions Statistische Funktionen +## +AVEDEV = MITTELABW ## Gibt die durchschnittliche absolute Abweichung einer Reihe von Merkmalsausprägungen und ihrem Mittelwert zurück +AVERAGE = MITTELWERT ## Gibt den Mittelwert der zugehörigen Argumente zurück +AVERAGEA = MITTELWERTA ## Gibt den Mittelwert der zugehörigen Argumente, die Zahlen, Text und Wahrheitswerte enthalten, zurück +AVERAGEIF = MITTELWERTWENN ## Der Durchschnittswert (arithmetisches Mittel) für alle Zellen in einem Bereich, die einem angegebenen Kriterium entsprechen, wird zurückgegeben +AVERAGEIFS = MITTELWERTWENNS ## Gibt den Durchschnittswert (arithmetisches Mittel) aller Zellen zurück, die mehreren Kriterien entsprechen +BETADIST = BETAVERT ## Gibt die Werte der kumulierten Betaverteilungsfunktion zurück +BETAINV = BETAINV ## Gibt das Quantil der angegebenen Betaverteilung zurück +BINOMDIST = BINOMVERT ## Gibt Wahrscheinlichkeiten einer binomialverteilten Zufallsvariablen zurück +CHIDIST = CHIVERT ## Gibt Werte der Verteilungsfunktion (1-Alpha) einer Chi-Quadrat-verteilten Zufallsgröße zurück +CHIINV = CHIINV ## Gibt Quantile der Verteilungsfunktion (1-Alpha) der Chi-Quadrat-Verteilung zurück +CHITEST = CHITEST ## Gibt die Teststatistik eines Unabhängigkeitstests zurück +CONFIDENCE = KONFIDENZ ## Ermöglicht die Berechnung des 1-Alpha Konfidenzintervalls für den Erwartungswert einer Zufallsvariablen +CORREL = KORREL ## Gibt den Korrelationskoeffizienten zweier Reihen von Merkmalsausprägungen zurück +COUNT = ANZAHL ## Gibt die Anzahl der Zahlen in der Liste mit Argumenten an +COUNTA = ANZAHL2 ## Gibt die Anzahl der Werte in der Liste mit Argumenten an +COUNTBLANK = ANZAHLLEEREZELLEN ## Gibt die Anzahl der leeren Zellen in einem Bereich an +COUNTIF = ZÄHLENWENN ## Gibt die Anzahl der Zellen in einem Bereich an, deren Inhalte mit den Suchkriterien übereinstimmen +COUNTIFS = ZÄHLENWENNS ## Gibt die Anzahl der Zellen in einem Bereich an, deren Inhalte mit mehreren Suchkriterien übereinstimmen +COVAR = KOVAR ## Gibt die Kovarianz zurück, den Mittelwert der für alle Datenpunktpaare gebildeten Produkte der Abweichungen +CRITBINOM = KRITBINOM ## Gibt den kleinsten Wert zurück, für den die kumulierten Wahrscheinlichkeiten der Binomialverteilung kleiner oder gleich einer Grenzwahrscheinlichkeit sind +DEVSQ = SUMQUADABW ## Gibt die Summe der quadrierten Abweichungen der Datenpunkte von ihrem Stichprobenmittelwert zurück +EXPONDIST = EXPONVERT ## Gibt Wahrscheinlichkeiten einer exponential verteilten Zufallsvariablen zurück +FDIST = FVERT ## Gibt Werte der Verteilungsfunktion (1-Alpha) einer F-verteilten Zufallsvariablen zurück +FINV = FINV ## Gibt Quantile der F-Verteilung zurück +FISHER = FISHER ## Gibt die Fisher-Transformation zurück +FISHERINV = FISHERINV ## Gibt die Umkehrung der Fisher-Transformation zurück +FORECAST = PROGNOSE ## Gibt einen Wert zurück, der sich aus einem linearen Trend ergibt +FREQUENCY = HÄUFIGKEIT ## Gibt eine Häufigkeitsverteilung als vertikale Matrix zurück +FTEST = FTEST ## Gibt die Teststatistik eines F-Tests zurück +GAMMADIST = GAMMAVERT ## Gibt Wahrscheinlichkeiten einer gammaverteilten Zufallsvariablen zurück +GAMMAINV = GAMMAINV ## Gibt Quantile der Gammaverteilung zurück +GAMMALN = GAMMALN ## Gibt den natürlichen Logarithmus der Gammafunktion zurück, Γ(x) +GEOMEAN = GEOMITTEL ## Gibt das geometrische Mittel zurück +GROWTH = VARIATION ## Gibt Werte zurück, die sich aus einem exponentiellen Trend ergeben +HARMEAN = HARMITTEL ## Gibt das harmonische Mittel zurück +HYPGEOMDIST = HYPGEOMVERT ## Gibt Wahrscheinlichkeiten einer hypergeometrisch-verteilten Zufallsvariablen zurück +INTERCEPT = ACHSENABSCHNITT ## Gibt den Schnittpunkt der Regressionsgeraden zurück +KURT = KURT ## Gibt die Kurtosis (Exzess) einer Datengruppe zurück +LARGE = KGRÖSSTE ## Gibt den k-größten Wert einer Datengruppe zurück +LINEST = RGP ## Gibt die Parameter eines linearen Trends zurück +LOGEST = RKP ## Gibt die Parameter eines exponentiellen Trends zurück +LOGINV = LOGINV ## Gibt Quantile der Lognormalverteilung zurück +LOGNORMDIST = LOGNORMVERT ## Gibt Werte der Verteilungsfunktion einer lognormalverteilten Zufallsvariablen zurück +MAX = MAX ## Gibt den Maximalwert einer Liste mit Argumenten zurück +MAXA = MAXA ## Gibt den Maximalwert einer Liste mit Argumenten zurück, die Zahlen, Text und Wahrheitswerte enthalten +MEDIAN = MEDIAN ## Gibt den Median der angegebenen Zahlen zurück +MIN = MIN ## Gibt den Minimalwert einer Liste mit Argumenten zurück +MINA = MINA ## Gibt den kleinsten Wert einer Liste mit Argumenten zurück, die Zahlen, Text und Wahrheitswerte enthalten +MODE = MODALWERT ## Gibt den am häufigsten vorkommenden Wert in einer Datengruppe zurück +NEGBINOMDIST = NEGBINOMVERT ## Gibt Wahrscheinlichkeiten einer negativen, binominal verteilten Zufallsvariablen zurück +NORMDIST = NORMVERT ## Gibt Wahrscheinlichkeiten einer normal verteilten Zufallsvariablen zurück +NORMINV = NORMINV ## Gibt Quantile der Normalverteilung zurück +NORMSDIST = STANDNORMVERT ## Gibt Werte der Verteilungsfunktion einer standardnormalverteilten Zufallsvariablen zurück +NORMSINV = STANDNORMINV ## Gibt Quantile der Standardnormalverteilung zurück +PEARSON = PEARSON ## Gibt den Pearsonschen Korrelationskoeffizienten zurück +PERCENTILE = QUANTIL ## Gibt das Alpha-Quantil einer Gruppe von Daten zurück +PERCENTRANK = QUANTILSRANG ## Gibt den prozentualen Rang (Alpha) eines Werts in einer Datengruppe zurück +PERMUT = VARIATIONEN ## Gibt die Anzahl der Möglichkeiten zurück, um k Elemente aus einer Menge von n Elementen ohne Zurücklegen zu ziehen +POISSON = POISSON ## Gibt Wahrscheinlichkeiten einer poissonverteilten Zufallsvariablen zurück +PROB = WAHRSCHBEREICH ## Gibt die Wahrscheinlichkeit für ein von zwei Werten eingeschlossenes Intervall zurück +QUARTILE = QUARTILE ## Gibt die Quartile der Datengruppe zurück +RANK = RANG ## Gibt den Rang zurück, den eine Zahl innerhalb einer Liste von Zahlen einnimmt +RSQ = BESTIMMTHEITSMASS ## Gibt das Quadrat des Pearsonschen Korrelationskoeffizienten zurück +SKEW = SCHIEFE ## Gibt die Schiefe einer Verteilung zurück +SLOPE = STEIGUNG ## Gibt die Steigung der Regressionsgeraden zurück +SMALL = KKLEINSTE ## Gibt den k-kleinsten Wert einer Datengruppe zurück +STANDARDIZE = STANDARDISIERUNG ## Gibt den standardisierten Wert zurück +STDEV = STABW ## Schätzt die Standardabweichung ausgehend von einer Stichprobe +STDEVA = STABWA ## Schätzt die Standardabweichung ausgehend von einer Stichprobe, die Zahlen, Text und Wahrheitswerte enthält +STDEVP = STABWN ## Berechnet die Standardabweichung ausgehend von der Grundgesamtheit +STDEVPA = STABWNA ## Berechnet die Standardabweichung ausgehend von der Grundgesamtheit, die Zahlen, Text und Wahrheitswerte enthält +STEYX = STFEHLERYX ## Gibt den Standardfehler der geschätzten y-Werte für alle x-Werte der Regression zurück +TDIST = TVERT ## Gibt Werte der Verteilungsfunktion (1-Alpha) einer (Student) t-verteilten Zufallsvariablen zurück +TINV = TINV ## Gibt Quantile der t-Verteilung zurück +TREND = TREND ## Gibt Werte zurück, die sich aus einem linearen Trend ergeben +TRIMMEAN = GESTUTZTMITTEL ## Gibt den Mittelwert einer Datengruppe zurück, ohne die Randwerte zu berücksichtigen +TTEST = TTEST ## Gibt die Teststatistik eines Student'schen t-Tests zurück +VAR = VARIANZ ## Schätzt die Varianz ausgehend von einer Stichprobe +VARA = VARIANZA ## Schätzt die Varianz ausgehend von einer Stichprobe, die Zahlen, Text und Wahrheitswerte enthält +VARP = VARIANZEN ## Berechnet die Varianz ausgehend von der Grundgesamtheit +VARPA = VARIANZENA ## Berechnet die Varianz ausgehend von der Grundgesamtheit, die Zahlen, Text und Wahrheitswerte enthält +WEIBULL = WEIBULL ## Gibt Wahrscheinlichkeiten einer weibullverteilten Zufallsvariablen zurück +ZTEST = GTEST ## Gibt den einseitigen Wahrscheinlichkeitswert für einen Gausstest (Normalverteilung) zurück + + +## +## Text functions Textfunktionen +## +ASC = ASC ## Konvertiert DB-Text in einer Zeichenfolge (lateinische Buchstaben oder Katakana) in SB-Text +BAHTTEXT = BAHTTEXT ## Wandelt eine Zahl in Text im Währungsformat ß (Baht) um +CHAR = ZEICHEN ## Gibt das der Codezahl entsprechende Zeichen zurück +CLEAN = SÄUBERN ## Löscht alle nicht druckbaren Zeichen aus einem Text +CODE = CODE ## Gibt die Codezahl des ersten Zeichens in einem Text zurück +CONCATENATE = VERKETTEN ## Verknüpft mehrere Textelemente zu einem Textelement +DOLLAR = DM ## Wandelt eine Zahl in Text im Währungsformat € (Euro) um +EXACT = IDENTISCH ## Prüft, ob zwei Textwerte identisch sind +FIND = FINDEN ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird unterschieden) +FINDB = FINDENB ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird unterschieden) +FIXED = FEST ## Formatiert eine Zahl als Text mit einer festen Anzahl von Dezimalstellen +JIS = JIS ## Konvertiert SB-Text in einer Zeichenfolge (lateinische Buchstaben oder Katakana) in DB-Text +LEFT = LINKS ## Gibt die Zeichen ganz links in einem Textwert zurück +LEFTB = LINKSB ## Gibt die Zeichen ganz links in einem Textwert zurück +LEN = LÄNGE ## Gibt die Anzahl der Zeichen in einer Zeichenfolge zurück +LENB = LÄNGEB ## Gibt die Anzahl der Zeichen in einer Zeichenfolge zurück +LOWER = KLEIN ## Wandelt Text in Kleinbuchstaben um +MID = TEIL ## Gibt eine bestimmte Anzahl Zeichen aus einer Zeichenfolge ab der von Ihnen angegebenen Stelle zurück +MIDB = TEILB ## Gibt eine bestimmte Anzahl Zeichen aus einer Zeichenfolge ab der von Ihnen angegebenen Stelle zurück +PHONETIC = PHONETIC ## Extrahiert die phonetischen (Furigana-)Zeichen aus einer Textzeichenfolge +PROPER = GROSS2 ## Wandelt den ersten Buchstaben aller Wörter eines Textwerts in Großbuchstaben um +REPLACE = ERSETZEN ## Ersetzt Zeichen in Text +REPLACEB = ERSETZENB ## Ersetzt Zeichen in Text +REPT = WIEDERHOLEN ## Wiederholt einen Text so oft wie angegeben +RIGHT = RECHTS ## Gibt die Zeichen ganz rechts in einem Textwert zurück +RIGHTB = RECHTSB ## Gibt die Zeichen ganz rechts in einem Textwert zurück +SEARCH = SUCHEN ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird nicht unterschieden) +SEARCHB = SUCHENB ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird nicht unterschieden) +SUBSTITUTE = WECHSELN ## Ersetzt in einer Zeichenfolge neuen Text gegen alten +T = T ## Wandelt die zugehörigen Argumente in Text um +TEXT = TEXT ## Formatiert eine Zahl und wandelt sie in Text um +TRIM = GLÄTTEN ## Entfernt Leerzeichen aus Text +UPPER = GROSS ## Wandelt Text in Großbuchstaben um +VALUE = WERT ## Wandelt ein Textargument in eine Zahl um diff --git a/extend/PHPExcel/PHPExcel/locale/en/uk/config b/extend/PHPExcel/PHPExcel/locale/en/uk/config new file mode 100644 index 0000000..532080b --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/en/uk/config @@ -0,0 +1,32 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +## +## (For future use) +## +currencySymbol = £ diff --git a/extend/PHPExcel/PHPExcel/locale/es/config b/extend/PHPExcel/PHPExcel/locale/es/config new file mode 100644 index 0000000..96cfa69 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/es/config @@ -0,0 +1,47 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = $ ## I'm surprised that the Excel Documentation suggests $ rather than € + + +## +## Excel Error Codes (For future use) +## +NULL = #¡NULO! +DIV0 = #¡DIV/0! +VALUE = #¡VALOR! +REF = #¡REF! +NAME = #¿NOMBRE? +NUM = #¡NÚM! +NA = #N/A diff --git a/extend/PHPExcel/PHPExcel/locale/es/functions b/extend/PHPExcel/PHPExcel/locale/es/functions new file mode 100644 index 0000000..4876269 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/es/functions @@ -0,0 +1,438 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Calculation +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ +## +## + + +## +## Add-in and Automation functions Funciones de complementos y automatización +## +GETPIVOTDATA = IMPORTARDATOSDINAMICOS ## Devuelve los datos almacenados en un informe de tabla dinámica. + + +## +## Cube functions Funciones de cubo +## +CUBEKPIMEMBER = MIEMBROKPICUBO ## Devuelve un nombre, propiedad y medida de indicador de rendimiento clave (KPI) y muestra el nombre y la propiedad en la celda. Un KPI es una medida cuantificable, como los beneficios brutos mensuales o la facturación trimestral por empleado, que se usa para supervisar el rendimiento de una organización. +CUBEMEMBER = MIEMBROCUBO ## Devuelve un miembro o tupla en una jerarquía de cubo. Se usa para validar la existencia del miembro o la tupla en el cubo. +CUBEMEMBERPROPERTY = PROPIEDADMIEMBROCUBO ## Devuelve el valor de una propiedad de miembro del cubo Se usa para validar la existencia de un nombre de miembro en el cubo y para devolver la propiedad especificada para este miembro. +CUBERANKEDMEMBER = MIEMBRORANGOCUBO ## Devuelve el miembro n, o clasificado, de un conjunto. Se usa para devolver uno o más elementos de un conjunto, por ejemplo, el representante con mejores ventas o los diez mejores alumnos. +CUBESET = CONJUNTOCUBO ## Define un conjunto calculado de miembros o tuplas mediante el envío de una expresión de conjunto al cubo en el servidor, lo que crea el conjunto y, después, devuelve dicho conjunto a Microsoft Office Excel. +CUBESETCOUNT = RECUENTOCONJUNTOCUBO ## Devuelve el número de elementos de un conjunto. +CUBEVALUE = VALORCUBO ## Devuelve un valor agregado de un cubo. + + +## +## Database functions Funciones de base de datos +## +DAVERAGE = BDPROMEDIO ## Devuelve el promedio de las entradas seleccionadas en la base de datos. +DCOUNT = BDCONTAR ## Cuenta el número de celdas que contienen números en una base de datos. +DCOUNTA = BDCONTARA ## Cuenta el número de celdas no vacías en una base de datos. +DGET = BDEXTRAER ## Extrae de una base de datos un único registro que cumple los criterios especificados. +DMAX = BDMAX ## Devuelve el valor máximo de las entradas seleccionadas de la base de datos. +DMIN = BDMIN ## Devuelve el valor mínimo de las entradas seleccionadas de la base de datos. +DPRODUCT = BDPRODUCTO ## Multiplica los valores de un campo concreto de registros de una base de datos que cumplen los criterios especificados. +DSTDEV = BDDESVEST ## Calcula la desviación estándar a partir de una muestra de entradas seleccionadas en la base de datos. +DSTDEVP = BDDESVESTP ## Calcula la desviación estándar en función de la población total de las entradas seleccionadas de la base de datos. +DSUM = BDSUMA ## Suma los números de la columna de campo de los registros de la base de datos que cumplen los criterios. +DVAR = BDVAR ## Calcula la varianza a partir de una muestra de entradas seleccionadas de la base de datos. +DVARP = BDVARP ## Calcula la varianza a partir de la población total de entradas seleccionadas de la base de datos. + + +## +## Date and time functions Funciones de fecha y hora +## +DATE = FECHA ## Devuelve el número de serie correspondiente a una fecha determinada. +DATEVALUE = FECHANUMERO ## Convierte una fecha con formato de texto en un valor de número de serie. +DAY = DIA ## Convierte un número de serie en un valor de día del mes. +DAYS360 = DIAS360 ## Calcula el número de días entre dos fechas a partir de un año de 360 días. +EDATE = FECHA.MES ## Devuelve el número de serie de la fecha equivalente al número indicado de meses anteriores o posteriores a la fecha inicial. +EOMONTH = FIN.MES ## Devuelve el número de serie correspondiente al último día del mes anterior o posterior a un número de meses especificado. +HOUR = HORA ## Convierte un número de serie en un valor de hora. +MINUTE = MINUTO ## Convierte un número de serie en un valor de minuto. +MONTH = MES ## Convierte un número de serie en un valor de mes. +NETWORKDAYS = DIAS.LAB ## Devuelve el número de todos los días laborables existentes entre dos fechas. +NOW = AHORA ## Devuelve el número de serie correspondiente a la fecha y hora actuales. +SECOND = SEGUNDO ## Convierte un número de serie en un valor de segundo. +TIME = HORA ## Devuelve el número de serie correspondiente a una hora determinada. +TIMEVALUE = HORANUMERO ## Convierte una hora con formato de texto en un valor de número de serie. +TODAY = HOY ## Devuelve el número de serie correspondiente al día actual. +WEEKDAY = DIASEM ## Convierte un número de serie en un valor de día de la semana. +WEEKNUM = NUM.DE.SEMANA ## Convierte un número de serie en un número que representa el lugar numérico correspondiente a una semana de un año. +WORKDAY = DIA.LAB ## Devuelve el número de serie de la fecha que tiene lugar antes o después de un número determinado de días laborables. +YEAR = AÑO ## Convierte un número de serie en un valor de año. +YEARFRAC = FRAC.AÑO ## Devuelve la fracción de año que representa el número total de días existentes entre el valor de fecha_inicial y el de fecha_final. + + +## +## Engineering functions Funciones de ingeniería +## +BESSELI = BESSELI ## Devuelve la función Bessel In(x) modificada. +BESSELJ = BESSELJ ## Devuelve la función Bessel Jn(x). +BESSELK = BESSELK ## Devuelve la función Bessel Kn(x) modificada. +BESSELY = BESSELY ## Devuelve la función Bessel Yn(x). +BIN2DEC = BIN.A.DEC ## Convierte un número binario en decimal. +BIN2HEX = BIN.A.HEX ## Convierte un número binario en hexadecimal. +BIN2OCT = BIN.A.OCT ## Convierte un número binario en octal. +COMPLEX = COMPLEJO ## Convierte coeficientes reales e imaginarios en un número complejo. +CONVERT = CONVERTIR ## Convierte un número de un sistema de medida a otro. +DEC2BIN = DEC.A.BIN ## Convierte un número decimal en binario. +DEC2HEX = DEC.A.HEX ## Convierte un número decimal en hexadecimal. +DEC2OCT = DEC.A.OCT ## Convierte un número decimal en octal. +DELTA = DELTA ## Comprueba si dos valores son iguales. +ERF = FUN.ERROR ## Devuelve la función de error. +ERFC = FUN.ERROR.COMPL ## Devuelve la función de error complementario. +GESTEP = MAYOR.O.IGUAL ## Comprueba si un número es mayor que un valor de umbral. +HEX2BIN = HEX.A.BIN ## Convierte un número hexadecimal en binario. +HEX2DEC = HEX.A.DEC ## Convierte un número hexadecimal en decimal. +HEX2OCT = HEX.A.OCT ## Convierte un número hexadecimal en octal. +IMABS = IM.ABS ## Devuelve el valor absoluto (módulo) de un número complejo. +IMAGINARY = IMAGINARIO ## Devuelve el coeficiente imaginario de un número complejo. +IMARGUMENT = IM.ANGULO ## Devuelve el argumento theta, un ángulo expresado en radianes. +IMCONJUGATE = IM.CONJUGADA ## Devuelve la conjugada compleja de un número complejo. +IMCOS = IM.COS ## Devuelve el coseno de un número complejo. +IMDIV = IM.DIV ## Devuelve el cociente de dos números complejos. +IMEXP = IM.EXP ## Devuelve el valor exponencial de un número complejo. +IMLN = IM.LN ## Devuelve el logaritmo natural (neperiano) de un número complejo. +IMLOG10 = IM.LOG10 ## Devuelve el logaritmo en base 10 de un número complejo. +IMLOG2 = IM.LOG2 ## Devuelve el logaritmo en base 2 de un número complejo. +IMPOWER = IM.POT ## Devuelve un número complejo elevado a una potencia entera. +IMPRODUCT = IM.PRODUCT ## Devuelve el producto de números complejos. +IMREAL = IM.REAL ## Devuelve el coeficiente real de un número complejo. +IMSIN = IM.SENO ## Devuelve el seno de un número complejo. +IMSQRT = IM.RAIZ2 ## Devuelve la raíz cuadrada de un número complejo. +IMSUB = IM.SUSTR ## Devuelve la diferencia entre dos números complejos. +IMSUM = IM.SUM ## Devuelve la suma de números complejos. +OCT2BIN = OCT.A.BIN ## Convierte un número octal en binario. +OCT2DEC = OCT.A.DEC ## Convierte un número octal en decimal. +OCT2HEX = OCT.A.HEX ## Convierte un número octal en hexadecimal. + + +## +## Financial functions Funciones financieras +## +ACCRINT = INT.ACUM ## Devuelve el interés acumulado de un valor bursátil con pagos de interés periódicos. +ACCRINTM = INT.ACUM.V ## Devuelve el interés acumulado de un valor bursátil con pagos de interés al vencimiento. +AMORDEGRC = AMORTIZ.PROGRE ## Devuelve la amortización de cada período contable mediante el uso de un coeficiente de amortización. +AMORLINC = AMORTIZ.LIN ## Devuelve la amortización de cada uno de los períodos contables. +COUPDAYBS = CUPON.DIAS.L1 ## Devuelve el número de días desde el principio del período de un cupón hasta la fecha de liquidación. +COUPDAYS = CUPON.DIAS ## Devuelve el número de días del período (entre dos cupones) donde se encuentra la fecha de liquidación. +COUPDAYSNC = CUPON.DIAS.L2 ## Devuelve el número de días desde la fecha de liquidación hasta la fecha del próximo cupón. +COUPNCD = CUPON.FECHA.L2 ## Devuelve la fecha del próximo cupón después de la fecha de liquidación. +COUPNUM = CUPON.NUM ## Devuelve el número de pagos de cupón entre la fecha de liquidación y la fecha de vencimiento. +COUPPCD = CUPON.FECHA.L1 ## Devuelve la fecha de cupón anterior a la fecha de liquidación. +CUMIPMT = PAGO.INT.ENTRE ## Devuelve el interés acumulado pagado entre dos períodos. +CUMPRINC = PAGO.PRINC.ENTRE ## Devuelve el capital acumulado pagado de un préstamo entre dos períodos. +DB = DB ## Devuelve la amortización de un bien durante un período específico a través del método de amortización de saldo fijo. +DDB = DDB ## Devuelve la amortización de un bien durante un período específico a través del método de amortización por doble disminución de saldo u otro método que se especifique. +DISC = TASA.DESC ## Devuelve la tasa de descuento de un valor bursátil. +DOLLARDE = MONEDA.DEC ## Convierte una cotización de un valor bursátil expresada en forma fraccionaria en una cotización de un valor bursátil expresada en forma decimal. +DOLLARFR = MONEDA.FRAC ## Convierte una cotización de un valor bursátil expresada en forma decimal en una cotización de un valor bursátil expresada en forma fraccionaria. +DURATION = DURACION ## Devuelve la duración anual de un valor bursátil con pagos de interés periódico. +EFFECT = INT.EFECTIVO ## Devuelve la tasa de interés anual efectiva. +FV = VF ## Devuelve el valor futuro de una inversión. +FVSCHEDULE = VF.PLAN ## Devuelve el valor futuro de un capital inicial después de aplicar una serie de tasas de interés compuesto. +INTRATE = TASA.INT ## Devuelve la tasa de interés para la inversión total de un valor bursátil. +IPMT = PAGOINT ## Devuelve el pago de intereses de una inversión durante un período determinado. +IRR = TIR ## Devuelve la tasa interna de retorno para una serie de flujos de efectivo periódicos. +ISPMT = INT.PAGO.DIR ## Calcula el interés pagado durante un período específico de una inversión. +MDURATION = DURACION.MODIF ## Devuelve la duración de Macauley modificada de un valor bursátil con un valor nominal supuesto de 100 $. +MIRR = TIRM ## Devuelve la tasa interna de retorno donde se financian flujos de efectivo positivos y negativos a tasas diferentes. +NOMINAL = TASA.NOMINAL ## Devuelve la tasa nominal de interés anual. +NPER = NPER ## Devuelve el número de períodos de una inversión. +NPV = VNA ## Devuelve el valor neto actual de una inversión en función de una serie de flujos periódicos de efectivo y una tasa de descuento. +ODDFPRICE = PRECIO.PER.IRREGULAR.1 ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil con un primer período impar. +ODDFYIELD = RENDTO.PER.IRREGULAR.1 ## Devuelve el rendimiento de un valor bursátil con un primer período impar. +ODDLPRICE = PRECIO.PER.IRREGULAR.2 ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil con un último período impar. +ODDLYIELD = RENDTO.PER.IRREGULAR.2 ## Devuelve el rendimiento de un valor bursátil con un último período impar. +PMT = PAGO ## Devuelve el pago periódico de una anualidad. +PPMT = PAGOPRIN ## Devuelve el pago de capital de una inversión durante un período determinado. +PRICE = PRECIO ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil que paga una tasa de interés periódico. +PRICEDISC = PRECIO.DESCUENTO ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil con descuento. +PRICEMAT = PRECIO.VENCIMIENTO ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil que paga interés a su vencimiento. +PV = VALACT ## Devuelve el valor actual de una inversión. +RATE = TASA ## Devuelve la tasa de interés por período de una anualidad. +RECEIVED = CANTIDAD.RECIBIDA ## Devuelve la cantidad recibida al vencimiento de un valor bursátil completamente invertido. +SLN = SLN ## Devuelve la amortización por método directo de un bien en un período dado. +SYD = SYD ## Devuelve la amortización por suma de dígitos de los años de un bien durante un período especificado. +TBILLEQ = LETRA.DE.TES.EQV.A.BONO ## Devuelve el rendimiento de un bono equivalente a una letra del Tesoro (de EE.UU.) +TBILLPRICE = LETRA.DE.TES.PRECIO ## Devuelve el precio por un valor nominal de 100 $ de una letra del Tesoro (de EE.UU.) +TBILLYIELD = LETRA.DE.TES.RENDTO ## Devuelve el rendimiento de una letra del Tesoro (de EE.UU.) +VDB = DVS ## Devuelve la amortización de un bien durante un período específico o parcial a través del método de cálculo del saldo en disminución. +XIRR = TIR.NO.PER ## Devuelve la tasa interna de retorno para un flujo de efectivo que no es necesariamente periódico. +XNPV = VNA.NO.PER ## Devuelve el valor neto actual para un flujo de efectivo que no es necesariamente periódico. +YIELD = RENDTO ## Devuelve el rendimiento de un valor bursátil que paga intereses periódicos. +YIELDDISC = RENDTO.DESC ## Devuelve el rendimiento anual de un valor bursátil con descuento; por ejemplo, una letra del Tesoro (de EE.UU.) +YIELDMAT = RENDTO.VENCTO ## Devuelve el rendimiento anual de un valor bursátil que paga intereses al vencimiento. + + +## +## Information functions Funciones de información +## +CELL = CELDA ## Devuelve información acerca del formato, la ubicación o el contenido de una celda. +ERROR.TYPE = TIPO.DE.ERROR ## Devuelve un número que corresponde a un tipo de error. +INFO = INFO ## Devuelve información acerca del entorno operativo en uso. +ISBLANK = ESBLANCO ## Devuelve VERDADERO si el valor está en blanco. +ISERR = ESERR ## Devuelve VERDADERO si el valor es cualquier valor de error excepto #N/A. +ISERROR = ESERROR ## Devuelve VERDADERO si el valor es cualquier valor de error. +ISEVEN = ES.PAR ## Devuelve VERDADERO si el número es par. +ISLOGICAL = ESLOGICO ## Devuelve VERDADERO si el valor es un valor lógico. +ISNA = ESNOD ## Devuelve VERDADERO si el valor es el valor de error #N/A. +ISNONTEXT = ESNOTEXTO ## Devuelve VERDADERO si el valor no es texto. +ISNUMBER = ESNUMERO ## Devuelve VERDADERO si el valor es un número. +ISODD = ES.IMPAR ## Devuelve VERDADERO si el número es impar. +ISREF = ESREF ## Devuelve VERDADERO si el valor es una referencia. +ISTEXT = ESTEXTO ## Devuelve VERDADERO si el valor es texto. +N = N ## Devuelve un valor convertido en un número. +NA = ND ## Devuelve el valor de error #N/A. +TYPE = TIPO ## Devuelve un número que indica el tipo de datos de un valor. + + +## +## Logical functions Funciones lógicas +## +AND = Y ## Devuelve VERDADERO si todos sus argumentos son VERDADERO. +FALSE = FALSO ## Devuelve el valor lógico FALSO. +IF = SI ## Especifica una prueba lógica que realizar. +IFERROR = SI.ERROR ## Devuelve un valor que se especifica si una fórmula lo evalúa como un error; de lo contrario, devuelve el resultado de la fórmula. +NOT = NO ## Invierte el valor lógico del argumento. +OR = O ## Devuelve VERDADERO si cualquier argumento es VERDADERO. +TRUE = VERDADERO ## Devuelve el valor lógico VERDADERO. + + +## +## Lookup and reference functions Funciones de búsqueda y referencia +## +ADDRESS = DIRECCION ## Devuelve una referencia como texto a una sola celda de una hoja de cálculo. +AREAS = AREAS ## Devuelve el número de áreas de una referencia. +CHOOSE = ELEGIR ## Elige un valor de una lista de valores. +COLUMN = COLUMNA ## Devuelve el número de columna de una referencia. +COLUMNS = COLUMNAS ## Devuelve el número de columnas de una referencia. +HLOOKUP = BUSCARH ## Busca en la fila superior de una matriz y devuelve el valor de la celda indicada. +HYPERLINK = HIPERVINCULO ## Crea un acceso directo o un salto que abre un documento almacenado en un servidor de red, en una intranet o en Internet. +INDEX = INDICE ## Usa un índice para elegir un valor de una referencia o matriz. +INDIRECT = INDIRECTO ## Devuelve una referencia indicada por un valor de texto. +LOOKUP = BUSCAR ## Busca valores de un vector o una matriz. +MATCH = COINCIDIR ## Busca valores de una referencia o matriz. +OFFSET = DESREF ## Devuelve un desplazamiento de referencia respecto a una referencia dada. +ROW = FILA ## Devuelve el número de fila de una referencia. +ROWS = FILAS ## Devuelve el número de filas de una referencia. +RTD = RDTR ## Recupera datos en tiempo real desde un programa compatible con la automatización COM (automatización: modo de trabajar con los objetos de una aplicación desde otra aplicación o herramienta de entorno. La automatización, antes denominada automatización OLE, es un estándar de la industria y una función del Modelo de objetos componentes (COM).). +TRANSPOSE = TRANSPONER ## Devuelve la transposición de una matriz. +VLOOKUP = BUSCARV ## Busca en la primera columna de una matriz y se mueve en horizontal por la fila para devolver el valor de una celda. + + +## +## Math and trigonometry functions Funciones matemáticas y trigonométricas +## +ABS = ABS ## Devuelve el valor absoluto de un número. +ACOS = ACOS ## Devuelve el arcocoseno de un número. +ACOSH = ACOSH ## Devuelve el coseno hiperbólico inverso de un número. +ASIN = ASENO ## Devuelve el arcoseno de un número. +ASINH = ASENOH ## Devuelve el seno hiperbólico inverso de un número. +ATAN = ATAN ## Devuelve la arcotangente de un número. +ATAN2 = ATAN2 ## Devuelve la arcotangente de las coordenadas "x" e "y". +ATANH = ATANH ## Devuelve la tangente hiperbólica inversa de un número. +CEILING = MULTIPLO.SUPERIOR ## Redondea un número al entero más próximo o al múltiplo significativo más cercano. +COMBIN = COMBINAT ## Devuelve el número de combinaciones para un número determinado de objetos. +COS = COS ## Devuelve el coseno de un número. +COSH = COSH ## Devuelve el coseno hiperbólico de un número. +DEGREES = GRADOS ## Convierte radianes en grados. +EVEN = REDONDEA.PAR ## Redondea un número hasta el entero par más próximo. +EXP = EXP ## Devuelve e elevado a la potencia de un número dado. +FACT = FACT ## Devuelve el factorial de un número. +FACTDOUBLE = FACT.DOBLE ## Devuelve el factorial doble de un número. +FLOOR = MULTIPLO.INFERIOR ## Redondea un número hacia abajo, en dirección hacia cero. +GCD = M.C.D ## Devuelve el máximo común divisor. +INT = ENTERO ## Redondea un número hacia abajo hasta el entero más próximo. +LCM = M.C.M ## Devuelve el mínimo común múltiplo. +LN = LN ## Devuelve el logaritmo natural (neperiano) de un número. +LOG = LOG ## Devuelve el logaritmo de un número en una base especificada. +LOG10 = LOG10 ## Devuelve el logaritmo en base 10 de un número. +MDETERM = MDETERM ## Devuelve la determinante matricial de una matriz. +MINVERSE = MINVERSA ## Devuelve la matriz inversa de una matriz. +MMULT = MMULT ## Devuelve el producto de matriz de dos matrices. +MOD = RESIDUO ## Devuelve el resto de la división. +MROUND = REDOND.MULT ## Devuelve un número redondeado al múltiplo deseado. +MULTINOMIAL = MULTINOMIAL ## Devuelve el polinomio de un conjunto de números. +ODD = REDONDEA.IMPAR ## Redondea un número hacia arriba hasta el entero impar más próximo. +PI = PI ## Devuelve el valor de pi. +POWER = POTENCIA ## Devuelve el resultado de elevar un número a una potencia. +PRODUCT = PRODUCTO ## Multiplica sus argumentos. +QUOTIENT = COCIENTE ## Devuelve la parte entera de una división. +RADIANS = RADIANES ## Convierte grados en radianes. +RAND = ALEATORIO ## Devuelve un número aleatorio entre 0 y 1. +RANDBETWEEN = ALEATORIO.ENTRE ## Devuelve un número aleatorio entre los números que especifique. +ROMAN = NUMERO.ROMANO ## Convierte un número arábigo en número romano, con formato de texto. +ROUND = REDONDEAR ## Redondea un número al número de decimales especificado. +ROUNDDOWN = REDONDEAR.MENOS ## Redondea un número hacia abajo, en dirección hacia cero. +ROUNDUP = REDONDEAR.MAS ## Redondea un número hacia arriba, en dirección contraria a cero. +SERIESSUM = SUMA.SERIES ## Devuelve la suma de una serie de potencias en función de la fórmula. +SIGN = SIGNO ## Devuelve el signo de un número. +SIN = SENO ## Devuelve el seno de un ángulo determinado. +SINH = SENOH ## Devuelve el seno hiperbólico de un número. +SQRT = RAIZ ## Devuelve la raíz cuadrada positiva de un número. +SQRTPI = RAIZ2PI ## Devuelve la raíz cuadrada de un número multiplicado por PI (número * pi). +SUBTOTAL = SUBTOTALES ## Devuelve un subtotal en una lista o base de datos. +SUM = SUMA ## Suma sus argumentos. +SUMIF = SUMAR.SI ## Suma las celdas especificadas que cumplen unos criterios determinados. +SUMIFS = SUMAR.SI.CONJUNTO ## Suma las celdas de un rango que cumplen varios criterios. +SUMPRODUCT = SUMAPRODUCTO ## Devuelve la suma de los productos de los correspondientes componentes de matriz. +SUMSQ = SUMA.CUADRADOS ## Devuelve la suma de los cuadrados de los argumentos. +SUMX2MY2 = SUMAX2MENOSY2 ## Devuelve la suma de la diferencia de los cuadrados de los valores correspondientes de dos matrices. +SUMX2PY2 = SUMAX2MASY2 ## Devuelve la suma de la suma de los cuadrados de los valores correspondientes de dos matrices. +SUMXMY2 = SUMAXMENOSY2 ## Devuelve la suma de los cuadrados de las diferencias de los valores correspondientes de dos matrices. +TAN = TAN ## Devuelve la tangente de un número. +TANH = TANH ## Devuelve la tangente hiperbólica de un número. +TRUNC = TRUNCAR ## Trunca un número a un entero. + + +## +## Statistical functions Funciones estadísticas +## +AVEDEV = DESVPROM ## Devuelve el promedio de las desviaciones absolutas de la media de los puntos de datos. +AVERAGE = PROMEDIO ## Devuelve el promedio de sus argumentos. +AVERAGEA = PROMEDIOA ## Devuelve el promedio de sus argumentos, incluidos números, texto y valores lógicos. +AVERAGEIF = PROMEDIO.SI ## Devuelve el promedio (media aritmética) de todas las celdas de un rango que cumplen unos criterios determinados. +AVERAGEIFS = PROMEDIO.SI.CONJUNTO ## Devuelve el promedio (media aritmética) de todas las celdas que cumplen múltiples criterios. +BETADIST = DISTR.BETA ## Devuelve la función de distribución beta acumulativa. +BETAINV = DISTR.BETA.INV ## Devuelve la función inversa de la función de distribución acumulativa de una distribución beta especificada. +BINOMDIST = DISTR.BINOM ## Devuelve la probabilidad de una variable aleatoria discreta siguiendo una distribución binomial. +CHIDIST = DISTR.CHI ## Devuelve la probabilidad de una variable aleatoria continua siguiendo una distribución chi cuadrado de una sola cola. +CHIINV = PRUEBA.CHI.INV ## Devuelve la función inversa de la probabilidad de una variable aleatoria continua siguiendo una distribución chi cuadrado de una sola cola. +CHITEST = PRUEBA.CHI ## Devuelve la prueba de independencia. +CONFIDENCE = INTERVALO.CONFIANZA ## Devuelve el intervalo de confianza de la media de una población. +CORREL = COEF.DE.CORREL ## Devuelve el coeficiente de correlación entre dos conjuntos de datos. +COUNT = CONTAR ## Cuenta cuántos números hay en la lista de argumentos. +COUNTA = CONTARA ## Cuenta cuántos valores hay en la lista de argumentos. +COUNTBLANK = CONTAR.BLANCO ## Cuenta el número de celdas en blanco de un rango. +COUNTIF = CONTAR.SI ## Cuenta el número de celdas, dentro del rango, que cumplen el criterio especificado. +COUNTIFS = CONTAR.SI.CONJUNTO ## Cuenta el número de celdas, dentro del rango, que cumplen varios criterios. +COVAR = COVAR ## Devuelve la covarianza, que es el promedio de los productos de las desviaciones para cada pareja de puntos de datos. +CRITBINOM = BINOM.CRIT ## Devuelve el menor valor cuya distribución binomial acumulativa es menor o igual a un valor de criterio. +DEVSQ = DESVIA2 ## Devuelve la suma de los cuadrados de las desviaciones. +EXPONDIST = DISTR.EXP ## Devuelve la distribución exponencial. +FDIST = DISTR.F ## Devuelve la distribución de probabilidad F. +FINV = DISTR.F.INV ## Devuelve la función inversa de la distribución de probabilidad F. +FISHER = FISHER ## Devuelve la transformación Fisher. +FISHERINV = PRUEBA.FISHER.INV ## Devuelve la función inversa de la transformación Fisher. +FORECAST = PRONOSTICO ## Devuelve un valor en una tendencia lineal. +FREQUENCY = FRECUENCIA ## Devuelve una distribución de frecuencia como una matriz vertical. +FTEST = PRUEBA.F ## Devuelve el resultado de una prueba F. +GAMMADIST = DISTR.GAMMA ## Devuelve la distribución gamma. +GAMMAINV = DISTR.GAMMA.INV ## Devuelve la función inversa de la distribución gamma acumulativa. +GAMMALN = GAMMA.LN ## Devuelve el logaritmo natural de la función gamma, G(x). +GEOMEAN = MEDIA.GEOM ## Devuelve la media geométrica. +GROWTH = CRECIMIENTO ## Devuelve valores en una tendencia exponencial. +HARMEAN = MEDIA.ARMO ## Devuelve la media armónica. +HYPGEOMDIST = DISTR.HIPERGEOM ## Devuelve la distribución hipergeométrica. +INTERCEPT = INTERSECCION.EJE ## Devuelve la intersección de la línea de regresión lineal. +KURT = CURTOSIS ## Devuelve la curtosis de un conjunto de datos. +LARGE = K.ESIMO.MAYOR ## Devuelve el k-ésimo mayor valor de un conjunto de datos. +LINEST = ESTIMACION.LINEAL ## Devuelve los parámetros de una tendencia lineal. +LOGEST = ESTIMACION.LOGARITMICA ## Devuelve los parámetros de una tendencia exponencial. +LOGINV = DISTR.LOG.INV ## Devuelve la función inversa de la distribución logarítmico-normal. +LOGNORMDIST = DISTR.LOG.NORM ## Devuelve la distribución logarítmico-normal acumulativa. +MAX = MAX ## Devuelve el valor máximo de una lista de argumentos. +MAXA = MAXA ## Devuelve el valor máximo de una lista de argumentos, incluidos números, texto y valores lógicos. +MEDIAN = MEDIANA ## Devuelve la mediana de los números dados. +MIN = MIN ## Devuelve el valor mínimo de una lista de argumentos. +MINA = MINA ## Devuelve el valor mínimo de una lista de argumentos, incluidos números, texto y valores lógicos. +MODE = MODA ## Devuelve el valor más común de un conjunto de datos. +NEGBINOMDIST = NEGBINOMDIST ## Devuelve la distribución binomial negativa. +NORMDIST = DISTR.NORM ## Devuelve la distribución normal acumulativa. +NORMINV = DISTR.NORM.INV ## Devuelve la función inversa de la distribución normal acumulativa. +NORMSDIST = DISTR.NORM.ESTAND ## Devuelve la distribución normal estándar acumulativa. +NORMSINV = DISTR.NORM.ESTAND.INV ## Devuelve la función inversa de la distribución normal estándar acumulativa. +PEARSON = PEARSON ## Devuelve el coeficiente de momento de correlación de producto Pearson. +PERCENTILE = PERCENTIL ## Devuelve el k-ésimo percentil de los valores de un rango. +PERCENTRANK = RANGO.PERCENTIL ## Devuelve el rango porcentual de un valor de un conjunto de datos. +PERMUT = PERMUTACIONES ## Devuelve el número de permutaciones de un número determinado de objetos. +POISSON = POISSON ## Devuelve la distribución de Poisson. +PROB = PROBABILIDAD ## Devuelve la probabilidad de que los valores de un rango se encuentren entre dos límites. +QUARTILE = CUARTIL ## Devuelve el cuartil de un conjunto de datos. +RANK = JERARQUIA ## Devuelve la jerarquía de un número en una lista de números. +RSQ = COEFICIENTE.R2 ## Devuelve el cuadrado del coeficiente de momento de correlación de producto Pearson. +SKEW = COEFICIENTE.ASIMETRIA ## Devuelve la asimetría de una distribución. +SLOPE = PENDIENTE ## Devuelve la pendiente de la línea de regresión lineal. +SMALL = K.ESIMO.MENOR ## Devuelve el k-ésimo menor valor de un conjunto de datos. +STANDARDIZE = NORMALIZACION ## Devuelve un valor normalizado. +STDEV = DESVEST ## Calcula la desviación estándar a partir de una muestra. +STDEVA = DESVESTA ## Calcula la desviación estándar a partir de una muestra, incluidos números, texto y valores lógicos. +STDEVP = DESVESTP ## Calcula la desviación estándar en función de toda la población. +STDEVPA = DESVESTPA ## Calcula la desviación estándar en función de toda la población, incluidos números, texto y valores lógicos. +STEYX = ERROR.TIPICO.XY ## Devuelve el error estándar del valor de "y" previsto para cada "x" de la regresión. +TDIST = DISTR.T ## Devuelve la distribución de t de Student. +TINV = DISTR.T.INV ## Devuelve la función inversa de la distribución de t de Student. +TREND = TENDENCIA ## Devuelve valores en una tendencia lineal. +TRIMMEAN = MEDIA.ACOTADA ## Devuelve la media del interior de un conjunto de datos. +TTEST = PRUEBA.T ## Devuelve la probabilidad asociada a una prueba t de Student. +VAR = VAR ## Calcula la varianza en función de una muestra. +VARA = VARA ## Calcula la varianza en función de una muestra, incluidos números, texto y valores lógicos. +VARP = VARP ## Calcula la varianza en función de toda la población. +VARPA = VARPA ## Calcula la varianza en función de toda la población, incluidos números, texto y valores lógicos. +WEIBULL = DIST.WEIBULL ## Devuelve la distribución de Weibull. +ZTEST = PRUEBA.Z ## Devuelve el valor de una probabilidad de una cola de una prueba z. + + +## +## Text functions Funciones de texto +## +ASC = ASC ## Convierte las letras inglesas o katakana de ancho completo (de dos bytes) dentro de una cadena de caracteres en caracteres de ancho medio (de un byte). +BAHTTEXT = TEXTOBAHT ## Convierte un número en texto, con el formato de moneda ß (Baht). +CHAR = CARACTER ## Devuelve el carácter especificado por el número de código. +CLEAN = LIMPIAR ## Quita del texto todos los caracteres no imprimibles. +CODE = CODIGO ## Devuelve un código numérico del primer carácter de una cadena de texto. +CONCATENATE = CONCATENAR ## Concatena varios elementos de texto en uno solo. +DOLLAR = MONEDA ## Convierte un número en texto, con el formato de moneda $ (dólar). +EXACT = IGUAL ## Comprueba si dos valores de texto son idénticos. +FIND = ENCONTRAR ## Busca un valor de texto dentro de otro (distingue mayúsculas de minúsculas). +FINDB = ENCONTRARB ## Busca un valor de texto dentro de otro (distingue mayúsculas de minúsculas). +FIXED = DECIMAL ## Da formato a un número como texto con un número fijo de decimales. +JIS = JIS ## Convierte las letras inglesas o katakana de ancho medio (de un byte) dentro de una cadena de caracteres en caracteres de ancho completo (de dos bytes). +LEFT = IZQUIERDA ## Devuelve los caracteres del lado izquierdo de un valor de texto. +LEFTB = IZQUIERDAB ## Devuelve los caracteres del lado izquierdo de un valor de texto. +LEN = LARGO ## Devuelve el número de caracteres de una cadena de texto. +LENB = LARGOB ## Devuelve el número de caracteres de una cadena de texto. +LOWER = MINUSC ## Pone el texto en minúsculas. +MID = EXTRAE ## Devuelve un número específico de caracteres de una cadena de texto que comienza en la posición que se especifique. +MIDB = EXTRAEB ## Devuelve un número específico de caracteres de una cadena de texto que comienza en la posición que se especifique. +PHONETIC = FONETICO ## Extrae los caracteres fonéticos (furigana) de una cadena de texto. +PROPER = NOMPROPIO ## Pone en mayúscula la primera letra de cada palabra de un valor de texto. +REPLACE = REEMPLAZAR ## Reemplaza caracteres de texto. +REPLACEB = REEMPLAZARB ## Reemplaza caracteres de texto. +REPT = REPETIR ## Repite el texto un número determinado de veces. +RIGHT = DERECHA ## Devuelve los caracteres del lado derecho de un valor de texto. +RIGHTB = DERECHAB ## Devuelve los caracteres del lado derecho de un valor de texto. +SEARCH = HALLAR ## Busca un valor de texto dentro de otro (no distingue mayúsculas de minúsculas). +SEARCHB = HALLARB ## Busca un valor de texto dentro de otro (no distingue mayúsculas de minúsculas). +SUBSTITUTE = SUSTITUIR ## Sustituye texto nuevo por texto antiguo en una cadena de texto. +T = T ## Convierte sus argumentos a texto. +TEXT = TEXTO ## Da formato a un número y lo convierte en texto. +TRIM = ESPACIOS ## Quita los espacios del texto. +UPPER = MAYUSC ## Pone el texto en mayúsculas. +VALUE = VALOR ## Convierte un argumento de texto en un número. diff --git a/extend/PHPExcel/PHPExcel/locale/fi/config b/extend/PHPExcel/PHPExcel/locale/fi/config new file mode 100644 index 0000000..498cf4c --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/fi/config @@ -0,0 +1,47 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = $ # Symbol not known, should it be a € (Euro)? + + +## +## Excel Error Codes (For future use) +## +NULL = #TYHJÄ! +DIV0 = #JAKO/0! +VALUE = #ARVO! +REF = #VIITTAUS! +NAME = #NIMI? +NUM = #LUKU! +NA = #PUUTTUU diff --git a/extend/PHPExcel/PHPExcel/locale/fi/functions b/extend/PHPExcel/PHPExcel/locale/fi/functions new file mode 100644 index 0000000..6a7c2b3 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/fi/functions @@ -0,0 +1,438 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Calculation +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ +## +## + + +## +## Add-in and Automation functions Apuohjelma- ja automaatiofunktiot +## +GETPIVOTDATA = NOUDA.PIVOT.TIEDOT ## Palauttaa pivot-taulukkoraporttiin tallennettuja tietoja. + + +## +## Cube functions Kuutiofunktiot +## +CUBEKPIMEMBER = KUUTIOKPIJÄSEN ## Palauttaa suorituskykyilmaisimen (KPI) nimen, ominaisuuden sekä mitan ja näyttää nimen sekä ominaisuuden solussa. KPI on mitattavissa oleva suure, kuten kuukauden bruttotuotto tai vuosineljänneksen työntekijäkohtainen liikevaihto, joiden avulla tarkkaillaan organisaation suorituskykyä. +CUBEMEMBER = KUUTIONJÄSEN ## Palauttaa kuutiohierarkian jäsenen tai monikon. Tällä funktiolla voit tarkistaa, että jäsen tai monikko on olemassa kuutiossa. +CUBEMEMBERPROPERTY = KUUTIONJÄSENENOMINAISUUS ## Palauttaa kuution jäsenominaisuuden arvon. Tällä funktiolla voit tarkistaa, että nimi on olemassa kuutiossa, ja palauttaa tämän jäsenen määritetyn ominaisuuden. +CUBERANKEDMEMBER = KUUTIONLUOKITELTUJÄSEN ## Palauttaa joukon n:nnen jäsenen. Tällä funktiolla voit palauttaa joukosta elementtejä, kuten parhaan myyjän tai 10 parasta opiskelijaa. +CUBESET = KUUTIOJOUKKO ## Määrittää lasketun jäsen- tai monikkojoukon lähettämällä joukon lausekkeita palvelimessa olevalle kuutiolle. Palvelin luo joukon ja palauttaa sen Microsoft Office Excelille. +CUBESETCOUNT = KUUTIOJOUKKOJENMÄÄRÄ ## Palauttaa joukon kohteiden määrän. +CUBEVALUE = KUUTIONARVO ## Palauttaa koostetun arvon kuutiosta. + + +## +## Database functions Tietokantafunktiot +## +DAVERAGE = TKESKIARVO ## Palauttaa valittujen tietokantamerkintöjen keskiarvon. +DCOUNT = TLASKE ## Laskee tietokannan lukuja sisältävien solujen määrän. +DCOUNTA = TLASKEA ## Laskee tietokannan tietoja sisältävien solujen määrän. +DGET = TNOUDA ## Hakee määritettyjä ehtoja vastaavan tietueen tietokannasta. +DMAX = TMAKS ## Palauttaa suurimman arvon tietokannasta valittujen arvojen joukosta. +DMIN = TMIN ## Palauttaa pienimmän arvon tietokannasta valittujen arvojen joukosta. +DPRODUCT = TTULO ## Kertoo määritetyn ehdon täyttävien tietokannan tietueiden tietyssä kentässä olevat arvot. +DSTDEV = TKESKIHAJONTA ## Laskee keskihajonnan tietokannasta valituista arvoista muodostuvan otoksen perusteella. +DSTDEVP = TKESKIHAJONTAP ## Laskee keskihajonnan tietokannasta valittujen arvojen koko populaation perusteella. +DSUM = TSUMMA ## Lisää luvut määritetyn ehdon täyttävien tietokannan tietueiden kenttäsarakkeeseen. +DVAR = TVARIANSSI ## Laskee varianssin tietokannasta valittujen arvojen otoksen perusteella. +DVARP = TVARIANSSIP ## Laskee varianssin tietokannasta valittujen arvojen koko populaation perusteella. + + +## +## Date and time functions Päivämäärä- ja aikafunktiot +## +DATE = PÄIVÄYS ## Palauttaa annetun päivämäärän järjestysluvun. +DATEVALUE = PÄIVÄYSARVO ## Muuntaa tekstimuodossa olevan päivämäärän järjestysluvuksi. +DAY = PÄIVÄ ## Muuntaa järjestysluvun kuukauden päiväksi. +DAYS360 = PÄIVÄT360 ## Laskee kahden päivämäärän välisten päivien määrän käyttäen perustana 360-päiväistä vuotta. +EDATE = PÄIVÄ.KUUKAUSI ## Palauttaa järjestyslukuna päivämäärän, joka poikkeaa aloituspäivän päivämäärästä annetun kuukausimäärän verran joko eteen- tai taaksepäin. +EOMONTH = KUUKAUSI.LOPPU ## Palauttaa järjestyslukuna sen kuukauden viimeisen päivämäärän, joka poikkeaa annetun kuukausimäärän verran eteen- tai taaksepäin. +HOUR = TUNNIT ## Muuntaa järjestysluvun tunneiksi. +MINUTE = MINUUTIT ## Muuntaa järjestysluvun minuuteiksi. +MONTH = KUUKAUSI ## Muuntaa järjestysluvun kuukausiksi. +NETWORKDAYS = TYÖPÄIVÄT ## Palauttaa kahden päivämäärän välissä olevien täysien työpäivien määrän. +NOW = NYT ## Palauttaa kuluvan päivämäärän ja ajan järjestysnumeron. +SECOND = SEKUNNIT ## Muuntaa järjestysluvun sekunneiksi. +TIME = AIKA ## Palauttaa annetun kellonajan järjestysluvun. +TIMEVALUE = AIKA_ARVO ## Muuntaa tekstimuodossa olevan kellonajan järjestysluvuksi. +TODAY = TÄMÄ.PÄIVÄ ## Palauttaa kuluvan päivän päivämäärän järjestysluvun. +WEEKDAY = VIIKONPÄIVÄ ## Muuntaa järjestysluvun viikonpäiväksi. +WEEKNUM = VIIKKO.NRO ## Muuntaa järjestysluvun luvuksi, joka ilmaisee viikon järjestysluvun vuoden alusta laskettuna. +WORKDAY = TYÖPÄIVÄ ## Palauttaa järjestysluvun päivämäärälle, joka sijaitsee annettujen työpäivien verran eteen tai taaksepäin. +YEAR = VUOSI ## Muuntaa järjestysluvun vuosiksi. +YEARFRAC = VUOSI.OSA ## Palauttaa määritettyjen päivämäärien (aloituspäivä ja lopetuspäivä) välisen osan vuodesta. + + +## +## Engineering functions Tekniset funktiot +## +BESSELI = BESSELI ## Palauttaa muunnetun Bessel-funktion In(x). +BESSELJ = BESSELJ ## Palauttaa Bessel-funktion Jn(x). +BESSELK = BESSELK ## Palauttaa muunnetun Bessel-funktion Kn(x). +BESSELY = BESSELY ## Palauttaa Bessel-funktion Yn(x). +BIN2DEC = BINDES ## Muuntaa binaariluvun desimaaliluvuksi. +BIN2HEX = BINHEKSA ## Muuntaa binaariluvun heksadesimaaliluvuksi. +BIN2OCT = BINOKT ## Muuntaa binaariluvun oktaaliluvuksi. +COMPLEX = KOMPLEKSI ## Muuntaa reaali- ja imaginaariosien kertoimet kompleksiluvuksi. +CONVERT = MUUNNA ## Muuntaa luvun toisen mittajärjestelmän mukaiseksi. +DEC2BIN = DESBIN ## Muuntaa desimaaliluvun binaariluvuksi. +DEC2HEX = DESHEKSA ## Muuntaa kymmenjärjestelmän luvun heksadesimaaliluvuksi. +DEC2OCT = DESOKT ## Muuntaa kymmenjärjestelmän luvun oktaaliluvuksi. +DELTA = SAMA.ARVO ## Tarkistaa, ovatko kaksi arvoa yhtä suuria. +ERF = VIRHEFUNKTIO ## Palauttaa virhefunktion. +ERFC = VIRHEFUNKTIO.KOMPLEMENTTI ## Palauttaa komplementtivirhefunktion. +GESTEP = RAJA ## Testaa, onko luku suurempi kuin kynnysarvo. +HEX2BIN = HEKSABIN ## Muuntaa heksadesimaaliluvun binaariluvuksi. +HEX2DEC = HEKSADES ## Muuntaa heksadesimaaliluvun desimaaliluvuksi. +HEX2OCT = HEKSAOKT ## Muuntaa heksadesimaaliluvun oktaaliluvuksi. +IMABS = KOMPLEKSI.ITSEISARVO ## Palauttaa kompleksiluvun itseisarvon (moduluksen). +IMAGINARY = KOMPLEKSI.IMAG ## Palauttaa kompleksiluvun imaginaariosan kertoimen. +IMARGUMENT = KOMPLEKSI.ARG ## Palauttaa theeta-argumentin, joka on radiaaneina annettu kulma. +IMCONJUGATE = KOMPLEKSI.KONJ ## Palauttaa kompleksiluvun konjugaattiluvun. +IMCOS = KOMPLEKSI.COS ## Palauttaa kompleksiluvun kosinin. +IMDIV = KOMPLEKSI.OSAM ## Palauttaa kahden kompleksiluvun osamäärän. +IMEXP = KOMPLEKSI.EKSP ## Palauttaa kompleksiluvun eksponentin. +IMLN = KOMPLEKSI.LN ## Palauttaa kompleksiluvun luonnollisen logaritmin. +IMLOG10 = KOMPLEKSI.LOG10 ## Palauttaa kompleksiluvun kymmenkantaisen logaritmin. +IMLOG2 = KOMPLEKSI.LOG2 ## Palauttaa kompleksiluvun kaksikantaisen logaritmin. +IMPOWER = KOMPLEKSI.POT ## Palauttaa kokonaislukupotenssiin korotetun kompleksiluvun. +IMPRODUCT = KOMPLEKSI.TULO ## Palauttaa kompleksilukujen tulon. +IMREAL = KOMPLEKSI.REAALI ## Palauttaa kompleksiluvun reaaliosan kertoimen. +IMSIN = KOMPLEKSI.SIN ## Palauttaa kompleksiluvun sinin. +IMSQRT = KOMPLEKSI.NELIÖJ ## Palauttaa kompleksiluvun neliöjuuren. +IMSUB = KOMPLEKSI.EROTUS ## Palauttaa kahden kompleksiluvun erotuksen. +IMSUM = KOMPLEKSI.SUM ## Palauttaa kompleksilukujen summan. +OCT2BIN = OKTBIN ## Muuntaa oktaaliluvun binaariluvuksi. +OCT2DEC = OKTDES ## Muuntaa oktaaliluvun desimaaliluvuksi. +OCT2HEX = OKTHEKSA ## Muuntaa oktaaliluvun heksadesimaaliluvuksi. + + +## +## Financial functions Rahoitusfunktiot +## +ACCRINT = KERTYNYT.KORKO ## Laskee arvopaperille kertyneen koron, kun korko kertyy säännöllisin väliajoin. +ACCRINTM = KERTYNYT.KORKO.LOPUSSA ## Laskee arvopaperille kertyneen koron, kun korko maksetaan eräpäivänä. +AMORDEGRC = AMORDEGRC ## Laskee kunkin laskentakauden poiston poistokerrointa käyttämällä. +AMORLINC = AMORLINC ## Palauttaa kunkin laskentakauden poiston. +COUPDAYBS = KORKOPÄIVÄT.ALUSTA ## Palauttaa koronmaksukauden aloituspäivän ja tilityspäivän välisen ajanjakson päivien määrän. +COUPDAYS = KORKOPÄIVÄT ## Palauttaa päivien määrän koronmaksukaudelta, johon tilityspäivä kuuluu. +COUPDAYSNC = KORKOPÄIVÄT.SEURAAVA ## Palauttaa tilityspäivän ja seuraavan koronmaksupäivän välisen ajanjakson päivien määrän. +COUPNCD = KORKOMAKSU.SEURAAVA ## Palauttaa tilityspäivän jälkeisen seuraavan koronmaksupäivän. +COUPNUM = KORKOPÄIVÄJAKSOT ## Palauttaa arvopaperin ostopäivän ja erääntymispäivän välisten koronmaksupäivien määrän. +COUPPCD = KORKOPÄIVÄ.EDELLINEN ## Palauttaa tilityspäivää edeltävän koronmaksupäivän. +CUMIPMT = MAKSETTU.KORKO ## Palauttaa kahden jakson välisenä aikana kertyneen koron. +CUMPRINC = MAKSETTU.LYHENNYS ## Palauttaa lainalle kahden jakson välisenä aikana kertyneen lyhennyksen. +DB = DB ## Palauttaa kauden kirjanpidollisen poiston amerikkalaisen DB-menetelmän (Fixed-declining balance) mukaan. +DDB = DDB ## Palauttaa kauden kirjanpidollisen poiston amerikkalaisen DDB-menetelmän (Double-Declining Balance) tai jonkin muun määrittämäsi menetelmän mukaan. +DISC = DISKONTTOKORKO ## Palauttaa arvopaperin diskonttokoron. +DOLLARDE = VALUUTTA.DES ## Muuntaa murtolukuna ilmoitetun valuuttamäärän desimaaliluvuksi. +DOLLARFR = VALUUTTA.MURTO ## Muuntaa desimaalilukuna ilmaistun valuuttamäärän murtoluvuksi. +DURATION = KESTO ## Palauttaa keston arvopaperille, jonka koronmaksu tapahtuu säännöllisesti. +EFFECT = KORKO.EFEKT ## Palauttaa todellisen vuosikoron. +FV = TULEVA.ARVO ## Palauttaa sijoituksen tulevan arvon. +FVSCHEDULE = TULEVA.ARVO.ERIKORKO ## Palauttaa pääoman tulevan arvon, kun pääomalle on kertynyt korkoa vaihtelevasti. +INTRATE = KORKO.ARVOPAPERI ## Palauttaa arvopaperin korkokannan täysin sijoitetulle arvopaperille. +IPMT = IPMT ## Laskee sijoitukselle tai lainalle tiettynä ajanjaksona kertyvän koron. +IRR = SISÄINEN.KORKO ## Laskee sisäisen korkokannan kassavirrasta muodostuvalle sarjalle. +ISPMT = ONMAKSU ## Laskee sijoituksen maksetun koron tietyllä jaksolla. +MDURATION = KESTO.MUUNN ## Palauttaa muunnetun Macauley-keston arvopaperille, jonka oletettu nimellisarvo on 100 euroa. +MIRR = MSISÄINEN ## Palauttaa sisäisen korkokannan, kun positiivisten ja negatiivisten kassavirtojen rahoituskorko on erilainen. +NOMINAL = KORKO.VUOSI ## Palauttaa vuosittaisen nimelliskoron. +NPER = NJAKSO ## Palauttaa sijoituksen jaksojen määrän. +NPV = NNA ## Palauttaa sijoituksen nykyarvon toistuvista kassavirroista muodostuvan sarjan ja diskonttokoron perusteella. +ODDFPRICE = PARITON.ENS.NIMELLISARVO ## Palauttaa arvopaperin hinnan tilanteessa, jossa ensimmäinen jakso on pariton. +ODDFYIELD = PARITON.ENS.TUOTTO ## Palauttaa arvopaperin tuoton tilanteessa, jossa ensimmäinen jakso on pariton. +ODDLPRICE = PARITON.VIIM.NIMELLISARVO ## Palauttaa arvopaperin hinnan tilanteessa, jossa viimeinen jakso on pariton. +ODDLYIELD = PARITON.VIIM.TUOTTO ## Palauttaa arvopaperin tuoton tilanteessa, jossa viimeinen jakso on pariton. +PMT = MAKSU ## Palauttaa annuiteetin kausittaisen maksuerän. +PPMT = PPMT ## Laskee sijoitukselle tai lainalle tiettynä ajanjaksona maksettavan lyhennyksen. +PRICE = HINTA ## Palauttaa hinnan 100 euron nimellisarvoa kohden arvopaperille, jonka korko maksetaan säännöllisin väliajoin. +PRICEDISC = HINTA.DISK ## Palauttaa diskontatun arvopaperin hinnan 100 euron nimellisarvoa kohden. +PRICEMAT = HINTA.LUNASTUS ## Palauttaa hinnan 100 euron nimellisarvoa kohden arvopaperille, jonka korko maksetaan erääntymispäivänä. +PV = NA ## Palauttaa sijoituksen nykyarvon. +RATE = KORKO ## Palauttaa annuiteetin kausittaisen korkokannan. +RECEIVED = SAATU.HINTA ## Palauttaa arvopaperin tuoton erääntymispäivänä kokonaan maksetulle sijoitukselle. +SLN = STP ## Palauttaa sijoituksen tasapoiston yhdeltä jaksolta. +SYD = VUOSIPOISTO ## Palauttaa sijoituksen vuosipoiston annettuna kautena amerikkalaisen SYD-menetelmän (Sum-of-Year's Digits) avulla. +TBILLEQ = OBLIG.TUOTTOPROS ## Palauttaa valtion obligaation tuoton vastaavana joukkovelkakirjan tuottona. +TBILLPRICE = OBLIG.HINTA ## Palauttaa obligaation hinnan 100 euron nimellisarvoa kohden. +TBILLYIELD = OBLIG.TUOTTO ## Palauttaa obligaation tuoton. +VDB = VDB ## Palauttaa annetun kauden tai kauden osan kirjanpidollisen poiston amerikkalaisen DB-menetelmän (Fixed-declining balance) mukaan. +XIRR = SISÄINEN.KORKO.JAKSOTON ## Palauttaa sisäisen korkokannan kassavirtojen sarjoille, jotka eivät välttämättä ole säännöllisiä. +XNPV = NNA.JAKSOTON ## Palauttaa nettonykyarvon kassavirtasarjalle, joka ei välttämättä ole kausittainen. +YIELD = TUOTTO ## Palauttaa tuoton arvopaperille, jonka korko maksetaan säännöllisin väliajoin. +YIELDDISC = TUOTTO.DISK ## Palauttaa diskontatun arvopaperin, kuten obligaation, vuosittaisen tuoton. +YIELDMAT = TUOTTO.ERÄP ## Palauttaa erääntymispäivänään korkoa tuottavan arvopaperin vuosittaisen tuoton. + + +## +## Information functions Erikoisfunktiot +## +CELL = SOLU ## Palauttaa tietoja solun muotoilusta, sijainnista ja sisällöstä. +ERROR.TYPE = VIRHEEN.LAJI ## Palauttaa virhetyyppiä vastaavan luvun. +INFO = KUVAUS ## Palauttaa tietoja nykyisestä käyttöympäristöstä. +ISBLANK = ONTYHJÄ ## Palauttaa arvon TOSI, jos arvo on tyhjä. +ISERR = ONVIRH ## Palauttaa arvon TOSI, jos arvo on mikä tahansa virhearvo paitsi arvo #PUUTTUU!. +ISERROR = ONVIRHE ## Palauttaa arvon TOSI, jos arvo on mikä tahansa virhearvo. +ISEVEN = ONPARILLINEN ## Palauttaa arvon TOSI, jos arvo on parillinen. +ISLOGICAL = ONTOTUUS ## Palauttaa arvon TOSI, jos arvo on mikä tahansa looginen arvo. +ISNA = ONPUUTTUU ## Palauttaa arvon TOSI, jos virhearvo on #PUUTTUU!. +ISNONTEXT = ONEI_TEKSTI ## Palauttaa arvon TOSI, jos arvo ei ole teksti. +ISNUMBER = ONLUKU ## Palauttaa arvon TOSI, jos arvo on luku. +ISODD = ONPARITON ## Palauttaa arvon TOSI, jos arvo on pariton. +ISREF = ONVIITT ## Palauttaa arvon TOSI, jos arvo on viittaus. +ISTEXT = ONTEKSTI ## Palauttaa arvon TOSI, jos arvo on teksti. +N = N ## Palauttaa arvon luvuksi muunnettuna. +NA = PUUTTUU ## Palauttaa virhearvon #PUUTTUU!. +TYPE = TYYPPI ## Palauttaa luvun, joka ilmaisee arvon tietotyypin. + + +## +## Logical functions Loogiset funktiot +## +AND = JA ## Palauttaa arvon TOSI, jos kaikkien argumenttien arvo on TOSI. +FALSE = EPÄTOSI ## Palauttaa totuusarvon EPÄTOSI. +IF = JOS ## Määrittää suoritettavan loogisen testin. +IFERROR = JOSVIRHE ## Palauttaa määrittämäsi arvon, jos kaavan tulos on virhe; muussa tapauksessa palauttaa kaavan tuloksen. +NOT = EI ## Kääntää argumentin loogisen arvon. +OR = TAI ## Palauttaa arvon TOSI, jos minkä tahansa argumentin arvo on TOSI. +TRUE = TOSI ## Palauttaa totuusarvon TOSI. + + +## +## Lookup and reference functions Haku- ja viitefunktiot +## +ADDRESS = OSOITE ## Palauttaa laskentataulukon soluun osoittavan viittauksen tekstinä. +AREAS = ALUEET ## Palauttaa viittauksessa olevien alueiden määrän. +CHOOSE = VALITSE.INDEKSI ## Valitsee arvon arvoluettelosta. +COLUMN = SARAKE ## Palauttaa viittauksen sarakenumeron. +COLUMNS = SARAKKEET ## Palauttaa viittauksessa olevien sarakkeiden määrän. +HLOOKUP = VHAKU ## Suorittaa haun matriisin ylimmältä riviltä ja palauttaa määritetyn solun arvon. +HYPERLINK = HYPERLINKKI ## Luo pikakuvakkeen tai tekstin, joka avaa verkkopalvelimeen, intranetiin tai Internetiin tallennetun tiedoston. +INDEX = INDEKSI ## Valitsee arvon viittauksesta tai matriisista indeksin mukaan. +INDIRECT = EPÄSUORA ## Palauttaa tekstiarvona ilmaistun viittauksen. +LOOKUP = HAKU ## Etsii arvoja vektorista tai matriisista. +MATCH = VASTINE ## Etsii arvoja viittauksesta tai matriisista. +OFFSET = SIIRTYMÄ ## Palauttaa annetun viittauksen siirtymän. +ROW = RIVI ## Palauttaa viittauksen rivinumeron. +ROWS = RIVIT ## Palauttaa viittauksessa olevien rivien määrän. +RTD = RTD ## Noutaa COM-automaatiota (automaatio: Tapa käsitellä sovelluksen objekteja toisesta sovelluksesta tai kehitystyökalusta. Automaatio, jota aiemmin kutsuttiin OLE-automaatioksi, on teollisuusstandardi ja COM-mallin (Component Object Model) ominaisuus.) tukevasta ohjelmasta reaaliaikaisia tietoja. +TRANSPOSE = TRANSPONOI ## Palauttaa matriisin käänteismatriisin. +VLOOKUP = PHAKU ## Suorittaa haun matriisin ensimmäisestä sarakkeesta ja palauttaa rivillä olevan solun arvon. + + +## +## Math and trigonometry functions Matemaattiset ja trigonometriset funktiot +## +ABS = ITSEISARVO ## Palauttaa luvun itseisarvon. +ACOS = ACOS ## Palauttaa luvun arkuskosinin. +ACOSH = ACOSH ## Palauttaa luvun käänteisen hyperbolisen kosinin. +ASIN = ASIN ## Palauttaa luvun arkussinin. +ASINH = ASINH ## Palauttaa luvun käänteisen hyperbolisen sinin. +ATAN = ATAN ## Palauttaa luvun arkustangentin. +ATAN2 = ATAN2 ## Palauttaa arkustangentin x- ja y-koordinaatin perusteella. +ATANH = ATANH ## Palauttaa luvun käänteisen hyperbolisen tangentin. +CEILING = PYÖRISTÄ.KERR.YLÖS ## Pyöristää luvun lähimpään kokonaislukuun tai tarkkuusargumentin lähimpään kerrannaiseen. +COMBIN = KOMBINAATIO ## Palauttaa mahdollisten kombinaatioiden määrän annetulle objektien määrälle. +COS = COS ## Palauttaa luvun kosinin. +COSH = COSH ## Palauttaa luvun hyperbolisen kosinin. +DEGREES = ASTEET ## Muuntaa radiaanit asteiksi. +EVEN = PARILLINEN ## Pyöristää luvun ylöspäin lähimpään parilliseen kokonaislukuun. +EXP = EKSPONENTTI ## Palauttaa e:n korotettuna annetun luvun osoittamaan potenssiin. +FACT = KERTOMA ## Palauttaa luvun kertoman. +FACTDOUBLE = KERTOMA.OSA ## Palauttaa luvun osakertoman. +FLOOR = PYÖRISTÄ.KERR.ALAS ## Pyöristää luvun alaspäin (nollaa kohti). +GCD = SUURIN.YHT.TEKIJÄ ## Palauttaa suurimman yhteisen tekijän. +INT = KOKONAISLUKU ## Pyöristää luvun alaspäin lähimpään kokonaislukuun. +LCM = PIENIN.YHT.JAETTAVA ## Palauttaa pienimmän yhteisen tekijän. +LN = LUONNLOG ## Palauttaa luvun luonnollisen logaritmin. +LOG = LOG ## Laskee luvun logaritmin käyttämällä annettua kantalukua. +LOG10 = LOG10 ## Palauttaa luvun kymmenkantaisen logaritmin. +MDETERM = MDETERM ## Palauttaa matriisin matriisideterminantin. +MINVERSE = MKÄÄNTEINEN ## Palauttaa matriisin käänteismatriisin. +MMULT = MKERRO ## Palauttaa kahden matriisin tulon. +MOD = JAKOJ ## Palauttaa jakolaskun jäännöksen. +MROUND = PYÖRISTÄ.KERR ## Palauttaa luvun pyöristettynä annetun luvun kerrannaiseen. +MULTINOMIAL = MULTINOMI ## Palauttaa lukujoukon multinomin. +ODD = PARITON ## Pyöristää luvun ylöspäin lähimpään parittomaan kokonaislukuun. +PI = PII ## Palauttaa piin arvon. +POWER = POTENSSI ## Palauttaa luvun korotettuna haluttuun potenssiin. +PRODUCT = TULO ## Kertoo annetut argumentit. +QUOTIENT = OSAMÄÄRÄ ## Palauttaa osamäärän kokonaislukuosan. +RADIANS = RADIAANIT ## Muuntaa asteet radiaaneiksi. +RAND = SATUNNAISLUKU ## Palauttaa satunnaisluvun väliltä 0–1. +RANDBETWEEN = SATUNNAISLUKU.VÄLILTÄ ## Palauttaa satunnaisluvun määritettyjen lukujen väliltä. +ROMAN = ROMAN ## Muuntaa arabialaisen numeron tekstimuotoiseksi roomalaiseksi numeroksi. +ROUND = PYÖRISTÄ ## Pyöristää luvun annettuun määrään desimaaleja. +ROUNDDOWN = PYÖRISTÄ.DES.ALAS ## Pyöristää luvun alaspäin (nollaa kohti). +ROUNDUP = PYÖRISTÄ.DES.YLÖS ## Pyöristää luvun ylöspäin (poispäin nollasta). +SERIESSUM = SARJA.SUMMA ## Palauttaa kaavaan perustuvan potenssisarjan arvon. +SIGN = ETUMERKKI ## Palauttaa luvun etumerkin. +SIN = SIN ## Palauttaa annetun kulman sinin. +SINH = SINH ## Palauttaa luvun hyperbolisen sinin. +SQRT = NELIÖJUURI ## Palauttaa positiivisen neliöjuuren. +SQRTPI = NELIÖJUURI.PII ## Palauttaa tulon (luku * pii) neliöjuuren. +SUBTOTAL = VÄLISUMMA ## Palauttaa luettelon tai tietokannan välisumman. +SUM = SUMMA ## Laskee yhteen annetut argumentit. +SUMIF = SUMMA.JOS ## Laskee ehdot täyttävien solujen summan. +SUMIFS = SUMMA.JOS.JOUKKO ## Laskee yhteen solualueen useita ehtoja vastaavat solut. +SUMPRODUCT = TULOJEN.SUMMA ## Palauttaa matriisin toisiaan vastaavien osien tulojen summan. +SUMSQ = NELIÖSUMMA ## Palauttaa argumenttien neliöiden summan. +SUMX2MY2 = NELIÖSUMMIEN.EROTUS ## Palauttaa kahden matriisin toisiaan vastaavien arvojen laskettujen neliösummien erotuksen. +SUMX2PY2 = NELIÖSUMMIEN.SUMMA ## Palauttaa kahden matriisin toisiaan vastaavien arvojen neliösummien summan. +SUMXMY2 = EROTUSTEN.NELIÖSUMMA ## Palauttaa kahden matriisin toisiaan vastaavien arvojen erotusten neliösumman. +TAN = TAN ## Palauttaa luvun tangentin. +TANH = TANH ## Palauttaa luvun hyperbolisen tangentin. +TRUNC = KATKAISE ## Katkaisee luvun kokonaisluvuksi. + + +## +## Statistical functions Tilastolliset funktiot +## +AVEDEV = KESKIPOIKKEAMA ## Palauttaa hajontojen itseisarvojen keskiarvon. +AVERAGE = KESKIARVO ## Palauttaa argumenttien keskiarvon. +AVERAGEA = KESKIARVOA ## Palauttaa argumenttien, mukaan lukien lukujen, tekstin ja loogisten arvojen, keskiarvon. +AVERAGEIF = KESKIARVO.JOS ## Palauttaa alueen niiden solujen keskiarvon (aritmeettisen keskiarvon), jotka täyttävät annetut ehdot. +AVERAGEIFS = KESKIARVO.JOS.JOUKKO ## Palauttaa niiden solujen keskiarvon (aritmeettisen keskiarvon), jotka vastaavat useita ehtoja. +BETADIST = BEETAJAKAUMA ## Palauttaa kumulatiivisen beetajakaumafunktion arvon. +BETAINV = BEETAJAKAUMA.KÄÄNT ## Palauttaa määritetyn beetajakauman käänteisen kumulatiivisen jakaumafunktion arvon. +BINOMDIST = BINOMIJAKAUMA ## Palauttaa yksittäisen termin binomijakaumatodennäköisyyden. +CHIDIST = CHIJAKAUMA ## Palauttaa yksisuuntaisen chi-neliön jakauman todennäköisyyden. +CHIINV = CHIJAKAUMA.KÄÄNT ## Palauttaa yksisuuntaisen chi-neliön jakauman todennäköisyyden käänteisarvon. +CHITEST = CHITESTI ## Palauttaa riippumattomuustestin tuloksen. +CONFIDENCE = LUOTTAMUSVÄLI ## Palauttaa luottamusvälin populaation keskiarvolle. +CORREL = KORRELAATIO ## Palauttaa kahden arvojoukon korrelaatiokertoimen. +COUNT = LASKE ## Laskee argumenttiluettelossa olevien lukujen määrän. +COUNTA = LASKE.A ## Laskee argumenttiluettelossa olevien arvojen määrän. +COUNTBLANK = LASKE.TYHJÄT ## Laskee alueella olevien tyhjien solujen määrän. +COUNTIF = LASKE.JOS ## Laskee alueella olevien sellaisten solujen määrän, joiden sisältö vastaa annettuja ehtoja. +COUNTIFS = LASKE.JOS.JOUKKO ## Laskee alueella olevien sellaisten solujen määrän, joiden sisältö vastaa useita ehtoja. +COVAR = KOVARIANSSI ## Palauttaa kovarianssin, joka on keskiarvo havaintoaineiston kunkin pisteparin poikkeamien tuloista. +CRITBINOM = BINOMIJAKAUMA.KRIT ## Palauttaa pienimmän arvon, jossa binomijakauman kertymäfunktion arvo on pienempi tai yhtä suuri kuin vertailuarvo. +DEVSQ = OIKAISTU.NELIÖSUMMA ## Palauttaa keskipoikkeamien neliösumman. +EXPONDIST = EKSPONENTIAALIJAKAUMA ## Palauttaa eksponentiaalijakauman. +FDIST = FJAKAUMA ## Palauttaa F-todennäköisyysjakauman. +FINV = FJAKAUMA.KÄÄNT ## Palauttaa F-todennäköisyysjakauman käänteisfunktion. +FISHER = FISHER ## Palauttaa Fisher-muunnoksen. +FISHERINV = FISHER.KÄÄNT ## Palauttaa käänteisen Fisher-muunnoksen. +FORECAST = ENNUSTE ## Palauttaa lineaarisen trendin arvon. +FREQUENCY = TAAJUUS ## Palauttaa frekvenssijakautuman pystysuuntaisena matriisina. +FTEST = FTESTI ## Palauttaa F-testin tuloksen. +GAMMADIST = GAMMAJAKAUMA ## Palauttaa gammajakauman. +GAMMAINV = GAMMAJAKAUMA.KÄÄNT ## Palauttaa käänteisen gammajakauman kertymäfunktion. +GAMMALN = GAMMALN ## Palauttaa gammafunktion luonnollisen logaritmin G(x). +GEOMEAN = KESKIARVO.GEOM ## Palauttaa geometrisen keskiarvon. +GROWTH = KASVU ## Palauttaa eksponentiaalisen trendin arvon. +HARMEAN = KESKIARVO.HARM ## Palauttaa harmonisen keskiarvon. +HYPGEOMDIST = HYPERGEOM.JAKAUMA ## Palauttaa hypergeometrisen jakauman. +INTERCEPT = LEIKKAUSPISTE ## Palauttaa lineaarisen regressiosuoran leikkauspisteen. +KURT = KURT ## Palauttaa tietoalueen vinous-arvon eli huipukkuuden. +LARGE = SUURI ## Palauttaa tietojoukon k:nneksi suurimman arvon. +LINEST = LINREGR ## Palauttaa lineaarisen trendin parametrit. +LOGEST = LOGREGR ## Palauttaa eksponentiaalisen trendin parametrit. +LOGINV = LOGNORM.JAKAUMA.KÄÄNT ## Palauttaa lognormeeratun jakauman käänteisfunktion. +LOGNORMDIST = LOGNORM.JAKAUMA ## Palauttaa lognormaalisen jakauman kertymäfunktion. +MAX = MAKS ## Palauttaa suurimman arvon argumenttiluettelosta. +MAXA = MAKSA ## Palauttaa argumenttien, mukaan lukien lukujen, tekstin ja loogisten arvojen, suurimman arvon. +MEDIAN = MEDIAANI ## Palauttaa annettujen lukujen mediaanin. +MIN = MIN ## Palauttaa pienimmän arvon argumenttiluettelosta. +MINA = MINA ## Palauttaa argumenttien, mukaan lukien lukujen, tekstin ja loogisten arvojen, pienimmän arvon. +MODE = MOODI ## Palauttaa tietojoukossa useimmin esiintyvän arvon. +NEGBINOMDIST = BINOMIJAKAUMA.NEG ## Palauttaa negatiivisen binomijakauman. +NORMDIST = NORM.JAKAUMA ## Palauttaa normaalijakauman kertymäfunktion. +NORMINV = NORM.JAKAUMA.KÄÄNT ## Palauttaa käänteisen normaalijakauman kertymäfunktion. +NORMSDIST = NORM.JAKAUMA.NORMIT ## Palauttaa normitetun normaalijakauman kertymäfunktion. +NORMSINV = NORM.JAKAUMA.NORMIT.KÄÄNT ## Palauttaa normitetun normaalijakauman kertymäfunktion käänteisarvon. +PEARSON = PEARSON ## Palauttaa Pearsonin tulomomenttikorrelaatiokertoimen. +PERCENTILE = PROSENTTIPISTE ## Palauttaa alueen arvojen k:nnen prosenttipisteen. +PERCENTRANK = PROSENTTIJÄRJESTYS ## Palauttaa tietojoukon arvon prosentuaalisen järjestysluvun. +PERMUT = PERMUTAATIO ## Palauttaa mahdollisten permutaatioiden määrän annetulle objektien määrälle. +POISSON = POISSON ## Palauttaa Poissonin todennäköisyysjakauman. +PROB = TODENNÄKÖISYYS ## Palauttaa todennäköisyyden sille, että arvot ovat tietyltä väliltä. +QUARTILE = NELJÄNNES ## Palauttaa tietoalueen neljänneksen. +RANK = ARVON.MUKAAN ## Palauttaa luvun paikan lukuarvoluettelossa. +RSQ = PEARSON.NELIÖ ## Palauttaa Pearsonin tulomomenttikorrelaatiokertoimen neliön. +SKEW = JAKAUMAN.VINOUS ## Palauttaa jakauman vinouden. +SLOPE = KULMAKERROIN ## Palauttaa lineaarisen regressiosuoran kulmakertoimen. +SMALL = PIENI ## Palauttaa tietojoukon k:nneksi pienimmän arvon. +STANDARDIZE = NORMITA ## Palauttaa normitetun arvon. +STDEV = KESKIHAJONTA ## Laskee populaation keskihajonnan otoksen perusteella. +STDEVA = KESKIHAJONTAA ## Laskee populaation keskihajonnan otoksen perusteella, mukaan lukien luvut, tekstin ja loogiset arvot. +STDEVP = KESKIHAJONTAP ## Laskee normaalijakautuman koko populaation perusteella. +STDEVPA = KESKIHAJONTAPA ## Laskee populaation keskihajonnan koko populaation perusteella, mukaan lukien luvut, tekstin ja totuusarvot. +STEYX = KESKIVIRHE ## Palauttaa regression kutakin x-arvoa vastaavan ennustetun y-arvon keskivirheen. +TDIST = TJAKAUMA ## Palauttaa t-jakautuman. +TINV = TJAKAUMA.KÄÄNT ## Palauttaa käänteisen t-jakauman. +TREND = SUUNTAUS ## Palauttaa lineaarisen trendin arvoja. +TRIMMEAN = KESKIARVO.TASATTU ## Palauttaa tietojoukon tasatun keskiarvon. +TTEST = TTESTI ## Palauttaa t-testiin liittyvän todennäköisyyden. +VAR = VAR ## Arvioi populaation varianssia otoksen perusteella. +VARA = VARA ## Laskee populaation varianssin otoksen perusteella, mukaan lukien luvut, tekstin ja loogiset arvot. +VARP = VARP ## Laskee varianssin koko populaation perusteella. +VARPA = VARPA ## Laskee populaation varianssin koko populaation perusteella, mukaan lukien luvut, tekstin ja totuusarvot. +WEIBULL = WEIBULL ## Palauttaa Weibullin jakauman. +ZTEST = ZTESTI ## Palauttaa z-testin yksisuuntaisen todennäköisyysarvon. + + +## +## Text functions Tekstifunktiot +## +ASC = ASC ## Muuntaa merkkijonossa olevat englanninkieliset DBCS- tai katakana-merkit SBCS-merkeiksi. +BAHTTEXT = BAHTTEKSTI ## Muuntaa luvun tekstiksi ß (baht) -valuuttamuotoa käyttämällä. +CHAR = MERKKI ## Palauttaa koodin lukua vastaavan merkin. +CLEAN = SIIVOA ## Poistaa tekstistä kaikki tulostumattomat merkit. +CODE = KOODI ## Palauttaa tekstimerkkijonon ensimmäisen merkin numerokoodin. +CONCATENATE = KETJUTA ## Yhdistää useat merkkijonot yhdeksi merkkijonoksi. +DOLLAR = VALUUTTA ## Muuntaa luvun tekstiksi $ (dollari) -valuuttamuotoa käyttämällä. +EXACT = VERTAA ## Tarkistaa, ovatko kaksi tekstiarvoa samanlaiset. +FIND = ETSI ## Etsii tekstiarvon toisen tekstin sisältä (tunnistaa isot ja pienet kirjaimet). +FINDB = ETSIB ## Etsii tekstiarvon toisen tekstin sisältä (tunnistaa isot ja pienet kirjaimet). +FIXED = KIINTEÄ ## Muotoilee luvun tekstiksi, jossa on kiinteä määrä desimaaleja. +JIS = JIS ## Muuntaa merkkijonossa olevat englanninkieliset SBCS- tai katakana-merkit DBCS-merkeiksi. +LEFT = VASEN ## Palauttaa tekstiarvon vasemmanpuoliset merkit. +LEFTB = VASENB ## Palauttaa tekstiarvon vasemmanpuoliset merkit. +LEN = PITUUS ## Palauttaa tekstimerkkijonon merkkien määrän. +LENB = PITUUSB ## Palauttaa tekstimerkkijonon merkkien määrän. +LOWER = PIENET ## Muuntaa tekstin pieniksi kirjaimiksi. +MID = POIMI.TEKSTI ## Palauttaa määritetyn määrän merkkejä merkkijonosta alkaen annetusta kohdasta. +MIDB = POIMI.TEKSTIB ## Palauttaa määritetyn määrän merkkejä merkkijonosta alkaen annetusta kohdasta. +PHONETIC = FONEETTINEN ## Hakee foneettiset (furigana) merkit merkkijonosta. +PROPER = ERISNIMI ## Muuttaa merkkijonon kunkin sanan ensimmäisen kirjaimen isoksi. +REPLACE = KORVAA ## Korvaa tekstissä olevat merkit. +REPLACEB = KORVAAB ## Korvaa tekstissä olevat merkit. +REPT = TOISTA ## Toistaa tekstin annetun määrän kertoja. +RIGHT = OIKEA ## Palauttaa tekstiarvon oikeanpuoliset merkit. +RIGHTB = OIKEAB ## Palauttaa tekstiarvon oikeanpuoliset merkit. +SEARCH = KÄY.LÄPI ## Etsii tekstiarvon toisen tekstin sisältä (isot ja pienet kirjaimet tulkitaan samoiksi merkeiksi). +SEARCHB = KÄY.LÄPIB ## Etsii tekstiarvon toisen tekstin sisältä (isot ja pienet kirjaimet tulkitaan samoiksi merkeiksi). +SUBSTITUTE = VAIHDA ## Korvaa merkkijonossa olevan tekstin toisella. +T = T ## Muuntaa argumentit tekstiksi. +TEXT = TEKSTI ## Muotoilee luvun ja muuntaa sen tekstiksi. +TRIM = POISTA.VÄLIT ## Poistaa välilyönnit tekstistä. +UPPER = ISOT ## Muuntaa tekstin isoiksi kirjaimiksi. +VALUE = ARVO ## Muuntaa tekstiargumentin luvuksi. diff --git a/extend/PHPExcel/PHPExcel/locale/fr/config b/extend/PHPExcel/PHPExcel/locale/fr/config new file mode 100644 index 0000000..1f5db88 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/fr/config @@ -0,0 +1,47 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = € + + +## +## Excel Error Codes (For future use) +## +NULL = #NUL! +DIV0 = #DIV/0! +VALUE = #VALEUR! +REF = #REF! +NAME = #NOM? +NUM = #NOMBRE! +NA = #N/A diff --git a/extend/PHPExcel/PHPExcel/locale/fr/functions b/extend/PHPExcel/PHPExcel/locale/fr/functions new file mode 100644 index 0000000..03b80e5 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/fr/functions @@ -0,0 +1,438 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Calculation +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ +## +## + + +## +## Add-in and Automation functions Fonctions de complément et d’automatisation +## +GETPIVOTDATA = LIREDONNEESTABCROISDYNAMIQUE ## Renvoie les données stockées dans un rapport de tableau croisé dynamique. + + +## +## Cube functions Fonctions Cube +## +CUBEKPIMEMBER = MEMBREKPICUBE ## Renvoie un nom, une propriété et une mesure d’indicateur de performance clé et affiche le nom et la propriété dans la cellule. Un indicateur de performance clé est une mesure quantifiable, telle que la marge bénéficiaire brute mensuelle ou la rotation trimestrielle du personnel, utilisée pour évaluer les performances d’une entreprise. +CUBEMEMBER = MEMBRECUBE ## Renvoie un membre ou un uplet dans une hiérarchie de cubes. Utilisez cette fonction pour valider l’existence du membre ou de l’uplet dans le cube. +CUBEMEMBERPROPERTY = PROPRIETEMEMBRECUBE ## Renvoie la valeur d’une propriété de membre du cube. Utilisez cette fonction pour valider l’existence d’un nom de membre dans le cube et pour renvoyer la propriété spécifiée pour ce membre. +CUBERANKEDMEMBER = RANGMEMBRECUBE ## Renvoie le nième membre ou le membre placé à un certain rang dans un ensemble. Utilisez cette fonction pour renvoyer un ou plusieurs éléments d’un ensemble, tels que les meilleurs vendeurs ou les 10 meilleurs étudiants. +CUBESET = JEUCUBE ## Définit un ensemble calculé de membres ou d’uplets en envoyant une expression définie au cube sur le serveur qui crée l’ensemble et le renvoie à Microsoft Office Excel. +CUBESETCOUNT = NBJEUCUBE ## Renvoie le nombre d’éléments dans un jeu. +CUBEVALUE = VALEURCUBE ## Renvoie une valeur d’agrégation issue d’un cube. + + +## +## Database functions Fonctions de base de données +## +DAVERAGE = BDMOYENNE ## Renvoie la moyenne des entrées de base de données sélectionnées. +DCOUNT = BCOMPTE ## Compte le nombre de cellules d’une base de données qui contiennent des nombres. +DCOUNTA = BDNBVAL ## Compte les cellules non vides d’une base de données. +DGET = BDLIRE ## Extrait d’une base de données un enregistrement unique répondant aux critères spécifiés. +DMAX = BDMAX ## Renvoie la valeur maximale des entrées de base de données sélectionnées. +DMIN = BDMIN ## Renvoie la valeur minimale des entrées de base de données sélectionnées. +DPRODUCT = BDPRODUIT ## Multiplie les valeurs d’un champ particulier des enregistrements d’une base de données, qui répondent aux critères spécifiés. +DSTDEV = BDECARTYPE ## Calcule l’écart type pour un échantillon d’entrées de base de données sélectionnées. +DSTDEVP = BDECARTYPEP ## Calcule l’écart type pour l’ensemble d’une population d’entrées de base de données sélectionnées. +DSUM = BDSOMME ## Ajoute les nombres dans la colonne de champ des enregistrements de la base de données, qui répondent aux critères. +DVAR = BDVAR ## Calcule la variance pour un échantillon d’entrées de base de données sélectionnées. +DVARP = BDVARP ## Calcule la variance pour l’ensemble d’une population d’entrées de base de données sélectionnées. + + +## +## Date and time functions Fonctions de date et d’heure +## +DATE = DATE ## Renvoie le numéro de série d’une date précise. +DATEVALUE = DATEVAL ## Convertit une date représentée sous forme de texte en numéro de série. +DAY = JOUR ## Convertit un numéro de série en jour du mois. +DAYS360 = JOURS360 ## Calcule le nombre de jours qui séparent deux dates sur la base d’une année de 360 jours. +EDATE = MOIS.DECALER ## Renvoie le numéro séquentiel de la date qui représente une date spécifiée (l’argument date_départ), corrigée en plus ou en moins du nombre de mois indiqué. +EOMONTH = FIN.MOIS ## Renvoie le numéro séquentiel de la date du dernier jour du mois précédant ou suivant la date_départ du nombre de mois indiqué. +HOUR = HEURE ## Convertit un numéro de série en heure. +MINUTE = MINUTE ## Convertit un numéro de série en minute. +MONTH = MOIS ## Convertit un numéro de série en mois. +NETWORKDAYS = NB.JOURS.OUVRES ## Renvoie le nombre de jours ouvrés entiers compris entre deux dates. +NOW = MAINTENANT ## Renvoie le numéro de série de la date et de l’heure du jour. +SECOND = SECONDE ## Convertit un numéro de série en seconde. +TIME = TEMPS ## Renvoie le numéro de série d’une heure précise. +TIMEVALUE = TEMPSVAL ## Convertit une date représentée sous forme de texte en numéro de série. +TODAY = AUJOURDHUI ## Renvoie le numéro de série de la date du jour. +WEEKDAY = JOURSEM ## Convertit un numéro de série en jour de la semaine. +WEEKNUM = NO.SEMAINE ## Convertit un numéro de série en un numéro représentant l’ordre de la semaine dans l’année. +WORKDAY = SERIE.JOUR.OUVRE ## Renvoie le numéro de série de la date avant ou après le nombre de jours ouvrés spécifiés. +YEAR = ANNEE ## Convertit un numéro de série en année. +YEARFRAC = FRACTION.ANNEE ## Renvoie la fraction de l’année représentant le nombre de jours entre la date de début et la date de fin. + + +## +## Engineering functions Fonctions d’ingénierie +## +BESSELI = BESSELI ## Renvoie la fonction Bessel modifiée In(x). +BESSELJ = BESSELJ ## Renvoie la fonction Bessel Jn(x). +BESSELK = BESSELK ## Renvoie la fonction Bessel modifiée Kn(x). +BESSELY = BESSELY ## Renvoie la fonction Bessel Yn(x). +BIN2DEC = BINDEC ## Convertit un nombre binaire en nombre décimal. +BIN2HEX = BINHEX ## Convertit un nombre binaire en nombre hexadécimal. +BIN2OCT = BINOCT ## Convertit un nombre binaire en nombre octal. +COMPLEX = COMPLEXE ## Convertit des coefficients réel et imaginaire en un nombre complexe. +CONVERT = CONVERT ## Convertit un nombre d’une unité de mesure à une autre. +DEC2BIN = DECBIN ## Convertit un nombre décimal en nombre binaire. +DEC2HEX = DECHEX ## Convertit un nombre décimal en nombre hexadécimal. +DEC2OCT = DECOCT ## Convertit un nombre décimal en nombre octal. +DELTA = DELTA ## Teste l’égalité de deux nombres. +ERF = ERF ## Renvoie la valeur de la fonction d’erreur. +ERFC = ERFC ## Renvoie la valeur de la fonction d’erreur complémentaire. +GESTEP = SUP.SEUIL ## Teste si un nombre est supérieur à une valeur de seuil. +HEX2BIN = HEXBIN ## Convertit un nombre hexadécimal en nombre binaire. +HEX2DEC = HEXDEC ## Convertit un nombre hexadécimal en nombre décimal. +HEX2OCT = HEXOCT ## Convertit un nombre hexadécimal en nombre octal. +IMABS = COMPLEXE.MODULE ## Renvoie la valeur absolue (module) d’un nombre complexe. +IMAGINARY = COMPLEXE.IMAGINAIRE ## Renvoie le coefficient imaginaire d’un nombre complexe. +IMARGUMENT = COMPLEXE.ARGUMENT ## Renvoie l’argument thêta, un angle exprimé en radians. +IMCONJUGATE = COMPLEXE.CONJUGUE ## Renvoie le nombre complexe conjugué d’un nombre complexe. +IMCOS = IMCOS ## Renvoie le cosinus d’un nombre complexe. +IMDIV = COMPLEXE.DIV ## Renvoie le quotient de deux nombres complexes. +IMEXP = COMPLEXE.EXP ## Renvoie la fonction exponentielle d’un nombre complexe. +IMLN = COMPLEXE.LN ## Renvoie le logarithme népérien d’un nombre complexe. +IMLOG10 = COMPLEXE.LOG10 ## Calcule le logarithme en base 10 d’un nombre complexe. +IMLOG2 = COMPLEXE.LOG2 ## Calcule le logarithme en base 2 d’un nombre complexe. +IMPOWER = COMPLEXE.PUISSANCE ## Renvoie un nombre complexe élevé à une puissance entière. +IMPRODUCT = COMPLEXE.PRODUIT ## Renvoie le produit de plusieurs nombres complexes. +IMREAL = COMPLEXE.REEL ## Renvoie le coefficient réel d’un nombre complexe. +IMSIN = COMPLEXE.SIN ## Renvoie le sinus d’un nombre complexe. +IMSQRT = COMPLEXE.RACINE ## Renvoie la racine carrée d’un nombre complexe. +IMSUB = COMPLEXE.DIFFERENCE ## Renvoie la différence entre deux nombres complexes. +IMSUM = COMPLEXE.SOMME ## Renvoie la somme de plusieurs nombres complexes. +OCT2BIN = OCTBIN ## Convertit un nombre octal en nombre binaire. +OCT2DEC = OCTDEC ## Convertit un nombre octal en nombre décimal. +OCT2HEX = OCTHEX ## Convertit un nombre octal en nombre hexadécimal. + + +## +## Financial functions Fonctions financières +## +ACCRINT = INTERET.ACC ## Renvoie l’intérêt couru non échu d’un titre dont l’intérêt est perçu périodiquement. +ACCRINTM = INTERET.ACC.MAT ## Renvoie l’intérêt couru non échu d’un titre dont l’intérêt est perçu à l’échéance. +AMORDEGRC = AMORDEGRC ## Renvoie l’amortissement correspondant à chaque période comptable en utilisant un coefficient d’amortissement. +AMORLINC = AMORLINC ## Renvoie l’amortissement d’un bien à la fin d’une période fiscale donnée. +COUPDAYBS = NB.JOURS.COUPON.PREC ## Renvoie le nombre de jours entre le début de la période de coupon et la date de liquidation. +COUPDAYS = NB.JOURS.COUPONS ## Renvoie le nombre de jours pour la période du coupon contenant la date de liquidation. +COUPDAYSNC = NB.JOURS.COUPON.SUIV ## Renvoie le nombre de jours entre la date de liquidation et la date du coupon suivant la date de liquidation. +COUPNCD = DATE.COUPON.SUIV ## Renvoie la première date de coupon ultérieure à la date de règlement. +COUPNUM = NB.COUPONS ## Renvoie le nombre de coupons dus entre la date de règlement et la date d’échéance. +COUPPCD = DATE.COUPON.PREC ## Renvoie la date de coupon précédant la date de règlement. +CUMIPMT = CUMUL.INTER ## Renvoie l’intérêt cumulé payé sur un emprunt entre deux périodes. +CUMPRINC = CUMUL.PRINCPER ## Renvoie le montant cumulé des remboursements du capital d’un emprunt effectués entre deux périodes. +DB = DB ## Renvoie l’amortissement d’un bien pour une période spécifiée en utilisant la méthode de l’amortissement dégressif à taux fixe. +DDB = DDB ## Renvoie l’amortissement d’un bien pour toute période spécifiée, en utilisant la méthode de l’amortissement dégressif à taux double ou selon un coefficient à spécifier. +DISC = TAUX.ESCOMPTE ## Calcule le taux d’escompte d’une transaction. +DOLLARDE = PRIX.DEC ## Convertit un prix en euros, exprimé sous forme de fraction, en un prix en euros exprimé sous forme de nombre décimal. +DOLLARFR = PRIX.FRAC ## Convertit un prix en euros, exprimé sous forme de nombre décimal, en un prix en euros exprimé sous forme de fraction. +DURATION = DUREE ## Renvoie la durée, en années, d’un titre dont l’intérêt est perçu périodiquement. +EFFECT = TAUX.EFFECTIF ## Renvoie le taux d’intérêt annuel effectif. +FV = VC ## Renvoie la valeur future d’un investissement. +FVSCHEDULE = VC.PAIEMENTS ## Calcule la valeur future d’un investissement en appliquant une série de taux d’intérêt composites. +INTRATE = TAUX.INTERET ## Affiche le taux d’intérêt d’un titre totalement investi. +IPMT = INTPER ## Calcule le montant des intérêts d’un investissement pour une période donnée. +IRR = TRI ## Calcule le taux de rentabilité interne d’un investissement pour une succession de trésoreries. +ISPMT = ISPMT ## Calcule le montant des intérêts d’un investissement pour une période donnée. +MDURATION = DUREE.MODIFIEE ## Renvoie la durée de Macauley modifiée pour un titre ayant une valeur nominale hypothétique de 100_euros. +MIRR = TRIM ## Calcule le taux de rentabilité interne lorsque les paiements positifs et négatifs sont financés à des taux différents. +NOMINAL = TAUX.NOMINAL ## Calcule le taux d’intérêt nominal annuel. +NPER = NPM ## Renvoie le nombre de versements nécessaires pour rembourser un emprunt. +NPV = VAN ## Calcule la valeur actuelle nette d’un investissement basé sur une série de décaissements et un taux d’escompte. +ODDFPRICE = PRIX.PCOUPON.IRREG ## Renvoie le prix par tranche de valeur nominale de 100 euros d’un titre dont la première période de coupon est irrégulière. +ODDFYIELD = REND.PCOUPON.IRREG ## Renvoie le taux de rendement d’un titre dont la première période de coupon est irrégulière. +ODDLPRICE = PRIX.DCOUPON.IRREG ## Renvoie le prix par tranche de valeur nominale de 100 euros d’un titre dont la première période de coupon est irrégulière. +ODDLYIELD = REND.DCOUPON.IRREG ## Renvoie le taux de rendement d’un titre dont la dernière période de coupon est irrégulière. +PMT = VPM ## Calcule le paiement périodique d’un investissement donné. +PPMT = PRINCPER ## Calcule, pour une période donnée, la part de remboursement du principal d’un investissement. +PRICE = PRIX.TITRE ## Renvoie le prix d’un titre rapportant des intérêts périodiques, pour une valeur nominale de 100 euros. +PRICEDISC = VALEUR.ENCAISSEMENT ## Renvoie la valeur d’encaissement d’un escompte commercial, pour une valeur nominale de 100 euros. +PRICEMAT = PRIX.TITRE.ECHEANCE ## Renvoie le prix d’un titre dont la valeur nominale est 100 euros et qui rapporte des intérêts à l’échéance. +PV = PV ## Calcule la valeur actuelle d’un investissement. +RATE = TAUX ## Calcule le taux d’intérêt par période pour une annuité. +RECEIVED = VALEUR.NOMINALE ## Renvoie la valeur nominale à échéance d’un effet de commerce. +SLN = AMORLIN ## Calcule l’amortissement linéaire d’un bien pour une période donnée. +SYD = SYD ## Calcule l’amortissement d’un bien pour une période donnée sur la base de la méthode américaine Sum-of-Years Digits (amortissement dégressif à taux décroissant appliqué à une valeur constante). +TBILLEQ = TAUX.ESCOMPTE.R ## Renvoie le taux d’escompte rationnel d’un bon du Trésor. +TBILLPRICE = PRIX.BON.TRESOR ## Renvoie le prix d’un bon du Trésor d’une valeur nominale de 100 euros. +TBILLYIELD = RENDEMENT.BON.TRESOR ## Calcule le taux de rendement d’un bon du Trésor. +VDB = VDB ## Renvoie l’amortissement d’un bien pour une période spécifiée ou partielle en utilisant une méthode de l’amortissement dégressif à taux fixe. +XIRR = TRI.PAIEMENTS ## Calcule le taux de rentabilité interne d’un ensemble de paiements non périodiques. +XNPV = VAN.PAIEMENTS ## Renvoie la valeur actuelle nette d’un ensemble de paiements non périodiques. +YIELD = RENDEMENT.TITRE ## Calcule le rendement d’un titre rapportant des intérêts périodiquement. +YIELDDISC = RENDEMENT.SIMPLE ## Calcule le taux de rendement d’un emprunt à intérêt simple (par exemple, un bon du Trésor). +YIELDMAT = RENDEMENT.TITRE.ECHEANCE ## Renvoie le rendement annuel d’un titre qui rapporte des intérêts à l’échéance. + + +## +## Information functions Fonctions d’information +## +CELL = CELLULE ## Renvoie des informations sur la mise en forme, l’emplacement et le contenu d’une cellule. +ERROR.TYPE = TYPE.ERREUR ## Renvoie un nombre correspondant à un type d’erreur. +INFO = INFORMATIONS ## Renvoie des informations sur l’environnement d’exploitation actuel. +ISBLANK = ESTVIDE ## Renvoie VRAI si l’argument valeur est vide. +ISERR = ESTERR ## Renvoie VRAI si l’argument valeur fait référence à une valeur d’erreur, sauf #N/A. +ISERROR = ESTERREUR ## Renvoie VRAI si l’argument valeur fait référence à une valeur d’erreur. +ISEVEN = EST.PAIR ## Renvoie VRAI si le chiffre est pair. +ISLOGICAL = ESTLOGIQUE ## Renvoie VRAI si l’argument valeur fait référence à une valeur logique. +ISNA = ESTNA ## Renvoie VRAI si l’argument valeur fait référence à la valeur d’erreur #N/A. +ISNONTEXT = ESTNONTEXTE ## Renvoie VRAI si l’argument valeur ne se présente pas sous forme de texte. +ISNUMBER = ESTNUM ## Renvoie VRAI si l’argument valeur représente un nombre. +ISODD = EST.IMPAIR ## Renvoie VRAI si le chiffre est impair. +ISREF = ESTREF ## Renvoie VRAI si l’argument valeur est une référence. +ISTEXT = ESTTEXTE ## Renvoie VRAI si l’argument valeur se présente sous forme de texte. +N = N ## Renvoie une valeur convertie en nombre. +NA = NA ## Renvoie la valeur d’erreur #N/A. +TYPE = TYPE ## Renvoie un nombre indiquant le type de données d’une valeur. + + +## +## Logical functions Fonctions logiques +## +AND = ET ## Renvoie VRAI si tous ses arguments sont VRAI. +FALSE = FAUX ## Renvoie la valeur logique FAUX. +IF = SI ## Spécifie un test logique à effectuer. +IFERROR = SIERREUR ## Renvoie une valeur que vous spécifiez si une formule génère une erreur ; sinon, elle renvoie le résultat de la formule. +NOT = NON ## Inverse la logique de cet argument. +OR = OU ## Renvoie VRAI si un des arguments est VRAI. +TRUE = VRAI ## Renvoie la valeur logique VRAI. + + +## +## Lookup and reference functions Fonctions de recherche et de référence +## +ADDRESS = ADRESSE ## Renvoie une référence sous forme de texte à une seule cellule d’une feuille de calcul. +AREAS = ZONES ## Renvoie le nombre de zones dans une référence. +CHOOSE = CHOISIR ## Choisit une valeur dans une liste. +COLUMN = COLONNE ## Renvoie le numéro de colonne d’une référence. +COLUMNS = COLONNES ## Renvoie le nombre de colonnes dans une référence. +HLOOKUP = RECHERCHEH ## Effectue une recherche dans la première ligne d’une matrice et renvoie la valeur de la cellule indiquée. +HYPERLINK = LIEN_HYPERTEXTE ## Crée un raccourci ou un renvoi qui ouvre un document stocké sur un serveur réseau, sur un réseau Intranet ou sur Internet. +INDEX = INDEX ## Utilise un index pour choisir une valeur provenant d’une référence ou d’une matrice. +INDIRECT = INDIRECT ## Renvoie une référence indiquée par une valeur de texte. +LOOKUP = RECHERCHE ## Recherche des valeurs dans un vecteur ou une matrice. +MATCH = EQUIV ## Recherche des valeurs dans une référence ou une matrice. +OFFSET = DECALER ## Renvoie une référence décalée par rapport à une référence donnée. +ROW = LIGNE ## Renvoie le numéro de ligne d’une référence. +ROWS = LIGNES ## Renvoie le nombre de lignes dans une référence. +RTD = RTD ## Extrait les données en temps réel à partir d’un programme prenant en charge l’automation COM (Automation : utilisation des objets d'une application à partir d'une autre application ou d'un autre outil de développement. Autrefois appelée OLE Automation, Automation est une norme industrielle et une fonctionnalité du modèle d'objet COM (Component Object Model).). +TRANSPOSE = TRANSPOSE ## Renvoie la transposition d’une matrice. +VLOOKUP = RECHERCHEV ## Effectue une recherche dans la première colonne d’une matrice et se déplace sur la ligne pour renvoyer la valeur d’une cellule. + + +## +## Math and trigonometry functions Fonctions mathématiques et trigonométriques +## +ABS = ABS ## Renvoie la valeur absolue d’un nombre. +ACOS = ACOS ## Renvoie l’arccosinus d’un nombre. +ACOSH = ACOSH ## Renvoie le cosinus hyperbolique inverse d’un nombre. +ASIN = ASIN ## Renvoie l’arcsinus d’un nombre. +ASINH = ASINH ## Renvoie le sinus hyperbolique inverse d’un nombre. +ATAN = ATAN ## Renvoie l’arctangente d’un nombre. +ATAN2 = ATAN2 ## Renvoie l’arctangente des coordonnées x et y. +ATANH = ATANH ## Renvoie la tangente hyperbolique inverse d’un nombre. +CEILING = PLAFOND ## Arrondit un nombre au nombre entier le plus proche ou au multiple le plus proche de l’argument précision en s’éloignant de zéro. +COMBIN = COMBIN ## Renvoie le nombre de combinaisons que l’on peut former avec un nombre donné d’objets. +COS = COS ## Renvoie le cosinus d’un nombre. +COSH = COSH ## Renvoie le cosinus hyperbolique d’un nombre. +DEGREES = DEGRES ## Convertit des radians en degrés. +EVEN = PAIR ## Arrondit un nombre au nombre entier pair le plus proche en s’éloignant de zéro. +EXP = EXP ## Renvoie e élevé à la puissance d’un nombre donné. +FACT = FACT ## Renvoie la factorielle d’un nombre. +FACTDOUBLE = FACTDOUBLE ## Renvoie la factorielle double d’un nombre. +FLOOR = PLANCHER ## Arrondit un nombre en tendant vers 0 (zéro). +GCD = PGCD ## Renvoie le plus grand commun diviseur. +INT = ENT ## Arrondit un nombre à l’entier immédiatement inférieur. +LCM = PPCM ## Renvoie le plus petit commun multiple. +LN = LN ## Renvoie le logarithme népérien d’un nombre. +LOG = LOG ## Renvoie le logarithme d’un nombre dans la base spécifiée. +LOG10 = LOG10 ## Calcule le logarithme en base 10 d’un nombre. +MDETERM = DETERMAT ## Renvoie le déterminant d’une matrice. +MINVERSE = INVERSEMAT ## Renvoie la matrice inverse d’une matrice. +MMULT = PRODUITMAT ## Renvoie le produit de deux matrices. +MOD = MOD ## Renvoie le reste d’une division. +MROUND = ARRONDI.AU.MULTIPLE ## Donne l’arrondi d’un nombre au multiple spécifié. +MULTINOMIAL = MULTINOMIALE ## Calcule la multinomiale d’un ensemble de nombres. +ODD = IMPAIR ## Renvoie le nombre, arrondi à la valeur du nombre entier impair le plus proche en s’éloignant de zéro. +PI = PI ## Renvoie la valeur de pi. +POWER = PUISSANCE ## Renvoie la valeur du nombre élevé à une puissance. +PRODUCT = PRODUIT ## Multiplie ses arguments. +QUOTIENT = QUOTIENT ## Renvoie la partie entière du résultat d’une division. +RADIANS = RADIANS ## Convertit des degrés en radians. +RAND = ALEA ## Renvoie un nombre aléatoire compris entre 0 et 1. +RANDBETWEEN = ALEA.ENTRE.BORNES ## Renvoie un nombre aléatoire entre les nombres que vous spécifiez. +ROMAN = ROMAIN ## Convertit des chiffres arabes en chiffres romains, sous forme de texte. +ROUND = ARRONDI ## Arrondit un nombre au nombre de chiffres indiqué. +ROUNDDOWN = ARRONDI.INF ## Arrondit un nombre en tendant vers 0 (zéro). +ROUNDUP = ARRONDI.SUP ## Arrondit un nombre à l’entier supérieur, en s’éloignant de zéro. +SERIESSUM = SOMME.SERIES ## Renvoie la somme d’une série géométrique en s’appuyant sur la formule suivante : +SIGN = SIGNE ## Renvoie le signe d’un nombre. +SIN = SIN ## Renvoie le sinus d’un angle donné. +SINH = SINH ## Renvoie le sinus hyperbolique d’un nombre. +SQRT = RACINE ## Renvoie la racine carrée d’un nombre. +SQRTPI = RACINE.PI ## Renvoie la racine carrée de (nombre * pi). +SUBTOTAL = SOUS.TOTAL ## Renvoie un sous-total dans une liste ou une base de données. +SUM = SOMME ## Calcule la somme de ses arguments. +SUMIF = SOMME.SI ## Additionne les cellules spécifiées si elles répondent à un critère donné. +SUMIFS = SOMME.SI.ENS ## Ajoute les cellules d’une plage qui répondent à plusieurs critères. +SUMPRODUCT = SOMMEPROD ## Multiplie les valeurs correspondantes des matrices spécifiées et calcule la somme de ces produits. +SUMSQ = SOMME.CARRES ## Renvoie la somme des carrés des arguments. +SUMX2MY2 = SOMME.X2MY2 ## Renvoie la somme de la différence des carrés des valeurs correspondantes de deux matrices. +SUMX2PY2 = SOMME.X2PY2 ## Renvoie la somme de la somme des carrés des valeurs correspondantes de deux matrices. +SUMXMY2 = SOMME.XMY2 ## Renvoie la somme des carrés des différences entre les valeurs correspondantes de deux matrices. +TAN = TAN ## Renvoie la tangente d’un nombre. +TANH = TANH ## Renvoie la tangente hyperbolique d’un nombre. +TRUNC = TRONQUE ## Renvoie la partie entière d’un nombre. + + +## +## Statistical functions Fonctions statistiques +## +AVEDEV = ECART.MOYEN ## Renvoie la moyenne des écarts absolus observés dans la moyenne des points de données. +AVERAGE = MOYENNE ## Renvoie la moyenne de ses arguments. +AVERAGEA = AVERAGEA ## Renvoie la moyenne de ses arguments, nombres, texte et valeurs logiques inclus. +AVERAGEIF = MOYENNE.SI ## Renvoie la moyenne (arithmétique) de toutes les cellules d’une plage qui répondent à des critères donnés. +AVERAGEIFS = MOYENNE.SI.ENS ## Renvoie la moyenne (arithmétique) de toutes les cellules qui répondent à plusieurs critères. +BETADIST = LOI.BETA ## Renvoie la fonction de distribution cumulée. +BETAINV = BETA.INVERSE ## Renvoie l’inverse de la fonction de distribution cumulée pour une distribution bêta spécifiée. +BINOMDIST = LOI.BINOMIALE ## Renvoie la probabilité d’une variable aléatoire discrète suivant la loi binomiale. +CHIDIST = LOI.KHIDEUX ## Renvoie la probabilité unilatérale de la distribution khi-deux. +CHIINV = KHIDEUX.INVERSE ## Renvoie l’inverse de la probabilité unilatérale de la distribution khi-deux. +CHITEST = TEST.KHIDEUX ## Renvoie le test d’indépendance. +CONFIDENCE = INTERVALLE.CONFIANCE ## Renvoie l’intervalle de confiance pour une moyenne de population. +CORREL = COEFFICIENT.CORRELATION ## Renvoie le coefficient de corrélation entre deux séries de données. +COUNT = NB ## Détermine les nombres compris dans la liste des arguments. +COUNTA = NBVAL ## Détermine le nombre de valeurs comprises dans la liste des arguments. +COUNTBLANK = NB.VIDE ## Compte le nombre de cellules vides dans une plage. +COUNTIF = NB.SI ## Compte le nombre de cellules qui répondent à un critère donné dans une plage. +COUNTIFS = NB.SI.ENS ## Compte le nombre de cellules à l’intérieur d’une plage qui répondent à plusieurs critères. +COVAR = COVARIANCE ## Renvoie la covariance, moyenne des produits des écarts pour chaque série d’observations. +CRITBINOM = CRITERE.LOI.BINOMIALE ## Renvoie la plus petite valeur pour laquelle la distribution binomiale cumulée est inférieure ou égale à une valeur de critère. +DEVSQ = SOMME.CARRES.ECARTS ## Renvoie la somme des carrés des écarts. +EXPONDIST = LOI.EXPONENTIELLE ## Renvoie la distribution exponentielle. +FDIST = LOI.F ## Renvoie la distribution de probabilité F. +FINV = INVERSE.LOI.F ## Renvoie l’inverse de la distribution de probabilité F. +FISHER = FISHER ## Renvoie la transformation de Fisher. +FISHERINV = FISHER.INVERSE ## Renvoie l’inverse de la transformation de Fisher. +FORECAST = PREVISION ## Calcule une valeur par rapport à une tendance linéaire. +FREQUENCY = FREQUENCE ## Calcule la fréquence d’apparition des valeurs dans une plage de valeurs, puis renvoie des nombres sous forme de matrice verticale. +FTEST = TEST.F ## Renvoie le résultat d’un test F. +GAMMADIST = LOI.GAMMA ## Renvoie la probabilité d’une variable aléatoire suivant une loi Gamma. +GAMMAINV = LOI.GAMMA.INVERSE ## Renvoie, pour une probabilité donnée, la valeur d’une variable aléatoire suivant une loi Gamma. +GAMMALN = LNGAMMA ## Renvoie le logarithme népérien de la fonction Gamma, G(x) +GEOMEAN = MOYENNE.GEOMETRIQUE ## Renvoie la moyenne géométrique. +GROWTH = CROISSANCE ## Calcule des valeurs par rapport à une tendance exponentielle. +HARMEAN = MOYENNE.HARMONIQUE ## Renvoie la moyenne harmonique. +HYPGEOMDIST = LOI.HYPERGEOMETRIQUE ## Renvoie la probabilité d’une variable aléatoire discrète suivant une loi hypergéométrique. +INTERCEPT = ORDONNEE.ORIGINE ## Renvoie l’ordonnée à l’origine d’une droite de régression linéaire. +KURT = KURTOSIS ## Renvoie le kurtosis d’une série de données. +LARGE = GRANDE.VALEUR ## Renvoie la k-ième plus grande valeur d’une série de données. +LINEST = DROITEREG ## Renvoie les paramètres d’une tendance linéaire. +LOGEST = LOGREG ## Renvoie les paramètres d’une tendance exponentielle. +LOGINV = LOI.LOGNORMALE.INVERSE ## Renvoie l’inverse de la probabilité pour une variable aléatoire suivant la loi lognormale. +LOGNORMDIST = LOI.LOGNORMALE ## Renvoie la probabilité d’une variable aléatoire continue suivant une loi lognormale. +MAX = MAX ## Renvoie la valeur maximale contenue dans une liste d’arguments. +MAXA = MAXA ## Renvoie la valeur maximale d’une liste d’arguments, nombres, texte et valeurs logiques inclus. +MEDIAN = MEDIANE ## Renvoie la valeur médiane des nombres donnés. +MIN = MIN ## Renvoie la valeur minimale contenue dans une liste d’arguments. +MINA = MINA ## Renvoie la plus petite valeur d’une liste d’arguments, nombres, texte et valeurs logiques inclus. +MODE = MODE ## Renvoie la valeur la plus courante d’une série de données. +NEGBINOMDIST = LOI.BINOMIALE.NEG ## Renvoie la probabilité d’une variable aléatoire discrète suivant une loi binomiale négative. +NORMDIST = LOI.NORMALE ## Renvoie la probabilité d’une variable aléatoire continue suivant une loi normale. +NORMINV = LOI.NORMALE.INVERSE ## Renvoie, pour une probabilité donnée, la valeur d’une variable aléatoire suivant une loi normale standard. +NORMSDIST = LOI.NORMALE.STANDARD ## Renvoie la probabilité d’une variable aléatoire continue suivant une loi normale standard. +NORMSINV = LOI.NORMALE.STANDARD.INVERSE ## Renvoie l’inverse de la distribution cumulée normale standard. +PEARSON = PEARSON ## Renvoie le coefficient de corrélation d’échantillonnage de Pearson. +PERCENTILE = CENTILE ## Renvoie le k-ième centile des valeurs d’une plage. +PERCENTRANK = RANG.POURCENTAGE ## Renvoie le rang en pourcentage d’une valeur d’une série de données. +PERMUT = PERMUTATION ## Renvoie le nombre de permutations pour un nombre donné d’objets. +POISSON = LOI.POISSON ## Renvoie la probabilité d’une variable aléatoire suivant une loi de Poisson. +PROB = PROBABILITE ## Renvoie la probabilité que des valeurs d’une plage soient comprises entre deux limites. +QUARTILE = QUARTILE ## Renvoie le quartile d’une série de données. +RANK = RANG ## Renvoie le rang d’un nombre contenu dans une liste. +RSQ = COEFFICIENT.DETERMINATION ## Renvoie la valeur du coefficient de détermination R^2 d’une régression linéaire. +SKEW = COEFFICIENT.ASYMETRIE ## Renvoie l’asymétrie d’une distribution. +SLOPE = PENTE ## Renvoie la pente d’une droite de régression linéaire. +SMALL = PETITE.VALEUR ## Renvoie la k-ième plus petite valeur d’une série de données. +STANDARDIZE = CENTREE.REDUITE ## Renvoie une valeur centrée réduite. +STDEV = ECARTYPE ## Évalue l’écart type d’une population en se basant sur un échantillon de cette population. +STDEVA = STDEVA ## Évalue l’écart type d’une population en se basant sur un échantillon de cette population, nombres, texte et valeurs logiques inclus. +STDEVP = ECARTYPEP ## Calcule l’écart type d’une population à partir de la population entière. +STDEVPA = STDEVPA ## Calcule l’écart type d’une population à partir de l’ensemble de la population, nombres, texte et valeurs logiques inclus. +STEYX = ERREUR.TYPE.XY ## Renvoie l’erreur type de la valeur y prévue pour chaque x de la régression. +TDIST = LOI.STUDENT ## Renvoie la probabilité d’une variable aléatoire suivant une loi T de Student. +TINV = LOI.STUDENT.INVERSE ## Renvoie, pour une probabilité donnée, la valeur d’une variable aléatoire suivant une loi T de Student. +TREND = TENDANCE ## Renvoie des valeurs par rapport à une tendance linéaire. +TRIMMEAN = MOYENNE.REDUITE ## Renvoie la moyenne de l’intérieur d’une série de données. +TTEST = TEST.STUDENT ## Renvoie la probabilité associée à un test T de Student. +VAR = VAR ## Calcule la variance sur la base d’un échantillon. +VARA = VARA ## Estime la variance d’une population en se basant sur un échantillon de cette population, nombres, texte et valeurs logiques incluses. +VARP = VAR.P ## Calcule la variance sur la base de l’ensemble de la population. +VARPA = VARPA ## Calcule la variance d’une population en se basant sur la population entière, nombres, texte et valeurs logiques inclus. +WEIBULL = LOI.WEIBULL ## Renvoie la probabilité d’une variable aléatoire suivant une loi de Weibull. +ZTEST = TEST.Z ## Renvoie la valeur de probabilité unilatérale d’un test z. + + +## +## Text functions Fonctions de texte +## +ASC = ASC ## Change les caractères anglais ou katakana à pleine chasse (codés sur deux octets) à l’intérieur d’une chaîne de caractères en caractères à demi-chasse (codés sur un octet). +BAHTTEXT = BAHTTEXT ## Convertit un nombre en texte en utilisant le format monétaire ß (baht). +CHAR = CAR ## Renvoie le caractère spécifié par le code numérique. +CLEAN = EPURAGE ## Supprime tous les caractères de contrôle du texte. +CODE = CODE ## Renvoie le numéro de code du premier caractère du texte. +CONCATENATE = CONCATENER ## Assemble plusieurs éléments textuels de façon à n’en former qu’un seul. +DOLLAR = EURO ## Convertit un nombre en texte en utilisant le format monétaire € (euro). +EXACT = EXACT ## Vérifie si deux valeurs de texte sont identiques. +FIND = TROUVE ## Trouve un valeur textuelle dans une autre, en respectant la casse. +FINDB = TROUVERB ## Trouve un valeur textuelle dans une autre, en respectant la casse. +FIXED = CTXT ## Convertit un nombre au format texte avec un nombre de décimales spécifié. +JIS = JIS ## Change les caractères anglais ou katakana à demi-chasse (codés sur un octet) à l’intérieur d’une chaîne de caractères en caractères à à pleine chasse (codés sur deux octets). +LEFT = GAUCHE ## Renvoie des caractères situés à l’extrême gauche d’une chaîne de caractères. +LEFTB = GAUCHEB ## Renvoie des caractères situés à l’extrême gauche d’une chaîne de caractères. +LEN = NBCAR ## Renvoie le nombre de caractères contenus dans une chaîne de texte. +LENB = LENB ## Renvoie le nombre de caractères contenus dans une chaîne de texte. +LOWER = MINUSCULE ## Convertit le texte en minuscules. +MID = STXT ## Renvoie un nombre déterminé de caractères d’une chaîne de texte à partir de la position que vous indiquez. +MIDB = STXTB ## Renvoie un nombre déterminé de caractères d’une chaîne de texte à partir de la position que vous indiquez. +PHONETIC = PHONETIQUE ## Extrait les caractères phonétiques (furigana) d’une chaîne de texte. +PROPER = NOMPROPRE ## Met en majuscules la première lettre de chaque mot dans une chaîne textuelle. +REPLACE = REMPLACER ## Remplace des caractères dans un texte. +REPLACEB = REMPLACERB ## Remplace des caractères dans un texte. +REPT = REPT ## Répète un texte un certain nombre de fois. +RIGHT = DROITE ## Renvoie des caractères situés à l’extrême droite d’une chaîne de caractères. +RIGHTB = DROITEB ## Renvoie des caractères situés à l’extrême droite d’une chaîne de caractères. +SEARCH = CHERCHE ## Trouve un texte dans un autre texte (sans respecter la casse). +SEARCHB = CHERCHERB ## Trouve un texte dans un autre texte (sans respecter la casse). +SUBSTITUTE = SUBSTITUE ## Remplace l’ancien texte d’une chaîne de caractères par un nouveau. +T = T ## Convertit ses arguments en texte. +TEXT = TEXTE ## Convertit un nombre au format texte. +TRIM = SUPPRESPACE ## Supprime les espaces du texte. +UPPER = MAJUSCULE ## Convertit le texte en majuscules. +VALUE = CNUM ## Convertit un argument textuel en nombre diff --git a/extend/PHPExcel/PHPExcel/locale/hu/config b/extend/PHPExcel/PHPExcel/locale/hu/config new file mode 100644 index 0000000..080b201 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/hu/config @@ -0,0 +1,47 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = Ft + + +## +## Excel Error Codes (For future use) +## +NULL = #NULLA! +DIV0 = #ZÉRÓOSZTÓ! +VALUE = #ÉRTÉK! +REF = #HIV! +NAME = #NÉV? +NUM = #SZÁM! +NA = #HIÁNYZIK diff --git a/extend/PHPExcel/PHPExcel/locale/hu/functions b/extend/PHPExcel/PHPExcel/locale/hu/functions new file mode 100644 index 0000000..200d3f7 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/hu/functions @@ -0,0 +1,438 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Calculation +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ +## +## + + +## +## Add-in and Automation functions Bővítmények és automatizálási függvények +## +GETPIVOTDATA = KIMUTATÁSADATOT.VESZ ## A kimutatásokban tárolt adatok visszaadására használható. + + +## +## Cube functions Kockafüggvények +## +CUBEKPIMEMBER = KOCKA.FŐTELJMUT ## Egy fő teljesítménymutató (KPI) nevét, tulajdonságát és mértékegységét adja eredményül, a nevet és a tulajdonságot megjeleníti a cellában. A KPI-k számszerűsíthető mérési lehetőséget jelentenek – ilyen mutató például a havi bruttó nyereség vagy az egy alkalmazottra jutó negyedéves forgalom –, egy szervezet teljesítményének nyomonkövetésére használhatók. +CUBEMEMBER = KOCKA.TAG ## Kockahierachia tagját vagy rekordját adja eredményül. Ellenőrizhető vele, hogy szerepel-e a kockában az adott tag vagy rekord. +CUBEMEMBERPROPERTY = KOCKA.TAG.TUL ## A kocka egyik tagtulajdonságának értékét adja eredményül. Használatával ellenőrizhető, hogy szerepel-e egy tagnév a kockában, eredménye pedig az erre a tagra vonatkozó, megadott tulajdonság. +CUBERANKEDMEMBER = KOCKA.HALM.ELEM ## Egy halmaz rangsor szerinti n-edik tagját adja eredményül. Használatával egy halmaz egy vagy több elemét kaphatja meg, például a legnagyobb teljesítményű üzletkötőt vagy a 10 legjobb tanulót. +CUBESET = KOCKA.HALM ## Számított tagok vagy rekordok halmazát adja eredményül, ehhez egy beállított kifejezést elküld a kiszolgálón található kockának, majd ezt a halmazt adja vissza a Microsoft Office Excel alkalmazásnak. +CUBESETCOUNT = KOCKA.HALM.DB ## Egy halmaz elemszámát adja eredményül. +CUBEVALUE = KOCKA.ÉRTÉK ## Kockából összesített értéket ad eredményül. + + +## +## Database functions Adatbázis-kezelő függvények +## +DAVERAGE = AB.ÁTLAG ## A kijelölt adatbáziselemek átlagát számítja ki. +DCOUNT = AB.DARAB ## Megszámolja, hogy az adatbázisban hány cella tartalmaz számokat. +DCOUNTA = AB.DARAB2 ## Megszámolja az adatbázisban lévő nem üres cellákat. +DGET = AB.MEZŐ ## Egy adatbázisból egyetlen olyan rekordot ad vissza, amely megfelel a megadott feltételeknek. +DMAX = AB.MAX ## A kiválasztott adatbáziselemek közül a legnagyobb értéket adja eredményül. +DMIN = AB.MIN ## A kijelölt adatbáziselemek közül a legkisebb értéket adja eredményül. +DPRODUCT = AB.SZORZAT ## Az adatbázis megadott feltételeknek eleget tevő rekordjaira összeszorozza a megadott mezőben található számértékeket, és eredményül ezt a szorzatot adja. +DSTDEV = AB.SZÓRÁS ## A kijelölt adatbáziselemek egy mintája alapján megbecsüli a szórást. +DSTDEVP = AB.SZÓRÁS2 ## A kijelölt adatbáziselemek teljes sokasága alapján kiszámítja a szórást. +DSUM = AB.SZUM ## Összeadja a feltételnek megfelelő adatbázisrekordok mezőoszlopában a számokat. +DVAR = AB.VAR ## A kijelölt adatbáziselemek mintája alapján becslést ad a szórásnégyzetre. +DVARP = AB.VAR2 ## A kijelölt adatbáziselemek teljes sokasága alapján kiszámítja a szórásnégyzetet. + + +## +## Date and time functions Dátumfüggvények +## +DATE = DÁTUM ## Adott dátum dátumértékét adja eredményül. +DATEVALUE = DÁTUMÉRTÉK ## Szövegként megadott dátumot dátumértékké alakít át. +DAY = NAP ## Dátumértéket a hónap egy napjává (0-31) alakít. +DAYS360 = NAP360 ## Két dátum közé eső napok számát számítja ki a 360 napos év alapján. +EDATE = EDATE ## Adott dátumnál adott számú hónappal korábbi vagy későbbi dátum dátumértékét adja eredményül. +EOMONTH = EOMONTH ## Adott dátumnál adott számú hónappal korábbi vagy későbbi hónap utolsó napjának dátumértékét adja eredményül. +HOUR = ÓRA ## Időértéket órákká alakít. +MINUTE = PERC ## Időértéket percekké alakít. +MONTH = HÓNAP ## Időértéket hónapokká alakít. +NETWORKDAYS = NETWORKDAYS ## Két dátum között a teljes munkanapok számát adja meg. +NOW = MOST ## A napi dátum dátumértékét és a pontos idő időértékét adja eredményül. +SECOND = MPERC ## Időértéket másodpercekké alakít át. +TIME = IDŐ ## Adott időpont időértékét adja meg. +TIMEVALUE = IDŐÉRTÉK ## Szövegként megadott időpontot időértékké alakít át. +TODAY = MA ## A napi dátum dátumértékét adja eredményül. +WEEKDAY = HÉT.NAPJA ## Dátumértéket a hét napjává alakítja át. +WEEKNUM = WEEKNUM ## Visszatérési értéke egy szám, amely azt mutatja meg, hogy a megadott dátum az év hányadik hetére esik. +WORKDAY = WORKDAY ## Adott dátumnál adott munkanappal korábbi vagy későbbi dátum dátumértékét adja eredményül. +YEAR = ÉV ## Sorszámot évvé alakít át. +YEARFRAC = YEARFRAC ## Az adott dátumok közötti teljes napok számát törtévként adja meg. + + +## +## Engineering functions Mérnöki függvények +## +BESSELI = BESSELI ## Az In(x) módosított Bessel-függvény értékét adja eredményül. +BESSELJ = BESSELJ ## A Jn(x) Bessel-függvény értékét adja eredményül. +BESSELK = BESSELK ## A Kn(x) módosított Bessel-függvény értékét adja eredményül. +BESSELY = BESSELY ## Az Yn(x) módosított Bessel-függvény értékét adja eredményül. +BIN2DEC = BIN2DEC ## Bináris számot decimálissá alakít át. +BIN2HEX = BIN2HEX ## Bináris számot hexadecimálissá alakít át. +BIN2OCT = BIN2OCT ## Bináris számot oktálissá alakít át. +COMPLEX = COMPLEX ## Valós és képzetes részből komplex számot képez. +CONVERT = CONVERT ## Mértékegységeket vált át. +DEC2BIN = DEC2BIN ## Decimális számot binárissá alakít át. +DEC2HEX = DEC2HEX ## Decimális számot hexadecimálissá alakít át. +DEC2OCT = DEC2OCT ## Decimális számot oktálissá alakít át. +DELTA = DELTA ## Azt vizsgálja, hogy két érték egyenlő-e. +ERF = ERF ## A hibafüggvény értékét adja eredményül. +ERFC = ERFC ## A kiegészített hibafüggvény értékét adja eredményül. +GESTEP = GESTEP ## Azt vizsgálja, hogy egy szám nagyobb-e adott küszöbértéknél. +HEX2BIN = HEX2BIN ## Hexadecimális számot binárissá alakít át. +HEX2DEC = HEX2DEC ## Hexadecimális számot decimálissá alakít át. +HEX2OCT = HEX2OCT ## Hexadecimális számot oktálissá alakít át. +IMABS = IMABS ## Komplex szám abszolút értékét (modulusát) adja eredményül. +IMAGINARY = IMAGINARY ## Komplex szám képzetes részét adja eredményül. +IMARGUMENT = IMARGUMENT ## A komplex szám radiánban kifejezett théta argumentumát adja eredményül. +IMCONJUGATE = IMCONJUGATE ## Komplex szám komplex konjugáltját adja eredményül. +IMCOS = IMCOS ## Komplex szám koszinuszát adja eredményül. +IMDIV = IMDIV ## Két komplex szám hányadosát adja eredményül. +IMEXP = IMEXP ## Az e szám komplex kitevőjű hatványát adja eredményül. +IMLN = IMLN ## Komplex szám természetes logaritmusát adja eredményül. +IMLOG10 = IMLOG10 ## Komplex szám tízes alapú logaritmusát adja eredményül. +IMLOG2 = IMLOG2 ## Komplex szám kettes alapú logaritmusát adja eredményül. +IMPOWER = IMPOWER ## Komplex szám hatványát adja eredményül. +IMPRODUCT = IMPRODUCT ## Komplex számok szorzatát adja eredményül. +IMREAL = IMREAL ## Komplex szám valós részét adja eredményül. +IMSIN = IMSIN ## Komplex szám szinuszát adja eredményül. +IMSQRT = IMSQRT ## Komplex szám négyzetgyökét adja eredményül. +IMSUB = IMSUB ## Két komplex szám különbségét adja eredményül. +IMSUM = IMSUM ## Komplex számok összegét adja eredményül. +OCT2BIN = OCT2BIN ## Oktális számot binárissá alakít át. +OCT2DEC = OCT2DEC ## Oktális számot decimálissá alakít át. +OCT2HEX = OCT2HEX ## Oktális számot hexadecimálissá alakít át. + + +## +## Financial functions Pénzügyi függvények +## +ACCRINT = ACCRINT ## Periodikusan kamatozó értékpapír felszaporodott kamatát adja eredményül. +ACCRINTM = ACCRINTM ## Lejáratkor kamatozó értékpapír felszaporodott kamatát adja eredményül. +AMORDEGRC = AMORDEGRC ## Állóeszköz lineáris értékcsökkenését adja meg az egyes könyvelési időszakokra vonatkozóan. +AMORLINC = AMORLINC ## Az egyes könyvelési időszakokban az értékcsökkenést adja meg. +COUPDAYBS = COUPDAYBS ## A szelvényidőszak kezdetétől a kifizetés időpontjáig eltelt napokat adja vissza. +COUPDAYS = COUPDAYS ## A kifizetés időpontját magában foglaló szelvényperiódus hosszát adja meg napokban. +COUPDAYSNC = COUPDAYSNC ## A kifizetés időpontja és a legközelebbi szelvénydátum közötti napok számát adja meg. +COUPNCD = COUPNCD ## A kifizetést követő legelső szelvénydátumot adja eredményül. +COUPNUM = COUPNUM ## A kifizetés és a lejárat időpontja között kifizetendő szelvények számát adja eredményül. +COUPPCD = COUPPCD ## A kifizetés előtti utolsó szelvénydátumot adja eredményül. +CUMIPMT = CUMIPMT ## Két fizetési időszak között kifizetett kamat halmozott értékét adja eredményül. +CUMPRINC = CUMPRINC ## Két fizetési időszak között kifizetett részletek halmozott (kamatot nem tartalmazó) értékét adja eredményül. +DB = KCS2 ## Eszköz adott időszak alatti értékcsökkenését számítja ki a lineáris leírási modell alkalmazásával. +DDB = KCSA ## Eszköz értékcsökkenését számítja ki adott időszakra vonatkozóan a progresszív vagy egyéb megadott leírási modell alkalmazásával. +DISC = DISC ## Értékpapír leszámítolási kamatlábát adja eredményül. +DOLLARDE = DOLLARDE ## Egy közönséges törtként megadott számot tizedes törtté alakít át. +DOLLARFR = DOLLARFR ## Tizedes törtként megadott számot közönséges törtté alakít át. +DURATION = DURATION ## Periodikus kamatfizetésű értékpapír éves kamatérzékenységét adja eredményül. +EFFECT = EFFECT ## Az éves tényleges kamatláb értékét adja eredményül. +FV = JBÉ ## Befektetés jövőbeli értékét számítja ki. +FVSCHEDULE = FVSCHEDULE ## A kezdőtőke adott kamatlábak szerint megnövelt jövőbeli értékét adja eredményül. +INTRATE = INTRATE ## A lejáratig teljesen lekötött értékpapír kamatrátáját adja eredményül. +IPMT = RRÉSZLET ## Hiteltörlesztésen belül a tőketörlesztés nagyságát számítja ki adott időszakra. +IRR = BMR ## A befektetés belső megtérülési rátáját számítja ki pénzáramláshoz. +ISPMT = LRÉSZLETKAMAT ## A befektetés adott időszakára fizetett kamatot számítja ki. +MDURATION = MDURATION ## Egy 100 Ft névértékű értékpapír Macauley-féle módosított kamatérzékenységét adja eredményül. +MIRR = MEGTÉRÜLÉS ## A befektetés belső megtérülési rátáját számítja ki a költségek és a bevételek különböző kamatlába mellett. +NOMINAL = NOMINAL ## Az éves névleges kamatláb értékét adja eredményül. +NPER = PER.SZÁM ## A törlesztési időszakok számát adja meg. +NPV = NMÉ ## Befektetéshez kapcsolódó pénzáramlás nettó jelenértékét számítja ki ismert pénzáramlás és kamatláb mellett. +ODDFPRICE = ODDFPRICE ## Egy 100 Ft névértékű, a futamidő elején töredék-időszakos értékpapír árát adja eredményül. +ODDFYIELD = ODDFYIELD ## A futamidő elején töredék-időszakos értékpapír hozamát adja eredményül. +ODDLPRICE = ODDLPRICE ## Egy 100 Ft névértékű, a futamidő végén töredék-időszakos értékpapír árát adja eredményül. +ODDLYIELD = ODDLYIELD ## A futamidő végén töredék-időszakos értékpapír hozamát adja eredményül. +PMT = RÉSZLET ## A törlesztési időszakra vonatkozó törlesztési összeget számítja ki. +PPMT = PRÉSZLET ## Hiteltörlesztésen belül a tőketörlesztés nagyságát számítja ki adott időszakra. +PRICE = PRICE ## Egy 100 Ft névértékű, periodikusan kamatozó értékpapír árát adja eredményül. +PRICEDISC = PRICEDISC ## Egy 100 Ft névértékű leszámítolt értékpapír árát adja eredményül. +PRICEMAT = PRICEMAT ## Egy 100 Ft névértékű, a lejáratkor kamatozó értékpapír árát adja eredményül. +PV = MÉ ## Befektetés jelenlegi értékét számítja ki. +RATE = RÁTA ## Egy törlesztési időszakban az egy időszakra eső kamatláb nagyságát számítja ki. +RECEIVED = RECEIVED ## A lejáratig teljesen lekötött értékpapír lejáratakor kapott összegét adja eredményül. +SLN = LCSA ## Tárgyi eszköz egy időszakra eső amortizációját adja meg bruttó érték szerinti lineáris leírási kulcsot alkalmazva. +SYD = SYD ## Tárgyi eszköz értékcsökkenését számítja ki adott időszakra az évek számjegyösszegével dolgozó módszer alapján. +TBILLEQ = TBILLEQ ## Kincstárjegy kötvény-egyenértékű hozamát adja eredményül. +TBILLPRICE = TBILLPRICE ## Egy 100 Ft névértékű kincstárjegy árát adja eredményül. +TBILLYIELD = TBILLYIELD ## Kincstárjegy hozamát adja eredményül. +VDB = ÉCSRI ## Tárgyi eszköz amortizációját számítja ki megadott vagy részidőszakra a csökkenő egyenleg módszerének alkalmazásával. +XIRR = XIRR ## Ütemezett készpénzforgalom (cash flow) belső megtérülési kamatrátáját adja eredményül. +XNPV = XNPV ## Ütemezett készpénzforgalom (cash flow) nettó jelenlegi értékét adja eredményül. +YIELD = YIELD ## Periodikusan kamatozó értékpapír hozamát adja eredményül. +YIELDDISC = YIELDDISC ## Leszámítolt értékpapír (például kincstárjegy) éves hozamát adja eredményül. +YIELDMAT = YIELDMAT ## Lejáratkor kamatozó értékpapír éves hozamát adja eredményül. + + +## +## Information functions Információs függvények +## +CELL = CELLA ## Egy cella formátumára, elhelyezkedésére vagy tartalmára vonatkozó adatokat ad eredményül. +ERROR.TYPE = HIBA.TÍPUS ## Egy hibatípushoz tartozó számot ad eredményül. +INFO = INFÓ ## A rendszer- és munkakörnyezet pillanatnyi állapotáról ad felvilágosítást. +ISBLANK = ÜRES ## Eredménye IGAZ, ha az érték üres. +ISERR = HIBA ## Eredménye IGAZ, ha az érték valamelyik hibaérték a #HIÁNYZIK kivételével. +ISERROR = HIBÁS ## Eredménye IGAZ, ha az érték valamelyik hibaérték. +ISEVEN = ISEVEN ## Eredménye IGAZ, ha argumentuma páros szám. +ISLOGICAL = LOGIKAI ## Eredménye IGAZ, ha az érték logikai érték. +ISNA = NINCS ## Eredménye IGAZ, ha az érték a #HIÁNYZIK hibaérték. +ISNONTEXT = NEM.SZÖVEG ## Eredménye IGAZ, ha az érték nem szöveg. +ISNUMBER = SZÁM ## Eredménye IGAZ, ha az érték szám. +ISODD = ISODD ## Eredménye IGAZ, ha argumentuma páratlan szám. +ISREF = HIVATKOZÁS ## Eredménye IGAZ, ha az érték hivatkozás. +ISTEXT = SZÖVEG.E ## Eredménye IGAZ, ha az érték szöveg. +N = N ## Argumentumának értékét számmá alakítja. +NA = HIÁNYZIK ## Eredménye a #HIÁNYZIK hibaérték. +TYPE = TÍPUS ## Érték adattípusának azonosítószámát adja eredményül. + + +## +## Logical functions Logikai függvények +## +AND = ÉS ## Eredménye IGAZ, ha minden argumentuma IGAZ. +FALSE = HAMIS ## A HAMIS logikai értéket adja eredményül. +IF = HA ## Logikai vizsgálatot hajt végre. +IFERROR = HAHIBA ## A megadott értéket adja vissza, ha egy képlet hibához vezet; más esetben a képlet értékét adja eredményül. +NOT = NEM ## Argumentuma értékének ellentettjét adja eredményül. +OR = VAGY ## Eredménye IGAZ, ha bármely argumentuma IGAZ. +TRUE = IGAZ ## Az IGAZ logikai értéket adja eredményül. + + +## +## Lookup and reference functions Keresési és hivatkozási függvények +## +ADDRESS = CÍM ## A munkalap egy cellájára való hivatkozást adja szövegként eredményül. +AREAS = TERÜLET ## Hivatkozásban a területek számát adja eredményül. +CHOOSE = VÁLASZT ## Értékek listájából választ ki egy elemet. +COLUMN = OSZLOP ## Egy hivatkozás oszlopszámát adja eredményül. +COLUMNS = OSZLOPOK ## A hivatkozásban található oszlopok számát adja eredményül. +HLOOKUP = VKERES ## A megadott tömb felső sorában adott értékű elemet keres, és a megtalált elem oszlopából adott sorban elhelyezkedő értékkel tér vissza. +HYPERLINK = HIPERHIVATKOZÁS ## Hálózati kiszolgálón, intraneten vagy az interneten tárolt dokumentumot megnyitó parancsikont vagy hivatkozást hoz létre. +INDEX = INDEX ## Tömb- vagy hivatkozás indexszel megadott értékét adja vissza. +INDIRECT = INDIREKT ## Szöveg megadott hivatkozást ad eredményül. +LOOKUP = KERES ## Vektorban vagy tömbben keres meg értékeket. +MATCH = HOL.VAN ## Hivatkozásban vagy tömbben értékeket keres. +OFFSET = OFSZET ## Hivatkozás egy másik hivatkozástól számított távolságát adja meg. +ROW = SOR ## Egy hivatkozás sorának számát adja meg. +ROWS = SOROK ## Egy hivatkozás sorainak számát adja meg. +RTD = RTD ## Valós idejű adatokat keres vissza a COM automatizmust (automatizálás: Egy alkalmazás objektumaival való munka másik alkalmazásból vagy fejlesztőeszközből. A korábban OLE automatizmusnak nevezett automatizálás iparági szabvány, a Component Object Model (COM) szolgáltatása.) támogató programból. +TRANSPOSE = TRANSZPONÁLÁS ## Egy tömb transzponáltját adja eredményül. +VLOOKUP = FKERES ## A megadott tömb bal szélső oszlopában megkeres egy értéket, majd annak sora és a megadott oszlop metszéspontjában levő értéked adja eredményül. + + +## +## Math and trigonometry functions Matematikai és trigonometrikus függvények +## +ABS = ABS ## Egy szám abszolút értékét adja eredményül. +ACOS = ARCCOS ## Egy szám arkusz koszinuszát számítja ki. +ACOSH = ACOSH ## Egy szám inverz koszinusz hiperbolikuszát számítja ki. +ASIN = ARCSIN ## Egy szám arkusz szinuszát számítja ki. +ASINH = ASINH ## Egy szám inverz szinusz hiperbolikuszát számítja ki. +ATAN = ARCTAN ## Egy szám arkusz tangensét számítja ki. +ATAN2 = ARCTAN2 ## X és y koordináták alapján számítja ki az arkusz tangens értéket. +ATANH = ATANH ## A szám inverz tangens hiperbolikuszát számítja ki. +CEILING = PLAFON ## Egy számot a legközelebbi egészre vagy a pontosságként megadott érték legközelebb eső többszörösére kerekít. +COMBIN = KOMBINÁCIÓK ## Adott számú objektum összes lehetséges kombinációinak számát számítja ki. +COS = COS ## Egy szám koszinuszát számítja ki. +COSH = COSH ## Egy szám koszinusz hiperbolikuszát számítja ki. +DEGREES = FOK ## Radiánt fokká alakít át. +EVEN = PÁROS ## Egy számot a legközelebbi páros egész számra kerekít. +EXP = KITEVŐ ## Az e adott kitevőjű hatványát adja eredményül. +FACT = FAKT ## Egy szám faktoriálisát számítja ki. +FACTDOUBLE = FACTDOUBLE ## Egy szám dupla faktoriálisát adja eredményül. +FLOOR = PADLÓ ## Egy számot lefelé, a nulla felé kerekít. +GCD = GCD ## A legnagyobb közös osztót adja eredményül. +INT = INT ## Egy számot lefelé kerekít a legközelebbi egészre. +LCM = LCM ## A legkisebb közös többszöröst adja eredményül. +LN = LN ## Egy szám természetes logaritmusát számítja ki. +LOG = LOG ## Egy szám adott alapú logaritmusát számítja ki. +LOG10 = LOG10 ## Egy szám 10-es alapú logaritmusát számítja ki. +MDETERM = MDETERM ## Egy tömb mátrix-determinánsát számítja ki. +MINVERSE = INVERZ.MÁTRIX ## Egy tömb mátrix inverzét adja eredményül. +MMULT = MSZORZAT ## Két tömb mátrix-szorzatát adja meg. +MOD = MARADÉK ## Egy szám osztási maradékát adja eredményül. +MROUND = MROUND ## A kívánt többszörösére kerekített értéket ad eredményül. +MULTINOMIAL = MULTINOMIAL ## Számhalmaz multinomiálisát adja eredményül. +ODD = PÁRATLAN ## Egy számot a legközelebbi páratlan számra kerekít. +PI = PI ## A pi matematikai állandót adja vissza. +POWER = HATVÁNY ## Egy szám adott kitevőjű hatványát számítja ki. +PRODUCT = SZORZAT ## Argumentumai szorzatát számítja ki. +QUOTIENT = QUOTIENT ## Egy hányados egész részét adja eredményül. +RADIANS = RADIÁN ## Fokot radiánná alakít át. +RAND = VÉL ## Egy 0 és 1 közötti véletlen számot ad eredményül. +RANDBETWEEN = RANDBETWEEN ## Megadott számok közé eső véletlen számot állít elő. +ROMAN = RÓMAI ## Egy számot római számokkal kifejezve szövegként ad eredményül. +ROUND = KEREKÍTÉS ## Egy számot adott számú számjegyre kerekít. +ROUNDDOWN = KEREKÍTÉS.LE ## Egy számot lefelé, a nulla felé kerekít. +ROUNDUP = KEREKÍTÉS.FEL ## Egy számot felfelé, a nullától távolabbra kerekít. +SERIESSUM = SERIESSUM ## Hatványsor összegét adja eredményül. +SIGN = ELŐJEL ## Egy szám előjelét adja meg. +SIN = SIN ## Egy szög szinuszát számítja ki. +SINH = SINH ## Egy szám szinusz hiperbolikuszát számítja ki. +SQRT = GYÖK ## Egy szám pozitív négyzetgyökét számítja ki. +SQRTPI = SQRTPI ## A (szám*pi) négyzetgyökét adja eredményül. +SUBTOTAL = RÉSZÖSSZEG ## Lista vagy adatbázis részösszegét adja eredményül. +SUM = SZUM ## Összeadja az argumentumlistájában lévő számokat. +SUMIF = SZUMHA ## A megadott feltételeknek eleget tevő cellákban található értékeket adja össze. +SUMIFS = SZUMHATÖBB ## Több megadott feltételnek eleget tévő tartománycellák összegét adja eredményül. +SUMPRODUCT = SZORZATÖSSZEG ## A megfelelő tömbelemek szorzatának összegét számítja ki. +SUMSQ = NÉGYZETÖSSZEG ## Argumentumai négyzetének összegét számítja ki. +SUMX2MY2 = SZUMX2BŐLY2 ## Két tömb megfelelő elemei négyzetének különbségét összegzi. +SUMX2PY2 = SZUMX2MEGY2 ## Két tömb megfelelő elemei négyzetének összegét összegzi. +SUMXMY2 = SZUMXBŐLY2 ## Két tömb megfelelő elemei különbségének négyzetösszegét számítja ki. +TAN = TAN ## Egy szám tangensét számítja ki. +TANH = TANH ## Egy szám tangens hiperbolikuszát számítja ki. +TRUNC = CSONK ## Egy számot egésszé csonkít. + + +## +## Statistical functions Statisztikai függvények +## +AVEDEV = ÁTL.ELTÉRÉS ## Az adatpontoknak átlaguktól való átlagos abszolút eltérését számítja ki. +AVERAGE = ÁTLAG ## Argumentumai átlagát számítja ki. +AVERAGEA = ÁTLAGA ## Argumentumai átlagát számítja ki (beleértve a számokat, szöveget és logikai értékeket). +AVERAGEIF = ÁTLAGHA ## A megadott feltételnek eleget tévő tartomány celláinak átlagát (számtani közepét) adja eredményül. +AVERAGEIFS = ÁTLAGHATÖBB ## A megadott feltételeknek eleget tévő cellák átlagát (számtani közepét) adja eredményül. +BETADIST = BÉTA.ELOSZLÁS ## A béta-eloszlás függvényt számítja ki. +BETAINV = INVERZ.BÉTA ## Adott béta-eloszláshoz kiszámítja a béta eloszlásfüggvény inverzét. +BINOMDIST = BINOM.ELOSZLÁS ## A diszkrét binomiális eloszlás valószínűségértékét számítja ki. +CHIDIST = KHI.ELOSZLÁS ## A khi-négyzet-eloszlás egyszélű valószínűségértékét számítja ki. +CHIINV = INVERZ.KHI ## A khi-négyzet-eloszlás egyszélű valószínűségértékének inverzét számítja ki. +CHITEST = KHI.PRÓBA ## Függetlenségvizsgálatot hajt végre. +CONFIDENCE = MEGBÍZHATÓSÁG ## Egy statisztikai sokaság várható értékének megbízhatósági intervallumát adja eredményül. +CORREL = KORREL ## Két adathalmaz korrelációs együtthatóját számítja ki. +COUNT = DARAB ## Megszámolja, hogy argumentumlistájában hány szám található. +COUNTA = DARAB2 ## Megszámolja, hogy argumentumlistájában hány érték található. +COUNTBLANK = DARABÜRES ## Egy tartományban összeszámolja az üres cellákat. +COUNTIF = DARABTELI ## Egy tartományban összeszámolja azokat a cellákat, amelyek eleget tesznek a megadott feltételnek. +COUNTIFS = DARABHATÖBB ## Egy tartományban összeszámolja azokat a cellákat, amelyek eleget tesznek több feltételnek. +COVAR = KOVAR ## A kovarianciát, azaz a páronkénti eltérések szorzatának átlagát számítja ki. +CRITBINOM = KRITBINOM ## Azt a legkisebb számot adja eredményül, amelyre a binomiális eloszlásfüggvény értéke nem kisebb egy adott határértéknél. +DEVSQ = SQ ## Az átlagtól való eltérések négyzetének összegét számítja ki. +EXPONDIST = EXP.ELOSZLÁS ## Az exponenciális eloszlás értékét számítja ki. +FDIST = F.ELOSZLÁS ## Az F-eloszlás értékét számítja ki. +FINV = INVERZ.F ## Az F-eloszlás inverzének értékét számítja ki. +FISHER = FISHER ## Fisher-transzformációt hajt végre. +FISHERINV = INVERZ.FISHER ## A Fisher-transzformáció inverzét hajtja végre. +FORECAST = ELŐREJELZÉS ## Az ismert értékek alapján lineáris regresszióval becsült értéket ad eredményül. +FREQUENCY = GYAKORISÁG ## A gyakorisági vagy empirikus eloszlás értékét függőleges tömbként adja eredményül. +FTEST = F.PRÓBA ## Az F-próba értékét adja eredményül. +GAMMADIST = GAMMA.ELOSZLÁS ## A gamma-eloszlás értékét számítja ki. +GAMMAINV = INVERZ.GAMMA ## A gamma-eloszlás eloszlásfüggvénye inverzének értékét számítja ki. +GAMMALN = GAMMALN ## A gamma-függvény természetes logaritmusát számítja ki. +GEOMEAN = MÉRTANI.KÖZÉP ## Argumentumai mértani középértékét számítja ki. +GROWTH = NÖV ## Exponenciális regresszió alapján ad becslést. +HARMEAN = HARM.KÖZÉP ## Argumentumai harmonikus átlagát számítja ki. +HYPGEOMDIST = HIPERGEOM.ELOSZLÁS ## A hipergeometriai eloszlás értékét számítja ki. +INTERCEPT = METSZ ## A regressziós egyenes y tengellyel való metszéspontját határozza meg. +KURT = CSÚCSOSSÁG ## Egy adathalmaz csúcsosságát számítja ki. +LARGE = NAGY ## Egy adathalmaz k-adik legnagyobb elemét adja eredményül. +LINEST = LIN.ILL ## A legkisebb négyzetek módszerével az adatokra illesztett egyenes paramétereit határozza meg. +LOGEST = LOG.ILL ## Az adatokra illesztett exponenciális görbe paramétereit határozza meg. +LOGINV = INVERZ.LOG.ELOSZLÁS ## A lognormális eloszlás inverzét számítja ki. +LOGNORMDIST = LOG.ELOSZLÁS ## A lognormális eloszlásfüggvény értékét számítja ki. +MAX = MAX ## Az argumentumai között szereplő legnagyobb számot adja meg. +MAXA = MAX2 ## Az argumentumai között szereplő legnagyobb számot adja meg (beleértve a számokat, szöveget és logikai értékeket). +MEDIAN = MEDIÁN ## Adott számhalmaz mediánját számítja ki. +MIN = MIN ## Az argumentumai között szereplő legkisebb számot adja meg. +MINA = MIN2 ## Az argumentumai között szereplő legkisebb számot adja meg, beleértve a számokat, szöveget és logikai értékeket. +MODE = MÓDUSZ ## Egy adathalmazból kiválasztja a leggyakrabban előforduló számot. +NEGBINOMDIST = NEGBINOM.ELOSZL ## A negatív binomiális eloszlás értékét számítja ki. +NORMDIST = NORM.ELOSZL ## A normális eloszlás értékét számítja ki. +NORMINV = INVERZ.NORM ## A normális eloszlás eloszlásfüggvénye inverzének értékét számítja ki. +NORMSDIST = STNORMELOSZL ## A standard normális eloszlás eloszlásfüggvényének értékét számítja ki. +NORMSINV = INVERZ.STNORM ## A standard normális eloszlás eloszlásfüggvénye inverzének értékét számítja ki. +PEARSON = PEARSON ## A Pearson-féle korrelációs együtthatót számítja ki. +PERCENTILE = PERCENTILIS ## Egy tartományban található értékek k-adik percentilisét, azaz százalékosztályát adja eredményül. +PERCENTRANK = SZÁZALÉKRANG ## Egy értéknek egy adathalmazon belül vett százalékos rangját (elhelyezkedését) számítja ki. +PERMUT = VARIÁCIÓK ## Adott számú objektum k-ad osztályú ismétlés nélküli variációinak számát számítja ki. +POISSON = POISSON ## A Poisson-eloszlás értékét számítja ki. +PROB = VALÓSZÍNŰSÉG ## Annak valószínűségét számítja ki, hogy adott értékek két határérték közé esnek. +QUARTILE = KVARTILIS ## Egy adathalmaz kvartilisét (negyedszintjét) számítja ki. +RANK = SORSZÁM ## Kiszámítja, hogy egy szám hányadik egy számsorozatban. +RSQ = RNÉGYZET ## Kiszámítja a Pearson-féle szorzatmomentum korrelációs együtthatójának négyzetét. +SKEW = FERDESÉG ## Egy eloszlás ferdeségét határozza meg. +SLOPE = MEREDEKSÉG ## Egy lineáris regressziós egyenes meredekségét számítja ki. +SMALL = KICSI ## Egy adathalmaz k-adik legkisebb elemét adja meg. +STANDARDIZE = NORMALIZÁLÁS ## Normalizált értéket ad eredményül. +STDEV = SZÓRÁS ## Egy statisztikai sokaság mintájából kiszámítja annak szórását. +STDEVA = SZÓRÁSA ## Egy statisztikai sokaság mintájából kiszámítja annak szórását (beleértve a számokat, szöveget és logikai értékeket). +STDEVP = SZÓRÁSP ## Egy statisztikai sokaság egészéből kiszámítja annak szórását. +STDEVPA = SZÓRÁSPA ## Egy statisztikai sokaság egészéből kiszámítja annak szórását (beleértve számokat, szöveget és logikai értékeket). +STEYX = STHIBAYX ## Egy regresszió esetén az egyes x-értékek alapján meghatározott y-értékek standard hibáját számítja ki. +TDIST = T.ELOSZLÁS ## A Student-féle t-eloszlás értékét számítja ki. +TINV = INVERZ.T ## A Student-féle t-eloszlás inverzét számítja ki. +TREND = TREND ## Lineáris trend értékeit számítja ki. +TRIMMEAN = RÉSZÁTLAG ## Egy adathalmaz középső részének átlagát számítja ki. +TTEST = T.PRÓBA ## A Student-féle t-próbához tartozó valószínűséget számítja ki. +VAR = VAR ## Minta alapján becslést ad a varianciára. +VARA = VARA ## Minta alapján becslést ad a varianciára (beleértve számokat, szöveget és logikai értékeket). +VARP = VARP ## Egy statisztikai sokaság varianciáját számítja ki. +VARPA = VARPA ## Egy statisztikai sokaság varianciáját számítja ki (beleértve számokat, szöveget és logikai értékeket). +WEIBULL = WEIBULL ## A Weibull-féle eloszlás értékét számítja ki. +ZTEST = Z.PRÓBA ## Az egyszélű z-próbával kapott valószínűségértéket számítja ki. + + +## +## Text functions Szövegműveletekhez használható függvények +## +ASC = ASC ## Szöveg teljes szélességű (kétbájtos) latin és katakana karaktereit félszélességű (egybájtos) karakterekké alakítja. +BAHTTEXT = BAHTSZÖVEG ## Számot szöveggé alakít a ß (baht) pénznemformátum használatával. +CHAR = KARAKTER ## A kódszámmal meghatározott karaktert adja eredményül. +CLEAN = TISZTÍT ## A szövegből eltávolítja az összes nem nyomtatható karaktert. +CODE = KÓD ## Karaktersorozat első karakterének numerikus kódját adja eredményül. +CONCATENATE = ÖSSZEFŰZ ## Több szövegelemet egyetlen szöveges elemmé fűz össze. +DOLLAR = FORINT ## Számot pénznem formátumú szöveggé alakít át. +EXACT = AZONOS ## Megvizsgálja, hogy két érték azonos-e. +FIND = SZÖVEG.TALÁL ## Karaktersorozatot keres egy másikban (a kis- és nagybetűk megkülönböztetésével). +FINDB = SZÖVEG.TALÁL2 ## Karaktersorozatot keres egy másikban (a kis- és nagybetűk megkülönböztetésével). +FIXED = FIX ## Számot szöveges formátumúra alakít adott számú tizedesjegyre kerekítve. +JIS = JIS ## A félszélességű (egybájtos) latin és a katakana karaktereket teljes szélességű (kétbájtos) karakterekké alakítja. +LEFT = BAL ## Szöveg bal szélső karaktereit adja eredményül. +LEFTB = BAL2 ## Szöveg bal szélső karaktereit adja eredményül. +LEN = HOSSZ ## Szöveg karakterekben mért hosszát adja eredményül. +LENB = HOSSZ2 ## Szöveg karakterekben mért hosszát adja eredményül. +LOWER = KISBETŰ ## Szöveget kisbetűssé alakít át. +MID = KÖZÉP ## A szöveg adott pozíciójától kezdve megadott számú karaktert ad vissza eredményként. +MIDB = KÖZÉP2 ## A szöveg adott pozíciójától kezdve megadott számú karaktert ad vissza eredményként. +PHONETIC = PHONETIC ## Szöveg furigana (fonetikus) karaktereit adja vissza. +PROPER = TNÉV ## Szöveg minden szavának kezdőbetűjét nagybetűsre cseréli. +REPLACE = CSERE ## A szövegen belül karaktereket cserél. +REPLACEB = CSERE2 ## A szövegen belül karaktereket cserél. +REPT = SOKSZOR ## Megadott számú alkalommal megismétel egy szövegrészt. +RIGHT = JOBB ## Szövegrész jobb szélső karaktereit adja eredményül. +RIGHTB = JOBB2 ## Szövegrész jobb szélső karaktereit adja eredményül. +SEARCH = SZÖVEG.KERES ## Karaktersorozatot keres egy másikban (a kis- és nagybetűk között nem tesz különbséget). +SEARCHB = SZÖVEG.KERES2 ## Karaktersorozatot keres egy másikban (a kis- és nagybetűk között nem tesz különbséget). +SUBSTITUTE = HELYETTE ## Szövegben adott karaktereket másikra cserél. +T = T ## Argumentumát szöveggé alakítja át. +TEXT = SZÖVEG ## Számértéket alakít át adott számformátumú szöveggé. +TRIM = TRIM ## A szövegből eltávolítja a szóközöket. +UPPER = NAGYBETŰS ## Szöveget nagybetűssé alakít át. +VALUE = ÉRTÉK ## Szöveget számmá alakít át. diff --git a/extend/PHPExcel/PHPExcel/locale/it/config b/extend/PHPExcel/PHPExcel/locale/it/config new file mode 100644 index 0000000..c3afa75 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/it/config @@ -0,0 +1,47 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = € + + +## +## Excel Error Codes (For future use) +## +NULL = #NULLO! +DIV0 = #DIV/0! +VALUE = #VALORE! +REF = #RIF! +NAME = #NOME? +NUM = #NUM! +NA = #N/D diff --git a/extend/PHPExcel/PHPExcel/locale/it/functions b/extend/PHPExcel/PHPExcel/locale/it/functions new file mode 100644 index 0000000..d371f3d --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/it/functions @@ -0,0 +1,438 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Calculation +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ +## +## + + +## +## Add-in and Automation functions Funzioni di automazione e dei componenti aggiuntivi +## +GETPIVOTDATA = INFO.DATI.TAB.PIVOT ## Restituisce i dati memorizzati in un rapporto di tabella pivot + + +## +## Cube functions Funzioni cubo +## +CUBEKPIMEMBER = MEMBRO.KPI.CUBO ## Restituisce il nome, la proprietà e la misura di un indicatore di prestazioni chiave (KPI) e visualizza il nome e la proprietà nella cella. Un KPI è una misura quantificabile, ad esempio l'utile lordo mensile o il fatturato trimestrale dei dipendenti, utilizzata per il monitoraggio delle prestazioni di un'organizzazione. +CUBEMEMBER = MEMBRO.CUBO ## Restituisce un membro o una tupla in una gerarchia di cubi. Consente di verificare l'esistenza del membro o della tupla nel cubo. +CUBEMEMBERPROPERTY = PROPRIETÀ.MEMBRO.CUBO ## Restituisce il valore di una proprietà di un membro del cubo. Consente di verificare l'esistenza di un nome di membro all'interno del cubo e di restituire la proprietà specificata per tale membro. +CUBERANKEDMEMBER = MEMBRO.CUBO.CON.RANGO ## Restituisce l'n-esimo membro o il membro ordinato di un insieme. Consente di restituire uno o più elementi in un insieme, ad esempio l'agente di vendita migliore o i primi 10 studenti. +CUBESET = SET.CUBO ## Definisce un insieme di tuple o membri calcolati mediante l'invio di un'espressione di insieme al cubo sul server. In questo modo l'insieme viene creato e restituito a Microsoft Office Excel. +CUBESETCOUNT = CONTA.SET.CUBO ## Restituisce il numero di elementi di un insieme. +CUBEVALUE = VALORE.CUBO ## Restituisce un valore aggregato da un cubo. + + +## +## Database functions Funzioni di database +## +DAVERAGE = DB.MEDIA ## Restituisce la media di voci del database selezionate +DCOUNT = DB.CONTA.NUMERI ## Conta le celle di un database contenenti numeri +DCOUNTA = DB.CONTA.VALORI ## Conta le celle non vuote in un database +DGET = DB.VALORI ## Estrae da un database un singolo record che soddisfa i criteri specificati +DMAX = DB.MAX ## Restituisce il valore massimo dalle voci selezionate in un database +DMIN = DB.MIN ## Restituisce il valore minimo dalle voci di un database selezionate +DPRODUCT = DB.PRODOTTO ## Moltiplica i valori in un determinato campo di record che soddisfano i criteri del database +DSTDEV = DB.DEV.ST ## Restituisce una stima della deviazione standard sulla base di un campione di voci di un database selezionate +DSTDEVP = DB.DEV.ST.POP ## Calcola la deviazione standard sulla base di tutte le voci di un database selezionate +DSUM = DB.SOMMA ## Aggiunge i numeri nel campo colonna di record del database che soddisfa determinati criteri +DVAR = DB.VAR ## Restituisce una stima della varianza sulla base di un campione da voci di un database selezionate +DVARP = DB.VAR.POP ## Calcola la varianza sulla base di tutte le voci di un database selezionate + + +## +## Date and time functions Funzioni data e ora +## +DATE = DATA ## Restituisce il numero seriale di una determinata data +DATEVALUE = DATA.VALORE ## Converte una data sotto forma di testo in un numero seriale +DAY = GIORNO ## Converte un numero seriale in un giorno del mese +DAYS360 = GIORNO360 ## Calcola il numero di giorni compreso tra due date basandosi su un anno di 360 giorni +EDATE = DATA.MESE ## Restituisce il numero seriale della data che rappresenta il numero di mesi prima o dopo la data di inizio +EOMONTH = FINE.MESE ## Restituisce il numero seriale dell'ultimo giorno del mese, prima o dopo un determinato numero di mesi +HOUR = ORA ## Converte un numero seriale in un'ora +MINUTE = MINUTO ## Converte un numero seriale in un minuto +MONTH = MESE ## Converte un numero seriale in un mese +NETWORKDAYS = GIORNI.LAVORATIVI.TOT ## Restituisce il numero di tutti i giorni lavorativi compresi fra due date +NOW = ADESSO ## Restituisce il numero seriale della data e dell'ora corrente +SECOND = SECONDO ## Converte un numero seriale in un secondo +TIME = ORARIO ## Restituisce il numero seriale di una determinata ora +TIMEVALUE = ORARIO.VALORE ## Converte un orario in forma di testo in un numero seriale +TODAY = OGGI ## Restituisce il numero seriale relativo alla data odierna +WEEKDAY = GIORNO.SETTIMANA ## Converte un numero seriale in un giorno della settimana +WEEKNUM = NUM.SETTIMANA ## Converte un numero seriale in un numero che rappresenta la posizione numerica di una settimana nell'anno +WORKDAY = GIORNO.LAVORATIVO ## Restituisce il numero della data prima o dopo un determinato numero di giorni lavorativi +YEAR = ANNO ## Converte un numero seriale in un anno +YEARFRAC = FRAZIONE.ANNO ## Restituisce la frazione dell'anno che rappresenta il numero dei giorni compresi tra una data_ iniziale e una data_finale + + +## +## Engineering functions Funzioni ingegneristiche +## +BESSELI = BESSEL.I ## Restituisce la funzione di Bessel modificata In(x) +BESSELJ = BESSEL.J ## Restituisce la funzione di Bessel Jn(x) +BESSELK = BESSEL.K ## Restituisce la funzione di Bessel modificata Kn(x) +BESSELY = BESSEL.Y ## Restituisce la funzione di Bessel Yn(x) +BIN2DEC = BINARIO.DECIMALE ## Converte un numero binario in decimale +BIN2HEX = BINARIO.HEX ## Converte un numero binario in esadecimale +BIN2OCT = BINARIO.OCT ## Converte un numero binario in ottale +COMPLEX = COMPLESSO ## Converte i coefficienti reali e immaginari in numeri complessi +CONVERT = CONVERTI ## Converte un numero da un sistema di misura in un altro +DEC2BIN = DECIMALE.BINARIO ## Converte un numero decimale in binario +DEC2HEX = DECIMALE.HEX ## Converte un numero decimale in esadecimale +DEC2OCT = DECIMALE.OCT ## Converte un numero decimale in ottale +DELTA = DELTA ## Verifica se due valori sono uguali +ERF = FUNZ.ERRORE ## Restituisce la funzione di errore +ERFC = FUNZ.ERRORE.COMP ## Restituisce la funzione di errore complementare +GESTEP = SOGLIA ## Verifica se un numero è maggiore del valore di soglia +HEX2BIN = HEX.BINARIO ## Converte un numero esadecimale in binario +HEX2DEC = HEX.DECIMALE ## Converte un numero esadecimale in decimale +HEX2OCT = HEX.OCT ## Converte un numero esadecimale in ottale +IMABS = COMP.MODULO ## Restituisce il valore assoluto (modulo) di un numero complesso +IMAGINARY = COMP.IMMAGINARIO ## Restituisce il coefficiente immaginario di un numero complesso +IMARGUMENT = COMP.ARGOMENTO ## Restituisce l'argomento theta, un angolo espresso in radianti +IMCONJUGATE = COMP.CONIUGATO ## Restituisce il complesso coniugato del numero complesso +IMCOS = COMP.COS ## Restituisce il coseno di un numero complesso +IMDIV = COMP.DIV ## Restituisce il quoziente di due numeri complessi +IMEXP = COMP.EXP ## Restituisce il valore esponenziale di un numero complesso +IMLN = COMP.LN ## Restituisce il logaritmo naturale di un numero complesso +IMLOG10 = COMP.LOG10 ## Restituisce il logaritmo in base 10 di un numero complesso +IMLOG2 = COMP.LOG2 ## Restituisce un logaritmo in base 2 di un numero complesso +IMPOWER = COMP.POTENZA ## Restituisce il numero complesso elevato a una potenza intera +IMPRODUCT = COMP.PRODOTTO ## Restituisce il prodotto di numeri complessi compresi tra 2 e 29 +IMREAL = COMP.PARTE.REALE ## Restituisce il coefficiente reale di un numero complesso +IMSIN = COMP.SEN ## Restituisce il seno di un numero complesso +IMSQRT = COMP.RADQ ## Restituisce la radice quadrata di un numero complesso +IMSUB = COMP.DIFF ## Restituisce la differenza fra due numeri complessi +IMSUM = COMP.SOMMA ## Restituisce la somma di numeri complessi +OCT2BIN = OCT.BINARIO ## Converte un numero ottale in binario +OCT2DEC = OCT.DECIMALE ## Converte un numero ottale in decimale +OCT2HEX = OCT.HEX ## Converte un numero ottale in esadecimale + + +## +## Financial functions Funzioni finanziarie +## +ACCRINT = INT.MATURATO.PER ## Restituisce l'interesse maturato di un titolo che paga interessi periodici +ACCRINTM = INT.MATURATO.SCAD ## Restituisce l'interesse maturato di un titolo che paga interessi alla scadenza +AMORDEGRC = AMMORT.DEGR ## Restituisce l'ammortamento per ogni periodo contabile utilizzando un coefficiente di ammortamento +AMORLINC = AMMORT.PER ## Restituisce l'ammortamento per ogni periodo contabile +COUPDAYBS = GIORNI.CED.INIZ.LIQ ## Restituisce il numero dei giorni che vanno dall'inizio del periodo di durata della cedola alla data di liquidazione +COUPDAYS = GIORNI.CED ## Restituisce il numero dei giorni relativi al periodo della cedola che contiene la data di liquidazione +COUPDAYSNC = GIORNI.CED.NUOVA ## Restituisce il numero di giorni che vanno dalla data di liquidazione alla data della cedola successiva +COUPNCD = DATA.CED.SUCC ## Restituisce un numero che rappresenta la data della cedola successiva alla data di liquidazione +COUPNUM = NUM.CED ## Restituisce il numero di cedole pagabili fra la data di liquidazione e la data di scadenza +COUPPCD = DATA.CED.PREC ## Restituisce un numero che rappresenta la data della cedola precedente alla data di liquidazione +CUMIPMT = INT.CUMUL ## Restituisce l'interesse cumulativo pagato fra due periodi +CUMPRINC = CAP.CUM ## Restituisce il capitale cumulativo pagato per estinguere un debito fra due periodi +DB = DB ## Restituisce l'ammortamento di un bene per un periodo specificato utilizzando il metodo di ammortamento a quote fisse decrescenti +DDB = AMMORT ## Restituisce l'ammortamento di un bene per un periodo specificato utilizzando il metodo di ammortamento a doppie quote decrescenti o altri metodi specificati +DISC = TASSO.SCONTO ## Restituisce il tasso di sconto per un titolo +DOLLARDE = VALUTA.DEC ## Converte un prezzo valuta, espresso come frazione, in prezzo valuta, espresso come numero decimale +DOLLARFR = VALUTA.FRAZ ## Converte un prezzo valuta, espresso come numero decimale, in prezzo valuta, espresso come frazione +DURATION = DURATA ## Restituisce la durata annuale di un titolo con i pagamenti di interesse periodico +EFFECT = EFFETTIVO ## Restituisce l'effettivo tasso di interesse annuo +FV = VAL.FUT ## Restituisce il valore futuro di un investimento +FVSCHEDULE = VAL.FUT.CAPITALE ## Restituisce il valore futuro di un capitale iniziale dopo aver applicato una serie di tassi di interesse composti +INTRATE = TASSO.INT ## Restituisce il tasso di interesse per un titolo interamente investito +IPMT = INTERESSI ## Restituisce il valore degli interessi per un investimento relativo a un periodo specifico +IRR = TIR.COST ## Restituisce il tasso di rendimento interno per una serie di flussi di cassa +ISPMT = INTERESSE.RATA ## Calcola l'interesse di un investimento pagato durante un periodo specifico +MDURATION = DURATA.M ## Restituisce la durata Macauley modificata per un titolo con un valore presunto di € 100 +MIRR = TIR.VAR ## Restituisce il tasso di rendimento interno in cui i flussi di cassa positivi e negativi sono finanziati a tassi differenti +NOMINAL = NOMINALE ## Restituisce il tasso di interesse nominale annuale +NPER = NUM.RATE ## Restituisce un numero di periodi relativi a un investimento +NPV = VAN ## Restituisce il valore attuale netto di un investimento basato su una serie di flussi di cassa periodici e sul tasso di sconto +ODDFPRICE = PREZZO.PRIMO.IRR ## Restituisce il prezzo di un titolo dal valore nominale di € 100 avente il primo periodo di durata irregolare +ODDFYIELD = REND.PRIMO.IRR ## Restituisce il rendimento di un titolo avente il primo periodo di durata irregolare +ODDLPRICE = PREZZO.ULTIMO.IRR ## Restituisce il prezzo di un titolo dal valore nominale di € 100 avente l'ultimo periodo di durata irregolare +ODDLYIELD = REND.ULTIMO.IRR ## Restituisce il rendimento di un titolo avente l'ultimo periodo di durata irregolare +PMT = RATA ## Restituisce il pagamento periodico di una rendita annua +PPMT = P.RATA ## Restituisce il pagamento sul capitale di un investimento per un dato periodo +PRICE = PREZZO ## Restituisce il prezzo di un titolo dal valore nominale di € 100 che paga interessi periodici +PRICEDISC = PREZZO.SCONT ## Restituisce il prezzo di un titolo scontato dal valore nominale di € 100 +PRICEMAT = PREZZO.SCAD ## Restituisce il prezzo di un titolo dal valore nominale di € 100 che paga gli interessi alla scadenza +PV = VA ## Restituisce il valore attuale di un investimento +RATE = TASSO ## Restituisce il tasso di interesse per un periodo di un'annualità +RECEIVED = RICEV.SCAD ## Restituisce l'ammontare ricevuto alla scadenza di un titolo interamente investito +SLN = AMMORT.COST ## Restituisce l'ammortamento a quote costanti di un bene per un singolo periodo +SYD = AMMORT.ANNUO ## Restituisce l'ammortamento a somma degli anni di un bene per un periodo specificato +TBILLEQ = BOT.EQUIV ## Restituisce il rendimento equivalente ad un'obbligazione per un Buono ordinario del Tesoro +TBILLPRICE = BOT.PREZZO ## Restituisce il prezzo di un Buono del Tesoro dal valore nominale di € 100 +TBILLYIELD = BOT.REND ## Restituisce il rendimento di un Buono del Tesoro +VDB = AMMORT.VAR ## Restituisce l'ammortamento di un bene per un periodo specificato o parziale utilizzando il metodo a doppie quote proporzionali ai valori residui +XIRR = TIR.X ## Restituisce il tasso di rendimento interno di un impiego di flussi di cassa +XNPV = VAN.X ## Restituisce il valore attuale netto di un impiego di flussi di cassa non necessariamente periodici +YIELD = REND ## Restituisce il rendimento di un titolo che frutta interessi periodici +YIELDDISC = REND.TITOLI.SCONT ## Restituisce il rendimento annuale di un titolo scontato, ad esempio un Buono del Tesoro +YIELDMAT = REND.SCAD ## Restituisce il rendimento annuo di un titolo che paga interessi alla scadenza + + +## +## Information functions Funzioni relative alle informazioni +## +CELL = CELLA ## Restituisce le informazioni sulla formattazione, la posizione o i contenuti di una cella +ERROR.TYPE = ERRORE.TIPO ## Restituisce un numero che corrisponde a un tipo di errore +INFO = INFO ## Restituisce le informazioni sull'ambiente operativo corrente +ISBLANK = VAL.VUOTO ## Restituisce VERO se il valore è vuoto +ISERR = VAL.ERR ## Restituisce VERO se il valore è un valore di errore qualsiasi tranne #N/D +ISERROR = VAL.ERRORE ## Restituisce VERO se il valore è un valore di errore qualsiasi +ISEVEN = VAL.PARI ## Restituisce VERO se il numero è pari +ISLOGICAL = VAL.LOGICO ## Restituisce VERO se il valore è un valore logico +ISNA = VAL.NON.DISP ## Restituisce VERO se il valore è un valore di errore #N/D +ISNONTEXT = VAL.NON.TESTO ## Restituisce VERO se il valore non è in formato testo +ISNUMBER = VAL.NUMERO ## Restituisce VERO se il valore è un numero +ISODD = VAL.DISPARI ## Restituisce VERO se il numero è dispari +ISREF = VAL.RIF ## Restituisce VERO se il valore è un riferimento +ISTEXT = VAL.TESTO ## Restituisce VERO se il valore è in formato testo +N = NUM ## Restituisce un valore convertito in numero +NA = NON.DISP ## Restituisce il valore di errore #N/D +TYPE = TIPO ## Restituisce un numero che indica il tipo di dati relativi a un valore + + +## +## Logical functions Funzioni logiche +## +AND = E ## Restituisce VERO se tutti gli argomenti sono VERO +FALSE = FALSO ## Restituisce il valore logico FALSO +IF = SE ## Specifica un test logico da eseguire +IFERROR = SE.ERRORE ## Restituisce un valore specificato se una formula fornisce un errore come risultato; in caso contrario, restituisce il risultato della formula +NOT = NON ## Inverte la logica degli argomenti +OR = O ## Restituisce VERO se un argomento qualsiasi è VERO +TRUE = VERO ## Restituisce il valore logico VERO + + +## +## Lookup and reference functions Funzioni di ricerca e di riferimento +## +ADDRESS = INDIRIZZO ## Restituisce un riferimento come testo in una singola cella di un foglio di lavoro +AREAS = AREE ## Restituisce il numero di aree in un riferimento +CHOOSE = SCEGLI ## Sceglie un valore da un elenco di valori +COLUMN = RIF.COLONNA ## Restituisce il numero di colonna di un riferimento +COLUMNS = COLONNE ## Restituisce il numero di colonne in un riferimento +HLOOKUP = CERCA.ORIZZ ## Effettua una ricerca nella riga superiore di una matrice e restituisce il valore della cella specificata +HYPERLINK = COLLEG.IPERTESTUALE ## Crea un collegamento che apre un documento memorizzato in un server di rete, una rete Intranet o Internet +INDEX = INDICE ## Utilizza un indice per scegliere un valore da un riferimento o da una matrice +INDIRECT = INDIRETTO ## Restituisce un riferimento specificato da un valore testo +LOOKUP = CERCA ## Ricerca i valori in un vettore o in una matrice +MATCH = CONFRONTA ## Ricerca i valori in un riferimento o in una matrice +OFFSET = SCARTO ## Restituisce uno scarto di riferimento da un riferimento dato +ROW = RIF.RIGA ## Restituisce il numero di riga di un riferimento +ROWS = RIGHE ## Restituisce il numero delle righe in un riferimento +RTD = DATITEMPOREALE ## Recupera dati in tempo reale da un programma che supporta l'automazione COM (automazione: Metodo per utilizzare gli oggetti di un'applicazione da un'altra applicazione o da un altro strumento di sviluppo. Precedentemente nota come automazione OLE, l'automazione è uno standard del settore e una caratteristica del modello COM (Component Object Model).) +TRANSPOSE = MATR.TRASPOSTA ## Restituisce la trasposizione di una matrice +VLOOKUP = CERCA.VERT ## Effettua una ricerca nella prima colonna di una matrice e si sposta attraverso la riga per restituire il valore di una cella + + +## +## Math and trigonometry functions Funzioni matematiche e trigonometriche +## +ABS = ASS ## Restituisce il valore assoluto di un numero. +ACOS = ARCCOS ## Restituisce l'arcocoseno di un numero +ACOSH = ARCCOSH ## Restituisce l'inverso del coseno iperbolico di un numero +ASIN = ARCSEN ## Restituisce l'arcoseno di un numero +ASINH = ARCSENH ## Restituisce l'inverso del seno iperbolico di un numero +ATAN = ARCTAN ## Restituisce l'arcotangente di un numero +ATAN2 = ARCTAN.2 ## Restituisce l'arcotangente delle coordinate x e y specificate +ATANH = ARCTANH ## Restituisce l'inverso della tangente iperbolica di un numero +CEILING = ARROTONDA.ECCESSO ## Arrotonda un numero per eccesso all'intero più vicino o al multiplo più vicino a peso +COMBIN = COMBINAZIONE ## Restituisce il numero di combinazioni possibili per un numero assegnato di elementi +COS = COS ## Restituisce il coseno dell'angolo specificato +COSH = COSH ## Restituisce il coseno iperbolico di un numero +DEGREES = GRADI ## Converte i radianti in gradi +EVEN = PARI ## Arrotonda il valore assoluto di un numero per eccesso al più vicino intero pari +EXP = ESP ## Restituisce il numero e elevato alla potenza di num +FACT = FATTORIALE ## Restituisce il fattoriale di un numero +FACTDOUBLE = FATT.DOPPIO ## Restituisce il fattoriale doppio di un numero +FLOOR = ARROTONDA.DIFETTO ## Arrotonda un numero per difetto al multiplo più vicino a zero +GCD = MCD ## Restituisce il massimo comune divisore +INT = INT ## Arrotonda un numero per difetto al numero intero più vicino +LCM = MCM ## Restituisce il minimo comune multiplo +LN = LN ## Restituisce il logaritmo naturale di un numero +LOG = LOG ## Restituisce il logaritmo di un numero in una specificata base +LOG10 = LOG10 ## Restituisce il logaritmo in base 10 di un numero +MDETERM = MATR.DETERM ## Restituisce il determinante di una matrice +MINVERSE = MATR.INVERSA ## Restituisce l'inverso di una matrice +MMULT = MATR.PRODOTTO ## Restituisce il prodotto di due matrici +MOD = RESTO ## Restituisce il resto della divisione +MROUND = ARROTONDA.MULTIPLO ## Restituisce un numero arrotondato al multiplo desiderato +MULTINOMIAL = MULTINOMIALE ## Restituisce il multinomiale di un insieme di numeri +ODD = DISPARI ## Arrotonda un numero per eccesso al più vicino intero dispari +PI = PI.GRECO ## Restituisce il valore di pi greco +POWER = POTENZA ## Restituisce il risultato di un numero elevato a potenza +PRODUCT = PRODOTTO ## Moltiplica i suoi argomenti +QUOTIENT = QUOZIENTE ## Restituisce la parte intera di una divisione +RADIANS = RADIANTI ## Converte i gradi in radianti +RAND = CASUALE ## Restituisce un numero casuale compreso tra 0 e 1 +RANDBETWEEN = CASUALE.TRA ## Restituisce un numero casuale compreso tra i numeri specificati +ROMAN = ROMANO ## Restituisce il numero come numero romano sotto forma di testo +ROUND = ARROTONDA ## Arrotonda il numero al numero di cifre specificato +ROUNDDOWN = ARROTONDA.PER.DIF ## Arrotonda il valore assoluto di un numero per difetto +ROUNDUP = ARROTONDA.PER.ECC ## Arrotonda il valore assoluto di un numero per eccesso +SERIESSUM = SOMMA.SERIE ## Restituisce la somma di una serie di potenze in base alla formula +SIGN = SEGNO ## Restituisce il segno di un numero +SIN = SEN ## Restituisce il seno di un dato angolo +SINH = SENH ## Restituisce il seno iperbolico di un numero +SQRT = RADQ ## Restituisce una radice quadrata +SQRTPI = RADQ.PI.GRECO ## Restituisce la radice quadrata di un numero (numero * pi greco) +SUBTOTAL = SUBTOTALE ## Restituisce un subtotale in un elenco o in un database +SUM = SOMMA ## Somma i suoi argomenti +SUMIF = SOMMA.SE ## Somma le celle specificate da un dato criterio +SUMIFS = SOMMA.PIÙ.SE ## Somma le celle in un intervallo che soddisfano più criteri +SUMPRODUCT = MATR.SOMMA.PRODOTTO ## Restituisce la somma dei prodotti dei componenti corrispondenti della matrice +SUMSQ = SOMMA.Q ## Restituisce la somma dei quadrati degli argomenti +SUMX2MY2 = SOMMA.DIFF.Q ## Restituisce la somma della differenza dei quadrati dei corrispondenti elementi in due matrici +SUMX2PY2 = SOMMA.SOMMA.Q ## Restituisce la somma della somma dei quadrati dei corrispondenti elementi in due matrici +SUMXMY2 = SOMMA.Q.DIFF ## Restituisce la somma dei quadrati delle differenze dei corrispondenti elementi in due matrici +TAN = TAN ## Restituisce la tangente di un numero +TANH = TANH ## Restituisce la tangente iperbolica di un numero +TRUNC = TRONCA ## Tronca la parte decimale di un numero + + +## +## Statistical functions Funzioni statistiche +## +AVEDEV = MEDIA.DEV ## Restituisce la media delle deviazioni assolute delle coordinate rispetto alla loro media +AVERAGE = MEDIA ## Restituisce la media degli argomenti +AVERAGEA = MEDIA.VALORI ## Restituisce la media degli argomenti, inclusi i numeri, il testo e i valori logici +AVERAGEIF = MEDIA.SE ## Restituisce la media aritmetica di tutte le celle in un intervallo che soddisfano un determinato criterio +AVERAGEIFS = MEDIA.PIÙ.SE ## Restituisce la media aritmetica di tutte le celle che soddisfano più criteri +BETADIST = DISTRIB.BETA ## Restituisce la funzione di distribuzione cumulativa beta +BETAINV = INV.BETA ## Restituisce l'inverso della funzione di distribuzione cumulativa per una distribuzione beta specificata +BINOMDIST = DISTRIB.BINOM ## Restituisce la distribuzione binomiale per il termine individuale +CHIDIST = DISTRIB.CHI ## Restituisce la probabilità a una coda per la distribuzione del chi quadrato +CHIINV = INV.CHI ## Restituisce l'inverso della probabilità ad una coda per la distribuzione del chi quadrato +CHITEST = TEST.CHI ## Restituisce il test per l'indipendenza +CONFIDENCE = CONFIDENZA ## Restituisce l'intervallo di confidenza per una popolazione +CORREL = CORRELAZIONE ## Restituisce il coefficiente di correlazione tra due insiemi di dati +COUNT = CONTA.NUMERI ## Conta la quantità di numeri nell'elenco di argomenti +COUNTA = CONTA.VALORI ## Conta il numero di valori nell'elenco di argomenti +COUNTBLANK = CONTA.VUOTE ## Conta il numero di celle vuote all'interno di un intervallo +COUNTIF = CONTA.SE ## Conta il numero di celle all'interno di un intervallo che soddisfa i criteri specificati +COUNTIFS = CONTA.PIÙ.SE ## Conta il numero di celle in un intervallo che soddisfano più criteri. +COVAR = COVARIANZA ## Calcola la covarianza, la media dei prodotti delle deviazioni accoppiate +CRITBINOM = CRIT.BINOM ## Restituisce il più piccolo valore per il quale la distribuzione cumulativa binomiale risulta maggiore o uguale ad un valore di criterio +DEVSQ = DEV.Q ## Restituisce la somma dei quadrati delle deviazioni +EXPONDIST = DISTRIB.EXP ## Restituisce la distribuzione esponenziale +FDIST = DISTRIB.F ## Restituisce la distribuzione di probabilità F +FINV = INV.F ## Restituisce l'inverso della distribuzione della probabilità F +FISHER = FISHER ## Restituisce la trasformazione di Fisher +FISHERINV = INV.FISHER ## Restituisce l'inverso della trasformazione di Fisher +FORECAST = PREVISIONE ## Restituisce i valori lungo una tendenza lineare +FREQUENCY = FREQUENZA ## Restituisce la distribuzione di frequenza come matrice verticale +FTEST = TEST.F ## Restituisce il risultato di un test F +GAMMADIST = DISTRIB.GAMMA ## Restituisce la distribuzione gamma +GAMMAINV = INV.GAMMA ## Restituisce l'inverso della distribuzione cumulativa gamma +GAMMALN = LN.GAMMA ## Restituisce il logaritmo naturale della funzione gamma, G(x) +GEOMEAN = MEDIA.GEOMETRICA ## Restituisce la media geometrica +GROWTH = CRESCITA ## Restituisce i valori lungo una linea di tendenza esponenziale +HARMEAN = MEDIA.ARMONICA ## Restituisce la media armonica +HYPGEOMDIST = DISTRIB.IPERGEOM ## Restituisce la distribuzione ipergeometrica +INTERCEPT = INTERCETTA ## Restituisce l'intercetta della retta di regressione lineare +KURT = CURTOSI ## Restituisce la curtosi di un insieme di dati +LARGE = GRANDE ## Restituisce il k-esimo valore più grande in un insieme di dati +LINEST = REGR.LIN ## Restituisce i parametri di una tendenza lineare +LOGEST = REGR.LOG ## Restituisce i parametri di una linea di tendenza esponenziale +LOGINV = INV.LOGNORM ## Restituisce l'inverso di una distribuzione lognormale +LOGNORMDIST = DISTRIB.LOGNORM ## Restituisce la distribuzione lognormale cumulativa +MAX = MAX ## Restituisce il valore massimo in un elenco di argomenti +MAXA = MAX.VALORI ## Restituisce il valore massimo in un elenco di argomenti, inclusi i numeri, il testo e i valori logici +MEDIAN = MEDIANA ## Restituisce la mediana dei numeri specificati +MIN = MIN ## Restituisce il valore minimo in un elenco di argomenti +MINA = MIN.VALORI ## Restituisce il più piccolo valore in un elenco di argomenti, inclusi i numeri, il testo e i valori logici +MODE = MODA ## Restituisce il valore più comune in un insieme di dati +NEGBINOMDIST = DISTRIB.BINOM.NEG ## Restituisce la distribuzione binomiale negativa +NORMDIST = DISTRIB.NORM ## Restituisce la distribuzione cumulativa normale +NORMINV = INV.NORM ## Restituisce l'inverso della distribuzione cumulativa normale standard +NORMSDIST = DISTRIB.NORM.ST ## Restituisce la distribuzione cumulativa normale standard +NORMSINV = INV.NORM.ST ## Restituisce l'inverso della distribuzione cumulativa normale +PEARSON = PEARSON ## Restituisce il coefficiente del momento di correlazione di Pearson +PERCENTILE = PERCENTILE ## Restituisce il k-esimo dato percentile di valori in un intervallo +PERCENTRANK = PERCENT.RANGO ## Restituisce il rango di un valore in un insieme di dati come percentuale +PERMUT = PERMUTAZIONE ## Restituisce il numero delle permutazioni per un determinato numero di oggetti +POISSON = POISSON ## Restituisce la distribuzione di Poisson +PROB = PROBABILITÀ ## Calcola la probabilità che dei valori in un intervallo siano compresi tra due limiti +QUARTILE = QUARTILE ## Restituisce il quartile di un insieme di dati +RANK = RANGO ## Restituisce il rango di un numero in un elenco di numeri +RSQ = RQ ## Restituisce la radice quadrata del coefficiente di momento di correlazione di Pearson +SKEW = ASIMMETRIA ## Restituisce il grado di asimmetria di una distribuzione +SLOPE = PENDENZA ## Restituisce la pendenza di una retta di regressione lineare +SMALL = PICCOLO ## Restituisce il k-esimo valore più piccolo in un insieme di dati +STANDARDIZE = NORMALIZZA ## Restituisce un valore normalizzato +STDEV = DEV.ST ## Restituisce una stima della deviazione standard sulla base di un campione +STDEVA = DEV.ST.VALORI ## Restituisce una stima della deviazione standard sulla base di un campione, inclusi i numeri, il testo e i valori logici +STDEVP = DEV.ST.POP ## Calcola la deviazione standard sulla base di un'intera popolazione +STDEVPA = DEV.ST.POP.VALORI ## Calcola la deviazione standard sulla base sull'intera popolazione, inclusi i numeri, il testo e i valori logici +STEYX = ERR.STD.YX ## Restituisce l'errore standard del valore previsto per y per ogni valore x nella regressione +TDIST = DISTRIB.T ## Restituisce la distribuzione t di Student +TINV = INV.T ## Restituisce l'inversa della distribuzione t di Student +TREND = TENDENZA ## Restituisce i valori lungo una linea di tendenza lineare +TRIMMEAN = MEDIA.TRONCATA ## Restituisce la media della parte interna di un insieme di dati +TTEST = TEST.T ## Restituisce la probabilità associata ad un test t di Student +VAR = VAR ## Stima la varianza sulla base di un campione +VARA = VAR.VALORI ## Stima la varianza sulla base di un campione, inclusi i numeri, il testo e i valori logici +VARP = VAR.POP ## Calcola la varianza sulla base dell'intera popolazione +VARPA = VAR.POP.VALORI ## Calcola la deviazione standard sulla base sull'intera popolazione, inclusi i numeri, il testo e i valori logici +WEIBULL = WEIBULL ## Restituisce la distribuzione di Weibull +ZTEST = TEST.Z ## Restituisce il valore di probabilità a una coda per un test z + + +## +## Text functions Funzioni di testo +## +ASC = ASC ## Modifica le lettere inglesi o il katakana a doppio byte all'interno di una stringa di caratteri in caratteri a singolo byte +BAHTTEXT = BAHTTESTO ## Converte un numero in testo, utilizzando il formato valuta ß (baht) +CHAR = CODICE.CARATT ## Restituisce il carattere specificato dal numero di codice +CLEAN = LIBERA ## Elimina dal testo tutti i caratteri che non è possibile stampare +CODE = CODICE ## Restituisce il codice numerico del primo carattere di una stringa di testo +CONCATENATE = CONCATENA ## Unisce diversi elementi di testo in un unico elemento di testo +DOLLAR = VALUTA ## Converte un numero in testo, utilizzando il formato valuta € (euro) +EXACT = IDENTICO ## Verifica se due valori di testo sono uguali +FIND = TROVA ## Rileva un valore di testo all'interno di un altro (distinzione tra maiuscole e minuscole) +FINDB = TROVA.B ## Rileva un valore di testo all'interno di un altro (distinzione tra maiuscole e minuscole) +FIXED = FISSO ## Formatta un numero come testo con un numero fisso di decimali +JIS = ORDINAMENTO.JIS ## Modifica le lettere inglesi o i caratteri katakana a byte singolo all'interno di una stringa di caratteri in caratteri a byte doppio. +LEFT = SINISTRA ## Restituisce il carattere più a sinistra di un valore di testo +LEFTB = SINISTRA.B ## Restituisce il carattere più a sinistra di un valore di testo +LEN = LUNGHEZZA ## Restituisce il numero di caratteri di una stringa di testo +LENB = LUNB ## Restituisce il numero di caratteri di una stringa di testo +LOWER = MINUSC ## Converte il testo in lettere minuscole +MID = MEDIA ## Restituisce un numero specifico di caratteri di una stringa di testo a partire dalla posizione specificata +MIDB = MEDIA.B ## Restituisce un numero specifico di caratteri di una stringa di testo a partire dalla posizione specificata +PHONETIC = FURIGANA ## Estrae i caratteri fonetici (furigana) da una stringa di testo. +PROPER = MAIUSC.INIZ ## Converte in maiuscolo la prima lettera di ogni parola di un valore di testo +REPLACE = RIMPIAZZA ## Sostituisce i caratteri all'interno di un testo +REPLACEB = SOSTITUISCI.B ## Sostituisce i caratteri all'interno di un testo +REPT = RIPETI ## Ripete un testo per un dato numero di volte +RIGHT = DESTRA ## Restituisce il carattere più a destra di un valore di testo +RIGHTB = DESTRA.B ## Restituisce il carattere più a destra di un valore di testo +SEARCH = RICERCA ## Rileva un valore di testo all'interno di un altro (non è sensibile alle maiuscole e minuscole) +SEARCHB = CERCA.B ## Rileva un valore di testo all'interno di un altro (non è sensibile alle maiuscole e minuscole) +SUBSTITUTE = SOSTITUISCI ## Sostituisce il nuovo testo al testo contenuto in una stringa +T = T ## Converte gli argomenti in testo +TEXT = TESTO ## Formatta un numero e lo converte in testo +TRIM = ANNULLA.SPAZI ## Elimina gli spazi dal testo +UPPER = MAIUSC ## Converte il testo in lettere maiuscole +VALUE = VALORE ## Converte un argomento di testo in numero diff --git a/extend/PHPExcel/PHPExcel/locale/nl/config b/extend/PHPExcel/PHPExcel/locale/nl/config new file mode 100644 index 0000000..48dcc15 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/nl/config @@ -0,0 +1,47 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = € + + +## +## Excel Error Codes (For future use) +## +NULL = #LEEG! +DIV0 = #DEEL/0! +VALUE = #WAARDE! +REF = #VERW! +NAME = #NAAM? +NUM = #GETAL! +NA = #N/B diff --git a/extend/PHPExcel/PHPExcel/locale/nl/functions b/extend/PHPExcel/PHPExcel/locale/nl/functions new file mode 100644 index 0000000..573600a --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/nl/functions @@ -0,0 +1,438 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Calculation +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ +## +## + + +## +## Add-in and Automation functions Automatiseringsfuncties en functies in invoegtoepassingen +## +GETPIVOTDATA = DRAAITABEL.OPHALEN ## Geeft gegevens uit een draaitabelrapport als resultaat + + +## +## Cube functions Kubusfuncties +## +CUBEKPIMEMBER = KUBUSKPILID ## Retourneert de naam, eigenschap en waarde van een KPI (prestatie-indicator) en geeft de naam en de eigenschap in de cel weer. Een KPI is een meetbare waarde, zoals de maandelijkse brutowinst of de omzet per kwartaal per werknemer, die wordt gebruikt om de prestaties van een organisatie te bewaken +CUBEMEMBER = KUBUSLID ## Retourneert een lid of tupel in een kubushiërarchie. Wordt gebruikt om te controleren of het lid of de tupel in de kubus aanwezig is +CUBEMEMBERPROPERTY = KUBUSLIDEIGENSCHAP ## Retourneert de waarde van een lideigenschap in de kubus. Wordt gebruikt om te controleren of de lidnaam in de kubus bestaat en retourneert de opgegeven eigenschap voor dit lid +CUBERANKEDMEMBER = KUBUSGERANGCHIKTLID ## Retourneert het zoveelste, gerangschikte lid in een set. Wordt gebruikt om een of meer elementen in een set te retourneren, zoals de tien beste verkopers of de tien beste studenten +CUBESET = KUBUSSET ## Definieert een berekende set leden of tupels door een ingestelde expressie naar de kubus op de server te sturen, alwaar de set wordt gemaakt en vervolgens wordt geretourneerd naar Microsoft Office Excel +CUBESETCOUNT = KUBUSSETAANTAL ## Retourneert het aantal onderdelen in een set +CUBEVALUE = KUBUSWAARDE ## Retourneert een samengestelde waarde van een kubus + + +## +## Database functions Databasefuncties +## +DAVERAGE = DBGEMIDDELDE ## Berekent de gemiddelde waarde in geselecteerde databasegegevens +DCOUNT = DBAANTAL ## Telt de cellen met getallen in een database +DCOUNTA = DBAANTALC ## Telt de niet-lege cellen in een database +DGET = DBLEZEN ## Retourneert één record dat voldoet aan de opgegeven criteria uit een database +DMAX = DBMAX ## Retourneert de maximumwaarde in de geselecteerde databasegegevens +DMIN = DBMIN ## Retourneert de minimumwaarde in de geselecteerde databasegegevens +DPRODUCT = DBPRODUCT ## Vermenigvuldigt de waarden in een bepaald veld van de records die voldoen aan de criteria in een database +DSTDEV = DBSTDEV ## Maakt een schatting van de standaarddeviatie op basis van een steekproef uit geselecteerde databasegegevens +DSTDEVP = DBSTDEVP ## Berekent de standaarddeviatie op basis van de volledige populatie van geselecteerde databasegegevens +DSUM = DBSOM ## Telt de getallen uit een kolom records in de database op die voldoen aan de criteria +DVAR = DBVAR ## Maakt een schatting van de variantie op basis van een steekproef uit geselecteerde databasegegevens +DVARP = DBVARP ## Berekent de variantie op basis van de volledige populatie van geselecteerde databasegegevens + + +## +## Date and time functions Datum- en tijdfuncties +## +DATE = DATUM ## Geeft als resultaat het seriële getal van een opgegeven datum +DATEVALUE = DATUMWAARDE ## Converteert een datum in de vorm van tekst naar een serieel getal +DAY = DAG ## Converteert een serieel getal naar een dag van de maand +DAYS360 = DAGEN360 ## Berekent het aantal dagen tussen twee datums op basis van een jaar met 360 dagen +EDATE = ZELFDE.DAG ## Geeft als resultaat het seriële getal van een datum die het opgegeven aantal maanden voor of na de begindatum ligt +EOMONTH = LAATSTE.DAG ## Geeft als resultaat het seriële getal van de laatste dag van de maand voor of na het opgegeven aantal maanden +HOUR = UUR ## Converteert een serieel getal naar uren +MINUTE = MINUUT ## Converteert een serieel naar getal minuten +MONTH = MAAND ## Converteert een serieel getal naar een maand +NETWORKDAYS = NETTO.WERKDAGEN ## Geeft als resultaat het aantal hele werkdagen tussen twee datums +NOW = NU ## Geeft als resultaat het seriële getal van de huidige datum en tijd +SECOND = SECONDE ## Converteert een serieel getal naar seconden +TIME = TIJD ## Geeft als resultaat het seriële getal van een bepaald tijdstip +TIMEVALUE = TIJDWAARDE ## Converteert de tijd in de vorm van tekst naar een serieel getal +TODAY = VANDAAG ## Geeft als resultaat het seriële getal van de huidige datum +WEEKDAY = WEEKDAG ## Converteert een serieel getal naar een weekdag +WEEKNUM = WEEKNUMMER ## Converteert een serieel getal naar een weeknummer +WORKDAY = WERKDAG ## Geeft als resultaat het seriële getal van de datum voor of na een bepaald aantal werkdagen +YEAR = JAAR ## Converteert een serieel getal naar een jaar +YEARFRAC = JAAR.DEEL ## Geeft als resultaat het gedeelte van het jaar, uitgedrukt in het aantal hele dagen tussen begindatum en einddatum + + +## +## Engineering functions Technische functies +## +BESSELI = BESSEL.Y ## Geeft als resultaat de gewijzigde Bessel-functie In(x) +BESSELJ = BESSEL.J ## Geeft als resultaat de Bessel-functie Jn(x) +BESSELK = BESSEL.K ## Geeft als resultaat de gewijzigde Bessel-functie Kn(x) +BESSELY = BESSEL.Y ## Geeft als resultaat de gewijzigde Bessel-functie Yn(x) +BIN2DEC = BIN.N.DEC ## Converteert een binair getal naar een decimaal getal +BIN2HEX = BIN.N.HEX ## Converteert een binair getal naar een hexadecimaal getal +BIN2OCT = BIN.N.OCT ## Converteert een binair getal naar een octaal getal +COMPLEX = COMPLEX ## Converteert reële en imaginaire coëfficiënten naar een complex getal +CONVERT = CONVERTEREN ## Converteert een getal in de ene maateenheid naar een getal in een andere maateenheid +DEC2BIN = DEC.N.BIN ## Converteert een decimaal getal naar een binair getal +DEC2HEX = DEC.N.HEX ## Converteert een decimaal getal naar een hexadecimaal getal +DEC2OCT = DEC.N.OCT ## Converteert een decimaal getal naar een octaal getal +DELTA = DELTA ## Test of twee waarden gelijk zijn +ERF = FOUTFUNCTIE ## Geeft als resultaat de foutfunctie +ERFC = FOUT.COMPLEMENT ## Geeft als resultaat de complementaire foutfunctie +GESTEP = GROTER.DAN ## Test of een getal groter is dan de drempelwaarde +HEX2BIN = HEX.N.BIN ## Converteert een hexadecimaal getal naar een binair getal +HEX2DEC = HEX.N.DEC ## Converteert een hexadecimaal getal naar een decimaal getal +HEX2OCT = HEX.N.OCT ## Converteert een hexadecimaal getal naar een octaal getal +IMABS = C.ABS ## Geeft als resultaat de absolute waarde (modulus) van een complex getal +IMAGINARY = C.IM.DEEL ## Geeft als resultaat de imaginaire coëfficiënt van een complex getal +IMARGUMENT = C.ARGUMENT ## Geeft als resultaat het argument thèta, een hoek uitgedrukt in radialen +IMCONJUGATE = C.TOEGEVOEGD ## Geeft als resultaat het complexe toegevoegde getal van een complex getal +IMCOS = C.COS ## Geeft als resultaat de cosinus van een complex getal +IMDIV = C.QUOTIENT ## Geeft als resultaat het quotiënt van twee complexe getallen +IMEXP = C.EXP ## Geeft als resultaat de exponent van een complex getal +IMLN = C.LN ## Geeft als resultaat de natuurlijke logaritme van een complex getal +IMLOG10 = C.LOG10 ## Geeft als resultaat de logaritme met grondtal 10 van een complex getal +IMLOG2 = C.LOG2 ## Geeft als resultaat de logaritme met grondtal 2 van een complex getal +IMPOWER = C.MACHT ## Geeft als resultaat een complex getal dat is verheven tot de macht van een geheel getal +IMPRODUCT = C.PRODUCT ## Geeft als resultaat het product van complexe getallen +IMREAL = C.REEEL.DEEL ## Geeft als resultaat de reële coëfficiënt van een complex getal +IMSIN = C.SIN ## Geeft als resultaat de sinus van een complex getal +IMSQRT = C.WORTEL ## Geeft als resultaat de vierkantswortel van een complex getal +IMSUB = C.VERSCHIL ## Geeft als resultaat het verschil tussen twee complexe getallen +IMSUM = C.SOM ## Geeft als resultaat de som van complexe getallen +OCT2BIN = OCT.N.BIN ## Converteert een octaal getal naar een binair getal +OCT2DEC = OCT.N.DEC ## Converteert een octaal getal naar een decimaal getal +OCT2HEX = OCT.N.HEX ## Converteert een octaal getal naar een hexadecimaal getal + + +## +## Financial functions Financiële functies +## +ACCRINT = SAMENG.RENTE ## Berekent de opgelopen rente voor een waardepapier waarvan de rente periodiek wordt uitgekeerd +ACCRINTM = SAMENG.RENTE.V ## Berekent de opgelopen rente voor een waardepapier waarvan de rente op de vervaldatum wordt uitgekeerd +AMORDEGRC = AMORDEGRC ## Geeft als resultaat de afschrijving voor elke boekingsperiode door een afschrijvingscoëfficiënt toe te passen +AMORLINC = AMORLINC ## Berekent de afschrijving voor elke boekingsperiode +COUPDAYBS = COUP.DAGEN.BB ## Berekent het aantal dagen vanaf het begin van de coupontermijn tot de stortingsdatum +COUPDAYS = COUP.DAGEN ## Geeft als resultaat het aantal dagen in de coupontermijn waarin de stortingsdatum valt +COUPDAYSNC = COUP.DAGEN.VV ## Geeft als resultaat het aantal dagen vanaf de stortingsdatum tot de volgende couponvervaldatum +COUPNCD = COUP.DATUM.NB ## Geeft als resultaat de volgende coupondatum na de stortingsdatum +COUPNUM = COUP.AANTAL ## Geeft als resultaat het aantal coupons dat nog moet worden uitbetaald tussen de stortingsdatum en de vervaldatum +COUPPCD = COUP.DATUM.VB ## Geeft als resultaat de vorige couponvervaldatum vóór de stortingsdatum +CUMIPMT = CUM.RENTE ## Geeft als resultaat de cumulatieve rente die tussen twee termijnen is uitgekeerd +CUMPRINC = CUM.HOOFDSOM ## Geeft als resultaat de cumulatieve hoofdsom van een lening die tussen twee termijnen is terugbetaald +DB = DB ## Geeft als resultaat de afschrijving van activa voor een bepaalde periode met behulp van de 'fixed declining balance'-methode +DDB = DDB ## Geeft als resultaat de afschrijving van activa over een bepaalde termijn met behulp van de 'double declining balance'-methode of een andere methode die u opgeeft +DISC = DISCONTO ## Geeft als resultaat het discontopercentage voor een waardepapier +DOLLARDE = EURO.DE ## Converteert een prijs in euro's, uitgedrukt in een breuk, naar een prijs in euro's, uitgedrukt in een decimaal getal +DOLLARFR = EURO.BR ## Converteert een prijs in euro's, uitgedrukt in een decimaal getal, naar een prijs in euro's, uitgedrukt in een breuk +DURATION = DUUR ## Geeft als resultaat de gewogen gemiddelde looptijd voor een waardepapier met periodieke rentebetalingen +EFFECT = EFFECT.RENTE ## Geeft als resultaat het effectieve jaarlijkse rentepercentage +FV = TW ## Geeft als resultaat de toekomstige waarde van een investering +FVSCHEDULE = TOEK.WAARDE2 ## Geeft als resultaat de toekomstige waarde van een bepaalde hoofdsom na het toepassen van een reeks samengestelde rentepercentages +INTRATE = RENTEPERCENTAGE ## Geeft als resultaat het rentepercentage voor een volgestort waardepapier +IPMT = IBET ## Geeft als resultaat de te betalen rente voor een investering over een bepaalde termijn +IRR = IR ## Geeft als resultaat de interne rentabiliteit voor een reeks cashflows +ISPMT = ISBET ## Geeft als resultaat de rente die is betaald tijdens een bepaalde termijn van een investering +MDURATION = AANG.DUUR ## Geeft als resultaat de aangepaste Macauley-looptijd voor een waardepapier, aangenomen dat de nominale waarde € 100 bedraagt +MIRR = GIR ## Geeft als resultaat de interne rentabiliteit voor een serie cashflows, waarbij voor betalingen een ander rentepercentage geldt dan voor inkomsten +NOMINAL = NOMINALE.RENTE ## Geeft als resultaat het nominale jaarlijkse rentepercentage +NPER = NPER ## Geeft als resultaat het aantal termijnen van een investering +NPV = NHW ## Geeft als resultaat de netto huidige waarde van een investering op basis van een reeks periodieke cashflows en een discontopercentage +ODDFPRICE = AFW.ET.PRIJS ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier met een afwijkende eerste termijn +ODDFYIELD = AFW.ET.REND ## Geeft als resultaat het rendement voor een waardepapier met een afwijkende eerste termijn +ODDLPRICE = AFW.LT.PRIJS ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier met een afwijkende laatste termijn +ODDLYIELD = AFW.LT.REND ## Geeft als resultaat het rendement voor een waardepapier met een afwijkende laatste termijn +PMT = BET ## Geeft als resultaat de periodieke betaling voor een annuïteit +PPMT = PBET ## Geeft als resultaat de afbetaling op de hoofdsom voor een bepaalde termijn +PRICE = PRIJS.NOM ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier waarvan de rente periodiek wordt uitgekeerd +PRICEDISC = PRIJS.DISCONTO ## Geeft als resultaat de prijs per € 100 nominale waarde voor een verdisconteerd waardepapier +PRICEMAT = PRIJS.VERVALDAG ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier waarvan de rente wordt uitgekeerd op de vervaldatum +PV = HW ## Geeft als resultaat de huidige waarde van een investering +RATE = RENTE ## Geeft als resultaat het periodieke rentepercentage voor een annuïteit +RECEIVED = OPBRENGST ## Geeft als resultaat het bedrag dat op de vervaldatum wordt uitgekeerd voor een volgestort waardepapier +SLN = LIN.AFSCHR ## Geeft als resultaat de lineaire afschrijving van activa over één termijn +SYD = SYD ## Geeft als resultaat de afschrijving van activa over een bepaalde termijn met behulp van de 'Sum-Of-Years-Digits'-methode +TBILLEQ = SCHATK.OBL ## Geeft als resultaat het rendement op schatkistpapier, dat op dezelfde manier wordt berekend als het rendement op obligaties +TBILLPRICE = SCHATK.PRIJS ## Bepaalt de prijs per € 100 nominale waarde voor schatkistpapier +TBILLYIELD = SCHATK.REND ## Berekent het rendement voor schatkistpapier +VDB = VDB ## Geeft als resultaat de afschrijving van activa over een gehele of gedeeltelijke termijn met behulp van de 'declining balance'-methode +XIRR = IR.SCHEMA ## Berekent de interne rentabiliteit voor een betalingsschema van cashflows +XNPV = NHW2 ## Berekent de huidige nettowaarde voor een betalingsschema van cashflows +YIELD = RENDEMENT ## Geeft als resultaat het rendement voor een waardepapier waarvan de rente periodiek wordt uitgekeerd +YIELDDISC = REND.DISCONTO ## Geeft als resultaat het jaarlijkse rendement voor een verdisconteerd waardepapier, bijvoorbeeld schatkistpapier +YIELDMAT = REND.VERVAL ## Geeft als resultaat het jaarlijkse rendement voor een waardepapier waarvan de rente wordt uitgekeerd op de vervaldatum + + +## +## Information functions Informatiefuncties +## +CELL = CEL ## Geeft als resultaat informatie over de opmaak, locatie of inhoud van een cel +ERROR.TYPE = TYPE.FOUT ## Geeft als resultaat een getal dat overeenkomt met een van de foutwaarden van Microsoft Excel +INFO = INFO ## Geeft als resultaat informatie over de huidige besturingsomgeving +ISBLANK = ISLEEG ## Geeft als resultaat WAAR als de waarde leeg is +ISERR = ISFOUT2 ## Geeft als resultaat WAAR als de waarde een foutwaarde is, met uitzondering van #N/B +ISERROR = ISFOUT ## Geeft als resultaat WAAR als de waarde een foutwaarde is +ISEVEN = IS.EVEN ## Geeft als resultaat WAAR als het getal even is +ISLOGICAL = ISLOGISCH ## Geeft als resultaat WAAR als de waarde een logische waarde is +ISNA = ISNB ## Geeft als resultaat WAAR als de waarde de foutwaarde #N/B is +ISNONTEXT = ISGEENTEKST ## Geeft als resultaat WAAR als de waarde geen tekst is +ISNUMBER = ISGETAL ## Geeft als resultaat WAAR als de waarde een getal is +ISODD = IS.ONEVEN ## Geeft als resultaat WAAR als het getal oneven is +ISREF = ISVERWIJZING ## Geeft als resultaat WAAR als de waarde een verwijzing is +ISTEXT = ISTEKST ## Geeft als resultaat WAAR als de waarde tekst is +N = N ## Geeft als resultaat een waarde die is geconverteerd naar een getal +NA = NB ## Geeft als resultaat de foutwaarde #N/B +TYPE = TYPE ## Geeft als resultaat een getal dat het gegevenstype van een waarde aangeeft + + +## +## Logical functions Logische functies +## +AND = EN ## Geeft als resultaat WAAR als alle argumenten WAAR zijn +FALSE = ONWAAR ## Geeft als resultaat de logische waarde ONWAAR +IF = ALS ## Geeft een logische test aan +IFERROR = ALS.FOUT ## Retourneert een waarde die u opgeeft als een formule een fout oplevert, anders wordt het resultaat van de formule geretourneerd +NOT = NIET ## Keert de logische waarde van het argument om +OR = OF ## Geeft als resultaat WAAR als minimaal een van de argumenten WAAR is +TRUE = WAAR ## Geeft als resultaat de logische waarde WAAR + + +## +## Lookup and reference functions Zoek- en verwijzingsfuncties +## +ADDRESS = ADRES ## Geeft als resultaat een verwijzing, in de vorm van tekst, naar één bepaalde cel in een werkblad +AREAS = BEREIKEN ## Geeft als resultaat het aantal bereiken in een verwijzing +CHOOSE = KIEZEN ## Kiest een waarde uit een lijst met waarden +COLUMN = KOLOM ## Geeft als resultaat het kolomnummer van een verwijzing +COLUMNS = KOLOMMEN ## Geeft als resultaat het aantal kolommen in een verwijzing +HLOOKUP = HORIZ.ZOEKEN ## Zoekt in de bovenste rij van een matrix naar een bepaalde waarde en geeft als resultaat de gevonden waarde in de opgegeven cel +HYPERLINK = HYPERLINK ## Maakt een snelkoppeling of een sprong waarmee een document wordt geopend dat is opgeslagen op een netwerkserver, een intranet of op internet +INDEX = INDEX ## Kiest met een index een waarde uit een verwijzing of een matrix +INDIRECT = INDIRECT ## Geeft als resultaat een verwijzing die wordt aangegeven met een tekstwaarde +LOOKUP = ZOEKEN ## Zoekt naar bepaalde waarden in een vector of een matrix +MATCH = VERGELIJKEN ## Zoekt naar bepaalde waarden in een verwijzing of een matrix +OFFSET = VERSCHUIVING ## Geeft als resultaat een nieuwe verwijzing die is verschoven ten opzichte van een bepaalde verwijzing +ROW = RIJ ## Geeft als resultaat het rijnummer van een verwijzing +ROWS = RIJEN ## Geeft als resultaat het aantal rijen in een verwijzing +RTD = RTG ## Haalt realtimegegevens op uit een programma dat COM-automatisering (automatisering: een methode waarmee de ene toepassing objecten van een andere toepassing of ontwikkelprogramma kan besturen. Automatisering werd vroeger OLE-automatisering genoemd. Automatisering is een industrienorm die deel uitmaakt van het Component Object Model (COM).) ondersteunt +TRANSPOSE = TRANSPONEREN ## Geeft als resultaat de getransponeerde van een matrix +VLOOKUP = VERT.ZOEKEN ## Zoekt in de meest linkse kolom van een matrix naar een bepaalde waarde en geeft als resultaat de waarde in de opgegeven cel + + +## +## Math and trigonometry functions Wiskundige en trigonometrische functies +## +ABS = ABS ## Geeft als resultaat de absolute waarde van een getal +ACOS = BOOGCOS ## Geeft als resultaat de boogcosinus van een getal +ACOSH = BOOGCOSH ## Geeft als resultaat de inverse cosinus hyperbolicus van een getal +ASIN = BOOGSIN ## Geeft als resultaat de boogsinus van een getal +ASINH = BOOGSINH ## Geeft als resultaat de inverse sinus hyperbolicus van een getal +ATAN = BOOGTAN ## Geeft als resultaat de boogtangens van een getal +ATAN2 = BOOGTAN2 ## Geeft als resultaat de boogtangens van de x- en y-coördinaten +ATANH = BOOGTANH ## Geeft als resultaat de inverse tangens hyperbolicus van een getal +CEILING = AFRONDEN.BOVEN ## Rondt de absolute waarde van een getal naar boven af op het dichtstbijzijnde gehele getal of het dichtstbijzijnde significante veelvoud +COMBIN = COMBINATIES ## Geeft als resultaat het aantal combinaties voor een bepaald aantal objecten +COS = COS ## Geeft als resultaat de cosinus van een getal +COSH = COSH ## Geeft als resultaat de cosinus hyperbolicus van een getal +DEGREES = GRADEN ## Converteert radialen naar graden +EVEN = EVEN ## Rondt het getal af op het dichtstbijzijnde gehele even getal +EXP = EXP ## Verheft e tot de macht van een bepaald getal +FACT = FACULTEIT ## Geeft als resultaat de faculteit van een getal +FACTDOUBLE = DUBBELE.FACULTEIT ## Geeft als resultaat de dubbele faculteit van een getal +FLOOR = AFRONDEN.BENEDEN ## Rondt de absolute waarde van een getal naar beneden af +GCD = GGD ## Geeft als resultaat de grootste gemene deler +INT = INTEGER ## Rondt een getal naar beneden af op het dichtstbijzijnde gehele getal +LCM = KGV ## Geeft als resultaat het kleinste gemene veelvoud +LN = LN ## Geeft als resultaat de natuurlijke logaritme van een getal +LOG = LOG ## Geeft als resultaat de logaritme met het opgegeven grondtal van een getal +LOG10 = LOG10 ## Geeft als resultaat de logaritme met grondtal 10 van een getal +MDETERM = DETERMINANTMAT ## Geeft als resultaat de determinant van een matrix +MINVERSE = INVERSEMAT ## Geeft als resultaat de inverse van een matrix +MMULT = PRODUCTMAT ## Geeft als resultaat het product van twee matrices +MOD = REST ## Geeft als resultaat het restgetal van een deling +MROUND = AFRONDEN.N.VEELVOUD ## Geeft als resultaat een getal afgerond op het gewenste veelvoud +MULTINOMIAL = MULTINOMIAAL ## Geeft als resultaat de multinomiaalcoëfficiënt van een reeks getallen +ODD = ONEVEN ## Rondt de absolute waarde van het getal naar boven af op het dichtstbijzijnde gehele oneven getal +PI = PI ## Geeft als resultaat de waarde van pi +POWER = MACHT ## Verheft een getal tot een macht +PRODUCT = PRODUCT ## Vermenigvuldigt de argumenten met elkaar +QUOTIENT = QUOTIENT ## Geeft als resultaat de uitkomst van een deling als geheel getal +RADIANS = RADIALEN ## Converteert graden naar radialen +RAND = ASELECT ## Geeft als resultaat een willekeurig getal tussen 0 en 1 +RANDBETWEEN = ASELECTTUSSEN ## Geeft een willekeurig getal tussen de getallen die u hebt opgegeven +ROMAN = ROMEINS ## Converteert een Arabisch getal naar een Romeins getal en geeft het resultaat weer in de vorm van tekst +ROUND = AFRONDEN ## Rondt een getal af op het opgegeven aantal decimalen +ROUNDDOWN = AFRONDEN.NAAR.BENEDEN ## Rondt de absolute waarde van een getal naar beneden af +ROUNDUP = AFRONDEN.NAAR.BOVEN ## Rondt de absolute waarde van een getal naar boven af +SERIESSUM = SOM.MACHTREEKS ## Geeft als resultaat de som van een machtreeks die is gebaseerd op de formule +SIGN = POS.NEG ## Geeft als resultaat het teken van een getal +SIN = SIN ## Geeft als resultaat de sinus van de opgegeven hoek +SINH = SINH ## Geeft als resultaat de sinus hyperbolicus van een getal +SQRT = WORTEL ## Geeft als resultaat de positieve vierkantswortel van een getal +SQRTPI = WORTEL.PI ## Geeft als resultaat de vierkantswortel van (getal * pi) +SUBTOTAL = SUBTOTAAL ## Geeft als resultaat een subtotaal voor een bereik +SUM = SOM ## Telt de argumenten op +SUMIF = SOM.ALS ## Telt de getallen bij elkaar op die voldoen aan een bepaald criterium +SUMIFS = SOMMEN.ALS ## Telt de cellen in een bereik op die aan meerdere criteria voldoen +SUMPRODUCT = SOMPRODUCT ## Geeft als resultaat de som van de producten van de corresponderende matrixelementen +SUMSQ = KWADRATENSOM ## Geeft als resultaat de som van de kwadraten van de argumenten +SUMX2MY2 = SOM.X2MINY2 ## Geeft als resultaat de som van het verschil tussen de kwadraten van corresponderende waarden in twee matrices +SUMX2PY2 = SOM.X2PLUSY2 ## Geeft als resultaat de som van de kwadratensom van corresponderende waarden in twee matrices +SUMXMY2 = SOM.XMINY.2 ## Geeft als resultaat de som van de kwadraten van de verschillen tussen de corresponderende waarden in twee matrices +TAN = TAN ## Geeft als resultaat de tangens van een getal +TANH = TANH ## Geeft als resultaat de tangens hyperbolicus van een getal +TRUNC = GEHEEL ## Kapt een getal af tot een geheel getal + + +## +## Statistical functions Statistische functies +## +AVEDEV = GEM.DEVIATIE ## Geeft als resultaat het gemiddelde van de absolute deviaties van gegevenspunten ten opzichte van hun gemiddelde waarde +AVERAGE = GEMIDDELDE ## Geeft als resultaat het gemiddelde van de argumenten +AVERAGEA = GEMIDDELDEA ## Geeft als resultaat het gemiddelde van de argumenten, inclusief getallen, tekst en logische waarden +AVERAGEIF = GEMIDDELDE.ALS ## Geeft het gemiddelde (rekenkundig gemiddelde) als resultaat van alle cellen in een bereik die voldoen aan de opgegeven criteria +AVERAGEIFS = GEMIDDELDEN.ALS ## Geeft het gemiddelde (rekenkundig gemiddelde) als resultaat van alle cellen die aan meerdere criteria voldoen +BETADIST = BETA.VERD ## Geeft als resultaat de cumulatieve bèta-verdelingsfunctie +BETAINV = BETA.INV ## Geeft als resultaat de inverse van de cumulatieve verdelingsfunctie voor een gegeven bèta-verdeling +BINOMDIST = BINOMIALE.VERD ## Geeft als resultaat de binomiale verdeling +CHIDIST = CHI.KWADRAAT ## Geeft als resultaat de eenzijdige kans van de chi-kwadraatverdeling +CHIINV = CHI.KWADRAAT.INV ## Geeft als resultaat de inverse van een eenzijdige kans van de chi-kwadraatverdeling +CHITEST = CHI.TOETS ## Geeft als resultaat de onafhankelijkheidstoets +CONFIDENCE = BETROUWBAARHEID ## Geeft als resultaat het betrouwbaarheidsinterval van een gemiddelde waarde voor de elementen van een populatie +CORREL = CORRELATIE ## Geeft als resultaat de correlatiecoëfficiënt van twee gegevensverzamelingen +COUNT = AANTAL ## Telt het aantal getallen in de argumentenlijst +COUNTA = AANTALARG ## Telt het aantal waarden in de argumentenlijst +COUNTBLANK = AANTAL.LEGE.CELLEN ## Telt het aantal lege cellen in een bereik +COUNTIF = AANTAL.ALS ## Telt in een bereik het aantal cellen die voldoen aan een bepaald criterium +COUNTIFS = AANTALLEN.ALS ## Telt in een bereik het aantal cellen die voldoen aan meerdere criteria +COVAR = COVARIANTIE ## Geeft als resultaat de covariantie, het gemiddelde van de producten van de gepaarde deviaties +CRITBINOM = CRIT.BINOM ## Geeft als resultaat de kleinste waarde waarvoor de binomiale verdeling kleiner is dan of gelijk is aan het criterium +DEVSQ = DEV.KWAD ## Geeft als resultaat de som van de deviaties in het kwadraat +EXPONDIST = EXPON.VERD ## Geeft als resultaat de exponentiële verdeling +FDIST = F.VERDELING ## Geeft als resultaat de F-verdeling +FINV = F.INVERSE ## Geeft als resultaat de inverse van de F-verdeling +FISHER = FISHER ## Geeft als resultaat de Fisher-transformatie +FISHERINV = FISHER.INV ## Geeft als resultaat de inverse van de Fisher-transformatie +FORECAST = VOORSPELLEN ## Geeft als resultaat een waarde op basis van een lineaire trend +FREQUENCY = FREQUENTIE ## Geeft als resultaat een frequentieverdeling in de vorm van een verticale matrix +FTEST = F.TOETS ## Geeft als resultaat een F-toets +GAMMADIST = GAMMA.VERD ## Geeft als resultaat de gamma-verdeling +GAMMAINV = GAMMA.INV ## Geeft als resultaat de inverse van de cumulatieve gamma-verdeling +GAMMALN = GAMMA.LN ## Geeft als resultaat de natuurlijke logaritme van de gamma-functie, G(x) +GEOMEAN = MEETK.GEM ## Geeft als resultaat het meetkundige gemiddelde +GROWTH = GROEI ## Geeft als resultaat de waarden voor een exponentiële trend +HARMEAN = HARM.GEM ## Geeft als resultaat het harmonische gemiddelde +HYPGEOMDIST = HYPERGEO.VERD ## Geeft als resultaat de hypergeometrische verdeling +INTERCEPT = SNIJPUNT ## Geeft als resultaat het snijpunt van de lineaire regressielijn met de y-as +KURT = KURTOSIS ## Geeft als resultaat de kurtosis van een gegevensverzameling +LARGE = GROOTSTE ## Geeft als resultaat de op k-1 na grootste waarde in een gegevensverzameling +LINEST = LIJNSCH ## Geeft als resultaat de parameters van een lineaire trend +LOGEST = LOGSCH ## Geeft als resultaat de parameters van een exponentiële trend +LOGINV = LOG.NORM.INV ## Geeft als resultaat de inverse van de logaritmische normale verdeling +LOGNORMDIST = LOG.NORM.VERD ## Geeft als resultaat de cumulatieve logaritmische normale verdeling +MAX = MAX ## Geeft als resultaat de maximumwaarde in een lijst met argumenten +MAXA = MAXA ## Geeft als resultaat de maximumwaarde in een lijst met argumenten, inclusief getallen, tekst en logische waarden +MEDIAN = MEDIAAN ## Geeft als resultaat de mediaan van de opgegeven getallen +MIN = MIN ## Geeft als resultaat de minimumwaarde in een lijst met argumenten +MINA = MINA ## Geeft als resultaat de minimumwaarde in een lijst met argumenten, inclusief getallen, tekst en logische waarden +MODE = MODUS ## Geeft als resultaat de meest voorkomende waarde in een gegevensverzameling +NEGBINOMDIST = NEG.BINOM.VERD ## Geeft als resultaat de negatieve binomiaalverdeling +NORMDIST = NORM.VERD ## Geeft als resultaat de cumulatieve normale verdeling +NORMINV = NORM.INV ## Geeft als resultaat de inverse van de cumulatieve standaardnormale verdeling +NORMSDIST = STAND.NORM.VERD ## Geeft als resultaat de cumulatieve standaardnormale verdeling +NORMSINV = STAND.NORM.INV ## Geeft als resultaat de inverse van de cumulatieve normale verdeling +PEARSON = PEARSON ## Geeft als resultaat de correlatiecoëfficiënt van Pearson +PERCENTILE = PERCENTIEL ## Geeft als resultaat het k-de percentiel van waarden in een bereik +PERCENTRANK = PERCENT.RANG ## Geeft als resultaat de positie, in procenten uitgedrukt, van een waarde in de rangorde van een gegevensverzameling +PERMUT = PERMUTATIES ## Geeft als resultaat het aantal permutaties voor een gegeven aantal objecten +POISSON = POISSON ## Geeft als resultaat de Poisson-verdeling +PROB = KANS ## Geeft als resultaat de kans dat waarden zich tussen twee grenzen bevinden +QUARTILE = KWARTIEL ## Geeft als resultaat het kwartiel van een gegevensverzameling +RANK = RANG ## Geeft als resultaat het rangnummer van een getal in een lijst getallen +RSQ = R.KWADRAAT ## Geeft als resultaat het kwadraat van de Pearson-correlatiecoëfficiënt +SKEW = SCHEEFHEID ## Geeft als resultaat de mate van asymmetrie van een verdeling +SLOPE = RICHTING ## Geeft als resultaat de richtingscoëfficiënt van een lineaire regressielijn +SMALL = KLEINSTE ## Geeft als resultaat de op k-1 na kleinste waarde in een gegevensverzameling +STANDARDIZE = NORMALISEREN ## Geeft als resultaat een genormaliseerde waarde +STDEV = STDEV ## Maakt een schatting van de standaarddeviatie op basis van een steekproef +STDEVA = STDEVA ## Maakt een schatting van de standaarddeviatie op basis van een steekproef, inclusief getallen, tekst en logische waarden +STDEVP = STDEVP ## Berekent de standaarddeviatie op basis van de volledige populatie +STDEVPA = STDEVPA ## Berekent de standaarddeviatie op basis van de volledige populatie, inclusief getallen, tekst en logische waarden +STEYX = STAND.FOUT.YX ## Geeft als resultaat de standaardfout in de voorspelde y-waarde voor elke x in een regressie +TDIST = T.VERD ## Geeft als resultaat de Student T-verdeling +TINV = T.INV ## Geeft als resultaat de inverse van de Student T-verdeling +TREND = TREND ## Geeft als resultaat de waarden voor een lineaire trend +TRIMMEAN = GETRIMD.GEM ## Geeft als resultaat het gemiddelde van waarden in een gegevensverzameling +TTEST = T.TOETS ## Geeft als resultaat de kans met behulp van de Student T-toets +VAR = VAR ## Maakt een schatting van de variantie op basis van een steekproef +VARA = VARA ## Maakt een schatting van de variantie op basis van een steekproef, inclusief getallen, tekst en logische waarden +VARP = VARP ## Berekent de variantie op basis van de volledige populatie +VARPA = VARPA ## Berekent de standaarddeviatie op basis van de volledige populatie, inclusief getallen, tekst en logische waarden +WEIBULL = WEIBULL ## Geeft als resultaat de Weibull-verdeling +ZTEST = Z.TOETS ## Geeft als resultaat de eenzijdige kanswaarde van een Z-toets + + +## +## Text functions Tekstfuncties +## +ASC = ASC ## Wijzigt Nederlandse letters of katakanatekens over de volle breedte (dubbel-bytetekens) binnen een tekenreeks in tekens over de halve breedte (enkel-bytetekens) +BAHTTEXT = BAHT.TEKST ## Converteert een getal naar tekst met de valutanotatie ß (baht) +CHAR = TEKEN ## Geeft als resultaat het teken dat hoort bij de opgegeven code +CLEAN = WISSEN.CONTROL ## Verwijdert alle niet-afdrukbare tekens uit een tekst +CODE = CODE ## Geeft als resultaat de numerieke code voor het eerste teken in een tekenreeks +CONCATENATE = TEKST.SAMENVOEGEN ## Voegt verschillende tekstfragmenten samen tot één tekstfragment +DOLLAR = EURO ## Converteert een getal naar tekst met de valutanotatie € (euro) +EXACT = GELIJK ## Controleert of twee tekenreeksen identiek zijn +FIND = VIND.ALLES ## Zoekt een bepaalde tekenreeks in een tekst (waarbij onderscheid wordt gemaakt tussen hoofdletters en kleine letters) +FINDB = VIND.ALLES.B ## Zoekt een bepaalde tekenreeks in een tekst (waarbij onderscheid wordt gemaakt tussen hoofdletters en kleine letters) +FIXED = VAST ## Maakt een getal als tekst met een vast aantal decimalen op +JIS = JIS ## Wijzigt Nederlandse letters of katakanatekens over de halve breedte (enkel-bytetekens) binnen een tekenreeks in tekens over de volle breedte (dubbel-bytetekens) +LEFT = LINKS ## Geeft als resultaat de meest linkse tekens in een tekenreeks +LEFTB = LINKSB ## Geeft als resultaat de meest linkse tekens in een tekenreeks +LEN = LENGTE ## Geeft als resultaat het aantal tekens in een tekenreeks +LENB = LENGTEB ## Geeft als resultaat het aantal tekens in een tekenreeks +LOWER = KLEINE.LETTERS ## Zet tekst om in kleine letters +MID = MIDDEN ## Geeft als resultaat een bepaald aantal tekens van een tekenreeks vanaf de positie die u opgeeft +MIDB = DEELB ## Geeft als resultaat een bepaald aantal tekens van een tekenreeks vanaf de positie die u opgeeft +PHONETIC = FONETISCH ## Haalt de fonetische tekens (furigana) uit een tekenreeks op +PROPER = BEGINLETTERS ## Zet de eerste letter van elk woord in een tekst om in een hoofdletter +REPLACE = VERVANG ## Vervangt tekens binnen een tekst +REPLACEB = VERVANGENB ## Vervangt tekens binnen een tekst +REPT = HERHALING ## Herhaalt een tekst een aantal malen +RIGHT = RECHTS ## Geeft als resultaat de meest rechtse tekens in een tekenreeks +RIGHTB = RECHTSB ## Geeft als resultaat de meest rechtse tekens in een tekenreeks +SEARCH = VIND.SPEC ## Zoekt een bepaalde tekenreeks in een tekst (waarbij geen onderscheid wordt gemaakt tussen hoofdletters en kleine letters) +SEARCHB = VIND.SPEC.B ## Zoekt een bepaalde tekenreeks in een tekst (waarbij geen onderscheid wordt gemaakt tussen hoofdletters en kleine letters) +SUBSTITUTE = SUBSTITUEREN ## Vervangt oude tekst door nieuwe tekst in een tekenreeks +T = T ## Converteert de argumenten naar tekst +TEXT = TEKST ## Maakt een getal op en converteert het getal naar tekst +TRIM = SPATIES.WISSEN ## Verwijdert de spaties uit een tekst +UPPER = HOOFDLETTERS ## Zet tekst om in hoofdletters +VALUE = WAARDE ## Converteert tekst naar een getal diff --git a/extend/PHPExcel/PHPExcel/locale/no/config b/extend/PHPExcel/PHPExcel/locale/no/config new file mode 100644 index 0000000..bf2d34a --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/no/config @@ -0,0 +1,47 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = kr + + +## +## Excel Error Codes (For future use) +## +NULL = #NULL! +DIV0 = #DIV/0! +VALUE = #VERDI! +REF = #REF! +NAME = #NAVN? +NUM = #NUM! +NA = #I/T diff --git a/extend/PHPExcel/PHPExcel/locale/no/functions b/extend/PHPExcel/PHPExcel/locale/no/functions new file mode 100644 index 0000000..10d0a20 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/no/functions @@ -0,0 +1,438 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Calculation +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ +## +## + + +## +## Add-in and Automation functions Funksjonene Tillegg og Automatisering +## +GETPIVOTDATA = HENTPIVOTDATA ## Returnerer data som er lagret i en pivottabellrapport + + +## +## Cube functions Kubefunksjoner +## +CUBEKPIMEMBER = KUBEKPIMEDLEM ## Returnerer navnet, egenskapen og målet for en viktig ytelsesindikator (KPI), og viser navnet og egenskapen i cellen. En KPI er en målbar enhet, for eksempel månedlig bruttoinntjening eller kvartalsvis inntjening per ansatt, og brukes til å overvåke ytelsen i en organisasjon. +CUBEMEMBER = KUBEMEDLEM ## Returnerer et medlem eller en tuppel i et kubehierarki. Brukes til å validere at medlemmet eller tuppelen finnes i kuben. +CUBEMEMBERPROPERTY = KUBEMEDLEMEGENSKAP ## Returnerer verdien til en medlemsegenskap i kuben. Brukes til å validere at et medlemsnavn finnes i kuben, og til å returnere den angitte egenskapen for dette medlemmet. +CUBERANKEDMEMBER = KUBERANGERTMEDLEM ## Returnerer det n-te, eller rangerte, medlemmet i et sett. Brukes til å returnere ett eller flere elementer i et sett, for eksempel de 10 beste studentene. +CUBESET = KUBESETT ## Definerer et beregnet sett av medlemmer eller tuppeler ved å sende et settuttrykk til kuben på serveren, noe som oppretter settet og deretter returnerer dette settet til Microsoft Office Excel. +CUBESETCOUNT = KUBESETTANTALL ## Returnerer antallet elementer i et sett. +CUBEVALUE = KUBEVERDI ## Returnerer en aggregert verdi fra en kube. + + +## +## Database functions Databasefunksjoner +## +DAVERAGE = DGJENNOMSNITT ## Returnerer gjennomsnittet av merkede databaseposter +DCOUNT = DANTALL ## Teller celler som inneholder tall i en database +DCOUNTA = DANTALLA ## Teller celler som ikke er tomme i en database +DGET = DHENT ## Trekker ut fra en database en post som oppfyller angitte vilkår +DMAX = DMAKS ## Returnerer maksimumsverdien fra merkede databaseposter +DMIN = DMIN ## Returnerer minimumsverdien fra merkede databaseposter +DPRODUCT = DPRODUKT ## Multipliserer verdiene i et bestemt felt med poster som oppfyller vilkårene i en database +DSTDEV = DSTDAV ## Estimerer standardavviket basert på et utvalg av merkede databaseposter +DSTDEVP = DSTAVP ## Beregner standardavviket basert på at merkede databaseposter utgjør hele populasjonen +DSUM = DSUMMER ## Legger til tallene i feltkolonnen med poster, i databasen som oppfyller vilkårene +DVAR = DVARIANS ## Estimerer variansen basert på et utvalg av merkede databaseposter +DVARP = DVARIANSP ## Beregner variansen basert på at merkede databaseposter utgjør hele populasjonen + + +## +## Date and time functions Dato- og tidsfunksjoner +## +DATE = DATO ## Returnerer serienummeret som svarer til en bestemt dato +DATEVALUE = DATOVERDI ## Konverterer en dato med tekstformat til et serienummer +DAY = DAG ## Konverterer et serienummer til en dag i måneden +DAYS360 = DAGER360 ## Beregner antall dager mellom to datoer basert på et år med 360 dager +EDATE = DAG.ETTER ## Returnerer serienummeret som svarer til datoen som er det indikerte antall måneder før eller etter startdatoen +EOMONTH = MÅNEDSSLUTT ## Returnerer serienummeret som svarer til siste dag i måneden, før eller etter et angitt antall måneder +HOUR = TIME ## Konverterer et serienummer til en time +MINUTE = MINUTT ## Konverterer et serienummer til et minutt +MONTH = MÅNED ## Konverterer et serienummer til en måned +NETWORKDAYS = NETT.ARBEIDSDAGER ## Returnerer antall hele arbeidsdager mellom to datoer +NOW = NÅ ## Returnerer serienummeret som svarer til gjeldende dato og klokkeslett +SECOND = SEKUND ## Konverterer et serienummer til et sekund +TIME = TID ## Returnerer serienummeret som svarer til et bestemt klokkeslett +TIMEVALUE = TIDSVERDI ## Konverterer et klokkeslett i tekstformat til et serienummer +TODAY = IDAG ## Returnerer serienummeret som svarer til dagens dato +WEEKDAY = UKEDAG ## Konverterer et serienummer til en ukedag +WEEKNUM = UKENR ## Konverterer et serienummer til et tall som representerer hvilket nummer uken har i et år +WORKDAY = ARBEIDSDAG ## Returnerer serienummeret som svarer til datoen før eller etter et angitt antall arbeidsdager +YEAR = ÅR ## Konverterer et serienummer til et år +YEARFRAC = ÅRDEL ## Returnerer brøkdelen for året, som svarer til antall hele dager mellom startdato og sluttdato + + +## +## Engineering functions Tekniske funksjoner +## +BESSELI = BESSELI ## Returnerer den endrede Bessel-funksjonen In(x) +BESSELJ = BESSELJ ## Returnerer Bessel-funksjonen Jn(x) +BESSELK = BESSELK ## Returnerer den endrede Bessel-funksjonen Kn(x) +BESSELY = BESSELY ## Returnerer Bessel-funksjonen Yn(x) +BIN2DEC = BINTILDES ## Konverterer et binært tall til et desimaltall +BIN2HEX = BINTILHEKS ## Konverterer et binært tall til et heksadesimaltall +BIN2OCT = BINTILOKT ## Konverterer et binært tall til et oktaltall +COMPLEX = KOMPLEKS ## Konverterer reelle og imaginære koeffisienter til et komplekst tall +CONVERT = KONVERTER ## Konverterer et tall fra ett målsystem til et annet +DEC2BIN = DESTILBIN ## Konverterer et desimaltall til et binærtall +DEC2HEX = DESTILHEKS ## Konverterer et heltall i 10-tallsystemet til et heksadesimalt tall +DEC2OCT = DESTILOKT ## Konverterer et heltall i 10-tallsystemet til et oktaltall +DELTA = DELTA ## Undersøker om to verdier er like +ERF = FEILF ## Returnerer feilfunksjonen +ERFC = FEILFK ## Returnerer den komplementære feilfunksjonen +GESTEP = GRENSEVERDI ## Tester om et tall er større enn en terskelverdi +HEX2BIN = HEKSTILBIN ## Konverterer et heksadesimaltall til et binært tall +HEX2DEC = HEKSTILDES ## Konverterer et heksadesimalt tall til et heltall i 10-tallsystemet +HEX2OCT = HEKSTILOKT ## Konverterer et heksadesimalt tall til et oktaltall +IMABS = IMABS ## Returnerer absoluttverdien (koeffisienten) til et komplekst tall +IMAGINARY = IMAGINÆR ## Returnerer den imaginære koeffisienten til et komplekst tall +IMARGUMENT = IMARGUMENT ## Returnerer argumentet theta, som er en vinkel uttrykt i radianer +IMCONJUGATE = IMKONJUGERT ## Returnerer den komplekse konjugaten til et komplekst tall +IMCOS = IMCOS ## Returnerer cosinus til et komplekst tall +IMDIV = IMDIV ## Returnerer kvotienten til to komplekse tall +IMEXP = IMEKSP ## Returnerer eksponenten til et komplekst tall +IMLN = IMLN ## Returnerer den naturlige logaritmen for et komplekst tall +IMLOG10 = IMLOG10 ## Returnerer logaritmen med grunntall 10 for et komplekst tall +IMLOG2 = IMLOG2 ## Returnerer logaritmen med grunntall 2 for et komplekst tall +IMPOWER = IMOPPHØY ## Returnerer et komplekst tall opphøyd til en heltallspotens +IMPRODUCT = IMPRODUKT ## Returnerer produktet av komplekse tall +IMREAL = IMREELL ## Returnerer den reelle koeffisienten til et komplekst tall +IMSIN = IMSIN ## Returnerer sinus til et komplekst tall +IMSQRT = IMROT ## Returnerer kvadratroten av et komplekst tall +IMSUB = IMSUB ## Returnerer differansen mellom to komplekse tall +IMSUM = IMSUMMER ## Returnerer summen av komplekse tall +OCT2BIN = OKTTILBIN ## Konverterer et oktaltall til et binært tall +OCT2DEC = OKTTILDES ## Konverterer et oktaltall til et desimaltall +OCT2HEX = OKTTILHEKS ## Konverterer et oktaltall til et heksadesimaltall + + +## +## Financial functions Økonomiske funksjoner +## +ACCRINT = PÅLØPT.PERIODISK.RENTE ## Returnerer påløpte renter for et verdipapir som betaler periodisk rente +ACCRINTM = PÅLØPT.FORFALLSRENTE ## Returnerer den påløpte renten for et verdipapir som betaler rente ved forfall +AMORDEGRC = AMORDEGRC ## Returnerer avskrivningen for hver regnskapsperiode ved hjelp av en avskrivingskoeffisient +AMORLINC = AMORLINC ## Returnerer avskrivingen for hver regnskapsperiode +COUPDAYBS = OBLIG.DAGER.FF ## Returnerer antall dager fra begynnelsen av den rentebærende perioden til innløsningsdatoen +COUPDAYS = OBLIG.DAGER ## Returnerer antall dager i den rentebærende perioden som inneholder innløsningsdatoen +COUPDAYSNC = OBLIG.DAGER.NF ## Returnerer antall dager fra betalingsdato til neste renteinnbetalingsdato +COUPNCD = OBLIG.DAGER.EF ## Returnerer obligasjonsdatoen som kommer etter oppgjørsdatoen +COUPNUM = OBLIG.ANTALL ## Returnerer antall obligasjoner som skal betales mellom oppgjørsdatoen og forfallsdatoen +COUPPCD = OBLIG.DAG.FORRIGE ## Returnerer obligasjonsdatoen som kommer før oppgjørsdatoen +CUMIPMT = SAMLET.RENTE ## Returnerer den kumulative renten som er betalt mellom to perioder +CUMPRINC = SAMLET.HOVEDSTOL ## Returnerer den kumulative hovedstolen som er betalt for et lån mellom to perioder +DB = DAVSKR ## Returnerer avskrivningen for et aktivum i en angitt periode, foretatt med fast degressiv avskrivning +DDB = DEGRAVS ## Returnerer avskrivningen for et aktivum for en gitt periode, ved hjelp av dobbel degressiv avskrivning eller en metode som du selv angir +DISC = DISKONTERT ## Returnerer diskonteringsraten for et verdipapir +DOLLARDE = DOLLARDE ## Konverterer en valutapris uttrykt som en brøk, til en valutapris uttrykt som et desimaltall +DOLLARFR = DOLLARBR ## Konverterer en valutapris uttrykt som et desimaltall, til en valutapris uttrykt som en brøk +DURATION = VARIGHET ## Returnerer årlig varighet for et verdipapir med renter som betales periodisk +EFFECT = EFFEKTIV.RENTE ## Returnerer den effektive årlige rentesatsen +FV = SLUTTVERDI ## Returnerer fremtidig verdi for en investering +FVSCHEDULE = SVPLAN ## Returnerer den fremtidige verdien av en inngående hovedstol etter å ha anvendt en serie med sammensatte rentesatser +INTRATE = RENTESATS ## Returnerer rentefoten av et fullfinansiert verdipapir +IPMT = RAVDRAG ## Returnerer betalte renter på en investering for en gitt periode +IRR = IR ## Returnerer internrenten for en serie kontantstrømmer +ISPMT = ER.AVDRAG ## Beregner renten som er betalt for en investering i løpet av en bestemt periode +MDURATION = MVARIGHET ## Returnerer Macauleys modifiserte varighet for et verdipapir med en antatt pålydende verdi på kr 100,00 +MIRR = MODIR ## Returnerer internrenten der positive og negative kontantstrømmer finansieres med forskjellige satser +NOMINAL = NOMINELL ## Returnerer årlig nominell rentesats +NPER = PERIODER ## Returnerer antall perioder for en investering +NPV = NNV ## Returnerer netto nåverdi for en investering, basert på en serie periodiske kontantstrømmer og en rentesats +ODDFPRICE = AVVIKFP.PRIS ## Returnerer pris pålydende kr 100 for et verdipapir med en odde første periode +ODDFYIELD = AVVIKFP.AVKASTNING ## Returnerer avkastingen for et verdipapir med en odde første periode +ODDLPRICE = AVVIKSP.PRIS ## Returnerer pris pålydende kr 100 for et verdipapir med en odde siste periode +ODDLYIELD = AVVIKSP.AVKASTNING ## Returnerer avkastingen for et verdipapir med en odde siste periode +PMT = AVDRAG ## Returnerer periodisk betaling for en annuitet +PPMT = AMORT ## Returnerer betalingen på hovedstolen for en investering i en gitt periode +PRICE = PRIS ## Returnerer prisen per pålydende kr 100 for et verdipapir som gir periodisk avkastning +PRICEDISC = PRIS.DISKONTERT ## Returnerer prisen per pålydende kr 100 for et diskontert verdipapir +PRICEMAT = PRIS.FORFALL ## Returnerer prisen per pålydende kr 100 av et verdipapir som betaler rente ved forfall +PV = NÅVERDI ## Returnerer nåverdien av en investering +RATE = RENTE ## Returnerer rentesatsen per periode for en annuitet +RECEIVED = MOTTATT.AVKAST ## Returnerer summen som mottas ved forfallsdato for et fullinvestert verdipapir +SLN = LINAVS ## Returnerer den lineære avskrivningen for et aktivum i én periode +SYD = ÅRSAVS ## Returnerer årsavskrivningen for et aktivum i en angitt periode +TBILLEQ = TBILLEKV ## Returnerer den obligasjonsekvivalente avkastningen for en statsobligasjon +TBILLPRICE = TBILLPRIS ## Returnerer prisen per pålydende kr 100 for en statsobligasjon +TBILLYIELD = TBILLAVKASTNING ## Returnerer avkastningen til en statsobligasjon +VDB = VERDIAVS ## Returnerer avskrivningen for et aktivum i en angitt periode eller delperiode, ved hjelp av degressiv avskrivning +XIRR = XIR ## Returnerer internrenten for en serie kontantstrømmer som ikke nødvendigvis er periodiske +XNPV = XNNV ## Returnerer netto nåverdi for en serie kontantstrømmer som ikke nødvendigvis er periodiske +YIELD = AVKAST ## Returnerer avkastningen på et verdipapir som betaler periodisk rente +YIELDDISC = AVKAST.DISKONTERT ## Returnerer årlig avkastning for et diskontert verdipapir, for eksempel en statskasseveksel +YIELDMAT = AVKAST.FORFALL ## Returnerer den årlige avkastningen for et verdipapir som betaler rente ved forfallsdato + + +## +## Information functions Informasjonsfunksjoner +## +CELL = CELLE ## Returnerer informasjon om formatering, plassering eller innholdet til en celle +ERROR.TYPE = FEIL.TYPE ## Returnerer et tall som svarer til en feiltype +INFO = INFO ## Returnerer informasjon om gjeldende operativmiljø +ISBLANK = ERTOM ## Returnerer SANN hvis verdien er tom +ISERR = ERFEIL ## Returnerer SANN hvis verdien er en hvilken som helst annen feilverdi enn #I/T +ISERROR = ERFEIL ## Returnerer SANN hvis verdien er en hvilken som helst feilverdi +ISEVEN = ERPARTALL ## Returnerer SANN hvis tallet er et partall +ISLOGICAL = ERLOGISK ## Returnerer SANN hvis verdien er en logisk verdi +ISNA = ERIT ## Returnerer SANN hvis verdien er feilverdien #I/T +ISNONTEXT = ERIKKETEKST ## Returnerer SANN hvis verdien ikke er tekst +ISNUMBER = ERTALL ## Returnerer SANN hvis verdien er et tall +ISODD = ERODDETALL ## Returnerer SANN hvis tallet er et oddetall +ISREF = ERREF ## Returnerer SANN hvis verdien er en referanse +ISTEXT = ERTEKST ## Returnerer SANN hvis verdien er tekst +N = N ## Returnerer en verdi som er konvertert til et tall +NA = IT ## Returnerer feilverdien #I/T +TYPE = VERDITYPE ## Returnerer et tall som indikerer datatypen til en verdi + + +## +## Logical functions Logiske funksjoner +## +AND = OG ## Returnerer SANN hvis alle argumentene er lik SANN +FALSE = USANN ## Returnerer den logiske verdien USANN +IF = HVIS ## Angir en logisk test som skal utføres +IFERROR = HVISFEIL ## Returnerer en verdi du angir hvis en formel evaluerer til en feil. Ellers returnerer den resultatet av formelen. +NOT = IKKE ## Reverserer logikken til argumentet +OR = ELLER ## Returnerer SANN hvis ett eller flere argumenter er lik SANN +TRUE = SANN ## Returnerer den logiske verdien SANN + + +## +## Lookup and reference functions Oppslag- og referansefunksjoner +## +ADDRESS = ADRESSE ## Returnerer en referanse som tekst til en enkelt celle i et regneark +AREAS = OMRÅDER ## Returnerer antall områder i en referanse +CHOOSE = VELG ## Velger en verdi fra en liste med verdier +COLUMN = KOLONNE ## Returnerer kolonnenummeret for en referanse +COLUMNS = KOLONNER ## Returnerer antall kolonner i en referanse +HLOOKUP = FINN.KOLONNE ## Leter i den øverste raden i en matrise og returnerer verdien for den angitte cellen +HYPERLINK = HYPERKOBLING ## Oppretter en snarvei eller et hopp som åpner et dokument som er lagret på en nettverksserver, et intranett eller Internett +INDEX = INDEKS ## Bruker en indeks til å velge en verdi fra en referanse eller matrise +INDIRECT = INDIREKTE ## Returnerer en referanse angitt av en tekstverdi +LOOKUP = SLÅ.OPP ## Slår opp verdier i en vektor eller matrise +MATCH = SAMMENLIGNE ## Slår opp verdier i en referanse eller matrise +OFFSET = FORSKYVNING ## Returnerer en referanseforskyvning fra en gitt referanse +ROW = RAD ## Returnerer radnummeret for en referanse +ROWS = RADER ## Returnerer antall rader i en referanse +RTD = RTD ## Henter sanntidsdata fra et program som støtter COM-automatisering (automatisering: En måte å arbeide på med programobjekter fra et annet program- eller utviklingsverktøy. Tidligere kalt OLE-automatisering. Automatisering er en bransjestandard og en funksjon i Component Object Model (COM).) +TRANSPOSE = TRANSPONER ## Returnerer transponeringen av en matrise +VLOOKUP = FINN.RAD ## Leter i den første kolonnen i en matrise og flytter bortover raden for å returnere verdien til en celle + + +## +## Math and trigonometry functions Matematikk- og trigonometrifunksjoner +## +ABS = ABS ## Returnerer absoluttverdien til et tall +ACOS = ARCCOS ## Returnerer arcus cosinus til et tall +ACOSH = ARCCOSH ## Returnerer den inverse hyperbolske cosinus til et tall +ASIN = ARCSIN ## Returnerer arcus sinus til et tall +ASINH = ARCSINH ## Returnerer den inverse hyperbolske sinus til et tall +ATAN = ARCTAN ## Returnerer arcus tangens til et tall +ATAN2 = ARCTAN2 ## Returnerer arcus tangens fra x- og y-koordinater +ATANH = ARCTANH ## Returnerer den inverse hyperbolske tangens til et tall +CEILING = AVRUND.GJELDENDE.MULTIPLUM ## Runder av et tall til nærmeste heltall eller til nærmeste signifikante multiplum +COMBIN = KOMBINASJON ## Returnerer antall kombinasjoner for ett gitt antall objekter +COS = COS ## Returnerer cosinus til et tall +COSH = COSH ## Returnerer den hyperbolske cosinus til et tall +DEGREES = GRADER ## Konverterer radianer til grader +EVEN = AVRUND.TIL.PARTALL ## Runder av et tall oppover til nærmeste heltall som er et partall +EXP = EKSP ## Returnerer e opphøyd i en angitt potens +FACT = FAKULTET ## Returnerer fakultet til et tall +FACTDOUBLE = DOBBELFAKT ## Returnerer et talls doble fakultet +FLOOR = AVRUND.GJELDENDE.MULTIPLUM.NED ## Avrunder et tall nedover, mot null +GCD = SFF ## Returnerer høyeste felles divisor +INT = HELTALL ## Avrunder et tall nedover til nærmeste heltall +LCM = MFM ## Returnerer minste felles multiplum +LN = LN ## Returnerer den naturlige logaritmen til et tall +LOG = LOG ## Returnerer logaritmen for et tall til et angitt grunntall +LOG10 = LOG10 ## Returnerer logaritmen med grunntall 10 for et tall +MDETERM = MDETERM ## Returnerer matrisedeterminanten til en matrise +MINVERSE = MINVERS ## Returnerer den inverse matrisen til en matrise +MMULT = MMULT ## Returnerer matriseproduktet av to matriser +MOD = REST ## Returnerer resten fra en divisjon +MROUND = MRUND ## Returnerer et tall avrundet til det ønskede multiplum +MULTINOMIAL = MULTINOMINELL ## Returnerer det multinominelle for et sett med tall +ODD = AVRUND.TIL.ODDETALL ## Runder av et tall oppover til nærmeste heltall som er et oddetall +PI = PI ## Returnerer verdien av pi +POWER = OPPHØYD.I ## Returnerer resultatet av et tall opphøyd i en potens +PRODUCT = PRODUKT ## Multipliserer argumentene +QUOTIENT = KVOTIENT ## Returnerer heltallsdelen av en divisjon +RADIANS = RADIANER ## Konverterer grader til radianer +RAND = TILFELDIG ## Returnerer et tilfeldig tall mellom 0 og 1 +RANDBETWEEN = TILFELDIGMELLOM ## Returnerer et tilfeldig tall innenfor et angitt område +ROMAN = ROMERTALL ## Konverterer vanlige tall til romertall, som tekst +ROUND = AVRUND ## Avrunder et tall til et angitt antall sifre +ROUNDDOWN = AVRUND.NED ## Avrunder et tall nedover, mot null +ROUNDUP = AVRUND.OPP ## Runder av et tall oppover, bort fra null +SERIESSUM = SUMMER.REKKE ## Returnerer summen av en geometrisk rekke, basert på formelen +SIGN = FORTEGN ## Returnerer fortegnet for et tall +SIN = SIN ## Returnerer sinus til en gitt vinkel +SINH = SINH ## Returnerer den hyperbolske sinus til et tall +SQRT = ROT ## Returnerer en positiv kvadratrot +SQRTPI = ROTPI ## Returnerer kvadratroten av (tall * pi) +SUBTOTAL = DELSUM ## Returnerer en delsum i en liste eller database +SUM = SUMMER ## Legger sammen argumentene +SUMIF = SUMMERHVIS ## Legger sammen cellene angitt ved et gitt vilkår +SUMIFS = SUMMER.HVIS.SETT ## Legger sammen cellene i et område som oppfyller flere vilkår +SUMPRODUCT = SUMMERPRODUKT ## Returnerer summen av produktene av tilsvarende matrisekomponenter +SUMSQ = SUMMERKVADRAT ## Returnerer kvadratsummen av argumentene +SUMX2MY2 = SUMMERX2MY2 ## Returnerer summen av differansen av kvadratene for tilsvarende verdier i to matriser +SUMX2PY2 = SUMMERX2PY2 ## Returnerer summen av kvadratsummene for tilsvarende verdier i to matriser +SUMXMY2 = SUMMERXMY2 ## Returnerer summen av kvadratene av differansen for tilsvarende verdier i to matriser +TAN = TAN ## Returnerer tangens for et tall +TANH = TANH ## Returnerer den hyperbolske tangens for et tall +TRUNC = AVKORT ## Korter av et tall til et heltall + + +## +## Statistical functions Statistiske funksjoner +## +AVEDEV = GJENNOMSNITTSAVVIK ## Returnerer datapunktenes gjennomsnittlige absoluttavvik fra middelverdien +AVERAGE = GJENNOMSNITT ## Returnerer gjennomsnittet for argumentene +AVERAGEA = GJENNOMSNITTA ## Returnerer gjennomsnittet for argumentene, inkludert tall, tekst og logiske verdier +AVERAGEIF = GJENNOMSNITTHVIS ## Returnerer gjennomsnittet (aritmetisk gjennomsnitt) av alle cellene i et område som oppfyller et bestemt vilkår +AVERAGEIFS = GJENNOMSNITT.HVIS.SETT ## Returnerer gjennomsnittet (aritmetisk middelverdi) av alle celler som oppfyller flere vilkår. +BETADIST = BETA.FORDELING ## Returnerer den kumulative betafordelingsfunksjonen +BETAINV = INVERS.BETA.FORDELING ## Returnerer den inverse verdien til fordelingsfunksjonen for en angitt betafordeling +BINOMDIST = BINOM.FORDELING ## Returnerer den individuelle binomiske sannsynlighetsfordelingen +CHIDIST = KJI.FORDELING ## Returnerer den ensidige sannsynligheten for en kjikvadrert fordeling +CHIINV = INVERS.KJI.FORDELING ## Returnerer den inverse av den ensidige sannsynligheten for den kjikvadrerte fordelingen +CHITEST = KJI.TEST ## Utfører testen for uavhengighet +CONFIDENCE = KONFIDENS ## Returnerer konfidensintervallet til gjennomsnittet for en populasjon +CORREL = KORRELASJON ## Returnerer korrelasjonskoeffisienten mellom to datasett +COUNT = ANTALL ## Teller hvor mange tall som er i argumentlisten +COUNTA = ANTALLA ## Teller hvor mange verdier som er i argumentlisten +COUNTBLANK = TELLBLANKE ## Teller antall tomme celler i et område. +COUNTIF = ANTALL.HVIS ## Teller antall celler i et område som oppfyller gitte vilkår +COUNTIFS = ANTALL.HVIS.SETT ## Teller antallet ikke-tomme celler i et område som oppfyller flere vilkår +COVAR = KOVARIANS ## Returnerer kovariansen, gjennomsnittet av produktene av parvise avvik +CRITBINOM = GRENSE.BINOM ## Returnerer den minste verdien der den kumulative binomiske fordelingen er mindre enn eller lik en vilkårsverdi +DEVSQ = AVVIK.KVADRERT ## Returnerer summen av kvadrerte avvik +EXPONDIST = EKSP.FORDELING ## Returnerer eksponentialfordelingen +FDIST = FFORDELING ## Returnerer F-sannsynlighetsfordelingen +FINV = FFORDELING.INVERS ## Returnerer den inverse av den sannsynlige F-fordelingen +FISHER = FISHER ## Returnerer Fisher-transformasjonen +FISHERINV = FISHERINV ## Returnerer den inverse av Fisher-transformasjonen +FORECAST = PROGNOSE ## Returnerer en verdi langs en lineær trend +FREQUENCY = FREKVENS ## Returnerer en frekvensdistribusjon som en loddrett matrise +FTEST = FTEST ## Returnerer resultatet av en F-test +GAMMADIST = GAMMAFORDELING ## Returnerer gammafordelingen +GAMMAINV = GAMMAINV ## Returnerer den inverse av den gammakumulative fordelingen +GAMMALN = GAMMALN ## Returnerer den naturlige logaritmen til gammafunksjonen G(x) +GEOMEAN = GJENNOMSNITT.GEOMETRISK ## Returnerer den geometriske middelverdien +GROWTH = VEKST ## Returnerer verdier langs en eksponentiell trend +HARMEAN = GJENNOMSNITT.HARMONISK ## Returnerer den harmoniske middelverdien +HYPGEOMDIST = HYPGEOM.FORDELING ## Returnerer den hypergeometriske fordelingen +INTERCEPT = SKJÆRINGSPUNKT ## Returnerer skjæringspunktet til den lineære regresjonslinjen +KURT = KURT ## Returnerer kurtosen til et datasett +LARGE = N.STØRST ## Returnerer den n-te største verdien i et datasett +LINEST = RETTLINJE ## Returnerer parameterne til en lineær trend +LOGEST = KURVE ## Returnerer parameterne til en eksponentiell trend +LOGINV = LOGINV ## Returnerer den inverse lognormale fordelingen +LOGNORMDIST = LOGNORMFORD ## Returnerer den kumulative lognormale fordelingen +MAX = STØRST ## Returnerer maksimumsverdien i en argumentliste +MAXA = MAKSA ## Returnerer maksimumsverdien i en argumentliste, inkludert tall, tekst og logiske verdier +MEDIAN = MEDIAN ## Returnerer medianen til tallene som er gitt +MIN = MIN ## Returnerer minimumsverdien i en argumentliste +MINA = MINA ## Returnerer den minste verdien i en argumentliste, inkludert tall, tekst og logiske verdier +MODE = MODUS ## Returnerer den vanligste verdien i et datasett +NEGBINOMDIST = NEGBINOM.FORDELING ## Returnerer den negative binomiske fordelingen +NORMDIST = NORMALFORDELING ## Returnerer den kumulative normalfordelingen +NORMINV = NORMINV ## Returnerer den inverse kumulative normalfordelingen +NORMSDIST = NORMSFORDELING ## Returnerer standard kumulativ normalfordeling +NORMSINV = NORMSINV ## Returnerer den inverse av den den kumulative standard normalfordelingen +PEARSON = PEARSON ## Returnerer produktmomentkorrelasjonskoeffisienten, Pearson +PERCENTILE = PERSENTIL ## Returnerer den n-te persentil av verdiene i et område +PERCENTRANK = PROSENTDEL ## Returnerer prosentrangeringen av en verdi i et datasett +PERMUT = PERMUTER ## Returnerer antall permutasjoner for et gitt antall objekter +POISSON = POISSON ## Returnerer Poissons sannsynlighetsfordeling +PROB = SANNSYNLIG ## Returnerer sannsynligheten for at verdier i et område ligger mellom to grenser +QUARTILE = KVARTIL ## Returnerer kvartilen til et datasett +RANK = RANG ## Returnerer rangeringen av et tall, eller plassen tallet har i en rekke +RSQ = RKVADRAT ## Returnerer kvadratet av produktmomentkorrelasjonskoeffisienten (Pearsons r) +SKEW = SKJEVFORDELING ## Returnerer skjevheten i en fordeling +SLOPE = STIGNINGSTALL ## Returnerer stigningtallet for den lineære regresjonslinjen +SMALL = N.MINST ## Returnerer den n-te minste verdien i et datasett +STANDARDIZE = NORMALISER ## Returnerer en normalisert verdi +STDEV = STDAV ## Estimere standardavvik på grunnlag av et utvalg +STDEVA = STDAVVIKA ## Estimerer standardavvik basert på et utvalg, inkludert tall, tekst og logiske verdier +STDEVP = STDAVP ## Beregner standardavvik basert på hele populasjonen +STDEVPA = STDAVVIKPA ## Beregner standardavvik basert på hele populasjonen, inkludert tall, tekst og logiske verdier +STEYX = STANDARDFEIL ## Returnerer standardfeilen for den predikerte y-verdien for hver x i regresjonen +TDIST = TFORDELING ## Returnerer en Student t-fordeling +TINV = TINV ## Returnerer den inverse Student t-fordelingen +TREND = TREND ## Returnerer verdier langs en lineær trend +TRIMMEAN = TRIMMET.GJENNOMSNITT ## Returnerer den interne middelverdien til et datasett +TTEST = TTEST ## Returnerer sannsynligheten assosiert med en Student t-test +VAR = VARIANS ## Estimerer varians basert på et utvalg +VARA = VARIANSA ## Estimerer varians basert på et utvalg, inkludert tall, tekst og logiske verdier +VARP = VARIANSP ## Beregner varians basert på hele populasjonen +VARPA = VARIANSPA ## Beregner varians basert på hele populasjonen, inkludert tall, tekst og logiske verdier +WEIBULL = WEIBULL.FORDELING ## Returnerer Weibull-fordelingen +ZTEST = ZTEST ## Returnerer den ensidige sannsynlighetsverdien for en z-test + + +## +## Text functions Tekstfunksjoner +## +ASC = STIGENDE ## Endrer fullbreddes (dobbeltbyte) engelske bokstaver eller katakana i en tegnstreng, til halvbreddes (enkeltbyte) tegn +BAHTTEXT = BAHTTEKST ## Konverterer et tall til tekst, og bruker valutaformatet ß (baht) +CHAR = TEGNKODE ## Returnerer tegnet som svarer til kodenummeret +CLEAN = RENSK ## Fjerner alle tegn som ikke kan skrives ut, fra teksten +CODE = KODE ## Returnerer en numerisk kode for det første tegnet i en tekststreng +CONCATENATE = KJEDE.SAMMEN ## Slår sammen flere tekstelementer til ett tekstelement +DOLLAR = VALUTA ## Konverterer et tall til tekst, og bruker valutaformatet $ (dollar) +EXACT = EKSAKT ## Kontrollerer om to tekstverdier er like +FIND = FINN ## Finner en tekstverdi inne i en annen (skiller mellom store og små bokstaver) +FINDB = FINNB ## Finner en tekstverdi inne i en annen (skiller mellom store og små bokstaver) +FIXED = FASTSATT ## Formaterer et tall som tekst med et bestemt antall desimaler +JIS = JIS ## Endrer halvbreddes (enkeltbyte) engelske bokstaver eller katakana i en tegnstreng, til fullbreddes (dobbeltbyte) tegn +LEFT = VENSTRE ## Returnerer tegnene lengst til venstre i en tekstverdi +LEFTB = VENSTREB ## Returnerer tegnene lengst til venstre i en tekstverdi +LEN = LENGDE ## Returnerer antall tegn i en tekststreng +LENB = LENGDEB ## Returnerer antall tegn i en tekststreng +LOWER = SMÅ ## Konverterer tekst til små bokstaver +MID = DELTEKST ## Returnerer et angitt antall tegn fra en tekststreng, og begynner fra posisjonen du angir +MIDB = DELTEKSTB ## Returnerer et angitt antall tegn fra en tekststreng, og begynner fra posisjonen du angir +PHONETIC = FURIGANA ## Trekker ut fonetiske tegn (furigana) fra en tekststreng +PROPER = STOR.FORBOKSTAV ## Gir den første bokstaven i hvert ord i en tekstverdi stor forbokstav +REPLACE = ERSTATT ## Erstatter tegn i en tekst +REPLACEB = ERSTATTB ## Erstatter tegn i en tekst +REPT = GJENTA ## Gjentar tekst et gitt antall ganger +RIGHT = HØYRE ## Returnerer tegnene lengst til høyre i en tekstverdi +RIGHTB = HØYREB ## Returnerer tegnene lengst til høyre i en tekstverdi +SEARCH = SØK ## Finner en tekstverdi inne i en annen (skiller ikke mellom store og små bokstaver) +SEARCHB = SØKB ## Finner en tekstverdi inne i en annen (skiller ikke mellom store og små bokstaver) +SUBSTITUTE = BYTT.UT ## Bytter ut gammel tekst med ny tekst i en tekststreng +T = T ## Konverterer argumentene til tekst +TEXT = TEKST ## Formaterer et tall og konverterer det til tekst +TRIM = TRIMME ## Fjerner mellomrom fra tekst +UPPER = STORE ## Konverterer tekst til store bokstaver +VALUE = VERDI ## Konverterer et tekstargument til et tall diff --git a/extend/PHPExcel/PHPExcel/locale/pl/config b/extend/PHPExcel/PHPExcel/locale/pl/config new file mode 100644 index 0000000..4dd75be --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/pl/config @@ -0,0 +1,47 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = zł + + +## +## Excel Error Codes (For future use) +## +NULL = #ZERO! +DIV0 = #DZIEL/0! +VALUE = #ARG! +REF = #ADR! +NAME = #NAZWA? +NUM = #LICZBA! +NA = #N/D! diff --git a/extend/PHPExcel/PHPExcel/locale/pl/functions b/extend/PHPExcel/PHPExcel/locale/pl/functions new file mode 100644 index 0000000..1881a71 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/pl/functions @@ -0,0 +1,438 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Calculation +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ +## +## + + +## +## Add-in and Automation functions Funkcje dodatków i automatyzacji +## +GETPIVOTDATA = WEŹDANETABELI ## Zwraca dane przechowywane w raporcie tabeli przestawnej. + + +## +## Cube functions Funkcje modułów +## +CUBEKPIMEMBER = ELEMENT.KPI.MODUŁU ## Zwraca nazwę, właściwość i miarę kluczowego wskaźnika wydajności (KPI) oraz wyświetla nazwę i właściwość w komórce. Wskaźnik KPI jest miarą ilościową, taką jak miesięczny zysk brutto lub kwartalna fluktuacja pracowników, używaną do monitorowania wydajności organizacji. +CUBEMEMBER = ELEMENT.MODUŁU ## Zwraca element lub krotkę z hierarchii modułu. Służy do sprawdzania, czy element lub krotka istnieje w module. +CUBEMEMBERPROPERTY = WŁAŚCIWOŚĆ.ELEMENTU.MODUŁU ## Zwraca wartość właściwości elementu w module. Służy do sprawdzania, czy nazwa elementu istnieje w module, i zwracania określonej właściwości dla tego elementu. +CUBERANKEDMEMBER = USZEREGOWANY.ELEMENT.MODUŁU ## Zwraca n-ty (albo uszeregowany) element zestawu. Służy do zwracania elementu lub elementów zestawu, na przykład najlepszego sprzedawcy lub 10 najlepszych studentów. +CUBESET = ZESTAW.MODUŁÓW ## Definiuje obliczony zestaw elementów lub krotek, wysyłając wyrażenie zestawu do serwera modułu, który tworzy zestaw i zwraca go do programu Microsoft Office Excel. +CUBESETCOUNT = LICZNIK.MODUŁÓW.ZESTAWU ## Zwraca liczbę elementów zestawu. +CUBEVALUE = WARTOŚĆ.MODUŁU ## Zwraca zagregowaną wartość z modułu. + + +## +## Database functions Funkcje baz danych +## +DAVERAGE = BD.ŚREDNIA ## Zwraca wartość średniej wybranych wpisów bazy danych. +DCOUNT = BD.ILE.REKORDÓW ## Zlicza komórki zawierające liczby w bazie danych. +DCOUNTA = BD.ILE.REKORDÓW.A ## Zlicza niepuste komórki w bazie danych. +DGET = BD.POLE ## Wyodrębnia z bazy danych jeden rekord spełniający określone kryteria. +DMAX = BD.MAX ## Zwraca wartość maksymalną z wybranych wpisów bazy danych. +DMIN = BD.MIN ## Zwraca wartość minimalną z wybranych wpisów bazy danych. +DPRODUCT = BD.ILOCZYN ## Mnoży wartości w konkretnym, spełniającym kryteria polu rekordów bazy danych. +DSTDEV = BD.ODCH.STANDARD ## Szacuje odchylenie standardowe na podstawie próbki z wybranych wpisów bazy danych. +DSTDEVP = BD.ODCH.STANDARD.POPUL ## Oblicza odchylenie standardowe na podstawie całej populacji wybranych wpisów bazy danych. +DSUM = BD.SUMA ## Dodaje liczby w kolumnie pól rekordów bazy danych, które spełniają kryteria. +DVAR = BD.WARIANCJA ## Szacuje wariancję na podstawie próbki z wybranych wpisów bazy danych. +DVARP = BD.WARIANCJA.POPUL ## Oblicza wariancję na podstawie całej populacji wybranych wpisów bazy danych. + + +## +## Date and time functions Funkcje dat, godzin i czasu +## +DATE = DATA ## Zwraca liczbę seryjną dla wybranej daty. +DATEVALUE = DATA.WARTOŚĆ ## Konwertuje datę w formie tekstu na liczbę seryjną. +DAY = DZIEŃ ## Konwertuje liczbę seryjną na dzień miesiąca. +DAYS360 = DNI.360 ## Oblicza liczbę dni między dwiema datami na podstawie roku 360-dniowego. +EDATE = UPŁDNI ## Zwraca liczbę seryjną daty jako wskazaną liczbę miesięcy przed określoną datą początkową lub po niej. +EOMONTH = EOMONTH ## Zwraca liczbę seryjną ostatniego dnia miesiąca przed określoną liczbą miesięcy lub po niej. +HOUR = GODZINA ## Konwertuje liczbę seryjną na godzinę. +MINUTE = MINUTA ## Konwertuje liczbę seryjną na minutę. +MONTH = MIESIĄC ## Konwertuje liczbę seryjną na miesiąc. +NETWORKDAYS = NETWORKDAYS ## Zwraca liczbę pełnych dni roboczych między dwiema datami. +NOW = TERAZ ## Zwraca liczbę seryjną bieżącej daty i godziny. +SECOND = SEKUNDA ## Konwertuje liczbę seryjną na sekundę. +TIME = CZAS ## Zwraca liczbę seryjną określonego czasu. +TIMEVALUE = CZAS.WARTOŚĆ ## Konwertuje czas w formie tekstu na liczbę seryjną. +TODAY = DZIŚ ## Zwraca liczbę seryjną dla daty bieżącej. +WEEKDAY = DZIEŃ.TYG ## Konwertuje liczbę seryjną na dzień tygodnia. +WEEKNUM = WEEKNUM ## Konwertuje liczbę seryjną na liczbę reprezentującą numer tygodnia w roku. +WORKDAY = WORKDAY ## Zwraca liczbę seryjną dla daty przed określoną liczbą dni roboczych lub po niej. +YEAR = ROK ## Konwertuje liczbę seryjną na rok. +YEARFRAC = YEARFRAC ## Zwraca część roku reprezentowaną przez pełną liczbę dni między datą początkową a datą końcową. + + +## +## Engineering functions Funkcje inżynierskie +## +BESSELI = BESSELI ## Zwraca wartość zmodyfikowanej funkcji Bessela In(x). +BESSELJ = BESSELJ ## Zwraca wartość funkcji Bessela Jn(x). +BESSELK = BESSELK ## Zwraca wartość zmodyfikowanej funkcji Bessela Kn(x). +BESSELY = BESSELY ## Zwraca wartość funkcji Bessela Yn(x). +BIN2DEC = BIN2DEC ## Konwertuje liczbę w postaci dwójkowej na liczbę w postaci dziesiętnej. +BIN2HEX = BIN2HEX ## Konwertuje liczbę w postaci dwójkowej na liczbę w postaci szesnastkowej. +BIN2OCT = BIN2OCT ## Konwertuje liczbę w postaci dwójkowej na liczbę w postaci ósemkowej. +COMPLEX = COMPLEX ## Konwertuje część rzeczywistą i urojoną na liczbę zespoloną. +CONVERT = CONVERT ## Konwertuje liczbę z jednego systemu miar na inny. +DEC2BIN = DEC2BIN ## Konwertuje liczbę w postaci dziesiętnej na postać dwójkową. +DEC2HEX = DEC2HEX ## Konwertuje liczbę w postaci dziesiętnej na liczbę w postaci szesnastkowej. +DEC2OCT = DEC2OCT ## Konwertuje liczbę w postaci dziesiętnej na liczbę w postaci ósemkowej. +DELTA = DELTA ## Sprawdza, czy dwie wartości są równe. +ERF = ERF ## Zwraca wartość funkcji błędu. +ERFC = ERFC ## Zwraca wartość komplementarnej funkcji błędu. +GESTEP = GESTEP ## Sprawdza, czy liczba jest większa niż wartość progowa. +HEX2BIN = HEX2BIN ## Konwertuje liczbę w postaci szesnastkowej na liczbę w postaci dwójkowej. +HEX2DEC = HEX2DEC ## Konwertuje liczbę w postaci szesnastkowej na liczbę w postaci dziesiętnej. +HEX2OCT = HEX2OCT ## Konwertuje liczbę w postaci szesnastkowej na liczbę w postaci ósemkowej. +IMABS = IMABS ## Zwraca wartość bezwzględną (moduł) liczby zespolonej. +IMAGINARY = IMAGINARY ## Zwraca wartość części urojonej liczby zespolonej. +IMARGUMENT = IMARGUMENT ## Zwraca wartość argumentu liczby zespolonej, przy czym kąt wyrażony jest w radianach. +IMCONJUGATE = IMCONJUGATE ## Zwraca wartość liczby sprzężonej danej liczby zespolonej. +IMCOS = IMCOS ## Zwraca wartość cosinusa liczby zespolonej. +IMDIV = IMDIV ## Zwraca wartość ilorazu dwóch liczb zespolonych. +IMEXP = IMEXP ## Zwraca postać wykładniczą liczby zespolonej. +IMLN = IMLN ## Zwraca wartość logarytmu naturalnego liczby zespolonej. +IMLOG10 = IMLOG10 ## Zwraca wartość logarytmu dziesiętnego liczby zespolonej. +IMLOG2 = IMLOG2 ## Zwraca wartość logarytmu liczby zespolonej przy podstawie 2. +IMPOWER = IMPOWER ## Zwraca wartość liczby zespolonej podniesionej do potęgi całkowitej. +IMPRODUCT = IMPRODUCT ## Zwraca wartość iloczynu liczb zespolonych. +IMREAL = IMREAL ## Zwraca wartość części rzeczywistej liczby zespolonej. +IMSIN = IMSIN ## Zwraca wartość sinusa liczby zespolonej. +IMSQRT = IMSQRT ## Zwraca wartość pierwiastka kwadratowego z liczby zespolonej. +IMSUB = IMSUB ## Zwraca wartość różnicy dwóch liczb zespolonych. +IMSUM = IMSUM ## Zwraca wartość sumy liczb zespolonych. +OCT2BIN = OCT2BIN ## Konwertuje liczbę w postaci ósemkowej na liczbę w postaci dwójkowej. +OCT2DEC = OCT2DEC ## Konwertuje liczbę w postaci ósemkowej na liczbę w postaci dziesiętnej. +OCT2HEX = OCT2HEX ## Konwertuje liczbę w postaci ósemkowej na liczbę w postaci szesnastkowej. + + +## +## Financial functions Funkcje finansowe +## +ACCRINT = ACCRINT ## Zwraca narosłe odsetki dla papieru wartościowego z oprocentowaniem okresowym. +ACCRINTM = ACCRINTM ## Zwraca narosłe odsetki dla papieru wartościowego z oprocentowaniem w terminie wykupu. +AMORDEGRC = AMORDEGRC ## Zwraca amortyzację dla każdego okresu rozliczeniowego z wykorzystaniem współczynnika amortyzacji. +AMORLINC = AMORLINC ## Zwraca amortyzację dla każdego okresu rozliczeniowego. +COUPDAYBS = COUPDAYBS ## Zwraca liczbę dni od początku okresu dywidendy do dnia rozliczeniowego. +COUPDAYS = COUPDAYS ## Zwraca liczbę dni w okresie dywidendy, z uwzględnieniem dnia rozliczeniowego. +COUPDAYSNC = COUPDAYSNC ## Zwraca liczbę dni od dnia rozliczeniowego do daty następnego dnia dywidendy. +COUPNCD = COUPNCD ## Zwraca dzień następnej dywidendy po dniu rozliczeniowym. +COUPNUM = COUPNUM ## Zwraca liczbę dywidend płatnych między dniem rozliczeniowym a dniem wykupu. +COUPPCD = COUPPCD ## Zwraca dzień poprzedniej dywidendy przed dniem rozliczeniowym. +CUMIPMT = CUMIPMT ## Zwraca wartość procentu składanego płatnego między dwoma okresami. +CUMPRINC = CUMPRINC ## Zwraca wartość kapitału skumulowanego spłaty pożyczki między dwoma okresami. +DB = DB ## Zwraca amortyzację środka trwałego w danym okresie metodą degresywną z zastosowaniem stałej bazowej. +DDB = DDB ## Zwraca amortyzację środka trwałego za podany okres metodą degresywną z zastosowaniem podwójnej bazowej lub metodą określoną przez użytkownika. +DISC = DISC ## Zwraca wartość stopy dyskontowej papieru wartościowego. +DOLLARDE = DOLLARDE ## Konwertuje cenę w postaci ułamkowej na cenę wyrażoną w postaci dziesiętnej. +DOLLARFR = DOLLARFR ## Konwertuje cenę wyrażoną w postaci dziesiętnej na cenę wyrażoną w postaci ułamkowej. +DURATION = DURATION ## Zwraca wartość rocznego przychodu z papieru wartościowego o okresowych wypłatach oprocentowania. +EFFECT = EFFECT ## Zwraca wartość efektywnej rocznej stopy procentowej. +FV = FV ## Zwraca przyszłą wartość lokaty. +FVSCHEDULE = FVSCHEDULE ## Zwraca przyszłą wartość kapitału początkowego wraz z szeregiem procentów składanych. +INTRATE = INTRATE ## Zwraca wartość stopy procentowej papieru wartościowego całkowicie ulokowanego. +IPMT = IPMT ## Zwraca wysokość spłaty oprocentowania lokaty za dany okres. +IRR = IRR ## Zwraca wartość wewnętrznej stopy zwrotu dla serii przepływów gotówkowych. +ISPMT = ISPMT ## Oblicza wysokość spłaty oprocentowania za dany okres lokaty. +MDURATION = MDURATION ## Zwraca wartość zmodyfikowanego okresu Macauleya dla papieru wartościowego o założonej wartości nominalnej 100 zł. +MIRR = MIRR ## Zwraca wartość wewnętrznej stopy zwrotu dla przypadku, gdy dodatnie i ujemne przepływy gotówkowe mają różne stopy. +NOMINAL = NOMINAL ## Zwraca wysokość nominalnej rocznej stopy procentowej. +NPER = NPER ## Zwraca liczbę okresów dla lokaty. +NPV = NPV ## Zwraca wartość bieżącą netto lokaty na podstawie szeregu okresowych przepływów gotówkowych i stopy dyskontowej. +ODDFPRICE = ODDFPRICE ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego z nietypowym pierwszym okresem. +ODDFYIELD = ODDFYIELD ## Zwraca rentowność papieru wartościowego z nietypowym pierwszym okresem. +ODDLPRICE = ODDLPRICE ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego z nietypowym ostatnim okresem. +ODDLYIELD = ODDLYIELD ## Zwraca rentowność papieru wartościowego z nietypowym ostatnim okresem. +PMT = PMT ## Zwraca wartość okresowej płatności raty rocznej. +PPMT = PPMT ## Zwraca wysokość spłaty kapitału w przypadku lokaty dla danego okresu. +PRICE = PRICE ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego z oprocentowaniem okresowym. +PRICEDISC = PRICEDISC ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego zdyskontowanego. +PRICEMAT = PRICEMAT ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego z oprocentowaniem w terminie wykupu. +PV = PV ## Zwraca wartość bieżącą lokaty. +RATE = RATE ## Zwraca wysokość stopy procentowej w okresie raty rocznej. +RECEIVED = RECEIVED ## Zwraca wartość kapitału otrzymanego przy wykupie papieru wartościowego całkowicie ulokowanego. +SLN = SLN ## Zwraca amortyzację środka trwałego za jeden okres metodą liniową. +SYD = SYD ## Zwraca amortyzację środka trwałego za dany okres metodą sumy cyfr lat amortyzacji. +TBILLEQ = TBILLEQ ## Zwraca rentowność ekwiwalentu obligacji dla bonu skarbowego. +TBILLPRICE = TBILLPRICE ## Zwraca cenę za 100 zł wartości nominalnej bonu skarbowego. +TBILLYIELD = TBILLYIELD ## Zwraca rentowność bonu skarbowego. +VDB = VDB ## Oblicza amortyzację środka trwałego w danym okresie lub jego części metodą degresywną. +XIRR = XIRR ## Zwraca wartość wewnętrznej stopy zwrotu dla serii rozłożonych w czasie przepływów gotówkowych, niekoniecznie okresowych. +XNPV = XNPV ## Zwraca wartość bieżącą netto dla serii rozłożonych w czasie przepływów gotówkowych, niekoniecznie okresowych. +YIELD = YIELD ## Zwraca rentowność papieru wartościowego z oprocentowaniem okresowym. +YIELDDISC = YIELDDISC ## Zwraca roczną rentowność zdyskontowanego papieru wartościowego, na przykład bonu skarbowego. +YIELDMAT = YIELDMAT ## Zwraca roczną rentowność papieru wartościowego oprocentowanego przy wykupie. + + +## +## Information functions Funkcje informacyjne +## +CELL = KOMÓRKA ## Zwraca informacje o formacie, położeniu lub zawartości komórki. +ERROR.TYPE = NR.BŁĘDU ## Zwraca liczbę odpowiadającą typowi błędu. +INFO = INFO ## Zwraca informację o aktualnym środowisku pracy. +ISBLANK = CZY.PUSTA ## Zwraca wartość PRAWDA, jeśli wartość jest pusta. +ISERR = CZY.BŁ ## Zwraca wartość PRAWDA, jeśli wartość jest dowolną wartością błędu, z wyjątkiem #N/D!. +ISERROR = CZY.BŁĄD ## Zwraca wartość PRAWDA, jeśli wartość jest dowolną wartością błędu. +ISEVEN = ISEVEN ## Zwraca wartość PRAWDA, jeśli liczba jest parzysta. +ISLOGICAL = CZY.LOGICZNA ## Zwraca wartość PRAWDA, jeśli wartość jest wartością logiczną. +ISNA = CZY.BRAK ## Zwraca wartość PRAWDA, jeśli wartość jest wartością błędu #N/D!. +ISNONTEXT = CZY.NIE.TEKST ## Zwraca wartość PRAWDA, jeśli wartość nie jest tekstem. +ISNUMBER = CZY.LICZBA ## Zwraca wartość PRAWDA, jeśli wartość jest liczbą. +ISODD = ISODD ## Zwraca wartość PRAWDA, jeśli liczba jest nieparzysta. +ISREF = CZY.ADR ## Zwraca wartość PRAWDA, jeśli wartość jest odwołaniem. +ISTEXT = CZY.TEKST ## Zwraca wartość PRAWDA, jeśli wartość jest tekstem. +N = L ## Zwraca wartość przekonwertowaną na postać liczbową. +NA = BRAK ## Zwraca wartość błędu #N/D!. +TYPE = TYP ## Zwraca liczbę wskazującą typ danych wartości. + + +## +## Logical functions Funkcje logiczne +## +AND = ORAZ ## Zwraca wartość PRAWDA, jeśli wszystkie argumenty mają wartość PRAWDA. +FALSE = FAŁSZ ## Zwraca wartość logiczną FAŁSZ. +IF = JEŻELI ## Określa warunek logiczny do sprawdzenia. +IFERROR = JEŻELI.BŁĄD ## Zwraca określoną wartość, jeśli wynikiem obliczenia formuły jest błąd; w przeciwnym przypadku zwraca wynik formuły. +NOT = NIE ## Odwraca wartość logiczną argumentu. +OR = LUB ## Zwraca wartość PRAWDA, jeśli co najmniej jeden z argumentów ma wartość PRAWDA. +TRUE = PRAWDA ## Zwraca wartość logiczną PRAWDA. + + +## +## Lookup and reference functions Funkcje wyszukiwania i odwołań +## +ADDRESS = ADRES ## Zwraca odwołanie do jednej komórki w arkuszu jako wartość tekstową. +AREAS = OBSZARY ## Zwraca liczbę obszarów występujących w odwołaniu. +CHOOSE = WYBIERZ ## Wybiera wartość z listy wartości. +COLUMN = NR.KOLUMNY ## Zwraca numer kolumny z odwołania. +COLUMNS = LICZBA.KOLUMN ## Zwraca liczbę kolumn dla danego odwołania. +HLOOKUP = WYSZUKAJ.POZIOMO ## Przegląda górny wiersz tablicy i zwraca wartość wskazanej komórki. +HYPERLINK = HIPERŁĄCZE ## Tworzy skrót lub skok, który pozwala otwierać dokument przechowywany na serwerze sieciowym, w sieci intranet lub w Internecie. +INDEX = INDEKS ## Używa indeksu do wybierania wartości z odwołania lub tablicy. +INDIRECT = ADR.POŚR ## Zwraca odwołanie określone przez wartość tekstową. +LOOKUP = WYSZUKAJ ## Wyszukuje wartości w wektorze lub tablicy. +MATCH = PODAJ.POZYCJĘ ## Wyszukuje wartości w odwołaniu lub w tablicy. +OFFSET = PRZESUNIĘCIE ## Zwraca adres przesunięty od danego odwołania. +ROW = WIERSZ ## Zwraca numer wiersza odwołania. +ROWS = ILE.WIERSZY ## Zwraca liczbę wierszy dla danego odwołania. +RTD = RTD ## Pobiera dane w czasie rzeczywistym z programu obsługującego automatyzację COM (Automatyzacja: Sposób pracy z obiektami aplikacji pochodzącymi z innej aplikacji lub narzędzia projektowania. Nazywana wcześniej Automatyzacją OLE, Automatyzacja jest standardem przemysłowym i funkcją obiektowego modelu składników (COM, Component Object Model).). +TRANSPOSE = TRANSPONUJ ## Zwraca transponowaną tablicę. +VLOOKUP = WYSZUKAJ.PIONOWO ## Przeszukuje pierwszą kolumnę tablicy i przechodzi wzdłuż wiersza, aby zwrócić wartość komórki. + + +## +## Math and trigonometry functions Funkcje matematyczne i trygonometryczne +## +ABS = MODUŁ.LICZBY ## Zwraca wartość absolutną liczby. +ACOS = ACOS ## Zwraca arcus cosinus liczby. +ACOSH = ACOSH ## Zwraca arcus cosinus hiperboliczny liczby. +ASIN = ASIN ## Zwraca arcus sinus liczby. +ASINH = ASINH ## Zwraca arcus sinus hiperboliczny liczby. +ATAN = ATAN ## Zwraca arcus tangens liczby. +ATAN2 = ATAN2 ## Zwraca arcus tangens liczby na podstawie współrzędnych x i y. +ATANH = ATANH ## Zwraca arcus tangens hiperboliczny liczby. +CEILING = ZAOKR.W.GÓRĘ ## Zaokrągla liczbę do najbliższej liczby całkowitej lub do najbliższej wielokrotności dokładności. +COMBIN = KOMBINACJE ## Zwraca liczbę kombinacji dla danej liczby obiektów. +COS = COS ## Zwraca cosinus liczby. +COSH = COSH ## Zwraca cosinus hiperboliczny liczby. +DEGREES = STOPNIE ## Konwertuje radiany na stopnie. +EVEN = ZAOKR.DO.PARZ ## Zaokrągla liczbę w górę do najbliższej liczby parzystej. +EXP = EXP ## Zwraca wartość liczby e podniesionej do potęgi określonej przez podaną liczbę. +FACT = SILNIA ## Zwraca silnię liczby. +FACTDOUBLE = FACTDOUBLE ## Zwraca podwójną silnię liczby. +FLOOR = ZAOKR.W.DÓŁ ## Zaokrągla liczbę w dół, w kierunku zera. +GCD = GCD ## Zwraca największy wspólny dzielnik. +INT = ZAOKR.DO.CAŁK ## Zaokrągla liczbę w dół do najbliższej liczby całkowitej. +LCM = LCM ## Zwraca najmniejszą wspólną wielokrotność. +LN = LN ## Zwraca logarytm naturalny podanej liczby. +LOG = LOG ## Zwraca logarytm danej liczby przy zadanej podstawie. +LOG10 = LOG10 ## Zwraca logarytm dziesiętny liczby. +MDETERM = WYZNACZNIK.MACIERZY ## Zwraca wyznacznik macierzy tablicy. +MINVERSE = MACIERZ.ODW ## Zwraca odwrotność macierzy tablicy. +MMULT = MACIERZ.ILOCZYN ## Zwraca iloczyn macierzy dwóch tablic. +MOD = MOD ## Zwraca resztę z dzielenia. +MROUND = MROUND ## Zwraca liczbę zaokrągloną do żądanej wielokrotności. +MULTINOMIAL = MULTINOMIAL ## Zwraca wielomian dla zbioru liczb. +ODD = ZAOKR.DO.NPARZ ## Zaokrągla liczbę w górę do najbliższej liczby nieparzystej. +PI = PI ## Zwraca wartość liczby Pi. +POWER = POTĘGA ## Zwraca liczbę podniesioną do potęgi. +PRODUCT = ILOCZYN ## Mnoży argumenty. +QUOTIENT = QUOTIENT ## Zwraca iloraz (całkowity). +RADIANS = RADIANY ## Konwertuje stopnie na radiany. +RAND = LOS ## Zwraca liczbę pseudolosową z zakresu od 0 do 1. +RANDBETWEEN = RANDBETWEEN ## Zwraca liczbę pseudolosową z zakresu określonego przez podane argumenty. +ROMAN = RZYMSKIE ## Konwertuje liczbę arabską na rzymską jako tekst. +ROUND = ZAOKR ## Zaokrągla liczbę do określonej liczby cyfr. +ROUNDDOWN = ZAOKR.DÓŁ ## Zaokrągla liczbę w dół, w kierunku zera. +ROUNDUP = ZAOKR.GÓRA ## Zaokrągla liczbę w górę, w kierunku od zera. +SERIESSUM = SERIESSUM ## Zwraca sumę szeregu potęgowego na podstawie wzoru. +SIGN = ZNAK.LICZBY ## Zwraca znak liczby. +SIN = SIN ## Zwraca sinus danego kąta. +SINH = SINH ## Zwraca sinus hiperboliczny liczby. +SQRT = PIERWIASTEK ## Zwraca dodatni pierwiastek kwadratowy. +SQRTPI = SQRTPI ## Zwraca pierwiastek kwadratowy iloczynu (liczba * Pi). +SUBTOTAL = SUMY.POŚREDNIE ## Zwraca sumę częściową listy lub bazy danych. +SUM = SUMA ## Dodaje argumenty. +SUMIF = SUMA.JEŻELI ## Dodaje komórki określone przez podane kryterium. +SUMIFS = SUMA.WARUNKÓW ## Dodaje komórki w zakresie, które spełniają wiele kryteriów. +SUMPRODUCT = SUMA.ILOCZYNÓW ## Zwraca sumę iloczynów odpowiednich elementów tablicy. +SUMSQ = SUMA.KWADRATÓW ## Zwraca sumę kwadratów argumentów. +SUMX2MY2 = SUMA.X2.M.Y2 ## Zwraca sumę różnic kwadratów odpowiednich wartości w dwóch tablicach. +SUMX2PY2 = SUMA.X2.P.Y2 ## Zwraca sumę sum kwadratów odpowiednich wartości w dwóch tablicach. +SUMXMY2 = SUMA.XMY.2 ## Zwraca sumę kwadratów różnic odpowiednich wartości w dwóch tablicach. +TAN = TAN ## Zwraca tangens liczby. +TANH = TANH ## Zwraca tangens hiperboliczny liczby. +TRUNC = LICZBA.CAŁK ## Przycina liczbę do wartości całkowitej. + + +## +## Statistical functions Funkcje statystyczne +## +AVEDEV = ODCH.ŚREDNIE ## Zwraca średnią wartość odchyleń absolutnych punktów danych od ich wartości średniej. +AVERAGE = ŚREDNIA ## Zwraca wartość średnią argumentów. +AVERAGEA = ŚREDNIA.A ## Zwraca wartość średnią argumentów, z uwzględnieniem liczb, tekstów i wartości logicznych. +AVERAGEIF = ŚREDNIA.JEŻELI ## Zwraca średnią (średnią arytmetyczną) wszystkich komórek w zakresie, które spełniają podane kryteria. +AVERAGEIFS = ŚREDNIA.WARUNKÓW ## Zwraca średnią (średnią arytmetyczną) wszystkich komórek, które spełniają jedno lub więcej kryteriów. +BETADIST = ROZKŁAD.BETA ## Zwraca skumulowaną funkcję gęstości prawdopodobieństwa beta. +BETAINV = ROZKŁAD.BETA.ODW ## Zwraca odwrotność skumulowanej funkcji gęstości prawdopodobieństwa beta. +BINOMDIST = ROZKŁAD.DWUM ## Zwraca pojedynczy składnik dwumianowego rozkładu prawdopodobieństwa. +CHIDIST = ROZKŁAD.CHI ## Zwraca wartość jednostronnego prawdopodobieństwa rozkładu chi-kwadrat. +CHIINV = ROZKŁAD.CHI.ODW ## Zwraca odwrotność wartości jednostronnego prawdopodobieństwa rozkładu chi-kwadrat. +CHITEST = TEST.CHI ## Zwraca test niezależności. +CONFIDENCE = UFNOŚĆ ## Zwraca interwał ufności dla średniej populacji. +CORREL = WSP.KORELACJI ## Zwraca współczynnik korelacji dwóch zbiorów danych. +COUNT = ILE.LICZB ## Zlicza liczby znajdujące się na liście argumentów. +COUNTA = ILE.NIEPUSTYCH ## Zlicza wartości znajdujące się na liście argumentów. +COUNTBLANK = LICZ.PUSTE ## Zwraca liczbę pustych komórek w pewnym zakresie. +COUNTIF = LICZ.JEŻELI ## Zlicza komórki wewnątrz zakresu, które spełniają podane kryteria. +COUNTIFS = LICZ.WARUNKI ## Zlicza komórki wewnątrz zakresu, które spełniają wiele kryteriów. +COVAR = KOWARIANCJA ## Zwraca kowariancję, czyli średnią wartość iloczynów odpowiednich odchyleń. +CRITBINOM = PRÓG.ROZKŁAD.DWUM ## Zwraca najmniejszą wartość, dla której skumulowany rozkład dwumianowy jest mniejszy niż wartość kryterium lub równy jej. +DEVSQ = ODCH.KWADRATOWE ## Zwraca sumę kwadratów odchyleń. +EXPONDIST = ROZKŁAD.EXP ## Zwraca rozkład wykładniczy. +FDIST = ROZKŁAD.F ## Zwraca rozkład prawdopodobieństwa F. +FINV = ROZKŁAD.F.ODW ## Zwraca odwrotność rozkładu prawdopodobieństwa F. +FISHER = ROZKŁAD.FISHER ## Zwraca transformację Fishera. +FISHERINV = ROZKŁAD.FISHER.ODW ## Zwraca odwrotność transformacji Fishera. +FORECAST = REGLINX ## Zwraca wartość trendu liniowego. +FREQUENCY = CZĘSTOŚĆ ## Zwraca rozkład częstotliwości jako tablicę pionową. +FTEST = TEST.F ## Zwraca wynik testu F. +GAMMADIST = ROZKŁAD.GAMMA ## Zwraca rozkład gamma. +GAMMAINV = ROZKŁAD.GAMMA.ODW ## Zwraca odwrotność skumulowanego rozkładu gamma. +GAMMALN = ROZKŁAD.LIN.GAMMA ## Zwraca logarytm naturalny funkcji gamma, Γ(x). +GEOMEAN = ŚREDNIA.GEOMETRYCZNA ## Zwraca średnią geometryczną. +GROWTH = REGEXPW ## Zwraca wartości trendu wykładniczego. +HARMEAN = ŚREDNIA.HARMONICZNA ## Zwraca średnią harmoniczną. +HYPGEOMDIST = ROZKŁAD.HIPERGEOM ## Zwraca rozkład hipergeometryczny. +INTERCEPT = ODCIĘTA ## Zwraca punkt przecięcia osi pionowej z linią regresji liniowej. +KURT = KURTOZA ## Zwraca kurtozę zbioru danych. +LARGE = MAX.K ## Zwraca k-tą największą wartość ze zbioru danych. +LINEST = REGLINP ## Zwraca parametry trendu liniowego. +LOGEST = REGEXPP ## Zwraca parametry trendu wykładniczego. +LOGINV = ROZKŁAD.LOG.ODW ## Zwraca odwrotność rozkładu logarytmu naturalnego. +LOGNORMDIST = ROZKŁAD.LOG ## Zwraca skumulowany rozkład logarytmu naturalnego. +MAX = MAX ## Zwraca maksymalną wartość listy argumentów. +MAXA = MAX.A ## Zwraca maksymalną wartość listy argumentów, z uwzględnieniem liczb, tekstów i wartości logicznych. +MEDIAN = MEDIANA ## Zwraca medianę podanych liczb. +MIN = MIN ## Zwraca minimalną wartość listy argumentów. +MINA = MIN.A ## Zwraca najmniejszą wartość listy argumentów, z uwzględnieniem liczb, tekstów i wartości logicznych. +MODE = WYST.NAJCZĘŚCIEJ ## Zwraca wartość najczęściej występującą w zbiorze danych. +NEGBINOMDIST = ROZKŁAD.DWUM.PRZEC ## Zwraca ujemny rozkład dwumianowy. +NORMDIST = ROZKŁAD.NORMALNY ## Zwraca rozkład normalny skumulowany. +NORMINV = ROZKŁAD.NORMALNY.ODW ## Zwraca odwrotność rozkładu normalnego skumulowanego. +NORMSDIST = ROZKŁAD.NORMALNY.S ## Zwraca standardowy rozkład normalny skumulowany. +NORMSINV = ROZKŁAD.NORMALNY.S.ODW ## Zwraca odwrotność standardowego rozkładu normalnego skumulowanego. +PEARSON = PEARSON ## Zwraca współczynnik korelacji momentu iloczynu Pearsona. +PERCENTILE = PERCENTYL ## Wyznacza k-ty percentyl wartości w zakresie. +PERCENTRANK = PROCENT.POZYCJA ## Zwraca procentową pozycję wartości w zbiorze danych. +PERMUT = PERMUTACJE ## Zwraca liczbę permutacji dla danej liczby obiektów. +POISSON = ROZKŁAD.POISSON ## Zwraca rozkład Poissona. +PROB = PRAWDPD ## Zwraca prawdopodobieństwo, że wartości w zakresie leżą pomiędzy dwiema granicami. +QUARTILE = KWARTYL ## Wyznacza kwartyl zbioru danych. +RANK = POZYCJA ## Zwraca pozycję liczby na liście liczb. +RSQ = R.KWADRAT ## Zwraca kwadrat współczynnika korelacji momentu iloczynu Pearsona. +SKEW = SKOŚNOŚĆ ## Zwraca skośność rozkładu. +SLOPE = NACHYLENIE ## Zwraca nachylenie linii regresji liniowej. +SMALL = MIN.K ## Zwraca k-tą najmniejszą wartość ze zbioru danych. +STANDARDIZE = NORMALIZUJ ## Zwraca wartość znormalizowaną. +STDEV = ODCH.STANDARDOWE ## Szacuje odchylenie standardowe na podstawie próbki. +STDEVA = ODCH.STANDARDOWE.A ## Szacuje odchylenie standardowe na podstawie próbki, z uwzględnieniem liczb, tekstów i wartości logicznych. +STDEVP = ODCH.STANDARD.POPUL ## Oblicza odchylenie standardowe na podstawie całej populacji. +STDEVPA = ODCH.STANDARD.POPUL.A ## Oblicza odchylenie standardowe na podstawie całej populacji, z uwzględnieniem liczb, teksów i wartości logicznych. +STEYX = REGBŁSTD ## Zwraca błąd standardowy przewidzianej wartości y dla każdej wartości x w regresji. +TDIST = ROZKŁAD.T ## Zwraca rozkład t-Studenta. +TINV = ROZKŁAD.T.ODW ## Zwraca odwrotność rozkładu t-Studenta. +TREND = REGLINW ## Zwraca wartości trendu liniowego. +TRIMMEAN = ŚREDNIA.WEWN ## Zwraca średnią wartość dla wnętrza zbioru danych. +TTEST = TEST.T ## Zwraca prawdopodobieństwo związane z testem t-Studenta. +VAR = WARIANCJA ## Szacuje wariancję na podstawie próbki. +VARA = WARIANCJA.A ## Szacuje wariancję na podstawie próbki, z uwzględnieniem liczb, tekstów i wartości logicznych. +VARP = WARIANCJA.POPUL ## Oblicza wariancję na podstawie całej populacji. +VARPA = WARIANCJA.POPUL.A ## Oblicza wariancję na podstawie całej populacji, z uwzględnieniem liczb, tekstów i wartości logicznych. +WEIBULL = ROZKŁAD.WEIBULL ## Zwraca rozkład Weibulla. +ZTEST = TEST.Z ## Zwraca wartość jednostronnego prawdopodobieństwa testu z. + + +## +## Text functions Funkcje tekstowe +## +ASC = ASC ## Zamienia litery angielskie lub katakana o pełnej szerokości (dwubajtowe) w ciągu znaków na znaki o szerokości połówkowej (jednobajtowe). +BAHTTEXT = BAHTTEXT ## Konwertuje liczbę na tekst, stosując format walutowy ß (baht). +CHAR = ZNAK ## Zwraca znak o podanym numerze kodu. +CLEAN = OCZYŚĆ ## Usuwa z tekstu wszystkie znaki, które nie mogą być drukowane. +CODE = KOD ## Zwraca kod numeryczny pierwszego znaku w ciągu tekstowym. +CONCATENATE = ZŁĄCZ.TEKSTY ## Łączy kilka oddzielnych tekstów w jeden tekst. +DOLLAR = KWOTA ## Konwertuje liczbę na tekst, stosując format walutowy $ (dolar). +EXACT = PORÓWNAJ ## Sprawdza identyczność dwóch wartości tekstowych. +FIND = ZNAJDŹ ## Znajduje jedną wartość tekstową wewnątrz innej (z uwzględnieniem wielkich i małych liter). +FINDB = ZNAJDŹB ## Znajduje jedną wartość tekstową wewnątrz innej (z uwzględnieniem wielkich i małych liter). +FIXED = ZAOKR.DO.TEKST ## Formatuje liczbę jako tekst przy stałej liczbie miejsc dziesiętnych. +JIS = JIS ## Zmienia litery angielskie lub katakana o szerokości połówkowej (jednobajtowe) w ciągu znaków na znaki o pełnej szerokości (dwubajtowe). +LEFT = LEWY ## Zwraca skrajne lewe znaki z wartości tekstowej. +LEFTB = LEWYB ## Zwraca skrajne lewe znaki z wartości tekstowej. +LEN = DŁ ## Zwraca liczbę znaków ciągu tekstowego. +LENB = DŁ.B ## Zwraca liczbę znaków ciągu tekstowego. +LOWER = LITERY.MAŁE ## Konwertuje wielkie litery tekstu na małe litery. +MID = FRAGMENT.TEKSTU ## Zwraca określoną liczbę znaków z ciągu tekstowego, zaczynając od zadanej pozycji. +MIDB = FRAGMENT.TEKSTU.B ## Zwraca określoną liczbę znaków z ciągu tekstowego, zaczynając od zadanej pozycji. +PHONETIC = PHONETIC ## Wybiera znaki fonetyczne (furigana) z ciągu tekstowego. +PROPER = Z.WIELKIEJ.LITERY ## Zastępuje pierwszą literę każdego wyrazu tekstu wielką literą. +REPLACE = ZASTĄP ## Zastępuje znaki w tekście. +REPLACEB = ZASTĄP.B ## Zastępuje znaki w tekście. +REPT = POWT ## Powiela tekst daną liczbę razy. +RIGHT = PRAWY ## Zwraca skrajne prawe znaki z wartości tekstowej. +RIGHTB = PRAWYB ## Zwraca skrajne prawe znaki z wartości tekstowej. +SEARCH = SZUKAJ.TEKST ## Wyszukuje jedną wartość tekstową wewnątrz innej (bez uwzględniania wielkości liter). +SEARCHB = SZUKAJ.TEKST.B ## Wyszukuje jedną wartość tekstową wewnątrz innej (bez uwzględniania wielkości liter). +SUBSTITUTE = PODSTAW ## Podstawia nowy tekst w miejsce poprzedniego tekstu w ciągu tekstowym. +T = T ## Konwertuje argumenty na tekst. +TEXT = TEKST ## Formatuje liczbę i konwertuje ją na tekst. +TRIM = USUŃ.ZBĘDNE.ODSTĘPY ## Usuwa spacje z tekstu. +UPPER = LITERY.WIELKIE ## Konwertuje znaki tekstu na wielkie litery. +VALUE = WARTOŚĆ ## Konwertuje argument tekstowy na liczbę. diff --git a/extend/PHPExcel/PHPExcel/locale/pt/br/config b/extend/PHPExcel/PHPExcel/locale/pt/br/config new file mode 100644 index 0000000..45b6fbd --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/pt/br/config @@ -0,0 +1,47 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = R$ + + +## +## Excel Error Codes (For future use) +## +NULL = #NULO! +DIV0 = #DIV/0! +VALUE = #VALOR! +REF = #REF! +NAME = #NOME? +NUM = #NÚM! +NA = #N/D diff --git a/extend/PHPExcel/PHPExcel/locale/pt/br/functions b/extend/PHPExcel/PHPExcel/locale/pt/br/functions new file mode 100644 index 0000000..a062a7f --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/pt/br/functions @@ -0,0 +1,408 @@ +## +## Add-in and Automation functions Funções Suplemento e Automação +## +GETPIVOTDATA = INFODADOSTABELADINÂMICA ## Retorna os dados armazenados em um relatório de tabela dinâmica + + +## +## Cube functions Funções de Cubo +## +CUBEKPIMEMBER = MEMBROKPICUBO ## Retorna o nome de um KPI (indicador de desempenho-chave), uma propriedade e uma medida e exibe o nome e a propriedade na célula. Um KPI é uma medida quantificável, como o lucro bruto mensal ou a rotatividade trimestral dos funcionários, usada para monitorar o desempenho de uma organização. +CUBEMEMBER = MEMBROCUBO ## Retorna um membro ou tupla em uma hierarquia de cubo. Use para validar se o membro ou tupla existe no cubo. +CUBEMEMBERPROPERTY = PROPRIEDADEMEMBROCUBO ## Retorna o valor da propriedade de um membro no cubo. Usada para validar a existência do nome do membro no cubo e para retornar a propriedade especificada para esse membro. +CUBERANKEDMEMBER = MEMBROCLASSIFICADOCUBO ## Retorna o enésimo membro, ou o membro ordenado, em um conjunto. Use para retornar um ou mais elementos em um conjunto, assim como o melhor vendedor ou os dez melhores alunos. +CUBESET = CONJUNTOCUBO ## Define um conjunto calculado de membros ou tuplas enviando uma expressão do conjunto para o cubo no servidor, que cria o conjunto e o retorna para o Microsoft Office Excel. +CUBESETCOUNT = CONTAGEMCONJUNTOCUBO ## Retorna o número de itens em um conjunto. +CUBEVALUE = VALORCUBO ## Retorna um valor agregado de um cubo. + + +## +## Database functions Funções de banco de dados +## +DAVERAGE = BDMÉDIA ## Retorna a média das entradas selecionadas de um banco de dados +DCOUNT = BDCONTAR ## Conta as células que contêm números em um banco de dados +DCOUNTA = BDCONTARA ## Conta células não vazias em um banco de dados +DGET = BDEXTRAIR ## Extrai de um banco de dados um único registro que corresponde a um critério específico +DMAX = BDMÁX ## Retorna o valor máximo de entradas selecionadas de um banco de dados +DMIN = BDMÍN ## Retorna o valor mínimo de entradas selecionadas de um banco de dados +DPRODUCT = BDMULTIPL ## Multiplica os valores em um campo específico de registros que correspondem ao critério em um banco de dados +DSTDEV = BDEST ## Estima o desvio padrão com base em uma amostra de entradas selecionadas de um banco de dados +DSTDEVP = BDDESVPA ## Calcula o desvio padrão com base na população inteira de entradas selecionadas de um banco de dados +DSUM = BDSOMA ## Adiciona os números à coluna de campos de registros do banco de dados que correspondem ao critério +DVAR = BDVAREST ## Estima a variância com base em uma amostra de entradas selecionadas de um banco de dados +DVARP = BDVARP ## Calcula a variância com base na população inteira de entradas selecionadas de um banco de dados + + +## +## Date and time functions Funções de data e hora +## +DATE = DATA ## Retorna o número de série de uma data específica +DATEVALUE = DATA.VALOR ## Converte uma data na forma de texto para um número de série +DAY = DIA ## Converte um número de série em um dia do mês +DAYS360 = DIAS360 ## Calcula o número de dias entre duas datas com base em um ano de 360 dias +EDATE = DATAM ## Retorna o número de série da data que é o número indicado de meses antes ou depois da data inicial +EOMONTH = FIMMÊS ## Retorna o número de série do último dia do mês antes ou depois de um número especificado de meses +HOUR = HORA ## Converte um número de série em uma hora +MINUTE = MINUTO ## Converte um número de série em um minuto +MONTH = MÊS ## Converte um número de série em um mês +NETWORKDAYS = DIATRABALHOTOTAL ## Retorna o número de dias úteis inteiros entre duas datas +NOW = AGORA ## Retorna o número de série seqüencial da data e hora atuais +SECOND = SEGUNDO ## Converte um número de série em um segundo +TIME = HORA ## Retorna o número de série de uma hora específica +TIMEVALUE = VALOR.TEMPO ## Converte um horário na forma de texto para um número de série +TODAY = HOJE ## Retorna o número de série da data de hoje +WEEKDAY = DIA.DA.SEMANA ## Converte um número de série em um dia da semana +WEEKNUM = NÚMSEMANA ## Converte um número de série em um número que representa onde a semana cai numericamente em um ano +WORKDAY = DIATRABALHO ## Retorna o número de série da data antes ou depois de um número específico de dias úteis +YEAR = ANO ## Converte um número de série em um ano +YEARFRAC = FRAÇÃOANO ## Retorna a fração do ano que representa o número de dias entre data_inicial e data_final + + +## +## Engineering functions Funções de engenharia +## +BESSELI = BESSELI ## Retorna a função de Bessel In(x) modificada +BESSELJ = BESSELJ ## Retorna a função de Bessel Jn(x) +BESSELK = BESSELK ## Retorna a função de Bessel Kn(x) modificada +BESSELY = BESSELY ## Retorna a função de Bessel Yn(x) +BIN2DEC = BIN2DEC ## Converte um número binário em decimal +BIN2HEX = BIN2HEX ## Converte um número binário em hexadecimal +BIN2OCT = BIN2OCT ## Converte um número binário em octal +COMPLEX = COMPLEX ## Converte coeficientes reais e imaginários e um número complexo +CONVERT = CONVERTER ## Converte um número de um sistema de medida para outro +DEC2BIN = DECABIN ## Converte um número decimal em binário +DEC2HEX = DECAHEX ## Converte um número decimal em hexadecimal +DEC2OCT = DECAOCT ## Converte um número decimal em octal +DELTA = DELTA ## Testa se dois valores são iguais +ERF = FUNERRO ## Retorna a função de erro +ERFC = FUNERROCOMPL ## Retorna a função de erro complementar +GESTEP = DEGRAU ## Testa se um número é maior do que um valor limite +HEX2BIN = HEXABIN ## Converte um número hexadecimal em binário +HEX2DEC = HEXADEC ## Converte um número hexadecimal em decimal +HEX2OCT = HEXAOCT ## Converte um número hexadecimal em octal +IMABS = IMABS ## Retorna o valor absoluto (módulo) de um número complexo +IMAGINARY = IMAGINÁRIO ## Retorna o coeficiente imaginário de um número complexo +IMARGUMENT = IMARG ## Retorna o argumento teta, um ângulo expresso em radianos +IMCONJUGATE = IMCONJ ## Retorna o conjugado complexo de um número complexo +IMCOS = IMCOS ## Retorna o cosseno de um número complexo +IMDIV = IMDIV ## Retorna o quociente de dois números complexos +IMEXP = IMEXP ## Retorna o exponencial de um número complexo +IMLN = IMLN ## Retorna o logaritmo natural de um número complexo +IMLOG10 = IMLOG10 ## Retorna o logaritmo de base 10 de um número complexo +IMLOG2 = IMLOG2 ## Retorna o logaritmo de base 2 de um número complexo +IMPOWER = IMPOT ## Retorna um número complexo elevado a uma potência inteira +IMPRODUCT = IMPROD ## Retorna o produto de números complexos +IMREAL = IMREAL ## Retorna o coeficiente real de um número complexo +IMSIN = IMSENO ## Retorna o seno de um número complexo +IMSQRT = IMRAIZ ## Retorna a raiz quadrada de um número complexo +IMSUB = IMSUBTR ## Retorna a diferença entre dois números complexos +IMSUM = IMSOMA ## Retorna a soma de números complexos +OCT2BIN = OCTABIN ## Converte um número octal em binário +OCT2DEC = OCTADEC ## Converte um número octal em decimal +OCT2HEX = OCTAHEX ## Converte um número octal em hexadecimal + + +## +## Financial functions Funções financeiras +## +ACCRINT = JUROSACUM ## Retorna a taxa de juros acumulados de um título que paga uma taxa periódica de juros +ACCRINTM = JUROSACUMV ## Retorna os juros acumulados de um título que paga juros no vencimento +AMORDEGRC = AMORDEGRC ## Retorna a depreciação para cada período contábil usando o coeficiente de depreciação +AMORLINC = AMORLINC ## Retorna a depreciação para cada período contábil +COUPDAYBS = CUPDIASINLIQ ## Retorna o número de dias do início do período de cupom até a data de liquidação +COUPDAYS = CUPDIAS ## Retorna o número de dias no período de cupom que contém a data de quitação +COUPDAYSNC = CUPDIASPRÓX ## Retorna o número de dias da data de liquidação até a data do próximo cupom +COUPNCD = CUPDATAPRÓX ## Retorna a próxima data de cupom após a data de quitação +COUPNUM = CUPNÚM ## Retorna o número de cupons pagáveis entre as datas de quitação e vencimento +COUPPCD = CUPDATAANT ## Retorna a data de cupom anterior à data de quitação +CUMIPMT = PGTOJURACUM ## Retorna os juros acumulados pagos entre dois períodos +CUMPRINC = PGTOCAPACUM ## Retorna o capital acumulado pago sobre um empréstimo entre dois períodos +DB = BD ## Retorna a depreciação de um ativo para um período especificado, usando o método de balanço de declínio fixo +DDB = BDD ## Retorna a depreciação de um ativo com relação a um período especificado usando o método de saldos decrescentes duplos ou qualquer outro método especificado por você +DISC = DESC ## Retorna a taxa de desconto de um título +DOLLARDE = MOEDADEC ## Converte um preço em formato de moeda, na forma fracionária, em um preço na forma decimal +DOLLARFR = MOEDAFRA ## Converte um preço, apresentado na forma decimal, em um preço apresentado na forma fracionária +DURATION = DURAÇÃO ## Retorna a duração anual de um título com pagamentos de juros periódicos +EFFECT = EFETIVA ## Retorna a taxa de juros anual efetiva +FV = VF ## Retorna o valor futuro de um investimento +FVSCHEDULE = VFPLANO ## Retorna o valor futuro de um capital inicial após a aplicação de uma série de taxas de juros compostas +INTRATE = TAXAJUROS ## Retorna a taxa de juros de um título totalmente investido +IPMT = IPGTO ## Retorna o pagamento de juros para um investimento em um determinado período +IRR = TIR ## Retorna a taxa interna de retorno de uma série de fluxos de caixa +ISPMT = ÉPGTO ## Calcula os juros pagos durante um período específico de um investimento +MDURATION = MDURAÇÃO ## Retorna a duração de Macauley modificada para um título com um valor de paridade equivalente a R$ 100 +MIRR = MTIR ## Calcula a taxa interna de retorno em que fluxos de caixa positivos e negativos são financiados com diferentes taxas +NOMINAL = NOMINAL ## Retorna a taxa de juros nominal anual +NPER = NPER ## Retorna o número de períodos de um investimento +NPV = VPL ## Retorna o valor líquido atual de um investimento com base em uma série de fluxos de caixa periódicos e em uma taxa de desconto +ODDFPRICE = PREÇOPRIMINC ## Retorna o preço por R$ 100 de valor nominal de um título com um primeiro período indefinido +ODDFYIELD = LUCROPRIMINC ## Retorna o rendimento de um título com um primeiro período indefinido +ODDLPRICE = PREÇOÚLTINC ## Retorna o preço por R$ 100 de valor nominal de um título com um último período de cupom indefinido +ODDLYIELD = LUCROÚLTINC ## Retorna o rendimento de um título com um último período indefinido +PMT = PGTO ## Retorna o pagamento periódico de uma anuidade +PPMT = PPGTO ## Retorna o pagamento de capital para determinado período de investimento +PRICE = PREÇO ## Retorna a preço por R$ 100,00 de valor nominal de um título que paga juros periódicos +PRICEDISC = PREÇODESC ## Retorna o preço por R$ 100,00 de valor nominal de um título descontado +PRICEMAT = PREÇOVENC ## Retorna o preço por R$ 100,00 de valor nominal de um título que paga juros no vencimento +PV = VP ## Retorna o valor presente de um investimento +RATE = TAXA ## Retorna a taxa de juros por período de uma anuidade +RECEIVED = RECEBER ## Retorna a quantia recebida no vencimento de um título totalmente investido +SLN = DPD ## Retorna a depreciação em linha reta de um ativo durante um período +SYD = SDA ## Retorna a depreciação dos dígitos da soma dos anos de um ativo para um período especificado +TBILLEQ = OTN ## Retorna o rendimento de um título equivalente a uma obrigação do Tesouro +TBILLPRICE = OTNVALOR ## Retorna o preço por R$ 100,00 de valor nominal de uma obrigação do Tesouro +TBILLYIELD = OTNLUCRO ## Retorna o rendimento de uma obrigação do Tesouro +VDB = BDV ## Retorna a depreciação de um ativo para um período especificado ou parcial usando um método de balanço declinante +XIRR = XTIR ## Fornece a taxa interna de retorno para um programa de fluxos de caixa que não é necessariamente periódico +XNPV = XVPL ## Retorna o valor presente líquido de um programa de fluxos de caixa que não é necessariamente periódico +YIELD = LUCRO ## Retorna o lucro de um título que paga juros periódicos +YIELDDISC = LUCRODESC ## Retorna o rendimento anual de um título descontado. Por exemplo, uma obrigação do Tesouro +YIELDMAT = LUCROVENC ## Retorna o lucro anual de um título que paga juros no vencimento + + +## +## Information functions Funções de informação +## +CELL = CÉL ## Retorna informações sobre formatação, localização ou conteúdo de uma célula +ERROR.TYPE = TIPO.ERRO ## Retorna um número correspondente a um tipo de erro +INFO = INFORMAÇÃO ## Retorna informações sobre o ambiente operacional atual +ISBLANK = ÉCÉL.VAZIA ## Retorna VERDADEIRO se o valor for vazio +ISERR = ÉERRO ## Retorna VERDADEIRO se o valor for um valor de erro diferente de #N/D +ISERROR = ÉERROS ## Retorna VERDADEIRO se o valor for um valor de erro +ISEVEN = ÉPAR ## Retorna VERDADEIRO se o número for par +ISLOGICAL = ÉLÓGICO ## Retorna VERDADEIRO se o valor for um valor lógico +ISNA = É.NÃO.DISP ## Retorna VERDADEIRO se o valor for o valor de erro #N/D +ISNONTEXT = É.NÃO.TEXTO ## Retorna VERDADEIRO se o valor for diferente de texto +ISNUMBER = ÉNÚM ## Retorna VERDADEIRO se o valor for um número +ISODD = ÉIMPAR ## Retorna VERDADEIRO se o número for ímpar +ISREF = ÉREF ## Retorna VERDADEIRO se o valor for uma referência +ISTEXT = ÉTEXTO ## Retorna VERDADEIRO se o valor for texto +N = N ## Retorna um valor convertido em um número +NA = NÃO.DISP ## Retorna o valor de erro #N/D +TYPE = TIPO ## Retorna um número indicando o tipo de dados de um valor + + +## +## Logical functions Funções lógicas +## +AND = E ## Retorna VERDADEIRO se todos os seus argumentos forem VERDADEIROS +FALSE = FALSO ## Retorna o valor lógico FALSO +IF = SE ## Especifica um teste lógico a ser executado +IFERROR = SEERRO ## Retornará um valor que você especifica se uma fórmula for avaliada para um erro; do contrário, retornará o resultado da fórmula +NOT = NÃO ## Inverte o valor lógico do argumento +OR = OU ## Retorna VERDADEIRO se um dos argumentos for VERDADEIRO +TRUE = VERDADEIRO ## Retorna o valor lógico VERDADEIRO + + +## +## Lookup and reference functions Funções de pesquisa e referência +## +ADDRESS = ENDEREÇO ## Retorna uma referência como texto para uma única célula em uma planilha +AREAS = ÁREAS ## Retorna o número de áreas em uma referência +CHOOSE = ESCOLHER ## Escolhe um valor a partir de uma lista de valores +COLUMN = COL ## Retorna o número da coluna de uma referência +COLUMNS = COLS ## Retorna o número de colunas em uma referência +HLOOKUP = PROCH ## Procura na linha superior de uma matriz e retorna o valor da célula especificada +HYPERLINK = HYPERLINK ## Cria um atalho ou salto que abre um documento armazenado em um servidor de rede, uma intranet ou na Internet +INDEX = ÍNDICE ## Usa um índice para escolher um valor de uma referência ou matriz +INDIRECT = INDIRETO ## Retorna uma referência indicada por um valor de texto +LOOKUP = PROC ## Procura valores em um vetor ou em uma matriz +MATCH = CORRESP ## Procura valores em uma referência ou em uma matriz +OFFSET = DESLOC ## Retorna um deslocamento de referência com base em uma determinada referência +ROW = LIN ## Retorna o número da linha de uma referência +ROWS = LINS ## Retorna o número de linhas em uma referência +RTD = RTD ## Recupera dados em tempo real de um programa que ofereça suporte a automação COM (automação: uma forma de trabalhar com objetos de um aplicativo a partir de outro aplicativo ou ferramenta de desenvolvimento. Chamada inicialmente de automação OLE, a automação é um padrão industrial e um recurso do modelo de objeto componente (COM).) +TRANSPOSE = TRANSPOR ## Retorna a transposição de uma matriz +VLOOKUP = PROCV ## Procura na primeira coluna de uma matriz e move ao longo da linha para retornar o valor de uma célula + + +## +## Math and trigonometry functions Funções matemáticas e trigonométricas +## +ABS = ABS ## Retorna o valor absoluto de um número +ACOS = ACOS ## Retorna o arco cosseno de um número +ACOSH = ACOSH ## Retorna o cosseno hiperbólico inverso de um número +ASIN = ASEN ## Retorna o arco seno de um número +ASINH = ASENH ## Retorna o seno hiperbólico inverso de um número +ATAN = ATAN ## Retorna o arco tangente de um número +ATAN2 = ATAN2 ## Retorna o arco tangente das coordenadas x e y especificadas +ATANH = ATANH ## Retorna a tangente hiperbólica inversa de um número +CEILING = TETO ## Arredonda um número para o inteiro mais próximo ou para o múltiplo mais próximo de significância +COMBIN = COMBIN ## Retorna o número de combinações de um determinado número de objetos +COS = COS ## Retorna o cosseno de um número +COSH = COSH ## Retorna o cosseno hiperbólico de um número +DEGREES = GRAUS ## Converte radianos em graus +EVEN = PAR ## Arredonda um número para cima até o inteiro par mais próximo +EXP = EXP ## Retorna e elevado à potência de um número especificado +FACT = FATORIAL ## Retorna o fatorial de um número +FACTDOUBLE = FATDUPLO ## Retorna o fatorial duplo de um número +FLOOR = ARREDMULTB ## Arredonda um número para baixo até zero +GCD = MDC ## Retorna o máximo divisor comum +INT = INT ## Arredonda um número para baixo até o número inteiro mais próximo +LCM = MMC ## Retorna o mínimo múltiplo comum +LN = LN ## Retorna o logaritmo natural de um número +LOG = LOG ## Retorna o logaritmo de um número de uma base especificada +LOG10 = LOG10 ## Retorna o logaritmo de base 10 de um número +MDETERM = MATRIZ.DETERM ## Retorna o determinante de uma matriz de uma variável do tipo matriz +MINVERSE = MATRIZ.INVERSO ## Retorna a matriz inversa de uma matriz +MMULT = MATRIZ.MULT ## Retorna o produto de duas matrizes +MOD = RESTO ## Retorna o resto da divisão +MROUND = MARRED ## Retorna um número arredondado ao múltiplo desejado +MULTINOMIAL = MULTINOMIAL ## Retorna o multinomial de um conjunto de números +ODD = ÍMPAR ## Arredonda um número para cima até o inteiro ímpar mais próximo +PI = PI ## Retorna o valor de Pi +POWER = POTÊNCIA ## Fornece o resultado de um número elevado a uma potência +PRODUCT = MULT ## Multiplica seus argumentos +QUOTIENT = QUOCIENTE ## Retorna a parte inteira de uma divisão +RADIANS = RADIANOS ## Converte graus em radianos +RAND = ALEATÓRIO ## Retorna um número aleatório entre 0 e 1 +RANDBETWEEN = ALEATÓRIOENTRE ## Retorna um número aleatório entre os números especificados +ROMAN = ROMANO ## Converte um algarismo arábico em romano, como texto +ROUND = ARRED ## Arredonda um número até uma quantidade especificada de dígitos +ROUNDDOWN = ARREDONDAR.PARA.BAIXO ## Arredonda um número para baixo até zero +ROUNDUP = ARREDONDAR.PARA.CIMA ## Arredonda um número para cima, afastando-o de zero +SERIESSUM = SOMASEQÜÊNCIA ## Retorna a soma de uma série polinomial baseada na fórmula +SIGN = SINAL ## Retorna o sinal de um número +SIN = SEN ## Retorna o seno de um ângulo dado +SINH = SENH ## Retorna o seno hiperbólico de um número +SQRT = RAIZ ## Retorna uma raiz quadrada positiva +SQRTPI = RAIZPI ## Retorna a raiz quadrada de (núm* pi) +SUBTOTAL = SUBTOTAL ## Retorna um subtotal em uma lista ou em um banco de dados +SUM = SOMA ## Soma seus argumentos +SUMIF = SOMASE ## Adiciona as células especificadas por um determinado critério +SUMIFS = SOMASE ## Adiciona as células em um intervalo que atende a vários critérios +SUMPRODUCT = SOMARPRODUTO ## Retorna a soma dos produtos de componentes correspondentes de matrizes +SUMSQ = SOMAQUAD ## Retorna a soma dos quadrados dos argumentos +SUMX2MY2 = SOMAX2DY2 ## Retorna a soma da diferença dos quadrados dos valores correspondentes em duas matrizes +SUMX2PY2 = SOMAX2SY2 ## Retorna a soma da soma dos quadrados dos valores correspondentes em duas matrizes +SUMXMY2 = SOMAXMY2 ## Retorna a soma dos quadrados das diferenças dos valores correspondentes em duas matrizes +TAN = TAN ## Retorna a tangente de um número +TANH = TANH ## Retorna a tangente hiperbólica de um número +TRUNC = TRUNCAR ## Trunca um número para um inteiro + + +## +## Statistical functions Funções estatísticas +## +AVEDEV = DESV.MÉDIO ## Retorna a média aritmética dos desvios médios dos pontos de dados a partir de sua média +AVERAGE = MÉDIA ## Retorna a média dos argumentos +AVERAGEA = MÉDIAA ## Retorna a média dos argumentos, inclusive números, texto e valores lógicos +AVERAGEIF = MÉDIASE ## Retorna a média (média aritmética) de todas as células em um intervalo que atendem a um determinado critério +AVERAGEIFS = MÉDIASES ## Retorna a média (média aritmética) de todas as células que atendem a múltiplos critérios. +BETADIST = DISTBETA ## Retorna a função de distribuição cumulativa beta +BETAINV = BETA.ACUM.INV ## Retorna o inverso da função de distribuição cumulativa para uma distribuição beta especificada +BINOMDIST = DISTRBINOM ## Retorna a probabilidade de distribuição binomial do termo individual +CHIDIST = DIST.QUI ## Retorna a probabilidade unicaudal da distribuição qui-quadrada +CHIINV = INV.QUI ## Retorna o inverso da probabilidade uni-caudal da distribuição qui-quadrada +CHITEST = TESTE.QUI ## Retorna o teste para independência +CONFIDENCE = INT.CONFIANÇA ## Retorna o intervalo de confiança para uma média da população +CORREL = CORREL ## Retorna o coeficiente de correlação entre dois conjuntos de dados +COUNT = CONT.NÚM ## Calcula quantos números há na lista de argumentos +COUNTA = CONT.VALORES ## Calcula quantos valores há na lista de argumentos +COUNTBLANK = CONTAR.VAZIO ## Conta o número de células vazias no intervalo especificado +COUNTIF = CONT.SE ## Calcula o número de células não vazias em um intervalo que corresponde a determinados critérios +COUNTIFS = CONT.SES ## Conta o número de células dentro de um intervalo que atende a múltiplos critérios +COVAR = COVAR ## Retorna a covariância, a média dos produtos dos desvios pares +CRITBINOM = CRIT.BINOM ## Retorna o menor valor para o qual a distribuição binomial cumulativa é menor ou igual ao valor padrão +DEVSQ = DESVQ ## Retorna a soma dos quadrados dos desvios +EXPONDIST = DISTEXPON ## Retorna a distribuição exponencial +FDIST = DISTF ## Retorna a distribuição de probabilidade F +FINV = INVF ## Retorna o inverso da distribuição de probabilidades F +FISHER = FISHER ## Retorna a transformação Fisher +FISHERINV = FISHERINV ## Retorna o inverso da transformação Fisher +FORECAST = PREVISÃO ## Retorna um valor ao longo de uma linha reta +FREQUENCY = FREQÜÊNCIA ## Retorna uma distribuição de freqüência como uma matriz vertical +FTEST = TESTEF ## Retorna o resultado de um teste F +GAMMADIST = DISTGAMA ## Retorna a distribuição gama +GAMMAINV = INVGAMA ## Retorna o inverso da distribuição cumulativa gama +GAMMALN = LNGAMA ## Retorna o logaritmo natural da função gama, G(x) +GEOMEAN = MÉDIA.GEOMÉTRICA ## Retorna a média geométrica +GROWTH = CRESCIMENTO ## Retorna valores ao longo de uma tendência exponencial +HARMEAN = MÉDIA.HARMÔNICA ## Retorna a média harmônica +HYPGEOMDIST = DIST.HIPERGEOM ## Retorna a distribuição hipergeométrica +INTERCEPT = INTERCEPÇÃO ## Retorna a intercepção da linha de regressão linear +KURT = CURT ## Retorna a curtose de um conjunto de dados +LARGE = MAIOR ## Retorna o maior valor k-ésimo de um conjunto de dados +LINEST = PROJ.LIN ## Retorna os parâmetros de uma tendência linear +LOGEST = PROJ.LOG ## Retorna os parâmetros de uma tendência exponencial +LOGINV = INVLOG ## Retorna o inverso da distribuição lognormal +LOGNORMDIST = DIST.LOGNORMAL ## Retorna a distribuição lognormal cumulativa +MAX = MÁXIMO ## Retorna o valor máximo em uma lista de argumentos +MAXA = MÁXIMOA ## Retorna o maior valor em uma lista de argumentos, inclusive números, texto e valores lógicos +MEDIAN = MED ## Retorna a mediana dos números indicados +MIN = MÍNIMO ## Retorna o valor mínimo em uma lista de argumentos +MINA = MÍNIMOA ## Retorna o menor valor em uma lista de argumentos, inclusive números, texto e valores lógicos +MODE = MODO ## Retorna o valor mais comum em um conjunto de dados +NEGBINOMDIST = DIST.BIN.NEG ## Retorna a distribuição binomial negativa +NORMDIST = DIST.NORM ## Retorna a distribuição cumulativa normal +NORMINV = INV.NORM ## Retorna o inverso da distribuição cumulativa normal +NORMSDIST = DIST.NORMP ## Retorna a distribuição cumulativa normal padrão +NORMSINV = INV.NORMP ## Retorna o inverso da distribuição cumulativa normal padrão +PEARSON = PEARSON ## Retorna o coeficiente de correlação do momento do produto Pearson +PERCENTILE = PERCENTIL ## Retorna o k-ésimo percentil de valores em um intervalo +PERCENTRANK = ORDEM.PORCENTUAL ## Retorna a ordem percentual de um valor em um conjunto de dados +PERMUT = PERMUT ## Retorna o número de permutações de um determinado número de objetos +POISSON = POISSON ## Retorna a distribuição Poisson +PROB = PROB ## Retorna a probabilidade de valores em um intervalo estarem entre dois limites +QUARTILE = QUARTIL ## Retorna o quartil do conjunto de dados +RANK = ORDEM ## Retorna a posição de um número em uma lista de números +RSQ = RQUAD ## Retorna o quadrado do coeficiente de correlação do momento do produto de Pearson +SKEW = DISTORÇÃO ## Retorna a distorção de uma distribuição +SLOPE = INCLINAÇÃO ## Retorna a inclinação da linha de regressão linear +SMALL = MENOR ## Retorna o menor valor k-ésimo do conjunto de dados +STANDARDIZE = PADRONIZAR ## Retorna um valor normalizado +STDEV = DESVPAD ## Estima o desvio padrão com base em uma amostra +STDEVA = DESVPADA ## Estima o desvio padrão com base em uma amostra, inclusive números, texto e valores lógicos +STDEVP = DESVPADP ## Calcula o desvio padrão com base na população total +STDEVPA = DESVPADPA ## Calcula o desvio padrão com base na população total, inclusive números, texto e valores lógicos +STEYX = EPADYX ## Retorna o erro padrão do valor-y previsto para cada x da regressão +TDIST = DISTT ## Retorna a distribuição t de Student +TINV = INVT ## Retorna o inverso da distribuição t de Student +TREND = TENDÊNCIA ## Retorna valores ao longo de uma tendência linear +TRIMMEAN = MÉDIA.INTERNA ## Retorna a média do interior de um conjunto de dados +TTEST = TESTET ## Retorna a probabilidade associada ao teste t de Student +VAR = VAR ## Estima a variância com base em uma amostra +VARA = VARA ## Estima a variância com base em uma amostra, inclusive números, texto e valores lógicos +VARP = VARP ## Calcula a variância com base na população inteira +VARPA = VARPA ## Calcula a variância com base na população total, inclusive números, texto e valores lógicos +WEIBULL = WEIBULL ## Retorna a distribuição Weibull +ZTEST = TESTEZ ## Retorna o valor de probabilidade uni-caudal de um teste-z + + +## +## Text functions Funções de texto +## +ASC = ASC ## Altera letras do inglês ou katakana de largura total (bytes duplos) dentro de uma seqüência de caracteres para caracteres de meia largura (byte único) +BAHTTEXT = BAHTTEXT ## Converte um número em um texto, usando o formato de moeda ß (baht) +CHAR = CARACT ## Retorna o caractere especificado pelo número de código +CLEAN = TIRAR ## Remove todos os caracteres do texto que não podem ser impressos +CODE = CÓDIGO ## Retorna um código numérico para o primeiro caractere de uma seqüência de caracteres de texto +CONCATENATE = CONCATENAR ## Agrupa vários itens de texto em um único item de texto +DOLLAR = MOEDA ## Converte um número em texto, usando o formato de moeda $ (dólar) +EXACT = EXATO ## Verifica se dois valores de texto são idênticos +FIND = PROCURAR ## Procura um valor de texto dentro de outro (diferencia maiúsculas de minúsculas) +FINDB = PROCURARB ## Procura um valor de texto dentro de outro (diferencia maiúsculas de minúsculas) +FIXED = DEF.NÚM.DEC ## Formata um número como texto com um número fixo de decimais +JIS = JIS ## Altera letras do inglês ou katakana de meia largura (byte único) dentro de uma seqüência de caracteres para caracteres de largura total (bytes duplos) +LEFT = ESQUERDA ## Retorna os caracteres mais à esquerda de um valor de texto +LEFTB = ESQUERDAB ## Retorna os caracteres mais à esquerda de um valor de texto +LEN = NÚM.CARACT ## Retorna o número de caracteres em uma seqüência de texto +LENB = NÚM.CARACTB ## Retorna o número de caracteres em uma seqüência de texto +LOWER = MINÚSCULA ## Converte texto para minúsculas +MID = EXT.TEXTO ## Retorna um número específico de caracteres de uma seqüência de texto começando na posição especificada +MIDB = EXT.TEXTOB ## Retorna um número específico de caracteres de uma seqüência de texto começando na posição especificada +PHONETIC = FONÉTICA ## Extrai os caracteres fonéticos (furigana) de uma seqüência de caracteres de texto +PROPER = PRI.MAIÚSCULA ## Coloca a primeira letra de cada palavra em maiúscula em um valor de texto +REPLACE = MUDAR ## Muda os caracteres dentro do texto +REPLACEB = MUDARB ## Muda os caracteres dentro do texto +REPT = REPT ## Repete o texto um determinado número de vezes +RIGHT = DIREITA ## Retorna os caracteres mais à direita de um valor de texto +RIGHTB = DIREITAB ## Retorna os caracteres mais à direita de um valor de texto +SEARCH = LOCALIZAR ## Localiza um valor de texto dentro de outro (não diferencia maiúsculas de minúsculas) +SEARCHB = LOCALIZARB ## Localiza um valor de texto dentro de outro (não diferencia maiúsculas de minúsculas) +SUBSTITUTE = SUBSTITUIR ## Substitui um novo texto por um texto antigo em uma seqüência de texto +T = T ## Converte os argumentos em texto +TEXT = TEXTO ## Formata um número e o converte em texto +TRIM = ARRUMAR ## Remove espaços do texto +UPPER = MAIÚSCULA ## Converte o texto em maiúsculas +VALUE = VALOR ## Converte um argumento de texto em um número diff --git a/extend/PHPExcel/PHPExcel/locale/pt/config b/extend/PHPExcel/PHPExcel/locale/pt/config new file mode 100644 index 0000000..8bb8d8b --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/pt/config @@ -0,0 +1,47 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = € + + +## +## Excel Error Codes (For future use) +## +NULL = #NULO! +DIV0 = #DIV/0! +VALUE = #VALOR! +REF = #REF! +NAME = #NOME? +NUM = #NÚM! +NA = #N/D diff --git a/extend/PHPExcel/PHPExcel/locale/pt/functions b/extend/PHPExcel/PHPExcel/locale/pt/functions new file mode 100644 index 0000000..ba4eb47 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/pt/functions @@ -0,0 +1,408 @@ +## +## Add-in and Automation functions Funções de Suplemento e Automatização +## +GETPIVOTDATA = OBTERDADOSDIN ## Devolve dados armazenados num relatório de Tabela Dinâmica + + +## +## Cube functions Funções de cubo +## +CUBEKPIMEMBER = MEMBROKPICUBO ## Devolve o nome, propriedade e medição de um KPI (key performance indicator) e apresenta o nome e a propriedade na célula. Um KPI é uma medida quantificável, como, por exemplo, o lucro mensal bruto ou a rotatividade trimestral de pessoal, utilizada para monitorizar o desempenho de uma organização. +CUBEMEMBER = MEMBROCUBO ## Devolve um membro ou cadeia de identificação numa hierarquia de cubo. Utilizada para validar a existência do membro ou cadeia de identificação no cubo. +CUBEMEMBERPROPERTY = PROPRIEDADEMEMBROCUBO ## Devolve o valor de uma propriedade de membro no cubo. Utilizada para validar a existência de um nome de membro no cubo e para devolver a propriedade especificada para esse membro. +CUBERANKEDMEMBER = MEMBROCLASSIFICADOCUBO ## Devolve o enésimo ou a classificação mais alta num conjunto. Utilizada para devolver um ou mais elementos num conjunto, tal como o melhor vendedor ou os 10 melhores alunos. +CUBESET = CONJUNTOCUBO ## Define um conjunto calculado de membros ou cadeias de identificação enviando uma expressão de conjunto para o cubo no servidor, que cria o conjunto e, em seguida, devolve o conjunto ao Microsoft Office Excel. +CUBESETCOUNT = CONTARCONJUNTOCUBO ## Devolve o número de itens num conjunto. +CUBEVALUE = VALORCUBO ## Devolve um valor agregado do cubo. + + +## +## Database functions Funções de base de dados +## +DAVERAGE = BDMÉDIA ## Devolve a média das entradas da base de dados seleccionadas +DCOUNT = BDCONTAR ## Conta as células que contêm números numa base de dados +DCOUNTA = BDCONTAR.VAL ## Conta as células que não estejam em branco numa base de dados +DGET = BDOBTER ## Extrai de uma base de dados um único registo que corresponde aos critérios especificados +DMAX = BDMÁX ## Devolve o valor máximo das entradas da base de dados seleccionadas +DMIN = BDMÍN ## Devolve o valor mínimo das entradas da base de dados seleccionadas +DPRODUCT = BDMULTIPL ## Multiplica os valores de um determinado campo de registos que correspondem aos critérios numa base de dados +DSTDEV = BDDESVPAD ## Calcula o desvio-padrão com base numa amostra de entradas da base de dados seleccionadas +DSTDEVP = BDDESVPADP ## Calcula o desvio-padrão com base na população total das entradas da base de dados seleccionadas +DSUM = BDSOMA ## Adiciona os números na coluna de campo dos registos de base de dados que correspondem aos critérios +DVAR = BDVAR ## Calcula a variância com base numa amostra das entradas de base de dados seleccionadas +DVARP = BDVARP ## Calcula a variância com base na população total das entradas de base de dados seleccionadas + + +## +## Date and time functions Funções de data e hora +## +DATE = DATA ## Devolve o número de série de uma determinada data +DATEVALUE = DATA.VALOR ## Converte uma data em forma de texto num número de série +DAY = DIA ## Converte um número de série num dia do mês +DAYS360 = DIAS360 ## Calcula o número de dias entre duas datas com base num ano com 360 dias +EDATE = DATAM ## Devolve um número de série de data que corresponde ao número de meses indicado antes ou depois da data de início +EOMONTH = FIMMÊS ## Devolve o número de série do último dia do mês antes ou depois de um número de meses especificado +HOUR = HORA ## Converte um número de série numa hora +MINUTE = MINUTO ## Converte um número de série num minuto +MONTH = MÊS ## Converte um número de série num mês +NETWORKDAYS = DIATRABALHOTOTAL ## Devolve o número total de dias úteis entre duas datas +NOW = AGORA ## Devolve o número de série da data e hora actuais +SECOND = SEGUNDO ## Converte um número de série num segundo +TIME = TEMPO ## Devolve o número de série de um determinado tempo +TIMEVALUE = VALOR.TEMPO ## Converte um tempo em forma de texto num número de série +TODAY = HOJE ## Devolve o número de série da data actual +WEEKDAY = DIA.SEMANA ## Converte um número de série num dia da semana +WEEKNUM = NÚMSEMANA ## Converte um número de série num número que representa o número da semana num determinado ano +WORKDAY = DIA.TRABALHO ## Devolve o número de série da data antes ou depois de um número de dias úteis especificado +YEAR = ANO ## Converte um número de série num ano +YEARFRAC = FRACÇÃOANO ## Devolve a fracção de ano que representa o número de dias inteiros entre a data_de_início e a data_de_fim + + +## +## Engineering functions Funções de engenharia +## +BESSELI = BESSELI ## Devolve a função de Bessel modificada In(x) +BESSELJ = BESSELJ ## Devolve a função de Bessel Jn(x) +BESSELK = BESSELK ## Devolve a função de Bessel modificada Kn(x) +BESSELY = BESSELY ## Devolve a função de Bessel Yn(x) +BIN2DEC = BINADEC ## Converte um número binário em decimal +BIN2HEX = BINAHEX ## Converte um número binário em hexadecimal +BIN2OCT = BINAOCT ## Converte um número binário em octal +COMPLEX = COMPLEXO ## Converte coeficientes reais e imaginários num número complexo +CONVERT = CONVERTER ## Converte um número de um sistema de medida noutro +DEC2BIN = DECABIN ## Converte um número decimal em binário +DEC2HEX = DECAHEX ## Converte um número decimal em hexadecimal +DEC2OCT = DECAOCT ## Converte um número decimal em octal +DELTA = DELTA ## Testa se dois valores são iguais +ERF = FUNCERRO ## Devolve a função de erro +ERFC = FUNCERROCOMPL ## Devolve a função de erro complementar +GESTEP = DEGRAU ## Testa se um número é maior do que um valor limite +HEX2BIN = HEXABIN ## Converte um número hexadecimal em binário +HEX2DEC = HEXADEC ## Converte um número hexadecimal em decimal +HEX2OCT = HEXAOCT ## Converte um número hexadecimal em octal +IMABS = IMABS ## Devolve o valor absoluto (módulo) de um número complexo +IMAGINARY = IMAGINÁRIO ## Devolve o coeficiente imaginário de um número complexo +IMARGUMENT = IMARG ## Devolve o argumento Teta, um ângulo expresso em radianos +IMCONJUGATE = IMCONJ ## Devolve o conjugado complexo de um número complexo +IMCOS = IMCOS ## Devolve o co-seno de um número complexo +IMDIV = IMDIV ## Devolve o quociente de dois números complexos +IMEXP = IMEXP ## Devolve o exponencial de um número complexo +IMLN = IMLN ## Devolve o logaritmo natural de um número complexo +IMLOG10 = IMLOG10 ## Devolve o logaritmo de base 10 de um número complexo +IMLOG2 = IMLOG2 ## Devolve o logaritmo de base 2 de um número complexo +IMPOWER = IMPOT ## Devolve um número complexo elevado a uma potência inteira +IMPRODUCT = IMPROD ## Devolve o produto de números complexos +IMREAL = IMREAL ## Devolve o coeficiente real de um número complexo +IMSIN = IMSENO ## Devolve o seno de um número complexo +IMSQRT = IMRAIZ ## Devolve a raiz quadrada de um número complexo +IMSUB = IMSUBTR ## Devolve a diferença entre dois números complexos +IMSUM = IMSOMA ## Devolve a soma de números complexos +OCT2BIN = OCTABIN ## Converte um número octal em binário +OCT2DEC = OCTADEC ## Converte um número octal em decimal +OCT2HEX = OCTAHEX ## Converte um número octal em hexadecimal + + +## +## Financial functions Funções financeiras +## +ACCRINT = JUROSACUM ## Devolve os juros acumulados de um título que paga juros periódicos +ACCRINTM = JUROSACUMV ## Devolve os juros acumulados de um título que paga juros no vencimento +AMORDEGRC = AMORDEGRC ## Devolve a depreciação correspondente a cada período contabilístico utilizando um coeficiente de depreciação +AMORLINC = AMORLINC ## Devolve a depreciação correspondente a cada período contabilístico +COUPDAYBS = CUPDIASINLIQ ## Devolve o número de dias entre o início do período do cupão e a data de regularização +COUPDAYS = CUPDIAS ## Devolve o número de dias no período do cupão que contém a data de regularização +COUPDAYSNC = CUPDIASPRÓX ## Devolve o número de dias entre a data de regularização e a data do cupão seguinte +COUPNCD = CUPDATAPRÓX ## Devolve a data do cupão seguinte após a data de regularização +COUPNUM = CUPNÚM ## Devolve o número de cupões a serem pagos entre a data de regularização e a data de vencimento +COUPPCD = CUPDATAANT ## Devolve a data do cupão anterior antes da data de regularização +CUMIPMT = PGTOJURACUM ## Devolve os juros cumulativos pagos entre dois períodos +CUMPRINC = PGTOCAPACUM ## Devolve o capital cumulativo pago a título de empréstimo entre dois períodos +DB = BD ## Devolve a depreciação de um activo relativo a um período especificado utilizando o método das quotas degressivas fixas +DDB = BDD ## Devolve a depreciação de um activo relativo a um período especificado utilizando o método das quotas degressivas duplas ou qualquer outro método especificado +DISC = DESC ## Devolve a taxa de desconto de um título +DOLLARDE = MOEDADEC ## Converte um preço em unidade monetária, expresso como uma fracção, num preço em unidade monetária, expresso como um número decimal +DOLLARFR = MOEDAFRA ## Converte um preço em unidade monetária, expresso como um número decimal, num preço em unidade monetária, expresso como uma fracção +DURATION = DURAÇÃO ## Devolve a duração anual de um título com pagamentos de juros periódicos +EFFECT = EFECTIVA ## Devolve a taxa de juros anual efectiva +FV = VF ## Devolve o valor futuro de um investimento +FVSCHEDULE = VFPLANO ## Devolve o valor futuro de um capital inicial após a aplicação de uma série de taxas de juro compostas +INTRATE = TAXAJUROS ## Devolve a taxa de juros de um título investido na totalidade +IPMT = IPGTO ## Devolve o pagamento dos juros de um investimento durante um determinado período +IRR = TIR ## Devolve a taxa de rentabilidade interna para uma série de fluxos monetários +ISPMT = É.PGTO ## Calcula os juros pagos durante um período específico de um investimento +MDURATION = MDURAÇÃO ## Devolve a duração modificada de Macauley de um título com um valor de paridade equivalente a € 100 +MIRR = MTIR ## Devolve a taxa interna de rentabilidade em que os fluxos monetários positivos e negativos são financiados com taxas diferentes +NOMINAL = NOMINAL ## Devolve a taxa de juros nominal anual +NPER = NPER ## Devolve o número de períodos de um investimento +NPV = VAL ## Devolve o valor actual líquido de um investimento com base numa série de fluxos monetários periódicos e numa taxa de desconto +ODDFPRICE = PREÇOPRIMINC ## Devolve o preço por € 100 do valor nominal de um título com um período inicial incompleto +ODDFYIELD = LUCROPRIMINC ## Devolve o lucro de um título com um período inicial incompleto +ODDLPRICE = PREÇOÚLTINC ## Devolve o preço por € 100 do valor nominal de um título com um período final incompleto +ODDLYIELD = LUCROÚLTINC ## Devolve o lucro de um título com um período final incompleto +PMT = PGTO ## Devolve o pagamento periódico de uma anuidade +PPMT = PPGTO ## Devolve o pagamento sobre o capital de um investimento num determinado período +PRICE = PREÇO ## Devolve o preço por € 100 do valor nominal de um título que paga juros periódicos +PRICEDISC = PREÇODESC ## Devolve o preço por € 100 do valor nominal de um título descontado +PRICEMAT = PREÇOVENC ## Devolve o preço por € 100 do valor nominal de um título que paga juros no vencimento +PV = VA ## Devolve o valor actual de um investimento +RATE = TAXA ## Devolve a taxa de juros por período de uma anuidade +RECEIVED = RECEBER ## Devolve o montante recebido no vencimento de um título investido na totalidade +SLN = AMORT ## Devolve uma depreciação linear de um activo durante um período +SYD = AMORTD ## Devolve a depreciação por algarismos da soma dos anos de um activo durante um período especificado +TBILLEQ = OTN ## Devolve o lucro de um título equivalente a uma Obrigação do Tesouro +TBILLPRICE = OTNVALOR ## Devolve o preço por € 100 de valor nominal de uma Obrigação do Tesouro +TBILLYIELD = OTNLUCRO ## Devolve o lucro de uma Obrigação do Tesouro +VDB = BDV ## Devolve a depreciação de um activo relativo a um período específico ou parcial utilizando um método de quotas degressivas +XIRR = XTIR ## Devolve a taxa interna de rentabilidade de um plano de fluxos monetários que não seja necessariamente periódica +XNPV = XVAL ## Devolve o valor actual líquido de um plano de fluxos monetários que não seja necessariamente periódico +YIELD = LUCRO ## Devolve o lucro de um título que paga juros periódicos +YIELDDISC = LUCRODESC ## Devolve o lucro anual de um título emitido abaixo do valor nominal, por exemplo, uma Obrigação do Tesouro +YIELDMAT = LUCROVENC ## Devolve o lucro anual de um título que paga juros na data de vencimento + + +## +## Information functions Funções de informação +## +CELL = CÉL ## Devolve informações sobre a formatação, localização ou conteúdo de uma célula +ERROR.TYPE = TIPO.ERRO ## Devolve um número correspondente a um tipo de erro +INFO = INFORMAÇÃO ## Devolve informações sobre o ambiente de funcionamento actual +ISBLANK = É.CÉL.VAZIA ## Devolve VERDADEIRO se o valor estiver em branco +ISERR = É.ERROS ## Devolve VERDADEIRO se o valor for um valor de erro diferente de #N/D +ISERROR = É.ERRO ## Devolve VERDADEIRO se o valor for um valor de erro +ISEVEN = ÉPAR ## Devolve VERDADEIRO se o número for par +ISLOGICAL = É.LÓGICO ## Devolve VERDADEIRO se o valor for lógico +ISNA = É.NÃO.DISP ## Devolve VERDADEIRO se o valor for o valor de erro #N/D +ISNONTEXT = É.NÃO.TEXTO ## Devolve VERDADEIRO se o valor não for texto +ISNUMBER = É.NÚM ## Devolve VERDADEIRO se o valor for um número +ISODD = ÉÍMPAR ## Devolve VERDADEIRO se o número for ímpar +ISREF = É.REF ## Devolve VERDADEIRO se o valor for uma referência +ISTEXT = É.TEXTO ## Devolve VERDADEIRO se o valor for texto +N = N ## Devolve um valor convertido num número +NA = NÃO.DISP ## Devolve o valor de erro #N/D +TYPE = TIPO ## Devolve um número que indica o tipo de dados de um valor + + +## +## Logical functions Funções lógicas +## +AND = E ## Devolve VERDADEIRO se todos os respectivos argumentos corresponderem a VERDADEIRO +FALSE = FALSO ## Devolve o valor lógico FALSO +IF = SE ## Especifica um teste lógico a ser executado +IFERROR = SE.ERRO ## Devolve um valor definido pelo utilizador se ocorrer um erro na fórmula, e devolve o resultado da fórmula se não ocorrer nenhum erro +NOT = NÃO ## Inverte a lógica do respectivo argumento +OR = OU ## Devolve VERDADEIRO se qualquer argumento for VERDADEIRO +TRUE = VERDADEIRO ## Devolve o valor lógico VERDADEIRO + + +## +## Lookup and reference functions Funções de pesquisa e referência +## +ADDRESS = ENDEREÇO ## Devolve uma referência a uma única célula numa folha de cálculo como texto +AREAS = ÁREAS ## Devolve o número de áreas numa referência +CHOOSE = SELECCIONAR ## Selecciona um valor a partir de uma lista de valores +COLUMN = COL ## Devolve o número da coluna de uma referência +COLUMNS = COLS ## Devolve o número de colunas numa referência +HLOOKUP = PROCH ## Procura na linha superior de uma matriz e devolve o valor da célula indicada +HYPERLINK = HIPERLIGAÇÃO ## Cria um atalho ou hiperligação que abre um documento armazenado num servidor de rede, numa intranet ou na Internet +INDEX = ÍNDICE ## Utiliza um índice para escolher um valor de uma referência ou de uma matriz +INDIRECT = INDIRECTO ## Devolve uma referência indicada por um valor de texto +LOOKUP = PROC ## Procura valores num vector ou numa matriz +MATCH = CORRESP ## Procura valores numa referência ou numa matriz +OFFSET = DESLOCAMENTO ## Devolve o deslocamento de referência de uma determinada referência +ROW = LIN ## Devolve o número da linha de uma referência +ROWS = LINS ## Devolve o número de linhas numa referência +RTD = RTD ## Obtém dados em tempo real a partir de um programa que suporte automatização COM (automatização: modo de trabalhar com objectos de uma aplicação a partir de outra aplicação ou ferramenta de desenvolvimento. Anteriormente conhecida como automatização OLE, a automatização é uma norma da indústria de software e uma funcionalidade COM (Component Object Model).) +TRANSPOSE = TRANSPOR ## Devolve a transposição de uma matriz +VLOOKUP = PROCV ## Procura na primeira coluna de uma matriz e percorre a linha para devolver o valor de uma célula + + +## +## Math and trigonometry functions Funções matemáticas e trigonométricas +## +ABS = ABS ## Devolve o valor absoluto de um número +ACOS = ACOS ## Devolve o arco de co-seno de um número +ACOSH = ACOSH ## Devolve o co-seno hiperbólico inverso de um número +ASIN = ASEN ## Devolve o arco de seno de um número +ASINH = ASENH ## Devolve o seno hiperbólico inverso de um número +ATAN = ATAN ## Devolve o arco de tangente de um número +ATAN2 = ATAN2 ## Devolve o arco de tangente das coordenadas x e y +ATANH = ATANH ## Devolve a tangente hiperbólica inversa de um número +CEILING = ARRED.EXCESSO ## Arredonda um número para o número inteiro mais próximo ou para o múltiplo de significância mais próximo +COMBIN = COMBIN ## Devolve o número de combinações de um determinado número de objectos +COS = COS ## Devolve o co-seno de um número +COSH = COSH ## Devolve o co-seno hiperbólico de um número +DEGREES = GRAUS ## Converte radianos em graus +EVEN = PAR ## Arredonda um número por excesso para o número inteiro mais próximo +EXP = EXP ## Devolve e elevado à potência de um determinado número +FACT = FACTORIAL ## Devolve o factorial de um número +FACTDOUBLE = FACTDUPLO ## Devolve o factorial duplo de um número +FLOOR = ARRED.DEFEITO ## Arredonda um número por defeito até zero +GCD = MDC ## Devolve o maior divisor comum +INT = INT ## Arredonda um número por defeito para o número inteiro mais próximo +LCM = MMC ## Devolve o mínimo múltiplo comum +LN = LN ## Devolve o logaritmo natural de um número +LOG = LOG ## Devolve o logaritmo de um número com uma base especificada +LOG10 = LOG10 ## Devolve o logaritmo de base 10 de um número +MDETERM = MATRIZ.DETERM ## Devolve o determinante matricial de uma matriz +MINVERSE = MATRIZ.INVERSA ## Devolve o inverso matricial de uma matriz +MMULT = MATRIZ.MULT ## Devolve o produto matricial de duas matrizes +MOD = RESTO ## Devolve o resto da divisão +MROUND = MARRED ## Devolve um número arredondado para o múltiplo pretendido +MULTINOMIAL = POLINOMIAL ## Devolve o polinomial de um conjunto de números +ODD = ÍMPAR ## Arredonda por excesso um número para o número inteiro ímpar mais próximo +PI = PI ## Devolve o valor de pi +POWER = POTÊNCIA ## Devolve o resultado de um número elevado a uma potência +PRODUCT = PRODUTO ## Multiplica os respectivos argumentos +QUOTIENT = QUOCIENTE ## Devolve a parte inteira de uma divisão +RADIANS = RADIANOS ## Converte graus em radianos +RAND = ALEATÓRIO ## Devolve um número aleatório entre 0 e 1 +RANDBETWEEN = ALEATÓRIOENTRE ## Devolve um número aleatório entre os números especificados +ROMAN = ROMANO ## Converte um número árabe em romano, como texto +ROUND = ARRED ## Arredonda um número para um número de dígitos especificado +ROUNDDOWN = ARRED.PARA.BAIXO ## Arredonda um número por defeito até zero +ROUNDUP = ARRED.PARA.CIMA ## Arredonda um número por excesso, afastando-o de zero +SERIESSUM = SOMASÉRIE ## Devolve a soma de uma série de potências baseada na fórmula +SIGN = SINAL ## Devolve o sinal de um número +SIN = SEN ## Devolve o seno de um determinado ângulo +SINH = SENH ## Devolve o seno hiperbólico de um número +SQRT = RAIZQ ## Devolve uma raiz quadrada positiva +SQRTPI = RAIZPI ## Devolve a raiz quadrada de (núm * pi) +SUBTOTAL = SUBTOTAL ## Devolve um subtotal numa lista ou base de dados +SUM = SOMA ## Adiciona os respectivos argumentos +SUMIF = SOMA.SE ## Adiciona as células especificadas por um determinado critério +SUMIFS = SOMA.SE.S ## Adiciona as células num intervalo que cumpre vários critérios +SUMPRODUCT = SOMARPRODUTO ## Devolve a soma dos produtos de componentes de matrizes correspondentes +SUMSQ = SOMARQUAD ## Devolve a soma dos quadrados dos argumentos +SUMX2MY2 = SOMAX2DY2 ## Devolve a soma da diferença dos quadrados dos valores correspondentes em duas matrizes +SUMX2PY2 = SOMAX2SY2 ## Devolve a soma da soma dos quadrados dos valores correspondentes em duas matrizes +SUMXMY2 = SOMAXMY2 ## Devolve a soma dos quadrados da diferença dos valores correspondentes em duas matrizes +TAN = TAN ## Devolve a tangente de um número +TANH = TANH ## Devolve a tangente hiperbólica de um número +TRUNC = TRUNCAR ## Trunca um número para um número inteiro + + +## +## Statistical functions Funções estatísticas +## +AVEDEV = DESV.MÉDIO ## Devolve a média aritmética dos desvios absolutos à média dos pontos de dados +AVERAGE = MÉDIA ## Devolve a média dos respectivos argumentos +AVERAGEA = MÉDIAA ## Devolve uma média dos respectivos argumentos, incluindo números, texto e valores lógicos +AVERAGEIF = MÉDIA.SE ## Devolve a média aritmética de todas as células num intervalo que cumprem determinado critério +AVERAGEIFS = MÉDIA.SE.S ## Devolve a média aritmética de todas as células que cumprem múltiplos critérios +BETADIST = DISTBETA ## Devolve a função de distribuição cumulativa beta +BETAINV = BETA.ACUM.INV ## Devolve o inverso da função de distribuição cumulativa relativamente a uma distribuição beta específica +BINOMDIST = DISTRBINOM ## Devolve a probabilidade de distribuição binomial de termo individual +CHIDIST = DIST.CHI ## Devolve a probabilidade unicaudal da distribuição qui-quadrada +CHIINV = INV.CHI ## Devolve o inverso da probabilidade unicaudal da distribuição qui-quadrada +CHITEST = TESTE.CHI ## Devolve o teste para independência +CONFIDENCE = INT.CONFIANÇA ## Devolve o intervalo de confiança correspondente a uma média de população +CORREL = CORREL ## Devolve o coeficiente de correlação entre dois conjuntos de dados +COUNT = CONTAR ## Conta os números que existem na lista de argumentos +COUNTA = CONTAR.VAL ## Conta os valores que existem na lista de argumentos +COUNTBLANK = CONTAR.VAZIO ## Conta o número de células em branco num intervalo +COUNTIF = CONTAR.SE ## Calcula o número de células num intervalo que corresponde aos critérios determinados +COUNTIFS = CONTAR.SE.S ## Conta o número de células num intervalo que cumprem múltiplos critérios +COVAR = COVAR ## Devolve a covariância, que é a média dos produtos de desvios de pares +CRITBINOM = CRIT.BINOM ## Devolve o menor valor em que a distribuição binomial cumulativa é inferior ou igual a um valor de critério +DEVSQ = DESVQ ## Devolve a soma dos quadrados dos desvios +EXPONDIST = DISTEXPON ## Devolve a distribuição exponencial +FDIST = DISTF ## Devolve a distribuição da probabilidade F +FINV = INVF ## Devolve o inverso da distribuição da probabilidade F +FISHER = FISHER ## Devolve a transformação Fisher +FISHERINV = FISHERINV ## Devolve o inverso da transformação Fisher +FORECAST = PREVISÃO ## Devolve um valor ao longo de uma tendência linear +FREQUENCY = FREQUÊNCIA ## Devolve uma distribuição de frequência como uma matriz vertical +FTEST = TESTEF ## Devolve o resultado de um teste F +GAMMADIST = DISTGAMA ## Devolve a distribuição gama +GAMMAINV = INVGAMA ## Devolve o inverso da distribuição gama cumulativa +GAMMALN = LNGAMA ## Devolve o logaritmo natural da função gama, Γ(x) +GEOMEAN = MÉDIA.GEOMÉTRICA ## Devolve a média geométrica +GROWTH = CRESCIMENTO ## Devolve valores ao longo de uma tendência exponencial +HARMEAN = MÉDIA.HARMÓNICA ## Devolve a média harmónica +HYPGEOMDIST = DIST.HIPERGEOM ## Devolve a distribuição hipergeométrica +INTERCEPT = INTERCEPTAR ## Devolve a intercepção da linha de regressão linear +KURT = CURT ## Devolve a curtose de um conjunto de dados +LARGE = MAIOR ## Devolve o maior valor k-ésimo de um conjunto de dados +LINEST = PROJ.LIN ## Devolve os parâmetros de uma tendência linear +LOGEST = PROJ.LOG ## Devolve os parâmetros de uma tendência exponencial +LOGINV = INVLOG ## Devolve o inverso da distribuição normal logarítmica +LOGNORMDIST = DIST.NORMALLOG ## Devolve a distribuição normal logarítmica cumulativa +MAX = MÁXIMO ## Devolve o valor máximo numa lista de argumentos +MAXA = MÁXIMOA ## Devolve o valor máximo numa lista de argumentos, incluindo números, texto e valores lógicos +MEDIAN = MED ## Devolve a mediana dos números indicados +MIN = MÍNIMO ## Devolve o valor mínimo numa lista de argumentos +MINA = MÍNIMOA ## Devolve o valor mínimo numa lista de argumentos, incluindo números, texto e valores lógicos +MODE = MODA ## Devolve o valor mais comum num conjunto de dados +NEGBINOMDIST = DIST.BIN.NEG ## Devolve a distribuição binominal negativa +NORMDIST = DIST.NORM ## Devolve a distribuição cumulativa normal +NORMINV = INV.NORM ## Devolve o inverso da distribuição cumulativa normal +NORMSDIST = DIST.NORMP ## Devolve a distribuição cumulativa normal padrão +NORMSINV = INV.NORMP ## Devolve o inverso da distribuição cumulativa normal padrão +PEARSON = PEARSON ## Devolve o coeficiente de correlação momento/produto de Pearson +PERCENTILE = PERCENTIL ## Devolve o k-ésimo percentil de valores num intervalo +PERCENTRANK = ORDEM.PERCENTUAL ## Devolve a ordem percentual de um valor num conjunto de dados +PERMUT = PERMUTAR ## Devolve o número de permutações de um determinado número de objectos +POISSON = POISSON ## Devolve a distribuição de Poisson +PROB = PROB ## Devolve a probabilidade dos valores num intervalo se encontrarem entre dois limites +QUARTILE = QUARTIL ## Devolve o quartil de um conjunto de dados +RANK = ORDEM ## Devolve a ordem de um número numa lista numérica +RSQ = RQUAD ## Devolve o quadrado do coeficiente de correlação momento/produto de Pearson +SKEW = DISTORÇÃO ## Devolve a distorção de uma distribuição +SLOPE = DECLIVE ## Devolve o declive da linha de regressão linear +SMALL = MENOR ## Devolve o menor valor de k-ésimo de um conjunto de dados +STANDARDIZE = NORMALIZAR ## Devolve um valor normalizado +STDEV = DESVPAD ## Calcula o desvio-padrão com base numa amostra +STDEVA = DESVPADA ## Calcula o desvio-padrão com base numa amostra, incluindo números, texto e valores lógicos +STDEVP = DESVPADP ## Calcula o desvio-padrão com base na população total +STDEVPA = DESVPADPA ## Calcula o desvio-padrão com base na população total, incluindo números, texto e valores lógicos +STEYX = EPADYX ## Devolve o erro-padrão do valor de y previsto para cada x na regressão +TDIST = DISTT ## Devolve a distribuição t de Student +TINV = INVT ## Devolve o inverso da distribuição t de Student +TREND = TENDÊNCIA ## Devolve valores ao longo de uma tendência linear +TRIMMEAN = MÉDIA.INTERNA ## Devolve a média do interior de um conjunto de dados +TTEST = TESTET ## Devolve a probabilidade associada ao teste t de Student +VAR = VAR ## Calcula a variância com base numa amostra +VARA = VARA ## Calcula a variância com base numa amostra, incluindo números, texto e valores lógicos +VARP = VARP ## Calcula a variância com base na população total +VARPA = VARPA ## Calcula a variância com base na população total, incluindo números, texto e valores lógicos +WEIBULL = WEIBULL ## Devolve a distribuição Weibull +ZTEST = TESTEZ ## Devolve o valor de probabilidade unicaudal de um teste-z + + +## +## Text functions Funções de texto +## +ASC = ASC ## Altera letras ou katakana de largura total (byte duplo) numa cadeia de caracteres para caracteres de largura média (byte único) +BAHTTEXT = TEXTO.BAHT ## Converte um número em texto, utilizando o formato monetário ß (baht) +CHAR = CARÁCT ## Devolve o carácter especificado pelo número de código +CLEAN = LIMPAR ## Remove do texto todos os caracteres não imprimíveis +CODE = CÓDIGO ## Devolve um código numérico correspondente ao primeiro carácter numa cadeia de texto +CONCATENATE = CONCATENAR ## Agrupa vários itens de texto num único item de texto +DOLLAR = MOEDA ## Converte um número em texto, utilizando o formato monetário € (Euro) +EXACT = EXACTO ## Verifica se dois valores de texto são idênticos +FIND = LOCALIZAR ## Localiza um valor de texto dentro de outro (sensível às maiúsculas e minúsculas) +FINDB = LOCALIZARB ## Localiza um valor de texto dentro de outro (sensível às maiúsculas e minúsculas) +FIXED = FIXA ## Formata um número como texto com um número fixo de decimais +JIS = JIS ## Altera letras ou katakana de largura média (byte único) numa cadeia de caracteres para caracteres de largura total (byte duplo) +LEFT = ESQUERDA ## Devolve os caracteres mais à esquerda de um valor de texto +LEFTB = ESQUERDAB ## Devolve os caracteres mais à esquerda de um valor de texto +LEN = NÚM.CARACT ## Devolve o número de caracteres de uma cadeia de texto +LENB = NÚM.CARACTB ## Devolve o número de caracteres de uma cadeia de texto +LOWER = MINÚSCULAS ## Converte o texto em minúsculas +MID = SEG.TEXTO ## Devolve um número específico de caracteres de uma cadeia de texto, a partir da posição especificada +MIDB = SEG.TEXTOB ## Devolve um número específico de caracteres de uma cadeia de texto, a partir da posição especificada +PHONETIC = FONÉTICA ## Retira os caracteres fonéticos (furigana) de uma cadeia de texto +PROPER = INICIAL.MAIÚSCULA ## Coloca em maiúsculas a primeira letra de cada palavra de um valor de texto +REPLACE = SUBSTITUIR ## Substitui caracteres no texto +REPLACEB = SUBSTITUIRB ## Substitui caracteres no texto +REPT = REPETIR ## Repete texto um determinado número de vezes +RIGHT = DIREITA ## Devolve os caracteres mais à direita de um valor de texto +RIGHTB = DIREITAB ## Devolve os caracteres mais à direita de um valor de texto +SEARCH = PROCURAR ## Localiza um valor de texto dentro de outro (não sensível a maiúsculas e minúsculas) +SEARCHB = PROCURARB ## Localiza um valor de texto dentro de outro (não sensível a maiúsculas e minúsculas) +SUBSTITUTE = SUBST ## Substitui texto novo por texto antigo numa cadeia de texto +T = T ## Converte os respectivos argumentos em texto +TEXT = TEXTO ## Formata um número e converte-o em texto +TRIM = COMPACTAR ## Remove espaços do texto +UPPER = MAIÚSCULAS ## Converte texto em maiúsculas +VALUE = VALOR ## Converte um argumento de texto num número diff --git a/extend/PHPExcel/PHPExcel/locale/ru/config b/extend/PHPExcel/PHPExcel/locale/ru/config new file mode 100644 index 0000000..56e45bf --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/ru/config @@ -0,0 +1,47 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = р + + +## +## Excel Error Codes (For future use) +## +NULL = #ПУСТО! +DIV0 = #ДЕЛ/0! +VALUE = #ЗНАЧ! +REF = #ССЫЛ! +NAME = #ИМЯ? +NUM = #ЧИСЛО! +NA = #Н/Д diff --git a/extend/PHPExcel/PHPExcel/locale/ru/functions b/extend/PHPExcel/PHPExcel/locale/ru/functions new file mode 100644 index 0000000..5ff6d4f --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/ru/functions @@ -0,0 +1,438 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Calculation +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## Data in this file derived from information provided by web-junior (http://www.web-junior.net/) +## +## + + +## +## Add-in and Automation functions Функции надстроек и автоматизации +## +GETPIVOTDATA = ПОЛУЧИТЬ.ДАННЫЕ.СВОДНОЙ.ТАБЛИЦЫ ## Возвращает данные, хранящиеся в отчете сводной таблицы. + + +## +## Cube functions Функции Куб +## +CUBEKPIMEMBER = КУБЭЛЕМЕНТКИП ## Возвращает свойство ключевого индикатора производительности «(КИП)» и отображает имя «КИП» в ячейке. «КИП» представляет собой количественную величину, такую как ежемесячная валовая прибыль или ежеквартальная текучесть кадров, используемой для контроля эффективности работы организации. +CUBEMEMBER = КУБЭЛЕМЕНТ ## Возвращает элемент или кортеж из куба. Используется для проверки существования элемента или кортежа в кубе. +CUBEMEMBERPROPERTY = КУБСВОЙСТВОЭЛЕМЕНТА ## Возвращает значение свойства элемента из куба. Используется для проверки существования имени элемента в кубе и возвращает указанное свойство для этого элемента. +CUBERANKEDMEMBER = КУБПОРЭЛЕМЕНТ ## Возвращает n-ый или ранжированный элемент в множество. Используется для возвращения одного или нескольких элементов в множество, например, лучшего продавца или 10 лучших студентов. +CUBESET = КУБМНОЖ ## Определяет вычислительное множество элементов или кортежей, отправляя на сервер выражение, которое создает множество, а затем возвращает его в Microsoft Office Excel. +CUBESETCOUNT = КУБЧИСЛОЭЛМНОЖ ## Возвращает число элементов множества. +CUBEVALUE = КУБЗНАЧЕНИЕ ## Возвращает обобщенное значение из куба. + + +## +## Database functions Функции для работы с базами данных +## +DAVERAGE = ДСРЗНАЧ ## Возвращает среднее значение выбранных записей базы данных. +DCOUNT = БСЧЁТ ## Подсчитывает количество числовых ячеек в базе данных. +DCOUNTA = БСЧЁТА ## Подсчитывает количество непустых ячеек в базе данных. +DGET = БИЗВЛЕЧЬ ## Извлекает из базы данных одну запись, удовлетворяющую заданному условию. +DMAX = ДМАКС ## Возвращает максимальное значение среди выделенных записей базы данных. +DMIN = ДМИН ## Возвращает минимальное значение среди выделенных записей базы данных. +DPRODUCT = БДПРОИЗВЕД ## Перемножает значения определенного поля в записях базы данных, удовлетворяющих условию. +DSTDEV = ДСТАНДОТКЛ ## Оценивает стандартное отклонение по выборке для выделенных записей базы данных. +DSTDEVP = ДСТАНДОТКЛП ## Вычисляет стандартное отклонение по генеральной совокупности для выделенных записей базы данных +DSUM = БДСУММ ## Суммирует числа в поле для записей базы данных, удовлетворяющих условию. +DVAR = БДДИСП ## Оценивает дисперсию по выборке из выделенных записей базы данных +DVARP = БДДИСПП ## Вычисляет дисперсию по генеральной совокупности для выделенных записей базы данных + + +## +## Date and time functions Функции даты и времени +## +DATE = ДАТА ## Возвращает заданную дату в числовом формате. +DATEVALUE = ДАТАЗНАЧ ## Преобразует дату из текстового формата в числовой формат. +DAY = ДЕНЬ ## Преобразует дату в числовом формате в день месяца. +DAYS360 = ДНЕЙ360 ## Вычисляет количество дней между двумя датами на основе 360-дневного года. +EDATE = ДАТАМЕС ## Возвращает дату в числовом формате, отстоящую на заданное число месяцев вперед или назад от начальной даты. +EOMONTH = КОНМЕСЯЦА ## Возвращает дату в числовом формате для последнего дня месяца, отстоящего вперед или назад на заданное число месяцев. +HOUR = ЧАС ## Преобразует дату в числовом формате в часы. +MINUTE = МИНУТЫ ## Преобразует дату в числовом формате в минуты. +MONTH = МЕСЯЦ ## Преобразует дату в числовом формате в месяцы. +NETWORKDAYS = ЧИСТРАБДНИ ## Возвращает количество рабочих дней между двумя датами. +NOW = ТДАТА ## Возвращает текущую дату и время в числовом формате. +SECOND = СЕКУНДЫ ## Преобразует дату в числовом формате в секунды. +TIME = ВРЕМЯ ## Возвращает заданное время в числовом формате. +TIMEVALUE = ВРЕМЗНАЧ ## Преобразует время из текстового формата в числовой формат. +TODAY = СЕГОДНЯ ## Возвращает текущую дату в числовом формате. +WEEKDAY = ДЕНЬНЕД ## Преобразует дату в числовом формате в день недели. +WEEKNUM = НОМНЕДЕЛИ ## Преобразует числовое представление в число, которое указывает, на какую неделю года приходится указанная дата. +WORKDAY = РАБДЕНЬ ## Возвращает дату в числовом формате, отстоящую вперед или назад на заданное количество рабочих дней. +YEAR = ГОД ## Преобразует дату в числовом формате в год. +YEARFRAC = ДОЛЯГОДА ## Возвращает долю года, которую составляет количество дней между начальной и конечной датами. + + +## +## Engineering functions Инженерные функции +## +BESSELI = БЕССЕЛЬ.I ## Возвращает модифицированную функцию Бесселя In(x). +BESSELJ = БЕССЕЛЬ.J ## Возвращает функцию Бесселя Jn(x). +BESSELK = БЕССЕЛЬ.K ## Возвращает модифицированную функцию Бесселя Kn(x). +BESSELY = БЕССЕЛЬ.Y ## Возвращает функцию Бесселя Yn(x). +BIN2DEC = ДВ.В.ДЕС ## Преобразует двоичное число в десятичное. +BIN2HEX = ДВ.В.ШЕСТН ## Преобразует двоичное число в шестнадцатеричное. +BIN2OCT = ДВ.В.ВОСЬМ ## Преобразует двоичное число в восьмеричное. +COMPLEX = КОМПЛЕКСН ## Преобразует коэффициенты при вещественной и мнимой частях комплексного числа в комплексное число. +CONVERT = ПРЕОБР ## Преобразует число из одной системы единиц измерения в другую. +DEC2BIN = ДЕС.В.ДВ ## Преобразует десятичное число в двоичное. +DEC2HEX = ДЕС.В.ШЕСТН ## Преобразует десятичное число в шестнадцатеричное. +DEC2OCT = ДЕС.В.ВОСЬМ ## Преобразует десятичное число в восьмеричное. +DELTA = ДЕЛЬТА ## Проверяет равенство двух значений. +ERF = ФОШ ## Возвращает функцию ошибки. +ERFC = ДФОШ ## Возвращает дополнительную функцию ошибки. +GESTEP = ПОРОГ ## Проверяет, не превышает ли данное число порогового значения. +HEX2BIN = ШЕСТН.В.ДВ ## Преобразует шестнадцатеричное число в двоичное. +HEX2DEC = ШЕСТН.В.ДЕС ## Преобразует шестнадцатеричное число в десятичное. +HEX2OCT = ШЕСТН.В.ВОСЬМ ## Преобразует шестнадцатеричное число в восьмеричное. +IMABS = МНИМ.ABS ## Возвращает абсолютную величину (модуль) комплексного числа. +IMAGINARY = МНИМ.ЧАСТЬ ## Возвращает коэффициент при мнимой части комплексного числа. +IMARGUMENT = МНИМ.АРГУМЕНТ ## Возвращает значение аргумента комплексного числа (тета) — угол, выраженный в радианах. +IMCONJUGATE = МНИМ.СОПРЯЖ ## Возвращает комплексно-сопряженное комплексное число. +IMCOS = МНИМ.COS ## Возвращает косинус комплексного числа. +IMDIV = МНИМ.ДЕЛ ## Возвращает частное от деления двух комплексных чисел. +IMEXP = МНИМ.EXP ## Возвращает экспоненту комплексного числа. +IMLN = МНИМ.LN ## Возвращает натуральный логарифм комплексного числа. +IMLOG10 = МНИМ.LOG10 ## Возвращает обычный (десятичный) логарифм комплексного числа. +IMLOG2 = МНИМ.LOG2 ## Возвращает двоичный логарифм комплексного числа. +IMPOWER = МНИМ.СТЕПЕНЬ ## Возвращает комплексное число, возведенное в целую степень. +IMPRODUCT = МНИМ.ПРОИЗВЕД ## Возвращает произведение от 2 до 29 комплексных чисел. +IMREAL = МНИМ.ВЕЩ ## Возвращает коэффициент при вещественной части комплексного числа. +IMSIN = МНИМ.SIN ## Возвращает синус комплексного числа. +IMSQRT = МНИМ.КОРЕНЬ ## Возвращает значение квадратного корня из комплексного числа. +IMSUB = МНИМ.РАЗН ## Возвращает разность двух комплексных чисел. +IMSUM = МНИМ.СУММ ## Возвращает сумму комплексных чисел. +OCT2BIN = ВОСЬМ.В.ДВ ## Преобразует восьмеричное число в двоичное. +OCT2DEC = ВОСЬМ.В.ДЕС ## Преобразует восьмеричное число в десятичное. +OCT2HEX = ВОСЬМ.В.ШЕСТН ## Преобразует восьмеричное число в шестнадцатеричное. + + +## +## Financial functions Финансовые функции +## +ACCRINT = НАКОПДОХОД ## Возвращает накопленный процент по ценным бумагам с периодической выплатой процентов. +ACCRINTM = НАКОПДОХОДПОГАШ ## Возвращает накопленный процент по ценным бумагам, проценты по которым выплачиваются в срок погашения. +AMORDEGRC = АМОРУМ ## Возвращает величину амортизации для каждого периода, используя коэффициент амортизации. +AMORLINC = АМОРУВ ## Возвращает величину амортизации для каждого периода. +COUPDAYBS = ДНЕЙКУПОНДО ## Возвращает количество дней от начала действия купона до даты соглашения. +COUPDAYS = ДНЕЙКУПОН ## Возвращает число дней в периоде купона, содержащем дату соглашения. +COUPDAYSNC = ДНЕЙКУПОНПОСЛЕ ## Возвращает число дней от даты соглашения до срока следующего купона. +COUPNCD = ДАТАКУПОНПОСЛЕ ## Возвращает следующую дату купона после даты соглашения. +COUPNUM = ЧИСЛКУПОН ## Возвращает количество купонов, которые могут быть оплачены между датой соглашения и сроком вступления в силу. +COUPPCD = ДАТАКУПОНДО ## Возвращает предыдущую дату купона перед датой соглашения. +CUMIPMT = ОБЩПЛАТ ## Возвращает общую выплату, произведенную между двумя периодическими выплатами. +CUMPRINC = ОБЩДОХОД ## Возвращает общую выплату по займу между двумя периодами. +DB = ФУО ## Возвращает величину амортизации актива для заданного периода, рассчитанную методом фиксированного уменьшения остатка. +DDB = ДДОБ ## Возвращает величину амортизации актива за данный период, используя метод двойного уменьшения остатка или иной явно указанный метод. +DISC = СКИДКА ## Возвращает норму скидки для ценных бумаг. +DOLLARDE = РУБЛЬ.ДЕС ## Преобразует цену в рублях, выраженную в виде дроби, в цену в рублях, выраженную десятичным числом. +DOLLARFR = РУБЛЬ.ДРОБЬ ## Преобразует цену в рублях, выраженную десятичным числом, в цену в рублях, выраженную в виде дроби. +DURATION = ДЛИТ ## Возвращает ежегодную продолжительность действия ценных бумаг с периодическими выплатами по процентам. +EFFECT = ЭФФЕКТ ## Возвращает действующие ежегодные процентные ставки. +FV = БС ## Возвращает будущую стоимость инвестиции. +FVSCHEDULE = БЗРАСПИС ## Возвращает будущую стоимость первоначальной основной суммы после начисления ряда сложных процентов. +INTRATE = ИНОРМА ## Возвращает процентную ставку для полностью инвестированных ценных бумаг. +IPMT = ПРПЛТ ## Возвращает величину выплаты прибыли на вложения за данный период. +IRR = ВСД ## Возвращает внутреннюю ставку доходности для ряда потоков денежных средств. +ISPMT = ПРОЦПЛАТ ## Вычисляет выплаты за указанный период инвестиции. +MDURATION = МДЛИТ ## Возвращает модифицированную длительность Маколея для ценных бумаг с предполагаемой номинальной стоимостью 100 рублей. +MIRR = МВСД ## Возвращает внутреннюю ставку доходности, при которой положительные и отрицательные денежные потоки имеют разные значения ставки. +NOMINAL = НОМИНАЛ ## Возвращает номинальную годовую процентную ставку. +NPER = КПЕР ## Возвращает общее количество периодов выплаты для данного вклада. +NPV = ЧПС ## Возвращает чистую приведенную стоимость инвестиции, основанной на серии периодических денежных потоков и ставке дисконтирования. +ODDFPRICE = ЦЕНАПЕРВНЕРЕГ ## Возвращает цену за 100 рублей нарицательной стоимости ценных бумаг с нерегулярным первым периодом. +ODDFYIELD = ДОХОДПЕРВНЕРЕГ ## Возвращает доход по ценным бумагам с нерегулярным первым периодом. +ODDLPRICE = ЦЕНАПОСЛНЕРЕГ ## Возвращает цену за 100 рублей нарицательной стоимости ценных бумаг с нерегулярным последним периодом. +ODDLYIELD = ДОХОДПОСЛНЕРЕГ ## Возвращает доход по ценным бумагам с нерегулярным последним периодом. +PMT = ПЛТ ## Возвращает величину выплаты за один период аннуитета. +PPMT = ОСПЛТ ## Возвращает величину выплат в погашение основной суммы по инвестиции за заданный период. +PRICE = ЦЕНА ## Возвращает цену за 100 рублей нарицательной стоимости ценных бумаг, по которым производится периодическая выплата процентов. +PRICEDISC = ЦЕНАСКИДКА ## Возвращает цену за 100 рублей номинальной стоимости ценных бумаг, на которые сделана скидка. +PRICEMAT = ЦЕНАПОГАШ ## Возвращает цену за 100 рублей номинальной стоимости ценных бумаг, проценты по которым выплачиваются в срок погашения. +PV = ПС ## Возвращает приведенную (к текущему моменту) стоимость инвестиции. +RATE = СТАВКА ## Возвращает процентную ставку по аннуитету за один период. +RECEIVED = ПОЛУЧЕНО ## Возвращает сумму, полученную к сроку погашения полностью обеспеченных ценных бумаг. +SLN = АПЛ ## Возвращает величину линейной амортизации актива за один период. +SYD = АСЧ ## Возвращает величину амортизации актива за данный период, рассчитанную методом суммы годовых чисел. +TBILLEQ = РАВНОКЧЕК ## Возвращает эквивалентный облигации доход по казначейскому чеку. +TBILLPRICE = ЦЕНАКЧЕК ## Возвращает цену за 100 рублей нарицательной стоимости для казначейского чека. +TBILLYIELD = ДОХОДКЧЕК ## Возвращает доход по казначейскому чеку. +VDB = ПУО ## Возвращает величину амортизации актива для указанного или частичного периода при использовании метода сокращающегося баланса. +XIRR = ЧИСТВНДОХ ## Возвращает внутреннюю ставку доходности для графика денежных потоков, которые не обязательно носят периодический характер. +XNPV = ЧИСТНЗ ## Возвращает чистую приведенную стоимость для денежных потоков, которые не обязательно являются периодическими. +YIELD = ДОХОД ## Возвращает доход от ценных бумаг, по которым производятся периодические выплаты процентов. +YIELDDISC = ДОХОДСКИДКА ## Возвращает годовой доход по ценным бумагам, на которые сделана скидка (пример — казначейские чеки). +YIELDMAT = ДОХОДПОГАШ ## Возвращает годовой доход от ценных бумаг, проценты по которым выплачиваются в срок погашения. + + +## +## Information functions Информационные функции +## +CELL = ЯЧЕЙКА ## Возвращает информацию о формате, расположении или содержимом ячейки. +ERROR.TYPE = ТИП.ОШИБКИ ## Возвращает числовой код, соответствующий типу ошибки. +INFO = ИНФОРМ ## Возвращает информацию о текущей операционной среде. +ISBLANK = ЕПУСТО ## Возвращает значение ИСТИНА, если аргумент является ссылкой на пустую ячейку. +ISERR = ЕОШ ## Возвращает значение ИСТИНА, если аргумент ссылается на любое значение ошибки, кроме #Н/Д. +ISERROR = ЕОШИБКА ## Возвращает значение ИСТИНА, если аргумент ссылается на любое значение ошибки. +ISEVEN = ЕЧЁТН ## Возвращает значение ИСТИНА, если значение аргумента является четным числом. +ISLOGICAL = ЕЛОГИЧ ## Возвращает значение ИСТИНА, если аргумент ссылается на логическое значение. +ISNA = ЕНД ## Возвращает значение ИСТИНА, если аргумент ссылается на значение ошибки #Н/Д. +ISNONTEXT = ЕНЕТЕКСТ ## Возвращает значение ИСТИНА, если значение аргумента не является текстом. +ISNUMBER = ЕЧИСЛО ## Возвращает значение ИСТИНА, если аргумент ссылается на число. +ISODD = ЕНЕЧЁТ ## Возвращает значение ИСТИНА, если значение аргумента является нечетным числом. +ISREF = ЕССЫЛКА ## Возвращает значение ИСТИНА, если значение аргумента является ссылкой. +ISTEXT = ЕТЕКСТ ## Возвращает значение ИСТИНА, если значение аргумента является текстом. +N = Ч ## Возвращает значение, преобразованное в число. +NA = НД ## Возвращает значение ошибки #Н/Д. +TYPE = ТИП ## Возвращает число, обозначающее тип данных значения. + + +## +## Logical functions Логические функции +## +AND = И ## Renvoie VRAI si tous ses arguments sont VRAI. +FALSE = ЛОЖЬ ## Возвращает логическое значение ЛОЖЬ. +IF = ЕСЛИ ## Выполняет проверку условия. +IFERROR = ЕСЛИОШИБКА ## Возвращает введённое значение, если вычисление по формуле вызывает ошибку; в противном случае функция возвращает результат вычисления. +NOT = НЕ ## Меняет логическое значение своего аргумента на противоположное. +OR = ИЛИ ## Возвращает значение ИСТИНА, если хотя бы один аргумент имеет значение ИСТИНА. +TRUE = ИСТИНА ## Возвращает логическое значение ИСТИНА. + + +## +## Lookup and reference functions Функции ссылки и поиска +## +ADDRESS = АДРЕС ## Возвращает ссылку на отдельную ячейку листа в виде текста. +AREAS = ОБЛАСТИ ## Возвращает количество областей в ссылке. +CHOOSE = ВЫБОР ## Выбирает значение из списка значений по индексу. +COLUMN = СТОЛБЕЦ ## Возвращает номер столбца, на который указывает ссылка. +COLUMNS = ЧИСЛСТОЛБ ## Возвращает количество столбцов в ссылке. +HLOOKUP = ГПР ## Ищет в первой строке массива и возвращает значение отмеченной ячейки +HYPERLINK = ГИПЕРССЫЛКА ## Создает ссылку, открывающую документ, который находится на сервере сети, в интрасети или в Интернете. +INDEX = ИНДЕКС ## Использует индекс для выбора значения из ссылки или массива. +INDIRECT = ДВССЫЛ ## Возвращает ссылку, заданную текстовым значением. +LOOKUP = ПРОСМОТР ## Ищет значения в векторе или массиве. +MATCH = ПОИСКПОЗ ## Ищет значения в ссылке или массиве. +OFFSET = СМЕЩ ## Возвращает смещение ссылки относительно заданной ссылки. +ROW = СТРОКА ## Возвращает номер строки, определяемой ссылкой. +ROWS = ЧСТРОК ## Возвращает количество строк в ссылке. +RTD = ДРВ ## Извлекает данные реального времени из программ, поддерживающих автоматизацию COM (Программирование объектов. Стандартное средство для работы с объектами некоторого приложения из другого приложения или средства разработки. Программирование объектов (ранее называемое программированием OLE) является функцией модели COM (Component Object Model, модель компонентных объектов).). +TRANSPOSE = ТРАНСП ## Возвращает транспонированный массив. +VLOOKUP = ВПР ## Ищет значение в первом столбце массива и возвращает значение из ячейки в найденной строке и указанном столбце. + + +## +## Math and trigonometry functions Математические и тригонометрические функции +## +ABS = ABS ## Возвращает модуль (абсолютную величину) числа. +ACOS = ACOS ## Возвращает арккосинус числа. +ACOSH = ACOSH ## Возвращает гиперболический арккосинус числа. +ASIN = ASIN ## Возвращает арксинус числа. +ASINH = ASINH ## Возвращает гиперболический арксинус числа. +ATAN = ATAN ## Возвращает арктангенс числа. +ATAN2 = ATAN2 ## Возвращает арктангенс для заданных координат x и y. +ATANH = ATANH ## Возвращает гиперболический арктангенс числа. +CEILING = ОКРВВЕРХ ## Округляет число до ближайшего целого или до ближайшего кратного указанному значению. +COMBIN = ЧИСЛКОМБ ## Возвращает количество комбинаций для заданного числа объектов. +COS = COS ## Возвращает косинус числа. +COSH = COSH ## Возвращает гиперболический косинус числа. +DEGREES = ГРАДУСЫ ## Преобразует радианы в градусы. +EVEN = ЧЁТН ## Округляет число до ближайшего четного целого. +EXP = EXP ## Возвращает число e, возведенное в указанную степень. +FACT = ФАКТР ## Возвращает факториал числа. +FACTDOUBLE = ДВФАКТР ## Возвращает двойной факториал числа. +FLOOR = ОКРВНИЗ ## Округляет число до ближайшего меньшего по модулю значения. +GCD = НОД ## Возвращает наибольший общий делитель. +INT = ЦЕЛОЕ ## Округляет число до ближайшего меньшего целого. +LCM = НОК ## Возвращает наименьшее общее кратное. +LN = LN ## Возвращает натуральный логарифм числа. +LOG = LOG ## Возвращает логарифм числа по заданному основанию. +LOG10 = LOG10 ## Возвращает десятичный логарифм числа. +MDETERM = МОПРЕД ## Возвращает определитель матрицы массива. +MINVERSE = МОБР ## Возвращает обратную матрицу массива. +MMULT = МУМНОЖ ## Возвращает произведение матриц двух массивов. +MOD = ОСТАТ ## Возвращает остаток от деления. +MROUND = ОКРУГЛТ ## Возвращает число, округленное с требуемой точностью. +MULTINOMIAL = МУЛЬТИНОМ ## Возвращает мультиномиальный коэффициент множества чисел. +ODD = НЕЧЁТ ## Округляет число до ближайшего нечетного целого. +PI = ПИ ## Возвращает число пи. +POWER = СТЕПЕНЬ ## Возвращает результат возведения числа в степень. +PRODUCT = ПРОИЗВЕД ## Возвращает произведение аргументов. +QUOTIENT = ЧАСТНОЕ ## Возвращает целую часть частного при делении. +RADIANS = РАДИАНЫ ## Преобразует градусы в радианы. +RAND = СЛЧИС ## Возвращает случайное число в интервале от 0 до 1. +RANDBETWEEN = СЛУЧМЕЖДУ ## Возвращает случайное число в интервале между двумя заданными числами. +ROMAN = РИМСКОЕ ## Преобразует арабские цифры в римские в виде текста. +ROUND = ОКРУГЛ ## Округляет число до указанного количества десятичных разрядов. +ROUNDDOWN = ОКРУГЛВНИЗ ## Округляет число до ближайшего меньшего по модулю значения. +ROUNDUP = ОКРУГЛВВЕРХ ## Округляет число до ближайшего большего по модулю значения. +SERIESSUM = РЯД.СУММ ## Возвращает сумму степенного ряда, вычисленную по формуле. +SIGN = ЗНАК ## Возвращает знак числа. +SIN = SIN ## Возвращает синус заданного угла. +SINH = SINH ## Возвращает гиперболический синус числа. +SQRT = КОРЕНЬ ## Возвращает положительное значение квадратного корня. +SQRTPI = КОРЕНЬПИ ## Возвращает квадратный корень из значения выражения (число * ПИ). +SUBTOTAL = ПРОМЕЖУТОЧНЫЕ.ИТОГИ ## Возвращает промежуточный итог в списке или базе данных. +SUM = СУММ ## Суммирует аргументы. +SUMIF = СУММЕСЛИ ## Суммирует ячейки, удовлетворяющие заданному условию. +SUMIFS = СУММЕСЛИМН ## Суммирует диапазон ячеек, удовлетворяющих нескольким условиям. +SUMPRODUCT = СУММПРОИЗВ ## Возвращает сумму произведений соответствующих элементов массивов. +SUMSQ = СУММКВ ## Возвращает сумму квадратов аргументов. +SUMX2MY2 = СУММРАЗНКВ ## Возвращает сумму разностей квадратов соответствующих значений в двух массивах. +SUMX2PY2 = СУММСУММКВ ## Возвращает сумму сумм квадратов соответствующих элементов двух массивов. +SUMXMY2 = СУММКВРАЗН ## Возвращает сумму квадратов разностей соответствующих значений в двух массивах. +TAN = TAN ## Возвращает тангенс числа. +TANH = TANH ## Возвращает гиперболический тангенс числа. +TRUNC = ОТБР ## Отбрасывает дробную часть числа. + + +## +## Statistical functions Статистические функции +## +AVEDEV = СРОТКЛ ## Возвращает среднее арифметическое абсолютных значений отклонений точек данных от среднего. +AVERAGE = СРЗНАЧ ## Возвращает среднее арифметическое аргументов. +AVERAGEA = СРЗНАЧА ## Возвращает среднее арифметическое аргументов, включая числа, текст и логические значения. +AVERAGEIF = СРЗНАЧЕСЛИ ## Возвращает среднее значение (среднее арифметическое) всех ячеек в диапазоне, которые удовлетворяют данному условию. +AVERAGEIFS = СРЗНАЧЕСЛИМН ## Возвращает среднее значение (среднее арифметическое) всех ячеек, которые удовлетворяют нескольким условиям. +BETADIST = БЕТАРАСП ## Возвращает интегральную функцию бета-распределения. +BETAINV = БЕТАОБР ## Возвращает обратную интегральную функцию указанного бета-распределения. +BINOMDIST = БИНОМРАСП ## Возвращает отдельное значение биномиального распределения. +CHIDIST = ХИ2РАСП ## Возвращает одностороннюю вероятность распределения хи-квадрат. +CHIINV = ХИ2ОБР ## Возвращает обратное значение односторонней вероятности распределения хи-квадрат. +CHITEST = ХИ2ТЕСТ ## Возвращает тест на независимость. +CONFIDENCE = ДОВЕРИТ ## Возвращает доверительный интервал для среднего значения по генеральной совокупности. +CORREL = КОРРЕЛ ## Возвращает коэффициент корреляции между двумя множествами данных. +COUNT = СЧЁТ ## Подсчитывает количество чисел в списке аргументов. +COUNTA = СЧЁТЗ ## Подсчитывает количество значений в списке аргументов. +COUNTBLANK = СЧИТАТЬПУСТОТЫ ## Подсчитывает количество пустых ячеек в диапазоне +COUNTIF = СЧЁТЕСЛИ ## Подсчитывает количество ячеек в диапазоне, удовлетворяющих заданному условию +COUNTIFS = СЧЁТЕСЛИМН ## Подсчитывает количество ячеек внутри диапазона, удовлетворяющих нескольким условиям. +COVAR = КОВАР ## Возвращает ковариацию, среднее произведений парных отклонений +CRITBINOM = КРИТБИНОМ ## Возвращает наименьшее значение, для которого интегральное биномиальное распределение меньше или равно заданному критерию. +DEVSQ = КВАДРОТКЛ ## Возвращает сумму квадратов отклонений. +EXPONDIST = ЭКСПРАСП ## Возвращает экспоненциальное распределение. +FDIST = FРАСП ## Возвращает F-распределение вероятности. +FINV = FРАСПОБР ## Возвращает обратное значение для F-распределения вероятности. +FISHER = ФИШЕР ## Возвращает преобразование Фишера. +FISHERINV = ФИШЕРОБР ## Возвращает обратное преобразование Фишера. +FORECAST = ПРЕДСКАЗ ## Возвращает значение линейного тренда. +FREQUENCY = ЧАСТОТА ## Возвращает распределение частот в виде вертикального массива. +FTEST = ФТЕСТ ## Возвращает результат F-теста. +GAMMADIST = ГАММАРАСП ## Возвращает гамма-распределение. +GAMMAINV = ГАММАОБР ## Возвращает обратное гамма-распределение. +GAMMALN = ГАММАНЛОГ ## Возвращает натуральный логарифм гамма функции, Γ(x). +GEOMEAN = СРГЕОМ ## Возвращает среднее геометрическое. +GROWTH = РОСТ ## Возвращает значения в соответствии с экспоненциальным трендом. +HARMEAN = СРГАРМ ## Возвращает среднее гармоническое. +HYPGEOMDIST = ГИПЕРГЕОМЕТ ## Возвращает гипергеометрическое распределение. +INTERCEPT = ОТРЕЗОК ## Возвращает отрезок, отсекаемый на оси линией линейной регрессии. +KURT = ЭКСЦЕСС ## Возвращает эксцесс множества данных. +LARGE = НАИБОЛЬШИЙ ## Возвращает k-ое наибольшее значение в множестве данных. +LINEST = ЛИНЕЙН ## Возвращает параметры линейного тренда. +LOGEST = ЛГРФПРИБЛ ## Возвращает параметры экспоненциального тренда. +LOGINV = ЛОГНОРМОБР ## Возвращает обратное логарифмическое нормальное распределение. +LOGNORMDIST = ЛОГНОРМРАСП ## Возвращает интегральное логарифмическое нормальное распределение. +MAX = МАКС ## Возвращает наибольшее значение в списке аргументов. +MAXA = МАКСА ## Возвращает наибольшее значение в списке аргументов, включая числа, текст и логические значения. +MEDIAN = МЕДИАНА ## Возвращает медиану заданных чисел. +MIN = МИН ## Возвращает наименьшее значение в списке аргументов. +MINA = МИНА ## Возвращает наименьшее значение в списке аргументов, включая числа, текст и логические значения. +MODE = МОДА ## Возвращает значение моды множества данных. +NEGBINOMDIST = ОТРБИНОМРАСП ## Возвращает отрицательное биномиальное распределение. +NORMDIST = НОРМРАСП ## Возвращает нормальную функцию распределения. +NORMINV = НОРМОБР ## Возвращает обратное нормальное распределение. +NORMSDIST = НОРМСТРАСП ## Возвращает стандартное нормальное интегральное распределение. +NORMSINV = НОРМСТОБР ## Возвращает обратное значение стандартного нормального распределения. +PEARSON = ПИРСОН ## Возвращает коэффициент корреляции Пирсона. +PERCENTILE = ПЕРСЕНТИЛЬ ## Возвращает k-ую персентиль для значений диапазона. +PERCENTRANK = ПРОЦЕНТРАНГ ## Возвращает процентную норму значения в множестве данных. +PERMUT = ПЕРЕСТ ## Возвращает количество перестановок для заданного числа объектов. +POISSON = ПУАССОН ## Возвращает распределение Пуассона. +PROB = ВЕРОЯТНОСТЬ ## Возвращает вероятность того, что значение из диапазона находится внутри заданных пределов. +QUARTILE = КВАРТИЛЬ ## Возвращает квартиль множества данных. +RANK = РАНГ ## Возвращает ранг числа в списке чисел. +RSQ = КВПИРСОН ## Возвращает квадрат коэффициента корреляции Пирсона. +SKEW = СКОС ## Возвращает асимметрию распределения. +SLOPE = НАКЛОН ## Возвращает наклон линии линейной регрессии. +SMALL = НАИМЕНЬШИЙ ## Возвращает k-ое наименьшее значение в множестве данных. +STANDARDIZE = НОРМАЛИЗАЦИЯ ## Возвращает нормализованное значение. +STDEV = СТАНДОТКЛОН ## Оценивает стандартное отклонение по выборке. +STDEVA = СТАНДОТКЛОНА ## Оценивает стандартное отклонение по выборке, включая числа, текст и логические значения. +STDEVP = СТАНДОТКЛОНП ## Вычисляет стандартное отклонение по генеральной совокупности. +STDEVPA = СТАНДОТКЛОНПА ## Вычисляет стандартное отклонение по генеральной совокупности, включая числа, текст и логические значения. +STEYX = СТОШYX ## Возвращает стандартную ошибку предсказанных значений y для каждого значения x в регрессии. +TDIST = СТЬЮДРАСП ## Возвращает t-распределение Стьюдента. +TINV = СТЬЮДРАСПОБР ## Возвращает обратное t-распределение Стьюдента. +TREND = ТЕНДЕНЦИЯ ## Возвращает значения в соответствии с линейным трендом. +TRIMMEAN = УРЕЗСРЕДНЕЕ ## Возвращает среднее внутренности множества данных. +TTEST = ТТЕСТ ## Возвращает вероятность, соответствующую критерию Стьюдента. +VAR = ДИСП ## Оценивает дисперсию по выборке. +VARA = ДИСПА ## Оценивает дисперсию по выборке, включая числа, текст и логические значения. +VARP = ДИСПР ## Вычисляет дисперсию для генеральной совокупности. +VARPA = ДИСПРА ## Вычисляет дисперсию для генеральной совокупности, включая числа, текст и логические значения. +WEIBULL = ВЕЙБУЛЛ ## Возвращает распределение Вейбулла. +ZTEST = ZТЕСТ ## Возвращает двустороннее P-значение z-теста. + + +## +## Text functions Текстовые функции +## +ASC = ASC ## Для языков с двухбайтовыми наборами знаков (например, катакана) преобразует полноширинные (двухбайтовые) знаки в полуширинные (однобайтовые). +BAHTTEXT = БАТТЕКСТ ## Преобразует число в текст, используя денежный формат ß (БАТ). +CHAR = СИМВОЛ ## Возвращает знак с заданным кодом. +CLEAN = ПЕЧСИМВ ## Удаляет все непечатаемые знаки из текста. +CODE = КОДСИМВ ## Возвращает числовой код первого знака в текстовой строке. +CONCATENATE = СЦЕПИТЬ ## Объединяет несколько текстовых элементов в один. +DOLLAR = РУБЛЬ ## Преобразует число в текст, используя денежный формат. +EXACT = СОВПАД ## Проверяет идентичность двух текстовых значений. +FIND = НАЙТИ ## Ищет вхождения одного текстового значения в другом (с учетом регистра). +FINDB = НАЙТИБ ## Ищет вхождения одного текстового значения в другом (с учетом регистра). +FIXED = ФИКСИРОВАННЫЙ ## Форматирует число и преобразует его в текст с заданным числом десятичных знаков. +JIS = JIS ## Для языков с двухбайтовыми наборами знаков (например, катакана) преобразует полуширинные (однобайтовые) знаки в текстовой строке в полноширинные (двухбайтовые). +LEFT = ЛЕВСИМВ ## Возвращает крайние слева знаки текстового значения. +LEFTB = ЛЕВБ ## Возвращает крайние слева знаки текстового значения. +LEN = ДЛСТР ## Возвращает количество знаков в текстовой строке. +LENB = ДЛИНБ ## Возвращает количество знаков в текстовой строке. +LOWER = СТРОЧН ## Преобразует все буквы текста в строчные. +MID = ПСТР ## Возвращает заданное число знаков из строки текста, начиная с указанной позиции. +MIDB = ПСТРБ ## Возвращает заданное число знаков из строки текста, начиная с указанной позиции. +PHONETIC = PHONETIC ## Извлекает фонетические (фуригана) знаки из текстовой строки. +PROPER = ПРОПНАЧ ## Преобразует первую букву в каждом слове текста в прописную. +REPLACE = ЗАМЕНИТЬ ## Заменяет знаки в тексте. +REPLACEB = ЗАМЕНИТЬБ ## Заменяет знаки в тексте. +REPT = ПОВТОР ## Повторяет текст заданное число раз. +RIGHT = ПРАВСИМВ ## Возвращает крайние справа знаки текстовой строки. +RIGHTB = ПРАВБ ## Возвращает крайние справа знаки текстовой строки. +SEARCH = ПОИСК ## Ищет вхождения одного текстового значения в другом (без учета регистра). +SEARCHB = ПОИСКБ ## Ищет вхождения одного текстового значения в другом (без учета регистра). +SUBSTITUTE = ПОДСТАВИТЬ ## Заменяет в текстовой строке старый текст новым. +T = Т ## Преобразует аргументы в текст. +TEXT = ТЕКСТ ## Форматирует число и преобразует его в текст. +TRIM = СЖПРОБЕЛЫ ## Удаляет из текста пробелы. +UPPER = ПРОПИСН ## Преобразует все буквы текста в прописные. +VALUE = ЗНАЧЕН ## Преобразует текстовый аргумент в число. diff --git a/extend/PHPExcel/PHPExcel/locale/sv/config b/extend/PHPExcel/PHPExcel/locale/sv/config new file mode 100644 index 0000000..726f771 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/sv/config @@ -0,0 +1,47 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = kr + + +## +## Excel Error Codes (For future use) +## +NULL = #Skärning! +DIV0 = #Division/0! +VALUE = #Värdefel! +REF = #Referens! +NAME = #Namn? +NUM = #Ogiltigt! +NA = #Saknas! diff --git a/extend/PHPExcel/PHPExcel/locale/sv/functions b/extend/PHPExcel/PHPExcel/locale/sv/functions new file mode 100644 index 0000000..73b2deb --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/sv/functions @@ -0,0 +1,408 @@ +## +## Add-in and Automation functions Tilläggs- och automatiseringsfunktioner +## +GETPIVOTDATA = HÄMTA.PIVOTDATA ## Returnerar data som lagrats i en pivottabellrapport + + +## +## Cube functions Kubfunktioner +## +CUBEKPIMEMBER = KUBKPIMEDLEM ## Returnerar namn, egenskap och mått för en KPI och visar namnet och egenskapen i cellen. En KPI, eller prestandaindikator, är ett kvantifierbart mått, t.ex. månatlig bruttovinst eller personalomsättning per kvartal, som används för att analysera ett företags resultat. +CUBEMEMBER = KUBMEDLEM ## Returnerar en medlem eller ett par i en kubhierarki. Används för att verifiera att medlemmen eller paret finns i kuben. +CUBEMEMBERPROPERTY = KUBMEDLEMSEGENSKAP ## Returnerar värdet för en medlemsegenskap i kuben. Används för att verifiera att ett medlemsnamn finns i kuben, samt för att returnera den angivna egenskapen för medlemmen. +CUBERANKEDMEMBER = KUBRANGORDNADMEDLEM ## Returnerar den n:te, eller rangordnade, medlemmen i en uppsättning. Används för att returnera ett eller flera element i en uppsättning, till exempelvis den bästa försäljaren eller de tio bästa eleverna. +CUBESET = KUBINSTÄLLNING ## Definierar en beräknad uppsättning medlemmar eller par genom att skicka ett bestämt uttryck till kuben på servern, som skapar uppsättningen och sedan returnerar den till Microsoft Office Excel. +CUBESETCOUNT = KUBINSTÄLLNINGANTAL ## Returnerar antalet objekt i en uppsättning. +CUBEVALUE = KUBVÄRDE ## Returnerar ett mängdvärde från en kub. + + +## +## Database functions Databasfunktioner +## +DAVERAGE = DMEDEL ## Returnerar medelvärdet av databasposterna +DCOUNT = DANTAL ## Räknar antalet celler som innehåller tal i en databas +DCOUNTA = DANTALV ## Räknar ifyllda celler i en databas +DGET = DHÄMTA ## Hämtar en enstaka post från en databas som uppfyller de angivna villkoren +DMAX = DMAX ## Returnerar det största värdet från databasposterna +DMIN = DMIN ## Returnerar det minsta värdet från databasposterna +DPRODUCT = DPRODUKT ## Multiplicerar värdena i ett visst fält i poster som uppfyller villkoret +DSTDEV = DSTDAV ## Uppskattar standardavvikelsen baserat på ett urval av databasposterna +DSTDEVP = DSTDAVP ## Beräknar standardavvikelsen utifrån hela populationen av valda databasposter +DSUM = DSUMMA ## Summerar talen i kolumnfält i databasposter som uppfyller villkoret +DVAR = DVARIANS ## Uppskattar variansen baserat på ett urval av databasposterna +DVARP = DVARIANSP ## Beräknar variansen utifrån hela populationen av valda databasposter + + +## +## Date and time functions Tid- och datumfunktioner +## +DATE = DATUM ## Returnerar ett serienummer för ett visst datum +DATEVALUE = DATUMVÄRDE ## Konverterar ett datum i textformat till ett serienummer +DAY = DAG ## Konverterar ett serienummer till dag i månaden +DAYS360 = DAGAR360 ## Beräknar antalet dagar mellan två datum baserat på ett 360-dagarsår +EDATE = EDATUM ## Returnerar serienumret för ett datum som infaller ett visst antal månader före eller efter startdatumet +EOMONTH = SLUTMÅNAD ## Returnerar serienumret för sista dagen i månaden ett visst antal månader tidigare eller senare +HOUR = TIMME ## Konverterar ett serienummer till en timme +MINUTE = MINUT ## Konverterar ett serienummer till en minut +MONTH = MÅNAD ## Konverterar ett serienummer till en månad +NETWORKDAYS = NETTOARBETSDAGAR ## Returnerar antalet hela arbetsdagar mellan två datum +NOW = NU ## Returnerar serienumret för dagens datum och aktuell tid +SECOND = SEKUND ## Konverterar ett serienummer till en sekund +TIME = KLOCKSLAG ## Returnerar serienumret för en viss tid +TIMEVALUE = TIDVÄRDE ## Konverterar en tid i textformat till ett serienummer +TODAY = IDAG ## Returnerar serienumret för dagens datum +WEEKDAY = VECKODAG ## Konverterar ett serienummer till en dag i veckan +WEEKNUM = VECKONR ## Konverterar ett serienummer till ett veckonummer +WORKDAY = ARBETSDAGAR ## Returnerar serienumret för ett datum ett visst antal arbetsdagar tidigare eller senare +YEAR = ÅR ## Konverterar ett serienummer till ett år +YEARFRAC = ÅRDEL ## Returnerar en del av ett år som representerar antalet hela dagar mellan start- och slutdatum + + +## +## Engineering functions Tekniska funktioner +## +BESSELI = BESSELI ## Returnerar den modifierade Bessel-funktionen In(x) +BESSELJ = BESSELJ ## Returnerar Bessel-funktionen Jn(x) +BESSELK = BESSELK ## Returnerar den modifierade Bessel-funktionen Kn(x) +BESSELY = BESSELY ## Returnerar Bessel-funktionen Yn(x) +BIN2DEC = BIN.TILL.DEC ## Omvandlar ett binärt tal till decimalt +BIN2HEX = BIN.TILL.HEX ## Omvandlar ett binärt tal till hexadecimalt +BIN2OCT = BIN.TILL.OKT ## Omvandlar ett binärt tal till oktalt +COMPLEX = KOMPLEX ## Omvandlar reella och imaginära koefficienter till ett komplext tal +CONVERT = KONVERTERA ## Omvandlar ett tal från ett måttsystem till ett annat +DEC2BIN = DEC.TILL.BIN ## Omvandlar ett decimalt tal till binärt +DEC2HEX = DEC.TILL.HEX ## Omvandlar ett decimalt tal till hexadecimalt +DEC2OCT = DEC.TILL.OKT ## Omvandlar ett decimalt tal till oktalt +DELTA = DELTA ## Testar om två värden är lika +ERF = FELF ## Returnerar felfunktionen +ERFC = FELFK ## Returnerar den komplementära felfunktionen +GESTEP = SLSTEG ## Testar om ett tal är större än ett tröskelvärde +HEX2BIN = HEX.TILL.BIN ## Omvandlar ett hexadecimalt tal till binärt +HEX2DEC = HEX.TILL.DEC ## Omvandlar ett hexadecimalt tal till decimalt +HEX2OCT = HEX.TILL.OKT ## Omvandlar ett hexadecimalt tal till oktalt +IMABS = IMABS ## Returnerar absolutvärdet (modulus) för ett komplext tal +IMAGINARY = IMAGINÄR ## Returnerar den imaginära koefficienten för ett komplext tal +IMARGUMENT = IMARGUMENT ## Returnerar det komplexa talets argument, en vinkel uttryckt i radianer +IMCONJUGATE = IMKONJUGAT ## Returnerar det komplexa talets konjugat +IMCOS = IMCOS ## Returnerar cosinus för ett komplext tal +IMDIV = IMDIV ## Returnerar kvoten för två komplexa tal +IMEXP = IMEUPPHÖJT ## Returnerar exponenten för ett komplext tal +IMLN = IMLN ## Returnerar den naturliga logaritmen för ett komplext tal +IMLOG10 = IMLOG10 ## Returnerar 10-logaritmen för ett komplext tal +IMLOG2 = IMLOG2 ## Returnerar 2-logaritmen för ett komplext tal +IMPOWER = IMUPPHÖJT ## Returnerar ett komplext tal upphöjt till en exponent +IMPRODUCT = IMPRODUKT ## Returnerar produkten av komplexa tal +IMREAL = IMREAL ## Returnerar den reella koefficienten för ett komplext tal +IMSIN = IMSIN ## Returnerar sinus för ett komplext tal +IMSQRT = IMROT ## Returnerar kvadratroten av ett komplext tal +IMSUB = IMDIFF ## Returnerar differensen mellan två komplexa tal +IMSUM = IMSUM ## Returnerar summan av komplexa tal +OCT2BIN = OKT.TILL.BIN ## Omvandlar ett oktalt tal till binärt +OCT2DEC = OKT.TILL.DEC ## Omvandlar ett oktalt tal till decimalt +OCT2HEX = OKT.TILL.HEX ## Omvandlar ett oktalt tal till hexadecimalt + + +## +## Financial functions Finansiella funktioner +## +ACCRINT = UPPLRÄNTA ## Returnerar den upplupna räntan för värdepapper med periodisk ränta +ACCRINTM = UPPLOBLRÄNTA ## Returnerar den upplupna räntan för ett värdepapper som ger avkastning på förfallodagen +AMORDEGRC = AMORDEGRC ## Returnerar avskrivningen för varje redovisningsperiod med hjälp av en avskrivningskoefficient +AMORLINC = AMORLINC ## Returnerar avskrivningen för varje redovisningsperiod +COUPDAYBS = KUPDAGBB ## Returnerar antal dagar från början av kupongperioden till likviddagen +COUPDAYS = KUPDAGARS ## Returnerar antalet dagar i kupongperioden som innehåller betalningsdatumet +COUPDAYSNC = KUPDAGNK ## Returnerar antalet dagar från betalningsdatumet till nästa kupongdatum +COUPNCD = KUPNKD ## Returnerar nästa kupongdatum efter likviddagen +COUPNUM = KUPANT ## Returnerar kuponger som förfaller till betalning mellan likviddagen och förfallodagen +COUPPCD = KUPFKD ## Returnerar föregående kupongdatum före likviddagen +CUMIPMT = KUMRÄNTA ## Returnerar den ackumulerade räntan som betalats mellan två perioder +CUMPRINC = KUMPRIS ## Returnerar det ackumulerade kapitalbeloppet som betalats på ett lån mellan två perioder +DB = DB ## Returnerar avskrivningen för en tillgång under en angiven tid enligt metoden för fast degressiv avskrivning +DDB = DEGAVSKR ## Returnerar en tillgångs värdeminskning under en viss period med hjälp av dubbel degressiv avskrivning eller någon annan metod som du anger +DISC = DISK ## Returnerar diskonteringsräntan för ett värdepapper +DOLLARDE = DECTAL ## Omvandlar ett pris uttryckt som ett bråk till ett decimaltal +DOLLARFR = BRÅK ## Omvandlar ett pris i kronor uttryckt som ett decimaltal till ett bråk +DURATION = LÖPTID ## Returnerar den årliga löptiden för en säkerhet med periodiska räntebetalningar +EFFECT = EFFRÄNTA ## Returnerar den årliga effektiva räntesatsen +FV = SLUTVÄRDE ## Returnerar det framtida värdet på en investering +FVSCHEDULE = FÖRRÄNTNING ## Returnerar det framtida värdet av ett begynnelsekapital beräknat på olika räntenivåer +INTRATE = ÅRSRÄNTA ## Returnerar räntesatsen för ett betalt värdepapper +IPMT = RBETALNING ## Returnerar räntedelen av en betalning för en given period +IRR = IR ## Returnerar internräntan för en serie betalningar +ISPMT = RALÅN ## Beräknar räntan som har betalats under en specifik betalningsperiod +MDURATION = MLÖPTID ## Returnerar den modifierade Macauley-löptiden för ett värdepapper med det antagna nominella värdet 100 kr +MIRR = MODIR ## Returnerar internräntan där positiva och negativa betalningar finansieras med olika räntor +NOMINAL = NOMRÄNTA ## Returnerar den årliga nominella räntesatsen +NPER = PERIODER ## Returnerar antalet perioder för en investering +NPV = NETNUVÄRDE ## Returnerar nuvärdet av en serie periodiska betalningar vid en given diskonteringsränta +ODDFPRICE = UDDAFPRIS ## Returnerar priset per 100 kr nominellt värde för ett värdepapper med en udda första period +ODDFYIELD = UDDAFAVKASTNING ## Returnerar avkastningen för en säkerhet med en udda första period +ODDLPRICE = UDDASPRIS ## Returnerar priset per 100 kr nominellt värde för ett värdepapper med en udda sista period +ODDLYIELD = UDDASAVKASTNING ## Returnerar avkastningen för en säkerhet med en udda sista period +PMT = BETALNING ## Returnerar den periodiska betalningen för en annuitet +PPMT = AMORT ## Returnerar amorteringsdelen av en annuitetsbetalning för en given period +PRICE = PRIS ## Returnerar priset per 100 kr nominellt värde för ett värdepapper som ger periodisk ränta +PRICEDISC = PRISDISK ## Returnerar priset per 100 kr nominellt värde för ett diskonterat värdepapper +PRICEMAT = PRISFÖRF ## Returnerar priset per 100 kr nominellt värde för ett värdepapper som ger ränta på förfallodagen +PV = PV ## Returnerar nuvärdet av en serie lika stora periodiska betalningar +RATE = RÄNTA ## Returnerar räntesatsen per period i en annuitet +RECEIVED = BELOPP ## Returnerar beloppet som utdelas på förfallodagen för ett betalat värdepapper +SLN = LINAVSKR ## Returnerar den linjära avskrivningen för en tillgång under en period +SYD = ÅRSAVSKR ## Returnerar den årliga avskrivningssumman för en tillgång under en angiven period +TBILLEQ = SSVXEKV ## Returnerar avkastningen motsvarande en obligation för en statsskuldväxel +TBILLPRICE = SSVXPRIS ## Returnerar priset per 100 kr nominellt värde för en statsskuldväxel +TBILLYIELD = SSVXRÄNTA ## Returnerar avkastningen för en statsskuldväxel +VDB = VDEGRAVSKR ## Returnerar avskrivningen för en tillgång under en angiven period (med degressiv avskrivning) +XIRR = XIRR ## Returnerar internräntan för en serie betalningar som inte nödvändigtvis är periodiska +XNPV = XNUVÄRDE ## Returnerar det nuvarande nettovärdet för en serie betalningar som inte nödvändigtvis är periodiska +YIELD = NOMAVK ## Returnerar avkastningen för ett värdepapper som ger periodisk ränta +YIELDDISC = NOMAVKDISK ## Returnerar den årliga avkastningen för diskonterade värdepapper, exempelvis en statsskuldväxel +YIELDMAT = NOMAVKFÖRF ## Returnerar den årliga avkastningen för ett värdepapper som ger ränta på förfallodagen + + +## +## Information functions Informationsfunktioner +## +CELL = CELL ## Returnerar information om formatering, plats och innehåll i en cell +ERROR.TYPE = FEL.TYP ## Returnerar ett tal som motsvarar ett felvärde +INFO = INFO ## Returnerar information om operativsystemet +ISBLANK = ÄRREF ## Returnerar SANT om värdet är tomt +ISERR = Ä ## Returnerar SANT om värdet är ett felvärde annat än #SAKNAS! +ISERROR = ÄRFEL ## Returnerar SANT om värdet är ett felvärde +ISEVEN = ÄRJÄMN ## Returnerar SANT om talet är jämnt +ISLOGICAL = ÄREJTEXT ## Returnerar SANT om värdet är ett logiskt värde +ISNA = ÄRLOGISK ## Returnerar SANT om värdet är felvärdet #SAKNAS! +ISNONTEXT = ÄRSAKNAD ## Returnerar SANT om värdet inte är text +ISNUMBER = ÄRTAL ## Returnerar SANT om värdet är ett tal +ISODD = ÄRUDDA ## Returnerar SANT om talet är udda +ISREF = ÄRTOM ## Returnerar SANT om värdet är en referens +ISTEXT = ÄRTEXT ## Returnerar SANT om värdet är text +N = N ## Returnerar ett värde omvandlat till ett tal +NA = SAKNAS ## Returnerar felvärdet #SAKNAS! +TYPE = VÄRDETYP ## Returnerar ett tal som anger värdets datatyp + + +## +## Logical functions Logiska funktioner +## +AND = OCH ## Returnerar SANT om alla argument är sanna +FALSE = FALSKT ## Returnerar det logiska värdet FALSKT +IF = OM ## Anger vilket logiskt test som ska utföras +IFERROR = OMFEL ## Returnerar ett värde som du anger om en formel utvärderar till ett fel; annars returneras resultatet av formeln +NOT = ICKE ## Inverterar logiken för argumenten +OR = ELLER ## Returnerar SANT om något argument är SANT +TRUE = SANT ## Returnerar det logiska värdet SANT + + +## +## Lookup and reference functions Sök- och referensfunktioner +## +ADDRESS = ADRESS ## Returnerar en referens som text till en enstaka cell i ett kalkylblad +AREAS = OMRÅDEN ## Returnerar antalet områden i en referens +CHOOSE = VÄLJ ## Väljer ett värde i en lista över värden +COLUMN = KOLUMN ## Returnerar kolumnnumret för en referens +COLUMNS = KOLUMNER ## Returnerar antalet kolumner i en referens +HLOOKUP = LETAKOLUMN ## Söker i den översta raden i en matris och returnerar värdet för angiven cell +HYPERLINK = HYPERLÄNK ## Skapar en genväg eller ett hopp till ett dokument i nätverket, i ett intranät eller på Internet +INDEX = INDEX ## Använder ett index för ett välja ett värde i en referens eller matris +INDIRECT = INDIREKT ## Returnerar en referens som anges av ett textvärde +LOOKUP = LETAUPP ## Letar upp värden i en vektor eller matris +MATCH = PASSA ## Letar upp värden i en referens eller matris +OFFSET = FÖRSKJUTNING ## Returnerar en referens förskjuten i förhållande till en given referens +ROW = RAD ## Returnerar radnumret för en referens +ROWS = RADER ## Returnerar antalet rader i en referens +RTD = RTD ## Hämtar realtidsdata från ett program som stöder COM-automation (Automation: Ett sätt att arbeta med ett programs objekt från ett annat program eller utvecklingsverktyg. Detta kallades tidigare för OLE Automation, och är en branschstandard och ingår i Component Object Model (COM).) +TRANSPOSE = TRANSPONERA ## Transponerar en matris +VLOOKUP = LETARAD ## Letar i den första kolumnen i en matris och flyttar över raden för att returnera värdet för en cell + + +## +## Math and trigonometry functions Matematiska och trigonometriska funktioner +## +ABS = ABS ## Returnerar absolutvärdet av ett tal +ACOS = ARCCOS ## Returnerar arcus cosinus för ett tal +ACOSH = ARCCOSH ## Returnerar inverterad hyperbolisk cosinus för ett tal +ASIN = ARCSIN ## Returnerar arcus cosinus för ett tal +ASINH = ARCSINH ## Returnerar hyperbolisk arcus sinus för ett tal +ATAN = ARCTAN ## Returnerar arcus tangens för ett tal +ATAN2 = ARCTAN2 ## Returnerar arcus tangens för en x- och en y- koordinat +ATANH = ARCTANH ## Returnerar hyperbolisk arcus tangens för ett tal +CEILING = RUNDA.UPP ## Avrundar ett tal till närmaste heltal eller närmaste signifikanta multipel +COMBIN = KOMBIN ## Returnerar antalet kombinationer för ett givet antal objekt +COS = COS ## Returnerar cosinus för ett tal +COSH = COSH ## Returnerar hyperboliskt cosinus för ett tal +DEGREES = GRADER ## Omvandlar radianer till grader +EVEN = JÄMN ## Avrundar ett tal uppåt till närmaste heltal +EXP = EXP ## Returnerar e upphöjt till ett givet tal +FACT = FAKULTET ## Returnerar fakulteten för ett tal +FACTDOUBLE = DUBBELFAKULTET ## Returnerar dubbelfakulteten för ett tal +FLOOR = RUNDA.NED ## Avrundar ett tal nedåt mot noll +GCD = SGD ## Returnerar den största gemensamma nämnaren +INT = HELTAL ## Avrundar ett tal nedåt till närmaste heltal +LCM = MGM ## Returnerar den minsta gemensamma multipeln +LN = LN ## Returnerar den naturliga logaritmen för ett tal +LOG = LOG ## Returnerar logaritmen för ett tal för en given bas +LOG10 = LOG10 ## Returnerar 10-logaritmen för ett tal +MDETERM = MDETERM ## Returnerar matrisen som är avgörandet av en matris +MINVERSE = MINVERT ## Returnerar matrisinversen av en matris +MMULT = MMULT ## Returnerar matrisprodukten av två matriser +MOD = REST ## Returnerar resten vid en division +MROUND = MAVRUNDA ## Returnerar ett tal avrundat till en given multipel +MULTINOMIAL = MULTINOMIAL ## Returnerar multinomialen för en uppsättning tal +ODD = UDDA ## Avrundar ett tal uppåt till närmaste udda heltal +PI = PI ## Returnerar värdet pi +POWER = UPPHÖJT.TILL ## Returnerar resultatet av ett tal upphöjt till en exponent +PRODUCT = PRODUKT ## Multiplicerar argumenten +QUOTIENT = KVOT ## Returnerar heltalsdelen av en division +RADIANS = RADIANER ## Omvandlar grader till radianer +RAND = SLUMP ## Returnerar ett slumptal mellan 0 och 1 +RANDBETWEEN = SLUMP.MELLAN ## Returnerar ett slumptal mellan de tal som du anger +ROMAN = ROMERSK ## Omvandlar vanliga (arabiska) siffror till romerska som text +ROUND = AVRUNDA ## Avrundar ett tal till ett angivet antal siffror +ROUNDDOWN = AVRUNDA.NEDÅT ## Avrundar ett tal nedåt mot noll +ROUNDUP = AVRUNDA.UPPÅT ## Avrundar ett tal uppåt, från noll +SERIESSUM = SERIESUMMA ## Returnerar summan av en potensserie baserat på formeln +SIGN = TECKEN ## Returnerar tecknet för ett tal +SIN = SIN ## Returnerar sinus för en given vinkel +SINH = SINH ## Returnerar hyperbolisk sinus för ett tal +SQRT = ROT ## Returnerar den positiva kvadratroten +SQRTPI = ROTPI ## Returnerar kvadratroten för (tal * pi) +SUBTOTAL = DELSUMMA ## Returnerar en delsumma i en lista eller databas +SUM = SUMMA ## Summerar argumenten +SUMIF = SUMMA.OM ## Summerar celler enligt ett angivet villkor +SUMIFS = SUMMA.OMF ## Lägger till cellerna i ett område som uppfyller flera kriterier +SUMPRODUCT = PRODUKTSUMMA ## Returnerar summan av produkterna i motsvarande matriskomponenter +SUMSQ = KVADRATSUMMA ## Returnerar summan av argumentens kvadrater +SUMX2MY2 = SUMMAX2MY2 ## Returnerar summan av differensen mellan kvadraterna för motsvarande värden i två matriser +SUMX2PY2 = SUMMAX2PY2 ## Returnerar summan av summan av kvadraterna av motsvarande värden i två matriser +SUMXMY2 = SUMMAXMY2 ## Returnerar summan av kvadraten av skillnaden mellan motsvarande värden i två matriser +TAN = TAN ## Returnerar tangens för ett tal +TANH = TANH ## Returnerar hyperbolisk tangens för ett tal +TRUNC = AVKORTA ## Avkortar ett tal till ett heltal + + +## +## Statistical functions Statistiska funktioner +## +AVEDEV = MEDELAVV ## Returnerar medelvärdet för datapunkters absoluta avvikelse från deras medelvärde +AVERAGE = MEDEL ## Returnerar medelvärdet av argumenten +AVERAGEA = AVERAGEA ## Returnerar medelvärdet av argumenten, inklusive tal, text och logiska värden +AVERAGEIF = MEDELOM ## Returnerar medelvärdet (aritmetiskt medelvärde) för alla celler i ett område som uppfyller ett givet kriterium +AVERAGEIFS = MEDELOMF ## Returnerar medelvärdet (det aritmetiska medelvärdet) för alla celler som uppfyller flera villkor. +BETADIST = BETAFÖRD ## Returnerar den kumulativa betafördelningsfunktionen +BETAINV = BETAINV ## Returnerar inversen till den kumulativa fördelningsfunktionen för en viss betafördelning +BINOMDIST = BINOMFÖRD ## Returnerar den individuella binomialfördelningen +CHIDIST = CHI2FÖRD ## Returnerar den ensidiga sannolikheten av c2-fördelningen +CHIINV = CHI2INV ## Returnerar inversen av chi2-fördelningen +CHITEST = CHI2TEST ## Returnerar oberoendetesten +CONFIDENCE = KONFIDENS ## Returnerar konfidensintervallet för en populations medelvärde +CORREL = KORREL ## Returnerar korrelationskoefficienten mellan två datamängder +COUNT = ANTAL ## Räknar hur många tal som finns bland argumenten +COUNTA = ANTALV ## Räknar hur många värden som finns bland argumenten +COUNTBLANK = ANTAL.TOMMA ## Räknar antalet tomma celler i ett område +COUNTIF = ANTAL.OM ## Räknar antalet celler i ett område som uppfyller angivna villkor. +COUNTIFS = ANTAL.OMF ## Räknar antalet celler i ett område som uppfyller flera villkor. +COVAR = KOVAR ## Returnerar kovariansen, d.v.s. medelvärdet av produkterna för parade avvikelser +CRITBINOM = KRITBINOM ## Returnerar det minsta värdet för vilket den kumulativa binomialfördelningen är mindre än eller lika med ett villkorsvärde +DEVSQ = KVADAVV ## Returnerar summan av kvadrater på avvikelser +EXPONDIST = EXPONFÖRD ## Returnerar exponentialfördelningen +FDIST = FFÖRD ## Returnerar F-sannolikhetsfördelningen +FINV = FINV ## Returnerar inversen till F-sannolikhetsfördelningen +FISHER = FISHER ## Returnerar Fisher-transformationen +FISHERINV = FISHERINV ## Returnerar inversen till Fisher-transformationen +FORECAST = PREDIKTION ## Returnerar ett värde längs en linjär trendlinje +FREQUENCY = FREKVENS ## Returnerar en frekvensfördelning som en lodrät matris +FTEST = FTEST ## Returnerar resultatet av en F-test +GAMMADIST = GAMMAFÖRD ## Returnerar gammafördelningen +GAMMAINV = GAMMAINV ## Returnerar inversen till den kumulativa gammafördelningen +GAMMALN = GAMMALN ## Returnerar den naturliga logaritmen för gammafunktionen, G(x) +GEOMEAN = GEOMEDEL ## Returnerar det geometriska medelvärdet +GROWTH = EXPTREND ## Returnerar värden längs en exponentiell trend +HARMEAN = HARMMEDEL ## Returnerar det harmoniska medelvärdet +HYPGEOMDIST = HYPGEOMFÖRD ## Returnerar den hypergeometriska fördelningen +INTERCEPT = SKÄRNINGSPUNKT ## Returnerar skärningspunkten för en linjär regressionslinje +KURT = TOPPIGHET ## Returnerar toppigheten av en mängd data +LARGE = STÖRSTA ## Returnerar det n:te största värdet i en mängd data +LINEST = REGR ## Returnerar parametrar till en linjär trendlinje +LOGEST = EXPREGR ## Returnerar parametrarna i en exponentiell trend +LOGINV = LOGINV ## Returnerar inversen till den lognormala fördelningen +LOGNORMDIST = LOGNORMFÖRD ## Returnerar den kumulativa lognormala fördelningen +MAX = MAX ## Returnerar det största värdet i en lista av argument +MAXA = MAXA ## Returnerar det största värdet i en lista av argument, inklusive tal, text och logiska värden +MEDIAN = MEDIAN ## Returnerar medianen för angivna tal +MIN = MIN ## Returnerar det minsta värdet i en lista med argument +MINA = MINA ## Returnerar det minsta värdet i en lista över argument, inklusive tal, text och logiska värden +MODE = TYPVÄRDE ## Returnerar det vanligaste värdet i en datamängd +NEGBINOMDIST = NEGBINOMFÖRD ## Returnerar den negativa binomialfördelningen +NORMDIST = NORMFÖRD ## Returnerar den kumulativa normalfördelningen +NORMINV = NORMINV ## Returnerar inversen till den kumulativa normalfördelningen +NORMSDIST = NORMSFÖRD ## Returnerar den kumulativa standardnormalfördelningen +NORMSINV = NORMSINV ## Returnerar inversen till den kumulativa standardnormalfördelningen +PEARSON = PEARSON ## Returnerar korrelationskoefficienten till Pearsons momentprodukt +PERCENTILE = PERCENTIL ## Returnerar den n:te percentilen av värden i ett område +PERCENTRANK = PROCENTRANG ## Returnerar procentrangen för ett värde i en datamängd +PERMUT = PERMUT ## Returnerar antal permutationer för ett givet antal objekt +POISSON = POISSON ## Returnerar Poisson-fördelningen +PROB = SANNOLIKHET ## Returnerar sannolikheten att värden i ett område ligger mellan två gränser +QUARTILE = KVARTIL ## Returnerar kvartilen av en mängd data +RANK = RANG ## Returnerar rangordningen för ett tal i en lista med tal +RSQ = RKV ## Returnerar kvadraten av Pearsons produktmomentkorrelationskoefficient +SKEW = SNEDHET ## Returnerar snedheten för en fördelning +SLOPE = LUTNING ## Returnerar lutningen på en linjär regressionslinje +SMALL = MINSTA ## Returnerar det n:te minsta värdet i en mängd data +STANDARDIZE = STANDARDISERA ## Returnerar ett normaliserat värde +STDEV = STDAV ## Uppskattar standardavvikelsen baserat på ett urval +STDEVA = STDEVA ## Uppskattar standardavvikelsen baserat på ett urval, inklusive tal, text och logiska värden +STDEVP = STDAVP ## Beräknar standardavvikelsen baserat på hela populationen +STDEVPA = STDEVPA ## Beräknar standardavvikelsen baserat på hela populationen, inklusive tal, text och logiska värden +STEYX = STDFELYX ## Returnerar standardfelet för ett förutspått y-värde för varje x-värde i regressionen +TDIST = TFÖRD ## Returnerar Students t-fördelning +TINV = TINV ## Returnerar inversen till Students t-fördelning +TREND = TREND ## Returnerar värden längs en linjär trend +TRIMMEAN = TRIMMEDEL ## Returnerar medelvärdet av mittpunkterna i en datamängd +TTEST = TTEST ## Returnerar sannolikheten beräknad ur Students t-test +VAR = VARIANS ## Uppskattar variansen baserat på ett urval +VARA = VARA ## Uppskattar variansen baserat på ett urval, inklusive tal, text och logiska värden +VARP = VARIANSP ## Beräknar variansen baserat på hela populationen +VARPA = VARPA ## Beräknar variansen baserat på hela populationen, inklusive tal, text och logiska värden +WEIBULL = WEIBULL ## Returnerar Weibull-fördelningen +ZTEST = ZTEST ## Returnerar det ensidiga sannolikhetsvärdet av ett z-test + + +## +## Text functions Textfunktioner +## +ASC = ASC ## Ändrar helbredds (dubbel byte) engelska bokstäver eller katakana inom en teckensträng till tecken med halvt breddsteg (enkel byte) +BAHTTEXT = BAHTTEXT ## Omvandlar ett tal till text med valutaformatet ß (baht) +CHAR = TECKENKOD ## Returnerar tecknet som anges av kod +CLEAN = STÄDA ## Tar bort alla icke utskrivbara tecken i en text +CODE = KOD ## Returnerar en numerisk kod för det första tecknet i en textsträng +CONCATENATE = SAMMANFOGA ## Sammanfogar flera textdelar till en textsträng +DOLLAR = VALUTA ## Omvandlar ett tal till text med valutaformat +EXACT = EXAKT ## Kontrollerar om två textvärden är identiska +FIND = HITTA ## Hittar en text i en annan (skiljer på gemener och versaler) +FINDB = HITTAB ## Hittar en text i en annan (skiljer på gemener och versaler) +FIXED = FASTTAL ## Formaterar ett tal som text med ett fast antal decimaler +JIS = JIS ## Ändrar halvbredds (enkel byte) engelska bokstäver eller katakana inom en teckensträng till tecken med helt breddsteg (dubbel byte) +LEFT = VÄNSTER ## Returnerar tecken längst till vänster i en sträng +LEFTB = VÄNSTERB ## Returnerar tecken längst till vänster i en sträng +LEN = LÄNGD ## Returnerar antalet tecken i en textsträng +LENB = LÄNGDB ## Returnerar antalet tecken i en textsträng +LOWER = GEMENER ## Omvandlar text till gemener +MID = EXTEXT ## Returnerar angivet antal tecken från en text med början vid den position som du anger +MIDB = EXTEXTB ## Returnerar angivet antal tecken från en text med början vid den position som du anger +PHONETIC = PHONETIC ## Returnerar de fonetiska (furigana) tecknen i en textsträng +PROPER = INITIAL ## Ändrar första bokstaven i varje ord i ett textvärde till versal +REPLACE = ERSÄTT ## Ersätter tecken i text +REPLACEB = ERSÄTTB ## Ersätter tecken i text +REPT = REP ## Upprepar en text ett bestämt antal gånger +RIGHT = HÖGER ## Returnerar tecken längst till höger i en sträng +RIGHTB = HÖGERB ## Returnerar tecken längst till höger i en sträng +SEARCH = SÖK ## Hittar ett textvärde i ett annat (skiljer inte på gemener och versaler) +SEARCHB = SÖKB ## Hittar ett textvärde i ett annat (skiljer inte på gemener och versaler) +SUBSTITUTE = BYT.UT ## Ersätter gammal text med ny text i en textsträng +T = T ## Omvandlar argumenten till text +TEXT = TEXT ## Formaterar ett tal och omvandlar det till text +TRIM = RENSA ## Tar bort blanksteg från text +UPPER = VERSALER ## Omvandlar text till versaler +VALUE = TEXTNUM ## Omvandlar ett textargument till ett tal diff --git a/extend/PHPExcel/PHPExcel/locale/tr/config b/extend/PHPExcel/PHPExcel/locale/tr/config new file mode 100644 index 0000000..b69d425 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/tr/config @@ -0,0 +1,47 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Settings +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## + + +ArgumentSeparator = ; + + +## +## (For future use) +## +currencySymbol = YTL + + +## +## Excel Error Codes (For future use) +## +NULL = #BOŞ! +DIV0 = #SAYI/0! +VALUE = #DEĞER! +REF = #BAŞV! +NAME = #AD? +NUM = #SAYI! +NA = #YOK diff --git a/extend/PHPExcel/PHPExcel/locale/tr/functions b/extend/PHPExcel/PHPExcel/locale/tr/functions new file mode 100644 index 0000000..45d7df1 --- /dev/null +++ b/extend/PHPExcel/PHPExcel/locale/tr/functions @@ -0,0 +1,438 @@ +## +## PHPExcel +## +## Copyright (c) 2006 - 2013 PHPExcel +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## @category PHPExcel +## @package PHPExcel_Calculation +## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) +## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL +## @version ##VERSION##, ##DATE## +## +## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ +## +## + + +## +## Add-in and Automation functions Eklenti ve Otomasyon fonksiyonları +## +GETPIVOTDATA = ÖZETVERİAL ## Bir Özet Tablo raporunda saklanan verileri verir. + + +## +## Cube functions Küp işlevleri +## +CUBEKPIMEMBER = KÜPKPIÜYE ## Kilit performans göstergesi (KPI-Key Performance Indicator) adını, özelliğini ve ölçüsünü verir ve hücredeki ad ve özelliği gösterir. KPI, bir kurumun performansını izlemek için kullanılan aylık brüt kâr ya da üç aylık çalışan giriş çıkışları gibi ölçülebilen bir birimdir. +CUBEMEMBER = KÜPÜYE ## Bir küp hiyerarşisinde bir üyeyi veya kaydı verir. Üye veya kaydın küpte varolduğunu doğrulamak için kullanılır. +CUBEMEMBERPROPERTY = KÜPÜYEÖZELLİĞİ ## Bir küpte bir üyenin özelliğinin değerini verir. Küp içinde üye adının varlığını doğrulamak ve bu üyenin belli özelliklerini getirmek için kullanılır. +CUBERANKEDMEMBER = KÜPÜYESIRASI ## Bir küme içindeki üyenin derecesini veya kaçıncı olduğunu verir. En iyi satış elemanı, veya en iyi on öğrenci gibi bir kümedeki bir veya daha fazla öğeyi getirmek için kullanılır. +CUBESET = KÜPKÜME ## Kümeyi oluşturan ve ardından bu kümeyi Microsoft Office Excel'e getiren sunucudaki küpe küme ifadelerini göndererek hesaplanan üye veya kayıt kümesini tanımlar. +CUBESETCOUNT = KÜPKÜMESAY ## Bir kümedeki öğelerin sayısını getirir. +CUBEVALUE = KÜPDEĞER ## Bir küpten toplam değeri getirir. + + +## +## Database functions Veritabanı işlevleri +## +DAVERAGE = VSEÇORT ## Seçili veritabanı girdilerinin ortalamasını verir. +DCOUNT = VSEÇSAY ## Veritabanında sayı içeren hücre sayısını hesaplar. +DCOUNTA = VSEÇSAYDOLU ## Veritabanındaki boş olmayan hücreleri sayar. +DGET = VAL ## Veritabanından, belirtilen ölçütlerle eşleşen tek bir rapor çıkarır. +DMAX = VSEÇMAK ## Seçili veritabanı girişlerinin en yüksek değerini verir. +DMIN = VSEÇMİN ## Seçili veritabanı girişlerinin en düşük değerini verir. +DPRODUCT = VSEÇÇARP ## Kayıtların belli bir alanında bulunan, bir veritabanındaki ölçütlerle eşleşen değerleri çarpar. +DSTDEV = VSEÇSTDSAPMA ## Seçili veritabanı girişlerinden oluşan bir örneğe dayanarak, standart sapmayı tahmin eder. +DSTDEVP = VSEÇSTDSAPMAS ## Standart sapmayı, seçili veritabanı girişlerinin tüm popülasyonunu esas alarak hesaplar. +DSUM = VSEÇTOPLA ## Kayıtların alan sütununda bulunan, ölçütle eşleşen sayıları toplar. +DVAR = VSEÇVAR ## Seçili veritabanı girişlerinden oluşan bir örneği esas alarak farkı tahmin eder. +DVARP = VSEÇVARS ## Seçili veritabanı girişlerinin tüm popülasyonunu esas alarak farkı hesaplar. + + +## +## Date and time functions Tarih ve saat işlevleri +## +DATE = TARİH ## Belirli bir tarihin seri numarasını verir. +DATEVALUE = TARİHSAYISI ## Metin biçimindeki bir tarihi seri numarasına dönüştürür. +DAY = GÜN ## Seri numarasını, ayın bir gününe dönüştürür. +DAYS360 = GÜN360 ## İki tarih arasındaki gün sayısını, 360 günlük yılı esas alarak hesaplar. +EDATE = SERİTARİH ## Başlangıç tarihinden itibaren, belirtilen ay sayısından önce veya sonraki tarihin seri numarasını verir. +EOMONTH = SERİAY ## Belirtilen sayıda ay önce veya sonraki ayın son gününün seri numarasını verir. +HOUR = SAAT ## Bir seri numarasını saate dönüştürür. +MINUTE = DAKİKA ## Bir seri numarasını dakikaya dönüştürür. +MONTH = AY ## Bir seri numarasını aya dönüştürür. +NETWORKDAYS = TAMİŞGÜNÜ ## İki tarih arasındaki tam çalışma günlerinin sayısını verir. +NOW = ŞİMDİ ## Geçerli tarihin ve saatin seri numarasını verir. +SECOND = SANİYE ## Bir seri numarasını saniyeye dönüştürür. +TIME = ZAMAN ## Belirli bir zamanın seri numarasını verir. +TIMEVALUE = ZAMANSAYISI ## Metin biçimindeki zamanı seri numarasına dönüştürür. +TODAY = BUGÜN ## Bugünün tarihini seri numarasına dönüştürür. +WEEKDAY = HAFTANINGÜNÜ ## Bir seri numarasını, haftanın gününe dönüştürür. +WEEKNUM = HAFTASAY ## Dizisel değerini, haftanın yıl içinde bulunduğu konumu sayısal olarak gösteren sayıya dönüştürür. +WORKDAY = İŞGÜNÜ ## Belirtilen sayıda çalışma günü öncesinin ya da sonrasının tarihinin seri numarasını verir. +YEAR = YIL ## Bir seri numarasını yıla dönüştürür. +YEARFRAC = YILORAN ## Başlangıç_tarihi ve bitiş_tarihi arasındaki tam günleri gösteren yıl kesrini verir. + + +## +## Engineering functions Mühendislik işlevleri +## +BESSELI = BESSELI ## Değiştirilmiş Bessel fonksiyonu In(x)'i verir. +BESSELJ = BESSELJ ## Bessel fonksiyonu Jn(x)'i verir. +BESSELK = BESSELK ## Değiştirilmiş Bessel fonksiyonu Kn(x)'i verir. +BESSELY = BESSELY ## Bessel fonksiyonu Yn(x)'i verir. +BIN2DEC = BIN2DEC ## İkili bir sayıyı, ondalık sayıya dönüştürür. +BIN2HEX = BIN2HEX ## İkili bir sayıyı, onaltılıya dönüştürür. +BIN2OCT = BIN2OCT ## İkili bir sayıyı, sekizliye dönüştürür. +COMPLEX = KARMAŞIK ## Gerçek ve sanal katsayıları, karmaşık sayıya dönüştürür. +CONVERT = ÇEVİR ## Bir sayıyı, bir ölçüm sisteminden bir başka ölçüm sistemine dönüştürür. +DEC2BIN = DEC2BIN ## Ondalık bir sayıyı, ikiliye dönüştürür. +DEC2HEX = DEC2HEX ## Ondalık bir sayıyı, onaltılıya dönüştürür. +DEC2OCT = DEC2OCT ## Ondalık bir sayıyı sekizliğe dönüştürür. +DELTA = DELTA ## İki değerin eşit olup olmadığını sınar. +ERF = HATAİŞLEV ## Hata işlevini verir. +ERFC = TÜMHATAİŞLEV ## Tümleyici hata işlevini verir. +GESTEP = BESINIR ## Bir sayının eşik değerinden büyük olup olmadığını sınar. +HEX2BIN = HEX2BIN ## Onaltılı bir sayıyı ikiliye dönüştürür. +HEX2DEC = HEX2DEC ## Onaltılı bir sayıyı ondalığa dönüştürür. +HEX2OCT = HEX2OCT ## Onaltılı bir sayıyı sekizliğe dönüştürür. +IMABS = SANMUTLAK ## Karmaşık bir sayının mutlak değerini (modül) verir. +IMAGINARY = SANAL ## Karmaşık bir sayının sanal katsayısını verir. +IMARGUMENT = SANBAĞ_DEĞİŞKEN ## Radyanlarla belirtilen bir açı olan teta bağımsız değişkenini verir. +IMCONJUGATE = SANEŞLENEK ## Karmaşık bir sayının karmaşık eşleniğini verir. +IMCOS = SANCOS ## Karmaşık bir sayının kosinüsünü verir. +IMDIV = SANBÖL ## İki karmaşık sayının bölümünü verir. +IMEXP = SANÜS ## Karmaşık bir sayının üssünü verir. +IMLN = SANLN ## Karmaşık bir sayının doğal logaritmasını verir. +IMLOG10 = SANLOG10 ## Karmaşık bir sayının, 10 tabanında logaritmasını verir. +IMLOG2 = SANLOG2 ## Karmaşık bir sayının 2 tabanında logaritmasını verir. +IMPOWER = SANÜSSÜ ## Karmaşık bir sayıyı, bir tamsayı üssüne yükseltilmiş olarak verir. +IMPRODUCT = SANÇARP ## Karmaşık sayıların çarpımını verir. +IMREAL = SANGERÇEK ## Karmaşık bir sayının, gerçek katsayısını verir. +IMSIN = SANSIN ## Karmaşık bir sayının sinüsünü verir. +IMSQRT = SANKAREKÖK ## Karmaşık bir sayının karekökünü verir. +IMSUB = SANÇIKAR ## İki karmaşık sayının farkını verir. +IMSUM = SANTOPLA ## Karmaşık sayıların toplamını verir. +OCT2BIN = OCT2BIN ## Sekizli bir sayıyı ikiliye dönüştürür. +OCT2DEC = OCT2DEC ## Sekizli bir sayıyı ondalığa dönüştürür. +OCT2HEX = OCT2HEX ## Sekizli bir sayıyı onaltılıya dönüştürür. + + +## +## Financial functions Finansal fonksiyonlar +## +ACCRINT = GERÇEKFAİZ ## Dönemsel faiz ödeyen hisse senedine ilişkin tahakkuk eden faizi getirir. +ACCRINTM = GERÇEKFAİZV ## Vadesinde ödeme yapan bir tahvilin tahakkuk etmiş faizini verir. +AMORDEGRC = AMORDEGRC ## Yıpranma katsayısı kullanarak her hesap döneminin değer kaybını verir. +AMORLINC = AMORLINC ## Her hesap dönemi içindeki yıpranmayı verir. +COUPDAYBS = KUPONGÜNBD ## Kupon süresinin başlangıcından alış tarihine kadar olan süredeki gün sayısını verir. +COUPDAYS = KUPONGÜN ## Kupon süresindeki, gün sayısını, alış tarihini de içermek üzere, verir. +COUPDAYSNC = KUPONGÜNDSK ## Alış tarihinden bir sonraki kupon tarihine kadar olan gün sayısını verir. +COUPNCD = KUPONGÜNSKT ## Alış tarihinden bir sonraki kupon tarihini verir. +COUPNUM = KUPONSAYI ## Alış tarihiyle vade tarihi arasında ödenecek kuponların sayısını verir. +COUPPCD = KUPONGÜNÖKT ## Alış tarihinden bir önceki kupon tarihini verir. +CUMIPMT = AİÇVERİMORANI ## İki dönem arasında ödenen kümülatif faizi verir. +CUMPRINC = ANA_PARA_ÖDEMESİ ## İki dönem arasında bir borç üzerine ödenen birikimli temeli verir. +DB = AZALANBAKİYE ## Bir malın belirtilen bir süre içindeki yıpranmasını, sabit azalan bakiye yöntemini kullanarak verir. +DDB = ÇİFTAZALANBAKİYE ## Bir malın belirtilen bir süre içindeki yıpranmasını, çift azalan bakiye yöntemi ya da sizin belirttiğiniz başka bir yöntemi kullanarak verir. +DISC = İNDİRİM ## Bir tahvilin indirim oranını verir. +DOLLARDE = LİRAON ## Kesir olarak tanımlanmış lira fiyatını, ondalık sayı olarak tanımlanmış lira fiyatına dönüştürür. +DOLLARFR = LİRAKES ## Ondalık sayı olarak tanımlanmış lira fiyatını, kesir olarak tanımlanmış lira fiyatına dönüştürür. +DURATION = SÜRE ## Belli aralıklarla faiz ödemesi yapan bir tahvilin yıllık süresini verir. +EFFECT = ETKİN ## Efektif yıllık faiz oranını verir. +FV = ANBD ## Bir yatırımın gelecekteki değerini verir. +FVSCHEDULE = GDPROGRAM ## Bir seri birleşik faiz oranı uyguladıktan sonra, bir başlangıçtaki anaparanın gelecekteki değerini verir. +INTRATE = FAİZORANI ## Tam olarak yatırım yapılmış bir tahvilin faiz oranını verir. +IPMT = FAİZTUTARI ## Bir yatırımın verilen bir süre için faiz ödemesini verir. +IRR = İÇ_VERİM_ORANI ## Bir para akışı serisi için, iç verim oranını verir. +ISPMT = ISPMT ## Yatırımın belirli bir dönemi boyunca ödenen faizi hesaplar. +MDURATION = MSÜRE ## Varsayılan par değeri 10.000.000 lira olan bir tahvil için Macauley değiştirilmiş süreyi verir. +MIRR = D_İÇ_VERİM_ORANI ## Pozitif ve negatif para akışlarının farklı oranlarda finanse edildiği durumlarda, iç verim oranını verir. +NOMINAL = NOMİNAL ## Yıllık nominal faiz oranını verir. +NPER = DÖNEM_SAYISI ## Bir yatırımın dönem sayısını verir. +NPV = NBD ## Bir yatırımın bugünkü net değerini, bir dönemsel para akışları serisine ve bir indirim oranına bağlı olarak verir. +ODDFPRICE = TEKYDEĞER ## Tek bir ilk dönemi olan bir tahvilin değerini, her 100.000.000 lirada bir verir. +ODDFYIELD = TEKYÖDEME ## Tek bir ilk dönemi olan bir tahvilin ödemesini verir. +ODDLPRICE = TEKSDEĞER ## Tek bir son dönemi olan bir tahvilin fiyatını her 10.000.000 lirada bir verir. +ODDLYIELD = TEKSÖDEME ## Tek bir son dönemi olan bir tahvilin ödemesini verir. +PMT = DEVRESEL_ÖDEME ## Bir yıllık dönemsel ödemeyi verir. +PPMT = ANA_PARA_ÖDEMESİ ## Verilen bir süre için, bir yatırımın anaparasına dayanan ödemeyi verir. +PRICE = DEĞER ## Dönemsel faiz ödeyen bir tahvilin fiyatını 10.000.00 liralık değer başına verir. +PRICEDISC = DEĞERİND ## İndirimli bir tahvilin fiyatını 10.000.000 liralık nominal değer başına verir. +PRICEMAT = DEĞERVADE ## Faizini vade sonunda ödeyen bir tahvilin fiyatını 10.000.000 nominal değer başına verir. +PV = BD ## Bir yatırımın bugünkü değerini verir. +RATE = FAİZ_ORANI ## Bir yıllık dönem başına düşen faiz oranını verir. +RECEIVED = GETİRİ ## Tam olarak yatırılmış bir tahvilin vadesinin bitiminde alınan miktarı verir. +SLN = DA ## Bir malın bir dönem içindeki doğrusal yıpranmasını verir. +SYD = YAT ## Bir malın belirli bir dönem için olan amortismanını verir. +TBILLEQ = HTAHEŞ ## Bir Hazine bonosunun bono eşdeğeri ödemesini verir. +TBILLPRICE = HTAHDEĞER ## Bir Hazine bonosunun değerini, 10.000.000 liralık nominal değer başına verir. +TBILLYIELD = HTAHÖDEME ## Bir Hazine bonosunun ödemesini verir. +VDB = DAB ## Bir malın amortismanını, belirlenmiş ya da kısmi bir dönem için, bir azalan bakiye yöntemi kullanarak verir. +XIRR = AİÇVERİMORANI ## Dönemsel olması gerekmeyen bir para akışları programı için, iç verim oranını verir. +XNPV = ANBD ## Dönemsel olması gerekmeyen bir para akışları programı için, bugünkü net değeri verir. +YIELD = ÖDEME ## Belirli aralıklarla faiz ödeyen bir tahvilin ödemesini verir. +YIELDDISC = ÖDEMEİND ## İndirimli bir tahvilin yıllık ödemesini verir; örneğin, bir Hazine bonosunun. +YIELDMAT = ÖDEMEVADE ## Vadesinin bitiminde faiz ödeyen bir tahvilin yıllık ödemesini verir. + + +## +## Information functions Bilgi fonksiyonları +## +CELL = HÜCRE ## Bir hücrenin biçimlendirmesi, konumu ya da içeriği hakkında bilgi verir. +ERROR.TYPE = HATA.TİPİ ## Bir hata türüne ilişkin sayıları verir. +INFO = BİLGİ ## Geçerli işletim ortamı hakkında bilgi verir. +ISBLANK = EBOŞSA ## Değer boşsa, DOĞRU verir. +ISERR = EHATA ## Değer, #YOK dışındaki bir hata değeriyse, DOĞRU verir. +ISERROR = EHATALIYSA ## Değer, herhangi bir hata değeriyse, DOĞRU verir. +ISEVEN = ÇİFTTİR ## Sayı çiftse, DOĞRU verir. +ISLOGICAL = EMANTIKSALSA ## Değer, mantıksal bir değerse, DOĞRU verir. +ISNA = EYOKSA ## Değer, #YOK hata değeriyse, DOĞRU verir. +ISNONTEXT = EMETİNDEĞİLSE ## Değer, metin değilse, DOĞRU verir. +ISNUMBER = ESAYIYSA ## Değer, bir sayıysa, DOĞRU verir. +ISODD = TEKTİR ## Sayı tekse, DOĞRU verir. +ISREF = EREFSE ## Değer bir başvuruysa, DOĞRU verir. +ISTEXT = EMETİNSE ## Değer bir metinse DOĞRU verir. +N = N ## Sayıya dönüştürülmüş bir değer verir. +NA = YOKSAY ## #YOK hata değerini verir. +TYPE = TİP ## Bir değerin veri türünü belirten bir sayı verir. + + +## +## Logical functions Mantıksal fonksiyonlar +## +AND = VE ## Bütün bağımsız değişkenleri DOĞRU ise, DOĞRU verir. +FALSE = YANLIŞ ## YANLIŞ mantıksal değerini verir. +IF = EĞER ## Gerçekleştirilecek bir mantıksal sınama belirtir. +IFERROR = EĞERHATA ## Formül hatalıysa belirttiğiniz değeri verir; bunun dışındaki durumlarda formülün sonucunu verir. +NOT = DEĞİL ## Bağımsız değişkeninin mantığını tersine çevirir. +OR = YADA ## Bağımsız değişkenlerden herhangi birisi DOĞRU ise, DOĞRU verir. +TRUE = DOĞRU ## DOĞRU mantıksal değerini verir. + + +## +## Lookup and reference functions Arama ve Başvuru fonksiyonları +## +ADDRESS = ADRES ## Bir başvuruyu, çalışma sayfasındaki tek bir hücreye metin olarak verir. +AREAS = ALANSAY ## Renvoie le nombre de zones dans une référence. +CHOOSE = ELEMAN ## Değerler listesinden bir değer seçer. +COLUMN = SÜTUN ## Bir başvurunun sütun sayısını verir. +COLUMNS = SÜTUNSAY ## Bir başvurudaki sütunların sayısını verir. +HLOOKUP = YATAYARA ## Bir dizinin en üst satırına bakar ve belirtilen hücrenin değerini verir. +HYPERLINK = KÖPRÜ ## Bir ağ sunucusunda, bir intranette ya da Internet'te depolanan bir belgeyi açan bir kısayol ya da atlama oluşturur. +INDEX = İNDİS ## Başvurudan veya diziden bir değer seçmek için, bir dizin kullanır. +INDIRECT = DOLAYLI ## Metin değeriyle belirtilen bir başvuru verir. +LOOKUP = ARA ## Bir vektördeki veya dizideki değerleri arar. +MATCH = KAÇINCI ## Bir başvurudaki veya dizideki değerleri arar. +OFFSET = KAYDIR ## Verilen bir başvurudan, bir başvuru kaydırmayı verir. +ROW = SATIR ## Bir başvurunun satır sayısını verir. +ROWS = SATIRSAY ## Bir başvurudaki satırların sayısını verir. +RTD = RTD ## COM otomasyonunu destekleyen programdan gerçek zaman verileri alır. +TRANSPOSE = DEVRİK_DÖNÜŞÜM ## Bir dizinin devrik dönüşümünü verir. +VLOOKUP = DÜŞEYARA ## Bir dizinin ilk sütununa bakar ve bir hücrenin değerini vermek için satır boyunca hareket eder. + + +## +## Math and trigonometry functions Matematik ve trigonometri fonksiyonları +## +ABS = MUTLAK ## Bir sayının mutlak değerini verir. +ACOS = ACOS ## Bir sayının ark kosinüsünü verir. +ACOSH = ACOSH ## Bir sayının ters hiperbolik kosinüsünü verir. +ASIN = ASİN ## Bir sayının ark sinüsünü verir. +ASINH = ASİNH ## Bir sayının ters hiperbolik sinüsünü verir. +ATAN = ATAN ## Bir sayının ark tanjantını verir. +ATAN2 = ATAN2 ## Ark tanjantı, x- ve y- koordinatlarından verir. +ATANH = ATANH ## Bir sayının ters hiperbolik tanjantını verir. +CEILING = TAVANAYUVARLA ## Bir sayıyı, en yakın tamsayıya ya da en yakın katına yuvarlar. +COMBIN = KOMBİNASYON ## Verilen sayıda öğenin kombinasyon sayısını verir. +COS = COS ## Bir sayının kosinüsünü verir. +COSH = COSH ## Bir sayının hiperbolik kosinüsünü verir. +DEGREES = DERECE ## Radyanları dereceye dönüştürür. +EVEN = ÇİFT ## Bir sayıyı, en yakın daha büyük çift tamsayıya yuvarlar. +EXP = ÜS ## e'yi, verilen bir sayının üssüne yükseltilmiş olarak verir. +FACT = ÇARPINIM ## Bir sayının faktörünü verir. +FACTDOUBLE = ÇİFTFAKTÖR ## Bir sayının çift çarpınımını verir. +FLOOR = TABANAYUVARLA ## Bir sayıyı, daha küçük sayıya, sıfıra yakınsayarak yuvarlar. +GCD = OBEB ## En büyük ortak böleni verir. +INT = TAMSAYI ## Bir sayıyı aşağıya doğru en yakın tamsayıya yuvarlar. +LCM = OKEK ## En küçük ortak katı verir. +LN = LN ## Bir sayının doğal logaritmasını verir. +LOG = LOG ## Bir sayının, belirtilen bir tabandaki logaritmasını verir. +LOG10 = LOG10 ## Bir sayının 10 tabanında logaritmasını verir. +MDETERM = DETERMİNANT ## Bir dizinin dizey determinantını verir. +MINVERSE = DİZEY_TERS ## Bir dizinin dizey tersini verir. +MMULT = DÇARP ## İki dizinin dizey çarpımını verir. +MOD = MODÜLO ## Bölmeden kalanı verir. +MROUND = KYUVARLA ## İstenen kata yuvarlanmış bir sayı verir. +MULTINOMIAL = ÇOKTERİMLİ ## Bir sayılar kümesinin çok terimlisini verir. +ODD = TEK ## Bir sayıyı en yakın daha büyük tek sayıya yuvarlar. +PI = Pİ ## Pi değerini verir. +POWER = KUVVET ## Bir üsse yükseltilmiş sayının sonucunu verir. +PRODUCT = ÇARPIM ## Bağımsız değişkenlerini çarpar. +QUOTIENT = BÖLÜM ## Bir bölme işleminin tamsayı kısmını verir. +RADIANS = RADYAN ## Dereceleri radyanlara dönüştürür. +RAND = S_SAYI_ÜRET ## 0 ile 1 arasında rastgele bir sayı verir. +RANDBETWEEN = RASTGELEARALIK ## Belirttiğiniz sayılar arasında rastgele bir sayı verir. +ROMAN = ROMEN ## Bir normal rakamı, metin olarak, romen rakamına çevirir. +ROUND = YUVARLA ## Bir sayıyı, belirtilen basamak sayısına yuvarlar. +ROUNDDOWN = AŞAĞIYUVARLA ## Bir sayıyı, daha küçük sayıya, sıfıra yakınsayarak yuvarlar. +ROUNDUP = YUKARIYUVARLA ## Bir sayıyı daha büyük sayıya, sıfırdan ıraksayarak yuvarlar. +SERIESSUM = SERİTOPLA ## Bir üs serisinin toplamını, formüle bağlı olarak verir. +SIGN = İŞARET ## Bir sayının işaretini verir. +SIN = SİN ## Verilen bir açının sinüsünü verir. +SINH = SİNH ## Bir sayının hiperbolik sinüsünü verir. +SQRT = KAREKÖK ## Pozitif bir karekök verir. +SQRTPI = KAREKÖKPİ ## (* Pi sayısının) kare kökünü verir. +SUBTOTAL = ALTTOPLAM ## Bir listedeki ya da veritabanındaki bir alt toplamı verir. +SUM = TOPLA ## Bağımsız değişkenlerini toplar. +SUMIF = ETOPLA ## Verilen ölçütle belirlenen hücreleri toplar. +SUMIFS = SUMIFS ## Bir aralıktaki, birden fazla ölçüte uyan hücreleri ekler. +SUMPRODUCT = TOPLA.ÇARPIM ## İlişkili dizi bileşenlerinin çarpımlarının toplamını verir. +SUMSQ = TOPKARE ## Bağımsız değişkenlerin karelerinin toplamını verir. +SUMX2MY2 = TOPX2EY2 ## İki dizideki ilişkili değerlerin farkının toplamını verir. +SUMX2PY2 = TOPX2AY2 ## İki dizideki ilişkili değerlerin karelerinin toplamının toplamını verir. +SUMXMY2 = TOPXEY2 ## İki dizideki ilişkili değerlerin farklarının karelerinin toplamını verir. +TAN = TAN ## Bir sayının tanjantını verir. +TANH = TANH ## Bir sayının hiperbolik tanjantını verir. +TRUNC = NSAT ## Bir sayının, tamsayı durumuna gelecek şekilde, fazlalıklarını atar. + + +## +## Statistical functions İstatistiksel fonksiyonlar +## +AVEDEV = ORTSAP ## Veri noktalarının ortalamalarından mutlak sapmalarının ortalamasını verir. +AVERAGE = ORTALAMA ## Bağımsız değişkenlerinin ortalamasını verir. +AVERAGEA = ORTALAMAA ## Bağımsız değişkenlerinin, sayılar, metin ve mantıksal değerleri içermek üzere ortalamasını verir. +AVERAGEIF = EĞERORTALAMA ## Verili ölçütü karşılayan bir aralıktaki bütün hücrelerin ortalamasını (aritmetik ortalama) hesaplar. +AVERAGEIFS = EĞERLERORTALAMA ## Birden çok ölçüte uyan tüm hücrelerin ortalamasını (aritmetik ortalama) hesaplar. +BETADIST = BETADAĞ ## Beta birikimli dağılım fonksiyonunu verir. +BETAINV = BETATERS ## Belirli bir beta dağılımı için birikimli dağılım fonksiyonunun tersini verir. +BINOMDIST = BİNOMDAĞ ## Tek terimli binom dağılımı olasılığını verir. +CHIDIST = KİKAREDAĞ ## Kikare dağılımın tek kuyruklu olasılığını verir. +CHIINV = KİKARETERS ## Kikare dağılımın kuyruklu olasılığının tersini verir. +CHITEST = KİKARETEST ## Bağımsızlık sınamalarını verir. +CONFIDENCE = GÜVENİRLİK ## Bir popülasyon ortalaması için güvenirlik aralığını verir. +CORREL = KORELASYON ## İki veri kümesi arasındaki bağlantı katsayısını verir. +COUNT = BAĞ_DEĞ_SAY ## Bağımsız değişkenler listesinde kaç tane sayı bulunduğunu sayar. +COUNTA = BAĞ_DEĞ_DOLU_SAY ## Bağımsız değişkenler listesinde kaç tane değer bulunduğunu sayar. +COUNTBLANK = BOŞLUKSAY ## Aralıktaki boş hücre sayısını hesaplar. +COUNTIF = EĞERSAY ## Verilen ölçütlere uyan bir aralık içindeki hücreleri sayar. +COUNTIFS = ÇOKEĞERSAY ## Birden çok ölçüte uyan bir aralık içindeki hücreleri sayar. +COVAR = KOVARYANS ## Eşleştirilmiş sapmaların ortalaması olan kovaryansı verir. +CRITBINOM = KRİTİKBİNOM ## Birikimli binom dağılımının bir ölçüt değerinden küçük veya ölçüt değerine eşit olduğu en küçük değeri verir. +DEVSQ = SAPKARE ## Sapmaların karelerinin toplamını verir. +EXPONDIST = ÜSTELDAĞ ## Üstel dağılımı verir. +FDIST = FDAĞ ## F olasılık dağılımını verir. +FINV = FTERS ## F olasılık dağılımının tersini verir. +FISHER = FISHER ## Fisher dönüşümünü verir. +FISHERINV = FISHERTERS ## Fisher dönüşümünün tersini verir. +FORECAST = TAHMİN ## Bir doğrusal eğilim boyunca bir değer verir. +FREQUENCY = SIKLIK ## Bir sıklık dağılımını, dikey bir dizi olarak verir. +FTEST = FTEST ## Bir F-test'in sonucunu verir. +GAMMADIST = GAMADAĞ ## Gama dağılımını verir. +GAMMAINV = GAMATERS ## Gama kümülatif dağılımının tersini verir. +GAMMALN = GAMALN ## Gama fonksiyonunun (?(x)) doğal logaritmasını verir. +GEOMEAN = GEOORT ## Geometrik ortayı verir. +GROWTH = BÜYÜME ## Üstel bir eğilim boyunca değerler verir. +HARMEAN = HARORT ## Harmonik ortayı verir. +HYPGEOMDIST = HİPERGEOMDAĞ ## Hipergeometrik dağılımı verir. +INTERCEPT = KESMENOKTASI ## Doğrusal çakıştırma çizgisinin kesişme noktasını verir. +KURT = BASIKLIK ## Bir veri kümesinin basıklığını verir. +LARGE = BÜYÜK ## Bir veri kümesinde k. en büyük değeri verir. +LINEST = DOT ## Doğrusal bir eğilimin parametrelerini verir. +LOGEST = LOT ## Üstel bir eğilimin parametrelerini verir. +LOGINV = LOGTERS ## Bir lognormal dağılımının tersini verir. +LOGNORMDIST = LOGNORMDAĞ ## Birikimli lognormal dağılımını verir. +MAX = MAK ## Bir bağımsız değişkenler listesindeki en büyük değeri verir. +MAXA = MAKA ## Bir bağımsız değişkenler listesindeki, sayılar, metin ve mantıksal değerleri içermek üzere, en büyük değeri verir. +MEDIAN = ORTANCA ## Belirtilen sayıların orta değerini verir. +MIN = MİN ## Bir bağımsız değişkenler listesindeki en küçük değeri verir. +MINA = MİNA ## Bir bağımsız değişkenler listesindeki, sayılar, metin ve mantıksal değerleri de içermek üzere, en küçük değeri verir. +MODE = ENÇOK_OLAN ## Bir veri kümesindeki en sık rastlanan değeri verir. +NEGBINOMDIST = NEGBİNOMDAĞ ## Negatif binom dağılımını verir. +NORMDIST = NORMDAĞ ## Normal birikimli dağılımı verir. +NORMINV = NORMTERS ## Normal kümülatif dağılımın tersini verir. +NORMSDIST = NORMSDAĞ ## Standart normal birikimli dağılımı verir. +NORMSINV = NORMSTERS ## Standart normal birikimli dağılımın tersini verir. +PEARSON = PEARSON ## Pearson çarpım moment korelasyon katsayısını verir. +PERCENTILE = YÜZDEBİRLİK ## Bir aralık içerisinde bulunan değerlerin k. frekans toplamını verir. +PERCENTRANK = YÜZDERANK ## Bir veri kümesindeki bir değerin yüzde mertebesini verir. +PERMUT = PERMÜTASYON ## Verilen sayıda nesne için permütasyon sayısını verir. +POISSON = POISSON ## Poisson dağılımını verir. +PROB = OLASILIK ## Bir aralıktaki değerlerin iki sınır arasında olması olasılığını verir. +QUARTILE = DÖRTTEBİRLİK ## Bir veri kümesinin dörtte birliğini verir. +RANK = RANK ## Bir sayılar listesinde bir sayının mertebesini verir. +RSQ = RKARE ## Pearson çarpım moment korelasyon katsayısının karesini verir. +SKEW = ÇARPIKLIK ## Bir dağılımın çarpıklığını verir. +SLOPE = EĞİM ## Doğrusal çakışma çizgisinin eğimini verir. +SMALL = KÜÇÜK ## Bir veri kümesinde k. en küçük değeri verir. +STANDARDIZE = STANDARTLAŞTIRMA ## Normalleştirilmiş bir değer verir. +STDEV = STDSAPMA ## Bir örneğe dayanarak standart sapmayı tahmin eder. +STDEVA = STDSAPMAA ## Standart sapmayı, sayılar, metin ve mantıksal değerleri içermek üzere, bir örneğe bağlı olarak tahmin eder. +STDEVP = STDSAPMAS ## Standart sapmayı, tüm popülasyona bağlı olarak hesaplar. +STDEVPA = STDSAPMASA ## Standart sapmayı, sayılar, metin ve mantıksal değerleri içermek üzere, tüm popülasyona bağlı olarak hesaplar. +STEYX = STHYX ## Regresyondaki her x için tahmini y değerinin standart hatasını verir. +TDIST = TDAĞ ## T-dağılımını verir. +TINV = TTERS ## T-dağılımının tersini verir. +TREND = EĞİLİM ## Doğrusal bir eğilim boyunca değerler verir. +TRIMMEAN = KIRPORTALAMA ## Bir veri kümesinin içinin ortalamasını verir. +TTEST = TTEST ## T-test'le ilişkilendirilmiş olasılığı verir. +VAR = VAR ## Varyansı, bir örneğe bağlı olarak tahmin eder. +VARA = VARA ## Varyansı, sayılar, metin ve mantıksal değerleri içermek üzere, bir örneğe bağlı olarak tahmin eder. +VARP = VARS ## Varyansı, tüm popülasyona dayanarak hesaplar. +VARPA = VARSA ## Varyansı, sayılar, metin ve mantıksal değerleri içermek üzere, tüm popülasyona bağlı olarak hesaplar. +WEIBULL = WEIBULL ## Weibull dağılımını hesaplar. +ZTEST = ZTEST ## Z-testinin tek kuyruklu olasılık değerini hesaplar. + + +## +## Text functions Metin fonksiyonları +## +ASC = ASC ## Bir karakter dizesindeki çift enli (iki bayt) İngilizce harfleri veya katakanayı yarım enli (tek bayt) karakterlerle değiştirir. +BAHTTEXT = BAHTTEXT ## Sayıyı, ß (baht) para birimi biçimini kullanarak metne dönüştürür. +CHAR = DAMGA ## Kod sayısıyla belirtilen karakteri verir. +CLEAN = TEMİZ ## Metindeki bütün yazdırılamaz karakterleri kaldırır. +CODE = KOD ## Bir metin dizesindeki ilk karakter için sayısal bir kod verir. +CONCATENATE = BİRLEŞTİR ## Pek çok metin öğesini bir metin öğesi olarak birleştirir. +DOLLAR = LİRA ## Bir sayıyı YTL (yeni Türk lirası) para birimi biçimini kullanarak metne dönüştürür. +EXACT = ÖZDEŞ ## İki metin değerinin özdeş olup olmadığını anlamak için, değerleri denetler. +FIND = BUL ## Bir metin değerini, bir başkasının içinde bulur (büyük küçük harf duyarlıdır). +FINDB = BULB ## Bir metin değerini, bir başkasının içinde bulur (büyük küçük harf duyarlıdır). +FIXED = SAYIDÜZENLE ## Bir sayıyı, sabit sayıda ondalıkla, metin olarak biçimlendirir. +JIS = JIS ## Bir karakter dizesindeki tek enli (tek bayt) İngilizce harfleri veya katakanayı çift enli (iki bayt) karakterlerle değiştirir. +LEFT = SOL ## Bir metin değerinden en soldaki karakterleri verir. +LEFTB = SOLB ## Bir metin değerinden en soldaki karakterleri verir. +LEN = UZUNLUK ## Bir metin dizesindeki karakter sayısını verir. +LENB = UZUNLUKB ## Bir metin dizesindeki karakter sayısını verir. +LOWER = KÜÇÜKHARF ## Metni küçük harfe çevirir. +MID = ORTA ## Bir metin dizesinden belirli sayıda karakteri, belirttiğiniz konumdan başlamak üzere verir. +MIDB = ORTAB ## Bir metin dizesinden belirli sayıda karakteri, belirttiğiniz konumdan başlamak üzere verir. +PHONETIC = SES ## Metin dizesinden ses (furigana) karakterlerini ayıklar. +PROPER = YAZIM.DÜZENİ ## Bir metin değerinin her bir sözcüğünün ilk harfini büyük harfe çevirir. +REPLACE = DEĞİŞTİR ## Metnin içindeki karakterleri değiştirir. +REPLACEB = DEĞİŞTİRB ## Metnin içindeki karakterleri değiştirir. +REPT = YİNELE ## Metni belirtilen sayıda yineler. +RIGHT = SAĞ ## Bir metin değerinden en sağdaki karakterleri verir. +RIGHTB = SAĞB ## Bir metin değerinden en sağdaki karakterleri verir. +SEARCH = BUL ## Bir metin değerini, bir başkasının içinde bulur (büyük küçük harf duyarlı değildir). +SEARCHB = BULB ## Bir metin değerini, bir başkasının içinde bulur (büyük küçük harf duyarlı değildir). +SUBSTITUTE = YERİNEKOY ## Bir metin dizesinde, eski metnin yerine yeni metin koyar. +T = M ## Bağımsız değerlerini metne dönüştürür. +TEXT = METNEÇEVİR ## Bir sayıyı biçimlendirir ve metne dönüştürür. +TRIM = KIRP ## Metindeki boşlukları kaldırır. +UPPER = BÜYÜKHARF ## Metni büyük harfe çevirir. +VALUE = SAYIYAÇEVİR ## Bir metin bağımsız değişkenini sayıya dönüştürür. diff --git a/extend/alipay/aop/AlipayMobilePublicMultiMediaClient.php b/extend/alipay/aop/AlipayMobilePublicMultiMediaClient.php new file mode 100644 index 0000000..1933632 --- /dev/null +++ b/extend/alipay/aop/AlipayMobilePublicMultiMediaClient.php @@ -0,0 +1,188 @@ +<?php + +/** + * 多媒体文件客户端 + * @author yikai.hu + * @version $Id: AlipayMobilePublicMultiMediaClient.php, v 0.1 Aug 15, 2014 10:19:01 AM yikai.hu Exp $ + */ + +include("AlipayMobilePublicMultiMediaExecute.php"); + +class AlipayMobilePublicMultiMediaClient +{ + private $DEFAULT_CHARSET = 'UTF-8'; + private $METHOD_POST = "POST"; + private $METHOD_GET = "GET"; + private $SIGN = 'sign'; //get name + + private $timeout = 10;// 超时时间 + private $serverUrl; + private $appId; + private $privateKey; + private $prodCode; + private $format = 'json'; //todo + private $sign_type = 'RSA'; //todo + + private $charset; + private $apiVersion = "1.0"; + private $apiMethodName = "alipay.mobile.public.multimedia.download"; + private $media_id = "L21pZnMvVDFQV3hYWGJKWFhYYUNucHJYP3Q9YW13ZiZ4c2lnPTU0MzRhYjg1ZTZjNWJmZTMxZGJiNjIzNDdjMzFkNzkw575"; + //此处写死的,实际开发中,请传入 + + private $connectTimeout = 3000; + private $readTimeout = 15000; + + function __construct($serverUrl = '', $appId = '', $partner_private_key = '', $format = '', $charset = 'GBK') + { + $this->serverUrl = $serverUrl; + $this->appId = $appId; + $this->privateKey = $partner_private_key; + $this->format = $format; + $this->charset = $charset; + } + + /** + * getContents 获取网址内容 + * @param $request + * @return text | bin + */ + public function getContents() + { + $datas = array( + "app_id" => $this->appId, + "method" => $this->METHOD_POST, + "sign_type" => $this->sign_type, + "version" => $this->apiVersion, + "timestamp" => date('Y-m-d H:i:s'),//yyyy-MM-dd HH:mm:ss + "biz_content" => '{"mediaId":"' . $this->media_id . '"}', + "charset" => $this->charset + ); + + //要提交的数据 + $data_sign = $this->buildGetUrl($datas); + + $post_data = $data_sign; + //初始化 curl + $ch = curl_init(); + //设置目标服务器 + curl_setopt($ch, CURLOPT_URL, $this->serverUrl); + curl_setopt($ch, CURLOPT_HEADER, TRUE); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + //超时时间 + curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout); + + if ($this->METHOD_POST == 'POST') { + // post数据 + curl_setopt($ch, CURLOPT_POST, 1); + // post的变量 + curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); + } + + + $output = curl_exec($ch); + $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + curl_close($ch); + + echo $output; + + $datas = explode("\r\n\r\n", $output, 2); + $header = $datas[0]; + + if ($httpCode == '200') { + $body = $datas[1]; + } else { + $body = ''; + + } + + return $this->execute($header, $body, $httpCode); + } + + /** + * + * @param $request + * @return text | bin + */ + public function execute($header = '', $body = '', $httpCode = '') + { + $exe = new AlipayMobilePublicMultiMediaExecute($header, $body, $httpCode); + return $exe; + } + + public function buildGetUrl($query = array()) + { + if (!is_array($query)) { + //exit; + } + //排序参数, + $data = $this->buildQuery($query); + + // 私钥密码 + $passphrase = ''; + $key_width = 64; + + //私钥 + $privateKey = $this->privateKey; + $p_key = array(); + //如果私钥是 1行 + if (!stripos($privateKey, "\n")) { + $i = 0; + while ($key_str = substr($privateKey, $i * $key_width, $key_width)) { + $p_key[] = $key_str; + $i++; + } + } else { + //echo '一行?'; + } + $privateKey = "-----BEGIN RSA PRIVATE KEY-----\n" . implode("\n", $p_key); + $privateKey = $privateKey . "\n-----END RSA PRIVATE KEY-----"; + + //私钥 + $private_id = openssl_pkey_get_private($privateKey, $passphrase); + + // 签名 + $signature = ''; + + if ("RSA2" == $this->sign_type) { + + openssl_sign($data, $signature, $private_id, OPENSSL_ALGO_SHA256); + } else { + + openssl_sign($data, $signature, $private_id, OPENSSL_ALGO_SHA1); + } + + openssl_free_key($private_id); + + //加密后的内容通常含有特殊字符,需要编码转换下 + $signature = base64_encode($signature); + + $signature = urlencode($signature); + + //$signature = 'XjUN6YM1Mc9HXebKMv7GTLy7gmyhktyOgKk2/Jf+cz4DtP6udkzTdpkjW2j/Z4ZSD7xD6CNYI1Spz4yS93HPT0a5X9LgFWYY8SaADqe+ArXg+FBSiTwUz49SE//Xd9+LEiIRsSFkbpkuiGoO6mqJmB7vXjlD5lx6qCM3nb41wb8='; + + $out = $data . '&' . $this->SIGN . '=' . $signature; + + return $out; + } + + /* + * 查询参数排序 a-z + * */ + public function buildQuery($query) + { + if (!$query) { + return null; + } + //将要 参数 排序 + ksort($query); + + //重新组装参数 + $params = array(); + foreach ($query as $key => $value) { + $params[] = $key . '=' . $value; + } + $data = implode('&', $params); + return $data; + } + +} diff --git a/extend/alipay/aop/AlipayMobilePublicMultiMediaExecute.php b/extend/alipay/aop/AlipayMobilePublicMultiMediaExecute.php new file mode 100644 index 0000000..b3ffbfb --- /dev/null +++ b/extend/alipay/aop/AlipayMobilePublicMultiMediaExecute.php @@ -0,0 +1,115 @@ +<?php + +/** + * 多媒体文件客户端 + * @author yuanwai.wang + * @version $Id: AlipayMobilePublicMultiMediaExecute.php, v 0.1 Aug 15, 2014 10:19:01 AM yuanwai.wang Exp $ + */ + +//namespace alipay\api ; + + +class AlipayMobilePublicMultiMediaExecute +{ + + private $code = 200; + private $msg = ''; + private $body = ''; + private $params = ''; + + private $fileSuffix = array( + "image/jpeg" => 'jpg', //+ + "text/plain" => 'text' + ); + + /* + * @$header : 头部 + * */ + function __construct($header, $body, $httpCode) + { + $this->code = $httpCode; + $this->msg = ''; + $this->params = $header; + $this->body = $body; + } + + /** + * + * @return text | bin + */ + public function getCode() + { + return $this->code; + } + + /** + * + * @return text | bin + */ + public function getMsg() + { + return $this->msg; + } + + /** + * + * @return text | bin + */ + public function getType() + { + $subject = $this->params; + $pattern = '/Content\-Type:([^;]+)/'; + preg_match($pattern, $subject, $matches); + if ($matches) { + $type = $matches[1]; + } else { + $type = 'application/download'; + } + + return str_replace(' ', '', $type); + } + + /** + * + * @return text | bin + */ + public function getContentLength() + { + $subject = $this->params; + $pattern = '/Content-Length:\s*([^\n]+)/'; + preg_match($pattern, $subject, $matches); + return (int)(isset($matches[1]) ? $matches[1] : ''); + } + + + public function getFileSuffix($fileType) + { + $type = isset($this->fileSuffix[$fileType]) ? $this->fileSuffix[$fileType] : 'text/plain'; + if (!$type) { + $type = 'json'; + } + return $type; + } + + + /** + * + * @return text | bin + */ + public function getBody() + { + //header('Content-type: image/jpeg'); + return $this->body; + } + + /** + * 获取参数 + * @return text | bin + */ + public function getParams() + { + return $this->params; + } + + +} diff --git a/extend/alipay/aop/AopCertClient.php b/extend/alipay/aop/AopCertClient.php new file mode 100644 index 0000000..5ba2b48 --- /dev/null +++ b/extend/alipay/aop/AopCertClient.php @@ -0,0 +1,1237 @@ +<?php + +require_once 'AopEncrypt.php'; +require_once 'AopCertification.php'; +require_once 'EncryptParseItem.php'; +require_once 'EncryptResponseData.php'; +require_once 'SignData.php'; + +class AopCertClient +{ + //应用证书地址 + public $appCertSN; + + //支付宝公钥证书地址 + public $alipayCertSN; + + //支付宝根证书地址 + public $alipayRootCertSN; + + //支付宝根证书地址 + public $alipayRootCertContent; + + //是否校验支付宝公钥证书 + public $isCheckAlipayPublicCert; + + //应用ID + public $appId; + + //私钥文件路径 + public $rsaPrivateKeyFilePath; + + //私钥值 + public $rsaPrivateKey; + + //网关 + public $gatewayUrl = "https://openapi.alipay.com/gateway.do"; + //返回数据格式 + public $format = "json"; + + //api版本 + public $apiVersion = "1.0"; + + // 表单提交字符集编码 + public $postCharset = "UTF-8"; + + //使用文件读取文件格式,请只传递该值 + public $alipayPublicKey = null; + + //使用读取字符串格式,请只传递该值 + public $alipayrsaPublicKey; + + public $debugInfo = false; + + //签名类型 + public $signType = "RSA"; + + //加密密钥和类型 + public $encryptKey; + + public $encryptType = "AES"; + + protected $alipaySdkVersion = "alipay-sdk-php-2020-04-15"; + + private $fileCharset = "UTF-8"; + + private $RESPONSE_SUFFIX = "_response"; + + private $ERROR_RESPONSE = "error_response"; + + private $SIGN_NODE_NAME = "sign"; + + private $ALIPAY_CERT_SN = "alipay_cert_sn"; + + + //加密XML节点名称 + private $ENCRYPT_XML_NODE_NAME = "response_encrypted"; + + private $needEncrypt = false; + + private $targetServiceUrl = ""; + + /** + * 从证书中提取序列号 + * @param $cert + * @return string + */ + public function getCertSN($certPath) + { + $cert = file_get_contents($certPath); + $ssl = openssl_x509_parse($cert); + $SN = md5(array2string(array_reverse($ssl['issuer'])) . $ssl['serialNumber']); + return $SN; + } + + /** + * 提取根证书序列号 + * @param $cert 根证书 + * @return string|null + */ + public function getRootCertSN($certPath) + { + $cert = file_get_contents($certPath); + $this->alipayRootCertContent = $cert; + $array = explode("-----END CERTIFICATE-----", $cert); + $SN = null; + for ($i = 0; $i < count($array) - 1; $i++) { + $ssl[$i] = openssl_x509_parse($array[$i] . "-----END CERTIFICATE-----"); + if(strpos($ssl[$i]['serialNumber'],'0x') === 0){ + $ssl[$i]['serialNumber'] = $this->hex2dec($ssl[$i]['serialNumber']); + } + if ($ssl[$i]['signatureTypeLN'] == "sha1WithRSAEncryption" || $ssl[$i]['signatureTypeLN'] == "sha256WithRSAEncryption") { + if ($SN == null) { + $SN = md5(array2string(array_reverse($ssl[$i]['issuer'])) . $ssl[$i]['serialNumber']); + } else { + + $SN = $SN . "_" . md5(array2string(array_reverse($ssl[$i]['issuer'])) . $ssl[$i]['serialNumber']); + } + } + } + return $SN; + } + + /** + * 0x转高精度数字 + * @param $hex + * @return int|string + */ + function hex2dec($hex) + { + $dec = 0; + $len = strlen($hex); + for ($i = 1; $i <= $len; $i++) { + $dec = bcadd($dec, bcmul(strval(hexdec($hex[$i - 1])), bcpow('16', strval($len - $i)))); + } + return round($dec,0); + } + + /** + * 从证书中提取公钥 + * @param $cert + * @return mixed + */ + public function getPublicKey($certPath) + { + $cert = file_get_contents($certPath); + $pkey = openssl_pkey_get_public($cert); + $keyData = openssl_pkey_get_details($pkey); + $public_key = str_replace('-----BEGIN PUBLIC KEY-----', '', $keyData['key']); + $public_key = trim(str_replace('-----END PUBLIC KEY-----', '', $public_key)); + return $public_key; + } + + + /** + * 验证签名 + * 在使用本方法前,必须初始化AopCertClient且传入公钥参数。 + * 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。 + * + * @param $params + * @param $rsaPublicKeyFilePath + * @param string $signType + * @return bool + */ + public function rsaCheckV1($params, $rsaPublicKeyFilePath,$signType='RSA') { + $sign = $params['sign']; + unset($params['sign']); + unset($params['sign_type']); + return $this->verify($this->getCheckSignContent($params), $sign, $rsaPublicKeyFilePath,$signType); + } + + /** + * 验证签名 + * 在使用本方法前,必须初始化AopCertClient且传入公钥参数。 + * 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。 + * + * @param $params + * @param $rsaPublicKeyFilePath + * @param string $signType + * @return bool + */ + public function rsaCheckV2($params, $rsaPublicKeyFilePath, $signType='RSA') { + $sign = $params['sign']; + unset($params['sign']); + unset($params['sign_type']); + return $this->verify($this->getCheckSignContent($params), $sign, $rsaPublicKeyFilePath, $signType); + } + + + function getCheckSignContent($params) + { + ksort($params); + + $stringToBeSigned = ""; + $i = 0; + foreach ($params as $k => $v) { + // 转换成目标字符集 + $v = $this->characet($v, $this->postCharset); + + if ($i == 0) { + $stringToBeSigned .= "$k" . "=" . "$v"; + } else { + $stringToBeSigned .= "&" . "$k" . "=" . "$v"; + } + $i++; + } + + unset ($k, $v); + return $stringToBeSigned; + } + + + /** + * 在使用本方法前,必须初始化AopCertClient且传入公私钥参数。 + * 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。 + **/ + public function checkSignAndDecrypt($params, $rsaPublicKeyPem, $rsaPrivateKeyPem, $isCheckSign, $isDecrypt, $signType='RSA') { + $charset = $params['charset']; + $bizContent = $params['biz_content']; + if ($isCheckSign) { + if (!$this->rsaCheckV2($params, $rsaPublicKeyPem, $signType)) { + echo "<br/>checkSign failure<br/>"; + exit; + } + } + if ($isDecrypt) { + return $this->rsaDecrypt($bizContent, $rsaPrivateKeyPem, $charset); + } + + return $bizContent; + } + + /** + * 在使用本方法前,必须初始化AopCertClient且传入公私钥参数。 + * 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。 + **/ + public function encryptAndSign($bizContent, $rsaPublicKeyPem, $rsaPrivateKeyPem, $charset, $isEncrypt, $isSign, $signType='RSA') { + // 加密,并签名 + if ($isEncrypt && $isSign) { + $encrypted = $this->rsaEncrypt($bizContent, $rsaPublicKeyPem, $charset); + $sign = $this->sign($encrypted, $signType); + $response = "<?xml version=\"1.0\" encoding=\"$charset\"?><alipay><response>$encrypted</response><encryption_type>RSA</encryption_type><sign>$sign</sign><sign_type>$signType</sign_type></alipay>"; + return $response; + } + // 加密,不签名 + if ($isEncrypt && (!$isSign)) { + $encrypted = $this->rsaEncrypt($bizContent, $rsaPublicKeyPem, $charset); + $response = "<?xml version=\"1.0\" encoding=\"$charset\"?><alipay><response>$encrypted</response><encryption_type>$signType</encryption_type></alipay>"; + return $response; + } + // 不加密,但签名 + if ((!$isEncrypt) && $isSign) { + $sign = $this->sign($bizContent, $signType); + $response = "<?xml version=\"1.0\" encoding=\"$charset\"?><alipay><response>$bizContent</response><sign>$sign</sign><sign_type>$signType</sign_type></alipay>"; + return $response; + } + // 不加密,不签名 + $response = "<?xml version=\"1.0\" encoding=\"$charset\"?>$bizContent"; + return $response; + } + + /** + * 在使用本方法前,必须初始化AopCertClient且传入公私钥参数。 + **/ + public function rsaEncrypt($data, $rsaPublicKeyFilePath, $charset) { + if($this->checkEmpty($this->alipayPublicKey)){ + //读取字符串 + $pubKey= $this->alipayrsaPublicKey; + $res = "-----BEGIN PUBLIC KEY-----\n" . + wordwrap($pubKey, 64, "\n", true) . + "\n-----END PUBLIC KEY-----"; + }else { + //读取公钥文件 + $pubKey = file_get_contents($rsaPublicKeyFilePath); + //转换为openssl格式密钥 + $res = openssl_get_publickey($pubKey); + } + + ($res) or die('支付宝RSA公钥错误。请检查公钥文件格式是否正确'); + $blocks = $this->splitCN($data, 0, 30, $charset); + $chrtext  = null; + $encodes  = array(); + foreach ($blocks as $n => $block) { + if (!openssl_public_encrypt($block, $chrtext , $res)) { + echo "<br/>" . openssl_error_string() . "<br/>"; + } + $encodes[] = $chrtext ; + } + $chrtext = implode(",", $encodes); + + return base64_encode($chrtext); + } + + /** + * 在使用本方法前,必须初始化AopCertClient且传入公私钥参数。 + * 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。 + **/ + public function rsaDecrypt($data, $rsaPrivateKeyPem, $charset) { + + if($this->checkEmpty($this->rsaPrivateKeyFilePath)){ + //读字符串 + $priKey=$this->rsaPrivateKey; + $res = "-----BEGIN RSA PRIVATE KEY-----\n" . + wordwrap($priKey, 64, "\n", true) . + "\n-----END RSA PRIVATE KEY-----"; + }else { + $priKey = file_get_contents($this->rsaPrivateKeyFilePath); + $res = openssl_get_privatekey($priKey); + } + ($res) or die('您使用的私钥格式错误,请检查RSA私钥配置'); + //转换为openssl格式密钥 + $decodes = explode(',', $data); + $strnull = ""; + $dcyCont = ""; + foreach ($decodes as $n => $decode) { + if (!openssl_private_decrypt($decode, $dcyCont, $res)) { + echo "<br/>" . openssl_error_string() . "<br/>"; + } + $strnull .= $dcyCont; + } + return $strnull; + } + + function splitCN($cont, $n = 0, $subnum, $charset) { + //$len = strlen($cont) / 3; + $arrr = array(); + for ($i = $n; $i < strlen($cont); $i += $subnum) { + $res = $this->subCNchar($cont, $i, $subnum, $charset); + if (!empty ($res)) { + $arrr[] = $res; + } + } + + return $arrr; + } + + function subCNchar($str, $start = 0, $length, $charset = "gbk") { + if (strlen($str) <= $length) { + return $str; + } + $re['utf-8'] = "/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xff][\x80-\xbf]{3}/"; + $re['gb2312'] = "/[\x01-\x7f]|[\xb0-\xf7][\xa0-\xfe]/"; + $re['gbk'] = "/[\x01-\x7f]|[\x81-\xfe][\x40-\xfe]/"; + $re['big5'] = "/[\x01-\x7f]|[\x81-\xfe]([\x40-\x7e]|\xa1-\xfe])/"; + preg_match_all($re[$charset], $str, $match); + $slice = join("", array_slice($match[0], $start, $length)); + return $slice; + } + + /** + * 生成用于调用收银台SDK的字符串 + * @param $request SDK接口的请求参数对象 + * @param $appAuthToken 三方应用授权token + * @return string + */ + public function sdkExecute($request, $appAuthToken = null) { + + $this->setupCharsets($request); + $params['app_id'] = $this->appId; + $params['method'] = $request->getApiMethodName(); + $params['format'] = $this->format; + $params['sign_type'] = $this->signType; + $params['timestamp'] = date("Y-m-d H:i:s"); + $params['alipay_sdk'] = $this->alipaySdkVersion; + $params['charset'] = $this->postCharset; + $version = $request->getApiVersion(); + $params['version'] = $this->checkEmpty($version) ? $this->apiVersion : $version; + $params["app_cert_sn"] = $this->appCertSN; + $params["alipay_root_cert_sn"] = $this->alipayRootCertSN; + if ($notify_url = $request->getNotifyUrl()) { + $params['notify_url'] = $notify_url; + } + $params['app_auth_token'] = $appAuthToken; + $dict = $request->getApiParas(); + $params['biz_content'] = $dict['biz_content']; + ksort($params); + $params['sign'] = $this->generateSign($params, $this->signType); + foreach ($params as &$value) { + $value = $this->characet($value, $params['charset']); + } + return http_build_query($params); + } + + + /** + * 页面提交执行方法 + * @param $request 跳转类接口的request + * @param string $httpmethod 提交方式,两个值可选:post、get; + * @param null $appAuthToken 三方应用授权token + * @return 构建好的、签名后的最终跳转URL(GET)或String形式的form(POST) + * @throws Exception + */ + public function pageExecute($request, $httpmethod = "POST", $appAuthToken = null) { + + $this->setupCharsets($request); + if (strcasecmp($this->fileCharset, $this->postCharset)) { + throw new Exception("文件编码:[" . $this->fileCharset . "] 与表单提交编码:[" . $this->postCharset . "]两者不一致!"); + } + $iv=null; + if(!$this->checkEmpty($request->getApiVersion())){ + $iv=$request->getApiVersion(); + }else{ + $iv=$this->apiVersion; + } + + //组装系统参数 + $sysParams["app_id"] = $this->appId; + $sysParams["version"] = $iv; + $sysParams["format"] = $this->format; + $sysParams["sign_type"] = $this->signType; + $sysParams["method"] = $request->getApiMethodName(); + $sysParams["timestamp"] = date("Y-m-d H:i:s"); + $sysParams["alipay_sdk"] = $this->alipaySdkVersion; + $sysParams["terminal_type"] = $request->getTerminalType(); + $sysParams["terminal_info"] = $request->getTerminalInfo(); + $sysParams["prod_code"] = $request->getProdCode(); + $sysParams["notify_url"] = $request->getNotifyUrl(); + $sysParams["return_url"] = $request->getReturnUrl(); + $sysParams["charset"] = $this->postCharset; + $sysParams["app_auth_token"] = $appAuthToken; + $sysParams["app_cert_sn"] = $this->appCertSN; + $sysParams["alipay_root_cert_sn"] = $this->alipayRootCertSN; + + //获取业务参数 + $apiParams = $request->getApiParas(); + if (method_exists($request,"getNeedEncrypt") &&$request->getNeedEncrypt()){ + $sysParams["encrypt_type"] = $this->encryptType; + if ($this->checkEmpty($apiParams['biz_content'])) { + throw new Exception(" api request Fail! The reason : encrypt request is not supperted!"); + } + if ($this->checkEmpty($this->encryptKey) || $this->checkEmpty($this->encryptType)) { + throw new Exception(" encryptType and encryptKey must not null! "); + } + if ("AES" != $this->encryptType) { + throw new Exception("加密类型只支持AES"); + } + // 执行加密 + $enCryptContent = encrypt($apiParams['biz_content'], $this->encryptKey); + $apiParams['biz_content'] = $enCryptContent; + } + $totalParams = array_merge($apiParams, $sysParams); + //待签名字符串 + $preSignStr = $this->getSignContent($totalParams); + //签名 + $totalParams["sign"] = $this->generateSign($totalParams, $this->signType); + + if ("GET" == strtoupper($httpmethod)) { + //value做urlencode + $preString=$this->getSignContentUrlencode($totalParams); + //拼接GET请求串 + $requestUrl = $this->gatewayUrl."?".$preString; + return $requestUrl; + } else { + //拼接表单字符串 + return $this->buildRequestForm($totalParams); + } + } + + //此方法对value做urlencode + public function getSignContentUrlencode($params) { + ksort($params); + $stringToBeSigned = ""; + $i = 0; + foreach ($params as $k => $v) { + if (false === $this->checkEmpty($v) && "@" != substr($v, 0, 1)) { + + // 转换成目标字符集 + $v = $this->characet($v, $this->postCharset); + + if ($i == 0) { + $stringToBeSigned .= "$k" . "=" . urlencode($v); + } else { + $stringToBeSigned .= "&" . "$k" . "=" . urlencode($v); + } + $i++; + } + } + unset ($k, $v); + return $stringToBeSigned; + } + + + /** + * 建立请求,以表单HTML形式构造(默认) + * @param $para_temp 请求参数数组 + * @return 提交表单HTML文本 + */ + protected function buildRequestForm($para_temp) { + $sHtml = "<form id='alipaysubmit' name='alipaysubmit' action='".$this->gatewayUrl."?charset=".trim($this->postCharset)."' method='POST'>"; + while (list ($key, $val) = $this->fun_adm_each($para_temp)) { + if (false === $this->checkEmpty($val)) { + //$val = $this->characet($val, $this->postCharset); + $val = str_replace("'","&apos;",$val); + //$val = str_replace("\"","&quot;",$val); + $sHtml.= "<input type='hidden' name='".$key."' value='".$val."'/>"; + } + } + //submit按钮控件请不要含有name属性 + $sHtml = $sHtml."<input type='submit' value='ok' style='display:none;''></form>"; + $sHtml = $sHtml."<script>document.forms['alipaysubmit'].submit();</script>"; + return $sHtml; + } + + protected function fun_adm_each(&$array) + { + $res = array(); + $key = key($array); + if ($key !== null) { + next($array); + $res[1] = $res['value'] = $array[$key]; + $res[0] = $res['key'] = $key; + } else { + $res = false; + } + return $res; + } + + public function execute($request, $authToken = null, $appInfoAuthtoken = null,$targetAppId = null) { + $this->setupCharsets($request); + //如果两者编码不一致,会出现签名验签或者乱码 + if (strcasecmp($this->fileCharset, $this->postCharset)) { + throw new Exception("文件编码:[" . $this->fileCharset . "] 与表单提交编码:[" . $this->postCharset . "]两者不一致!"); + } + $iv = null; + if (!$this->checkEmpty($request->getApiVersion())) { + $iv = $request->getApiVersion(); + } else { + $iv = $this->apiVersion; + } + //组装系统参数 + $sysParams["app_id"] = $this->appId; + $sysParams["version"] = $iv; + $sysParams["format"] = $this->format; + $sysParams["sign_type"] = $this->signType; + $sysParams["method"] = $request->getApiMethodName(); + $sysParams["timestamp"] = date("Y-m-d H:i:s"); + $sysParams["auth_token"] = $authToken; + $sysParams["alipay_sdk"] = $this->alipaySdkVersion; + $sysParams["terminal_type"] = $request->getTerminalType(); + $sysParams["terminal_info"] = $request->getTerminalInfo(); + $sysParams["prod_code"] = $request->getProdCode(); + $sysParams["notify_url"] = $request->getNotifyUrl(); + $sysParams["charset"] = $this->postCharset; + $sysParams["app_auth_token"] = $appInfoAuthtoken; + $sysParams["app_cert_sn"] = $this->appCertSN; + $sysParams["alipay_root_cert_sn"] = $this->alipayRootCertSN; + $sysParams["target_app_id"] = $targetAppId; + if(!$this->checkEmpty($this->targetServiceUrl)){ + $sysParams["ws_service_url"] = $this->targetServiceUrl; + } + + //获取业务参数 + $apiParams = $request->getApiParas(); + + if (method_exists($request,"getNeedEncrypt") && $request->getNeedEncrypt()){ + $sysParams["encrypt_type"] = $this->encryptType; + if ($this->checkEmpty($apiParams['biz_content'])) { + throw new Exception(" api request Fail! The reason : encrypt request is not supperted!"); + } + if ($this->checkEmpty($this->encryptKey) || $this->checkEmpty($this->encryptType)) { + throw new Exception(" encryptType and encryptKey must not null! "); + } + if ("AES" != $this->encryptType) { + throw new Exception("加密类型只支持AES"); + } + // 执行加密 + $enCryptContent = encrypt($apiParams['biz_content'], $this->encryptKey); + $apiParams['biz_content'] = $enCryptContent; + } + + //签名 + $sysParams["sign"] = $this->generateSign(array_merge($apiParams, $sysParams), $this->signType); + + //系统参数放入GET请求串 + $requestUrl = $this->gatewayUrl . "?"; + foreach ($sysParams as $sysParamKey => $sysParamValue) { + $requestUrl .= "$sysParamKey=" . urlencode($this->characet($sysParamValue, $this->postCharset)) . "&"; + } + $requestUrl = substr($requestUrl, 0, -1); + + //发起HTTP请求 + try { + $resp = $this->curl($requestUrl, $apiParams); + } catch (Exception $e) { + $this->logCommunicationError($sysParams["method"], $requestUrl, "HTTP_ERROR_" . $e->getCode(), $e->getMessage()); + return false; + } + + //解析AOP返回结果 + $respWellFormed = false; + + // 将返回结果转换本地文件编码 + $r = iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp); + $signData = null; + + if ("json" == $this->format) { + $respObject = json_decode($r); + if (null !== $respObject) { + $respWellFormed = true; + $signData = $this->parserJSONSignData($request, $resp, $respObject); + } + } else if ("xml" == $this->format) { + $disableLibxmlEntityLoader = libxml_disable_entity_loader(true); + $respObject = @ simplexml_load_string($resp); + if (false !== $respObject) { + $respWellFormed = true; + $signData = $this->parserXMLSignData($request, $resp); + } + libxml_disable_entity_loader($disableLibxmlEntityLoader); + } + + //返回的HTTP文本不是标准JSON或者XML,记下错误日志 + if (false === $respWellFormed) { + $this->logCommunicationError($sysParams["method"], $requestUrl, "HTTP_RESPONSE_NOT_WELL_FORMED", $resp); + return false; + } + + // 验签 + $this->checkResponseSign($request, $signData, $resp, $respObject); + + // 解密 + if (method_exists($request,"getNeedEncrypt") &&$request->getNeedEncrypt()){ + + if ("json" == $this->format) { + $resp = $this->encryptJSONSignSource($request, $resp); + // 将返回结果转换本地文件编码 + $r = iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp); + $respObject = json_decode($r); + }else{ + $resp = $this->encryptXMLSignSource($request, $resp); + $r = iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp); + $disableLibxmlEntityLoader = libxml_disable_entity_loader(true); + $respObject = @ simplexml_load_string($r); + libxml_disable_entity_loader($disableLibxmlEntityLoader); + } + } + return $respObject; + } + + + /** + * 设置编码格式 + * @param $request + */ + private function setupCharsets($request) { + if ($this->checkEmpty($this->postCharset)) { + $this->postCharset = 'UTF-8'; + } + $str = preg_match('/[\x80-\xff]/', $this->appId) ? $this->appId : print_r($request, true); + $this->fileCharset = mb_detect_encoding($str, "UTF-8, GBK") == 'UTF-8' ? 'UTF-8' : 'GBK'; + } + + /** + * 校验$value是否非空 + * if not set ,return true; + * if is null , return true; + **/ + protected function checkEmpty($value) { + if (!isset($value)) + return true; + if ($value === null) + return true; + if (trim($value) === "") + return true; + + return false; + } + + /** + * 加签 + * @param $params + * @param string $signType + * @return mixed + */ + public function generateSign($params, $signType = "RSA") { + return $this->sign($this->getSignContent($params), $signType); + } + + public function rsaSign($params, $signType = "RSA") { + return $this->sign($this->getSignContent($params), $signType); + } + + protected function sign($data, $signType = "RSA") { + if($this->checkEmpty($this->rsaPrivateKeyFilePath)){ + $priKey=$this->rsaPrivateKey; + $res = "-----BEGIN RSA PRIVATE KEY-----\n" . + wordwrap($priKey, 64, "\n", true) . + "\n-----END RSA PRIVATE KEY-----"; + }else { + $priKey = file_get_contents($this->rsaPrivateKeyFilePath); + $res = openssl_get_privatekey($priKey); + } + + ($res) or die('您使用的私钥格式错误,请检查RSA私钥配置'); + + if ("RSA2" == $signType) { + openssl_sign($data, $sign, $res, OPENSSL_ALGO_SHA256); + } else { + openssl_sign($data, $sign, $res); + } + + if(!$this->checkEmpty($this->rsaPrivateKeyFilePath)){ + openssl_free_key($res); + } + $sign = base64_encode($sign); + return $sign; + } + + public function getSignContent($params) { + ksort($params); + + $stringToBeSigned = ""; + $i = 0; + foreach ($params as $k => $v) { + if (false === $this->checkEmpty($v) && "@" != substr($v, 0, 1)) { + + // 转换成目标字符集 + $v = $this->characet($v, $this->postCharset); + + if ($i == 0) { + $stringToBeSigned .= "$k" . "=" . "$v"; + } else { + $stringToBeSigned .= "&" . "$k" . "=" . "$v"; + } + $i++; + } + } + unset ($k, $v); + return $stringToBeSigned; + } + + + /** + * RSA单独签名方法,未做字符串处理,字符串处理见getSignContent() + * @param $data 待签名字符串 + * @param $privatekey 商户私钥,根据keyfromfile来判断是读取字符串还是读取文件,false:填写私钥字符串去回车和空格 true:填写私钥文件路径 + * @param $signType 签名方式,RSA:SHA1 RSA2:SHA256 + * @param $keyfromfile 私钥获取方式,读取字符串还是读文件 + * @return string + */ + public function alonersaSign($data,$privatekey,$signType = "RSA",$keyfromfile=false) { + if(!$keyfromfile){ + $priKey=$privatekey; + $res = "-----BEGIN RSA PRIVATE KEY-----\n" . + wordwrap($priKey, 64, "\n", true) . + "\n-----END RSA PRIVATE KEY-----"; + } + else{ + $priKey = file_get_contents($privatekey); + $res = openssl_get_privatekey($priKey); + } + ($res) or die('您使用的私钥格式错误,请检查RSA私钥配置'); + if ("RSA2" == $signType) { + openssl_sign($data, $sign, $res, OPENSSL_ALGO_SHA256); + } else { + openssl_sign($data, $sign, $res); + } + if($keyfromfile){ + openssl_free_key($res); + } + $sign = base64_encode($sign); + return $sign; + } + + /** + * 转换字符集编码 + * @param $data + * @param $targetCharset + * @return string + */ + function characet($data, $targetCharset) { + + if (!empty($data)) { + $fileType = $this->fileCharset; + if (strcasecmp($fileType, $targetCharset) != 0) { + $data = mb_convert_encoding($data, $targetCharset, $fileType); + } + } + return $data; + } + + /** + * 发送curl请求 + * @param $url + * @param null $postFields + * @return bool|string + * @throws Exception + */ + protected function curl($url, $postFields = null) { + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_FAILONERROR, false); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); + $postBodyString = ""; + $encodeArray = Array(); + $postMultipart = false; + + if (is_array($postFields) && 0 < count($postFields)) { + foreach ($postFields as $k => $v) { + if ("@" != substr($v, 0, 1)) //判断是不是文件上传 + { + $postBodyString .= "$k=" . urlencode($this->characet($v, $this->postCharset)) . "&"; + $encodeArray[$k] = $this->characet($v, $this->postCharset); + } else //文件上传用multipart/form-data,否则用www-form-urlencoded + { + $postMultipart = true; + $encodeArray[$k] = new \CURLFile(substr($v, 1)); + } + } + unset ($k, $v); + curl_setopt($ch, CURLOPT_POST, true); + if ($postMultipart) { + curl_setopt($ch, CURLOPT_POSTFIELDS, $encodeArray); + } else { + curl_setopt($ch, CURLOPT_POSTFIELDS, substr($postBodyString, 0, -1)); + } + } + + if (!$postMultipart) { + $headers = array('content-type: application/x-www-form-urlencoded;charset=' . $this->postCharset); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + } + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + $reponse = curl_exec($ch); + if (curl_errno($ch)) { + throw new Exception(curl_error($ch), 0); + } else { + $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + if (200 !== $httpStatusCode) { + throw new Exception($reponse, $httpStatusCode); + } + } + curl_close($ch); + return $reponse; + } + + protected function getMillisecond() { + list($s1, $s2) = explode(' ', microtime()); + return (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000); + } + + /** + * 打印日志信息 + * @param $apiName + * @param $requestUrl + * @param $errorCode + * @param $responseTxt + */ + protected function logCommunicationError($apiName, $requestUrl, $errorCode, $responseTxt) { + $logData = array( + date("Y-m-d H:i:s"), + $apiName, + $this->appId, + PHP_OS, + $this->alipaySdkVersion, + $requestUrl, + $errorCode, + str_replace("\n", "", $responseTxt) + ); + echo json_encode($logData); + } + + /** + * Json格式签名内容 + * @param $request + * @param $responseContent + * @param $responseJSON + * @return SignData + */ + function parserJSONSignData($request, $responseContent, $responseJSON) { + $signData = new SignData(); + $signData->sign = $this->parserJSONSign($responseJSON); + $signData->signSourceData = $this->parserJSONSignSource($request, $responseContent); + return $signData; + } + + function parserJSONSign($responseJSon) { + return $responseJSon->sign; + } + + function parserJSONSignSource($request, $responseContent) { + $apiName = $request->getApiMethodName(); + $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX; + $rootIndex = strpos($responseContent, $rootNodeName); + $errorIndex = strpos($responseContent, $this->ERROR_RESPONSE); + if ($rootIndex > 0) { + return $this->parserJSONSource($responseContent, $rootNodeName, $rootIndex); + } else if ($errorIndex > 0) { + return $this->parserJSONSource($responseContent, $this->ERROR_RESPONSE, $errorIndex); + } else { + return null; + } + } + + function parserJSONSource($responseContent, $nodeName, $nodeIndex) { + $signDataStartIndex = $nodeIndex + strlen($nodeName) + 2; + if(strrpos($responseContent, $this->ALIPAY_CERT_SN)){ + $signIndex = strrpos($responseContent, "\"" . $this->ALIPAY_CERT_SN . "\""); + }else{ + $signIndex = strrpos($responseContent, "\"" . $this->SIGN_NODE_NAME . "\""); + } + // 签名前-逗号 + $signDataEndIndex = $signIndex - 1; + $indexLen = $signDataEndIndex - $signDataStartIndex; + if ($indexLen < 0) { + return null; + } + return substr($responseContent, $signDataStartIndex, $indexLen); + } + + /** + * XML格式签名内容 + * @param $request + * @param $responseContent + * @return SignData + */ + function parserXMLSignData($request, $responseContent) { + $signData = new SignData(); + $signData->sign = $this->parserXMLSign($responseContent); + $signData->signSourceData = $this->parserXMLSignSource($request, $responseContent); + return $signData; + } + + function parserXMLSign($responseContent) { + if(strrpos($responseContent, $this->ALIPAY_CERT_SN)){ + $signNodeName = "<" . $this->ALIPAY_CERT_SN . ">"; + $signEndNodeName = "</" . $this->ALIPAY_CERT_SN . ">"; + }else{ + $signNodeName = "<" . $this->SIGN_NODE_NAME . ">"; + $signEndNodeName = "</" . $this->SIGN_NODE_NAME . ">"; + } + + $indexOfSignNode = strpos($responseContent, $signNodeName); + $indexOfSignEndNode = strpos($responseContent, $signEndNodeName); + if ($indexOfSignNode < 0 || $indexOfSignEndNode < 0) { + return null; + } + $nodeIndex = ($indexOfSignNode + strlen($signNodeName)); + $indexLen = $indexOfSignEndNode - $nodeIndex; + if ($indexLen < 0) { + return null; + } + // 签名 + return substr($responseContent, $nodeIndex, $indexLen); + } + + function parserXMLSignSource($request, $responseContent) { + $apiName = $request->getApiMethodName(); + $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX; + $rootIndex = strpos($responseContent, $rootNodeName); + $errorIndex = strpos($responseContent, $this->ERROR_RESPONSE); + if ($rootIndex > 0) { + return $this->parserXMLSource($responseContent, $rootNodeName, $rootIndex); + } else if ($errorIndex > 0) { + return $this->parserXMLSource($responseContent, $this->ERROR_RESPONSE, $errorIndex); + } else { + return null; + } + } + + + function parserXMLSource($responseContent, $nodeName, $nodeIndex) { + $signDataStartIndex = $nodeIndex + strlen($nodeName) + 1; + if(strrpos($responseContent, $this->ALIPAY_CERT_SN)){ + $signIndex = strrpos($responseContent, "<" . $this->ALIPAY_CERT_SN . ">"); + }else{ + $signIndex = strrpos($responseContent, "<" . $this->SIGN_NODE_NAME . ">"); + } + + // 签名前-逗号 + $signDataEndIndex = $signIndex - 1; + $indexLen = $signDataEndIndex - $signDataStartIndex + 1; + + if ($indexLen < 0) { + return null; + } + return substr($responseContent, $signDataStartIndex, $indexLen); + } + + + /** + * 验签 + * @param $request + * @param $signData + * @param $resp + * @param $respObject + * @throws Exception + */ + public function checkResponseSign($request, $signData, $resp, $respObject) { + if (!$this->checkEmpty($this->alipayPublicKey) || !$this->checkEmpty($this->alipayrsaPublicKey)) { + if ($signData == null || $this->checkEmpty($signData->sign) || $this->checkEmpty($signData->signSourceData)) { + throw new Exception(" check sign Fail! The reason : signData is Empty"); + } + // 获取结果sub_code + $responseSubCode = $this->parserResponseSubCode($request, $resp, $respObject, $this->format); + if (!$this->checkEmpty($responseSubCode) || ($this->checkEmpty($responseSubCode) && !$this->checkEmpty($signData->sign))) { + $checkResult = $this->verify($signData->signSourceData, $signData->sign, $this->alipayPublicKey, $this->signType); + + if (!$checkResult) { + + //请求网关下载新的支付宝公钥证书 + if(!$respObject->alipay_cert_sn && ($request->getApiMethodName()=="alipay.open.app.alipaycert.download")){ + throw new Exception(" check sign Fail! The reason : alipay_cert_sn is Empty"); + } + //组装系统参数 + $sysParams["app_id"] = $this->appId; + $sysParams["format"] = $this->format; + $sysParams["sign_type"] = $this->signType; + $sysParams["method"] = "alipay.open.app.alipaycert.download"; + $sysParams["timestamp"] = date("Y-m-d H:i:s"); + $sysParams["alipay_sdk"] = $this->alipaySdkVersion; + $sysParams["terminal_type"] = $request->getTerminalType(); + $sysParams["terminal_info"] = $request->getTerminalInfo(); + $sysParams["prod_code"] = $request->getProdCode(); + $sysParams["notify_url"] = $request->getNotifyUrl(); + $sysParams["charset"] = $this->postCharset; + $sysParams["app_cert_sn"] = $this->appCertSN; + $sysParams["alipay_root_cert_sn"] = $this->alipayRootCertSN; + //获取业务参数 + $apiParas = array(); + $apiParas["biz_content"] = "{\"alipay_cert_sn\":\"".$respObject->alipay_cert_sn."\"}"; + $apiParams = $apiParas; + + //签名 + $sysParams["sign"] = $this->generateSign(array_merge($apiParams, $sysParams), $this->signType); + + //系统参数放入GET请求串 + $requestUrl = $this->gatewayUrl . "?"; + foreach ($sysParams as $sysParamKey => $sysParamValue) { + $requestUrl .= "$sysParamKey=" . urlencode($this->characet($sysParamValue, $this->postCharset)) . "&"; + } + $requestUrl = substr($requestUrl, 0, -1); + //发起HTTP请求 + try { + $resp = $this->curl($requestUrl, $apiParams); + } catch (Exception $e) { + $this->logCommunicationError($sysParams["method"], $requestUrl, "HTTP_ERROR_" . $e->getCode(), $e->getMessage()); + return false; + } + + // 将返回结果转换本地文件编码 + $r = iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp); + + $respObject = json_decode($r); + $resultCode = $respObject->alipay_open_app_alipaycert_download_response->code; + $certContent = $respObject->alipay_open_app_alipaycert_download_response->alipay_cert_content; + + if (!empty($resultCode) && $resultCode == 10000 && !empty($certContent)) { + $cert = base64_decode($certContent); + $certCheck = true; + if(!empty($this->alipayRootCertContent) && $this->isCheckAlipayPublicCert){ + $certCheck = isTrusted($cert,$this->alipayRootCertContent); + } + if($certCheck){ + $pkey = openssl_pkey_get_public($cert); + $keyData = openssl_pkey_get_details($pkey); + $public_key = str_replace('-----BEGIN PUBLIC KEY-----', '', $keyData['key']); + $public_key = trim(str_replace('-----END PUBLIC KEY-----', '', $public_key)); + $this->alipayrsaPublicKey = $public_key; + $checkResult = $this->verify($signData->signSourceData, $signData->sign, $this->alipayrsaPublicKey, $this->signType); + }else{ + //如果下载下来的支付宝公钥证书使用根证书检查失败直接抛异常 + throw new Exception("check sign Fail! [sign=" . $signData->sign . ", signSourceData=" . $signData->signSourceData . "]"); + } + } + + if(!$checkResult){ + if (strpos($signData->signSourceData, "\\/") > 0) { + $signData->signSourceData = str_replace("\\/", "/", $signData->signSourceData); + $checkResult = $this->verify($signData->signSourceData, $signData->sign, $this->alipayPublicKey, $this->signType); + if (!$checkResult) { + throw new Exception("check sign Fail! [sign=" . $signData->sign . ", signSourceData=" . $signData->signSourceData . "]"); + } + } else { + throw new Exception("check sign Fail! [sign=" . $signData->sign . ", signSourceData=" . $signData->signSourceData . "]"); + } + } + + } + } + } + } + + + function parserResponseSubCode($request, $responseContent, $respObject, $format) { + if ("json" == $format) { + $apiName = $request->getApiMethodName(); + $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX; + $errorNodeName = $this->ERROR_RESPONSE; + $rootIndex = strpos($responseContent, $rootNodeName); + $errorIndex = strpos($responseContent, $errorNodeName); + if ($rootIndex > 0) { + // 内部节点对象 + $rInnerObject = $respObject->$rootNodeName; + } elseif ($errorIndex > 0) { + $rInnerObject = $respObject->$errorNodeName; + } else { + return null; + } + // 存在属性则返回对应值 + if (isset($rInnerObject->sub_code)) { + return $rInnerObject->sub_code; + } else { + return null; + } + } elseif ("xml" == $format) { + // xml格式sub_code在同一层级 + return $respObject->sub_code; + } + } + + function verify($data, $sign, $rsaPublicKeyFilePath, $signType = 'RSA') { + if($this->checkEmpty($this->alipayPublicKey)){ + $pubKey= $this->alipayrsaPublicKey; + $res = "-----BEGIN PUBLIC KEY-----\n" . + wordwrap($pubKey, 64, "\n", true) . + "\n-----END PUBLIC KEY-----"; + }else { + //读取公钥文件 + $pubKey = file_get_contents($rsaPublicKeyFilePath); + //转换为openssl格式密钥 + $res = openssl_get_publickey($pubKey); + } + ($res) or die('支付宝RSA公钥错误。请检查公钥文件格式是否正确'); + //调用openssl内置方法验签,返回bool值 + $result = FALSE; + if ("RSA2" == $signType) { + $result = (openssl_verify($data, base64_decode($sign), $res, OPENSSL_ALGO_SHA256)===1); + } else { + $result = (openssl_verify($data, base64_decode($sign), $res)===1); + } + if(!$this->checkEmpty($this->alipayPublicKey)) { + //释放资源 + openssl_free_key($res); + } + return $result; + } + + + // 获取加密内容 + private function encryptJSONSignSource($request, $responseContent) { + $parsetItem = $this->parserEncryptJSONSignSource($request, $responseContent); + $bodyIndexContent = substr($responseContent, 0, $parsetItem->startIndex); + $bodyEndContent = substr($responseContent, $parsetItem->endIndex, strlen($responseContent) + 1 - $parsetItem->endIndex); + $bizContent = decrypt($parsetItem->encryptContent, $this->encryptKey); + return $bodyIndexContent . $bizContent . $bodyEndContent; + } + + + private function parserEncryptJSONSignSource($request, $responseContent) { + $apiName = $request->getApiMethodName(); + $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX; + $rootIndex = strpos($responseContent, $rootNodeName); + $errorIndex = strpos($responseContent, $this->ERROR_RESPONSE); + if ($rootIndex > 0) { + return $this->parserEncryptJSONItem($responseContent, $rootNodeName, $rootIndex); + } else if ($errorIndex > 0) { + return $this->parserEncryptJSONItem($responseContent, $this->ERROR_RESPONSE, $errorIndex); + } else { + return null; + } + } + + private function parserEncryptJSONItem($responseContent, $nodeName, $nodeIndex) { + $signDataStartIndex = $nodeIndex + strlen($nodeName) + 2; + if(strrpos($responseContent, $this->ALIPAY_CERT_SN)){ + $signIndex = strpos($responseContent, "\"" . $this->ALIPAY_CERT_SN . "\""); + }else{ + $signIndex = strpos($responseContent, "\"" . $this->SIGN_NODE_NAME . "\""); + } + + // 签名前-逗号 + $signDataEndIndex = $signIndex - 1; + if ($signDataEndIndex < 0) { + $signDataEndIndex = strlen($responseContent)-1 ; + } + $indexLen = $signDataEndIndex - $signDataStartIndex; + $encContent = substr($responseContent, $signDataStartIndex+1, $indexLen-2); + $encryptParseItem = new EncryptParseItem(); + $encryptParseItem->encryptContent = $encContent; + $encryptParseItem->startIndex = $signDataStartIndex; + $encryptParseItem->endIndex = $signDataEndIndex; + return $encryptParseItem; + } + + // 获取加密内容 + private function encryptXMLSignSource($request, $responseContent) { + $parsetItem = $this->parserEncryptXMLSignSource($request, $responseContent); + $bodyIndexContent = substr($responseContent, 0, $parsetItem->startIndex); + $bodyEndContent = substr($responseContent, $parsetItem->endIndex, strlen($responseContent) + 1 - $parsetItem->endIndex); + $bizContent = decrypt($parsetItem->encryptContent, $this->encryptKey); + return $bodyIndexContent . $bizContent . $bodyEndContent; + + } + + private function parserEncryptXMLSignSource($request, $responseContent) { + $apiName = $request->getApiMethodName(); + $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX; + $rootIndex = strpos($responseContent, $rootNodeName); + $errorIndex = strpos($responseContent, $this->ERROR_RESPONSE); + if ($rootIndex > 0) { + return $this->parserEncryptXMLItem($responseContent, $rootNodeName, $rootIndex); + } else if ($errorIndex > 0) { + return $this->parserEncryptXMLItem($responseContent, $this->ERROR_RESPONSE, $errorIndex); + } else { + return null; + } + } + + private function parserEncryptXMLItem($responseContent, $nodeName, $nodeIndex) { + $signDataStartIndex = $nodeIndex + strlen($nodeName) + 1; + $xmlStartNode="<".$this->ENCRYPT_XML_NODE_NAME.">"; + $xmlEndNode="</".$this->ENCRYPT_XML_NODE_NAME.">"; + $indexOfXmlNode=strpos($responseContent,$xmlEndNode); + if($indexOfXmlNode<0){ + $item = new EncryptParseItem(); + $item->encryptContent = null; + $item->startIndex = 0; + $item->endIndex = 0; + return $item; + } + $startIndex=$signDataStartIndex+strlen($xmlStartNode); + $bizContentLen=$indexOfXmlNode-$startIndex; + $bizContent=substr($responseContent,$startIndex,$bizContentLen); + $encryptParseItem = new EncryptParseItem(); + $encryptParseItem->encryptContent = $bizContent; + $encryptParseItem->startIndex = $signDataStartIndex; + $encryptParseItem->endIndex = $indexOfXmlNode+strlen($xmlEndNode); + return $encryptParseItem; + } + + function echoDebug($content) { + if ($this->debugInfo) { + echo "<br/>" . $content; + } + } +} \ No newline at end of file diff --git a/extend/alipay/aop/AopCertification.php b/extend/alipay/aop/AopCertification.php new file mode 100644 index 0000000..2704e23 --- /dev/null +++ b/extend/alipay/aop/AopCertification.php @@ -0,0 +1,527 @@ +<?php + +/** + * 验证支付宝公钥证书是否可信 + * @param $alipayCert 支付宝公钥证书 + * @param $rootCert 支付宝根证书 + */ +function isTrusted($alipayCert, $rootCert) +{ + $alipayCerts = readPemCertChain($alipayCert); + $rootCerts = readPemCertChain($rootCert); + if (verifyCertChain($alipayCerts, $rootCerts)) { + return verifySignature($alipayCert, $rootCert); + } else { + return false; + } + +} + +function verifySignature($alipayCert, $rootCert) +{ + $alipayCertArray = explode("-----END CERTIFICATE-----", $alipayCert); + $rootCertArray = explode("-----END CERTIFICATE-----", $rootCert); + $length = count($rootCertArray) - 1; + $checkSign = isCertSigner($alipayCertArray[0] . "-----END CERTIFICATE-----", $alipayCertArray[1] . "-----END CERTIFICATE-----"); + if (!$checkSign) { + $checkSign = isCertSigner($alipayCertArray[1] . "-----END CERTIFICATE-----", $alipayCertArray[0] . "-----END CERTIFICATE-----"); + if ($checkSign) { + $issuer = openssl_x509_parse($alipayCertArray[0] . "-----END CERTIFICATE-----")['issuer']; + for ($i = 0; $i < $length; $i++) { + $subject = openssl_x509_parse($rootCertArray[$i] . "-----END CERTIFICATE-----")['subject']; + if ($issuer == $subject) { + isCertSigner($alipayCertArray[0] . "-----END CERTIFICATE-----", $rootCertArray[$i] . $rootCertArray); + return $checkSign; + } + } + } else { + return $checkSign; + } + } else { + $issuer = openssl_x509_parse($alipayCertArray[1] . "-----END CERTIFICATE-----")['issuer']; + for ($i = 0; $i < $length; $i++) { + $subject = openssl_x509_parse($rootCertArray[$i] . "-----END CERTIFICATE-----")['subject']; + if ($issuer == $subject) { + $checkSign = isCertSigner($alipayCertArray[1] . "-----END CERTIFICATE-----", $rootCertArray[$i] . "-----END CERTIFICATE-----"); + return $checkSign; + } + } + return $checkSign; + } +} + +function readPemCertChain($cert) +{ + $array = explode("-----END CERTIFICATE-----", $cert); + $certs[] = null; + for ($i = 0; $i < count($array) - 1; $i++) { + $certs[$i] = openssl_x509_parse($array[$i] . "-----END CERTIFICATE-----"); + } + return $certs; +} + +function verifyCert($prev, $rootCerts) +{ + $nowTime = time(); + if ($nowTime < $prev['validFrom_time_t']) { + echo "证书未激活"; + return false; + } + if ($nowTime > $prev['validTo_time_t']) { + echo "证书已经过期"; + return false; + } + $subjectMap = null; + for ($i = 0; $i < count($rootCerts); $i++) { + $subjectDN = array2string($rootCerts[$i]['subject']); + $subjectMap[$subjectDN] = $rootCerts[$i]; + } + $issuerDN = array2string(($prev['issuer'])); + if (!array_key_exists($issuerDN, $subjectMap)) { + echo "证书链验证失败"; + return false; + } + return true; +} + +/** + * 验证证书链是否是信任证书库中证书签发的 + * @param $alipayCerts 目标验证证书列表 + * @param $rootCerts 可信根证书列表 + */ +function verifyCertChain($alipayCerts, $rootCerts) +{ + $sorted = sortByDn($alipayCerts); + if (!$sorted) { + echo "证书链验证失败:不是完整的证书链"; + return false; + } + //先验证第一个证书是不是信任库中证书签发的 + $prev = $alipayCerts[0]; + $firstOK = verifyCert($prev, $rootCerts); + $length = count($alipayCerts); + if (!$firstOK || $length == 1) { + return $firstOK; + } + + $nowTime = time(); + //验证证书链 + for ($i = 1; $i < $length; $i++) { + $cert = $alipayCerts[$i]; + if ($nowTime < $cert['validFrom_time_t']) { + echo "证书未激活"; + return false; + } + if ($nowTime > $cert['validTo_time_t']) { + echo "证书已经过期"; + return false; + } + } + return true; +} + +/** + * 将证书链按照完整的签发顺序进行排序,排序后证书链为:[issuerA, subjectA]-[issuerA, subjectB]-[issuerB, subjectC]-[issuerC, subjectD]... + * @param $certs 证书链 + */ +function sortByDn(&$certs) +{ + //是否包含自签名证书 + $hasSelfSignedCert = false; + $subjectMap = null; + $issuerMap = null; + for ($i = 0; $i < count($certs); $i++) { + if (isSelfSigned($certs[$i])) { + if ($hasSelfSignedCert) { + return false; + } + $hasSelfSignedCert = true; + } + $subjectDN = array2string($certs[$i]['subject']); + $issuerDN = array2string(($certs[$i]['issuer'])); + $subjectMap[$subjectDN] = $certs[$i]; + $issuerMap[$issuerDN] = $certs[$i]; + } + $certChain = null; + addressingUp($subjectMap, $certChain, $certs[0]); + addressingDown($issuerMap, $certChain, $certs[0]); + + //说明证书链不完整 + if (count($certs) != count($certChain)) { + return false; + } + //将证书链复制到原先的数据 + for ($i = 0; $i < count($certs); $i++) { + $certs[$i] = $certChain[count($certs) - $i - 1]; + } + return true; +} + +/** + * 验证证书是否是自签发的 + * @param $cert 目标证书 + */ +function isSelfSigned($cert) +{ + $subjectDN = array2string($cert['subject']); + $issuerDN = array2string($cert['issuer']); + return ($subjectDN == $issuerDN); +} + + +function array2string($array) +{ + $string = []; + if ($array && is_array($array)) { + foreach ($array as $key => $value) { + $string[] = $key . '=' . $value; + } + } + return implode(',', $string); +} + +/** + * 向上构造证书链 + * @param $subjectMap 主题和证书的映射 + * @param $certChain 证书链 + * @param $current 当前需要插入证书链的证书,include + */ +function addressingUp($subjectMap, &$certChain, $current) +{ + $certChain[] = $current; + if (isSelfSigned($current)) { + return; + } + $issuerDN = array2string($current['issuer']); + + if (!array_key_exists($issuerDN, $subjectMap)) { + return; + } + addressingUp($subjectMap, $certChain, $subjectMap[$issuerDN]); +} + +/** + * 向下构造证书链 + * @param $issuerMap 签发者和证书的映射 + * @param $certChain 证书链 + * @param $current 当前需要插入证书链的证书,exclude + */ +function addressingDown($issuerMap, &$certChain, $current) +{ + $subjectDN = array2string($current['subject']); + if (!array_key_exists($subjectDN, $issuerMap)) { + return $certChain; + } + $certChain[] = $issuerMap[$subjectDN]; + addressingDown($issuerMap, $certChain, $issuerMap[$subjectDN]); +} + + +/** + * Extract signature from der encoded cert. + * Expects x509 der encoded certificate consisting of a section container + * containing 2 sections and a bitstream. The bitstream contains the + * original encrypted signature, encrypted by the public key of the issuing + * signer. + * @param string $der + * @return string on success + * @return bool false on failures + */ +function extractSignature($der = false) +{ + if (strlen($der) < 5) { + return false; + } + // skip container sequence + $der = substr($der, 4); + // now burn through two sequences and the return the final bitstream + while (strlen($der) > 1) { + $class = ord($der[0]); + $classHex = dechex($class); + switch ($class) { + // BITSTREAM + case 0x03: + $len = ord($der[1]); + $bytes = 0; + if ($len & 0x80) { + $bytes = $len & 0x0f; + $len = 0; + for ($i = 0; $i < $bytes; $i++) { + $len = ($len << 8) | ord($der[$i + 2]); + } + } + return substr($der, 3 + $bytes, $len); + break; + // SEQUENCE + case 0x30: + $len = ord($der[1]); + $bytes = 0; + if ($len & 0x80) { + $bytes = $len & 0x0f; + $len = 0; + for ($i = 0; $i < $bytes; $i++) { + $len = ($len << 8) | ord($der[$i + 2]); + } + } + $contents = substr($der, 2 + $bytes, $len); + $der = substr($der, 2 + $bytes + $len); + break; + default: + return false; + break; + } + } + return false; +} + +/** + * Get signature algorithm oid from der encoded signature data. + * Expects decrypted signature data from a certificate in der format. + * This ASN1 data should contain the following structure: + * SEQUENCE + * SEQUENCE + * OID (signature algorithm) + * NULL + * OCTET STRING (signature hash) + * @return bool false on failures + * @return string oid + */ +function getSignatureAlgorithmOid($der = null) +{ + // Validate this is the der we need... + if (!is_string($der) or strlen($der) < 5) { + return false; + } + $bit_seq1 = 0; + $bit_seq2 = 2; + $bit_oid = 4; + if (ord($der[$bit_seq1]) !== 0x30) { + die('Invalid DER passed to getSignatureAlgorithmOid()'); + } + if (ord($der[$bit_seq2]) !== 0x30) { + die('Invalid DER passed to getSignatureAlgorithmOid()'); + } + if (ord($der[$bit_oid]) !== 0x06) { + die('Invalid DER passed to getSignatureAlgorithmOid'); + } + // strip out what we don't need and get the oid + $der = substr($der, $bit_oid); + // Get the oid + $len = ord($der[1]); + $bytes = 0; + if ($len & 0x80) { + $bytes = $len & 0x0f; + $len = 0; + for ($i = 0; $i < $bytes; $i++) { + $len = ($len << 8) | ord($der[$i + 2]); + } + } + $oid_data = substr($der, 2 + $bytes, $len); + // Unpack the OID + $oid = floor(ord($oid_data[0]) / 40); + $oid .= '.' . ord($oid_data[0]) % 40; + $value = 0; + $i = 1; + while ($i < strlen($oid_data)) { + $value = $value << 7; + $value = $value | (ord($oid_data[$i]) & 0x7f); + if (!(ord($oid_data[$i]) & 0x80)) { + $oid .= '.' . $value; + $value = 0; + } + $i++; + } + return $oid; +} + +/** + * Get signature hash from der encoded signature data. + * Expects decrypted signature data from a certificate in der format. + * This ASN1 data should contain the following structure: + * SEQUENCE + * SEQUENCE + * OID (signature algorithm) + * NULL + * OCTET STRING (signature hash) + * @return bool false on failures + * @return string hash + */ +function getSignatureHash($der = null) +{ + // Validate this is the der we need... + if (!is_string($der) or strlen($der) < 5) { + return false; + } + if (ord($der[0]) !== 0x30) { + die('Invalid DER passed to getSignatureHash()'); + } + // strip out the container sequence + $der = substr($der, 2); + if (ord($der[0]) !== 0x30) { + die('Invalid DER passed to getSignatureHash()'); + } + // Get the length of the first sequence so we can strip it out. + $len = ord($der[1]); + $bytes = 0; + if ($len & 0x80) { + $bytes = $len & 0x0f; + $len = 0; + for ($i = 0; $i < $bytes; $i++) { + $len = ($len << 8) | ord($der[$i + 2]); + } + } + $der = substr($der, 2 + $bytes + $len); + // Now we should have an octet string + if (ord($der[0]) !== 0x04) { + die('Invalid DER passed to getSignatureHash()'); + } + $len = ord($der[1]); + $bytes = 0; + if ($len & 0x80) { + $bytes = $len & 0x0f; + $len = 0; + for ($i = 0; $i < $bytes; $i++) { + $len = ($len << 8) | ord($der[$i + 2]); + } + } + return bin2hex(substr($der, 2 + $bytes, $len)); +} + +/** + * Determine if one cert was used to sign another + * Note that more than one CA cert can give a positive result, some certs + * re-issue signing certs after having only changed the expiration dates. + * @param string $cert - PEM encoded cert + * @param string $caCert - PEM encoded cert that possibly signed $cert + * @return bool + */ +function isCertSigner($certPem = null, $caCertPem = null) +{ + if (!function_exists('openssl_pkey_get_public')) { + die('Need the openssl_pkey_get_public() function.'); + } + if (!function_exists('openssl_public_decrypt')) { + die('Need the openssl_public_decrypt() function.'); + } + if (!function_exists('hash')) { + die('Need the php hash() function.'); + } + if (empty($certPem) or empty($caCertPem)) { + return false; + } + // Convert the cert to der for feeding to extractSignature. + $certDer = pemToDer($certPem); + if (!is_string($certDer)) { + die('invalid certPem'); + } + // Grab the encrypted signature from the der encoded cert. + $encryptedSig = extractSignature($certDer); + if (!is_string($encryptedSig)) { + die('Failed to extract encrypted signature from certPem.'); + } + // Extract the public key from the ca cert, which is what has + // been used to encrypt the signature in the cert. + $pubKey = openssl_pkey_get_public($caCertPem); + if ($pubKey === false) { + die('Failed to extract the public key from the ca cert.'); + } + // Attempt to decrypt the encrypted signature using the CA's public + // key, returning the decrypted signature in $decryptedSig. If + // it can't be decrypted, this ca was not used to sign it for sure... + $rc = openssl_public_decrypt($encryptedSig, $decryptedSig, $pubKey); + if ($rc === false) { + return false; + } + // We now have the decrypted signature, which is der encoded + // asn1 data containing the signature algorithm and signature hash. + // Now we need what was originally hashed by the issuer, which is + // the original DER encoded certificate without the issuer and + // signature information. + $origCert = stripSignerAsn($certDer); + if ($origCert === false) { + die('Failed to extract unsigned cert.'); + } + // Get the oid of the signature hash algorithm, which is required + // to generate our own hash of the original cert. This hash is + // what will be compared to the issuers hash. + $oid = getSignatureAlgorithmOid($decryptedSig); + if ($oid === false) { + die('Failed to determine the signature algorithm.'); + } + switch ($oid) { + case '1.2.840.113549.2.2': + $algo = 'md2'; + break; + case '1.2.840.113549.2.4': + $algo = 'md4'; + break; + case '1.2.840.113549.2.5': + $algo = 'md5'; + break; + case '1.3.14.3.2.18': + $algo = 'sha'; + break; + case '1.3.14.3.2.26': + $algo = 'sha1'; + break; + case '2.16.840.1.101.3.4.2.1': + $algo = 'sha256'; + break; + case '2.16.840.1.101.3.4.2.2': + $algo = 'sha384'; + break; + case '2.16.840.1.101.3.4.2.3': + $algo = 'sha512'; + break; + default: + die('Unknown signature hash algorithm oid: ' . $oid); + break; + } + // Get the issuer generated hash from the decrypted signature. + $decryptedHash = getSignatureHash($decryptedSig); + // Ok, hash the original unsigned cert with the same algorithm + // and if it matches $decryptedHash we have a winner. + $certHash = hash($algo, $origCert); + return ($decryptedHash === $certHash); +} + +/** + * Convert pem encoded certificate to DER encoding + * @return string $derEncoded on success + * @return bool false on failures + */ +function pemToDer($pem = null) +{ + if (!is_string($pem)) { + return false; + } + $cert_split = preg_split('/(-----((BEGIN)|(END)) CERTIFICATE-----)/', $pem); + if (!isset($cert_split[1])) { + return false; + } + return base64_decode($cert_split[1]); +} + +/** + * Obtain der cert with issuer and signature sections stripped. + * @param string $der - der encoded certificate + * @return string $der on success + * @return bool false on failures. + */ +function stripSignerAsn($der = null) +{ + if (!is_string($der) or strlen($der) < 8) { + return false; + } + $bit = 4; + $len = ord($der[($bit + 1)]); + $bytes = 0; + if ($len & 0x80) { + $bytes = $len & 0x0f; + $len = 0; + for ($i = 0; $i < $bytes; $i++) { + $len = ($len << 8) | ord($der[$bit + $i + 2]); + } + } + return substr($der, 4, $len + 4); +} \ No newline at end of file diff --git a/extend/alipay/aop/AopClient.php b/extend/alipay/aop/AopClient.php new file mode 100644 index 0000000..76c2098 --- /dev/null +++ b/extend/alipay/aop/AopClient.php @@ -0,0 +1,1312 @@ +<?php + +require_once 'AopEncrypt.php'; +require_once 'EncryptParseItem.php'; +require_once 'EncryptResponseData.php'; +require_once 'SignData.php'; + +class AopClient +{ + //应用ID + public $appId; + + //私钥文件路径 + public $rsaPrivateKeyFilePath; + + //私钥值 + public $rsaPrivateKey; + + //网关 + public $gatewayUrl = "https://openapi.alipay.com/gateway.do"; + //返回数据格式 + public $format = "json"; + //api版本 + public $apiVersion = "1.0"; + + // 表单提交字符集编码 + public $postCharset = "UTF-8"; + + //使用文件读取文件格式,请只传递该值 + public $alipayPublicKey = null; + + //使用读取字符串格式,请只传递该值 + public $alipayrsaPublicKey; + + + public $debugInfo = false; + + private $fileCharset = "UTF-8"; + + private $RESPONSE_SUFFIX = "_response"; + + private $ERROR_RESPONSE = "error_response"; + + private $SIGN_NODE_NAME = "sign"; + + + //加密XML节点名称 + private $ENCRYPT_XML_NODE_NAME = "response_encrypted"; + + private $needEncrypt = false; + + + //签名类型 + public $signType = "RSA"; + + + //加密密钥和类型 + + public $encryptKey; + + public $encryptType = "AES"; + + private $targetServiceUrl = ""; + + protected $alipaySdkVersion = "alipay-sdk-php-20200415"; + + public function generateSign($params, $signType = "RSA") + { + return $this->sign($this->getSignContent($params), $signType); + } + + public function rsaSign($params, $signType = "RSA") + { + return $this->sign($this->getSignContent($params), $signType); + } + + public function getSignContent($params) + { + ksort($params); + + $stringToBeSigned = ""; + $i = 0; + foreach ($params as $k => $v) { + if (false === $this->checkEmpty($v) && "@" != substr($v, 0, 1)) { + // 转换成目标字符集 + $v = $this->characet($v, $this->postCharset); + + if ($i == 0) { + $stringToBeSigned .= "$k" . "=" . "$v"; + } else { + $stringToBeSigned .= "&" . "$k" . "=" . "$v"; + } + $i++; + } + } + + unset ($k, $v); + + return $stringToBeSigned; + } + + + //此方法对value做urlencode + public function getSignContentUrlencode($params) + { + ksort($params); + + $stringToBeSigned = ""; + $i = 0; + foreach ($params as $k => $v) { + if (false === $this->checkEmpty($v) && "@" != substr($v, 0, 1)) { + + // 转换成目标字符集 + $v = $this->characet($v, $this->postCharset); + + if ($i == 0) { + $stringToBeSigned .= "$k" . "=" . urlencode($v); + } else { + $stringToBeSigned .= "&" . "$k" . "=" . urlencode($v); + } + $i++; + } + } + + unset ($k, $v); + return $stringToBeSigned; + } + + protected function sign($data, $signType = "RSA") + { + if ($this->checkEmpty($this->rsaPrivateKeyFilePath)) { + $priKey = $this->rsaPrivateKey; + $res = "-----BEGIN RSA PRIVATE KEY-----\n" . + wordwrap($priKey, 64, "\n", true) . + "\n-----END RSA PRIVATE KEY-----"; + } else { + $priKey = file_get_contents($this->rsaPrivateKeyFilePath); + $res = openssl_get_privatekey($priKey); + } + + ($res) or die('您使用的私钥格式错误,请检查RSA私钥配置'); + + + if ("RSA2" == $signType) { + openssl_sign($data, $sign, $res, OPENSSL_ALGO_SHA256); + } else { + openssl_sign($data, $sign, $res); + } + + if (!$this->checkEmpty($this->rsaPrivateKeyFilePath)) { + openssl_free_key($res); + } + $sign = base64_encode($sign); + return $sign; + } + + /** + * RSA单独签名方法,未做字符串处理,字符串处理见getSignContent() + * @param $data 待签名字符串 + * @param $privatekey 商户私钥,根据keyfromfile来判断是读取字符串还是读取文件,false:填写私钥字符串去回车和空格 true:填写私钥文件路径 + * @param $signType 签名方式,RSA:SHA1 RSA2:SHA256 + * @param $keyfromfile 私钥获取方式,读取字符串还是读文件 + * @return string + */ + public function alonersaSign($data, $privatekey, $signType = "RSA", $keyfromfile = false) + { + + if (!$keyfromfile) { + $priKey = $privatekey; + $res = "-----BEGIN RSA PRIVATE KEY-----\n" . + wordwrap($priKey, 64, "\n", true) . + "\n-----END RSA PRIVATE KEY-----"; + } else { + $priKey = file_get_contents($privatekey); + $res = openssl_get_privatekey($priKey); + } + + ($res) or die('您使用的私钥格式错误,请检查RSA私钥配置'); + + if ("RSA2" == $signType) { + openssl_sign($data, $sign, $res, OPENSSL_ALGO_SHA256); + } else { + openssl_sign($data, $sign, $res); + } + + if ($keyfromfile) { + openssl_free_key($res); + } + $sign = base64_encode($sign); + return $sign; + } + + + protected function curl($url, $postFields = null) + { + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_FAILONERROR, false); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + + $postBodyString = ""; + $encodeArray = Array(); + $postMultipart = false; + + + if (is_array($postFields) && 0 < count($postFields)) { + + foreach ($postFields as $k => $v) { + if ("@" != substr($v, 0, 1)) //判断是不是文件上传 + { + + $postBodyString .= "$k=" . urlencode($this->characet($v, $this->postCharset)) . "&"; + $encodeArray[$k] = $this->characet($v, $this->postCharset); + } else //文件上传用multipart/form-data,否则用www-form-urlencoded + { + $postMultipart = true; + $encodeArray[$k] = new \CURLFile(substr($v, 1)); + } + + } + unset ($k, $v); + curl_setopt($ch, CURLOPT_POST, true); + if ($postMultipart) { + curl_setopt($ch, CURLOPT_POSTFIELDS, $encodeArray); + } else { + curl_setopt($ch, CURLOPT_POSTFIELDS, substr($postBodyString, 0, -1)); + } + } + + if (!$postMultipart) { + $headers = array('content-type: application/x-www-form-urlencoded;charset=' . $this->postCharset); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + } + + $reponse = curl_exec($ch); + + if (curl_errno($ch)) { + + throw new Exception(curl_error($ch), 0); + } else { + $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + if (200 !== $httpStatusCode) { + throw new Exception($reponse, $httpStatusCode); + } + } + + curl_close($ch); + return $reponse; + } + + protected function getMillisecond() + { + list($s1, $s2) = explode(' ', microtime()); + return (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000); + } + + + protected function logCommunicationError($apiName, $requestUrl, $errorCode, $responseTxt) + { + $logData = array( + date("Y-m-d H:i:s"), + $apiName, + $this->appId, + PHP_OS, + $this->alipaySdkVersion, + $requestUrl, + $errorCode, + str_replace("\n", "", $responseTxt) + ); + + echo json_encode($logData); + } + + /** + * 生成用于调用收银台SDK的字符串 + * @param $request SDK接口的请求参数对象 + * @param $appAuthToken 三方应用授权token + * @return string + */ + public function sdkExecute($request, $appAuthToken = null) + { + + $this->setupCharsets($request); + + $params['app_id'] = $this->appId; + $params['method'] = $request->getApiMethodName(); + $params['format'] = $this->format; + $params['sign_type'] = $this->signType; + $params['timestamp'] = date("Y-m-d H:i:s"); + $params['alipay_sdk'] = $this->alipaySdkVersion; + $params['charset'] = $this->postCharset; + + + $version = $request->getApiVersion(); + $params['version'] = $this->checkEmpty($version) ? $this->apiVersion : $version; + + if ($notify_url = $request->getNotifyUrl()) { + $params['notify_url'] = $notify_url; + } + + $params['app_auth_token'] = $appAuthToken; + + $dict = $request->getApiParas(); + $params['biz_content'] = $dict['biz_content']; + + ksort($params); + + $params['sign'] = $this->generateSign($params, $this->signType); + + foreach ($params as &$value) { + $value = $this->characet($value, $params['charset']); + } + + return http_build_query($params); + return $params; + } + + /** + * 页面提交执行方法 + * @param $request 跳转类接口的request + * @param string $httpmethod 提交方式,两个值可选:post、get; + * @param null $appAuthToken 三方应用授权token + * @return 构建好的、签名后的最终跳转URL(GET)或String形式的form(POST) + * @throws Exception + */ + public function pageExecute($request, $httpmethod = "POST", $appAuthToken = null) + { + + $this->setupCharsets($request); + + if (strcasecmp($this->fileCharset, $this->postCharset)) { + + // writeLog("本地文件字符集编码与表单提交编码不一致,请务必设置成一样,属性名分别为postCharset!"); + throw new Exception("文件编码:[" . $this->fileCharset . "] 与表单提交编码:[" . $this->postCharset . "]两者不一致!"); + } + + $iv = null; + + if (!$this->checkEmpty($request->getApiVersion())) { + $iv = $request->getApiVersion(); + } else { + $iv = $this->apiVersion; + } + + //组装系统参数 + $sysParams["app_id"] = $this->appId; + $sysParams["version"] = $iv; + $sysParams["format"] = $this->format; + $sysParams["sign_type"] = $this->signType; + $sysParams["method"] = $request->getApiMethodName(); + $sysParams["timestamp"] = date("Y-m-d H:i:s"); + $sysParams["alipay_sdk"] = $this->alipaySdkVersion; + $sysParams["terminal_type"] = $request->getTerminalType(); + $sysParams["terminal_info"] = $request->getTerminalInfo(); + $sysParams["prod_code"] = $request->getProdCode(); + $sysParams["notify_url"] = $request->getNotifyUrl(); + $sysParams["return_url"] = $request->getReturnUrl(); + $sysParams["charset"] = $this->postCharset; + $sysParams["app_auth_token"] = $appAuthToken; + + //获取业务参数 + $apiParams = $request->getApiParas(); + + if (method_exists($request, "getNeedEncrypt") && $request->getNeedEncrypt()) { + + $sysParams["encrypt_type"] = $this->encryptType; + + if ($this->checkEmpty($apiParams['biz_content'])) { + + throw new Exception(" api request Fail! The reason : encrypt request is not supperted!"); + } + + if ($this->checkEmpty($this->encryptKey) || $this->checkEmpty($this->encryptType)) { + + throw new Exception(" encryptType and encryptKey must not null! "); + } + + if ("AES" != $this->encryptType) { + + throw new Exception("加密类型只支持AES"); + } + + // 执行加密 + $enCryptContent = encrypt($apiParams['biz_content'], $this->encryptKey); + $apiParams['biz_content'] = $enCryptContent; + + } + + //print_r($apiParams); + $totalParams = array_merge($apiParams, $sysParams); + + //待签名字符串 + $preSignStr = $this->getSignContent($totalParams); + + //签名 + $totalParams["sign"] = $this->generateSign($totalParams, $this->signType); + + if ("GET" == strtoupper($httpmethod)) { + + //value做urlencode + $preString = $this->getSignContentUrlencode($totalParams); + //拼接GET请求串 + $requestUrl = $this->gatewayUrl . "?" . $preString; + + return $requestUrl; + } else { + //拼接表单字符串 + return $this->buildRequestForm($totalParams); + } + + + } + + + /** + * 建立请求,以表单HTML形式构造(默认) + * @param $para_temp 请求参数数组 + * @return 提交表单HTML文本 + */ + protected function buildRequestForm($para_temp) + { + + $sHtml = "<form id='alipaysubmit' name='alipaysubmit' action='" . $this->gatewayUrl . "?charset=" . trim($this->postCharset) . "' method='POST'>"; + while (list ($key, $val) = $this->fun_adm_each($para_temp)) { + if (false === $this->checkEmpty($val)) { + //$val = $this->characet($val, $this->postCharset); + $val = str_replace("'", "&apos;", $val); + //$val = str_replace("\"","&quot;",$val); + $sHtml .= "<input type='hidden' name='" . $key . "' value='" . $val . "'/>"; + } + } + + //submit按钮控件请不要含有name属性 + $sHtml = $sHtml . "<input type='submit' value='ok' style='display:none;''></form>"; + + $sHtml = $sHtml . "<script>document.forms['alipaysubmit'].submit();</script>"; + + return $sHtml; + } + + protected function fun_adm_each(&$array) + { + $res = array(); + $key = key($array); + if ($key !== null) { + next($array); + $res[1] = $res['value'] = $array[$key]; + $res[0] = $res['key'] = $key; + } else { + $res = false; + } + return $res; + } + + + public function execute($request, $authToken = null, $appInfoAuthtoken = null, $targetAppId = null) + { + + $this->setupCharsets($request); + + //如果两者编码不一致,会出现签名验签或者乱码 + if (strcasecmp($this->fileCharset, $this->postCharset)) { + + // writeLog("本地文件字符集编码与表单提交编码不一致,请务必设置成一样,属性名分别为postCharset!"); + throw new Exception("文件编码:[" . $this->fileCharset . "] 与表单提交编码:[" . $this->postCharset . "]两者不一致!"); + } + + $iv = null; + + if (!$this->checkEmpty($request->getApiVersion())) { + $iv = $request->getApiVersion(); + } else { + $iv = $this->apiVersion; + } + + + //组装系统参数 + $sysParams["app_id"] = $this->appId; + $sysParams["version"] = $iv; + $sysParams["format"] = $this->format; + $sysParams["sign_type"] = $this->signType; + $sysParams["method"] = $request->getApiMethodName(); + $sysParams["timestamp"] = date("Y-m-d H:i:s"); + $sysParams["auth_token"] = $authToken; + $sysParams["alipay_sdk"] = $this->alipaySdkVersion; + $sysParams["terminal_type"] = $request->getTerminalType(); + $sysParams["terminal_info"] = $request->getTerminalInfo(); + $sysParams["prod_code"] = $request->getProdCode(); + $sysParams["notify_url"] = $request->getNotifyUrl(); + $sysParams["charset"] = $this->postCharset; + $sysParams["app_auth_token"] = $appInfoAuthtoken; + $sysParams["target_app_id"] = $targetAppId; + if (!$this->checkEmpty($this->targetServiceUrl)) { + $sysParams["ws_service_url"] = $this->targetServiceUrl; + } + + + //获取业务参数 + $apiParams = $request->getApiParas(); + + if (method_exists($request, "getNeedEncrypt") && $request->getNeedEncrypt()) { + + $sysParams["encrypt_type"] = $this->encryptType; + + if ($this->checkEmpty($apiParams['biz_content'])) { + + throw new Exception(" api request Fail! The reason : encrypt request is not supperted!"); + } + + if ($this->checkEmpty($this->encryptKey) || $this->checkEmpty($this->encryptType)) { + + throw new Exception(" encryptType and encryptKey must not null! "); + } + + if ("AES" != $this->encryptType) { + + throw new Exception("加密类型只支持AES"); + } + + // 执行加密 + $enCryptContent = encrypt($apiParams['biz_content'], $this->encryptKey); + $apiParams['biz_content'] = $enCryptContent; + + } + + + //签名 + $sysParams["sign"] = $this->generateSign(array_merge($apiParams, $sysParams), $this->signType); + + + //系统参数放入GET请求串 + $requestUrl = $this->gatewayUrl . "?"; + foreach ($sysParams as $sysParamKey => $sysParamValue) { + $requestUrl .= "$sysParamKey=" . urlencode($this->characet($sysParamValue, $this->postCharset)) . "&"; + } + $requestUrl = substr($requestUrl, 0, -1); + + + //发起HTTP请求 + try { + $resp = $this->curl($requestUrl, $apiParams); + } catch (Exception $e) { + + $this->logCommunicationError($sysParams["method"], $requestUrl, "HTTP_ERROR_" . $e->getCode(), $e->getMessage()); + return false; + } + + //解析AOP返回结果 + $respWellFormed = false; + + + // 将返回结果转换本地文件编码 + $r = iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp); + + + $signData = null; + + if ("json" == $this->format) { + + $respObject = json_decode($r); + + if (null !== $respObject) { + $respWellFormed = true; + + $signData = $this->parserJSONSignData($request, $resp, $respObject); + + } + } else if ("xml" == $this->format) { + $disableLibxmlEntityLoader = libxml_disable_entity_loader(true); + $respObject = @ simplexml_load_string($resp); + if (false !== $respObject) { + $respWellFormed = true; + + $signData = $this->parserXMLSignData($request, $resp); + } + libxml_disable_entity_loader($disableLibxmlEntityLoader); + } + + + //返回的HTTP文本不是标准JSON或者XML,记下错误日志 + if (false === $respWellFormed) { + $this->logCommunicationError($sysParams["method"], $requestUrl, "HTTP_RESPONSE_NOT_WELL_FORMED", $resp); + return false; + } + + // 验签 + $this->checkResponseSign($request, $signData, $resp, $respObject); + + // 解密 + if (method_exists($request, "getNeedEncrypt") && $request->getNeedEncrypt()) { + + if ("json" == $this->format) { + + + $resp = $this->encryptJSONSignSource($request, $resp); + + // 将返回结果转换本地文件编码 + $r = iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp); + $respObject = json_decode($r); + } else { + + $resp = $this->encryptXMLSignSource($request, $resp); + + $r = iconv($this->postCharset, $this->fileCharset . "//IGNORE", $resp); + $disableLibxmlEntityLoader = libxml_disable_entity_loader(true); + $respObject = @ simplexml_load_string($r); + libxml_disable_entity_loader($disableLibxmlEntityLoader); + + } + } + + return $respObject; + } + + /** + * 转换字符集编码 + * @param $data + * @param $targetCharset + * @return string + */ + function characet($data, $targetCharset) + { + + if (!empty($data)) { + $fileType = $this->fileCharset; + if (strcasecmp($fileType, $targetCharset) != 0) { + $data = mb_convert_encoding($data, $targetCharset, $fileType); + // $data = iconv($fileType, $targetCharset.'//IGNORE', $data); + } + } + + + return $data; + } + + public function exec($paramsArray) + { + if (!isset ($paramsArray["method"])) { + trigger_error("No api name passed"); + } + $inflector = new LtInflector; + $inflector->conf["separator"] = "."; + $requestClassName = ucfirst($inflector->camelize(substr($paramsArray["method"], 7))) . "Request"; + if (!class_exists($requestClassName)) { + trigger_error("No such api: " . $paramsArray["method"]); + } + + $session = isset ($paramsArray["session"]) ? $paramsArray["session"] : null; + + $req = new $requestClassName; + foreach ($paramsArray as $paraKey => $paraValue) { + $inflector->conf["separator"] = "_"; + $setterMethodName = $inflector->camelize($paraKey); + $inflector->conf["separator"] = "."; + $setterMethodName = "set" . $inflector->camelize($setterMethodName); + if (method_exists($req, $setterMethodName)) { + $req->$setterMethodName ($paraValue); + } + } + return $this->execute($req, $session); + } + + /** + * 校验$value是否非空 + * if not set ,return true; + * if is null , return true; + **/ + protected function checkEmpty($value) + { + if (!isset($value)) + return true; + if ($value === null) + return true; + if (trim($value) === "") + return true; + + return false; + } + + /** rsaCheckV1 & rsaCheckV2 + * 验证签名 + * 在使用本方法前,必须初始化AopClient且传入公钥参数。 + * 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。 + **/ + public function rsaCheckV1($params, $rsaPublicKeyFilePath, $signType = 'RSA') + { + $sign = $params['sign']; + + unset($params['sign']); + unset($params['sign_type']); + return $this->verify($this->getCheckSignContent($params), $sign, $rsaPublicKeyFilePath, $signType); + } + + public function rsaCheckV2($params, $rsaPublicKeyFilePath, $signType = 'RSA') + { + $sign = $params['sign']; + + unset($params['sign']); + unset($params['sign_type']); + return $this->verify($this->getCheckSignContent($params), $sign, $rsaPublicKeyFilePath, $signType); + } + + function getCheckSignContent($params) + { + ksort($params); + + $stringToBeSigned = ""; + $i = 0; + foreach ($params as $k => $v) { + // 转换成目标字符集 + $v = $this->characet($v, $this->postCharset); + + if ($i == 0) { + $stringToBeSigned .= "$k" . "=" . "$v"; + } else { + $stringToBeSigned .= "&" . "$k" . "=" . "$v"; + } + $i++; + } + + unset ($k, $v); + return $stringToBeSigned; + } + + function verify($data, $sign, $rsaPublicKeyFilePath, $signType = 'RSA') + { + + if ($this->checkEmpty($this->alipayPublicKey)) { + + $pubKey = $this->alipayrsaPublicKey; + $res = "-----BEGIN PUBLIC KEY-----\n" . + wordwrap($pubKey, 64, "\n", true) . + "\n-----END PUBLIC KEY-----"; + } else { + //读取公钥文件 + $pubKey = file_get_contents($rsaPublicKeyFilePath); + //转换为openssl格式密钥 + $res = openssl_get_publickey($pubKey); + } + + ($res) or die('支付宝RSA公钥错误。请检查公钥文件格式是否正确'); + + //调用openssl内置方法验签,返回bool值 + + $result = FALSE; + if ("RSA2" == $signType) { + $result = (openssl_verify($data, base64_decode($sign), $res, OPENSSL_ALGO_SHA256) === 1); + } else { + $result = (openssl_verify($data, base64_decode($sign), $res) === 1); + } + + if (!$this->checkEmpty($this->alipayPublicKey)) { + //释放资源 + openssl_free_key($res); + } + + return $result; + } + + /** + * 在使用本方法前,必须初始化AopClient且传入公私钥参数。 + * 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。 + **/ + public function checkSignAndDecrypt($params, $rsaPublicKeyPem, $rsaPrivateKeyPem, $isCheckSign, $isDecrypt, $signType = 'RSA') + { + $charset = $params['charset']; + $bizContent = $params['biz_content']; + if ($isCheckSign) { + if (!$this->rsaCheckV2($params, $rsaPublicKeyPem, $signType)) { + echo "<br/>checkSign failure<br/>"; + exit; + } + } + if ($isDecrypt) { + return $this->rsaDecrypt($bizContent, $rsaPrivateKeyPem, $charset); + } + + return $bizContent; + } + + /** + * 在使用本方法前,必须初始化AopClient且传入公私钥参数。 + * 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。 + **/ + public function encryptAndSign($bizContent, $rsaPublicKeyPem, $rsaPrivateKeyPem, $charset, $isEncrypt, $isSign, $signType = 'RSA') + { + // 加密,并签名 + if ($isEncrypt && $isSign) { + $encrypted = $this->rsaEncrypt($bizContent, $rsaPublicKeyPem, $charset); + $sign = $this->sign($encrypted, $signType); + $response = "<?xml version=\"1.0\" encoding=\"$charset\"?><alipay><response>$encrypted</response><encryption_type>RSA</encryption_type><sign>$sign</sign><sign_type>$signType</sign_type></alipay>"; + return $response; + } + // 加密,不签名 + if ($isEncrypt && (!$isSign)) { + $encrypted = $this->rsaEncrypt($bizContent, $rsaPublicKeyPem, $charset); + $response = "<?xml version=\"1.0\" encoding=\"$charset\"?><alipay><response>$encrypted</response><encryption_type>$signType</encryption_type></alipay>"; + return $response; + } + // 不加密,但签名 + if ((!$isEncrypt) && $isSign) { + $sign = $this->sign($bizContent, $signType); + $response = "<?xml version=\"1.0\" encoding=\"$charset\"?><alipay><response>$bizContent</response><sign>$sign</sign><sign_type>$signType</sign_type></alipay>"; + return $response; + } + // 不加密,不签名 + $response = "<?xml version=\"1.0\" encoding=\"$charset\"?>$bizContent"; + return $response; + } + + /** + * 在使用本方法前,必须初始化AopClient且传入公私钥参数。 + * 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。 + **/ + public function rsaEncrypt($data, $rsaPublicKeyFilePath, $charset) + { + if ($this->checkEmpty($this->alipayPublicKey)) { + //读取字符串 + $pubKey = $this->alipayrsaPublicKey; + $res = "-----BEGIN PUBLIC KEY-----\n" . + wordwrap($pubKey, 64, "\n", true) . + "\n-----END PUBLIC KEY-----"; + } else { + //读取公钥文件 + $pubKey = file_get_contents($rsaPublicKeyFilePath); + //转换为openssl格式密钥 + $res = openssl_get_publickey($pubKey); + } + + ($res) or die('支付宝RSA公钥错误。请检查公钥文件格式是否正确'); + $blocks = $this->splitCN($data, 0, 30, $charset); + $chrtext  = null; + $encodes  = array(); + foreach ($blocks as $n => $block) { + if (!openssl_public_encrypt($block, $chrtext , $res)) { + echo "<br/>" . openssl_error_string() . "<br/>"; + } + $encodes[] = $chrtext ; + } + $chrtext = implode(",", $encodes); + + return base64_encode($chrtext); + } + + /** + * 在使用本方法前,必须初始化AopClient且传入公私钥参数。 + * 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。 + **/ + public function rsaDecrypt($data, $rsaPrivateKeyPem, $charset) + { + + if ($this->checkEmpty($this->rsaPrivateKeyFilePath)) { + //读字符串 + $priKey = $this->rsaPrivateKey; + $res = "-----BEGIN RSA PRIVATE KEY-----\n" . + wordwrap($priKey, 64, "\n", true) . + "\n-----END RSA PRIVATE KEY-----"; + } else { + $priKey = file_get_contents($this->rsaPrivateKeyFilePath); + $res = openssl_get_privatekey($priKey); + } + ($res) or die('您使用的私钥格式错误,请检查RSA私钥配置'); + //转换为openssl格式密钥 + $decodes = explode(',', $data); + $strnull = ""; + $dcyCont = ""; + foreach ($decodes as $n => $decode) { + if (!openssl_private_decrypt($decode, $dcyCont, $res)) { + echo "<br/>" . openssl_error_string() . "<br/>"; + } + $strnull .= $dcyCont; + } + return $strnull; + } + + function splitCN($cont, $n = 0, $subnum, $charset) + { + //$len = strlen($cont) / 3; + $arrr = array(); + for ($i = $n; $i < strlen($cont); $i += $subnum) { + $res = $this->subCNchar($cont, $i, $subnum, $charset); + if (!empty ($res)) { + $arrr[] = $res; + } + } + + return $arrr; + } + + function subCNchar($str, $start = 0, $length, $charset = "gbk") + { + if (strlen($str) <= $length) { + return $str; + } + $re['utf-8'] = "/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xff][\x80-\xbf]{3}/"; + $re['gb2312'] = "/[\x01-\x7f]|[\xb0-\xf7][\xa0-\xfe]/"; + $re['gbk'] = "/[\x01-\x7f]|[\x81-\xfe][\x40-\xfe]/"; + $re['big5'] = "/[\x01-\x7f]|[\x81-\xfe]([\x40-\x7e]|\xa1-\xfe])/"; + preg_match_all($re[$charset], $str, $match); + $slice = join("", array_slice($match[0], $start, $length)); + return $slice; + } + + function parserResponseSubCode($request, $responseContent, $respObject, $format) + { + + if ("json" == $format) { + + $apiName = $request->getApiMethodName(); + $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX; + $errorNodeName = $this->ERROR_RESPONSE; + + $rootIndex = strpos($responseContent, $rootNodeName); + $errorIndex = strpos($responseContent, $errorNodeName); + + if ($rootIndex > 0) { + // 内部节点对象 + $rInnerObject = $respObject->$rootNodeName; + } elseif ($errorIndex > 0) { + + $rInnerObject = $respObject->$errorNodeName; + } else { + return null; + } + + // 存在属性则返回对应值 + if (isset($rInnerObject->sub_code)) { + + return $rInnerObject->sub_code; + } else { + + return null; + } + + + } elseif ("xml" == $format) { + + // xml格式sub_code在同一层级 + return $respObject->sub_code; + + } + + + } + + function parserJSONSignData($request, $responseContent, $responseJSON) + { + + + $signData = new SignData(); + + $signData->sign = $this->parserJSONSign($responseJSON); + + + $signData->signSourceData = $this->parserJSONSignSource($request, $responseContent); + + + return $signData; + + } + + function parserJSONSignSource($request, $responseContent) + { + + $apiName = $request->getApiMethodName(); + $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX; + + $rootIndex = strpos($responseContent, $rootNodeName); + $errorIndex = strpos($responseContent, $this->ERROR_RESPONSE); + + + if ($rootIndex > 0) { + + return $this->parserJSONSource($responseContent, $rootNodeName, $rootIndex); + } else if ($errorIndex > 0) { + + return $this->parserJSONSource($responseContent, $this->ERROR_RESPONSE, $errorIndex); + } else { + + return null; + } + + + } + + function parserJSONSource($responseContent, $nodeName, $nodeIndex) + { + $signDataStartIndex = $nodeIndex + strlen($nodeName) + 2; + $signIndex = strrpos($responseContent, "\"" . $this->SIGN_NODE_NAME . "\""); + // 签名前-逗号 + $signDataEndIndex = $signIndex - 1; + $indexLen = $signDataEndIndex - $signDataStartIndex; + if ($indexLen < 0) { + + return null; + } + + return substr($responseContent, $signDataStartIndex, $indexLen); + + } + + function parserJSONSign($responseJSon) + { + + //dump($responseJSon);exit; + return $responseJSon->sign; + } + + function parserXMLSignData($request, $responseContent) + { + + + $signData = new SignData(); + + $signData->sign = $this->parserXMLSign($responseContent); + $signData->signSourceData = $this->parserXMLSignSource($request, $responseContent); + + + return $signData; + + + } + + function parserXMLSignSource($request, $responseContent) + { + + + $apiName = $request->getApiMethodName(); + $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX; + + + $rootIndex = strpos($responseContent, $rootNodeName); + $errorIndex = strpos($responseContent, $this->ERROR_RESPONSE); + // $this->echoDebug("<br/>rootNodeName:" . $rootNodeName); + // $this->echoDebug("<br/> responseContent:<xmp>" . $responseContent . ""); + + + if ($rootIndex > 0) { + + return $this->parserXMLSource($responseContent, $rootNodeName, $rootIndex); + } else if ($errorIndex > 0) { + + return $this->parserXMLSource($responseContent, $this->ERROR_RESPONSE, $errorIndex); + } else { + + return null; + } + + + } + + function parserXMLSource($responseContent, $nodeName, $nodeIndex) + { + $signDataStartIndex = $nodeIndex + strlen($nodeName) + 1; + $signIndex = strrpos($responseContent, "<" . $this->SIGN_NODE_NAME . ">"); + // 签名前-逗号 + $signDataEndIndex = $signIndex - 1; + $indexLen = $signDataEndIndex - $signDataStartIndex + 1; + + if ($indexLen < 0) { + return null; + } + + + return substr($responseContent, $signDataStartIndex, $indexLen); + + + } + + function parserXMLSign($responseContent) + { + $signNodeName = "<" . $this->SIGN_NODE_NAME . ">"; + $signEndNodeName = "SIGN_NODE_NAME . ">"; + + $indexOfSignNode = strpos($responseContent, $signNodeName); + $indexOfSignEndNode = strpos($responseContent, $signEndNodeName); + + + if ($indexOfSignNode < 0 || $indexOfSignEndNode < 0) { + return null; + } + + $nodeIndex = ($indexOfSignNode + strlen($signNodeName)); + + $indexLen = $indexOfSignEndNode - $nodeIndex; + + if ($indexLen < 0) { + return null; + } + + // 签名 + return substr($responseContent, $nodeIndex, $indexLen); + + } + + /** + * 验签 + * @param $request + * @param $signData + * @param $resp + * @param $respObject + * @throws Exception + */ + public function checkResponseSign($request, $signData, $resp, $respObject) + { + + if (!$this->checkEmpty($this->alipayPublicKey) || !$this->checkEmpty($this->alipayrsaPublicKey)) { + + + if ($signData == null || $this->checkEmpty($signData->sign) || $this->checkEmpty($signData->signSourceData)) { + + throw new Exception(" check sign Fail! The reason : signData is Empty"); + } + + + // 获取结果sub_code + $responseSubCode = $this->parserResponseSubCode($request, $resp, $respObject, $this->format); + + + if (!$this->checkEmpty($responseSubCode) || ($this->checkEmpty($responseSubCode) && !$this->checkEmpty($signData->sign))) { + + $checkResult = $this->verify($signData->signSourceData, $signData->sign, $this->alipayPublicKey, $this->signType); + + + if (!$checkResult) { + + if (strpos($signData->signSourceData, "\\/") > 0) { + + $signData->signSourceData = str_replace("\\/", "/", $signData->signSourceData); + + $checkResult = $this->verify($signData->signSourceData, $signData->sign, $this->alipayPublicKey, $this->signType); + + if (!$checkResult) { + throw new Exception("check sign Fail! [sign=" . $signData->sign . ", signSourceData=" . $signData->signSourceData . "]"); + } + + } else { + + throw new Exception("check sign Fail! [sign=" . $signData->sign . ", signSourceData=" . $signData->signSourceData . "]"); + } + + } + } + + + } + } + + private function setupCharsets($request) + { + if ($this->checkEmpty($this->postCharset)) { + $this->postCharset = 'UTF-8'; + } + $str = preg_match('/[\x80-\xff]/', $this->appId) ? $this->appId : print_r($request, true); + $this->fileCharset = mb_detect_encoding($str, "UTF-8, GBK") == 'UTF-8' ? 'UTF-8' : 'GBK'; + } + + // 获取加密内容 + + private function encryptJSONSignSource($request, $responseContent) + { + + $parsetItem = $this->parserEncryptJSONSignSource($request, $responseContent); + + $bodyIndexContent = substr($responseContent, 0, $parsetItem->startIndex); + $bodyEndContent = substr($responseContent, $parsetItem->endIndex, strlen($responseContent) + 1 - $parsetItem->endIndex); + + $bizContent = decrypt($parsetItem->encryptContent, $this->encryptKey); + return $bodyIndexContent . $bizContent . $bodyEndContent; + + } + + + private function parserEncryptJSONSignSource($request, $responseContent) + { + + $apiName = $request->getApiMethodName(); + $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX; + + $rootIndex = strpos($responseContent, $rootNodeName); + $errorIndex = strpos($responseContent, $this->ERROR_RESPONSE); + + + if ($rootIndex > 0) { + + return $this->parserEncryptJSONItem($responseContent, $rootNodeName, $rootIndex); + } else if ($errorIndex > 0) { + + return $this->parserEncryptJSONItem($responseContent, $this->ERROR_RESPONSE, $errorIndex); + } else { + + return null; + } + + + } + + + private function parserEncryptJSONItem($responseContent, $nodeName, $nodeIndex) + { + $signDataStartIndex = $nodeIndex + strlen($nodeName) + 2; + $signIndex = strpos($responseContent, "\"" . $this->SIGN_NODE_NAME . "\""); + // 签名前-逗号 + $signDataEndIndex = $signIndex - 1; + + if ($signDataEndIndex < 0) { + + $signDataEndIndex = strlen($responseContent) - 1; + } + + $indexLen = $signDataEndIndex - $signDataStartIndex; + + $encContent = substr($responseContent, $signDataStartIndex + 1, $indexLen - 2); + + + $encryptParseItem = new EncryptParseItem(); + + $encryptParseItem->encryptContent = $encContent; + $encryptParseItem->startIndex = $signDataStartIndex; + $encryptParseItem->endIndex = $signDataEndIndex; + + return $encryptParseItem; + + } + + // 获取加密内容 + + private function encryptXMLSignSource($request, $responseContent) + { + + $parsetItem = $this->parserEncryptXMLSignSource($request, $responseContent); + + $bodyIndexContent = substr($responseContent, 0, $parsetItem->startIndex); + $bodyEndContent = substr($responseContent, $parsetItem->endIndex, strlen($responseContent) + 1 - $parsetItem->endIndex); + $bizContent = decrypt($parsetItem->encryptContent, $this->encryptKey); + + return $bodyIndexContent . $bizContent . $bodyEndContent; + + } + + private function parserEncryptXMLSignSource($request, $responseContent) + { + + + $apiName = $request->getApiMethodName(); + $rootNodeName = str_replace(".", "_", $apiName) . $this->RESPONSE_SUFFIX; + + + $rootIndex = strpos($responseContent, $rootNodeName); + $errorIndex = strpos($responseContent, $this->ERROR_RESPONSE); + // $this->echoDebug("
rootNodeName:" . $rootNodeName); + // $this->echoDebug("
responseContent:" . $responseContent . ""); + + + if ($rootIndex > 0) { + + return $this->parserEncryptXMLItem($responseContent, $rootNodeName, $rootIndex); + } else if ($errorIndex > 0) { + + return $this->parserEncryptXMLItem($responseContent, $this->ERROR_RESPONSE, $errorIndex); + } else { + + return null; + } + + + } + + private function parserEncryptXMLItem($responseContent, $nodeName, $nodeIndex) + { + + $signDataStartIndex = $nodeIndex + strlen($nodeName) + 1; + + $xmlStartNode = "<" . $this->ENCRYPT_XML_NODE_NAME . ">"; + $xmlEndNode = "ENCRYPT_XML_NODE_NAME . ">"; + + $indexOfXmlNode = strpos($responseContent, $xmlEndNode); + if ($indexOfXmlNode < 0) { + + $item = new EncryptParseItem(); + $item->encryptContent = null; + $item->startIndex = 0; + $item->endIndex = 0; + return $item; + } + + $startIndex = $signDataStartIndex + strlen($xmlStartNode); + $bizContentLen = $indexOfXmlNode - $startIndex; + $bizContent = substr($responseContent, $startIndex, $bizContentLen); + + $encryptParseItem = new EncryptParseItem(); + $encryptParseItem->encryptContent = $bizContent; + $encryptParseItem->startIndex = $signDataStartIndex; + $encryptParseItem->endIndex = $indexOfXmlNode + strlen($xmlEndNode); + + return $encryptParseItem; + + } + + + function echoDebug($content) + { + + if ($this->debugInfo) { + echo "
" . $content; + } + + } + + +} diff --git a/extend/alipay/aop/AopEncrypt.php b/extend/alipay/aop/AopEncrypt.php new file mode 100644 index 0000000..a6f2ae5 --- /dev/null +++ b/extend/alipay/aop/AopEncrypt.php @@ -0,0 +1,81 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "aft.aifin.fireeye.ocr.image.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AftFinsecureRiskplusSecurityPolicyQueryRequest.php b/extend/alipay/aop/request/AftFinsecureRiskplusSecurityPolicyQueryRequest.php new file mode 100644 index 0000000..316883d --- /dev/null +++ b/extend/alipay/aop/request/AftFinsecureRiskplusSecurityPolicyQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "aft.finsecure.riskplus.security.policy.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AliosOpenAutoInfoQueryRequest.php b/extend/alipay/aop/request/AliosOpenAutoInfoQueryRequest.php new file mode 100644 index 0000000..30b31c5 --- /dev/null +++ b/extend/alipay/aop/request/AliosOpenAutoInfoQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alios.open.auto.info.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayAccountExrateAdviceAcceptRequest.php b/extend/alipay/aop/request/AlipayAccountExrateAdviceAcceptRequest.php new file mode 100644 index 0000000..43b7141 --- /dev/null +++ b/extend/alipay/aop/request/AlipayAccountExrateAdviceAcceptRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.account.exrate.advice.accept"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayAccountExrateAllclientrateQueryRequest.php b/extend/alipay/aop/request/AlipayAccountExrateAllclientrateQueryRequest.php new file mode 100644 index 0000000..7d04b90 --- /dev/null +++ b/extend/alipay/aop/request/AlipayAccountExrateAllclientrateQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.account.exrate.allclientrate.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayAccountExrateRatequeryRequest.php b/extend/alipay/aop/request/AlipayAccountExrateRatequeryRequest.php new file mode 100644 index 0000000..7ac974b --- /dev/null +++ b/extend/alipay/aop/request/AlipayAccountExrateRatequeryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.account.exrate.ratequery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayAccountExrateTraderequestCreateRequest.php b/extend/alipay/aop/request/AlipayAccountExrateTraderequestCreateRequest.php new file mode 100644 index 0000000..f46ac96 --- /dev/null +++ b/extend/alipay/aop/request/AlipayAccountExrateTraderequestCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.account.exrate.traderequest.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayAcquireCancelRequest.php b/extend/alipay/aop/request/AlipayAcquireCancelRequest.php new file mode 100644 index 0000000..2eb7e2e --- /dev/null +++ b/extend/alipay/aop/request/AlipayAcquireCancelRequest.php @@ -0,0 +1,171 @@ +operatorId = $operatorId; + $this->apiParas["operator_id"] = $operatorId; + } + + public function getOperatorId() + { + return $this->operatorId; + } + + public function setOperatorType($operatorType) + { + $this->operatorType = $operatorType; + $this->apiParas["operator_type"] = $operatorType; + } + + public function getOperatorType() + { + return $this->operatorType; + } + + public function setOutTradeNo($outTradeNo) + { + $this->outTradeNo = $outTradeNo; + $this->apiParas["out_trade_no"] = $outTradeNo; + } + + public function getOutTradeNo() + { + return $this->outTradeNo; + } + + public function setTradeNo($tradeNo) + { + $this->tradeNo = $tradeNo; + $this->apiParas["trade_no"] = $tradeNo; + } + + public function getTradeNo() + { + return $this->tradeNo; + } + + public function getApiMethodName() + { + return "alipay.acquire.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayAcquireCloseRequest.php b/extend/alipay/aop/request/AlipayAcquireCloseRequest.php new file mode 100644 index 0000000..c525547 --- /dev/null +++ b/extend/alipay/aop/request/AlipayAcquireCloseRequest.php @@ -0,0 +1,152 @@ +operatorId = $operatorId; + $this->apiParas["operator_id"] = $operatorId; + } + + public function getOperatorId() + { + return $this->operatorId; + } + + public function setOutTradeNo($outTradeNo) + { + $this->outTradeNo = $outTradeNo; + $this->apiParas["out_trade_no"] = $outTradeNo; + } + + public function getOutTradeNo() + { + return $this->outTradeNo; + } + + public function setTradeNo($tradeNo) + { + $this->tradeNo = $tradeNo; + $this->apiParas["trade_no"] = $tradeNo; + } + + public function getTradeNo() + { + return $this->tradeNo; + } + + public function getApiMethodName() + { + return "alipay.acquire.close"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayAcquireCreateandpayRequest.php b/extend/alipay/aop/request/AlipayAcquireCreateandpayRequest.php new file mode 100644 index 0000000..8212593 --- /dev/null +++ b/extend/alipay/aop/request/AlipayAcquireCreateandpayRequest.php @@ -0,0 +1,550 @@ +alipayCaRequest = $alipayCaRequest; + $this->apiParas["alipay_ca_request"] = $alipayCaRequest; + } + + public function getAlipayCaRequest() + { + return $this->alipayCaRequest; + } + + public function setBody($body) + { + $this->body = $body; + $this->apiParas["body"] = $body; + } + + public function getBody() + { + return $this->body; + } + + public function setBuyerEmail($buyerEmail) + { + $this->buyerEmail = $buyerEmail; + $this->apiParas["buyer_email"] = $buyerEmail; + } + + public function getBuyerEmail() + { + return $this->buyerEmail; + } + + public function setBuyerId($buyerId) + { + $this->buyerId = $buyerId; + $this->apiParas["buyer_id"] = $buyerId; + } + + public function getBuyerId() + { + return $this->buyerId; + } + + public function setChannelParameters($channelParameters) + { + $this->channelParameters = $channelParameters; + $this->apiParas["channel_parameters"] = $channelParameters; + } + + public function getChannelParameters() + { + return $this->channelParameters; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + $this->apiParas["currency"] = $currency; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setDynamicId($dynamicId) + { + $this->dynamicId = $dynamicId; + $this->apiParas["dynamic_id"] = $dynamicId; + } + + public function getDynamicId() + { + return $this->dynamicId; + } + + public function setDynamicIdType($dynamicIdType) + { + $this->dynamicIdType = $dynamicIdType; + $this->apiParas["dynamic_id_type"] = $dynamicIdType; + } + + public function getDynamicIdType() + { + return $this->dynamicIdType; + } + + public function setExtendParams($extendParams) + { + $this->extendParams = $extendParams; + $this->apiParas["extend_params"] = $extendParams; + } + + public function getExtendParams() + { + return $this->extendParams; + } + + public function setFormatType($formatType) + { + $this->formatType = $formatType; + $this->apiParas["format_type"] = $formatType; + } + + public function getFormatType() + { + return $this->formatType; + } + + public function setGoodsDetail($goodsDetail) + { + $this->goodsDetail = $goodsDetail; + $this->apiParas["goods_detail"] = $goodsDetail; + } + + public function getGoodsDetail() + { + return $this->goodsDetail; + } + + public function setItBPay($itBPay) + { + $this->itBPay = $itBPay; + $this->apiParas["it_b_pay"] = $itBPay; + } + + public function getItBPay() + { + return $this->itBPay; + } + + public function setMcardParameters($mcardParameters) + { + $this->mcardParameters = $mcardParameters; + $this->apiParas["mcard_parameters"] = $mcardParameters; + } + + public function getMcardParameters() + { + return $this->mcardParameters; + } + + public function setOperatorId($operatorId) + { + $this->operatorId = $operatorId; + $this->apiParas["operator_id"] = $operatorId; + } + + public function getOperatorId() + { + return $this->operatorId; + } + + public function setOperatorType($operatorType) + { + $this->operatorType = $operatorType; + $this->apiParas["operator_type"] = $operatorType; + } + + public function getOperatorType() + { + return $this->operatorType; + } + + public function setOutTradeNo($outTradeNo) + { + $this->outTradeNo = $outTradeNo; + $this->apiParas["out_trade_no"] = $outTradeNo; + } + + public function getOutTradeNo() + { + return $this->outTradeNo; + } + + public function setPrice($price) + { + $this->price = $price; + $this->apiParas["price"] = $price; + } + + public function getPrice() + { + return $this->price; + } + + public function setQuantity($quantity) + { + $this->quantity = $quantity; + $this->apiParas["quantity"] = $quantity; + } + + public function getQuantity() + { + return $this->quantity; + } + + public function setRefIds($refIds) + { + $this->refIds = $refIds; + $this->apiParas["ref_ids"] = $refIds; + } + + public function getRefIds() + { + return $this->refIds; + } + + public function setRoyaltyParameters($royaltyParameters) + { + $this->royaltyParameters = $royaltyParameters; + $this->apiParas["royalty_parameters"] = $royaltyParameters; + } + + public function getRoyaltyParameters() + { + return $this->royaltyParameters; + } + + public function setRoyaltyType($royaltyType) + { + $this->royaltyType = $royaltyType; + $this->apiParas["royalty_type"] = $royaltyType; + } + + public function getRoyaltyType() + { + return $this->royaltyType; + } + + public function setSellerEmail($sellerEmail) + { + $this->sellerEmail = $sellerEmail; + $this->apiParas["seller_email"] = $sellerEmail; + } + + public function getSellerEmail() + { + return $this->sellerEmail; + } + + public function setSellerId($sellerId) + { + $this->sellerId = $sellerId; + $this->apiParas["seller_id"] = $sellerId; + } + + public function getSellerId() + { + return $this->sellerId; + } + + public function setShowUrl($showUrl) + { + $this->showUrl = $showUrl; + $this->apiParas["show_url"] = $showUrl; + } + + public function getShowUrl() + { + return $this->showUrl; + } + + public function setSubject($subject) + { + $this->subject = $subject; + $this->apiParas["subject"] = $subject; + } + + public function getSubject() + { + return $this->subject; + } + + public function setTotalFee($totalFee) + { + $this->totalFee = $totalFee; + $this->apiParas["total_fee"] = $totalFee; + } + + public function getTotalFee() + { + return $this->totalFee; + } + + public function getApiMethodName() + { + return "alipay.acquire.createandpay"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayAcquirePrecreateRequest.php b/extend/alipay/aop/request/AlipayAcquirePrecreateRequest.php new file mode 100644 index 0000000..ae21e8a --- /dev/null +++ b/extend/alipay/aop/request/AlipayAcquirePrecreateRequest.php @@ -0,0 +1,402 @@ +body = $body; + $this->apiParas["body"] = $body; + } + + public function getBody() + { + return $this->body; + } + + public function setChannelParameters($channelParameters) + { + $this->channelParameters = $channelParameters; + $this->apiParas["channel_parameters"] = $channelParameters; + } + + public function getChannelParameters() + { + return $this->channelParameters; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + $this->apiParas["currency"] = $currency; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setExtendParams($extendParams) + { + $this->extendParams = $extendParams; + $this->apiParas["extend_params"] = $extendParams; + } + + public function getExtendParams() + { + return $this->extendParams; + } + + public function setGoodsDetail($goodsDetail) + { + $this->goodsDetail = $goodsDetail; + $this->apiParas["goods_detail"] = $goodsDetail; + } + + public function getGoodsDetail() + { + return $this->goodsDetail; + } + + public function setItBPay($itBPay) + { + $this->itBPay = $itBPay; + $this->apiParas["it_b_pay"] = $itBPay; + } + + public function getItBPay() + { + return $this->itBPay; + } + + public function setOperatorCode($operatorCode) + { + $this->operatorCode = $operatorCode; + $this->apiParas["operator_code"] = $operatorCode; + } + + public function getOperatorCode() + { + return $this->operatorCode; + } + + public function setOperatorId($operatorId) + { + $this->operatorId = $operatorId; + $this->apiParas["operator_id"] = $operatorId; + } + + public function getOperatorId() + { + return $this->operatorId; + } + + public function setOutTradeNo($outTradeNo) + { + $this->outTradeNo = $outTradeNo; + $this->apiParas["out_trade_no"] = $outTradeNo; + } + + public function getOutTradeNo() + { + return $this->outTradeNo; + } + + public function setPrice($price) + { + $this->price = $price; + $this->apiParas["price"] = $price; + } + + public function getPrice() + { + return $this->price; + } + + public function setQuantity($quantity) + { + $this->quantity = $quantity; + $this->apiParas["quantity"] = $quantity; + } + + public function getQuantity() + { + return $this->quantity; + } + + public function setRoyaltyParameters($royaltyParameters) + { + $this->royaltyParameters = $royaltyParameters; + $this->apiParas["royalty_parameters"] = $royaltyParameters; + } + + public function getRoyaltyParameters() + { + return $this->royaltyParameters; + } + + public function setRoyaltyType($royaltyType) + { + $this->royaltyType = $royaltyType; + $this->apiParas["royalty_type"] = $royaltyType; + } + + public function getRoyaltyType() + { + return $this->royaltyType; + } + + public function setSellerEmail($sellerEmail) + { + $this->sellerEmail = $sellerEmail; + $this->apiParas["seller_email"] = $sellerEmail; + } + + public function getSellerEmail() + { + return $this->sellerEmail; + } + + public function setSellerId($sellerId) + { + $this->sellerId = $sellerId; + $this->apiParas["seller_id"] = $sellerId; + } + + public function getSellerId() + { + return $this->sellerId; + } + + public function setShowUrl($showUrl) + { + $this->showUrl = $showUrl; + $this->apiParas["show_url"] = $showUrl; + } + + public function getShowUrl() + { + return $this->showUrl; + } + + public function setSubject($subject) + { + $this->subject = $subject; + $this->apiParas["subject"] = $subject; + } + + public function getSubject() + { + return $this->subject; + } + + public function setTotalFee($totalFee) + { + $this->totalFee = $totalFee; + $this->apiParas["total_fee"] = $totalFee; + } + + public function getTotalFee() + { + return $this->totalFee; + } + + public function getApiMethodName() + { + return "alipay.acquire.precreate"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayAcquireQueryRequest.php b/extend/alipay/aop/request/AlipayAcquireQueryRequest.php new file mode 100644 index 0000000..752ced9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayAcquireQueryRequest.php @@ -0,0 +1,136 @@ +outTradeNo = $outTradeNo; + $this->apiParas["out_trade_no"] = $outTradeNo; + } + + public function getOutTradeNo() + { + return $this->outTradeNo; + } + + public function setTradeNo($tradeNo) + { + $this->tradeNo = $tradeNo; + $this->apiParas["trade_no"] = $tradeNo; + } + + public function getTradeNo() + { + return $this->tradeNo; + } + + public function getApiMethodName() + { + return "alipay.acquire.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayAcquireRefundRequest.php b/extend/alipay/aop/request/AlipayAcquireRefundRequest.php new file mode 100644 index 0000000..c60bc09 --- /dev/null +++ b/extend/alipay/aop/request/AlipayAcquireRefundRequest.php @@ -0,0 +1,236 @@ +operatorId = $operatorId; + $this->apiParas["operator_id"] = $operatorId; + } + + public function getOperatorId() + { + return $this->operatorId; + } + + public function setOperatorType($operatorType) + { + $this->operatorType = $operatorType; + $this->apiParas["operator_type"] = $operatorType; + } + + public function getOperatorType() + { + return $this->operatorType; + } + + public function setOutRequestNo($outRequestNo) + { + $this->outRequestNo = $outRequestNo; + $this->apiParas["out_request_no"] = $outRequestNo; + } + + public function getOutRequestNo() + { + return $this->outRequestNo; + } + + public function setOutTradeNo($outTradeNo) + { + $this->outTradeNo = $outTradeNo; + $this->apiParas["out_trade_no"] = $outTradeNo; + } + + public function getOutTradeNo() + { + return $this->outTradeNo; + } + + public function setRefIds($refIds) + { + $this->refIds = $refIds; + $this->apiParas["ref_ids"] = $refIds; + } + + public function getRefIds() + { + return $this->refIds; + } + + public function setRefundAmount($refundAmount) + { + $this->refundAmount = $refundAmount; + $this->apiParas["refund_amount"] = $refundAmount; + } + + public function getRefundAmount() + { + return $this->refundAmount; + } + + public function setRefundReason($refundReason) + { + $this->refundReason = $refundReason; + $this->apiParas["refund_reason"] = $refundReason; + } + + public function getRefundReason() + { + return $this->refundReason; + } + + public function setTradeNo($tradeNo) + { + $this->tradeNo = $tradeNo; + $this->apiParas["trade_no"] = $tradeNo; + } + + public function getTradeNo() + { + return $this->tradeNo; + } + + public function getApiMethodName() + { + return "alipay.acquire.refund"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayAppTokenGetRequest.php b/extend/alipay/aop/request/AlipayAppTokenGetRequest.php new file mode 100644 index 0000000..4639206 --- /dev/null +++ b/extend/alipay/aop/request/AlipayAppTokenGetRequest.php @@ -0,0 +1,118 @@ +secret = $secret; + $this->apiParas["secret"] = $secret; + } + + public function getSecret() + { + return $this->secret; + } + + public function getApiMethodName() + { + return "alipay.app.token.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayAssetPointBalanceQueryRequest.php b/extend/alipay/aop/request/AlipayAssetPointBalanceQueryRequest.php new file mode 100644 index 0000000..a6c6e0e --- /dev/null +++ b/extend/alipay/aop/request/AlipayAssetPointBalanceQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayAssetPointBudgetQueryRequest.php b/extend/alipay/aop/request/AlipayAssetPointBudgetQueryRequest.php new file mode 100644 index 0000000..fd02570 --- /dev/null +++ b/extend/alipay/aop/request/AlipayAssetPointBudgetQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayAssetPointOrderCreateRequest.php b/extend/alipay/aop/request/AlipayAssetPointOrderCreateRequest.php new file mode 100644 index 0000000..5799924 --- /dev/null +++ b/extend/alipay/aop/request/AlipayAssetPointOrderCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.asset.point.order.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayAssetPointOrderQueryRequest.php b/extend/alipay/aop/request/AlipayAssetPointOrderQueryRequest.php new file mode 100644 index 0000000..497c70b --- /dev/null +++ b/extend/alipay/aop/request/AlipayAssetPointOrderQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.asset.point.order.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayBossCsChannelQueryRequest.php b/extend/alipay/aop/request/AlipayBossCsChannelQueryRequest.php new file mode 100644 index 0000000..035d1c2 --- /dev/null +++ b/extend/alipay/aop/request/AlipayBossCsChannelQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.boss.cs.channel.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayBossFncXwbtestRetModifyRequest.php b/extend/alipay/aop/request/AlipayBossFncXwbtestRetModifyRequest.php new file mode 100644 index 0000000..8483713 --- /dev/null +++ b/extend/alipay/aop/request/AlipayBossFncXwbtestRetModifyRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayBossProdArrangementOfflineQueryRequest.php b/extend/alipay/aop/request/AlipayBossProdArrangementOfflineQueryRequest.php new file mode 100644 index 0000000..0da0142 --- /dev/null +++ b/extend/alipay/aop/request/AlipayBossProdArrangementOfflineQueryRequest.php @@ -0,0 +1,118 @@ +productCode = $productCode; + $this->apiParas["product_code"] = $productCode; + } + + public function getProductCode() + { + return $this->productCode; + } + + public function getApiMethodName() + { + return "alipay.boss.prod.arrangement.offline.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayBossProdMyTestQueryRequest.php b/extend/alipay/aop/request/AlipayBossProdMyTestQueryRequest.php new file mode 100644 index 0000000..ae91313 --- /dev/null +++ b/extend/alipay/aop/request/AlipayBossProdMyTestQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.boss.prod.my.test.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceAdContractSignRequest.php b/extend/alipay/aop/request/AlipayCommerceAdContractSignRequest.php new file mode 100644 index 0000000..9ee791b --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceAdContractSignRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceAirCallcenterTradeApplyRequest.php b/extend/alipay/aop/request/AlipayCommerceAirCallcenterTradeApplyRequest.php new file mode 100644 index 0000000..a2ecd41 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceAirCallcenterTradeApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.air.callcenter.trade.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceAirXfgDsgModifyRequest.php b/extend/alipay/aop/request/AlipayCommerceAirXfgDsgModifyRequest.php new file mode 100644 index 0000000..c89f621 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceAirXfgDsgModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.air.xfg.dsg.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceCityfacilitatorCityQueryRequest.php b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorCityQueryRequest.php new file mode 100644 index 0000000..bad0c89 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorCityQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceCityfacilitatorDepositCancelRequest.php b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorDepositCancelRequest.php new file mode 100644 index 0000000..709846f --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorDepositCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.cityfacilitator.deposit.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceCityfacilitatorDepositConfirmRequest.php b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorDepositConfirmRequest.php new file mode 100644 index 0000000..749b0a2 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorDepositConfirmRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.cityfacilitator.deposit.confirm"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceCityfacilitatorDepositQueryRequest.php b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorDepositQueryRequest.php new file mode 100644 index 0000000..00c7044 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorDepositQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.cityfacilitator.deposit.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceCityfacilitatorFunctionQueryRequest.php b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorFunctionQueryRequest.php new file mode 100644 index 0000000..64c3aa8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorFunctionQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.cityfacilitator.function.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceCityfacilitatorScriptQueryRequest.php b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorScriptQueryRequest.php new file mode 100644 index 0000000..478de17 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorScriptQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.cityfacilitator.script.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceCityfacilitatorStationQueryRequest.php b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorStationQueryRequest.php new file mode 100644 index 0000000..de1b978 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorStationQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.cityfacilitator.station.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherBatchqueryRequest.php b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherBatchqueryRequest.php new file mode 100644 index 0000000..5abc4ed --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.cityfacilitator.voucher.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherCancelRequest.php b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherCancelRequest.php new file mode 100644 index 0000000..fad6acb --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.cityfacilitator.voucher.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherConfirmRequest.php b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherConfirmRequest.php new file mode 100644 index 0000000..bbd24f5 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherConfirmRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.cityfacilitator.voucher.confirm"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherGenerateRequest.php b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherGenerateRequest.php new file mode 100644 index 0000000..2c998c0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherGenerateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.cityfacilitator.voucher.generate"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherQueryRequest.php b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherQueryRequest.php new file mode 100644 index 0000000..3ebadbc --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.cityfacilitator.voucher.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherRefundRequest.php b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherRefundRequest.php new file mode 100644 index 0000000..0b2c648 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherRefundRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.cityfacilitator.voucher.refund"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherUploadRequest.php b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherUploadRequest.php new file mode 100644 index 0000000..f205162 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceCityfacilitatorVoucherUploadRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.cityfacilitator.voucher.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceDataCampaignCreateRequest.php b/extend/alipay/aop/request/AlipayCommerceDataCampaignCreateRequest.php new file mode 100644 index 0000000..758a501 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceDataCampaignCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.data.campaign.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceDataCampaignSendRequest.php b/extend/alipay/aop/request/AlipayCommerceDataCampaignSendRequest.php new file mode 100644 index 0000000..1a83749 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceDataCampaignSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.data.campaign.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceDataCustommetricSyncRequest.php b/extend/alipay/aop/request/AlipayCommerceDataCustommetricSyncRequest.php new file mode 100644 index 0000000..9fdb0b6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceDataCustommetricSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.data.custommetric.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceDataLogdataSyncRequest.php b/extend/alipay/aop/request/AlipayCommerceDataLogdataSyncRequest.php new file mode 100644 index 0000000..e9ea217 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceDataLogdataSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.data.logdata.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceDataMonitordataSyncRequest.php b/extend/alipay/aop/request/AlipayCommerceDataMonitordataSyncRequest.php new file mode 100644 index 0000000..bac6a0c --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceDataMonitordataSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.data.monitordata.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceEducateAuthenticateCampuscardCreateRequest.php b/extend/alipay/aop/request/AlipayCommerceEducateAuthenticateCampuscardCreateRequest.php new file mode 100644 index 0000000..e6761da --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceEducateAuthenticateCampuscardCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.educate.authenticate.campuscard.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceEducateAuthenticateCampuscardDeleteRequest.php b/extend/alipay/aop/request/AlipayCommerceEducateAuthenticateCampuscardDeleteRequest.php new file mode 100644 index 0000000..a0e4a78 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceEducateAuthenticateCampuscardDeleteRequest.php @@ -0,0 +1,119 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + + { + return "alipay.commerce.educate.authenticate.campuscard.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceEducateCampuscardAuthorizedQueryRequest.php b/extend/alipay/aop/request/AlipayCommerceEducateCampuscardAuthorizedQueryRequest.php new file mode 100644 index 0000000..2e455b5 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceEducateCampuscardAuthorizedQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceEducateParttimejobInfoCreateRequest.php b/extend/alipay/aop/request/AlipayCommerceEducateParttimejobInfoCreateRequest.php new file mode 100644 index 0000000..29ae6ac --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceEducateParttimejobInfoCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.educate.parttimejob.info.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceEducateSchoolcodeTokenCreateRequest.php b/extend/alipay/aop/request/AlipayCommerceEducateSchoolcodeTokenCreateRequest.php new file mode 100644 index 0000000..ba30230 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceEducateSchoolcodeTokenCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.educate.schoolcode.token.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceEducateStudentinfoShareRequest.php b/extend/alipay/aop/request/AlipayCommerceEducateStudentinfoShareRequest.php new file mode 100644 index 0000000..dfdde1c --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceEducateStudentinfoShareRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceEducateUserClickCreateRequest.php b/extend/alipay/aop/request/AlipayCommerceEducateUserClickCreateRequest.php new file mode 100644 index 0000000..78e7f43 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceEducateUserClickCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.educate.user.click.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceIotDeviceserviceCancelRequest.php b/extend/alipay/aop/request/AlipayCommerceIotDeviceserviceCancelRequest.php new file mode 100644 index 0000000..e96afec --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceIotDeviceserviceCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.iot.deviceservice.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceIotReceiptDetailQueryRequest.php b/extend/alipay/aop/request/AlipayCommerceIotReceiptDetailQueryRequest.php new file mode 100644 index 0000000..a47d832 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceIotReceiptDetailQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.iot.receipt.detail.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceIotReceiptSendRequest.php b/extend/alipay/aop/request/AlipayCommerceIotReceiptSendRequest.php new file mode 100644 index 0000000..69c6163 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceIotReceiptSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.iot.receipt.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceIotSdarttoolMessageQueryRequest.php b/extend/alipay/aop/request/AlipayCommerceIotSdarttoolMessageQueryRequest.php new file mode 100644 index 0000000..7528c58 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceIotSdarttoolMessageQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.iot.sdarttool.message.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceIotSdarttoolMessageSendRequest.php b/extend/alipay/aop/request/AlipayCommerceIotSdarttoolMessageSendRequest.php new file mode 100644 index 0000000..be2cdaf --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceIotSdarttoolMessageSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.iot.sdarttool.message.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceLogisticsWaybillMinimctSyncRequest.php b/extend/alipay/aop/request/AlipayCommerceLogisticsWaybillMinimctSyncRequest.php new file mode 100644 index 0000000..73800c0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceLogisticsWaybillMinimctSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.logistics.waybill.minimct.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceLotteryPresentSendRequest.php b/extend/alipay/aop/request/AlipayCommerceLotteryPresentSendRequest.php new file mode 100644 index 0000000..f9bc50a --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceLotteryPresentSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.lottery.present.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceLotteryPresentlistQueryRequest.php b/extend/alipay/aop/request/AlipayCommerceLotteryPresentlistQueryRequest.php new file mode 100644 index 0000000..78cb979 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceLotteryPresentlistQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.lottery.presentlist.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceLotteryTypelistQueryRequest.php b/extend/alipay/aop/request/AlipayCommerceLotteryTypelistQueryRequest.php new file mode 100644 index 0000000..18ac208 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceLotteryTypelistQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceTransportIntelligentizeDataSyncRequest.php b/extend/alipay/aop/request/AlipayCommerceTransportIntelligentizeDataSyncRequest.php new file mode 100644 index 0000000..0fdcbf9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceTransportIntelligentizeDataSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.transport.intelligentize.data.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceTransportNfccardSendRequest.php b/extend/alipay/aop/request/AlipayCommerceTransportNfccardSendRequest.php new file mode 100644 index 0000000..43ec41b --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceTransportNfccardSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.transport.nfccard.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceTransportOfflinepayKeyQueryRequest.php b/extend/alipay/aop/request/AlipayCommerceTransportOfflinepayKeyQueryRequest.php new file mode 100644 index 0000000..8292e4c --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceTransportOfflinepayKeyQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceTransportOfflinepayRecordVerifyRequest.php b/extend/alipay/aop/request/AlipayCommerceTransportOfflinepayRecordVerifyRequest.php new file mode 100644 index 0000000..c206c7d --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceTransportOfflinepayRecordVerifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.transport.offlinepay.record.verify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceTransportOfflinepayUserblacklistQueryRequest.php b/extend/alipay/aop/request/AlipayCommerceTransportOfflinepayUserblacklistQueryRequest.php new file mode 100644 index 0000000..66390f7 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceTransportOfflinepayUserblacklistQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.transport.offlinepay.userblacklist.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceTransportParkingReserveConfirmRequest.php b/extend/alipay/aop/request/AlipayCommerceTransportParkingReserveConfirmRequest.php new file mode 100644 index 0000000..292c7b0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceTransportParkingReserveConfirmRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.transport.parking.reserve.confirm"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayCommerceTransportVehicleownerMessageSendRequest.php b/extend/alipay/aop/request/AlipayCommerceTransportVehicleownerMessageSendRequest.php new file mode 100644 index 0000000..112f56b --- /dev/null +++ b/extend/alipay/aop/request/AlipayCommerceTransportVehicleownerMessageSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.commerce.transport.vehicleowner.message.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDaoweiOrderCancelRequest.php b/extend/alipay/aop/request/AlipayDaoweiOrderCancelRequest.php new file mode 100644 index 0000000..3669290 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDaoweiOrderCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.daowei.order.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDaoweiOrderConfirmRequest.php b/extend/alipay/aop/request/AlipayDaoweiOrderConfirmRequest.php new file mode 100644 index 0000000..b631ae9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDaoweiOrderConfirmRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.daowei.order.confirm"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDaoweiOrderModifyRequest.php b/extend/alipay/aop/request/AlipayDaoweiOrderModifyRequest.php new file mode 100644 index 0000000..d7392fe --- /dev/null +++ b/extend/alipay/aop/request/AlipayDaoweiOrderModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.daowei.order.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDaoweiOrderQueryRequest.php b/extend/alipay/aop/request/AlipayDaoweiOrderQueryRequest.php new file mode 100644 index 0000000..4455ce1 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDaoweiOrderQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.daowei.order.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDaoweiOrderRefundRequest.php b/extend/alipay/aop/request/AlipayDaoweiOrderRefundRequest.php new file mode 100644 index 0000000..08d15eb --- /dev/null +++ b/extend/alipay/aop/request/AlipayDaoweiOrderRefundRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.daowei.order.refund"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDaoweiOrderRefuseRequest.php b/extend/alipay/aop/request/AlipayDaoweiOrderRefuseRequest.php new file mode 100644 index 0000000..1416c47 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDaoweiOrderRefuseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.daowei.order.refuse"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDaoweiOrderSpModifyRequest.php b/extend/alipay/aop/request/AlipayDaoweiOrderSpModifyRequest.php new file mode 100644 index 0000000..fc25ab5 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDaoweiOrderSpModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.daowei.order.sp.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDaoweiOrderTransferRequest.php b/extend/alipay/aop/request/AlipayDaoweiOrderTransferRequest.php new file mode 100644 index 0000000..d744033 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDaoweiOrderTransferRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.daowei.order.transfer"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDaoweiServiceModifyRequest.php b/extend/alipay/aop/request/AlipayDaoweiServiceModifyRequest.php new file mode 100644 index 0000000..4669450 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDaoweiServiceModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.daowei.service.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDaoweiSpModifyRequest.php b/extend/alipay/aop/request/AlipayDaoweiSpModifyRequest.php new file mode 100644 index 0000000..638c791 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDaoweiSpModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.daowei.sp.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDaoweiSpScheduleModifyRequest.php b/extend/alipay/aop/request/AlipayDaoweiSpScheduleModifyRequest.php new file mode 100644 index 0000000..ffdaa96 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDaoweiSpScheduleModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.daowei.sp.schedule.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataAiserviceSgxGatewayQueryRequest.php b/extend/alipay/aop/request/AlipayDataAiserviceSgxGatewayQueryRequest.php new file mode 100644 index 0000000..d9d3996 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataAiserviceSgxGatewayQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.aiservice.sgx.gateway.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataAiserviceSmartpriceMerchanteffectQueryRequest.php b/extend/alipay/aop/request/AlipayDataAiserviceSmartpriceMerchanteffectQueryRequest.php new file mode 100644 index 0000000..bfda331 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataAiserviceSmartpriceMerchanteffectQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.aiservice.smartprice.merchanteffect.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataBillAccountlogQueryRequest.php b/extend/alipay/aop/request/AlipayDataBillAccountlogQueryRequest.php new file mode 100644 index 0000000..3a421e0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataBillAccountlogQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.bill.accountlog.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataBillBailQueryRequest.php b/extend/alipay/aop/request/AlipayDataBillBailQueryRequest.php new file mode 100644 index 0000000..614c866 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataBillBailQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.bill.bail.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataBillBalanceQueryRequest.php b/extend/alipay/aop/request/AlipayDataBillBalanceQueryRequest.php new file mode 100644 index 0000000..2f2c641 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataBillBalanceQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataBillBalancehisQueryRequest.php b/extend/alipay/aop/request/AlipayDataBillBalancehisQueryRequest.php new file mode 100644 index 0000000..08f357a --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataBillBalancehisQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.bill.balancehis.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataBillBuyQueryRequest.php b/extend/alipay/aop/request/AlipayDataBillBuyQueryRequest.php new file mode 100644 index 0000000..6b433ba --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataBillBuyQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.bill.buy.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataBillDownloadurlGetRequest.php b/extend/alipay/aop/request/AlipayDataBillDownloadurlGetRequest.php new file mode 100644 index 0000000..496e5de --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataBillDownloadurlGetRequest.php @@ -0,0 +1,134 @@ +billDate = $billDate; + $this->apiParas["bill_date"] = $billDate; + } + + public function getBillDate() + { + return $this->billDate; + } + + public function setBillType($billType) + { + $this->billType = $billType; + $this->apiParas["bill_type"] = $billType; + } + + public function getBillType() + { + return $this->billType; + } + + public function getApiMethodName() + { + return "alipay.data.bill.downloadurl.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataBillEreceiptApplyRequest.php b/extend/alipay/aop/request/AlipayDataBillEreceiptApplyRequest.php new file mode 100644 index 0000000..fabf903 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataBillEreceiptApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.bill.ereceipt.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataBillEreceiptQueryRequest.php b/extend/alipay/aop/request/AlipayDataBillEreceiptQueryRequest.php new file mode 100644 index 0000000..8c75c0a --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataBillEreceiptQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.bill.ereceipt.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataBillSellQueryRequest.php b/extend/alipay/aop/request/AlipayDataBillSellQueryRequest.php new file mode 100644 index 0000000..12213f0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataBillSellQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.bill.sell.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataBillTransferQueryRequest.php b/extend/alipay/aop/request/AlipayDataBillTransferQueryRequest.php new file mode 100644 index 0000000..2db21f6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataBillTransferQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.bill.transfer.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataexchangeSfasdfRequest.php b/extend/alipay/aop/request/AlipayDataDataexchangeSfasdfRequest.php new file mode 100644 index 0000000..938046d --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataexchangeSfasdfRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataexchange.sfasdf"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdCreativeBatchqueryRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdCreativeBatchqueryRequest.php new file mode 100644 index 0000000..e1ec5cb --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdCreativeBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.creative.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdCreativeCreateormodifyRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdCreativeCreateormodifyRequest.php new file mode 100644 index 0000000..73d3e9e --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdCreativeCreateormodifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.creative.createormodify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdCreativeQueryRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdCreativeQueryRequest.php new file mode 100644 index 0000000..52b8e73 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdCreativeQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.creative.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdDataQueryRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdDataQueryRequest.php new file mode 100644 index 0000000..ee0c582 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdDataQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.data.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdGroupCreateormodifyRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdGroupCreateormodifyRequest.php new file mode 100644 index 0000000..c107096 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdGroupCreateormodifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.group.createormodify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdGroupQueryRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdGroupQueryRequest.php new file mode 100644 index 0000000..b8464ec --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdGroupQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.group.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdOfflineRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdOfflineRequest.php new file mode 100644 index 0000000..490a36a --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdOfflineRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.offline"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdOnlineRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdOnlineRequest.php new file mode 100644 index 0000000..9a24038 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdOnlineRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.online"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdPlanCreateormodifyRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdPlanCreateormodifyRequest.php new file mode 100644 index 0000000..0a1be72 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdPlanCreateormodifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.plan.createormodify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdPlanQueryRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdPlanQueryRequest.php new file mode 100644 index 0000000..d1e5271 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdPlanQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.plan.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdPrincipalCheckavailableRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdPrincipalCheckavailableRequest.php new file mode 100644 index 0000000..4026110 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdPrincipalCheckavailableRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.principal.checkavailable"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdPrincipalConsultRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdPrincipalConsultRequest.php new file mode 100644 index 0000000..7671c2c --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdPrincipalConsultRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.principal.consult"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdPrincipalCreateormodifyRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdPrincipalCreateormodifyRequest.php new file mode 100644 index 0000000..af5a3d9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdPrincipalCreateormodifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.principal.createormodify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdPrincipalQueryRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdPrincipalQueryRequest.php new file mode 100644 index 0000000..ff952c6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdPrincipalQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.principal.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdPromotepageQueryRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdPromotepageQueryRequest.php new file mode 100644 index 0000000..3fac2d0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdPromotepageQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.promotepage.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdPromotepagestatisticQueryRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdPromotepagestatisticQueryRequest.php new file mode 100644 index 0000000..4cde747 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdPromotepagestatisticQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.promotepagestatistic.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdUserCreateRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdUserCreateRequest.php new file mode 100644 index 0000000..0e93d5b --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdUserCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.user.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdUserbalanceOfflineRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdUserbalanceOfflineRequest.php new file mode 100644 index 0000000..97ebe9b --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdUserbalanceOfflineRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.userbalance.offline"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceAdUserbalanceOnlineRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceAdUserbalanceOnlineRequest.php new file mode 100644 index 0000000..733d111 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceAdUserbalanceOnlineRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.ad.userbalance.online"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceBillDownloadurlQueryRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceBillDownloadurlQueryRequest.php new file mode 100644 index 0000000..a165391 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceBillDownloadurlQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.bill.downloadurl.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceChinaremodelQueryRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceChinaremodelQueryRequest.php new file mode 100644 index 0000000..250b709 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceChinaremodelQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.chinaremodel.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceCodeRecoRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceCodeRecoRequest.php new file mode 100644 index 0000000..fa9e0c9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceCodeRecoRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.code.reco"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceSdfsdfRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceSdfsdfRequest.php new file mode 100644 index 0000000..24f5247 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceSdfsdfRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceShoppingmallrecShopQueryRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceShoppingmallrecShopQueryRequest.php new file mode 100644 index 0000000..12d5bcf --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceShoppingmallrecShopQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.shoppingmallrec.shop.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceShoppingmallrecVoucherQueryRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceShoppingmallrecVoucherQueryRequest.php new file mode 100644 index 0000000..34e03e9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceShoppingmallrecVoucherQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.shoppingmallrec.voucher.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayDataDataserviceUserlevelZrankGetRequest.php b/extend/alipay/aop/request/AlipayDataDataserviceUserlevelZrankGetRequest.php new file mode 100644 index 0000000..87872e1 --- /dev/null +++ b/extend/alipay/aop/request/AlipayDataDataserviceUserlevelZrankGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.data.dataservice.userlevel.zrank.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppBillAddRequest.php b/extend/alipay/aop/request/AlipayEbppBillAddRequest.php new file mode 100644 index 0000000..6e2f2cc --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppBillAddRequest.php @@ -0,0 +1,326 @@ +bankBillNo = $bankBillNo; + $this->apiParas["bank_bill_no"] = $bankBillNo; + } + + public function getBankBillNo() + { + return $this->bankBillNo; + } + + public function setBillDate($billDate) + { + $this->billDate = $billDate; + $this->apiParas["bill_date"] = $billDate; + } + + public function getBillDate() + { + return $this->billDate; + } + + public function setBillKey($billKey) + { + $this->billKey = $billKey; + $this->apiParas["bill_key"] = $billKey; + } + + public function getBillKey() + { + return $this->billKey; + } + + public function setChargeInst($chargeInst) + { + $this->chargeInst = $chargeInst; + $this->apiParas["charge_inst"] = $chargeInst; + } + + public function getChargeInst() + { + return $this->chargeInst; + } + + public function setExtendField($extendField) + { + $this->extendField = $extendField; + $this->apiParas["extend_field"] = $extendField; + } + + public function getExtendField() + { + return $this->extendField; + } + + public function setMerchantOrderNo($merchantOrderNo) + { + $this->merchantOrderNo = $merchantOrderNo; + $this->apiParas["merchant_order_no"] = $merchantOrderNo; + } + + public function getMerchantOrderNo() + { + return $this->merchantOrderNo; + } + + public function setMobile($mobile) + { + $this->mobile = $mobile; + $this->apiParas["mobile"] = $mobile; + } + + public function getMobile() + { + return $this->mobile; + } + + public function setOrderType($orderType) + { + $this->orderType = $orderType; + $this->apiParas["order_type"] = $orderType; + } + + public function getOrderType() + { + return $this->orderType; + } + + public function setOwnerName($ownerName) + { + $this->ownerName = $ownerName; + $this->apiParas["owner_name"] = $ownerName; + } + + public function getOwnerName() + { + return $this->ownerName; + } + + public function setPayAmount($payAmount) + { + $this->payAmount = $payAmount; + $this->apiParas["pay_amount"] = $payAmount; + } + + public function getPayAmount() + { + return $this->payAmount; + } + + public function setServiceAmount($serviceAmount) + { + $this->serviceAmount = $serviceAmount; + $this->apiParas["service_amount"] = $serviceAmount; + } + + public function getServiceAmount() + { + return $this->serviceAmount; + } + + public function setSubOrderType($subOrderType) + { + $this->subOrderType = $subOrderType; + $this->apiParas["sub_order_type"] = $subOrderType; + } + + public function getSubOrderType() + { + return $this->subOrderType; + } + + public function setTrafficLocation($trafficLocation) + { + $this->trafficLocation = $trafficLocation; + $this->apiParas["traffic_location"] = $trafficLocation; + } + + public function getTrafficLocation() + { + return $this->trafficLocation; + } + + public function setTrafficRegulations($trafficRegulations) + { + $this->trafficRegulations = $trafficRegulations; + $this->apiParas["traffic_regulations"] = $trafficRegulations; + } + + public function getTrafficRegulations() + { + return $this->trafficRegulations; + } + + public function getApiMethodName() + { + return "alipay.ebpp.bill.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppBillGetRequest.php b/extend/alipay/aop/request/AlipayEbppBillGetRequest.php new file mode 100644 index 0000000..216ae89 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppBillGetRequest.php @@ -0,0 +1,134 @@ +merchantOrderNo = $merchantOrderNo; + $this->apiParas["merchant_order_no"] = $merchantOrderNo; + } + + public function getMerchantOrderNo() + { + return $this->merchantOrderNo; + } + + public function setOrderType($orderType) + { + $this->orderType = $orderType; + $this->apiParas["order_type"] = $orderType; + } + + public function getOrderType() + { + return $this->orderType; + } + + public function getApiMethodName() + { + return "alipay.ebpp.bill.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppBillSearchRequest.php b/extend/alipay/aop/request/AlipayEbppBillSearchRequest.php new file mode 100644 index 0000000..3e313ee --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppBillSearchRequest.php @@ -0,0 +1,215 @@ +billKey = $billKey; + $this->apiParas["bill_key"] = $billKey; + } + + public function getBillKey() + { + return $this->billKey; + } + + public function setChargeInst($chargeInst) + { + $this->chargeInst = $chargeInst; + $this->apiParas["charge_inst"] = $chargeInst; + } + + public function getChargeInst() + { + return $this->chargeInst; + } + + public function setChargeoffInst($chargeoffInst) + { + $this->chargeoffInst = $chargeoffInst; + $this->apiParas["chargeoff_inst"] = $chargeoffInst; + } + + public function getChargeoffInst() + { + return $this->chargeoffInst; + } + + public function setCompanyId($companyId) + { + $this->companyId = $companyId; + $this->apiParas["company_id"] = $companyId; + } + + public function getCompanyId() + { + return $this->companyId; + } + + public function setExtend($extend) + { + $this->extend = $extend; + $this->apiParas["extend"] = $extend; + } + + public function getExtend() + { + return $this->extend; + } + + public function setOrderType($orderType) + { + $this->orderType = $orderType; + $this->apiParas["order_type"] = $orderType; + } + + public function getOrderType() + { + return $this->orderType; + } + + public function setSubOrderType($subOrderType) + { + $this->subOrderType = $subOrderType; + $this->apiParas["sub_order_type"] = $subOrderType; + } + + public function getSubOrderType() + { + return $this->subOrderType; + } + + public function getApiMethodName() + { + return "alipay.ebpp.bill.search"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceApplyResultSyncRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceApplyResultSyncRequest.php new file mode 100644 index 0000000..fe3180e --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceApplyResultSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.apply.result.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceApplystatusQueryRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceApplystatusQueryRequest.php new file mode 100644 index 0000000..9ff143c --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceApplystatusQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.applystatus.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceAuthSignRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceAuthSignRequest.php new file mode 100644 index 0000000..4cdbc1b --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceAuthSignRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.auth.sign"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceAuthUnsignRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceAuthUnsignRequest.php new file mode 100644 index 0000000..250d4d2 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceAuthUnsignRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.auth.unsign"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceDetailOutputQueryRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceDetailOutputQueryRequest.php new file mode 100644 index 0000000..5d84046 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceDetailOutputQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.detail.output.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceEinvpackageQueryRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceEinvpackageQueryRequest.php new file mode 100644 index 0000000..ba5b38e --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceEinvpackageQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.einvpackage.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceExpenseProgressSyncRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceExpenseProgressSyncRequest.php new file mode 100644 index 0000000..cff2b94 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceExpenseProgressSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.expense.progress.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceFileOutputQueryRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceFileOutputQueryRequest.php new file mode 100644 index 0000000..7e6387e --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceFileOutputQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.file.output.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceInfoSendRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceInfoSendRequest.php new file mode 100644 index 0000000..56036e9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceInfoSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.info.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceIsvtokenReimApplyRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceIsvtokenReimApplyRequest.php new file mode 100644 index 0000000..0d09719 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceIsvtokenReimApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.isvtoken.reim.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceListExpenseSyncRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceListExpenseSyncRequest.php new file mode 100644 index 0000000..0b114fe --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceListExpenseSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.list.expense.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceMerchantEnterstatusQueryRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceMerchantEnterstatusQueryRequest.php new file mode 100644 index 0000000..9851750 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceMerchantEnterstatusQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.merchant.enterstatus.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceMerchantlistEnterApplyRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceMerchantlistEnterApplyRequest.php new file mode 100644 index 0000000..0f1a75d --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceMerchantlistEnterApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.merchantlist.enter.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceOrderQueryRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceOrderQueryRequest.php new file mode 100644 index 0000000..46cea38 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceOrderQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.order.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceSycnRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceSycnRequest.php new file mode 100644 index 0000000..dbb6c1a --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceSycnRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.sycn"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceSyncSimpleSendRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceSyncSimpleSendRequest.php new file mode 100644 index 0000000..4c68ea3 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceSyncSimpleSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.sync.simple.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceTaxnoBatchqueryRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceTaxnoBatchqueryRequest.php new file mode 100644 index 0000000..2ddf97f --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceTaxnoBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.taxno.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceTitleDynamicGetRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceTitleDynamicGetRequest.php new file mode 100644 index 0000000..25a9fd7 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceTitleDynamicGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.title.dynamic.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppInvoiceTitleListGetRequest.php b/extend/alipay/aop/request/AlipayEbppInvoiceTitleListGetRequest.php new file mode 100644 index 0000000..eebf62f --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppInvoiceTitleListGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.invoice.title.list.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppMerchantConfigGetRequest.php b/extend/alipay/aop/request/AlipayEbppMerchantConfigGetRequest.php new file mode 100644 index 0000000..a2f92e0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppMerchantConfigGetRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppPdeductBillPayStatusRequest.php b/extend/alipay/aop/request/AlipayEbppPdeductBillPayStatusRequest.php new file mode 100644 index 0000000..24877d0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppPdeductBillPayStatusRequest.php @@ -0,0 +1,134 @@ +agreementId = $agreementId; + $this->apiParas["agreement_id"] = $agreementId; + } + + public function getAgreementId() + { + return $this->agreementId; + } + + public function setOutOrderNo($outOrderNo) + { + $this->outOrderNo = $outOrderNo; + $this->apiParas["out_order_no"] = $outOrderNo; + } + + public function getOutOrderNo() + { + return $this->outOrderNo; + } + + public function getApiMethodName() + { + return "alipay.ebpp.pdeduct.bill.pay.status"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppPdeductPayRequest.php b/extend/alipay/aop/request/AlipayEbppPdeductPayRequest.php new file mode 100644 index 0000000..f155417 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppPdeductPayRequest.php @@ -0,0 +1,297 @@ +agentChannel = $agentChannel; + $this->apiParas["agent_channel"] = $agentChannel; + } + + public function getAgentChannel() + { + return $this->agentChannel; + } + + public function setAgentCode($agentCode) + { + $this->agentCode = $agentCode; + $this->apiParas["agent_code"] = $agentCode; + } + + public function getAgentCode() + { + return $this->agentCode; + } + + public function setAgreementId($agreementId) + { + $this->agreementId = $agreementId; + $this->apiParas["agreement_id"] = $agreementId; + } + + public function getAgreementId() + { + return $this->agreementId; + } + + public function setBillDate($billDate) + { + $this->billDate = $billDate; + $this->apiParas["bill_date"] = $billDate; + } + + public function getBillDate() + { + return $this->billDate; + } + + public function setBillKey($billKey) + { + $this->billKey = $billKey; + $this->apiParas["bill_key"] = $billKey; + } + + public function getBillKey() + { + return $this->billKey; + } + + public function setExtendField($extendField) + { + $this->extendField = $extendField; + $this->apiParas["extend_field"] = $extendField; + } + + public function getExtendField() + { + return $this->extendField; + } + + public function setFineAmount($fineAmount) + { + $this->fineAmount = $fineAmount; + $this->apiParas["fine_amount"] = $fineAmount; + } + + public function getFineAmount() + { + return $this->fineAmount; + } + + public function setMemo($memo) + { + $this->memo = $memo; + $this->apiParas["memo"] = $memo; + } + + public function getMemo() + { + return $this->memo; + } + + public function setOutOrderNo($outOrderNo) + { + $this->outOrderNo = $outOrderNo; + $this->apiParas["out_order_no"] = $outOrderNo; + } + + public function getOutOrderNo() + { + return $this->outOrderNo; + } + + public function setPayAmount($payAmount) + { + $this->payAmount = $payAmount; + $this->apiParas["pay_amount"] = $payAmount; + } + + public function getPayAmount() + { + return $this->payAmount; + } + + public function setPid($pid) + { + $this->pid = $pid; + $this->apiParas["pid"] = $pid; + } + + public function getPid() + { + return $this->pid; + } + + public function setUserId($userId) + { + $this->userId = $userId; + $this->apiParas["user_id"] = $userId; + } + + public function getUserId() + { + return $this->userId; + } + + public function getApiMethodName() + { + return "alipay.ebpp.pdeduct.pay"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppPdeductSignAddRequest.php b/extend/alipay/aop/request/AlipayEbppPdeductSignAddRequest.php new file mode 100644 index 0000000..2558a0a --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppPdeductSignAddRequest.php @@ -0,0 +1,416 @@ +agentChannel = $agentChannel; + $this->apiParas["agent_channel"] = $agentChannel; + } + + public function getAgentChannel() + { + return $this->agentChannel; + } + + public function setAgentCode($agentCode) + { + $this->agentCode = $agentCode; + $this->apiParas["agent_code"] = $agentCode; + } + + public function getAgentCode() + { + return $this->agentCode; + } + + public function setBillKey($billKey) + { + $this->billKey = $billKey; + $this->apiParas["bill_key"] = $billKey; + } + + public function getBillKey() + { + return $this->billKey; + } + + public function setBizType($bizType) + { + $this->bizType = $bizType; + $this->apiParas["biz_type"] = $bizType; + } + + public function getBizType() + { + return $this->bizType; + } + + public function setChargeInst($chargeInst) + { + $this->chargeInst = $chargeInst; + $this->apiParas["charge_inst"] = $chargeInst; + } + + public function getChargeInst() + { + return $this->chargeInst; + } + + public function setDeductProdCode($deductProdCode) + { + $this->deductProdCode = $deductProdCode; + $this->apiParas["deduct_prod_code"] = $deductProdCode; + } + + public function getDeductProdCode() + { + return $this->deductProdCode; + } + + public function setDeductType($deductType) + { + $this->deductType = $deductType; + $this->apiParas["deduct_type"] = $deductType; + } + + public function getDeductType() + { + return $this->deductType; + } + + public function setExtUserInfo($extUserInfo) + { + $this->extUserInfo = $extUserInfo; + $this->apiParas["ext_user_info"] = $extUserInfo; + } + + public function getExtUserInfo() + { + return $this->extUserInfo; + } + + public function setExtendField($extendField) + { + $this->extendField = $extendField; + $this->apiParas["extend_field"] = $extendField; + } + + public function getExtendField() + { + return $this->extendField; + } + + public function setNotifyConfig($notifyConfig) + { + $this->notifyConfig = $notifyConfig; + $this->apiParas["notify_config"] = $notifyConfig; + } + + public function getNotifyConfig() + { + return $this->notifyConfig; + } + + public function setOutAgreementId($outAgreementId) + { + $this->outAgreementId = $outAgreementId; + $this->apiParas["out_agreement_id"] = $outAgreementId; + } + + public function getOutAgreementId() + { + return $this->outAgreementId; + } + + public function setOwnerName($ownerName) + { + $this->ownerName = $ownerName; + $this->apiParas["owner_name"] = $ownerName; + } + + public function getOwnerName() + { + return $this->ownerName; + } + + public function setPayConfig($payConfig) + { + $this->payConfig = $payConfig; + $this->apiParas["pay_config"] = $payConfig; + } + + public function getPayConfig() + { + return $this->payConfig; + } + + public function setPayPasswordToken($payPasswordToken) + { + $this->payPasswordToken = $payPasswordToken; + $this->apiParas["pay_password_token"] = $payPasswordToken; + } + + public function getPayPasswordToken() + { + return $this->payPasswordToken; + } + + public function setPid($pid) + { + $this->pid = $pid; + $this->apiParas["pid"] = $pid; + } + + public function getPid() + { + return $this->pid; + } + + public function setSignExpireDate($signExpireDate) + { + $this->signExpireDate = $signExpireDate; + $this->apiParas["sign_expire_date"] = $signExpireDate; + } + + public function getSignExpireDate() + { + return $this->signExpireDate; + } + + public function setSubBizType($subBizType) + { + $this->subBizType = $subBizType; + $this->apiParas["sub_biz_type"] = $subBizType; + } + + public function getSubBizType() + { + return $this->subBizType; + } + + public function setUserId($userId) + { + $this->userId = $userId; + $this->apiParas["user_id"] = $userId; + } + + public function getUserId() + { + return $this->userId; + } + + public function getApiMethodName() + { + return "alipay.ebpp.pdeduct.sign.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppPdeductSignCancelRequest.php b/extend/alipay/aop/request/AlipayEbppPdeductSignCancelRequest.php new file mode 100644 index 0000000..ce9e0b7 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppPdeductSignCancelRequest.php @@ -0,0 +1,182 @@ +agentChannel = $agentChannel; + $this->apiParas["agent_channel"] = $agentChannel; + } + + public function getAgentChannel() + { + return $this->agentChannel; + } + + public function setAgentCode($agentCode) + { + $this->agentCode = $agentCode; + $this->apiParas["agent_code"] = $agentCode; + } + + public function getAgentCode() + { + return $this->agentCode; + } + + public function setAgreementId($agreementId) + { + $this->agreementId = $agreementId; + $this->apiParas["agreement_id"] = $agreementId; + } + + public function getAgreementId() + { + return $this->agreementId; + } + + public function setPayPasswordToken($payPasswordToken) + { + $this->payPasswordToken = $payPasswordToken; + $this->apiParas["pay_password_token"] = $payPasswordToken; + } + + public function getPayPasswordToken() + { + return $this->payPasswordToken; + } + + public function setUserId($userId) + { + $this->userId = $userId; + $this->apiParas["user_id"] = $userId; + } + + public function getUserId() + { + return $this->userId; + } + + public function getApiMethodName() + { + return "alipay.ebpp.pdeduct.sign.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppPdeductSignQueryRequest.php b/extend/alipay/aop/request/AlipayEbppPdeductSignQueryRequest.php new file mode 100644 index 0000000..b446109 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppPdeductSignQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.pdeduct.sign.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEbppPdeductSignValidateRequest.php b/extend/alipay/aop/request/AlipayEbppPdeductSignValidateRequest.php new file mode 100644 index 0000000..0c81906 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEbppPdeductSignValidateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ebpp.pdeduct.sign.validate"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcapiprodCreditGetRequest.php b/extend/alipay/aop/request/AlipayEcapiprodCreditGetRequest.php new file mode 100644 index 0000000..79c796b --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcapiprodCreditGetRequest.php @@ -0,0 +1,182 @@ +creditNo = $creditNo; + $this->apiParas["credit_no"] = $creditNo; + } + + public function getCreditNo() + { + return $this->creditNo; + } + + public function setEntityCode($entityCode) + { + $this->entityCode = $entityCode; + $this->apiParas["entity_code"] = $entityCode; + } + + public function getEntityCode() + { + return $this->entityCode; + } + + public function setEntityName($entityName) + { + $this->entityName = $entityName; + $this->apiParas["entity_name"] = $entityName; + } + + public function getEntityName() + { + return $this->entityName; + } + + public function setIsvCode($isvCode) + { + $this->isvCode = $isvCode; + $this->apiParas["isv_code"] = $isvCode; + } + + public function getIsvCode() + { + return $this->isvCode; + } + + public function setOrgCode($orgCode) + { + $this->orgCode = $orgCode; + $this->apiParas["org_code"] = $orgCode; + } + + public function getOrgCode() + { + return $this->orgCode; + } + + public function getApiMethodName() + { + return "alipay.ecapiprod.credit.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcapiprodDataPutRequest.php b/extend/alipay/aop/request/AlipayEcapiprodDataPutRequest.php new file mode 100644 index 0000000..b1f5282 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcapiprodDataPutRequest.php @@ -0,0 +1,246 @@ +category = $category; + $this->apiParas["category"] = $category; + } + + public function getCategory() + { + return $this->category; + } + + public function setCharSet($charSet) + { + $this->charSet = $charSet; + $this->apiParas["char_set"] = $charSet; + } + + public function getCharSet() + { + return $this->charSet; + } + + public function setCollectingTaskId($collectingTaskId) + { + $this->collectingTaskId = $collectingTaskId; + $this->apiParas["collecting_task_id"] = $collectingTaskId; + } + + public function getCollectingTaskId() + { + return $this->collectingTaskId; + } + + public function setEntityCode($entityCode) + { + $this->entityCode = $entityCode; + $this->apiParas["entity_code"] = $entityCode; + } + + public function getEntityCode() + { + return $this->entityCode; + } + + public function setEntityName($entityName) + { + $this->entityName = $entityName; + $this->apiParas["entity_name"] = $entityName; + } + + public function getEntityName() + { + return $this->entityName; + } + + public function setEntityType($entityType) + { + $this->entityType = $entityType; + $this->apiParas["entity_type"] = $entityType; + } + + public function getEntityType() + { + return $this->entityType; + } + + public function setIsvCode($isvCode) + { + $this->isvCode = $isvCode; + $this->apiParas["isv_code"] = $isvCode; + } + + public function getIsvCode() + { + return $this->isvCode; + } + + public function setJsonData($jsonData) + { + $this->jsonData = $jsonData; + $this->apiParas["json_data"] = $jsonData; + } + + public function getJsonData() + { + return $this->jsonData; + } + + public function setOrgCode($orgCode) + { + $this->orgCode = $orgCode; + $this->apiParas["org_code"] = $orgCode; + } + + public function getOrgCode() + { + return $this->orgCode; + } + + public function getApiMethodName() + { + return "alipay.ecapiprod.data.put"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcapiprodDrawndnContractGetRequest.php b/extend/alipay/aop/request/AlipayEcapiprodDrawndnContractGetRequest.php new file mode 100644 index 0000000..da84604 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcapiprodDrawndnContractGetRequest.php @@ -0,0 +1,182 @@ +drawndnNo = $drawndnNo; + $this->apiParas["drawndn_no"] = $drawndnNo; + } + + public function getDrawndnNo() + { + return $this->drawndnNo; + } + + public function setEntityCode($entityCode) + { + $this->entityCode = $entityCode; + $this->apiParas["entity_code"] = $entityCode; + } + + public function getEntityCode() + { + return $this->entityCode; + } + + public function setEntityName($entityName) + { + $this->entityName = $entityName; + $this->apiParas["entity_name"] = $entityName; + } + + public function getEntityName() + { + return $this->entityName; + } + + public function setIsvCode($isvCode) + { + $this->isvCode = $isvCode; + $this->apiParas["isv_code"] = $isvCode; + } + + public function getIsvCode() + { + return $this->isvCode; + } + + public function setOrgCode($orgCode) + { + $this->orgCode = $orgCode; + $this->apiParas["org_code"] = $orgCode; + } + + public function getOrgCode() + { + return $this->orgCode; + } + + public function getApiMethodName() + { + return "alipay.ecapiprod.drawndn.contract.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcapiprodDrawndnDrawndnlistQueryRequest.php b/extend/alipay/aop/request/AlipayEcapiprodDrawndnDrawndnlistQueryRequest.php new file mode 100644 index 0000000..b9d2dde --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcapiprodDrawndnDrawndnlistQueryRequest.php @@ -0,0 +1,182 @@ +creditNo = $creditNo; + $this->apiParas["credit_no"] = $creditNo; + } + + public function getCreditNo() + { + return $this->creditNo; + } + + public function setEntityCode($entityCode) + { + $this->entityCode = $entityCode; + $this->apiParas["entity_code"] = $entityCode; + } + + public function getEntityCode() + { + return $this->entityCode; + } + + public function setEntityName($entityName) + { + $this->entityName = $entityName; + $this->apiParas["entity_name"] = $entityName; + } + + public function getEntityName() + { + return $this->entityName; + } + + public function setIsvCode($isvCode) + { + $this->isvCode = $isvCode; + $this->apiParas["isv_code"] = $isvCode; + } + + public function getIsvCode() + { + return $this->isvCode; + } + + public function setOrgCode($orgCode) + { + $this->orgCode = $orgCode; + $this->apiParas["org_code"] = $orgCode; + } + + public function getOrgCode() + { + return $this->orgCode; + } + + public function getApiMethodName() + { + return "alipay.ecapiprod.drawndn.drawndnlist.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcapiprodDrawndnFeerecordQueryRequest.php b/extend/alipay/aop/request/AlipayEcapiprodDrawndnFeerecordQueryRequest.php new file mode 100644 index 0000000..4785bf6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcapiprodDrawndnFeerecordQueryRequest.php @@ -0,0 +1,214 @@ +drawndnNo = $drawndnNo; + $this->apiParas["drawndn_no"] = $drawndnNo; + } + + public function getDrawndnNo() + { + return $this->drawndnNo; + } + + public function setEnd($end) + { + $this->end = $end; + $this->apiParas["end"] = $end; + } + + public function getEnd() + { + return $this->end; + } + + public function setEntityCode($entityCode) + { + $this->entityCode = $entityCode; + $this->apiParas["entity_code"] = $entityCode; + } + + public function getEntityCode() + { + return $this->entityCode; + } + + public function setEntityName($entityName) + { + $this->entityName = $entityName; + $this->apiParas["entity_name"] = $entityName; + } + + public function getEntityName() + { + return $this->entityName; + } + + public function setIsvCode($isvCode) + { + $this->isvCode = $isvCode; + $this->apiParas["isv_code"] = $isvCode; + } + + public function getIsvCode() + { + return $this->isvCode; + } + + public function setOrgCode($orgCode) + { + $this->orgCode = $orgCode; + $this->apiParas["org_code"] = $orgCode; + } + + public function getOrgCode() + { + return $this->orgCode; + } + + public function setStart($start) + { + $this->start = $start; + $this->apiParas["start"] = $start; + } + + public function getStart() + { + return $this->start; + } + + public function getApiMethodName() + { + return "alipay.ecapiprod.drawndn.feerecord.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcapiprodDrawndnLendingrecordQueryRequest.php b/extend/alipay/aop/request/AlipayEcapiprodDrawndnLendingrecordQueryRequest.php new file mode 100644 index 0000000..ea8356e --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcapiprodDrawndnLendingrecordQueryRequest.php @@ -0,0 +1,214 @@ +drawndnNo = $drawndnNo; + $this->apiParas["drawndn_no"] = $drawndnNo; + } + + public function getDrawndnNo() + { + return $this->drawndnNo; + } + + public function setEnd($end) + { + $this->end = $end; + $this->apiParas["end"] = $end; + } + + public function getEnd() + { + return $this->end; + } + + public function setEntityCode($entityCode) + { + $this->entityCode = $entityCode; + $this->apiParas["entity_code"] = $entityCode; + } + + public function getEntityCode() + { + return $this->entityCode; + } + + public function setEntityName($entityName) + { + $this->entityName = $entityName; + $this->apiParas["entity_name"] = $entityName; + } + + public function getEntityName() + { + return $this->entityName; + } + + public function setIsvCode($isvCode) + { + $this->isvCode = $isvCode; + $this->apiParas["isv_code"] = $isvCode; + } + + public function getIsvCode() + { + return $this->isvCode; + } + + public function setOrgCode($orgCode) + { + $this->orgCode = $orgCode; + $this->apiParas["org_code"] = $orgCode; + } + + public function getOrgCode() + { + return $this->orgCode; + } + + public function setStart($start) + { + $this->start = $start; + $this->apiParas["start"] = $start; + } + + public function getStart() + { + return $this->start; + } + + public function getApiMethodName() + { + return "alipay.ecapiprod.drawndn.lendingrecord.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcapiprodDrawndnPaymentscheduleGetRequest.php b/extend/alipay/aop/request/AlipayEcapiprodDrawndnPaymentscheduleGetRequest.php new file mode 100644 index 0000000..09ea4b5 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcapiprodDrawndnPaymentscheduleGetRequest.php @@ -0,0 +1,182 @@ +drawndnNo = $drawndnNo; + $this->apiParas["drawndn_no"] = $drawndnNo; + } + + public function getDrawndnNo() + { + return $this->drawndnNo; + } + + public function setEntityCode($entityCode) + { + $this->entityCode = $entityCode; + $this->apiParas["entity_code"] = $entityCode; + } + + public function getEntityCode() + { + return $this->entityCode; + } + + public function setEntityName($entityName) + { + $this->entityName = $entityName; + $this->apiParas["entity_name"] = $entityName; + } + + public function getEntityName() + { + return $this->entityName; + } + + public function setIsvCode($isvCode) + { + $this->isvCode = $isvCode; + $this->apiParas["isv_code"] = $isvCode; + } + + public function getIsvCode() + { + return $this->isvCode; + } + + public function setOrgCode($orgCode) + { + $this->orgCode = $orgCode; + $this->apiParas["org_code"] = $orgCode; + } + + public function getOrgCode() + { + return $this->orgCode; + } + + public function getApiMethodName() + { + return "alipay.ecapiprod.drawndn.paymentschedule.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcapiprodDrawndnRepaymentrecordQueryRequest.php b/extend/alipay/aop/request/AlipayEcapiprodDrawndnRepaymentrecordQueryRequest.php new file mode 100644 index 0000000..96115b6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcapiprodDrawndnRepaymentrecordQueryRequest.php @@ -0,0 +1,214 @@ +drawndnNo = $drawndnNo; + $this->apiParas["drawndn_no"] = $drawndnNo; + } + + public function getDrawndnNo() + { + return $this->drawndnNo; + } + + public function setEnd($end) + { + $this->end = $end; + $this->apiParas["end"] = $end; + } + + public function getEnd() + { + return $this->end; + } + + public function setEntityCode($entityCode) + { + $this->entityCode = $entityCode; + $this->apiParas["entity_code"] = $entityCode; + } + + public function getEntityCode() + { + return $this->entityCode; + } + + public function setEntityName($entityName) + { + $this->entityName = $entityName; + $this->apiParas["entity_name"] = $entityName; + } + + public function getEntityName() + { + return $this->entityName; + } + + public function setIsvCode($isvCode) + { + $this->isvCode = $isvCode; + $this->apiParas["isv_code"] = $isvCode; + } + + public function getIsvCode() + { + return $this->isvCode; + } + + public function setOrgCode($orgCode) + { + $this->orgCode = $orgCode; + $this->apiParas["org_code"] = $orgCode; + } + + public function getOrgCode() + { + return $this->orgCode; + } + + public function setStart($start) + { + $this->start = $start; + $this->apiParas["start"] = $start; + } + + public function getStart() + { + return $this->start; + } + + public function getApiMethodName() + { + return "alipay.ecapiprod.drawndn.repaymentrecord.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcardEduPublicBindRequest.php b/extend/alipay/aop/request/AlipayEcardEduPublicBindRequest.php new file mode 100644 index 0000000..b089565 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcardEduPublicBindRequest.php @@ -0,0 +1,198 @@ +agentCode = $agentCode; + $this->apiParas["agent_code"] = $agentCode; + } + + public function getAgentCode() + { + return $this->agentCode; + } + + public function setAgreementId($agreementId) + { + $this->agreementId = $agreementId; + $this->apiParas["agreement_id"] = $agreementId; + } + + public function getAgreementId() + { + return $this->agreementId; + } + + public function setAlipayUserId($alipayUserId) + { + $this->alipayUserId = $alipayUserId; + $this->apiParas["alipay_user_id"] = $alipayUserId; + } + + public function getAlipayUserId() + { + return $this->alipayUserId; + } + + public function setCardName($cardName) + { + $this->cardName = $cardName; + $this->apiParas["card_name"] = $cardName; + } + + public function getCardName() + { + return $this->cardName; + } + + public function setCardNo($cardNo) + { + $this->cardNo = $cardNo; + $this->apiParas["card_no"] = $cardNo; + } + + public function getCardNo() + { + return $this->cardNo; + } + + public function setPublicId($publicId) + { + $this->publicId = $publicId; + $this->apiParas["public_id"] = $publicId; + } + + public function getPublicId() + { + return $this->publicId; + } + + public function getApiMethodName() + { + return "alipay.ecard.edu.public.bind"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCityserviceMessageSendRequest.php b/extend/alipay/aop/request/AlipayEcoCityserviceMessageSendRequest.php new file mode 100644 index 0000000..9df5c35 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCityserviceMessageSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cityservice.message.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoContractSignflowsCreateRequest.php b/extend/alipay/aop/request/AlipayEcoContractSignflowsCreateRequest.php new file mode 100644 index 0000000..0985264 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoContractSignflowsCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.contract.signflows.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeBasicserviceInitializeRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeBasicserviceInitializeRequest.php new file mode 100644 index 0000000..c7f5721 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeBasicserviceInitializeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.basicservice.initialize"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeBasicserviceModifyRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeBasicserviceModifyRequest.php new file mode 100644 index 0000000..5434ef8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeBasicserviceModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.basicservice.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeBillBatchUploadRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeBillBatchUploadRequest.php new file mode 100644 index 0000000..f9b105d --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeBillBatchUploadRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.bill.batch.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeBillBatchqueryRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeBillBatchqueryRequest.php new file mode 100644 index 0000000..fb38697 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeBillBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.bill.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeBillDeleteRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeBillDeleteRequest.php new file mode 100644 index 0000000..d583aa2 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeBillDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.bill.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeBillModifyRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeBillModifyRequest.php new file mode 100644 index 0000000..1b91913 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeBillModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.bill.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeBillSyncRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeBillSyncRequest.php new file mode 100644 index 0000000..af7ba31 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeBillSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.bill.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeCommunityBatchqueryRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeCommunityBatchqueryRequest.php new file mode 100644 index 0000000..9f72a52 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeCommunityBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.community.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeCommunityCreateRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeCommunityCreateRequest.php new file mode 100644 index 0000000..46f07d7 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeCommunityCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.community.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeCommunityDetailsQueryRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeCommunityDetailsQueryRequest.php new file mode 100644 index 0000000..c6c2bc8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeCommunityDetailsQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.community.details.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeCommunityModifyRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeCommunityModifyRequest.php new file mode 100644 index 0000000..1c16647 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeCommunityModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.community.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeNoticeDeleteRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeNoticeDeleteRequest.php new file mode 100644 index 0000000..b695896 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeNoticeDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.notice.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeNoticePublishRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeNoticePublishRequest.php new file mode 100644 index 0000000..ec42c2c --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeNoticePublishRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.notice.publish"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifePayResultQueryRequest.php b/extend/alipay/aop/request/AlipayEcoCplifePayResultQueryRequest.php new file mode 100644 index 0000000..423777e --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifePayResultQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.pay.result.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeRepairStatusUpdateRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeRepairStatusUpdateRequest.php new file mode 100644 index 0000000..81a4de4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeRepairStatusUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.repair.status.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeResidentinfoDeleteRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeResidentinfoDeleteRequest.php new file mode 100644 index 0000000..d9ea662 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeResidentinfoDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.residentinfo.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeResidentinfoUploadRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeResidentinfoUploadRequest.php new file mode 100644 index 0000000..6a825a9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeResidentinfoUploadRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.residentinfo.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeRoominfoDeleteRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeRoominfoDeleteRequest.php new file mode 100644 index 0000000..677715c --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeRoominfoDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.roominfo.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeRoominfoQueryRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeRoominfoQueryRequest.php new file mode 100644 index 0000000..c9af49c --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeRoominfoQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.roominfo.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeRoominfoUploadRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeRoominfoUploadRequest.php new file mode 100644 index 0000000..8dfbbf2 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeRoominfoUploadRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.roominfo.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeRooominfoQueryRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeRooominfoQueryRequest.php new file mode 100644 index 0000000..d06aaa6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeRooominfoQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.rooominfo.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoCplifeUseridentityStatusUpdateRequest.php b/extend/alipay/aop/request/AlipayEcoCplifeUseridentityStatusUpdateRequest.php new file mode 100644 index 0000000..391cdc8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoCplifeUseridentityStatusUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.cplife.useridentity.status.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoDocTemplateCreateRequest.php b/extend/alipay/aop/request/AlipayEcoDocTemplateCreateRequest.php new file mode 100644 index 0000000..90fffab --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoDocTemplateCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.doc.template.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoDoctemplateSettingurlQueryRequest.php b/extend/alipay/aop/request/AlipayEcoDoctemplateSettingurlQueryRequest.php new file mode 100644 index 0000000..4af8450 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoDoctemplateSettingurlQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.doctemplate.settingurl.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoEduKtBillingModifyRequest.php b/extend/alipay/aop/request/AlipayEcoEduKtBillingModifyRequest.php new file mode 100644 index 0000000..1d1deee --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoEduKtBillingModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.edu.kt.billing.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoEduKtBillingQueryRequest.php b/extend/alipay/aop/request/AlipayEcoEduKtBillingQueryRequest.php new file mode 100644 index 0000000..de420f2 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoEduKtBillingQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.edu.kt.billing.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoEduKtBillingSendRequest.php b/extend/alipay/aop/request/AlipayEcoEduKtBillingSendRequest.php new file mode 100644 index 0000000..9e2ed27 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoEduKtBillingSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.edu.kt.billing.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoEduKtParentQueryRequest.php b/extend/alipay/aop/request/AlipayEcoEduKtParentQueryRequest.php new file mode 100644 index 0000000..f9cbff4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoEduKtParentQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.edu.kt.parent.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoEduKtSchoolinfoModifyRequest.php b/extend/alipay/aop/request/AlipayEcoEduKtSchoolinfoModifyRequest.php new file mode 100644 index 0000000..12f7215 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoEduKtSchoolinfoModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.edu.kt.schoolinfo.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoEduKtStudentModifyRequest.php b/extend/alipay/aop/request/AlipayEcoEduKtStudentModifyRequest.php new file mode 100644 index 0000000..5d36626 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoEduKtStudentModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.edu.kt.student.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoEduKtStudentQueryRequest.php b/extend/alipay/aop/request/AlipayEcoEduKtStudentQueryRequest.php new file mode 100644 index 0000000..b957cd3 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoEduKtStudentQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.edu.kt.student.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoFilePathQueryRequest.php b/extend/alipay/aop/request/AlipayEcoFilePathQueryRequest.php new file mode 100644 index 0000000..70f6182 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoFilePathQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.file.path.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarCarlibInfoPushRequest.php b/extend/alipay/aop/request/AlipayEcoMycarCarlibInfoPushRequest.php new file mode 100644 index 0000000..29dd8c8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarCarlibInfoPushRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.carlib.info.push"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarCarmodelModifyRequest.php b/extend/alipay/aop/request/AlipayEcoMycarCarmodelModifyRequest.php new file mode 100644 index 0000000..43e3e9b --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarCarmodelModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.carmodel.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarDataExternalQueryRequest.php b/extend/alipay/aop/request/AlipayEcoMycarDataExternalQueryRequest.php new file mode 100644 index 0000000..402da11 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarDataExternalQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.data.external.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarDataExternalSendRequest.php b/extend/alipay/aop/request/AlipayEcoMycarDataExternalSendRequest.php new file mode 100644 index 0000000..904f104 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarDataExternalSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.data.external.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarDataserviceViolationinfoShareRequest.php b/extend/alipay/aop/request/AlipayEcoMycarDataserviceViolationinfoShareRequest.php new file mode 100644 index 0000000..b781888 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarDataserviceViolationinfoShareRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.dataservice.violationinfo.share"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarMaintainDataUpdateRequest.php b/extend/alipay/aop/request/AlipayEcoMycarMaintainDataUpdateRequest.php new file mode 100644 index 0000000..1af89a1 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarMaintainDataUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.maintain.data.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarMaintainOrderCreateRequest.php b/extend/alipay/aop/request/AlipayEcoMycarMaintainOrderCreateRequest.php new file mode 100644 index 0000000..9f0af42 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarMaintainOrderCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.maintain.order.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarMaintainOrderstatusUpdateRequest.php b/extend/alipay/aop/request/AlipayEcoMycarMaintainOrderstatusUpdateRequest.php new file mode 100644 index 0000000..e5e7bf0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarMaintainOrderstatusUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.maintain.orderstatus.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarOrderStatusQueryRequest.php b/extend/alipay/aop/request/AlipayEcoMycarOrderStatusQueryRequest.php new file mode 100644 index 0000000..c98691c --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarOrderStatusQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.order.status.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingAgreementQueryRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingAgreementQueryRequest.php new file mode 100644 index 0000000..04dbd6f --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingAgreementQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.agreement.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingCardbarcodeCreateRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingCardbarcodeCreateRequest.php new file mode 100644 index 0000000..b95a802 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingCardbarcodeCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.cardbarcode.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingChargeinfoSyncRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingChargeinfoSyncRequest.php new file mode 100644 index 0000000..5edd62e --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingChargeinfoSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.chargeinfo.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingConfigQueryRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingConfigQueryRequest.php new file mode 100644 index 0000000..6fbabff --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingConfigQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.config.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingConfigSetRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingConfigSetRequest.php new file mode 100644 index 0000000..9169654 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingConfigSetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.config.set"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingEnterinfoSyncRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingEnterinfoSyncRequest.php new file mode 100644 index 0000000..945e08b --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingEnterinfoSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.enterinfo.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingExitinfoSyncRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingExitinfoSyncRequest.php new file mode 100644 index 0000000..547d11e --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingExitinfoSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.exitinfo.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingLotbarcodeCreateRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingLotbarcodeCreateRequest.php new file mode 100644 index 0000000..38c69e1 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingLotbarcodeCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.lotbarcode.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingOrderPayRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingOrderPayRequest.php new file mode 100644 index 0000000..c8039df --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingOrderPayRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.order.pay"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingOrderRefundRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingOrderRefundRequest.php new file mode 100644 index 0000000..10d5c38 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingOrderRefundRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.order.refund"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingOrderSyncRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingOrderSyncRequest.php new file mode 100644 index 0000000..87dd0cc --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingOrderSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.order.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingOrderUpdateRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingOrderUpdateRequest.php new file mode 100644 index 0000000..4cfd169 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingOrderUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.order.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingOrderstatusQueryRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingOrderstatusQueryRequest.php new file mode 100644 index 0000000..876987e --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingOrderstatusQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.orderstatus.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingParkinglotinfoCreateRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingParkinglotinfoCreateRequest.php new file mode 100644 index 0000000..7346d89 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingParkinglotinfoCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.parkinglotinfo.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingParkinglotinfoQueryRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingParkinglotinfoQueryRequest.php new file mode 100644 index 0000000..c3c970d --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingParkinglotinfoQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.parkinglotinfo.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingParkinglotinfoUpdateRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingParkinglotinfoUpdateRequest.php new file mode 100644 index 0000000..7718bca --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingParkinglotinfoUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.parkinglotinfo.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingSpaceinfoSyncRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingSpaceinfoSyncRequest.php new file mode 100644 index 0000000..fbd736a --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingSpaceinfoSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.spaceinfo.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarParkingVehicleQueryRequest.php b/extend/alipay/aop/request/AlipayEcoMycarParkingVehicleQueryRequest.php new file mode 100644 index 0000000..6f827e0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarParkingVehicleQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.parking.vehicle.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarPromoTicketPushRequest.php b/extend/alipay/aop/request/AlipayEcoMycarPromoTicketPushRequest.php new file mode 100644 index 0000000..8e790f2 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarPromoTicketPushRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.promo.ticket.push"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarPromoTicketSyncRequest.php b/extend/alipay/aop/request/AlipayEcoMycarPromoTicketSyncRequest.php new file mode 100644 index 0000000..e01705e --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarPromoTicketSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.promo.ticket.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarPromoVoucherVerifyRequest.php b/extend/alipay/aop/request/AlipayEcoMycarPromoVoucherVerifyRequest.php new file mode 100644 index 0000000..06236fa --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarPromoVoucherVerifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.promo.voucher.verify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarTradeOrderQueryRequest.php b/extend/alipay/aop/request/AlipayEcoMycarTradeOrderQueryRequest.php new file mode 100644 index 0000000..2f53389 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarTradeOrderQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.trade.order.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarTradeRefundRequest.php b/extend/alipay/aop/request/AlipayEcoMycarTradeRefundRequest.php new file mode 100644 index 0000000..1c669f9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarTradeRefundRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.trade.refund"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarViolationCityPushRequest.php b/extend/alipay/aop/request/AlipayEcoMycarViolationCityPushRequest.php new file mode 100644 index 0000000..f87d995 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarViolationCityPushRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.violation.city.push"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoMycarViolationInfoPushRequest.php b/extend/alipay/aop/request/AlipayEcoMycarViolationInfoPushRequest.php new file mode 100644 index 0000000..bdc7a28 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoMycarViolationInfoPushRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.mycar.violation.info.push"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoRebateBalanceQueryRequest.php b/extend/alipay/aop/request/AlipayEcoRebateBalanceQueryRequest.php new file mode 100644 index 0000000..6e05269 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoRebateBalanceQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.rebate.balance.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoRebateBalanceSendRequest.php b/extend/alipay/aop/request/AlipayEcoRebateBalanceSendRequest.php new file mode 100644 index 0000000..a3cc9db --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoRebateBalanceSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.rebate.balance.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoSignFlowCancelRequest.php b/extend/alipay/aop/request/AlipayEcoSignFlowCancelRequest.php new file mode 100644 index 0000000..7304f59 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoSignFlowCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.sign.flow.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoSignFlowCreateRequest.php b/extend/alipay/aop/request/AlipayEcoSignFlowCreateRequest.php new file mode 100644 index 0000000..59928cf --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoSignFlowCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.sign.flow.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoSignFlowFinishRequest.php b/extend/alipay/aop/request/AlipayEcoSignFlowFinishRequest.php new file mode 100644 index 0000000..4f7989d --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoSignFlowFinishRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.sign.flow.finish"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoSignFlowQueryRequest.php b/extend/alipay/aop/request/AlipayEcoSignFlowQueryRequest.php new file mode 100644 index 0000000..b6fe20a --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoSignFlowQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.sign.flow.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoSignflowsDetailQueryRequest.php b/extend/alipay/aop/request/AlipayEcoSignflowsDetailQueryRequest.php new file mode 100644 index 0000000..01bae11 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoSignflowsDetailQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.signflows.detail.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoSignflowsUrlQueryRequest.php b/extend/alipay/aop/request/AlipayEcoSignflowsUrlQueryRequest.php new file mode 100644 index 0000000..c22a4f9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoSignflowsUrlQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.signflows.url.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayEcoWelfareCodeSyncRequest.php b/extend/alipay/aop/request/AlipayEcoWelfareCodeSyncRequest.php new file mode 100644 index 0000000..3f07594 --- /dev/null +++ b/extend/alipay/aop/request/AlipayEcoWelfareCodeSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.eco.welfare.code.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayExscUserCurrentsignGetRequest.php b/extend/alipay/aop/request/AlipayExscUserCurrentsignGetRequest.php new file mode 100644 index 0000000..7f88be0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayExscUserCurrentsignGetRequest.php @@ -0,0 +1,118 @@ +alipayId = $alipayId; + $this->apiParas["alipay_id"] = $alipayId; + } + + public function getAlipayId() + { + return $this->alipayId; + } + + public function getApiMethodName() + { + return "alipay.exsc.user.currentsign.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayExscUserFirstfundinpourGetRequest.php b/extend/alipay/aop/request/AlipayExscUserFirstfundinpourGetRequest.php new file mode 100644 index 0000000..c194075 --- /dev/null +++ b/extend/alipay/aop/request/AlipayExscUserFirstfundinpourGetRequest.php @@ -0,0 +1,118 @@ +alipayId = $alipayId; + $this->apiParas["alipay_id"] = $alipayId; + } + + public function getAlipayId() + { + return $this->alipayId; + } + + public function getApiMethodName() + { + return "alipay.exsc.user.firstfundinpour.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayExscUserFirstsignGetRequest.php b/extend/alipay/aop/request/AlipayExscUserFirstsignGetRequest.php new file mode 100644 index 0000000..36fd84a --- /dev/null +++ b/extend/alipay/aop/request/AlipayExscUserFirstsignGetRequest.php @@ -0,0 +1,118 @@ +alipayId = $alipayId; + $this->apiParas["alipay_id"] = $alipayId; + } + + public function getAlipayId() + { + return $this->alipayId; + } + + public function getApiMethodName() + { + return "alipay.exsc.user.firstsign.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFlashsalesStockSyncUpdateRequest.php b/extend/alipay/aop/request/AlipayFlashsalesStockSyncUpdateRequest.php new file mode 100644 index 0000000..5b2ab4f --- /dev/null +++ b/extend/alipay/aop/request/AlipayFlashsalesStockSyncUpdateRequest.php @@ -0,0 +1,150 @@ +outProductId = $outProductId; + $this->apiParas["out_product_id"] = $outProductId; + } + + public function getOutProductId() + { + return $this->outProductId; + } + + public function setPublicId($publicId) + { + $this->publicId = $publicId; + $this->apiParas["public_id"] = $publicId; + } + + public function getPublicId() + { + return $this->publicId; + } + + public function setStock($stock) + { + $this->stock = $stock; + $this->apiParas["stock"] = $stock; + } + + public function getStock() + { + return $this->stock; + } + + public function getApiMethodName() + { + return "alipay.flashsales.stock.sync.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundAccountQueryRequest.php b/extend/alipay/aop/request/AlipayFundAccountQueryRequest.php new file mode 100644 index 0000000..f46b297 --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundAccountQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.account.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundAccountbookCreateRequest.php b/extend/alipay/aop/request/AlipayFundAccountbookCreateRequest.php new file mode 100644 index 0000000..df7999c --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundAccountbookCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.accountbook.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundAccountbookQueryRequest.php b/extend/alipay/aop/request/AlipayFundAccountbookQueryRequest.php new file mode 100644 index 0000000..fd1a559 --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundAccountbookQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.accountbook.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundAuthOperationCancelRequest.php b/extend/alipay/aop/request/AlipayFundAuthOperationCancelRequest.php new file mode 100644 index 0000000..60e450e --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundAuthOperationCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.auth.operation.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundAuthOperationDetailQueryRequest.php b/extend/alipay/aop/request/AlipayFundAuthOperationDetailQueryRequest.php new file mode 100644 index 0000000..57b4dd4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundAuthOperationDetailQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.auth.operation.detail.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundAuthOrderAppFreezeRequest.php b/extend/alipay/aop/request/AlipayFundAuthOrderAppFreezeRequest.php new file mode 100644 index 0000000..2140341 --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundAuthOrderAppFreezeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.auth.order.app.freeze"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundAuthOrderFreezeRequest.php b/extend/alipay/aop/request/AlipayFundAuthOrderFreezeRequest.php new file mode 100644 index 0000000..c9f0887 --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundAuthOrderFreezeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.auth.order.freeze"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundAuthOrderUnfreezeRequest.php b/extend/alipay/aop/request/AlipayFundAuthOrderUnfreezeRequest.php new file mode 100644 index 0000000..da4f39f --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundAuthOrderUnfreezeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.auth.order.unfreeze"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundAuthOrderVoucherCreateRequest.php b/extend/alipay/aop/request/AlipayFundAuthOrderVoucherCreateRequest.php new file mode 100644 index 0000000..0402e7e --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundAuthOrderVoucherCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.auth.order.voucher.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundBatchCloseRequest.php b/extend/alipay/aop/request/AlipayFundBatchCloseRequest.php new file mode 100644 index 0000000..b4c3395 --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundBatchCloseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.batch.close"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundBatchCreateRequest.php b/extend/alipay/aop/request/AlipayFundBatchCreateRequest.php new file mode 100644 index 0000000..66b82be --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundBatchCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.batch.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundBatchDetailQueryRequest.php b/extend/alipay/aop/request/AlipayFundBatchDetailQueryRequest.php new file mode 100644 index 0000000..28a9cab --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundBatchDetailQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.batch.detail.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundBatchTransferRequest.php b/extend/alipay/aop/request/AlipayFundBatchTransferRequest.php new file mode 100644 index 0000000..3505bb8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundBatchTransferRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.batch.transfer"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundBatchUniTransferRequest.php b/extend/alipay/aop/request/AlipayFundBatchUniTransferRequest.php new file mode 100644 index 0000000..8347b6d --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundBatchUniTransferRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.batch.uni.transfer"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundCouponOperationQueryRequest.php b/extend/alipay/aop/request/AlipayFundCouponOperationQueryRequest.php new file mode 100644 index 0000000..aeabd4d --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundCouponOperationQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.coupon.operation.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundCouponOrderAgreementPayRequest.php b/extend/alipay/aop/request/AlipayFundCouponOrderAgreementPayRequest.php new file mode 100644 index 0000000..7582f0c --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundCouponOrderAgreementPayRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.coupon.order.agreement.pay"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundCouponOrderAppPayRequest.php b/extend/alipay/aop/request/AlipayFundCouponOrderAppPayRequest.php new file mode 100644 index 0000000..514333b --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundCouponOrderAppPayRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.coupon.order.app.pay"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundCouponOrderDisburseRequest.php b/extend/alipay/aop/request/AlipayFundCouponOrderDisburseRequest.php new file mode 100644 index 0000000..ffc9b0c --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundCouponOrderDisburseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.coupon.order.disburse"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundCouponOrderPagePayRequest.php b/extend/alipay/aop/request/AlipayFundCouponOrderPagePayRequest.php new file mode 100644 index 0000000..0b8a40d --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundCouponOrderPagePayRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.coupon.order.page.pay"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundCouponOrderRefundRequest.php b/extend/alipay/aop/request/AlipayFundCouponOrderRefundRequest.php new file mode 100644 index 0000000..cf2406f --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundCouponOrderRefundRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.coupon.order.refund"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundTransAppPayRequest.php b/extend/alipay/aop/request/AlipayFundTransAppPayRequest.php new file mode 100644 index 0000000..e3a7367 --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundTransAppPayRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.trans.app.pay"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundTransCommonQueryRequest.php b/extend/alipay/aop/request/AlipayFundTransCommonQueryRequest.php new file mode 100644 index 0000000..5c8b8e7 --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundTransCommonQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.trans.common.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundTransOrderQueryRequest.php b/extend/alipay/aop/request/AlipayFundTransOrderQueryRequest.php new file mode 100644 index 0000000..0fea9dc --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundTransOrderQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.trans.order.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundTransRefundRequest.php b/extend/alipay/aop/request/AlipayFundTransRefundRequest.php new file mode 100644 index 0000000..6bf81bb --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundTransRefundRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.trans.refund"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundTransToaccountTransferRequest.php b/extend/alipay/aop/request/AlipayFundTransToaccountTransferRequest.php new file mode 100644 index 0000000..18c82be --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundTransToaccountTransferRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.trans.toaccount.transfer"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayFundTransUniTransferRequest.php b/extend/alipay/aop/request/AlipayFundTransUniTransferRequest.php new file mode 100644 index 0000000..0e8b0bf --- /dev/null +++ b/extend/alipay/aop/request/AlipayFundTransUniTransferRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.fund.trans.uni.transfer"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsAutoAutoaftermarketAttachmentUploadRequest.php b/extend/alipay/aop/request/AlipayInsAutoAutoaftermarketAttachmentUploadRequest.php new file mode 100644 index 0000000..2852fbe --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsAutoAutoaftermarketAttachmentUploadRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.auto.autoaftermarket.attachment.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsAutoAutoaftermarketDepotCreateormodifyRequest.php b/extend/alipay/aop/request/AlipayInsAutoAutoaftermarketDepotCreateormodifyRequest.php new file mode 100644 index 0000000..8c32fc2 --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsAutoAutoaftermarketDepotCreateormodifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.auto.autoaftermarket.depot.createormodify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsAutoAutoaftermarketInserviceorderNotifyRequest.php b/extend/alipay/aop/request/AlipayInsAutoAutoaftermarketInserviceorderNotifyRequest.php new file mode 100644 index 0000000..2a89531 --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsAutoAutoaftermarketInserviceorderNotifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.auto.autoaftermarket.inserviceorder.notify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsAutoAutoaftermarketOutorderSyncRequest.php b/extend/alipay/aop/request/AlipayInsAutoAutoaftermarketOutorderSyncRequest.php new file mode 100644 index 0000000..5f42a0e --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsAutoAutoaftermarketOutorderSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.auto.autoaftermarket.outorder.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsAutoAutoinsprodCommonConsultRequest.php b/extend/alipay/aop/request/AlipayInsAutoAutoinsprodCommonConsultRequest.php new file mode 100644 index 0000000..89825fa --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsAutoAutoinsprodCommonConsultRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.auto.autoinsprod.common.consult"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsAutoAutoinsprodEnquriyApplyRequest.php b/extend/alipay/aop/request/AlipayInsAutoAutoinsprodEnquriyApplyRequest.php new file mode 100644 index 0000000..a910a31 --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsAutoAutoinsprodEnquriyApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.auto.autoinsprod.enquriy.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsAutoAutoinsprodPolicyApplyRequest.php b/extend/alipay/aop/request/AlipayInsAutoAutoinsprodPolicyApplyRequest.php new file mode 100644 index 0000000..7a76afa --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsAutoAutoinsprodPolicyApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.auto.autoinsprod.policy.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsAutoAutoinsprodPolicyCancelRequest.php b/extend/alipay/aop/request/AlipayInsAutoAutoinsprodPolicyCancelRequest.php new file mode 100644 index 0000000..0da88e9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsAutoAutoinsprodPolicyCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.auto.autoinsprod.policy.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsAutoAutoinsprodQuoteApplyRequest.php b/extend/alipay/aop/request/AlipayInsAutoAutoinsprodQuoteApplyRequest.php new file mode 100644 index 0000000..aed0eed --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsAutoAutoinsprodQuoteApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.auto.autoinsprod.quote.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsAutoAutoinsprodQuoteQueryRequest.php b/extend/alipay/aop/request/AlipayInsAutoAutoinsprodQuoteQueryRequest.php new file mode 100644 index 0000000..12695bf --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsAutoAutoinsprodQuoteQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.auto.autoinsprod.quote.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsAutoAutoinsprodUserCertifyRequest.php b/extend/alipay/aop/request/AlipayInsAutoAutoinsprodUserCertifyRequest.php new file mode 100644 index 0000000..b0896d8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsAutoAutoinsprodUserCertifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.auto.autoinsprod.user.certify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsAutoCarSaveRequest.php b/extend/alipay/aop/request/AlipayInsAutoCarSaveRequest.php new file mode 100644 index 0000000..d913465 --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsAutoCarSaveRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.auto.car.save"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsCooperationProductOfflineBatchqueryRequest.php b/extend/alipay/aop/request/AlipayInsCooperationProductOfflineBatchqueryRequest.php new file mode 100644 index 0000000..25767c1 --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsCooperationProductOfflineBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.cooperation.product.offline.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsCooperationProductQrcodeApplyRequest.php b/extend/alipay/aop/request/AlipayInsCooperationProductQrcodeApplyRequest.php new file mode 100644 index 0000000..cb016dd --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsCooperationProductQrcodeApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.cooperation.product.qrcode.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsCooperationRegionQrcodeApplyRequest.php b/extend/alipay/aop/request/AlipayInsCooperationRegionQrcodeApplyRequest.php new file mode 100644 index 0000000..7289868 --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsCooperationRegionQrcodeApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.cooperation.region.qrcode.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsSceneApplicationIssueConfirmRequest.php b/extend/alipay/aop/request/AlipayInsSceneApplicationIssueConfirmRequest.php new file mode 100644 index 0000000..134c386 --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsSceneApplicationIssueConfirmRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.scene.application.issue.confirm"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsSceneCouponReceiveRequest.php b/extend/alipay/aop/request/AlipayInsSceneCouponReceiveRequest.php new file mode 100644 index 0000000..f986ae6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsSceneCouponReceiveRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.scene.coupon.receive"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayInsSceneCouponSendRequest.php b/extend/alipay/aop/request/AlipayInsSceneCouponSendRequest.php new file mode 100644 index 0000000..b5aff70 --- /dev/null +++ b/extend/alipay/aop/request/AlipayInsSceneCouponSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.ins.scene.coupon.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignActivityOfflineCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignActivityOfflineCreateRequest.php new file mode 100644 index 0000000..41f3beb --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignActivityOfflineCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.activity.offline.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignActivityOfflineTriggerRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignActivityOfflineTriggerRequest.php new file mode 100644 index 0000000..817577d --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignActivityOfflineTriggerRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.activity.offline.trigger"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignCashCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignCashCreateRequest.php new file mode 100644 index 0000000..2467ada --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignCashCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.cash.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignCashDetailQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignCashDetailQueryRequest.php new file mode 100644 index 0000000..d111fbc --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignCashDetailQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.cash.detail.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignCashListQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignCashListQueryRequest.php new file mode 100644 index 0000000..01c06a4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignCashListQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.cash.list.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignCashStatusModifyRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignCashStatusModifyRequest.php new file mode 100644 index 0000000..1bab972 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignCashStatusModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.cash.status.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignCashTriggerRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignCashTriggerRequest.php new file mode 100644 index 0000000..36f3586 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignCashTriggerRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.cash.trigger"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignCertCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignCertCreateRequest.php new file mode 100644 index 0000000..3ce233e --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignCertCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.cert.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignDiscountBudgetAppendRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignDiscountBudgetAppendRequest.php new file mode 100644 index 0000000..2d66152 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignDiscountBudgetAppendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.discount.budget.append"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignDiscountBudgetCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignDiscountBudgetCreateRequest.php new file mode 100644 index 0000000..cff77d7 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignDiscountBudgetCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.discount.budget.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignDiscountBudgetQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignDiscountBudgetQueryRequest.php new file mode 100644 index 0000000..6b10d2f --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignDiscountBudgetQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.discount.budget.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignDiscountQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignDiscountQueryRequest.php new file mode 100644 index 0000000..6b06551 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignDiscountQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.discount.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignDiscountStatusUpdateRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignDiscountStatusUpdateRequest.php new file mode 100644 index 0000000..66f3fa2 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignDiscountStatusUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.discount.status.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignDiscountWhitelistQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignDiscountWhitelistQueryRequest.php new file mode 100644 index 0000000..6f09e87 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignDiscountWhitelistQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.discount.whitelist.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignDiscountWhitelistUpdateRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignDiscountWhitelistUpdateRequest.php new file mode 100644 index 0000000..e28d5de --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignDiscountWhitelistUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.discount.whitelist.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignDrawcampCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignDrawcampCreateRequest.php new file mode 100644 index 0000000..ed7945e --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignDrawcampCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.drawcamp.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignDrawcampQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignDrawcampQueryRequest.php new file mode 100644 index 0000000..090e772 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignDrawcampQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.drawcamp.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignDrawcampStatusUpdateRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignDrawcampStatusUpdateRequest.php new file mode 100644 index 0000000..1da3903 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignDrawcampStatusUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.drawcamp.status.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignDrawcampUpdateRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignDrawcampUpdateRequest.php new file mode 100644 index 0000000..1ce844e --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignDrawcampUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.drawcamp.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignDrawcampWhitelistCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignDrawcampWhitelistCreateRequest.php new file mode 100644 index 0000000..9af7fa8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignDrawcampWhitelistCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.drawcamp.whitelist.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCampaignPrizeAmountQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingCampaignPrizeAmountQueryRequest.php new file mode 100644 index 0000000..7cfdc29 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCampaignPrizeAmountQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.campaign.prize.amount.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCardActivateformQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingCardActivateformQueryRequest.php new file mode 100644 index 0000000..f7ce76d --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCardActivateformQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.card.activateform.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCardActivateurlApplyRequest.php b/extend/alipay/aop/request/AlipayMarketingCardActivateurlApplyRequest.php new file mode 100644 index 0000000..b85780f --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCardActivateurlApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.card.activateurl.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCardBenefitCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingCardBenefitCreateRequest.php new file mode 100644 index 0000000..2fe5550 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCardBenefitCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.card.benefit.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCardBenefitDeleteRequest.php b/extend/alipay/aop/request/AlipayMarketingCardBenefitDeleteRequest.php new file mode 100644 index 0000000..6c60746 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCardBenefitDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.card.benefit.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCardBenefitModifyRequest.php b/extend/alipay/aop/request/AlipayMarketingCardBenefitModifyRequest.php new file mode 100644 index 0000000..5cc4b8d --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCardBenefitModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.card.benefit.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCardBenefitQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingCardBenefitQueryRequest.php new file mode 100644 index 0000000..4bd711d --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCardBenefitQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.card.benefit.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCardConsumeSyncRequest.php b/extend/alipay/aop/request/AlipayMarketingCardConsumeSyncRequest.php new file mode 100644 index 0000000..e3a85e6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCardConsumeSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.card.consume.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCardDeleteRequest.php b/extend/alipay/aop/request/AlipayMarketingCardDeleteRequest.php new file mode 100644 index 0000000..6e928d4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCardDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.card.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCardFormtemplateSetRequest.php b/extend/alipay/aop/request/AlipayMarketingCardFormtemplateSetRequest.php new file mode 100644 index 0000000..3adc0c4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCardFormtemplateSetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.card.formtemplate.set"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCardOpenRequest.php b/extend/alipay/aop/request/AlipayMarketingCardOpenRequest.php new file mode 100644 index 0000000..d70a361 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCardOpenRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.card.open"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCardQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingCardQueryRequest.php new file mode 100644 index 0000000..3c116c4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCardQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.card.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCardTemplateBatchqueryRequest.php b/extend/alipay/aop/request/AlipayMarketingCardTemplateBatchqueryRequest.php new file mode 100644 index 0000000..e1ab2b4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCardTemplateBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.card.template.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCardTemplateCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingCardTemplateCreateRequest.php new file mode 100644 index 0000000..cac1a1b --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCardTemplateCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.card.template.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCardTemplateModifyRequest.php b/extend/alipay/aop/request/AlipayMarketingCardTemplateModifyRequest.php new file mode 100644 index 0000000..c5c0c05 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCardTemplateModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.card.template.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCardTemplateQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingCardTemplateQueryRequest.php new file mode 100644 index 0000000..0af1013 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCardTemplateQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.card.template.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCardUpdateRequest.php b/extend/alipay/aop/request/AlipayMarketingCardUpdateRequest.php new file mode 100644 index 0000000..adbce6d --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCardUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.card.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCashitemvoucherTemplateCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingCashitemvoucherTemplateCreateRequest.php new file mode 100644 index 0000000..1df2fd8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCashitemvoucherTemplateCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.cashitemvoucher.template.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCashlessitemvoucherTemplateCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingCashlessitemvoucherTemplateCreateRequest.php new file mode 100644 index 0000000..1d97b34 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCashlessitemvoucherTemplateCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.cashlessitemvoucher.template.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCashlessvoucherTemplateCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingCashlessvoucherTemplateCreateRequest.php new file mode 100644 index 0000000..0a21101 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCashlessvoucherTemplateCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.cashlessvoucher.template.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCashlessvoucherTemplateModifyRequest.php b/extend/alipay/aop/request/AlipayMarketingCashlessvoucherTemplateModifyRequest.php new file mode 100644 index 0000000..7c0de55 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCashlessvoucherTemplateModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.cashlessvoucher.template.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCashvoucherTemplateCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingCashvoucherTemplateCreateRequest.php new file mode 100644 index 0000000..91947bc --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCashvoucherTemplateCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.cashvoucher.template.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCashvoucherTemplateModifyRequest.php b/extend/alipay/aop/request/AlipayMarketingCashvoucherTemplateModifyRequest.php new file mode 100644 index 0000000..1603231 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCashvoucherTemplateModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.cashvoucher.template.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCdpAdvertiseCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingCdpAdvertiseCreateRequest.php new file mode 100644 index 0000000..ace480d --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCdpAdvertiseCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.cdp.advertise.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCdpAdvertiseModifyRequest.php b/extend/alipay/aop/request/AlipayMarketingCdpAdvertiseModifyRequest.php new file mode 100644 index 0000000..cb57e34 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCdpAdvertiseModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.cdp.advertise.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCdpAdvertiseOperateRequest.php b/extend/alipay/aop/request/AlipayMarketingCdpAdvertiseOperateRequest.php new file mode 100644 index 0000000..0bdbd6d --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCdpAdvertiseOperateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.cdp.advertise.operate"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCdpAdvertiseQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingCdpAdvertiseQueryRequest.php new file mode 100644 index 0000000..78a6ab1 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCdpAdvertiseQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.cdp.advertise.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCdpAdvertiseReportQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingCdpAdvertiseReportQueryRequest.php new file mode 100644 index 0000000..75639e8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCdpAdvertiseReportQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.cdp.advertise.report.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCdpRecommendQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingCdpRecommendQueryRequest.php new file mode 100644 index 0000000..38cec38 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCdpRecommendQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.cdp.recommend.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingCouponTemplateCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingCouponTemplateCreateRequest.php new file mode 100644 index 0000000..f0c9289 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingCouponTemplateCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.coupon.template.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingExchangevoucherTemplateCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingExchangevoucherTemplateCreateRequest.php new file mode 100644 index 0000000..00d3a6d --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingExchangevoucherTemplateCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.exchangevoucher.template.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingExchangevoucherUseRequest.php b/extend/alipay/aop/request/AlipayMarketingExchangevoucherUseRequest.php new file mode 100644 index 0000000..f6f19c3 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingExchangevoucherUseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.exchangevoucher.use"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingFacetofaceDecodeUseRequest.php b/extend/alipay/aop/request/AlipayMarketingFacetofaceDecodeUseRequest.php new file mode 100644 index 0000000..8722ac1 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingFacetofaceDecodeUseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.facetoface.decode.use"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingMaterialImageUploadRequest.php b/extend/alipay/aop/request/AlipayMarketingMaterialImageUploadRequest.php new file mode 100644 index 0000000..eb23040 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingMaterialImageUploadRequest.php @@ -0,0 +1,118 @@ +fileContent = $fileContent; + $this->apiParas["file_content"] = $fileContent; + } + + public function getFileContent() + { + return $this->fileContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.material.image.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingToolFengdieActivityCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingToolFengdieActivityCreateRequest.php new file mode 100644 index 0000000..aa59555 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingToolFengdieActivityCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.tool.fengdie.activity.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingToolFengdieActivityQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingToolFengdieActivityQueryRequest.php new file mode 100644 index 0000000..3ed3f0c --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingToolFengdieActivityQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.tool.fengdie.activity.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingToolFengdieEditorQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingToolFengdieEditorQueryRequest.php new file mode 100644 index 0000000..2066674 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingToolFengdieEditorQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.tool.fengdie.editor.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingToolFengdieMemberCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingToolFengdieMemberCreateRequest.php new file mode 100644 index 0000000..7679491 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingToolFengdieMemberCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.tool.fengdie.member.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesBatchqueryRequest.php b/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesBatchqueryRequest.php new file mode 100644 index 0000000..2ecc509 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.tool.fengdie.sites.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesConfirmRequest.php b/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesConfirmRequest.php new file mode 100644 index 0000000..a51e727 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesConfirmRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.tool.fengdie.sites.confirm"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesCreateRequest.php new file mode 100644 index 0000000..6814572 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.tool.fengdie.sites.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesDeleteRequest.php b/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesDeleteRequest.php new file mode 100644 index 0000000..8daabd4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.tool.fengdie.sites.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesQueryRequest.php new file mode 100644 index 0000000..fbd57c9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.tool.fengdie.sites.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesSyncRequest.php b/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesSyncRequest.php new file mode 100644 index 0000000..fd690a3 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingToolFengdieSitesSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.tool.fengdie.sites.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingToolFengdieSpaceBatchqueryRequest.php b/extend/alipay/aop/request/AlipayMarketingToolFengdieSpaceBatchqueryRequest.php new file mode 100644 index 0000000..4783b05 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingToolFengdieSpaceBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.tool.fengdie.space.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingToolFengdieSpaceCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingToolFengdieSpaceCreateRequest.php new file mode 100644 index 0000000..ad60ff0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingToolFengdieSpaceCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.tool.fengdie.space.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingToolFengdieSpaceQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingToolFengdieSpaceQueryRequest.php new file mode 100644 index 0000000..615782d --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingToolFengdieSpaceQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.tool.fengdie.space.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingToolFengdieTemplateBatchqueryRequest.php b/extend/alipay/aop/request/AlipayMarketingToolFengdieTemplateBatchqueryRequest.php new file mode 100644 index 0000000..1f797a6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingToolFengdieTemplateBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.tool.fengdie.template.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingToolFengdieTemplateQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingToolFengdieTemplateQueryRequest.php new file mode 100644 index 0000000..57d78e5 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingToolFengdieTemplateQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.tool.fengdie.template.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingToolFengdieTemplateSendRequest.php b/extend/alipay/aop/request/AlipayMarketingToolFengdieTemplateSendRequest.php new file mode 100644 index 0000000..818a1f7 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingToolFengdieTemplateSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.tool.fengdie.template.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingUserulePidQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingUserulePidQueryRequest.php new file mode 100644 index 0000000..5b76f5e --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingUserulePidQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.userule.pid.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingVoucherAuthSendRequest.php b/extend/alipay/aop/request/AlipayMarketingVoucherAuthSendRequest.php new file mode 100644 index 0000000..8a2ee7d --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingVoucherAuthSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.voucher.auth.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingVoucherConfirmRequest.php b/extend/alipay/aop/request/AlipayMarketingVoucherConfirmRequest.php new file mode 100644 index 0000000..6df85ed --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingVoucherConfirmRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.voucher.confirm"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingVoucherListQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingVoucherListQueryRequest.php new file mode 100644 index 0000000..5140368 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingVoucherListQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.voucher.list.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingVoucherQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingVoucherQueryRequest.php new file mode 100644 index 0000000..daa6e76 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingVoucherQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.voucher.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingVoucherSendRequest.php b/extend/alipay/aop/request/AlipayMarketingVoucherSendRequest.php new file mode 100644 index 0000000..12600b4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingVoucherSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.voucher.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingVoucherStockCreateRequest.php b/extend/alipay/aop/request/AlipayMarketingVoucherStockCreateRequest.php new file mode 100644 index 0000000..e8eb1d2 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingVoucherStockCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.voucher.stock.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingVoucherStockMatchRequest.php b/extend/alipay/aop/request/AlipayMarketingVoucherStockMatchRequest.php new file mode 100644 index 0000000..aa2a89a --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingVoucherStockMatchRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.voucher.stock.match"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingVoucherStockQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingVoucherStockQueryRequest.php new file mode 100644 index 0000000..2bb74f3 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingVoucherStockQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.voucher.stock.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingVoucherStockUseRequest.php b/extend/alipay/aop/request/AlipayMarketingVoucherStockUseRequest.php new file mode 100644 index 0000000..af93b43 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingVoucherStockUseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.voucher.stock.use"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingVoucherTemplateDeleteRequest.php b/extend/alipay/aop/request/AlipayMarketingVoucherTemplateDeleteRequest.php new file mode 100644 index 0000000..090b755 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingVoucherTemplateDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.voucher.template.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingVoucherTemplatedetailQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingVoucherTemplatedetailQueryRequest.php new file mode 100644 index 0000000..2fe3a88 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingVoucherTemplatedetailQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.voucher.templatedetail.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMarketingVoucherTemplatelistQueryRequest.php b/extend/alipay/aop/request/AlipayMarketingVoucherTemplatelistQueryRequest.php new file mode 100644 index 0000000..72b1ac4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMarketingVoucherTemplatelistQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.marketing.voucher.templatelist.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMdataTagGetRequest.php b/extend/alipay/aop/request/AlipayMdataTagGetRequest.php new file mode 100644 index 0000000..a700db6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMdataTagGetRequest.php @@ -0,0 +1,134 @@ +requiredTags = $requiredTags; + $this->apiParas["required_tags"] = $requiredTags; + } + + public function getRequiredTags() + { + return $this->requiredTags; + } + + public function setUserId($userId) + { + $this->userId = $userId; + $this->apiParas["user_id"] = $userId; + } + + public function getUserId() + { + return $this->userId; + } + + public function getApiMethodName() + { + return "alipay.mdata.tag.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMemberCouponQuerylistRequest.php b/extend/alipay/aop/request/AlipayMemberCouponQuerylistRequest.php new file mode 100644 index 0000000..f521fd3 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMemberCouponQuerylistRequest.php @@ -0,0 +1,198 @@ +merchantInfo = $merchantInfo; + $this->apiParas["merchant_info"] = $merchantInfo; + } + + public function getMerchantInfo() + { + return $this->merchantInfo; + } + + public function setPageNo($pageNo) + { + $this->pageNo = $pageNo; + $this->apiParas["page_no"] = $pageNo; + } + + public function getPageNo() + { + return $this->pageNo; + } + + public function setPageSize($pageSize) + { + $this->pageSize = $pageSize; + $this->apiParas["page_size"] = $pageSize; + } + + public function getPageSize() + { + return $this->pageSize; + } + + public function setStatus($status) + { + $this->status = $status; + $this->apiParas["status"] = $status; + } + + public function getStatus() + { + return $this->status; + } + + public function setUserInfo($userInfo) + { + $this->userInfo = $userInfo; + $this->apiParas["user_info"] = $userInfo; + } + + public function getUserInfo() + { + return $this->userInfo; + } + + public function getApiMethodName() + { + return "alipay.member.coupon.querylist"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMerchantItemFileUploadRequest.php b/extend/alipay/aop/request/AlipayMerchantItemFileUploadRequest.php new file mode 100644 index 0000000..d01644a --- /dev/null +++ b/extend/alipay/aop/request/AlipayMerchantItemFileUploadRequest.php @@ -0,0 +1,134 @@ +fileContent = $fileContent; + $this->apiParas["file_content"] = $fileContent; + } + + public function getFileContent() + { + return $this->fileContent; + } + + public function setScene($scene) + { + $this->scene = $scene; + $this->apiParas["scene"] = $scene; + } + + public function getScene() + { + return $this->scene; + } + + public function getApiMethodName() + { + return "alipay.merchant.item.file.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMerchantOrderConsumerQueryRequest.php b/extend/alipay/aop/request/AlipayMerchantOrderConsumerQueryRequest.php new file mode 100644 index 0000000..e910b3c --- /dev/null +++ b/extend/alipay/aop/request/AlipayMerchantOrderConsumerQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.merchant.order.consumer.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMerchantOrderDigestConsumerBatchqueryRequest.php b/extend/alipay/aop/request/AlipayMerchantOrderDigestConsumerBatchqueryRequest.php new file mode 100644 index 0000000..4384435 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMerchantOrderDigestConsumerBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.merchant.order.digest.consumer.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMerchantOrderSecuritydetailConsumerQueryRequest.php b/extend/alipay/aop/request/AlipayMerchantOrderSecuritydetailConsumerQueryRequest.php new file mode 100644 index 0000000..fa456e3 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMerchantOrderSecuritydetailConsumerQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.merchant.order.securitydetail.consumer.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMerchantOrderSecuritydigestConsumerBatchqueryRequest.php b/extend/alipay/aop/request/AlipayMerchantOrderSecuritydigestConsumerBatchqueryRequest.php new file mode 100644 index 0000000..8000d95 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMerchantOrderSecuritydigestConsumerBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.merchant.order.securitydigest.consumer.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMerchantOrderSyncRequest.php b/extend/alipay/aop/request/AlipayMerchantOrderSyncRequest.php new file mode 100644 index 0000000..baa18b1 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMerchantOrderSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.merchant.order.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMicropayOrderConfirmpayurlGetRequest.php b/extend/alipay/aop/request/AlipayMicropayOrderConfirmpayurlGetRequest.php new file mode 100644 index 0000000..452d28f --- /dev/null +++ b/extend/alipay/aop/request/AlipayMicropayOrderConfirmpayurlGetRequest.php @@ -0,0 +1,182 @@ +alipayOrderNo = $alipayOrderNo; + $this->apiParas["alipay_order_no"] = $alipayOrderNo; + } + + public function getAlipayOrderNo() + { + return $this->alipayOrderNo; + } + + public function setAmount($amount) + { + $this->amount = $amount; + $this->apiParas["amount"] = $amount; + } + + public function getAmount() + { + return $this->amount; + } + + public function setMemo($memo) + { + $this->memo = $memo; + $this->apiParas["memo"] = $memo; + } + + public function getMemo() + { + return $this->memo; + } + + public function setReceiveUserId($receiveUserId) + { + $this->receiveUserId = $receiveUserId; + $this->apiParas["receive_user_id"] = $receiveUserId; + } + + public function getReceiveUserId() + { + return $this->receiveUserId; + } + + public function setTransferOutOrderNo($transferOutOrderNo) + { + $this->transferOutOrderNo = $transferOutOrderNo; + $this->apiParas["transfer_out_order_no"] = $transferOutOrderNo; + } + + public function getTransferOutOrderNo() + { + return $this->transferOutOrderNo; + } + + public function getApiMethodName() + { + return "alipay.micropay.order.confirmpayurl.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMicropayOrderDirectPayRequest.php b/extend/alipay/aop/request/AlipayMicropayOrderDirectPayRequest.php new file mode 100644 index 0000000..01b1f46 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMicropayOrderDirectPayRequest.php @@ -0,0 +1,182 @@ +alipayOrderNo = $alipayOrderNo; + $this->apiParas["alipay_order_no"] = $alipayOrderNo; + } + + public function getAlipayOrderNo() + { + return $this->alipayOrderNo; + } + + public function setAmount($amount) + { + $this->amount = $amount; + $this->apiParas["amount"] = $amount; + } + + public function getAmount() + { + return $this->amount; + } + + public function setMemo($memo) + { + $this->memo = $memo; + $this->apiParas["memo"] = $memo; + } + + public function getMemo() + { + return $this->memo; + } + + public function setReceiveUserId($receiveUserId) + { + $this->receiveUserId = $receiveUserId; + $this->apiParas["receive_user_id"] = $receiveUserId; + } + + public function getReceiveUserId() + { + return $this->receiveUserId; + } + + public function setTransferOutOrderNo($transferOutOrderNo) + { + $this->transferOutOrderNo = $transferOutOrderNo; + $this->apiParas["transfer_out_order_no"] = $transferOutOrderNo; + } + + public function getTransferOutOrderNo() + { + return $this->transferOutOrderNo; + } + + public function getApiMethodName() + { + return "alipay.micropay.order.direct.pay"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMicropayOrderFreezeRequest.php b/extend/alipay/aop/request/AlipayMicropayOrderFreezeRequest.php new file mode 100644 index 0000000..810c012 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMicropayOrderFreezeRequest.php @@ -0,0 +1,182 @@ +amount = $amount; + $this->apiParas["amount"] = $amount; + } + + public function getAmount() + { + return $this->amount; + } + + public function setExpireTime($expireTime) + { + $this->expireTime = $expireTime; + $this->apiParas["expire_time"] = $expireTime; + } + + public function getExpireTime() + { + return $this->expireTime; + } + + public function setMemo($memo) + { + $this->memo = $memo; + $this->apiParas["memo"] = $memo; + } + + public function getMemo() + { + return $this->memo; + } + + public function setMerchantOrderNo($merchantOrderNo) + { + $this->merchantOrderNo = $merchantOrderNo; + $this->apiParas["merchant_order_no"] = $merchantOrderNo; + } + + public function getMerchantOrderNo() + { + return $this->merchantOrderNo; + } + + public function setPayConfirm($payConfirm) + { + $this->payConfirm = $payConfirm; + $this->apiParas["pay_confirm"] = $payConfirm; + } + + public function getPayConfirm() + { + return $this->payConfirm; + } + + public function getApiMethodName() + { + return "alipay.micropay.order.freeze"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMicropayOrderFreezepayurlGetRequest.php b/extend/alipay/aop/request/AlipayMicropayOrderFreezepayurlGetRequest.php new file mode 100644 index 0000000..0333bdd --- /dev/null +++ b/extend/alipay/aop/request/AlipayMicropayOrderFreezepayurlGetRequest.php @@ -0,0 +1,118 @@ +alipayOrderNo = $alipayOrderNo; + $this->apiParas["alipay_order_no"] = $alipayOrderNo; + } + + public function getAlipayOrderNo() + { + return $this->alipayOrderNo; + } + + public function getApiMethodName() + { + return "alipay.micropay.order.freezepayurl.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMicropayOrderGetRequest.php b/extend/alipay/aop/request/AlipayMicropayOrderGetRequest.php new file mode 100644 index 0000000..1371e30 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMicropayOrderGetRequest.php @@ -0,0 +1,118 @@ +alipayOrderNo = $alipayOrderNo; + $this->apiParas["alipay_order_no"] = $alipayOrderNo; + } + + public function getAlipayOrderNo() + { + return $this->alipayOrderNo; + } + + public function getApiMethodName() + { + return "alipay.micropay.order.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMicropayOrderUnfreezeRequest.php b/extend/alipay/aop/request/AlipayMicropayOrderUnfreezeRequest.php new file mode 100644 index 0000000..70d05a8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMicropayOrderUnfreezeRequest.php @@ -0,0 +1,134 @@ +alipayOrderNo = $alipayOrderNo; + $this->apiParas["alipay_order_no"] = $alipayOrderNo; + } + + public function getAlipayOrderNo() + { + return $this->alipayOrderNo; + } + + public function setMemo($memo) + { + $this->memo = $memo; + $this->apiParas["memo"] = $memo; + } + + public function getMemo() + { + return $this->memo; + } + + public function getApiMethodName() + { + return "alipay.micropay.order.unfreeze"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobileBeaconDeviceAddRequest.php b/extend/alipay/aop/request/AlipayMobileBeaconDeviceAddRequest.php new file mode 100644 index 0000000..e98fa56 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobileBeaconDeviceAddRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.beacon.device.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobileBeaconDeviceDeleteRequest.php b/extend/alipay/aop/request/AlipayMobileBeaconDeviceDeleteRequest.php new file mode 100644 index 0000000..0ed4f04 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobileBeaconDeviceDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.beacon.device.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobileBeaconDeviceModifyRequest.php b/extend/alipay/aop/request/AlipayMobileBeaconDeviceModifyRequest.php new file mode 100644 index 0000000..4306478 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobileBeaconDeviceModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.beacon.device.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobileBeaconDeviceQueryRequest.php b/extend/alipay/aop/request/AlipayMobileBeaconDeviceQueryRequest.php new file mode 100644 index 0000000..22a0de8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobileBeaconDeviceQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.beacon.device.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobileBeaconMessageSendRequest.php b/extend/alipay/aop/request/AlipayMobileBeaconMessageSendRequest.php new file mode 100644 index 0000000..0cf9c0f --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobileBeaconMessageSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.beacon.message.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobileBksigntokenVerifyRequest.php b/extend/alipay/aop/request/AlipayMobileBksigntokenVerifyRequest.php new file mode 100644 index 0000000..7928a0c --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobileBksigntokenVerifyRequest.php @@ -0,0 +1,150 @@ +deviceid = $deviceid; + $this->apiParas["deviceid"] = $deviceid; + } + + public function getDeviceid() + { + return $this->deviceid; + } + + public function setSource($source) + { + $this->source = $source; + $this->apiParas["source"] = $source; + } + + public function getSource() + { + return $this->source; + } + + public function setToken($token) + { + $this->token = $token; + $this->apiParas["token"] = $token; + } + + public function getToken() + { + return $this->token; + } + + public function getApiMethodName() + { + return "alipay.mobile.bksigntoken.verify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobileCodeCreateRequest.php b/extend/alipay/aop/request/AlipayMobileCodeCreateRequest.php new file mode 100644 index 0000000..770cd6c --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobileCodeCreateRequest.php @@ -0,0 +1,247 @@ +bizLinkedId = $bizLinkedId; + $this->apiParas["biz_linked_id"] = $bizLinkedId; + } + + public function getBizLinkedId() + { + return $this->bizLinkedId; + } + + public function setBizType($bizType) + { + $this->bizType = $bizType; + $this->apiParas["biz_type"] = $bizType; + } + + public function getBizType() + { + return $this->bizType; + } + + public function setContextStr($contextStr) + { + $this->contextStr = $contextStr; + $this->apiParas["context_str"] = $contextStr; + } + + public function getContextStr() + { + return $this->contextStr; + } + + public function setIsDirect($isDirect) + { + $this->isDirect = $isDirect; + $this->apiParas["is_direct"] = $isDirect; + } + + public function getIsDirect() + { + return $this->isDirect; + } + + public function setMemo($memo) + { + $this->memo = $memo; + $this->apiParas["memo"] = $memo; + } + + public function getMemo() + { + return $this->memo; + } + + public function setSourceId($sourceId) + { + $this->sourceId = $sourceId; + $this->apiParas["source_id"] = $sourceId; + } + + public function getSourceId() + { + return $this->sourceId; + } + + public function setStartDate($startDate) + { + $this->startDate = $startDate; + $this->apiParas["start_date"] = $startDate; + } + + public function getStartDate() + { + return $this->startDate; + } + + public function setTimeout($timeout) + { + $this->timeout = $timeout; + $this->apiParas["timeout"] = $timeout; + } + + public function getTimeout() + { + return $this->timeout; + } + + public function setUserId($userId) + { + $this->userId = $userId; + $this->apiParas["user_id"] = $userId; + } + + public function getUserId() + { + return $this->userId; + } + + public function getApiMethodName() + { + return "alipay.mobile.code.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobileCodeQueryRequest.php b/extend/alipay/aop/request/AlipayMobileCodeQueryRequest.php new file mode 100644 index 0000000..c85203c --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobileCodeQueryRequest.php @@ -0,0 +1,118 @@ +qrToken = $qrToken; + $this->apiParas["qr_token"] = $qrToken; + } + + public function getQrToken() + { + return $this->qrToken; + } + + public function getApiMethodName() + { + return "alipay.mobile.code.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicAccountAddRequest.php b/extend/alipay/aop/request/AlipayMobilePublicAccountAddRequest.php new file mode 100644 index 0000000..7cb3512 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicAccountAddRequest.php @@ -0,0 +1,198 @@ +agreementId = $agreementId; + $this->apiParas["agreement_id"] = $agreementId; + } + + public function getAgreementId() + { + return $this->agreementId; + } + + public function setBindAccountNo($bindAccountNo) + { + $this->bindAccountNo = $bindAccountNo; + $this->apiParas["bind_account_no"] = $bindAccountNo; + } + + public function getBindAccountNo() + { + return $this->bindAccountNo; + } + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function setDisplayName($displayName) + { + $this->displayName = $displayName; + $this->apiParas["display_name"] = $displayName; + } + + public function getDisplayName() + { + return $this->displayName; + } + + public function setFromUserId($fromUserId) + { + $this->fromUserId = $fromUserId; + $this->apiParas["from_user_id"] = $fromUserId; + } + + public function getFromUserId() + { + return $this->fromUserId; + } + + public function setRealName($realName) + { + $this->realName = $realName; + $this->apiParas["real_name"] = $realName; + } + + public function getRealName() + { + return $this->realName; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.account.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicAccountDeleteRequest.php b/extend/alipay/aop/request/AlipayMobilePublicAccountDeleteRequest.php new file mode 100644 index 0000000..e3e7608 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicAccountDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.account.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicAccountQueryRequest.php b/extend/alipay/aop/request/AlipayMobilePublicAccountQueryRequest.php new file mode 100644 index 0000000..74e5c04 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicAccountQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.account.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicAccountResetRequest.php b/extend/alipay/aop/request/AlipayMobilePublicAccountResetRequest.php new file mode 100644 index 0000000..152a2e5 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicAccountResetRequest.php @@ -0,0 +1,198 @@ +agreementId = $agreementId; + $this->apiParas["agreement_id"] = $agreementId; + } + + public function getAgreementId() + { + return $this->agreementId; + } + + public function setBindAccountNo($bindAccountNo) + { + $this->bindAccountNo = $bindAccountNo; + $this->apiParas["bind_account_no"] = $bindAccountNo; + } + + public function getBindAccountNo() + { + return $this->bindAccountNo; + } + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function setDisplayName($displayName) + { + $this->displayName = $displayName; + $this->apiParas["display_name"] = $displayName; + } + + public function getDisplayName() + { + return $this->displayName; + } + + public function setFromUserId($fromUserId) + { + $this->fromUserId = $fromUserId; + $this->apiParas["from_user_id"] = $fromUserId; + } + + public function getFromUserId() + { + return $this->fromUserId; + } + + public function setRealName($realName) + { + $this->realName = $realName; + $this->apiParas["real_name"] = $realName; + } + + public function getRealName() + { + return $this->realName; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.account.reset"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicAppinfoUpdateRequest.php b/extend/alipay/aop/request/AlipayMobilePublicAppinfoUpdateRequest.php new file mode 100644 index 0000000..9d94b4f --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicAppinfoUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.appinfo.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicContactFollowListRequest.php b/extend/alipay/aop/request/AlipayMobilePublicContactFollowListRequest.php new file mode 100644 index 0000000..8b6e4cf --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicContactFollowListRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicFollowListRequest.php b/extend/alipay/aop/request/AlipayMobilePublicFollowListRequest.php new file mode 100644 index 0000000..418fa06 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicFollowListRequest.php @@ -0,0 +1,119 @@ +详情请见 + **/ + private $bizContent; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.follow.list"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicGisGetRequest.php b/extend/alipay/aop/request/AlipayMobilePublicGisGetRequest.php new file mode 100644 index 0000000..089d263 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicGisGetRequest.php @@ -0,0 +1,118 @@ +详情请见 + **/ + private $bizContent; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.gis.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicInfoModifyRequest.php b/extend/alipay/aop/request/AlipayMobilePublicInfoModifyRequest.php new file mode 100644 index 0000000..4e2b289 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicInfoModifyRequest.php @@ -0,0 +1,230 @@ +appName = $appName; + $this->apiParas["app_name"] = $appName; + } + + public function getAppName() + { + return $this->appName; + } + + public function setAuthPic($authPic) + { + $this->authPic = $authPic; + $this->apiParas["auth_pic"] = $authPic; + } + + public function getAuthPic() + { + return $this->authPic; + } + + public function setLicenseUrl($licenseUrl) + { + $this->licenseUrl = $licenseUrl; + $this->apiParas["license_url"] = $licenseUrl; + } + + public function getLicenseUrl() + { + return $this->licenseUrl; + } + + public function setLogoUrl($logoUrl) + { + $this->logoUrl = $logoUrl; + $this->apiParas["logo_url"] = $logoUrl; + } + + public function getLogoUrl() + { + return $this->logoUrl; + } + + public function setPublicGreeting($publicGreeting) + { + $this->publicGreeting = $publicGreeting; + $this->apiParas["public_greeting"] = $publicGreeting; + } + + public function getPublicGreeting() + { + return $this->publicGreeting; + } + + public function setShopPic1($shopPic1) + { + $this->shopPic1 = $shopPic1; + $this->apiParas["shop_pic1"] = $shopPic1; + } + + public function getShopPic1() + { + return $this->shopPic1; + } + + public function setShopPic2($shopPic2) + { + $this->shopPic2 = $shopPic2; + $this->apiParas["shop_pic2"] = $shopPic2; + } + + public function getShopPic2() + { + return $this->shopPic2; + } + + public function setShopPic3($shopPic3) + { + $this->shopPic3 = $shopPic3; + $this->apiParas["shop_pic3"] = $shopPic3; + } + + public function getShopPic3() + { + return $this->shopPic3; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.info.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicInfoQueryRequest.php b/extend/alipay/aop/request/AlipayMobilePublicInfoQueryRequest.php new file mode 100644 index 0000000..3ea67cb --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicInfoQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicLabelAddRequest.php b/extend/alipay/aop/request/AlipayMobilePublicLabelAddRequest.php new file mode 100644 index 0000000..9659843 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicLabelAddRequest.php @@ -0,0 +1,118 @@ +详情请见 + **/ + private $bizContent; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.label.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicLabelDeleteRequest.php b/extend/alipay/aop/request/AlipayMobilePublicLabelDeleteRequest.php new file mode 100644 index 0000000..db64733 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicLabelDeleteRequest.php @@ -0,0 +1,118 @@ +详情请见 + **/ + private $bizContent; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.label.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicLabelQueryRequest.php b/extend/alipay/aop/request/AlipayMobilePublicLabelQueryRequest.php new file mode 100644 index 0000000..99fb606 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicLabelQueryRequest.php @@ -0,0 +1,118 @@ +详情请见 + **/ + private $bizContent; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.label.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicLabelUpdateRequest.php b/extend/alipay/aop/request/AlipayMobilePublicLabelUpdateRequest.php new file mode 100644 index 0000000..f24f654 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicLabelUpdateRequest.php @@ -0,0 +1,118 @@ +详情请见 + **/ + private $bizContent; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.label.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicLabelUserAddRequest.php b/extend/alipay/aop/request/AlipayMobilePublicLabelUserAddRequest.php new file mode 100644 index 0000000..020f158 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicLabelUserAddRequest.php @@ -0,0 +1,118 @@ +详情请见 + **/ + private $bizContent; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.label.user.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicLabelUserDeleteRequest.php b/extend/alipay/aop/request/AlipayMobilePublicLabelUserDeleteRequest.php new file mode 100644 index 0000000..a6a78d0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicLabelUserDeleteRequest.php @@ -0,0 +1,118 @@ +详情请见 + **/ + private $bizContent; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.label.user.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicLabelUserQueryRequest.php b/extend/alipay/aop/request/AlipayMobilePublicLabelUserQueryRequest.php new file mode 100644 index 0000000..c07bac4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicLabelUserQueryRequest.php @@ -0,0 +1,118 @@ +详情请见 + **/ + private $bizContent; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.label.user.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicMenuAddRequest.php b/extend/alipay/aop/request/AlipayMobilePublicMenuAddRequest.php new file mode 100644 index 0000000..7c4b468 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicMenuAddRequest.php @@ -0,0 +1,118 @@ +详情请见 + **/ + private $bizContent; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.menu.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicMenuDeleteRequest.php b/extend/alipay/aop/request/AlipayMobilePublicMenuDeleteRequest.php new file mode 100644 index 0000000..3f5bca9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicMenuDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.menu.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicMenuGetRequest.php b/extend/alipay/aop/request/AlipayMobilePublicMenuGetRequest.php new file mode 100644 index 0000000..f72d95e --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicMenuGetRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicMenuQueryRequest.php b/extend/alipay/aop/request/AlipayMobilePublicMenuQueryRequest.php new file mode 100644 index 0000000..a329559 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicMenuQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicMenuUpdateRequest.php b/extend/alipay/aop/request/AlipayMobilePublicMenuUpdateRequest.php new file mode 100644 index 0000000..a918bf6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicMenuUpdateRequest.php @@ -0,0 +1,118 @@ +详情请见 + **/ + private $bizContent; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.menu.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicMenuUserQueryRequest.php b/extend/alipay/aop/request/AlipayMobilePublicMenuUserQueryRequest.php new file mode 100644 index 0000000..2437769 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicMenuUserQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.menu.user.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicMenuUserUpdateRequest.php b/extend/alipay/aop/request/AlipayMobilePublicMenuUserUpdateRequest.php new file mode 100644 index 0000000..a84432d --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicMenuUserUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.menu.user.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicMessageCustomSendRequest.php b/extend/alipay/aop/request/AlipayMobilePublicMessageCustomSendRequest.php new file mode 100644 index 0000000..a1ce960 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicMessageCustomSendRequest.php @@ -0,0 +1,119 @@ +详情请见 + **/ + private $bizContent; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.message.custom.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicMessageLabelSendRequest.php b/extend/alipay/aop/request/AlipayMobilePublicMessageLabelSendRequest.php new file mode 100644 index 0000000..bfc8c91 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicMessageLabelSendRequest.php @@ -0,0 +1,118 @@ +详情请见 + **/ + private $bizContent; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.message.label.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicMessagePushRequest.php b/extend/alipay/aop/request/AlipayMobilePublicMessagePushRequest.php new file mode 100644 index 0000000..5d13b82 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicMessagePushRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.message.push"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicMessageSingleSendRequest.php b/extend/alipay/aop/request/AlipayMobilePublicMessageSingleSendRequest.php new file mode 100644 index 0000000..047058e --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicMessageSingleSendRequest.php @@ -0,0 +1,119 @@ +详情请见 + **/ + private $bizContent; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.message.single.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicMessageTotalSendRequest.php b/extend/alipay/aop/request/AlipayMobilePublicMessageTotalSendRequest.php new file mode 100644 index 0000000..10a8f1f --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicMessageTotalSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.message.total.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicMessagebatchPushRequest.php b/extend/alipay/aop/request/AlipayMobilePublicMessagebatchPushRequest.php new file mode 100644 index 0000000..8c99594 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicMessagebatchPushRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.messagebatch.push"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicMessagespecifyPushRequest.php b/extend/alipay/aop/request/AlipayMobilePublicMessagespecifyPushRequest.php new file mode 100644 index 0000000..a91a36f --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicMessagespecifyPushRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.messagespecify.push"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicQrcodeCreateRequest.php b/extend/alipay/aop/request/AlipayMobilePublicQrcodeCreateRequest.php new file mode 100644 index 0000000..be3fe14 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicQrcodeCreateRequest.php @@ -0,0 +1,118 @@ +详情请见 + **/ + private $bizContent; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.qrcode.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicShortlinkCreateRequest.php b/extend/alipay/aop/request/AlipayMobilePublicShortlinkCreateRequest.php new file mode 100644 index 0000000..83634fd --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicShortlinkCreateRequest.php @@ -0,0 +1,118 @@ +详情请见 + **/ + private $bizContent; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBizContent($bizContent) + { + $this->bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.shortlink.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicTemplateMessageDeleteRequest.php b/extend/alipay/aop/request/AlipayMobilePublicTemplateMessageDeleteRequest.php new file mode 100644 index 0000000..d48220b --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicTemplateMessageDeleteRequest.php @@ -0,0 +1,118 @@ +templateId = $templateId; + $this->apiParas["template_id"] = $templateId; + } + + public function getTemplateId() + { + return $this->templateId; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.template.message.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicTemplateMessageGetRequest.php b/extend/alipay/aop/request/AlipayMobilePublicTemplateMessageGetRequest.php new file mode 100644 index 0000000..8d4e3b3 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicTemplateMessageGetRequest.php @@ -0,0 +1,118 @@ +templateId = $templateId; + $this->apiParas["template_id"] = $templateId; + } + + public function getTemplateId() + { + return $this->templateId; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.template.message.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicTemplateMessageModifyRequest.php b/extend/alipay/aop/request/AlipayMobilePublicTemplateMessageModifyRequest.php new file mode 100644 index 0000000..f41601b --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicTemplateMessageModifyRequest.php @@ -0,0 +1,134 @@ +templateId = $templateId; + $this->apiParas["template_id"] = $templateId; + } + + public function getTemplateId() + { + return $this->templateId; + } + + public function setTradeSetting($tradeSetting) + { + $this->tradeSetting = $tradeSetting; + $this->apiParas["trade_setting"] = $tradeSetting; + } + + public function getTradeSetting() + { + return $this->tradeSetting; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.template.message.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobilePublicTemplateMessageQueryRequest.php b/extend/alipay/aop/request/AlipayMobilePublicTemplateMessageQueryRequest.php new file mode 100644 index 0000000..144ed0a --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobilePublicTemplateMessageQueryRequest.php @@ -0,0 +1,134 @@ +template = $template; + $this->apiParas["template"] = $template; + } + + public function getTemplate() + { + return $this->template; + } + + public function setTemplateId($templateId) + { + $this->templateId = $templateId; + $this->apiParas["template_id"] = $templateId; + } + + public function getTemplateId() + { + return $this->templateId; + } + + public function getApiMethodName() + { + return "alipay.mobile.public.template.message.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobileRecommendGetRequest.php b/extend/alipay/aop/request/AlipayMobileRecommendGetRequest.php new file mode 100644 index 0000000..920baa5 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobileRecommendGetRequest.php @@ -0,0 +1,182 @@ +extInfo = $extInfo; + $this->apiParas["ext_info"] = $extInfo; + } + + public function getExtInfo() + { + return $this->extInfo; + } + + public function setLimit($limit) + { + $this->limit = $limit; + $this->apiParas["limit"] = $limit; + } + + public function getLimit() + { + return $this->limit; + } + + public function setSceneId($sceneId) + { + $this->sceneId = $sceneId; + $this->apiParas["scene_id"] = $sceneId; + } + + public function getSceneId() + { + return $this->sceneId; + } + + public function setStartIdx($startIdx) + { + $this->startIdx = $startIdx; + $this->apiParas["start_idx"] = $startIdx; + } + + public function getStartIdx() + { + return $this->startIdx; + } + + public function setUserId($userId) + { + $this->userId = $userId; + $this->apiParas["user_id"] = $userId; + } + + public function getUserId() + { + return $this->userId; + } + + public function getApiMethodName() + { + return "alipay.mobile.recommend.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobileShakeUserQueryRequest.php b/extend/alipay/aop/request/AlipayMobileShakeUserQueryRequest.php new file mode 100644 index 0000000..4cf0d21 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobileShakeUserQueryRequest.php @@ -0,0 +1,137 @@ +dynamicId = $dynamicId; + $this->apiParas["dynamic_id"] = $dynamicId; + } + + public function getDynamicId() + { + return $this->dynamicId; + } + + public function setDynamicIdType($dynamicIdType) + { + $this->dynamicIdType = $dynamicIdType; + $this->apiParas["dynamic_id_type"] = $dynamicIdType; + } + + public function getDynamicIdType() + { + return $this->dynamicIdType; + } + + public function getApiMethodName() + { + return "alipay.mobile.shake.user.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobileStdPublicAccountQueryRequest.php b/extend/alipay/aop/request/AlipayMobileStdPublicAccountQueryRequest.php new file mode 100644 index 0000000..10906ba --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobileStdPublicAccountQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.std.public.account.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobileStdPublicExpressUserQueryRequest.php b/extend/alipay/aop/request/AlipayMobileStdPublicExpressUserQueryRequest.php new file mode 100644 index 0000000..59b1604 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobileStdPublicExpressUserQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.std.public.express.user.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobileStdPublicFollowListRequest.php b/extend/alipay/aop/request/AlipayMobileStdPublicFollowListRequest.php new file mode 100644 index 0000000..75308c4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobileStdPublicFollowListRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.std.public.follow.list"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobileStdPublicMenuQueryRequest.php b/extend/alipay/aop/request/AlipayMobileStdPublicMenuQueryRequest.php new file mode 100644 index 0000000..ee5efdc --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobileStdPublicMenuQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMobileStdPublicMessageCustomSendRequest.php b/extend/alipay/aop/request/AlipayMobileStdPublicMessageCustomSendRequest.php new file mode 100644 index 0000000..50f5cad --- /dev/null +++ b/extend/alipay/aop/request/AlipayMobileStdPublicMessageCustomSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mobile.std.public.message.custom.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMpointprodBenefitDetailGetRequest.php b/extend/alipay/aop/request/AlipayMpointprodBenefitDetailGetRequest.php new file mode 100644 index 0000000..920524a --- /dev/null +++ b/extend/alipay/aop/request/AlipayMpointprodBenefitDetailGetRequest.php @@ -0,0 +1,122 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.mpointprod.benefit.detail.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMsaasMediarecogVoiceMediaaudioUploadRequest.php b/extend/alipay/aop/request/AlipayMsaasMediarecogVoiceMediaaudioUploadRequest.php new file mode 100644 index 0000000..d68b8ae --- /dev/null +++ b/extend/alipay/aop/request/AlipayMsaasMediarecogVoiceMediaaudioUploadRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.msaas.mediarecog.voice.mediaaudio.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayMsaasPromotionCpainfoCreateRequest.php b/extend/alipay/aop/request/AlipayMsaasPromotionCpainfoCreateRequest.php new file mode 100644 index 0000000..c027917 --- /dev/null +++ b/extend/alipay/aop/request/AlipayMsaasPromotionCpainfoCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.msaas.promotion.cpainfo.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketApplyorderBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketApplyorderBatchqueryRequest.php new file mode 100644 index 0000000..39cdfa6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketApplyorderBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.market.applyorder.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketItemCreateRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketItemCreateRequest.php new file mode 100644 index 0000000..3b72e23 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketItemCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.market.item.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketItemModifyRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketItemModifyRequest.php new file mode 100644 index 0000000..4543a4d --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketItemModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.market.item.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketItemStateRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketItemStateRequest.php new file mode 100644 index 0000000..b57924c --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketItemStateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.market.item.state"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketMcommentQueryRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketMcommentQueryRequest.php new file mode 100644 index 0000000..4def55c --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketMcommentQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.market.mcomment.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketProductBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketProductBatchqueryRequest.php new file mode 100644 index 0000000..4184a8d --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketProductBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.market.product.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketProductQuerydetailRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketProductQuerydetailRequest.php new file mode 100644 index 0000000..a061b00 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketProductQuerydetailRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.market.product.querydetail"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketReporterrorCreateRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketReporterrorCreateRequest.php new file mode 100644 index 0000000..1d8c2c4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketReporterrorCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.market.reporterror.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketShopApplyorderCancelRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketShopApplyorderCancelRequest.php new file mode 100644 index 0000000..61feb59 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketShopApplyorderCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.market.shop.applyorder.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketShopBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketShopBatchqueryRequest.php new file mode 100644 index 0000000..c561505 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketShopBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.market.shop.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketShopCategoryQueryRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketShopCategoryQueryRequest.php new file mode 100644 index 0000000..832f5c8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketShopCategoryQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.market.shop.category.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketShopCreateRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketShopCreateRequest.php new file mode 100644 index 0000000..393a711 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketShopCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.market.shop.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketShopDiscountQueryRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketShopDiscountQueryRequest.php new file mode 100644 index 0000000..1c68d43 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketShopDiscountQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.market.shop.discount.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketShopModifyRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketShopModifyRequest.php new file mode 100644 index 0000000..6b3a017 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketShopModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.market.shop.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketShopPublicBindRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketShopPublicBindRequest.php new file mode 100644 index 0000000..d42aada --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketShopPublicBindRequest.php @@ -0,0 +1,134 @@ +isAll = $isAll; + $this->apiParas["is_all"] = $isAll; + } + + public function getIsAll() + { + return $this->isAll; + } + + public function setShopIds($shopIds) + { + $this->shopIds = $shopIds; + $this->apiParas["shop_ids"] = $shopIds; + } + + public function getShopIds() + { + return $this->shopIds; + } + + public function getApiMethodName() + { + return "alipay.offline.market.shop.public.bind"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketShopPublicUnbindRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketShopPublicUnbindRequest.php new file mode 100644 index 0000000..e7b5e72 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketShopPublicUnbindRequest.php @@ -0,0 +1,134 @@ +isAll = $isAll; + $this->apiParas["is_all"] = $isAll; + } + + public function getIsAll() + { + return $this->isAll; + } + + public function setShopIds($shopIds) + { + $this->shopIds = $shopIds; + $this->apiParas["shop_ids"] = $shopIds; + } + + public function getShopIds() + { + return $this->shopIds; + } + + public function getApiMethodName() + { + return "alipay.offline.market.shop.public.unbind"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketShopQuerydetailRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketShopQuerydetailRequest.php new file mode 100644 index 0000000..ebac6c4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketShopQuerydetailRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.market.shop.querydetail"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketShopSummaryBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketShopSummaryBatchqueryRequest.php new file mode 100644 index 0000000..95510b2 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketShopSummaryBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.market.shop.summary.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketingVoucherCodeUploadRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketingVoucherCodeUploadRequest.php new file mode 100644 index 0000000..e66e456 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketingVoucherCodeUploadRequest.php @@ -0,0 +1,150 @@ +extendParams = $extendParams; + $this->apiParas["extend_params"] = $extendParams; + } + + public function getExtendParams() + { + return $this->extendParams; + } + + public function setFileCharset($fileCharset) + { + $this->fileCharset = $fileCharset; + $this->apiParas["file_charset"] = $fileCharset; + } + + public function getFileCharset() + { + return $this->fileCharset; + } + + public function setFileContent($fileContent) + { + $this->fileContent = $fileContent; + $this->apiParas["file_content"] = $fileContent; + } + + public function getFileContent() + { + return $this->fileContent; + } + + public function getApiMethodName() + { + return "alipay.offline.marketing.voucher.code.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketingVoucherCreateRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketingVoucherCreateRequest.php new file mode 100644 index 0000000..512a9fe --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketingVoucherCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.marketing.voucher.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketingVoucherModifyRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketingVoucherModifyRequest.php new file mode 100644 index 0000000..194ba15 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketingVoucherModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.marketing.voucher.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketingVoucherOfflineRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketingVoucherOfflineRequest.php new file mode 100644 index 0000000..5c31568 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketingVoucherOfflineRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.marketing.voucher.offline"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketingVoucherStatusQueryRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketingVoucherStatusQueryRequest.php new file mode 100644 index 0000000..231dba9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketingVoucherStatusQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.marketing.voucher.status.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMarketingVoucherUseRequest.php b/extend/alipay/aop/request/AlipayOfflineMarketingVoucherUseRequest.php new file mode 100644 index 0000000..ec1e3e1 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMarketingVoucherUseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.marketing.voucher.use"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMaterialImageDownloadRequest.php b/extend/alipay/aop/request/AlipayOfflineMaterialImageDownloadRequest.php new file mode 100644 index 0000000..668276f --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMaterialImageDownloadRequest.php @@ -0,0 +1,118 @@ +imageIds = $imageIds; + $this->apiParas["image_ids"] = $imageIds; + } + + public function getImageIds() + { + return $this->imageIds; + } + + public function getApiMethodName() + { + return "alipay.offline.material.image.download"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineMaterialImageUploadRequest.php b/extend/alipay/aop/request/AlipayOfflineMaterialImageUploadRequest.php new file mode 100644 index 0000000..2317735 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineMaterialImageUploadRequest.php @@ -0,0 +1,166 @@ +imageContent = $imageContent; + $this->apiParas["image_content"] = $imageContent; + } + + public function getImageContent() + { + return $this->imageContent; + } + + public function setImageName($imageName) + { + $this->imageName = $imageName; + $this->apiParas["image_name"] = $imageName; + } + + public function getImageName() + { + return $this->imageName; + } + + public function setImagePid($imagePid) + { + $this->imagePid = $imagePid; + $this->apiParas["image_pid"] = $imagePid; + } + + public function getImagePid() + { + return $this->imagePid; + } + + public function setImageType($imageType) + { + $this->imageType = $imageType; + $this->apiParas["image_type"] = $imageType; + } + + public function getImageType() + { + return $this->imageType; + } + + public function getApiMethodName() + { + return "alipay.offline.material.image.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineProviderDishQueryRequest.php b/extend/alipay/aop/request/AlipayOfflineProviderDishQueryRequest.php new file mode 100644 index 0000000..ef4345c --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineProviderDishQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.provider.dish.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineProviderEquipmentAuthQuerybypageRequest.php b/extend/alipay/aop/request/AlipayOfflineProviderEquipmentAuthQuerybypageRequest.php new file mode 100644 index 0000000..20a357a --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineProviderEquipmentAuthQuerybypageRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.provider.equipment.auth.querybypage"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineProviderEquipmentAuthRemoveRequest.php b/extend/alipay/aop/request/AlipayOfflineProviderEquipmentAuthRemoveRequest.php new file mode 100644 index 0000000..6107d6c --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineProviderEquipmentAuthRemoveRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.provider.equipment.auth.remove"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineProviderMonitorLogSyncRequest.php b/extend/alipay/aop/request/AlipayOfflineProviderMonitorLogSyncRequest.php new file mode 100644 index 0000000..c39ee70 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineProviderMonitorLogSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.provider.monitor.log.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineProviderShopactionRecordRequest.php b/extend/alipay/aop/request/AlipayOfflineProviderShopactionRecordRequest.php new file mode 100644 index 0000000..6249a36 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineProviderShopactionRecordRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.provider.shopaction.record"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOfflineProviderUseractionRecordRequest.php b/extend/alipay/aop/request/AlipayOfflineProviderUseractionRecordRequest.php new file mode 100644 index 0000000..d1854ff --- /dev/null +++ b/extend/alipay/aop/request/AlipayOfflineProviderUseractionRecordRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.offline.provider.useraction.record"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAgentCancelRequest.php b/extend/alipay/aop/request/AlipayOpenAgentCancelRequest.php new file mode 100644 index 0000000..9b99ad5 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAgentCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.agent.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAgentConfirmRequest.php b/extend/alipay/aop/request/AlipayOpenAgentConfirmRequest.php new file mode 100644 index 0000000..475a3cc --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAgentConfirmRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.agent.confirm"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAgentCreateRequest.php b/extend/alipay/aop/request/AlipayOpenAgentCreateRequest.php new file mode 100644 index 0000000..918992c --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAgentCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.agent.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAgentFacetofaceSignRequest.php b/extend/alipay/aop/request/AlipayOpenAgentFacetofaceSignRequest.php new file mode 100644 index 0000000..c468a14 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAgentFacetofaceSignRequest.php @@ -0,0 +1,296 @@ +商家经营类目 中的“经营类目编码” + **/ + private $mccCode; + + /** + * 服务费率(%),0.38~3之间, 特殊行业除外。当签约且授权标识sign_and_auth=true时,该费率信息必填。 + **/ + private $rate; + + /** + * 店铺内景图片,最小5KB,图片格式必须为:png、bmp、gif、jpg、jpeg + **/ + private $shopScenePic; + + /** + * 店铺门头照图片,最小5KB,图片格式必须为:png、bmp、gif、jpg、jpeg + **/ + private $shopSignBoardPic; + + /** + * 签约且授权标识,默认为false,只进行签约操作; 如果设置为true,则表示签约成功后,会自动进行应用授权操作。 + **/ + private $signAndAuth; + + /** + * 企业特殊资质图片,可参考 +商家经营类目 中的“需要的特殊资质证书”,最小5KB,图片格式必须为:png、bmp、gif、jpg、jpeg + **/ + private $specialLicensePic; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBatchNo($batchNo) + { + $this->batchNo = $batchNo; + $this->apiParas["batch_no"] = $batchNo; + } + + public function getBatchNo() + { + return $this->batchNo; + } + + public function setBusinessLicenseAuthPic($businessLicenseAuthPic) + { + $this->businessLicenseAuthPic = $businessLicenseAuthPic; + $this->apiParas["business_license_auth_pic"] = $businessLicenseAuthPic; + } + + public function getBusinessLicenseAuthPic() + { + return $this->businessLicenseAuthPic; + } + + public function setBusinessLicenseNo($businessLicenseNo) + { + $this->businessLicenseNo = $businessLicenseNo; + $this->apiParas["business_license_no"] = $businessLicenseNo; + } + + public function getBusinessLicenseNo() + { + return $this->businessLicenseNo; + } + + public function setBusinessLicensePic($businessLicensePic) + { + $this->businessLicensePic = $businessLicensePic; + $this->apiParas["business_license_pic"] = $businessLicensePic; + } + + public function getBusinessLicensePic() + { + return $this->businessLicensePic; + } + + public function setDateLimitation($dateLimitation) + { + $this->dateLimitation = $dateLimitation; + $this->apiParas["date_limitation"] = $dateLimitation; + } + + public function getDateLimitation() + { + return $this->dateLimitation; + } + + public function setLongTerm($longTerm) + { + $this->longTerm = $longTerm; + $this->apiParas["long_term"] = $longTerm; + } + + public function getLongTerm() + { + return $this->longTerm; + } + + public function setMccCode($mccCode) + { + $this->mccCode = $mccCode; + $this->apiParas["mcc_code"] = $mccCode; + } + + public function getMccCode() + { + return $this->mccCode; + } + + public function setRate($rate) + { + $this->rate = $rate; + $this->apiParas["rate"] = $rate; + } + + public function getRate() + { + return $this->rate; + } + + public function setShopScenePic($shopScenePic) + { + $this->shopScenePic = $shopScenePic; + $this->apiParas["shop_scene_pic"] = $shopScenePic; + } + + public function getShopScenePic() + { + return $this->shopScenePic; + } + + public function setShopSignBoardPic($shopSignBoardPic) + { + $this->shopSignBoardPic = $shopSignBoardPic; + $this->apiParas["shop_sign_board_pic"] = $shopSignBoardPic; + } + + public function getShopSignBoardPic() + { + return $this->shopSignBoardPic; + } + + public function setSignAndAuth($signAndAuth) + { + $this->signAndAuth = $signAndAuth; + $this->apiParas["sign_and_auth"] = $signAndAuth; + } + + public function getSignAndAuth() + { + return $this->signAndAuth; + } + + public function setSpecialLicensePic($specialLicensePic) + { + $this->specialLicensePic = $specialLicensePic; + $this->apiParas["special_license_pic"] = $specialLicensePic; + } + + public function getSpecialLicensePic() + { + return $this->specialLicensePic; + } + + public function getApiMethodName() + { + return "alipay.open.agent.facetoface.sign"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAgentMiniCreateRequest.php b/extend/alipay/aop/request/AlipayOpenAgentMiniCreateRequest.php new file mode 100644 index 0000000..ae7e8d7 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAgentMiniCreateRequest.php @@ -0,0 +1,265 @@ +appCategoryIds = $appCategoryIds; + $this->apiParas["app_category_ids"] = $appCategoryIds; + } + + public function getAppCategoryIds() + { + return $this->appCategoryIds; + } + + public function setAppDesc($appDesc) + { + $this->appDesc = $appDesc; + $this->apiParas["app_desc"] = $appDesc; + } + + public function getAppDesc() + { + return $this->appDesc; + } + + public function setAppEnglishName($appEnglishName) + { + $this->appEnglishName = $appEnglishName; + $this->apiParas["app_english_name"] = $appEnglishName; + } + + public function getAppEnglishName() + { + return $this->appEnglishName; + } + + public function setAppLogo($appLogo) + { + $this->appLogo = $appLogo; + $this->apiParas["app_logo"] = $appLogo; + } + + public function getAppLogo() + { + return $this->appLogo; + } + + public function setAppName($appName) + { + $this->appName = $appName; + $this->apiParas["app_name"] = $appName; + } + + public function getAppName() + { + return $this->appName; + } + + public function setAppSlogan($appSlogan) + { + $this->appSlogan = $appSlogan; + $this->apiParas["app_slogan"] = $appSlogan; + } + + public function getAppSlogan() + { + return $this->appSlogan; + } + + public function setBatchNo($batchNo) + { + $this->batchNo = $batchNo; + $this->apiParas["batch_no"] = $batchNo; + } + + public function getBatchNo() + { + return $this->batchNo; + } + + public function setMiniCategoryIds($miniCategoryIds) + { + $this->miniCategoryIds = $miniCategoryIds; + $this->apiParas["mini_category_ids"] = $miniCategoryIds; + } + + public function getMiniCategoryIds() + { + return $this->miniCategoryIds; + } + + public function setServiceEmail($serviceEmail) + { + $this->serviceEmail = $serviceEmail; + $this->apiParas["service_email"] = $serviceEmail; + } + + public function getServiceEmail() + { + return $this->serviceEmail; + } + + public function setServicePhone($servicePhone) + { + $this->servicePhone = $servicePhone; + $this->apiParas["service_phone"] = $servicePhone; + } + + public function getServicePhone() + { + return $this->servicePhone; + } + + public function getApiMethodName() + { + return "alipay.open.agent.mini.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAgentMobilepaySignRequest.php b/extend/alipay/aop/request/AlipayOpenAgentMobilepaySignRequest.php new file mode 100644 index 0000000..d9b4c17 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAgentMobilepaySignRequest.php @@ -0,0 +1,266 @@ +商家经营类目 中的“经营类目编码” + **/ + private $mccCode; + + /** + * 企业特殊资质图片,可参考 +商家经营类目 中的“需要的特殊资质证书”,最小5KB,图片格式必须为:png、bmp、gif、jpg、jpeg + **/ + private $specialLicensePic; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setAppDemo($appDemo) + { + $this->appDemo = $appDemo; + $this->apiParas["app_demo"] = $appDemo; + } + + public function getAppDemo() + { + return $this->appDemo; + } + + public function setAppName($appName) + { + $this->appName = $appName; + $this->apiParas["app_name"] = $appName; + } + + public function getAppName() + { + return $this->appName; + } + + public function setBatchNo($batchNo) + { + $this->batchNo = $batchNo; + $this->apiParas["batch_no"] = $batchNo; + } + + public function getBatchNo() + { + return $this->batchNo; + } + + public function setBusinessLicenseAuthPic($businessLicenseAuthPic) + { + $this->businessLicenseAuthPic = $businessLicenseAuthPic; + $this->apiParas["business_license_auth_pic"] = $businessLicenseAuthPic; + } + + public function getBusinessLicenseAuthPic() + { + return $this->businessLicenseAuthPic; + } + + public function setBusinessLicenseNo($businessLicenseNo) + { + $this->businessLicenseNo = $businessLicenseNo; + $this->apiParas["business_license_no"] = $businessLicenseNo; + } + + public function getBusinessLicenseNo() + { + return $this->businessLicenseNo; + } + + public function setBusinessLicensePic($businessLicensePic) + { + $this->businessLicensePic = $businessLicensePic; + $this->apiParas["business_license_pic"] = $businessLicensePic; + } + + public function getBusinessLicensePic() + { + return $this->businessLicensePic; + } + + public function setDateLimitation($dateLimitation) + { + $this->dateLimitation = $dateLimitation; + $this->apiParas["date_limitation"] = $dateLimitation; + } + + public function getDateLimitation() + { + return $this->dateLimitation; + } + + public function setLongTerm($longTerm) + { + $this->longTerm = $longTerm; + $this->apiParas["long_term"] = $longTerm; + } + + public function getLongTerm() + { + return $this->longTerm; + } + + public function setMccCode($mccCode) + { + $this->mccCode = $mccCode; + $this->apiParas["mcc_code"] = $mccCode; + } + + public function getMccCode() + { + return $this->mccCode; + } + + public function setSpecialLicensePic($specialLicensePic) + { + $this->specialLicensePic = $specialLicensePic; + $this->apiParas["special_license_pic"] = $specialLicensePic; + } + + public function getSpecialLicensePic() + { + return $this->specialLicensePic; + } + + public function getApiMethodName() + { + return "alipay.open.agent.mobilepay.sign"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAgentOfflinepaymentSignRequest.php b/extend/alipay/aop/request/AlipayOpenAgentOfflinepaymentSignRequest.php new file mode 100644 index 0000000..e5f599a --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAgentOfflinepaymentSignRequest.php @@ -0,0 +1,248 @@ +商家经营类目 中的“经营类目编码” + **/ + private $mccCode; + + /** + * 服务费率(%),0.38~3之间,精确到0.01 + **/ + private $rate; + + /** + * 店铺门头照图片,需要包括招牌信息。最小5KB,图片格式必须为:png、bmp、gif、jpg、jpeg + **/ + private $shopSignBoardPic; + + /** + * 企业特殊资质图片,可参考 +商家经营类目 中的“需要的特殊资质证书”,最小5KB,图片格式必须为:png、bmp、gif、jpg、jpeg + **/ + private $specialLicensePic; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setBatchNo($batchNo) + { + $this->batchNo = $batchNo; + $this->apiParas["batch_no"] = $batchNo; + } + + public function getBatchNo() + { + return $this->batchNo; + } + + public function setBusinessLicenseNo($businessLicenseNo) + { + $this->businessLicenseNo = $businessLicenseNo; + $this->apiParas["business_license_no"] = $businessLicenseNo; + } + + public function getBusinessLicenseNo() + { + return $this->businessLicenseNo; + } + + public function setBusinessLicensePic($businessLicensePic) + { + $this->businessLicensePic = $businessLicensePic; + $this->apiParas["business_license_pic"] = $businessLicensePic; + } + + public function getBusinessLicensePic() + { + return $this->businessLicensePic; + } + + public function setDateLimitation($dateLimitation) + { + $this->dateLimitation = $dateLimitation; + $this->apiParas["date_limitation"] = $dateLimitation; + } + + public function getDateLimitation() + { + return $this->dateLimitation; + } + + public function setLongTerm($longTerm) + { + $this->longTerm = $longTerm; + $this->apiParas["long_term"] = $longTerm; + } + + public function getLongTerm() + { + return $this->longTerm; + } + + public function setMccCode($mccCode) + { + $this->mccCode = $mccCode; + $this->apiParas["mcc_code"] = $mccCode; + } + + public function getMccCode() + { + return $this->mccCode; + } + + public function setRate($rate) + { + $this->rate = $rate; + $this->apiParas["rate"] = $rate; + } + + public function getRate() + { + return $this->rate; + } + + public function setShopSignBoardPic($shopSignBoardPic) + { + $this->shopSignBoardPic = $shopSignBoardPic; + $this->apiParas["shop_sign_board_pic"] = $shopSignBoardPic; + } + + public function getShopSignBoardPic() + { + return $this->shopSignBoardPic; + } + + public function setSpecialLicensePic($specialLicensePic) + { + $this->specialLicensePic = $specialLicensePic; + $this->apiParas["special_license_pic"] = $specialLicensePic; + } + + public function getSpecialLicensePic() + { + return $this->specialLicensePic; + } + + public function getApiMethodName() + { + return "alipay.open.agent.offlinepayment.sign"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAgentOrderQueryRequest.php b/extend/alipay/aop/request/AlipayOpenAgentOrderQueryRequest.php new file mode 100644 index 0000000..36f5195 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAgentOrderQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.agent.order.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAgentSignstatusQueryRequest.php b/extend/alipay/aop/request/AlipayOpenAgentSignstatusQueryRequest.php new file mode 100644 index 0000000..6cb9cec --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAgentSignstatusQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.agent.signstatus.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAgentZhimabriefSignRequest.php b/extend/alipay/aop/request/AlipayOpenAgentZhimabriefSignRequest.php new file mode 100644 index 0000000..3c524ac --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAgentZhimabriefSignRequest.php @@ -0,0 +1,426 @@ +商家经营类目 中的“经营类目编码” + **/ + private $mccCode; + + /** + * 异议处理接口人 + **/ + private $ohContact; + + /** + * 用户服务联动机制接口人 + **/ + private $prContact; + + /** + * 企业特殊资质图片,可参考 +商家经营类目 中的“需要的特殊资质证书”,最小5KB,图片格式必须为:png、bmp、gif、jpg、jpeg + **/ + private $specialLicensePic; + + /** + * 使用场景描述,签约芝麻信用产品的用途,可选值:"现金放贷","其他", "消费分期(例如买房、装修等)", "融资租赁", "发放信用卡", "极速返利", "押金减免", "先用后付", "社交场景信用互查", "会员分层信用参考" + **/ + private $usageScene; + + /** + * 接入网址信息(1 app_name、app_demo;2 web_sites;3 alipay_life_name;4 wechat_official_account_name。1、2、3、4至少选择一个填写) + **/ + private $webSites; + + /** + * 微信公众号名称(1 app_name、app_demo;2 web_sites;3 alipay_life_name;4 wechat_official_account_name。1、2、3、4至少选择一个填写) + **/ + private $wechatOfficialAccountName; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setAlipayLifeName($alipayLifeName) + { + $this->alipayLifeName = $alipayLifeName; + $this->apiParas["alipay_life_name"] = $alipayLifeName; + } + + public function getAlipayLifeName() + { + return $this->alipayLifeName; + } + + public function setAppDemo($appDemo) + { + $this->appDemo = $appDemo; + $this->apiParas["app_demo"] = $appDemo; + } + + public function getAppDemo() + { + return $this->appDemo; + } + + public function setAppName($appName) + { + $this->appName = $appName; + $this->apiParas["app_name"] = $appName; + } + + public function getAppName() + { + return $this->appName; + } + + public function setBatchNo($batchNo) + { + $this->batchNo = $batchNo; + $this->apiParas["batch_no"] = $batchNo; + } + + public function getBatchNo() + { + return $this->batchNo; + } + + public function setBusinessLicenseAuthPic($businessLicenseAuthPic) + { + $this->businessLicenseAuthPic = $businessLicenseAuthPic; + $this->apiParas["business_license_auth_pic"] = $businessLicenseAuthPic; + } + + public function getBusinessLicenseAuthPic() + { + return $this->businessLicenseAuthPic; + } + + public function setBusinessLicenseNo($businessLicenseNo) + { + $this->businessLicenseNo = $businessLicenseNo; + $this->apiParas["business_license_no"] = $businessLicenseNo; + } + + public function getBusinessLicenseNo() + { + return $this->businessLicenseNo; + } + + public function setBusinessLicensePic($businessLicensePic) + { + $this->businessLicensePic = $businessLicensePic; + $this->apiParas["business_license_pic"] = $businessLicensePic; + } + + public function getBusinessLicensePic() + { + return $this->businessLicensePic; + } + + public function setCustomUsageScene($customUsageScene) + { + $this->customUsageScene = $customUsageScene; + $this->apiParas["custom_usage_scene"] = $customUsageScene; + } + + public function getCustomUsageScene() + { + return $this->customUsageScene; + } + + public function setDateLimitation($dateLimitation) + { + $this->dateLimitation = $dateLimitation; + $this->apiParas["date_limitation"] = $dateLimitation; + } + + public function getDateLimitation() + { + return $this->dateLimitation; + } + + public function setDrContact($drContact) + { + $this->drContact = $drContact; + $this->apiParas["dr_contact"] = $drContact; + } + + public function getDrContact() + { + return $this->drContact; + } + + public function setEnterpriseAlias($enterpriseAlias) + { + $this->enterpriseAlias = $enterpriseAlias; + $this->apiParas["enterprise_alias"] = $enterpriseAlias; + } + + public function getEnterpriseAlias() + { + return $this->enterpriseAlias; + } + + public function setEnterpriseLogo($enterpriseLogo) + { + $this->enterpriseLogo = $enterpriseLogo; + $this->apiParas["enterprise_logo"] = $enterpriseLogo; + } + + public function getEnterpriseLogo() + { + return $this->enterpriseLogo; + } + + public function setLongTerm($longTerm) + { + $this->longTerm = $longTerm; + $this->apiParas["long_term"] = $longTerm; + } + + public function getLongTerm() + { + return $this->longTerm; + } + + public function setMccCode($mccCode) + { + $this->mccCode = $mccCode; + $this->apiParas["mcc_code"] = $mccCode; + } + + public function getMccCode() + { + return $this->mccCode; + } + + public function setOhContact($ohContact) + { + $this->ohContact = $ohContact; + $this->apiParas["oh_contact"] = $ohContact; + } + + public function getOhContact() + { + return $this->ohContact; + } + + public function setPrContact($prContact) + { + $this->prContact = $prContact; + $this->apiParas["pr_contact"] = $prContact; + } + + public function getPrContact() + { + return $this->prContact; + } + + public function setSpecialLicensePic($specialLicensePic) + { + $this->specialLicensePic = $specialLicensePic; + $this->apiParas["special_license_pic"] = $specialLicensePic; + } + + public function getSpecialLicensePic() + { + return $this->specialLicensePic; + } + + public function setUsageScene($usageScene) + { + $this->usageScene = $usageScene; + $this->apiParas["usage_scene"] = $usageScene; + } + + public function getUsageScene() + { + return $this->usageScene; + } + + public function setWebSites($webSites) + { + $this->webSites = $webSites; + $this->apiParas["web_sites"] = $webSites; + } + + public function getWebSites() + { + return $this->webSites; + } + + public function setWechatOfficialAccountName($wechatOfficialAccountName) + { + $this->wechatOfficialAccountName = $wechatOfficialAccountName; + $this->apiParas["wechat_official_account_name"] = $wechatOfficialAccountName; + } + + public function getWechatOfficialAccountName() + { + return $this->wechatOfficialAccountName; + } + + public function getApiMethodName() + { + return "alipay.open.agent.zhimabrief.sign"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppAlipaycertDownloadRequest.php b/extend/alipay/aop/request/AlipayOpenAppAlipaycertDownloadRequest.php new file mode 100644 index 0000000..fd3963e --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppAlipaycertDownloadRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.alipaycert.download"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppAppcontentFunctionCreateRequest.php b/extend/alipay/aop/request/AlipayOpenAppAppcontentFunctionCreateRequest.php new file mode 100644 index 0000000..4e277f1 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppAppcontentFunctionCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.appcontent.function.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppAppcontentFunctionModifyRequest.php b/extend/alipay/aop/request/AlipayOpenAppAppcontentFunctionModifyRequest.php new file mode 100644 index 0000000..abcafba --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppAppcontentFunctionModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.appcontent.function.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppAppcontentFunctionOfflineRequest.php b/extend/alipay/aop/request/AlipayOpenAppAppcontentFunctionOfflineRequest.php new file mode 100644 index 0000000..672361f --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppAppcontentFunctionOfflineRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.appcontent.function.offline"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppAppcontentFunctionQueryRequest.php b/extend/alipay/aop/request/AlipayOpenAppAppcontentFunctionQueryRequest.php new file mode 100644 index 0000000..d99c2bd --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppAppcontentFunctionQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.appcontent.function.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppAppcontentItemBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenAppAppcontentItemBatchqueryRequest.php new file mode 100644 index 0000000..233f251 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppAppcontentItemBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.appcontent.item.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppAppcontentItemCreateRequest.php b/extend/alipay/aop/request/AlipayOpenAppAppcontentItemCreateRequest.php new file mode 100644 index 0000000..574aa83 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppAppcontentItemCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.appcontent.item.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppAppcontentItemDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenAppAppcontentItemDeleteRequest.php new file mode 100644 index 0000000..fc2641b --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppAppcontentItemDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.appcontent.item.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppAppcontentItemModifyRequest.php b/extend/alipay/aop/request/AlipayOpenAppAppcontentItemModifyRequest.php new file mode 100644 index 0000000..70f87cd --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppAppcontentItemModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.appcontent.item.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppAppcontentItemQueryRequest.php b/extend/alipay/aop/request/AlipayOpenAppAppcontentItemQueryRequest.php new file mode 100644 index 0000000..0328cca --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppAppcontentItemQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.appcontent.item.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppCallQueryRequest.php b/extend/alipay/aop/request/AlipayOpenAppCallQueryRequest.php new file mode 100644 index 0000000..d517a24 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppCallQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppCodetesttestRequest.php b/extend/alipay/aop/request/AlipayOpenAppCodetesttestRequest.php new file mode 100644 index 0000000..9f6ee70 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppCodetesttestRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.codetesttest"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppDedfDdQueryRequest.php b/extend/alipay/aop/request/AlipayOpenAppDedfDdQueryRequest.php new file mode 100644 index 0000000..a1362b3 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppDedfDdQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.dedf.dd.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppDfsfasDeQueryRequest.php b/extend/alipay/aop/request/AlipayOpenAppDfsfasDeQueryRequest.php new file mode 100644 index 0000000..a272dee --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppDfsfasDeQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.dfsfas.de.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppLingbalingliuQueryRequest.php b/extend/alipay/aop/request/AlipayOpenAppLingbalingliuQueryRequest.php new file mode 100644 index 0000000..b426dca --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppLingbalingliuQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.lingbalingliu.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppLingjiuyisiCreateRequest.php b/extend/alipay/aop/request/AlipayOpenAppLingjiuyisiCreateRequest.php new file mode 100644 index 0000000..5dc8a21 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppLingjiuyisiCreateRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppLingjiuyiwuBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenAppLingjiuyiwuBatchqueryRequest.php new file mode 100644 index 0000000..8652cfa --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppLingjiuyiwuBatchqueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppMembersCreateRequest.php b/extend/alipay/aop/request/AlipayOpenAppMembersCreateRequest.php new file mode 100644 index 0000000..7531ac0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppMembersCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.members.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppMembersDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenAppMembersDeleteRequest.php new file mode 100644 index 0000000..c30abab --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppMembersDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.members.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppMembersQueryRequest.php b/extend/alipay/aop/request/AlipayOpenAppMembersQueryRequest.php new file mode 100644 index 0000000..d0934b8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppMembersQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.members.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppMessageSubscriptionModifyRequest.php b/extend/alipay/aop/request/AlipayOpenAppMessageSubscriptionModifyRequest.php new file mode 100644 index 0000000..22fe19d --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppMessageSubscriptionModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.message.subscription.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppMessageSubscriptionQueryRequest.php b/extend/alipay/aop/request/AlipayOpenAppMessageSubscriptionQueryRequest.php new file mode 100644 index 0000000..251adc6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppMessageSubscriptionQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.message.subscription.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppMessageTopicSubscribeRequest.php b/extend/alipay/aop/request/AlipayOpenAppMessageTopicSubscribeRequest.php new file mode 100644 index 0000000..0ce75a9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppMessageTopicSubscribeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.message.topic.subscribe"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppMessageTopicUnsubscribeRequest.php b/extend/alipay/aop/request/AlipayOpenAppMessageTopicUnsubscribeRequest.php new file mode 100644 index 0000000..45e218a --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppMessageTopicUnsubscribeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.message.topic.unsubscribe"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppMiniTemplatemessageSendRequest.php b/extend/alipay/aop/request/AlipayOpenAppMiniTemplatemessageSendRequest.php new file mode 100644 index 0000000..45521a1 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppMiniTemplatemessageSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.mini.templatemessage.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppNotifyModifyRequest.php b/extend/alipay/aop/request/AlipayOpenAppNotifyModifyRequest.php new file mode 100644 index 0000000..6c9f41b --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppNotifyModifyRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppNotifyVerifyRequest.php b/extend/alipay/aop/request/AlipayOpenAppNotifyVerifyRequest.php new file mode 100644 index 0000000..e9876a0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppNotifyVerifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.notify.verify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppOpenbizmockApisdkgrayQueryRequest.php b/extend/alipay/aop/request/AlipayOpenAppOpenbizmockApisdkgrayQueryRequest.php new file mode 100644 index 0000000..1d6ed2d --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppOpenbizmockApisdkgrayQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.openbizmock.apisdkgray.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppOpenbizmockMessageSendRequest.php b/extend/alipay/aop/request/AlipayOpenAppOpenbizmockMessageSendRequest.php new file mode 100644 index 0000000..8dba249 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppOpenbizmockMessageSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.openbizmock.message.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppOpenbizmockOpenidnonstandQueryRequest.php b/extend/alipay/aop/request/AlipayOpenAppOpenbizmockOpenidnonstandQueryRequest.php new file mode 100644 index 0000000..41d85ff --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppOpenbizmockOpenidnonstandQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.openbizmock.openidnonstand.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppQrcodeCreateRequest.php b/extend/alipay/aop/request/AlipayOpenAppQrcodeCreateRequest.php new file mode 100644 index 0000000..8b92538 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppQrcodeCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.qrcode.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppSmgMsgSendRequest.php b/extend/alipay/aop/request/AlipayOpenAppSmgMsgSendRequest.php new file mode 100644 index 0000000..0438b61 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppSmgMsgSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.smg.msg.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppSmsgDataSyncRequest.php b/extend/alipay/aop/request/AlipayOpenAppSmsgDataSyncRequest.php new file mode 100644 index 0000000..6c865a4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppSmsgDataSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.smsg.data.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppSystemNewcontextupiduoidTransferRequest.php b/extend/alipay/aop/request/AlipayOpenAppSystemNewcontextupiduoidTransferRequest.php new file mode 100644 index 0000000..3f9190d --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppSystemNewcontextupiduoidTransferRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.system.newcontextupiduoid.transfer"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppUpdattestBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenAppUpdattestBatchqueryRequest.php new file mode 100644 index 0000000..13e5202 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppUpdattestBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.updattest.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppXwbtestabcQueryRequest.php b/extend/alipay/aop/request/AlipayOpenAppXwbtestabcQueryRequest.php new file mode 100644 index 0000000..4f9ef83 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppXwbtestabcQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.xwbtestabc.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppYiyiyiwuQueryRequest.php b/extend/alipay/aop/request/AlipayOpenAppYiyiyiwuQueryRequest.php new file mode 100644 index 0000000..62ba9ef --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppYiyiyiwuQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.yiyiyiwu.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAppYufanlingsanyaowuYufalingsanyaowuQueryRequest.php b/extend/alipay/aop/request/AlipayOpenAppYufanlingsanyaowuYufalingsanyaowuQueryRequest.php new file mode 100644 index 0000000..552af5f --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAppYufanlingsanyaowuYufalingsanyaowuQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.app.yufanlingsanyaowu.yufalingsanyaowu.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAuthAppAesGetRequest.php b/extend/alipay/aop/request/AlipayOpenAuthAppAesGetRequest.php new file mode 100644 index 0000000..d3893f2 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAuthAppAesGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.auth.app.aes.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAuthAppAesSetRequest.php b/extend/alipay/aop/request/AlipayOpenAuthAppAesSetRequest.php new file mode 100644 index 0000000..13cb5b6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAuthAppAesSetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.auth.app.aes.set"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAuthIndustryPlatformCreateTokenRequest.php b/extend/alipay/aop/request/AlipayOpenAuthIndustryPlatformCreateTokenRequest.php new file mode 100644 index 0000000..3ed191a --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAuthIndustryPlatformCreateTokenRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.auth.industry.platform.create.token"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAuthTokenAppQueryRequest.php b/extend/alipay/aop/request/AlipayOpenAuthTokenAppQueryRequest.php new file mode 100644 index 0000000..aaf38de --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAuthTokenAppQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.auth.token.app.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenAuthTokenAppRequest.php b/extend/alipay/aop/request/AlipayOpenAuthTokenAppRequest.php new file mode 100644 index 0000000..eaeabbd --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenAuthTokenAppRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.auth.token.app"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenBizCreateRequest.php b/extend/alipay/aop/request/AlipayOpenBizCreateRequest.php new file mode 100644 index 0000000..1191e00 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenBizCreateRequest.php @@ -0,0 +1,166 @@ +a = $a; + $this->apiParas["a"] = $a; + } + + public function getA() + { + return $this->a; + } + + public function setB($b) + { + $this->b = $b; + $this->apiParas["b"] = $b; + } + + public function getB() + { + return $this->b; + } + + public function setDe($de) + { + $this->de = $de; + $this->apiParas["de"] = $de; + } + + public function getDe() + { + return $this->de; + } + + public function setStringbuff($stringbuff) + { + $this->stringbuff = $stringbuff; + $this->apiParas["stringbuff"] = $stringbuff; + } + + public function getStringbuff() + { + return $this->stringbuff; + } + + public function getApiMethodName() + { + return "alipay.open.biz.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenDafBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenDafBatchqueryRequest.php new file mode 100644 index 0000000..acb4464 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenDafBatchqueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenEchoOfflineSendRequest.php b/extend/alipay/aop/request/AlipayOpenEchoOfflineSendRequest.php new file mode 100644 index 0000000..20c6cea --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenEchoOfflineSendRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenInviteOrderCreateRequest.php b/extend/alipay/aop/request/AlipayOpenInviteOrderCreateRequest.php new file mode 100644 index 0000000..d6037dd --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenInviteOrderCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.invite.order.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenInviteOrderQueryRequest.php b/extend/alipay/aop/request/AlipayOpenInviteOrderQueryRequest.php new file mode 100644 index 0000000..873633b --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenInviteOrderQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.invite.order.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMessagetestCesSendRequest.php b/extend/alipay/aop/request/AlipayOpenMessagetestCesSendRequest.php new file mode 100644 index 0000000..a4c8962 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMessagetestCesSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.messagetest.ces.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniBaseinfoModifyRequest.php b/extend/alipay/aop/request/AlipayOpenMiniBaseinfoModifyRequest.php new file mode 100644 index 0000000..a2041ec --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniBaseinfoModifyRequest.php @@ -0,0 +1,246 @@ +appCategoryIds = $appCategoryIds; + $this->apiParas["app_category_ids"] = $appCategoryIds; + } + + public function getAppCategoryIds() + { + return $this->appCategoryIds; + } + + public function setAppDesc($appDesc) + { + $this->appDesc = $appDesc; + $this->apiParas["app_desc"] = $appDesc; + } + + public function getAppDesc() + { + return $this->appDesc; + } + + public function setAppEnglishName($appEnglishName) + { + $this->appEnglishName = $appEnglishName; + $this->apiParas["app_english_name"] = $appEnglishName; + } + + public function getAppEnglishName() + { + return $this->appEnglishName; + } + + public function setAppLogo($appLogo) + { + $this->appLogo = $appLogo; + $this->apiParas["app_logo"] = $appLogo; + } + + public function getAppLogo() + { + return $this->appLogo; + } + + public function setAppName($appName) + { + $this->appName = $appName; + $this->apiParas["app_name"] = $appName; + } + + public function getAppName() + { + return $this->appName; + } + + public function setAppSlogan($appSlogan) + { + $this->appSlogan = $appSlogan; + $this->apiParas["app_slogan"] = $appSlogan; + } + + public function getAppSlogan() + { + return $this->appSlogan; + } + + public function setMiniCategoryIds($miniCategoryIds) + { + $this->miniCategoryIds = $miniCategoryIds; + $this->apiParas["mini_category_ids"] = $miniCategoryIds; + } + + public function getMiniCategoryIds() + { + return $this->miniCategoryIds; + } + + public function setServiceEmail($serviceEmail) + { + $this->serviceEmail = $serviceEmail; + $this->apiParas["service_email"] = $serviceEmail; + } + + public function getServiceEmail() + { + return $this->serviceEmail; + } + + public function setServicePhone($servicePhone) + { + $this->servicePhone = $servicePhone; + $this->apiParas["service_phone"] = $servicePhone; + } + + public function getServicePhone() + { + return $this->servicePhone; + } + + public function getApiMethodName() + { + return "alipay.open.mini.baseinfo.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniBaseinfoQueryRequest.php b/extend/alipay/aop/request/AlipayOpenMiniBaseinfoQueryRequest.php new file mode 100644 index 0000000..114697d --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniBaseinfoQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniBizdataTemplatemessageDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenMiniBizdataTemplatemessageDeleteRequest.php new file mode 100644 index 0000000..5150143 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniBizdataTemplatemessageDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.bizdata.templatemessage.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniBizdataTemplatemessageUploadRequest.php b/extend/alipay/aop/request/AlipayOpenMiniBizdataTemplatemessageUploadRequest.php new file mode 100644 index 0000000..5c7c337 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniBizdataTemplatemessageUploadRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.bizdata.templatemessage.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniCategoryQueryRequest.php b/extend/alipay/aop/request/AlipayOpenMiniCategoryQueryRequest.php new file mode 100644 index 0000000..a0d8556 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniCategoryQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.category.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniContentSyncRequest.php b/extend/alipay/aop/request/AlipayOpenMiniContentSyncRequest.php new file mode 100644 index 0000000..ac64a94 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniContentSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.content.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniDataVisitQueryRequest.php b/extend/alipay/aop/request/AlipayOpenMiniDataVisitQueryRequest.php new file mode 100644 index 0000000..bc6b94f --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniDataVisitQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.data.visit.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniExperienceCancelRequest.php b/extend/alipay/aop/request/AlipayOpenMiniExperienceCancelRequest.php new file mode 100644 index 0000000..df5efd9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniExperienceCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.experience.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniExperienceCreateRequest.php b/extend/alipay/aop/request/AlipayOpenMiniExperienceCreateRequest.php new file mode 100644 index 0000000..6231edf --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniExperienceCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.experience.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniExperienceQueryRequest.php b/extend/alipay/aop/request/AlipayOpenMiniExperienceQueryRequest.php new file mode 100644 index 0000000..13f3408 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniExperienceQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.experience.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniIndividualBusinessCertifyRequest.php b/extend/alipay/aop/request/AlipayOpenMiniIndividualBusinessCertifyRequest.php new file mode 100644 index 0000000..c47d59f --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniIndividualBusinessCertifyRequest.php @@ -0,0 +1,134 @@ +licenseNo = $licenseNo; + $this->apiParas["license_no"] = $licenseNo; + } + + public function getLicenseNo() + { + return $this->licenseNo; + } + + public function setLicensePic($licensePic) + { + $this->licensePic = $licensePic; + $this->apiParas["license_pic"] = $licensePic; + } + + public function getLicensePic() + { + return $this->licensePic; + } + + public function getApiMethodName() + { + return "alipay.open.mini.individual.business.certify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniItemBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenMiniItemBatchqueryRequest.php new file mode 100644 index 0000000..7810d21 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniItemBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.item.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniItemPageQueryRequest.php b/extend/alipay/aop/request/AlipayOpenMiniItemPageQueryRequest.php new file mode 100644 index 0000000..73eabbc --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniItemPageQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.item.page.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniMiniappServiceconfigModifyRequest.php b/extend/alipay/aop/request/AlipayOpenMiniMiniappServiceconfigModifyRequest.php new file mode 100644 index 0000000..350b274 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniMiniappServiceconfigModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.miniapp.serviceconfig.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniQrcodeBindRequest.php b/extend/alipay/aop/request/AlipayOpenMiniQrcodeBindRequest.php new file mode 100644 index 0000000..88b1425 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniQrcodeBindRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.qrcode.bind"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniQrcodeUnbindRequest.php b/extend/alipay/aop/request/AlipayOpenMiniQrcodeUnbindRequest.php new file mode 100644 index 0000000..d024088 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniQrcodeUnbindRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.qrcode.unbind"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniReleaststBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenMiniReleaststBatchqueryRequest.php new file mode 100644 index 0000000..2fbbf93 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniReleaststBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.releastst.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniSafedomainCreateRequest.php b/extend/alipay/aop/request/AlipayOpenMiniSafedomainCreateRequest.php new file mode 100644 index 0000000..b69e1fe --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniSafedomainCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.safedomain.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniSafedomainDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenMiniSafedomainDeleteRequest.php new file mode 100644 index 0000000..d64342d --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniSafedomainDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.safedomain.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniTemplateUsageQueryRequest.php b/extend/alipay/aop/request/AlipayOpenMiniTemplateUsageQueryRequest.php new file mode 100644 index 0000000..e6aa282 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniTemplateUsageQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.template.usage.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniTemplatemessageUsertemplateApplyRequest.php b/extend/alipay/aop/request/AlipayOpenMiniTemplatemessageUsertemplateApplyRequest.php new file mode 100644 index 0000000..38a48f9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniTemplatemessageUsertemplateApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.templatemessage.usertemplate.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniTinyappExistQueryRequest.php b/extend/alipay/aop/request/AlipayOpenMiniTinyappExistQueryRequest.php new file mode 100644 index 0000000..46a079c --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniTinyappExistQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.tinyapp.exist.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniVersionAuditApplyRequest.php b/extend/alipay/aop/request/AlipayOpenMiniVersionAuditApplyRequest.php new file mode 100644 index 0000000..177517d --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniVersionAuditApplyRequest.php @@ -0,0 +1,670 @@ +appCategoryIds = $appCategoryIds; + $this->apiParas["app_category_ids"] = $appCategoryIds; + } + + public function getAppCategoryIds() + { + return $this->appCategoryIds; + } + + public function setAppDesc($appDesc) + { + $this->appDesc = $appDesc; + $this->apiParas["app_desc"] = $appDesc; + } + + public function getAppDesc() + { + return $this->appDesc; + } + + public function setAppEnglishName($appEnglishName) + { + $this->appEnglishName = $appEnglishName; + $this->apiParas["app_english_name"] = $appEnglishName; + } + + public function getAppEnglishName() + { + return $this->appEnglishName; + } + + public function setAppLogo($appLogo) + { + $this->appLogo = $appLogo; + $this->apiParas["app_logo"] = $appLogo; + } + + public function getAppLogo() + { + return $this->appLogo; + } + + public function setAppName($appName) + { + $this->appName = $appName; + $this->apiParas["app_name"] = $appName; + } + + public function getAppName() + { + return $this->appName; + } + + public function setAppSlogan($appSlogan) + { + $this->appSlogan = $appSlogan; + $this->apiParas["app_slogan"] = $appSlogan; + } + + public function getAppSlogan() + { + return $this->appSlogan; + } + + public function setAppVersion($appVersion) + { + $this->appVersion = $appVersion; + $this->apiParas["app_version"] = $appVersion; + } + + public function getAppVersion() + { + return $this->appVersion; + } + + public function setBundleId($bundleId) + { + $this->bundleId = $bundleId; + $this->apiParas["bundle_id"] = $bundleId; + } + + public function getBundleId() + { + return $this->bundleId; + } + + public function setFifthLicensePic($fifthLicensePic) + { + $this->fifthLicensePic = $fifthLicensePic; + $this->apiParas["fifth_license_pic"] = $fifthLicensePic; + } + + public function getFifthLicensePic() + { + return $this->fifthLicensePic; + } + + public function setFifthScreenShot($fifthScreenShot) + { + $this->fifthScreenShot = $fifthScreenShot; + $this->apiParas["fifth_screen_shot"] = $fifthScreenShot; + } + + public function getFifthScreenShot() + { + return $this->fifthScreenShot; + } + + public function setFirstLicensePic($firstLicensePic) + { + $this->firstLicensePic = $firstLicensePic; + $this->apiParas["first_license_pic"] = $firstLicensePic; + } + + public function getFirstLicensePic() + { + return $this->firstLicensePic; + } + + public function setFirstScreenShot($firstScreenShot) + { + $this->firstScreenShot = $firstScreenShot; + $this->apiParas["first_screen_shot"] = $firstScreenShot; + } + + public function getFirstScreenShot() + { + return $this->firstScreenShot; + } + + public function setFirstSpecialLicensePic($firstSpecialLicensePic) + { + $this->firstSpecialLicensePic = $firstSpecialLicensePic; + $this->apiParas["first_special_license_pic"] = $firstSpecialLicensePic; + } + + public function getFirstSpecialLicensePic() + { + return $this->firstSpecialLicensePic; + } + + public function setFourthLicensePic($fourthLicensePic) + { + $this->fourthLicensePic = $fourthLicensePic; + $this->apiParas["fourth_license_pic"] = $fourthLicensePic; + } + + public function getFourthLicensePic() + { + return $this->fourthLicensePic; + } + + public function setFourthScreenShot($fourthScreenShot) + { + $this->fourthScreenShot = $fourthScreenShot; + $this->apiParas["fourth_screen_shot"] = $fourthScreenShot; + } + + public function getFourthScreenShot() + { + return $this->fourthScreenShot; + } + + public function setLicenseName($licenseName) + { + $this->licenseName = $licenseName; + $this->apiParas["license_name"] = $licenseName; + } + + public function getLicenseName() + { + return $this->licenseName; + } + + public function setLicenseNo($licenseNo) + { + $this->licenseNo = $licenseNo; + $this->apiParas["license_no"] = $licenseNo; + } + + public function getLicenseNo() + { + return $this->licenseNo; + } + + public function setLicenseValidDate($licenseValidDate) + { + $this->licenseValidDate = $licenseValidDate; + $this->apiParas["license_valid_date"] = $licenseValidDate; + } + + public function getLicenseValidDate() + { + return $this->licenseValidDate; + } + + public function setMemo($memo) + { + $this->memo = $memo; + $this->apiParas["memo"] = $memo; + } + + public function getMemo() + { + return $this->memo; + } + + public function setMiniCategoryIds($miniCategoryIds) + { + $this->miniCategoryIds = $miniCategoryIds; + $this->apiParas["mini_category_ids"] = $miniCategoryIds; + } + + public function getMiniCategoryIds() + { + return $this->miniCategoryIds; + } + + public function setOutDoorPic($outDoorPic) + { + $this->outDoorPic = $outDoorPic; + $this->apiParas["out_door_pic"] = $outDoorPic; + } + + public function getOutDoorPic() + { + return $this->outDoorPic; + } + + public function setRegionType($regionType) + { + $this->regionType = $regionType; + $this->apiParas["region_type"] = $regionType; + } + + public function getRegionType() + { + return $this->regionType; + } + + public function setSecondLicensePic($secondLicensePic) + { + $this->secondLicensePic = $secondLicensePic; + $this->apiParas["second_license_pic"] = $secondLicensePic; + } + + public function getSecondLicensePic() + { + return $this->secondLicensePic; + } + + public function setSecondScreenShot($secondScreenShot) + { + $this->secondScreenShot = $secondScreenShot; + $this->apiParas["second_screen_shot"] = $secondScreenShot; + } + + public function getSecondScreenShot() + { + return $this->secondScreenShot; + } + + public function setSecondSpecialLicensePic($secondSpecialLicensePic) + { + $this->secondSpecialLicensePic = $secondSpecialLicensePic; + $this->apiParas["second_special_license_pic"] = $secondSpecialLicensePic; + } + + public function getSecondSpecialLicensePic() + { + return $this->secondSpecialLicensePic; + } + + public function setServiceEmail($serviceEmail) + { + $this->serviceEmail = $serviceEmail; + $this->apiParas["service_email"] = $serviceEmail; + } + + public function getServiceEmail() + { + return $this->serviceEmail; + } + + public function setServicePhone($servicePhone) + { + $this->servicePhone = $servicePhone; + $this->apiParas["service_phone"] = $servicePhone; + } + + public function getServicePhone() + { + return $this->servicePhone; + } + + public function setServiceRegionInfo($serviceRegionInfo) + { + $this->serviceRegionInfo = $serviceRegionInfo; + $this->apiParas["service_region_info"] = $serviceRegionInfo; + } + + public function getServiceRegionInfo() + { + return $this->serviceRegionInfo; + } + + public function setTestAccout($testAccout) + { + $this->testAccout = $testAccout; + $this->apiParas["test_accout"] = $testAccout; + } + + public function getTestAccout() + { + return $this->testAccout; + } + + public function setTestFileName($testFileName) + { + $this->testFileName = $testFileName; + $this->apiParas["test_file_name"] = $testFileName; + } + + public function getTestFileName() + { + return $this->testFileName; + } + + public function setTestPassword($testPassword) + { + $this->testPassword = $testPassword; + $this->apiParas["test_password"] = $testPassword; + } + + public function getTestPassword() + { + return $this->testPassword; + } + + public function setThirdLicensePic($thirdLicensePic) + { + $this->thirdLicensePic = $thirdLicensePic; + $this->apiParas["third_license_pic"] = $thirdLicensePic; + } + + public function getThirdLicensePic() + { + return $this->thirdLicensePic; + } + + public function setThirdScreenShot($thirdScreenShot) + { + $this->thirdScreenShot = $thirdScreenShot; + $this->apiParas["third_screen_shot"] = $thirdScreenShot; + } + + public function getThirdScreenShot() + { + return $this->thirdScreenShot; + } + + public function setThirdSpecialLicensePic($thirdSpecialLicensePic) + { + $this->thirdSpecialLicensePic = $thirdSpecialLicensePic; + $this->apiParas["third_special_license_pic"] = $thirdSpecialLicensePic; + } + + public function getThirdSpecialLicensePic() + { + return $this->thirdSpecialLicensePic; + } + + public function setVersionDesc($versionDesc) + { + $this->versionDesc = $versionDesc; + $this->apiParas["version_desc"] = $versionDesc; + } + + public function getVersionDesc() + { + return $this->versionDesc; + } + + public function getApiMethodName() + { + return "alipay.open.mini.version.audit.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniVersionAuditCancelRequest.php b/extend/alipay/aop/request/AlipayOpenMiniVersionAuditCancelRequest.php new file mode 100644 index 0000000..1fc60bc --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniVersionAuditCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.version.audit.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniVersionAuditedCancelRequest.php b/extend/alipay/aop/request/AlipayOpenMiniVersionAuditedCancelRequest.php new file mode 100644 index 0000000..4b897cd --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniVersionAuditedCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.version.audited.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniVersionBuildQueryRequest.php b/extend/alipay/aop/request/AlipayOpenMiniVersionBuildQueryRequest.php new file mode 100644 index 0000000..ddabfe8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniVersionBuildQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.version.build.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniVersionDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenMiniVersionDeleteRequest.php new file mode 100644 index 0000000..0c65624 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniVersionDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.version.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniVersionDetailQueryRequest.php b/extend/alipay/aop/request/AlipayOpenMiniVersionDetailQueryRequest.php new file mode 100644 index 0000000..d96c837 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniVersionDetailQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.version.detail.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniVersionGrayCancelRequest.php b/extend/alipay/aop/request/AlipayOpenMiniVersionGrayCancelRequest.php new file mode 100644 index 0000000..000d92f --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniVersionGrayCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.version.gray.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniVersionGrayOnlineRequest.php b/extend/alipay/aop/request/AlipayOpenMiniVersionGrayOnlineRequest.php new file mode 100644 index 0000000..89a9f35 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniVersionGrayOnlineRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.version.gray.online"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniVersionListQueryRequest.php b/extend/alipay/aop/request/AlipayOpenMiniVersionListQueryRequest.php new file mode 100644 index 0000000..6a08957 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniVersionListQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniVersionOfflineRequest.php b/extend/alipay/aop/request/AlipayOpenMiniVersionOfflineRequest.php new file mode 100644 index 0000000..4d374fc --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniVersionOfflineRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.version.offline"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniVersionOnlineRequest.php b/extend/alipay/aop/request/AlipayOpenMiniVersionOnlineRequest.php new file mode 100644 index 0000000..8ce8545 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniVersionOnlineRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.version.online"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniVersionRollbackRequest.php b/extend/alipay/aop/request/AlipayOpenMiniVersionRollbackRequest.php new file mode 100644 index 0000000..3deb100 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniVersionRollbackRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.version.rollback"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenMiniVersionUploadRequest.php b/extend/alipay/aop/request/AlipayOpenMiniVersionUploadRequest.php new file mode 100644 index 0000000..a8df6dd --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenMiniVersionUploadRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.mini.version.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenNewgotoneCreateRequest.php b/extend/alipay/aop/request/AlipayOpenNewgotoneCreateRequest.php new file mode 100644 index 0000000..e558862 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenNewgotoneCreateRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenOperationBizfeeActivityApplyRequest.php b/extend/alipay/aop/request/AlipayOpenOperationBizfeeActivityApplyRequest.php new file mode 100644 index 0000000..479993c --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenOperationBizfeeActivityApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.operation.bizfee.activity.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenOperationOpenbizmockBizQueryRequest.php b/extend/alipay/aop/request/AlipayOpenOperationOpenbizmockBizQueryRequest.php new file mode 100644 index 0000000..c0830e0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenOperationOpenbizmockBizQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.operation.openbizmock.biz.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenOperationSsffDeeQueryRequest.php b/extend/alipay/aop/request/AlipayOpenOperationSsffDeeQueryRequest.php new file mode 100644 index 0000000..2ece585 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenOperationSsffDeeQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.operation.ssff.dee.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPageNewcontextTransferRequest.php b/extend/alipay/aop/request/AlipayOpenPageNewcontextTransferRequest.php new file mode 100644 index 0000000..1fb2247 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPageNewcontextTransferRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.page.newcontext.transfer"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPageOldcontextTransferRequest.php b/extend/alipay/aop/request/AlipayOpenPageOldcontextTransferRequest.php new file mode 100644 index 0000000..09a0545 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPageOldcontextTransferRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.page.oldcontext.transfer"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicAccountCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicAccountCreateRequest.php new file mode 100644 index 0000000..e73cd83 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicAccountCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.account.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicAccountDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenPublicAccountDeleteRequest.php new file mode 100644 index 0000000..a6b599b --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicAccountDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.account.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicAccountQueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicAccountQueryRequest.php new file mode 100644 index 0000000..a3999d7 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicAccountQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.account.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicAccountResetRequest.php b/extend/alipay/aop/request/AlipayOpenPublicAccountResetRequest.php new file mode 100644 index 0000000..05fe944 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicAccountResetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.account.reset"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicAdvertBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicAdvertBatchqueryRequest.php new file mode 100644 index 0000000..e7dec4f --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicAdvertBatchqueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicAdvertCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicAdvertCreateRequest.php new file mode 100644 index 0000000..d0244c7 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicAdvertCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.advert.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicAdvertDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenPublicAdvertDeleteRequest.php new file mode 100644 index 0000000..749aee2 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicAdvertDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.advert.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicAdvertModifyRequest.php b/extend/alipay/aop/request/AlipayOpenPublicAdvertModifyRequest.php new file mode 100644 index 0000000..1bab130 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicAdvertModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.advert.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicArticlesummaryDataBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicArticlesummaryDataBatchqueryRequest.php new file mode 100644 index 0000000..fcf0c31 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicArticlesummaryDataBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.articlesummary.data.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicComptestCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicComptestCreateRequest.php new file mode 100644 index 0000000..a3c3576 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicComptestCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.comptest.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicContactFollowBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicContactFollowBatchqueryRequest.php new file mode 100644 index 0000000..e512c04 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicContactFollowBatchqueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicDefaultExtensionCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicDefaultExtensionCreateRequest.php new file mode 100644 index 0000000..706247f --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicDefaultExtensionCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.default.extension.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicFollowBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicFollowBatchqueryRequest.php new file mode 100644 index 0000000..f422bb6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicFollowBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.follow.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicGisQueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicGisQueryRequest.php new file mode 100644 index 0000000..c17ac20 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicGisQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.gis.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicGroupBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicGroupBatchqueryRequest.php new file mode 100644 index 0000000..8665165 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicGroupBatchqueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicGroupCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicGroupCreateRequest.php new file mode 100644 index 0000000..9c4b321 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicGroupCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.group.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicGroupCrowdQueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicGroupCrowdQueryRequest.php new file mode 100644 index 0000000..dcef69a --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicGroupCrowdQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.group.crowd.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicGroupDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenPublicGroupDeleteRequest.php new file mode 100644 index 0000000..717c663 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicGroupDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.group.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicGroupModifyRequest.php b/extend/alipay/aop/request/AlipayOpenPublicGroupModifyRequest.php new file mode 100644 index 0000000..0cb212c --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicGroupModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.group.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicInfoModifyRequest.php b/extend/alipay/aop/request/AlipayOpenPublicInfoModifyRequest.php new file mode 100644 index 0000000..497ca6a --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicInfoModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.info.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicInfoQueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicInfoQueryRequest.php new file mode 100644 index 0000000..3daec9f --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicInfoQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLabelCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLabelCreateRequest.php new file mode 100644 index 0000000..6a4a38f --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLabelCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.label.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLabelDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLabelDeleteRequest.php new file mode 100644 index 0000000..93fe955 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLabelDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.label.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLabelModifyRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLabelModifyRequest.php new file mode 100644 index 0000000..c1dfb70 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLabelModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.label.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLabelQueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLabelQueryRequest.php new file mode 100644 index 0000000..9ddd974 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLabelQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLabelUserCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLabelUserCreateRequest.php new file mode 100644 index 0000000..bcec43a --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLabelUserCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.label.user.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLabelUserDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLabelUserDeleteRequest.php new file mode 100644 index 0000000..d1b4467 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLabelUserDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.label.user.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLabelUserQueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLabelUserQueryRequest.php new file mode 100644 index 0000000..c1f6f99 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLabelUserQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.label.user.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLifeAboardApplyRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLifeAboardApplyRequest.php new file mode 100644 index 0000000..dc67396 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLifeAboardApplyRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLifeAccountCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLifeAccountCreateRequest.php new file mode 100644 index 0000000..4979552 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLifeAccountCreateRequest.php @@ -0,0 +1,247 @@ +background = $background; + $this->apiParas["background"] = $background; + } + + public function getBackground() + { + return $this->background; + } + + public function setCatagoryId($catagoryId) + { + $this->catagoryId = $catagoryId; + $this->apiParas["catagory_id"] = $catagoryId; + } + + public function getCatagoryId() + { + return $this->catagoryId; + } + + public function setContactEmail($contactEmail) + { + $this->contactEmail = $contactEmail; + $this->apiParas["contact_email"] = $contactEmail; + } + + public function getContactEmail() + { + return $this->contactEmail; + } + + public function setContactTel($contactTel) + { + $this->contactTel = $contactTel; + $this->apiParas["contact_tel"] = $contactTel; + } + + public function getContactTel() + { + return $this->contactTel; + } + + public function setContent($content) + { + $this->content = $content; + $this->apiParas["content"] = $content; + } + + public function getContent() + { + return $this->content; + } + + public function setCustomerTel($customerTel) + { + $this->customerTel = $customerTel; + $this->apiParas["customer_tel"] = $customerTel; + } + + public function getCustomerTel() + { + return $this->customerTel; + } + + public function setLifeName($lifeName) + { + $this->lifeName = $lifeName; + $this->apiParas["life_name"] = $lifeName; + } + + public function getLifeName() + { + return $this->lifeName; + } + + public function setLogo($logo) + { + $this->logo = $logo; + $this->apiParas["logo"] = $logo; + } + + public function getLogo() + { + return $this->logo; + } + + public function setUserId($userId) + { + $this->userId = $userId; + $this->apiParas["user_id"] = $userId; + } + + public function getUserId() + { + return $this->userId; + } + + public function getApiMethodName() + { + return "alipay.open.public.life.account.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLifeAgentCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLifeAgentCreateRequest.php new file mode 100644 index 0000000..02d0576 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLifeAgentCreateRequest.php @@ -0,0 +1,375 @@ +商家经营类目 中的“经营类目编码” + **/ + private $mccCode; + + /** + * 外部入驻申请单据号,由开发者生成,并需保证在开发者端不重复。另,如果代创建被驳回,需更换新的申请号,原申请号不能再次使用 + **/ + private $outBizNo; + + /** + * 自有知识产权证书图片 + **/ + private $ownIntellectualPic; + + /** + * 生活号简介 + **/ + private $publicDesc; + + /** + * 生活号名称 + **/ + private $publicName; + + /** + * 店铺内景图片,被代创建商户运营主体为个人账户必填,企业账户选填 + **/ + private $shopScenePic; + + /** + * 店铺门头照图片,被代创建商户运营主体为个人账户必填,企业账户选填 + **/ + private $shopSignBoardPic; + + /** + * 企业特殊资质图片,可参考 商家经营类目 中的 “需要的特殊资质证书” + **/ + private $specialLicensePic; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setAccount($account) + { + $this->account = $account; + $this->apiParas["account"] = $account; + } + + public function getAccount() + { + return $this->account; + } + + public function setBackgroundPic($backgroundPic) + { + $this->backgroundPic = $backgroundPic; + $this->apiParas["background_pic"] = $backgroundPic; + } + + public function getBackgroundPic() + { + return $this->backgroundPic; + } + + public function setBusinessLicenseAuthPic($businessLicenseAuthPic) + { + $this->businessLicenseAuthPic = $businessLicenseAuthPic; + $this->apiParas["business_license_auth_pic"] = $businessLicenseAuthPic; + } + + public function getBusinessLicenseAuthPic() + { + return $this->businessLicenseAuthPic; + } + + public function setBusinessLicenseNo($businessLicenseNo) + { + $this->businessLicenseNo = $businessLicenseNo; + $this->apiParas["business_license_no"] = $businessLicenseNo; + } + + public function getBusinessLicenseNo() + { + return $this->businessLicenseNo; + } + + public function setBusinessLicensePic($businessLicensePic) + { + $this->businessLicensePic = $businessLicensePic; + $this->apiParas["business_license_pic"] = $businessLicensePic; + } + + public function getBusinessLicensePic() + { + return $this->businessLicensePic; + } + + public function setContactEmail($contactEmail) + { + $this->contactEmail = $contactEmail; + $this->apiParas["contact_email"] = $contactEmail; + } + + public function getContactEmail() + { + return $this->contactEmail; + } + + public function setContactMobile($contactMobile) + { + $this->contactMobile = $contactMobile; + $this->apiParas["contact_mobile"] = $contactMobile; + } + + public function getContactMobile() + { + return $this->contactMobile; + } + + public function setContactName($contactName) + { + $this->contactName = $contactName; + $this->apiParas["contact_name"] = $contactName; + } + + public function getContactName() + { + return $this->contactName; + } + + public function setLogoPic($logoPic) + { + $this->logoPic = $logoPic; + $this->apiParas["logo_pic"] = $logoPic; + } + + public function getLogoPic() + { + return $this->logoPic; + } + + public function setMccCode($mccCode) + { + $this->mccCode = $mccCode; + $this->apiParas["mcc_code"] = $mccCode; + } + + public function getMccCode() + { + return $this->mccCode; + } + + public function setOutBizNo($outBizNo) + { + $this->outBizNo = $outBizNo; + $this->apiParas["out_biz_no"] = $outBizNo; + } + + public function getOutBizNo() + { + return $this->outBizNo; + } + + public function setOwnIntellectualPic($ownIntellectualPic) + { + $this->ownIntellectualPic = $ownIntellectualPic; + $this->apiParas["own_intellectual_pic"] = $ownIntellectualPic; + } + + public function getOwnIntellectualPic() + { + return $this->ownIntellectualPic; + } + + public function setPublicDesc($publicDesc) + { + $this->publicDesc = $publicDesc; + $this->apiParas["public_desc"] = $publicDesc; + } + + public function getPublicDesc() + { + return $this->publicDesc; + } + + public function setPublicName($publicName) + { + $this->publicName = $publicName; + $this->apiParas["public_name"] = $publicName; + } + + public function getPublicName() + { + return $this->publicName; + } + + public function setShopScenePic($shopScenePic) + { + $this->shopScenePic = $shopScenePic; + $this->apiParas["shop_scene_pic"] = $shopScenePic; + } + + public function getShopScenePic() + { + return $this->shopScenePic; + } + + public function setShopSignBoardPic($shopSignBoardPic) + { + $this->shopSignBoardPic = $shopSignBoardPic; + $this->apiParas["shop_sign_board_pic"] = $shopSignBoardPic; + } + + public function getShopSignBoardPic() + { + return $this->shopSignBoardPic; + } + + public function setSpecialLicensePic($specialLicensePic) + { + $this->specialLicensePic = $specialLicensePic; + $this->apiParas["special_license_pic"] = $specialLicensePic; + } + + public function getSpecialLicensePic() + { + return $this->specialLicensePic; + } + + public function getApiMethodName() + { + return "alipay.open.public.life.agent.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLifeAgentcreateQueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLifeAgentcreateQueryRequest.php new file mode 100644 index 0000000..70cdf8f --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLifeAgentcreateQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.life.agentcreate.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLifeCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLifeCreateRequest.php new file mode 100644 index 0000000..50b2afc --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLifeCreateRequest.php @@ -0,0 +1,310 @@ +background = $background; + $this->apiParas["background"] = $background; + } + + public function getBackground() + { + return $this->background; + } + + public function setContactEmail($contactEmail) + { + $this->contactEmail = $contactEmail; + $this->apiParas["contact_email"] = $contactEmail; + } + + public function getContactEmail() + { + return $this->contactEmail; + } + + public function setContactName($contactName) + { + $this->contactName = $contactName; + $this->apiParas["contact_name"] = $contactName; + } + + public function getContactName() + { + return $this->contactName; + } + + public function setContactTel($contactTel) + { + $this->contactTel = $contactTel; + $this->apiParas["contact_tel"] = $contactTel; + } + + public function getContactTel() + { + return $this->contactTel; + } + + public function setCustomerTel($customerTel) + { + $this->customerTel = $customerTel; + $this->apiParas["customer_tel"] = $customerTel; + } + + public function getCustomerTel() + { + return $this->customerTel; + } + + public function setDescription($description) + { + $this->description = $description; + $this->apiParas["description"] = $description; + } + + public function getDescription() + { + return $this->description; + } + + public function setExtendData($extendData) + { + $this->extendData = $extendData; + $this->apiParas["extend_data"] = $extendData; + } + + public function getExtendData() + { + return $this->extendData; + } + + public function setLifeName($lifeName) + { + $this->lifeName = $lifeName; + $this->apiParas["life_name"] = $lifeName; + } + + public function getLifeName() + { + return $this->lifeName; + } + + public function setLogo($logo) + { + $this->logo = $logo; + $this->apiParas["logo"] = $logo; + } + + public function getLogo() + { + return $this->logo; + } + + public function setMccCode($mccCode) + { + $this->mccCode = $mccCode; + $this->apiParas["mcc_code"] = $mccCode; + } + + public function getMccCode() + { + return $this->mccCode; + } + + public function setPublicBizType($publicBizType) + { + $this->publicBizType = $publicBizType; + $this->apiParas["public_biz_type"] = $publicBizType; + } + + public function getPublicBizType() + { + return $this->publicBizType; + } + + public function setShowStyle($showStyle) + { + $this->showStyle = $showStyle; + $this->apiParas["show_style"] = $showStyle; + } + + public function getShowStyle() + { + return $this->showStyle; + } + + public function setUserId($userId) + { + $this->userId = $userId; + $this->apiParas["user_id"] = $userId; + } + + public function getUserId() + { + return $this->userId; + } + + public function getApiMethodName() + { + return "alipay.open.public.life.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLifeDebarkApplyRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLifeDebarkApplyRequest.php new file mode 100644 index 0000000..fcc0ed7 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLifeDebarkApplyRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLifeLabelBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLifeLabelBatchqueryRequest.php new file mode 100644 index 0000000..2d96b9b --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLifeLabelBatchqueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLifeLabelCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLifeLabelCreateRequest.php new file mode 100644 index 0000000..495bc5e --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLifeLabelCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.life.label.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLifeLabelDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLifeLabelDeleteRequest.php new file mode 100644 index 0000000..879c912 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLifeLabelDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.life.label.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLifeLabelModifyRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLifeLabelModifyRequest.php new file mode 100644 index 0000000..9201012 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLifeLabelModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.life.label.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLifeModifyRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLifeModifyRequest.php new file mode 100644 index 0000000..5481008 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLifeModifyRequest.php @@ -0,0 +1,262 @@ +background = $background; + $this->apiParas["background"] = $background; + } + + public function getBackground() + { + return $this->background; + } + + public function setContactEmail($contactEmail) + { + $this->contactEmail = $contactEmail; + $this->apiParas["contact_email"] = $contactEmail; + } + + public function getContactEmail() + { + return $this->contactEmail; + } + + public function setContactName($contactName) + { + $this->contactName = $contactName; + $this->apiParas["contact_name"] = $contactName; + } + + public function getContactName() + { + return $this->contactName; + } + + public function setContactTel($contactTel) + { + $this->contactTel = $contactTel; + $this->apiParas["contact_tel"] = $contactTel; + } + + public function getContactTel() + { + return $this->contactTel; + } + + public function setCustomerTel($customerTel) + { + $this->customerTel = $customerTel; + $this->apiParas["customer_tel"] = $customerTel; + } + + public function getCustomerTel() + { + return $this->customerTel; + } + + public function setDescription($description) + { + $this->description = $description; + $this->apiParas["description"] = $description; + } + + public function getDescription() + { + return $this->description; + } + + public function setExtendData($extendData) + { + $this->extendData = $extendData; + $this->apiParas["extend_data"] = $extendData; + } + + public function getExtendData() + { + return $this->extendData; + } + + public function setLifeName($lifeName) + { + $this->lifeName = $lifeName; + $this->apiParas["life_name"] = $lifeName; + } + + public function getLifeName() + { + return $this->lifeName; + } + + public function setLogo($logo) + { + $this->logo = $logo; + $this->apiParas["logo"] = $logo; + } + + public function getLogo() + { + return $this->logo; + } + + public function setUserId($userId) + { + $this->userId = $userId; + $this->apiParas["user_id"] = $userId; + } + + public function getUserId() + { + return $this->userId; + } + + public function getApiMethodName() + { + return "alipay.open.public.life.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLifeMsgRecallRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLifeMsgRecallRequest.php new file mode 100644 index 0000000..b7937d5 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLifeMsgRecallRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.life.msg.recall"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicLifeMsgSendRequest.php b/extend/alipay/aop/request/AlipayOpenPublicLifeMsgSendRequest.php new file mode 100644 index 0000000..36ef25c --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicLifeMsgSendRequest.php @@ -0,0 +1,337 @@ +category = $category; + $this->apiParas["category"] = $category; + } + + public function getCategory() + { + return $this->category; + } + + public function setContent($content) + { + $this->content = $content; + $this->apiParas["content"] = $content; + } + + public function getContent() + { + return $this->content; + } + + public function setCover($cover) + { + $this->cover = $cover; + $this->apiParas["cover"] = $cover; + } + + public function getCover() + { + return $this->cover; + } + + public function setDesc($desc) + { + $this->desc = $desc; + $this->apiParas["desc"] = $desc; + } + + public function getDesc() + { + return $this->desc; + } + + public function setMsgType($msgType) + { + $this->msgType = $msgType; + $this->apiParas["msg_type"] = $msgType; + } + + public function getMsgType() + { + return $this->msgType; + } + + public function setSourceExtInfo($sourceExtInfo) + { + $this->sourceExtInfo = $sourceExtInfo; + $this->apiParas["source_ext_info"] = $sourceExtInfo; + } + + public function getSourceExtInfo() + { + return $this->sourceExtInfo; + } + + public function setTitle($title) + { + $this->title = $title; + $this->apiParas["title"] = $title; + } + + public function getTitle() + { + return $this->title; + } + + public function setUniqueMsgId($uniqueMsgId) + { + $this->uniqueMsgId = $uniqueMsgId; + $this->apiParas["unique_msg_id"] = $uniqueMsgId; + } + + public function getUniqueMsgId() + { + return $this->uniqueMsgId; + } + + public function setVideoLength($videoLength) + { + $this->videoLength = $videoLength; + $this->apiParas["video_length"] = $videoLength; + } + + public function getVideoLength() + { + return $this->videoLength; + } + + public function setVideoSamples($videoSamples) + { + $this->videoSamples = $videoSamples; + $this->apiParas["video_samples"] = $videoSamples; + } + + public function getVideoSamples() + { + return $this->videoSamples; + } + + public function setVideoSize($videoSize) + { + $this->videoSize = $videoSize; + $this->apiParas["video_size"] = $videoSize; + } + + public function getVideoSize() + { + return $this->videoSize; + } + + public function setVideoSource($videoSource) + { + $this->videoSource = $videoSource; + $this->apiParas["video_source"] = $videoSource; + } + + public function getVideoSource() + { + return $this->videoSource; + } + + public function setVideoTemporaryUrl($videoTemporaryUrl) + { + $this->videoTemporaryUrl = $videoTemporaryUrl; + $this->apiParas["video_temporary_url"] = $videoTemporaryUrl; + } + + public function getVideoTemporaryUrl() + { + return $this->videoTemporaryUrl; + } + + public function setVideoUrl($videoUrl) + { + $this->videoUrl = $videoUrl; + $this->apiParas["video_url"] = $videoUrl; + } + + public function getVideoUrl() + { + return $this->videoUrl; + } + + public function getApiMethodName() + { + return "alipay.open.public.life.msg.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMatchuserLabelCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMatchuserLabelCreateRequest.php new file mode 100644 index 0000000..89d5621 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMatchuserLabelCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.matchuser.label.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMatchuserLabelDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMatchuserLabelDeleteRequest.php new file mode 100644 index 0000000..a81c090 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMatchuserLabelDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.matchuser.label.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMenuBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMenuBatchqueryRequest.php new file mode 100644 index 0000000..22dcdcd --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMenuBatchqueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMenuCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMenuCreateRequest.php new file mode 100644 index 0000000..1a5ce2b --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMenuCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.menu.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMenuDataBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMenuDataBatchqueryRequest.php new file mode 100644 index 0000000..1252cc8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMenuDataBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.menu.data.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMenuDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMenuDeleteRequest.php new file mode 100644 index 0000000..00f16fd --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMenuDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.menu.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMenuModifyRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMenuModifyRequest.php new file mode 100644 index 0000000..272720d --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMenuModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.menu.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMenuQueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMenuQueryRequest.php new file mode 100644 index 0000000..274b617 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMenuQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMessageContentCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMessageContentCreateRequest.php new file mode 100644 index 0000000..e616e2e --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMessageContentCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.message.content.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMessageContentModifyRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMessageContentModifyRequest.php new file mode 100644 index 0000000..167d7f1 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMessageContentModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.message.content.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMessageCustomSendRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMessageCustomSendRequest.php new file mode 100644 index 0000000..9fb8cb3 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMessageCustomSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.message.custom.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMessageGroupSendRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMessageGroupSendRequest.php new file mode 100644 index 0000000..1223799 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMessageGroupSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.message.group.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMessageLabelSendRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMessageLabelSendRequest.php new file mode 100644 index 0000000..aa67dfa --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMessageLabelSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.message.label.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMessagePreviewSendRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMessagePreviewSendRequest.php new file mode 100644 index 0000000..dbcffe0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMessagePreviewSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.message.preview.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMessageQueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMessageQueryRequest.php new file mode 100644 index 0000000..35a5f2d --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMessageQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.message.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMessageSingleSendRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMessageSingleSendRequest.php new file mode 100644 index 0000000..8042d17 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMessageSingleSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.message.single.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMessageTotalSendRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMessageTotalSendRequest.php new file mode 100644 index 0000000..56ccd8c --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMessageTotalSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.message.total.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicMultimediaDownloadProxyRequest.php b/extend/alipay/aop/request/AlipayOpenPublicMultimediaDownloadProxyRequest.php new file mode 100644 index 0000000..4f023f5 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicMultimediaDownloadProxyRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicPartnerMenuOperateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicPartnerMenuOperateRequest.php new file mode 100644 index 0000000..612c4b2 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicPartnerMenuOperateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.partner.menu.operate"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicPartnerMenuQueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicPartnerMenuQueryRequest.php new file mode 100644 index 0000000..99ab085 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicPartnerMenuQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.partner.menu.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicPartnerSubscribeSyncRequest.php b/extend/alipay/aop/request/AlipayOpenPublicPartnerSubscribeSyncRequest.php new file mode 100644 index 0000000..3a81806 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicPartnerSubscribeSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.partner.subscribe.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicPayeeBindCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicPayeeBindCreateRequest.php new file mode 100644 index 0000000..60fa71f --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicPayeeBindCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.payee.bind.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicPayeeBindDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenPublicPayeeBindDeleteRequest.php new file mode 100644 index 0000000..5c81ba6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicPayeeBindDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.payee.bind.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicPersonalizedExtensionBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicPersonalizedExtensionBatchqueryRequest.php new file mode 100644 index 0000000..62b0bed --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicPersonalizedExtensionBatchqueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicPersonalizedExtensionCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicPersonalizedExtensionCreateRequest.php new file mode 100644 index 0000000..48f5af0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicPersonalizedExtensionCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.personalized.extension.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicPersonalizedExtensionDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenPublicPersonalizedExtensionDeleteRequest.php new file mode 100644 index 0000000..2d1d475 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicPersonalizedExtensionDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.personalized.extension.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicPersonalizedExtensionSetRequest.php b/extend/alipay/aop/request/AlipayOpenPublicPersonalizedExtensionSetRequest.php new file mode 100644 index 0000000..5021c5e --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicPersonalizedExtensionSetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.personalized.extension.set"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicPersonalizedMenuCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicPersonalizedMenuCreateRequest.php new file mode 100644 index 0000000..f76eea8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicPersonalizedMenuCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.personalized.menu.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicPersonalizedMenuDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenPublicPersonalizedMenuDeleteRequest.php new file mode 100644 index 0000000..1c1fd48 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicPersonalizedMenuDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.personalized.menu.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicQrcodeCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicQrcodeCreateRequest.php new file mode 100644 index 0000000..6a71687 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicQrcodeCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.qrcode.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicSettingCategoryQueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicSettingCategoryQueryRequest.php new file mode 100644 index 0000000..80d6ff9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicSettingCategoryQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicShortlinkCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicShortlinkCreateRequest.php new file mode 100644 index 0000000..903b36e --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicShortlinkCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.shortlink.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicSinglearticleDataBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicSinglearticleDataBatchqueryRequest.php new file mode 100644 index 0000000..677fe21 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicSinglearticleDataBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.singlearticle.data.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicTemplateMessageAddRequest.php b/extend/alipay/aop/request/AlipayOpenPublicTemplateMessageAddRequest.php new file mode 100644 index 0000000..1ec30eb --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicTemplateMessageAddRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.template.message.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicTemplateMessageGetRequest.php b/extend/alipay/aop/request/AlipayOpenPublicTemplateMessageGetRequest.php new file mode 100644 index 0000000..71fa5b9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicTemplateMessageGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.template.message.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicTemplateMessageIndustryModifyRequest.php b/extend/alipay/aop/request/AlipayOpenPublicTemplateMessageIndustryModifyRequest.php new file mode 100644 index 0000000..ac480b8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicTemplateMessageIndustryModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.template.message.industry.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicThirdCustomerServiceRequest.php b/extend/alipay/aop/request/AlipayOpenPublicThirdCustomerServiceRequest.php new file mode 100644 index 0000000..19d4681 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicThirdCustomerServiceRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.third.customer.service"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicTopicBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicTopicBatchqueryRequest.php new file mode 100644 index 0000000..6dff65d --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicTopicBatchqueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicTopicCreateRequest.php b/extend/alipay/aop/request/AlipayOpenPublicTopicCreateRequest.php new file mode 100644 index 0000000..d6a6c77 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicTopicCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.topic.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicTopicDeleteRequest.php b/extend/alipay/aop/request/AlipayOpenPublicTopicDeleteRequest.php new file mode 100644 index 0000000..d34cfaf --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicTopicDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.topic.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicTopicModifyRequest.php b/extend/alipay/aop/request/AlipayOpenPublicTopicModifyRequest.php new file mode 100644 index 0000000..66ace40 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicTopicModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.topic.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicUserDataBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicUserDataBatchqueryRequest.php new file mode 100644 index 0000000..f3f15f4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicUserDataBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.user.data.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicUserFollowQueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicUserFollowQueryRequest.php new file mode 100644 index 0000000..7a36fc7 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicUserFollowQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.user.follow.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenPublicXwbtestabcdBatchqueryRequest.php b/extend/alipay/aop/request/AlipayOpenPublicXwbtestabcdBatchqueryRequest.php new file mode 100644 index 0000000..92f2bbd --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenPublicXwbtestabcdBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.public.xwbtestabcd.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenServicemarketCommodityShopOfflineRequest.php b/extend/alipay/aop/request/AlipayOpenServicemarketCommodityShopOfflineRequest.php new file mode 100644 index 0000000..8c75050 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenServicemarketCommodityShopOfflineRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.servicemarket.commodity.shop.offline"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenServicemarketCommodityShopOnlineRequest.php b/extend/alipay/aop/request/AlipayOpenServicemarketCommodityShopOnlineRequest.php new file mode 100644 index 0000000..9991876 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenServicemarketCommodityShopOnlineRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.servicemarket.commodity.shop.online"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenServicemarketOrderAcceptRequest.php b/extend/alipay/aop/request/AlipayOpenServicemarketOrderAcceptRequest.php new file mode 100644 index 0000000..d095873 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenServicemarketOrderAcceptRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.servicemarket.order.accept"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenServicemarketOrderItemCancelRequest.php b/extend/alipay/aop/request/AlipayOpenServicemarketOrderItemCancelRequest.php new file mode 100644 index 0000000..5a3ed3f --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenServicemarketOrderItemCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.servicemarket.order.item.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenServicemarketOrderItemCompleteRequest.php b/extend/alipay/aop/request/AlipayOpenServicemarketOrderItemCompleteRequest.php new file mode 100644 index 0000000..ab62a34 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenServicemarketOrderItemCompleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.servicemarket.order.item.complete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenServicemarketOrderItemConfirmRequest.php b/extend/alipay/aop/request/AlipayOpenServicemarketOrderItemConfirmRequest.php new file mode 100644 index 0000000..b4450b0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenServicemarketOrderItemConfirmRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.servicemarket.order.item.confirm"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenServicemarketOrderNotifyRequest.php b/extend/alipay/aop/request/AlipayOpenServicemarketOrderNotifyRequest.php new file mode 100644 index 0000000..24feeef --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenServicemarketOrderNotifyRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenServicemarketOrderQueryRequest.php b/extend/alipay/aop/request/AlipayOpenServicemarketOrderQueryRequest.php new file mode 100644 index 0000000..5d79d2d --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenServicemarketOrderQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.servicemarket.order.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenServicemarketOrderRejectRequest.php b/extend/alipay/aop/request/AlipayOpenServicemarketOrderRejectRequest.php new file mode 100644 index 0000000..ecd3c09 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenServicemarketOrderRejectRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.servicemarket.order.reject"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenSmsgDataSetRequest.php b/extend/alipay/aop/request/AlipayOpenSmsgDataSetRequest.php new file mode 100644 index 0000000..43aba40 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenSmsgDataSetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.smsg.data.set"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayOpenTestQueryRequest.php b/extend/alipay/aop/request/AlipayOpenTestQueryRequest.php new file mode 100644 index 0000000..ac33106 --- /dev/null +++ b/extend/alipay/aop/request/AlipayOpenTestQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.open.test.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPassCodeAddRequest.php b/extend/alipay/aop/request/AlipayPassCodeAddRequest.php new file mode 100644 index 0000000..4e6aed9 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPassCodeAddRequest.php @@ -0,0 +1,170 @@ +fileContent = $fileContent; + $this->apiParas["file_content"] = $fileContent; + } + + public function getFileContent() + { + return $this->fileContent; + } + + public function setRecognitionInfo($recognitionInfo) + { + $this->recognitionInfo = $recognitionInfo; + $this->apiParas["recognition_info"] = $recognitionInfo; + } + + public function getRecognitionInfo() + { + return $this->recognitionInfo; + } + + public function setRecognitionType($recognitionType) + { + $this->recognitionType = $recognitionType; + $this->apiParas["recognition_type"] = $recognitionType; + } + + public function getRecognitionType() + { + return $this->recognitionType; + } + + public function setVerifyType($verifyType) + { + $this->verifyType = $verifyType; + $this->apiParas["verify_type"] = $verifyType; + } + + public function getVerifyType() + { + return $this->verifyType; + } + + public function getApiMethodName() + { + return "alipay.pass.code.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPassCodeVerifyRequest.php b/extend/alipay/aop/request/AlipayPassCodeVerifyRequest.php new file mode 100644 index 0000000..172c3e0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPassCodeVerifyRequest.php @@ -0,0 +1,170 @@ +extInfo = $extInfo; + $this->apiParas["ext_info"] = $extInfo; + } + + public function getExtInfo() + { + return $this->extInfo; + } + + public function setOperatorId($operatorId) + { + $this->operatorId = $operatorId; + $this->apiParas["operator_id"] = $operatorId; + } + + public function getOperatorId() + { + return $this->operatorId; + } + + public function setOperatorType($operatorType) + { + $this->operatorType = $operatorType; + $this->apiParas["operator_type"] = $operatorType; + } + + public function getOperatorType() + { + return $this->operatorType; + } + + public function setVerifyCode($verifyCode) + { + $this->verifyCode = $verifyCode; + $this->apiParas["verify_code"] = $verifyCode; + } + + public function getVerifyCode() + { + return $this->verifyCode; + } + + public function getApiMethodName() + { + return "alipay.pass.code.verify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPassFileAddRequest.php b/extend/alipay/aop/request/AlipayPassFileAddRequest.php new file mode 100644 index 0000000..083ee94 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPassFileAddRequest.php @@ -0,0 +1,153 @@ +fileContent = $fileContent; + $this->apiParas["file_content"] = $fileContent; + } + + public function getFileContent() + { + return $this->fileContent; + } + + public function setRecognitionInfo($recognitionInfo) + { + $this->recognitionInfo = $recognitionInfo; + $this->apiParas["recognition_info"] = $recognitionInfo; + } + + public function getRecognitionInfo() + { + return $this->recognitionInfo; + } + + public function setRecognitionType($recognitionType) + { + $this->recognitionType = $recognitionType; + $this->apiParas["recognition_type"] = $recognitionType; + } + + public function getRecognitionType() + { + return $this->recognitionType; + } + + public function getApiMethodName() + { + return "alipay.pass.file.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPassInstanceAddRequest.php b/extend/alipay/aop/request/AlipayPassInstanceAddRequest.php new file mode 100644 index 0000000..a256a04 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPassInstanceAddRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pass.instance.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPassInstanceUpdateRequest.php b/extend/alipay/aop/request/AlipayPassInstanceUpdateRequest.php new file mode 100644 index 0000000..c0a2b81 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPassInstanceUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pass.instance.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPassSyncAddRequest.php b/extend/alipay/aop/request/AlipayPassSyncAddRequest.php new file mode 100644 index 0000000..41376be --- /dev/null +++ b/extend/alipay/aop/request/AlipayPassSyncAddRequest.php @@ -0,0 +1,166 @@ +fileContent = $fileContent; + $this->apiParas["file_content"] = $fileContent; + } + + public function getFileContent() + { + return $this->fileContent; + } + + public function setOutTradeNo($outTradeNo) + { + $this->outTradeNo = $outTradeNo; + $this->apiParas["out_trade_no"] = $outTradeNo; + } + + public function getOutTradeNo() + { + return $this->outTradeNo; + } + + public function setPartnerId($partnerId) + { + $this->partnerId = $partnerId; + $this->apiParas["partner_id"] = $partnerId; + } + + public function getPartnerId() + { + return $this->partnerId; + } + + public function setUserId($userId) + { + $this->userId = $userId; + $this->apiParas["user_id"] = $userId; + } + + public function getUserId() + { + return $this->userId; + } + + public function getApiMethodName() + { + return "alipay.pass.sync.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPassSyncUpdateRequest.php b/extend/alipay/aop/request/AlipayPassSyncUpdateRequest.php new file mode 100644 index 0000000..62637e6 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPassSyncUpdateRequest.php @@ -0,0 +1,214 @@ +channelId = $channelId; + $this->apiParas["channel_id"] = $channelId; + } + + public function getChannelId() + { + return $this->channelId; + } + + public function setExtInfo($extInfo) + { + $this->extInfo = $extInfo; + $this->apiParas["ext_info"] = $extInfo; + } + + public function getExtInfo() + { + return $this->extInfo; + } + + public function setPass($pass) + { + $this->pass = $pass; + $this->apiParas["pass"] = $pass; + } + + public function getPass() + { + return $this->pass; + } + + public function setSerialNumber($serialNumber) + { + $this->serialNumber = $serialNumber; + $this->apiParas["serial_number"] = $serialNumber; + } + + public function getSerialNumber() + { + return $this->serialNumber; + } + + public function setStatus($status) + { + $this->status = $status; + $this->apiParas["status"] = $status; + } + + public function getStatus() + { + return $this->status; + } + + public function setVerifyCode($verifyCode) + { + $this->verifyCode = $verifyCode; + $this->apiParas["verify_code"] = $verifyCode; + } + + public function getVerifyCode() + { + return $this->verifyCode; + } + + public function setVerifyType($verifyType) + { + $this->verifyType = $verifyType; + $this->apiParas["verify_type"] = $verifyType; + } + + public function getVerifyType() + { + return $this->verifyType; + } + + public function getApiMethodName() + { + return "alipay.pass.sync.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPassTemplateAddRequest.php b/extend/alipay/aop/request/AlipayPassTemplateAddRequest.php new file mode 100644 index 0000000..bb5baf4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPassTemplateAddRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pass.template.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPassTemplateUpdateRequest.php b/extend/alipay/aop/request/AlipayPassTemplateUpdateRequest.php new file mode 100644 index 0000000..3656084 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPassTemplateUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pass.template.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPassTplAddRequest.php b/extend/alipay/aop/request/AlipayPassTplAddRequest.php new file mode 100644 index 0000000..d0175b0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPassTplAddRequest.php @@ -0,0 +1,135 @@ +tplContent = $tplContent; + $this->apiParas["tpl_content"] = $tplContent; + } + + public function getTplContent() + { + return $this->tplContent; + } + + public function setUniqueId($uniqueId) + { + $this->uniqueId = $uniqueId; + $this->apiParas["unique_id"] = $uniqueId; + } + + public function getUniqueId() + { + return $this->uniqueId; + } + + public function getApiMethodName() + { + return "alipay.pass.tpl.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPassTplContentAddRequest.php b/extend/alipay/aop/request/AlipayPassTplContentAddRequest.php new file mode 100644 index 0000000..c36db64 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPassTplContentAddRequest.php @@ -0,0 +1,169 @@ +recognitionInfo = $recognitionInfo; + $this->apiParas["recognition_info"] = $recognitionInfo; + } + + public function getRecognitionInfo() + { + return $this->recognitionInfo; + } + + public function setRecognitionType($recognitionType) + { + $this->recognitionType = $recognitionType; + $this->apiParas["recognition_type"] = $recognitionType; + } + + public function getRecognitionType() + { + return $this->recognitionType; + } + + public function setTplId($tplId) + { + $this->tplId = $tplId; + $this->apiParas["tpl_id"] = $tplId; + } + + public function getTplId() + { + return $this->tplId; + } + + public function setTplParams($tplParams) + { + $this->tplParams = $tplParams; + $this->apiParas["tpl_params"] = $tplParams; + } + + public function getTplParams() + { + return $this->tplParams; + } + + public function getApiMethodName() + { + return "alipay.pass.tpl.content.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPassTplContentUpdateRequest.php b/extend/alipay/aop/request/AlipayPassTplContentUpdateRequest.php new file mode 100644 index 0000000..d7bad5c --- /dev/null +++ b/extend/alipay/aop/request/AlipayPassTplContentUpdateRequest.php @@ -0,0 +1,198 @@ +channelId = $channelId; + $this->apiParas["channel_id"] = $channelId; + } + + public function getChannelId() + { + return $this->channelId; + } + + public function setSerialNumber($serialNumber) + { + $this->serialNumber = $serialNumber; + $this->apiParas["serial_number"] = $serialNumber; + } + + public function getSerialNumber() + { + return $this->serialNumber; + } + + public function setStatus($status) + { + $this->status = $status; + $this->apiParas["status"] = $status; + } + + public function getStatus() + { + return $this->status; + } + + public function setTplParams($tplParams) + { + $this->tplParams = $tplParams; + $this->apiParas["tpl_params"] = $tplParams; + } + + public function getTplParams() + { + return $this->tplParams; + } + + public function setVerifyCode($verifyCode) + { + $this->verifyCode = $verifyCode; + $this->apiParas["verify_code"] = $verifyCode; + } + + public function getVerifyCode() + { + return $this->verifyCode; + } + + public function setVerifyType($verifyType) + { + $this->verifyType = $verifyType; + $this->apiParas["verify_type"] = $verifyType; + } + + public function getVerifyType() + { + return $this->verifyType; + } + + public function getApiMethodName() + { + return "alipay.pass.tpl.content.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPassTplUpdateRequest.php b/extend/alipay/aop/request/AlipayPassTplUpdateRequest.php new file mode 100644 index 0000000..215e417 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPassTplUpdateRequest.php @@ -0,0 +1,134 @@ +tplContent = $tplContent; + $this->apiParas["tpl_content"] = $tplContent; + } + + public function getTplContent() + { + return $this->tplContent; + } + + public function setTplId($tplId) + { + $this->tplId = $tplId; + $this->apiParas["tpl_id"] = $tplId; + } + + public function getTplId() + { + return $this->tplId; + } + + public function getApiMethodName() + { + return "alipay.pass.tpl.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPassVerifyQueryRequest.php b/extend/alipay/aop/request/AlipayPassVerifyQueryRequest.php new file mode 100644 index 0000000..fa69d9d --- /dev/null +++ b/extend/alipay/aop/request/AlipayPassVerifyQueryRequest.php @@ -0,0 +1,118 @@ +verifyCode = $verifyCode; + $this->apiParas["verify_code"] = $verifyCode; + } + + public function getVerifyCode() + { + return $this->verifyCode; + } + + public function getApiMethodName() + { + return "alipay.pass.verify.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPayAppMarketingConsultRequest.php b/extend/alipay/aop/request/AlipayPayAppMarketingConsultRequest.php new file mode 100644 index 0000000..3d33689 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPayAppMarketingConsultRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pay.app.marketing.consult"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPayCodecHschoolDecodeUseRequest.php b/extend/alipay/aop/request/AlipayPayCodecHschoolDecodeUseRequest.php new file mode 100644 index 0000000..277f0ac --- /dev/null +++ b/extend/alipay/aop/request/AlipayPayCodecHschoolDecodeUseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pay.codec.hschool.decode.use"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiAuthAccumulationQueryRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthAccumulationQueryRequest.php new file mode 100644 index 0000000..07c0709 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthAccumulationQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.auth.accumulation.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiAuthAgreementCloseRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthAgreementCloseRequest.php new file mode 100644 index 0000000..79502b2 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthAgreementCloseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.auth.agreement.close"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiAuthAgreementQueryRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthAgreementQueryRequest.php new file mode 100644 index 0000000..12f566b --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthAgreementQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.auth.agreement.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiAuthBusinessConfirmRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthBusinessConfirmRequest.php new file mode 100644 index 0000000..7473c99 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthBusinessConfirmRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.auth.business.confirm"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiAuthOrderCloseRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthOrderCloseRequest.php new file mode 100644 index 0000000..6e0908c --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthOrderCloseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.auth.order.close"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiAuthOrderQueryRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthOrderQueryRequest.php new file mode 100644 index 0000000..999a9a3 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthOrderQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.auth.order.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiAuthOrderUnfreezeRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthOrderUnfreezeRequest.php new file mode 100644 index 0000000..a2e864b --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthOrderUnfreezeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.auth.order.unfreeze"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiAuthRefundApplyRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthRefundApplyRequest.php new file mode 100644 index 0000000..4b5614a --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthRefundApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.auth.refund.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiAuthSettleApplyRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthSettleApplyRequest.php new file mode 100644 index 0000000..7476cec --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthSettleApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.auth.settle.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiAuthSignApplyRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthSignApplyRequest.php new file mode 100644 index 0000000..796238b --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiAuthSignApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.auth.sign.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiDiscountBillQueryRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiDiscountBillQueryRequest.php new file mode 100644 index 0000000..5131c85 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiDiscountBillQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.discount.bill.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiDiscountSolutionCreateRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiDiscountSolutionCreateRequest.php new file mode 100644 index 0000000..f0fe1bb --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiDiscountSolutionCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.discount.solution.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiDiscountSolutionModifyRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiDiscountSolutionModifyRequest.php new file mode 100644 index 0000000..9f08b6f --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiDiscountSolutionModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.discount.solution.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiDiscountSolutionOfflineRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiDiscountSolutionOfflineRequest.php new file mode 100644 index 0000000..c4cd2ce --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiDiscountSolutionOfflineRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.discount.solution.offline"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiDiscountSolutionOnlineRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiDiscountSolutionOnlineRequest.php new file mode 100644 index 0000000..5216205 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiDiscountSolutionOnlineRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.discount.solution.online"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiMerchantActivityCreateRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiMerchantActivityCreateRequest.php new file mode 100644 index 0000000..a7017e1 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiMerchantActivityCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.merchant.activity.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiMerchantActivityModifyRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiMerchantActivityModifyRequest.php new file mode 100644 index 0000000..d630516 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiMerchantActivityModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.merchant.activity.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiMerchantActivityOfflineRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiMerchantActivityOfflineRequest.php new file mode 100644 index 0000000..ae8921b --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiMerchantActivityOfflineRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.merchant.activity.offline"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiMerchantActivityOnlineRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiMerchantActivityOnlineRequest.php new file mode 100644 index 0000000..beaffc0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiMerchantActivityOnlineRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.merchant.activity.online"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiMerchantBillQueryRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiMerchantBillQueryRequest.php new file mode 100644 index 0000000..8698a9b --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiMerchantBillQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.merchant.bill.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditHuabeiPromoQueryRequest.php b/extend/alipay/aop/request/AlipayPcreditHuabeiPromoQueryRequest.php new file mode 100644 index 0000000..d92f94c --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditHuabeiPromoQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.huabei.promo.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditLoanApplyCreateRequest.php b/extend/alipay/aop/request/AlipayPcreditLoanApplyCreateRequest.php new file mode 100644 index 0000000..18b9f6e --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditLoanApplyCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.loan.apply.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPcreditLoanRefundCreateRequest.php b/extend/alipay/aop/request/AlipayPcreditLoanRefundCreateRequest.php new file mode 100644 index 0000000..fda4940 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPcreditLoanRefundCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.pcredit.loan.refund.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPlatformOpenidGetRequest.php b/extend/alipay/aop/request/AlipayPlatformOpenidGetRequest.php new file mode 100644 index 0000000..e3fbe2d --- /dev/null +++ b/extend/alipay/aop/request/AlipayPlatformOpenidGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.platform.openid.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPlatformUseridGetRequest.php b/extend/alipay/aop/request/AlipayPlatformUseridGetRequest.php new file mode 100644 index 0000000..73aa829 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPlatformUseridGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.platform.userid.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPointBalanceGetRequest.php b/extend/alipay/aop/request/AlipayPointBalanceGetRequest.php new file mode 100644 index 0000000..4370722 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPointBalanceGetRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPointBudgetGetRequest.php b/extend/alipay/aop/request/AlipayPointBudgetGetRequest.php new file mode 100644 index 0000000..eb466f7 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPointBudgetGetRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPointOrderAddRequest.php b/extend/alipay/aop/request/AlipayPointOrderAddRequest.php new file mode 100644 index 0000000..5499773 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPointOrderAddRequest.php @@ -0,0 +1,198 @@ +memo = $memo; + $this->apiParas["memo"] = $memo; + } + + public function getMemo() + { + return $this->memo; + } + + public function setMerchantOrderNo($merchantOrderNo) + { + $this->merchantOrderNo = $merchantOrderNo; + $this->apiParas["merchant_order_no"] = $merchantOrderNo; + } + + public function getMerchantOrderNo() + { + return $this->merchantOrderNo; + } + + public function setOrderTime($orderTime) + { + $this->orderTime = $orderTime; + $this->apiParas["order_time"] = $orderTime; + } + + public function getOrderTime() + { + return $this->orderTime; + } + + public function setPointCount($pointCount) + { + $this->pointCount = $pointCount; + $this->apiParas["point_count"] = $pointCount; + } + + public function getPointCount() + { + return $this->pointCount; + } + + public function setUserSymbol($userSymbol) + { + $this->userSymbol = $userSymbol; + $this->apiParas["user_symbol"] = $userSymbol; + } + + public function getUserSymbol() + { + return $this->userSymbol; + } + + public function setUserSymbolType($userSymbolType) + { + $this->userSymbolType = $userSymbolType; + $this->apiParas["user_symbol_type"] = $userSymbolType; + } + + public function getUserSymbolType() + { + return $this->userSymbolType; + } + + public function getApiMethodName() + { + return "alipay.point.order.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPointOrderGetRequest.php b/extend/alipay/aop/request/AlipayPointOrderGetRequest.php new file mode 100644 index 0000000..4c7615f --- /dev/null +++ b/extend/alipay/aop/request/AlipayPointOrderGetRequest.php @@ -0,0 +1,150 @@ +merchantOrderNo = $merchantOrderNo; + $this->apiParas["merchant_order_no"] = $merchantOrderNo; + } + + public function getMerchantOrderNo() + { + return $this->merchantOrderNo; + } + + public function setUserSymbol($userSymbol) + { + $this->userSymbol = $userSymbol; + $this->apiParas["user_symbol"] = $userSymbol; + } + + public function getUserSymbol() + { + return $this->userSymbol; + } + + public function setUserSymbolType($userSymbolType) + { + $this->userSymbolType = $userSymbolType; + $this->apiParas["user_symbol_type"] = $userSymbolType; + } + + public function getUserSymbolType() + { + return $this->userSymbolType; + } + + public function getApiMethodName() + { + return "alipay.point.order.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayPromorulecenterRuleAnalyzeRequest.php b/extend/alipay/aop/request/AlipayPromorulecenterRuleAnalyzeRequest.php new file mode 100644 index 0000000..f41ffb1 --- /dev/null +++ b/extend/alipay/aop/request/AlipayPromorulecenterRuleAnalyzeRequest.php @@ -0,0 +1,150 @@ +bizId = $bizId; + $this->apiParas["biz_id"] = $bizId; + } + + public function getBizId() + { + return $this->bizId; + } + + public function setRuleUuid($ruleUuid) + { + $this->ruleUuid = $ruleUuid; + $this->apiParas["rule_uuid"] = $ruleUuid; + } + + public function getRuleUuid() + { + return $this->ruleUuid; + } + + public function setUserId($userId) + { + $this->userId = $userId; + $this->apiParas["user_id"] = $userId; + } + + public function getUserId() + { + return $this->userId; + } + + public function getApiMethodName() + { + return "alipay.promorulecenter.rule.analyze"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityInfoAnalysisRequest.php b/extend/alipay/aop/request/AlipaySecurityInfoAnalysisRequest.php new file mode 100644 index 0000000..767aa83 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityInfoAnalysisRequest.php @@ -0,0 +1,470 @@ +envClientBaseBand = $envClientBaseBand; + $this->apiParas["env_client_base_band"] = $envClientBaseBand; + } + + public function getEnvClientBaseBand() + { + return $this->envClientBaseBand; + } + + public function setEnvClientBaseStation($envClientBaseStation) + { + $this->envClientBaseStation = $envClientBaseStation; + $this->apiParas["env_client_base_station"] = $envClientBaseStation; + } + + public function getEnvClientBaseStation() + { + return $this->envClientBaseStation; + } + + public function setEnvClientCoordinates($envClientCoordinates) + { + $this->envClientCoordinates = $envClientCoordinates; + $this->apiParas["env_client_coordinates"] = $envClientCoordinates; + } + + public function getEnvClientCoordinates() + { + return $this->envClientCoordinates; + } + + public function setEnvClientImei($envClientImei) + { + $this->envClientImei = $envClientImei; + $this->apiParas["env_client_imei"] = $envClientImei; + } + + public function getEnvClientImei() + { + return $this->envClientImei; + } + + public function setEnvClientImsi($envClientImsi) + { + $this->envClientImsi = $envClientImsi; + $this->apiParas["env_client_imsi"] = $envClientImsi; + } + + public function getEnvClientImsi() + { + return $this->envClientImsi; + } + + public function setEnvClientIosUdid($envClientIosUdid) + { + $this->envClientIosUdid = $envClientIosUdid; + $this->apiParas["env_client_ios_udid"] = $envClientIosUdid; + } + + public function getEnvClientIosUdid() + { + return $this->envClientIosUdid; + } + + public function setEnvClientIp($envClientIp) + { + $this->envClientIp = $envClientIp; + $this->apiParas["env_client_ip"] = $envClientIp; + } + + public function getEnvClientIp() + { + return $this->envClientIp; + } + + public function setEnvClientMac($envClientMac) + { + $this->envClientMac = $envClientMac; + $this->apiParas["env_client_mac"] = $envClientMac; + } + + public function getEnvClientMac() + { + return $this->envClientMac; + } + + public function setEnvClientScreen($envClientScreen) + { + $this->envClientScreen = $envClientScreen; + $this->apiParas["env_client_screen"] = $envClientScreen; + } + + public function getEnvClientScreen() + { + return $this->envClientScreen; + } + + public function setEnvClientUuid($envClientUuid) + { + $this->envClientUuid = $envClientUuid; + $this->apiParas["env_client_uuid"] = $envClientUuid; + } + + public function getEnvClientUuid() + { + return $this->envClientUuid; + } + + public function setJsTokenId($jsTokenId) + { + $this->jsTokenId = $jsTokenId; + $this->apiParas["js_token_id"] = $jsTokenId; + } + + public function getJsTokenId() + { + return $this->jsTokenId; + } + + public function setPartnerId($partnerId) + { + $this->partnerId = $partnerId; + $this->apiParas["partner_id"] = $partnerId; + } + + public function getPartnerId() + { + return $this->partnerId; + } + + public function setSceneCode($sceneCode) + { + $this->sceneCode = $sceneCode; + $this->apiParas["scene_code"] = $sceneCode; + } + + public function getSceneCode() + { + return $this->sceneCode; + } + + public function setUserAccountNo($userAccountNo) + { + $this->userAccountNo = $userAccountNo; + $this->apiParas["user_account_no"] = $userAccountNo; + } + + public function getUserAccountNo() + { + return $this->userAccountNo; + } + + public function setUserBindBankcard($userBindBankcard) + { + $this->userBindBankcard = $userBindBankcard; + $this->apiParas["user_bind_bankcard"] = $userBindBankcard; + } + + public function getUserBindBankcard() + { + return $this->userBindBankcard; + } + + public function setUserBindBankcardType($userBindBankcardType) + { + $this->userBindBankcardType = $userBindBankcardType; + $this->apiParas["user_bind_bankcard_type"] = $userBindBankcardType; + } + + public function getUserBindBankcardType() + { + return $this->userBindBankcardType; + } + + public function setUserBindMobile($userBindMobile) + { + $this->userBindMobile = $userBindMobile; + $this->apiParas["user_bind_mobile"] = $userBindMobile; + } + + public function getUserBindMobile() + { + return $this->userBindMobile; + } + + public function setUserIdentityType($userIdentityType) + { + $this->userIdentityType = $userIdentityType; + $this->apiParas["user_identity_type"] = $userIdentityType; + } + + public function getUserIdentityType() + { + return $this->userIdentityType; + } + + public function setUserRealName($userRealName) + { + $this->userRealName = $userRealName; + $this->apiParas["user_real_name"] = $userRealName; + } + + public function getUserRealName() + { + return $this->userRealName; + } + + public function setUserRegDate($userRegDate) + { + $this->userRegDate = $userRegDate; + $this->apiParas["user_reg_date"] = $userRegDate; + } + + public function getUserRegDate() + { + return $this->userRegDate; + } + + public function setUserRegEmail($userRegEmail) + { + $this->userRegEmail = $userRegEmail; + $this->apiParas["user_reg_email"] = $userRegEmail; + } + + public function getUserRegEmail() + { + return $this->userRegEmail; + } + + public function setUserRegMobile($userRegMobile) + { + $this->userRegMobile = $userRegMobile; + $this->apiParas["user_reg_mobile"] = $userRegMobile; + } + + public function getUserRegMobile() + { + return $this->userRegMobile; + } + + public function setUserrIdentityNo($userrIdentityNo) + { + $this->userrIdentityNo = $userrIdentityNo; + $this->apiParas["userr_identity_no"] = $userrIdentityNo; + } + + public function getUserrIdentityNo() + { + return $this->userrIdentityNo; + } + + public function getApiMethodName() + { + return "alipay.security.info.analysis"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdAlipaySecurityProdTestRequest.php b/extend/alipay/aop/request/AlipaySecurityProdAlipaySecurityProdTestRequest.php new file mode 100644 index 0000000..ff7c33e --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdAlipaySecurityProdTestRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.alipay.security.prod.test"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdAmlriskQueryRequest.php b/extend/alipay/aop/request/AlipaySecurityProdAmlriskQueryRequest.php new file mode 100644 index 0000000..5a7babc --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdAmlriskQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.amlrisk.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdCheckIqQueryRequest.php b/extend/alipay/aop/request/AlipaySecurityProdCheckIqQueryRequest.php new file mode 100644 index 0000000..eb84087 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdCheckIqQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.check.iq.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdDdsBatchqueryRequest.php b/extend/alipay/aop/request/AlipaySecurityProdDdsBatchqueryRequest.php new file mode 100644 index 0000000..c6ebc83 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdDdsBatchqueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdDesQueryRequest.php b/extend/alipay/aop/request/AlipaySecurityProdDesQueryRequest.php new file mode 100644 index 0000000..f91c389 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdDesQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.des.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdDfasfdasFdfdsBatchqueryRequest.php b/extend/alipay/aop/request/AlipaySecurityProdDfasfdasFdfdsBatchqueryRequest.php new file mode 100644 index 0000000..a8f5851 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdDfasfdasFdfdsBatchqueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdDfesfDefBatchqueryRequest.php b/extend/alipay/aop/request/AlipaySecurityProdDfesfDefBatchqueryRequest.php new file mode 100644 index 0000000..aabe4d6 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdDfesfDefBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.dfesf.def.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdFacePayCreateRequest.php b/extend/alipay/aop/request/AlipaySecurityProdFacePayCreateRequest.php new file mode 100644 index 0000000..73e1a29 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdFacePayCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.face.pay.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdFacePayRequest.php b/extend/alipay/aop/request/AlipaySecurityProdFacePayRequest.php new file mode 100644 index 0000000..1276f7c --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdFacePayRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.face.pay"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdFacerepoAddRequest.php b/extend/alipay/aop/request/AlipaySecurityProdFacerepoAddRequest.php new file mode 100644 index 0000000..d5e6c0a --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdFacerepoAddRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.facerepo.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdFacerepoSearchRequest.php b/extend/alipay/aop/request/AlipaySecurityProdFacerepoSearchRequest.php new file mode 100644 index 0000000..aeec25a --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdFacerepoSearchRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.facerepo.search"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdFingerprintApplyInitializeRequest.php b/extend/alipay/aop/request/AlipaySecurityProdFingerprintApplyInitializeRequest.php new file mode 100644 index 0000000..ce0fd9a --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdFingerprintApplyInitializeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.fingerprint.apply.initialize"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdFingerprintApplyRequest.php b/extend/alipay/aop/request/AlipaySecurityProdFingerprintApplyRequest.php new file mode 100644 index 0000000..3a59363 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdFingerprintApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.fingerprint.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdFingerprintDeleteRequest.php b/extend/alipay/aop/request/AlipaySecurityProdFingerprintDeleteRequest.php new file mode 100644 index 0000000..2dce08f --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdFingerprintDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.fingerprint.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdFingerprintDeviceVerifyRequest.php b/extend/alipay/aop/request/AlipaySecurityProdFingerprintDeviceVerifyRequest.php new file mode 100644 index 0000000..1d75a90 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdFingerprintDeviceVerifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.fingerprint.device.verify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdFingerprintRiskcontrolQueryRequest.php b/extend/alipay/aop/request/AlipaySecurityProdFingerprintRiskcontrolQueryRequest.php new file mode 100644 index 0000000..3435f02 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdFingerprintRiskcontrolQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.fingerprint.riskcontrol.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdFingerprintVerifyInitializeRequest.php b/extend/alipay/aop/request/AlipaySecurityProdFingerprintVerifyInitializeRequest.php new file mode 100644 index 0000000..e7d5493 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdFingerprintVerifyInitializeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.fingerprint.verify.initialize"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdFingerprintVerifyRequest.php b/extend/alipay/aop/request/AlipaySecurityProdFingerprintVerifyRequest.php new file mode 100644 index 0000000..4ff841f --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdFingerprintVerifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.fingerprint.verify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdMyQueryRequest.php b/extend/alipay/aop/request/AlipaySecurityProdMyQueryRequest.php new file mode 100644 index 0000000..c996b98 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdMyQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdNopidBatchqueryRequest.php b/extend/alipay/aop/request/AlipaySecurityProdNopidBatchqueryRequest.php new file mode 100644 index 0000000..69954f9 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdNopidBatchqueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdShopQueryRequest.php b/extend/alipay/aop/request/AlipaySecurityProdShopQueryRequest.php new file mode 100644 index 0000000..38f935f --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdShopQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdSignatureFileUploadRequest.php b/extend/alipay/aop/request/AlipaySecurityProdSignatureFileUploadRequest.php new file mode 100644 index 0000000..875318c --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdSignatureFileUploadRequest.php @@ -0,0 +1,134 @@ +bizProduct = $bizProduct; + $this->apiParas["biz_product"] = $bizProduct; + } + + public function getBizProduct() + { + return $this->bizProduct; + } + + public function setFileContent($fileContent) + { + $this->fileContent = $fileContent; + $this->apiParas["file_content"] = $fileContent; + } + + public function getFileContent() + { + return $this->fileContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.signature.file.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdSignatureTaskApplyRequest.php b/extend/alipay/aop/request/AlipaySecurityProdSignatureTaskApplyRequest.php new file mode 100644 index 0000000..1f81c52 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdSignatureTaskApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.signature.task.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdSignatureTaskCancelRequest.php b/extend/alipay/aop/request/AlipaySecurityProdSignatureTaskCancelRequest.php new file mode 100644 index 0000000..642ccbe --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdSignatureTaskCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.signature.task.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdSignatureTaskQueryRequest.php b/extend/alipay/aop/request/AlipaySecurityProdSignatureTaskQueryRequest.php new file mode 100644 index 0000000..8fdecd6 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdSignatureTaskQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.signature.task.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdXwbtestabcAbcQueryRequest.php b/extend/alipay/aop/request/AlipaySecurityProdXwbtestabcAbcQueryRequest.php new file mode 100644 index 0000000..27cd58e --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdXwbtestabcAbcQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.xwbtestabc.abc.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityProdXwbtestprodQueryRequest.php b/extend/alipay/aop/request/AlipaySecurityProdXwbtestprodQueryRequest.php new file mode 100644 index 0000000..558204c --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityProdXwbtestprodQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.prod.xwbtestprod.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityRiskContentDetectRequest.php b/extend/alipay/aop/request/AlipaySecurityRiskContentDetectRequest.php new file mode 100644 index 0000000..71b7866 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityRiskContentDetectRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.risk.content.detect"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityRiskCustomerriskQueryRequest.php b/extend/alipay/aop/request/AlipaySecurityRiskCustomerriskQueryRequest.php new file mode 100644 index 0000000..7809f09 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityRiskCustomerriskQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.risk.customerrisk.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityRiskCustomerriskSendRequest.php b/extend/alipay/aop/request/AlipaySecurityRiskCustomerriskSendRequest.php new file mode 100644 index 0000000..e248b31 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityRiskCustomerriskSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.risk.customerrisk.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityRiskDetectRequest.php b/extend/alipay/aop/request/AlipaySecurityRiskDetectRequest.php new file mode 100644 index 0000000..244fffe --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityRiskDetectRequest.php @@ -0,0 +1,998 @@ +buyerAccountNo = $buyerAccountNo; + $this->apiParas["buyer_account_no"] = $buyerAccountNo; + } + + public function getBuyerAccountNo() + { + return $this->buyerAccountNo; + } + + public function setBuyerBindBankcard($buyerBindBankcard) + { + $this->buyerBindBankcard = $buyerBindBankcard; + $this->apiParas["buyer_bind_bankcard"] = $buyerBindBankcard; + } + + public function getBuyerBindBankcard() + { + return $this->buyerBindBankcard; + } + + public function setBuyerBindBankcardType($buyerBindBankcardType) + { + $this->buyerBindBankcardType = $buyerBindBankcardType; + $this->apiParas["buyer_bind_bankcard_type"] = $buyerBindBankcardType; + } + + public function getBuyerBindBankcardType() + { + return $this->buyerBindBankcardType; + } + + public function setBuyerBindMobile($buyerBindMobile) + { + $this->buyerBindMobile = $buyerBindMobile; + $this->apiParas["buyer_bind_mobile"] = $buyerBindMobile; + } + + public function getBuyerBindMobile() + { + return $this->buyerBindMobile; + } + + public function setBuyerGrade($buyerGrade) + { + $this->buyerGrade = $buyerGrade; + $this->apiParas["buyer_grade"] = $buyerGrade; + } + + public function getBuyerGrade() + { + return $this->buyerGrade; + } + + public function setBuyerIdentityNo($buyerIdentityNo) + { + $this->buyerIdentityNo = $buyerIdentityNo; + $this->apiParas["buyer_identity_no"] = $buyerIdentityNo; + } + + public function getBuyerIdentityNo() + { + return $this->buyerIdentityNo; + } + + public function setBuyerIdentityType($buyerIdentityType) + { + $this->buyerIdentityType = $buyerIdentityType; + $this->apiParas["buyer_identity_type"] = $buyerIdentityType; + } + + public function getBuyerIdentityType() + { + return $this->buyerIdentityType; + } + + public function setBuyerRealName($buyerRealName) + { + $this->buyerRealName = $buyerRealName; + $this->apiParas["buyer_real_name"] = $buyerRealName; + } + + public function getBuyerRealName() + { + return $this->buyerRealName; + } + + public function setBuyerRegDate($buyerRegDate) + { + $this->buyerRegDate = $buyerRegDate; + $this->apiParas["buyer_reg_date"] = $buyerRegDate; + } + + public function getBuyerRegDate() + { + return $this->buyerRegDate; + } + + public function setBuyerRegEmail($buyerRegEmail) + { + $this->buyerRegEmail = $buyerRegEmail; + $this->apiParas["buyer_reg_email"] = $buyerRegEmail; + } + + public function getBuyerRegEmail() + { + return $this->buyerRegEmail; + } + + public function setBuyerRegMobile($buyerRegMobile) + { + $this->buyerRegMobile = $buyerRegMobile; + $this->apiParas["buyer_reg_mobile"] = $buyerRegMobile; + } + + public function getBuyerRegMobile() + { + return $this->buyerRegMobile; + } + + public function setBuyerSceneBankcard($buyerSceneBankcard) + { + $this->buyerSceneBankcard = $buyerSceneBankcard; + $this->apiParas["buyer_scene_bankcard"] = $buyerSceneBankcard; + } + + public function getBuyerSceneBankcard() + { + return $this->buyerSceneBankcard; + } + + public function setBuyerSceneBankcardType($buyerSceneBankcardType) + { + $this->buyerSceneBankcardType = $buyerSceneBankcardType; + $this->apiParas["buyer_scene_bankcard_type"] = $buyerSceneBankcardType; + } + + public function getBuyerSceneBankcardType() + { + return $this->buyerSceneBankcardType; + } + + public function setBuyerSceneEmail($buyerSceneEmail) + { + $this->buyerSceneEmail = $buyerSceneEmail; + $this->apiParas["buyer_scene_email"] = $buyerSceneEmail; + } + + public function getBuyerSceneEmail() + { + return $this->buyerSceneEmail; + } + + public function setBuyerSceneMobile($buyerSceneMobile) + { + $this->buyerSceneMobile = $buyerSceneMobile; + $this->apiParas["buyer_scene_mobile"] = $buyerSceneMobile; + } + + public function getBuyerSceneMobile() + { + return $this->buyerSceneMobile; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + $this->apiParas["currency"] = $currency; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setEnvClientBaseBand($envClientBaseBand) + { + $this->envClientBaseBand = $envClientBaseBand; + $this->apiParas["env_client_base_band"] = $envClientBaseBand; + } + + public function getEnvClientBaseBand() + { + return $this->envClientBaseBand; + } + + public function setEnvClientBaseStation($envClientBaseStation) + { + $this->envClientBaseStation = $envClientBaseStation; + $this->apiParas["env_client_base_station"] = $envClientBaseStation; + } + + public function getEnvClientBaseStation() + { + return $this->envClientBaseStation; + } + + public function setEnvClientCoordinates($envClientCoordinates) + { + $this->envClientCoordinates = $envClientCoordinates; + $this->apiParas["env_client_coordinates"] = $envClientCoordinates; + } + + public function getEnvClientCoordinates() + { + return $this->envClientCoordinates; + } + + public function setEnvClientImei($envClientImei) + { + $this->envClientImei = $envClientImei; + $this->apiParas["env_client_imei"] = $envClientImei; + } + + public function getEnvClientImei() + { + return $this->envClientImei; + } + + public function setEnvClientImsi($envClientImsi) + { + $this->envClientImsi = $envClientImsi; + $this->apiParas["env_client_imsi"] = $envClientImsi; + } + + public function getEnvClientImsi() + { + return $this->envClientImsi; + } + + public function setEnvClientIosUdid($envClientIosUdid) + { + $this->envClientIosUdid = $envClientIosUdid; + $this->apiParas["env_client_ios_udid"] = $envClientIosUdid; + } + + public function getEnvClientIosUdid() + { + return $this->envClientIosUdid; + } + + public function setEnvClientIp($envClientIp) + { + $this->envClientIp = $envClientIp; + $this->apiParas["env_client_ip"] = $envClientIp; + } + + public function getEnvClientIp() + { + return $this->envClientIp; + } + + public function setEnvClientMac($envClientMac) + { + $this->envClientMac = $envClientMac; + $this->apiParas["env_client_mac"] = $envClientMac; + } + + public function getEnvClientMac() + { + return $this->envClientMac; + } + + public function setEnvClientScreen($envClientScreen) + { + $this->envClientScreen = $envClientScreen; + $this->apiParas["env_client_screen"] = $envClientScreen; + } + + public function getEnvClientScreen() + { + return $this->envClientScreen; + } + + public function setEnvClientUuid($envClientUuid) + { + $this->envClientUuid = $envClientUuid; + $this->apiParas["env_client_uuid"] = $envClientUuid; + } + + public function getEnvClientUuid() + { + return $this->envClientUuid; + } + + public function setItemQuantity($itemQuantity) + { + $this->itemQuantity = $itemQuantity; + $this->apiParas["item_quantity"] = $itemQuantity; + } + + public function getItemQuantity() + { + return $this->itemQuantity; + } + + public function setItemUnitPrice($itemUnitPrice) + { + $this->itemUnitPrice = $itemUnitPrice; + $this->apiParas["item_unit_price"] = $itemUnitPrice; + } + + public function getItemUnitPrice() + { + return $this->itemUnitPrice; + } + + public function setJsTokenId($jsTokenId) + { + $this->jsTokenId = $jsTokenId; + $this->apiParas["js_token_id"] = $jsTokenId; + } + + public function getJsTokenId() + { + return $this->jsTokenId; + } + + public function setOrderAmount($orderAmount) + { + $this->orderAmount = $orderAmount; + $this->apiParas["order_amount"] = $orderAmount; + } + + public function getOrderAmount() + { + return $this->orderAmount; + } + + public function setOrderCategory($orderCategory) + { + $this->orderCategory = $orderCategory; + $this->apiParas["order_category"] = $orderCategory; + } + + public function getOrderCategory() + { + return $this->orderCategory; + } + + public function setOrderCredateTime($orderCredateTime) + { + $this->orderCredateTime = $orderCredateTime; + $this->apiParas["order_credate_time"] = $orderCredateTime; + } + + public function getOrderCredateTime() + { + return $this->orderCredateTime; + } + + public function setOrderItemCity($orderItemCity) + { + $this->orderItemCity = $orderItemCity; + $this->apiParas["order_item_city"] = $orderItemCity; + } + + public function getOrderItemCity() + { + return $this->orderItemCity; + } + + public function setOrderItemName($orderItemName) + { + $this->orderItemName = $orderItemName; + $this->apiParas["order_item_name"] = $orderItemName; + } + + public function getOrderItemName() + { + return $this->orderItemName; + } + + public function setOrderNo($orderNo) + { + $this->orderNo = $orderNo; + $this->apiParas["order_no"] = $orderNo; + } + + public function getOrderNo() + { + return $this->orderNo; + } + + public function setPartnerId($partnerId) + { + $this->partnerId = $partnerId; + $this->apiParas["partner_id"] = $partnerId; + } + + public function getPartnerId() + { + return $this->partnerId; + } + + public function setReceiverAddress($receiverAddress) + { + $this->receiverAddress = $receiverAddress; + $this->apiParas["receiver_address"] = $receiverAddress; + } + + public function getReceiverAddress() + { + return $this->receiverAddress; + } + + public function setReceiverCity($receiverCity) + { + $this->receiverCity = $receiverCity; + $this->apiParas["receiver_city"] = $receiverCity; + } + + public function getReceiverCity() + { + return $this->receiverCity; + } + + public function setReceiverDistrict($receiverDistrict) + { + $this->receiverDistrict = $receiverDistrict; + $this->apiParas["receiver_district"] = $receiverDistrict; + } + + public function getReceiverDistrict() + { + return $this->receiverDistrict; + } + + public function setReceiverEmail($receiverEmail) + { + $this->receiverEmail = $receiverEmail; + $this->apiParas["receiver_email"] = $receiverEmail; + } + + public function getReceiverEmail() + { + return $this->receiverEmail; + } + + public function setReceiverMobile($receiverMobile) + { + $this->receiverMobile = $receiverMobile; + $this->apiParas["receiver_mobile"] = $receiverMobile; + } + + public function getReceiverMobile() + { + return $this->receiverMobile; + } + + public function setReceiverName($receiverName) + { + $this->receiverName = $receiverName; + $this->apiParas["receiver_name"] = $receiverName; + } + + public function getReceiverName() + { + return $this->receiverName; + } + + public function setReceiverState($receiverState) + { + $this->receiverState = $receiverState; + $this->apiParas["receiver_state"] = $receiverState; + } + + public function getReceiverState() + { + return $this->receiverState; + } + + public function setReceiverZip($receiverZip) + { + $this->receiverZip = $receiverZip; + $this->apiParas["receiver_zip"] = $receiverZip; + } + + public function getReceiverZip() + { + return $this->receiverZip; + } + + public function setSceneCode($sceneCode) + { + $this->sceneCode = $sceneCode; + $this->apiParas["scene_code"] = $sceneCode; + } + + public function getSceneCode() + { + return $this->sceneCode; + } + + public function setSellerAccountNo($sellerAccountNo) + { + $this->sellerAccountNo = $sellerAccountNo; + $this->apiParas["seller_account_no"] = $sellerAccountNo; + } + + public function getSellerAccountNo() + { + return $this->sellerAccountNo; + } + + public function setSellerBindBankcard($sellerBindBankcard) + { + $this->sellerBindBankcard = $sellerBindBankcard; + $this->apiParas["seller_bind_bankcard"] = $sellerBindBankcard; + } + + public function getSellerBindBankcard() + { + return $this->sellerBindBankcard; + } + + public function setSellerBindBankcardType($sellerBindBankcardType) + { + $this->sellerBindBankcardType = $sellerBindBankcardType; + $this->apiParas["seller_bind_bankcard_type"] = $sellerBindBankcardType; + } + + public function getSellerBindBankcardType() + { + return $this->sellerBindBankcardType; + } + + public function setSellerBindMobile($sellerBindMobile) + { + $this->sellerBindMobile = $sellerBindMobile; + $this->apiParas["seller_bind_mobile"] = $sellerBindMobile; + } + + public function getSellerBindMobile() + { + return $this->sellerBindMobile; + } + + public function setSellerIdentityNo($sellerIdentityNo) + { + $this->sellerIdentityNo = $sellerIdentityNo; + $this->apiParas["seller_identity_no"] = $sellerIdentityNo; + } + + public function getSellerIdentityNo() + { + return $this->sellerIdentityNo; + } + + public function setSellerIdentityType($sellerIdentityType) + { + $this->sellerIdentityType = $sellerIdentityType; + $this->apiParas["seller_identity_type"] = $sellerIdentityType; + } + + public function getSellerIdentityType() + { + return $this->sellerIdentityType; + } + + public function setSellerRealName($sellerRealName) + { + $this->sellerRealName = $sellerRealName; + $this->apiParas["seller_real_name"] = $sellerRealName; + } + + public function getSellerRealName() + { + return $this->sellerRealName; + } + + public function setSellerRegDate($sellerRegDate) + { + $this->sellerRegDate = $sellerRegDate; + $this->apiParas["seller_reg_date"] = $sellerRegDate; + } + + public function getSellerRegDate() + { + return $this->sellerRegDate; + } + + public function setSellerRegEmail($sellerRegEmail) + { + $this->sellerRegEmail = $sellerRegEmail; + $this->apiParas["seller_reg_email"] = $sellerRegEmail; + } + + public function getSellerRegEmail() + { + return $this->sellerRegEmail; + } + + public function setSellerRegMoile($sellerRegMoile) + { + $this->sellerRegMoile = $sellerRegMoile; + $this->apiParas["seller_reg_moile"] = $sellerRegMoile; + } + + public function getSellerRegMoile() + { + return $this->sellerRegMoile; + } + + public function setTransportType($transportType) + { + $this->transportType = $transportType; + $this->apiParas["transport_type"] = $transportType; + } + + public function getTransportType() + { + return $this->transportType; + } + + public function getApiMethodName() + { + return "alipay.security.risk.detect"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityRiskHideDeviceidQueryRequest.php b/extend/alipay/aop/request/AlipaySecurityRiskHideDeviceidQueryRequest.php new file mode 100644 index 0000000..62132c4 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityRiskHideDeviceidQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.risk.hide.deviceid.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityRiskRainscoreQueryRequest.php b/extend/alipay/aop/request/AlipaySecurityRiskRainscoreQueryRequest.php new file mode 100644 index 0000000..26a7ccb --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityRiskRainscoreQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.risk.rainscore.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecuritySssssssQueryRequest.php b/extend/alipay/aop/request/AlipaySecuritySssssssQueryRequest.php new file mode 100644 index 0000000..7b49ad3 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecuritySssssssQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.security.sssssss.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySecurityTesttestQueryRequest.php b/extend/alipay/aop/request/AlipaySecurityTesttestQueryRequest.php new file mode 100644 index 0000000..d5d1176 --- /dev/null +++ b/extend/alipay/aop/request/AlipaySecurityTesttestQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipaySystemOauthTokenRequest.php b/extend/alipay/aop/request/AlipaySystemOauthTokenRequest.php new file mode 100644 index 0000000..2c3c2fb --- /dev/null +++ b/extend/alipay/aop/request/AlipaySystemOauthTokenRequest.php @@ -0,0 +1,150 @@ +code = $code; + $this->apiParas["code"] = $code; + } + + public function getCode() + { + return $this->code; + } + + public function setGrantType($grantType) + { + $this->grantType = $grantType; + $this->apiParas["grant_type"] = $grantType; + } + + public function getGrantType() + { + return $this->grantType; + } + + public function setRefreshToken($refreshToken) + { + $this->refreshToken = $refreshToken; + $this->apiParas["refresh_token"] = $refreshToken; + } + + public function getRefreshToken() + { + return $this->refreshToken; + } + + public function getApiMethodName() + { + return "alipay.system.oauth.token"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeAdvanceConsultRequest.php b/extend/alipay/aop/request/AlipayTradeAdvanceConsultRequest.php new file mode 100644 index 0000000..63b221e --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeAdvanceConsultRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.advance.consult"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeAppPayRequest.php b/extend/alipay/aop/request/AlipayTradeAppPayRequest.php new file mode 100644 index 0000000..264a573 --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeAppPayRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.app.pay"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeCancelRequest.php b/extend/alipay/aop/request/AlipayTradeCancelRequest.php new file mode 100644 index 0000000..60fbb5c --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeCloseRequest.php b/extend/alipay/aop/request/AlipayTradeCloseRequest.php new file mode 100644 index 0000000..685c0ea --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeCloseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.close"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeCreateRequest.php b/extend/alipay/aop/request/AlipayTradeCreateRequest.php new file mode 100644 index 0000000..543431b --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeCustomsDeclareRequest.php b/extend/alipay/aop/request/AlipayTradeCustomsDeclareRequest.php new file mode 100644 index 0000000..7a45b44 --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeCustomsDeclareRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.customs.declare"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeCustomsQueryRequest.php b/extend/alipay/aop/request/AlipayTradeCustomsQueryRequest.php new file mode 100644 index 0000000..b2b27fe --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeCustomsQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.customs.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeFastpayRefundQueryRequest.php b/extend/alipay/aop/request/AlipayTradeFastpayRefundQueryRequest.php new file mode 100644 index 0000000..ed4cef4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeFastpayRefundQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.fastpay.refund.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeOrderSettleRequest.php b/extend/alipay/aop/request/AlipayTradeOrderSettleRequest.php new file mode 100644 index 0000000..c003079 --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeOrderSettleRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.order.settle"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeOrderinfoSyncRequest.php b/extend/alipay/aop/request/AlipayTradeOrderinfoSyncRequest.php new file mode 100644 index 0000000..5bb25b0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeOrderinfoSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.orderinfo.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradePagePayRequest.php b/extend/alipay/aop/request/AlipayTradePagePayRequest.php new file mode 100644 index 0000000..d98a3fd --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradePagePayRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.page.pay"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradePageRefundRequest.php b/extend/alipay/aop/request/AlipayTradePageRefundRequest.php new file mode 100644 index 0000000..220888f --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradePageRefundRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.page.refund"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradePayRequest.php b/extend/alipay/aop/request/AlipayTradePayRequest.php new file mode 100644 index 0000000..db63651 --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradePayRequest.php @@ -0,0 +1,119 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.pay"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradePrecreateRequest.php b/extend/alipay/aop/request/AlipayTradePrecreateRequest.php new file mode 100644 index 0000000..79f35f8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradePrecreateRequest.php @@ -0,0 +1,119 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.precreate"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeQueryRequest.php b/extend/alipay/aop/request/AlipayTradeQueryRequest.php new file mode 100644 index 0000000..75a668d --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeQueryRequest.php @@ -0,0 +1,119 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeRefundRequest.php b/extend/alipay/aop/request/AlipayTradeRefundRequest.php new file mode 100644 index 0000000..1fc81d7 --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeRefundRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.refund"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeRoyaltyRelationBatchqueryRequest.php b/extend/alipay/aop/request/AlipayTradeRoyaltyRelationBatchqueryRequest.php new file mode 100644 index 0000000..0e626ae --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeRoyaltyRelationBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.royalty.relation.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeRoyaltyRelationBindRequest.php b/extend/alipay/aop/request/AlipayTradeRoyaltyRelationBindRequest.php new file mode 100644 index 0000000..e700687 --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeRoyaltyRelationBindRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.royalty.relation.bind"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeRoyaltyRelationUnbindRequest.php b/extend/alipay/aop/request/AlipayTradeRoyaltyRelationUnbindRequest.php new file mode 100644 index 0000000..1b77d08 --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeRoyaltyRelationUnbindRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.royalty.relation.unbind"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeVendorpayDevicedataUploadRequest.php b/extend/alipay/aop/request/AlipayTradeVendorpayDevicedataUploadRequest.php new file mode 100644 index 0000000..94a3ee0 --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeVendorpayDevicedataUploadRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.vendorpay.devicedata.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTradeWapPayRequest.php b/extend/alipay/aop/request/AlipayTradeWapPayRequest.php new file mode 100644 index 0000000..b6cafba --- /dev/null +++ b/extend/alipay/aop/request/AlipayTradeWapPayRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.trade.wap.pay"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTransferThirdpartyBillCreateRequest.php b/extend/alipay/aop/request/AlipayTransferThirdpartyBillCreateRequest.php new file mode 100644 index 0000000..4f4c364 --- /dev/null +++ b/extend/alipay/aop/request/AlipayTransferThirdpartyBillCreateRequest.php @@ -0,0 +1,301 @@ +amount = $amount; + $this->apiParas["amount"] = $amount; + } + + public function getAmount() + { + return $this->amount; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + $this->apiParas["currency"] = $currency; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setExtParam($extParam) + { + $this->extParam = $extParam; + $this->apiParas["ext_param"] = $extParam; + } + + public function getExtParam() + { + return $this->extParam; + } + + public function setMemo($memo) + { + $this->memo = $memo; + $this->apiParas["memo"] = $memo; + } + + public function getMemo() + { + return $this->memo; + } + + public function setPartnerId($partnerId) + { + $this->partnerId = $partnerId; + $this->apiParas["partner_id"] = $partnerId; + } + + public function getPartnerId() + { + return $this->partnerId; + } + + public function setPayeeAccount($payeeAccount) + { + $this->payeeAccount = $payeeAccount; + $this->apiParas["payee_account"] = $payeeAccount; + } + + public function getPayeeAccount() + { + return $this->payeeAccount; + } + + public function setPayeeType($payeeType) + { + $this->payeeType = $payeeType; + $this->apiParas["payee_type"] = $payeeType; + } + + public function getPayeeType() + { + return $this->payeeType; + } + + public function setPayerAccount($payerAccount) + { + $this->payerAccount = $payerAccount; + $this->apiParas["payer_account"] = $payerAccount; + } + + public function getPayerAccount() + { + return $this->payerAccount; + } + + public function setPayerType($payerType) + { + $this->payerType = $payerType; + $this->apiParas["payer_type"] = $payerType; + } + + public function getPayerType() + { + return $this->payerType; + } + + public function setPaymentId($paymentId) + { + $this->paymentId = $paymentId; + $this->apiParas["payment_id"] = $paymentId; + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function setPaymentSource($paymentSource) + { + $this->paymentSource = $paymentSource; + $this->apiParas["payment_source"] = $paymentSource; + } + + public function getPaymentSource() + { + return $this->paymentSource; + } + + public function setTitle($title) + { + $this->title = $title; + $this->apiParas["title"] = $title; + } + + public function getTitle() + { + return $this->title; + } + + public function getApiMethodName() + { + return "alipay.transfer.thirdparty.bill.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTrustUserAuthSendRequest.php b/extend/alipay/aop/request/AlipayTrustUserAuthSendRequest.php new file mode 100644 index 0000000..2b26750 --- /dev/null +++ b/extend/alipay/aop/request/AlipayTrustUserAuthSendRequest.php @@ -0,0 +1,118 @@ +aliTrustUserInfo = $aliTrustUserInfo; + $this->apiParas["ali_trust_user_info"] = $aliTrustUserInfo; + } + + public function getAliTrustUserInfo() + { + return $this->aliTrustUserInfo; + } + + public function getApiMethodName() + { + return "alipay.trust.user.auth.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTrustUserReportGetRequest.php b/extend/alipay/aop/request/AlipayTrustUserReportGetRequest.php new file mode 100644 index 0000000..e4e1275 --- /dev/null +++ b/extend/alipay/aop/request/AlipayTrustUserReportGetRequest.php @@ -0,0 +1,134 @@ +scene = $scene; + $this->apiParas["scene"] = $scene; + } + + public function getScene() + { + return $this->scene; + } + + public function setType($type) + { + $this->type = $type; + $this->apiParas["type"] = $type; + } + + public function getType() + { + return $this->type; + } + + public function getApiMethodName() + { + return "alipay.trust.user.report.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTrustUserRiskidentifyGetRequest.php b/extend/alipay/aop/request/AlipayTrustUserRiskidentifyGetRequest.php new file mode 100644 index 0000000..4e3367f --- /dev/null +++ b/extend/alipay/aop/request/AlipayTrustUserRiskidentifyGetRequest.php @@ -0,0 +1,118 @@ +type = $type; + $this->apiParas["type"] = $type; + } + + public function getType() + { + return $this->type; + } + + public function getApiMethodName() + { + return "alipay.trust.user.riskidentify.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTrustUserScoreGetRequest.php b/extend/alipay/aop/request/AlipayTrustUserScoreGetRequest.php new file mode 100644 index 0000000..7ca5850 --- /dev/null +++ b/extend/alipay/aop/request/AlipayTrustUserScoreGetRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayTrustUserTokenGetRequest.php b/extend/alipay/aop/request/AlipayTrustUserTokenGetRequest.php new file mode 100644 index 0000000..177462f --- /dev/null +++ b/extend/alipay/aop/request/AlipayTrustUserTokenGetRequest.php @@ -0,0 +1,118 @@ +aliTrustUserInfo = $aliTrustUserInfo; + $this->apiParas["ali_trust_user_info"] = $aliTrustUserInfo; + } + + public function getAliTrustUserInfo() + { + return $this->aliTrustUserInfo; + } + + public function getApiMethodName() + { + return "alipay.trust.user.token.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserAccountFreezeGetRequest.php b/extend/alipay/aop/request/AlipayUserAccountFreezeGetRequest.php new file mode 100644 index 0000000..8191409 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserAccountFreezeGetRequest.php @@ -0,0 +1,118 @@ +freezeType = $freezeType; + $this->apiParas["freeze_type"] = $freezeType; + } + + public function getFreezeType() + { + return $this->freezeType; + } + + public function getApiMethodName() + { + return "alipay.user.account.freeze.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserAccountGetRequest.php b/extend/alipay/aop/request/AlipayUserAccountGetRequest.php new file mode 100644 index 0000000..88b25c7 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserAccountGetRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserAccountSearchRequest.php b/extend/alipay/aop/request/AlipayUserAccountSearchRequest.php new file mode 100644 index 0000000..5f13b36 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserAccountSearchRequest.php @@ -0,0 +1,198 @@ +endTime = $endTime; + $this->apiParas["end_time"] = $endTime; + } + + public function getEndTime() + { + return $this->endTime; + } + + public function setFields($fields) + { + $this->fields = $fields; + $this->apiParas["fields"] = $fields; + } + + public function getFields() + { + return $this->fields; + } + + public function setPageNo($pageNo) + { + $this->pageNo = $pageNo; + $this->apiParas["page_no"] = $pageNo; + } + + public function getPageNo() + { + return $this->pageNo; + } + + public function setPageSize($pageSize) + { + $this->pageSize = $pageSize; + $this->apiParas["page_size"] = $pageSize; + } + + public function getPageSize() + { + return $this->pageSize; + } + + public function setStartTime($startTime) + { + $this->startTime = $startTime; + $this->apiParas["start_time"] = $startTime; + } + + public function getStartTime() + { + return $this->startTime; + } + + public function setType($type) + { + $this->type = $type; + $this->apiParas["type"] = $type; + } + + public function getType() + { + return $this->type; + } + + public function getApiMethodName() + { + return "alipay.user.account.search"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserAccountUseridBatchqueryRequest.php b/extend/alipay/aop/request/AlipayUserAccountUseridBatchqueryRequest.php new file mode 100644 index 0000000..374f09c --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserAccountUseridBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.account.userid.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserAddressQueryRequest.php b/extend/alipay/aop/request/AlipayUserAddressQueryRequest.php new file mode 100644 index 0000000..4e458d8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserAddressQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.address.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserAgreementExecutionplanModifyRequest.php b/extend/alipay/aop/request/AlipayUserAgreementExecutionplanModifyRequest.php new file mode 100644 index 0000000..3eb673c --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserAgreementExecutionplanModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.agreement.executionplan.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserAgreementPageSignRequest.php b/extend/alipay/aop/request/AlipayUserAgreementPageSignRequest.php new file mode 100644 index 0000000..58a555c --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserAgreementPageSignRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.agreement.page.sign"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserAgreementQueryRequest.php b/extend/alipay/aop/request/AlipayUserAgreementQueryRequest.php new file mode 100644 index 0000000..a17b346 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserAgreementQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.agreement.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserAgreementTransferRequest.php b/extend/alipay/aop/request/AlipayUserAgreementTransferRequest.php new file mode 100644 index 0000000..bfd5980 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserAgreementTransferRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.agreement.transfer"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserAgreementUnsignRequest.php b/extend/alipay/aop/request/AlipayUserAgreementUnsignRequest.php new file mode 100644 index 0000000..e629e91 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserAgreementUnsignRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.agreement.unsign"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserAgreementUserverifyApplyRequest.php b/extend/alipay/aop/request/AlipayUserAgreementUserverifyApplyRequest.php new file mode 100644 index 0000000..2fc6259 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserAgreementUserverifyApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.agreement.userverify.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserAgreementUserverifyQueryRequest.php b/extend/alipay/aop/request/AlipayUserAgreementUserverifyQueryRequest.php new file mode 100644 index 0000000..f18ec89 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserAgreementUserverifyQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.agreement.userverify.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserAlipaypointSendRequest.php b/extend/alipay/aop/request/AlipayUserAlipaypointSendRequest.php new file mode 100644 index 0000000..0dde487 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserAlipaypointSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.alipaypoint.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserAuthZhimaorgIdentityApplyRequest.php b/extend/alipay/aop/request/AlipayUserAuthZhimaorgIdentityApplyRequest.php new file mode 100644 index 0000000..98d6282 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserAuthZhimaorgIdentityApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.auth.zhimaorg.identity.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserCertdocCertverifyConsultRequest.php b/extend/alipay/aop/request/AlipayUserCertdocCertverifyConsultRequest.php new file mode 100644 index 0000000..b43754d --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserCertdocCertverifyConsultRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.certdoc.certverify.consult"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserCertdocCertverifyPreconsultRequest.php b/extend/alipay/aop/request/AlipayUserCertdocCertverifyPreconsultRequest.php new file mode 100644 index 0000000..74f6229 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserCertdocCertverifyPreconsultRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.certdoc.certverify.preconsult"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserCertifyOpenCertifyRequest.php b/extend/alipay/aop/request/AlipayUserCertifyOpenCertifyRequest.php new file mode 100644 index 0000000..364e84b --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserCertifyOpenCertifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.certify.open.certify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserCertifyOpenInitializeRequest.php b/extend/alipay/aop/request/AlipayUserCertifyOpenInitializeRequest.php new file mode 100644 index 0000000..b4afd98 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserCertifyOpenInitializeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.certify.open.initialize"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserCertifyOpenQueryRequest.php b/extend/alipay/aop/request/AlipayUserCertifyOpenQueryRequest.php new file mode 100644 index 0000000..deae060 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserCertifyOpenQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.certify.open.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserContractGetRequest.php b/extend/alipay/aop/request/AlipayUserContractGetRequest.php new file mode 100644 index 0000000..b699a05 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserContractGetRequest.php @@ -0,0 +1,118 @@ +subscriberUserId = $subscriberUserId; + $this->apiParas["subscriber_user_id"] = $subscriberUserId; + } + + public function getSubscriberUserId() + { + return $this->subscriberUserId; + } + + public function getApiMethodName() + { + return "alipay.user.contract.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserFamilyArchiveInitializeRequest.php b/extend/alipay/aop/request/AlipayUserFamilyArchiveInitializeRequest.php new file mode 100644 index 0000000..abc7786 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserFamilyArchiveInitializeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.family.archive.initialize"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserFamilyArchiveQueryRequest.php b/extend/alipay/aop/request/AlipayUserFamilyArchiveQueryRequest.php new file mode 100644 index 0000000..466d71d --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserFamilyArchiveQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.family.archive.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserFinanceinfoShareRequest.php b/extend/alipay/aop/request/AlipayUserFinanceinfoShareRequest.php new file mode 100644 index 0000000..f3e7ff1 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserFinanceinfoShareRequest.php @@ -0,0 +1,119 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.financeinfo.share"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserGetRequest.php b/extend/alipay/aop/request/AlipayUserGetRequest.php new file mode 100644 index 0000000..f63611d --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserGetRequest.php @@ -0,0 +1,118 @@ +fields = $fields; + $this->apiParas["fields"] = $fields; + } + + public function getFields() + { + return $this->fields; + } + + public function getApiMethodName() + { + return "alipay.user.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserInfoAuthRequest.php b/extend/alipay/aop/request/AlipayUserInfoAuthRequest.php new file mode 100644 index 0000000..3842841 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserInfoAuthRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.info.auth"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserInfoShareRequest.php b/extend/alipay/aop/request/AlipayUserInfoShareRequest.php new file mode 100644 index 0000000..afe7a6e --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserInfoShareRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserPassInstancebatchAddRequest.php b/extend/alipay/aop/request/AlipayUserPassInstancebatchAddRequest.php new file mode 100644 index 0000000..979db94 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserPassInstancebatchAddRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.pass.instancebatch.add"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserPassTemplateCreateRequest.php b/extend/alipay/aop/request/AlipayUserPassTemplateCreateRequest.php new file mode 100644 index 0000000..b639cfc --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserPassTemplateCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.pass.template.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserPassTemplateModifyRequest.php b/extend/alipay/aop/request/AlipayUserPassTemplateModifyRequest.php new file mode 100644 index 0000000..99abd67 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserPassTemplateModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.pass.template.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserPassTemplateQueryRequest.php b/extend/alipay/aop/request/AlipayUserPassTemplateQueryRequest.php new file mode 100644 index 0000000..7e1585e --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserPassTemplateQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.pass.template.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserTestRequest.php b/extend/alipay/aop/request/AlipayUserTestRequest.php new file mode 100644 index 0000000..1058099 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserTestRequest.php @@ -0,0 +1,118 @@ +userinfo = $userinfo; + $this->apiParas["userinfo"] = $userinfo; + } + + public function getUserinfo() + { + return $this->userinfo; + } + + public function getApiMethodName() + { + return "alipay.user.test"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserTradeSearchRequest.php b/extend/alipay/aop/request/AlipayUserTradeSearchRequest.php new file mode 100644 index 0000000..2e8a0f5 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserTradeSearchRequest.php @@ -0,0 +1,246 @@ +alipayOrderNo = $alipayOrderNo; + $this->apiParas["alipay_order_no"] = $alipayOrderNo; + } + + public function getAlipayOrderNo() + { + return $this->alipayOrderNo; + } + + public function setEndTime($endTime) + { + $this->endTime = $endTime; + $this->apiParas["end_time"] = $endTime; + } + + public function getEndTime() + { + return $this->endTime; + } + + public function setMerchantOrderNo($merchantOrderNo) + { + $this->merchantOrderNo = $merchantOrderNo; + $this->apiParas["merchant_order_no"] = $merchantOrderNo; + } + + public function getMerchantOrderNo() + { + return $this->merchantOrderNo; + } + + public function setOrderFrom($orderFrom) + { + $this->orderFrom = $orderFrom; + $this->apiParas["order_from"] = $orderFrom; + } + + public function getOrderFrom() + { + return $this->orderFrom; + } + + public function setOrderStatus($orderStatus) + { + $this->orderStatus = $orderStatus; + $this->apiParas["order_status"] = $orderStatus; + } + + public function getOrderStatus() + { + return $this->orderStatus; + } + + public function setOrderType($orderType) + { + $this->orderType = $orderType; + $this->apiParas["order_type"] = $orderType; + } + + public function getOrderType() + { + return $this->orderType; + } + + public function setPageNo($pageNo) + { + $this->pageNo = $pageNo; + $this->apiParas["page_no"] = $pageNo; + } + + public function getPageNo() + { + return $this->pageNo; + } + + public function setPageSize($pageSize) + { + $this->pageSize = $pageSize; + $this->apiParas["page_size"] = $pageSize; + } + + public function getPageSize() + { + return $this->pageSize; + } + + public function setStartTime($startTime) + { + $this->startTime = $startTime; + $this->apiParas["start_time"] = $startTime; + } + + public function getStartTime() + { + return $this->startTime; + } + + public function getApiMethodName() + { + return "alipay.user.trade.search"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserTwostageCommonUseRequest.php b/extend/alipay/aop/request/AlipayUserTwostageCommonUseRequest.php new file mode 100644 index 0000000..7d6daf5 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserTwostageCommonUseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.user.twostage.common.use"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayUserUserinfoShareRequest.php b/extend/alipay/aop/request/AlipayUserUserinfoShareRequest.php new file mode 100644 index 0000000..419d221 --- /dev/null +++ b/extend/alipay/aop/request/AlipayUserUserinfoShareRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayZdataassetsEasyserviceRequest.php b/extend/alipay/aop/request/AlipayZdataassetsEasyserviceRequest.php new file mode 100644 index 0000000..5f08aa4 --- /dev/null +++ b/extend/alipay/aop/request/AlipayZdataassetsEasyserviceRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.zdataassets.easyservice"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayZdataassetsFcdatalabZdatamergetaskRequest.php b/extend/alipay/aop/request/AlipayZdataassetsFcdatalabZdatamergetaskRequest.php new file mode 100644 index 0000000..7c6a8c8 --- /dev/null +++ b/extend/alipay/aop/request/AlipayZdataassetsFcdatalabZdatamergetaskRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.zdataassets.fcdatalab.zdatamergetask"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayZdataassetsMetadataRequest.php b/extend/alipay/aop/request/AlipayZdataassetsMetadataRequest.php new file mode 100644 index 0000000..44c64bd --- /dev/null +++ b/extend/alipay/aop/request/AlipayZdataassetsMetadataRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "alipay.zdataassets.metadata"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayZdatafrontCommonQueryRequest.php b/extend/alipay/aop/request/AlipayZdatafrontCommonQueryRequest.php new file mode 100644 index 0000000..148dc9e --- /dev/null +++ b/extend/alipay/aop/request/AlipayZdatafrontCommonQueryRequest.php @@ -0,0 +1,200 @@ +0,就先判断cache中的数据是否过期,如果没有过期就返回cache中的数据,如果过期再从外部获取数据并刷新cache,然后返回数据。 +单位:秒 + **/ + private $cacheInterval; + + /** + * 通用查询的入参 + **/ + private $queryConditions; + + /** + * 服务名称请与相关开发负责人联系 + **/ + private $serviceName; + + /** + * 访问该服务的业务 + **/ + private $visitBiz; + + /** + * 访问该服务的业务线 + **/ + private $visitBizLine; + + /** + * 访问该服务的部门名称 + **/ + private $visitDomain; + + private $apiParas = array(); + private $terminalType; + private $terminalInfo; + private $prodCode; + private $apiVersion="1.0"; + private $notifyUrl; + private $returnUrl; + private $needEncrypt=false; + + + public function setCacheInterval($cacheInterval) + { + $this->cacheInterval = $cacheInterval; + $this->apiParas["cache_interval"] = $cacheInterval; + } + + public function getCacheInterval() + { + return $this->cacheInterval; + } + + public function setQueryConditions($queryConditions) + { + $this->queryConditions = $queryConditions; + $this->apiParas["query_conditions"] = $queryConditions; + } + + public function getQueryConditions() + { + return $this->queryConditions; + } + + public function setServiceName($serviceName) + { + $this->serviceName = $serviceName; + $this->apiParas["service_name"] = $serviceName; + } + + public function getServiceName() + { + return $this->serviceName; + } + + public function setVisitBiz($visitBiz) + { + $this->visitBiz = $visitBiz; + $this->apiParas["visit_biz"] = $visitBiz; + } + + public function getVisitBiz() + { + return $this->visitBiz; + } + + public function setVisitBizLine($visitBizLine) + { + $this->visitBizLine = $visitBizLine; + $this->apiParas["visit_biz_line"] = $visitBizLine; + } + + public function getVisitBizLine() + { + return $this->visitBizLine; + } + + public function setVisitDomain($visitDomain) + { + $this->visitDomain = $visitDomain; + $this->apiParas["visit_domain"] = $visitDomain; + } + + public function getVisitDomain() + { + return $this->visitDomain; + } + + public function getApiMethodName() + { + return "alipay.zdatafront.common.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayZdatafrontDatatransferedFileuploadRequest.php b/extend/alipay/aop/request/AlipayZdatafrontDatatransferedFileuploadRequest.php new file mode 100644 index 0000000..6976fd2 --- /dev/null +++ b/extend/alipay/aop/request/AlipayZdatafrontDatatransferedFileuploadRequest.php @@ -0,0 +1,230 @@ +columns = $columns; + $this->apiParas["columns"] = $columns; + } + + public function getColumns() + { + return $this->columns; + } + + public function setFile($file) + { + $this->file = $file; + $this->apiParas["file"] = $file; + } + + public function getFile() + { + return $this->file; + } + + public function setFileDescription($fileDescription) + { + $this->fileDescription = $fileDescription; + $this->apiParas["file_description"] = $fileDescription; + } + + public function getFileDescription() + { + return $this->fileDescription; + } + + public function setFileDigest($fileDigest) + { + $this->fileDigest = $fileDigest; + $this->apiParas["file_digest"] = $fileDigest; + } + + public function getFileDigest() + { + return $this->fileDigest; + } + + public function setFileType($fileType) + { + $this->fileType = $fileType; + $this->apiParas["file_type"] = $fileType; + } + + public function getFileType() + { + return $this->fileType; + } + + public function setPrimaryKey($primaryKey) + { + $this->primaryKey = $primaryKey; + $this->apiParas["primary_key"] = $primaryKey; + } + + public function getPrimaryKey() + { + return $this->primaryKey; + } + + public function setRecords($records) + { + $this->records = $records; + $this->apiParas["records"] = $records; + } + + public function getRecords() + { + return $this->records; + } + + public function setTypeId($typeId) + { + $this->typeId = $typeId; + $this->apiParas["type_id"] = $typeId; + } + + public function getTypeId() + { + return $this->typeId; + } + + public function getApiMethodName() + { + return "alipay.zdatafront.datatransfered.fileupload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayZdatafrontDatatransferedSendRequest.php b/extend/alipay/aop/request/AlipayZdatafrontDatatransferedSendRequest.php new file mode 100644 index 0000000..ccaec9d --- /dev/null +++ b/extend/alipay/aop/request/AlipayZdatafrontDatatransferedSendRequest.php @@ -0,0 +1,150 @@ +data = $data; + $this->apiParas["data"] = $data; + } + + public function getData() + { + return $this->data; + } + + public function setIdentity($identity) + { + $this->identity = $identity; + $this->apiParas["identity"] = $identity; + } + + public function getIdentity() + { + return $this->identity; + } + + public function setTypeId($typeId) + { + $this->typeId = $typeId; + $this->apiParas["type_id"] = $typeId; + } + + public function getTypeId() + { + return $this->typeId; + } + + public function getApiMethodName() + { + return "alipay.zdatafront.datatransfered.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayZdataserviceUnidataQueryRequest.php b/extend/alipay/aop/request/AlipayZdataserviceUnidataQueryRequest.php new file mode 100644 index 0000000..516cd6f --- /dev/null +++ b/extend/alipay/aop/request/AlipayZdataserviceUnidataQueryRequest.php @@ -0,0 +1,134 @@ +queryCondition = $queryCondition; + $this->apiParas["query_condition"] = $queryCondition; + } + + public function getQueryCondition() + { + return $this->queryCondition; + } + + public function setUniqKey($uniqKey) + { + $this->uniqKey = $uniqKey; + $this->apiParas["uniq_key"] = $uniqKey; + } + + public function getUniqKey() + { + return $this->uniqKey; + } + + public function getApiMethodName() + { + return "alipay.zdataservice.unidata.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AlipayZmscoreZrankGetRequest.php b/extend/alipay/aop/request/AlipayZmscoreZrankGetRequest.php new file mode 100644 index 0000000..783ca98 --- /dev/null +++ b/extend/alipay/aop/request/AlipayZmscoreZrankGetRequest.php @@ -0,0 +1,118 @@ +userId = $userId; + $this->apiParas["user_id"] = $userId; + } + + public function getUserId() + { + return $this->userId; + } + + public function getApiMethodName() + { + return "alipay.zmscore.zrank.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AmapMapMapserviceTeseBatchqueryRequest.php b/extend/alipay/aop/request/AmapMapMapserviceTeseBatchqueryRequest.php new file mode 100644 index 0000000..4208e9c --- /dev/null +++ b/extend/alipay/aop/request/AmapMapMapserviceTeseBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "amap.map.mapservice.tese.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandContractFacetofaceQueryRequest.php b/extend/alipay/aop/request/AntMerchantExpandContractFacetofaceQueryRequest.php new file mode 100644 index 0000000..eb4fe0d --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandContractFacetofaceQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.contract.facetoface.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandContractFacetofaceSignRequest.php b/extend/alipay/aop/request/AntMerchantExpandContractFacetofaceSignRequest.php new file mode 100644 index 0000000..9de065c --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandContractFacetofaceSignRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.contract.facetoface.sign"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandEnterpriseApplyRequest.php b/extend/alipay/aop/request/AntMerchantExpandEnterpriseApplyRequest.php new file mode 100644 index 0000000..0448d3b --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandEnterpriseApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.enterprise.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandImageUploadRequest.php b/extend/alipay/aop/request/AntMerchantExpandImageUploadRequest.php new file mode 100644 index 0000000..1e0477a --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandImageUploadRequest.php @@ -0,0 +1,134 @@ +imageContent = $imageContent; + $this->apiParas["image_content"] = $imageContent; + } + + public function getImageContent() + { + return $this->imageContent; + } + + public function setImageType($imageType) + { + $this->imageType = $imageType; + $this->apiParas["image_type"] = $imageType; + } + + public function getImageType() + { + return $this->imageType; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.image.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandIndirectImageUploadRequest.php b/extend/alipay/aop/request/AntMerchantExpandIndirectImageUploadRequest.php new file mode 100644 index 0000000..4bcb4d0 --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandIndirectImageUploadRequest.php @@ -0,0 +1,134 @@ +imageContent = $imageContent; + $this->apiParas["image_content"] = $imageContent; + } + + public function getImageContent() + { + return $this->imageContent; + } + + public function setImageType($imageType) + { + $this->imageType = $imageType; + $this->apiParas["image_type"] = $imageType; + } + + public function getImageType() + { + return $this->imageType; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.indirect.image.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandIndirectIsvModifyRequest.php b/extend/alipay/aop/request/AntMerchantExpandIndirectIsvModifyRequest.php new file mode 100644 index 0000000..f994f4d --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandIndirectIsvModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.indirect.isv.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandItemOpenBatchqueryRequest.php b/extend/alipay/aop/request/AntMerchantExpandItemOpenBatchqueryRequest.php new file mode 100644 index 0000000..dc5a209 --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandItemOpenBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.item.open.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandItemOpenCreateRequest.php b/extend/alipay/aop/request/AntMerchantExpandItemOpenCreateRequest.php new file mode 100644 index 0000000..2f59c9e --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandItemOpenCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.item.open.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandItemOpenDeleteRequest.php b/extend/alipay/aop/request/AntMerchantExpandItemOpenDeleteRequest.php new file mode 100644 index 0000000..0008019 --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandItemOpenDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.item.open.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandItemOpenModifyRequest.php b/extend/alipay/aop/request/AntMerchantExpandItemOpenModifyRequest.php new file mode 100644 index 0000000..d85180d --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandItemOpenModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.item.open.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandItemOpenQueryRequest.php b/extend/alipay/aop/request/AntMerchantExpandItemOpenQueryRequest.php new file mode 100644 index 0000000..81563b6 --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandItemOpenQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.item.open.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandMapplyorderQueryRequest.php b/extend/alipay/aop/request/AntMerchantExpandMapplyorderQueryRequest.php new file mode 100644 index 0000000..f55a128 --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandMapplyorderQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.mapplyorder.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandMerchantStorelistQueryRequest.php b/extend/alipay/aop/request/AntMerchantExpandMerchantStorelistQueryRequest.php new file mode 100644 index 0000000..664d282 --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandMerchantStorelistQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.merchant.storelist.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandOrderQueryRequest.php b/extend/alipay/aop/request/AntMerchantExpandOrderQueryRequest.php new file mode 100644 index 0000000..fe5aefd --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandOrderQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.order.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandPersonalApplyRequest.php b/extend/alipay/aop/request/AntMerchantExpandPersonalApplyRequest.php new file mode 100644 index 0000000..b48cf11 --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandPersonalApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.personal.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandShopCloseRequest.php b/extend/alipay/aop/request/AntMerchantExpandShopCloseRequest.php new file mode 100644 index 0000000..d6bbfee --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandShopCloseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.shop.close"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandShopConsultRequest.php b/extend/alipay/aop/request/AntMerchantExpandShopConsultRequest.php new file mode 100644 index 0000000..0499a6b --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandShopConsultRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.shop.consult"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandShopCreateRequest.php b/extend/alipay/aop/request/AntMerchantExpandShopCreateRequest.php new file mode 100644 index 0000000..bb9ff02 --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandShopCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.shop.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandShopModifyRequest.php b/extend/alipay/aop/request/AntMerchantExpandShopModifyRequest.php new file mode 100644 index 0000000..ce983b1 --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandShopModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.shop.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntMerchantExpandShopQueryRequest.php b/extend/alipay/aop/request/AntMerchantExpandShopQueryRequest.php new file mode 100644 index 0000000..7e97402 --- /dev/null +++ b/extend/alipay/aop/request/AntMerchantExpandShopQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.merchant.expand.shop.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntOcrDriverlicenseIdentifyRequest.php b/extend/alipay/aop/request/AntOcrDriverlicenseIdentifyRequest.php new file mode 100644 index 0000000..a279d70 --- /dev/null +++ b/extend/alipay/aop/request/AntOcrDriverlicenseIdentifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.ocr.driverlicense.identify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntOcrGeneralIdentifyRequest.php b/extend/alipay/aop/request/AntOcrGeneralIdentifyRequest.php new file mode 100644 index 0000000..1516b9f --- /dev/null +++ b/extend/alipay/aop/request/AntOcrGeneralIdentifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.ocr.general.identify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntOcrIdcardIdentifyRequest.php b/extend/alipay/aop/request/AntOcrIdcardIdentifyRequest.php new file mode 100644 index 0000000..cc47779 --- /dev/null +++ b/extend/alipay/aop/request/AntOcrIdcardIdentifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.ocr.idcard.identify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntOcrVehiclelicenseIdentifyRequest.php b/extend/alipay/aop/request/AntOcrVehiclelicenseIdentifyRequest.php new file mode 100644 index 0000000..592efa0 --- /dev/null +++ b/extend/alipay/aop/request/AntOcrVehiclelicenseIdentifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.ocr.vehiclelicense.identify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AntOcrVehicleplateIdentifyRequest.php b/extend/alipay/aop/request/AntOcrVehicleplateIdentifyRequest.php new file mode 100644 index 0000000..9928c7a --- /dev/null +++ b/extend/alipay/aop/request/AntOcrVehicleplateIdentifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ant.ocr.vehicleplate.identify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/AnttechBlockchainFinanceFileUploadRequest.php b/extend/alipay/aop/request/AnttechBlockchainFinanceFileUploadRequest.php new file mode 100644 index 0000000..dcf60bf --- /dev/null +++ b/extend/alipay/aop/request/AnttechBlockchainFinanceFileUploadRequest.php @@ -0,0 +1,134 @@ +fileContent = $fileContent; + $this->apiParas["file_content"] = $fileContent; + } + + public function getFileContent() + { + return $this->fileContent; + } + + public function setOtherParam($otherParam) + { + $this->otherParam = $otherParam; + $this->apiParas["other_param"] = $otherParam; + } + + public function getOtherParam() + { + return $this->otherParam; + } + + public function getApiMethodName() + { + return "anttech.blockchain.finance.file.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/HuanxuTradeOrderCloseRequest.php b/extend/alipay/aop/request/HuanxuTradeOrderCloseRequest.php new file mode 100644 index 0000000..bbf3f08 --- /dev/null +++ b/extend/alipay/aop/request/HuanxuTradeOrderCloseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "huanxu.trade.order.close"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/HuanxuTradeOrderDisburseRequest.php b/extend/alipay/aop/request/HuanxuTradeOrderDisburseRequest.php new file mode 100644 index 0000000..24d08b1 --- /dev/null +++ b/extend/alipay/aop/request/HuanxuTradeOrderDisburseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "huanxu.trade.order.disburse"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/HuanxuTradeOrderQueryRequest.php b/extend/alipay/aop/request/HuanxuTradeOrderQueryRequest.php new file mode 100644 index 0000000..1f9055c --- /dev/null +++ b/extend/alipay/aop/request/HuanxuTradeOrderQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "huanxu.trade.order.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/HuanxuTradeOrderRefundRequest.php b/extend/alipay/aop/request/HuanxuTradeOrderRefundRequest.php new file mode 100644 index 0000000..43528c5 --- /dev/null +++ b/extend/alipay/aop/request/HuanxuTradeOrderRefundRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "huanxu.trade.order.refund"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiAdvertDeliveryDiscountAuthwebBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiAdvertDeliveryDiscountAuthwebBatchqueryRequest.php new file mode 100644 index 0000000..cb39891 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiAdvertDeliveryDiscountAuthwebBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.advert.delivery.discount.authweb.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiAdvertDeliveryDiscountGetRequest.php b/extend/alipay/aop/request/KoubeiAdvertDeliveryDiscountGetRequest.php new file mode 100644 index 0000000..f096fb4 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiAdvertDeliveryDiscountGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.advert.delivery.discount.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiAdvertDeliveryDiscountQueryRequest.php b/extend/alipay/aop/request/KoubeiAdvertDeliveryDiscountQueryRequest.php new file mode 100644 index 0000000..3017805 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiAdvertDeliveryDiscountQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.advert.delivery.discount.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiAdvertDeliveryDiscountSendRequest.php b/extend/alipay/aop/request/KoubeiAdvertDeliveryDiscountSendRequest.php new file mode 100644 index 0000000..2485859 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiAdvertDeliveryDiscountSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.advert.delivery.discount.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiAdvertDeliveryDiscountWebBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiAdvertDeliveryDiscountWebBatchqueryRequest.php new file mode 100644 index 0000000..d5b0f96 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiAdvertDeliveryDiscountWebBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.advert.delivery.discount.web.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiAdvertDeliveryItemApplyRequest.php b/extend/alipay/aop/request/KoubeiAdvertDeliveryItemApplyRequest.php new file mode 100644 index 0000000..0b4eade --- /dev/null +++ b/extend/alipay/aop/request/KoubeiAdvertDeliveryItemApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.advert.delivery.item.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCateringCommodityOrderBuyRequest.php b/extend/alipay/aop/request/KoubeiCateringCommodityOrderBuyRequest.php new file mode 100644 index 0000000..18adbd8 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCateringCommodityOrderBuyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.catering.commodity.order.buy"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCateringCrowdgroupConditionQueryRequest.php b/extend/alipay/aop/request/KoubeiCateringCrowdgroupConditionQueryRequest.php new file mode 100644 index 0000000..45c8649 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCateringCrowdgroupConditionQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.catering.crowdgroup.condition.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCateringCrowdgroupConditionSetRequest.php b/extend/alipay/aop/request/KoubeiCateringCrowdgroupConditionSetRequest.php new file mode 100644 index 0000000..4c37ab8 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCateringCrowdgroupConditionSetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.catering.crowdgroup.condition.set"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCateringDishCommgroupQueryRequest.php b/extend/alipay/aop/request/KoubeiCateringDishCommgroupQueryRequest.php new file mode 100644 index 0000000..0bb2e85 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCateringDishCommgroupQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.catering.dish.commgroup.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCateringDishCommgroupSyncRequest.php b/extend/alipay/aop/request/KoubeiCateringDishCommgroupSyncRequest.php new file mode 100644 index 0000000..474bd01 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCateringDishCommgroupSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.catering.dish.commgroup.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCateringDishCommruleQueryRequest.php b/extend/alipay/aop/request/KoubeiCateringDishCommruleQueryRequest.php new file mode 100644 index 0000000..95e3a1a --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCateringDishCommruleQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.catering.dish.commrule.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCateringDishCommruleSyncRequest.php b/extend/alipay/aop/request/KoubeiCateringDishCommruleSyncRequest.php new file mode 100644 index 0000000..c022817 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCateringDishCommruleSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.catering.dish.commrule.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCateringDishCookcatetopSyncRequest.php b/extend/alipay/aop/request/KoubeiCateringDishCookcatetopSyncRequest.php new file mode 100644 index 0000000..e93e81a --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCateringDishCookcatetopSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.catering.dish.cookcatetop.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCateringDishMenuQueryRequest.php b/extend/alipay/aop/request/KoubeiCateringDishMenuQueryRequest.php new file mode 100644 index 0000000..fd0de83 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCateringDishMenuQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.catering.dish.menu.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCateringDishMenuSyncRequest.php b/extend/alipay/aop/request/KoubeiCateringDishMenuSyncRequest.php new file mode 100644 index 0000000..d7eb1ec --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCateringDishMenuSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.catering.dish.menu.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCateringDishSpecgroupQueryRequest.php b/extend/alipay/aop/request/KoubeiCateringDishSpecgroupQueryRequest.php new file mode 100644 index 0000000..f631471 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCateringDishSpecgroupQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.catering.dish.specgroup.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCateringDishSpecgroupSyncRequest.php b/extend/alipay/aop/request/KoubeiCateringDishSpecgroupSyncRequest.php new file mode 100644 index 0000000..c2d4f92 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCateringDishSpecgroupSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.catering.dish.specgroup.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCateringDishVirtualdishQueryRequest.php b/extend/alipay/aop/request/KoubeiCateringDishVirtualdishQueryRequest.php new file mode 100644 index 0000000..30c4362 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCateringDishVirtualdishQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.catering.dish.virtualdish.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCateringDishVirtualdishSyncRequest.php b/extend/alipay/aop/request/KoubeiCateringDishVirtualdishSyncRequest.php new file mode 100644 index 0000000..a5d6690 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCateringDishVirtualdishSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.catering.dish.virtualdish.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCateringTablecodeQueryRequest.php b/extend/alipay/aop/request/KoubeiCateringTablecodeQueryRequest.php new file mode 100644 index 0000000..eecb932 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCateringTablecodeQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.catering.tablecode.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCateringTablelistQueryRequest.php b/extend/alipay/aop/request/KoubeiCateringTablelistQueryRequest.php new file mode 100644 index 0000000..1ad6ff0 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCateringTablelistQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.catering.tablelist.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCraftsmanDataProviderBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiCraftsmanDataProviderBatchqueryRequest.php new file mode 100644 index 0000000..567e2d7 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCraftsmanDataProviderBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.craftsman.data.provider.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCraftsmanDataProviderCreateRequest.php b/extend/alipay/aop/request/KoubeiCraftsmanDataProviderCreateRequest.php new file mode 100644 index 0000000..009986a --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCraftsmanDataProviderCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.craftsman.data.provider.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCraftsmanDataProviderModifyRequest.php b/extend/alipay/aop/request/KoubeiCraftsmanDataProviderModifyRequest.php new file mode 100644 index 0000000..391b1b8 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCraftsmanDataProviderModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.craftsman.data.provider.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCraftsmanDataWorkBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiCraftsmanDataWorkBatchqueryRequest.php new file mode 100644 index 0000000..090036e --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCraftsmanDataWorkBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.craftsman.data.work.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCraftsmanDataWorkCreateRequest.php b/extend/alipay/aop/request/KoubeiCraftsmanDataWorkCreateRequest.php new file mode 100644 index 0000000..370cb1c --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCraftsmanDataWorkCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.craftsman.data.work.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCraftsmanDataWorkDeleteRequest.php b/extend/alipay/aop/request/KoubeiCraftsmanDataWorkDeleteRequest.php new file mode 100644 index 0000000..fbe3a16 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCraftsmanDataWorkDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.craftsman.data.work.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiCraftsmanDataWorkModifyRequest.php b/extend/alipay/aop/request/KoubeiCraftsmanDataWorkModifyRequest.php new file mode 100644 index 0000000..7e1bd57 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiCraftsmanDataWorkModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.craftsman.data.work.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiItemCategoryChildrenBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiItemCategoryChildrenBatchqueryRequest.php new file mode 100644 index 0000000..91ed47f --- /dev/null +++ b/extend/alipay/aop/request/KoubeiItemCategoryChildrenBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.item.category.children.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiItemCreateRequest.php b/extend/alipay/aop/request/KoubeiItemCreateRequest.php new file mode 100644 index 0000000..6436b5a --- /dev/null +++ b/extend/alipay/aop/request/KoubeiItemCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.item.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiItemExtitemBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiItemExtitemBatchqueryRequest.php new file mode 100644 index 0000000..27434b9 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiItemExtitemBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.item.extitem.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiItemExtitemBrandQueryRequest.php b/extend/alipay/aop/request/KoubeiItemExtitemBrandQueryRequest.php new file mode 100644 index 0000000..063215f --- /dev/null +++ b/extend/alipay/aop/request/KoubeiItemExtitemBrandQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiItemExtitemCategoryQueryRequest.php b/extend/alipay/aop/request/KoubeiItemExtitemCategoryQueryRequest.php new file mode 100644 index 0000000..f730a59 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiItemExtitemCategoryQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.item.extitem.category.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiItemExtitemCreateRequest.php b/extend/alipay/aop/request/KoubeiItemExtitemCreateRequest.php new file mode 100644 index 0000000..a3f4d60 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiItemExtitemCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.item.extitem.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiItemExtitemExistedQueryRequest.php b/extend/alipay/aop/request/KoubeiItemExtitemExistedQueryRequest.php new file mode 100644 index 0000000..8d99455 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiItemExtitemExistedQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.item.extitem.existed.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiItemExtitemQueryRequest.php b/extend/alipay/aop/request/KoubeiItemExtitemQueryRequest.php new file mode 100644 index 0000000..3de37dd --- /dev/null +++ b/extend/alipay/aop/request/KoubeiItemExtitemQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.item.extitem.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiItemExtitemUpdateRequest.php b/extend/alipay/aop/request/KoubeiItemExtitemUpdateRequest.php new file mode 100644 index 0000000..52059e0 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiItemExtitemUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.item.extitem.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiItemModifyRequest.php b/extend/alipay/aop/request/KoubeiItemModifyRequest.php new file mode 100644 index 0000000..6ef9b32 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiItemModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.item.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiItemStateRequest.php b/extend/alipay/aop/request/KoubeiItemStateRequest.php new file mode 100644 index 0000000..7f6db1a --- /dev/null +++ b/extend/alipay/aop/request/KoubeiItemStateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.item.state"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignActivityBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignActivityBatchqueryRequest.php new file mode 100644 index 0000000..50e5936 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignActivityBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.activity.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignActivityCreateRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignActivityCreateRequest.php new file mode 100644 index 0000000..fd848bf --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignActivityCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.activity.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignActivityModifyRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignActivityModifyRequest.php new file mode 100644 index 0000000..5ec08f3 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignActivityModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.activity.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignActivityOfflineRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignActivityOfflineRequest.php new file mode 100644 index 0000000..7d29914 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignActivityOfflineRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.activity.offline"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignActivityQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignActivityQueryRequest.php new file mode 100644 index 0000000..baeb481 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignActivityQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.activity.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignAssetDetailQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignAssetDetailQueryRequest.php new file mode 100644 index 0000000..3391dde --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignAssetDetailQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.asset.detail.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdBatchqueryRequest.php new file mode 100644 index 0000000..97b5fe9 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.crowd.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdCountRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdCountRequest.php new file mode 100644 index 0000000..3eb6cc0 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdCountRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.crowd.count"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdCreateRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdCreateRequest.php new file mode 100644 index 0000000..6cd9f52 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.crowd.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdDeleteRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdDeleteRequest.php new file mode 100644 index 0000000..d38b406 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.crowd.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdDetailQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdDetailQueryRequest.php new file mode 100644 index 0000000..01bfa81 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdDetailQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.crowd.detail.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdModifyRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdModifyRequest.php new file mode 100644 index 0000000..a3dd799 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignCrowdModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.crowd.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignDetailInfoQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignDetailInfoQueryRequest.php new file mode 100644 index 0000000..48ab78e --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignDetailInfoQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.detail.info.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoBatchqueryRequest.php new file mode 100644 index 0000000..c0d346f --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.intelligent.promo.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoConsultRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoConsultRequest.php new file mode 100644 index 0000000..021c0a9 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoConsultRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.intelligent.promo.consult"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoCreateRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoCreateRequest.php new file mode 100644 index 0000000..47d2fee --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.intelligent.promo.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoDeleteRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoDeleteRequest.php new file mode 100644 index 0000000..e2cb278 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.intelligent.promo.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoModifyRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoModifyRequest.php new file mode 100644 index 0000000..63ecab6 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.intelligent.promo.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoQueryRequest.php new file mode 100644 index 0000000..fd8b2e6 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentPromoQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.intelligent.promo.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentShopConsultRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentShopConsultRequest.php new file mode 100644 index 0000000..7ba6f1e --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentShopConsultRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.intelligent.shop.consult"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentTemplateConsultRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentTemplateConsultRequest.php new file mode 100644 index 0000000..4421a51 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignIntelligentTemplateConsultRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.intelligent.template.consult"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignItemMerchantactivityBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignItemMerchantactivityBatchqueryRequest.php new file mode 100644 index 0000000..29eabfa --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignItemMerchantactivityBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.item.merchantactivity.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignItemMerchantactivityCloseRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignItemMerchantactivityCloseRequest.php new file mode 100644 index 0000000..438a254 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignItemMerchantactivityCloseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.item.merchantactivity.close"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignItemMerchantactivityCreateRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignItemMerchantactivityCreateRequest.php new file mode 100644 index 0000000..88f4da5 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignItemMerchantactivityCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.item.merchantactivity.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignItemMerchantactivityModifyRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignItemMerchantactivityModifyRequest.php new file mode 100644 index 0000000..1f0bb58 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignItemMerchantactivityModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.item.merchantactivity.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignItemMerchantactivityQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignItemMerchantactivityQueryRequest.php new file mode 100644 index 0000000..2fc1470 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignItemMerchantactivityQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.item.merchantactivity.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignRecruitApplyQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignRecruitApplyQueryRequest.php new file mode 100644 index 0000000..341c4d8 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignRecruitApplyQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.recruit.apply.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignRecruitShopQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignRecruitShopQueryRequest.php new file mode 100644 index 0000000..f7220eb --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignRecruitShopQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.recruit.shop.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignTagsQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignTagsQueryRequest.php new file mode 100644 index 0000000..bdbcd46 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignTagsQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingCampaignUserAssetQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingCampaignUserAssetQueryRequest.php new file mode 100644 index 0000000..7150a81 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingCampaignUserAssetQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.campaign.user.asset.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataActivityBillDownloadRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataActivityBillDownloadRequest.php new file mode 100644 index 0000000..b57ddfc --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataActivityBillDownloadRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.activity.bill.download"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataActivityReportQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataActivityReportQueryRequest.php new file mode 100644 index 0000000..64ef8ba --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataActivityReportQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.activity.report.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataAlisisReportBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataAlisisReportBatchqueryRequest.php new file mode 100644 index 0000000..27cafaf --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataAlisisReportBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.alisis.report.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataAlisisReportQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataAlisisReportQueryRequest.php new file mode 100644 index 0000000..a51a0a4 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataAlisisReportQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.alisis.report.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataBizadviserMemberprofileQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataBizadviserMemberprofileQueryRequest.php new file mode 100644 index 0000000..6eef3ba --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataBizadviserMemberprofileQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.bizadviser.memberprofile.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataBizadviserMyddsreportQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataBizadviserMyddsreportQueryRequest.php new file mode 100644 index 0000000..cb37efd --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataBizadviserMyddsreportQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.bizadviser.myddsreport.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataBizadviserMyreportQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataBizadviserMyreportQueryRequest.php new file mode 100644 index 0000000..8ac8edd --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataBizadviserMyreportQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.bizadviser.myreport.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataCustomreportBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataCustomreportBatchqueryRequest.php new file mode 100644 index 0000000..79bdbe7 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataCustomreportBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.customreport.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataCustomreportDeleteRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataCustomreportDeleteRequest.php new file mode 100644 index 0000000..73a3874 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataCustomreportDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.customreport.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataCustomreportDetailQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataCustomreportDetailQueryRequest.php new file mode 100644 index 0000000..99fb9b9 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataCustomreportDetailQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.customreport.detail.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataCustomreportQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataCustomreportQueryRequest.php new file mode 100644 index 0000000..819408a --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataCustomreportQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.customreport.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataCustomreportSaveRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataCustomreportSaveRequest.php new file mode 100644 index 0000000..f2342fe --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataCustomreportSaveRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.customreport.save"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataDishdiagnoseBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataDishdiagnoseBatchqueryRequest.php new file mode 100644 index 0000000..59581da --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataDishdiagnoseBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.dishdiagnose.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataDishdiagnosetypeBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataDishdiagnosetypeBatchqueryRequest.php new file mode 100644 index 0000000..5f33df5 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataDishdiagnosetypeBatchqueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataEnterpriseStaffinfoUploadRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataEnterpriseStaffinfoUploadRequest.php new file mode 100644 index 0000000..450087a --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataEnterpriseStaffinfoUploadRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.enterprise.staffinfo.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataIndicatorQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataIndicatorQueryRequest.php new file mode 100644 index 0000000..9f1b988 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataIndicatorQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.indicator.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataIntelligentEffectQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataIntelligentEffectQueryRequest.php new file mode 100644 index 0000000..97ac6cf --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataIntelligentEffectQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.intelligent.effect.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataIntelligentIndicatorQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataIntelligentIndicatorQueryRequest.php new file mode 100644 index 0000000..6c7e339 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataIntelligentIndicatorQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.intelligent.indicator.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataIsvShopQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataIsvShopQueryRequest.php new file mode 100644 index 0000000..bb5ca3f --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataIsvShopQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.isv.shop.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataMallShopitemsQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataMallShopitemsQueryRequest.php new file mode 100644 index 0000000..719810a --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataMallShopitemsQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.mall.shopitems.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataMemberReportQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataMemberReportQueryRequest.php new file mode 100644 index 0000000..491ad4f --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataMemberReportQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.member.report.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataMessageDeliverRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataMessageDeliverRequest.php new file mode 100644 index 0000000..1bebdb7 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataMessageDeliverRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.message.deliver"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataNearmallQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataNearmallQueryRequest.php new file mode 100644 index 0000000..4ba67b0 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataNearmallQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.nearmall.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataRetailDmQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataRetailDmQueryRequest.php new file mode 100644 index 0000000..6de09cf --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataRetailDmQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.retail.dm.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataSmartactivityConfigRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataSmartactivityConfigRequest.php new file mode 100644 index 0000000..3e2b9b3 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataSmartactivityConfigRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.smartactivity.config"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataSmartactivityForecastRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataSmartactivityForecastRequest.php new file mode 100644 index 0000000..20481c4 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataSmartactivityForecastRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.smartactivity.forecast"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataSmartmanagementDiagnoseRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataSmartmanagementDiagnoseRequest.php new file mode 100644 index 0000000..8d8909e --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataSmartmanagementDiagnoseRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingDataTradeHabbitQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingDataTradeHabbitQueryRequest.php new file mode 100644 index 0000000..02e7bf3 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingDataTradeHabbitQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.data.trade.habbit.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingToolIsvMerchantQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingToolIsvMerchantQueryRequest.php new file mode 100644 index 0000000..46c88d3 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingToolIsvMerchantQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.tool.isv.merchant.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingToolPointsQueryRequest.php b/extend/alipay/aop/request/KoubeiMarketingToolPointsQueryRequest.php new file mode 100644 index 0000000..a6411c2 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingToolPointsQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.tool.points.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingToolPointsUpdateRequest.php b/extend/alipay/aop/request/KoubeiMarketingToolPointsUpdateRequest.php new file mode 100644 index 0000000..9f557b1 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingToolPointsUpdateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.tool.points.update"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMarketingToolPrizesendAuthRequest.php b/extend/alipay/aop/request/KoubeiMarketingToolPrizesendAuthRequest.php new file mode 100644 index 0000000..2731e33 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMarketingToolPrizesendAuthRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.marketing.tool.prizesend.auth"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMemberBrandownerNameQueryRequest.php b/extend/alipay/aop/request/KoubeiMemberBrandownerNameQueryRequest.php new file mode 100644 index 0000000..be70f3d --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMemberBrandownerNameQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMemberDataDesdBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiMemberDataDesdBatchqueryRequest.php new file mode 100644 index 0000000..5d2dac9 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMemberDataDesdBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.member.data.desd.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMemberDataIsvCreateRequest.php b/extend/alipay/aop/request/KoubeiMemberDataIsvCreateRequest.php new file mode 100644 index 0000000..6aae5b7 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMemberDataIsvCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.member.data.isv.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMemberDataOauthQueryRequest.php b/extend/alipay/aop/request/KoubeiMemberDataOauthQueryRequest.php new file mode 100644 index 0000000..737521e --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMemberDataOauthQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.member.data.oauth.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMemberRetailerQueryRequest.php b/extend/alipay/aop/request/KoubeiMemberRetailerQueryRequest.php new file mode 100644 index 0000000..2cac6e2 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMemberRetailerQueryRequest.php @@ -0,0 +1,103 @@ +notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMerchantKbdeviceDevicesBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiMerchantKbdeviceDevicesBatchqueryRequest.php new file mode 100644 index 0000000..83d9e7f --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMerchantKbdeviceDevicesBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.merchant.kbdevice.devices.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiMerchantKbdeviceDispenserQueryRequest.php b/extend/alipay/aop/request/KoubeiMerchantKbdeviceDispenserQueryRequest.php new file mode 100644 index 0000000..320d826 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiMerchantKbdeviceDispenserQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.merchant.kbdevice.dispenser.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiQualityTestCloudacptActivityQueryRequest.php b/extend/alipay/aop/request/KoubeiQualityTestCloudacptActivityQueryRequest.php new file mode 100644 index 0000000..4e6b957 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiQualityTestCloudacptActivityQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.quality.test.cloudacpt.activity.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiQualityTestCloudacptBatchQueryRequest.php b/extend/alipay/aop/request/KoubeiQualityTestCloudacptBatchQueryRequest.php new file mode 100644 index 0000000..da6e2cf --- /dev/null +++ b/extend/alipay/aop/request/KoubeiQualityTestCloudacptBatchQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.quality.test.cloudacpt.batch.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiQualityTestCloudacptCheckresultSubmitRequest.php b/extend/alipay/aop/request/KoubeiQualityTestCloudacptCheckresultSubmitRequest.php new file mode 100644 index 0000000..20f0b57 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiQualityTestCloudacptCheckresultSubmitRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.quality.test.cloudacpt.checkresult.submit"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiQualityTestCloudacptItemQueryRequest.php b/extend/alipay/aop/request/KoubeiQualityTestCloudacptItemQueryRequest.php new file mode 100644 index 0000000..efbcfb3 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiQualityTestCloudacptItemQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.quality.test.cloudacpt.item.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiRetailShopitemBatchqueryRequest.php b/extend/alipay/aop/request/KoubeiRetailShopitemBatchqueryRequest.php new file mode 100644 index 0000000..92ebea7 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiRetailShopitemBatchqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.retail.shopitem.batchquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiRetailShopitemModifyRequest.php b/extend/alipay/aop/request/KoubeiRetailShopitemModifyRequest.php new file mode 100644 index 0000000..050f73d --- /dev/null +++ b/extend/alipay/aop/request/KoubeiRetailShopitemModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.retail.shopitem.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiRetailShopitemUploadRequest.php b/extend/alipay/aop/request/KoubeiRetailShopitemUploadRequest.php new file mode 100644 index 0000000..1445260 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiRetailShopitemUploadRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.retail.shopitem.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiSalesLeadsSaleleadsCreateRequest.php b/extend/alipay/aop/request/KoubeiSalesLeadsSaleleadsCreateRequest.php new file mode 100644 index 0000000..7bc06b8 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiSalesLeadsSaleleadsCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.sales.leads.saleleads.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiSalesLeadsShopleadsCreateRequest.php b/extend/alipay/aop/request/KoubeiSalesLeadsShopleadsCreateRequest.php new file mode 100644 index 0000000..819721a --- /dev/null +++ b/extend/alipay/aop/request/KoubeiSalesLeadsShopleadsCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.sales.leads.shopleads.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeItemBuyRequest.php b/extend/alipay/aop/request/KoubeiTradeItemBuyRequest.php new file mode 100644 index 0000000..81da11e --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeItemBuyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.item.buy"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeItemorderBuyRequest.php b/extend/alipay/aop/request/KoubeiTradeItemorderBuyRequest.php new file mode 100644 index 0000000..d145cce --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeItemorderBuyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.itemorder.buy"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeItemorderQueryRequest.php b/extend/alipay/aop/request/KoubeiTradeItemorderQueryRequest.php new file mode 100644 index 0000000..2003c7f --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeItemorderQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.itemorder.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeItemorderRefundRequest.php b/extend/alipay/aop/request/KoubeiTradeItemorderRefundRequest.php new file mode 100644 index 0000000..ca8746b --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeItemorderRefundRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.itemorder.refund"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeKbdeliveryDeliveryApplyRequest.php b/extend/alipay/aop/request/KoubeiTradeKbdeliveryDeliveryApplyRequest.php new file mode 100644 index 0000000..2424eeb --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeKbdeliveryDeliveryApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.kbdelivery.delivery.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeKbdeliveryDeliveryCancelRequest.php b/extend/alipay/aop/request/KoubeiTradeKbdeliveryDeliveryCancelRequest.php new file mode 100644 index 0000000..9d4051a --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeKbdeliveryDeliveryCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.kbdelivery.delivery.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeOrderAggregateConsultRequest.php b/extend/alipay/aop/request/KoubeiTradeOrderAggregateConsultRequest.php new file mode 100644 index 0000000..30125c0 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeOrderAggregateConsultRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.order.aggregate.consult"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeOrderConsultRequest.php b/extend/alipay/aop/request/KoubeiTradeOrderConsultRequest.php new file mode 100644 index 0000000..07ee64c --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeOrderConsultRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.order.consult"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeOrderEnterpriseQueryRequest.php b/extend/alipay/aop/request/KoubeiTradeOrderEnterpriseQueryRequest.php new file mode 100644 index 0000000..1f4ac54 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeOrderEnterpriseQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.order.enterprise.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeOrderEnterpriseSettleRequest.php b/extend/alipay/aop/request/KoubeiTradeOrderEnterpriseSettleRequest.php new file mode 100644 index 0000000..2423f10 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeOrderEnterpriseSettleRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.order.enterprise.settle"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeOrderPrecreateRequest.php b/extend/alipay/aop/request/KoubeiTradeOrderPrecreateRequest.php new file mode 100644 index 0000000..2c2f4bb --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeOrderPrecreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.order.precreate"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeOrderQueryRequest.php b/extend/alipay/aop/request/KoubeiTradeOrderQueryRequest.php new file mode 100644 index 0000000..cb10903 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeOrderQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.order.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeTicketSendCloseRequest.php b/extend/alipay/aop/request/KoubeiTradeTicketSendCloseRequest.php new file mode 100644 index 0000000..ceda194 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeTicketSendCloseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.ticket.send.close"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeCancelRequest.php b/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeCancelRequest.php new file mode 100644 index 0000000..52b5631 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.ticket.ticketcode.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeCheckavailableRequest.php b/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeCheckavailableRequest.php new file mode 100644 index 0000000..cc9faaf --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeCheckavailableRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.ticket.ticketcode.checkavailable"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeDelayRequest.php b/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeDelayRequest.php new file mode 100644 index 0000000..f81dbc8 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeDelayRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.ticket.ticketcode.delay"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeQueryRequest.php b/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeQueryRequest.php new file mode 100644 index 0000000..729b00b --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.ticket.ticketcode.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeSendRequest.php b/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeSendRequest.php new file mode 100644 index 0000000..0b99fbc --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.ticket.ticketcode.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeSyncRequest.php b/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeSyncRequest.php new file mode 100644 index 0000000..d190cfe --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.ticket.ticketcode.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeUseRequest.php b/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeUseRequest.php new file mode 100644 index 0000000..37ec037 --- /dev/null +++ b/extend/alipay/aop/request/KoubeiTradeTicketTicketcodeUseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "koubei.trade.ticket.ticketcode.use"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MonitorHeartbeatSynRequest.php b/extend/alipay/aop/request/MonitorHeartbeatSynRequest.php new file mode 100644 index 0000000..79e2da8 --- /dev/null +++ b/extend/alipay/aop/request/MonitorHeartbeatSynRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "monitor.heartbeat.syn"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankCreditLoanapplyDataUploadRequest.php b/extend/alipay/aop/request/MybankCreditLoanapplyDataUploadRequest.php new file mode 100644 index 0000000..8a4efc2 --- /dev/null +++ b/extend/alipay/aop/request/MybankCreditLoanapplyDataUploadRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.credit.loanapply.data.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankCreditUserCertifyOpenQueryRequest.php b/extend/alipay/aop/request/MybankCreditUserCertifyOpenQueryRequest.php new file mode 100644 index 0000000..4249ac6 --- /dev/null +++ b/extend/alipay/aop/request/MybankCreditUserCertifyOpenQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.credit.user.certify.open.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankCreditUserInfoShareQueryRequest.php b/extend/alipay/aop/request/MybankCreditUserInfoShareQueryRequest.php new file mode 100644 index 0000000..dc55cd4 --- /dev/null +++ b/extend/alipay/aop/request/MybankCreditUserInfoShareQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.credit.user.info.share.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankCreditUserOpenCertifyCertifyRequest.php b/extend/alipay/aop/request/MybankCreditUserOpenCertifyCertifyRequest.php new file mode 100644 index 0000000..7d6777a --- /dev/null +++ b/extend/alipay/aop/request/MybankCreditUserOpenCertifyCertifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.credit.user.open.certify.certify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankCreditUserOpenCertifyInitializeRequest.php b/extend/alipay/aop/request/MybankCreditUserOpenCertifyInitializeRequest.php new file mode 100644 index 0000000..a4ebb9a --- /dev/null +++ b/extend/alipay/aop/request/MybankCreditUserOpenCertifyInitializeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.credit.user.open.certify.initialize"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankCreditUserSystemOauthQueryRequest.php b/extend/alipay/aop/request/MybankCreditUserSystemOauthQueryRequest.php new file mode 100644 index 0000000..a6f243a --- /dev/null +++ b/extend/alipay/aop/request/MybankCreditUserSystemOauthQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.credit.user.system.oauth.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankFinanceYulibaoAccountQueryRequest.php b/extend/alipay/aop/request/MybankFinanceYulibaoAccountQueryRequest.php new file mode 100644 index 0000000..9e45857 --- /dev/null +++ b/extend/alipay/aop/request/MybankFinanceYulibaoAccountQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.finance.yulibao.account.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankFinanceYulibaoCapitalPurchaseRequest.php b/extend/alipay/aop/request/MybankFinanceYulibaoCapitalPurchaseRequest.php new file mode 100644 index 0000000..8221feb --- /dev/null +++ b/extend/alipay/aop/request/MybankFinanceYulibaoCapitalPurchaseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.finance.yulibao.capital.purchase"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankFinanceYulibaoCapitalRansomRequest.php b/extend/alipay/aop/request/MybankFinanceYulibaoCapitalRansomRequest.php new file mode 100644 index 0000000..dfb9739 --- /dev/null +++ b/extend/alipay/aop/request/MybankFinanceYulibaoCapitalRansomRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.finance.yulibao.capital.ransom"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankFinanceYulibaoPriceQueryRequest.php b/extend/alipay/aop/request/MybankFinanceYulibaoPriceQueryRequest.php new file mode 100644 index 0000000..e464da6 --- /dev/null +++ b/extend/alipay/aop/request/MybankFinanceYulibaoPriceQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.finance.yulibao.price.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankFinanceYulibaoTransHistoryQueryRequest.php b/extend/alipay/aop/request/MybankFinanceYulibaoTransHistoryQueryRequest.php new file mode 100644 index 0000000..6e7a288 --- /dev/null +++ b/extend/alipay/aop/request/MybankFinanceYulibaoTransHistoryQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.finance.yulibao.trans.history.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankPaymentTradeFinancingOrderCloseRequest.php b/extend/alipay/aop/request/MybankPaymentTradeFinancingOrderCloseRequest.php new file mode 100644 index 0000000..0979b40 --- /dev/null +++ b/extend/alipay/aop/request/MybankPaymentTradeFinancingOrderCloseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.payment.trade.financing.order.close"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankPaymentTradeFinancingOrderCreateRequest.php b/extend/alipay/aop/request/MybankPaymentTradeFinancingOrderCreateRequest.php new file mode 100644 index 0000000..997b465 --- /dev/null +++ b/extend/alipay/aop/request/MybankPaymentTradeFinancingOrderCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.payment.trade.financing.order.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankPaymentTradeFinancingOrderRefundRequest.php b/extend/alipay/aop/request/MybankPaymentTradeFinancingOrderRefundRequest.php new file mode 100644 index 0000000..4a7514e --- /dev/null +++ b/extend/alipay/aop/request/MybankPaymentTradeFinancingOrderRefundRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.payment.trade.financing.order.refund"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankPaymentTradeOrderCreateRequest.php b/extend/alipay/aop/request/MybankPaymentTradeOrderCreateRequest.php new file mode 100644 index 0000000..9e46fe7 --- /dev/null +++ b/extend/alipay/aop/request/MybankPaymentTradeOrderCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.payment.trade.order.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankPaymentTradeQrcodeCreateRequest.php b/extend/alipay/aop/request/MybankPaymentTradeQrcodeCreateRequest.php new file mode 100644 index 0000000..69941d3 --- /dev/null +++ b/extend/alipay/aop/request/MybankPaymentTradeQrcodeCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.payment.trade.qrcode.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/MybankPaymentTradeQrcodeDeleteRequest.php b/extend/alipay/aop/request/MybankPaymentTradeQrcodeDeleteRequest.php new file mode 100644 index 0000000..19f43af --- /dev/null +++ b/extend/alipay/aop/request/MybankPaymentTradeQrcodeDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "mybank.payment.trade.qrcode.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/SsdataDataserviceRiskAlixiaohaoQueryRequest.php b/extend/alipay/aop/request/SsdataDataserviceRiskAlixiaohaoQueryRequest.php new file mode 100644 index 0000000..d9d97ea --- /dev/null +++ b/extend/alipay/aop/request/SsdataDataserviceRiskAlixiaohaoQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ssdata.dataservice.risk.alixiaohao.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/SsdataDataserviceRiskAntifraudlistQueryRequest.php b/extend/alipay/aop/request/SsdataDataserviceRiskAntifraudlistQueryRequest.php new file mode 100644 index 0000000..9bf2807 --- /dev/null +++ b/extend/alipay/aop/request/SsdataDataserviceRiskAntifraudlistQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ssdata.dataservice.risk.antifraudlist.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/SsdataDataserviceRiskAntifraudscoreQueryRequest.php b/extend/alipay/aop/request/SsdataDataserviceRiskAntifraudscoreQueryRequest.php new file mode 100644 index 0000000..1f1bc86 --- /dev/null +++ b/extend/alipay/aop/request/SsdataDataserviceRiskAntifraudscoreQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "ssdata.dataservice.risk.antifraudscore.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaAuthInfoAuthqueryRequest.php b/extend/alipay/aop/request/ZhimaAuthInfoAuthqueryRequest.php new file mode 100644 index 0000000..87afd94 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaAuthInfoAuthqueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.auth.info.authquery"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditAntifraudRiskListRequest.php b/extend/alipay/aop/request/ZhimaCreditAntifraudRiskListRequest.php new file mode 100644 index 0000000..5ec6759 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditAntifraudRiskListRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.antifraud.risk.list"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditAntifraudScoreGetRequest.php b/extend/alipay/aop/request/ZhimaCreditAntifraudScoreGetRequest.php new file mode 100644 index 0000000..0303c97 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditAntifraudScoreGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.antifraud.score.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditAntifraudVerifyRequest.php b/extend/alipay/aop/request/ZhimaCreditAntifraudVerifyRequest.php new file mode 100644 index 0000000..06f985d --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditAntifraudVerifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.antifraud.verify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditContractBorrowCancelRequest.php b/extend/alipay/aop/request/ZhimaCreditContractBorrowCancelRequest.php new file mode 100644 index 0000000..7bf0e9d --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditContractBorrowCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.contract.borrow.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditContractBorrowCreateRequest.php b/extend/alipay/aop/request/ZhimaCreditContractBorrowCreateRequest.php new file mode 100644 index 0000000..1d2fb47 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditContractBorrowCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.contract.borrow.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditContractBorrowDelayRequest.php b/extend/alipay/aop/request/ZhimaCreditContractBorrowDelayRequest.php new file mode 100644 index 0000000..ed0a63c --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditContractBorrowDelayRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.contract.borrow.delay"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditContractBorrowInitializeRequest.php b/extend/alipay/aop/request/ZhimaCreditContractBorrowInitializeRequest.php new file mode 100644 index 0000000..7ba02c6 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditContractBorrowInitializeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.contract.borrow.initialize"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditContractBorrowQueryRequest.php b/extend/alipay/aop/request/ZhimaCreditContractBorrowQueryRequest.php new file mode 100644 index 0000000..aafa618 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditContractBorrowQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.contract.borrow.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditContractBorrowReturnRequest.php b/extend/alipay/aop/request/ZhimaCreditContractBorrowReturnRequest.php new file mode 100644 index 0000000..6496c4a --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditContractBorrowReturnRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.contract.borrow.return"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditContractPrincipalQueryRequest.php b/extend/alipay/aop/request/ZhimaCreditContractPrincipalQueryRequest.php new file mode 100644 index 0000000..a28fd6c --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditContractPrincipalQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.contract.principal.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditEpInfoGetRequest.php b/extend/alipay/aop/request/ZhimaCreditEpInfoGetRequest.php new file mode 100644 index 0000000..fc779c3 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditEpInfoGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.ep.info.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditEpLawsuitDetailGetRequest.php b/extend/alipay/aop/request/ZhimaCreditEpLawsuitDetailGetRequest.php new file mode 100644 index 0000000..5b690a8 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditEpLawsuitDetailGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.ep.lawsuit.detail.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditEpLawsuitRecordGetRequest.php b/extend/alipay/aop/request/ZhimaCreditEpLawsuitRecordGetRequest.php new file mode 100644 index 0000000..abf60a9 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditEpLawsuitRecordGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.ep.lawsuit.record.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditEpSceneAgreementCancelRequest.php b/extend/alipay/aop/request/ZhimaCreditEpSceneAgreementCancelRequest.php new file mode 100644 index 0000000..9859d5b --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditEpSceneAgreementCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.ep.scene.agreement.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditEpSceneAgreementUseRequest.php b/extend/alipay/aop/request/ZhimaCreditEpSceneAgreementUseRequest.php new file mode 100644 index 0000000..5599104 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditEpSceneAgreementUseRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.ep.scene.agreement.use"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditEpSceneFulfillmentSyncRequest.php b/extend/alipay/aop/request/ZhimaCreditEpSceneFulfillmentSyncRequest.php new file mode 100644 index 0000000..3940376 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditEpSceneFulfillmentSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.ep.scene.fulfillment.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditEpSceneFulfillmentlistSyncRequest.php b/extend/alipay/aop/request/ZhimaCreditEpSceneFulfillmentlistSyncRequest.php new file mode 100644 index 0000000..f5b3b79 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditEpSceneFulfillmentlistSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.ep.scene.fulfillmentlist.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditEpSceneRatingApplyRequest.php b/extend/alipay/aop/request/ZhimaCreditEpSceneRatingApplyRequest.php new file mode 100644 index 0000000..aebdd77 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditEpSceneRatingApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.ep.scene.rating.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditEpSceneRatingInitializeRequest.php b/extend/alipay/aop/request/ZhimaCreditEpSceneRatingInitializeRequest.php new file mode 100644 index 0000000..89d8845 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditEpSceneRatingInitializeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.ep.scene.rating.initialize"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditEpSceneRatingQueryRequest.php b/extend/alipay/aop/request/ZhimaCreditEpSceneRatingQueryRequest.php new file mode 100644 index 0000000..8ddea9c --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditEpSceneRatingQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.ep.scene.rating.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditEpScoreGetRequest.php b/extend/alipay/aop/request/ZhimaCreditEpScoreGetRequest.php new file mode 100644 index 0000000..117b215 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditEpScoreGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.ep.score.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditOrderRepaymentApplyRequest.php b/extend/alipay/aop/request/ZhimaCreditOrderRepaymentApplyRequest.php new file mode 100644 index 0000000..8c7396a --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditOrderRepaymentApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.order.repayment.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditPeLawsuitDetailQueryRequest.php b/extend/alipay/aop/request/ZhimaCreditPeLawsuitDetailQueryRequest.php new file mode 100644 index 0000000..ed76ff8 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditPeLawsuitDetailQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.pe.lawsuit.detail.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditPeLawsuitRecordGetRequest.php b/extend/alipay/aop/request/ZhimaCreditPeLawsuitRecordGetRequest.php new file mode 100644 index 0000000..d27d4b8 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditPeLawsuitRecordGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.pe.lawsuit.record.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditScoreBriefGetRequest.php b/extend/alipay/aop/request/ZhimaCreditScoreBriefGetRequest.php new file mode 100644 index 0000000..ba68cdd --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditScoreBriefGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.score.brief.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditScoreGetRequest.php b/extend/alipay/aop/request/ZhimaCreditScoreGetRequest.php new file mode 100644 index 0000000..c4cf3a0 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditScoreGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.score.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditWatchlistBriefGetRequest.php b/extend/alipay/aop/request/ZhimaCreditWatchlistBriefGetRequest.php new file mode 100644 index 0000000..5261c72 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditWatchlistBriefGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.watchlist.brief.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCreditWatchlistiiGetRequest.php b/extend/alipay/aop/request/ZhimaCreditWatchlistiiGetRequest.php new file mode 100644 index 0000000..6950cb2 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCreditWatchlistiiGetRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.credit.watchlistii.get"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCustomerAuthMutualviewApplyRequest.php b/extend/alipay/aop/request/ZhimaCustomerAuthMutualviewApplyRequest.php new file mode 100644 index 0000000..5ff69de --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCustomerAuthMutualviewApplyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.customer.auth.mutualview.apply"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCustomerBehaviorSyncRequest.php b/extend/alipay/aop/request/ZhimaCustomerBehaviorSyncRequest.php new file mode 100644 index 0000000..6a31a0d --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCustomerBehaviorSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.customer.behavior.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCustomerCertificationCertifyRequest.php b/extend/alipay/aop/request/ZhimaCustomerCertificationCertifyRequest.php new file mode 100644 index 0000000..2aad7f0 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCustomerCertificationCertifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.customer.certification.certify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCustomerCertificationInitializeRequest.php b/extend/alipay/aop/request/ZhimaCustomerCertificationInitializeRequest.php new file mode 100644 index 0000000..4b1c2ce --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCustomerCertificationInitializeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.customer.certification.initialize"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCustomerCertificationMaterialCertifyRequest.php b/extend/alipay/aop/request/ZhimaCustomerCertificationMaterialCertifyRequest.php new file mode 100644 index 0000000..beea858 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCustomerCertificationMaterialCertifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.customer.certification.material.certify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCustomerCertificationQueryRequest.php b/extend/alipay/aop/request/ZhimaCustomerCertificationQueryRequest.php new file mode 100644 index 0000000..c9cf773 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCustomerCertificationQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.customer.certification.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCustomerContractDetailQueryRequest.php b/extend/alipay/aop/request/ZhimaCustomerContractDetailQueryRequest.php new file mode 100644 index 0000000..f27b797 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCustomerContractDetailQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.customer.contract.detail.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCustomerContractInitializeRequest.php b/extend/alipay/aop/request/ZhimaCustomerContractInitializeRequest.php new file mode 100644 index 0000000..4c2cc94 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCustomerContractInitializeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.customer.contract.initialize"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCustomerEpCertificationCertifyRequest.php b/extend/alipay/aop/request/ZhimaCustomerEpCertificationCertifyRequest.php new file mode 100644 index 0000000..e1cbe38 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCustomerEpCertificationCertifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.customer.ep.certification.certify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCustomerEpCertificationInitializeRequest.php b/extend/alipay/aop/request/ZhimaCustomerEpCertificationInitializeRequest.php new file mode 100644 index 0000000..b04f739 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCustomerEpCertificationInitializeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.customer.ep.certification.initialize"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaCustomerEpCertificationQueryRequest.php b/extend/alipay/aop/request/ZhimaCustomerEpCertificationQueryRequest.php new file mode 100644 index 0000000..d866425 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaCustomerEpCertificationQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.customer.ep.certification.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaDataBatchFeedbackRequest.php b/extend/alipay/aop/request/ZhimaDataBatchFeedbackRequest.php new file mode 100644 index 0000000..d210d92 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaDataBatchFeedbackRequest.php @@ -0,0 +1,230 @@ +bizExtParams = $bizExtParams; + $this->apiParas["biz_ext_params"] = $bizExtParams; + } + + public function getBizExtParams() + { + return $this->bizExtParams; + } + + public function setColumns($columns) + { + $this->columns = $columns; + $this->apiParas["columns"] = $columns; + } + + public function getColumns() + { + return $this->columns; + } + + public function setFile($file) + { + $this->file = $file; + $this->apiParas["file"] = $file; + } + + public function getFile() + { + return $this->file; + } + + public function setFileCharset($fileCharset) + { + $this->fileCharset = $fileCharset; + $this->apiParas["file_charset"] = $fileCharset; + } + + public function getFileCharset() + { + return $this->fileCharset; + } + + public function setFileDescription($fileDescription) + { + $this->fileDescription = $fileDescription; + $this->apiParas["file_description"] = $fileDescription; + } + + public function getFileDescription() + { + return $this->fileDescription; + } + + public function setFileType($fileType) + { + $this->fileType = $fileType; + $this->apiParas["file_type"] = $fileType; + } + + public function getFileType() + { + return $this->fileType; + } + + public function setPrimaryKeyColumns($primaryKeyColumns) + { + $this->primaryKeyColumns = $primaryKeyColumns; + $this->apiParas["primary_key_columns"] = $primaryKeyColumns; + } + + public function getPrimaryKeyColumns() + { + return $this->primaryKeyColumns; + } + + public function setRecords($records) + { + $this->records = $records; + $this->apiParas["records"] = $records; + } + + public function getRecords() + { + return $this->records; + } + + public function getApiMethodName() + { + return "zhima.data.batch.feedback"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaDataFeedbackurlQueryRequest.php b/extend/alipay/aop/request/ZhimaDataFeedbackurlQueryRequest.php new file mode 100644 index 0000000..dafce47 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaDataFeedbackurlQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.data.feedbackurl.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaDataStateDataSyncRequest.php b/extend/alipay/aop/request/ZhimaDataStateDataSyncRequest.php new file mode 100644 index 0000000..57f4050 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaDataStateDataSyncRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.data.state.data.sync"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantBorrowEntityUploadRequest.php b/extend/alipay/aop/request/ZhimaMerchantBorrowEntityUploadRequest.php new file mode 100644 index 0000000..2dd69b3 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantBorrowEntityUploadRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.borrow.entity.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantCloseloopDataUploadRequest.php b/extend/alipay/aop/request/ZhimaMerchantCloseloopDataUploadRequest.php new file mode 100644 index 0000000..d68b761 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantCloseloopDataUploadRequest.php @@ -0,0 +1,234 @@ +bizExtParams = $bizExtParams; + $this->apiParas["biz_ext_params"] = $bizExtParams; + } + + public function getBizExtParams() + { + return $this->bizExtParams; + } + + public function setColumns($columns) + { + $this->columns = $columns; + $this->apiParas["columns"] = $columns; + } + + public function getColumns() + { + return $this->columns; + } + + public function setFile($file) + { + $this->file = $file; + $this->apiParas["file"] = $file; + } + + public function getFile() + { + return $this->file; + } + + public function setFileCharset($fileCharset) + { + $this->fileCharset = $fileCharset; + $this->apiParas["file_charset"] = $fileCharset; + } + + public function getFileCharset() + { + return $this->fileCharset; + } + + public function setLinkedMerchantId($linkedMerchantId) + { + $this->linkedMerchantId = $linkedMerchantId; + $this->apiParas["linked_merchant_id"] = $linkedMerchantId; + } + + public function getLinkedMerchantId() + { + return $this->linkedMerchantId; + } + + public function setPrimaryKeyColumns($primaryKeyColumns) + { + $this->primaryKeyColumns = $primaryKeyColumns; + $this->apiParas["primary_key_columns"] = $primaryKeyColumns; + } + + public function getPrimaryKeyColumns() + { + return $this->primaryKeyColumns; + } + + public function setRecords($records) + { + $this->records = $records; + $this->apiParas["records"] = $records; + } + + public function getRecords() + { + return $this->records; + } + + public function setSceneCode($sceneCode) + { + $this->sceneCode = $sceneCode; + $this->apiParas["scene_code"] = $sceneCode; + } + + public function getSceneCode() + { + return $this->sceneCode; + } + + public function getApiMethodName() + { + return "zhima.merchant.closeloop.data.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantContractCommonCancelRequest.php b/extend/alipay/aop/request/ZhimaMerchantContractCommonCancelRequest.php new file mode 100644 index 0000000..5749870 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantContractCommonCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.contract.common.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantContractCommonConfirmRequest.php b/extend/alipay/aop/request/ZhimaMerchantContractCommonConfirmRequest.php new file mode 100644 index 0000000..9d88455 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantContractCommonConfirmRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.contract.common.confirm"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantContractCommonQueryRequest.php b/extend/alipay/aop/request/ZhimaMerchantContractCommonQueryRequest.php new file mode 100644 index 0000000..ba4684e --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantContractCommonQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.contract.common.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantContractOfferModifyRequest.php b/extend/alipay/aop/request/ZhimaMerchantContractOfferModifyRequest.php new file mode 100644 index 0000000..55f26e8 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantContractOfferModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.contract.offer.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantContractOfferQueryRequest.php b/extend/alipay/aop/request/ZhimaMerchantContractOfferQueryRequest.php new file mode 100644 index 0000000..ed483c6 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantContractOfferQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.contract.offer.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantContractOnofferQueryRequest.php b/extend/alipay/aop/request/ZhimaMerchantContractOnofferQueryRequest.php new file mode 100644 index 0000000..4fd3f24 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantContractOnofferQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.contract.onoffer.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantContractPageQueryRequest.php b/extend/alipay/aop/request/ZhimaMerchantContractPageQueryRequest.php new file mode 100644 index 0000000..2077cf3 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantContractPageQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.contract.page.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantContractQuickCreateRequest.php b/extend/alipay/aop/request/ZhimaMerchantContractQuickCreateRequest.php new file mode 100644 index 0000000..9a3a414 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantContractQuickCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.contract.quick.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantCreditserviceDetailCreateRequest.php b/extend/alipay/aop/request/ZhimaMerchantCreditserviceDetailCreateRequest.php new file mode 100644 index 0000000..626ff33 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantCreditserviceDetailCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.creditservice.detail.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantCreditserviceDetailModifyRequest.php b/extend/alipay/aop/request/ZhimaMerchantCreditserviceDetailModifyRequest.php new file mode 100644 index 0000000..7a7b821 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantCreditserviceDetailModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.creditservice.detail.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantCreditserviceDetailQueryRequest.php b/extend/alipay/aop/request/ZhimaMerchantCreditserviceDetailQueryRequest.php new file mode 100644 index 0000000..13a1b3d --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantCreditserviceDetailQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.creditservice.detail.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantDataUploadInitializeRequest.php b/extend/alipay/aop/request/ZhimaMerchantDataUploadInitializeRequest.php new file mode 100644 index 0000000..47bacd9 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantDataUploadInitializeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.data.upload.initialize"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantLogoImageUploadRequest.php b/extend/alipay/aop/request/ZhimaMerchantLogoImageUploadRequest.php new file mode 100644 index 0000000..8881336 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantLogoImageUploadRequest.php @@ -0,0 +1,118 @@ +file = $file; + $this->apiParas["file"] = $file; + } + + public function getFile() + { + return $this->file; + } + + public function getApiMethodName() + { + return "zhima.merchant.logo.image.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantOrderRentCancelRequest.php b/extend/alipay/aop/request/ZhimaMerchantOrderRentCancelRequest.php new file mode 100644 index 0000000..d352cc6 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantOrderRentCancelRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.order.rent.cancel"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantOrderRentCompleteRequest.php b/extend/alipay/aop/request/ZhimaMerchantOrderRentCompleteRequest.php new file mode 100644 index 0000000..1758b89 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantOrderRentCompleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.order.rent.complete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantOrderRentCreateRequest.php b/extend/alipay/aop/request/ZhimaMerchantOrderRentCreateRequest.php new file mode 100644 index 0000000..2910150 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantOrderRentCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.order.rent.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantOrderRentModifyRequest.php b/extend/alipay/aop/request/ZhimaMerchantOrderRentModifyRequest.php new file mode 100644 index 0000000..3eea221 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantOrderRentModifyRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.order.rent.modify"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantOrderRentQueryRequest.php b/extend/alipay/aop/request/ZhimaMerchantOrderRentQueryRequest.php new file mode 100644 index 0000000..1dea174 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantOrderRentQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.order.rent.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantSingleDataUploadRequest.php b/extend/alipay/aop/request/ZhimaMerchantSingleDataUploadRequest.php new file mode 100644 index 0000000..c7d91a9 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantSingleDataUploadRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.single.data.upload"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaMerchantTestPracticeRequest.php b/extend/alipay/aop/request/ZhimaMerchantTestPracticeRequest.php new file mode 100644 index 0000000..c114b01 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaMerchantTestPracticeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.merchant.test.practice"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaOpenAppDesSendRequest.php b/extend/alipay/aop/request/ZhimaOpenAppDesSendRequest.php new file mode 100644 index 0000000..aea1f59 --- /dev/null +++ b/extend/alipay/aop/request/ZhimaOpenAppDesSendRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.open.app.des.send"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaOpenAppKeyanLqlCreateRequest.php b/extend/alipay/aop/request/ZhimaOpenAppKeyanLqlCreateRequest.php new file mode 100644 index 0000000..a0b576e --- /dev/null +++ b/extend/alipay/aop/request/ZhimaOpenAppKeyanLqlCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.open.app.keyan.lql.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZhimaOpenQerqQerqQueryRequest.php b/extend/alipay/aop/request/ZhimaOpenQerqQerqQueryRequest.php new file mode 100644 index 0000000..0730eba --- /dev/null +++ b/extend/alipay/aop/request/ZhimaOpenQerqQerqQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zhima.open.qerq.qerq.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZolozAuthenticationCustomerFacemanageCreateRequest.php b/extend/alipay/aop/request/ZolozAuthenticationCustomerFacemanageCreateRequest.php new file mode 100644 index 0000000..a108fa0 --- /dev/null +++ b/extend/alipay/aop/request/ZolozAuthenticationCustomerFacemanageCreateRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zoloz.authentication.customer.facemanage.create"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZolozAuthenticationCustomerFacemanageDeleteRequest.php b/extend/alipay/aop/request/ZolozAuthenticationCustomerFacemanageDeleteRequest.php new file mode 100644 index 0000000..611939d --- /dev/null +++ b/extend/alipay/aop/request/ZolozAuthenticationCustomerFacemanageDeleteRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zoloz.authentication.customer.facemanage.delete"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZolozAuthenticationCustomerFtokenQueryRequest.php b/extend/alipay/aop/request/ZolozAuthenticationCustomerFtokenQueryRequest.php new file mode 100644 index 0000000..9a78fd2 --- /dev/null +++ b/extend/alipay/aop/request/ZolozAuthenticationCustomerFtokenQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zoloz.authentication.customer.ftoken.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZolozAuthenticationCustomerSmilepayInitializeRequest.php b/extend/alipay/aop/request/ZolozAuthenticationCustomerSmilepayInitializeRequest.php new file mode 100644 index 0000000..5e0ef24 --- /dev/null +++ b/extend/alipay/aop/request/ZolozAuthenticationCustomerSmilepayInitializeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zoloz.authentication.customer.smilepay.initialize"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZolozAuthenticationSmilepayInitializeRequest.php b/extend/alipay/aop/request/ZolozAuthenticationSmilepayInitializeRequest.php new file mode 100644 index 0000000..b77f662 --- /dev/null +++ b/extend/alipay/aop/request/ZolozAuthenticationSmilepayInitializeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zoloz.authentication.smilepay.initialize"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZolozIdentificationCustomerCertifyzhubQueryRequest.php b/extend/alipay/aop/request/ZolozIdentificationCustomerCertifyzhubQueryRequest.php new file mode 100644 index 0000000..83a868f --- /dev/null +++ b/extend/alipay/aop/request/ZolozIdentificationCustomerCertifyzhubQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zoloz.identification.customer.certifyzhub.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZolozIdentificationUserWebInitializeRequest.php b/extend/alipay/aop/request/ZolozIdentificationUserWebInitializeRequest.php new file mode 100644 index 0000000..aa2eee0 --- /dev/null +++ b/extend/alipay/aop/request/ZolozIdentificationUserWebInitializeRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zoloz.identification.user.web.initialize"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/request/ZolozIdentificationUserWebQueryRequest.php b/extend/alipay/aop/request/ZolozIdentificationUserWebQueryRequest.php new file mode 100644 index 0000000..4e45d5f --- /dev/null +++ b/extend/alipay/aop/request/ZolozIdentificationUserWebQueryRequest.php @@ -0,0 +1,118 @@ +bizContent = $bizContent; + $this->apiParas["biz_content"] = $bizContent; + } + + public function getBizContent() + { + return $this->bizContent; + } + + public function getApiMethodName() + { + return "zoloz.identification.user.web.query"; + } + + public function setNotifyUrl($notifyUrl) + { + $this->notifyUrl=$notifyUrl; + } + + public function getNotifyUrl() + { + return $this->notifyUrl; + } + + public function setReturnUrl($returnUrl) + { + $this->returnUrl=$returnUrl; + } + + public function getReturnUrl() + { + return $this->returnUrl; + } + + public function getApiParas() + { + return $this->apiParas; + } + + public function getTerminalType() + { + return $this->terminalType; + } + + public function setTerminalType($terminalType) + { + $this->terminalType = $terminalType; + } + + public function getTerminalInfo() + { + return $this->terminalInfo; + } + + public function setTerminalInfo($terminalInfo) + { + $this->terminalInfo = $terminalInfo; + } + + public function getProdCode() + { + return $this->prodCode; + } + + public function setProdCode($prodCode) + { + $this->prodCode = $prodCode; + } + + public function setApiVersion($apiVersion) + { + $this->apiVersion=$apiVersion; + } + + public function getApiVersion() + { + return $this->apiVersion; + } + + public function setNeedEncrypt($needEncrypt) + { + + $this->needEncrypt=$needEncrypt; + + } + + public function getNeedEncrypt() + { + return $this->needEncrypt; + } + +} diff --git a/extend/alipay/aop/test/AopCertClientTest.php b/extend/alipay/aop/test/AopCertClientTest.php new file mode 100644 index 0000000..b1f9357 --- /dev/null +++ b/extend/alipay/aop/test/AopCertClientTest.php @@ -0,0 +1,178 @@ +gatewayUrl = 'https://openapi.alipay.com/gateway.do'; +$aop->appId = '你的appid'; +$aop->rsaPrivateKey = '你的应用私钥'; +$aop->alipayrsaPublicKey = $aop->getPublicKey($alipayCertPath);//调用getPublicKey从支付宝公钥证书中提取公钥 +$aop->apiVersion = '1.0'; +$aop->signType = 'RSA2'; +$aop->postCharset = 'utf-8'; +$aop->format = 'json'; +$aop->isCheckAlipayPublicCert = true;//是否校验自动下载的支付宝公钥证书,如果开启校验要保证支付宝根证书在有效期内 +$aop->appCertSN = $aop->getCertSN($appCertPath);//调用getCertSN获取证书序列号 +$aop->alipayRootCertSN = $aop->getRootCertSN($rootCertPath);//调用getRootCertSN获取支付宝根证书序列号 + +$request = new AlipayTradeQueryRequest (); +$request->setBizContent("{" . + "\"out_trade_no\":\"20150320010101001\"," . + "\"trade_no\":\"2014112611001004680 073956707\"," . + "\"org_pid\":\"2088101117952222\"," . + " \"query_options\":[" . + " \"TRADE_SETTE_INFO\"" . + " ]" . + " }"); +$result = $aop->execute($request); +var_dump($result); + + +//2、sdkExecute 测试 +$aop = new AopCertClient (); +$appCertPath = "应用证书路径(要确保证书文件可读),例如:/home/admin/cert/appCertPublicKey.crt"; +$alipayCertPath = "支付宝公钥证书路径(要确保证书文件可读),例如:/home/admin/cert/alipayCertPublicKey_RSA2.crt"; +$rootCertPath = "支付宝根证书路径(要确保证书文件可读),例如:/home/admin/cert/alipayRootCert.crt"; + +$aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do'; +$aop->appId = '你的appid'; +$aop->rsaPrivateKey = '你的应用私钥'; +$aop->alipayrsaPublicKey = $aop->getPublicKey($alipayCertPath); +$aop->apiVersion = '1.0'; +$aop->signType = 'RSA2'; +$aop->postCharset = 'utf-8'; +$aop->format = 'json'; +$aop->isCheckAlipayPublicCert = true;//是否校验自动下载的支付宝公钥证书,如果开启校验要保证支付宝根证书在有效期内 +$aop->appCertSN = $aop->getCertSN($appCertPath);//调用getCertSN获取证书序列号 +$aop->alipayRootCertSN = $aop->getRootCertSN($rootCertPath);//调用getRootCertSN获取支付宝根证书序列号 + + +$request = new AlipayTradeAppPayRequest (); +$request->setBizContent("{" . + "\"timeout_express\":\"90m\"," . + "\"total_amount\":\"9.00\"," . + "\"product_code\":\"QUICK_MSECURITY_PAY\"," . + "\"body\":\"Iphone6 16G\"," . + "\"subject\":\"大乐透\"," . + "\"out_trade_no\":\"70501111111S001111119\"," . + "\"time_expire\":\"2016-12-31 10:05\"," . + "\"goods_type\":\"0\"," . + "\"promo_params\":\"{\\\"storeIdType\\\":\\\"1\\\"}\"," . + "\"passback_params\":\"merchantBizType%3d3C%26merchantBizNo%3d2016010101111\"," . + "\"extend_params\":{" . + "\"sys_service_provider_id\":\"2088511833207846\"," . + "\"hb_fq_num\":\"3\"," . + "\"hb_fq_seller_percent\":\"100\"," . + "\"industry_reflux_info\":\"{\\\\\\\"scene_code\\\\\\\":\\\\\\\"metro_tradeorder\\\\\\\",\\\\\\\"channel\\\\\\\":\\\\\\\"xxxx\\\\\\\",\\\\\\\"scene_data\\\\\\\":{\\\\\\\"asset_name\\\\\\\":\\\\\\\"ALIPAY\\\\\\\"}}\"," . + "\"card_type\":\"S0JP0000\"" . + " }," . + "\"merchant_order_no\":\"20161008001\"," . + "\"enable_pay_channels\":\"pcredit,moneyFund,debitCardExpress\"," . + "\"store_id\":\"NJ_001\"," . + "\"specified_channel\":\"pcredit\"," . + "\"disable_pay_channels\":\"pcredit,moneyFund,debitCardExpress\"," . + " \"goods_detail\":[{" . + " \"goods_id\":\"apple-01\"," . + "\"alipay_goods_id\":\"20010001\"," . + "\"goods_name\":\"ipad\"," . + "\"quantity\":1," . + "\"price\":2000," . + "\"goods_category\":\"34543238\"," . + "\"categories_tree\":\"124868003|126232002|126252004\"," . + "\"body\":\"特价手机\"," . + "\"show_url\":\"http://www.alipay.com/xxx.jpg\"" . + " }]," . + "\"ext_user_info\":{" . + "\"name\":\"李明\"," . + "\"mobile\":\"16587658765\"," . + "\"cert_type\":\"IDENTITY_CARD\"," . + "\"cert_no\":\"362334768769238881\"," . + "\"min_age\":\"18\"," . + "\"fix_buyer\":\"F\"," . + "\"need_check_info\":\"F\"" . + " }," . + "\"business_params\":\"{\\\"data\\\":\\\"123\\\"}\"," . + "\"agreement_sign_params\":{" . + "\"personal_product_code\":\"CYCLE_PAY_AUTH_P\"," . + "\"sign_scene\":\"INDUSTRY|DIGITAL_MEDIA\"," . + "\"external_agreement_no\":\"test20190701\"," . + "\"external_logon_id\":\"13852852877\"," . + "\"access_params\":{" . + "\"channel\":\"ALIPAYAPP\"" . + " }," . + "\"sub_merchant\":{" . + "\"sub_merchant_id\":\"2088123412341234\"," . + "\"sub_merchant_name\":\"滴滴出行\"," . + "\"sub_merchant_service_name\":\"滴滴出行免密支付\"," . + "\"sub_merchant_service_description\":\"免密付车费,单次最高500\"" . + " }," . + "\"period_rule_params\":{" . + "\"period_type\":\"DAY\"," . + "\"period\":3," . + "\"execute_time\":\"2019-01-23\"," . + "\"single_amount\":10.99," . + "\"total_amount\":600," . + "\"total_payments\":12" . + " }" . + " }" . + " }"); +$result = $aop->sdkExecute($request); +$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response"; +echo $responseNode; +$resultCode = $result->$responseNode->code; +if (!empty($resultCode) && $resultCode == 10000) { + echo "成功"; +} else { + echo "失败"; +} + + +//3、pageExecute 测试 +$aop = new AopCertClient (); +$appCertPath = "应用证书路径(要确保证书文件可读),例如:/home/admin/cert/appCertPublicKey.crt"; +$alipayCertPath = "支付宝公钥证书路径(要确保证书文件可读),例如:/home/admin/cert/alipayCertPublicKey_RSA2.crt"; +$rootCertPath = "支付宝根证书路径(要确保证书文件可读),例如:/home/admin/cert/alipayRootCert.crt"; + +$aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do'; +$aop->appId = '你的appid'; +$aop->rsaPrivateKey = '你的应用私钥'; +$aop->alipayrsaPublicKey = $aop->getPublicKey($alipayCertPath); +$aop->apiVersion = '1.0'; +$aop->signType = 'RSA2'; +$aop->postCharset = 'utf-8'; +$aop->format = 'json'; +$aop->isCheckAlipayPublicCert = true;//是否校验自动下载的支付宝公钥证书,如果开启校验要保证支付宝根证书在有效期内 +$aop->appCertSN = $aop->getCertSN($appCertPath);//调用getCertSN获取证书序列号 +$aop->alipayRootCertSN = $aop->getRootCertSN($rootCertPath);//调用getRootCertSN获取支付宝根证书序列号 + +$request = new AlipayTradeWapPayRequest (); +$request->setBizContent("{" . + " \"body\":\"对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。\"," . + " \"subject\":\"测试\"," . + " \"out_trade_no\":\"70501111111S001111119\"," . + " \"timeout_express\":\"90m\"," . + " \"total_amount\":9.00," . + " \"product_code\":\"QUICK_WAP_WAY\"" . + " }"); +$result = $aop->pageExecute($request); +echo $result; + + diff --git a/extend/alipay/aop/test/AopCertificationTest.php b/extend/alipay/aop/test/AopCertificationTest.php new file mode 100644 index 0000000..b2657c7 --- /dev/null +++ b/extend/alipay/aop/test/AopCertificationTest.php @@ -0,0 +1,146 @@ +gatewayUrl = 'https://openapi.alipay.com/gateway.do'; +$aop->appId = '你的appid'; +$aop->rsaPrivateKey = '你的应用私钥'; +$aop->alipayrsaPublicKey = '你的支付宝公钥'; +$aop->apiVersion = '1.0'; +$aop->signType = 'RSA2'; +$aop->postCharset = 'utf-8'; +$aop->format = 'json'; + +$request = new AlipayTradeQueryRequest (); +$request->setBizContent("{" . + "\"out_trade_no\":\"20150320010101001\"," . + "\"trade_no\":\"2014112611001004680 073956707\"," . + "\"org_pid\":\"2088101117952222\"," . + " \"query_options\":[" . + " \"TRADE_SETTE_INFO\"" . + " ]" . + " }"); +$result = $aop->execute($request); +var_dump($result); + + +//2、sdkExecute 测试 +$aop = new AopClient (); + +$aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do'; +$aop->appId = '你的appid'; +$aop->rsaPrivateKey = '你的应用私钥'; +$aop->alipayrsaPublicKey = '你的支付宝公钥'; +$aop->apiVersion = '1.0'; +$aop->signType = 'RSA2'; +$aop->postCharset = 'utf-8'; +$aop->format = 'json'; + +$request = new AlipayTradeAppPayRequest (); +$request->setBizContent("{" . + "\"timeout_express\":\"90m\"," . + "\"total_amount\":\"9.00\"," . + "\"product_code\":\"QUICK_MSECURITY_PAY\"," . + "\"body\":\"Iphone6 16G\"," . + "\"subject\":\"大乐透\"," . + "\"out_trade_no\":\"70501111111S001111119\"," . + "\"time_expire\":\"2016-12-31 10:05\"," . + "\"goods_type\":\"0\"," . + "\"promo_params\":\"{\\\"storeIdType\\\":\\\"1\\\"}\"," . + "\"passback_params\":\"merchantBizType%3d3C%26merchantBizNo%3d2016010101111\"," . + "\"extend_params\":{" . + "\"sys_service_provider_id\":\"2088511833207846\"," . + "\"hb_fq_num\":\"3\"," . + "\"hb_fq_seller_percent\":\"100\"," . + "\"industry_reflux_info\":\"{\\\\\\\"scene_code\\\\\\\":\\\\\\\"metro_tradeorder\\\\\\\",\\\\\\\"channel\\\\\\\":\\\\\\\"xxxx\\\\\\\",\\\\\\\"scene_data\\\\\\\":{\\\\\\\"asset_name\\\\\\\":\\\\\\\"ALIPAY\\\\\\\"}}\"," . + "\"card_type\":\"S0JP0000\"" . + " }," . + "\"merchant_order_no\":\"20161008001\"," . + "\"enable_pay_channels\":\"pcredit,moneyFund,debitCardExpress\"," . + "\"store_id\":\"NJ_001\"," . + "\"specified_channel\":\"pcredit\"," . + "\"disable_pay_channels\":\"pcredit,moneyFund,debitCardExpress\"," . + " \"goods_detail\":[{" . + " \"goods_id\":\"apple-01\"," . + "\"alipay_goods_id\":\"20010001\"," . + "\"goods_name\":\"ipad\"," . + "\"quantity\":1," . + "\"price\":2000," . + "\"goods_category\":\"34543238\"," . + "\"categories_tree\":\"124868003|126232002|126252004\"," . + "\"body\":\"特价手机\"," . + "\"show_url\":\"http://www.alipay.com/xxx.jpg\"" . + " }]," . + "\"ext_user_info\":{" . + "\"name\":\"李明\"," . + "\"mobile\":\"16587658765\"," . + "\"cert_type\":\"IDENTITY_CARD\"," . + "\"cert_no\":\"362334768769238881\"," . + "\"min_age\":\"18\"," . + "\"fix_buyer\":\"F\"," . + "\"need_check_info\":\"F\"" . + " }," . + "\"business_params\":\"{\\\"data\\\":\\\"123\\\"}\"," . + "\"agreement_sign_params\":{" . + "\"personal_product_code\":\"CYCLE_PAY_AUTH_P\"," . + "\"sign_scene\":\"INDUSTRY|DIGITAL_MEDIA\"," . + "\"external_agreement_no\":\"test20190701\"," . + "\"external_logon_id\":\"13852852877\"," . + "\"access_params\":{" . + "\"channel\":\"ALIPAYAPP\"" . + " }," . + "\"sub_merchant\":{" . + "\"sub_merchant_id\":\"2088123412341234\"," . + "\"sub_merchant_name\":\"滴滴出行\"," . + "\"sub_merchant_service_name\":\"滴滴出行免密支付\"," . + "\"sub_merchant_service_description\":\"免密付车费,单次最高500\"" . + " }," . + "\"period_rule_params\":{" . + "\"period_type\":\"DAY\"," . + "\"period\":3," . + "\"execute_time\":\"2019-01-23\"," . + "\"single_amount\":10.99," . + "\"total_amount\":600," . + "\"total_payments\":12" . + " }" . + " }" . + " }"); +$result = $aop->sdkExecute($request); + +$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response"; +echo $responseNode; +$resultCode = $result->$responseNode->code; +if (!empty($resultCode) && $resultCode == 10000) { + echo "成功"; +} else { + echo "失败"; +} + + +//3、pageExecute 测试 +$aop = new AopClient (); + +$aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do'; +$aop->appId = '你的appid'; +$aop->rsaPrivateKey = '你的应用私钥'; +$aop->alipayrsaPublicKey = '你的支付宝公钥'; +$aop->apiVersion = '1.0'; +$aop->signType = 'RSA2'; +$aop->postCharset = 'utf-8'; +$aop->format = 'json'; + +$request = new AlipayTradeWapPayRequest (); +$request->setBizContent("{" . + " \"body\":\"对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。\"," . + " \"subject\":\"测试\"," . + " \"out_trade_no\":\"70501111111S001111119\"," . + " \"timeout_express\":\"90m\"," . + " \"total_amount\":9.00," . + " \"product_code\":\"QUICK_WAP_WAY\"" . + " }"); +$result = $aop->pageExecute($request); +echo $result; + + diff --git a/extend/alipay/version.txt b/extend/alipay/version.txt new file mode 100644 index 0000000..464ea8b --- /dev/null +++ b/extend/alipay/version.txt @@ -0,0 +1 @@ +ǰ汾:4.9.2 ʱ:2020-09-02 15:59:15 \ No newline at end of file diff --git a/extend/phpqrcode/CHANGELOG b/extend/phpqrcode/CHANGELOG new file mode 100644 index 0000000..a6c53d2 --- /dev/null +++ b/extend/phpqrcode/CHANGELOG @@ -0,0 +1,38 @@ +* 1.0.0 build 2010031920 + + - first public release + - help in readme, install + - cleanup ans separation of QRtools and QRspec + - now TCPDF binding requires minimal changes in TCPDF, having most of job + done in QRtools tcpdfBarcodeArray + - nicer QRtools::timeBenchmark output + - license and copyright notices in files + - indent cleanup - from tab to 4spc, keep it that way please :) + - sf project, repository, wiki + - simple code generator in index.php + +* 1.1.0 build 2010032113 + + - added merge tool wich generate merged version of code + located in phpqrcode.php + - splited qrconst.php from qrlib.php + +* 1.1.1 build 2010032405 + + - patch by Rick Seymour allowing saving PNG and displaying it at the same time + - added version info in VERSION file + - modified merge tool to include version info into generated file + - fixed e-mail in almost all head comments + +* 1.1.2 build 2010032722 + + - full integration with TCPDF thanks to Nicola Asuni, it's author + - fixed bug with alphanumeric encoding detection + +* 1.1.3 build 2010081807 + + - short opening tags replaced with standard ones + +* 1.1.4 build 2010100721 + + - added missing static keyword QRinput::check (found by Luke Brookhart, Onjax LLC) diff --git a/extend/phpqrcode/INSTALL b/extend/phpqrcode/INSTALL new file mode 100644 index 0000000..945c95a --- /dev/null +++ b/extend/phpqrcode/INSTALL @@ -0,0 +1,67 @@ +== REQUIREMENTS == + + * PHP5 + * PHP GD2 extension with JPEG and PNG support + +== INSTALLATION == + +If you want to recreate cache by yourself make sure cache directory is +writable and you have permisions to write into it. Also make sure you are +able to read files in it if you have cache option enabled + +== CONFIGURATION == + +Feel free to modify config constants in qrconfig.php file. Read about it in +provided comments and project wiki page (links in README file) + +== QUICK START == + +Notice: probably you should'nt use all of this in same script :) + +encode('PHP QR Code :)'); +QRspec::debug($tab, true); + +== TCPDF INTEGRATION == + +Inside bindings/tcpdf you will find slightly modified 2dbarcodes.php. +Instal phpqrcode liblaty inside tcpdf folder, then overwrite (or merge) +2dbarcodes.php + +Then use similar as example #50 from TCPDF examples: + + true, + 'padding' => 4, + 'fgcolor' => array(0,0,0), + 'bgcolor' => false, //array(255,255,255) +); + +//code name: QR, specify error correction level after semicolon (L,M,Q,H) +$pdf->write2DBarcode('PHP QR Code :)', 'QR,L', '', '', 30, 30, $style, 'N'); diff --git a/extend/phpqrcode/LICENSE b/extend/phpqrcode/LICENSE new file mode 100644 index 0000000..31afd6d --- /dev/null +++ b/extend/phpqrcode/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/extend/phpqrcode/README b/extend/phpqrcode/README new file mode 100644 index 0000000..dd598f0 --- /dev/null +++ b/extend/phpqrcode/README @@ -0,0 +1,45 @@ +This is PHP implementation of QR Code 2-D barcode generator. It is pure-php +LGPL-licensed implementation based on C libqrencode by Kentaro Fukuchi. + +== LICENSING == + +Copyright (C) 2010 by Dominik Dzienia + +This library is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free +Software Foundation; either version 3 of the License, or any later version. + +This library is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU Lesser General Public License (LICENSE file) +for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this library; if not, write to the Free Software Foundation, Inc., 51 +Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +== INSTALATION AND USAGE == + + * INSTALL file + * http://sourceforge.net/apps/mediawiki/phpqrcode/index.php?title=Main_Page + +== CONTACT == + +Fell free to contact me via e-mail (deltalab at poczta dot fm) or using +folowing project pages: + + * http://sourceforge.net/projects/phpqrcode/ + * http://phpqrcode.sourceforge.net/ + +== ACKNOWLEDGMENTS == + +Based on C libqrencode library (ver. 3.1.1) +Copyright (C) 2006-2010 by Kentaro Fukuchi +http://megaui.net/fukuchi/works/qrencode/index.en.html + +QR Code is registered trademarks of DENSO WAVE INCORPORATED in JAPAN and other +countries. + +Reed-Solomon code encoder is written by Phil Karn, KA9Q. +Copyright (C) 2002, 2003, 2004, 2006 Phil Karn, KA9Q + \ No newline at end of file diff --git a/extend/phpqrcode/VERSION b/extend/phpqrcode/VERSION new file mode 100644 index 0000000..2677b36 --- /dev/null +++ b/extend/phpqrcode/VERSION @@ -0,0 +1,2 @@ +1.1.4 +2010100721 \ No newline at end of file diff --git a/extend/phpqrcode/bindings/tcpdf/qrcode.php b/extend/phpqrcode/bindings/tcpdf/qrcode.php new file mode 100644 index 0000000..7995460 --- /dev/null +++ b/extend/phpqrcode/bindings/tcpdf/qrcode.php @@ -0,0 +1,2875 @@ + +// http://phpqrcode.sourceforge.net/ +// https://sourceforge.net/projects/phpqrcode/ +// +// The "PHP QR Code encoder" is based on +// "C libqrencode library" (ver. 3.1.1) +// License: GNU-LGPL 2.1 +// Copyright (C) 2006-2010 by Kentaro Fukuchi +// http://megaui.net/fukuchi/works/qrencode/index.en.html +// +// Reed-Solomon code encoder is written by Phil Karn, KA9Q. +// Copyright (C) 2002-2006 Phil Karn, KA9Q +// +// QR Code is registered trademark of DENSO WAVE INCORPORATED +// http://www.denso-wave.com/qrcode/index-e.html +// --------------------------------------------------------- +// +// Author: Nicola Asuni +// +// (c) Copyright 2010: +// Nicola Asuni +// Tecnick.com S.r.l. +// Via della Pace, 11 +// 09044 Quartucciu (CA) +// ITALY +// www.tecnick.com +// info@tecnick.com +//============================================================+ + +/** + * Class to create QR-code arrays for TCPDF class. + * QR Code symbol is a 2D barcode that can be scanned by handy terminals such as a mobile phone with CCD. + * The capacity of QR Code is up to 7000 digits or 4000 characters, and has high robustness. + * This class supports QR Code model 2, described in JIS (Japanese Industrial Standards) X0510:2004 or ISO/IEC 18004. + * Currently the following features are not supported: ECI and FNC1 mode, Micro QR Code, QR Code model 1, Structured mode. + * + * This class is derived from "PHP QR Code encoder" by Dominik Dzienia (http://phpqrcode.sourceforge.net/) based on "libqrencode C library 3.1.1." by Kentaro Fukuchi (http://megaui.net/fukuchi/works/qrencode/index.en.html), contains Reed-Solomon code written by Phil Karn, KA9Q. QR Code is registered trademark of DENSO WAVE INCORPORATED (http://www.denso-wave.com/qrcode/index-e.html). + * Please read comments on this class source file for full copyright and license information. + * + * @package com.tecnick.tcpdf + * @abstract Class for generating QR-code array for TCPDF. + * @author Nicola Asuni + * @copyright 2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com + * @link http://www.tcpdf.org + * @license http://www.gnu.org/copyleft/lesser.html LGPL + * @version 1.0.002 + */ + +// definitions +if (!defined('QRCODEDEFS')) { + + /** + * Indicate that definitions for this class are set + */ + define('QRCODEDEFS', true); + + // ----------------------------------------------------- + + // Encoding modes (characters which can be encoded in QRcode) + + /** + * Encoding mode + */ + define('QR_MODE_NL', -1); + + /** + * Encoding mode numeric (0-9). 3 characters are encoded to 10bit length. In theory, 7089 characters or less can be stored in a QRcode. + */ + define('QR_MODE_NM', 0); + + /** + * Encoding mode alphanumeric (0-9A-Z $%*+-./:) 45characters. 2 characters are encoded to 11bit length. In theory, 4296 characters or less can be stored in a QRcode. + */ + define('QR_MODE_AN', 1); + + /** + * Encoding mode 8bit byte data. In theory, 2953 characters or less can be stored in a QRcode. + */ + define('QR_MODE_8B', 2); + + /** + * Encoding mode KANJI. A KANJI character (multibyte character) is encoded to 13bit length. In theory, 1817 characters or less can be stored in a QRcode. + */ + define('QR_MODE_KJ', 3); + + /** + * Encoding mode STRUCTURED (currently unsupported) + */ + define('QR_MODE_ST', 4); + + // ----------------------------------------------------- + + // Levels of error correction. + // QRcode has a function of an error correcting for miss reading that white is black. + // Error correcting is defined in 4 level as below. + + /** + * Error correction level L : About 7% or less errors can be corrected. + */ + define('QR_ECLEVEL_L', 0); + + /** + * Error correction level M : About 15% or less errors can be corrected. + */ + define('QR_ECLEVEL_M', 1); + + /** + * Error correction level Q : About 25% or less errors can be corrected. + */ + define('QR_ECLEVEL_Q', 2); + + /** + * Error correction level H : About 30% or less errors can be corrected. + */ + define('QR_ECLEVEL_H', 3); + + // ----------------------------------------------------- + + // Version. Size of QRcode is defined as version. + // Version is from 1 to 40. + // Version 1 is 21*21 matrix. And 4 modules increases whenever 1 version increases. + // So version 40 is 177*177 matrix. + + /** + * Maximum QR Code version. + */ + define('QRSPEC_VERSION_MAX', 40); + + /** + * Maximum matrix size for maximum version (version 40 is 177*177 matrix). + */ + define('QRSPEC_WIDTH_MAX', 177); + + // ----------------------------------------------------- + + /** + * Matrix index to get width from $capacity array. + */ + define('QRCAP_WIDTH', 0); + + /** + * Matrix index to get number of words from $capacity array. + */ + define('QRCAP_WORDS', 1); + + /** + * Matrix index to get remainder from $capacity array. + */ + define('QRCAP_REMINDER', 2); + + /** + * Matrix index to get error correction level from $capacity array. + */ + define('QRCAP_EC', 3); + + // ----------------------------------------------------- + + // Structure (currently usupported) + + /** + * Number of header bits for structured mode + */ + define('STRUCTURE_HEADER_BITS', 20); + + /** + * Max number of symbols for structured mode + */ + define('MAX_STRUCTURED_SYMBOLS', 16); + + // ----------------------------------------------------- + + // Masks + + /** + * Down point base value for case 1 mask pattern (concatenation of same color in a line or a column) + */ + define('N1', 3); + + /** + * Down point base value for case 2 mask pattern (module block of same color) + */ + define('N2', 3); + + /** + * Down point base value for case 3 mask pattern (1:1:3:1:1(dark:bright:dark:bright:dark)pattern in a line or a column) + */ + define('N3', 40); + + /** + * Down point base value for case 4 mask pattern (ration of dark modules in whole) + */ + define('N4', 10); + + // ----------------------------------------------------- + + // Optimization settings + + /** + * if true, estimates best mask (spec. default, but extremally slow; set to false to significant performance boost but (propably) worst quality code + */ + define('QR_FIND_BEST_MASK', true); + + /** + * if false, checks all masks available, otherwise value tells count of masks need to be checked, mask id are got randomly + */ + define('QR_FIND_FROM_RANDOM', 2); + + /** + * when QR_FIND_BEST_MASK === false + */ + define('QR_DEFAULT_MASK', 2); + + // ----------------------------------------------------- + +} // end of definitions + +// #*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*# + +if (!class_exists('QRcode', false)) { + + // for compaibility with PHP4 + if (!function_exists('str_split')) { + /** + * Convert a string to an array (needed for PHP4 compatibility) + * @param string $string The input string. + * @param int $split_length Maximum length of the chunk. + * @return If the optional split_length parameter is specified, the returned array will be broken down into chunks with each being split_length in length, otherwise each chunk will be one character in length. FALSE is returned if split_length is less than 1. If the split_length length exceeds the length of string , the entire string is returned as the first (and only) array element. + */ + function str_split($string, $split_length=1) { + if ((strlen($string) > $split_length) OR (!$split_length)) { + do { + $c = strlen($string); + $parts[] = substr($string, 0, $split_length); + $string = substr($string, $split_length); + } while ($string !== false); + } else { + $parts = array($string); + } + return $parts; + } + } + + // ##################################################### + + /** + * Class to create QR-code arrays for TCPDF class. + * QR Code symbol is a 2D barcode that can be scanned by handy terminals such as a mobile phone with CCD. + * The capacity of QR Code is up to 7000 digits or 4000 characters, and has high robustness. + * This class supports QR Code model 2, described in JIS (Japanese Industrial Standards) X0510:2004 or ISO/IEC 18004. + * Currently the following features are not supported: ECI and FNC1 mode, Micro QR Code, QR Code model 1, Structured mode. + * + * This class is derived from "PHP QR Code encoder" by Dominik Dzienia (http://phpqrcode.sourceforge.net/) based on "libqrencode C library 3.1.1." by Kentaro Fukuchi (http://megaui.net/fukuchi/works/qrencode/index.en.html), contains Reed-Solomon code written by Phil Karn, KA9Q. QR Code is registered trademark of DENSO WAVE INCORPORATED (http://www.denso-wave.com/qrcode/index-e.html). + * Please read comments on this class source file for full copyright and license information. + * + * @name QRcode + * @package com.tecnick.tcpdf + * @abstract Class for generating QR-code array for TCPDF. + * @author Nicola Asuni + * @copyright 2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com + * @link http://www.tcpdf.org + * @license http://www.gnu.org/copyleft/lesser.html LGPL + * @version 1.0.002 + */ + class QRcode { + + /** + * @var barcode array to be returned which is readable by TCPDF + * @access protected + */ + protected $barcode_array = array(); + + /** + * @var QR code version. Size of QRcode is defined as version. Version is from 1 to 40. Version 1 is 21*21 matrix. And 4 modules increases whenever 1 version increases. So version 40 is 177*177 matrix. + * @access protected + */ + protected $version = 0; + + /** + * @var Levels of error correction. See definitions for possible values. + * @access protected + */ + protected $level = QR_ECLEVEL_L; + + /** + * @var Encoding mode + * @access protected + */ + protected $hint = QR_MODE_8B; + + /** + * @var if true the input string will be converted to uppercase + * @access protected + */ + protected $casesensitive = true; + + /** + * @var structured QR code (not supported yet) + * @access protected + */ + protected $structured = 0; + + /** + * @var mask data + * @access protected + */ + protected $data; + + // FrameFiller + + /** + * @var width + * @access protected + */ + protected $width; + + /** + * @var frame + * @access protected + */ + protected $frame; + + /** + * @var X position of bit + * @access protected + */ + protected $x; + + /** + * @var Y position of bit + * @access protected + */ + protected $y; + + /** + * @var direction + * @access protected + */ + protected $dir; + + /** + * @var single bit + * @access protected + */ + protected $bit; + + // ---- QRrawcode ---- + + /** + * @var data code + * @access protected + */ + protected $datacode = array(); + + /** + * @var error correction code + * @access protected + */ + protected $ecccode = array(); + + /** + * @var blocks + * @access protected + */ + protected $blocks; + + /** + * @var Reed-Solomon blocks + * @access protected + */ + protected $rsblocks = array(); //of RSblock + + /** + * @var counter + * @access protected + */ + protected $count; + + /** + * @var data length + * @access protected + */ + protected $dataLength; + + /** + * @var error correction length + * @access protected + */ + protected $eccLength; + + /** + * @var b1 + * @access protected + */ + protected $b1; + + // ---- QRmask ---- + + /** + * @var run length + * @access protected + */ + protected $runLength = array(); + + // ---- QRsplit ---- + + /** + * @var input data string + * @access protected + */ + protected $dataStr = ''; + + /** + * @var input items + * @access protected + */ + protected $items; + + // Reed-Solomon items + + /** + * @var Reed-Solomon items + * @access protected + */ + protected $rsitems = array(); + + /** + * @var array of frames + * @access protected + */ + protected $frames = array(); + + /** + * @var alphabet-numeric convesion table + * @access protected + */ + protected $anTable = array( + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // + 36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43, // + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1, // + -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, // + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, // + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 // + ); + + /** + * @var array Table of the capacity of symbols + * See Table 1 (pp.13) and Table 12-16 (pp.30-36), JIS X0510:2004. + * @access protected + */ + protected $capacity = array( + array( 0, 0, 0, array( 0, 0, 0, 0)), // + array( 21, 26, 0, array( 7, 10, 13, 17)), // 1 + array( 25, 44, 7, array( 10, 16, 22, 28)), // + array( 29, 70, 7, array( 15, 26, 36, 44)), // + array( 33, 100, 7, array( 20, 36, 52, 64)), // + array( 37, 134, 7, array( 26, 48, 72, 88)), // 5 + array( 41, 172, 7, array( 36, 64, 96, 112)), // + array( 45, 196, 0, array( 40, 72, 108, 130)), // + array( 49, 242, 0, array( 48, 88, 132, 156)), // + array( 53, 292, 0, array( 60, 110, 160, 192)), // + array( 57, 346, 0, array( 72, 130, 192, 224)), // 10 + array( 61, 404, 0, array( 80, 150, 224, 264)), // + array( 65, 466, 0, array( 96, 176, 260, 308)), // + array( 69, 532, 0, array( 104, 198, 288, 352)), // + array( 73, 581, 3, array( 120, 216, 320, 384)), // + array( 77, 655, 3, array( 132, 240, 360, 432)), // 15 + array( 81, 733, 3, array( 144, 280, 408, 480)), // + array( 85, 815, 3, array( 168, 308, 448, 532)), // + array( 89, 901, 3, array( 180, 338, 504, 588)), // + array( 93, 991, 3, array( 196, 364, 546, 650)), // + array( 97, 1085, 3, array( 224, 416, 600, 700)), // 20 + array(101, 1156, 4, array( 224, 442, 644, 750)), // + array(105, 1258, 4, array( 252, 476, 690, 816)), // + array(109, 1364, 4, array( 270, 504, 750, 900)), // + array(113, 1474, 4, array( 300, 560, 810, 960)), // + array(117, 1588, 4, array( 312, 588, 870, 1050)), // 25 + array(121, 1706, 4, array( 336, 644, 952, 1110)), // + array(125, 1828, 4, array( 360, 700, 1020, 1200)), // + array(129, 1921, 3, array( 390, 728, 1050, 1260)), // + array(133, 2051, 3, array( 420, 784, 1140, 1350)), // + array(137, 2185, 3, array( 450, 812, 1200, 1440)), // 30 + array(141, 2323, 3, array( 480, 868, 1290, 1530)), // + array(145, 2465, 3, array( 510, 924, 1350, 1620)), // + array(149, 2611, 3, array( 540, 980, 1440, 1710)), // + array(153, 2761, 3, array( 570, 1036, 1530, 1800)), // + array(157, 2876, 0, array( 570, 1064, 1590, 1890)), // 35 + array(161, 3034, 0, array( 600, 1120, 1680, 1980)), // + array(165, 3196, 0, array( 630, 1204, 1770, 2100)), // + array(169, 3362, 0, array( 660, 1260, 1860, 2220)), // + array(173, 3532, 0, array( 720, 1316, 1950, 2310)), // + array(177, 3706, 0, array( 750, 1372, 2040, 2430)) // 40 + ); + + /** + * @var array Length indicator + * @access protected + */ + protected $lengthTableBits = array( + array(10, 12, 14), + array( 9, 11, 13), + array( 8, 16, 16), + array( 8, 10, 12) + ); + + /** + * @var array Table of the error correction code (Reed-Solomon block) + * See Table 12-16 (pp.30-36), JIS X0510:2004. + * @access protected + */ + protected $eccTable = array( + array(array( 0, 0), array( 0, 0), array( 0, 0), array( 0, 0)), // + array(array( 1, 0), array( 1, 0), array( 1, 0), array( 1, 0)), // 1 + array(array( 1, 0), array( 1, 0), array( 1, 0), array( 1, 0)), // + array(array( 1, 0), array( 1, 0), array( 2, 0), array( 2, 0)), // + array(array( 1, 0), array( 2, 0), array( 2, 0), array( 4, 0)), // + array(array( 1, 0), array( 2, 0), array( 2, 2), array( 2, 2)), // 5 + array(array( 2, 0), array( 4, 0), array( 4, 0), array( 4, 0)), // + array(array( 2, 0), array( 4, 0), array( 2, 4), array( 4, 1)), // + array(array( 2, 0), array( 2, 2), array( 4, 2), array( 4, 2)), // + array(array( 2, 0), array( 3, 2), array( 4, 4), array( 4, 4)), // + array(array( 2, 2), array( 4, 1), array( 6, 2), array( 6, 2)), // 10 + array(array( 4, 0), array( 1, 4), array( 4, 4), array( 3, 8)), // + array(array( 2, 2), array( 6, 2), array( 4, 6), array( 7, 4)), // + array(array( 4, 0), array( 8, 1), array( 8, 4), array(12, 4)), // + array(array( 3, 1), array( 4, 5), array(11, 5), array(11, 5)), // + array(array( 5, 1), array( 5, 5), array( 5, 7), array(11, 7)), // 15 + array(array( 5, 1), array( 7, 3), array(15, 2), array( 3, 13)), // + array(array( 1, 5), array(10, 1), array( 1, 15), array( 2, 17)), // + array(array( 5, 1), array( 9, 4), array(17, 1), array( 2, 19)), // + array(array( 3, 4), array( 3, 11), array(17, 4), array( 9, 16)), // + array(array( 3, 5), array( 3, 13), array(15, 5), array(15, 10)), // 20 + array(array( 4, 4), array(17, 0), array(17, 6), array(19, 6)), // + array(array( 2, 7), array(17, 0), array( 7, 16), array(34, 0)), // + array(array( 4, 5), array( 4, 14), array(11, 14), array(16, 14)), // + array(array( 6, 4), array( 6, 14), array(11, 16), array(30, 2)), // + array(array( 8, 4), array( 8, 13), array( 7, 22), array(22, 13)), // 25 + array(array(10, 2), array(19, 4), array(28, 6), array(33, 4)), // + array(array( 8, 4), array(22, 3), array( 8, 26), array(12, 28)), // + array(array( 3, 10), array( 3, 23), array( 4, 31), array(11, 31)), // + array(array( 7, 7), array(21, 7), array( 1, 37), array(19, 26)), // + array(array( 5, 10), array(19, 10), array(15, 25), array(23, 25)), // 30 + array(array(13, 3), array( 2, 29), array(42, 1), array(23, 28)), // + array(array(17, 0), array(10, 23), array(10, 35), array(19, 35)), // + array(array(17, 1), array(14, 21), array(29, 19), array(11, 46)), // + array(array(13, 6), array(14, 23), array(44, 7), array(59, 1)), // + array(array(12, 7), array(12, 26), array(39, 14), array(22, 41)), // 35 + array(array( 6, 14), array( 6, 34), array(46, 10), array( 2, 64)), // + array(array(17, 4), array(29, 14), array(49, 10), array(24, 46)), // + array(array( 4, 18), array(13, 32), array(48, 14), array(42, 32)), // + array(array(20, 4), array(40, 7), array(43, 22), array(10, 67)), // + array(array(19, 6), array(18, 31), array(34, 34), array(20, 61)) // 40 + ); + + /** + * @var array Positions of alignment patterns. + * This array includes only the second and the third position of the alignment patterns. Rest of them can be calculated from the distance between them. + * See Table 1 in Appendix E (pp.71) of JIS X0510:2004. + * @access protected + */ + protected $alignmentPattern = array( + array( 0, 0), + array( 0, 0), array(18, 0), array(22, 0), array(26, 0), array(30, 0), // 1- 5 + array(34, 0), array(22, 38), array(24, 42), array(26, 46), array(28, 50), // 6-10 + array(30, 54), array(32, 58), array(34, 62), array(26, 46), array(26, 48), // 11-15 + array(26, 50), array(30, 54), array(30, 56), array(30, 58), array(34, 62), // 16-20 + array(28, 50), array(26, 50), array(30, 54), array(28, 54), array(32, 58), // 21-25 + array(30, 58), array(34, 62), array(26, 50), array(30, 54), array(26, 52), // 26-30 + array(30, 56), array(34, 60), array(30, 58), array(34, 62), array(30, 54), // 31-35 + array(24, 50), array(28, 54), array(32, 58), array(26, 54), array(30, 58) // 35-40 + ); + + /** + * @var array Version information pattern (BCH coded). + * See Table 1 in Appendix D (pp.68) of JIS X0510:2004. + * size: [QRSPEC_VERSION_MAX - 6] + * @access protected + */ + protected $versionPattern = array( + 0x07c94, 0x085bc, 0x09a99, 0x0a4d3, 0x0bbf6, 0x0c762, 0x0d847, 0x0e60d, // + 0x0f928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, 0x168c9, // + 0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, 0x1ed75, // + 0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, 0x26a64, // + 0x27541, 0x28c69 + ); + + /** + * @var array Format information + * @access protected + */ + protected $formatInfo = array( + array(0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976), // + array(0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0), // + array(0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed), // + array(0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b) // + ); + + + // ------------------------------------------------- + // ------------------------------------------------- + + + /** + * This is the class constructor. + * Creates a QRcode object + * @param string $code code to represent using QRcode + * @param string $eclevel error level: + * @access public + * @since 1.0.000 + */ + public function __construct($code, $eclevel = 'L') { + $barcode_array = array(); + if ((is_null($code)) OR ($code == '\0') OR ($code == '')) { + return false; + } + // set error correction level + $this->level = array_search($eclevel, array('L', 'M', 'Q', 'H')); + if ($this->level === false) { + $this->level = QR_ECLEVEL_L; + } + if (($this->hint != QR_MODE_8B) AND ($this->hint != QR_MODE_KJ)) { + return false; + } + if (($this->version < 0) OR ($this->version > QRSPEC_VERSION_MAX)) { + return false; + } + $this->items = array(); + $this->encodeString($code); + $qrTab = $this->binarize($this->data); + $size = count($qrTab); + $barcode_array['num_rows'] = $size; + $barcode_array['num_cols'] = $size; + $barcode_array['bcode'] = array(); + foreach ($qrTab as $line) { + $arrAdd = array(); + foreach (str_split($line) as $char) { + $arrAdd[] = ($char=='1')?1:0; + } + $barcode_array['bcode'][] = $arrAdd; + } + $this->barcode_array = $barcode_array; + } + + /** + * Returns a barcode array which is readable by TCPDF + * @return array barcode array readable by TCPDF; + * @access public + */ + public function getBarcodeArray() { + return $this->barcode_array; + } + + /** + * Convert the frame in binary form + * @param array $frame array to binarize + * @return array frame in binary form + */ + protected function binarize($frame) { + $len = count($frame); + // the frame is square (width = height) + foreach ($frame as &$frameLine) { + for ($i=0; $i<$len; $i++) { + $frameLine[$i] = (ord($frameLine[$i])&1)?'1':'0'; + } + } + return $frame; + } + + /** + * Encode the input string to QR code + * @param string $string input string to encode + */ + protected function encodeString($string) { + $this->dataStr = $string; + if (!$this->casesensitive) { + $this->toUpper(); + } + $ret = $this->splitString(); + if ($ret < 0) { + return NULL; + } + $this->encodeMask(-1); + } + + /** + * Encode mask + * @param int $mask masking mode + */ + protected function encodeMask($mask) { + $spec = array(0, 0, 0, 0, 0); + $this->datacode = $this->getByteStream($this->items); + if (is_null($this->datacode)) { + return NULL; + } + $spec = $this->getEccSpec($this->version, $this->level, $spec); + $this->b1 = $this->rsBlockNum1($spec); + $this->dataLength = $this->rsDataLength($spec); + $this->eccLength = $this->rsEccLength($spec); + $this->ecccode = array_fill(0, $this->eccLength, 0); + $this->blocks = $this->rsBlockNum($spec); + $ret = $this->init($spec); + if ($ret < 0) { + return NULL; + } + $this->count = 0; + $this->width = $this->getWidth($this->version); + $this->frame = $this->newFrame($this->version); + $this->x = $this->width - 1; + $this->y = $this->width - 1; + $this->dir = -1; + $this->bit = -1; + // inteleaved data and ecc codes + for ($i=0; $i < ($this->dataLength + $this->eccLength); $i++) { + $code = $this->getCode(); + $bit = 0x80; + for ($j=0; $j<8; $j++) { + $addr = $this->getNextPosition(); + $this->setFrameAt($addr, 0x02 | (($bit & $code) != 0)); + $bit = $bit >> 1; + } + } + // remainder bits + $j = $this->getRemainder($this->version); + for ($i=0; $i<$j; $i++) { + $addr = $this->getNextPosition(); + $this->setFrameAt($addr, 0x02); + } + // masking + $this->runLength = array_fill(0, QRSPEC_WIDTH_MAX + 1, 0); + if ($mask < 0) { + if (QR_FIND_BEST_MASK) { + $masked = $this->mask($this->width, $this->frame, $this->level); + } else { + $masked = $this->makeMask($this->width, $this->frame, (intval(QR_DEFAULT_MASK) % 8), $this->level); + } + } else { + $masked = $this->makeMask($this->width, $this->frame, $mask, $this->level); + } + if ($masked == NULL) { + return NULL; + } + $this->data = $masked; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // FrameFiller + + /** + * Set frame value at specified position + * @param array $at x,y position + * @param int $val value of the character to set + */ + protected function setFrameAt($at, $val) { + $this->frame[$at['y']][$at['x']] = chr($val); + } + + /** + * Get frame value at specified position + * @param array $at x,y position + * @return value at specified position + */ + protected function getFrameAt($at) { + return ord($this->frame[$at['y']][$at['x']]); + } + + /** + * Return the next frame position + * @return array of x,y coordinates + */ + protected function getNextPosition() { + do { + if ($this->bit == -1) { + $this->bit = 0; + return array('x'=>$this->x, 'y'=>$this->y); + } + $x = $this->x; + $y = $this->y; + $w = $this->width; + if ($this->bit == 0) { + $x--; + $this->bit++; + } else { + $x++; + $y += $this->dir; + $this->bit--; + } + if ($this->dir < 0) { + if ($y < 0) { + $y = 0; + $x -= 2; + $this->dir = 1; + if ($x == 6) { + $x--; + $y = 9; + } + } + } else { + if ($y == $w) { + $y = $w - 1; + $x -= 2; + $this->dir = -1; + if ($x == 6) { + $x--; + $y -= 8; + } + } + } + if (($x < 0) OR ($y < 0)) { + return NULL; + } + $this->x = $x; + $this->y = $y; + } while(ord($this->frame[$y][$x]) & 0x80); + return array('x'=>$x, 'y'=>$y); + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRrawcode + + /** + * Initialize code. + * @param array $spec array of ECC specification + * @return 0 in case of success, -1 in case of error + */ + protected function init($spec) { + $dl = $this->rsDataCodes1($spec); + $el = $this->rsEccCodes1($spec); + $rs = $this->init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); + $blockNo = 0; + $dataPos = 0; + $eccPos = 0; + $endfor = $this->rsBlockNum1($spec); + for ($i=0; $i < $endfor; ++$i) { + $ecc = array_slice($this->ecccode, $eccPos); + $this->rsblocks[$blockNo] = array(); + $this->rsblocks[$blockNo]['dataLength'] = $dl; + $this->rsblocks[$blockNo]['data'] = array_slice($this->datacode, $dataPos); + $this->rsblocks[$blockNo]['eccLength'] = $el; + $ecc = $this->encode_rs_char($rs, $this->rsblocks[$blockNo]['data'], $ecc); + $this->rsblocks[$blockNo]['ecc'] = $ecc; + $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc); + $dataPos += $dl; + $eccPos += $el; + $blockNo++; + } + if ($this->rsBlockNum2($spec) == 0) { + return 0; + } + $dl = $this->rsDataCodes2($spec); + $el = $this->rsEccCodes2($spec); + $rs = $this->init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); + if ($rs == NULL) { + return -1; + } + $endfor = $this->rsBlockNum2($spec); + for ($i=0; $i < $endfor; ++$i) { + $ecc = array_slice($this->ecccode, $eccPos); + $this->rsblocks[$blockNo] = array(); + $this->rsblocks[$blockNo]['dataLength'] = $dl; + $this->rsblocks[$blockNo]['data'] = array_slice($this->datacode, $dataPos); + $this->rsblocks[$blockNo]['eccLength'] = $el; + $ecc = $this->encode_rs_char($rs, $this->rsblocks[$blockNo]['data'], $ecc); + $this->rsblocks[$blockNo]['ecc'] = $ecc; + $this->ecccode = array_merge(array_slice($this->ecccode, 0, $eccPos), $ecc); + $dataPos += $dl; + $eccPos += $el; + $blockNo++; + } + return 0; + } + + /** + * Return Reed-Solomon block code. + * @return array rsblocks + */ + protected function getCode() { + if ($this->count < $this->dataLength) { + $row = $this->count % $this->blocks; + $col = $this->count / $this->blocks; + if ($col >= $this->rsblocks[0]['dataLength']) { + $row += $this->b1; + } + $ret = $this->rsblocks[$row]['data'][$col]; + } elseif ($this->count < $this->dataLength + $this->eccLength) { + $row = ($this->count - $this->dataLength) % $this->blocks; + $col = ($this->count - $this->dataLength) / $this->blocks; + $ret = $this->rsblocks[$row]['ecc'][$col]; + } else { + return 0; + } + $this->count++; + return $ret; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRmask + + /** + * Write Format Information on frame and returns the number of black bits + * @param int $width frame width + * @param array $frame frame + * @param array $mask masking mode + * @param int $level error correction level + * @return int blacks + */ + protected function writeFormatInformation($width, &$frame, $mask, $level) { + $blacks = 0; + $format = $this->getFormatInfo($mask, $level); + for ($i=0; $i<8; ++$i) { + if ($format & 1) { + $blacks += 2; + $v = 0x85; + } else { + $v = 0x84; + } + $frame[8][$width - 1 - $i] = chr($v); + if ($i < 6) { + $frame[$i][8] = chr($v); + } else { + $frame[$i + 1][8] = chr($v); + } + $format = $format >> 1; + } + for ($i=0; $i<7; ++$i) { + if ($format & 1) { + $blacks += 2; + $v = 0x85; + } else { + $v = 0x84; + } + $frame[$width - 7 + $i][8] = chr($v); + if ($i == 0) { + $frame[8][7] = chr($v); + } else { + $frame[8][6 - $i] = chr($v); + } + $format = $format >> 1; + } + return $blacks; + } + + /** + * mask0 + * @param int $x X position + * @param int $y Y position + * @return int mask + */ + protected function mask0($x, $y) { + return ($x + $y) & 1; + } + + /** + * mask1 + * @param int $x X position + * @param int $y Y position + * @return int mask + */ + protected function mask1($x, $y) { + return ($y & 1); + } + + /** + * mask2 + * @param int $x X position + * @param int $y Y position + * @return int mask + */ + protected function mask2($x, $y) { + return ($x % 3); + } + + /** + * mask3 + * @param int $x X position + * @param int $y Y position + * @return int mask + */ + protected function mask3($x, $y) { + return ($x + $y) % 3; + } + + /** + * mask4 + * @param int $x X position + * @param int $y Y position + * @return int mask + */ + protected function mask4($x, $y) { + return (((int)($y / 2)) + ((int)($x / 3))) & 1; + } + + /** + * mask5 + * @param int $x X position + * @param int $y Y position + * @return int mask + */ + protected function mask5($x, $y) { + return (($x * $y) & 1) + ($x * $y) % 3; + } + + /** + * mask6 + * @param int $x X position + * @param int $y Y position + * @return int mask + */ + protected function mask6($x, $y) { + return ((($x * $y) & 1) + ($x * $y) % 3) & 1; + } + + /** + * mask7 + * @param int $x X position + * @param int $y Y position + * @return int mask + */ + protected function mask7($x, $y) { + return ((($x * $y) % 3) + (($x + $y) & 1)) & 1; + } + + /** + * Return bitmask + * @param int $maskNo mask number + * @param int $width width + * @param array $frame frame + * @return array bitmask + */ + protected function generateMaskNo($maskNo, $width, $frame) { + $bitMask = array_fill(0, $width, array_fill(0, $width, 0)); + for ($y=0; $y<$width; ++$y) { + for ($x=0; $x<$width; ++$x) { + if (ord($frame[$y][$x]) & 0x80) { + $bitMask[$y][$x] = 0; + } else { + $maskFunc = call_user_func(array($this, 'mask'.$maskNo), $x, $y); + $bitMask[$y][$x] = ($maskFunc == 0)?1:0; + } + } + } + return $bitMask; + } + + /** + * makeMaskNo + * @param int $maskNo + * @param int $width + * @param int $s + * @param int $d + * @param boolean $maskGenOnly + * @return int b + */ + protected function makeMaskNo($maskNo, $width, $s, &$d, $maskGenOnly=false) { + $b = 0; + $bitMask = array(); + $bitMask = $this->generateMaskNo($maskNo, $width, $s, $d); + if ($maskGenOnly) { + return; + } + $d = $s; + for ($y=0; $y<$width; ++$y) { + for ($x=0; $x<$width; ++$x) { + if ($bitMask[$y][$x] == 1) { + $d[$y][$x] = chr(ord($s[$y][$x]) ^ (int)$bitMask[$y][$x]); + } + $b += (int)(ord($d[$y][$x]) & 1); + } + } + return $b; + } + + /** + * makeMask + * @param int $width + * @param array $frame + * @param int $maskNo + * @param int $level + * @return array mask + */ + protected function makeMask($width, $frame, $maskNo, $level) { + $masked = array_fill(0, $width, str_repeat("\0", $width)); + $this->makeMaskNo($maskNo, $width, $frame, $masked); + $this->writeFormatInformation($width, $masked, $maskNo, $level); + return $masked; + } + + /** + * calcN1N3 + * @param int $length + * @return int demerit + */ + protected function calcN1N3($length) { + $demerit = 0; + for ($i=0; $i<$length; ++$i) { + if ($this->runLength[$i] >= 5) { + $demerit += (N1 + ($this->runLength[$i] - 5)); + } + if ($i & 1) { + if (($i >= 3) AND ($i < ($length-2)) AND ($this->runLength[$i] % 3 == 0)) { + $fact = (int)($this->runLength[$i] / 3); + if (($this->runLength[$i-2] == $fact) + AND ($this->runLength[$i-1] == $fact) + AND ($this->runLength[$i+1] == $fact) + AND ($this->runLength[$i+2] == $fact)) { + if (($this->runLength[$i-3] < 0) OR ($this->runLength[$i-3] >= (4 * $fact))) { + $demerit += N3; + } elseif ((($i+3) >= $length) OR ($this->runLength[$i+3] >= (4 * $fact))) { + $demerit += N3; + } + } + } + } + } + return $demerit; + } + + /** + * evaluateSymbol + * @param int $width + * @param array $frame + * @return int demerit + */ + protected function evaluateSymbol($width, $frame) { + $head = 0; + $demerit = 0; + for ($y=0; $y<$width; ++$y) { + $head = 0; + $this->runLength[0] = 1; + $frameY = $frame[$y]; + if ($y > 0) { + $frameYM = $frame[$y-1]; + } + for ($x=0; $x<$width; ++$x) { + if (($x > 0) AND ($y > 0)) { + $b22 = ord($frameY[$x]) & ord($frameY[$x-1]) & ord($frameYM[$x]) & ord($frameYM[$x-1]); + $w22 = ord($frameY[$x]) | ord($frameY[$x-1]) | ord($frameYM[$x]) | ord($frameYM[$x-1]); + if (($b22 | ($w22 ^ 1)) & 1) { + $demerit += N2; + } + } + if (($x == 0) AND (ord($frameY[$x]) & 1)) { + $this->runLength[0] = -1; + $head = 1; + $this->runLength[$head] = 1; + } elseif ($x > 0) { + if ((ord($frameY[$x]) ^ ord($frameY[$x-1])) & 1) { + $head++; + $this->runLength[$head] = 1; + } else { + $this->runLength[$head]++; + } + } + } + $demerit += $this->calcN1N3($head+1); + } + for ($x=0; $x<$width; ++$x) { + $head = 0; + $this->runLength[0] = 1; + for ($y=0; $y<$width; ++$y) { + if (($y == 0) AND (ord($frame[$y][$x]) & 1)) { + $this->runLength[0] = -1; + $head = 1; + $this->runLength[$head] = 1; + } elseif ($y > 0) { + if ((ord($frame[$y][$x]) ^ ord($frame[$y-1][$x])) & 1) { + $head++; + $this->runLength[$head] = 1; + } else { + $this->runLength[$head]++; + } + } + } + $demerit += $this->calcN1N3($head+1); + } + return $demerit; + } + + /** + * mask + * @param int $width + * @param array $frame + * @param int $level + * @return array best mask + */ + protected function mask($width, $frame, $level) { + $minDemerit = PHP_INT_MAX; + $bestMaskNum = 0; + $bestMask = array(); + $checked_masks = array(0, 1, 2, 3, 4, 5, 6, 7); + if (QR_FIND_FROM_RANDOM !== false) { + $howManuOut = 8 - (QR_FIND_FROM_RANDOM % 9); + for ($i = 0; $i < $howManuOut; ++$i) { + $remPos = rand (0, count($checked_masks)-1); + unset($checked_masks[$remPos]); + $checked_masks = array_values($checked_masks); + } + } + $bestMask = $frame; + foreach ($checked_masks as $i) { + $mask = array_fill(0, $width, str_repeat("\0", $width)); + $demerit = 0; + $blacks = 0; + $blacks = $this->makeMaskNo($i, $width, $frame, $mask); + $blacks += $this->writeFormatInformation($width, $mask, $i, $level); + $blacks = (int)(100 * $blacks / ($width * $width)); + $demerit = (int)((int)(abs($blacks - 50) / 5) * N4); + $demerit += $this->evaluateSymbol($width, $mask); + if ($demerit < $minDemerit) { + $minDemerit = $demerit; + $bestMask = $mask; + $bestMaskNum = $i; + } + } + return $bestMask; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRsplit + + /** + * Return true if the character at specified position is a number + * @param string $str string + * @param int $pos characted position + * @return boolean true of false + */ + protected function isdigitat($str, $pos) { + if ($pos >= strlen($str)) { + return false; + } + return ((ord($str[$pos]) >= ord('0'))&&(ord($str[$pos]) <= ord('9'))); + } + + /** + * Return true if the character at specified position is an alphanumeric character + * @param string $str string + * @param int $pos characted position + * @return boolean true of false + */ + protected function isalnumat($str, $pos) { + if ($pos >= strlen($str)) { + return false; + } + return ($this->lookAnTable(ord($str[$pos])) >= 0); + } + + /** + * identifyMode + * @param int $pos + * @return int mode + */ + protected function identifyMode($pos) { + if ($pos >= strlen($this->dataStr)) { + return QR_MODE_NL; + } + $c = $this->dataStr[$pos]; + if ($this->isdigitat($this->dataStr, $pos)) { + return QR_MODE_NM; + } elseif ($this->isalnumat($this->dataStr, $pos)) { + return QR_MODE_AN; + } elseif ($this->hint == QR_MODE_KJ) { + if ($pos+1 < strlen($this->dataStr)) { + $d = $this->dataStr[$pos+1]; + $word = (ord($c) << 8) | ord($d); + if (($word >= 0x8140 && $word <= 0x9ffc) OR ($word >= 0xe040 && $word <= 0xebbf)) { + return QR_MODE_KJ; + } + } + } + return QR_MODE_8B; + } + + /** + * eatNum + * @return int run + */ + protected function eatNum() { + $ln = $this->lengthIndicator(QR_MODE_NM, $this->version); + $p = 0; + while($this->isdigitat($this->dataStr, $p)) { + $p++; + } + $run = $p; + $mode = $this->identifyMode($p); + if ($mode == QR_MODE_8B) { + $dif = $this->estimateBitsModeNum($run) + 4 + $ln + + $this->estimateBitsMode8(1) // + 4 + l8 + - $this->estimateBitsMode8($run + 1); // - 4 - l8 + if ($dif > 0) { + return $this->eat8(); + } + } + if ($mode == QR_MODE_AN) { + $dif = $this->estimateBitsModeNum($run) + 4 + $ln + + $this->estimateBitsModeAn(1) // + 4 + la + - $this->estimateBitsModeAn($run + 1);// - 4 - la + if ($dif > 0) { + return $this->eatAn(); + } + } + $this->items = $this->appendNewInputItem($this->items, QR_MODE_NM, $run, str_split($this->dataStr)); + return $run; + } + + /** + * eatAn + * @return int run + */ + protected function eatAn() { + $la = $this->lengthIndicator(QR_MODE_AN, $this->version); + $ln = $this->lengthIndicator(QR_MODE_NM, $this->version); + $p = 0; + while($this->isalnumat($this->dataStr, $p)) { + if ($this->isdigitat($this->dataStr, $p)) { + $q = $p; + while($this->isdigitat($this->dataStr, $q)) { + $q++; + } + $dif = $this->estimateBitsModeAn($p) // + 4 + la + + $this->estimateBitsModeNum($q - $p) + 4 + $ln + - $this->estimateBitsModeAn($q); // - 4 - la + if ($dif < 0) { + break; + } else { + $p = $q; + } + } else { + $p++; + } + } + $run = $p; + if (!$this->isalnumat($this->dataStr, $p)) { + $dif = $this->estimateBitsModeAn($run) + 4 + $la + + $this->estimateBitsMode8(1) // + 4 + l8 + - $this->estimateBitsMode8($run + 1); // - 4 - l8 + if ($dif > 0) { + return $this->eat8(); + } + } + $this->items = $this->appendNewInputItem($this->items, QR_MODE_AN, $run, str_split($this->dataStr)); + return $run; + } + + /** + * eatKanji + * @return int run + */ + protected function eatKanji() { + $p = 0; + while($this->identifyMode($p) == QR_MODE_KJ) { + $p += 2; + } + $this->items = $this->appendNewInputItem($this->items, QR_MODE_KJ, $p, str_split($this->dataStr)); + return $run; + } + + /** + * eat8 + * @return int run + */ + protected function eat8() { + $la = $this->lengthIndicator(QR_MODE_AN, $this->version); + $ln = $this->lengthIndicator(QR_MODE_NM, $this->version); + $p = 1; + $dataStrLen = strlen($this->dataStr); + while($p < $dataStrLen) { + $mode = $this->identifyMode($p); + if ($mode == QR_MODE_KJ) { + break; + } + if ($mode == QR_MODE_NM) { + $q = $p; + while($this->isdigitat($this->dataStr, $q)) { + $q++; + } + $dif = $this->estimateBitsMode8($p) // + 4 + l8 + + $this->estimateBitsModeNum($q - $p) + 4 + $ln + - $this->estimateBitsMode8($q); // - 4 - l8 + if ($dif < 0) { + break; + } else { + $p = $q; + } + } elseif ($mode == QR_MODE_AN) { + $q = $p; + while($this->isalnumat($this->dataStr, $q)) { + $q++; + } + $dif = $this->estimateBitsMode8($p) // + 4 + l8 + + $this->estimateBitsModeAn($q - $p) + 4 + $la + - $this->estimateBitsMode8($q); // - 4 - l8 + if ($dif < 0) { + break; + } else { + $p = $q; + } + } else { + $p++; + } + } + $run = $p; + $this->items = $this->appendNewInputItem($this->items, QR_MODE_8B, $run, str_split($this->dataStr)); + return $run; + } + + /** + * splitString + */ + protected function splitString() { + while (strlen($this->dataStr) > 0) { + if ($this->dataStr == '') { + return 0; + } + $mode = $this->identifyMode(0); + switch ($mode) { + case QR_MODE_NM: { + $length = $this->eatNum(); + break; + } + case QR_MODE_AN: { + $length = $this->eatAn(); + break; + } + case QR_MODE_KJ: { + if ($hint == QR_MODE_KJ) { + $length = $this->eatKanji(); + } else { + $length = $this->eat8(); + } + break; + } + default: { + $length = $this->eat8(); + break; + } + } + if ($length == 0) { + return 0; + } + if ($length < 0) { + return -1; + } + $this->dataStr = substr($this->dataStr, $length); + } + } + + /** + * toUpper + */ + protected function toUpper() { + $stringLen = strlen($this->dataStr); + $p = 0; + while ($p < $stringLen) { + $mode = $this->identifyMode(substr($this->dataStr, $p), $this->hint); + if ($mode == QR_MODE_KJ) { + $p += 2; + } else { + if ((ord($this->dataStr[$p]) >= ord('a')) AND (ord($this->dataStr[$p]) <= ord('z'))) { + $this->dataStr[$p] = chr(ord($this->dataStr[$p]) - 32); + } + $p++; + } + } + return $this->dataStr; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRinputItem + + /** + * newInputItem + * @param int $mode + * @param int $size + * @param array $data + * @param array $bstream + * @return array input item + */ + protected function newInputItem($mode, $size, $data, $bstream=null) { + $setData = array_slice($data, 0, $size); + if (count($setData) < $size) { + $setData = array_merge($setData, array_fill(0, ($size - count($setData)), 0)); + } + if (!$this->check($mode, $size, $setData)) { + return NULL; + } + $inputitem = array(); + $inputitem['mode'] = $mode; + $inputitem['size'] = $size; + $inputitem['data'] = $setData; + $inputitem['bstream'] = $bstream; + return $inputitem; + } + + /** + * encodeModeNum + * @param array $inputitem + * @param int $version + * @return array input item + */ + protected function encodeModeNum($inputitem, $version) { + $words = (int)($inputitem['size'] / 3); + $inputitem['bstream'] = array(); + $val = 0x1; + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, $val); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_NM, $version), $inputitem['size']); + for ($i=0; $i < $words; ++$i) { + $val = (ord($inputitem['data'][$i*3 ]) - ord('0')) * 100; + $val += (ord($inputitem['data'][$i*3+1]) - ord('0')) * 10; + $val += (ord($inputitem['data'][$i*3+2]) - ord('0')); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 10, $val); + } + if ($inputitem['size'] - $words * 3 == 1) { + $val = ord($inputitem['data'][$words*3]) - ord('0'); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, $val); + } elseif (($inputitem['size'] - ($words * 3)) == 2) { + $val = (ord($inputitem['data'][$words*3 ]) - ord('0')) * 10; + $val += (ord($inputitem['data'][$words*3+1]) - ord('0')); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 7, $val); + } + return $inputitem; + } + + /** + * encodeModeAn + * @param array $inputitem + * @param int $version + * @return array input item + */ + protected function encodeModeAn($inputitem, $version) { + $words = (int)($inputitem['size'] / 2); + $inputitem['bstream'] = array(); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x02); + $inputitem['bstream'] = $this->appendNum(v, $this->lengthIndicator(QR_MODE_AN, $version), $inputitem['size']); + for ($i=0; $i < $words; ++$i) { + $val = (int)$this->lookAnTable(ord($inputitem['data'][$i*2 ])) * 45; + $val += (int)$this->lookAnTable(ord($inputitem['data'][$i*2+1])); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 11, $val); + } + if ($inputitem['size'] & 1) { + $val = $this->lookAnTable(ord($inputitem['data'][($words * 2)])); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 6, $val); + } + return $inputitem; + } + + /** + * encodeMode8 + * @param array $inputitem + * @param int $version + * @return array input item + */ + protected function encodeMode8($inputitem, $version) { + $inputitem['bstream'] = array(); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x4); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_8B, $version), $inputitem['size']); + for ($i=0; $i < $inputitem['size']; ++$i) { + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 8, ord($inputitem['data'][$i])); + } + return $inputitem; + } + + /** + * encodeModeKanji + * @param array $inputitem + * @param int $version + * @return array input item + */ + protected function encodeModeKanji($inputitem, $version) { + $inputitem['bstream'] = array(); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x8); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_KJ, $version), (int)($inputitem['size'] / 2)); + for ($i=0; $i<$inputitem['size']; $i+=2) { + $val = (ord($inputitem['data'][$i]) << 8) | ord($inputitem['data'][$i+1]); + if ($val <= 0x9ffc) { + $val -= 0x8140; + } else { + $val -= 0xc140; + } + $h = ($val >> 8) * 0xc0; + $val = ($val & 0xff) + $h; + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 13, $val); + } + return $inputitem; + } + + /** + * encodeModeStructure + * @param array $inputitem + * @return array input item + */ + protected function encodeModeStructure($inputitem) { + $inputitem['bstream'] = array(); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x03); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, ord($inputitem['data'][1]) - 1); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, ord($inputitem['data'][0]) - 1); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 8, ord($inputitem['data'][2])); + return $inputitem; + } + + /** + * encodeBitStream + * @param array $inputitem + * @param int $version + * @return array input item + */ + protected function encodeBitStream($inputitem, $version) { + $inputitem['bstream'] = array(); + $words = $this->maximumWords($inputitem['mode'], $version); + if ($inputitem['size'] > $words) { + $st1 = $this->newInputItem($inputitem['mode'], $words, $inputitem['data']); + $st2 = $this->newInputItem($inputitem['mode'], $inputitem['size'] - $words, array_slice($inputitem['data'], $words)); + $st1 = $this->encodeBitStream($st1, $version); + $st2 = $this->encodeBitStream($st2, $version); + $inputitem['bstream'] = array(); + $inputitem['bstream'] = $this->appendBitstream($inputitem['bstream'], $st1['bstream']); + $inputitem['bstream'] = $this->appendBitstream($inputitem['bstream'], $st2['bstream']); + } else { + switch($inputitem['mode']) { + case QR_MODE_NM: { + $inputitem = $this->encodeModeNum($inputitem, $version); + break; + } + case QR_MODE_AN: { + $inputitem = $this->encodeModeAn($inputitem, $version); + break; + } + case QR_MODE_8B: { + $inputitem = $this->encodeMode8($inputitem, $version); + break; + } + case QR_MODE_KJ: { + $inputitem = $this->encodeModeKanji($inputitem, $version); + break; + } + case QR_MODE_ST: { + $inputitem = $this->encodeModeStructure($inputitem); + break; + } + default: { + break; + } + } + } + return $inputitem; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRinput + + /** + * Append data to an input object. + * The data is copied and appended to the input object. + * @param array items input items + * @param int $mode encoding mode. + * @param int $size size of data (byte). + * @param array $data array of input data. + * @return items + * + */ + protected function appendNewInputItem($items, $mode, $size, $data) { + $items[] = $this->newInputItem($mode, $size, $data); + return $items; + } + + /** + * insertStructuredAppendHeader + * @param array $items + * @param int $size + * @param int $index + * @param int $parity + * @return array items + */ + protected function insertStructuredAppendHeader($items, $size, $index, $parity) { + if ($size > MAX_STRUCTURED_SYMBOLS) { + return -1; + } + if (($index <= 0) OR ($index > MAX_STRUCTURED_SYMBOLS)) { + return -1; + } + $buf = array($size, $index, $parity); + $entry = $this->newInputItem(QR_MODE_ST, 3, buf); + array_unshift($items, $entry); + return $items; + } + + /** + * calcParity + * @param array $items + * @return int parity + */ + protected function calcParity($items) { + $parity = 0; + foreach ($items as $item) { + if ($item['mode'] != QR_MODE_ST) { + for ($i=$item['size']-1; $i>=0; --$i) { + $parity ^= $item['data'][$i]; + } + } + } + return $parity; + } + + /** + * checkModeNum + * @param int $size + * @param array $data + * @return boolean true or false + */ + protected function checkModeNum($size, $data) { + for ($i=0; $i<$size; ++$i) { + if ((ord($data[$i]) < ord('0')) OR (ord($data[$i]) > ord('9'))){ + return false; + } + } + return true; + } + + /** + * estimateBitsModeNum + * @param int $size + * @return int number of bits + */ + protected function estimateBitsModeNum($size) { + $w = (int)$size / 3; + $bits = $w * 10; + switch($size - $w * 3) { + case 1: { + $bits += 4; + break; + } + case 2: { + $bits += 7; + break; + } + default: { + break; + } + } + return $bits; + } + + /** + * Look up the alphabet-numeric convesion table (see JIS X0510:2004, pp.19). + * @param int $c character value + * @return value + */ + protected function lookAnTable($c) { + return (($c > 127)?-1:$this->anTable[$c]); + } + + /** + * checkModeAn + * @param int $size + * @param array $data + * @return boolean true or false + */ + protected function checkModeAn($size, $data) { + for ($i=0; $i<$size; ++$i) { + if ($this->lookAnTable(ord($data[$i])) == -1) { + return false; + } + } + return true; + } + + /** + * estimateBitsModeAn + * @param int $size + * @return int number of bits + */ + protected function estimateBitsModeAn($size) { + $w = (int)($size / 2); + $bits = $w * 11; + if ($size & 1) { + $bits += 6; + } + return $bits; + } + + /** + * estimateBitsMode8 + * @param int $size + * @return int number of bits + */ + protected function estimateBitsMode8($size) { + return $size * 8; + } + + /** + * estimateBitsModeKanji + * @param int $size + * @return int number of bits + */ + protected function estimateBitsModeKanji($size) { + return (int)(($size / 2) * 13); + } + + /** + * checkModeKanji + * @param int $size + * @param array $data + * @return boolean true or false + */ + protected function checkModeKanji($size, $data) { + if ($size & 1) { + return false; + } + for ($i=0; $i<$size; $i+=2) { + $val = (ord($data[$i]) << 8) | ord($data[$i+1]); + if (($val < 0x8140) OR (($val > 0x9ffc) AND ($val < 0xe040)) OR ($val > 0xebbf)) { + return false; + } + } + return true; + } + + /** + * Validate the input data. + * @param int $mode encoding mode. + * @param int $size size of data (byte). + * @param array data data to validate + * @return boolean true in case of valid data, false otherwise + */ + protected function check($mode, $size, $data) { + if ($size <= 0) { + return false; + } + switch($mode) { + case QR_MODE_NM: { + return $this->checkModeNum($size, $data); + } + case QR_MODE_AN: { + return $this->checkModeAn($size, $data); + } + case QR_MODE_KJ: { + return $this->checkModeKanji($size, $data); + } + case QR_MODE_8B: { + return true; + } + case QR_MODE_ST: { + return true; + } + default: { + break; + } + } + return false; + } + + /** + * estimateBitStreamSize + * @param array $items + * @param int $version + * @return int bits + */ + protected function estimateBitStreamSize($items, $version) { + $bits = 0; + if ($version == 0) { + $version = 1; + } + foreach ($items as $item) { + switch($item['mode']) { + case QR_MODE_NM: { + $bits = $this->estimateBitsModeNum($item['size']); + break; + } + case QR_MODE_AN: { + $bits = $this->estimateBitsModeAn($item['size']); + break; + } + case QR_MODE_8B: { + $bits = $this->estimateBitsMode8($item['size']); + break; + } + case QR_MODE_KJ: { + $bits = $this->estimateBitsModeKanji($item['size']); + break; + } + case QR_MODE_ST: { + return STRUCTURE_HEADER_BITS; + } + default: { + return 0; + } + } + $l = $this->lengthIndicator($item['mode'], $version); + $m = 1 << $l; + $num = (int)(($item['size'] + $m - 1) / $m); + $bits += $num * (4 + $l); + } + return $bits; + } + + /** + * estimateVersion + * @param array $items + * @return int version + */ + protected function estimateVersion($items) { + $version = 0; + $prev = 0; + do { + $prev = $version; + $bits = $this->estimateBitStreamSize($items, $prev); + $version = $this->getMinimumVersion((int)(($bits + 7) / 8), $this->level); + if ($version < 0) { + return -1; + } + } while ($version > $prev); + return $version; + } + + /** + * lengthOfCode + * @param int $mode + * @param int $version + * @param int $bits + * @return int size + */ + protected function lengthOfCode($mode, $version, $bits) { + $payload = $bits - 4 - $this->lengthIndicator($mode, $version); + switch($mode) { + case QR_MODE_NM: { + $chunks = (int)($payload / 10); + $remain = $payload - $chunks * 10; + $size = $chunks * 3; + if ($remain >= 7) { + $size += 2; + } elseif ($remain >= 4) { + $size += 1; + } + break; + } + case QR_MODE_AN: { + $chunks = (int)($payload / 11); + $remain = $payload - $chunks * 11; + $size = $chunks * 2; + if ($remain >= 6) { + ++$size; + } + break; + } + case QR_MODE_8B: { + $size = (int)($payload / 8); + break; + } + case QR_MODE_KJ: { + $size = (int)(($payload / 13) * 2); + break; + } + case QR_MODE_ST: { + $size = (int)($payload / 8); + break; + } + default: { + $size = 0; + break; + } + } + $maxsize = $this->maximumWords($mode, $version); + if ($size < 0) { + $size = 0; + } + if ($size > $maxsize) { + $size = $maxsize; + } + return $size; + } + + /** + * createBitStream + * @param array $items + * @return array of items and total bits + */ + protected function createBitStream($items) { + $total = 0; + foreach ($items as $key => $item) { + $items[$key] = $this->encodeBitStream($item, $this->version); + $bits = count($items[$key]['bstream']); + $total += $bits; + } + return array($items, $total); + } + + /** + * convertData + * @param array $items + * @return array items + */ + protected function convertData($items) { + $ver = $this->estimateVersion($items); + if ($ver > $this->version) { + $this->version = $ver; + } + for (;;) { + $cbs = $this->createBitStream($items); + $items = $cbs[0]; + $bits = $cbs[1]; + if ($bits < 0) { + return -1; + } + $ver = $this->getMinimumVersion((int)(($bits + 7) / 8), $this->level); + if ($ver < 0) { + return -1; + } elseif ($ver > $this->version) { + $this->version = $ver; + } else { + break; + } + } + return $items; + } + + /** + * Append Padding Bit to bitstream + * @param array $bstream + * @return array bitstream + */ + protected function appendPaddingBit($bstream) { + $bits = count($bstream); + $maxwords = $this->getDataLength($this->version, $this->level); + $maxbits = $maxwords * 8; + if ($maxbits == $bits) { + return 0; + } + if ($maxbits - $bits < 5) { + return $this->appendNum($bstream, $maxbits - $bits, 0); + } + $bits += 4; + $words = (int)(($bits + 7) / 8); + $padding = array(); + $padding = $this->appendNum($padding, $words * 8 - $bits + 4, 0); + $padlen = $maxwords - $words; + if ($padlen > 0) { + $padbuf = array(); + for ($i=0; $i<$padlen; ++$i) { + $padbuf[$i] = ($i&1)?0x11:0xec; + } + $padding = $this->appendBytes($padding, $padlen, $padbuf); + } + return $this->appendBitstream($bstream, $padding); + } + + /** + * mergeBitStream + * @param array $bstream + * @return array bitstream + */ + protected function mergeBitStream($items) { + $items = $this->convertData($items); + $bstream = array(); + foreach ($items as $item) { + $bstream = $this->appendBitstream($bstream, $item['bstream']); + } + return $bstream; + } + + /** + * Returns a stream of bits. + * @param int $items + * @return array padded merged byte stream + */ + protected function getBitStream($items) { + $bstream = $this->mergeBitStream($items); + return $this->appendPaddingBit($bstream); + } + + /** + * Pack all bit streams padding bits into a byte array. + * @param int $items + * @return array padded merged byte stream + */ + protected function getByteStream($items) { + $bstream = $this->getBitStream($items); + return $this->bitstreamToByte($bstream); + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRbitstream + + /** + * Return an array with zeros + * @param int $setLength array size + * @return array + */ + protected function allocate($setLength) { + return array_fill(0, $setLength, 0); + } + + /** + * Return new bitstream from number + * @param int $bits number of bits + * @param int $num number + * @return array bitstream + */ + protected function newFromNum($bits, $num) { + $bstream = $this->allocate($bits); + $mask = 1 << ($bits - 1); + for ($i=0; $i<$bits; ++$i) { + if ($num & $mask) { + $bstream[$i] = 1; + } else { + $bstream[$i] = 0; + } + $mask = $mask >> 1; + } + return $bstream; + } + + /** + * Return new bitstream from bytes + * @param int $size size + * @param array $data bytes + * @return array bitstream + */ + protected function newFromBytes($size, $data) { + $bstream = $this->allocate($size * 8); + $p=0; + for ($i=0; $i<$size; ++$i) { + $mask = 0x80; + for ($j=0; $j<8; ++$j) { + if ($data[$i] & $mask) { + $bstream[$p] = 1; + } else { + $bstream[$p] = 0; + } + $p++; + $mask = $mask >> 1; + } + } + return $bstream; + } + + /** + * Append one bitstream to another + * @param array $bitstream original bitstream + * @param array $append bitstream to append + * @return array bitstream + */ + protected function appendBitstream($bitstream, $append) { + if ((!is_array($append)) OR (count($append) == 0)) { + return $bitstream; + } + if (count($bitstream) == 0) { + return $append; + } + return array_values(array_merge($bitstream, $append)); + } + + /** + * Append one bitstream created from number to another + * @param array $bitstream original bitstream + * @param int $bits number of bits + * @param int $num number + * @return array bitstream + */ + protected function appendNum($bitstream, $bits, $num) { + if ($bits == 0) { + return 0; + } + $b = $this->newFromNum($bits, $num); + return $this->appendBitstream($bitstream, $b); + } + + /** + * Append one bitstream created from bytes to another + * @param array $bitstream original bitstream + * @param int $size size + * @param array $data bytes + * @return array bitstream + */ + protected function appendBytes($bitstream, $size, $data) { + if ($size == 0) { + return 0; + } + $b = $this->newFromBytes($size, $data); + return $this->appendBitstream($bitstream, $b); + } + + /** + * Convert bitstream to bytes + * @param array $bitstream original bitstream + * @return array of bytes + */ + protected function bitstreamToByte($bstream) { + $size = count($bstream); + if ($size == 0) { + return array(); + } + $data = array_fill(0, (int)(($size + 7) / 8), 0); + $bytes = (int)($size / 8); + $p = 0; + for ($i=0; $i<$bytes; $i++) { + $v = 0; + for ($j=0; $j<8; $j++) { + $v = $v << 1; + $v |= $bstream[$p]; + $p++; + } + $data[$i] = $v; + } + if ($size & 7) { + $v = 0; + for ($j=0; $j<($size & 7); $j++) { + $v = $v << 1; + $v |= $bstream[$p]; + $p++; + } + $data[$bytes] = $v; + } + return $data; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRspec + + /** + * Replace a value on the array at the specified position + * @param array $srctab + * @param int $x X position + * @param int $y Y position + * @param string $repl value to replace + * @param int $replLen length of the repl string + * @return array srctab + */ + protected function qrstrset($srctab, $x, $y, $repl, $replLen=false) { + $srctab[$y] = substr_replace($srctab[$y], ($replLen !== false)?substr($repl,0,$replLen):$repl, $x, ($replLen !== false)?$replLen:strlen($repl)); + return $srctab; + } + + /** + * Return maximum data code length (bytes) for the version. + * @param int $version version + * @param int $level error correction level + * @return int maximum size (bytes) + */ + protected function getDataLength($version, $level) { + return $this->capacity[$version][QRCAP_WORDS] - $this->capacity[$version][QRCAP_EC][$level]; + } + + /** + * Return maximum error correction code length (bytes) for the version. + * @param int $version version + * @param int $level error correction level + * @return int ECC size (bytes) + */ + protected function getECCLength($version, $level){ + return $this->capacity[$version][QRCAP_EC][$level]; + } + + /** + * Return the width of the symbol for the version. + * @param int $version version + * @return int width + */ + protected function getWidth($version) { + return $this->capacity[$version][QRCAP_WIDTH]; + } + + /** + * Return the numer of remainder bits. + * @param int $version version + * @return int number of remainder bits + */ + protected function getRemainder($version) { + return $this->capacity[$version][QRCAP_REMINDER]; + } + + /** + * Return a version number that satisfies the input code length. + * @param int $size input code length (byte) + * @param int $level error correction level + * @return int version number + */ + protected function getMinimumVersion($size, $level) { + for ($i=1; $i <= QRSPEC_VERSION_MAX; ++$i) { + $words = $this->capacity[$i][QRCAP_WORDS] - $this->capacity[$i][QRCAP_EC][$level]; + if ($words >= $size) { + return $i; + } + } + return -1; + } + + /** + * Return the size of length indicator for the mode and version. + * @param int $mode encoding mode + * @param int $version version + * @return int the size of the appropriate length indicator (bits). + */ + protected function lengthIndicator($mode, $version) { + if ($mode == QR_MODE_ST) { + return 0; + } + if ($version <= 9) { + $l = 0; + } elseif ($version <= 26) { + $l = 1; + } else { + $l = 2; + } + return $this->lengthTableBits[$mode][$l]; + } + + /** + * Return the maximum length for the mode and version. + * @param int $mode encoding mode + * @param int $version version + * @return int the maximum length (bytes) + */ + protected function maximumWords($mode, $version) { + if ($mode == QR_MODE_ST) { + return 3; + } + if ($version <= 9) { + $l = 0; + } else if ($version <= 26) { + $l = 1; + } else { + $l = 2; + } + $bits = $this->lengthTableBits[$mode][$l]; + $words = (1 << $bits) - 1; + if ($mode == QR_MODE_KJ) { + $words *= 2; // the number of bytes is required + } + return $words; + } + + /** + * Return an array of ECC specification. + * @param int $version version + * @param int $level error correction level + * @param array $spec an array of ECC specification contains as following: {# of type1 blocks, # of data code, # of ecc code, # of type2 blocks, # of data code} + * @return array spec + */ + protected function getEccSpec($version, $level, $spec) { + if (count($spec) < 5) { + $spec = array(0, 0, 0, 0, 0); + } + $b1 = $this->eccTable[$version][$level][0]; + $b2 = $this->eccTable[$version][$level][1]; + $data = $this->getDataLength($version, $level); + $ecc = $this->getECCLength($version, $level); + if ($b2 == 0) { + $spec[0] = $b1; + $spec[1] = (int)($data / $b1); + $spec[2] = (int)($ecc / $b1); + $spec[3] = 0; + $spec[4] = 0; + } else { + $spec[0] = $b1; + $spec[1] = (int)($data / ($b1 + $b2)); + $spec[2] = (int)($ecc / ($b1 + $b2)); + $spec[3] = $b2; + $spec[4] = $spec[1] + 1; + } + return $spec; + } + + /** + * Put an alignment marker. + * @param array $frame frame + * @param int $width width + * @param int $ox X center coordinate of the pattern + * @param int $oy Y center coordinate of the pattern + * @return array frame + */ + protected function putAlignmentMarker($frame, $ox, $oy) { + $finder = array( + "\xa1\xa1\xa1\xa1\xa1", + "\xa1\xa0\xa0\xa0\xa1", + "\xa1\xa0\xa1\xa0\xa1", + "\xa1\xa0\xa0\xa0\xa1", + "\xa1\xa1\xa1\xa1\xa1" + ); + $yStart = $oy - 2; + $xStart = $ox - 2; + for ($y=0; $y < 5; $y++) { + $frame = $this->qrstrset($frame, $xStart, $yStart+$y, $finder[$y]); + } + return $frame; + } + + /** + * Put an alignment pattern. + * @param int $version version + * @param array $fram frame + * @param int $width width + * @return array frame + */ + protected function putAlignmentPattern($version, $frame, $width) { + if ($version < 2) { + return $frame; + } + $d = $this->alignmentPattern[$version][1] - $this->alignmentPattern[$version][0]; + if ($d < 0) { + $w = 2; + } else { + $w = (int)(($width - $this->alignmentPattern[$version][0]) / $d + 2); + } + if ($w * $w - 3 == 1) { + $x = $this->alignmentPattern[$version][0]; + $y = $this->alignmentPattern[$version][0]; + $frame = $this->putAlignmentMarker($frame, $x, $y); + return $frame; + } + $cx = $this->alignmentPattern[$version][0]; + $wo = $w - 1; + for ($x=1; $x < $wo; ++$x) { + $frame = $this->putAlignmentMarker($frame, 6, $cx); + $frame = $this->putAlignmentMarker($frame, $cx, 6); + $cx += $d; + } + $cy = $this->alignmentPattern[$version][0]; + for ($y=0; $y < $wo; ++$y) { + $cx = $this->alignmentPattern[$version][0]; + for ($x=0; $x < $wo; ++$x) { + $frame = $this->putAlignmentMarker($frame, $cx, $cy); + $cx += $d; + } + $cy += $d; + } + return $frame; + } + + /** + * Return BCH encoded version information pattern that is used for the symbol of version 7 or greater. Use lower 18 bits. + * @param int $version version + * @return BCH encoded version information pattern + */ + protected function getVersionPattern($version) { + if (($version < 7) OR ($version > QRSPEC_VERSION_MAX)) { + return 0; + } + return $this->versionPattern[($version - 7)]; + } + + /** + * Return BCH encoded format information pattern. + * @param array $mask + * @param int $level error correction level + * @return BCH encoded format information pattern + */ + protected function getFormatInfo($mask, $level) { + if (($mask < 0) OR ($mask > 7)) { + return 0; + } + if (($level < 0) OR ($level > 3)) { + return 0; + } + return $this->formatInfo[$level][$mask]; + } + + /** + * Put a finder pattern. + * @param array $frame frame + * @param int $width width + * @param int $ox X center coordinate of the pattern + * @param int $oy Y center coordinate of the pattern + * @return array frame + */ + protected function putFinderPattern($frame, $ox, $oy) { + $finder = array( + "\xc1\xc1\xc1\xc1\xc1\xc1\xc1", + "\xc1\xc0\xc0\xc0\xc0\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc0\xc0\xc0\xc0\xc1", + "\xc1\xc1\xc1\xc1\xc1\xc1\xc1" + ); + for ($y=0; $y < 7; $y++) { + $frame = $this->qrstrset($frame, $ox, ($oy + $y), $finder[$y]); + } + return $frame; + } + + /** + * Return a copy of initialized frame. + * @param int $version version + * @return Array of unsigned char. + */ + protected function createFrame($version) { + $width = $this->capacity[$version][QRCAP_WIDTH]; + $frameLine = str_repeat ("\0", $width); + $frame = array_fill(0, $width, $frameLine); + // Finder pattern + $frame = $this->putFinderPattern($frame, 0, 0); + $frame = $this->putFinderPattern($frame, $width - 7, 0); + $frame = $this->putFinderPattern($frame, 0, $width - 7); + // Separator + $yOffset = $width - 7; + for ($y=0; $y < 7; ++$y) { + $frame[$y][7] = "\xc0"; + $frame[$y][$width - 8] = "\xc0"; + $frame[$yOffset][7] = "\xc0"; + ++$yOffset; + } + $setPattern = str_repeat("\xc0", 8); + $frame = $this->qrstrset($frame, 0, 7, $setPattern); + $frame = $this->qrstrset($frame, $width-8, 7, $setPattern); + $frame = $this->qrstrset($frame, 0, $width - 8, $setPattern); + // Format info + $setPattern = str_repeat("\x84", 9); + $frame = $this->qrstrset($frame, 0, 8, $setPattern); + $frame = $this->qrstrset($frame, $width - 8, 8, $setPattern, 8); + $yOffset = $width - 8; + for ($y=0; $y < 8; ++$y,++$yOffset) { + $frame[$y][8] = "\x84"; + $frame[$yOffset][8] = "\x84"; + } + // Timing pattern + $wo = $width - 15; + for ($i=1; $i < $wo; ++$i) { + $frame[6][7+$i] = chr(0x90 | ($i & 1)); + $frame[7+$i][6] = chr(0x90 | ($i & 1)); + } + // Alignment pattern + $frame = $this->putAlignmentPattern($version, $frame, $width); + // Version information + if ($version >= 7) { + $vinf = $this->getVersionPattern($version); + $v = $vinf; + for ($x=0; $x<6; ++$x) { + for ($y=0; $y<3; ++$y) { + $frame[($width - 11)+$y][$x] = chr(0x88 | ($v & 1)); + $v = $v >> 1; + } + } + $v = $vinf; + for ($y=0; $y<6; ++$y) { + for ($x=0; $x<3; ++$x) { + $frame[$y][$x+($width - 11)] = chr(0x88 | ($v & 1)); + $v = $v >> 1; + } + } + } + // and a little bit... + $frame[$width - 8][8] = "\x81"; + return $frame; + } + + /** + * Set new frame for the specified version. + * @param int $version version + * @return Array of unsigned char. + */ + protected function newFrame($version) { + if (($version < 1) OR ($version > QRSPEC_VERSION_MAX)) { + return NULL; + } + if (!isset($this->frames[$version])) { + $this->frames[$version] = $this->createFrame($version); + } + if (is_null($this->frames[$version])) { + return NULL; + } + return $this->frames[$version]; + } + + /** + * Return block number 0 + * @param array $spec + * @return int value + */ + protected function rsBlockNum($spec) { + return ($spec[0] + $spec[3]); + } + + /** + * Return block number 1 + * @param array $spec + * @return int value + */ + protected function rsBlockNum1($spec) { + return $spec[0]; + } + + /** + * Return data codes 1 + * @param array $spec + * @return int value + */ + protected function rsDataCodes1($spec) { + return $spec[1]; + } + + /** + * Return ecc codes 1 + * @param array $spec + * @return int value + */ + protected function rsEccCodes1($spec) { + return $spec[2]; + } + + /** + * Return block number 2 + * @param array $spec + * @return int value + */ + protected function rsBlockNum2($spec) { + return $spec[3]; + } + + /** + * Return data codes 2 + * @param array $spec + * @return int value + */ + protected function rsDataCodes2($spec) { + return $spec[4]; + } + + /** + * Return ecc codes 2 + * @param array $spec + * @return int value + */ + protected function rsEccCodes2($spec) { + return $spec[2]; + } + + /** + * Return data length + * @param array $spec + * @return int value + */ + protected function rsDataLength($spec) { + return ($spec[0] * $spec[1]) + ($spec[3] * $spec[4]); + } + + /** + * Return ecc length + * @param array $spec + * @return int value + */ + protected function rsEccLength($spec) { + return ($spec[0] + $spec[3]) * $spec[2]; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRrs + + /** + * Initialize a Reed-Solomon codec and add it to existing rsitems + * @param int $symsize symbol size, bits + * @param int $gfpoly Field generator polynomial coefficients + * @param int $fcr first root of RS code generator polynomial, index form + * @param int $prim primitive element to generate polynomial roots + * @param int $nroots RS code generator polynomial degree (number of roots) + * @param int $pad padding bytes at front of shortened block + * @return array Array of RS values:. + */ + protected function init_rs($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) { + foreach ($this->rsitems as $rs) { + if (($rs['pad'] != $pad) OR ($rs['nroots'] != $nroots) OR ($rs['mm'] != $symsize) + OR ($rs['gfpoly'] != $gfpoly) OR ($rs['fcr'] != $fcr) OR ($rs['prim'] != $prim)) { + continue; + } + return $rs; + } + $rs = $this->init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad); + array_unshift($this->rsitems, $rs); + return $rs; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRrsItem + + /** + * modnn + * @param array RS values + * @param int $x X position + * @return int X osition + */ + protected function modnn($rs, $x) { + while ($x >= $rs['nn']) { + $x -= $rs['nn']; + $x = ($x >> $rs['mm']) + ($x & $rs['nn']); + } + return $x; + } + + /** + * Initialize a Reed-Solomon codec and returns an array of values. + * @param int $symsize symbol size, bits + * @param int $gfpoly Field generator polynomial coefficients + * @param int $fcr first root of RS code generator polynomial, index form + * @param int $prim primitive element to generate polynomial roots + * @param int $nroots RS code generator polynomial degree (number of roots) + * @param int $pad padding bytes at front of shortened block + * @return array Array of RS values:. + */ + protected function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) { + // Based on Reed solomon encoder by Phil Karn, KA9Q (GNU-LGPLv2) + $rs = null; + // Check parameter ranges + if (($symsize < 0) OR ($symsize > 8)) { + return $rs; + } + if (($fcr < 0) OR ($fcr >= (1<<$symsize))) { + return $rs; + } + if (($prim <= 0) OR ($prim >= (1<<$symsize))) { + return $rs; + } + if (($nroots < 0) OR ($nroots >= (1<<$symsize))) { + return $rs; + } + if (($pad < 0) OR ($pad >= ((1<<$symsize) -1 - $nroots))) { + return $rs; + } + $rs = array(); + $rs['mm'] = $symsize; + $rs['nn'] = (1 << $symsize) - 1; + $rs['pad'] = $pad; + $rs['alpha_to'] = array_fill(0, ($rs['nn'] + 1), 0); + $rs['index_of'] = array_fill(0, ($rs['nn'] + 1), 0); + // PHP style macro replacement ;) + $NN =& $rs['nn']; + $A0 =& $NN; + // Generate Galois field lookup tables + $rs['index_of'][0] = $A0; // log(zero) = -inf + $rs['alpha_to'][$A0] = 0; // alpha**-inf = 0 + $sr = 1; + for ($i=0; $i<$rs['nn']; ++$i) { + $rs['index_of'][$sr] = $i; + $rs['alpha_to'][$i] = $sr; + $sr <<= 1; + if ($sr & (1 << $symsize)) { + $sr ^= $gfpoly; + } + $sr &= $rs['nn']; + } + if ($sr != 1) { + // field generator polynomial is not primitive! + return NULL; + } + // Form RS code generator polynomial from its roots + $rs['genpoly'] = array_fill(0, ($nroots + 1), 0); + $rs['fcr'] = $fcr; + $rs['prim'] = $prim; + $rs['nroots'] = $nroots; + $rs['gfpoly'] = $gfpoly; + // Find prim-th root of 1, used in decoding + for ($iprim=1; ($iprim % $prim) != 0; $iprim += $rs['nn']) { + ; // intentional empty-body loop! + } + $rs['iprim'] = (int)($iprim / $prim); + $rs['genpoly'][0] = 1; + + + for ($i = 0,$root=$fcr*$prim; $i < $nroots; $i++, $root += $prim) { + $rs['genpoly'][$i+1] = 1; + // Multiply rs->genpoly[] by @**(root + x) + for ($j = $i; $j > 0; --$j) { + if ($rs['genpoly'][$j] != 0) { + $rs['genpoly'][$j] = $rs['genpoly'][$j-1] ^ $rs['alpha_to'][$this->modnn($rs, $rs['index_of'][$rs['genpoly'][$j]] + $root)]; + } else { + $rs['genpoly'][$j] = $rs['genpoly'][$j-1]; + } + } + // rs->genpoly[0] can never be zero + $rs['genpoly'][0] = $rs['alpha_to'][$this->modnn($rs, $rs['index_of'][$rs['genpoly'][0]] + $root)]; + } + // convert rs->genpoly[] to index form for quicker encoding + for ($i = 0; $i <= $nroots; ++$i) { + $rs['genpoly'][$i] = $rs['index_of'][$rs['genpoly'][$i]]; + } + return $rs; + } + + /** + * Encode a Reed-Solomon codec and returns the parity array + * @param array $rs RS values + * @param array $data data + * @param array $parity parity + * @return parity array + */ + protected function encode_rs_char($rs, $data, $parity) { + $MM =& $rs['mm']; // bits per symbol + $NN =& $rs['nn']; // the total number of symbols in a RS block + $ALPHA_TO =& $rs['alpha_to']; // the address of an array of NN elements to convert Galois field elements in index (log) form to polynomial form + $INDEX_OF =& $rs['index_of']; // the address of an array of NN elements to convert Galois field elements in polynomial form to index (log) form + $GENPOLY =& $rs['genpoly']; // an array of NROOTS+1 elements containing the generator polynomial in index form + $NROOTS =& $rs['nroots']; // the number of roots in the RS code generator polynomial, which is the same as the number of parity symbols in a block + $FCR =& $rs['fcr']; // first consecutive root, index form + $PRIM =& $rs['prim']; // primitive element, index form + $IPRIM =& $rs['iprim']; // prim-th root of 1, index form + $PAD =& $rs['pad']; // the number of pad symbols in a block + $A0 =& $NN; + $parity = array_fill(0, $NROOTS, 0); + for ($i=0; $i < ($NN - $NROOTS - $PAD); $i++) { + $feedback = $INDEX_OF[$data[$i] ^ $parity[0]]; + if ($feedback != $A0) { + // feedback term is non-zero + // This line is unnecessary when GENPOLY[NROOTS] is unity, as it must + // always be for the polynomials constructed by init_rs() + $feedback = $this->modnn($rs, $NN - $GENPOLY[$NROOTS] + $feedback); + for ($j=1; $j < $NROOTS; ++$j) { + $parity[$j] ^= $ALPHA_TO[$this->modnn($rs, $feedback + $GENPOLY[($NROOTS - $j)])]; + } + } + // Shift + array_shift($parity); + if ($feedback != $A0) { + array_push($parity, $ALPHA_TO[$this->modnn($rs, $feedback + $GENPOLY[0])]); + } else { + array_push($parity, 0); + } + } + return $parity; + } + + } // end QRcode class + +} // END OF "class_exists QRcode" +?> diff --git a/extend/phpqrcode/cache/frame_1.dat b/extend/phpqrcode/cache/frame_1.dat new file mode 100644 index 0000000..be28fea --- /dev/null +++ b/extend/phpqrcode/cache/frame_1.dat @@ -0,0 +1,2 @@ +xڝ E9u`"PńC牗T!0$ +EɲQmh۾9{kI" 9Ln)Ap־>^zmnŖ;mn \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_1.png b/extend/phpqrcode/cache/frame_1.png new file mode 100644 index 0000000..86ce6e9 Binary files /dev/null and b/extend/phpqrcode/cache/frame_1.png differ diff --git a/extend/phpqrcode/cache/frame_10.dat b/extend/phpqrcode/cache/frame_10.dat new file mode 100644 index 0000000..aff163f Binary files /dev/null and b/extend/phpqrcode/cache/frame_10.dat differ diff --git a/extend/phpqrcode/cache/frame_10.png b/extend/phpqrcode/cache/frame_10.png new file mode 100644 index 0000000..dbfcd70 Binary files /dev/null and b/extend/phpqrcode/cache/frame_10.png differ diff --git a/extend/phpqrcode/cache/frame_11.dat b/extend/phpqrcode/cache/frame_11.dat new file mode 100644 index 0000000..95af68a Binary files /dev/null and b/extend/phpqrcode/cache/frame_11.dat differ diff --git a/extend/phpqrcode/cache/frame_11.png b/extend/phpqrcode/cache/frame_11.png new file mode 100644 index 0000000..c07c761 Binary files /dev/null and b/extend/phpqrcode/cache/frame_11.png differ diff --git a/extend/phpqrcode/cache/frame_12.dat b/extend/phpqrcode/cache/frame_12.dat new file mode 100644 index 0000000..73228b3 Binary files /dev/null and b/extend/phpqrcode/cache/frame_12.dat differ diff --git a/extend/phpqrcode/cache/frame_12.png b/extend/phpqrcode/cache/frame_12.png new file mode 100644 index 0000000..8ba6782 Binary files /dev/null and b/extend/phpqrcode/cache/frame_12.png differ diff --git a/extend/phpqrcode/cache/frame_13.dat b/extend/phpqrcode/cache/frame_13.dat new file mode 100644 index 0000000..2256f0e Binary files /dev/null and b/extend/phpqrcode/cache/frame_13.dat differ diff --git a/extend/phpqrcode/cache/frame_13.png b/extend/phpqrcode/cache/frame_13.png new file mode 100644 index 0000000..6e49d35 Binary files /dev/null and b/extend/phpqrcode/cache/frame_13.png differ diff --git a/extend/phpqrcode/cache/frame_14.dat b/extend/phpqrcode/cache/frame_14.dat new file mode 100644 index 0000000..e9ae093 Binary files /dev/null and b/extend/phpqrcode/cache/frame_14.dat differ diff --git a/extend/phpqrcode/cache/frame_14.png b/extend/phpqrcode/cache/frame_14.png new file mode 100644 index 0000000..efc36c0 Binary files /dev/null and b/extend/phpqrcode/cache/frame_14.png differ diff --git a/extend/phpqrcode/cache/frame_15.dat b/extend/phpqrcode/cache/frame_15.dat new file mode 100644 index 0000000..1872781 Binary files /dev/null and b/extend/phpqrcode/cache/frame_15.dat differ diff --git a/extend/phpqrcode/cache/frame_15.png b/extend/phpqrcode/cache/frame_15.png new file mode 100644 index 0000000..a9f416c Binary files /dev/null and b/extend/phpqrcode/cache/frame_15.png differ diff --git a/extend/phpqrcode/cache/frame_16.dat b/extend/phpqrcode/cache/frame_16.dat new file mode 100644 index 0000000..60af678 --- /dev/null +++ b/extend/phpqrcode/cache/frame_16.dat @@ -0,0 +1 @@ +xA E]sIX;n6`qW6`%A/3!!g̡1N) E|;>6⸏97$c]kkw1[mC͜cR>E,hʼnp#xFyWVWG3+˓S}Ğ#G8b^c^cpc&3YQ"vk9܇} ĿQL/ \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_16.png b/extend/phpqrcode/cache/frame_16.png new file mode 100644 index 0000000..6ac8fe8 Binary files /dev/null and b/extend/phpqrcode/cache/frame_16.png differ diff --git a/extend/phpqrcode/cache/frame_17.dat b/extend/phpqrcode/cache/frame_17.dat new file mode 100644 index 0000000..87f0cf5 Binary files /dev/null and b/extend/phpqrcode/cache/frame_17.dat differ diff --git a/extend/phpqrcode/cache/frame_17.png b/extend/phpqrcode/cache/frame_17.png new file mode 100644 index 0000000..5b929ac Binary files /dev/null and b/extend/phpqrcode/cache/frame_17.png differ diff --git a/extend/phpqrcode/cache/frame_18.dat b/extend/phpqrcode/cache/frame_18.dat new file mode 100644 index 0000000..bb7138c --- /dev/null +++ b/extend/phpqrcode/cache/frame_18.dat @@ -0,0 +1,2 @@ +xA +0E]օ,2;s&͚hO1&09OIv@DD &ىKXFv<dq9<%h Ys !(ds;~||b(Yůg#`KSĶsidߍLg:әt/gmkM3{4rTQes><әt3;H#љt3Y+oghٽlnF>i^#awm;g~pgNs{6zp' \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_18.png b/extend/phpqrcode/cache/frame_18.png new file mode 100644 index 0000000..ee0d6a3 Binary files /dev/null and b/extend/phpqrcode/cache/frame_18.png differ diff --git a/extend/phpqrcode/cache/frame_19.dat b/extend/phpqrcode/cache/frame_19.dat new file mode 100644 index 0000000..95e26ad --- /dev/null +++ b/extend/phpqrcode/cache/frame_19.dat @@ -0,0 +1,3 @@ +xA + E.No7ћiiRN2W%x@ڜ' +u6.*S;}àT zrt%,};)ZLP$qgLdJ;w.]z#[͝Og" B}};w#1Gb;w_C+w@Dfu2N9R7|pWkk \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_19.png b/extend/phpqrcode/cache/frame_19.png new file mode 100644 index 0000000..20fddd8 Binary files /dev/null and b/extend/phpqrcode/cache/frame_19.png differ diff --git a/extend/phpqrcode/cache/frame_2.dat b/extend/phpqrcode/cache/frame_2.dat new file mode 100644 index 0000000..7e42f31 --- /dev/null +++ b/extend/phpqrcode/cache/frame_2.dat @@ -0,0 +1 @@ +x͒ F{v& &Y+?Z1S'y!a815&۴HٞclF1#6 f6O7C֏8gIfB\DԻ( \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_2.png b/extend/phpqrcode/cache/frame_2.png new file mode 100644 index 0000000..9c150eb Binary files /dev/null and b/extend/phpqrcode/cache/frame_2.png differ diff --git a/extend/phpqrcode/cache/frame_20.dat b/extend/phpqrcode/cache/frame_20.dat new file mode 100644 index 0000000..d5ecc1d Binary files /dev/null and b/extend/phpqrcode/cache/frame_20.dat differ diff --git a/extend/phpqrcode/cache/frame_20.png b/extend/phpqrcode/cache/frame_20.png new file mode 100644 index 0000000..23a061d Binary files /dev/null and b/extend/phpqrcode/cache/frame_20.png differ diff --git a/extend/phpqrcode/cache/frame_21.dat b/extend/phpqrcode/cache/frame_21.dat new file mode 100644 index 0000000..1974dd9 --- /dev/null +++ b/extend/phpqrcode/cache/frame_21.dat @@ -0,0 +1 @@ +xA E]sIX;n6Upв]٘< i-eW)ŕ…H\jvqHL\6ЅrILܹ%@Vv(P4|Xngɝ~]Du1Us S\,2N?DKF-:eJ]p_,a0` X` w,` X]5 Y4{2vJs9)u۹,]^_7$_ \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_21.png b/extend/phpqrcode/cache/frame_21.png new file mode 100644 index 0000000..291598c Binary files /dev/null and b/extend/phpqrcode/cache/frame_21.png differ diff --git a/extend/phpqrcode/cache/frame_22.dat b/extend/phpqrcode/cache/frame_22.dat new file mode 100644 index 0000000..0f01802 --- /dev/null +++ b/extend/phpqrcode/cache/frame_22.dat @@ -0,0 +1,3 @@ +xA +0 E]{.]{{{ZBepwe@VERZ3"*2o4y)i#dbdF҅I"4WIu45x.ZS{8k={o.q[:帒qy +)t#N8dCj-OOG}:/:sz!)^IO- 7p 7$}>ɷ7p tssrs Vmҹ}R~7&?7ԦIbh{<Mi- \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_23.png b/extend/phpqrcode/cache/frame_23.png new file mode 100644 index 0000000..b8f16ae Binary files /dev/null and b/extend/phpqrcode/cache/frame_23.png differ diff --git a/extend/phpqrcode/cache/frame_24.dat b/extend/phpqrcode/cache/frame_24.dat new file mode 100644 index 0000000..7b92e29 --- /dev/null +++ b/extend/phpqrcode/cache/frame_24.dat @@ -0,0 +1 @@ +xA EMX0;nVP4HSSxU3/O LiJ4V JC%6VR&DBHjDJ??BlcDZ'UXUޏ0ywįj똳3ścj{:GqGNv;笓J <]#8#8H'GqGtr:9#8#8ؓhNt_>teS^\gQe?vuo;>*wlm \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_24.png b/extend/phpqrcode/cache/frame_24.png new file mode 100644 index 0000000..397c64f Binary files /dev/null and b/extend/phpqrcode/cache/frame_24.png differ diff --git a/extend/phpqrcode/cache/frame_25.dat b/extend/phpqrcode/cache/frame_25.dat new file mode 100644 index 0000000..ba12518 --- /dev/null +++ b/extend/phpqrcode/cache/frame_25.dat @@ -0,0 +1,3 @@ +xA + s낋]rxY51mMBG +*Sx|Ua5ƵZ-,1HPRjX5iG>WR/+uT廯 ӯ嗴u[Sa[kv5+5nJ%+VXbŊ߬u'SRtzZ++VXbŊٟٟٟ+VXb}Ŋ+VXVI+kq[toVZvoNVw}{r<ýR"R] Wr} \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_25.png b/extend/phpqrcode/cache/frame_25.png new file mode 100644 index 0000000..25bc445 Binary files /dev/null and b/extend/phpqrcode/cache/frame_25.png differ diff --git a/extend/phpqrcode/cache/frame_26.dat b/extend/phpqrcode/cache/frame_26.dat new file mode 100644 index 0000000..d34a73f --- /dev/null +++ b/extend/phpqrcode/cache/frame_26.dat @@ -0,0 +1,2 @@ +xA + Eօ,t77ћU E)i7*~cXEBFC6:&L,Mv.KgոYM>>mۚ?vmg?ұηdCUIkE\Msfafa>[sӈ9쬩ެ8b]LgEo w1 \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_26.png b/extend/phpqrcode/cache/frame_26.png new file mode 100644 index 0000000..f4a6b39 Binary files /dev/null and b/extend/phpqrcode/cache/frame_26.png differ diff --git a/extend/phpqrcode/cache/frame_27.dat b/extend/phpqrcode/cache/frame_27.dat new file mode 100644 index 0000000..b4d9ffd Binary files /dev/null and b/extend/phpqrcode/cache/frame_27.dat differ diff --git a/extend/phpqrcode/cache/frame_27.png b/extend/phpqrcode/cache/frame_27.png new file mode 100644 index 0000000..8419ec2 Binary files /dev/null and b/extend/phpqrcode/cache/frame_27.png differ diff --git a/extend/phpqrcode/cache/frame_28.dat b/extend/phpqrcode/cache/frame_28.dat new file mode 100644 index 0000000..8cbaa19 Binary files /dev/null and b/extend/phpqrcode/cache/frame_28.dat differ diff --git a/extend/phpqrcode/cache/frame_28.png b/extend/phpqrcode/cache/frame_28.png new file mode 100644 index 0000000..7609d8e Binary files /dev/null and b/extend/phpqrcode/cache/frame_28.png differ diff --git a/extend/phpqrcode/cache/frame_29.dat b/extend/phpqrcode/cache/frame_29.dat new file mode 100644 index 0000000..5e4a711 --- /dev/null +++ b/extend/phpqrcode/cache/frame_29.dat @@ -0,0 +1,2 @@ +xA a޺ @n7+*4!?J 抮]STf)sI"Ȕb0|"Luٸ,E1\6*uQ?>aυR-rn.ꯋ\T:*)|) , ,x_}:^RUoɢu~މX`XЏЏЏЏ_`X`XЏЏЏ_`X`XЏЏЏЏwbX`PU)D"c{z3<}^?bm잃a.] +{Q6uT,9 \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_29.png b/extend/phpqrcode/cache/frame_29.png new file mode 100644 index 0000000..ffe072c Binary files /dev/null and b/extend/phpqrcode/cache/frame_29.png differ diff --git a/extend/phpqrcode/cache/frame_3.dat b/extend/phpqrcode/cache/frame_3.dat new file mode 100644 index 0000000..188d531 --- /dev/null +++ b/extend/phpqrcode/cache/frame_3.dat @@ -0,0 +1 @@ +x E{v& &Y+bk'ya:TXl޶$W+ӏv9}gR@H0YPBEm?s"bt2cn:ﺭ;YzQ7 \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_3.png b/extend/phpqrcode/cache/frame_3.png new file mode 100644 index 0000000..945ee7c Binary files /dev/null and b/extend/phpqrcode/cache/frame_3.png differ diff --git a/extend/phpqrcode/cache/frame_30.dat b/extend/phpqrcode/cache/frame_30.dat new file mode 100644 index 0000000..44cf3d3 Binary files /dev/null and b/extend/phpqrcode/cache/frame_30.dat differ diff --git a/extend/phpqrcode/cache/frame_30.png b/extend/phpqrcode/cache/frame_30.png new file mode 100644 index 0000000..75dbddd Binary files /dev/null and b/extend/phpqrcode/cache/frame_30.png differ diff --git a/extend/phpqrcode/cache/frame_31.dat b/extend/phpqrcode/cache/frame_31.dat new file mode 100644 index 0000000..ce429d0 --- /dev/null +++ b/extend/phpqrcode/cache/frame_31.dat @@ -0,0 +1 @@ +xA a޺ &r4yķ!mV3Iv!Ҝ2i\NSS4EF2+65e/Ws]!?p=S~Đ?+x6r6y}ǴeR1-WllҌXz/>V櫷:ñA8-+mTbllltM&]ll&]Ill&]y 6` 6`iuyXWi\tz>.zk t77wJϔ4w҈85 \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_31.png b/extend/phpqrcode/cache/frame_31.png new file mode 100644 index 0000000..b14d1fa Binary files /dev/null and b/extend/phpqrcode/cache/frame_31.png differ diff --git a/extend/phpqrcode/cache/frame_32.dat b/extend/phpqrcode/cache/frame_32.dat new file mode 100644 index 0000000..aaa0808 --- /dev/null +++ b/extend/phpqrcode/cache/frame_32.dat @@ -0,0 +1,2 @@ +x + ־. Dl, Mz6Ç gcJD;'.AIqމI,IrYFk%DOy|EDD(L_Y>*ߚ?aOkL_<[c>c˘uLI%#0#0#otѢ}4fv_)Eph5R881#0#0itZ#0#0#0itZ#0#0#0itZl0#09q"HܜHQ"L5}-Y׾k`>z鸳4&p!!`:5 \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_32.png b/extend/phpqrcode/cache/frame_32.png new file mode 100644 index 0000000..58d42db Binary files /dev/null and b/extend/phpqrcode/cache/frame_32.png differ diff --git a/extend/phpqrcode/cache/frame_33.dat b/extend/phpqrcode/cache/frame_33.dat new file mode 100644 index 0000000..a261375 --- /dev/null +++ b/extend/phpqrcode/cache/frame_33.dat @@ -0,0 +1,14 @@ +xA a޺@n7+*L++柮bb*LCc kHrjJ5Yi~0_TT}e>5b_w͟?\Rai+7W\wLUNL ++ ++jOkc\˩|%o} 8 ++ ++ ++ 3g ++ ++ ++3g@ ++ ++ ++:RXB9I=ko/Swؘٯ`gr_ٙYVSYzIefnmQoz > \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_33.png b/extend/phpqrcode/cache/frame_33.png new file mode 100644 index 0000000..924c728 Binary files /dev/null and b/extend/phpqrcode/cache/frame_33.png differ diff --git a/extend/phpqrcode/cache/frame_34.dat b/extend/phpqrcode/cache/frame_34.dat new file mode 100644 index 0000000..7ceb025 Binary files /dev/null and b/extend/phpqrcode/cache/frame_34.dat differ diff --git a/extend/phpqrcode/cache/frame_34.png b/extend/phpqrcode/cache/frame_34.png new file mode 100644 index 0000000..a477042 Binary files /dev/null and b/extend/phpqrcode/cache/frame_34.png differ diff --git a/extend/phpqrcode/cache/frame_35.dat b/extend/phpqrcode/cache/frame_35.dat new file mode 100644 index 0000000..56bc3e2 Binary files /dev/null and b/extend/phpqrcode/cache/frame_35.dat differ diff --git a/extend/phpqrcode/cache/frame_35.png b/extend/phpqrcode/cache/frame_35.png new file mode 100644 index 0000000..d29806c Binary files /dev/null and b/extend/phpqrcode/cache/frame_35.png differ diff --git a/extend/phpqrcode/cache/frame_36.dat b/extend/phpqrcode/cache/frame_36.dat new file mode 100644 index 0000000..282c60d Binary files /dev/null and b/extend/phpqrcode/cache/frame_36.dat differ diff --git a/extend/phpqrcode/cache/frame_36.png b/extend/phpqrcode/cache/frame_36.png new file mode 100644 index 0000000..96ecb42 Binary files /dev/null and b/extend/phpqrcode/cache/frame_36.png differ diff --git a/extend/phpqrcode/cache/frame_37.dat b/extend/phpqrcode/cache/frame_37.dat new file mode 100644 index 0000000..015c0f2 Binary files /dev/null and b/extend/phpqrcode/cache/frame_37.dat differ diff --git a/extend/phpqrcode/cache/frame_37.png b/extend/phpqrcode/cache/frame_37.png new file mode 100644 index 0000000..fcc5162 Binary files /dev/null and b/extend/phpqrcode/cache/frame_37.png differ diff --git a/extend/phpqrcode/cache/frame_38.dat b/extend/phpqrcode/cache/frame_38.dat new file mode 100644 index 0000000..71cf53e --- /dev/null +++ b/extend/phpqrcode/cache/frame_38.dat @@ -0,0 +1 @@ +xA0ЎuA2;Нk(gytp9$D\e^'t-aIFMSkIŤ:7|LkN8N7i}i,[WgӴ?31iN}}=OM:4)SL2eʔ)SL#$ JJM:}]L٧SQL2eʔ)SL2աPt(:)SL2eʔ)S:ECq2eʔ)SL2eʔECѡ8O2eʔ)SL2eTCѡPL2eʔ)SL2ݓsJCIKԂi93n_ +Ri4\g;% }an \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_38.png b/extend/phpqrcode/cache/frame_38.png new file mode 100644 index 0000000..89238f3 Binary files /dev/null and b/extend/phpqrcode/cache/frame_38.png differ diff --git a/extend/phpqrcode/cache/frame_39.dat b/extend/phpqrcode/cache/frame_39.dat new file mode 100644 index 0000000..53511f7 Binary files /dev/null and b/extend/phpqrcode/cache/frame_39.dat differ diff --git a/extend/phpqrcode/cache/frame_39.png b/extend/phpqrcode/cache/frame_39.png new file mode 100644 index 0000000..1dc9cd1 Binary files /dev/null and b/extend/phpqrcode/cache/frame_39.png differ diff --git a/extend/phpqrcode/cache/frame_4.dat b/extend/phpqrcode/cache/frame_4.dat new file mode 100644 index 0000000..67b30e8 --- /dev/null +++ b/extend/phpqrcode/cache/frame_4.dat @@ -0,0 +1 @@ +x E=u pجQCOM'ˏ$ @3eF\FNXRyؾC{a8R Ńa2@qkH1(`cj~0ܨعnXGĀ \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_4.png b/extend/phpqrcode/cache/frame_4.png new file mode 100644 index 0000000..b72f9e7 Binary files /dev/null and b/extend/phpqrcode/cache/frame_4.png differ diff --git a/extend/phpqrcode/cache/frame_40.dat b/extend/phpqrcode/cache/frame_40.dat new file mode 100644 index 0000000..90d36dd --- /dev/null +++ b/extend/phpqrcode/cache/frame_40.dat @@ -0,0 +1,2 @@ +xA@Ь@o7`Qfe䕫PA><]߳bZn^AQ}[9^]ynajM܇K̘1cƌ3f̘1{W5}{7lMޚxI<Kαyl3f̘1cƌ3f̘1ۻٻ={αyl3f̘1cƌ3f̘1ۻٻ={αyl3f̘1cƌ3f̘1ۻٻ={αyl3f̘1cƌ3f̘1ۻٻ={αyl3f̘1cƌ3f̘SʑӒ7HK޼g\u_r'4[-]qL8ƝY1q!/(% \ No newline at end of file diff --git a/extend/phpqrcode/cache/frame_40.png b/extend/phpqrcode/cache/frame_40.png new file mode 100644 index 0000000..8034d86 Binary files /dev/null and b/extend/phpqrcode/cache/frame_40.png differ diff --git a/extend/phpqrcode/cache/frame_5.dat b/extend/phpqrcode/cache/frame_5.dat new file mode 100644 index 0000000..d5dafe1 --- /dev/null +++ b/extend/phpqrcode/cache/frame_5.dat @@ -0,0 +1 @@ +x1 Eu7ЛZ|ND B0@R$l,->VKZ[I9+Es=ϤL1̄[FZU4?i<;7;P#W-[ݯ6ddddddc",;"sk摑Q&erw######L.摑Иy1^˲\3 v \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_117_0.dat b/extend/phpqrcode/cache/mask_0/mask_117_0.dat new file mode 100644 index 0000000..781c7f8 --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_117_0.dat @@ -0,0 +1,2 @@ +xA +0 }OrR,#3,o5Cq:;;wvNJZG=m} ѱ2iRkj_YYYYYYYYe_/WVVVVVVkd-Ϻ,#OZc]|{ž$ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_121_0.dat b/extend/phpqrcode/cache/mask_0/mask_121_0.dat new file mode 100644 index 0000000..68810c3 --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_121_0.dat @@ -0,0 +1 @@ +x1 О/w YMS8>2SFOEcW\ۼ{cpKGBКmxhfffffff/s22W|*d1*5̬RWas\xm~8߮r0wjsdm&y \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_125_0.dat b/extend/phpqrcode/cache/mask_0/mask_125_0.dat new file mode 100644 index 0000000..2c73ef1 --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_125_0.dat @@ -0,0 +1,2 @@ +xA + н_TH`3AOL4 k(ewGW. #2} \Ygggggggggg_d>j^s;;;;;;;;;;'q;;;;;;;;;'˰qu_PYw{e=dG/ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_129_0.dat b/extend/phpqrcode/cache/mask_0/mask_129_0.dat new file mode 100644 index 0000000..812ee8a --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_129_0.dat @@ -0,0 +1,2 @@ +x1 + /*DE'hgt-}_pV \"b=s[J=8Dho۞' 0X ۴e0`  j" 0`Wf`^P0`2Ȁ  d07(Y/XLGby"pT \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_137_0.dat b/extend/phpqrcode/cache/mask_0/mask_137_0.dat new file mode 100644 index 0000000..f6d993b --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_137_0.dat @@ -0,0 +1 @@ +x1 О/+FZ?J L7Ժ*Ba%L~˻ʓCJYIWJ .K]R0a„ $INTwlLaL0a„ &Ld@PO0a„ &L0e@P?a„ &L0aDe@ &L0aMIlL&)dlgacR<$v,ɺ?U2] \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_141_0.dat b/extend/phpqrcode/cache/mask_0/mask_141_0.dat new file mode 100644 index 0000000..8c685c8 --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_141_0.dat @@ -0,0 +1,2 @@ +x= +0 нi9'EDx͘%I9+E{$m^&uS"D6ڟ]98UMbҾY[2拉Ĉ#F1bĈ%iRN潝ѳ#;#F1bĈN1i#F1bĈ#FtZ}Nk1bĈ#F1bktZ;#F1bFV-u"IoD-*7uj>bMV+ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_149_0.dat b/extend/phpqrcode/cache/mask_0/mask_149_0.dat new file mode 100644 index 0000000..d258350 --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_149_0.dat @@ -0,0 +1,3 @@ +xA + н_MEQXP৞.|94e{JLv#^n[ ?; +ZIV-*w˒1*+VXbŊXgwqX}JRYbŊ+VXbeΠwfeΠ^bŊ+VXbʜAʜAbŊ+VXbŊ9ٜAbŊ+VXbŊl0*0Tj`?Ϊ;X=zZr* \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_153_0.dat b/extend/phpqrcode/cache/mask_0/mask_153_0.dat new file mode 100644 index 0000000..fc79e9e --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_153_0.dat @@ -0,0 +1 @@ +x1 Н/礑h&F`Ҽ@I;PZ^X͌mf.=5 [if-R+!wr˜g\j̘1cƌ3f̘1cfo.2?1z `ƌ3f̘1cƌzƌ3f̘1cƌ3fztf3f̘1cƌ3f̘kk030cƌ3f̘1c9;Ď`vf͚̆ZϘW9 \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_157_0.dat b/extend/phpqrcode/cache/mask_0/mask_157_0.dat new file mode 100644 index 0000000..ad749f3 --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_157_0.dat @@ -0,0 +1,2 @@ +xA + н_QRY k*q͵=j7~nN.p%ڵsi.رcǎ;vر{.-W2={mgy+رcǎ;vɳ2;yּcǎ;vرcNɳ;vرcǎ;v2I9+DyI4ˠ5:Wvdqߜܴ<d2x%[U%2]&K,Ydɒ%ˡ,S՗r2yd=,k_{Xdɒ%K,Yd)0m,Ydɒ%K,Yd)0m,Ydɒ%K,Yme,e%K,Ydɒ%K,eq Ò%K,Ydɒe:I9EQ=Ls I{ZtR}Sn:|R[?_*SL2eʔ)SL&ϦI O2O2eʔ)SL2e*C1PPSL2eʔ)SLP22)SL2eʔ)SLe(}2)SL2eʔ)SLe(}2)SL2eʔ)Sic7;"ޙFͦސٙvL ^2}oO'r \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_173_0.dat b/extend/phpqrcode/cache/mask_0/mask_173_0.dat new file mode 100644 index 0000000..5ef85e7 --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_173_0.dat @@ -0,0 +1 @@ +x10ޯT [4v2ƽok݇;Ӳ]f֞dljlG0n+߻mG˖-[lٲe"Y}oV[lٲe˖-[lٲeհՃ[2lٲe˖-[lٲeհՃ[2lٲe˖-[lٲeհՃ[lٲe˖-[lٲeValٲe˖-[lٲef[BmаE;N-ۜT/rl?* \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_177_0.dat b/extend/phpqrcode/cache/mask_0/mask_177_0.dat new file mode 100644 index 0000000..78a26a7 --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_177_0.dat @@ -0,0 +1,2 @@ +x1 +0>I9+?߁iև d̹xֈxN/է|{ظ8d0h=cFf̘1cƌ3f̘qq=w6;l4cƕ<nj3f̘1cƌ3fXһ1ֻcƌ3f̘1cƌ3fXbwnj3f̘1cƌ3f̘M'X&1cƌ3f̘1cƌ3ֻnn1cƌ3f̘1cƌÍ3U< \7+(<OƌΊnj4@ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_21_0.dat b/extend/phpqrcode/cache/mask_0/mask_21_0.dat new file mode 100644 index 0000000..368c994 Binary files /dev/null and b/extend/phpqrcode/cache/mask_0/mask_21_0.dat differ diff --git a/extend/phpqrcode/cache/mask_0/mask_25_0.dat b/extend/phpqrcode/cache/mask_0/mask_25_0.dat new file mode 100644 index 0000000..e4a5b6d Binary files /dev/null and b/extend/phpqrcode/cache/mask_0/mask_25_0.dat differ diff --git a/extend/phpqrcode/cache/mask_0/mask_29_0.dat b/extend/phpqrcode/cache/mask_0/mask_29_0.dat new file mode 100644 index 0000000..74a216b Binary files /dev/null and b/extend/phpqrcode/cache/mask_0/mask_29_0.dat differ diff --git a/extend/phpqrcode/cache/mask_0/mask_33_0.dat b/extend/phpqrcode/cache/mask_0/mask_33_0.dat new file mode 100644 index 0000000..2ec712a Binary files /dev/null and b/extend/phpqrcode/cache/mask_0/mask_33_0.dat differ diff --git a/extend/phpqrcode/cache/mask_0/mask_37_0.dat b/extend/phpqrcode/cache/mask_0/mask_37_0.dat new file mode 100644 index 0000000..1588cfc Binary files /dev/null and b/extend/phpqrcode/cache/mask_0/mask_37_0.dat differ diff --git a/extend/phpqrcode/cache/mask_0/mask_41_0.dat b/extend/phpqrcode/cache/mask_0/mask_41_0.dat new file mode 100644 index 0000000..e369027 Binary files /dev/null and b/extend/phpqrcode/cache/mask_0/mask_41_0.dat differ diff --git a/extend/phpqrcode/cache/mask_0/mask_45_0.dat b/extend/phpqrcode/cache/mask_0/mask_45_0.dat new file mode 100644 index 0000000..452f126 Binary files /dev/null and b/extend/phpqrcode/cache/mask_0/mask_45_0.dat differ diff --git a/extend/phpqrcode/cache/mask_0/mask_49_0.dat b/extend/phpqrcode/cache/mask_0/mask_49_0.dat new file mode 100644 index 0000000..fdd2aac --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_49_0.dat @@ -0,0 +1,2 @@ +xK E9o#?H/6g$-,X] +xݘ; X԰9<Ѻq2AfH7/5We{#fި?4=N > \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_53_0.dat b/extend/phpqrcode/cache/mask_0/mask_53_0.dat new file mode 100644 index 0000000..572d279 --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_53_0.dat @@ -0,0 +1,2 @@ +xK +@!йoQϺ:(m&s-6Z{m4YX.F٭XZij=:έ֋b忑VH 8 #[Y^Xe \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_57_0.dat b/extend/phpqrcode/cache/mask_0/mask_57_0.dat new file mode 100644 index 0000000..ea81e6d --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_57_0.dat @@ -0,0 +1,4 @@ +xA + {^s=YL՚ ( +ouj)  +Z7yv,ԴwVQ iGiҤDfەwo4ѤoLLȼ}4 h \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_61_0.dat b/extend/phpqrcode/cache/mask_0/mask_61_0.dat new file mode 100644 index 0000000..93d2444 Binary files /dev/null and b/extend/phpqrcode/cache/mask_0/mask_61_0.dat differ diff --git a/extend/phpqrcode/cache/mask_0/mask_65_0.dat b/extend/phpqrcode/cache/mask_0/mask_65_0.dat new file mode 100644 index 0000000..df29d7b Binary files /dev/null and b/extend/phpqrcode/cache/mask_0/mask_65_0.dat differ diff --git a/extend/phpqrcode/cache/mask_0/mask_69_0.dat b/extend/phpqrcode/cache/mask_0/mask_69_0.dat new file mode 100644 index 0000000..8a2cfbd --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_69_0.dat @@ -0,0 +1 @@ +xK =_+mBd|Q"s+1"),=Ea T"ŐnE-3 ,KYw=ZZT .,K1#֞!Ŋ+V嬪.2XbŊ+VX.kBzwձ̀gkYZ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_89_0.dat b/extend/phpqrcode/cache/mask_0/mask_89_0.dat new file mode 100644 index 0000000..aaa4c52 --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_89_0.dat @@ -0,0 +1 @@ +x1 ὧi9'Hl?L^"&M?bq?˸,9!z]VScƌ3_c!`n3f̘1č 3f̘1/f>.Uc˻; 2;Y+7 \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_93_0.dat b/extend/phpqrcode/cache/mask_0/mask_93_0.dat new file mode 100644 index 0000000..e218fa0 --- /dev/null +++ b/extend/phpqrcode/cache/mask_0/mask_93_0.dat @@ -0,0 +1,3 @@ +xK + EyV,OmޠrPH0{2bc{tQ] +{Q{{弬֒ǎ;v_ڳ}L}l߱cǎ;v̑̑̑رcǎ.Legw3qeѾ@i \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_0/mask_97_0.dat b/extend/phpqrcode/cache/mask_0/mask_97_0.dat new file mode 100644 index 0000000..74ac719 Binary files /dev/null and b/extend/phpqrcode/cache/mask_0/mask_97_0.dat differ diff --git a/extend/phpqrcode/cache/mask_1/mask_101_1.dat b/extend/phpqrcode/cache/mask_1/mask_101_1.dat new file mode 100644 index 0000000..ec939b5 --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_101_1.dat @@ -0,0 +1,2 @@ +x1 + н\QEd  1N<#Ֆ-7u.lԦeiXXXXXRZVVeIo1,,,,,v%?gaaaaY K&K=/+ۍ˱ގ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_105_1.dat b/extend/phpqrcode/cache/mask_1/mask_105_1.dat new file mode 100644 index 0000000..e1f5c99 --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_105_1.dat @@ -0,0 +1 @@ +x1 Ӕ_Υb KB?"*#WʘtgӎJqUM9TLLvǤLLLLLLzgG01111yiߘ4m=՛n+2 \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_109_1.dat b/extend/phpqrcode/cache/mask_1/mask_109_1.dat new file mode 100644 index 0000000..7e0d6d1 --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_109_1.dat @@ -0,0 +1 @@ +xֱ >ӘK}:!iY'*3]fsmb[JƶŖK9}cccccc'u.6Ʀs6666R[^g{/lٷ 7͂ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_113_1.dat b/extend/phpqrcode/cache/mask_1/mask_113_1.dat new file mode 100644 index 0000000..1dd666d --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_113_1.dat @@ -0,0 +1 @@ +x1  -8fL(pBlDM9";-;?1p{\%-3:@ad4*Nadddddd########c]751xYu \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_117_1.dat b/extend/phpqrcode/cache/mask_1/mask_117_1.dat new file mode 100644 index 0000000..8921f64 --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_117_1.dat @@ -0,0 +1,2 @@ +xֻ >ӘK$^ 8YQSV'z8jzʇ^]סekXYYYYYYYjݵ# ++yeeeeeeee#WVVVVVVVV;"+yeeeeeeel'e;b&^9{/J$p \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_121_1.dat b/extend/phpqrcode/cache/mask_1/mask_121_1.dat new file mode 100644 index 0000000..64bd8ba --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_121_1.dat @@ -0,0 +1,2 @@ +x1 + н\CPbїE$DdƩYtڅλ0$ήꝝga7yٯ痽Y??{{D \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_129_1.dat b/extend/phpqrcode/cache/mask_1/mask_129_1.dat new file mode 100644 index 0000000..62cd1c9 Binary files /dev/null and b/extend/phpqrcode/cache/mask_1/mask_129_1.dat differ diff --git a/extend/phpqrcode/cache/mask_1/mask_133_1.dat b/extend/phpqrcode/cache/mask_1/mask_133_1.dat new file mode 100644 index 0000000..18d68dc --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_133_1.dat @@ -0,0 +1 @@ +x1 Ӕ_΅hh|"zۉ-*dNHQĢR ,X`c9Y(na_` ,X,X,X` #:8  ,X`Bd¾` ,X|ϢY\X; 7-; ` \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_137_1.dat b/extend/phpqrcode/cache/mask_1/mask_137_1.dat new file mode 100644 index 0000000..284d7be --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_137_1.dat @@ -0,0 +1,3 @@ +x1 +0 ӤKh]D,-t #ڌQ[T Ks7_?9|B&X^L0a„&3„M&L0a„ &2D4c0a„ &LȀЌe„ &L0abwȀf,&L0a„7&y2anoL<01O + \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_141_1.dat b/extend/phpqrcode/cache/mask_1/mask_141_1.dat new file mode 100644 index 0000000..83220dd --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_141_1.dat @@ -0,0 +1,2 @@ +x1 + >946)3$`s uʮ>Wd )g'M{3\d6ubذaÆ 6lؼn]Nذ9FްaÆ 6lذa3a#oذaÆ 6lذذ5e16lذaÆ ]Sbk6lذaÆ mͤ;CcfIdsG \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_145_1.dat b/extend/phpqrcode/cache/mask_1/mask_145_1.dat new file mode 100644 index 0000000..6a9950f --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_145_1.dat @@ -0,0 +1 @@ +x!0@k 4a)q2i.YCUO{35UZFn]fN>bdwtzJF}F1bĈ#F(F6r1bĈ#F1E1ilF1bĈ#FtF#F1bĈ#FtZ}##F1bĈleHGܣ@ٝ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_149_1.dat b/extend/phpqrcode/cache/mask_1/mask_149_1.dat new file mode 100644 index 0000000..02a3cdc --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_149_1.dat @@ -0,0 +1 @@ +x1 Ӕ_΅qH_Xci#Gd̘Ք՛gLU^ݮVR>dKVXbŊ+VXeoXJ_bŊ+VXb;ݙ+}Ŋ+VXbŊ+VAVngŊ+VXbŊ}+ +VXbŊVj>hewf*`uTq \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_153_1.dat b/extend/phpqrcode/cache/mask_1/mask_153_1.dat new file mode 100644 index 0000000..2abfca2 --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_153_1.dat @@ -0,0 +1,2 @@ +x1 +0\9btEc'HH9efߞmffM#.̘1cƌ3f̘1cf73f̘g̘1cƌ3f̘1co2c]?3f̘1cƌ3f5Mf3f̘1cƌ3f̘17utf3f̘1cƌ3f̘=lj3>V \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_157_1.dat b/extend/phpqrcode/cache/mask_1/mask_157_1.dat new file mode 100644 index 0000000..17344b8 --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_157_1.dat @@ -0,0 +1,2 @@ +x1 + >94Sd/51V)SkJv7eGcǎ;vرc]Zٱc'رcǎ;vر+رg;vرcǎ;}V`N+رcǎ;v:;v;vرcǎ;;}Vޱcǎ;vص'vz#;]klwoA` \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_161_1.dat b/extend/phpqrcode/cache/mask_1/mask_161_1.dat new file mode 100644 index 0000000..669ade1 --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_161_1.dat @@ -0,0 +1 @@ +x10_΅Xš yi~Qbkvp7'M u=]([ 2dȐ +\' 2 2dȐ!C 2s0/3d() 2dȐ!C 241dh 2dȐ!C 2dhcȐSL2eʔ)SL2M SLSL2eʔ)SL2M}LSSL2eʔ)SLeSy)SŔ)SL2eʔ)S;ٔ)S;)SL2eʔ)Sv()Sv()SL2eʔ)SLdT6}a*3mljmzC' \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_173_1.dat b/extend/phpqrcode/cache/mask_1/mask_173_1.dat new file mode 100644 index 0000000..436918c --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_173_1.dat @@ -0,0 +1 @@ +x1 Ӕ_Υ''@y]X1?"g:1犝fn˶˻mm.?lٲe˖-F>glٲ2lٲe˖-[lٲeO`˖e˖-[lٲe˖-[l lٲlٲe˖-[lٲeVO`˖e˖-[lٲe˖-[z0}[z0y˖-[lٲe˖-[Ee[hOVWö=t*| \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_177_1.dat b/extend/phpqrcode/cache/mask_1/mask_177_1.dat new file mode 100644 index 0000000..12e2e52 --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_177_1.dat @@ -0,0 +1 @@ +x1 Ep0X,a#r}6}nj~\8ƌ3f̘1cƌ7{3f,y3f̘1cƌ3fX_`X&3f̘1cƌ3f̘M_1cy̘1cƌ3f̘1cƌ+3f,y3f̘1cƌ3fX_bX&3f̘1cƌ3fx2dX'x[cy| 3 \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_21_1.dat b/extend/phpqrcode/cache/mask_1/mask_21_1.dat new file mode 100644 index 0000000..f87e0a1 Binary files /dev/null and b/extend/phpqrcode/cache/mask_1/mask_21_1.dat differ diff --git a/extend/phpqrcode/cache/mask_1/mask_25_1.dat b/extend/phpqrcode/cache/mask_1/mask_25_1.dat new file mode 100644 index 0000000..3a225e3 Binary files /dev/null and b/extend/phpqrcode/cache/mask_1/mask_25_1.dat differ diff --git a/extend/phpqrcode/cache/mask_1/mask_29_1.dat b/extend/phpqrcode/cache/mask_1/mask_29_1.dat new file mode 100644 index 0000000..0a1cb3b Binary files /dev/null and b/extend/phpqrcode/cache/mask_1/mask_29_1.dat differ diff --git a/extend/phpqrcode/cache/mask_1/mask_33_1.dat b/extend/phpqrcode/cache/mask_1/mask_33_1.dat new file mode 100644 index 0000000..318949d Binary files /dev/null and b/extend/phpqrcode/cache/mask_1/mask_33_1.dat differ diff --git a/extend/phpqrcode/cache/mask_1/mask_37_1.dat b/extend/phpqrcode/cache/mask_1/mask_37_1.dat new file mode 100644 index 0000000..5bd9e3a Binary files /dev/null and b/extend/phpqrcode/cache/mask_1/mask_37_1.dat differ diff --git a/extend/phpqrcode/cache/mask_1/mask_41_1.dat b/extend/phpqrcode/cache/mask_1/mask_41_1.dat new file mode 100644 index 0000000..52e9e58 Binary files /dev/null and b/extend/phpqrcode/cache/mask_1/mask_41_1.dat differ diff --git a/extend/phpqrcode/cache/mask_1/mask_45_1.dat b/extend/phpqrcode/cache/mask_1/mask_45_1.dat new file mode 100644 index 0000000..b35c567 Binary files /dev/null and b/extend/phpqrcode/cache/mask_1/mask_45_1.dat differ diff --git a/extend/phpqrcode/cache/mask_1/mask_49_1.dat b/extend/phpqrcode/cache/mask_1/mask_49_1.dat new file mode 100644 index 0000000..d20d717 Binary files /dev/null and b/extend/phpqrcode/cache/mask_1/mask_49_1.dat differ diff --git a/extend/phpqrcode/cache/mask_1/mask_53_1.dat b/extend/phpqrcode/cache/mask_1/mask_53_1.dat new file mode 100644 index 0000000..a676d7d Binary files /dev/null and b/extend/phpqrcode/cache/mask_1/mask_53_1.dat differ diff --git a/extend/phpqrcode/cache/mask_1/mask_57_1.dat b/extend/phpqrcode/cache/mask_1/mask_57_1.dat new file mode 100644 index 0000000..896ed43 Binary files /dev/null and b/extend/phpqrcode/cache/mask_1/mask_57_1.dat differ diff --git a/extend/phpqrcode/cache/mask_1/mask_61_1.dat b/extend/phpqrcode/cache/mask_1/mask_61_1.dat new file mode 100644 index 0000000..4165a4b --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_61_1.dat @@ -0,0 +1 @@ +x30CbpPi`@&H^nadQG{n_.4Iy킎`)-5*(of[sm}6YM ;;;;;G{zطz1vw}=wuL%?"=~ei \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_1/mask_97_1.dat b/extend/phpqrcode/cache/mask_1/mask_97_1.dat new file mode 100644 index 0000000..24fa60f --- /dev/null +++ b/extend/phpqrcode/cache/mask_1/mask_97_1.dat @@ -0,0 +1,2 @@ +x1 +0н1\tncKD"H$DH$D"Q&WerH$D"*x[(?/'nd \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_2/mask_117_2.dat b/extend/phpqrcode/cache/mask_2/mask_117_2.dat new file mode 100644 index 0000000..b4dcce4 --- /dev/null +++ b/extend/phpqrcode/cache/mask_2/mask_117_2.dat @@ -0,0 +1,2 @@ +x1 + >94!m dOs\0X,la5#E>Z[ַRT*JR?Q-*T*JR?UW*JRTݟ+JRԤ~m5;S&+ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_2/mask_121_2.dat b/extend/phpqrcode/cache/mask_2/mask_121_2.dat new file mode 100644 index 0000000..a2a0097 Binary files /dev/null and b/extend/phpqrcode/cache/mask_2/mask_121_2.dat differ diff --git a/extend/phpqrcode/cache/mask_2/mask_125_2.dat b/extend/phpqrcode/cache/mask_2/mask_125_2.dat new file mode 100644 index 0000000..0ea40fd --- /dev/null +++ b/extend/phpqrcode/cache/mask_2/mask_125_2.dat @@ -0,0 +1 @@ +x! PӔ_@ U(kp@^Mڮ5-:VF_\t:NtyNqt:NtG;Nt:.8:NtzA}yNq;+n& \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_2/mask_129_2.dat b/extend/phpqrcode/cache/mask_2/mask_129_2.dat new file mode 100644 index 0000000..bf04839 --- /dev/null +++ b/extend/phpqrcode/cache/mask_2/mask_129_2.dat @@ -0,0 +1,2 @@ +x1 +0н_KVڡ'.!w]A0X~  !࣠fK# xFy4 vey@^+  ~  L#veI \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_2/mask_133_2.dat b/extend/phpqrcode/cache/mask_2/mask_133_2.dat new file mode 100644 index 0000000..9e78b6d --- /dev/null +++ b/extend/phpqrcode/cache/mask_2/mask_133_2.dat @@ -0,0 +1,10 @@ +x1 + н&`LQ-g=Aqbʪl fƄȚ44& )OȚYF4444444444c4~9S:3ЌטpǮ> \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_2/mask_145_2.dat b/extend/phpqrcode/cache/mask_2/mask_145_2.dat new file mode 100644 index 0000000..9ff2bbf --- /dev/null +++ b/extend/phpqrcode/cache/mask_2/mask_145_2.dat @@ -0,0 +1,4 @@ +x1 + нr] +,tQ^&C~ +щj~mɾ.FgMDDDDDDDDDDDST׈DHdZL+ɴDDDDDDDDDDD2-'"""""""":BתEYDd \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_2/mask_149_2.dat b/extend/phpqrcode/cache/mask_2/mask_149_2.dat new file mode 100644 index 0000000..d52e048 --- /dev/null +++ b/extend/phpqrcode/cache/mask_2/mask_149_2.dat @@ -0,0 +1 @@ +x;@/gcaGBXB'-ˆouէUQdRVOmT*ǫ;;j廝Ee2PQQQQQQQQQQQ TTTTTTTTTTTTr33R &Tskz_e2P=d \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_2/mask_153_2.dat b/extend/phpqrcode/cache/mask_2/mask_153_2.dat new file mode 100644 index 0000000..3b06041 --- /dev/null +++ b/extend/phpqrcode/cache/mask_2/mask_153_2.dat @@ -0,0 +1,2 @@ +x1 +0 Ӥ8ZP!BZu賶"bu*)]MFFFFFFFFFFFF%= #ddddddddddddr ot2yFFFFFFFFFFFF& #k5L 2222222222(Y7"d@H \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_2/mask_157_2.dat b/extend/phpqrcode/cache/mask_2/mask_157_2.dat new file mode 100644 index 0000000..2baf535 --- /dev/null +++ b/extend/phpqrcode/cache/mask_2/mask_157_2.dat @@ -0,0 +1,3 @@ +x1 +0>s6MqUH1X&U̘f/u-'.[KGGGGGGGGGGH|NG(ttttttttttNF;::::::::::}Nz$ +>n A#^AG(t =3{ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_2/mask_161_2.dat b/extend/phpqrcode/cache/mask_2/mask_161_2.dat new file mode 100644 index 0000000..d2df759 Binary files /dev/null and b/extend/phpqrcode/cache/mask_2/mask_161_2.dat differ diff --git a/extend/phpqrcode/cache/mask_2/mask_165_2.dat b/extend/phpqrcode/cache/mask_2/mask_165_2.dat new file mode 100644 index 0000000..2e6cd7c --- /dev/null +++ b/extend/phpqrcode/cache/mask_2/mask_165_2.dat @@ -0,0 +1,2 @@ +x1 +0 Ӥ?BVUG%*+_fs MIIIIIIIII2d;l4()))))))))))eqJنIDIIIIIIIIIII)۠mPRRRRRRRRRRR6l JJJJJJJJJJJJن}RaQRRRRRRRRRRNeK?R퐔͔&W3U \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_2/mask_169_2.dat b/extend/phpqrcode/cache/mask_2/mask_169_2.dat new file mode 100644 index 0000000..4052062 Binary files /dev/null and b/extend/phpqrcode/cache/mask_2/mask_169_2.dat differ diff --git a/extend/phpqrcode/cache/mask_2/mask_173_2.dat b/extend/phpqrcode/cache/mask_2/mask_173_2.dat new file mode 100644 index 0000000..0a30ba5 --- /dev/null +++ b/extend/phpqrcode/cache/mask_2/mask_173_2.dat @@ -0,0 +1 @@ +x+@ Pift:>y &d U߬S[]5Z;a5V۞A[Z˴VՃI0ZZZZZZZZZZZZZZ=-Lhi`VFK?ݧhioJ0}o \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_2/mask_177_2.dat b/extend/phpqrcode/cache/mask_2/mask_177_2.dat new file mode 100644 index 0000000..d2c52f9 --- /dev/null +++ b/extend/phpqrcode/cache/mask_2/mask_177_2.dat @@ -0,0 +1,2 @@ +x1 + E>Y4V$~ ,C&U;Ook5bϙGx9%&&&&&&&&&&&n$OL|v#&&&&&&&&&&&&&bbݍXw#&l7bbbbbbbbbbbbbbM"l7bbbbbbbbbbbbbbMa!&݈3)U*F> \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_2/mask_45_2.dat b/extend/phpqrcode/cache/mask_2/mask_45_2.dat new file mode 100644 index 0000000..ad44ff1 Binary files /dev/null and b/extend/phpqrcode/cache/mask_2/mask_45_2.dat differ diff --git a/extend/phpqrcode/cache/mask_2/mask_49_2.dat b/extend/phpqrcode/cache/mask_2/mask_49_2.dat new file mode 100644 index 0000000..6e8edff Binary files /dev/null and b/extend/phpqrcode/cache/mask_2/mask_49_2.dat differ diff --git a/extend/phpqrcode/cache/mask_2/mask_53_2.dat b/extend/phpqrcode/cache/mask_2/mask_53_2.dat new file mode 100644 index 0000000..682cae2 Binary files /dev/null and b/extend/phpqrcode/cache/mask_2/mask_53_2.dat differ diff --git a/extend/phpqrcode/cache/mask_2/mask_57_2.dat b/extend/phpqrcode/cache/mask_2/mask_57_2.dat new file mode 100644 index 0000000..66a5c05 Binary files /dev/null and b/extend/phpqrcode/cache/mask_2/mask_57_2.dat differ diff --git a/extend/phpqrcode/cache/mask_2/mask_61_2.dat b/extend/phpqrcode/cache/mask_2/mask_61_2.dat new file mode 100644 index 0000000..77d3815 Binary files /dev/null and b/extend/phpqrcode/cache/mask_2/mask_61_2.dat differ diff --git a/extend/phpqrcode/cache/mask_2/mask_65_2.dat b/extend/phpqrcode/cache/mask_2/mask_65_2.dat new file mode 100644 index 0000000..caf184a Binary files /dev/null and b/extend/phpqrcode/cache/mask_2/mask_65_2.dat differ diff --git a/extend/phpqrcode/cache/mask_2/mask_69_2.dat b/extend/phpqrcode/cache/mask_2/mask_69_2.dat new file mode 100644 index 0000000..6a3801b Binary files /dev/null and b/extend/phpqrcode/cache/mask_2/mask_69_2.dat differ diff --git a/extend/phpqrcode/cache/mask_2/mask_73_2.dat b/extend/phpqrcode/cache/mask_2/mask_73_2.dat new file mode 100644 index 0000000..74945b7 Binary files /dev/null and b/extend/phpqrcode/cache/mask_2/mask_73_2.dat differ diff --git a/extend/phpqrcode/cache/mask_2/mask_77_2.dat b/extend/phpqrcode/cache/mask_2/mask_77_2.dat new file mode 100644 index 0000000..903cba4 --- /dev/null +++ b/extend/phpqrcode/cache/mask_2/mask_77_2.dat @@ -0,0 +1 @@ +x1 н_CM>Gt ѫe+FWZEm&gއFѶhF+t/FYvFj[*7a \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_2/mask_81_2.dat b/extend/phpqrcode/cache/mask_2/mask_81_2.dat new file mode 100644 index 0000000..17a9ac2 --- /dev/null +++ b/extend/phpqrcode/cache/mask_2/mask_81_2.dat @@ -0,0 +1,2 @@ +x1 +0н_KҩVi!O\"A]:xbW1uȦ&_T ΋6H$U^D~bׯb=gX \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_2/mask_85_2.dat b/extend/phpqrcode/cache/mask_2/mask_85_2.dat new file mode 100644 index 0000000..72c74ff --- /dev/null +++ b/extend/phpqrcode/cache/mask_2/mask_85_2.dat @@ -0,0 +1,2 @@ +x1 +0=1\B7O$A0$8Wwjguu槊RT*uS֧JRTJRRޢN浘V \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_2/mask_89_2.dat b/extend/phpqrcode/cache/mask_2/mask_89_2.dat new file mode 100644 index 0000000..06c9a4f --- /dev/null +++ b/extend/phpqrcode/cache/mask_2/mask_89_2.dat @@ -0,0 +1 @@ +xٱ 0 >/&E*cQqŃ zf$rM)_%s_d3KO1^aL,$H"$KzRPt[I&X9$H"$I$ysI$DI$ɓI$I$Dɍ%es!=LAZ5'̓IVrn/2oƅ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_3/mask_113_3.dat b/extend/phpqrcode/cache/mask_3/mask_113_3.dat new file mode 100644 index 0000000..023b273 --- /dev/null +++ b/extend/phpqrcode/cache/mask_3/mask_113_3.dat @@ -0,0 +1,2 @@ +xA +0 D}NrnDFj2KCt?WݲZi.qoP %Smj7ަ:*N:@:***fW9d2*j*}S@`*j৪6Jlѿ}}էTUa24hnt \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_3/mask_117_3.dat b/extend/phpqrcode/cache/mask_3/mask_117_3.dat new file mode 100644 index 0000000..79cc04d --- /dev/null +++ b/extend/phpqrcode/cache/mask_3/mask_117_3.dat @@ -0,0 +1,4 @@ +x1 +0 ]Q.xIB$?~!z#E)RHZ@bl-)ݿ<ߧ*OUR"5&5*ie J]+ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_3/mask_145_3.dat b/extend/phpqrcode/cache/mask_3/mask_145_3.dat new file mode 100644 index 0000000..338b7e7 --- /dev/null +++ b/extend/phpqrcode/cache/mask_3/mask_145_3.dat @@ -0,0 +1,3 @@ +x +@|:^ Jy̡yMj-' +9VS֦K9e)PyUwe-m jԨQF5jԨRi٫F4_wk}0+jRBRF5jԨQeOMBJHjԨQF5jwP״˪IH I5jԨQFͳc w5jԨQF:zS*2UZ_C*e_OZ%dIȯb \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_3/mask_149_3.dat b/extend/phpqrcode/cache/mask_3/mask_149_3.dat new file mode 100644 index 0000000..30bc5fa --- /dev/null +++ b/extend/phpqrcode/cache/mask_3/mask_149_3.dat @@ -0,0 +1 @@ +xA0}Oܠ⦐H頯'Z2{oV|Ι%>yR{!8ÂI+JpI|#f5κ[P A $H Q})&X{ט+Wb`I)5%d \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_3/mask_153_3.dat b/extend/phpqrcode/cache/mask_3/mask_153_3.dat new file mode 100644 index 0000000..89cdec0 --- /dev/null +++ b/extend/phpqrcode/cache/mask_3/mask_153_3.dat @@ -0,0 +1,2 @@ +xA +0}Ns˹)7mJ,}8X=cW^GeN}o%uJV/{%O>}ӧO}K~O>}ӧO>Q=/ї>}ӧO>}u{ח>}ӧO>}u{蟪/%?}ӧO>}ׯ.N4჏VMmRt(1| \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_3/mask_177_3.dat b/extend/phpqrcode/cache/mask_3/mask_177_3.dat new file mode 100644 index 0000000..9586979 Binary files /dev/null and b/extend/phpqrcode/cache/mask_3/mask_177_3.dat differ diff --git a/extend/phpqrcode/cache/mask_3/mask_21_3.dat b/extend/phpqrcode/cache/mask_3/mask_21_3.dat new file mode 100644 index 0000000..bcb4eec Binary files /dev/null and b/extend/phpqrcode/cache/mask_3/mask_21_3.dat differ diff --git a/extend/phpqrcode/cache/mask_3/mask_25_3.dat b/extend/phpqrcode/cache/mask_3/mask_25_3.dat new file mode 100644 index 0000000..0ffc375 Binary files /dev/null and b/extend/phpqrcode/cache/mask_3/mask_25_3.dat differ diff --git a/extend/phpqrcode/cache/mask_3/mask_29_3.dat b/extend/phpqrcode/cache/mask_3/mask_29_3.dat new file mode 100644 index 0000000..6150ac1 Binary files /dev/null and b/extend/phpqrcode/cache/mask_3/mask_29_3.dat differ diff --git a/extend/phpqrcode/cache/mask_3/mask_33_3.dat b/extend/phpqrcode/cache/mask_3/mask_33_3.dat new file mode 100644 index 0000000..6053b5e Binary files /dev/null and b/extend/phpqrcode/cache/mask_3/mask_33_3.dat differ diff --git a/extend/phpqrcode/cache/mask_3/mask_37_3.dat b/extend/phpqrcode/cache/mask_3/mask_37_3.dat new file mode 100644 index 0000000..5dea5b9 Binary files /dev/null and b/extend/phpqrcode/cache/mask_3/mask_37_3.dat differ diff --git a/extend/phpqrcode/cache/mask_3/mask_41_3.dat b/extend/phpqrcode/cache/mask_3/mask_41_3.dat new file mode 100644 index 0000000..ca9ddc2 Binary files /dev/null and b/extend/phpqrcode/cache/mask_3/mask_41_3.dat differ diff --git a/extend/phpqrcode/cache/mask_3/mask_45_3.dat b/extend/phpqrcode/cache/mask_3/mask_45_3.dat new file mode 100644 index 0000000..3daad97 --- /dev/null +++ b/extend/phpqrcode/cache/mask_3/mask_45_3.dat @@ -0,0 +1,2 @@ +xK + DsFJ(&)0dЇFg![8=&iaD)d8&Aլa 1'II׳79 ex߾ I&֝CuJy \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_3/mask_49_3.dat b/extend/phpqrcode/cache/mask_3/mask_49_3.dat new file mode 100644 index 0000000..7f6508d Binary files /dev/null and b/extend/phpqrcode/cache/mask_3/mask_49_3.dat differ diff --git a/extend/phpqrcode/cache/mask_3/mask_53_3.dat b/extend/phpqrcode/cache/mask_3/mask_53_3.dat new file mode 100644 index 0000000..8800bea --- /dev/null +++ b/extend/phpqrcode/cache/mask_3/mask_53_3.dat @@ -0,0 +1,2 @@ +xK +0Ds ! -(.Bp&|"-t&`qQ-"9_+)Be/H8D%a~}spKFN=,;;a^t4\FSN \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_3/mask_57_3.dat b/extend/phpqrcode/cache/mask_3/mask_57_3.dat new file mode 100644 index 0000000..4e1e5da Binary files /dev/null and b/extend/phpqrcode/cache/mask_3/mask_57_3.dat differ diff --git a/extend/phpqrcode/cache/mask_3/mask_61_3.dat b/extend/phpqrcode/cache/mask_3/mask_61_3.dat new file mode 100644 index 0000000..bf1a3cc --- /dev/null +++ b/extend/phpqrcode/cache/mask_3/mask_61_3.dat @@ -0,0 +1,2 @@ +xA +0fz4-%*dp!yZܫu(~=&ۓ)R2"/"<9FΊ=rb"/rw"2B#3-0-KW \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_3/mask_65_3.dat b/extend/phpqrcode/cache/mask_3/mask_65_3.dat new file mode 100644 index 0000000..8589208 --- /dev/null +++ b/extend/phpqrcode/cache/mask_3/mask_65_3.dat @@ -0,0 +1,2 @@ +xQ + D4\?R ,!O-Nv1:cZu "UMÕF ~jK-la[^q^Q\=o-laZpUB @IKJzɢ|1Í  \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_3/mask_69_3.dat b/extend/phpqrcode/cache/mask_3/mask_69_3.dat new file mode 100644 index 0000000..55318a8 --- /dev/null +++ b/extend/phpqrcode/cache/mask_3/mask_69_3.dat @@ -0,0 +1,2 @@ +x +0 {&2'd l=,Fy;$쇤WE-R:%T,O2g"",Ȣ/DyĈɧ{O䮳",:NvEWN#(&,,]x؅ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_3/mask_73_3.dat b/extend/phpqrcode/cache/mask_3/mask_73_3.dat new file mode 100644 index 0000000..15be77f --- /dev/null +++ b/extend/phpqrcode/cache/mask_3/mask_73_3.dat @@ -0,0 +1,2 @@ +xQ +0 C{g;JJ?dԬK=RasJhTJ6exka\$nIE,-/XB*х=wee4t̒tLщtt߫b gFf qoddn-? \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_3/mask_77_3.dat b/extend/phpqrcode/cache/mask_3/mask_77_3.dat new file mode 100644 index 0000000..ec78280 --- /dev/null +++ b/extend/phpqrcode/cache/mask_3/mask_77_3.dat @@ -0,0 +1,2 @@ +xA +0 &BiRaK"t`I@|fXyilE:Sza18GifK*?:YC1쌞졘(ቷJ*jl*TRIKR^ؙks)c)c)JZa \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_3/mask_81_3.dat b/extend/phpqrcode/cache/mask_3/mask_81_3.dat new file mode 100644 index 0000000..47bc0f7 --- /dev/null +++ b/extend/phpqrcode/cache/mask_3/mask_81_3.dat @@ -0,0 +1,2 @@ +x1 + F=\,JGAġhj>#3X:kԹ\FM Jhu3>TZ{PSgP'kVjժU_ۯUV=P oO:Wҝj[Wxm 5 \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_3/mask_85_3.dat b/extend/phpqrcode/cache/mask_3/mask_85_3.dat new file mode 100644 index 0000000..02c4f8c Binary files /dev/null and b/extend/phpqrcode/cache/mask_3/mask_85_3.dat differ diff --git a/extend/phpqrcode/cache/mask_3/mask_89_3.dat b/extend/phpqrcode/cache/mask_3/mask_89_3.dat new file mode 100644 index 0000000..2b4cb59 --- /dev/null +++ b/extend/phpqrcode/cache/mask_3/mask_89_3.dat @@ -0,0 +1,2 @@ +x1 ὧ) *.@U |eŵ6ۢw5*) oiK4nk>1}d>@ 4XYCo ۡ1<AhFt + 4@51Wr>7G}}x7|NgN \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_3/mask_93_3.dat b/extend/phpqrcode/cache/mask_3/mask_93_3.dat new file mode 100644 index 0000000..b4cc8a9 --- /dev/null +++ b/extend/phpqrcode/cache/mask_3/mask_93_3.dat @@ -0,0 +1,2 @@ +xA +0 D}NrnJɪQ~B06na<<ׇe6MRCP L̓i9M 2 LkŮdDv*"aXjBdAddZTdAdqY0exqeN&WVQvc \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_3/mask_97_3.dat b/extend/phpqrcode/cache/mask_3/mask_97_3.dat new file mode 100644 index 0000000..7adc9eb Binary files /dev/null and b/extend/phpqrcode/cache/mask_3/mask_97_3.dat differ diff --git a/extend/phpqrcode/cache/mask_4/mask_101_4.dat b/extend/phpqrcode/cache/mask_4/mask_101_4.dat new file mode 100644 index 0000000..1c97dc0 --- /dev/null +++ b/extend/phpqrcode/cache/mask_4/mask_101_4.dat @@ -0,0 +1,2 @@ +xA Fs^1bИ]4m+8+Ve^HR]\c +oWN#X+l HEcp \^.9qW9":.BB \0aPǨcp \ONqjpG}}$.˅ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_4/mask_105_4.dat b/extend/phpqrcode/cache/mask_4/mask_105_4.dat new file mode 100644 index 0000000..0211cdb --- /dev/null +++ b/extend/phpqrcode/cache/mask_4/mask_105_4.dat @@ -0,0 +1,2 @@ +xK +0 D=Mr˹A TeEFL2 #鹢_I!딤Ѻ-իkmO]sS T6*'8 N$'NZ^}rU*G9r|c[cN[_=׫5^J 1*qv \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_4/mask_117_4.dat b/extend/phpqrcode/cache/mask_4/mask_117_4.dat new file mode 100644 index 0000000..3867259 --- /dev/null +++ b/extend/phpqrcode/cache/mask_4/mask_117_4.dat @@ -0,0 +1,2 @@ +x + н_s]4Dgn2Jj}ҾRsSWGRɧ)5Em#ܯk_"z3\rʕ+r Lk|/{;'/#\p\p># \p\p#>qp\p.$Iq dGR_4  \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_4/mask_137_4.dat b/extend/phpqrcode/cache/mask_4/mask_137_4.dat new file mode 100644 index 0000000..0c09c48 Binary files /dev/null and b/extend/phpqrcode/cache/mask_4/mask_137_4.dat differ diff --git a/extend/phpqrcode/cache/mask_4/mask_141_4.dat b/extend/phpqrcode/cache/mask_4/mask_141_4.dat new file mode 100644 index 0000000..62b03f2 Binary files /dev/null and b/extend/phpqrcode/cache/mask_4/mask_141_4.dat differ diff --git a/extend/phpqrcode/cache/mask_4/mask_145_4.dat b/extend/phpqrcode/cache/mask_4/mask_145_4.dat new file mode 100644 index 0000000..33fb211 Binary files /dev/null and b/extend/phpqrcode/cache/mask_4/mask_145_4.dat differ diff --git a/extend/phpqrcode/cache/mask_4/mask_149_4.dat b/extend/phpqrcode/cache/mask_4/mask_149_4.dat new file mode 100644 index 0000000..de99310 --- /dev/null +++ b/extend/phpqrcode/cache/mask_4/mask_149_4.dat @@ -0,0 +1,2 @@ +x +!н_sm +XӋ9=.=Zka]ޒ> Kjo |SSWKZm׌j\Ъ2 W\qW\q"~ jvtv_\qW\qW\q%g3 }+++ r9ArW\qW\qŕA g3WA W\qW\qW]V~v{D3Ȝ!\W^Tڍ[S7vۜgq? +{peo383838{YXz,_OYfe3s38383\C!Ms38383r \C?37938383\C!07M8383q,mMrskWv3~W WB \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_4/mask_157_4.dat b/extend/phpqrcode/cache/mask_4/mask_157_4.dat new file mode 100644 index 0000000..ad5fcf6 --- /dev/null +++ b/extend/phpqrcode/cache/mask_4/mask_157_4.dat @@ -0,0 +1 @@ +x10ޯs4"FP=iRX¢X0멪u 4ftl}m➭S|юS P5<]rwqwq^QN6ÏZsߙ,wqwqǝ>Μ5g;;Y}Vgw,wqwqw>9wqwq>3gY;[ww?P3Ƙggt퐮;].3w4A \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_4/mask_161_4.dat b/extend/phpqrcode/cache/mask_4/mask_161_4.dat new file mode 100644 index 0000000..7604c45 --- /dev/null +++ b/extend/phpqrcode/cache/mask_4/mask_161_4.dat @@ -0,0 +1 @@ +xA@ fs!AL_|,4l)iml׉0' +E ]N\x#2/_{7g9쏼ٷ}2r!?}-#Te9C9C9~6Sʇ겺!r!r!ۘse9C9C94_Ɯ|.r!r!s/s0 2r!r8}DwrDXΡ|x|!2 \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_4/mask_165_4.dat b/extend/phpqrcode/cache/mask_4/mask_165_4.dat new file mode 100644 index 0000000..d83d631 --- /dev/null +++ b/extend/phpqrcode/cache/mask_4/mask_165_4.dat @@ -0,0 +1,3 @@ +xA +1 }Or."*?fPLHIkΫZQ8 +Gyqk-n5+?|֎kKnEŹK.K.?2.|EJ{2<:.Ku\K.K.ǝmu)_8\r%\r%\Џ;'2!_8\r%\r%\Џ;'2!_\r%\r%\rinC?nn9 RK.K.;.HqY'ݽNF?K㕢,R| My*3 \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_4/mask_169_4.dat b/extend/phpqrcode/cache/mask_4/mask_169_4.dat new file mode 100644 index 0000000..4aac95c Binary files /dev/null and b/extend/phpqrcode/cache/mask_4/mask_169_4.dat differ diff --git a/extend/phpqrcode/cache/mask_4/mask_173_4.dat b/extend/phpqrcode/cache/mask_4/mask_173_4.dat new file mode 100644 index 0000000..9df4d86 --- /dev/null +++ b/extend/phpqrcode/cache/mask_4/mask_173_4.dat @@ -0,0 +1,2 @@ +xK +1}Nrna ~ZY!Jt^5(/jkz[pj_?~v:|jwՖ_mXzo6?naCe \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_4/mask_81_4.dat b/extend/phpqrcode/cache/mask_4/mask_81_4.dat new file mode 100644 index 0000000..dd65216 --- /dev/null +++ b/extend/phpqrcode/cache/mask_4/mask_81_4.dat @@ -0,0 +1,3 @@ +xA +0 yMyXE m7"892ѸQ1ݳ+xx;t35DIY1x\:u}e/ #Th< +UBz<5G<5{G<5<饫>]Urxu \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_4/mask_85_4.dat b/extend/phpqrcode/cache/mask_4/mask_85_4.dat new file mode 100644 index 0000000..c8d5123 Binary files /dev/null and b/extend/phpqrcode/cache/mask_4/mask_85_4.dat differ diff --git a/extend/phpqrcode/cache/mask_4/mask_89_4.dat b/extend/phpqrcode/cache/mask_4/mask_89_4.dat new file mode 100644 index 0000000..5b9bd7e --- /dev/null +++ b/extend/phpqrcode/cache/mask_4/mask_89_4.dat @@ -0,0 +1,2 @@ +x1 +0 ὧI9%  Vڀfr0}z=#9ҕ:~s1BՁg&4pgq.p.&gT05rgsgqrg捯u38k.Egmb*&7? : \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_4/mask_93_4.dat b/extend/phpqrcode/cache/mask_4/mask_93_4.dat new file mode 100644 index 0000000..be7f5e5 --- /dev/null +++ b/extend/phpqrcode/cache/mask_4/mask_93_4.dat @@ -0,0 +1,2 @@ +xK + ὧIn$}PŌB]N@%sfkҫ}CzoA}aʽ2|~D&l=Ywq}q\EYjK_ywqwz$==;_݋>+pH9Di \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_4/mask_97_4.dat b/extend/phpqrcode/cache/mask_4/mask_97_4.dat new file mode 100644 index 0000000..5d848ca Binary files /dev/null and b/extend/phpqrcode/cache/mask_4/mask_97_4.dat differ diff --git a/extend/phpqrcode/cache/mask_5/mask_101_5.dat b/extend/phpqrcode/cache/mask_5/mask_101_5.dat new file mode 100644 index 0000000..c21869e --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_101_5.dat @@ -0,0 +1,2 @@ +x + E+%=M3Cbv ѬNkûgqkqq{%Oo,iKee3[|iVh]` ` 0ʕz˴T0Gu/q8F13:W>#ȕ0c0Q8E=F#+a X͞+cV%9W>Q]TkY-gLqD艋 \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_105_5.dat b/extend/phpqrcode/cache/mask_5/mask_105_5.dat new file mode 100644 index 0000000..bc8798c Binary files /dev/null and b/extend/phpqrcode/cache/mask_5/mask_105_5.dat differ diff --git a/extend/phpqrcode/cache/mask_5/mask_109_5.dat b/extend/phpqrcode/cache/mask_5/mask_109_5.dat new file mode 100644 index 0000000..25a3944 Binary files /dev/null and b/extend/phpqrcode/cache/mask_5/mask_109_5.dat differ diff --git a/extend/phpqrcode/cache/mask_5/mask_113_5.dat b/extend/phpqrcode/cache/mask_5/mask_113_5.dat new file mode 100644 index 0000000..25f42b8 --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_113_5.dat @@ -0,0 +1,9 @@ +x +0D^6I63[[EDqc+jy81\c +7c?u}DK4},kkg--3[UƂyUXUXSV:ϫ՝,|кS⫰ + + +Vɫ*X[* + + +zU*NV*JUXUXSXijTi4fZkU^_~Ux }ծZ/r \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_117_5.dat b/extend/phpqrcode/cache/mask_5/mask_117_5.dat new file mode 100644 index 0000000..f236940 --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_117_5.dat @@ -0,0 +1 @@ +x D|Mn/*{M+pI_&m-ѾC32u?o-kgB7wc=U%yoRhӯșDo:ֶyRJkQ^aaaqOgiJ ;qOg)ӊ0 0 0 [vö>=>0 0 0 Ofz3=>0 0 0.3Z$׷8\pw4:Zp:qX 7 \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_121_5.dat b/extend/phpqrcode/cache/mask_5/mask_121_5.dat new file mode 100644 index 0000000..9bb5c41 Binary files /dev/null and b/extend/phpqrcode/cache/mask_5/mask_121_5.dat differ diff --git a/extend/phpqrcode/cache/mask_5/mask_125_5.dat b/extend/phpqrcode/cache/mask_5/mask_125_5.dat new file mode 100644 index 0000000..2161c50 --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_125_5.dat @@ -0,0 +1,2 @@ +xA + E&fc;S$?؏Q4YahûyJ}9g==li.;nh_wz.qCWȧy uPk;<<<|*q, mkWqNl% yyyy^2䰅sX|aaaa3ϙ9lH<<<<̿웁[n`Tq8^vy \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_129_5.dat b/extend/phpqrcode/cache/mask_5/mask_129_5.dat new file mode 100644 index 0000000..f0c1d65 Binary files /dev/null and b/extend/phpqrcode/cache/mask_5/mask_129_5.dat differ diff --git a/extend/phpqrcode/cache/mask_5/mask_133_5.dat b/extend/phpqrcode/cache/mask_5/mask_133_5.dat new file mode 100644 index 0000000..46be8b0 --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_133_5.dat @@ -0,0 +1,2 @@ +xA +0 DѽOcr]4%1mCTxΜ[Dv={FEϏq?ݿ9keѭ}'2^c4G:3=JK-F0`#Hw'#<{~Z4 :BG舻F0`G~:`#?#tw-`#?##t#F0r}Q}eR;M/k1mX=hsH"k M:3qOW}9ԖIH1G;- sڶ?[%M + v#;zg^3d}69Ψޙ@7҄#gv`;׳ީ\$wlv`v;ލ}7wߑa;vkA#gv`=N2wxgWӤ@n?c}SQ:Zd?+9vz)P \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_141_5.dat b/extend/phpqrcode/cache/mask_5/mask_141_5.dat new file mode 100644 index 0000000..60c1a8e Binary files /dev/null and b/extend/phpqrcode/cache/mask_5/mask_141_5.dat differ diff --git a/extend/phpqrcode/cache/mask_5/mask_145_5.dat b/extend/phpqrcode/cache/mask_5/mask_145_5.dat new file mode 100644 index 0000000..9303c07 Binary files /dev/null and b/extend/phpqrcode/cache/mask_5/mask_145_5.dat differ diff --git a/extend/phpqrcode/cache/mask_5/mask_149_5.dat b/extend/phpqrcode/cache/mask_5/mask_149_5.dat new file mode 100644 index 0000000..4256cef --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_149_5.dat @@ -0,0 +1,3 @@ +x[ +0&c}-s+'^;Ax=Q_gUݏﵪxGTȺV¹UUE_IǴ;T1̠ +]W 2 2 |o5uꆬuI:(WKU躒rPAdAdA; vo_zNO{2rPA9 2 29}^O挞rwQdAdAnMA9(dAdA^W Z.+G^K`׵}`_Fk \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_153_5.dat b/extend/phpqrcode/cache/mask_5/mask_153_5.dat new file mode 100644 index 0000000..deea09d --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_153_5.dat @@ -0,0 +1,2 @@ +x +@wfЬ`D"Ie<:au,7Of۳uP6~szs,jլcVZvߨm s^uHYu&l&l&_9 ;]^jsO;ܔrSn&l&l9yכzA rSnM6dM6dM6ރ@/$7ܔl&l&lzŽzACrSnM6dM6dOl7ᰚUuN֛FcPPS,l;HO \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_157_5.dat b/extend/phpqrcode/cache/mask_5/mask_157_5.dat new file mode 100644 index 0000000..176e2a6 --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_157_5.dat @@ -0,0 +1 @@ +x10Dާri( r* \~>C*vs]Ŝ_{W!zﶬ/)˙v V6V޻,f1Yb n^o>\O],,b,f1YyVgYYYb,f1+ʳ<˳<˳1YbŬ<+ʳ,,b,f1YyVgYYYb,fukys77}vmb=wsw)tW: \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_161_5.dat b/extend/phpqrcode/cache/mask_5/mask_161_5.dat new file mode 100644 index 0000000..70d5fb0 --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_161_5.dat @@ -0,0 +1,2 @@ +xI +@нDp@ o|m rHk㨤~co^Jzװ#5l¦S_92 [}ZÊ=T2ƀP2[cV衆CYf'-X9>v~usK5`e,2,2,2-///o_q}K\reYfeYf峖o+/,\feYfeYfٳexB.e2,2,̲g+l\r16,2,>ϰ=te&_4=tU}/>>>Or5/u>/g}g}gOsvO}/g}g}ٷGo-w{r_{g}g}g_n=n]4Nkβ_M8m?SF< \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_173_5.dat b/extend/phpqrcode/cache/mask_5/mask_173_5.dat new file mode 100644 index 0000000..f9a6741 --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_173_5.dat @@ -0,0 +1,4 @@ +x[ +0&G1gD)[CzeDѷц=RN6FJm JqP}x s_}GFy; +[;]ek[QbTmy&0 L`̄Y?رw؛ fcVN9&0 L`ׄZ}0=F=F9ANL`&0 L`BzYfI=F9AN&0 L`&0 fIsr ' L`&0 L`<i͒"9AN&0 L`VaBX",Um> +=wZgBΜP !8 \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_177_5.dat b/extend/phpqrcode/cache/mask_5/mask_177_5.dat new file mode 100644 index 0000000..b07c636 --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_177_5.dat @@ -0,0 +1,11 @@ +xъ0~ܾح uO,"% :$Xui=ѶՃgƸ?Ώq.So~z׉W:=h1cq]Ƕi!r8Ɓ`+X +V jj;8ƁX+ +oV`+X +V?[1^h-ֳ5Z;rmS+ +oV`+X +V;Z,YMB+ +V`+X +VZeڦ}r\!W`+X +V`+3Km>SB+ +V`+X +Vc㊛{g;^Qq5ZUݮQL0+*&YDq*6 \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_21_5.dat b/extend/phpqrcode/cache/mask_5/mask_21_5.dat new file mode 100644 index 0000000..04f97ea Binary files /dev/null and b/extend/phpqrcode/cache/mask_5/mask_21_5.dat differ diff --git a/extend/phpqrcode/cache/mask_5/mask_25_5.dat b/extend/phpqrcode/cache/mask_5/mask_25_5.dat new file mode 100644 index 0000000..c20b59b --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_25_5.dat @@ -0,0 +1,2 @@ +xڝa +@!4 ޳ʢ ?,""j?n=GZy:DR \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_33_5.dat b/extend/phpqrcode/cache/mask_5/mask_33_5.dat new file mode 100644 index 0000000..726d7fd Binary files /dev/null and b/extend/phpqrcode/cache/mask_5/mask_33_5.dat differ diff --git a/extend/phpqrcode/cache/mask_5/mask_37_5.dat b/extend/phpqrcode/cache/mask_5/mask_37_5.dat new file mode 100644 index 0000000..6d32ca6 Binary files /dev/null and b/extend/phpqrcode/cache/mask_5/mask_37_5.dat differ diff --git a/extend/phpqrcode/cache/mask_5/mask_41_5.dat b/extend/phpqrcode/cache/mask_5/mask_41_5.dat new file mode 100644 index 0000000..e07c617 --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_41_5.dat @@ -0,0 +1,2 @@ +xTA + 5?7XMtxҴx ?@7@~"N$Sɰ{+CA'r\Pp<ޏ- ͺ:S3sԉۻީz#qw > \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_45_5.dat b/extend/phpqrcode/cache/mask_5/mask_45_5.dat new file mode 100644 index 0000000..5168a17 --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_45_5.dat @@ -0,0 +1 @@ +xUA 5?U:N&Z":;4P1=bNvSGM1˛n'(κ J{Eѵs] ,sq \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_49_5.dat b/extend/phpqrcode/cache/mask_5/mask_49_5.dat new file mode 100644 index 0000000..9f3f3cd Binary files /dev/null and b/extend/phpqrcode/cache/mask_5/mask_49_5.dat differ diff --git a/extend/phpqrcode/cache/mask_5/mask_53_5.dat b/extend/phpqrcode/cache/mask_5/mask_53_5.dat new file mode 100644 index 0000000..449807b --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_53_5.dat @@ -0,0 +1 @@ +xVA " zYf5ƐJC A;l\,dR. \(e_ еaNi5\żaLP(;2שjN6O u+l{y6od^ C[%  \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_57_5.dat b/extend/phpqrcode/cache/mask_5/mask_57_5.dat new file mode 100644 index 0000000..c7dd81f --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_57_5.dat @@ -0,0 +1,2 @@ +xVA + 5?NlZHAbBZ0a Md`1z'"<Ր19nvͨ. )bݻ~;9Z#tB~ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_65_5.dat b/extend/phpqrcode/cache/mask_5/mask_65_5.dat new file mode 100644 index 0000000..ecd9380 Binary files /dev/null and b/extend/phpqrcode/cache/mask_5/mask_65_5.dat differ diff --git a/extend/phpqrcode/cache/mask_5/mask_69_5.dat b/extend/phpqrcode/cache/mask_5/mask_69_5.dat new file mode 100644 index 0000000..ead4edc Binary files /dev/null and b/extend/phpqrcode/cache/mask_5/mask_69_5.dat differ diff --git a/extend/phpqrcode/cache/mask_5/mask_73_5.dat b/extend/phpqrcode/cache/mask_5/mask_73_5.dat new file mode 100644 index 0000000..0000117 Binary files /dev/null and b/extend/phpqrcode/cache/mask_5/mask_73_5.dat differ diff --git a/extend/phpqrcode/cache/mask_5/mask_77_5.dat b/extend/phpqrcode/cache/mask_5/mask_77_5.dat new file mode 100644 index 0000000..1652cdc --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_77_5.dat @@ -0,0 +1 @@ +xQ Cw#&C`T6ƹB(9 'ֆڢzk"hv.` cXB5[(F>71/34Ϊz^'[FyglgM>OTL4ϔ{&3Wy*ʧb*`<3;Vo0/s6n0ya[mcE \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_81_5.dat b/extend/phpqrcode/cache/mask_5/mask_81_5.dat new file mode 100644 index 0000000..71215e9 --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_81_5.dat @@ -0,0 +1,3 @@ +x + C~M?tzU4" }tMX2|.ɋ˙F\~m4Xu +ٔ, w:EƄ>X̯=_]g>>zמ/)5ךkkkZsXXY{ܮ}~mt:S#&;U#) \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_85_5.dat b/extend/phpqrcode/cache/mask_5/mask_85_5.dat new file mode 100644 index 0000000..09cf0e2 Binary files /dev/null and b/extend/phpqrcode/cache/mask_5/mask_85_5.dat differ diff --git a/extend/phpqrcode/cache/mask_5/mask_89_5.dat b/extend/phpqrcode/cache/mask_5/mask_89_5.dat new file mode 100644 index 0000000..5fff530 --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_89_5.dat @@ -0,0 +1,2 @@ +x + 45enpQ Gcfl^^;;b5;`kU͹߮j`NsO=\[a6~nLD? !6uF%w*Ȭkf77SĆbÆXodw_—mbClNۙ ck&YVoܡ׷BעبAl6 Jjx \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_5/mask_93_5.dat b/extend/phpqrcode/cache/mask_5/mask_93_5.dat new file mode 100644 index 0000000..ec4240b --- /dev/null +++ b/extend/phpqrcode/cache/mask_5/mask_93_5.dat @@ -0,0 +1,2 @@ +xK +0 D>&&  fP^8BY5s(imҮ=f3/wۧEyYQwf[} [90303ef̙3'3=,ͼwxDַ.,;s%g,,,=Rὓ7uKKTD<(n lYhV۹sޕyPEtyY]ns ;ss,!LkԅcbL12cX91Z#XEn#;svT~L~LR11vs.1111J1&؍Ń111J1&ƞg KLƪjlk{gڞ5K1/ǐ~,ac$ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_6/mask_105_6.dat b/extend/phpqrcode/cache/mask_6/mask_105_6.dat new file mode 100644 index 0000000..a58fec7 --- /dev/null +++ b/extend/phpqrcode/cache/mask_6/mask_105_6.dat @@ -0,0 +1,3 @@ +xQ +@ DskBZ#o)Sd}Gܷl쯯^)G]S4S?#BZ:+{sHKNiI!me1 +RWe9!``Uyˀu:檞U=w-oԺwB}cMK蹰{{=y蹰{{=y蹰{wScaoi'fyO=CyO=Cy[{S޻=;|v4}ϯ20 \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_6/mask_109_6.dat b/extend/phpqrcode/cache/mask_6/mask_109_6.dat new file mode 100644 index 0000000..be7b474 --- /dev/null +++ b/extend/phpqrcode/cache/mask_6/mask_109_6.dat @@ -0,0 +1 @@ +xA0 ~ρDBHCHV20nuol쯯˻=ۢs9[l'?7R" &2:7QqX_n ]$՚EIY*Lq0 0 0{LJз(s\ɳwX-7^ItIII$~?N0 0 0O'Itg7L$L-Iuzrfr M^'}(O~R]1YLĞu9Qӕ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_6/mask_113_6.dat b/extend/phpqrcode/cache/mask_6/mask_113_6.dat new file mode 100644 index 0000000..397f527 --- /dev/null +++ b/extend/phpqrcode/cache/mask_6/mask_113_6.dat @@ -0,0 +1,3 @@ +x E5NՉbF6on,m>gS9RWcǕ9&%1_cx= GR^w-z?dzv=,}ԥ?ǹژ:9m==@U䲉UXUXVe~by4Wi:e=ɼÆ$<>Ov'Cytaaaa~|'9liΣ<<<<Iæ<:<<<ٕWDzy:.z= ݓʯ sVöE=ll_k0_#vίmj \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_6/mask_129_6.dat b/extend/phpqrcode/cache/mask_6/mask_129_6.dat new file mode 100644 index 0000000..b4695c3 Binary files /dev/null and b/extend/phpqrcode/cache/mask_6/mask_129_6.dat differ diff --git a/extend/phpqrcode/cache/mask_6/mask_133_6.dat b/extend/phpqrcode/cache/mask_6/mask_133_6.dat new file mode 100644 index 0000000..40911dc Binary files /dev/null and b/extend/phpqrcode/cache/mask_6/mask_133_6.dat differ diff --git a/extend/phpqrcode/cache/mask_6/mask_137_6.dat b/extend/phpqrcode/cache/mask_6/mask_137_6.dat new file mode 100644 index 0000000..43ccb68 --- /dev/null +++ b/extend/phpqrcode/cache/mask_6/mask_137_6.dat @@ -0,0 +1,2 @@ +x E5?e^4fHp[1-e)UQV]UWN5o*8|۩W6bk?{f|>s֪r666rҟ=vڲWy -' +Ο;q tQE>U϶f곭xN]Tc(s❮7tAw`v`v`v`kvwfwt;];;;;;!ޙ;ao];l;;;÷| ʷ(3}l.?"މr};\}S-Aw<9;EV'ם \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_6/mask_141_6.dat b/extend/phpqrcode/cache/mask_6/mask_141_6.dat new file mode 100644 index 0000000..0340409 --- /dev/null +++ b/extend/phpqrcode/cache/mask_6/mask_141_6.dat @@ -0,0 +1,10 @@ +xa F4/c]زȐ[=[E럓sm,fn/|kj\j?g[q(NOZc5SGGP[oMVָfvL<WóCaz6U~һ{`nݻdvVy~rZ"qk{>g$XKU}m\bjaGx,f1Yb]z̞^.5[?嬜r,f1YY>grVb,f1Y>g,rVmYb,f,|VY9Yb,f,|VY9+g1Ybً ̦M7>2{9z϶hm3l|9xټ#f#x6 -v%N' \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_6/mask_161_6.dat b/extend/phpqrcode/cache/mask_6/mask_161_6.dat new file mode 100644 index 0000000..ecec68b Binary files /dev/null and b/extend/phpqrcode/cache/mask_6/mask_161_6.dat differ diff --git a/extend/phpqrcode/cache/mask_6/mask_165_6.dat b/extend/phpqrcode/cache/mask_6/mask_165_6.dat new file mode 100644 index 0000000..d641dfa Binary files /dev/null and b/extend/phpqrcode/cache/mask_6/mask_165_6.dat differ diff --git a/extend/phpqrcode/cache/mask_6/mask_169_6.dat b/extend/phpqrcode/cache/mask_6/mask_169_6.dat new file mode 100644 index 0000000..ae68972 --- /dev/null +++ b/extend/phpqrcode/cache/mask_6/mask_169_6.dat @@ -0,0 +1 @@ +xJ0i9[Jɘk{1b!gnhHkS뉭-V?KIׁ1큏1ƣݎ/`/z)*=3ڏg6^k65CY>㵾+'{է_Vˊx-J<ӛܗr_>>i;rO}/g}g}ٿ}}xO}/g}g}ٷGo/{{r_>>o/z^#}g}ٿd'ʳ|QRNS3YڳZ'msEǷj5 \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_6/mask_173_6.dat b/extend/phpqrcode/cache/mask_6/mask_173_6.dat new file mode 100644 index 0000000..95fa97c --- /dev/null +++ b/extend/phpqrcode/cache/mask_6/mask_173_6.dat @@ -0,0 +1 @@ +xa09MrM S*:a_-5hh_)uZ֭[loےsmKN{H?x`l#f9>ڟ[eЄώߓ ?^m*/Kmhy%v-nKlkKL`&& g5(gwxYܞa¬pVcZ[#O=SN9&0 L`DŽ 'tjj]QN9&0 L`sYRc@QN9 L`&0 L`"YRc\ ' r&0 L`EH9AN&0 L`& 7p6`|hms R5Ƙȉ k\X/ )g9 \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_6/mask_177_6.dat b/extend/phpqrcode/cache/mask_6/mask_177_6.dat new file mode 100644 index 0000000..e9f0476 --- /dev/null +++ b/extend/phpqrcode/cache/mask_6/mask_177_6.dat @@ -0,0 +1,14 @@ +xn {ڤ*4v۴u1{f{_,,K9o 4ǵ7lniJiggir<-MG + + + +xuV+zRCr9+Gq6QWb"Qe"WL+ + XXXXX/|~j,nmuMۤ+ + XXXXXYa,X;M+ + XXXXXe)oӘf|5H늚7/D \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_6/mask_21_6.dat b/extend/phpqrcode/cache/mask_6/mask_21_6.dat new file mode 100644 index 0000000..6bd505b --- /dev/null +++ b/extend/phpqrcode/cache/mask_6/mask_21_6.dat @@ -0,0 +1 @@ +xڝQ C9M{i]X1- C!D7 W ٜ&rD)~]<M 3(>{A aS \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_6/mask_25_6.dat b/extend/phpqrcode/cache/mask_6/mask_25_6.dat new file mode 100644 index 0000000..d45083a --- /dev/null +++ b/extend/phpqrcode/cache/mask_6/mask_25_6.dat @@ -0,0 +1 @@ +xڝQA 52)e+(XmZt*(ڹ;tJ<峂_ڤ3oڴ"̢azh}&qvSG֙,-J4}oS[}w \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_6/mask_29_6.dat b/extend/phpqrcode/cache/mask_6/mask_29_6.dat new file mode 100644 index 0000000..0408e22 --- /dev/null +++ b/extend/phpqrcode/cache/mask_6/mask_29_6.dat @@ -0,0 +1,3 @@ +xRA +0 XcL(4EԈB +8Cܾ޳nM+lǝՆO1]&ڍ4UD-6-$:6dZ?ylf? 8?߲_ݏ`8G1`B`;+}&s]<iK'l'9%.7 \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_6/mask_65_6.dat b/extend/phpqrcode/cache/mask_6/mask_65_6.dat new file mode 100644 index 0000000..550fc8f --- /dev/null +++ b/extend/phpqrcode/cache/mask_6/mask_65_6.dat @@ -0,0 +1 @@ +xWQ i{KNLk?e$Qik41{`+!ڮM ? 1b8 .^wsnFj5EaQX|=w@2v<ŋŞ|4w\UXBQz+TTcBz/48,5`ȱ OV$ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_6/mask_69_6.dat b/extend/phpqrcode/cache/mask_6/mask_69_6.dat new file mode 100644 index 0000000..a3e4fa0 --- /dev/null +++ b/extend/phpqrcode/cache/mask_6/mask_69_6.dat @@ -0,0 +1 @@ +xK @dTh hLSSEq eY@<+*|窮 %>z*7e6QS`.>sE '%@[6@P0h aFxtpl2 Q-g1Nfeo^0FdT>N_OwG3ug {3<[Ժ b?'6^ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_6/mask_73_6.dat b/extend/phpqrcode/cache/mask_6/mask_73_6.dat new file mode 100644 index 0000000..ab71b70 Binary files /dev/null and b/extend/phpqrcode/cache/mask_6/mask_73_6.dat differ diff --git a/extend/phpqrcode/cache/mask_6/mask_77_6.dat b/extend/phpqrcode/cache/mask_6/mask_77_6.dat new file mode 100644 index 0000000..ad5a660 --- /dev/null +++ b/extend/phpqrcode/cache/mask_6/mask_77_6.dat @@ -0,0 +1 @@ +x E۲iVa.FpSTY4q~z=:͒ 6m8:#0PضiDy:2Š'Zs&}滜\r0\ŚXw;iPȔL)Seԕ{hDu9LbJSS))gZ{e)qJdLw+#3-V0շljڠS-S 9=ݯ5PPq1M?g \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_6/mask_81_6.dat b/extend/phpqrcode/cache/mask_6/mask_81_6.dat new file mode 100644 index 0000000..28a6d07 --- /dev/null +++ b/extend/phpqrcode/cache/mask_6/mask_81_6.dat @@ -0,0 +1,3 @@ +xQ0D9 rRLvk`0 ;i6\|_cc1huio#2}x*.Yt& +ְq/K;3ve̢ȊAH?`]5Kw!}{Zû߲W +yⷾ^_ykk^Kתb-bYSڸ'֜Nu#MfHSQ?|]IAiMyyuW \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_6/mask_85_6.dat b/extend/phpqrcode/cache/mask_6/mask_85_6.dat new file mode 100644 index 0000000..d5403e4 Binary files /dev/null and b/extend/phpqrcode/cache/mask_6/mask_85_6.dat differ diff --git a/extend/phpqrcode/cache/mask_6/mask_89_6.dat b/extend/phpqrcode/cache/mask_6/mask_89_6.dat new file mode 100644 index 0000000..eeeb5d1 Binary files /dev/null and b/extend/phpqrcode/cache/mask_6/mask_89_6.dat differ diff --git a/extend/phpqrcode/cache/mask_6/mask_93_6.dat b/extend/phpqrcode/cache/mask_6/mask_93_6.dat new file mode 100644 index 0000000..6ff38db Binary files /dev/null and b/extend/phpqrcode/cache/mask_6/mask_93_6.dat differ diff --git a/extend/phpqrcode/cache/mask_6/mask_97_6.dat b/extend/phpqrcode/cache/mask_6/mask_97_6.dat new file mode 100644 index 0000000..3a2072e --- /dev/null +++ b/extend/phpqrcode/cache/mask_6/mask_97_6.dat @@ -0,0 +1,2 @@ +xa0sdFx[=4Hoj34&s}* a Vc&35arW^aLClzq,1x SQN]/Giu`&w%,%DY"Kt+HE'|R2(v1vqiqd,%D~%ػJj}ͺĺgY"Kd,+K +]Wt+sF/)].zN'`>1='#`+bl]Z \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_7/mask_101_7.dat b/extend/phpqrcode/cache/mask_7/mask_101_7.dat new file mode 100644 index 0000000..1f6bc51 --- /dev/null +++ b/extend/phpqrcode/cache/mask_7/mask_101_7.dat @@ -0,0 +1 @@ +xQ C}rm`fjT#54'tfaЇo$cmOJ23c<6Xn0F ) \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_7/mask_105_7.dat b/extend/phpqrcode/cache/mask_7/mask_105_7.dat new file mode 100644 index 0000000..6b0cacf --- /dev/null +++ b/extend/phpqrcode/cache/mask_7/mask_105_7.dat @@ -0,0 +1,2 @@ +xA +0EFaMҙNPx)pQ_~|ñ(bF$.aoWGNPUǖM%{oHQUlִL^>+m#{{eo&Y2soM)gncO9sZ3wo+{=f.zޣ{{=zGcskCQϞp^&{^NʷU e5}EwGn+o \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_7/mask_109_7.dat b/extend/phpqrcode/cache/mask_7/mask_109_7.dat new file mode 100644 index 0000000..9875cbe --- /dev/null +++ b/extend/phpqrcode/cache/mask_7/mask_109_7.dat @@ -0,0 +1,2 @@ +xA +0 D9Mr}* _x-d:"NJ-k"⨚d{ջגɬ|'rQ5+ s)c7-1nn햺qɔJtg^ʉw̘Ň-?*&Mm@ee5^ +c + +,b\13j4TZfŢo* + + +:Ut* + + +Xů0"%6ed 8rS NsUnk5XejުuVXg,l`u!hXZ\VlM|[ͬ0 0 0 #hF'c]i>Hataaa~<ÆzyqkO0 0 0 㪞Faaa)2˰fÒ%z8tO=3=3:cw +V$ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_7/mask_121_7.dat b/extend/phpqrcode/cache/mask_7/mask_121_7.dat new file mode 100644 index 0000000..d5d577f --- /dev/null +++ b/extend/phpqrcode/cache/mask_7/mask_121_7.dat @@ -0,0 +1,2 @@ +x[ + Edi;^az,#6ƞ^rh&^amY9_غ5Cr6t^^WlEز~ɿ|MmmS}( ۰ ۰ ۰}mQ]ZVq]vѲ"M1fG, qBmtaaazeF3cxIDmtaaamný$n۰ ۰ ۰ ۏa[}`[yޖ޻)n<4K/Oslnlm/G \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_7/mask_125_7.dat b/extend/phpqrcode/cache/mask_7/mask_125_7.dat new file mode 100644 index 0000000..f9ec088 Binary files /dev/null and b/extend/phpqrcode/cache/mask_7/mask_125_7.dat differ diff --git a/extend/phpqrcode/cache/mask_7/mask_129_7.dat b/extend/phpqrcode/cache/mask_7/mask_129_7.dat new file mode 100644 index 0000000..9bf51d5 Binary files /dev/null and b/extend/phpqrcode/cache/mask_7/mask_129_7.dat differ diff --git a/extend/phpqrcode/cache/mask_7/mask_133_7.dat b/extend/phpqrcode/cache/mask_7/mask_133_7.dat new file mode 100644 index 0000000..b643ffe Binary files /dev/null and b/extend/phpqrcode/cache/mask_7/mask_133_7.dat differ diff --git a/extend/phpqrcode/cache/mask_7/mask_137_7.dat b/extend/phpqrcode/cache/mask_7/mask_137_7.dat new file mode 100644 index 0000000..11d212b --- /dev/null +++ b/extend/phpqrcode/cache/mask_7/mask_137_7.dat @@ -0,0 +1,5 @@ +x + F4/ c_ǂ+{SK<o[l +Ο +07։Vl;b7fMS;1LCvR|KMH +#Н(Sqd \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_7/mask_141_7.dat b/extend/phpqrcode/cache/mask_7/mask_141_7.dat new file mode 100644 index 0000000..98dffab --- /dev/null +++ b/extend/phpqrcode/cache/mask_7/mask_141_7.dat @@ -0,0 +1 @@ +xA E= rITY@Ä0!|1tbG0ԗѤs2Z/oa\qzOnҋMntX"KmeM}CpPL^S0S0S0SL )ǔژY߾%b,Sl?zC)tLLLLI2zRXh@)tLLLLI1zbϷB)~0S0S0S07)|B)))3ՖL% tfwM*:~hZsnc$1UTtJg8OYE \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_7/mask_145_7.dat b/extend/phpqrcode/cache/mask_7/mask_145_7.dat new file mode 100644 index 0000000..4aa2bac --- /dev/null +++ b/extend/phpqrcode/cache/mask_7/mask_145_7.dat @@ -0,0 +1,2 @@ +x + E5?W6Z-^2qbGX6(Ɖu"LbbGuμGk:HwA[jmHݞ3OkQ{l|TEm JfL?2"&)kRfc̉F,z=5X5X5X7F\pUs#5X5X5XFdYk!a ` ` `o8ct ]CC gM5[N%khZp?Iܣϲ^n$Y7AZP[ fȓ0 \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_7/mask_149_7.dat b/extend/phpqrcode/cache/mask_7/mask_149_7.dat new file mode 100644 index 0000000..809f005 --- /dev/null +++ b/extend/phpqrcode/cache/mask_7/mask_149_7.dat @@ -0,0 +1 @@ +xn {? uچ2G$ncFKb3֪tPc ̥7[?9:['9'*Ӗ Gah_/z+6XB>2qYJ0黏Bfa 1 9c7G Ol,^꽓3A:H  1A b0X4%٫#d>&C  1A b+g嬜,f1Yb|Y>+g嬜,f1Ylio.\Ɲo=gϙ-yk_TA \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_7/mask_161_7.dat b/extend/phpqrcode/cache/mask_7/mask_161_7.dat new file mode 100644 index 0000000..35ba8ff --- /dev/null +++ b/extend/phpqrcode/cache/mask_7/mask_161_7.dat @@ -0,0 +1 @@ +xю y/皨E)Ʈ1~493,˵+ZT=ZeC.~iߏ&>,6e~,lW] 2\;׵2j"e,rXݵV(c쵵ZӖ18ީ/,'t.ee,cX2߱,_|yt|]t.cX2e,cy/ɗys.eLe,cX2lo|Z{+2]bl,cX2e{+֊[A2]X2e,c9CX;QIQH8R҈G"z,&;'o97%P8%6oǽ;]NWn[f7v \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_7/mask_29_7.dat b/extend/phpqrcode/cache/mask_7/mask_29_7.dat new file mode 100644 index 0000000..e3d7391 --- /dev/null +++ b/extend/phpqrcode/cache/mask_7/mask_29_7.dat @@ -0,0 +1,2 @@ +xR9 QpX$lŲf!I2pgSMZj"te0#ԛ`_1-cha~/Eh4"~ \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_7/mask_37_7.dat b/extend/phpqrcode/cache/mask_7/mask_37_7.dat new file mode 100644 index 0000000..87d9a1a Binary files /dev/null and b/extend/phpqrcode/cache/mask_7/mask_37_7.dat differ diff --git a/extend/phpqrcode/cache/mask_7/mask_41_7.dat b/extend/phpqrcode/cache/mask_7/mask_41_7.dat new file mode 100644 index 0000000..8acec04 --- /dev/null +++ b/extend/phpqrcode/cache/mask_7/mask_41_7.dat @@ -0,0 +1 @@ +xTA 5[fDY(O^bR3/~t/L"7SQQ5j\Sib#Նȏ+ǣw#zx?㽧A-wu曑Y7$b.%A;wRoxG}? \ No newline at end of file diff --git a/extend/phpqrcode/cache/mask_7/mask_45_7.dat b/extend/phpqrcode/cache/mask_7/mask_45_7.dat new file mode 100644 index 0000000..dbba31d Binary files /dev/null and b/extend/phpqrcode/cache/mask_7/mask_45_7.dat differ diff --git a/extend/phpqrcode/cache/mask_7/mask_49_7.dat b/extend/phpqrcode/cache/mask_7/mask_49_7.dat new file mode 100644 index 0000000..be5dce8 --- /dev/null +++ b/extend/phpqrcode/cache/mask_7/mask_49_7.dat @@ -0,0 +1 @@ +xV0khC-X.ukv o40T%96U5*sI{`_>S?}(:yTl{G&E\6}"AX XϬback'); + + // user data + $filename = $PNG_TEMP_DIR.'test'.md5($_REQUEST['data'].'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png'; + QRcode::png($_REQUEST['data'], $filename, $errorCorrectionLevel, $matrixPointSize, 2); + + } else { + + //default data + echo 'You can provide data in GET parameter: like that
'; + QRcode::png('PHP QR Code :)', $filename, $errorCorrectionLevel, $matrixPointSize, 2); + + } + + //display generated file + echo '
'; + + //config form + echo '
+ Data:   + ECC:   + Size:   +

'; + + // benchmark + QRtools::timeBenchmark(); + + \ No newline at end of file diff --git a/extend/phpqrcode/phpqrcode.php b/extend/phpqrcode/phpqrcode.php new file mode 100644 index 0000000..1c962fa --- /dev/null +++ b/extend/phpqrcode/phpqrcode.php @@ -0,0 +1,3319 @@ + + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + + +/* + * Version: 1.1.4 + * Build: 2010100721 + */ + + + +//---- qrconst.php ----------------------------- + + + + + +/* + * PHP QR Code encoder + * + * Common constants + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + // Encoding modes + + define('QR_MODE_NUL', -1); + define('QR_MODE_NUM', 0); + define('QR_MODE_AN', 1); + define('QR_MODE_8', 2); + define('QR_MODE_KANJI', 3); + define('QR_MODE_STRUCTURE', 4); + + // Levels of error correction. + + define('QR_ECLEVEL_L', 0); + define('QR_ECLEVEL_M', 1); + define('QR_ECLEVEL_Q', 2); + define('QR_ECLEVEL_H', 3); + + // Supported output formats + + define('QR_FORMAT_TEXT', 0); + define('QR_FORMAT_PNG', 1); + + class qrstr { + public static function set(&$srctab, $x, $y, $repl, $replLen = false) { + $srctab[$y] = substr_replace($srctab[$y], ($replLen !== false)?substr($repl,0,$replLen):$repl, $x, ($replLen !== false)?$replLen:strlen($repl)); + } + } + + + +//---- merged_config.php ----------------------------- + + + + +/* + * PHP QR Code encoder + * + * Config file, tuned-up for merged verion + */ + + define('QR_CACHEABLE', false); // use cache - more disk reads but less CPU power, masks and format templates are stored there + define('QR_CACHE_DIR', false); // used when QR_CACHEABLE === true + define('QR_LOG_DIR', false); // default error logs dir + + define('QR_FIND_BEST_MASK', true); // if true, estimates best mask (spec. default, but extremally slow; set to false to significant performance boost but (propably) worst quality code + define('QR_FIND_FROM_RANDOM', 2); // if false, checks all masks available, otherwise value tells count of masks need to be checked, mask id are got randomly + define('QR_DEFAULT_MASK', 2); // when QR_FIND_BEST_MASK === false + + define('QR_PNG_MAXIMUM_SIZE', 1024); // maximum allowed png image width (in pixels), tune to make sure GD and PHP can handle such big images + + + + +//---- qrtools.php ----------------------------- + + + + +/* + * PHP QR Code encoder + * + * Toolset, handy and debug utilites. + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + class QRtools { + + //---------------------------------------------------------------------- + public static function binarize($frame) + { + $len = count($frame); + foreach ($frame as &$frameLine) { + + for($i=0; $i<$len; $i++) { + $frameLine[$i] = (ord($frameLine[$i])&1)?'1':'0'; + } + } + + return $frame; + } + + //---------------------------------------------------------------------- + public static function tcpdfBarcodeArray($code, $mode = 'QR,L', $tcPdfVersion = '4.5.037') + { + $barcode_array = array(); + + if (!is_array($mode)) + $mode = explode(',', $mode); + + $eccLevel = 'L'; + + if (count($mode) > 1) { + $eccLevel = $mode[1]; + } + + $qrTab = QRcode::text($code, false, $eccLevel); + $size = count($qrTab); + + $barcode_array['num_rows'] = $size; + $barcode_array['num_cols'] = $size; + $barcode_array['bcode'] = array(); + + foreach ($qrTab as $line) { + $arrAdd = array(); + foreach(str_split($line) as $char) + $arrAdd[] = ($char=='1')?1:0; + $barcode_array['bcode'][] = $arrAdd; + } + + return $barcode_array; + } + + //---------------------------------------------------------------------- + public static function clearCache() + { + self::$frames = array(); + } + + //---------------------------------------------------------------------- + public static function buildCache() + { + QRtools::markTime('before_build_cache'); + + $mask = new QRmask(); + for ($a=1; $a <= QRSPEC_VERSION_MAX; $a++) { + $frame = QRspec::newFrame($a); + if (QR_IMAGE) { + $fileName = QR_CACHE_DIR.'frame_'.$a.'.png'; + QRimage::png(self::binarize($frame), $fileName, 1, 0); + } + + $width = count($frame); + $bitMask = array_fill(0, $width, array_fill(0, $width, 0)); + for ($maskNo=0; $maskNo<8; $maskNo++) + $mask->makeMaskNo($maskNo, $width, $frame, $bitMask, true); + } + + QRtools::markTime('after_build_cache'); + } + + //---------------------------------------------------------------------- + public static function log($outfile, $err) + { + if (QR_LOG_DIR !== false) { + if ($err != '') { + if ($outfile !== false) { + file_put_contents(QR_LOG_DIR.basename($outfile).'-errors.txt', date('Y-m-d H:i:s').': '.$err, FILE_APPEND); + } else { + file_put_contents(QR_LOG_DIR.'errors.txt', date('Y-m-d H:i:s').': '.$err, FILE_APPEND); + } + } + } + } + + //---------------------------------------------------------------------- + public static function dumpMask($frame) + { + $width = count($frame); + for($y=0;$y<$width;$y++) { + for($x=0;$x<$width;$x++) { + echo ord($frame[$y][$x]).','; + } + } + } + + //---------------------------------------------------------------------- + public static function markTime($markerId) + { + list($usec, $sec) = explode(" ", microtime()); + $time = ((float)$usec + (float)$sec); + + if (!isset($GLOBALS['qr_time_bench'])) + $GLOBALS['qr_time_bench'] = array(); + + $GLOBALS['qr_time_bench'][$markerId] = $time; + } + + //---------------------------------------------------------------------- + public static function timeBenchmark() + { + self::markTime('finish'); + + $lastTime = 0; + $startTime = 0; + $p = 0; + + echo ' + + '; + + foreach($GLOBALS['qr_time_bench'] as $markerId=>$thisTime) { + if ($p > 0) { + echo ''; + } else { + $startTime = $thisTime; + } + + $p++; + $lastTime = $thisTime; + } + + echo ' + + +
BENCHMARK
till '.$markerId.': '.number_format($thisTime-$lastTime, 6).'s
TOTAL: '.number_format($lastTime-$startTime, 6).'s
'; + } + + } + + //########################################################################## + + QRtools::markTime('start'); + + + + +//---- qrspec.php ----------------------------- + + + + +/* + * PHP QR Code encoder + * + * QR Code specifications + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * The following data / specifications are taken from + * "Two dimensional symbol -- QR-code -- Basic Specification" (JIS X0510:2004) + * or + * "Automatic identification and data capture techniques -- + * QR Code 2005 bar code symbology specification" (ISO/IEC 18004:2006) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + define('QRSPEC_VERSION_MAX', 40); + define('QRSPEC_WIDTH_MAX', 177); + + define('QRCAP_WIDTH', 0); + define('QRCAP_WORDS', 1); + define('QRCAP_REMINDER', 2); + define('QRCAP_EC', 3); + + class QRspec { + + public static $capacity = array( + array( 0, 0, 0, array( 0, 0, 0, 0)), + array( 21, 26, 0, array( 7, 10, 13, 17)), // 1 + array( 25, 44, 7, array( 10, 16, 22, 28)), + array( 29, 70, 7, array( 15, 26, 36, 44)), + array( 33, 100, 7, array( 20, 36, 52, 64)), + array( 37, 134, 7, array( 26, 48, 72, 88)), // 5 + array( 41, 172, 7, array( 36, 64, 96, 112)), + array( 45, 196, 0, array( 40, 72, 108, 130)), + array( 49, 242, 0, array( 48, 88, 132, 156)), + array( 53, 292, 0, array( 60, 110, 160, 192)), + array( 57, 346, 0, array( 72, 130, 192, 224)), //10 + array( 61, 404, 0, array( 80, 150, 224, 264)), + array( 65, 466, 0, array( 96, 176, 260, 308)), + array( 69, 532, 0, array( 104, 198, 288, 352)), + array( 73, 581, 3, array( 120, 216, 320, 384)), + array( 77, 655, 3, array( 132, 240, 360, 432)), //15 + array( 81, 733, 3, array( 144, 280, 408, 480)), + array( 85, 815, 3, array( 168, 308, 448, 532)), + array( 89, 901, 3, array( 180, 338, 504, 588)), + array( 93, 991, 3, array( 196, 364, 546, 650)), + array( 97, 1085, 3, array( 224, 416, 600, 700)), //20 + array(101, 1156, 4, array( 224, 442, 644, 750)), + array(105, 1258, 4, array( 252, 476, 690, 816)), + array(109, 1364, 4, array( 270, 504, 750, 900)), + array(113, 1474, 4, array( 300, 560, 810, 960)), + array(117, 1588, 4, array( 312, 588, 870, 1050)), //25 + array(121, 1706, 4, array( 336, 644, 952, 1110)), + array(125, 1828, 4, array( 360, 700, 1020, 1200)), + array(129, 1921, 3, array( 390, 728, 1050, 1260)), + array(133, 2051, 3, array( 420, 784, 1140, 1350)), + array(137, 2185, 3, array( 450, 812, 1200, 1440)), //30 + array(141, 2323, 3, array( 480, 868, 1290, 1530)), + array(145, 2465, 3, array( 510, 924, 1350, 1620)), + array(149, 2611, 3, array( 540, 980, 1440, 1710)), + array(153, 2761, 3, array( 570, 1036, 1530, 1800)), + array(157, 2876, 0, array( 570, 1064, 1590, 1890)), //35 + array(161, 3034, 0, array( 600, 1120, 1680, 1980)), + array(165, 3196, 0, array( 630, 1204, 1770, 2100)), + array(169, 3362, 0, array( 660, 1260, 1860, 2220)), + array(173, 3532, 0, array( 720, 1316, 1950, 2310)), + array(177, 3706, 0, array( 750, 1372, 2040, 2430)) //40 + ); + + //---------------------------------------------------------------------- + public static function getDataLength($version, $level) + { + return self::$capacity[$version][QRCAP_WORDS] - self::$capacity[$version][QRCAP_EC][$level]; + } + + //---------------------------------------------------------------------- + public static function getECCLength($version, $level) + { + return self::$capacity[$version][QRCAP_EC][$level]; + } + + //---------------------------------------------------------------------- + public static function getWidth($version) + { + return self::$capacity[$version][QRCAP_WIDTH]; + } + + //---------------------------------------------------------------------- + public static function getRemainder($version) + { + return self::$capacity[$version][QRCAP_REMINDER]; + } + + //---------------------------------------------------------------------- + public static function getMinimumVersion($size, $level) + { + + for($i=1; $i<= QRSPEC_VERSION_MAX; $i++) { + $words = self::$capacity[$i][QRCAP_WORDS] - self::$capacity[$i][QRCAP_EC][$level]; + if($words >= $size) + return $i; + } + + return -1; + } + + //###################################################################### + + public static $lengthTableBits = array( + array(10, 12, 14), + array( 9, 11, 13), + array( 8, 16, 16), + array( 8, 10, 12) + ); + + //---------------------------------------------------------------------- + public static function lengthIndicator($mode, $version) + { + if ($mode == QR_MODE_STRUCTURE) + return 0; + + if ($version <= 9) { + $l = 0; + } else if ($version <= 26) { + $l = 1; + } else { + $l = 2; + } + + return self::$lengthTableBits[$mode][$l]; + } + + //---------------------------------------------------------------------- + public static function maximumWords($mode, $version) + { + if($mode == QR_MODE_STRUCTURE) + return 3; + + if($version <= 9) { + $l = 0; + } else if($version <= 26) { + $l = 1; + } else { + $l = 2; + } + + $bits = self::$lengthTableBits[$mode][$l]; + $words = (1 << $bits) - 1; + + if($mode == QR_MODE_KANJI) { + $words *= 2; // the number of bytes is required + } + + return $words; + } + + // Error correction code ----------------------------------------------- + // Table of the error correction code (Reed-Solomon block) + // See Table 12-16 (pp.30-36), JIS X0510:2004. + + public static $eccTable = array( + array(array( 0, 0), array( 0, 0), array( 0, 0), array( 0, 0)), + array(array( 1, 0), array( 1, 0), array( 1, 0), array( 1, 0)), // 1 + array(array( 1, 0), array( 1, 0), array( 1, 0), array( 1, 0)), + array(array( 1, 0), array( 1, 0), array( 2, 0), array( 2, 0)), + array(array( 1, 0), array( 2, 0), array( 2, 0), array( 4, 0)), + array(array( 1, 0), array( 2, 0), array( 2, 2), array( 2, 2)), // 5 + array(array( 2, 0), array( 4, 0), array( 4, 0), array( 4, 0)), + array(array( 2, 0), array( 4, 0), array( 2, 4), array( 4, 1)), + array(array( 2, 0), array( 2, 2), array( 4, 2), array( 4, 2)), + array(array( 2, 0), array( 3, 2), array( 4, 4), array( 4, 4)), + array(array( 2, 2), array( 4, 1), array( 6, 2), array( 6, 2)), //10 + array(array( 4, 0), array( 1, 4), array( 4, 4), array( 3, 8)), + array(array( 2, 2), array( 6, 2), array( 4, 6), array( 7, 4)), + array(array( 4, 0), array( 8, 1), array( 8, 4), array(12, 4)), + array(array( 3, 1), array( 4, 5), array(11, 5), array(11, 5)), + array(array( 5, 1), array( 5, 5), array( 5, 7), array(11, 7)), //15 + array(array( 5, 1), array( 7, 3), array(15, 2), array( 3, 13)), + array(array( 1, 5), array(10, 1), array( 1, 15), array( 2, 17)), + array(array( 5, 1), array( 9, 4), array(17, 1), array( 2, 19)), + array(array( 3, 4), array( 3, 11), array(17, 4), array( 9, 16)), + array(array( 3, 5), array( 3, 13), array(15, 5), array(15, 10)), //20 + array(array( 4, 4), array(17, 0), array(17, 6), array(19, 6)), + array(array( 2, 7), array(17, 0), array( 7, 16), array(34, 0)), + array(array( 4, 5), array( 4, 14), array(11, 14), array(16, 14)), + array(array( 6, 4), array( 6, 14), array(11, 16), array(30, 2)), + array(array( 8, 4), array( 8, 13), array( 7, 22), array(22, 13)), //25 + array(array(10, 2), array(19, 4), array(28, 6), array(33, 4)), + array(array( 8, 4), array(22, 3), array( 8, 26), array(12, 28)), + array(array( 3, 10), array( 3, 23), array( 4, 31), array(11, 31)), + array(array( 7, 7), array(21, 7), array( 1, 37), array(19, 26)), + array(array( 5, 10), array(19, 10), array(15, 25), array(23, 25)), //30 + array(array(13, 3), array( 2, 29), array(42, 1), array(23, 28)), + array(array(17, 0), array(10, 23), array(10, 35), array(19, 35)), + array(array(17, 1), array(14, 21), array(29, 19), array(11, 46)), + array(array(13, 6), array(14, 23), array(44, 7), array(59, 1)), + array(array(12, 7), array(12, 26), array(39, 14), array(22, 41)), //35 + array(array( 6, 14), array( 6, 34), array(46, 10), array( 2, 64)), + array(array(17, 4), array(29, 14), array(49, 10), array(24, 46)), + array(array( 4, 18), array(13, 32), array(48, 14), array(42, 32)), + array(array(20, 4), array(40, 7), array(43, 22), array(10, 67)), + array(array(19, 6), array(18, 31), array(34, 34), array(20, 61)),//40 + ); + + //---------------------------------------------------------------------- + // CACHEABLE!!! + + public static function getEccSpec($version, $level, array &$spec) + { + if (count($spec) < 5) { + $spec = array(0,0,0,0,0); + } + + $b1 = self::$eccTable[$version][$level][0]; + $b2 = self::$eccTable[$version][$level][1]; + $data = self::getDataLength($version, $level); + $ecc = self::getECCLength($version, $level); + + if($b2 == 0) { + $spec[0] = $b1; + $spec[1] = (int)($data / $b1); + $spec[2] = (int)($ecc / $b1); + $spec[3] = 0; + $spec[4] = 0; + } else { + $spec[0] = $b1; + $spec[1] = (int)($data / ($b1 + $b2)); + $spec[2] = (int)($ecc / ($b1 + $b2)); + $spec[3] = $b2; + $spec[4] = $spec[1] + 1; + } + } + + // Alignment pattern --------------------------------------------------- + + // Positions of alignment patterns. + // This array includes only the second and the third position of the + // alignment patterns. Rest of them can be calculated from the distance + // between them. + + // See Table 1 in Appendix E (pp.71) of JIS X0510:2004. + + public static $alignmentPattern = array( + array( 0, 0), + array( 0, 0), array(18, 0), array(22, 0), array(26, 0), array(30, 0), // 1- 5 + array(34, 0), array(22, 38), array(24, 42), array(26, 46), array(28, 50), // 6-10 + array(30, 54), array(32, 58), array(34, 62), array(26, 46), array(26, 48), //11-15 + array(26, 50), array(30, 54), array(30, 56), array(30, 58), array(34, 62), //16-20 + array(28, 50), array(26, 50), array(30, 54), array(28, 54), array(32, 58), //21-25 + array(30, 58), array(34, 62), array(26, 50), array(30, 54), array(26, 52), //26-30 + array(30, 56), array(34, 60), array(30, 58), array(34, 62), array(30, 54), //31-35 + array(24, 50), array(28, 54), array(32, 58), array(26, 54), array(30, 58), //35-40 + ); + + + /** -------------------------------------------------------------------- + * Put an alignment marker. + * @param frame + * @param width + * @param ox,oy center coordinate of the pattern + */ + public static function putAlignmentMarker(array &$frame, $ox, $oy) + { + $finder = array( + "\xa1\xa1\xa1\xa1\xa1", + "\xa1\xa0\xa0\xa0\xa1", + "\xa1\xa0\xa1\xa0\xa1", + "\xa1\xa0\xa0\xa0\xa1", + "\xa1\xa1\xa1\xa1\xa1" + ); + + $yStart = $oy-2; + $xStart = $ox-2; + + for($y=0; $y<5; $y++) { + QRstr::set($frame, $xStart, $yStart+$y, $finder[$y]); + } + } + + //---------------------------------------------------------------------- + public static function putAlignmentPattern($version, &$frame, $width) + { + if($version < 2) + return; + + $d = self::$alignmentPattern[$version][1] - self::$alignmentPattern[$version][0]; + if($d < 0) { + $w = 2; + } else { + $w = (int)(($width - self::$alignmentPattern[$version][0]) / $d + 2); + } + + if($w * $w - 3 == 1) { + $x = self::$alignmentPattern[$version][0]; + $y = self::$alignmentPattern[$version][0]; + self::putAlignmentMarker($frame, $x, $y); + return; + } + + $cx = self::$alignmentPattern[$version][0]; + for($x=1; $x<$w - 1; $x++) { + self::putAlignmentMarker($frame, 6, $cx); + self::putAlignmentMarker($frame, $cx, 6); + $cx += $d; + } + + $cy = self::$alignmentPattern[$version][0]; + for($y=0; $y<$w-1; $y++) { + $cx = self::$alignmentPattern[$version][0]; + for($x=0; $x<$w-1; $x++) { + self::putAlignmentMarker($frame, $cx, $cy); + $cx += $d; + } + $cy += $d; + } + } + + // Version information pattern ----------------------------------------- + + // Version information pattern (BCH coded). + // See Table 1 in Appendix D (pp.68) of JIS X0510:2004. + + // size: [QRSPEC_VERSION_MAX - 6] + + public static $versionPattern = array( + 0x07c94, 0x085bc, 0x09a99, 0x0a4d3, 0x0bbf6, 0x0c762, 0x0d847, 0x0e60d, + 0x0f928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, 0x168c9, + 0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, 0x1ed75, + 0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, 0x26a64, + 0x27541, 0x28c69 + ); + + //---------------------------------------------------------------------- + public static function getVersionPattern($version) + { + if($version < 7 || $version > QRSPEC_VERSION_MAX) + return 0; + + return self::$versionPattern[$version -7]; + } + + // Format information -------------------------------------------------- + // See calcFormatInfo in tests/test_qrspec.c (orginal qrencode c lib) + + public static $formatInfo = array( + array(0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976), + array(0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0), + array(0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed), + array(0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b) + ); + + public static function getFormatInfo($mask, $level) + { + if($mask < 0 || $mask > 7) + return 0; + + if($level < 0 || $level > 3) + return 0; + + return self::$formatInfo[$level][$mask]; + } + + // Frame --------------------------------------------------------------- + // Cache of initial frames. + + public static $frames = array(); + + /** -------------------------------------------------------------------- + * Put a finder pattern. + * @param frame + * @param width + * @param ox,oy upper-left coordinate of the pattern + */ + public static function putFinderPattern(&$frame, $ox, $oy) + { + $finder = array( + "\xc1\xc1\xc1\xc1\xc1\xc1\xc1", + "\xc1\xc0\xc0\xc0\xc0\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc0\xc0\xc0\xc0\xc1", + "\xc1\xc1\xc1\xc1\xc1\xc1\xc1" + ); + + for($y=0; $y<7; $y++) { + QRstr::set($frame, $ox, $oy+$y, $finder[$y]); + } + } + + //---------------------------------------------------------------------- + public static function createFrame($version) + { + $width = self::$capacity[$version][QRCAP_WIDTH]; + $frameLine = str_repeat ("\0", $width); + $frame = array_fill(0, $width, $frameLine); + + // Finder pattern + self::putFinderPattern($frame, 0, 0); + self::putFinderPattern($frame, $width - 7, 0); + self::putFinderPattern($frame, 0, $width - 7); + + // Separator + $yOffset = $width - 7; + + for($y=0; $y<7; $y++) { + $frame[$y][7] = "\xc0"; + $frame[$y][$width - 8] = "\xc0"; + $frame[$yOffset][7] = "\xc0"; + $yOffset++; + } + + $setPattern = str_repeat("\xc0", 8); + + QRstr::set($frame, 0, 7, $setPattern); + QRstr::set($frame, $width-8, 7, $setPattern); + QRstr::set($frame, 0, $width - 8, $setPattern); + + // Format info + $setPattern = str_repeat("\x84", 9); + QRstr::set($frame, 0, 8, $setPattern); + QRstr::set($frame, $width - 8, 8, $setPattern, 8); + + $yOffset = $width - 8; + + for($y=0; $y<8; $y++,$yOffset++) { + $frame[$y][8] = "\x84"; + $frame[$yOffset][8] = "\x84"; + } + + // Timing pattern + + for($i=1; $i<$width-15; $i++) { + $frame[6][7+$i] = chr(0x90 | ($i & 1)); + $frame[7+$i][6] = chr(0x90 | ($i & 1)); + } + + // Alignment pattern + self::putAlignmentPattern($version, $frame, $width); + + // Version information + if($version >= 7) { + $vinf = self::getVersionPattern($version); + + $v = $vinf; + + for($x=0; $x<6; $x++) { + for($y=0; $y<3; $y++) { + $frame[($width - 11)+$y][$x] = chr(0x88 | ($v & 1)); + $v = $v >> 1; + } + } + + $v = $vinf; + for($y=0; $y<6; $y++) { + for($x=0; $x<3; $x++) { + $frame[$y][$x+($width - 11)] = chr(0x88 | ($v & 1)); + $v = $v >> 1; + } + } + } + + // and a little bit... + $frame[$width - 8][8] = "\x81"; + + return $frame; + } + + //---------------------------------------------------------------------- + public static function debug($frame, $binary_mode = false) + { + if ($binary_mode) { + + foreach ($frame as &$frameLine) { + $frameLine = join('  ', explode('0', $frameLine)); + $frameLine = join('██', explode('1', $frameLine)); + } + + ?> + +


        '; + echo join("
        ", $frame); + echo '






'; + + } else { + + foreach ($frame as &$frameLine) { + $frameLine = join(' ', explode("\xc0", $frameLine)); + $frameLine = join('', explode("\xc1", $frameLine)); + $frameLine = join(' ', explode("\xa0", $frameLine)); + $frameLine = join('', explode("\xa1", $frameLine)); + $frameLine = join('', explode("\x84", $frameLine)); //format 0 + $frameLine = join('', explode("\x85", $frameLine)); //format 1 + $frameLine = join('', explode("\x81", $frameLine)); //special bit + $frameLine = join(' ', explode("\x90", $frameLine)); //clock 0 + $frameLine = join('', explode("\x91", $frameLine)); //clock 1 + $frameLine = join(' ', explode("\x88", $frameLine)); //version + $frameLine = join('', explode("\x89", $frameLine)); //version + $frameLine = join('♦', explode("\x01", $frameLine)); + $frameLine = join('⋅', explode("\0", $frameLine)); + } + + ?> + + "; + echo join("
", $frame); + echo "
"; + + } + } + + //---------------------------------------------------------------------- + public static function serial($frame) + { + return gzcompress(join("\n", $frame), 9); + } + + //---------------------------------------------------------------------- + public static function unserial($code) + { + return explode("\n", gzuncompress($code)); + } + + //---------------------------------------------------------------------- + public static function newFrame($version) + { + if($version < 1 || $version > QRSPEC_VERSION_MAX) + return null; + + if(!isset(self::$frames[$version])) { + + $fileName = QR_CACHE_DIR.'frame_'.$version.'.dat'; + + if (QR_CACHEABLE) { + if (file_exists($fileName)) { + self::$frames[$version] = self::unserial(file_get_contents($fileName)); + } else { + self::$frames[$version] = self::createFrame($version); + file_put_contents($fileName, self::serial(self::$frames[$version])); + } + } else { + self::$frames[$version] = self::createFrame($version); + } + } + + if(is_null(self::$frames[$version])) + return null; + + return self::$frames[$version]; + } + + //---------------------------------------------------------------------- + public static function rsBlockNum($spec) { return $spec[0] + $spec[3]; } + public static function rsBlockNum1($spec) { return $spec[0]; } + public static function rsDataCodes1($spec) { return $spec[1]; } + public static function rsEccCodes1($spec) { return $spec[2]; } + public static function rsBlockNum2($spec) { return $spec[3]; } + public static function rsDataCodes2($spec) { return $spec[4]; } + public static function rsEccCodes2($spec) { return $spec[2]; } + public static function rsDataLength($spec) { return ($spec[0] * $spec[1]) + ($spec[3] * $spec[4]); } + public static function rsEccLength($spec) { return ($spec[0] + $spec[3]) * $spec[2]; } + + } + + + +//---- qrimage.php ----------------------------- + + + + +/* + * PHP QR Code encoder + * + * Image output of code using GD2 + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + define('QR_IMAGE', true); + + class QRimage { + + //---------------------------------------------------------------------- + public static function png($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4,$saveandprint=FALSE) + { + + + $image = self::image($frame, $pixelPerPoint, $outerFrame); + + if ($filename === false) { + // Header("Content-type: image/png"); + ImagePng($image); + } else { + + if($saveandprint===TRUE){ + ImagePng($image, $filename); + header("Content-type: image/png"); + ImagePng($image); + }else{ + + ImagePng($image, $filename); + + + } + } + + ImageDestroy($image); + } + + //---------------------------------------------------------------------- + public static function jpg($frame, $filename = false, $pixelPerPoint = 8, $outerFrame = 4, $q = 85) + { + $image = self::image($frame, $pixelPerPoint, $outerFrame); + + if ($filename === false) { + Header("Content-type: image/jpeg"); + ImageJpeg($image, null, $q); + } else { + ImageJpeg($image, $filename, $q); + } + + ImageDestroy($image); + } + + //---------------------------------------------------------------------- + private static function image($frame, $pixelPerPoint = 4, $outerFrame = 4) + { + $h = count($frame); + $w = strlen($frame[0]); + + $imgW = $w + 2*$outerFrame; + $imgH = $h + 2*$outerFrame; + + $base_image =ImageCreate($imgW, $imgH); + + $col[0] = ImageColorAllocate($base_image,255,255,255); + $col[1] = ImageColorAllocate($base_image,0,0,0); + + imagefill($base_image, 0, 0, $col[0]); + + for($y=0; $y<$h; $y++) { + for($x=0; $x<$w; $x++) { + if ($frame[$y][$x] == '1') { + ImageSetPixel($base_image,$x+$outerFrame,$y+$outerFrame,$col[1]); + } + } + } + + $target_image =ImageCreate($imgW * $pixelPerPoint, $imgH * $pixelPerPoint); + ImageCopyResized($target_image, $base_image, 0, 0, 0, 0, $imgW * $pixelPerPoint, $imgH * $pixelPerPoint, $imgW, $imgH); + ImageDestroy($base_image); + + return $target_image; + } + } + + + +//---- qrinput.php ----------------------------- + + + + +/* + * PHP QR Code encoder + * + * Input encoding class + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + define('STRUCTURE_HEADER_BITS', 20); + define('MAX_STRUCTURED_SYMBOLS', 16); + + class QRinputItem { + + public $mode; + public $size; + public $data; + public $bstream; + + public function __construct($mode, $size, $data, $bstream = null) + { + $setData = array_slice($data, 0, $size); + + if (count($setData) < $size) { + $setData = array_merge($setData, array_fill(0,$size-count($setData),0)); + } + + if(!QRinput::check($mode, $size, $setData)) { + throw new Exception('Error m:'.$mode.',s:'.$size.',d:'.join(',',$setData)); + return null; + } + + $this->mode = $mode; + $this->size = $size; + $this->data = $setData; + $this->bstream = $bstream; + } + + //---------------------------------------------------------------------- + public function encodeModeNum($version) + { + try { + + $words = (int)($this->size / 3); + $bs = new QRbitstream(); + + $val = 0x1; + $bs->appendNum(4, $val); + $bs->appendNum(QRspec::lengthIndicator(QR_MODE_NUM, $version), $this->size); + + for($i=0; $i<$words; $i++) { + $val = (ord($this->data[$i*3 ]) - ord('0')) * 100; + $val += (ord($this->data[$i*3+1]) - ord('0')) * 10; + $val += (ord($this->data[$i*3+2]) - ord('0')); + $bs->appendNum(10, $val); + } + + if($this->size - $words * 3 == 1) { + $val = ord($this->data[$words*3]) - ord('0'); + $bs->appendNum(4, $val); + } else if($this->size - $words * 3 == 2) { + $val = (ord($this->data[$words*3 ]) - ord('0')) * 10; + $val += (ord($this->data[$words*3+1]) - ord('0')); + $bs->appendNum(7, $val); + } + + $this->bstream = $bs; + return 0; + + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function encodeModeAn($version) + { + try { + $words = (int)($this->size / 2); + $bs = new QRbitstream(); + + $bs->appendNum(4, 0x02); + $bs->appendNum(QRspec::lengthIndicator(QR_MODE_AN, $version), $this->size); + + for($i=0; $i<$words; $i++) { + $val = (int)QRinput::lookAnTable(ord($this->data[$i*2 ])) * 45; + $val += (int)QRinput::lookAnTable(ord($this->data[$i*2+1])); + + $bs->appendNum(11, $val); + } + + if($this->size & 1) { + $val = QRinput::lookAnTable(ord($this->data[$words * 2])); + $bs->appendNum(6, $val); + } + + $this->bstream = $bs; + return 0; + + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function encodeMode8($version) + { + try { + $bs = new QRbitstream(); + + $bs->appendNum(4, 0x4); + $bs->appendNum(QRspec::lengthIndicator(QR_MODE_8, $version), $this->size); + + for($i=0; $i<$this->size; $i++) { + $bs->appendNum(8, ord($this->data[$i])); + } + + $this->bstream = $bs; + return 0; + + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function encodeModeKanji($version) + { + try { + + $bs = new QRbitrtream(); + + $bs->appendNum(4, 0x8); + $bs->appendNum(QRspec::lengthIndicator(QR_MODE_KANJI, $version), (int)($this->size / 2)); + + for($i=0; $i<$this->size; $i+=2) { + $val = (ord($this->data[$i]) << 8) | ord($this->data[$i+1]); + if($val <= 0x9ffc) { + $val -= 0x8140; + } else { + $val -= 0xc140; + } + + $h = ($val >> 8) * 0xc0; + $val = ($val & 0xff) + $h; + + $bs->appendNum(13, $val); + } + + $this->bstream = $bs; + return 0; + + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function encodeModeStructure() + { + try { + $bs = new QRbitstream(); + + $bs->appendNum(4, 0x03); + $bs->appendNum(4, ord($this->data[1]) - 1); + $bs->appendNum(4, ord($this->data[0]) - 1); + $bs->appendNum(8, ord($this->data[2])); + + $this->bstream = $bs; + return 0; + + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function estimateBitStreamSizeOfEntry($version) + { + $bits = 0; + + if($version == 0) + $version = 1; + + switch($this->mode) { + case QR_MODE_NUM: $bits = QRinput::estimateBitsModeNum($this->size); break; + case QR_MODE_AN: $bits = QRinput::estimateBitsModeAn($this->size); break; + case QR_MODE_8: $bits = QRinput::estimateBitsMode8($this->size); break; + case QR_MODE_KANJI: $bits = QRinput::estimateBitsModeKanji($this->size);break; + case QR_MODE_STRUCTURE: return STRUCTURE_HEADER_BITS; + default: + return 0; + } + + $l = QRspec::lengthIndicator($this->mode, $version); + $m = 1 << $l; + $num = (int)(($this->size + $m - 1) / $m); + + $bits += $num * (4 + $l); + + return $bits; + } + + //---------------------------------------------------------------------- + public function encodeBitStream($version) + { + try { + + unset($this->bstream); + $words = QRspec::maximumWords($this->mode, $version); + + if($this->size > $words) { + + $st1 = new QRinputItem($this->mode, $words, $this->data); + $st2 = new QRinputItem($this->mode, $this->size - $words, array_slice($this->data, $words)); + + $st1->encodeBitStream($version); + $st2->encodeBitStream($version); + + $this->bstream = new QRbitstream(); + $this->bstream->append($st1->bstream); + $this->bstream->append($st2->bstream); + + unset($st1); + unset($st2); + + } else { + + $ret = 0; + + switch($this->mode) { + case QR_MODE_NUM: $ret = $this->encodeModeNum($version); break; + case QR_MODE_AN: $ret = $this->encodeModeAn($version); break; + case QR_MODE_8: $ret = $this->encodeMode8($version); break; + case QR_MODE_KANJI: $ret = $this->encodeModeKanji($version);break; + case QR_MODE_STRUCTURE: $ret = $this->encodeModeStructure(); break; + + default: + break; + } + + if($ret < 0) + return -1; + } + + return $this->bstream->size(); + + } catch (Exception $e) { + return -1; + } + } + }; + + //########################################################################## + + class QRinput { + + public $items; + + private $version; + private $level; + + //---------------------------------------------------------------------- + public function __construct($version = 0, $level = QR_ECLEVEL_L) + { + if ($version < 0 || $version > QRSPEC_VERSION_MAX || $level > QR_ECLEVEL_H) { + throw new Exception('Invalid version no'); + return NULL; + } + + $this->version = $version; + $this->level = $level; + } + + //---------------------------------------------------------------------- + public function getVersion() + { + return $this->version; + } + + //---------------------------------------------------------------------- + public function setVersion($version) + { + if($version < 0 || $version > QRSPEC_VERSION_MAX) { + throw new Exception('Invalid version no'); + return -1; + } + + $this->version = $version; + + return 0; + } + + //---------------------------------------------------------------------- + public function getErrorCorrectionLevel() + { + return $this->level; + } + + //---------------------------------------------------------------------- + public function setErrorCorrectionLevel($level) + { + if($level > QR_ECLEVEL_H) { + throw new Exception('Invalid ECLEVEL'); + return -1; + } + + $this->level = $level; + + return 0; + } + + //---------------------------------------------------------------------- + public function appendEntry(QRinputItem $entry) + { + $this->items[] = $entry; + } + + //---------------------------------------------------------------------- + public function append($mode, $size, $data) + { + try { + $entry = new QRinputItem($mode, $size, $data); + $this->items[] = $entry; + return 0; + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + + public function insertStructuredAppendHeader($size, $index, $parity) + { + if( $size > MAX_STRUCTURED_SYMBOLS ) { + throw new Exception('insertStructuredAppendHeader wrong size'); + } + + if( $index <= 0 || $index > MAX_STRUCTURED_SYMBOLS ) { + throw new Exception('insertStructuredAppendHeader wrong index'); + } + + $buf = array($size, $index, $parity); + + try { + $entry = new QRinputItem(QR_MODE_STRUCTURE, 3, buf); + array_unshift($this->items, $entry); + return 0; + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function calcParity() + { + $parity = 0; + + foreach($this->items as $item) { + if($item->mode != QR_MODE_STRUCTURE) { + for($i=$item->size-1; $i>=0; $i--) { + $parity ^= $item->data[$i]; + } + } + } + + return $parity; + } + + //---------------------------------------------------------------------- + public static function checkModeNum($size, $data) + { + for($i=0; $i<$size; $i++) { + if((ord($data[$i]) < ord('0')) || (ord($data[$i]) > ord('9'))){ + return false; + } + } + + return true; + } + + //---------------------------------------------------------------------- + public static function estimateBitsModeNum($size) + { + $w = (int)$size / 3; + $bits = $w * 10; + + switch($size - $w * 3) { + case 1: + $bits += 4; + break; + case 2: + $bits += 7; + break; + default: + break; + } + + return $bits; + } + + //---------------------------------------------------------------------- + public static $anTable = array( + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1, + -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + ); + + //---------------------------------------------------------------------- + public static function lookAnTable($c) + { + return (($c > 127)?-1:self::$anTable[$c]); + } + + //---------------------------------------------------------------------- + public static function checkModeAn($size, $data) + { + for($i=0; $i<$size; $i++) { + if (self::lookAnTable(ord($data[$i])) == -1) { + return false; + } + } + + return true; + } + + //---------------------------------------------------------------------- + public static function estimateBitsModeAn($size) + { + $w = (int)($size / 2); + $bits = $w * 11; + + if($size & 1) { + $bits += 6; + } + + return $bits; + } + + //---------------------------------------------------------------------- + public static function estimateBitsMode8($size) + { + return $size * 8; + } + + //---------------------------------------------------------------------- + public function estimateBitsModeKanji($size) + { + return (int)(($size / 2) * 13); + } + + //---------------------------------------------------------------------- + public static function checkModeKanji($size, $data) + { + if($size & 1) + return false; + + for($i=0; $i<$size; $i+=2) { + $val = (ord($data[$i]) << 8) | ord($data[$i+1]); + if( $val < 0x8140 + || ($val > 0x9ffc && $val < 0xe040) + || $val > 0xebbf) { + return false; + } + } + + return true; + } + + /*********************************************************************** + * Validation + **********************************************************************/ + + public static function check($mode, $size, $data) + { + if($size <= 0) + return false; + + switch($mode) { + case QR_MODE_NUM: return self::checkModeNum($size, $data); break; + case QR_MODE_AN: return self::checkModeAn($size, $data); break; + case QR_MODE_KANJI: return self::checkModeKanji($size, $data); break; + case QR_MODE_8: return true; break; + case QR_MODE_STRUCTURE: return true; break; + + default: + break; + } + + return false; + } + + + //---------------------------------------------------------------------- + public function estimateBitStreamSize($version) + { + $bits = 0; + + foreach($this->items as $item) { + $bits += $item->estimateBitStreamSizeOfEntry($version); + } + + return $bits; + } + + //---------------------------------------------------------------------- + public function estimateVersion() + { + $version = 0; + $prev = 0; + do { + $prev = $version; + $bits = $this->estimateBitStreamSize($prev); + $version = QRspec::getMinimumVersion((int)(($bits + 7) / 8), $this->level); + if ($version < 0) { + return -1; + } + } while ($version > $prev); + + return $version; + } + + //---------------------------------------------------------------------- + public static function lengthOfCode($mode, $version, $bits) + { + $payload = $bits - 4 - QRspec::lengthIndicator($mode, $version); + switch($mode) { + case QR_MODE_NUM: + $chunks = (int)($payload / 10); + $remain = $payload - $chunks * 10; + $size = $chunks * 3; + if($remain >= 7) { + $size += 2; + } else if($remain >= 4) { + $size += 1; + } + break; + case QR_MODE_AN: + $chunks = (int)($payload / 11); + $remain = $payload - $chunks * 11; + $size = $chunks * 2; + if($remain >= 6) + $size++; + break; + case QR_MODE_8: + $size = (int)($payload / 8); + break; + case QR_MODE_KANJI: + $size = (int)(($payload / 13) * 2); + break; + case QR_MODE_STRUCTURE: + $size = (int)($payload / 8); + break; + default: + $size = 0; + break; + } + + $maxsize = QRspec::maximumWords($mode, $version); + if($size < 0) $size = 0; + if($size > $maxsize) $size = $maxsize; + + return $size; + } + + //---------------------------------------------------------------------- + public function createBitStream() + { + $total = 0; + + foreach($this->items as $item) { + $bits = $item->encodeBitStream($this->version); + + if($bits < 0) + return -1; + + $total += $bits; + } + + return $total; + } + + //---------------------------------------------------------------------- + public function convertData() + { + $ver = $this->estimateVersion(); + if($ver > $this->getVersion()) { + $this->setVersion($ver); + } + + for(;;) { + $bits = $this->createBitStream(); + + if($bits < 0) + return -1; + + $ver = QRspec::getMinimumVersion((int)(($bits + 7) / 8), $this->level); + if($ver < 0) { + throw new Exception('WRONG VERSION'); + return -1; + } else if($ver > $this->getVersion()) { + $this->setVersion($ver); + } else { + break; + } + } + + return 0; + } + + //---------------------------------------------------------------------- + public function appendPaddingBit(&$bstream) + { + $bits = $bstream->size(); + $maxwords = QRspec::getDataLength($this->version, $this->level); + $maxbits = $maxwords * 8; + + if ($maxbits == $bits) { + return 0; + } + + if ($maxbits - $bits < 5) { + return $bstream->appendNum($maxbits - $bits, 0); + } + + $bits += 4; + $words = (int)(($bits + 7) / 8); + + $padding = new QRbitstream(); + $ret = $padding->appendNum($words * 8 - $bits + 4, 0); + + if($ret < 0) + return $ret; + + $padlen = $maxwords - $words; + + if($padlen > 0) { + + $padbuf = array(); + for($i=0; $i<$padlen; $i++) { + $padbuf[$i] = ($i&1)?0x11:0xec; + } + + $ret = $padding->appendBytes($padlen, $padbuf); + + if($ret < 0) + return $ret; + + } + + $ret = $bstream->append($padding); + + return $ret; + } + + //---------------------------------------------------------------------- + public function mergeBitStream() + { + if($this->convertData() < 0) { + return null; + } + + $bstream = new QRbitstream(); + + foreach($this->items as $item) { + $ret = $bstream->append($item->bstream); + if($ret < 0) { + return null; + } + } + + return $bstream; + } + + //---------------------------------------------------------------------- + public function getBitStream() + { + + $bstream = $this->mergeBitStream(); + + if($bstream == null) { + return null; + } + + $ret = $this->appendPaddingBit($bstream); + if($ret < 0) { + return null; + } + + return $bstream; + } + + //---------------------------------------------------------------------- + public function getByteStream() + { + $bstream = $this->getBitStream(); + if($bstream == null) { + return null; + } + + return $bstream->toByte(); + } + } + + + + + + +//---- qrbitstream.php ----------------------------- + + + + +/* + * PHP QR Code encoder + * + * Bitstream class + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + class QRbitstream { + + public $data = array(); + + //---------------------------------------------------------------------- + public function size() + { + return count($this->data); + } + + //---------------------------------------------------------------------- + public function allocate($setLength) + { + $this->data = array_fill(0, $setLength, 0); + return 0; + } + + //---------------------------------------------------------------------- + public static function newFromNum($bits, $num) + { + $bstream = new QRbitstream(); + $bstream->allocate($bits); + + $mask = 1 << ($bits - 1); + for($i=0; $i<$bits; $i++) { + if($num & $mask) { + $bstream->data[$i] = 1; + } else { + $bstream->data[$i] = 0; + } + $mask = $mask >> 1; + } + + return $bstream; + } + + //---------------------------------------------------------------------- + public static function newFromBytes($size, $data) + { + $bstream = new QRbitstream(); + $bstream->allocate($size * 8); + $p=0; + + for($i=0; $i<$size; $i++) { + $mask = 0x80; + for($j=0; $j<8; $j++) { + if($data[$i] & $mask) { + $bstream->data[$p] = 1; + } else { + $bstream->data[$p] = 0; + } + $p++; + $mask = $mask >> 1; + } + } + + return $bstream; + } + + //---------------------------------------------------------------------- + public function append(QRbitstream $arg) + { + if (is_null($arg)) { + return -1; + } + + if($arg->size() == 0) { + return 0; + } + + if($this->size() == 0) { + $this->data = $arg->data; + return 0; + } + + $this->data = array_values(array_merge($this->data, $arg->data)); + + return 0; + } + + //---------------------------------------------------------------------- + public function appendNum($bits, $num) + { + if ($bits == 0) + return 0; + + $b = QRbitstream::newFromNum($bits, $num); + + if(is_null($b)) + return -1; + + $ret = $this->append($b); + unset($b); + + return $ret; + } + + //---------------------------------------------------------------------- + public function appendBytes($size, $data) + { + if ($size == 0) + return 0; + + $b = QRbitstream::newFromBytes($size, $data); + + if(is_null($b)) + return -1; + + $ret = $this->append($b); + unset($b); + + return $ret; + } + + //---------------------------------------------------------------------- + public function toByte() + { + + $size = $this->size(); + + if($size == 0) { + return array(); + } + + $data = array_fill(0, (int)(($size + 7) / 8), 0); + $bytes = (int)($size / 8); + + $p = 0; + + for($i=0; $i<$bytes; $i++) { + $v = 0; + for($j=0; $j<8; $j++) { + $v = $v << 1; + $v |= $this->data[$p]; + $p++; + } + $data[$i] = $v; + } + + if($size & 7) { + $v = 0; + for($j=0; $j<($size & 7); $j++) { + $v = $v << 1; + $v |= $this->data[$p]; + $p++; + } + $data[$bytes] = $v; + } + + return $data; + } + + } + + + + +//---- qrsplit.php ----------------------------- + + + + +/* + * PHP QR Code encoder + * + * Input splitting classes + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * The following data / specifications are taken from + * "Two dimensional symbol -- QR-code -- Basic Specification" (JIS X0510:2004) + * or + * "Automatic identification and data capture techniques -- + * QR Code 2005 bar code symbology specification" (ISO/IEC 18004:2006) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + class QRsplit { + + public $dataStr = ''; + public $input; + public $modeHint; + + //---------------------------------------------------------------------- + public function __construct($dataStr, $input, $modeHint) + { + $this->dataStr = $dataStr; + $this->input = $input; + $this->modeHint = $modeHint; + } + + //---------------------------------------------------------------------- + public static function isdigitat($str, $pos) + { + if ($pos >= strlen($str)) + return false; + + return ((ord($str[$pos]) >= ord('0'))&&(ord($str[$pos]) <= ord('9'))); + } + + //---------------------------------------------------------------------- + public static function isalnumat($str, $pos) + { + if ($pos >= strlen($str)) + return false; + + return (QRinput::lookAnTable(ord($str[$pos])) >= 0); + } + + //---------------------------------------------------------------------- + public function identifyMode($pos) + { + if ($pos >= strlen($this->dataStr)) + return QR_MODE_NUL; + + $c = $this->dataStr[$pos]; + + if(self::isdigitat($this->dataStr, $pos)) { + return QR_MODE_NUM; + } else if(self::isalnumat($this->dataStr, $pos)) { + return QR_MODE_AN; + } else if($this->modeHint == QR_MODE_KANJI) { + + if ($pos+1 < strlen($this->dataStr)) + { + $d = $this->dataStr[$pos+1]; + $word = (ord($c) << 8) | ord($d); + if(($word >= 0x8140 && $word <= 0x9ffc) || ($word >= 0xe040 && $word <= 0xebbf)) { + return QR_MODE_KANJI; + } + } + } + + return QR_MODE_8; + } + + //---------------------------------------------------------------------- + public function eatNum() + { + $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion()); + + $p = 0; + while(self::isdigitat($this->dataStr, $p)) { + $p++; + } + + $run = $p; + $mode = $this->identifyMode($p); + + if($mode == QR_MODE_8) { + $dif = QRinput::estimateBitsModeNum($run) + 4 + $ln + + QRinput::estimateBitsMode8(1) // + 4 + l8 + - QRinput::estimateBitsMode8($run + 1); // - 4 - l8 + if($dif > 0) { + return $this->eat8(); + } + } + if($mode == QR_MODE_AN) { + $dif = QRinput::estimateBitsModeNum($run) + 4 + $ln + + QRinput::estimateBitsModeAn(1) // + 4 + la + - QRinput::estimateBitsModeAn($run + 1);// - 4 - la + if($dif > 0) { + return $this->eatAn(); + } + } + + $ret = $this->input->append(QR_MODE_NUM, $run, str_split($this->dataStr)); + if($ret < 0) + return -1; + + return $run; + } + + //---------------------------------------------------------------------- + public function eatAn() + { + $la = QRspec::lengthIndicator(QR_MODE_AN, $this->input->getVersion()); + $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion()); + + $p = 0; + + while(self::isalnumat($this->dataStr, $p)) { + if(self::isdigitat($this->dataStr, $p)) { + $q = $p; + while(self::isdigitat($this->dataStr, $q)) { + $q++; + } + + $dif = QRinput::estimateBitsModeAn($p) // + 4 + la + + QRinput::estimateBitsModeNum($q - $p) + 4 + $ln + - QRinput::estimateBitsModeAn($q); // - 4 - la + + if($dif < 0) { + break; + } else { + $p = $q; + } + } else { + $p++; + } + } + + $run = $p; + + if(!self::isalnumat($this->dataStr, $p)) { + $dif = QRinput::estimateBitsModeAn($run) + 4 + $la + + QRinput::estimateBitsMode8(1) // + 4 + l8 + - QRinput::estimateBitsMode8($run + 1); // - 4 - l8 + if($dif > 0) { + return $this->eat8(); + } + } + + $ret = $this->input->append(QR_MODE_AN, $run, str_split($this->dataStr)); + if($ret < 0) + return -1; + + return $run; + } + + //---------------------------------------------------------------------- + public function eatKanji() + { + $p = 0; + + while($this->identifyMode($p) == QR_MODE_KANJI) { + $p += 2; + } + + $ret = $this->input->append(QR_MODE_KANJI, $p, str_split($this->dataStr)); + if($ret < 0) + return -1; + + return $run; + } + + //---------------------------------------------------------------------- + public function eat8() + { + $la = QRspec::lengthIndicator(QR_MODE_AN, $this->input->getVersion()); + $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion()); + + $p = 1; + $dataStrLen = strlen($this->dataStr); + + while($p < $dataStrLen) { + + $mode = $this->identifyMode($p); + if($mode == QR_MODE_KANJI) { + break; + } + if($mode == QR_MODE_NUM) { + $q = $p; + while(self::isdigitat($this->dataStr, $q)) { + $q++; + } + $dif = QRinput::estimateBitsMode8($p) // + 4 + l8 + + QRinput::estimateBitsModeNum($q - $p) + 4 + $ln + - QRinput::estimateBitsMode8($q); // - 4 - l8 + if($dif < 0) { + break; + } else { + $p = $q; + } + } else if($mode == QR_MODE_AN) { + $q = $p; + while(self::isalnumat($this->dataStr, $q)) { + $q++; + } + $dif = QRinput::estimateBitsMode8($p) // + 4 + l8 + + QRinput::estimateBitsModeAn($q - $p) + 4 + $la + - QRinput::estimateBitsMode8($q); // - 4 - l8 + if($dif < 0) { + break; + } else { + $p = $q; + } + } else { + $p++; + } + } + + $run = $p; + $ret = $this->input->append(QR_MODE_8, $run, str_split($this->dataStr)); + + if($ret < 0) + return -1; + + return $run; + } + + //---------------------------------------------------------------------- + public function splitString() + { + while (strlen($this->dataStr) > 0) + { + if($this->dataStr == '') + return 0; + + $mode = $this->identifyMode(0); + + switch ($mode) { + case QR_MODE_NUM: $length = $this->eatNum(); break; + case QR_MODE_AN: $length = $this->eatAn(); break; + case QR_MODE_KANJI: + if ($hint == QR_MODE_KANJI) + $length = $this->eatKanji(); + else $length = $this->eat8(); + break; + default: $length = $this->eat8(); break; + + } + + if($length == 0) return 0; + if($length < 0) return -1; + + $this->dataStr = substr($this->dataStr, $length); + } + } + + //---------------------------------------------------------------------- + public function toUpper() + { + $stringLen = strlen($this->dataStr); + $p = 0; + + while ($p<$stringLen) { + $mode = self::identifyMode(substr($this->dataStr, $p), $this->modeHint); + if($mode == QR_MODE_KANJI) { + $p += 2; + } else { + if (ord($this->dataStr[$p]) >= ord('a') && ord($this->dataStr[$p]) <= ord('z')) { + $this->dataStr[$p] = chr(ord($this->dataStr[$p]) - 32); + } + $p++; + } + } + + return $this->dataStr; + } + + //---------------------------------------------------------------------- + public static function splitStringToQRinput($string, QRinput $input, $modeHint, $casesensitive = true) + { + if(is_null($string) || $string == '\0' || $string == '') { + throw new Exception('empty string!!!'); + } + + $split = new QRsplit($string, $input, $modeHint); + + if(!$casesensitive) + $split->toUpper(); + + return $split->splitString(); + } + } + + + +//---- qrrscode.php ----------------------------- + + + + +/* + * PHP QR Code encoder + * + * Reed-Solomon error correction support + * + * Copyright (C) 2002, 2003, 2004, 2006 Phil Karn, KA9Q + * (libfec is released under the GNU Lesser General Public License.) + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + class QRrsItem { + + public $mm; // Bits per symbol + public $nn; // Symbols per block (= (1<= $this->nn) { + $x -= $this->nn; + $x = ($x >> $this->mm) + ($x & $this->nn); + } + + return $x; + } + + //---------------------------------------------------------------------- + public static function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) + { + // Common code for intializing a Reed-Solomon control block (char or int symbols) + // Copyright 2004 Phil Karn, KA9Q + // May be used under the terms of the GNU Lesser General Public License (LGPL) + + $rs = null; + + // Check parameter ranges + if($symsize < 0 || $symsize > 8) return $rs; + if($fcr < 0 || $fcr >= (1<<$symsize)) return $rs; + if($prim <= 0 || $prim >= (1<<$symsize)) return $rs; + if($nroots < 0 || $nroots >= (1<<$symsize)) return $rs; // Can't have more roots than symbol values! + if($pad < 0 || $pad >= ((1<<$symsize) -1 - $nroots)) return $rs; // Too much padding + + $rs = new QRrsItem(); + $rs->mm = $symsize; + $rs->nn = (1<<$symsize)-1; + $rs->pad = $pad; + + $rs->alpha_to = array_fill(0, $rs->nn+1, 0); + $rs->index_of = array_fill(0, $rs->nn+1, 0); + + // PHP style macro replacement ;) + $NN =& $rs->nn; + $A0 =& $NN; + + // Generate Galois field lookup tables + $rs->index_of[0] = $A0; // log(zero) = -inf + $rs->alpha_to[$A0] = 0; // alpha**-inf = 0 + $sr = 1; + + for($i=0; $i<$rs->nn; $i++) { + $rs->index_of[$sr] = $i; + $rs->alpha_to[$i] = $sr; + $sr <<= 1; + if($sr & (1<<$symsize)) { + $sr ^= $gfpoly; + } + $sr &= $rs->nn; + } + + if($sr != 1){ + // field generator polynomial is not primitive! + $rs = NULL; + return $rs; + } + + /* Form RS code generator polynomial from its roots */ + $rs->genpoly = array_fill(0, $nroots+1, 0); + + $rs->fcr = $fcr; + $rs->prim = $prim; + $rs->nroots = $nroots; + $rs->gfpoly = $gfpoly; + + /* Find prim-th root of 1, used in decoding */ + for($iprim=1;($iprim % $prim) != 0;$iprim += $rs->nn) + ; // intentional empty-body loop! + + $rs->iprim = (int)($iprim / $prim); + $rs->genpoly[0] = 1; + + for ($i = 0,$root=$fcr*$prim; $i < $nroots; $i++, $root += $prim) { + $rs->genpoly[$i+1] = 1; + + // Multiply rs->genpoly[] by @**(root + x) + for ($j = $i; $j > 0; $j--) { + if ($rs->genpoly[$j] != 0) { + $rs->genpoly[$j] = $rs->genpoly[$j-1] ^ $rs->alpha_to[$rs->modnn($rs->index_of[$rs->genpoly[$j]] + $root)]; + } else { + $rs->genpoly[$j] = $rs->genpoly[$j-1]; + } + } + // rs->genpoly[0] can never be zero + $rs->genpoly[0] = $rs->alpha_to[$rs->modnn($rs->index_of[$rs->genpoly[0]] + $root)]; + } + + // convert rs->genpoly[] to index form for quicker encoding + for ($i = 0; $i <= $nroots; $i++) + $rs->genpoly[$i] = $rs->index_of[$rs->genpoly[$i]]; + + return $rs; + } + + //---------------------------------------------------------------------- + public function encode_rs_char($data, &$parity) + { + $MM =& $this->mm; + $NN =& $this->nn; + $ALPHA_TO =& $this->alpha_to; + $INDEX_OF =& $this->index_of; + $GENPOLY =& $this->genpoly; + $NROOTS =& $this->nroots; + $FCR =& $this->fcr; + $PRIM =& $this->prim; + $IPRIM =& $this->iprim; + $PAD =& $this->pad; + $A0 =& $NN; + + $parity = array_fill(0, $NROOTS, 0); + + for($i=0; $i< ($NN-$NROOTS-$PAD); $i++) { + + $feedback = $INDEX_OF[$data[$i] ^ $parity[0]]; + if($feedback != $A0) { + // feedback term is non-zero + + // This line is unnecessary when GENPOLY[NROOTS] is unity, as it must + // always be for the polynomials constructed by init_rs() + $feedback = $this->modnn($NN - $GENPOLY[$NROOTS] + $feedback); + + for($j=1;$j<$NROOTS;$j++) { + $parity[$j] ^= $ALPHA_TO[$this->modnn($feedback + $GENPOLY[$NROOTS-$j])]; + } + } + + // Shift + array_shift($parity); + if($feedback != $A0) { + array_push($parity, $ALPHA_TO[$this->modnn($feedback + $GENPOLY[0])]); + } else { + array_push($parity, 0); + } + } + } + } + + //########################################################################## + + class QRrs { + + public static $items = array(); + + //---------------------------------------------------------------------- + public static function init_rs($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) + { + foreach(self::$items as $rs) { + if($rs->pad != $pad) continue; + if($rs->nroots != $nroots) continue; + if($rs->mm != $symsize) continue; + if($rs->gfpoly != $gfpoly) continue; + if($rs->fcr != $fcr) continue; + if($rs->prim != $prim) continue; + + return $rs; + } + + $rs = QRrsItem::init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad); + array_unshift(self::$items, $rs); + + return $rs; + } + } + + + +//---- qrmask.php ----------------------------- + + + + +/* + * PHP QR Code encoder + * + * Masking + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + define('N1', 3); + define('N2', 3); + define('N3', 40); + define('N4', 10); + + class QRmask { + + public $runLength = array(); + + //---------------------------------------------------------------------- + public function __construct() + { + $this->runLength = array_fill(0, QRSPEC_WIDTH_MAX + 1, 0); + } + + //---------------------------------------------------------------------- + public function writeFormatInformation($width, &$frame, $mask, $level) + { + $blacks = 0; + $format = QRspec::getFormatInfo($mask, $level); + + for($i=0; $i<8; $i++) { + if($format & 1) { + $blacks += 2; + $v = 0x85; + } else { + $v = 0x84; + } + + $frame[8][$width - 1 - $i] = chr($v); + if($i < 6) { + $frame[$i][8] = chr($v); + } else { + $frame[$i + 1][8] = chr($v); + } + $format = $format >> 1; + } + + for($i=0; $i<7; $i++) { + if($format & 1) { + $blacks += 2; + $v = 0x85; + } else { + $v = 0x84; + } + + $frame[$width - 7 + $i][8] = chr($v); + if($i == 0) { + $frame[8][7] = chr($v); + } else { + $frame[8][6 - $i] = chr($v); + } + + $format = $format >> 1; + } + + return $blacks; + } + + //---------------------------------------------------------------------- + public function mask0($x, $y) { return ($x+$y)&1; } + public function mask1($x, $y) { return ($y&1); } + public function mask2($x, $y) { return ($x%3); } + public function mask3($x, $y) { return ($x+$y)%3; } + public function mask4($x, $y) { return (((int)($y/2))+((int)($x/3)))&1; } + public function mask5($x, $y) { return (($x*$y)&1)+($x*$y)%3; } + public function mask6($x, $y) { return ((($x*$y)&1)+($x*$y)%3)&1; } + public function mask7($x, $y) { return ((($x*$y)%3)+(($x+$y)&1))&1; } + + //---------------------------------------------------------------------- + private function generateMaskNo($maskNo, $width, $frame) + { + $bitMask = array_fill(0, $width, array_fill(0, $width, 0)); + + for($y=0; $y<$width; $y++) { + for($x=0; $x<$width; $x++) { + if(ord($frame[$y][$x]) & 0x80) { + $bitMask[$y][$x] = 0; + } else { + $maskFunc = call_user_func(array($this, 'mask'.$maskNo), $x, $y); + $bitMask[$y][$x] = ($maskFunc == 0)?1:0; + } + + } + } + + return $bitMask; + } + + //---------------------------------------------------------------------- + public static function serial($bitFrame) + { + $codeArr = array(); + + foreach ($bitFrame as $line) + $codeArr[] = join('', $line); + + return gzcompress(join("\n", $codeArr), 9); + } + + //---------------------------------------------------------------------- + public static function unserial($code) + { + $codeArr = array(); + + $codeLines = explode("\n", gzuncompress($code)); + foreach ($codeLines as $line) + $codeArr[] = str_split($line); + + return $codeArr; + } + + //---------------------------------------------------------------------- + public function makeMaskNo($maskNo, $width, $s, &$d, $maskGenOnly = false) + { + $b = 0; + $bitMask = array(); + + $fileName = QR_CACHE_DIR.'mask_'.$maskNo.DIRECTORY_SEPARATOR.'mask_'.$width.'_'.$maskNo.'.dat'; + + if (QR_CACHEABLE) { + if (file_exists($fileName)) { + $bitMask = self::unserial(file_get_contents($fileName)); + } else { + $bitMask = $this->generateMaskNo($maskNo, $width, $s, $d); + if (!file_exists(QR_CACHE_DIR.'mask_'.$maskNo)) + mkdir(QR_CACHE_DIR.'mask_'.$maskNo); + file_put_contents($fileName, self::serial($bitMask)); + } + } else { + $bitMask = $this->generateMaskNo($maskNo, $width, $s, $d); + } + + if ($maskGenOnly) + return; + + $d = $s; + + for($y=0; $y<$width; $y++) { + for($x=0; $x<$width; $x++) { + if($bitMask[$y][$x] == 1) { + $d[$y][$x] = chr(ord($s[$y][$x]) ^ (int)$bitMask[$y][$x]); + } + $b += (int)(ord($d[$y][$x]) & 1); + } + } + + return $b; + } + + //---------------------------------------------------------------------- + public function makeMask($width, $frame, $maskNo, $level) + { + $masked = array_fill(0, $width, str_repeat("\0", $width)); + $this->makeMaskNo($maskNo, $width, $frame, $masked); + $this->writeFormatInformation($width, $masked, $maskNo, $level); + + return $masked; + } + + //---------------------------------------------------------------------- + public function calcN1N3($length) + { + $demerit = 0; + + for($i=0; $i<$length; $i++) { + + if($this->runLength[$i] >= 5) { + $demerit += (N1 + ($this->runLength[$i] - 5)); + } + if($i & 1) { + if(($i >= 3) && ($i < ($length-2)) && ($this->runLength[$i] % 3 == 0)) { + $fact = (int)($this->runLength[$i] / 3); + if(($this->runLength[$i-2] == $fact) && + ($this->runLength[$i-1] == $fact) && + ($this->runLength[$i+1] == $fact) && + ($this->runLength[$i+2] == $fact)) { + if(($this->runLength[$i-3] < 0) || ($this->runLength[$i-3] >= (4 * $fact))) { + $demerit += N3; + } else if((($i+3) >= $length) || ($this->runLength[$i+3] >= (4 * $fact))) { + $demerit += N3; + } + } + } + } + } + return $demerit; + } + + //---------------------------------------------------------------------- + public function evaluateSymbol($width, $frame) + { + $head = 0; + $demerit = 0; + + for($y=0; $y<$width; $y++) { + $head = 0; + $this->runLength[0] = 1; + + $frameY = $frame[$y]; + + if ($y>0) + $frameYM = $frame[$y-1]; + + for($x=0; $x<$width; $x++) { + if(($x > 0) && ($y > 0)) { + $b22 = ord($frameY[$x]) & ord($frameY[$x-1]) & ord($frameYM[$x]) & ord($frameYM[$x-1]); + $w22 = ord($frameY[$x]) | ord($frameY[$x-1]) | ord($frameYM[$x]) | ord($frameYM[$x-1]); + + if(($b22 | ($w22 ^ 1))&1) { + $demerit += N2; + } + } + if(($x == 0) && (ord($frameY[$x]) & 1)) { + $this->runLength[0] = -1; + $head = 1; + $this->runLength[$head] = 1; + } else if($x > 0) { + if((ord($frameY[$x]) ^ ord($frameY[$x-1])) & 1) { + $head++; + $this->runLength[$head] = 1; + } else { + $this->runLength[$head]++; + } + } + } + + $demerit += $this->calcN1N3($head+1); + } + + for($x=0; $x<$width; $x++) { + $head = 0; + $this->runLength[0] = 1; + + for($y=0; $y<$width; $y++) { + if($y == 0 && (ord($frame[$y][$x]) & 1)) { + $this->runLength[0] = -1; + $head = 1; + $this->runLength[$head] = 1; + } else if($y > 0) { + if((ord($frame[$y][$x]) ^ ord($frame[$y-1][$x])) & 1) { + $head++; + $this->runLength[$head] = 1; + } else { + $this->runLength[$head]++; + } + } + } + + $demerit += $this->calcN1N3($head+1); + } + + return $demerit; + } + + + //---------------------------------------------------------------------- + public function mask($width, $frame, $level) + { + $minDemerit = PHP_INT_MAX; + $bestMaskNum = 0; + $bestMask = array(); + + $checked_masks = array(0,1,2,3,4,5,6,7); + + if (QR_FIND_FROM_RANDOM !== false) { + + $howManuOut = 8-(QR_FIND_FROM_RANDOM % 9); + for ($i = 0; $i < $howManuOut; $i++) { + $remPos = rand (0, count($checked_masks)-1); + unset($checked_masks[$remPos]); + $checked_masks = array_values($checked_masks); + } + + } + + $bestMask = $frame; + + foreach($checked_masks as $i) { + $mask = array_fill(0, $width, str_repeat("\0", $width)); + + $demerit = 0; + $blacks = 0; + $blacks = $this->makeMaskNo($i, $width, $frame, $mask); + $blacks += $this->writeFormatInformation($width, $mask, $i, $level); + $blacks = (int)(100 * $blacks / ($width * $width)); + $demerit = (int)((int)(abs($blacks - 50) / 5) * N4); + $demerit += $this->evaluateSymbol($width, $mask); + + if($demerit < $minDemerit) { + $minDemerit = $demerit; + $bestMask = $mask; + $bestMaskNum = $i; + } + } + + return $bestMask; + } + + //---------------------------------------------------------------------- + } + + + + +//---- qrencode.php ----------------------------- + + + + +/* + * PHP QR Code encoder + * + * Main encoder classes. + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + class QRrsblock { + public $dataLength; + public $data = array(); + public $eccLength; + public $ecc = array(); + + public function __construct($dl, $data, $el, &$ecc, QRrsItem $rs) + { + $rs->encode_rs_char($data, $ecc); + + $this->dataLength = $dl; + $this->data = $data; + $this->eccLength = $el; + $this->ecc = $ecc; + } + }; + + //########################################################################## + + class QRrawcode { + public $version; + public $datacode = array(); + public $ecccode = array(); + public $blocks; + public $rsblocks = array(); //of RSblock + public $count; + public $dataLength; + public $eccLength; + public $b1; + + //---------------------------------------------------------------------- + public function __construct(QRinput $input) + { + $spec = array(0,0,0,0,0); + + $this->datacode = $input->getByteStream(); + if(is_null($this->datacode)) { + throw new Exception('null imput string'); + } + + QRspec::getEccSpec($input->getVersion(), $input->getErrorCorrectionLevel(), $spec); + + $this->version = $input->getVersion(); + $this->b1 = QRspec::rsBlockNum1($spec); + $this->dataLength = QRspec::rsDataLength($spec); + $this->eccLength = QRspec::rsEccLength($spec); + $this->ecccode = array_fill(0, $this->eccLength, 0); + $this->blocks = QRspec::rsBlockNum($spec); + + $ret = $this->init($spec); + if($ret < 0) { + throw new Exception('block alloc error'); + return null; + } + + $this->count = 0; + } + + //---------------------------------------------------------------------- + public function init(array $spec) + { + $dl = QRspec::rsDataCodes1($spec); + $el = QRspec::rsEccCodes1($spec); + $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); + + + $blockNo = 0; + $dataPos = 0; + $eccPos = 0; + for($i=0; $iecccode,$eccPos); + $this->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el, $ecc, $rs); + $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc); + + $dataPos += $dl; + $eccPos += $el; + $blockNo++; + } + + if(QRspec::rsBlockNum2($spec) == 0) + return 0; + + $dl = QRspec::rsDataCodes2($spec); + $el = QRspec::rsEccCodes2($spec); + $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); + + if($rs == NULL) return -1; + + for($i=0; $iecccode,$eccPos); + $this->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el, $ecc, $rs); + $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc); + + $dataPos += $dl; + $eccPos += $el; + $blockNo++; + } + + return 0; + } + + //---------------------------------------------------------------------- + public function getCode() + { + $ret; + + if($this->count < $this->dataLength) { + $row = $this->count % $this->blocks; + $col = $this->count / $this->blocks; + if($col >= $this->rsblocks[0]->dataLength) { + $row += $this->b1; + } + $ret = $this->rsblocks[$row]->data[$col]; + } else if($this->count < $this->dataLength + $this->eccLength) { + $row = ($this->count - $this->dataLength) % $this->blocks; + $col = ($this->count - $this->dataLength) / $this->blocks; + $ret = $this->rsblocks[$row]->ecc[$col]; + } else { + return 0; + } + $this->count++; + + return $ret; + } + } + + //########################################################################## + + class QRcode { + + public $version; + public $width; + public $data; + + //---------------------------------------------------------------------- + public function encodeMask(QRinput $input, $mask) + { + if($input->getVersion() < 0 || $input->getVersion() > QRSPEC_VERSION_MAX) { + throw new Exception('wrong version'); + } + if($input->getErrorCorrectionLevel() > QR_ECLEVEL_H) { + throw new Exception('wrong level'); + } + + $raw = new QRrawcode($input); + + QRtools::markTime('after_raw'); + + $version = $raw->version; + $width = QRspec::getWidth($version); + $frame = QRspec::newFrame($version); + + $filler = new FrameFiller($width, $frame); + if(is_null($filler)) { + return NULL; + } + + // inteleaved data and ecc codes + for($i=0; $i<$raw->dataLength + $raw->eccLength; $i++) { + $code = $raw->getCode(); + $bit = 0x80; + for($j=0; $j<8; $j++) { + $addr = $filler->next(); + $filler->setFrameAt($addr, 0x02 | (($bit & $code) != 0)); + $bit = $bit >> 1; + } + } + + QRtools::markTime('after_filler'); + + unset($raw); + + // remainder bits + $j = QRspec::getRemainder($version); + for($i=0; $i<$j; $i++) { + $addr = $filler->next(); + $filler->setFrameAt($addr, 0x02); + } + + $frame = $filler->frame; + unset($filler); + + + // masking + $maskObj = new QRmask(); + if($mask < 0) { + + if (QR_FIND_BEST_MASK) { + $masked = $maskObj->mask($width, $frame, $input->getErrorCorrectionLevel()); + } else { + $masked = $maskObj->makeMask($width, $frame, (intval(QR_DEFAULT_MASK) % 8), $input->getErrorCorrectionLevel()); + } + } else { + $masked = $maskObj->makeMask($width, $frame, $mask, $input->getErrorCorrectionLevel()); + } + + if($masked == NULL) { + return NULL; + } + + QRtools::markTime('after_mask'); + + $this->version = $version; + $this->width = $width; + $this->data = $masked; + + return $this; + } + + //---------------------------------------------------------------------- + public function encodeInput(QRinput $input) + { + return $this->encodeMask($input, -1); + } + + //---------------------------------------------------------------------- + public function encodeString8bit($string, $version, $level) + { + if(string == NULL) { + throw new Exception('empty string!'); + return NULL; + } + + $input = new QRinput($version, $level); + if($input == NULL) return NULL; + + $ret = $input->append($input, QR_MODE_8, strlen($string), str_split($string)); + if($ret < 0) { + unset($input); + return NULL; + } + return $this->encodeInput($input); + } + + //---------------------------------------------------------------------- + public function encodeString($string, $version, $level, $hint, $casesensitive) + { + + if($hint != QR_MODE_8 && $hint != QR_MODE_KANJI) { + throw new Exception('bad hint'); + return NULL; + } + + $input = new QRinput($version, $level); + if($input == NULL) return NULL; + + $ret = QRsplit::splitStringToQRinput($string, $input, $hint, $casesensitive); + if($ret < 0) { + return NULL; + } + + return $this->encodeInput($input); + } + + //---------------------------------------------------------------------- + public static function png($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprint=false) + { + $enc = QRencode::factory($level, $size, $margin); + return $enc->encodePNG($text, $outfile, $saveandprint=false); + } + + //---------------------------------------------------------------------- + public static function text($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4) + { + $enc = QRencode::factory($level, $size, $margin); + return $enc->encode($text, $outfile); + } + + //---------------------------------------------------------------------- + public static function raw($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4) + { + $enc = QRencode::factory($level, $size, $margin); + return $enc->encodeRAW($text, $outfile); + } + } + + //########################################################################## + + class FrameFiller { + + public $width; + public $frame; + public $x; + public $y; + public $dir; + public $bit; + + //---------------------------------------------------------------------- + public function __construct($width, &$frame) + { + $this->width = $width; + $this->frame = $frame; + $this->x = $width - 1; + $this->y = $width - 1; + $this->dir = -1; + $this->bit = -1; + } + + //---------------------------------------------------------------------- + public function setFrameAt($at, $val) + { + $this->frame[$at['y']][$at['x']] = chr($val); + } + + //---------------------------------------------------------------------- + public function getFrameAt($at) + { + return ord($this->frame[$at['y']][$at['x']]); + } + + //---------------------------------------------------------------------- + public function next() + { + do { + + if($this->bit == -1) { + $this->bit = 0; + return array('x'=>$this->x, 'y'=>$this->y); + } + + $x = $this->x; + $y = $this->y; + $w = $this->width; + + if($this->bit == 0) { + $x--; + $this->bit++; + } else { + $x++; + $y += $this->dir; + $this->bit--; + } + + if($this->dir < 0) { + if($y < 0) { + $y = 0; + $x -= 2; + $this->dir = 1; + if($x == 6) { + $x--; + $y = 9; + } + } + } else { + if($y == $w) { + $y = $w - 1; + $x -= 2; + $this->dir = -1; + if($x == 6) { + $x--; + $y -= 8; + } + } + } + if($x < 0 || $y < 0) return null; + + $this->x = $x; + $this->y = $y; + + } while(ord($this->frame[$y][$x]) & 0x80); + + return array('x'=>$x, 'y'=>$y); + } + + } ; + + //########################################################################## + + class QRencode { + + public $casesensitive = true; + public $eightbit = false; + + public $version = 0; + public $size = 3; + public $margin = 4; + + public $structured = 0; // not supported yet + + public $level = QR_ECLEVEL_L; + public $hint = QR_MODE_8; + + //---------------------------------------------------------------------- + public static function factory($level = QR_ECLEVEL_L, $size = 3, $margin = 4) + { + $enc = new QRencode(); + $enc->size = $size; + $enc->margin = $margin; + + switch ($level.'') { + case '0': + case '1': + case '2': + case '3': + $enc->level = $level; + break; + case 'l': + case 'L': + $enc->level = QR_ECLEVEL_L; + break; + case 'm': + case 'M': + $enc->level = QR_ECLEVEL_M; + break; + case 'q': + case 'Q': + $enc->level = QR_ECLEVEL_Q; + break; + case 'h': + case 'H': + $enc->level = QR_ECLEVEL_H; + break; + } + + return $enc; + } + + //---------------------------------------------------------------------- + public function encodeRAW($intext, $outfile = false) + { + $code = new QRcode(); + + if($this->eightbit) { + $code->encodeString8bit($intext, $this->version, $this->level); + } else { + $code->encodeString($intext, $this->version, $this->level, $this->hint, $this->casesensitive); + } + + return $code->data; + } + + //---------------------------------------------------------------------- + public function encode($intext, $outfile = false) + { + $code = new QRcode(); + + if($this->eightbit) { + $code->encodeString8bit($intext, $this->version, $this->level); + } else { + $code->encodeString($intext, $this->version, $this->level, $this->hint, $this->casesensitive); + } + + QRtools::markTime('after_encode'); + + if ($outfile!== false) { + file_put_contents($outfile, join("\n", QRtools::binarize($code->data))); + } else { + return QRtools::binarize($code->data); + } + } + + //---------------------------------------------------------------------- + public function encodePNG($intext, $outfile = false,$saveandprint=false) + { + + try { + + ob_start(); + $tab = $this->encode($intext); + $err = ob_get_contents(); + ob_end_clean(); + + if ($err != '') + QRtools::log($outfile, $err); + + $maxSize = (int)(QR_PNG_MAXIMUM_SIZE / (count($tab)+2*$this->margin)); + + QRimage::png($tab, $outfile, min(max(1, $this->size), $maxSize), $this->margin,$saveandprint); + + } catch (Exception $e) { + + QRtools::log($outfile, $e->getMessage()); + + } + } + } + + diff --git a/extend/phpqrcode/qrbitstream.php b/extend/phpqrcode/qrbitstream.php new file mode 100644 index 0000000..c8d1166 --- /dev/null +++ b/extend/phpqrcode/qrbitstream.php @@ -0,0 +1,180 @@ + + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + class QRbitstream { + + public $data = array(); + + //---------------------------------------------------------------------- + public function size() + { + return count($this->data); + } + + //---------------------------------------------------------------------- + public function allocate($setLength) + { + $this->data = array_fill(0, $setLength, 0); + return 0; + } + + //---------------------------------------------------------------------- + public static function newFromNum($bits, $num) + { + $bstream = new QRbitstream(); + $bstream->allocate($bits); + + $mask = 1 << ($bits - 1); + for($i=0; $i<$bits; $i++) { + if($num & $mask) { + $bstream->data[$i] = 1; + } else { + $bstream->data[$i] = 0; + } + $mask = $mask >> 1; + } + + return $bstream; + } + + //---------------------------------------------------------------------- + public static function newFromBytes($size, $data) + { + $bstream = new QRbitstream(); + $bstream->allocate($size * 8); + $p=0; + + for($i=0; $i<$size; $i++) { + $mask = 0x80; + for($j=0; $j<8; $j++) { + if($data[$i] & $mask) { + $bstream->data[$p] = 1; + } else { + $bstream->data[$p] = 0; + } + $p++; + $mask = $mask >> 1; + } + } + + return $bstream; + } + + //---------------------------------------------------------------------- + public function append(QRbitstream $arg) + { + if (is_null($arg)) { + return -1; + } + + if($arg->size() == 0) { + return 0; + } + + if($this->size() == 0) { + $this->data = $arg->data; + return 0; + } + + $this->data = array_values(array_merge($this->data, $arg->data)); + + return 0; + } + + //---------------------------------------------------------------------- + public function appendNum($bits, $num) + { + if ($bits == 0) + return 0; + + $b = QRbitstream::newFromNum($bits, $num); + + if(is_null($b)) + return -1; + + $ret = $this->append($b); + unset($b); + + return $ret; + } + + //---------------------------------------------------------------------- + public function appendBytes($size, $data) + { + if ($size == 0) + return 0; + + $b = QRbitstream::newFromBytes($size, $data); + + if(is_null($b)) + return -1; + + $ret = $this->append($b); + unset($b); + + return $ret; + } + + //---------------------------------------------------------------------- + public function toByte() + { + + $size = $this->size(); + + if($size == 0) { + return array(); + } + + $data = array_fill(0, (int)(($size + 7) / 8), 0); + $bytes = (int)($size / 8); + + $p = 0; + + for($i=0; $i<$bytes; $i++) { + $v = 0; + for($j=0; $j<8; $j++) { + $v = $v << 1; + $v |= $this->data[$p]; + $p++; + } + $data[$i] = $v; + } + + if($size & 7) { + $v = 0; + for($j=0; $j<($size & 7); $j++) { + $v = $v << 1; + $v |= $this->data[$p]; + $p++; + } + $data[$bytes] = $v; + } + + return $data; + } + + } diff --git a/extend/phpqrcode/qrconfig.php b/extend/phpqrcode/qrconfig.php new file mode 100644 index 0000000..62e7f97 --- /dev/null +++ b/extend/phpqrcode/qrconfig.php @@ -0,0 +1,17 @@ + + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + // Encoding modes + + define('QR_MODE_NUL', -1); + define('QR_MODE_NUM', 0); + define('QR_MODE_AN', 1); + define('QR_MODE_8', 2); + define('QR_MODE_KANJI', 3); + define('QR_MODE_STRUCTURE', 4); + + // Levels of error correction. + + define('QR_ECLEVEL_L', 0); + define('QR_ECLEVEL_M', 1); + define('QR_ECLEVEL_Q', 2); + define('QR_ECLEVEL_H', 3); + + // Supported output formats + + define('QR_FORMAT_TEXT', 0); + define('QR_FORMAT_PNG', 1); + + class qrstr { + public static function set(&$srctab, $x, $y, $repl, $replLen = false) { + $srctab[$y] = substr_replace($srctab[$y], ($replLen !== false)?substr($repl,0,$replLen):$repl, $x, ($replLen !== false)?$replLen:strlen($repl)); + } + } \ No newline at end of file diff --git a/extend/phpqrcode/qrencode.php b/extend/phpqrcode/qrencode.php new file mode 100644 index 0000000..fc909fa --- /dev/null +++ b/extend/phpqrcode/qrencode.php @@ -0,0 +1,502 @@ + + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + class QRrsblock { + public $dataLength; + public $data = array(); + public $eccLength; + public $ecc = array(); + + public function __construct($dl, $data, $el, &$ecc, QRrsItem $rs) + { + $rs->encode_rs_char($data, $ecc); + + $this->dataLength = $dl; + $this->data = $data; + $this->eccLength = $el; + $this->ecc = $ecc; + } + }; + + //########################################################################## + + class QRrawcode { + public $version; + public $datacode = array(); + public $ecccode = array(); + public $blocks; + public $rsblocks = array(); //of RSblock + public $count; + public $dataLength; + public $eccLength; + public $b1; + + //---------------------------------------------------------------------- + public function __construct(QRinput $input) + { + $spec = array(0,0,0,0,0); + + $this->datacode = $input->getByteStream(); + if(is_null($this->datacode)) { + throw new Exception('null imput string'); + } + + QRspec::getEccSpec($input->getVersion(), $input->getErrorCorrectionLevel(), $spec); + + $this->version = $input->getVersion(); + $this->b1 = QRspec::rsBlockNum1($spec); + $this->dataLength = QRspec::rsDataLength($spec); + $this->eccLength = QRspec::rsEccLength($spec); + $this->ecccode = array_fill(0, $this->eccLength, 0); + $this->blocks = QRspec::rsBlockNum($spec); + + $ret = $this->init($spec); + if($ret < 0) { + throw new Exception('block alloc error'); + return null; + } + + $this->count = 0; + } + + //---------------------------------------------------------------------- + public function init(array $spec) + { + $dl = QRspec::rsDataCodes1($spec); + $el = QRspec::rsEccCodes1($spec); + $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); + + + $blockNo = 0; + $dataPos = 0; + $eccPos = 0; + for($i=0; $iecccode,$eccPos); + $this->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el, $ecc, $rs); + $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc); + + $dataPos += $dl; + $eccPos += $el; + $blockNo++; + } + + if(QRspec::rsBlockNum2($spec) == 0) + return 0; + + $dl = QRspec::rsDataCodes2($spec); + $el = QRspec::rsEccCodes2($spec); + $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); + + if($rs == NULL) return -1; + + for($i=0; $iecccode,$eccPos); + $this->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el, $ecc, $rs); + $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc); + + $dataPos += $dl; + $eccPos += $el; + $blockNo++; + } + + return 0; + } + + //---------------------------------------------------------------------- + public function getCode() + { + $ret; + + if($this->count < $this->dataLength) { + $row = $this->count % $this->blocks; + $col = $this->count / $this->blocks; + if($col >= $this->rsblocks[0]->dataLength) { + $row += $this->b1; + } + $ret = $this->rsblocks[$row]->data[$col]; + } else if($this->count < $this->dataLength + $this->eccLength) { + $row = ($this->count - $this->dataLength) % $this->blocks; + $col = ($this->count - $this->dataLength) / $this->blocks; + $ret = $this->rsblocks[$row]->ecc[$col]; + } else { + return 0; + } + $this->count++; + + return $ret; + } + } + + //########################################################################## + + class QRcode { + + public $version; + public $width; + public $data; + + //---------------------------------------------------------------------- + public function encodeMask(QRinput $input, $mask) + { + if($input->getVersion() < 0 || $input->getVersion() > QRSPEC_VERSION_MAX) { + throw new Exception('wrong version'); + } + if($input->getErrorCorrectionLevel() > QR_ECLEVEL_H) { + throw new Exception('wrong level'); + } + + $raw = new QRrawcode($input); + + QRtools::markTime('after_raw'); + + $version = $raw->version; + $width = QRspec::getWidth($version); + $frame = QRspec::newFrame($version); + + $filler = new FrameFiller($width, $frame); + if(is_null($filler)) { + return NULL; + } + + // inteleaved data and ecc codes + for($i=0; $i<$raw->dataLength + $raw->eccLength; $i++) { + $code = $raw->getCode(); + $bit = 0x80; + for($j=0; $j<8; $j++) { + $addr = $filler->next(); + $filler->setFrameAt($addr, 0x02 | (($bit & $code) != 0)); + $bit = $bit >> 1; + } + } + + QRtools::markTime('after_filler'); + + unset($raw); + + // remainder bits + $j = QRspec::getRemainder($version); + for($i=0; $i<$j; $i++) { + $addr = $filler->next(); + $filler->setFrameAt($addr, 0x02); + } + + $frame = $filler->frame; + unset($filler); + + + // masking + $maskObj = new QRmask(); + if($mask < 0) { + + if (QR_FIND_BEST_MASK) { + $masked = $maskObj->mask($width, $frame, $input->getErrorCorrectionLevel()); + } else { + $masked = $maskObj->makeMask($width, $frame, (intval(QR_DEFAULT_MASK) % 8), $input->getErrorCorrectionLevel()); + } + } else { + $masked = $maskObj->makeMask($width, $frame, $mask, $input->getErrorCorrectionLevel()); + } + + if($masked == NULL) { + return NULL; + } + + QRtools::markTime('after_mask'); + + $this->version = $version; + $this->width = $width; + $this->data = $masked; + + return $this; + } + + //---------------------------------------------------------------------- + public function encodeInput(QRinput $input) + { + return $this->encodeMask($input, -1); + } + + //---------------------------------------------------------------------- + public function encodeString8bit($string, $version, $level) + { + if(string == NULL) { + throw new Exception('empty string!'); + return NULL; + } + + $input = new QRinput($version, $level); + if($input == NULL) return NULL; + + $ret = $input->append($input, QR_MODE_8, strlen($string), str_split($string)); + if($ret < 0) { + unset($input); + return NULL; + } + return $this->encodeInput($input); + } + + //---------------------------------------------------------------------- + public function encodeString($string, $version, $level, $hint, $casesensitive) + { + + if($hint != QR_MODE_8 && $hint != QR_MODE_KANJI) { + throw new Exception('bad hint'); + return NULL; + } + + $input = new QRinput($version, $level); + if($input == NULL) return NULL; + + $ret = QRsplit::splitStringToQRinput($string, $input, $hint, $casesensitive); + if($ret < 0) { + return NULL; + } + + return $this->encodeInput($input); + } + + //---------------------------------------------------------------------- + public static function png($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprint=false) + { + $enc = QRencode::factory($level, $size, $margin); + return $enc->encodePNG($text, $outfile, $saveandprint=false); + } + + //---------------------------------------------------------------------- + public static function text($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4) + { + $enc = QRencode::factory($level, $size, $margin); + return $enc->encode($text, $outfile); + } + + //---------------------------------------------------------------------- + public static function raw($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4) + { + $enc = QRencode::factory($level, $size, $margin); + return $enc->encodeRAW($text, $outfile); + } + } + + //########################################################################## + + class FrameFiller { + + public $width; + public $frame; + public $x; + public $y; + public $dir; + public $bit; + + //---------------------------------------------------------------------- + public function __construct($width, &$frame) + { + $this->width = $width; + $this->frame = $frame; + $this->x = $width - 1; + $this->y = $width - 1; + $this->dir = -1; + $this->bit = -1; + } + + //---------------------------------------------------------------------- + public function setFrameAt($at, $val) + { + $this->frame[$at['y']][$at['x']] = chr($val); + } + + //---------------------------------------------------------------------- + public function getFrameAt($at) + { + return ord($this->frame[$at['y']][$at['x']]); + } + + //---------------------------------------------------------------------- + public function next() + { + do { + + if($this->bit == -1) { + $this->bit = 0; + return array('x'=>$this->x, 'y'=>$this->y); + } + + $x = $this->x; + $y = $this->y; + $w = $this->width; + + if($this->bit == 0) { + $x--; + $this->bit++; + } else { + $x++; + $y += $this->dir; + $this->bit--; + } + + if($this->dir < 0) { + if($y < 0) { + $y = 0; + $x -= 2; + $this->dir = 1; + if($x == 6) { + $x--; + $y = 9; + } + } + } else { + if($y == $w) { + $y = $w - 1; + $x -= 2; + $this->dir = -1; + if($x == 6) { + $x--; + $y -= 8; + } + } + } + if($x < 0 || $y < 0) return null; + + $this->x = $x; + $this->y = $y; + + } while(ord($this->frame[$y][$x]) & 0x80); + + return array('x'=>$x, 'y'=>$y); + } + + } ; + + //########################################################################## + + class QRencode { + + public $casesensitive = true; + public $eightbit = false; + + public $version = 0; + public $size = 3; + public $margin = 4; + + public $structured = 0; // not supported yet + + public $level = QR_ECLEVEL_L; + public $hint = QR_MODE_8; + + //---------------------------------------------------------------------- + public static function factory($level = QR_ECLEVEL_L, $size = 3, $margin = 4) + { + $enc = new QRencode(); + $enc->size = $size; + $enc->margin = $margin; + + switch ($level.'') { + case '0': + case '1': + case '2': + case '3': + $enc->level = $level; + break; + case 'l': + case 'L': + $enc->level = QR_ECLEVEL_L; + break; + case 'm': + case 'M': + $enc->level = QR_ECLEVEL_M; + break; + case 'q': + case 'Q': + $enc->level = QR_ECLEVEL_Q; + break; + case 'h': + case 'H': + $enc->level = QR_ECLEVEL_H; + break; + } + + return $enc; + } + + //---------------------------------------------------------------------- + public function encodeRAW($intext, $outfile = false) + { + $code = new QRcode(); + + if($this->eightbit) { + $code->encodeString8bit($intext, $this->version, $this->level); + } else { + $code->encodeString($intext, $this->version, $this->level, $this->hint, $this->casesensitive); + } + + return $code->data; + } + + //---------------------------------------------------------------------- + public function encode($intext, $outfile = false) + { + $code = new QRcode(); + + if($this->eightbit) { + $code->encodeString8bit($intext, $this->version, $this->level); + } else { + $code->encodeString($intext, $this->version, $this->level, $this->hint, $this->casesensitive); + } + + QRtools::markTime('after_encode'); + + if ($outfile!== false) { + file_put_contents($outfile, join("\n", QRtools::binarize($code->data))); + } else { + return QRtools::binarize($code->data); + } + } + + //---------------------------------------------------------------------- + public function encodePNG($intext, $outfile = false,$saveandprint=false) + { + try { + + ob_start(); + $tab = $this->encode($intext); + $err = ob_get_contents(); + ob_end_clean(); + + if ($err != '') + QRtools::log($outfile, $err); + + $maxSize = (int)(QR_PNG_MAXIMUM_SIZE / (count($tab)+2*$this->margin)); + + QRimage::png($tab, $outfile, min(max(1, $this->size), $maxSize), $this->margin,$saveandprint); + + } catch (Exception $e) { + + QRtools::log($outfile, $e->getMessage()); + + } + } + } diff --git a/extend/phpqrcode/qrimage.php b/extend/phpqrcode/qrimage.php new file mode 100644 index 0000000..ad7dfc0 --- /dev/null +++ b/extend/phpqrcode/qrimage.php @@ -0,0 +1,96 @@ + + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + define('QR_IMAGE', true); + + class QRimage { + + //---------------------------------------------------------------------- + public static function png($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4,$saveandprint=FALSE) + { + + $image = self::image($frame, $pixelPerPoint, $outerFrame); + + if ($filename === false) { + Header("Content-type: image/png"); + ImagePng($image); + } else { + if($saveandprint===TRUE){ + ImagePng($image, $filename); + header("Content-type: image/png"); + ImagePng($image); + }else{ + ImagePng($image, $filename); + } + } + + ImageDestroy($image); + } + + //---------------------------------------------------------------------- + public static function jpg($frame, $filename = false, $pixelPerPoint = 8, $outerFrame = 4, $q = 85) + { + $image = self::image($frame, $pixelPerPoint, $outerFrame); + + if ($filename === false) { + Header("Content-type: image/jpeg"); + ImageJpeg($image, null, $q); + } else { + ImageJpeg($image, $filename, $q); + } + + ImageDestroy($image); + } + + //---------------------------------------------------------------------- + private static function image($frame, $pixelPerPoint = 4, $outerFrame = 4) + { + $h = count($frame); + $w = strlen($frame[0]); + + $imgW = $w + 2*$outerFrame; + $imgH = $h + 2*$outerFrame; + + $base_image =ImageCreate($imgW, $imgH); + + $col[0] = ImageColorAllocate($base_image,255,255,255); + $col[1] = ImageColorAllocate($base_image,0,0,0); + + imagefill($base_image, 0, 0, $col[0]); + + for($y=0; $y<$h; $y++) { + for($x=0; $x<$w; $x++) { + if ($frame[$y][$x] == '1') { + ImageSetPixel($base_image,$x+$outerFrame,$y+$outerFrame,$col[1]); + } + } + } + + $target_image =ImageCreate($imgW * $pixelPerPoint, $imgH * $pixelPerPoint); + ImageCopyResized($target_image, $base_image, 0, 0, 0, 0, $imgW * $pixelPerPoint, $imgH * $pixelPerPoint, $imgW, $imgH); + ImageDestroy($base_image); + + return $target_image; + } + } \ No newline at end of file diff --git a/extend/phpqrcode/qrinput.php b/extend/phpqrcode/qrinput.php new file mode 100644 index 0000000..c65f91a --- /dev/null +++ b/extend/phpqrcode/qrinput.php @@ -0,0 +1,729 @@ + + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + define('STRUCTURE_HEADER_BITS', 20); + define('MAX_STRUCTURED_SYMBOLS', 16); + + class QRinputItem { + + public $mode; + public $size; + public $data; + public $bstream; + + public function __construct($mode, $size, $data, $bstream = null) + { + $setData = array_slice($data, 0, $size); + + if (count($setData) < $size) { + $setData = array_merge($setData, array_fill(0,$size-count($setData),0)); + } + + if(!QRinput::check($mode, $size, $setData)) { + throw new Exception('Error m:'.$mode.',s:'.$size.',d:'.join(',',$setData)); + return null; + } + + $this->mode = $mode; + $this->size = $size; + $this->data = $setData; + $this->bstream = $bstream; + } + + //---------------------------------------------------------------------- + public function encodeModeNum($version) + { + try { + + $words = (int)($this->size / 3); + $bs = new QRbitstream(); + + $val = 0x1; + $bs->appendNum(4, $val); + $bs->appendNum(QRspec::lengthIndicator(QR_MODE_NUM, $version), $this->size); + + for($i=0; $i<$words; $i++) { + $val = (ord($this->data[$i*3 ]) - ord('0')) * 100; + $val += (ord($this->data[$i*3+1]) - ord('0')) * 10; + $val += (ord($this->data[$i*3+2]) - ord('0')); + $bs->appendNum(10, $val); + } + + if($this->size - $words * 3 == 1) { + $val = ord($this->data[$words*3]) - ord('0'); + $bs->appendNum(4, $val); + } else if($this->size - $words * 3 == 2) { + $val = (ord($this->data[$words*3 ]) - ord('0')) * 10; + $val += (ord($this->data[$words*3+1]) - ord('0')); + $bs->appendNum(7, $val); + } + + $this->bstream = $bs; + return 0; + + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function encodeModeAn($version) + { + try { + $words = (int)($this->size / 2); + $bs = new QRbitstream(); + + $bs->appendNum(4, 0x02); + $bs->appendNum(QRspec::lengthIndicator(QR_MODE_AN, $version), $this->size); + + for($i=0; $i<$words; $i++) { + $val = (int)QRinput::lookAnTable(ord($this->data[$i*2 ])) * 45; + $val += (int)QRinput::lookAnTable(ord($this->data[$i*2+1])); + + $bs->appendNum(11, $val); + } + + if($this->size & 1) { + $val = QRinput::lookAnTable(ord($this->data[$words * 2])); + $bs->appendNum(6, $val); + } + + $this->bstream = $bs; + return 0; + + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function encodeMode8($version) + { + try { + $bs = new QRbitstream(); + + $bs->appendNum(4, 0x4); + $bs->appendNum(QRspec::lengthIndicator(QR_MODE_8, $version), $this->size); + + for($i=0; $i<$this->size; $i++) { + $bs->appendNum(8, ord($this->data[$i])); + } + + $this->bstream = $bs; + return 0; + + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function encodeModeKanji($version) + { + try { + + $bs = new QRbitrtream(); + + $bs->appendNum(4, 0x8); + $bs->appendNum(QRspec::lengthIndicator(QR_MODE_KANJI, $version), (int)($this->size / 2)); + + for($i=0; $i<$this->size; $i+=2) { + $val = (ord($this->data[$i]) << 8) | ord($this->data[$i+1]); + if($val <= 0x9ffc) { + $val -= 0x8140; + } else { + $val -= 0xc140; + } + + $h = ($val >> 8) * 0xc0; + $val = ($val & 0xff) + $h; + + $bs->appendNum(13, $val); + } + + $this->bstream = $bs; + return 0; + + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function encodeModeStructure() + { + try { + $bs = new QRbitstream(); + + $bs->appendNum(4, 0x03); + $bs->appendNum(4, ord($this->data[1]) - 1); + $bs->appendNum(4, ord($this->data[0]) - 1); + $bs->appendNum(8, ord($this->data[2])); + + $this->bstream = $bs; + return 0; + + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function estimateBitStreamSizeOfEntry($version) + { + $bits = 0; + + if($version == 0) + $version = 1; + + switch($this->mode) { + case QR_MODE_NUM: $bits = QRinput::estimateBitsModeNum($this->size); break; + case QR_MODE_AN: $bits = QRinput::estimateBitsModeAn($this->size); break; + case QR_MODE_8: $bits = QRinput::estimateBitsMode8($this->size); break; + case QR_MODE_KANJI: $bits = QRinput::estimateBitsModeKanji($this->size);break; + case QR_MODE_STRUCTURE: return STRUCTURE_HEADER_BITS; + default: + return 0; + } + + $l = QRspec::lengthIndicator($this->mode, $version); + $m = 1 << $l; + $num = (int)(($this->size + $m - 1) / $m); + + $bits += $num * (4 + $l); + + return $bits; + } + + //---------------------------------------------------------------------- + public function encodeBitStream($version) + { + try { + + unset($this->bstream); + $words = QRspec::maximumWords($this->mode, $version); + + if($this->size > $words) { + + $st1 = new QRinputItem($this->mode, $words, $this->data); + $st2 = new QRinputItem($this->mode, $this->size - $words, array_slice($this->data, $words)); + + $st1->encodeBitStream($version); + $st2->encodeBitStream($version); + + $this->bstream = new QRbitstream(); + $this->bstream->append($st1->bstream); + $this->bstream->append($st2->bstream); + + unset($st1); + unset($st2); + + } else { + + $ret = 0; + + switch($this->mode) { + case QR_MODE_NUM: $ret = $this->encodeModeNum($version); break; + case QR_MODE_AN: $ret = $this->encodeModeAn($version); break; + case QR_MODE_8: $ret = $this->encodeMode8($version); break; + case QR_MODE_KANJI: $ret = $this->encodeModeKanji($version);break; + case QR_MODE_STRUCTURE: $ret = $this->encodeModeStructure(); break; + + default: + break; + } + + if($ret < 0) + return -1; + } + + return $this->bstream->size(); + + } catch (Exception $e) { + return -1; + } + } + }; + + //########################################################################## + + class QRinput { + + public $items; + + private $version; + private $level; + + //---------------------------------------------------------------------- + public function __construct($version = 0, $level = QR_ECLEVEL_L) + { + if ($version < 0 || $version > QRSPEC_VERSION_MAX || $level > QR_ECLEVEL_H) { + throw new Exception('Invalid version no'); + return NULL; + } + + $this->version = $version; + $this->level = $level; + } + + //---------------------------------------------------------------------- + public function getVersion() + { + return $this->version; + } + + //---------------------------------------------------------------------- + public function setVersion($version) + { + if($version < 0 || $version > QRSPEC_VERSION_MAX) { + throw new Exception('Invalid version no'); + return -1; + } + + $this->version = $version; + + return 0; + } + + //---------------------------------------------------------------------- + public function getErrorCorrectionLevel() + { + return $this->level; + } + + //---------------------------------------------------------------------- + public function setErrorCorrectionLevel($level) + { + if($level > QR_ECLEVEL_H) { + throw new Exception('Invalid ECLEVEL'); + return -1; + } + + $this->level = $level; + + return 0; + } + + //---------------------------------------------------------------------- + public function appendEntry(QRinputItem $entry) + { + $this->items[] = $entry; + } + + //---------------------------------------------------------------------- + public function append($mode, $size, $data) + { + try { + $entry = new QRinputItem($mode, $size, $data); + $this->items[] = $entry; + return 0; + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + + public function insertStructuredAppendHeader($size, $index, $parity) + { + if( $size > MAX_STRUCTURED_SYMBOLS ) { + throw new Exception('insertStructuredAppendHeader wrong size'); + } + + if( $index <= 0 || $index > MAX_STRUCTURED_SYMBOLS ) { + throw new Exception('insertStructuredAppendHeader wrong index'); + } + + $buf = array($size, $index, $parity); + + try { + $entry = new QRinputItem(QR_MODE_STRUCTURE, 3, buf); + array_unshift($this->items, $entry); + return 0; + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function calcParity() + { + $parity = 0; + + foreach($this->items as $item) { + if($item->mode != QR_MODE_STRUCTURE) { + for($i=$item->size-1; $i>=0; $i--) { + $parity ^= $item->data[$i]; + } + } + } + + return $parity; + } + + //---------------------------------------------------------------------- + public static function checkModeNum($size, $data) + { + for($i=0; $i<$size; $i++) { + if((ord($data[$i]) < ord('0')) || (ord($data[$i]) > ord('9'))){ + return false; + } + } + + return true; + } + + //---------------------------------------------------------------------- + public static function estimateBitsModeNum($size) + { + $w = (int)$size / 3; + $bits = $w * 10; + + switch($size - $w * 3) { + case 1: + $bits += 4; + break; + case 2: + $bits += 7; + break; + default: + break; + } + + return $bits; + } + + //---------------------------------------------------------------------- + public static $anTable = array( + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1, + -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + ); + + //---------------------------------------------------------------------- + public static function lookAnTable($c) + { + return (($c > 127)?-1:self::$anTable[$c]); + } + + //---------------------------------------------------------------------- + public static function checkModeAn($size, $data) + { + for($i=0; $i<$size; $i++) { + if (self::lookAnTable(ord($data[$i])) == -1) { + return false; + } + } + + return true; + } + + //---------------------------------------------------------------------- + public static function estimateBitsModeAn($size) + { + $w = (int)($size / 2); + $bits = $w * 11; + + if($size & 1) { + $bits += 6; + } + + return $bits; + } + + //---------------------------------------------------------------------- + public static function estimateBitsMode8($size) + { + return $size * 8; + } + + //---------------------------------------------------------------------- + public function estimateBitsModeKanji($size) + { + return (int)(($size / 2) * 13); + } + + //---------------------------------------------------------------------- + public static function checkModeKanji($size, $data) + { + if($size & 1) + return false; + + for($i=0; $i<$size; $i+=2) { + $val = (ord($data[$i]) << 8) | ord($data[$i+1]); + if( $val < 0x8140 + || ($val > 0x9ffc && $val < 0xe040) + || $val > 0xebbf) { + return false; + } + } + + return true; + } + + /*********************************************************************** + * Validation + **********************************************************************/ + + public static function check($mode, $size, $data) + { + if($size <= 0) + return false; + + switch($mode) { + case QR_MODE_NUM: return self::checkModeNum($size, $data); break; + case QR_MODE_AN: return self::checkModeAn($size, $data); break; + case QR_MODE_KANJI: return self::checkModeKanji($size, $data); break; + case QR_MODE_8: return true; break; + case QR_MODE_STRUCTURE: return true; break; + + default: + break; + } + + return false; + } + + + //---------------------------------------------------------------------- + public function estimateBitStreamSize($version) + { + $bits = 0; + + foreach($this->items as $item) { + $bits += $item->estimateBitStreamSizeOfEntry($version); + } + + return $bits; + } + + //---------------------------------------------------------------------- + public function estimateVersion() + { + $version = 0; + $prev = 0; + do { + $prev = $version; + $bits = $this->estimateBitStreamSize($prev); + $version = QRspec::getMinimumVersion((int)(($bits + 7) / 8), $this->level); + if ($version < 0) { + return -1; + } + } while ($version > $prev); + + return $version; + } + + //---------------------------------------------------------------------- + public static function lengthOfCode($mode, $version, $bits) + { + $payload = $bits - 4 - QRspec::lengthIndicator($mode, $version); + switch($mode) { + case QR_MODE_NUM: + $chunks = (int)($payload / 10); + $remain = $payload - $chunks * 10; + $size = $chunks * 3; + if($remain >= 7) { + $size += 2; + } else if($remain >= 4) { + $size += 1; + } + break; + case QR_MODE_AN: + $chunks = (int)($payload / 11); + $remain = $payload - $chunks * 11; + $size = $chunks * 2; + if($remain >= 6) + $size++; + break; + case QR_MODE_8: + $size = (int)($payload / 8); + break; + case QR_MODE_KANJI: + $size = (int)(($payload / 13) * 2); + break; + case QR_MODE_STRUCTURE: + $size = (int)($payload / 8); + break; + default: + $size = 0; + break; + } + + $maxsize = QRspec::maximumWords($mode, $version); + if($size < 0) $size = 0; + if($size > $maxsize) $size = $maxsize; + + return $size; + } + + //---------------------------------------------------------------------- + public function createBitStream() + { + $total = 0; + + foreach($this->items as $item) { + $bits = $item->encodeBitStream($this->version); + + if($bits < 0) + return -1; + + $total += $bits; + } + + return $total; + } + + //---------------------------------------------------------------------- + public function convertData() + { + $ver = $this->estimateVersion(); + if($ver > $this->getVersion()) { + $this->setVersion($ver); + } + + for(;;) { + $bits = $this->createBitStream(); + + if($bits < 0) + return -1; + + $ver = QRspec::getMinimumVersion((int)(($bits + 7) / 8), $this->level); + if($ver < 0) { + throw new Exception('WRONG VERSION'); + return -1; + } else if($ver > $this->getVersion()) { + $this->setVersion($ver); + } else { + break; + } + } + + return 0; + } + + //---------------------------------------------------------------------- + public function appendPaddingBit(&$bstream) + { + $bits = $bstream->size(); + $maxwords = QRspec::getDataLength($this->version, $this->level); + $maxbits = $maxwords * 8; + + if ($maxbits == $bits) { + return 0; + } + + if ($maxbits - $bits < 5) { + return $bstream->appendNum($maxbits - $bits, 0); + } + + $bits += 4; + $words = (int)(($bits + 7) / 8); + + $padding = new QRbitstream(); + $ret = $padding->appendNum($words * 8 - $bits + 4, 0); + + if($ret < 0) + return $ret; + + $padlen = $maxwords - $words; + + if($padlen > 0) { + + $padbuf = array(); + for($i=0; $i<$padlen; $i++) { + $padbuf[$i] = ($i&1)?0x11:0xec; + } + + $ret = $padding->appendBytes($padlen, $padbuf); + + if($ret < 0) + return $ret; + + } + + $ret = $bstream->append($padding); + + return $ret; + } + + //---------------------------------------------------------------------- + public function mergeBitStream() + { + if($this->convertData() < 0) { + return null; + } + + $bstream = new QRbitstream(); + + foreach($this->items as $item) { + $ret = $bstream->append($item->bstream); + if($ret < 0) { + return null; + } + } + + return $bstream; + } + + //---------------------------------------------------------------------- + public function getBitStream() + { + + $bstream = $this->mergeBitStream(); + + if($bstream == null) { + return null; + } + + $ret = $this->appendPaddingBit($bstream); + if($ret < 0) { + return null; + } + + return $bstream; + } + + //---------------------------------------------------------------------- + public function getByteStream() + { + $bstream = $this->getBitStream(); + if($bstream == null) { + return null; + } + + return $bstream->toByte(); + } + } + + + \ No newline at end of file diff --git a/extend/phpqrcode/qrlib.php b/extend/phpqrcode/qrlib.php new file mode 100644 index 0000000..43059b9 --- /dev/null +++ b/extend/phpqrcode/qrlib.php @@ -0,0 +1,43 @@ + + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + $QR_BASEDIR = dirname(__FILE__).DIRECTORY_SEPARATOR; + + // Required libs + + include $QR_BASEDIR."qrconst.php"; + include $QR_BASEDIR."qrconfig.php"; + include $QR_BASEDIR."qrtools.php"; + include $QR_BASEDIR."qrspec.php"; + include $QR_BASEDIR."qrimage.php"; + include $QR_BASEDIR."qrinput.php"; + include $QR_BASEDIR."qrbitstream.php"; + include $QR_BASEDIR."qrsplit.php"; + include $QR_BASEDIR."qrrscode.php"; + include $QR_BASEDIR."qrmask.php"; + include $QR_BASEDIR."qrencode.php"; + diff --git a/extend/phpqrcode/qrmask.php b/extend/phpqrcode/qrmask.php new file mode 100644 index 0000000..2d388e0 --- /dev/null +++ b/extend/phpqrcode/qrmask.php @@ -0,0 +1,328 @@ + + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + define('N1', 3); + define('N2', 3); + define('N3', 40); + define('N4', 10); + + class QRmask { + + public $runLength = array(); + + //---------------------------------------------------------------------- + public function __construct() + { + $this->runLength = array_fill(0, QRSPEC_WIDTH_MAX + 1, 0); + } + + //---------------------------------------------------------------------- + public function writeFormatInformation($width, &$frame, $mask, $level) + { + $blacks = 0; + $format = QRspec::getFormatInfo($mask, $level); + + for($i=0; $i<8; $i++) { + if($format & 1) { + $blacks += 2; + $v = 0x85; + } else { + $v = 0x84; + } + + $frame[8][$width - 1 - $i] = chr($v); + if($i < 6) { + $frame[$i][8] = chr($v); + } else { + $frame[$i + 1][8] = chr($v); + } + $format = $format >> 1; + } + + for($i=0; $i<7; $i++) { + if($format & 1) { + $blacks += 2; + $v = 0x85; + } else { + $v = 0x84; + } + + $frame[$width - 7 + $i][8] = chr($v); + if($i == 0) { + $frame[8][7] = chr($v); + } else { + $frame[8][6 - $i] = chr($v); + } + + $format = $format >> 1; + } + + return $blacks; + } + + //---------------------------------------------------------------------- + public function mask0($x, $y) { return ($x+$y)&1; } + public function mask1($x, $y) { return ($y&1); } + public function mask2($x, $y) { return ($x%3); } + public function mask3($x, $y) { return ($x+$y)%3; } + public function mask4($x, $y) { return (((int)($y/2))+((int)($x/3)))&1; } + public function mask5($x, $y) { return (($x*$y)&1)+($x*$y)%3; } + public function mask6($x, $y) { return ((($x*$y)&1)+($x*$y)%3)&1; } + public function mask7($x, $y) { return ((($x*$y)%3)+(($x+$y)&1))&1; } + + //---------------------------------------------------------------------- + private function generateMaskNo($maskNo, $width, $frame) + { + $bitMask = array_fill(0, $width, array_fill(0, $width, 0)); + + for($y=0; $y<$width; $y++) { + for($x=0; $x<$width; $x++) { + if(ord($frame[$y][$x]) & 0x80) { + $bitMask[$y][$x] = 0; + } else { + $maskFunc = call_user_func(array($this, 'mask'.$maskNo), $x, $y); + $bitMask[$y][$x] = ($maskFunc == 0)?1:0; + } + + } + } + + return $bitMask; + } + + //---------------------------------------------------------------------- + public static function serial($bitFrame) + { + $codeArr = array(); + + foreach ($bitFrame as $line) + $codeArr[] = join('', $line); + + return gzcompress(join("\n", $codeArr), 9); + } + + //---------------------------------------------------------------------- + public static function unserial($code) + { + $codeArr = array(); + + $codeLines = explode("\n", gzuncompress($code)); + foreach ($codeLines as $line) + $codeArr[] = str_split($line); + + return $codeArr; + } + + //---------------------------------------------------------------------- + public function makeMaskNo($maskNo, $width, $s, &$d, $maskGenOnly = false) + { + $b = 0; + $bitMask = array(); + + $fileName = QR_CACHE_DIR.'mask_'.$maskNo.DIRECTORY_SEPARATOR.'mask_'.$width.'_'.$maskNo.'.dat'; + + if (QR_CACHEABLE) { + if (file_exists($fileName)) { + $bitMask = self::unserial(file_get_contents($fileName)); + } else { + $bitMask = $this->generateMaskNo($maskNo, $width, $s, $d); + if (!file_exists(QR_CACHE_DIR.'mask_'.$maskNo)) + mkdir(QR_CACHE_DIR.'mask_'.$maskNo); + file_put_contents($fileName, self::serial($bitMask)); + } + } else { + $bitMask = $this->generateMaskNo($maskNo, $width, $s, $d); + } + + if ($maskGenOnly) + return; + + $d = $s; + + for($y=0; $y<$width; $y++) { + for($x=0; $x<$width; $x++) { + if($bitMask[$y][$x] == 1) { + $d[$y][$x] = chr(ord($s[$y][$x]) ^ (int)$bitMask[$y][$x]); + } + $b += (int)(ord($d[$y][$x]) & 1); + } + } + + return $b; + } + + //---------------------------------------------------------------------- + public function makeMask($width, $frame, $maskNo, $level) + { + $masked = array_fill(0, $width, str_repeat("\0", $width)); + $this->makeMaskNo($maskNo, $width, $frame, $masked); + $this->writeFormatInformation($width, $masked, $maskNo, $level); + + return $masked; + } + + //---------------------------------------------------------------------- + public function calcN1N3($length) + { + $demerit = 0; + + for($i=0; $i<$length; $i++) { + + if($this->runLength[$i] >= 5) { + $demerit += (N1 + ($this->runLength[$i] - 5)); + } + if($i & 1) { + if(($i >= 3) && ($i < ($length-2)) && ($this->runLength[$i] % 3 == 0)) { + $fact = (int)($this->runLength[$i] / 3); + if(($this->runLength[$i-2] == $fact) && + ($this->runLength[$i-1] == $fact) && + ($this->runLength[$i+1] == $fact) && + ($this->runLength[$i+2] == $fact)) { + if(($this->runLength[$i-3] < 0) || ($this->runLength[$i-3] >= (4 * $fact))) { + $demerit += N3; + } else if((($i+3) >= $length) || ($this->runLength[$i+3] >= (4 * $fact))) { + $demerit += N3; + } + } + } + } + } + return $demerit; + } + + //---------------------------------------------------------------------- + public function evaluateSymbol($width, $frame) + { + $head = 0; + $demerit = 0; + + for($y=0; $y<$width; $y++) { + $head = 0; + $this->runLength[0] = 1; + + $frameY = $frame[$y]; + + if ($y>0) + $frameYM = $frame[$y-1]; + + for($x=0; $x<$width; $x++) { + if(($x > 0) && ($y > 0)) { + $b22 = ord($frameY[$x]) & ord($frameY[$x-1]) & ord($frameYM[$x]) & ord($frameYM[$x-1]); + $w22 = ord($frameY[$x]) | ord($frameY[$x-1]) | ord($frameYM[$x]) | ord($frameYM[$x-1]); + + if(($b22 | ($w22 ^ 1))&1) { + $demerit += N2; + } + } + if(($x == 0) && (ord($frameY[$x]) & 1)) { + $this->runLength[0] = -1; + $head = 1; + $this->runLength[$head] = 1; + } else if($x > 0) { + if((ord($frameY[$x]) ^ ord($frameY[$x-1])) & 1) { + $head++; + $this->runLength[$head] = 1; + } else { + $this->runLength[$head]++; + } + } + } + + $demerit += $this->calcN1N3($head+1); + } + + for($x=0; $x<$width; $x++) { + $head = 0; + $this->runLength[0] = 1; + + for($y=0; $y<$width; $y++) { + if($y == 0 && (ord($frame[$y][$x]) & 1)) { + $this->runLength[0] = -1; + $head = 1; + $this->runLength[$head] = 1; + } else if($y > 0) { + if((ord($frame[$y][$x]) ^ ord($frame[$y-1][$x])) & 1) { + $head++; + $this->runLength[$head] = 1; + } else { + $this->runLength[$head]++; + } + } + } + + $demerit += $this->calcN1N3($head+1); + } + + return $demerit; + } + + + //---------------------------------------------------------------------- + public function mask($width, $frame, $level) + { + $minDemerit = PHP_INT_MAX; + $bestMaskNum = 0; + $bestMask = array(); + + $checked_masks = array(0,1,2,3,4,5,6,7); + + if (QR_FIND_FROM_RANDOM !== false) { + + $howManuOut = 8-(QR_FIND_FROM_RANDOM % 9); + for ($i = 0; $i < $howManuOut; $i++) { + $remPos = rand (0, count($checked_masks)-1); + unset($checked_masks[$remPos]); + $checked_masks = array_values($checked_masks); + } + + } + + $bestMask = $frame; + + foreach($checked_masks as $i) { + $mask = array_fill(0, $width, str_repeat("\0", $width)); + + $demerit = 0; + $blacks = 0; + $blacks = $this->makeMaskNo($i, $width, $frame, $mask); + $blacks += $this->writeFormatInformation($width, $mask, $i, $level); + $blacks = (int)(100 * $blacks / ($width * $width)); + $demerit = (int)((int)(abs($blacks - 50) / 5) * N4); + $demerit += $this->evaluateSymbol($width, $mask); + + if($demerit < $minDemerit) { + $minDemerit = $demerit; + $bestMask = $mask; + $bestMaskNum = $i; + } + } + + return $bestMask; + } + + //---------------------------------------------------------------------- + } diff --git a/extend/phpqrcode/qrrscode.php b/extend/phpqrcode/qrrscode.php new file mode 100644 index 0000000..d7a97d9 --- /dev/null +++ b/extend/phpqrcode/qrrscode.php @@ -0,0 +1,210 @@ + + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + class QRrsItem { + + public $mm; // Bits per symbol + public $nn; // Symbols per block (= (1<= $this->nn) { + $x -= $this->nn; + $x = ($x >> $this->mm) + ($x & $this->nn); + } + + return $x; + } + + //---------------------------------------------------------------------- + public static function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) + { + // Common code for intializing a Reed-Solomon control block (char or int symbols) + // Copyright 2004 Phil Karn, KA9Q + // May be used under the terms of the GNU Lesser General Public License (LGPL) + + $rs = null; + + // Check parameter ranges + if($symsize < 0 || $symsize > 8) return $rs; + if($fcr < 0 || $fcr >= (1<<$symsize)) return $rs; + if($prim <= 0 || $prim >= (1<<$symsize)) return $rs; + if($nroots < 0 || $nroots >= (1<<$symsize)) return $rs; // Can't have more roots than symbol values! + if($pad < 0 || $pad >= ((1<<$symsize) -1 - $nroots)) return $rs; // Too much padding + + $rs = new QRrsItem(); + $rs->mm = $symsize; + $rs->nn = (1<<$symsize)-1; + $rs->pad = $pad; + + $rs->alpha_to = array_fill(0, $rs->nn+1, 0); + $rs->index_of = array_fill(0, $rs->nn+1, 0); + + // PHP style macro replacement ;) + $NN =& $rs->nn; + $A0 =& $NN; + + // Generate Galois field lookup tables + $rs->index_of[0] = $A0; // log(zero) = -inf + $rs->alpha_to[$A0] = 0; // alpha**-inf = 0 + $sr = 1; + + for($i=0; $i<$rs->nn; $i++) { + $rs->index_of[$sr] = $i; + $rs->alpha_to[$i] = $sr; + $sr <<= 1; + if($sr & (1<<$symsize)) { + $sr ^= $gfpoly; + } + $sr &= $rs->nn; + } + + if($sr != 1){ + // field generator polynomial is not primitive! + $rs = NULL; + return $rs; + } + + /* Form RS code generator polynomial from its roots */ + $rs->genpoly = array_fill(0, $nroots+1, 0); + + $rs->fcr = $fcr; + $rs->prim = $prim; + $rs->nroots = $nroots; + $rs->gfpoly = $gfpoly; + + /* Find prim-th root of 1, used in decoding */ + for($iprim=1;($iprim % $prim) != 0;$iprim += $rs->nn) + ; // intentional empty-body loop! + + $rs->iprim = (int)($iprim / $prim); + $rs->genpoly[0] = 1; + + for ($i = 0,$root=$fcr*$prim; $i < $nroots; $i++, $root += $prim) { + $rs->genpoly[$i+1] = 1; + + // Multiply rs->genpoly[] by @**(root + x) + for ($j = $i; $j > 0; $j--) { + if ($rs->genpoly[$j] != 0) { + $rs->genpoly[$j] = $rs->genpoly[$j-1] ^ $rs->alpha_to[$rs->modnn($rs->index_of[$rs->genpoly[$j]] + $root)]; + } else { + $rs->genpoly[$j] = $rs->genpoly[$j-1]; + } + } + // rs->genpoly[0] can never be zero + $rs->genpoly[0] = $rs->alpha_to[$rs->modnn($rs->index_of[$rs->genpoly[0]] + $root)]; + } + + // convert rs->genpoly[] to index form for quicker encoding + for ($i = 0; $i <= $nroots; $i++) + $rs->genpoly[$i] = $rs->index_of[$rs->genpoly[$i]]; + + return $rs; + } + + //---------------------------------------------------------------------- + public function encode_rs_char($data, &$parity) + { + $MM =& $this->mm; + $NN =& $this->nn; + $ALPHA_TO =& $this->alpha_to; + $INDEX_OF =& $this->index_of; + $GENPOLY =& $this->genpoly; + $NROOTS =& $this->nroots; + $FCR =& $this->fcr; + $PRIM =& $this->prim; + $IPRIM =& $this->iprim; + $PAD =& $this->pad; + $A0 =& $NN; + + $parity = array_fill(0, $NROOTS, 0); + + for($i=0; $i< ($NN-$NROOTS-$PAD); $i++) { + + $feedback = $INDEX_OF[$data[$i] ^ $parity[0]]; + if($feedback != $A0) { + // feedback term is non-zero + + // This line is unnecessary when GENPOLY[NROOTS] is unity, as it must + // always be for the polynomials constructed by init_rs() + $feedback = $this->modnn($NN - $GENPOLY[$NROOTS] + $feedback); + + for($j=1;$j<$NROOTS;$j++) { + $parity[$j] ^= $ALPHA_TO[$this->modnn($feedback + $GENPOLY[$NROOTS-$j])]; + } + } + + // Shift + array_shift($parity); + if($feedback != $A0) { + array_push($parity, $ALPHA_TO[$this->modnn($feedback + $GENPOLY[0])]); + } else { + array_push($parity, 0); + } + } + } + } + + //########################################################################## + + class QRrs { + + public static $items = array(); + + //---------------------------------------------------------------------- + public static function init_rs($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) + { + foreach(self::$items as $rs) { + if($rs->pad != $pad) continue; + if($rs->nroots != $nroots) continue; + if($rs->mm != $symsize) continue; + if($rs->gfpoly != $gfpoly) continue; + if($rs->fcr != $fcr) continue; + if($rs->prim != $prim) continue; + + return $rs; + } + + $rs = QRrsItem::init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad); + array_unshift(self::$items, $rs); + + return $rs; + } + } \ No newline at end of file diff --git a/extend/phpqrcode/qrspec.php b/extend/phpqrcode/qrspec.php new file mode 100644 index 0000000..5a0c4b3 --- /dev/null +++ b/extend/phpqrcode/qrspec.php @@ -0,0 +1,592 @@ + + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * The following data / specifications are taken from + * "Two dimensional symbol -- QR-code -- Basic Specification" (JIS X0510:2004) + * or + * "Automatic identification and data capture techniques -- + * QR Code 2005 bar code symbology specification" (ISO/IEC 18004:2006) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + define('QRSPEC_VERSION_MAX', 40); + define('QRSPEC_WIDTH_MAX', 177); + + define('QRCAP_WIDTH', 0); + define('QRCAP_WORDS', 1); + define('QRCAP_REMINDER', 2); + define('QRCAP_EC', 3); + + class QRspec { + + public static $capacity = array( + array( 0, 0, 0, array( 0, 0, 0, 0)), + array( 21, 26, 0, array( 7, 10, 13, 17)), // 1 + array( 25, 44, 7, array( 10, 16, 22, 28)), + array( 29, 70, 7, array( 15, 26, 36, 44)), + array( 33, 100, 7, array( 20, 36, 52, 64)), + array( 37, 134, 7, array( 26, 48, 72, 88)), // 5 + array( 41, 172, 7, array( 36, 64, 96, 112)), + array( 45, 196, 0, array( 40, 72, 108, 130)), + array( 49, 242, 0, array( 48, 88, 132, 156)), + array( 53, 292, 0, array( 60, 110, 160, 192)), + array( 57, 346, 0, array( 72, 130, 192, 224)), //10 + array( 61, 404, 0, array( 80, 150, 224, 264)), + array( 65, 466, 0, array( 96, 176, 260, 308)), + array( 69, 532, 0, array( 104, 198, 288, 352)), + array( 73, 581, 3, array( 120, 216, 320, 384)), + array( 77, 655, 3, array( 132, 240, 360, 432)), //15 + array( 81, 733, 3, array( 144, 280, 408, 480)), + array( 85, 815, 3, array( 168, 308, 448, 532)), + array( 89, 901, 3, array( 180, 338, 504, 588)), + array( 93, 991, 3, array( 196, 364, 546, 650)), + array( 97, 1085, 3, array( 224, 416, 600, 700)), //20 + array(101, 1156, 4, array( 224, 442, 644, 750)), + array(105, 1258, 4, array( 252, 476, 690, 816)), + array(109, 1364, 4, array( 270, 504, 750, 900)), + array(113, 1474, 4, array( 300, 560, 810, 960)), + array(117, 1588, 4, array( 312, 588, 870, 1050)), //25 + array(121, 1706, 4, array( 336, 644, 952, 1110)), + array(125, 1828, 4, array( 360, 700, 1020, 1200)), + array(129, 1921, 3, array( 390, 728, 1050, 1260)), + array(133, 2051, 3, array( 420, 784, 1140, 1350)), + array(137, 2185, 3, array( 450, 812, 1200, 1440)), //30 + array(141, 2323, 3, array( 480, 868, 1290, 1530)), + array(145, 2465, 3, array( 510, 924, 1350, 1620)), + array(149, 2611, 3, array( 540, 980, 1440, 1710)), + array(153, 2761, 3, array( 570, 1036, 1530, 1800)), + array(157, 2876, 0, array( 570, 1064, 1590, 1890)), //35 + array(161, 3034, 0, array( 600, 1120, 1680, 1980)), + array(165, 3196, 0, array( 630, 1204, 1770, 2100)), + array(169, 3362, 0, array( 660, 1260, 1860, 2220)), + array(173, 3532, 0, array( 720, 1316, 1950, 2310)), + array(177, 3706, 0, array( 750, 1372, 2040, 2430)) //40 + ); + + //---------------------------------------------------------------------- + public static function getDataLength($version, $level) + { + return self::$capacity[$version][QRCAP_WORDS] - self::$capacity[$version][QRCAP_EC][$level]; + } + + //---------------------------------------------------------------------- + public static function getECCLength($version, $level) + { + return self::$capacity[$version][QRCAP_EC][$level]; + } + + //---------------------------------------------------------------------- + public static function getWidth($version) + { + return self::$capacity[$version][QRCAP_WIDTH]; + } + + //---------------------------------------------------------------------- + public static function getRemainder($version) + { + return self::$capacity[$version][QRCAP_REMINDER]; + } + + //---------------------------------------------------------------------- + public static function getMinimumVersion($size, $level) + { + + for($i=1; $i<= QRSPEC_VERSION_MAX; $i++) { + $words = self::$capacity[$i][QRCAP_WORDS] - self::$capacity[$i][QRCAP_EC][$level]; + if($words >= $size) + return $i; + } + + return -1; + } + + //###################################################################### + + public static $lengthTableBits = array( + array(10, 12, 14), + array( 9, 11, 13), + array( 8, 16, 16), + array( 8, 10, 12) + ); + + //---------------------------------------------------------------------- + public static function lengthIndicator($mode, $version) + { + if ($mode == QR_MODE_STRUCTURE) + return 0; + + if ($version <= 9) { + $l = 0; + } else if ($version <= 26) { + $l = 1; + } else { + $l = 2; + } + + return self::$lengthTableBits[$mode][$l]; + } + + //---------------------------------------------------------------------- + public static function maximumWords($mode, $version) + { + if($mode == QR_MODE_STRUCTURE) + return 3; + + if($version <= 9) { + $l = 0; + } else if($version <= 26) { + $l = 1; + } else { + $l = 2; + } + + $bits = self::$lengthTableBits[$mode][$l]; + $words = (1 << $bits) - 1; + + if($mode == QR_MODE_KANJI) { + $words *= 2; // the number of bytes is required + } + + return $words; + } + + // Error correction code ----------------------------------------------- + // Table of the error correction code (Reed-Solomon block) + // See Table 12-16 (pp.30-36), JIS X0510:2004. + + public static $eccTable = array( + array(array( 0, 0), array( 0, 0), array( 0, 0), array( 0, 0)), + array(array( 1, 0), array( 1, 0), array( 1, 0), array( 1, 0)), // 1 + array(array( 1, 0), array( 1, 0), array( 1, 0), array( 1, 0)), + array(array( 1, 0), array( 1, 0), array( 2, 0), array( 2, 0)), + array(array( 1, 0), array( 2, 0), array( 2, 0), array( 4, 0)), + array(array( 1, 0), array( 2, 0), array( 2, 2), array( 2, 2)), // 5 + array(array( 2, 0), array( 4, 0), array( 4, 0), array( 4, 0)), + array(array( 2, 0), array( 4, 0), array( 2, 4), array( 4, 1)), + array(array( 2, 0), array( 2, 2), array( 4, 2), array( 4, 2)), + array(array( 2, 0), array( 3, 2), array( 4, 4), array( 4, 4)), + array(array( 2, 2), array( 4, 1), array( 6, 2), array( 6, 2)), //10 + array(array( 4, 0), array( 1, 4), array( 4, 4), array( 3, 8)), + array(array( 2, 2), array( 6, 2), array( 4, 6), array( 7, 4)), + array(array( 4, 0), array( 8, 1), array( 8, 4), array(12, 4)), + array(array( 3, 1), array( 4, 5), array(11, 5), array(11, 5)), + array(array( 5, 1), array( 5, 5), array( 5, 7), array(11, 7)), //15 + array(array( 5, 1), array( 7, 3), array(15, 2), array( 3, 13)), + array(array( 1, 5), array(10, 1), array( 1, 15), array( 2, 17)), + array(array( 5, 1), array( 9, 4), array(17, 1), array( 2, 19)), + array(array( 3, 4), array( 3, 11), array(17, 4), array( 9, 16)), + array(array( 3, 5), array( 3, 13), array(15, 5), array(15, 10)), //20 + array(array( 4, 4), array(17, 0), array(17, 6), array(19, 6)), + array(array( 2, 7), array(17, 0), array( 7, 16), array(34, 0)), + array(array( 4, 5), array( 4, 14), array(11, 14), array(16, 14)), + array(array( 6, 4), array( 6, 14), array(11, 16), array(30, 2)), + array(array( 8, 4), array( 8, 13), array( 7, 22), array(22, 13)), //25 + array(array(10, 2), array(19, 4), array(28, 6), array(33, 4)), + array(array( 8, 4), array(22, 3), array( 8, 26), array(12, 28)), + array(array( 3, 10), array( 3, 23), array( 4, 31), array(11, 31)), + array(array( 7, 7), array(21, 7), array( 1, 37), array(19, 26)), + array(array( 5, 10), array(19, 10), array(15, 25), array(23, 25)), //30 + array(array(13, 3), array( 2, 29), array(42, 1), array(23, 28)), + array(array(17, 0), array(10, 23), array(10, 35), array(19, 35)), + array(array(17, 1), array(14, 21), array(29, 19), array(11, 46)), + array(array(13, 6), array(14, 23), array(44, 7), array(59, 1)), + array(array(12, 7), array(12, 26), array(39, 14), array(22, 41)), //35 + array(array( 6, 14), array( 6, 34), array(46, 10), array( 2, 64)), + array(array(17, 4), array(29, 14), array(49, 10), array(24, 46)), + array(array( 4, 18), array(13, 32), array(48, 14), array(42, 32)), + array(array(20, 4), array(40, 7), array(43, 22), array(10, 67)), + array(array(19, 6), array(18, 31), array(34, 34), array(20, 61)),//40 + ); + + //---------------------------------------------------------------------- + // CACHEABLE!!! + + public static function getEccSpec($version, $level, array &$spec) + { + if (count($spec) < 5) { + $spec = array(0,0,0,0,0); + } + + $b1 = self::$eccTable[$version][$level][0]; + $b2 = self::$eccTable[$version][$level][1]; + $data = self::getDataLength($version, $level); + $ecc = self::getECCLength($version, $level); + + if($b2 == 0) { + $spec[0] = $b1; + $spec[1] = (int)($data / $b1); + $spec[2] = (int)($ecc / $b1); + $spec[3] = 0; + $spec[4] = 0; + } else { + $spec[0] = $b1; + $spec[1] = (int)($data / ($b1 + $b2)); + $spec[2] = (int)($ecc / ($b1 + $b2)); + $spec[3] = $b2; + $spec[4] = $spec[1] + 1; + } + } + + // Alignment pattern --------------------------------------------------- + + // Positions of alignment patterns. + // This array includes only the second and the third position of the + // alignment patterns. Rest of them can be calculated from the distance + // between them. + + // See Table 1 in Appendix E (pp.71) of JIS X0510:2004. + + public static $alignmentPattern = array( + array( 0, 0), + array( 0, 0), array(18, 0), array(22, 0), array(26, 0), array(30, 0), // 1- 5 + array(34, 0), array(22, 38), array(24, 42), array(26, 46), array(28, 50), // 6-10 + array(30, 54), array(32, 58), array(34, 62), array(26, 46), array(26, 48), //11-15 + array(26, 50), array(30, 54), array(30, 56), array(30, 58), array(34, 62), //16-20 + array(28, 50), array(26, 50), array(30, 54), array(28, 54), array(32, 58), //21-25 + array(30, 58), array(34, 62), array(26, 50), array(30, 54), array(26, 52), //26-30 + array(30, 56), array(34, 60), array(30, 58), array(34, 62), array(30, 54), //31-35 + array(24, 50), array(28, 54), array(32, 58), array(26, 54), array(30, 58), //35-40 + ); + + + /** -------------------------------------------------------------------- + * Put an alignment marker. + * @param frame + * @param width + * @param ox,oy center coordinate of the pattern + */ + public static function putAlignmentMarker(array &$frame, $ox, $oy) + { + $finder = array( + "\xa1\xa1\xa1\xa1\xa1", + "\xa1\xa0\xa0\xa0\xa1", + "\xa1\xa0\xa1\xa0\xa1", + "\xa1\xa0\xa0\xa0\xa1", + "\xa1\xa1\xa1\xa1\xa1" + ); + + $yStart = $oy-2; + $xStart = $ox-2; + + for($y=0; $y<5; $y++) { + QRstr::set($frame, $xStart, $yStart+$y, $finder[$y]); + } + } + + //---------------------------------------------------------------------- + public static function putAlignmentPattern($version, &$frame, $width) + { + if($version < 2) + return; + + $d = self::$alignmentPattern[$version][1] - self::$alignmentPattern[$version][0]; + if($d < 0) { + $w = 2; + } else { + $w = (int)(($width - self::$alignmentPattern[$version][0]) / $d + 2); + } + + if($w * $w - 3 == 1) { + $x = self::$alignmentPattern[$version][0]; + $y = self::$alignmentPattern[$version][0]; + self::putAlignmentMarker($frame, $x, $y); + return; + } + + $cx = self::$alignmentPattern[$version][0]; + for($x=1; $x<$w - 1; $x++) { + self::putAlignmentMarker($frame, 6, $cx); + self::putAlignmentMarker($frame, $cx, 6); + $cx += $d; + } + + $cy = self::$alignmentPattern[$version][0]; + for($y=0; $y<$w-1; $y++) { + $cx = self::$alignmentPattern[$version][0]; + for($x=0; $x<$w-1; $x++) { + self::putAlignmentMarker($frame, $cx, $cy); + $cx += $d; + } + $cy += $d; + } + } + + // Version information pattern ----------------------------------------- + + // Version information pattern (BCH coded). + // See Table 1 in Appendix D (pp.68) of JIS X0510:2004. + + // size: [QRSPEC_VERSION_MAX - 6] + + public static $versionPattern = array( + 0x07c94, 0x085bc, 0x09a99, 0x0a4d3, 0x0bbf6, 0x0c762, 0x0d847, 0x0e60d, + 0x0f928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, 0x168c9, + 0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, 0x1ed75, + 0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, 0x26a64, + 0x27541, 0x28c69 + ); + + //---------------------------------------------------------------------- + public static function getVersionPattern($version) + { + if($version < 7 || $version > QRSPEC_VERSION_MAX) + return 0; + + return self::$versionPattern[$version -7]; + } + + // Format information -------------------------------------------------- + // See calcFormatInfo in tests/test_qrspec.c (orginal qrencode c lib) + + public static $formatInfo = array( + array(0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976), + array(0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0), + array(0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed), + array(0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b) + ); + + public static function getFormatInfo($mask, $level) + { + if($mask < 0 || $mask > 7) + return 0; + + if($level < 0 || $level > 3) + return 0; + + return self::$formatInfo[$level][$mask]; + } + + // Frame --------------------------------------------------------------- + // Cache of initial frames. + + public static $frames = array(); + + /** -------------------------------------------------------------------- + * Put a finder pattern. + * @param frame + * @param width + * @param ox,oy upper-left coordinate of the pattern + */ + public static function putFinderPattern(&$frame, $ox, $oy) + { + $finder = array( + "\xc1\xc1\xc1\xc1\xc1\xc1\xc1", + "\xc1\xc0\xc0\xc0\xc0\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc0\xc0\xc0\xc0\xc1", + "\xc1\xc1\xc1\xc1\xc1\xc1\xc1" + ); + + for($y=0; $y<7; $y++) { + QRstr::set($frame, $ox, $oy+$y, $finder[$y]); + } + } + + //---------------------------------------------------------------------- + public static function createFrame($version) + { + $width = self::$capacity[$version][QRCAP_WIDTH]; + $frameLine = str_repeat ("\0", $width); + $frame = array_fill(0, $width, $frameLine); + + // Finder pattern + self::putFinderPattern($frame, 0, 0); + self::putFinderPattern($frame, $width - 7, 0); + self::putFinderPattern($frame, 0, $width - 7); + + // Separator + $yOffset = $width - 7; + + for($y=0; $y<7; $y++) { + $frame[$y][7] = "\xc0"; + $frame[$y][$width - 8] = "\xc0"; + $frame[$yOffset][7] = "\xc0"; + $yOffset++; + } + + $setPattern = str_repeat("\xc0", 8); + + QRstr::set($frame, 0, 7, $setPattern); + QRstr::set($frame, $width-8, 7, $setPattern); + QRstr::set($frame, 0, $width - 8, $setPattern); + + // Format info + $setPattern = str_repeat("\x84", 9); + QRstr::set($frame, 0, 8, $setPattern); + QRstr::set($frame, $width - 8, 8, $setPattern, 8); + + $yOffset = $width - 8; + + for($y=0; $y<8; $y++,$yOffset++) { + $frame[$y][8] = "\x84"; + $frame[$yOffset][8] = "\x84"; + } + + // Timing pattern + + for($i=1; $i<$width-15; $i++) { + $frame[6][7+$i] = chr(0x90 | ($i & 1)); + $frame[7+$i][6] = chr(0x90 | ($i & 1)); + } + + // Alignment pattern + self::putAlignmentPattern($version, $frame, $width); + + // Version information + if($version >= 7) { + $vinf = self::getVersionPattern($version); + + $v = $vinf; + + for($x=0; $x<6; $x++) { + for($y=0; $y<3; $y++) { + $frame[($width - 11)+$y][$x] = chr(0x88 | ($v & 1)); + $v = $v >> 1; + } + } + + $v = $vinf; + for($y=0; $y<6; $y++) { + for($x=0; $x<3; $x++) { + $frame[$y][$x+($width - 11)] = chr(0x88 | ($v & 1)); + $v = $v >> 1; + } + } + } + + // and a little bit... + $frame[$width - 8][8] = "\x81"; + + return $frame; + } + + //---------------------------------------------------------------------- + public static function debug($frame, $binary_mode = false) + { + if ($binary_mode) { + + foreach ($frame as &$frameLine) { + $frameLine = join('  ', explode('0', $frameLine)); + $frameLine = join('██', explode('1', $frameLine)); + } + + ?> + +


        '; + echo join("
        ", $frame); + echo '






'; + + } else { + + foreach ($frame as &$frameLine) { + $frameLine = join(' ', explode("\xc0", $frameLine)); + $frameLine = join('', explode("\xc1", $frameLine)); + $frameLine = join(' ', explode("\xa0", $frameLine)); + $frameLine = join('', explode("\xa1", $frameLine)); + $frameLine = join('', explode("\x84", $frameLine)); //format 0 + $frameLine = join('', explode("\x85", $frameLine)); //format 1 + $frameLine = join('', explode("\x81", $frameLine)); //special bit + $frameLine = join(' ', explode("\x90", $frameLine)); //clock 0 + $frameLine = join('', explode("\x91", $frameLine)); //clock 1 + $frameLine = join(' ', explode("\x88", $frameLine)); //version + $frameLine = join('', explode("\x89", $frameLine)); //version + $frameLine = join('♦', explode("\x01", $frameLine)); + $frameLine = join('⋅', explode("\0", $frameLine)); + } + + ?> + + "; + echo join("
", $frame); + echo "
"; + + } + } + + //---------------------------------------------------------------------- + public static function serial($frame) + { + return gzcompress(join("\n", $frame), 9); + } + + //---------------------------------------------------------------------- + public static function unserial($code) + { + return explode("\n", gzuncompress($code)); + } + + //---------------------------------------------------------------------- + public static function newFrame($version) + { + if($version < 1 || $version > QRSPEC_VERSION_MAX) + return null; + + if(!isset(self::$frames[$version])) { + + $fileName = QR_CACHE_DIR.'frame_'.$version.'.dat'; + + if (QR_CACHEABLE) { + if (file_exists($fileName)) { + self::$frames[$version] = self::unserial(file_get_contents($fileName)); + } else { + self::$frames[$version] = self::createFrame($version); + file_put_contents($fileName, self::serial(self::$frames[$version])); + } + } else { + self::$frames[$version] = self::createFrame($version); + } + } + + if(is_null(self::$frames[$version])) + return null; + + return self::$frames[$version]; + } + + //---------------------------------------------------------------------- + public static function rsBlockNum($spec) { return $spec[0] + $spec[3]; } + public static function rsBlockNum1($spec) { return $spec[0]; } + public static function rsDataCodes1($spec) { return $spec[1]; } + public static function rsEccCodes1($spec) { return $spec[2]; } + public static function rsBlockNum2($spec) { return $spec[3]; } + public static function rsDataCodes2($spec) { return $spec[4]; } + public static function rsEccCodes2($spec) { return $spec[2]; } + public static function rsDataLength($spec) { return ($spec[0] * $spec[1]) + ($spec[3] * $spec[4]); } + public static function rsEccLength($spec) { return ($spec[0] + $spec[3]) * $spec[2]; } + + } \ No newline at end of file diff --git a/extend/phpqrcode/qrsplit.php b/extend/phpqrcode/qrsplit.php new file mode 100644 index 0000000..8099c41 --- /dev/null +++ b/extend/phpqrcode/qrsplit.php @@ -0,0 +1,311 @@ + + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * The following data / specifications are taken from + * "Two dimensional symbol -- QR-code -- Basic Specification" (JIS X0510:2004) + * or + * "Automatic identification and data capture techniques -- + * QR Code 2005 bar code symbology specification" (ISO/IEC 18004:2006) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + class QRsplit { + + public $dataStr = ''; + public $input; + public $modeHint; + + //---------------------------------------------------------------------- + public function __construct($dataStr, $input, $modeHint) + { + $this->dataStr = $dataStr; + $this->input = $input; + $this->modeHint = $modeHint; + } + + //---------------------------------------------------------------------- + public static function isdigitat($str, $pos) + { + if ($pos >= strlen($str)) + return false; + + return ((ord($str[$pos]) >= ord('0'))&&(ord($str[$pos]) <= ord('9'))); + } + + //---------------------------------------------------------------------- + public static function isalnumat($str, $pos) + { + if ($pos >= strlen($str)) + return false; + + return (QRinput::lookAnTable(ord($str[$pos])) >= 0); + } + + //---------------------------------------------------------------------- + public function identifyMode($pos) + { + if ($pos >= strlen($this->dataStr)) + return QR_MODE_NUL; + + $c = $this->dataStr[$pos]; + + if(self::isdigitat($this->dataStr, $pos)) { + return QR_MODE_NUM; + } else if(self::isalnumat($this->dataStr, $pos)) { + return QR_MODE_AN; + } else if($this->modeHint == QR_MODE_KANJI) { + + if ($pos+1 < strlen($this->dataStr)) + { + $d = $this->dataStr[$pos+1]; + $word = (ord($c) << 8) | ord($d); + if(($word >= 0x8140 && $word <= 0x9ffc) || ($word >= 0xe040 && $word <= 0xebbf)) { + return QR_MODE_KANJI; + } + } + } + + return QR_MODE_8; + } + + //---------------------------------------------------------------------- + public function eatNum() + { + $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion()); + + $p = 0; + while(self::isdigitat($this->dataStr, $p)) { + $p++; + } + + $run = $p; + $mode = $this->identifyMode($p); + + if($mode == QR_MODE_8) { + $dif = QRinput::estimateBitsModeNum($run) + 4 + $ln + + QRinput::estimateBitsMode8(1) // + 4 + l8 + - QRinput::estimateBitsMode8($run + 1); // - 4 - l8 + if($dif > 0) { + return $this->eat8(); + } + } + if($mode == QR_MODE_AN) { + $dif = QRinput::estimateBitsModeNum($run) + 4 + $ln + + QRinput::estimateBitsModeAn(1) // + 4 + la + - QRinput::estimateBitsModeAn($run + 1);// - 4 - la + if($dif > 0) { + return $this->eatAn(); + } + } + + $ret = $this->input->append(QR_MODE_NUM, $run, str_split($this->dataStr)); + if($ret < 0) + return -1; + + return $run; + } + + //---------------------------------------------------------------------- + public function eatAn() + { + $la = QRspec::lengthIndicator(QR_MODE_AN, $this->input->getVersion()); + $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion()); + + $p = 0; + + while(self::isalnumat($this->dataStr, $p)) { + if(self::isdigitat($this->dataStr, $p)) { + $q = $p; + while(self::isdigitat($this->dataStr, $q)) { + $q++; + } + + $dif = QRinput::estimateBitsModeAn($p) // + 4 + la + + QRinput::estimateBitsModeNum($q - $p) + 4 + $ln + - QRinput::estimateBitsModeAn($q); // - 4 - la + + if($dif < 0) { + break; + } else { + $p = $q; + } + } else { + $p++; + } + } + + $run = $p; + + if(!self::isalnumat($this->dataStr, $p)) { + $dif = QRinput::estimateBitsModeAn($run) + 4 + $la + + QRinput::estimateBitsMode8(1) // + 4 + l8 + - QRinput::estimateBitsMode8($run + 1); // - 4 - l8 + if($dif > 0) { + return $this->eat8(); + } + } + + $ret = $this->input->append(QR_MODE_AN, $run, str_split($this->dataStr)); + if($ret < 0) + return -1; + + return $run; + } + + //---------------------------------------------------------------------- + public function eatKanji() + { + $p = 0; + + while($this->identifyMode($p) == QR_MODE_KANJI) { + $p += 2; + } + + $ret = $this->input->append(QR_MODE_KANJI, $p, str_split($this->dataStr)); + if($ret < 0) + return -1; + + return $run; + } + + //---------------------------------------------------------------------- + public function eat8() + { + $la = QRspec::lengthIndicator(QR_MODE_AN, $this->input->getVersion()); + $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion()); + + $p = 1; + $dataStrLen = strlen($this->dataStr); + + while($p < $dataStrLen) { + + $mode = $this->identifyMode($p); + if($mode == QR_MODE_KANJI) { + break; + } + if($mode == QR_MODE_NUM) { + $q = $p; + while(self::isdigitat($this->dataStr, $q)) { + $q++; + } + $dif = QRinput::estimateBitsMode8($p) // + 4 + l8 + + QRinput::estimateBitsModeNum($q - $p) + 4 + $ln + - QRinput::estimateBitsMode8($q); // - 4 - l8 + if($dif < 0) { + break; + } else { + $p = $q; + } + } else if($mode == QR_MODE_AN) { + $q = $p; + while(self::isalnumat($this->dataStr, $q)) { + $q++; + } + $dif = QRinput::estimateBitsMode8($p) // + 4 + l8 + + QRinput::estimateBitsModeAn($q - $p) + 4 + $la + - QRinput::estimateBitsMode8($q); // - 4 - l8 + if($dif < 0) { + break; + } else { + $p = $q; + } + } else { + $p++; + } + } + + $run = $p; + $ret = $this->input->append(QR_MODE_8, $run, str_split($this->dataStr)); + + if($ret < 0) + return -1; + + return $run; + } + + //---------------------------------------------------------------------- + public function splitString() + { + while (strlen($this->dataStr) > 0) + { + if($this->dataStr == '') + return 0; + + $mode = $this->identifyMode(0); + + switch ($mode) { + case QR_MODE_NUM: $length = $this->eatNum(); break; + case QR_MODE_AN: $length = $this->eatAn(); break; + case QR_MODE_KANJI: + if ($hint == QR_MODE_KANJI) + $length = $this->eatKanji(); + else $length = $this->eat8(); + break; + default: $length = $this->eat8(); break; + + } + + if($length == 0) return 0; + if($length < 0) return -1; + + $this->dataStr = substr($this->dataStr, $length); + } + } + + //---------------------------------------------------------------------- + public function toUpper() + { + $stringLen = strlen($this->dataStr); + $p = 0; + + while ($p<$stringLen) { + $mode = self::identifyMode(substr($this->dataStr, $p), $this->modeHint); + if($mode == QR_MODE_KANJI) { + $p += 2; + } else { + if (ord($this->dataStr[$p]) >= ord('a') && ord($this->dataStr[$p]) <= ord('z')) { + $this->dataStr[$p] = chr(ord($this->dataStr[$p]) - 32); + } + $p++; + } + } + + return $this->dataStr; + } + + //---------------------------------------------------------------------- + public static function splitStringToQRinput($string, QRinput $input, $modeHint, $casesensitive = true) + { + if(is_null($string) || $string == '\0' || $string == '') { + throw new Exception('empty string!!!'); + } + + $split = new QRsplit($string, $input, $modeHint); + + if(!$casesensitive) + $split->toUpper(); + + return $split->splitString(); + } + } \ No newline at end of file diff --git a/extend/phpqrcode/qrtools.php b/extend/phpqrcode/qrtools.php new file mode 100644 index 0000000..e0412c4 --- /dev/null +++ b/extend/phpqrcode/qrtools.php @@ -0,0 +1,172 @@ + + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + class QRtools { + + //---------------------------------------------------------------------- + public static function binarize($frame) + { + $len = count($frame); + foreach ($frame as &$frameLine) { + + for($i=0; $i<$len; $i++) { + $frameLine[$i] = (ord($frameLine[$i])&1)?'1':'0'; + } + } + + return $frame; + } + + //---------------------------------------------------------------------- + public static function tcpdfBarcodeArray($code, $mode = 'QR,L', $tcPdfVersion = '4.5.037') + { + $barcode_array = array(); + + if (!is_array($mode)) + $mode = explode(',', $mode); + + $eccLevel = 'L'; + + if (count($mode) > 1) { + $eccLevel = $mode[1]; + } + + $qrTab = QRcode::text($code, false, $eccLevel); + $size = count($qrTab); + + $barcode_array['num_rows'] = $size; + $barcode_array['num_cols'] = $size; + $barcode_array['bcode'] = array(); + + foreach ($qrTab as $line) { + $arrAdd = array(); + foreach(str_split($line) as $char) + $arrAdd[] = ($char=='1')?1:0; + $barcode_array['bcode'][] = $arrAdd; + } + + return $barcode_array; + } + + //---------------------------------------------------------------------- + public static function clearCache() + { + self::$frames = array(); + } + + //---------------------------------------------------------------------- + public static function buildCache() + { + QRtools::markTime('before_build_cache'); + + $mask = new QRmask(); + for ($a=1; $a <= QRSPEC_VERSION_MAX; $a++) { + $frame = QRspec::newFrame($a); + if (QR_IMAGE) { + $fileName = QR_CACHE_DIR.'frame_'.$a.'.png'; + QRimage::png(self::binarize($frame), $fileName, 1, 0); + } + + $width = count($frame); + $bitMask = array_fill(0, $width, array_fill(0, $width, 0)); + for ($maskNo=0; $maskNo<8; $maskNo++) + $mask->makeMaskNo($maskNo, $width, $frame, $bitMask, true); + } + + QRtools::markTime('after_build_cache'); + } + + //---------------------------------------------------------------------- + public static function log($outfile, $err) + { + if (QR_LOG_DIR !== false) { + if ($err != '') { + if ($outfile !== false) { + file_put_contents(QR_LOG_DIR.basename($outfile).'-errors.txt', date('Y-m-d H:i:s').': '.$err, FILE_APPEND); + } else { + file_put_contents(QR_LOG_DIR.'errors.txt', date('Y-m-d H:i:s').': '.$err, FILE_APPEND); + } + } + } + } + + //---------------------------------------------------------------------- + public static function dumpMask($frame) + { + $width = count($frame); + for($y=0;$y<$width;$y++) { + for($x=0;$x<$width;$x++) { + echo ord($frame[$y][$x]).','; + } + } + } + + //---------------------------------------------------------------------- + public static function markTime($markerId) + { + list($usec, $sec) = explode(" ", microtime()); + $time = ((float)$usec + (float)$sec); + + if (!isset($GLOBALS['qr_time_bench'])) + $GLOBALS['qr_time_bench'] = array(); + + $GLOBALS['qr_time_bench'][$markerId] = $time; + } + + //---------------------------------------------------------------------- + public static function timeBenchmark() + { + self::markTime('finish'); + + $lastTime = 0; + $startTime = 0; + $p = 0; + + echo ' + + '; + + foreach($GLOBALS['qr_time_bench'] as $markerId=>$thisTime) { + if ($p > 0) { + echo ''; + } else { + $startTime = $thisTime; + } + + $p++; + $lastTime = $thisTime; + } + + echo ' + + +
BENCHMARK
till '.$markerId.': '.number_format($thisTime-$lastTime, 6).'s
TOTAL: '.number_format($lastTime-$startTime, 6).'s
'; + } + + } + + //########################################################################## + + QRtools::markTime('start'); + \ No newline at end of file diff --git a/extend/phpqrcode/tools/merge.bat b/extend/phpqrcode/tools/merge.bat new file mode 100644 index 0000000..2b5eebb --- /dev/null +++ b/extend/phpqrcode/tools/merge.bat @@ -0,0 +1,2 @@ +php ./merge.php +pause \ No newline at end of file diff --git a/extend/phpqrcode/tools/merge.php b/extend/phpqrcode/tools/merge.php new file mode 100644 index 0000000..9e809c8 --- /dev/null +++ b/extend/phpqrcode/tools/merge.php @@ -0,0 +1,70 @@ + + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + $QR_BASEDIR = dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR; + $QR_TOOLSDIR = dirname(__FILE__).DIRECTORY_SEPARATOR; + + $outputFile = $QR_BASEDIR.'phpqrcode.php'; + + // Required libs + + $fileList = array( + $QR_BASEDIR.'qrconst.php', + $QR_TOOLSDIR.'merged_config.php', + $QR_BASEDIR.'qrtools.php', + $QR_BASEDIR.'qrspec.php', + $QR_BASEDIR.'qrimage.php', + $QR_BASEDIR.'qrinput.php', + $QR_BASEDIR.'qrbitstream.php', + $QR_BASEDIR.'qrsplit.php', + $QR_BASEDIR.'qrrscode.php', + $QR_BASEDIR.'qrmask.php', + $QR_BASEDIR.'qrencode.php' + ); + + $headerFile = $QR_TOOLSDIR.'merged_header.php'; + $versionFile = $QR_BASEDIR.'VERSION'; + + $outputCode = ''; + + foreach($fileList as $fileName) { + $outputCode .= "\n\n".'//---- '.basename($fileName).' -----------------------------'."\n\n"; + $anotherCode = file_get_contents($fileName); + $anotherCode = preg_replace ('/^<\?php/', '', $anotherCode); + $anotherCode = preg_replace ('/\?>\*$/', '', $anotherCode); + $outputCode .= "\n\n".$anotherCode."\n\n"; + } + + $versionDataEx = explode("\n", file_get_contents($versionFile)); + + $outputContents = file_get_contents($headerFile); + $outputContents .= "\n\n/*\n * Version: ".trim($versionDataEx[0])."\n * Build: ".trim($versionDataEx[1])."\n */\n\n"; + $outputContents .= $outputCode; + + file_put_contents($outputFile, $outputContents); + + \ No newline at end of file diff --git a/extend/phpqrcode/tools/merge.sh b/extend/phpqrcode/tools/merge.sh new file mode 100644 index 0000000..1a2515b --- /dev/null +++ b/extend/phpqrcode/tools/merge.sh @@ -0,0 +1,2 @@ +#!/bin/sh +php ./merge.php \ No newline at end of file diff --git a/extend/phpqrcode/tools/merged_config.php b/extend/phpqrcode/tools/merged_config.php new file mode 100644 index 0000000..8cd917d --- /dev/null +++ b/extend/phpqrcode/tools/merged_config.php @@ -0,0 +1,17 @@ + + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + \ No newline at end of file diff --git a/longbingcore/diy/BaseSubscribe.php b/longbingcore/diy/BaseSubscribe.php new file mode 100644 index 0000000..8b0d418 --- /dev/null +++ b/longbingcore/diy/BaseSubscribe.php @@ -0,0 +1,34 @@ +$item){ + + + if($item['auth_is_saas_check'] || $item['auth_platform'] ){ + $permissionPath = APP_PATH . $key . '/info/Permission.php' ; + if(file_exists($permissionPath) && require_once($permissionPath)){ + + $permissionClassName = 'app\\' . $key .'\\info\\Permission' ; + $permissionClass = new $permissionClassName($uniacid); + + if($item['auth_is_saas_check'] && $permissionClass->sAuth() && $item['auth_platform'] && $permissionClass->pAuth() ){ + $denyAdminMenuKeys[] = $key; + }else if ( !$item['auth_is_saas_check'] && $item['auth_platform'] && $permissionClass->pAuth() ) { + $denyAdminMenuKeys[] = $key; + } + } + + }else{ + $denyAdminMenuKeys[] = $key; + } + } + */ + + + //从查找没有权限的adminMenuKey + /*$denyAdminMenuKeys = []; + $permissions = config('permissions'); + foreach ($permissions as $permissionClass) { + + //判断一个对象是否为一个类的子类 + if (!is_subclass_of($permissionClass, PermissionAbstract::class)) { + continue; + } + + + $permission = new $permissionClass($uniacid, 0); + if (!$permission->pAuth() && !empty($permission->adminMenuKey)) { + $denyAdminMenuKeys[] = $permission->adminMenuKey; + } + }*/ + + //返回有权限的菜单 + $rst = []; + + + foreach ($menu_data as $k => $menu) { + + + if (array_key_exists($k, $denyAdminMenuKeys) ) { + //装载插件权限 By.jingshuixian + if($k == 'appstore'){ + //后去插件所有菜单 需要过滤权限 + $appMenudataList = longbing_init_info_data('AdminMenu','app'); + $app = json_decode($menu, true); + $children = $app['children'] ; + + foreach ($appMenudataList as $appKey => $appMenu) { + + //过滤插件全选,需要验证是否正确 + if (array_key_exists($appKey, $denyAdminMenuKeys)){ + + + $m = json_decode($appMenu, true); + + if(!empty($m)){ + foreach ($m as $item ){ + $children[] = $item; + } + } + } + } + + //应用中心主菜单 + + $app['children'] = $children ; + + $rst[] = $app ; + }else if($k == 'admin'){ + + $adminMenu = json_decode($menu, true) ; + $permission = new PermissionAdmin($uniacid); + $pAuthConfig = $permission->getPAuthConfig(); + if($pAuthConfig && $pAuthConfig['copyright_id'] != 0 ){ + $children = $adminMenu['children']; + foreach ($children as $k => $child) { + if ($child['path'] == 'copyright') { + unset($children[$k]); + } + } + $adminMenu['children'] = array_values($children); + + $url = $adminMenu['meta']['subNavName'][1]['url']; + unset($url[0]); + $adminMenu['meta']['subNavName'][1]['url'] = array_values($url); + } + + $rst[] = $adminMenu ; + + }else{ + $rst[] = json_decode($menu, true); + } + + + } + } + + + + + return $rst; + + } + + + /** + * 获取所有应用列表权限 + * + * @param int $uniacid + * @return array + * @author shuixian + * @DataTime: 2019/12/20 13:51 + */ + static public function getAppstoreInfoList (int $uniacid) : array { + + $dataList = longbing_init_info_data('Info','app'); + + $denyAdminMenuKeys = self::getAuthList($uniacid); + + $returnList = [] ; + + foreach ($dataList as $key => $item ){ + + if(array_key_exists($item['name'], $denyAdminMenuKeys) ){ + $returnList[] = $item ; + } + + } + + + return $returnList ; + + } + + + /** + * 获得拥有模块/app权限列表 + * + * @param $uniacid + * @return array + * @author shuixian + * @DataTime: 2019/12/20 13:39 + */ + static public function getAuthList($uniacid){ + $denyAdminMenuKeys = [] ; + + + if(empty($uniacid)){ + return $denyAdminMenuKeys ; + } + + $adminModelListInfo = config('app.AdminModelList') ; + $saas_auth_admin_model_list = $adminModelListInfo['saas_auth_admin_model_list']; + + + foreach ($saas_auth_admin_model_list as $key=>$item) { + + $className = 'Permission' . ucfirst($key); + $permissionPath = APP_PATH . $key . '/info/' . $className . '.php'; + if (file_exists($permissionPath) && require_once($permissionPath)) { + + $permissionClassName = 'app\\' . $key . '\\info\\'. $className; + $permission = new $permissionClassName($uniacid , $item); + if ( $permission->pAuth() && !empty($permission->adminMenuKey)) { + + $denyAdminMenuKeys[$key] = $item; + } + } + + } + + return $denyAdminMenuKeys ; + } + +} \ No newline at end of file diff --git a/longbingcore/permissions/PermissionAbstract.php b/longbingcore/permissions/PermissionAbstract.php new file mode 100644 index 0000000..a22fc70 --- /dev/null +++ b/longbingcore/permissions/PermissionAbstract.php @@ -0,0 +1,274 @@ + true , + 'auth_is_platform_check' =>true , + 'auth_is_saas_check' => true , + ]; + + public $info = []; + + static public $pAuthConfig; + + + public function __construct(int $uniacid, ?int $tabbarKey, ?string $adminMenuKey, ?string $saasKey, ?array $apiPaths , $infoConfigOptions = []) + { + $this->tabbarKey = $tabbarKey; + $this->adminMenuKey = $adminMenuKey; + $this->saasKey = $saasKey; + $this->apiPaths = $apiPaths; + $this->uniacid = $uniacid; + + if(!empty($infoConfigOptions)){ + $this->infoConfig = array_merge($this->infoConfig , $infoConfigOptions); + }else{ + //自动从全局Info里获取 + $adminModelListInfo = config('app.AdminModelList') ; + $saas_auth_admin_model_list = $adminModelListInfo['saas_auth_admin_model_list']; + if(array_key_exists($this->adminMenuKey , $saas_auth_admin_model_list)){ + $this->infoConfig = array_merge($this->infoConfig , $saas_auth_admin_model_list[$this->adminMenuKey]); + } + } + + $this->info = $this->getModelInfo($this->adminMenuKey); + + $this->sassValue = $this->getAuthVaule($this->saasKey ); + } + + /** + * 获取当前模块/app配置的info信息 + * + * @param $model_name + * @return array|mixed + * @author shuixian + * @DataTime: 2019/12/27 17:47 + */ + public function getModelInfo($model_name){ + + //导入info信息查看 + $infoDataPath = APP_PATH . $model_name . '/info/Info.php' ; + $infoData = [] ; + if(file_exists($infoDataPath)){ + $infoData = include $infoDataPath ; + } + return $infoData ; + } + + /** + * 返回saas端授权结果 + * + * @return bool + * @author ArtizanZhang + * @DataTime: 2019/12/6 18:57 + */ + abstract public function sAuth(): bool; + + /** + * 返回p端授权结果 + * + * @return bool + * @author ArtizanZhang + * @DataTime: 2019/12/6 18:57 + */ + abstract public function pAuth(): bool; + + /** + * 返回c端授权结果 + * + * @param int $user_id + * @return bool + * @author ArtizanZhang + * @DataTime: 2019/12/9 17:13 + */ + abstract public function cAuth(int $user_id): bool; + + + + + /** + * 返回saasValue + * + * @return int + * @author ArtizanZhang + * @DataTime: 2019/12/6 18:58 + */ + public function getSaasValue(): int + { + return $this->sassValue; + } + + + /** + * 返回当前实例 + * + * @param int $uniacid + * @return PermissionAbstract + * @author ArtizanZhang + * @DataTime: 2019/12/9 10:59 + */ + static function this (int $uniacid) : self { + return new static($uniacid); + } + + + /** + * 获取p端的权限配置 + * + * @return array|null + * @author ArtizanZhang + * @DataTime: 2019/12/9 14:22 + */ + public function getPAuthConfig(): ?array + { + if (isset(self::$pAuthConfig[$this->uniacid])) { + return self::$pAuthConfig[$this->uniacid]; + } + + try { + $cardauth2_config_exist = Db::query('show tables like "%longbing_cardauth2_config%"'); + if (empty($cardauth2_config_exist)) { + return null; + } + $pAuthConfig = Db::name('longbing_cardauth2_config')->where([['modular_id', '=', $this->uniacid]])->find(); + } catch (DataNotFoundException $notFoundException) { + return null; + } catch (ModelNotFoundException $modelNotFoundException) { + return null; + } catch (DbException $exception) { + return null; + } + + self::$pAuthConfig[$this->uniacid] = $pAuthConfig; + return $pAuthConfig; + } + + /** + * 根据saasAuthKey获得值 + * + * @param $saasAuthKey + * @return int|null + * @author shuixian + * @DataTime: 2019/12/19 19:07 + */ + public function getAuthVaule($saasAuthKey , $defaultAuthNumber = -1){ + $returnNumber = 0 ; + $auth = SaasAuthConfig::getSAuthConfig($this->uniacid); + if($auth){ + $authkey = array_column($auth,1 , 0) ; + }else{ + $authkey = []; + } + + + if(array_key_exists($saasAuthKey , $authkey)){ + + $returnNumber = intval( $authkey[$saasAuthKey] ) ; + //0 代表无限制数量, 默认给 99999999 + $returnNumber = $returnNumber == 0 ? 0 : $returnNumber ; + + }else{ + $returnNumber = $defaultAuthNumber ; + } + + /* if($saasAuthKey == 'LONGBING_BAIDU'){ + + longbing_dd($auth); + + longbing_dd($saasAuthKey . '=========='.$defaultAuthNumber .'===========' . $this->uniacid); + }*/ + + + return $returnNumber ; + } + + + public function getAuthPlatform(){ + return $this->infoConfig['auth_platform'] ; + } + + public function getAuthIsPlatformCheck(){ + return $this->infoConfig['auth_is_platform_check'] ; + } + + public function getAuthIsSaasCheck(){ + return $this->infoConfig['auth_is_saas_check'] ; + } + + /** + * 获取授权数量 + * + * @author shuixian + * @DataTime: 2019/12/19 19:02 + */ + public function getAuthNumber(){ + + return $this->getAuthVaule( $this->saasKey); + } + +} \ No newline at end of file diff --git a/longbingcore/permissions/SaasAuthConfig.php b/longbingcore/permissions/SaasAuthConfig.php new file mode 100644 index 0000000..465ae5d --- /dev/null +++ b/longbingcore/permissions/SaasAuthConfig.php @@ -0,0 +1,143 @@ +getsAuthConfig(); + + if (!empty($param_list)) { + + $data = $param_list; + + $auth_data = []; + //解密 + foreach ($data as $k => $item) { + + $a = explode(':', $item); + //存入缓存 一天的有效期 + if ($a[0] == 'LONGBING_AUTH_GOODS_SINGLE') { + + $a[0] = 'LONGBING_AUTH_GOODS'; + + } + $auth_data[] = $a; + } + setCache('single_checked_auth_' . $app_model_name . $domain_name, $auth_data, 3600, $uniacid); + + return $auth_data; + + } + return null; + + } + + + + + + +} \ No newline at end of file diff --git a/longbingcore/permissions/Tabbar.php b/longbingcore/permissions/Tabbar.php new file mode 100644 index 0000000..cc24d6d --- /dev/null +++ b/longbingcore/permissions/Tabbar.php @@ -0,0 +1,226 @@ +find(); + if (empty($diy)) { + return []; + } + $diy_tabbar = json_decode($diy['tabbar'], true); + + + //从查找没有权限的tabbarKey + $denyTabbarKeys = []; + $permissions = config('permissions'); + foreach ($permissions as $permissionClass) { + if (!is_subclass_of($permissionClass, PermissionAbstract::class)) { + continue; + } + + /** + * @var PermissionAbstract $permission + */ + $permission = new $permissionClass($uniacid, $user_id); + if (!$permission->cAuth($user_id) && !empty($permission->tabbarKey)) { + $denyTabbarKeys[] = $permission->tabbarKey; + } + + } + + //返回有权限的菜单 + foreach ($diy_tabbar['list'] as $k => $tabbar) { + if (in_array($tabbar['key'], $denyTabbarKeys)) { + unset($diy_tabbar['list'][$k]); + } + } + + return $diy_tabbar; + } + + + /** + * diy时,返回有diy权限的小程序菜单 + * + * @param int $uniacid + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author ArtizanZhang + * @DataTime: 2019/12/10 15:56 + */ + static public function allForDiySelect (int $uniacid) : array { + $diy_tabbar = [] ; + + + $adminModelListInfo = config('app.AdminModelList') ; + $saas_auth_admin_model_list = $adminModelListInfo['saas_auth_admin_model_list']; + + + foreach ($saas_auth_admin_model_list as $key=>$item) { + + $className = 'Permission' . ucfirst($key); + $permissionPath = APP_PATH . $key . '/info/' . $className . '.php'; + if (file_exists($permissionPath) && require_once($permissionPath)) { + + $permissionClassName = 'app\\' . $key . '\\info\\'. $className; + $permission = new $permissionClassName($uniacid , $item); + + if ( $permission->pAuth() && !empty($permission->adminMenuKey)) { + + $diyTabbarPath = APP_PATH . $key . '/info/DiyTabbar.php'; + if (file_exists($diyTabbarPath)) { + + $tabbar = include_once ($diyTabbarPath) ; + + $diy_tabbar = array_merge($diy_tabbar , $tabbar) ; + } + } + } + } + + $data['list'] = $diy_tabbar; + //默认设置 + $data['color'] = '#5d6268'; + $data['selectedColor'] = '#19c865'; + $data['backgroundColor'] = '#fff'; + $data['borderStyle'] = 'white'; + + return $data; + } + + + /** + * @param $uniacid + * @功能说明:获取有权限的默认数据 + * @author chenniang + * @DataTime: 2020-05-15 17:28 + */ + static public function getAuthDefultTabbar($data){ + + $url = config('app.AdminModelList')['diy_default_data']['tabbar']; + //默认配置 + //$url = '{"id":1,"uniacid":4,"status":1,"create_time":1578106749,"update_time":1578106749,"list":[{"is_show":1,"key":1,"iconPath":"icon-mingpian","selectedIconPath":"icon-mingpian1","pageComponents":"cardHome","name":"\u540d\u7247","url":"\/pages\/user\/home","url_out":"","jump_way":0},{"key":2,"is_show":1,"iconPath":"icon-shangcheng1","selectedIconPath":"icon-shangcheng","pageComponents":"shopHome","name":"\u5546\u57ce","url":"","url_jump_way":"0","url_out":"","is_delete":false,"bind_compoents":[],"bind_links":[],"page":[]},{"key":3,"is_show":1,"iconPath":"icon-dongtai1","selectedIconPath":"icon-dongtai","pageComponents":"infoHome","name":"\u52a8\u6001","url":"","url_jump_way":"0","url_out":"","is_delete":false,"bind_compoents":[],"bind_links":[],"page":[]},{"key":4,"is_show":1,"iconPath":"icon-guanwang","selectedIconPath":"icon-guanwang1","pageComponents":"websiteHome","name":"\u5b98\u7f51","url":"","url_jump_way":"0","url_out":"","is_delete":false,"bind_compoents":[],"bind_links":[],"page":[]},{"key":20001,"is_show":1,"iconPath":"iconyonghuduangerenzhongxin","selectedIconPath":"iconyonghuduangerenzhongxin1","pageComponents":"","name":"\u4e2a\u4eba\u4e2d\u5fc3","url":"","url_jump_way":"0","url_out":"","is_delete":false,"bind_compoents":["ucenterCompoent"],"bind_links":["case"],"page":[]}],"color":"#5d6268","selectedColor":"#19c865","backgroundColor":"#fff","borderStyle":"white"}'; + + $url = json_decode($url,true); + + foreach ($url['list'] as $k=>$v){ + + if(!in_array($v['key'],$data)){ + + unset($url['list'][$k]); + } + + } + + $url['list'] = array_values($url['list']); + + return $url; + } + + + /** + * @param $uniacid + * @功能说明:获取有权限的 + * @author chenniang + * @DataTime: 2020-05-15 17:50 + */ + static public function getAuthDefultPage($data){ + + $url = config('app.AdminModelList')['diy_default_data']['page']; + //默认配置 + //$url = '{"1":{"list":[]},"2":{"list":[]},"3":{"list":[]},"4":{"list":[]},"20001":{"list":[{"title":"\u7528\u6237\u4fe1\u606f","type":"userInfo","icon":"iconyonghuxinxi","isDelete":false,"addNumber":1,"attr":[{"title":"\u5b57\u4f53\u989c\u8272","type":"ColorPicker","name":"fontColor"},{"title":"\u80cc\u666f\u56fe\u7247","type":"UploadImage","desc":"750*440","name":"bgImage"}],"data":{"nickName":"\u7528\u6237\u6635\u79f0","avatarUrl":"https:\/\/retail.xiaochengxucms.com\/defaultAvatar.png","nickText":"\u66f4\u65b0\u6211\u7684\u4e2a\u4eba\u8d44\u6599","fontColor":"#F9DEAF","bgImage":[{"url":"http:\/\/longbingcdn.xiaochengxucms.com\/admin\/diy\/user_bg.jpg"}]},"id":1578137234868,"compontents":"ucenterCompoent"},{"title":"\u521b\u5efa\u540d\u7247","type":"createCard","icon":"iconchuangjianmingpian","isDelete":false,"addNumber":1,"data":{"createText":"\u521b\u5efa\u6211\u7684\u540d\u7247","createBtn":"\u521b\u5efa\u540d\u7247"},"id":1578137237049,"compontents":"ucenterCompoent"},{"title":"\u8ba2\u5355\u7ba1\u7406","type":"moduleMenuShopOrder","icon":"iconshoporder","isDelete":true,"addNumber":1,"attr":[{"title":"\u6a21\u677f\u540d\u79f0","type":"Switch","name":"isShowTitle"},{"title":"\u9009\u62e9\u6a21\u677f","type":"ChooseModule","name":"module","data":[{"title":"\u4e00\u884c\u591a\u5217","name":"module-menu-row","img":"http:\/\/longbingcdn.xiaochengxucms.com\/admin\/diy\/module-menu-col.jpg"},{"title":"\u4e00\u884c\u4e00\u5217","name":"module-menu-col","img":"http:\/\/longbingcdn.xiaochengxucms.com\/admin\/diy\/module-menu-row.jpg"}]},{"title":"\u4e00\u884c\u591a\u5c11\u5217","type":"InputNumber","name":"row"}],"data":{"isShowTitle":false,"module":"module-menu-row","row":{"number":4,"min":2,"max":5,"label":"\u8bf7\u8f93\u5165"},"list":[{"title":"\u5168\u90e8","icon":"iconwodedingdan","link":{"type":2,"url":"\/shop\/pages\/order\/list?index=0"}},{"title":"\u5f85\u4ed8\u6b3e","icon":"icondingdandaifukuan","link":{"type":2,"url":"\/shop\/pages\/order\/list?index=1"}},{"title":"\u5f85\u53d1\u8d27","icon":"icondingdandaifahuo","link":{"type":2,"url":"\/shop\/pages\/order\/list?index=2"}},{"title":"\u5f85\u6536\u8d27","icon":"icondingdandaishouhuo","link":{"type":2,"url":"\/shop\/pages\/order\/list?index=3"}},{"title":"\u5df2\u5b8c\u6210","icon":"icondingdanyiwancheng","link":{"type":2,"url":"\/shop\/pages\/order\/list?index=4"}}]},"id":1578137248488,"compontents":"ucenterCompoent"},{"title":"\u5fc5\u5907\u5de5\u5177","type":"moduleMenuShop","icon":"iconshop","isDelete":true,"addNumber":1,"attr":[{"title":"\u6a21\u677f\u540d\u79f0","type":"Switch","name":"isShowTitle"},{"title":"\u9009\u62e9\u6a21\u677f","type":"ChooseModule","name":"module","data":[{"title":"\u4e00\u884c\u591a\u5217","name":"module-menu-row","img":"http:\/\/longbingcdn.xiaochengxucms.com\/admin\/diy\/module-menu-col.jpg"},{"title":"\u4e00\u884c\u4e00\u5217","name":"module-menu-col","img":"http:\/\/longbingcdn.xiaochengxucms.com\/admin\/diy\/module-menu-row.jpg"}]},{"title":"\u4e00\u884c\u591a\u5c11\u5217","type":"InputNumber","name":"row"}],"data":{"isShowTitle":false,"module":"module-menu-row","row":{"number":4,"min":2,"max":5,"label":"\u8bf7\u8f93\u5165"},"list":[{"title":"\u6211\u7684\u552e\u540e","icon":"iconwodeshouhou","link":{"type":2,"url":"\/shop\/pages\/refund\/list"}},{"title":"\u6211\u7684\u6536\u5165","icon":"icontixianguanli","link":{"type":2,"url":"\/shop\/pages\/partner\/income"}},{"title":"\u6211\u7684\u4f18\u60e0\u5238","icon":"iconwodekaquan","link":{"type":2,"url":"\/shop\/pages\/coupon\/list"}},{"title":"\u5206\u9500\u5546\u54c1","icon":"iconquanmianfenxiao","link":{"type":2,"needStaffId":true,"url":"\/shop\/pages\/partner\/distribution?staff_id="}},{"title":"\u6211\u7684\u5730\u5740","icon":"icondizhi2","link":{"type":2,"url":"\/shop\/pages\/address\/list"}}]},"id":1578137252032,"compontents":"ucenterCompoent"},{"title":"\u5207\u6362\u9500\u552e","type":"changeStaff","icon":"iconqiehuanmingpian-copy","isDelete":false,"addNumber":1,"attr":[{"title":"\u6a21\u677f\u540d\u79f0","type":"Input","name":"title"},{"title":"\u662f\u5426\u663e\u793a\u66f4\u591a","type":"Switch","name":"isShowMore"}],"data":{"title":"\u5207\u6362\u9500\u552e","isShowMore":true},"dataList":[],"id":1578137250013,"compontents":"ucenterCompoent"}]}}'; + + $url = json_decode($url,true); + + foreach ($url as $k=>$v){ + + if(!in_array($k,$data)){ + + unset($url[$k]); + } + + } + + return $url; + + } + + + /** + * 获得拥有模块/app权限列表 + * + * @param $uniacid + * @return array + * @author shuixian + * @DataTime: 2019/12/20 13:39 + */ + public function getAuthList($uniacid){ + $denyAdminMenuKeys = [] ; + + + if(empty($uniacid)){ + return $denyAdminMenuKeys ; + } + + $adminModelListInfo = config('app.AdminModelList') ; + $saas_auth_admin_model_list = $adminModelListInfo['saas_auth_admin_model_list']; + + foreach ($saas_auth_admin_model_list as $key=>$item) { + + $className = 'Permission' . ucfirst($key); + $permissionPath = APP_PATH . $key . '/info/' . $className . '.php'; + if (file_exists($permissionPath) && require_once($permissionPath)) { + + $permissionClassName = 'app\\' . $key . '\\info\\'. $className; + $permission = new $permissionClassName($uniacid , $item); + + if ( $permission->pAuth() && !empty($permission->adminMenuKey)) { + $denyAdminMenuKeys[$key] = $item; + } + } + + } + + return $denyAdminMenuKeys ; + } + +} diff --git a/longbingcore/printer/API_PHP_DEMO.php b/longbingcore/printer/API_PHP_DEMO.php new file mode 100644 index 0000000..ec680eb --- /dev/null +++ b/longbingcore/printer/API_PHP_DEMO.php @@ -0,0 +1,263 @@ +"为换行,""为切刀指令(主动切纸,仅限切刀打印机使用才有效果) + //""为打印LOGO指令(前提是预先在机器内置LOGO图片),""为钱箱或者外置音响指令 + //成对标签: + //""为居中放大一倍,""为放大一倍,""为居中,字体变高一倍 + //字体变宽一倍,""为二维码,""为字体加粗,""为右对齐 + //拼凑订单内容时可参考如下格式 + //根据打印纸张的宽度,自行调整内容的格式,可参考下面的样例格式 + + $orderInfo = '测试打印
'; + $orderInfo .= '名称      单价 数量 金额
'; + $orderInfo .= '--------------------------------
'; + $orderInfo .= '饭       10.0 10 10.0
'; + $orderInfo .= '炒饭      10.0 10 10.0
'; + $orderInfo .= '蛋炒饭     10.0 100 100.0
'; + $orderInfo .= '鸡蛋炒饭    100.0 100 100.0
'; + $orderInfo .= '西红柿炒饭   1000.0 1 100.0
'; + $orderInfo .= '西红柿蛋炒饭  100.0 100 100.0
'; + $orderInfo .= '西红柿鸡蛋炒饭 15.0 1 15.0
'; + $orderInfo .= '备注:加辣
'; + $orderInfo .= '--------------------------------
'; + $orderInfo .= '合计:xx.0元
'; + $orderInfo .= '送货地点:广州市南沙区xx路xx号
'; + $orderInfo .= '联系电话:13888888888888
'; + $orderInfo .= '订餐时间:2014-08-08 08:08:08
'; + $orderInfo .= 'http://www.dzist.com';//把二维码字符串用标签套上即可自动生成二维码 + + + //打开注释可测试 + wp_print(SN,$orderInfo,2); + + + +//===========方法2.查询某订单是否打印成功============= + //***接口返回值说明*** + //正确例子: + //已打印:{"msg":"ok","ret":0,"data":true,"serverExecutedTime":6} + //未打印:{"msg":"ok","ret":0,"data":false,"serverExecutedTime":6} + + //打开注释可测试 + //$orderid = "xxxxxxxx_xxxxxxxxxx_xxxxxxxx";//订单ID,从方法1返回值中获取 + //queryOrderState($orderid); + + + + +//===========方法3.查询指定打印机某天的订单详情============ + //***接口返回值说明*** + //正确例子:{"msg":"ok","ret":0,"data":{"print":6,"waiting":1},"serverExecutedTime":9} + + //打开注释可测试 + //$date = "2017-04-02";//注意时间格式为"yyyy-MM-dd",如2016-08-27 + //queryOrderInfoByDate(SN,$date); + + + + +//===========方法4.查询打印机的状态========================== + //***接口返回值说明*** + //正确例子: + //{"msg":"ok","ret":0,"data":"离线","serverExecutedTime":9} + //{"msg":"ok","ret":0,"data":"在线,工作状态正常","serverExecutedTime":9} + //{"msg":"ok","ret":0,"data":"在线,工作状态不正常","serverExecutedTime":9} + + //打开注释可测试 + //queryPrinterStatus(SN); + + + + + + + + + + + +function addprinter($snlist){ + + $content = array( + 'user'=>USER, + 'stime'=>STIME, + 'sig'=>SIG, + 'apiname'=>'Open_printerAddlist', + + 'printerContent'=>$snlist + ); + + $client = new HttpClient(IP,PORT); + if(!$client->post(PATH,$content)){ + echo 'error'; + } + else{ + echo $client->getContent(); + } + +} + + + + + + +/* + * 方法1 + 拼凑订单内容时可参考如下格式 + 根据打印纸张的宽度,自行调整内容的格式,可参考下面的样例格式 +*/ +function wp_print($printer_sn,$orderInfo,$times){ + + $content = array( + 'user'=>USER, + 'stime'=>STIME, + 'sig'=>SIG, + 'apiname'=>'Open_printMsg', + + 'sn'=>$printer_sn, + 'content'=>$orderInfo, + 'times'=>$times//打印次数 + ); + + $client = new HttpClient(IP,PORT); + if(!$client->post(PATH,$content)){ + echo 'error'; + } + else{ + //服务器返回的JSON字符串,建议要当做日志记录起来 + echo $client->getContent(); + } + +} + + + + + +/* + * 方法2 + 根据订单索引,去查询订单是否打印成功,订单索引由方法1返回 +*/ +function queryOrderState($index){ + $msgInfo = array( + 'user'=>USER, + 'stime'=>STIME, + 'sig'=>SIG, + 'apiname'=>'Open_queryOrderState', + + 'orderid'=>$index + ); + + $client = new HttpClient(IP,PORT); + if(!$client->post(PATH,$msgInfo)){ + echo 'error'; + } + else{ + $result = $client->getContent(); + echo $result; + } + +} + + + + +/* + * 方法3 + 查询指定打印机某天的订单详情 +*/ +function queryOrderInfoByDate($printer_sn,$date){ + $msgInfo = array( + 'user'=>USER, + 'stime'=>STIME, + 'sig'=>SIG, + 'apiname'=>'Open_queryOrderInfoByDate', + + 'sn'=>$printer_sn, + 'date'=>$date + ); + + $client = new HttpClient(IP,PORT); + if(!$client->post(PATH,$msgInfo)){ + echo 'error'; + } + else{ + $result = $client->getContent(); + echo $result; + } + +} + + + +/* + * 方法4 + 查询打印机的状态 +*/ +function queryPrinterStatus($printer_sn){ + + $msgInfo = array( + 'user'=>USER, + 'stime'=>STIME, + 'sig'=>SIG, + 'apiname'=>'Open_queryPrinterStatus', + + 'sn'=>$printer_sn + ); + + $client = new HttpClient(IP,PORT); + if(!$client->post(PATH,$msgInfo)){ + echo 'error'; + } + else{ + $result = $client->getContent(); + echo $result; + } +} + + +?> diff --git a/longbingcore/printer/HttpClient.php b/longbingcore/printer/HttpClient.php new file mode 100644 index 0000000..aaaf1e3 --- /dev/null +++ b/longbingcore/printer/HttpClient.php @@ -0,0 +1,309 @@ +host = $host; + $this->port = $port; + } + function get($path, $data = false) { + $this->path = $path; + $this->method = 'GET'; + if ($data) { + $this->path .= '?'.$this->buildQueryString($data); + } + return $this->doRequest(); + } + function post($path, $data) { + $this->path = $path; + $this->method = 'POST'; + $this->postdata = $this->buildQueryString($data); + return $this->doRequest(); + } + function buildQueryString($data) { + $querystring = ''; + if (is_array($data)) { + foreach ($data as $key => $val) { + if (is_array($val)) { + foreach ($val as $val2) { + $querystring .= urlencode($key).'='.urlencode($val2).'&'; + } + } else { + $querystring .= urlencode($key).'='.urlencode($val).'&'; + } + } + $querystring = substr($querystring, 0, -1); // Eliminate unnecessary & + } else { + $querystring = $data; + } + return $querystring; + } + function doRequest() { + if (!$fp = @fsockopen($this->host, $this->port, $errno, $errstr, $this->timeout)) { + switch($errno) { + case -3: + $this->errormsg = 'Socket creation failed (-3)'; + case -4: + $this->errormsg = 'DNS lookup failure (-4)'; + case -5: + $this->errormsg = 'Connection refused or timed out (-5)'; + default: + $this->errormsg = 'Connection failed ('.$errno.')'; + $this->errormsg .= ' '.$errstr; + $this->debug($this->errormsg); + } + return false; + } + socket_set_timeout($fp, $this->timeout); + $request = $this->buildRequest(); + $this->debug('Request', $request); + fwrite($fp, $request); + $this->headers = array(); + $this->content = ''; + $this->errormsg = ''; + $inHeaders = true; + $atStart = true; + while (!feof($fp)) { + $line = fgets($fp, 4096); + if ($atStart) { + $atStart = false; + if (!preg_match('/HTTP\/(\\d\\.\\d)\\s*(\\d+)\\s*(.*)/', $line, $m)) { + $this->errormsg = "Status code line invalid: ".htmlentities($line); + $this->debug($this->errormsg); + return false; + } + $http_version = $m[1]; + $this->status = $m[2]; + $status_string = $m[3]; + $this->debug(trim($line)); + continue; + } + if ($inHeaders) { + if (trim($line) == '') { + $inHeaders = false; + $this->debug('Received Headers', $this->headers); + if ($this->headers_only) { + break; + } + continue; + } + if (!preg_match('/([^:]+):\\s*(.*)/', $line, $m)) { + continue; + } + $key = strtolower(trim($m[1])); + $val = trim($m[2]); + if (isset($this->headers[$key])) { + if (is_array($this->headers[$key])) { + $this->headers[$key][] = $val; + } else { + $this->headers[$key] = array($this->headers[$key], $val); + } + } else { + $this->headers[$key] = $val; + } + continue; + } + $this->content .= $line; + } + fclose($fp); + if (isset($this->headers['content-encoding']) && $this->headers['content-encoding'] == 'gzip') { + $this->debug('Content is gzip encoded, unzipping it'); + $this->content = substr($this->content, 10); + $this->content = gzinflate($this->content); + } + if ($this->persist_cookies && isset($this->headers['set-cookie']) && $this->host == $this->cookie_host) { + $cookies = $this->headers['set-cookie']; + if (!is_array($cookies)) { + $cookies = array($cookies); + } + foreach ($cookies as $cookie) { + if (preg_match('/([^=]+)=([^;]+);/', $cookie, $m)) { + $this->cookies[$m[1]] = $m[2]; + } + } + $this->cookie_host = $this->host; + } + if ($this->persist_referers) { + $this->debug('Persisting referer: '.$this->getRequestURL()); + $this->referer = $this->getRequestURL(); + } + if ($this->handle_redirects) { + if (++$this->redirect_count >= $this->max_redirects) { + $this->errormsg = 'Number of redirects exceeded maximum ('.$this->max_redirects.')'; + $this->debug($this->errormsg); + $this->redirect_count = 0; + return false; + } + $location = isset($this->headers['location']) ? $this->headers['location'] : ''; + $uri = isset($this->headers['uri']) ? $this->headers['uri'] : ''; + if ($location || $uri) { + $url = parse_url($location.$uri); + return $this->get($url['path']); + } + } + return true; + } + function buildRequest() { + $headers = array(); + $headers[] = "{$this->method} {$this->path} HTTP/1.0"; + $headers[] = "Host: {$this->host}"; + $headers[] = "User-Agent: {$this->user_agent}"; + $headers[] = "Accept: {$this->accept}"; + if ($this->use_gzip) { + $headers[] = "Accept-encoding: {$this->accept_encoding}"; + } + $headers[] = "Accept-language: {$this->accept_language}"; + if ($this->referer) { + $headers[] = "Referer: {$this->referer}"; + } + if ($this->cookies) { + $cookie = 'Cookie: '; + foreach ($this->cookies as $key => $value) { + $cookie .= "$key=$value; "; + } + $headers[] = $cookie; + } + if ($this->username && $this->password) { + $headers[] = 'Authorization: BASIC '.base64_encode($this->username.':'.$this->password); + } + if ($this->postdata) { + $headers[] = 'Content-Type: application/x-www-form-urlencoded'; + $headers[] = 'Content-Length: '.strlen($this->postdata); + } + $request = implode("\r\n", $headers)."\r\n\r\n".$this->postdata; + return $request; + } + function getStatus() { + return $this->status; + } + function getContent() { + return $this->content; + } + function getHeaders() { + return $this->headers; + } + function getHeader($header) { + $header = strtolower($header); + if (isset($this->headers[$header])) { + return $this->headers[$header]; + } else { + return false; + } + } + function getError() { + return $this->errormsg; + } + function getCookies() { + return $this->cookies; + } + function getRequestURL() { + $url = 'http://'.$this->host; + if ($this->port != 80) { + $url .= ':'.$this->port; + } + $url .= $this->path; + return $url; + } + function setUserAgent($string) { + $this->user_agent = $string; + } + function setAuthorization($username, $password) { + $this->username = $username; + $this->password = $password; + } + function setCookies($array) { + $this->cookies = $array; + } + function useGzip($boolean) { + $this->use_gzip = $boolean; + } + function setPersistCookies($boolean) { + $this->persist_cookies = $boolean; + } + function setPersistReferers($boolean) { + $this->persist_referers = $boolean; + } + function setHandleRedirects($boolean) { + $this->handle_redirects = $boolean; + } + function setMaxRedirects($num) { + $this->max_redirects = $num; + } + function setHeadersOnly($boolean) { + $this->headers_only = $boolean; + } + function setDebug($boolean) { + $this->debug = $boolean; + } + function quickGet($url) { + $bits = parse_url($url); + $host = $bits['host']; + $port = isset($bits['port']) ? $bits['port'] : 80; + $path = isset($bits['path']) ? $bits['path'] : '/'; + if (isset($bits['query'])) { + $path .= '?'.$bits['query']; + } + $client = new HttpClient($host, $port); + if (!$client->get($path)) { + return false; + } else { + return $client->getContent(); + } + } + function quickPost($url, $data) { + $bits = parse_url($url); + $host = $bits['host']; + $port = isset($bits['port']) ? $bits['port'] : 80; + $path = isset($bits['path']) ? $bits['path'] : '/'; + $client = new HttpClient($host, $port); + if (!$client->post($path, $data)) { + return false; + } else { + return $client->getContent(); + } + } + function debug($msg, $object = false) { + if ($this->debug) { + print '
HttpClient Debug: '.$msg; + if ($object) { + ob_start(); + print_r($object); + $content = htmlentities(ob_get_contents()); + ob_end_clean(); + print '
'.$content.'
'; + } + print '
'; + } + } +} + +?> \ No newline at end of file diff --git a/longbingcore/printer/Printer.php b/longbingcore/printer/Printer.php new file mode 100644 index 0000000..48c1bfd --- /dev/null +++ b/longbingcore/printer/Printer.php @@ -0,0 +1,167 @@ + +// +---------------------------------------------------------------------- +// | 修改者: anuo (本权限类在原3.2.3的基础上修改过来的) +// +---------------------------------------------------------------------- + +namespace longbingcore\printer; + +class Printer +{ + + + /* + * 飞鹅 打印/检查打印机状态 + * */ + public static function FeiePrintMsg($config , $orderInfo , $apiname = 'Open_printMsg',$time=1) + { + $content = array( + 'user' => $config['user'], + 'stime' => $_SERVER['REQUEST_TIME'], + 'sig' => sha1($config['user'] . $config['ukey'] . $_SERVER['REQUEST_TIME']), + 'apiname' => $apiname, + + 'sn' => $config['sn'], + 'content' => $orderInfo, + 'times' => $time + ); + return self::getStream($content); + + } + /* + * @param array $index 订单ID + * 根据订单索引,去查询订单是否打印成功 + * + * */ + public static function FeieQueryOrderState($config , $index){ + $msgInfo = array( + 'user' => $config['user'], + 'stime' => $_SERVER['REQUEST_TIME'], + 'sig' => sha1($config['user'] . $config['ukey'] . $_SERVER['REQUEST_TIME']), + 'apiname'=>'Open_queryOrderState', + 'orderid'=>$index + ); + return self::getStream($msgInfo); + } + + /** + * Request stream. + * @param array $msgInfo + * @return array + */ + protected static function getStream($msgInfo) + { + $client = new HttpClient('api.feieyun.cn',80); + if(!$client->post('/Api/Open/',$msgInfo)) + return ['code' => false]; + else + return json_decode($client->getContent(),true); + } +// 飞鹅 over + + + +// 易联云 + + /** + * 打印接口 + * @param int $partner 用户ID + * @param string $machine_code 打印机终端号 + * @param string $content 打印内容 + * @param string $apiKey API密钥 + * @param string $msign 打印机密钥 + */ + + public static function action_print($partner,$machine_code,$content,$apiKey,$msign) + { + $param = array( + "partner"=>$partner, + 'machine_code'=>$machine_code, + 'time'=>time(), + ); + + //获取签名 + $param['sign'] = self::generateSign($param,$apiKey,$msign); + $param['content'] = $content; + $str = self::getStr($param); + return json_decode(self::sendCmd('http://open.10ss.net:8888',$str) , true); + } + + /** + * 生成签名sign + * @param array $params 参数 + * @param string $apiKey API密钥 + * @param string $msign 打印机密钥 + * @return string sign + */ + + protected static function generateSign($params, $apiKey,$msign) + { + //所有请求参数按照字母先后顺序排 + ksort($params); + //定义字符串开始所包括的字符串 + $stringToBeSigned = $apiKey; + //把所有参数名和参数值串在一起 + foreach ($params as $k => $v) + { + $stringToBeSigned .= urldecode($k.$v); + } + unset($k, $v); + //定义字符串结尾所包括的字符串 + $stringToBeSigned .= $msign; + //使用MD5进行加密,再转化成大写 + return strtoupper(md5($stringToBeSigned)); + } + /** + * 生成字符串参数 + * @param array $param 参数 + * @return string 参数字符串 + */ + protected static function getStr($param) + { + $str = ''; + foreach ($param as $key => $value) { + $str=$str.$key.'='.$value.'&'; + } + $str = rtrim($str,'&'); + return $str; + } + + /** + * 发起请求 + * @param string $url 请求地址 + * @param string $data 请求数据包 + * @return string 请求返回数据 + */ + + protected static function sendCmd($url,$data) + { + $curl = curl_init(); // 启动一个CURL会话 + curl_setopt($curl, CURLOPT_URL, $url); // 要访问的地址 + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检测 + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); // 从证书中检查SSL加密算法是否存在 + curl_setopt($curl, CURLOPT_HTTPHEADER, array('Expect:')); //解决数据包大不能提交 + curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转 + curl_setopt($curl, CURLOPT_AUTOREFERER, 1); // 自动设置Referer + curl_setopt($curl, CURLOPT_POST, 1); // 发送一个常规的Post请求 + curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // Post提交的数据包 + curl_setopt($curl, CURLOPT_TIMEOUT, 30); // 设置超时限制防止死循 + curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容 + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回 + + $tmpInfo = curl_exec($curl); // 执行操作 + if (curl_errno($curl)) { + echo 'Errno'.curl_error($curl); + } + curl_close($curl); // 关键CURL会话 + return $tmpInfo; // 返回数据 + } +} diff --git a/longbingcore/tools/LongbingArr.php b/longbingcore/tools/LongbingArr.php new file mode 100644 index 0000000..84d1ddb --- /dev/null +++ b/longbingcore/tools/LongbingArr.php @@ -0,0 +1,112 @@ + $v){ + $arr = self::delBykey($arr , $v); + } + return $arr ; + } + + if(!array_key_exists($key, $arr)){ + return $arr; + } + $keys = array_keys($arr); + $index = array_search($key, $keys); + if($index !== FALSE){ + array_splice($arr, $index, 1); + } + return $arr; + } + + /** + * 删除多维数组,根据 + * + * @param $array + * @param $key + * @return array + * @author shuixian + * @DataTime: 2019/12/25 22:37 + * + * demo + * $details = array( + * 0 => array("id"=>"1", "name"=>"Mike", "num"=>"9876543210"), + * 1 => array("id"=>"2", "name"=>"Carissa", "num"=>"08548596258"), + * 2 => array("id"=>"1", "name"=>"Mathew", "num"=>"784581254"), + * ); + * $details = unique_multidim_array($details,'id'); + * Output will be like this : + * $details = array( + * 0 => array("id"=>"1","name"=>"Mike","num"=>"9876543210"), + * 1 => array("id"=>"2","name"=>"Carissa","num"=>"08548596258"), + * ); + */ + public static function unique_multidim_array($array, $key) { + $temp_array = array(); + $i = 0; + $key_array = array(); + + foreach($array as $val) { + if (!in_array($val[$key], $key_array)) { + $key_array[$i] = $val[$key]; + $temp_array[$i] = $val; + } + $i++; + } + return $temp_array; + } + + + /** + * 把所有的一级数组进行合并,主要用于 event 返回数据进行合并 + * + * @param $array + * @return mixed + * @author shuixian + * @DataTime: 2019/12/26 11:04 + * + * demo + * + * $array = [ [0,1,2] , [3,4] ]] ; + * LongbingArr::array_merge($array); + * $returnArray = [0,1,2,3,4] ; + */ + public static function array_merge($array){ + $returnArr = []; + foreach ($array as $item){ + if(!empty($item)) $returnArr = array_merge($returnArr,$item); + } + return $returnArr; + } + +} \ No newline at end of file diff --git a/longbingcore/tools/LongbingDefault.php b/longbingcore/tools/LongbingDefault.php new file mode 100644 index 0000000..311732d --- /dev/null +++ b/longbingcore/tools/LongbingDefault.php @@ -0,0 +1,53 @@ + $item ) + { + if ( is_array( $item ) ) + { + $data[ $index ] = formatDefaultImage( $item, $target, $default, $defaultArr ); + } + else + { + if ($index == $target && $item == '' && isset($defaultArr[$default])) + { + $data[$index] = $defaultArr[$default]; + } + } + } + return $data; + } +} \ No newline at end of file diff --git a/longbingcore/tools/LongbingImg.php b/longbingcore/tools/LongbingImg.php new file mode 100644 index 0000000..7929bb3 --- /dev/null +++ b/longbingcore/tools/LongbingImg.php @@ -0,0 +1,47 @@ + $item) { + $tmpTime = $item[$field]; + if ($tmpTime > $today) { + // $data[ $index ][ 'radar_time' ] = '今天 '; + $data[$index]['radar_group'] = '今天'; + $data[$index]['radar_time'] = date('H:i', $item[$field]); + } else if ($tmpTime > $Yesterday) { + // $data[ $index ][ 'radar_time' ] = '昨天 '; + $data[$index]['radar_group'] = '昨天'; + $data[$index]['radar_time'] = date('H:i', $item[$field]); + } else { + $thisYear = date('Y'); + $itemYear = date('Y', $item[$field]); + if ($thisYear == $itemYear) { + $data[$index]['radar_group'] = date('m-d', $item[$field]); + $data[$index]['radar_time'] = date(' H:i', $item[$field]); + } else { + $data[$index]['radar_group'] = date('Y-m-d', $item[$field]); + $data[$index]['radar_time'] = date(' H:i', $item[$field]); + } + + } + } + + return $data; + } + +} \ No newline at end of file diff --git a/longbingcore/wxcore/DadaApi.php b/longbingcore/wxcore/DadaApi.php new file mode 100644 index 0000000..456f003 --- /dev/null +++ b/longbingcore/wxcore/DadaApi.php @@ -0,0 +1,529 @@ +APP_KEY = $appkey; + + $this->APP_SECRET = $appsec; + + $this->SHOP_NO = $shop_no; + + $this->SOURCE_ID = $source_id; + + $this->incon = '?'; + + // dump($this->APP_KEY , $this->APP_SECRET, $this->SHOP_NO , $this->SOURCE_ID);exit; + + if(longbingIsWeiqin()){ + +// $url = substr($this->request->url(),0,strpos($this->request->url(), '&s=')); + + $params = $_GET; + + $i=$params['i']; + + $t=$params['t']; + + $v=$params['v']; + + $n=$params['m']; + + $this->call_back = "https://".$_SERVER['HTTP_HOST']."/app/index.php?i=$i&t=".$t."&v=".$v."&from=wxapp&c=entry&a=wxapp&do=api&core=core2&m=".$n."&s=restaurant/SendResult/dadaSend"; + +// $this->call_back = 'http://'. $_SERVER['HTTP_HOST'].$url.'&s=/restaurant/SendResult/dadaSend'; + + $this->incon = '&'; + }else{ + + $this->call_back = 'http://'. $_SERVER['HTTP_HOST'].'/restaurant/SendResult/dadaSend'; + + $this->incon = '?'; + + } + + } + + /** 新增订单 + * @return bool + */ + public function addOrder($data) + { + + $city_code = $this->cityCode($data['city']); + + if(!empty($city_code['code'])&&$city_code['code']==500){ + + return $city_code; + + } + + $arr = [ + + 'shop_no' => $this->SHOP_NO, + + 'origin_id' => $data['order_code'], + + 'city_code' => $city_code, + + 'is_prepay' => 0, + + 'cargo_price' => $data['pay_price'], + + 'receiver_name' => $data['address']['name'], + + 'receiver_address' => $data['address']['address'].$data['address']['info'], + + 'receiver_phone' => $data['address']['phone'], + + 'receiver_lat' => $data['address']['lat'], + + 'receiver_lng' => $data['address']['long'], + + 'callback' => $this->call_back.$this->incon.'id='.$data['id'], + + 'cargo_weight' => $data['weight'] + + ]; + + $res = self::getResult($this->API_ADDORDER,$arr); + + +// dump($this->SHOP_NO,$res);exit; + + return $res; + } + + /** + * 重新发布订单 + * 在调用新增订单后,订单被取消、过期或者投递异常的情况下,调用此接口,可以在达达平台重新发布订单。 + * @return bool + */ + public function reAddOrder($data) + { + + $arr = [ + + 'shop_no' => $this->SHOP_NO, + + 'origin_id' => $data['order_code'], + + 'city_code' => $this->cityCode($data['city']), + + 'is_prepay' => 0, + + 'cargo_price' => $data['pay_price'], + + 'receiver_name' => $data['address']['name'], + + 'receiver_address' => $data['address']['address'].$data['address']['info'], + + 'receiver_phone' => $data['address']['phone'], + + 'receiver_lat' => $data['address']['lat'], + + 'receiver_lng' => $data['address']['long'], + + 'callback' => $this->call_back.$this->incon.'id='.$data['id'], + + 'cargo_weight' => $data['weight'] + + ]; + return self::getResult($this->API_READDORDER,$arr); + } + + /** + * 查询订单运费接口 + * @return bool + */ + public function queryDeliverFee($data) + { + $data['shop_no'] = $this->SHOP_NO; + + $arr = [ + + 'shop_no' => $this->SHOP_NO, + + 'origin_id' => $data['id'], + + 'city_code' => $this->cityCode($data['city']), + + 'is_prepay' => 0, + + 'receiver_name' => $data['address']['name'], + + 'receiver_address' => $data['address']['address'].$data['address']['info'], + + 'receiver_phone' => $data['address']['phone'], + + 'receiver_lat' => $data['address']['lat'], + + 'receiver_lng' => $data['address']['long'], + + 'callback' => $this->call_back.$this->incon.'id='.$data['id'], + + 'cargo_weight' => $data['weight'] + + ]; + +// dump($this->call_back.'/id/'.$data['id']);exit; + return self::getResult($this->API_QUERYDELIVERFEE,$arr); + } + + /** + * 查询运费后发单接口 + */ + public function addAfterQuery($data) + { + + + return self::getResult($this->API_ADDAFTERQUERY,$data); + } + + + /** + * 查询运费后发单接口 + */ + public function orderInfo($data) + { + + $arr['order_id'] = $data['order_code']; +// dump($data);exit; +// $data['deliveryNo'] = ''; + return self::getResult($this->API_ORDERINFO,$arr); + } + + /** + * 取消订单(线上环境) + * 在订单待接单或待取货情况下,调用此接口可取消订单。注意:订单接单后1-15分钟取消订单,会扣除相应费用补贴给接单达达 + * @return bool + */ + public function formalCancel($data) + { +// $data['order_id'] = '12321'; +// $data['cancel_reason_id'] = '1'; +// $data['cancel_reason'] = ""; + return self::getResult($this->API_FORMALCANCEL,$data); + } + + /** + * 取消订单(仅在测试环境供调试使用) + * @return bool + */ + public function cancelOrder($data) + { +// $data['order_id'] = '12321'; + return self::getResult($this->API_CANCELORDER,$data); + } + + + /** + * 增加小费 + * 可以对待接单状态的订单增加小费。需要注意:订单的小费,以最新一次加小费动作的金额为准,故下一次增加小费额必须大于上一次小费额。 + * @return bool + */ + public function addTip($data) + { +// $data['order_id'] = '12321'; +// $data['tips'] = '2.5'; +// $data['city_code'] = '029'; +// $data['info'] = ''; + return self::getResult($this->API_ADDTIP,$data); + } + + /** + * 新增门店 + * @return bool + */ + public function addShop($data) + { +// $data['origin_shop_id'] = ''; +// $data['station_name'] = ''; +// $data['business'] = ''; +// $data['city_name'] = ''; +// $data['area_name'] = ''; +// $data['station_address'] = ''; +// $data['lng'] = ''; +// $data['lat'] = ''; +// $data['contact_name'] = ''; +// $data['phone'] = ''; +// $data['username'] = ''; +// $data['password'] = ''; + return self::getResult($this->API_ADDSHOP,$data); + } + + public function addMerchant($data) + { +// $data['mobile'] = ''; +// $data['city_name'] = ''; +// $data['enterprise_name'] = ''; +// $data['enterprise_address'] = ''; +// $data['contact_name'] = ''; +// $data['contact_phone'] = ''; + $this->SOURCE_ID = ''; + return self::getResult($this->API_ADDMERCHANT,$data); + + + } + + /** + * 获取取消订单原因列表 + * array {0 =>array{'reason' =>'没有达达接单','id' =>1},....} + */ + public function cancelReasons() + { + $res = self::getResult($this->API_CANCELREASONS); + var_dump($res); + } + + /** + * 接单(仅在测试环境供调试使用) + * @return bool + */ + public function acceptOrder($data) + { +// $data['order_id'] = '12321'; + return self::getResult($this->API_ACCEPTORDER,$data); + } + + /** + * 完成取货(仅在测试环境供调试使用) + * @return bool + */ + public function fetchOrder($data) + { +// $data['order_id'] = '12321'; + return self::getResult($this->API_FETCHORDER,$data); + } + + /** + * 完成订单(仅在测试环境供调试使用) + * @return bool + */ + public function finishOrder($data) + { +// $data['order_id'] = '12321'; + return self::getResult($this->API_FINISHORDER,$data); + } + + /** + * 订单过期(仅在测试环境供调试使用) + * @return bool + */ + public function expireOrder($data) + { +// $data['order_id'] = '12321'; + return self::getResult($this->API_EXPIREORDER,$data); + } + + /** + * 订单状态变化后,达达回调我们 + */ + public function processCallback() + { + $content = file_get_contents("php://input"); + //{"order_status":2,"cancel_reason":"","update_time":1482220973,"dm_id":666,"signature":"7a177ae4b1cf63d13261580e4f721cb9","dm_name":"测试达达","order_id":"12321","client_id":"","dm_mobile":"13546670420"} + if($content){ + $arr = json_decode($content,true); + + } + } + + /** 获取城市信息 + * @return bool + */ + public function cityCode($city){ + + $code = 0; + + $data = self::getResult($this->API_CITY_LIST); + + if(empty($data['result'])){ + + return $data; + } + + $city = str_replace('市','',$city); + + $found_key = array_search($city, array_column($data['result'], 'cityName')); + + if(!is_numeric($found_key)){ + + return ['code'=>500,'msg'=>'达达暂不支持该城市']; + } + + if(key_exists($found_key,$data['result'])){ + + $code = $data['result'][$found_key]['cityCode']; + } + + return $code; + } + + /** + * + * @param $param + * @param $time + * @return string + */ + private function sign($param,$time) + { + $tmpArr = array( + "app_key"=>$this->APP_KEY, + "body"=>$param, + "format"=>"json", + "source_id"=>$this->SOURCE_ID, + "timestamp"=>$time, + "v"=>$this->VERSION, + ); + +// dump($tmpArr);exit; + if(empty($this->SOURCE_ID)){ + unset($tmpArr['source_id']); + } + $str = ''; + foreach ($tmpArr as $k=>$v){ + $str .= $k.$v; + } + $str = $this->APP_SECRET.$str.$this->APP_SECRET; + $signature = md5($str); + +// dump($signature);exit; + return strtoupper($signature); + } + + private function getParam($data='') + { + if(empty($data)){ + $param = ''; + }else{ + $param = json_encode($data); + } + $time = time(); + $sign = self::sign($param,$time); + $tmpArr = array( + "app_key"=>$this->APP_KEY, + "body"=>$param, + "format"=>"json", + "signature"=>$sign, + "source_id"=>$this->SOURCE_ID, + "timestamp"=>$time, + "v"=>$this->VERSION, + ); + if(empty($this->SOURCE_ID)){ + unset($tmpArr['source_id']); + } + + return json_encode($tmpArr); + } + + /** 根据参数获取结果信息 + * @param $api + * @param string $data + * @return bool + */ + private function getResult($api,$data=''){ + $param = self::getParam($data); + + $url = $this->URL.$api; + $res = self::http_post($url,$param); + + if($res){ + $res = json_decode($res,true); +// if($res['status'] == $this->SUCCESS){ + return $res; +// } + } + return false; + } + + /** + * POST 请求 + * @param string $url + * @param array $param + * @param boolean $post_file 是否文件上传 + * @return string content + */ + private function http_post($url,$param,$post_file=false){ + $oCurl = curl_init(); + if(stripos($url,"https://")!==FALSE){ + curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, FALSE); + curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($oCurl, CURLOPT_SSLVERSION, 1); //CURL_SSLVERSION_TLSv1 + } + if (is_string($param) || $post_file) { + $strPOST = $param; + } else { + $aPOST = array(); + foreach($param as $key=>$val){ + $aPOST[] = $key."=".urlencode($val); + } + $strPOST = join("&", $aPOST); + } + curl_setopt($oCurl, CURLOPT_URL, $url); + curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1 ); + curl_setopt($oCurl, CURLOPT_POST,true); + curl_setopt($oCurl, CURLOPT_POSTFIELDS,$strPOST); + $header = array( + 'Content-Type: application/json', + ); + curl_setopt($oCurl, CURLOPT_HTTPHEADER, $header); + + $sContent = curl_exec($oCurl); + $aStatus = curl_getinfo($oCurl); + curl_close($oCurl); + if(intval($aStatus["http_code"])==200){ + return $sContent; + }else{ + return false; + } + } + + +} \ No newline at end of file diff --git a/longbingcore/wxcore/Excel.php b/longbingcore/wxcore/Excel.php new file mode 100644 index 0000000..188805b --- /dev/null +++ b/longbingcore/wxcore/Excel.php @@ -0,0 +1,298 @@ +load($filename); + //设置第一个Sheet + $objPHPExcel->setActiveSheetIndex(0); + + $sheet = $objPHPExcel->getSheet(0); + + $highestRow = $sheet->getHighestRow(); + + $highestColumn = $sheet->getHighestColumn(); + + for ($row = 2; $row <= $highestRow; $row++){ + //每一个文件 + $rowData = $sheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, NULL, TRUE, FALSE); + + $data[] = $rowData; + } + + return $data; + + } + + + + /** + * User: chenniang + * Date: 2019-09-10 10:47 + * @return \think\Response + * descption:phpExcel 导出方法 + */ + function excelExport($fileName = '', $headArr = [], $data = [],$type='',$status=0) { + require_once EXTEND_PATH.'PHPExcel/PHPExcel.php'; + + ini_set("memory_limit", "1024M"); // 设置php可使用内存 + + set_time_limit(30); + # 设置执行时间最大值 +// if(empty($fileName)){ + + $fileName .= ".xls"; +// } + + $objPHPExcel = new \PHPExcel(); + + $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); + + $objPHPExcel->getProperties(); + + $key = ord("A"); // 设置表头 + + //dump($headArr);exit; + $key2 = ord("@"); //64 + + foreach ($headArr as $v) { + + $e=mb_detect_encoding($v, array('UTF-8', 'GBK')); + + if($e!='UTF-8') { + + $v = mb_convert_encoding($v, "UTF-8", "GBK"); + } + + if($key > ord("Z")) + { + $colum = chr(ord("A")).chr(++$key2);//超过26个字母 AA1,AB1,AC1,AD1...BA1,BB1... + } + else + { + $colum = chr($key++); + } + + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($colum . '1', $v); + + } + $column = 2; + + $objActSheet = $objPHPExcel->getActiveSheet(0); + + if($type == 1){ + //合并名片的单元格 + $this->mergeCard($objPHPExcel); + } + + $fileName = iconv("utf-8", "GBK", $fileName); + + foreach ($data as $key => $rows) { // 行写入 + + $span = ord("A"); + + $key2 = ord("@"); //64 + + foreach ($rows as $keyName => $value) { // 列写入 + + if($span > ord("Z")) + { + $colum = chr(ord("A")).chr(++$key2);//超过26个字母 AA1,AB1,AC1,AD1...BA1,BB1... + } + else + { + $colum = chr($span); + } + + if(!empty($value)&&is_string($value)){ + + $e=mb_detect_encoding($value, array('UTF-8', 'GBK')); + + $value = $this->filterEmoji($value); + + if($e!='UTF-8'){ + + $value = mb_convert_encoding($value, "UTF-8", "GBK"); + } + + } + + $objActSheet->setCellValueExplicit($colum . $column, $value); + + $span++; + } + $column++; + } + + if(!empty($status)){ + + $this->mergeOrderExcel($objPHPExcel,$data,$status); + } + + ob_end_clean(); + + header('Content-Type: application/vnd.ms-excel'); + + header("Content-Disposition: attachment;filename=$fileName"); + + header('Cache-Control: max-age=0'); + + header('content-Type:application/vnd.ms-excel;charset=utf-8'); + + $objWriter->save('php://output');// 文件通过浏览器下载 + + return $fileName; + exit(); + } + + + /** + * @param $obj + * @param $data + * 合并订单单元格 + */ + public function mergeOrderExcel($obj,$data,$status=1){ + + foreach ($data as $k=>$v){ + + if(!empty($v)){ + + $v['key'] = $k+2; + + $newdata[$v[0]][] = $v; + + } + } + + switch ($status){ + case '1' : + $arr = ['A','E','F','G','H','I','J','K','L','M','N','O','P']; + break; + + case '2' : + $arr = ['A','E','F','G','H','I','J','K','L','M','N','O']; + break; + case '3' : + $arr = ['A','F','G','H','I','J','K','L']; + break; + + } + foreach ($newdata as $k=>$v){ + if(count($v)>1){ + $count = count($v)-1; + foreach ($arr as $value){ + $me = $value.$v[0]['key'].':'.$value.$v[$count]['key']; + + $obj->getActiveSheet()->mergeCells($me); + } + } + } + } + + + /** + * @param $str + * @return string|string[]|null + * 过滤表情包 + */ + public function filterEmoji($str) + { + $str = preg_replace_callback( + '/./u', + function (array $match) { + return strlen($match[0]) >= 4 ? '' : $match[0]; + }, + $str); + + return $str; + } + + /** + * @author chenniang + * @DataTime: 2020-04-15 15:19 + * @功能说明:合并订单导出的单元格 + */ + public function mergeCard($objPHPExcel){ + + + $arr = ['A','B','C','D']; + + foreach ($arr as $value){ + + $s_icon = $value.'1'.':'.$value.'2'; + + $h_icon = $value.'1'; + + $objPHPExcel->getActiveSheet()->mergeCells($s_icon); + + $objPHPExcel->getActiveSheet()->getstyle($s_icon)->getAlignment()->setVertical(\PHPExcel_Style_Alignment::VERTICAL_CENTER); + + $objPHPExcel->getActiveSheet()->getStyle($h_icon)->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER); + + } + + $arr2 = ['E1:F1','G1:H1','I1:J1','K1:L1','M1:N1','O1:P1']; + + foreach ($arr2 as $value){ + + + $objPHPExcel->getActiveSheet()->mergeCells($value); + + $objPHPExcel->getActiveSheet()->getstyle($value)->getAlignment()->setVertical(\PHPExcel_Style_Alignment::VERTICAL_CENTER); + + $objPHPExcel->getActiveSheet()->getStyle($value)->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER); + + } + + $arr3 = ['E2','F2','G2','H2','I2','J2','K2','L2','M2','N2','O2','P2']; + + foreach ($arr3 as $value){ + + $objPHPExcel->getActiveSheet()->getStyle($value)->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER); + + } + + return true; + } + + + + + + + + + +} \ No newline at end of file diff --git a/longbingcore/wxcore/PayModel.php b/longbingcore/wxcore/PayModel.php new file mode 100644 index 0000000..cb63318 --- /dev/null +++ b/longbingcore/wxcore/PayModel.php @@ -0,0 +1,178 @@ +pay_config = $pay_config; + + } + + + /** + * @author chenniang + * @DataTime: 2022-08-17 14:36 + * @功能说明: + */ + public function findOrder(){ + + $pay_config = $this->payConfig(); + + require_once EXTEND_PATH.'alipay/aop/AopClient.php'; + + require_once EXTEND_PATH.'alipay/aop/request/AlipayTradeQueryRequest.php'; + + $aop = new \AopClient (); + + $aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do'; + // $aop->gatewayUrl = 'https://openapi.alipaydev.com/gateway.do'; + + $aop->appId = $pay_config[ 'payment' ][ 'ali_appid' ]; + + $aop->rsaPrivateKey = $pay_config['payment']['ali_privatekey']; + + $aop->alipayrsaPublicKey=$pay_config['payment']['ali_publickey']; + $aop->apiVersion = '1.0'; + $aop->signType = 'RSA2'; + $aop->postCharset='UTF-8'; + $aop->format='json'; + $object = new \stdClass(); + $object->out_trade_no = '20150320010101001'; +//$object->trade_no = '2014112611001004680073956707'; + $json = json_encode($object); + $request = new \AlipayTradeQueryRequest(); + $request->setBizContent($json); + + $result = $aop->execute ( $request); + + return $result; + } + + + /** + * @author chenniang + * @DataTime: 2022-08-10 16:36 + * @功能说明:支付宝支付 + */ + public function aliPay($order_code,$price,$subject){ + + require_once EXTEND_PATH.'alipay/aop/AopClient.php'; + + require_once EXTEND_PATH.'alipay/aop/request/AlipayTradeAppPayRequest.php'; + + $pay_config = $this->payConfig(); + + $aop = new \AopClient (); + + $aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do'; + + $aop->gatewayUrl = 'https://openapi.alipaydev.com/gateway.do'; + + $aop->appId = $pay_config[ 'payment' ][ 'ali_appid' ]; + + $aop->rsaPrivateKey = $pay_config['payment']['ali_privatekey'];; + + $aop->alipayrsaPublicKey= $pay_config['payment']['ali_publickey'];; + + $aop->apiVersion = '1.0'; + + $aop->signType = 'RSA2'; + + $aop->postCharset='UTF-8'; + + $aop->format='json'; + + $object = new \stdClass(); + + $object->out_trade_no = $order_code; + + $object->total_amount = $price; + + $object->subject = $subject; + + $object->product_code ='QUICK_MSECURITY_PAY'; + + //$object->time_expire = date('Y-m-d H:i:s',time()); + + $json = json_encode($object); + + $request = new \AlipayTradeAppPayRequest(); + + $request->setNotifyUrl("https://".$_SERVER['HTTP_HOST'].'/index.php/shop/IndexWxPay/aliNotify'); + + $request->setBizContent($json); + + $result = $aop->sdkExecute ( $request); + + return $result; + + } + + + /** + * @author chenniang + * @DataTime: 2022-08-11 17:23 + * @功能说明:退款 + */ + public function aliRefund($order_code,$price){ + + require_once EXTEND_PATH.'alipay/aop/AopClient.php'; + + require_once EXTEND_PATH.'alipay/aop/request/AlipayTradeRefundRequest.php'; + + $pay_config = $this->payConfig(); + + $aop = new \AopClient (); + + $aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do'; + + $aop->appId = $pay_config[ 'payment' ][ 'ali_appid' ]; + + $aop->rsaPrivateKey = $pay_config['payment']['ali_privatekey'];; + + $aop->alipayrsaPublicKey= $pay_config['payment']['ali_publickey'];; + + $aop->apiVersion = '1.0'; + + $aop->signType = 'RSA2'; + + $aop->postCharset='UTF-8'; + + $aop->format='json'; + + $object = new \stdClass(); + + $object->trade_no = $order_code; + + $object->refund_amount = $price; + + $object->out_request_no = 'HZ01RF001'; + + $json = json_encode($object); + + $request = new \AlipayTradeRefundRequest(); + + $request->setBizContent($json); + + $result = $aop->execute ( $request); + + $result = !empty($result)?object_array($result):[]; + + return $result; + + } + + + + + +} \ No newline at end of file diff --git a/longbingcore/wxcore/PayNotify.php b/longbingcore/wxcore/PayNotify.php new file mode 100644 index 0000000..44f09b0 --- /dev/null +++ b/longbingcore/wxcore/PayNotify.php @@ -0,0 +1,72 @@ +app = $app; +// +// } + + + /** + * @author chenniang + * @DataTime: 2022-08-19 13:29 + * @功能说明:支付宝回调信息 + */ + public function aliNotify($arr){ + + switch ($arr['subject']){ + + case '余额充值': + //余额卡 + $order_model = new \app\farm\model\BalanceOrder(); + + break; + + case '认养商品': + //认养 + $order_model = new \app\farm\model\ClaimOrder(); + + break; + case '土地商品': + //土地 + $order_model = new \app\farm\model\LandOrder(); + + break; + + case '配送订单': + //配送订单 + $order_model = new \app\farm\model\SendOrder(); + + break; + + case '养殖商品': + //养殖订单 + $order_model = new \app\farm\model\BreedOrder(); + + break; + case '商场商品': + //商城订单 + $order_model = new \app\farm\model\ShopOrder(); + + break; + } + + $order_model->orderResult($arr['out_trade_no'],$arr['trade_no']); + + return true; + } + + + +} \ No newline at end of file diff --git a/longbingcore/wxcore/PospalApi.php b/longbingcore/wxcore/PospalApi.php new file mode 100644 index 0000000..44ffa2e --- /dev/null +++ b/longbingcore/wxcore/PospalApi.php @@ -0,0 +1,156 @@ +appId = '205871490509191130'; + $this->appId = '9C7F3BFC37E729D9A5D6798B2D358E28'; + + $this->url = 'https://area56-win.pospal.cn:443/'; + + $this->account_key = '0e73963b251112af12835cd7d6dbadca'; + } + + + /** + * @author chenniang + * @DataTime: 2022-02-17 17:42 + * @功能说明:获取令牌 + */ + + public function getToken(){ + + $url = 'https://api.ubibot.cn/accounts/generate_access_token?account_key='.$this->account_key; + + $key = 'ubibot_token'; + + $data = getCache($key); + + if(empty($data)){ + + $data = $this->request($url,[],'GET'); + + if(!empty($data['result'])&&$data['result']=='success'){ + + setCache($key,$data,60); + } + + } + + return $data; + } + + + /** + * @author chenniang + * @DataTime: 2022-02-17 17:54 + * @功能说明:获取空间列表 + */ + public function getRoomList(){ + + $url = 'https://api.ubibot.cn/channels?account_key='.$this->account_key; + + $data = $this->request($url,[],'GET'); + + return $data; + + } + + + /** + * @author chenniang + * @DataTime: 2022-02-17 17:57 + * @功能说明:获取空间详情 + */ + public function getRoomInfo($room_id){ + + $url = 'https://api.ubibot.cn/channels/'.$room_id.'?account_key='.$this->account_key; + + $data = $this->request($url,[],'GET'); + + return $data; + + + } + + + + + + /** + * @param $url + * @param $post_data + * @param string $post_type + * @功能说明:发送请求 + * @author chenniang + * @DataTime: 2021-10-26 14:38 + */ + public function request($url,$post_data,$post_type='POST'){ + + $curl = curl_init(); + + $post_data = json_encode($post_data); + + curl_setopt_array($curl, array( + CURLOPT_URL => $url, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => "", + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 30, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => $post_type, + CURLOPT_POSTFIELDS => $post_data, + CURLOPT_HTTPHEADER => array( + "Content-Type:application/json", + "User-Agent:openApi", + "Content-Type:application/json; charset=utf-8", + "accept-encoding:gzip,deflate", + "time-stamp:".time(), +// "data-signature:D2C3D3C7289EAE111277999D21196D4D", + "data-signature:".strtoupper(md5($this->appKey.$post_data)) + ), + )); + + $response = curl_exec($curl); + + $err = curl_error($curl); + + curl_close($curl); + + return json_decode($response,true); + +// if ($err) { +// echo "cURL Error #:" . $err; +// } else { +// echo $response; +// } + } + + + + + +} \ No newline at end of file diff --git a/longbingcore/wxcore/PushMsgModel.php b/longbingcore/wxcore/PushMsgModel.php new file mode 100644 index 0000000..c0f99b6 --- /dev/null +++ b/longbingcore/wxcore/PushMsgModel.php @@ -0,0 +1,241 @@ +dataInfo(['uniacid'=>$uniacid]); + + $this->app_key = $config['push_key']; + + $this->master_secret = $config['push_secret']; + + $this->url = 'https://api.jpush.cn/v3/push'; + } + + + + /* $receiver 接收者的信息 + all 字符串 该产品下面的所有用户. 对app_key下的所有用户推送消息 + tag(20个)Array标签组(并集): tag=>array('昆明','北京','曲靖','上海'); + tag_and(20个)Array标签组(交集): tag_and=>array('广州','女'); + alias(1000)Array别名(并集): alias=>array('93d78b73611d886a74*****88497f501','606d05090896228f66ae10d1*****310'); + registration_id(1000)注册ID设备标识(并集): registration_id=>array('20effc071de0b45c1a**********2824746e1ff2001bd80308a467d800bed39e'); + */ + //$content 推送的内容。 + //$m_type 推送附加字段的类型(可不填) http,tips,chat.... + //$m_txt 推送附加字段的类型对应的内容(可不填) 可能是url,可能是一段文字。 + //$m_time 保存离线时间的秒数默认为一天(可不传)单位为秒 + /** + * @param string $receiver 目标用户 + * @param string $content + * @param string $m_type + * @param string $m_txt + * @param string $m_time + * @功能说明: + * @author chenniang + * @DataTime: 2022-08-22 16:45 + * + * + */ + public function push($receiver='all',$content='',$m_type='',$m_txt='',$m_time='86400') + { + + if(empty($this->app_key)||empty($this->master_secret)){ + + return false; + } +// dump($this->app_key);exit; + $base64 = base64_encode("$this->app_key:$this->master_secret"); + $header = array("Authorization:Basic $base64", "Content-Type:application/json"); + $data = array(); + $data['platform'] = 'all'; //目标用户终端手机的平台类型android,ios,winphone + $data['audience'] = $receiver; //目标用户 + + $data['notification'] = array( + //统一的模式--标准模式 + "alert" => $content, + //安卓自定义 + "android" => array( + "alert" => $content, + "title" => "", + "builder_id" => 1, + "extras" => array("type" => $m_type, "txt" => $m_txt) + ), + //ios的自定义 + "ios" => array( + "alert" => $content, + "badge" => "1", + "sound" => "default", + "extras" => array("type" => $m_type, "txt" => $m_txt) + ) + ); + //苹果自定义---为了弹出值方便调测 + $data['message'] = array( + "msg_content"=>$content, + "extras"=>array("type"=>$m_type, "txt"=>$m_txt) + ); + + //附加选项 + $data['options'] = array( + "sendno"=>time(), + // "time_to_live"=>$m_time, //保存离线时间的秒数默认为一天 + "apns_production"=>false, //布尔类型 指定 APNS 通知发送环境:0开发环境,1生产环境。或者传递false和true + ); + $param = json_encode($data); + $res = $this->push_curl($param,$header); + + if($res){ //得到返回值--成功已否后面判断 + return $res; + }else{ //未得到返回值--返回失败 + return false; + } + + } + + + public function push_curl($param="",$header="") { + if (empty($param)) { return false; } + $postUrl = $this->url; + $curlPost = $param; + $ch = curl_init(); //初始化curl + curl_setopt($ch, CURLOPT_URL,$postUrl); //抓取指定网页 + curl_setopt($ch, CURLOPT_HEADER, 0); //设置header + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //要求结果为字符串且输出到屏幕上 + curl_setopt($ch, CURLOPT_POST, 1); //post提交方式 + curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost); + curl_setopt($ch, CURLOPT_HTTPHEADER,$header); // 增加 HTTP Header(头)里的字段 + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // 终止从服务端进行验证 + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); + $data = curl_exec($ch); //运行curl + curl_close($ch); + return $data; + } + + + /** + * @param $data + * @param $type + * @功能说明: + * @author chenniang + * @DataTime: 2022-08-23 13:54 + */ + public function sendMsg($data,$type){ + + $info_model = new SystemInfo(); + + $user_model = new User(); + //添加信息 + $info_model->infoAdd($data,$type); + + $data = $info_model->returnMsg($type,$data); + + $push_id = $user_model->where(['id'=>$data['user_id']])->value('push_id'); + + if(!empty($push_id)){ + + $push_id = ['registration_id'=>[$push_id]]; + //发送消息 + $this->send_pub($data['msg'],$push_id); + } + + return true; + } + + + /** + * @author chenniang + * @DataTime: 2022-08-22 16:46 + * @功能说明: + */ + public function send_pub($content,$receive='all'){ + //推送附加字段的类型 + $m_type = 'http'; + //推送附加字段的类型对应的内容(可不填) 可能是url,可能是一段文字。 + $m_txt = 'http://www.groex.cn/'; + //离线保留时间 + $m_time = '86400'; + + $result = $this->push($receive,$content,$m_type,$m_txt,$m_time); + + $res_arr=!empty($result)?json_decode($result, true):[]; + + return $res_arr; + + if($result){ + + $res_arr = json_decode($result, true); + + + if(isset($res_arr['error'])){ + //错误信息 + $error_code=$res_arr['error']['code']; + //错误码 + switch ($error_code) { + case 200: + $message= '发送成功!'; + break; + case 1000: + $message= '失败(系统内部错误)'; + break; + case 1001: + $message = '失败(只支持 HTTP Post 方法,不支持 Get 方法)'; + break; + case 1002: + $message= '失败(缺少了必须的参数)'; + break; + case 1003: + $message= '失败(参数值不合法)'; + break; + case 1004: + $message= '失败(验证失败)'; + break; + case 1005: + $message= '失败(消息体太大)'; + break; + case 1008: + $message= '失败(appkey参数非法)'; + break; + case 1020: + $message= '失败(只支持 HTTPS 请求)'; + break; + case 1030: + $message= '失败(内部服务超时)'; + break; + default: + $message= '失败(返回其他状态,目前不清楚额,请联系开发人员!)'; + break; + } + }else{ + $message="发送成功!"; + } + }else{ //接口调用失败或无响应 + $message='接口调用失败或无响应'; + } + + + } + + + +} \ No newline at end of file diff --git a/longbingcore/wxcore/WxMsg.php b/longbingcore/wxcore/WxMsg.php new file mode 100644 index 0000000..5adbdc5 --- /dev/null +++ b/longbingcore/wxcore/WxMsg.php @@ -0,0 +1,138 @@ +config = $this->getConfig($uniacid); + + $this->appid = $this->getAppid(); + +// $this->appsecret = $this->getAppsecret(); + + } + + + /** + * @author chenniang + * @DataTime: 2020-04-27 17:35 + * @功能说明:企业微信消息 + */ + public function WxMsg($to_user,$title='',$page='',$description='',$content_item=''){ + + $data = [ + //接受者 + 'touser' => $to_user, + //类型 + 'msgtype'=> 'miniprogram_notice', + + 'miniprogram_notice' => [ + + 'appid' => $this->appid , + //放大第一个字段 +// 'emphasis_first_item' => true, + ] + ]; + + + if(!empty($page)){ + //路径 + $data['miniprogram_notice']['page'] = $page; + } + if(!empty($title)){ + //标题 + $data['miniprogram_notice']['title'] = $title; + } + if(!empty($content_item)){ + //内容 + $data['miniprogram_notice']['content_item'] = $content_item; + } + if(!empty($description)){ + //描述 + $data['miniprogram_notice']['description'] = $description; + } + //初始化配置模型 + $service_model = new WxSetting(self::$uniacid); + //发送消息 + $result = $service_model->sendCompanyMsg($data); + + return $result; + } + + + /** + * 功能说明 获取appid + * + * @return mixed|null + * @author chenniang + * @DataTime: 2019-12-25 17:36 + */ + protected function getAppid() + { + if(isset($this->config['appid'])) return $this->config['appid']; + return null; + } + + /** + * 功能说明 获取appsecret + * + * @return mixed|null + * @author chenniang + * @DataTime: 2019-12-25 17:36 + */ + protected function getAppsecret() + { + if(isset($this->config['app_secret'])) return $this->config['app_secret']; + return null; + } + + /** + * 功能说明 获取配置信息 + * + * @param $uniacid + * @return array|bool|mixed|\think\Model|null + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author chenniang + * @DataTime: 2019-12-25 17:35 + */ + public function getConfig($uniacid) + { + //config key + $key = 'longbing_card_app_config_' . $uniacid; + //获取config + $config = getCache($key, $uniacid); + //判断缓存是否存在 + if(!empty($config)) return $config; + //获取数据 + $config = Db::name('longbing_card_config')->where(['uniacid'=>$uniacid])->find(); + + if(empty($config)){ + Db::name('longbing_card_config')->insert(['uniacid'=>$uniacid]); + $config = Db::name('longbing_card_config')->where(['uniacid'=>$uniacid])->find(); + } + //判断数据是否存在 + if(!empty($config)) setCache($key ,$config ,3600,$uniacid); + //返回数据 + return $config; + } + + + + + + +} \ No newline at end of file diff --git a/longbingcore/wxcore/WxPay.php b/longbingcore/wxcore/WxPay.php new file mode 100644 index 0000000..c560b6e --- /dev/null +++ b/longbingcore/wxcore/WxPay.php @@ -0,0 +1,113 @@ +where(['uniacid'=>$uniacid_id])->find(); + $config = Db::name( 'longbing_card_config')->where(['uniacid' => $uniacid_id])->find(); + if(empty($pay[ 'mch_id' ])||empty($pay[ 'pay_key' ])){ + + return [ + + 'result_code' => false, + + 'return_code' => false, + + 'err_code_des'=> '未配置支付信息' + ]; + } + $setting[ 'payment' ][ 'merchant_id' ] = $pay[ 'mch_id' ]; + $setting[ 'payment' ][ 'key' ] = $pay[ 'pay_key' ]; + $setting[ 'payment' ][ 'cert_path' ] = $pay[ 'cert_path' ]; + $setting[ 'payment' ][ 'key_path' ] = $pay[ 'key_path' ]; + $setting[ 'app_id' ] = $config['appid']; + $setting[ 'secret' ] = $config['app_secret']; + return $setting; + } + /** + * @param string $uid + * @param string $money + * @功能说明:提现 + * @author chenniang + * @DataTime: 2020-03-24 14:52 + */ + public function crteateMchPay($paymentApp,$openid,$money='') + { + + $money = $money*100; + + $payid = substr(md5('longbing1'.time()),0,11); + //没有配置支付信息 + if(empty($paymentApp['app_id'])||empty($paymentApp['payment']['merchant_id'])){ + + return $paymentApp; + + } + //没有openid + if(empty($openid)){ + + return [ + + 'result_code' => false, + + 'return_code' => false, + + 'err_code_des'=> '用户信息错误' + ]; + } + + $setting['mini_appid'] = $paymentApp['app_id']; + $setting['mini_appsecrept'] = $paymentApp['secret']; + $setting['mini_mid'] = $paymentApp['payment']['merchant_id']; + $setting['mini_apicode'] = $paymentApp['payment']['key']; + $setting['apiclient_cert'] = $paymentApp['payment']['cert_path']; + $setting['apiclient_cert_key'] = $paymentApp['payment']['key_path']; + + + define('WX_APPID', $setting['mini_appid']); + define('WX_MCHID', $setting['mini_mid']); + define('WX_KEY', $setting['mini_apicode']); + define('WX_APPSECRET', $setting['mini_appsecrept']); + define('WX_SSLCERT_PATH', $setting['apiclient_cert']); + define('WX_SSLKEY_PATH', $setting['apiclient_cert_key']); + define('WX_CURL_PROXY_HOST', '0.0.0.0'); + define('WX_CURL_PROXY_PORT', 0); + define('WX_REPORT_LEVENL', 0); + + require_once PAY_PATH . "weixinpay/lib/WxPay.Api.php"; + require_once PAY_PATH . "weixinpay/example/WxPay.JsApiPay.php"; + require_once PAY_PATH . "weixinpay/lib/WxMchPay.php"; + $payClass=new \WxMchPay(); + + $res=$payClass->MchPayOrder($openid,$money,$payid); + + return $res; + } + + + + + + + +} \ No newline at end of file diff --git a/longbingcore/wxcore/WxSetting.php b/longbingcore/wxcore/WxSetting.php new file mode 100644 index 0000000..ca7491b --- /dev/null +++ b/longbingcore/wxcore/WxSetting.php @@ -0,0 +1,449 @@ +uniacid = $uniacid; + + $this->config = $this->getConfig($this->uniacid); + + $this->appid = $this->getAppid(); + + $this->appsecret = $this->getAppsecret(); + } + + /** + * 功能说明 获取appid + * + * @return mixed|null + * @author chenniang + * @DataTime: 2019-12-25 17:36 + */ + protected function getAppid() + { + if(isset($this->config['appid'])) return $this->config['appid']; + return null; + } + + /** + * 功能说明 获取appsecret + * + * @return mixed|null + * @author chenniang + * @DataTime: 2019-12-25 17:36 + */ + protected function getAppsecret() + { + if(isset($this->config['appsecret'])) return $this->config['appsecret']; + return null; + } + + /** + * 功能说明 获取配置信息 + * + * @param $uniacid + * @return array|bool|mixed|\think\Model|null + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author chenniang + * @DataTime: 2019-12-25 17:35 + */ + public function getConfig($uniacid) + { + + $config = longbingGetAppConfig($uniacid); + //返回数据 + return $config; + } + + //检查信息是否存在 + public function checkConfig() + { + $result = true; + if(empty($this->uniacid) || empty($this->appid) || empty($this->appsecret)) $result = false; + return $result; + } + + /** + * 功能说明 获取token + * + * @return bool|null + * @author chenniang + * @DataTime: 2019-12-25 17:35 + */ + public function lbSingleGetAccessToken () + { + $key = "longbing_card_access_token"; + + $value = getCache( $key,$this->uniacid ); + + + if ( $value !=false ) + { + return $value; + } + + $uniacid = $this->uniacid; + //基础检查 + if(!$this->checkConfig()){ + + + return false; + } + //appid + $appid = $this->appid; + //appsecret + $appsecret = $this->appsecret; + + $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$appid&secret={$appsecret}"; + + + $accessToken = file_get_contents( $url ); + + // dump($accessToken);exit; + + if ( strstr( $accessToken, 'errcode' ) ) + { + return 0; + } + + $accessToken = json_decode( $accessToken, true ); + $accessToken = $accessToken[ 'access_token' ]; + + setCache( $key, $accessToken, 7000, $uniacid ); + + return $accessToken; + } + + + + /** + * User: chenniang + * Date: 2019-12-25 11:52 + * @param $data + * @return bool|string + * descrption:添加模版 返回模版消息id + */ + public function addTmpl($data){ + //获取token + $access_token = $this->lbSingleGetAccessToken(); +// dump($access_token);exit; + //添加模版的小程序地址 + $url = "https://api.weixin.qq.com/wxaapi/newtmpl/addtemplate?access_token={$access_token}"; + //请求 + $data = json_encode( $data, JSON_UNESCAPED_UNICODE ); + //返回模版消息id 是个array + $res = $this->curlPost( $url,$data ); + return $res; + } + + /** + * @author chenniang + * @DataTime: 2019-12-26 11:39 + * @功能说明:获取所有模版消息列表 + */ + public function getAllTpmlList(){ + //获取token + $access_token = $this->lbSingleGetAccessToken(); + //获取小程序所有 模版消息的url + $url = "https://api.weixin.qq.com/wxaapi/newtmpl/gettemplate?access_token={$access_token}"; + //请求 + $res = $this->curlPost($url,NULL,'GET'); + return $res; + } + + + /** + * @param $tpml_id + * @功能说明: 删除模版消息 + * @author chenniang + * @DataTime: 2019-12-26 14:08 + */ + public function deleteTmpl($tpml_id){ + //获取token + $access_token = $this->lbSingleGetAccessToken(); + //获取小程序所有 模版消息的url + $url = "https://api.weixin.qq.com/wxaapi/newtmpl/deltemplate?access_token={$access_token}"; + //请求参数 + $data['priTmplId'] = $tpml_id; + //请求 + $data = json_encode( $data, JSON_UNESCAPED_UNICODE ); + $res = $this->curlPost($url,$data); + return $res; + } + + /** + * @author chenniang + * @DataTime: 2019-12-26 18:54 + * @功能说明:发送模版消息 + */ + public function sendTmpl($data){ + //获取token + $access_token = $this->lbSingleGetAccessToken(); + //获取小程序所有 模版消息的url + $url = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token={$access_token}"; + //请求 + $data = json_encode( $data, JSON_UNESCAPED_UNICODE ); +// dump($data);exit; + $res = $this->curlPost($url,$data); + return $res; + } + + + /** + * @author chenniang + * @DataTime: 2019-12-26 18:54 + * @功能说明:获取当前账号下的所有模版消息 + */ + public function getUserTmpl(){ + //获取token + $access_token = $this->lbSingleGetAccessToken(); + //获取小程序所有 模版消息的url + $url = "https://api.weixin.qq.com/wxaapi/newtmpl/gettemplate?access_token={$access_token}"; + //请求 + $res = $this->curlPost($url,[],'GET'); + return $res; + } + + + /** + * @param array $data + * @功能说明:企业微信消息 + * @author chenniang + * @DataTime: 2020-04-27 18:33 + */ + public function sendCompanyMsg(array $data) + { + if (is_array($data)) { + $data = json_encode($data, JSON_UNESCAPED_UNICODE); + } + + $accessTokenWW = $this->companyMsgToken(); + + $url = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token={$accessTokenWW}"; + + $res = $this->curlPost($url, $data); + + + return $res; + } + + + /** + * @author chenniang + * @DataTime: 2020-04-28 13:40 + * @功能说明:获取企业消息token + */ + public function companyMsgToken(){ + + $key = "longbing_card_access_token_qy_cn"; + + $value = getCache($key,$this->uniacid); + + if ( $value !== false ) + { + return $value; + } + + $send_model = new SendConfig(); + //配置信息 + $config = $send_model->configInfo(['uniacid'=>$this->uniacid]); + + if (!empty($config['yq_corpid'])&& !empty($config['yq_corpsecret'] )) + { + $key = $config['yq_corpid']; + + $secret = $config['yq_corpsecret']; + + $url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=$key&corpsecret=$secret"; + + $accessToken = file_get_contents( $url ); + + $accessToken = json_decode( $accessToken, true ); + + if($accessToken['errcode'] != 0){ + + echo json_encode( [ 'code' => 402, 'error' => '获取token失败' ] ); + + exit; + } + $accessToken = $accessToken[ 'access_token' ]; + + setCache( $key, $accessToken, 7200, $this->uniacid ); + } + + return !empty($accessToken)?$accessToken:''; + } + /** + * 功能说明 post 请求 + * + * @param $url + * @param $post + * @param $method + * @param int $header + * @return bool|string + * @author chenniang + * @DataTime: 2019-12-25 18:40 + */ + public function curlPost($url,$post=NULL,$post_type='POST'){ + $result = $this->crulGetData($url,$post,$post_type); + return $result; + } + + + /** + * 功能说明 post 请求 + * + * @param $url + * @param $post + * @param $method + * @param int $header + * @return bool|string + * @author chenniang + * @DataTime: 2019-12-25 18:40 + */ + public function crulGetData($url, $post, $method, $header=1){ + $this->_errno = NULL; + $this->_error = NULL; + $ch = curl_init($url); + + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); + if($post != NULL) + curl_setopt($ch, CURLOPT_POSTFIELDS, $post); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION,true); + curl_setopt($ch, CURLOPT_AUTOREFERER,true); + curl_setopt($ch, CURLOPT_TIMEOUT, 120); + + if($header) + curl_setopt($ch, CURLOPT_HEADER, false); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array( + "Content-Type: application/json; charset=utf-8", + ) + ); + $result = curl_exec($ch); + return $result; + } + + /** + * @param $content + * @param $access_token + * @功能说明: 违禁词检测 + * @author chenniang + * @DataTime: 2020-01-02 17:07 + */ + public function wxContentRlue($content) + { + $access_token = $this->lbSingleGetAccessToken(); + + if(empty($access_token)){ + + return ['errcode'=>0]; + } + + $url = "https://api.weixin.qq.com/wxa/msg_sec_check?access_token={$access_token}"; + $tmp = [ + 'url' => $url, + 'data' => [ + 'content' => urlencode($content) + ], + ]; + $rest = $this->curlPost($tmp['url'], urldecode(json_encode($tmp['data']))); + $rest = json_decode($rest, true); + return $rest; + } + + + /** + * @param $img_path + * @功能说明:图片检测 + * @author chenniang + * @DataTime: 2020-03-27 11:44 + */ + function imgSecCheck($img_path){ + + //token + $access_token = $this->lbSingleGetAccessToken(); + //地址 + $url ='https://api.weixin.qq.com/wxa/img_sec_check?access_token='.$access_token; + //请求包 + $post_data = [ + 'media'=>new \CURLFile($img_path) + ]; + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); + + curl_setopt($ch, CURLOPT_URL,$url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); + curl_setopt($ch, CURLOPT_TIMEOUT, 100); + curl_setopt($ch, CURLOPT_POSTFIELDS,$post_data); + $output = curl_exec($ch); + curl_close($ch); + + return $output; + } + + + + /** + * @author chenniang + * @DataTime: 2022-03-14 18:56 + * @功能说明:php二维码 返回base64 + */ + public function phpQrCode($data){ + + require_once EXTEND_PATH.'phpqrcode/phpqrcode.php'; + + $errorCorrectionLevel = 'L'; //容错级别 + + $matrixPointSize = 10; + //生成图片大小 + ob_start(); + + \QRcode::png($data,false,$errorCorrectionLevel,$matrixPointSize,2,false,0xFFFFFF,0x000000); + + $imgstr = base64_encode(ob_get_contents()); + + ob_end_clean(); + + $imgstr = 'data:image/png;base64,'.$imgstr; + + return $imgstr; + + } + + + + + + + + + +} diff --git a/longbingcore/wxcore/WxTmpl.php b/longbingcore/wxcore/WxTmpl.php new file mode 100644 index 0000000..9a781db --- /dev/null +++ b/longbingcore/wxcore/WxTmpl.php @@ -0,0 +1,235 @@ + '模版名', 'model_name'=> '模块名', 'tid' => 模版消息的标题id, 'kidList' => [4,2,1,3] 模版消息的列表, 'sceneDesc' => '订单支付成功',]; + * @param $send_data + * @功能说明: 添加模版消息 + * @author chenniang + * @DataTime: 2019-12-26 14:18 + */ + + static public function addtmpl ($dis) + { + //查询数据库里的模版消息 + $tmpl = Db::name('longbing_card_tmpl_config')->where($dis)->find(); + //判断数据库里面有没有tmpl_id 没有就生成 + if(empty($tmpl['tmpl_id'])){ + //初始化配置模型 + $service_model = new WxSetting(self::$uniacid); + //生成模版消息的参数 + $send_data = [ + 'tid' => $tmpl['tid'], + 'kidList' => explode(',',$tmpl['kid']), + 'sceneDesc' => $tmpl['sceneDesc'] + ]; + //给客户的小程序添加模版 并返回模版id + $tmpl_info = $service_model->addTmpl($send_data); + $tmpl_info = json_decode($tmpl_info,true); + }else{ + //有数据就直接返回模版id + $tmpl_info['priTmplId'] = $tmpl['tmpl_id']; + $tmpl_info['errcode'] = 0; + + } + return $tmpl_info; + } + + + /** + * @author chenniang + * @DataTime: 2020-01-02 11:34 + * @功能说明:获取模版消息 需要发送的key + */ + static public function getTmplKey($tmpl_id){ + + if(empty($tmpl_id)){ + return []; + } + $cach_data = getCache($tmpl_id,self::$uniacid); + //如果有缓存直接返回 + if(!empty($cach_data)){ + return $cach_data; + } + //微信库类 + $service_model = new WxSetting(self::$uniacid); + //获取所有模版消息 + $data = $service_model->getUserTmpl(); + //没有返回空 + if(empty($data)){ + return []; + } + $data = json_decode($data,true); + //如果报错 直接返回 + if(empty($data['data'])){ + return []; + } + $data = $data['data']; + //找到该模版id 的模版 + $found_key = array_search($tmpl_id, array_column($data, 'priTmplId')); + + if(!is_numeric($found_key)){ + return []; + } + //获取该模版 + $tmpl = $data[$found_key]; + //获取该模版的内容 + $content = explode('{{',$tmpl['content']); + //转换格式 + foreach ($content as $k =>$value){ + if($k == 0){ + unset($content[$k]); + continue; + } + $content[$k] = substr($value,0,strpos($value, '.')); + } + //存入缓存 + setCache($tmpl_id,$content,86400,self::$uniacid); + return $content; + } + + /** + * @author chenniang + * @DataTime: 2019-12-26 15:04 + * @功能说明:模版参数 + */ + + static public function tmplParam($key){ + //订单支付通知 + $data['pay_order'] = [ + //标题id + 'tid' => 1754, + //内容的key(暂时不需要) + 'kidList' => 'thing4,amount2,character_string1,date3', + //模版场景类容 + 'sceneDesc' => '订单支付成功', + //自动生成模版时内容的顺序 + 'kid' => '4,2,1,3', + //模版内容的样板 + 'example' => '物品名称、金额、单号、支付时间', + ]; + //订单发货通知 + $data['send_order'] = [ + //标题id + 'tid' => 2414, + //内容的key(暂时不需要) + 'kidList' => '', + //模版场景类容 + 'sceneDesc' => '订单发货通知', + //自动生成模版时内容的顺序 + 'kid' => '1,2,3,4', + //模版内容的样板 + 'example' => '发货时间、订单编号、物流编号、物流公司', + ]; + + //IM 未读私信通知 + $data['land_order'] = [ + //标题id + 'tid' => 585, + //内容的key(暂时不需要) + 'kidList' => '', + //模版场景类容 + 'sceneDesc' => '土地订单通知', + //自动生成模版时内容的顺序 + 'kid' => '1,2,3,4,5', + //模版内容的样板 + 'example' => '订单编号、商品名称、商品详情、订单金额、下单时间', + ]; + + $data['land_over'] = [ + //标题id + 'tid' => 30781, + //内容的key(暂时不需要) + 'kidList' => '', + //模版场景类容 + 'sceneDesc' => '土地到期提醒', + //自动生成模版时内容的顺序 + 'kid' => '1,2,3,4', + //模版内容的样板 + 'example' => '土地名称、到期时间、单号、温馨提示', + ]; + + if(key_exists($key,$data)){ + + return $data[$key]; + + }else{ + + return []; + } + } + + /** + * @param $poenid + * @param $key_data + * @param $send_data + * @param $page + * @功能说明: 发送模版消息 + * @author chenniang + * @DataTime: 2019-12-26 11:22 + */ + static public function sendTmpl($poenid,$tmpl_id,$send_data,$page){ + //发送信息内容 + $data = [ + //用户openid + 'touser' => $poenid, + //模版id + 'template_id' => $tmpl_id, + //跳转页面 + 'page' => $page, + //发送内容 + 'data' => $send_data + ]; + //初始化配置模型 + $service_model = new WxSetting(self::$uniacid); + //发送消息 + $res = $service_model->sendTmpl($data); + return $res; + } + + + /** + * @param $str + * @功能说明:转utf 8 + * @author chenniang + * @DataTime: 2020-01-03 19:23 + */ + + static public function strToUtf8($str){ + + $encode = mb_detect_encoding($str, array("ASCII",'UTF-8',"GB2312","GBK",'BIG5')); + + if($encode == 'UTF-8'){ + return $str; + }else{ + return mb_convert_encoding($str, 'UTF-8', $encode); + } + } + + + + + + + + + + + +} \ No newline at end of file diff --git a/longbingcore/wxcore/YsCloudApi.php b/longbingcore/wxcore/YsCloudApi.php new file mode 100644 index 0000000..c6afce1 --- /dev/null +++ b/longbingcore/wxcore/YsCloudApi.php @@ -0,0 +1,284 @@ +uniacid= $uniacid; + + $config_model = new Config(); + + $config = $config_model->dataInfo(['uniacid'=>$uniacid]); + + $this->AppKey = $config['ys_appkey']; + + $this->Secret = $config['ys_secret']; + + } + + + /** + * @author chenniang + * @DataTime: 2022-02-17 17:42 + * @功能说明:获取令牌 + */ + + public function getToken(){ + + $url = 'https://open.ys7.com/api/lapp/token/get'; + + $key = 'yscloud_token'; + + $token = getCache($key,$this->uniacid); + + $post_data = [ + + 'appKey' => $this->AppKey, + + 'appSecret' => $this->Secret + ]; + + if(empty($token)){ + + $data = lbCurlPost($url,$post_data); + + $data = json_decode($data,true); + + if(!empty($data['code'])&&$data['code']==200){ + + $token = $data['data']['accessToken']; + + setCache($key,$token,86400*6,$this->uniacid); + + }else{ + + $token = ''; + } + + } + + return $token; + } + + + /** + * @author chenniang + * @DataTime: 2022-02-17 17:54 + * @功能说明:获取空间列表 + */ + public function getVideoList(){ + + $url = 'https://open.ys7.com/api/lapp/live/video/list'; + + $post_data = [ + + 'accessToken' => $this->getToken(), + + 'pageSize' => 100 + ]; + + $data = lbCurlPost($url,$post_data); + + $data = json_decode($data,true); + + return $data; + + } + + + /** + * @author chenniang + * @DataTime: 2022-02-17 17:57 + * @功能说明:获取空间详情 + */ + public function getVideoInfo($deviceSerial,$channelNo=1){ + + $url = 'https://open.ys7.com/api/lapp/v2/live/address/get'; + + $key = $deviceSerial.'-2'.$channelNo; + + $url_data = getCache($key,$this->uniacid); + + if(empty($url_data)){ + + $post_data = [ + + 'accessToken' => $this->getToken(), + + 'deviceSerial'=> $deviceSerial, + + 'channelNo' => $channelNo, + + 'protocol' => 2, + + 'quality' => 2 + ]; + + $data = lbCurlPost($url,$post_data); + + $data = @json_decode($data,true); + + if(isset($data['code'])&&$data['code']==200){ + + $url_data = $data['data']['url']; + + setCache($key,$url_data,86400,$this->uniacid); + } + + } + + return $url_data; + + } + + + /** + * @param $deviceSerial + * @param $direction + * @param int $channelNo + * @功能说明:开始转动 + * @author chenniang + * @DataTime: 2022-04-12 10:51 + */ + public function startTurn($deviceSerial,$direction,$channelNo=1) + { + $url='https://open.ys7.com/api/lapp/device/ptz/start'; + + $post_data = [ + + 'accessToken' => $this->getToken(), + + 'deviceSerial'=> $deviceSerial, + + 'channelNo' => $channelNo, + + 'direction' => $direction, + + 'speed' => 1 + ]; + + $data = lbCurlPost($url,$post_data); + + $data = json_decode($data,true); + + return $data; + } + + + + + /** + * @param $deviceSerial + * @param $direction + * @param int $channelNo + * @功能说明:停止转动 + * @author chenniang + * @DataTime: 2022-04-12 10:51 + */ + public function stopTurn($deviceSerial,$direction=0,$channelNo=1) + { + $url='https://open.ys7.com/api/lapp/device/ptz/stop'; + + $post_data = [ + + 'accessToken' => $this->getToken(), + + 'deviceSerial'=> $deviceSerial, + + 'channelNo' => $channelNo, + + 'direction' => $direction, + + ]; + + $data = lbCurlPost($url,$post_data); + + $data = json_decode($data,true); + + return $data; + } + + + + + /** + * @param $url + * @param $post_data + * @param string $post_type + * @功能说明:发送请求 + * @author chenniang + * @DataTime: 2021-10-26 14:38 + */ + public function request($url,$post_data,$post_type='POST'){ + + $curl = curl_init(); + + $post_data = json_encode($post_data); + + curl_setopt_array($curl, array( + CURLOPT_URL => $url, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => "", + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 30, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => $post_type, + CURLOPT_POSTFIELDS => $post_data, + CURLOPT_HTTPHEADER => array( + "Content-Type:application/json", + "User-Agent:openApi", + "Content-Type:application/json; charset=utf-8", + "accept-encoding:gzip,deflate", + "time-stamp:".time(), +// "data-signature:D2C3D3C7289EAE111277999D21196D4D", + "data-signature:".strtoupper(md5($this->appKey.$post_data)) + ), + )); + + $response = curl_exec($curl); + + $err = curl_error($curl); + + curl_close($curl); + + return json_decode($response,true); + +// if ($err) { +// echo "cURL Error #:" . $err; +// } else { +// echo $response; +// } + } + + + + + +} \ No newline at end of file diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..81fe165 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,8 @@ + + Options +FollowSymlinks -Multiviews + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L] + RewriteEngine on RewriteCond % !^$ + diff --git a/public/attachment/cert/1/23/06/1_apiclient_cert.pem b/public/attachment/cert/1/23/06/1_apiclient_cert.pem new file mode 100644 index 0000000..e59af5d --- /dev/null +++ b/public/attachment/cert/1/23/06/1_apiclient_cert.pem @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIID4zCCAsugAwIBAgIUMB7Mhez+wbxr7Pj7Db+5gLalVXEwDQYJKoZIhvcNAQEL +BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT +FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg +Q0EwHhcNMjExMTIzMDY1NjU2WhcNMjYxMTIyMDY1NjU2WjB1MRMwEQYDVQQDDAox +NjE2ODcxNTkwMRswGQYDVQQKDBLlvq7kv6HllYbmiLfns7vnu58xITAfBgNVBAsM +GOmCteatpuW4guWHr+iOieWwj+WQg+W6lzELMAkGA1UEBgwCQ04xETAPBgNVBAcM +CFNoZW5aaGVuMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxZRks4tG +g0aYe0IM5mK+HNYNlgWpjAx/RX6jo05ZSxSyc/YQheij3I9EAh2tL7uuJJ3D4pAm +hxpOeACP5TNwwxZRSTpjBqAm1Oyh2PAmD5gqQCWaq1+SCnPWqoIY5g/lLECEuO8G +nmjAP1JWKZD02SwddzeBKkuExRHm5DCF/1jkyh6rKn6Hpw2jSZ/E858odJSPdFbF +Ytcp/gr9Mqnax0d8bt8+X8/VwEUXwpVIUfdLuWHcYoGUWcTeYPp5fx3CB5z7lVwj +v27e17J+72pcXVYWBA+Y7scqiQVLqHjspJ56tc182/nzu594K+vpD8Gt017PJVH3 +8qf9V64Iz95oNwIDAQABo4GBMH8wCQYDVR0TBAIwADALBgNVHQ8EBAMCBPAwZQYD +VR0fBF4wXDBaoFigVoZUaHR0cDovL2V2Y2EuaXRydXMuY29tLmNuL3B1YmxpYy9p +dHJ1c2NybD9DQT0xQkQ0MjIwRTUwREJDMDRCMDZBRDM5NzU0OTg0NkMwMUMzRThF +QkQyMA0GCSqGSIb3DQEBCwUAA4IBAQCdyNEQhYvFwnT60nHk63F8ZIYfg9KQXtlg +seJviEq9JSKKxM7ONkyUq1AzVgxXN6y1SnSuoOcascTNCpqyvd6LURDIFFvDP6nB +ll6uT9WfVhZvL4rryE+GdhfO9eMF3+1Ojs8m4ZdtlRBrFHUa1nSu3rAjuLLXfnqz +e6fjlwZGHQ4RVJwnXcx41gdZlxRR3fhNqNrBDK4zew+jk83IVMyllylN4UUlM/AC +SdClTUoXBfZyd028yrNqzMNaA5qxxJ4NCsP6irNcb63wkVWEW4sHUZS3NW1iRCHp +aLqFlTGJkfztc37C97WVkefU89+JJO7HWyLSESNoETCMjlxYJI+K +-----END CERTIFICATE----- diff --git a/public/attachment/cert/1/23/06/1_apiclient_key.pem b/public/attachment/cert/1/23/06/1_apiclient_key.pem new file mode 100644 index 0000000..8dbb365 --- /dev/null +++ b/public/attachment/cert/1/23/06/1_apiclient_key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDFlGSzi0aDRph7 +QgzmYr4c1g2WBamMDH9FfqOjTllLFLJz9hCF6KPcj0QCHa0vu64kncPikCaHGk54 +AI/lM3DDFlFJOmMGoCbU7KHY8CYPmCpAJZqrX5IKc9aqghjmD+UsQIS47waeaMA/ +UlYpkPTZLB13N4EqS4TFEebkMIX/WOTKHqsqfoenDaNJn8Tznyh0lI90VsVi1yn+ +Cv0yqdrHR3xu3z5fz9XARRfClUhR90u5YdxigZRZxN5g+nl/HcIHnPuVXCO/bt7X +sn7valxdVhYED5juxyqJBUuoeOyknnq1zXzb+fO7n3gr6+kPwa3TXs8lUffyp/1X +rgjP3mg3AgMBAAECggEBAImul+H5ywBN4JH7/AtLgdmMXFlPxs9+Ie5mileRkG3e +lWBzdx4peI6JE0Y6MeZSbc68VbV66C47abT8B0ob55c65RgXZMxIK+cyorIO3yb8 +zWx4B+kmJxm7kTquf/VJ3FRS/Wn1vvICYv19PeenSMhRkpLyDcNQbsv5ZqFbIvVF +XinheICZkjyl5Ctu6seaqU3bCKgefVJ+nhWkC79HpPSLr4DYMYoStCdCYYGZVmWY +QYfd4zacEn1/Es174VV2/6prgy/fL93mXMjYmORsaJkY6LN3eXNao86a8sCWBHNI +ICj8B30G3xybMldtNJe8/Ztt/tcDOfiQ0WVydsiH59ECgYEA6nNFxTVmvxDXjSqz +Qo6IAzfP6+fY38GD1V3BQ+BND2WwoskHGrm7nCS/MFhw8QtM6pV2Oz/uJ/+snzCq +YdRxQwzo+S6/ljzKddEvdiZgfjWjO2CCg9fjU1bOET/kG7IRaTy583hoITUvBLFt +9QfEFt/DK3wF9jq5j4n5yb5+lXkCgYEA172JlUmYoMqttE7ESz6Zp4qJpKWJXQ0M +OftCgHUJRqhPmQS4UHr/vEddKJRL7WeCq0R4Mw5YBUj44dBb2Ssfib1YAfSxgf77 +us8tY3daTT+qR1hioFrP3fus0ccjFy2BzHIQDY/c2Keq0P9/XDGkZdPpKZ9uRgdn +CFjeStV97y8CgYAQXrwgaPojnSlv0etyWkFk+CCseCPMe9aYr1MvShoXWSJcO20j +kJRo8qfm2EYKjp9wQb9fo7cdU9zZwKwk6JB//gbGX11BQD1ivJhzx3o1Vclv++0h +B5H337fDvJJQ3L4aewMA3QdoSi5eRYVH9qLadgVKo/5GkxMh0qB+Va7BAQKBgQCY +lDYP3SMS5QUA9owhYz6snXBHf8OsiaPSBf+8dgl/bV4OLKZmVPc1I4uhPXCNkJ17 +n0sbYNOjuT48Bm5PIw6FDeKGT5aTB9DlB81kAW9eHt7A4qOuIUvOBUbuflY0+DxK +aYks7kgU+k/2zBw5CerpEXxfsZ/96xJVdvSQHHmahQKBgQCKKqz5A7Z/lN1SEi9m +rmMPOHC/qSrQa8witW+CeLlNfOzHjXMzvM4OZioNYCqKh6fCmR4yv9ZcsaGXvk/O +1DVqBTMKFHWfYP2Bk1eFM/+Igj0aMX37czjuVdRfZJ7dfF6owfDBG/LO1/HQa2eU +w+dP22zWuOfRcOpX/6kOQ8+Yiw== +-----END PRIVATE KEY----- diff --git a/public/attachment/image/1/23/06/03b10fec1405490ba6153f07477dcbcc.jpg b/public/attachment/image/1/23/06/03b10fec1405490ba6153f07477dcbcc.jpg new file mode 100644 index 0000000..435d6e6 Binary files /dev/null and b/public/attachment/image/1/23/06/03b10fec1405490ba6153f07477dcbcc.jpg differ diff --git a/public/attachment/image/1/23/06/086c16a78ffb43069f2bca84f9729ff6.jpg b/public/attachment/image/1/23/06/086c16a78ffb43069f2bca84f9729ff6.jpg new file mode 100644 index 0000000..30413c1 Binary files /dev/null and b/public/attachment/image/1/23/06/086c16a78ffb43069f2bca84f9729ff6.jpg differ diff --git a/public/attachment/image/1/23/06/0a09ad124c70434e8fe6a42d6b3b41ca.jpg b/public/attachment/image/1/23/06/0a09ad124c70434e8fe6a42d6b3b41ca.jpg new file mode 100644 index 0000000..e4ea134 Binary files /dev/null and b/public/attachment/image/1/23/06/0a09ad124c70434e8fe6a42d6b3b41ca.jpg differ diff --git a/public/attachment/image/1/23/06/0c5488718d41407b8990c11130e553f7.jpg b/public/attachment/image/1/23/06/0c5488718d41407b8990c11130e553f7.jpg new file mode 100644 index 0000000..88f0498 Binary files /dev/null and b/public/attachment/image/1/23/06/0c5488718d41407b8990c11130e553f7.jpg differ diff --git a/public/attachment/image/1/23/06/0e1ff450ad47442197c2883444e7fa17.jpg b/public/attachment/image/1/23/06/0e1ff450ad47442197c2883444e7fa17.jpg new file mode 100644 index 0000000..bd587e3 Binary files /dev/null and b/public/attachment/image/1/23/06/0e1ff450ad47442197c2883444e7fa17.jpg differ diff --git a/public/attachment/image/1/23/06/0e34803a148640d6ae6624317996884e.png b/public/attachment/image/1/23/06/0e34803a148640d6ae6624317996884e.png new file mode 100644 index 0000000..2b00d75 Binary files /dev/null and b/public/attachment/image/1/23/06/0e34803a148640d6ae6624317996884e.png differ diff --git a/public/attachment/image/1/23/06/17939d5d871c4784acdbad1ca8e92984.jpg b/public/attachment/image/1/23/06/17939d5d871c4784acdbad1ca8e92984.jpg new file mode 100644 index 0000000..7ffab52 Binary files /dev/null and b/public/attachment/image/1/23/06/17939d5d871c4784acdbad1ca8e92984.jpg differ diff --git a/public/attachment/image/1/23/06/1814648c72b644c8a4fe06159123cfe6.jpg b/public/attachment/image/1/23/06/1814648c72b644c8a4fe06159123cfe6.jpg new file mode 100644 index 0000000..1854f65 Binary files /dev/null and b/public/attachment/image/1/23/06/1814648c72b644c8a4fe06159123cfe6.jpg differ diff --git a/public/attachment/image/1/23/06/1c9d5ad2a66446339c2c68bb1d178ecf.png b/public/attachment/image/1/23/06/1c9d5ad2a66446339c2c68bb1d178ecf.png new file mode 100644 index 0000000..23f26bd Binary files /dev/null and b/public/attachment/image/1/23/06/1c9d5ad2a66446339c2c68bb1d178ecf.png differ diff --git a/public/attachment/image/1/23/06/23b4ff12897c4b4c8f3fb061d14f02ef.jpg b/public/attachment/image/1/23/06/23b4ff12897c4b4c8f3fb061d14f02ef.jpg new file mode 100644 index 0000000..3ce065b Binary files /dev/null and b/public/attachment/image/1/23/06/23b4ff12897c4b4c8f3fb061d14f02ef.jpg differ diff --git a/public/attachment/image/1/23/06/2469701ddce24c1ca09631e370f6f4a9.jpg b/public/attachment/image/1/23/06/2469701ddce24c1ca09631e370f6f4a9.jpg new file mode 100644 index 0000000..ad00c2d Binary files /dev/null and b/public/attachment/image/1/23/06/2469701ddce24c1ca09631e370f6f4a9.jpg differ diff --git a/public/attachment/image/1/23/06/26307c5c4be44d48bcf78ad97e99c508.png b/public/attachment/image/1/23/06/26307c5c4be44d48bcf78ad97e99c508.png new file mode 100644 index 0000000..0fad6cd Binary files /dev/null and b/public/attachment/image/1/23/06/26307c5c4be44d48bcf78ad97e99c508.png differ diff --git a/public/attachment/image/1/23/06/28a955b3a43142b3a1eaf5d7b0d1ea86.jpg b/public/attachment/image/1/23/06/28a955b3a43142b3a1eaf5d7b0d1ea86.jpg new file mode 100644 index 0000000..190b7c3 Binary files /dev/null and b/public/attachment/image/1/23/06/28a955b3a43142b3a1eaf5d7b0d1ea86.jpg differ diff --git a/public/attachment/image/1/23/06/2c8a48de2c89464aa81fbf7b18da1d9f.jpg b/public/attachment/image/1/23/06/2c8a48de2c89464aa81fbf7b18da1d9f.jpg new file mode 100644 index 0000000..8042501 Binary files /dev/null and b/public/attachment/image/1/23/06/2c8a48de2c89464aa81fbf7b18da1d9f.jpg differ diff --git a/public/attachment/image/1/23/06/41ffc3efe11441e486176b1a9b95c9b1.png b/public/attachment/image/1/23/06/41ffc3efe11441e486176b1a9b95c9b1.png new file mode 100644 index 0000000..9da6d97 Binary files /dev/null and b/public/attachment/image/1/23/06/41ffc3efe11441e486176b1a9b95c9b1.png differ diff --git a/public/attachment/image/1/23/06/4b272801bb0c4e139e6aa0bdeb61a082.jpg b/public/attachment/image/1/23/06/4b272801bb0c4e139e6aa0bdeb61a082.jpg new file mode 100644 index 0000000..bd587e3 Binary files /dev/null and b/public/attachment/image/1/23/06/4b272801bb0c4e139e6aa0bdeb61a082.jpg differ diff --git a/public/attachment/image/1/23/06/4e0d2e0fbd97437f9eb137600b07d95a.jpg b/public/attachment/image/1/23/06/4e0d2e0fbd97437f9eb137600b07d95a.jpg new file mode 100644 index 0000000..4c69f42 Binary files /dev/null and b/public/attachment/image/1/23/06/4e0d2e0fbd97437f9eb137600b07d95a.jpg differ diff --git a/public/attachment/image/1/23/06/4fb87021b3924782af9798e15caf569b.jpg b/public/attachment/image/1/23/06/4fb87021b3924782af9798e15caf569b.jpg new file mode 100644 index 0000000..af8be92 Binary files /dev/null and b/public/attachment/image/1/23/06/4fb87021b3924782af9798e15caf569b.jpg differ diff --git a/public/attachment/image/1/23/06/54501cfbc96f4306b3f57f3d8c687215.png b/public/attachment/image/1/23/06/54501cfbc96f4306b3f57f3d8c687215.png new file mode 100644 index 0000000..3fa0591 Binary files /dev/null and b/public/attachment/image/1/23/06/54501cfbc96f4306b3f57f3d8c687215.png differ diff --git a/public/attachment/image/1/23/06/547eb2a5fc1d4ee482150358f5d6fffd.jpg b/public/attachment/image/1/23/06/547eb2a5fc1d4ee482150358f5d6fffd.jpg new file mode 100644 index 0000000..0d10d9a Binary files /dev/null and b/public/attachment/image/1/23/06/547eb2a5fc1d4ee482150358f5d6fffd.jpg differ diff --git a/public/attachment/image/1/23/06/54a637550ab1402daf56d7ea8f06b601.jpg b/public/attachment/image/1/23/06/54a637550ab1402daf56d7ea8f06b601.jpg new file mode 100644 index 0000000..9b57817 Binary files /dev/null and b/public/attachment/image/1/23/06/54a637550ab1402daf56d7ea8f06b601.jpg differ diff --git a/public/attachment/image/1/23/06/5589db7cfea04db0b14e1d97a8b94382.jpg b/public/attachment/image/1/23/06/5589db7cfea04db0b14e1d97a8b94382.jpg new file mode 100644 index 0000000..a9f1b60 Binary files /dev/null and b/public/attachment/image/1/23/06/5589db7cfea04db0b14e1d97a8b94382.jpg differ diff --git a/public/attachment/image/1/23/06/56e6a7b7401d4e7a97f2fb4eeea377d7.jpg b/public/attachment/image/1/23/06/56e6a7b7401d4e7a97f2fb4eeea377d7.jpg new file mode 100644 index 0000000..f9b41b2 Binary files /dev/null and b/public/attachment/image/1/23/06/56e6a7b7401d4e7a97f2fb4eeea377d7.jpg differ diff --git a/public/attachment/image/1/23/06/56ee82441ed24985ab9b6e43cc6ddeb0.jpg b/public/attachment/image/1/23/06/56ee82441ed24985ab9b6e43cc6ddeb0.jpg new file mode 100644 index 0000000..4c463b8 Binary files /dev/null and b/public/attachment/image/1/23/06/56ee82441ed24985ab9b6e43cc6ddeb0.jpg differ diff --git a/public/attachment/image/1/23/06/57dfca41aa9c431780cb9b024d67ff65.jpg b/public/attachment/image/1/23/06/57dfca41aa9c431780cb9b024d67ff65.jpg new file mode 100644 index 0000000..50422b4 Binary files /dev/null and b/public/attachment/image/1/23/06/57dfca41aa9c431780cb9b024d67ff65.jpg differ diff --git a/public/attachment/image/1/23/06/582e44186ce54e33a7e6af3d9207b7ab.jpg b/public/attachment/image/1/23/06/582e44186ce54e33a7e6af3d9207b7ab.jpg new file mode 100644 index 0000000..1a80510 Binary files /dev/null and b/public/attachment/image/1/23/06/582e44186ce54e33a7e6af3d9207b7ab.jpg differ diff --git a/public/attachment/image/1/23/06/591c8ae4c84449c89c2bbb90b1780da7.jpg b/public/attachment/image/1/23/06/591c8ae4c84449c89c2bbb90b1780da7.jpg new file mode 100644 index 0000000..3302cde Binary files /dev/null and b/public/attachment/image/1/23/06/591c8ae4c84449c89c2bbb90b1780da7.jpg differ diff --git a/public/attachment/image/1/23/06/59fffc1610fc41f48126b8904e46927e.jpg b/public/attachment/image/1/23/06/59fffc1610fc41f48126b8904e46927e.jpg new file mode 100644 index 0000000..b4fdcdd Binary files /dev/null and b/public/attachment/image/1/23/06/59fffc1610fc41f48126b8904e46927e.jpg differ diff --git a/public/attachment/image/1/23/06/5aea5949ac6a4fdfb60c08c8205bbe0d.jpg b/public/attachment/image/1/23/06/5aea5949ac6a4fdfb60c08c8205bbe0d.jpg new file mode 100644 index 0000000..38507cb Binary files /dev/null and b/public/attachment/image/1/23/06/5aea5949ac6a4fdfb60c08c8205bbe0d.jpg differ diff --git a/public/attachment/image/1/23/06/61d9917ba69841e58a3dd041ef0921f9.jpg b/public/attachment/image/1/23/06/61d9917ba69841e58a3dd041ef0921f9.jpg new file mode 100644 index 0000000..6076c23 Binary files /dev/null and b/public/attachment/image/1/23/06/61d9917ba69841e58a3dd041ef0921f9.jpg differ diff --git a/public/attachment/image/1/23/06/650cdd659ab740f5840118d91ea923a1.jpg b/public/attachment/image/1/23/06/650cdd659ab740f5840118d91ea923a1.jpg new file mode 100644 index 0000000..9c3fde0 Binary files /dev/null and b/public/attachment/image/1/23/06/650cdd659ab740f5840118d91ea923a1.jpg differ diff --git a/public/attachment/image/1/23/06/69a2adc422c84e6aae94d6d3890e21c2.jpeg b/public/attachment/image/1/23/06/69a2adc422c84e6aae94d6d3890e21c2.jpeg new file mode 100644 index 0000000..8774bc6 Binary files /dev/null and b/public/attachment/image/1/23/06/69a2adc422c84e6aae94d6d3890e21c2.jpeg differ diff --git a/public/attachment/image/1/23/06/6a8470d56d0e44feb522c081807b63cb.jpg b/public/attachment/image/1/23/06/6a8470d56d0e44feb522c081807b63cb.jpg new file mode 100644 index 0000000..802e607 Binary files /dev/null and b/public/attachment/image/1/23/06/6a8470d56d0e44feb522c081807b63cb.jpg differ diff --git a/public/attachment/image/1/23/06/6b650630dd1e43a3acb52df9dfc819a3.png b/public/attachment/image/1/23/06/6b650630dd1e43a3acb52df9dfc819a3.png new file mode 100644 index 0000000..abb8b4d Binary files /dev/null and b/public/attachment/image/1/23/06/6b650630dd1e43a3acb52df9dfc819a3.png differ diff --git a/public/attachment/image/1/23/06/6c6f0a94e0e6407b92ace66770a8414f.jpg b/public/attachment/image/1/23/06/6c6f0a94e0e6407b92ace66770a8414f.jpg new file mode 100644 index 0000000..8c7b282 Binary files /dev/null and b/public/attachment/image/1/23/06/6c6f0a94e0e6407b92ace66770a8414f.jpg differ diff --git a/public/attachment/image/1/23/06/6f44a1cd6b9b4519b801528b0604de70.jpg b/public/attachment/image/1/23/06/6f44a1cd6b9b4519b801528b0604de70.jpg new file mode 100644 index 0000000..f8a2a63 Binary files /dev/null and b/public/attachment/image/1/23/06/6f44a1cd6b9b4519b801528b0604de70.jpg differ diff --git a/public/attachment/image/1/23/06/704181275e384829ae06c713f72ff06e.jpg b/public/attachment/image/1/23/06/704181275e384829ae06c713f72ff06e.jpg new file mode 100644 index 0000000..bead3d1 Binary files /dev/null and b/public/attachment/image/1/23/06/704181275e384829ae06c713f72ff06e.jpg differ diff --git a/public/attachment/image/1/23/06/707193112c8147d6a5d43f8b323748aa.jpg b/public/attachment/image/1/23/06/707193112c8147d6a5d43f8b323748aa.jpg new file mode 100644 index 0000000..f202781 Binary files /dev/null and b/public/attachment/image/1/23/06/707193112c8147d6a5d43f8b323748aa.jpg differ diff --git a/public/attachment/image/1/23/06/7592730a3fae4ec7af3f392e5c00fd6a.jpg b/public/attachment/image/1/23/06/7592730a3fae4ec7af3f392e5c00fd6a.jpg new file mode 100644 index 0000000..e78cd18 Binary files /dev/null and b/public/attachment/image/1/23/06/7592730a3fae4ec7af3f392e5c00fd6a.jpg differ diff --git a/public/attachment/image/1/23/06/75d7ac7ab3c2491bbf47caf16caf3a1c.png b/public/attachment/image/1/23/06/75d7ac7ab3c2491bbf47caf16caf3a1c.png new file mode 100644 index 0000000..20b102c Binary files /dev/null and b/public/attachment/image/1/23/06/75d7ac7ab3c2491bbf47caf16caf3a1c.png differ diff --git a/public/attachment/image/1/23/06/75d80ec263c34c719f14b100d4027c92.jpg b/public/attachment/image/1/23/06/75d80ec263c34c719f14b100d4027c92.jpg new file mode 100644 index 0000000..7fa38b2 Binary files /dev/null and b/public/attachment/image/1/23/06/75d80ec263c34c719f14b100d4027c92.jpg differ diff --git a/public/attachment/image/1/23/06/7e7530002efb4325afb6fe7a1ed707fd.jpg b/public/attachment/image/1/23/06/7e7530002efb4325afb6fe7a1ed707fd.jpg new file mode 100644 index 0000000..eece0d2 Binary files /dev/null and b/public/attachment/image/1/23/06/7e7530002efb4325afb6fe7a1ed707fd.jpg differ diff --git a/public/attachment/image/1/23/06/81ec1ea456df4b3bbbb7e46b332a6cbd.jpg b/public/attachment/image/1/23/06/81ec1ea456df4b3bbbb7e46b332a6cbd.jpg new file mode 100644 index 0000000..32ee596 Binary files /dev/null and b/public/attachment/image/1/23/06/81ec1ea456df4b3bbbb7e46b332a6cbd.jpg differ diff --git a/public/attachment/image/1/23/06/88e150cee743410bb2ade5d78d2c9440.jpg b/public/attachment/image/1/23/06/88e150cee743410bb2ade5d78d2c9440.jpg new file mode 100644 index 0000000..11be1e6 Binary files /dev/null and b/public/attachment/image/1/23/06/88e150cee743410bb2ade5d78d2c9440.jpg differ diff --git a/public/attachment/image/1/23/06/8e3e8967305441be9ba620d0a7a34e22.jpg b/public/attachment/image/1/23/06/8e3e8967305441be9ba620d0a7a34e22.jpg new file mode 100644 index 0000000..4f98a2f Binary files /dev/null and b/public/attachment/image/1/23/06/8e3e8967305441be9ba620d0a7a34e22.jpg differ diff --git a/public/attachment/image/1/23/06/8ec538b4d0134e6fa9cf37a4ba270f8e.jpg b/public/attachment/image/1/23/06/8ec538b4d0134e6fa9cf37a4ba270f8e.jpg new file mode 100644 index 0000000..8aaf2a5 Binary files /dev/null and b/public/attachment/image/1/23/06/8ec538b4d0134e6fa9cf37a4ba270f8e.jpg differ diff --git a/public/attachment/image/1/23/06/92c9e46f487f437b8a28ba9c1eff32de.jpg b/public/attachment/image/1/23/06/92c9e46f487f437b8a28ba9c1eff32de.jpg new file mode 100644 index 0000000..44f75ac Binary files /dev/null and b/public/attachment/image/1/23/06/92c9e46f487f437b8a28ba9c1eff32de.jpg differ diff --git a/public/attachment/image/1/23/06/9538432fc3fc4331b16142218d6ad1b0.jpg b/public/attachment/image/1/23/06/9538432fc3fc4331b16142218d6ad1b0.jpg new file mode 100644 index 0000000..6891312 Binary files /dev/null and b/public/attachment/image/1/23/06/9538432fc3fc4331b16142218d6ad1b0.jpg differ diff --git a/public/attachment/image/1/23/06/9929d84d01e346c9a4193350a44f9d85.jpg b/public/attachment/image/1/23/06/9929d84d01e346c9a4193350a44f9d85.jpg new file mode 100644 index 0000000..c369128 Binary files /dev/null and b/public/attachment/image/1/23/06/9929d84d01e346c9a4193350a44f9d85.jpg differ diff --git a/public/attachment/image/1/23/06/9a756318140a4648842da161749aeb28.jpg b/public/attachment/image/1/23/06/9a756318140a4648842da161749aeb28.jpg new file mode 100644 index 0000000..1498e58 Binary files /dev/null and b/public/attachment/image/1/23/06/9a756318140a4648842da161749aeb28.jpg differ diff --git a/public/attachment/image/1/23/06/9a7dc3a560cb46ef96af3cc8f0a80e57.jpg b/public/attachment/image/1/23/06/9a7dc3a560cb46ef96af3cc8f0a80e57.jpg new file mode 100644 index 0000000..af4b837 Binary files /dev/null and b/public/attachment/image/1/23/06/9a7dc3a560cb46ef96af3cc8f0a80e57.jpg differ diff --git a/public/attachment/image/1/23/06/9b921cc6d6c3487bb87060fce25846fe.jpg b/public/attachment/image/1/23/06/9b921cc6d6c3487bb87060fce25846fe.jpg new file mode 100644 index 0000000..31c1a13 Binary files /dev/null and b/public/attachment/image/1/23/06/9b921cc6d6c3487bb87060fce25846fe.jpg differ diff --git a/public/attachment/image/1/23/06/9e3d5ab2144e47dba315f3e585f35085.jpg b/public/attachment/image/1/23/06/9e3d5ab2144e47dba315f3e585f35085.jpg new file mode 100644 index 0000000..cc47dd9 Binary files /dev/null and b/public/attachment/image/1/23/06/9e3d5ab2144e47dba315f3e585f35085.jpg differ diff --git a/public/attachment/image/1/23/06/9ebdeb6f8dbc4e11a2bc9ff8d3b1fb79.jpg b/public/attachment/image/1/23/06/9ebdeb6f8dbc4e11a2bc9ff8d3b1fb79.jpg new file mode 100644 index 0000000..487e8d4 Binary files /dev/null and b/public/attachment/image/1/23/06/9ebdeb6f8dbc4e11a2bc9ff8d3b1fb79.jpg differ diff --git a/public/attachment/image/1/23/06/a28c4f1235944dafb6a4920be0d55285.jpg b/public/attachment/image/1/23/06/a28c4f1235944dafb6a4920be0d55285.jpg new file mode 100644 index 0000000..485e348 Binary files /dev/null and b/public/attachment/image/1/23/06/a28c4f1235944dafb6a4920be0d55285.jpg differ diff --git a/public/attachment/image/1/23/06/aba8f3086f424ecb93ee9df24995efb6.jpg b/public/attachment/image/1/23/06/aba8f3086f424ecb93ee9df24995efb6.jpg new file mode 100644 index 0000000..a1f7038 Binary files /dev/null and b/public/attachment/image/1/23/06/aba8f3086f424ecb93ee9df24995efb6.jpg differ diff --git a/public/attachment/image/1/23/06/afa1f076417b471898ef1d61f6d65958.jpg b/public/attachment/image/1/23/06/afa1f076417b471898ef1d61f6d65958.jpg new file mode 100644 index 0000000..c22d47e Binary files /dev/null and b/public/attachment/image/1/23/06/afa1f076417b471898ef1d61f6d65958.jpg differ diff --git a/public/attachment/image/1/23/06/b062e773d50243538ae8c376c965b554.jpg b/public/attachment/image/1/23/06/b062e773d50243538ae8c376c965b554.jpg new file mode 100644 index 0000000..ce401e9 Binary files /dev/null and b/public/attachment/image/1/23/06/b062e773d50243538ae8c376c965b554.jpg differ diff --git a/public/attachment/image/1/23/06/b3e04c4fc43847718195f4c663389ce8.jpg b/public/attachment/image/1/23/06/b3e04c4fc43847718195f4c663389ce8.jpg new file mode 100644 index 0000000..69c9143 Binary files /dev/null and b/public/attachment/image/1/23/06/b3e04c4fc43847718195f4c663389ce8.jpg differ diff --git a/public/attachment/image/1/23/06/b678369edb484891839203e552bcd3a6.jpg b/public/attachment/image/1/23/06/b678369edb484891839203e552bcd3a6.jpg new file mode 100644 index 0000000..13b741d Binary files /dev/null and b/public/attachment/image/1/23/06/b678369edb484891839203e552bcd3a6.jpg differ diff --git a/public/attachment/image/1/23/06/ba1243c159d54606a0ebd2d808d139a3.jpg b/public/attachment/image/1/23/06/ba1243c159d54606a0ebd2d808d139a3.jpg new file mode 100644 index 0000000..44db319 Binary files /dev/null and b/public/attachment/image/1/23/06/ba1243c159d54606a0ebd2d808d139a3.jpg differ diff --git a/public/attachment/image/1/23/06/bb67323fe24a4311bf9b405fff10d109.jpg b/public/attachment/image/1/23/06/bb67323fe24a4311bf9b405fff10d109.jpg new file mode 100644 index 0000000..290c212 Binary files /dev/null and b/public/attachment/image/1/23/06/bb67323fe24a4311bf9b405fff10d109.jpg differ diff --git a/public/attachment/image/1/23/06/bcabee4e7e114a4d99ee8b046643d591.jpg b/public/attachment/image/1/23/06/bcabee4e7e114a4d99ee8b046643d591.jpg new file mode 100644 index 0000000..0e2180d Binary files /dev/null and b/public/attachment/image/1/23/06/bcabee4e7e114a4d99ee8b046643d591.jpg differ diff --git a/public/attachment/image/1/23/06/bcc6e12049574fa5b4c5293b68f0edef.jpg b/public/attachment/image/1/23/06/bcc6e12049574fa5b4c5293b68f0edef.jpg new file mode 100644 index 0000000..c349871 Binary files /dev/null and b/public/attachment/image/1/23/06/bcc6e12049574fa5b4c5293b68f0edef.jpg differ diff --git a/public/attachment/image/1/23/06/c0928b2b83f94a7ba6d58bd431f59b60.jpg b/public/attachment/image/1/23/06/c0928b2b83f94a7ba6d58bd431f59b60.jpg new file mode 100644 index 0000000..6a59992 Binary files /dev/null and b/public/attachment/image/1/23/06/c0928b2b83f94a7ba6d58bd431f59b60.jpg differ diff --git a/public/attachment/image/1/23/06/c46638db672c4ad0811d4a64fdbbe163.jpg b/public/attachment/image/1/23/06/c46638db672c4ad0811d4a64fdbbe163.jpg new file mode 100644 index 0000000..ec7c9eb Binary files /dev/null and b/public/attachment/image/1/23/06/c46638db672c4ad0811d4a64fdbbe163.jpg differ diff --git a/public/attachment/image/1/23/06/c5c4ad68898240e0886f518c9d70df38.png b/public/attachment/image/1/23/06/c5c4ad68898240e0886f518c9d70df38.png new file mode 100644 index 0000000..a1f7038 Binary files /dev/null and b/public/attachment/image/1/23/06/c5c4ad68898240e0886f518c9d70df38.png differ diff --git a/public/attachment/image/1/23/06/cb6230c4577543679b766910a1f82fb2.jpg b/public/attachment/image/1/23/06/cb6230c4577543679b766910a1f82fb2.jpg new file mode 100644 index 0000000..9b13f45 Binary files /dev/null and b/public/attachment/image/1/23/06/cb6230c4577543679b766910a1f82fb2.jpg differ diff --git a/public/attachment/image/1/23/06/d202c2cc748c4662b0aad24be330b905.jpg b/public/attachment/image/1/23/06/d202c2cc748c4662b0aad24be330b905.jpg new file mode 100644 index 0000000..8cbe9e0 Binary files /dev/null and b/public/attachment/image/1/23/06/d202c2cc748c4662b0aad24be330b905.jpg differ diff --git a/public/attachment/image/1/23/06/d382833e0d3344cbac85ac45af178e36.jpg b/public/attachment/image/1/23/06/d382833e0d3344cbac85ac45af178e36.jpg new file mode 100644 index 0000000..9949ea7 Binary files /dev/null and b/public/attachment/image/1/23/06/d382833e0d3344cbac85ac45af178e36.jpg differ diff --git a/public/attachment/image/1/23/06/d676b26e950946228df99f4ff342a717.jpg b/public/attachment/image/1/23/06/d676b26e950946228df99f4ff342a717.jpg new file mode 100644 index 0000000..bf14c55 Binary files /dev/null and b/public/attachment/image/1/23/06/d676b26e950946228df99f4ff342a717.jpg differ diff --git a/public/attachment/image/1/23/06/d72f1739fdc145d08d4d8ca44c36ae4b.jpg b/public/attachment/image/1/23/06/d72f1739fdc145d08d4d8ca44c36ae4b.jpg new file mode 100644 index 0000000..7901bef Binary files /dev/null and b/public/attachment/image/1/23/06/d72f1739fdc145d08d4d8ca44c36ae4b.jpg differ diff --git a/public/attachment/image/1/23/06/db8af6401cb64a71807c605ff32d7cfa.jpg b/public/attachment/image/1/23/06/db8af6401cb64a71807c605ff32d7cfa.jpg new file mode 100644 index 0000000..a926609 Binary files /dev/null and b/public/attachment/image/1/23/06/db8af6401cb64a71807c605ff32d7cfa.jpg differ diff --git a/public/attachment/image/1/23/06/dcbcfad289ec4a748ec9be3097fb4fa6.jpg b/public/attachment/image/1/23/06/dcbcfad289ec4a748ec9be3097fb4fa6.jpg new file mode 100644 index 0000000..0d10d9a Binary files /dev/null and b/public/attachment/image/1/23/06/dcbcfad289ec4a748ec9be3097fb4fa6.jpg differ diff --git a/public/attachment/image/1/23/06/df1ef46eb9044b05a5d23e949ad43c07.jpg b/public/attachment/image/1/23/06/df1ef46eb9044b05a5d23e949ad43c07.jpg new file mode 100644 index 0000000..9435faa Binary files /dev/null and b/public/attachment/image/1/23/06/df1ef46eb9044b05a5d23e949ad43c07.jpg differ diff --git a/public/attachment/image/1/23/06/e1421b37abcc434fa3c4706a21d3855b.png b/public/attachment/image/1/23/06/e1421b37abcc434fa3c4706a21d3855b.png new file mode 100644 index 0000000..0be012c Binary files /dev/null and b/public/attachment/image/1/23/06/e1421b37abcc434fa3c4706a21d3855b.png differ diff --git a/public/attachment/image/1/23/06/e2fb5fc36c2d4f0abdaf7bbc66034537.jpg b/public/attachment/image/1/23/06/e2fb5fc36c2d4f0abdaf7bbc66034537.jpg new file mode 100644 index 0000000..64577a1 Binary files /dev/null and b/public/attachment/image/1/23/06/e2fb5fc36c2d4f0abdaf7bbc66034537.jpg differ diff --git a/public/attachment/image/1/23/06/ef6931b593904841aad25acc1ff18455.jpg b/public/attachment/image/1/23/06/ef6931b593904841aad25acc1ff18455.jpg new file mode 100644 index 0000000..75db14c Binary files /dev/null and b/public/attachment/image/1/23/06/ef6931b593904841aad25acc1ff18455.jpg differ diff --git a/public/attachment/image/1/23/06/f0b307f6ebde4184857d3c19373f1dd5.jpg b/public/attachment/image/1/23/06/f0b307f6ebde4184857d3c19373f1dd5.jpg new file mode 100644 index 0000000..39e13bf Binary files /dev/null and b/public/attachment/image/1/23/06/f0b307f6ebde4184857d3c19373f1dd5.jpg differ diff --git a/public/attachment/image/1/23/06/f19fbeca3d8a495384ca6e9535e4705e.jpg b/public/attachment/image/1/23/06/f19fbeca3d8a495384ca6e9535e4705e.jpg new file mode 100644 index 0000000..aa500ca Binary files /dev/null and b/public/attachment/image/1/23/06/f19fbeca3d8a495384ca6e9535e4705e.jpg differ diff --git a/public/attachment/image/1/23/06/f64e8626b78e435283e065d8f57be267.jpg b/public/attachment/image/1/23/06/f64e8626b78e435283e065d8f57be267.jpg new file mode 100644 index 0000000..cceb9cc Binary files /dev/null and b/public/attachment/image/1/23/06/f64e8626b78e435283e065d8f57be267.jpg differ diff --git a/public/attachment/image/1/23/06/fde0a523866f4903a091e033cf2c6bea.jpg b/public/attachment/image/1/23/06/fde0a523866f4903a091e033cf2c6bea.jpg new file mode 100644 index 0000000..ac842b0 Binary files /dev/null and b/public/attachment/image/1/23/06/fde0a523866f4903a091e033cf2c6bea.jpg differ diff --git a/public/attachment/image/1/23/06/ffdc8790b33640eeb96d4b3a3c947af3.jpg b/public/attachment/image/1/23/06/ffdc8790b33640eeb96d4b3a3c947af3.jpg new file mode 100644 index 0000000..abd13fc Binary files /dev/null and b/public/attachment/image/1/23/06/ffdc8790b33640eeb96d4b3a3c947af3.jpg differ diff --git a/public/auth.php b/public/auth.php new file mode 100644 index 0000000..83cf37b --- /dev/null +++ b/public/auth.php @@ -0,0 +1,24 @@ + +// +---------------------------------------------------------------------- + +// [ 应用入口文件 ] +namespace think; + +require __DIR__ . '/../vendor/autoload.php'; + +// 执行HTTP应用并响应 +$http = (new App())->http; + +$response = $http->name('auth')->run(); + +$response->send(); + +$http->end($response); diff --git a/public/demo/ezuikit-talk.js b/public/demo/ezuikit-talk.js new file mode 100644 index 0000000..fb321c6 --- /dev/null +++ b/public/demo/ezuikit-talk.js @@ -0,0 +1,181 @@ +/** + * ezuikit-talk v0.0.1-beta + */ +(function (global, factory) { + + "use strict"; + + if (typeof module === "object" && typeof module.exports === "object") { + module.exports = global.document ? + factory(global, true) : + function (w) { + if (!w.document) { + throw new Error("EZUIPlayer requires a window with a document"); + } + return factory(w); + }; + } else { + factory(global); + } + + // Pass this if window is not defined yet +})(typeof window !== "undefined" ? window : this, function (window, noGlobal) { + // 加载js + function addJs(filepath, callback) { + var oJs = document.createElement("script"); + oJs.setAttribute("src", filepath); + oJs.onload = callback; + document.getElementsByTagName("head")[0].appendChild(oJs); + } + // 通用请求方法 + function request(url, method, params, header, success, error) { + var _url = url; + var http_request = new XMLHttpRequest(); + http_request.onreadystatechange = function () { + if (http_request.readyState == 4) { + if (http_request.status == 200) { + var _data = JSON.parse(http_request.responseText); + success(_data); + } + } + }; + http_request.open(method, _url, true); + // http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + var data = new FormData(); + for (i in params) { + data.append(i, params[i]); + } + http_request.send(data); + }; + var EZUITalk = function (params) { + console.log("params",params); + // this.opt = { + // apiDomain: 'https://test12open.ys7.com/api/lapp/live/talk/url' + // } + this.opt = { + apiDomain: 'https://open.ys7.com/api/lapp/live/talk/url', + filePath: '', + accessToken: undefined, + deviceSerial: undefined, + channelNo: undefined, + talkLink: '', + rtcUrl: '', + ttsUrl: '', + stream: '', + } + if(params.accessToken){ + this.opt.accessToken = params.accessToken; + } + if(params.url){ + this.opt.deviceSerial = params.url.split("/")[3]; + this.opt.channelNo = params.url.split("/")[4].split(".")[0]; + } + if(params.filePath){ + this.opt.filePath = params.filePath; + } + var _this = this; + function apiSuccess(data){ + console.log("data",data); + if(data.code == 200){ + var apiResult = data.data; + if(apiResult){ + // 临时将https转换为websocket + var rtcTrunk = apiResult.rtcUrl; + if(rtcTrunk.indexOf("ws") === -1){ + rtcTrunk = rtcTrunk.replace("https","wss").replace("rtcgw","rtcgw-ws"); + } + _this.opt.rtcUrl = rtcTrunk; + _this.opt.ttsUrl = "tts://" + apiResult.ttsUrl; + var talk = "talk://" + _this.opt.deviceSerial + ":0:" + _this.opt.channelNo + ":cas.ys7.com:6500"; + _this.opt.talkLink = _this.opt.ttsUrl + "/" + talk; + _this.opt.stream = apiResult.stream; + console.log("_this.opt",_this.opt) + // 加载依赖 + // this.init(); + var adapeterJS = _this.opt.filePath + '/adapeter.js'; + var janusJS = _this.opt.filePath + '/janus.js'; + var ttsJS = _this.opt.filePath + '/tts.js'; + console.log("加载jquery.js"); + addJs(adapeterJS,function(){ + console.log("加载adapeter.js"); + addJs(janusJS,function(){ + console.log("加载janus.js"); + addJs(ttsJS,function(){ + console.log("加载tts.js"); + // 文件加载完毕; + + }) + }) + }) + } + + } + } + function apiError(err){ + if(params.handleError){ + params.handleError(err); + } + + } + request( + this.opt.apiDomain, + 'POST', + { + accessToken: this.opt.accessToken, + deviceSerial: this.opt.deviceSerial, + channelNo: this.opt.channelNo + }, + '', + apiSuccess, + apiError + ); + + console.log("this.opt",this.opt) + } + // EZUITalk.prototype.init = function () { + // console.log(); + + // $.ajax({ + // type: 'POST', + // url: 'https://test12open.ys7.com/api/lapp/live/talk/url', + // // contentType: "application/json;charset=utf-8", + // dataType: 'json', + // data: { + // accessToken: accessToken, + // deviceSerial: serial, + // channelNo: channelNo, + // }, + // success: function (data) { + // log("对讲api调用成功" + JSON.stringify(data)); + // if (data.code == 200) { + // var result = data.data; + // ttsUrl = result.ttsUrl, + // rtcUrl = "wss://test12.ys7.com/rtcgw-ws", //result.ttsUrl + // stream = result.stream; + // $('#tts_url').attr("value", matchTalkLink); + // $("#start").attr('disabled', false); + // } else { + // } + // }, + // error: function (err) { + // }, + // }) + // } + + // this.prototype.init = function(){ + // var adapeterJS = this.opt.filepath + '/js/adapeter.js'; + // addJs(adapeterJS,function(){ + // console.log("加载adapeter.js") + // }) + // } + EZUITalk.prototype.startTalk = function(){ + window.startTalk(); + } + EZUITalk.prototype.stopTalk = function(){ + window.stopTalk(); + } + if (!noGlobal) { + window.EZUITalk = EZUITalk; + } + return EZUITalk; +}) \ No newline at end of file diff --git a/public/demo/ezuikit.js b/public/demo/ezuikit.js new file mode 100644 index 0000000..fb0518b --- /dev/null +++ b/public/demo/ezuikit.js @@ -0,0 +1,2080 @@ +/** + * jssdk 3.0 + */ +(function (global, factory) { + + "use strict"; + + if (typeof module === "object" && typeof module.exports === "object") { + module.exports = global.document ? + factory(global, true) : + function (w) { + if (!w.document) { + throw new Error("EZUIPlayer requires a window with a document"); + } + return factory(w); + }; + } else { + factory(global); + } + + // Pass this if window is not defined yet +})(typeof window !== "undefined" ? window : this, function (window, noGlobal) { + + /** + * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed + */ + !function (a, b) { function c(a, b) { var c = a.createElement("p"), d = a.getElementsByTagName("head")[0] || a.documentElement; return c.innerHTML = "x", d.insertBefore(c.lastChild, d.firstChild) } function d() { var a = t.elements; return "string" == typeof a ? a.split(" ") : a } function e(a, b) { var c = t.elements; "string" != typeof c && (c = c.join(" ")), "string" != typeof a && (a = a.join(" ")), t.elements = c + " " + a, j(b) } function f(a) { var b = s[a[q]]; return b || (b = {}, r++, a[q] = r, s[r] = b), b } function g(a, c, d) { if (c || (c = b), l) return c.createElement(a); d || (d = f(c)); var e; return e = d.cache[a] ? d.cache[a].cloneNode() : p.test(a) ? (d.cache[a] = d.createElem(a)).cloneNode() : d.createElem(a), !e.canHaveChildren || o.test(a) || e.tagUrn ? e : d.frag.appendChild(e) } function h(a, c) { if (a || (a = b), l) return a.createDocumentFragment(); c = c || f(a); for (var e = c.frag.cloneNode(), g = 0, h = d(), i = h.length; i > g; g++)e.createElement(h[g]); return e } function i(a, b) { b.cache || (b.cache = {}, b.createElem = a.createElement, b.createFrag = a.createDocumentFragment, b.frag = b.createFrag()), a.createElement = function (c) { return t.shivMethods ? g(c, a, b) : b.createElem(c) }, a.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + d().join().replace(/[\w\-:]+/g, function (a) { return b.createElem(a), b.frag.createElement(a), 'c("' + a + '")' }) + ");return n}")(t, b.frag) } function j(a) { a || (a = b); var d = f(a); return !t.shivCSS || k || d.hasCSS || (d.hasCSS = !!c(a, "article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")), l || i(a, d), a } var k, l, m = "3.7.3", n = a.html5 || {}, o = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i, p = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i, q = "_html5shiv", r = 0, s = {}; !function () { try { var a = b.createElement("a"); a.innerHTML = "", k = "hidden" in a, l = 1 == a.childNodes.length || function () { b.createElement("a"); var a = b.createDocumentFragment(); return "undefined" == typeof a.cloneNode || "undefined" == typeof a.createDocumentFragment || "undefined" == typeof a.createElement }() } catch (c) { k = !0, l = !0 } }(); var t = { elements: n.elements || "abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video", version: m, shivCSS: n.shivCSS !== !1, supportsUnknownElements: l, shivMethods: n.shivMethods !== !1, type: "default", shivDocument: j, createElement: g, createDocumentFragment: h, addElements: e }; a.html5 = t, j(b), "object" == typeof module && module.exports && (module.exports = t) }("undefined" != typeof window ? window : this, document); + + /*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */ + if ("document" in self) { if (!("classList" in document.createElement("_"))) { (function (j) { "use strict"; if (!("Element" in j)) { return } var a = "classList", f = "prototype", m = j.Element[f], b = Object, k = String[f].trim || function () { return this.replace(/^\s+|\s+$/g, "") }, c = Array[f].indexOf || function (q) { var p = 0, o = this.length; for (; p < o; p++) { if (p in this && this[p] === q) { return p } } return -1 }, n = function (o, p) { this.name = o; this.code = DOMException[o]; this.message = p }, g = function (p, o) { if (o === "") { throw new n("SYNTAX_ERR", "An invalid or illegal string was specified") } if (/\s/.test(o)) { throw new n("INVALID_CHARACTER_ERR", "String contains an invalid character") } return c.call(p, o) }, d = function (s) { var r = k.call(s.getAttribute("class") || ""), q = r ? r.split(/\s+/) : [], p = 0, o = q.length; for (; p < o; p++) { this.push(q[p]) } this._updateClassName = function () { s.setAttribute("class", this.toString()) } }, e = d[f] = [], i = function () { return new d(this) }; n[f] = Error[f]; e.item = function (o) { return this[o] || null }; e.contains = function (o) { o += ""; return g(this, o) !== -1 }; e.add = function () { var s = arguments, r = 0, p = s.length, q, o = false; do { q = s[r] + ""; if (g(this, q) === -1) { this.push(q); o = true } } while (++r < p); if (o) { this._updateClassName() } }; e.remove = function () { var t = arguments, s = 0, p = t.length, r, o = false, q; do { r = t[s] + ""; q = g(this, r); while (q !== -1) { this.splice(q, 1); o = true; q = g(this, r) } } while (++s < p); if (o) { this._updateClassName() } }; e.toggle = function (p, q) { p += ""; var o = this.contains(p), r = o ? q !== true && "remove" : q !== false && "add"; if (r) { this[r](p) } if (q === true || q === false) { return q } else { return !o } }; e.toString = function () { return this.join(" ") }; if (b.defineProperty) { var l = { get: i, enumerable: true, configurable: true }; try { b.defineProperty(m, a, l) } catch (h) { if (h.number === -2146823252) { l.enumerable = false; b.defineProperty(m, a, l) } } } else { if (b[f].__defineGetter__) { m.__defineGetter__(a, i) } } }(self)) } else { (function () { var b = document.createElement("_"); b.classList.add("c1", "c2"); if (!b.classList.contains("c2")) { var c = function (e) { var d = DOMTokenList.prototype[e]; DOMTokenList.prototype[e] = function (h) { var g, f = arguments.length; for (g = 0; g < f; g++) { h = arguments[g]; d.call(this, h) } } }; c("add"); c("remove") } b.classList.toggle("c3", false); if (b.classList.contains("c3")) { var a = DOMTokenList.prototype.toggle; DOMTokenList.prototype.toggle = function (d, e) { if (1 in arguments && !this.contains(d) === !e) { return e } else { return a.call(this, d) } } } b = null }()) } }; + + + Date.prototype.Format = function (fmt) { //author: meizz + var o = { + "M+": this.getMonth() + 1, //月份 + "d+": this.getDate(), //日 + "h+": this.getHours(), //小时 + "m+": this.getMinutes(), //分 + "s+": this.getSeconds(), //秒 + "q+": Math.floor((this.getMonth() + 3) / 3), //季度 + "S": this.getMilliseconds() //毫秒 + }; + if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); + for (var k in o) + if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); + return fmt; + }; + + + var Domain = 'https://open.ys7.com'; + var logDomain = 'https://log.ys7.com/statistics.do'; + + var jqueryJS = Domain + '/sdk/js/2.0/js/jquery.min.js'; + var ckplayerJS = Domain + '/sdk/js/2.0/js/ckplayer/ckplayer.js'; + var ckplayerSWF = Domain + '/sdk/js/2.0/js/ckplayer/ckplayer.swf'; + var m3u8SWF = Domain + '/sdk/js/2.0/js/ckplayer/m3u8.swf'; + var flv_js = Domain + '/sdk/js/2.0/js/flv.min.js'; + var hlsJS = Domain + '/sdk/js/2.0/js/hls.min.js'; + var mpegJS = Domain + '/sdk/js/2.0/js/jsmpeg.min.js'; + var wav = Domain + '/sdk/js/2.0/js/wav-audio-encoder.js'; + + + // 当前页面是否是https协议 + var isHttps = window.location.protocol === 'https:' ? true : false; + // 是否为移动端 + var isMobile = !!navigator.userAgent.match(/(iPhone|iPod|iPad|Android|ios|SymbianOS)/i); + var testVideo = document.createElement('video'); + // 是否支持video标签和addEventListener方法(主要为了区别ie8) + var isModernBrowser = !!testVideo.canPlayType && !!window.addEventListener; + // 是否能使用video原生播放hls,目前只有safari可以支持原生video播放。 + var isNativeSupportHls = isModernBrowser && testVideo.canPlayType('application/vnd.apple.mpegURL'); + // 是否能使用hls.js播放 + var isSupportHls = false; + // 是否使用flash + var useFlash = false; + // 初始化播放时间 + var playStartTime = new Date().getTime(); + // 本地信息上报 + var LOCALINFO = 'open_netstream_localinfo'; + // 预览主表上报 + var PLAY_MAIN = 'open_netstream_play_main'; + // 日志上报(轻应用独立上报) + var LOCALINFO_EZUIKIT = 'open_ezuikit_localinfo'; + var PERFORMANCE_EZUIKIT = 'open_ezuikit_performance'; + var appKey = ""; + + function dclog(obj) { + var domain = window.location.protocol + '//' + window.location.host; + var logObj = { + Ver: 'v.2.6.5', + PlatAddr: domain, + ExterVer: 'Ez.2.6.5', + OpId: uuid(), + CltType: 102, + AppId: appKey, + StartTime: (new Date()).Format('yyyy-MM-dd hh:mm:ss.S'), // 每个日志包含当前的时间 + OS: navigator.platform + } + for (var i in obj) { + logObj[i] = obj[i]; + } + + var tempArray = []; + for (var j in logObj) { + tempArray.push(j + '=' + logObj[j]); + } + var params = '?' + tempArray.join('&'); + // 上报一次本地统计信息 + var img = new Image(); + img.src = logDomain + params; + } + // 日志上报-2019-09-10 + function ezuikitDclog(obj) { + var domain = window.location.protocol + '//' + window.location.host; + var logObj = { + version: 'v.2.6.5', + plate_addr: domain, + appId: appKey, + st: new Date().getTime(), // 每个日志包含当前的时间 + } + for (var i in obj) { + logObj[i] = obj[i]; + } + + var tempArray = []; + for (var j in logObj) { + tempArray.push(j + '=' + logObj[j]); + } + var params = '?' + tempArray.join('&'); + // 上报一次本地统计信息 + var img = new Image(); + img.src = logDomain + params; + } + + var RTMP_REG = /^rtmp/; + var HLS_REG = /\.m3u8/; + + // 获取元素样式 + function getStyle(el) { + return window.getComputedStyle + ? window.getComputedStyle(el, null) + : el.currentStyle; + } + + // 加载js + function addJs(filepath, callback) { + var oJs = document.createElement("script"); + oJs.setAttribute("src", filepath); + oJs.onload = callback; + document.getElementsByTagName("head")[0].appendChild(oJs); + } + // 通用请求方法 + function request(url, method, params, header, success, error) { + var _url = url; + var http_request = new XMLHttpRequest(); + http_request.onreadystatechange = function () { + if (http_request.readyState == 4) { + if (http_request.status == 200) { + if (isJSON(http_request.responseText)) { + var _data = JSON.parse(http_request.responseText); + success(_data); + } else { + success(http_request.responseText) + } + } + } + }; + http_request.open(method, _url, true); + // http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + var data = new FormData(); + for (var i in params) { + data.append(i, params[i]); + } + http_request.send(data); + }; + /** 获取url参数 */ + function getQueryString(name, url) { var r = new RegExp("(\\?|#|&)" + name + "=(.*?)(#|&|$)"); var m = (url || location.href).match(r); return decodeURIComponent(m ? m[2] : ''); } + /** 判断是否为promise对象 */ + function isPromise(obj) { return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; } + /** 生成uuid */ + function uuid() { var s = []; var hexDigits = "0123456789abcdef"; for (var i = 0; i < 36; i++) { s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1) }; s[14] = "4"; s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); s[8] = s[13] = s[18] = s[23] = "-"; var uuid = s.join(""); return uuid; } + /**获取浏览器名称,版本 */ + function getBrowserInfo() { var Sys = {}; var ua = navigator.userAgent.toLowerCase(); var re = /(msie|firefox|chrome|opera|version).*?([\d.]+)/; var m = ua.match(re); try { Sys.browser = m[1].replace(/version/, "'safari"); Sys.ver = m[2]; } catch (e) { console.log("getBrowserInfo fail.") } return Sys; } + /** 是否为JSON格式字符串 */ + function isJSON(str) { if (typeof str == 'string') { try { var obj = JSON.parse(str); if (typeof obj == 'object' && obj) { return true; } else { return false; } } catch (e) { return false; } } console.log('It is not a string!') } + /** insertAfter */ + function insertAfter(newElement, targetElement) { var parent = targetElement.parentNode; if (parent.lastChild == targetElement) { parent.appendChild(newElement); } else { parent.insertBefore(newElement, targetElement.nextSibling); } } + + + + var EZUIPlayer = function (playParams) { + if (!isModernBrowser) { + throw new Error('不支持ie8等低版本浏览器'); + return; + } + /**定义播放配置项 */ + this.opt = {}; + this.opt.sources = []; + this.handlers = {}; + + // 修订 - 支持JS Decoder 允许非字符串配置项 + if (typeof playParams === 'object' && playParams.hasOwnProperty('decoderPath')) { + if (typeof playParams.audioId === 'undefined') { + playParams["audioId"] = 0; + } + this.playParams = playParams; + /* 校验播放器配置参数合法性 */ + var oS = document.createElement('style'); + document.getElementsByTagName("head")[0].appendChild(oS); + oS.innerHTML = '.draw-window {border: none!important}'; + // 解码器路径 + if (typeof playParams.decoderPath !== 'string' || typeof playParams.decoderPath === 'undefined') { + throw new Error('EZUIDecoder requires the path of decoder'); + return; + } + // Id + if (typeof playParams.id !== 'string' || typeof playParams.id === 'undefined') { + throw new Error('EZUIDecoder requires parameter id'); + return; + } + if (typeof playParams.url !== 'string' || typeof playParams.url === 'undefined') { + throw new Error('EZUIDecoder requires parameter url'); + return; + } + // 状态提示 + this.loadingStart = function () { + var oS = document.createElement('style'); + document.getElementsByTagName("head")[0].appendChild(oS); + oS.innerHTML = '@keyframes antRotate {to {transform: rotate(400deg);transform-origin:50% 50%;}} .loading {display: inline-block;z-index: 1000;-webkit-animation: antRotate 1s infinite linear;animation: antRotate 1s infinite linear;}'; + if (playParams && playParams.id) { + var domId = playParams.id; + var domElement = document.getElementById(domId); + var windowWidth = domElement.offsetWidth; + var windowHeight = domElement.offsetHeight || playParams.height || 400; + var offsetTop = domElement.offsetTop; + var offsetLeft = domElement.offsetLeft; + // 先执行清空loading + if (document.getElementById('loading-id-0')) { + document.getElementById('loading-id-0').parentNode.removeChild(document.getElementById('loading-id-0')) + } + var loadingContainerDOM = document.createElement('div'); + loadingContainerDOM.setAttribute('id', 'loading-id-0'); + var style = 'position:absolute;outline:none;' + style += 'width: 0px;' + style += 'height: 0px;' + style += 'top:' + offsetTop + 'px;' + style += 'left:' + offsetLeft + 'px;' + + loadingContainerDOM.setAttribute('style', style); + var loadingContainer = document.getElementById("loading-id-0"); + loadingContainerDOM.style.height = windowHeight; + + loadingContainerDOM.setAttribute('class', 'loading-container'); + // loadingContainerDOM.innerHTML= loading; + + + insertAfter(loadingContainerDOM, domElement); + + var splitBasis = playParams.splitBasis || 1; + var windowLength = playParams.url.split(",").length; + for (var i = 0; i < windowLength; i++) { + var loadingContainer = document.createElement('div'); + var loadingStatusDOM = document.createElement('div'); + loadingContainer.setAttribute('class', 'loading-item'); + loadingContainer.setAttribute('id', 'loading-item-' + i); + //loadingContainer.setAttribute('style','display:inline-flex;flex-direction:column;justify-content:center;align-items: center;width:'+(windowWidth / splitBasis)+'px;height:'+(windowHeight /splitBasis )+'px;outline:none;vertical-align: top;position:absolute'); + var style = 'display:inline-flex;flex-direction:column;justify-content:center;align-items: center;width:' + (windowWidth / splitBasis) + 'px;height:' + (windowHeight / splitBasis) + 'px;outline:none;vertical-align: top;position:absolute;'; + style += ('left:' + calLoadingPostion(windowHeight, windowWidth, splitBasis, i).left + 'px;'); + style += ('top:' + calLoadingPostion(windowHeight, windowWidth, splitBasis, i).top + 'px;'); + loadingContainer.setAttribute('style', style); + function calLoadingPostion(windowHeight, windowWidth, splitBasis, i) { + var top = parseInt(i / splitBasis, 10) * (windowHeight / splitBasis); + var left = (i % splitBasis) * (windowWidth / splitBasis); + return { + top: top, + left: left + } + } + var loadingDOM = document.createElement('div'); + loadingStatusDOM.innerHTML = ""; + loadingStatusDOM.style.color = "#fff"; + loadingDOM.setAttribute('class', 'loading'); + var loading = ''; + if (playParams.loading && playParams.loading.svg) { + loading = playParams.loading.svg; + } + loadingDOM.innerHTML = loading; + loadingContainer.appendChild(loadingDOM); + // loadingContainer.appendChild(loading); + loadingContainer.appendChild(loadingStatusDOM); + loadingContainerDOM.appendChild(loadingContainer) + } + } + + } + this.loadingSet = function (index, opt) { + var loadingContainer = document.getElementById('loading-id-0'); + if (document.getElementById('loading-item-' + index)) { + var textElement = document.getElementById('loading-item-' + index).childNodes[1]; + textElement.innerHTML = opt.text; + if (opt.color) { + textElement.style.color = opt.color; + } + } + } + this.loadingSetIcon = function (i, type) { + var _this = this; + if (playParams && playParams.id) { + var domId = playParams.id; + var domElement = document.getElementById(domId); + var windowWidth = domElement.offsetWidth; + var windowHeight = domElement.offsetHeight || playParams.height || 400; + var offsetTop = domElement.offsetTop; + var offsetLeft = domElement.offsetLeft; + // 先执行清空loading + if (document.getElementById('loading-id-0')) { + document.getElementById('loading-id-0').parentNode.removeChild(document.getElementById('loading-id-0')) + } + var loadingContainerDOM = document.createElement('div'); + loadingContainerDOM.setAttribute('id', 'loading-id-0'); + var style = 'position:absolute;outline:none;' + style += 'width: 0px;' + style += 'height: 0px;' + style += 'top:' + offsetTop + 'px;' + style += 'left:' + offsetLeft + 'px;' + + loadingContainerDOM.setAttribute('style', style); + var loadingContainer = document.getElementById("loading-id-0"); + loadingContainerDOM.style.height = windowHeight; + + loadingContainerDOM.setAttribute('class', 'loading-container'); + insertAfter(loadingContainerDOM, domElement); + + var splitBasis = playParams.splitBasis || 1; + var windowLength = playParams.url.split(",").length; + var loadingContainer = document.createElement('div'); + var loadingStatusDOM = document.createElement('div'); + loadingContainer.setAttribute('class', 'loading-item'); + loadingContainer.setAttribute('id', 'loading-item-' + i); + //loadingContainer.setAttribute('style','display:inline-flex;flex-direction:column;justify-content:center;align-items: center;width:'+(windowWidth / splitBasis)+'px;height:'+(windowHeight /splitBasis )+'px;outline:none;vertical-align: top;position:absolute'); + var style = 'display:inline-flex;flex-direction:column;justify-content:center;align-items: center;width:' + (windowWidth / splitBasis) + 'px;height:' + (windowHeight / splitBasis) + 'px;outline:none;vertical-align: top;position:absolute;'; + style += ('left:' + calLoadingPostion(windowHeight, windowWidth, splitBasis, i).left + 'px;'); + style += ('top:' + calLoadingPostion(windowHeight, windowWidth, splitBasis, i).top + 'px;'); + loadingContainer.setAttribute('style', style); + function calLoadingPostion(windowHeight, windowWidth, splitBasis, i) { + var top = parseInt(i / splitBasis, 10) * (windowHeight / splitBasis); + var left = (i % splitBasis) * (windowWidth / splitBasis); + return { + top: top, + left: left + } + } + var loadingDOM = document.createElement('div'); + loadingStatusDOM.innerHTML = ""; + loadingStatusDOM.style.color = "#fff"; + loadingDOM.setAttribute('class', type); + var icon = ''; + switch (type) { + case 'retry': + icon = ''; + loadingDOM.style.cursor = 'pointer'; + loadingDOM.onclick = function () { + console.log("点击重试", i); + // _this.loadingStart(); + _this.play(i); + } + break; + } + + loadingDOM.innerHTML = icon; + loadingContainer.appendChild(loadingDOM); + loadingContainer.appendChild(loadingStatusDOM); + loadingContainerDOM.appendChild(loadingContainer) + + } + } + this.loadingEnd = function (index) { + var loadingItemContainerDOM = document.getElementById('loading-item-' + index); + if (loadingItemContainerDOM) { + loadingItemContainerDOM.parentNode.removeChild(loadingItemContainerDOM); + var loadingContainerDOM = document.getElementById('loading-id-0'); + if (loadingContainerDOM && loadingContainerDOM.children.length === 0) { + loadingContainerDOM.parentNode.removeChild(loadingContainerDOM); + } + } + } + // 将播放地址配置在实例 opt 属性中 + this.opt.sources.push(playParams.url); + // JSDecoder 只有一个播放地址 + this.opt.currentSource = this.opt.sources[0]; + + /* 获取解码器用户配置项 - 开始 */ + /** + * 调试模式配置 + * 可通过dev属性指定API服务域名 + */ + var domain = "https://open.ys7.com"; + if (playParams.env) { + var environmentParams = playParams.env; + domain = environmentParams.domain; + } + + /** 创建jSPlugin 对象 */ + this.jSPlugin = {}; + var _this = this; + /** 根据播放参数获取真实播放地址 */ + this.loadingStart(); + playStartTime = new Date().getTime(); + // var getRealUrl = this.getRealUrl(playParams); + var initDecoder = this.initDecoder(playParams); + // 初始化播放器 + _this.loadingSet(0, { text: '初始化播放器...' }); + if(playParams.autoplay){ + _this.play() + } + if (isPromise(initDecoder)) { + initDecoder.then(function (data) { + _this.loadingSet(0, { text: '初始化完成' }); + // setTimeout(function () { + // _this.play(playParams); + // }, 100) + // var getRealUrl = _this.getRealUrl(playParams); + // getRealUrl.then(function (data) { + // _this.play(playParams); + // }) + }) + } + // debugger + /**是否自动播放 */ + // if (isPromise(getRealUrl)) { + // getRealUrl.then(function (data) { + // var initDecoder = _this.initDecoder(playParams); + // // 初始化播放器 + // _this.loadingSet(0, { text: '初始化播放器...' }); + // if (isPromise(initDecoder)) { + // initDecoder.then(function (data) { + // _this.loadingSet(0, { text: '初始化完成' }); + // setTimeout(function () { + // _this.play(playParams); + // }, 1500) + // }) + // } + // }) + // } + } else { + var domain = "https://open.ys7.com"; + var elementID = ''; + if (typeof playParams === 'string') { //缩写模式 new EZUIPlayer('myplayer') + elementID = playParams; + } else if (typeof playParams === 'object') { //标准模式 new EZUIPlayer({id: 'myplayer'}) + elementID = playParams.id; + } + this.videoId = elementID; + this.video = document.getElementById(elementID); + if (!this.video) { + throw new Error('EZUIPlayer requires parameter videoId'); + } + var sources = this.video.getElementsByTagName('source'); + // 转为数组对象,不受removeChild影响 + sources = Array.prototype.slice.call(sources, 0); + + if (this.video.src) { + // 移动端删除rtmp地址 + if (isMobile && RTMP_REG.test(this.video.src)) { + this.video.removeAttribute('src'); + this.video.load(); + } else { + this.opt.sources.push(this.video.src); + } + } + + var l = sources.length; + if (l > 0) { + for (var i = 0; i < l; i++) { + // 移动端删除rtmp地址 + if (isMobile && RTMP_REG.test(sources[i].src)) { + this.video.removeChild(sources[i]); + } else { + this.opt.sources.push(sources[i].src); + } + } + } + if (this.opt.sources.length < 1) { + throw new Error('no source found in video tag.'); + } + this.opt.cur = 0; + this.opt.poster = this.video.poster; + var videoStyle = getStyle(this.video); + var width = this.video.width; + var height = this.video.height; + if (width) { + this.opt.width = width; + if (height) { + this.opt.height = height; + } else { + this.opt.height = 'auto'; + } + this.log('video width:' + this.opt.width + ' height:' + this.opt.height); + } else { + this.opt.width = videoStyle.width; + this.opt.height = videoStyle.height; + this.log('videoStyle.width:' + videoStyle.width + ' wideoStyle.height:' + videoStyle.height); + } + this.opt.parentId = elementID; + this.opt.autoplay = this.video.autoplay ? true : false; + this.log('autoplay:' + this.video.autoplay); + + this.opt.currentSource = this.opt.sources[this.opt.cur]; + this.getRealUrl(playParams); + } + + /* 创建播放,错误,停止事件钩子,上报用户行为 */ + this.handlers = {}; + this.initTime = (new Date()).getTime(); + this.on('play', function () { + // 上报播放成功信息 + dclog({ + systemName: PLAY_MAIN, + playurl: this.opt.currentSource, + Time: (new Date()).Format('yyyy-MM-dd hh:mm:ss.S'), + Enc: 0, // 0 不加密 1 加密 + PlTp: 1, // 1 直播 2 回放 + Via: 911, // 2 私有流 911 标准流 + ErrCd: 0, + OpId: uuid(), + Cost: (new Date()).getTime() - this.initTime // 毫秒数 + }); + }); + this.retry = 2; + this.on('error', function () { + dclog({ + systemName: PLAY_MAIN, + playurl: this.opt.currentSource, + cost: -1, + ErrCd: -1, + Via: 911, // 2 私有流 911 标准流 + OpId: uuid(), + }); + }); + var appInfoSuccess = function (data) { + if (data.retcode === 0 && data.data) { + appKey = data.data.appKey; + } + // 上报一次本地信息 + dclog({ + systemName: LOCALINFO, + }); + // 上报一次本地信息-新 + ezuikitDclog({ + systemName: LOCALINFO_EZUIKIT, + os: navigator.platform, + browser: JSON.stringify(getBrowserInfo()), + }) + } + var appInfoError = function (error) { + // 上报一次本地信息 + dclog({ + systemName: LOCALINFO + }); + // 上报一次本地信息-新 + ezuikitDclog({ + systemName: LOCALINFO_EZUIKIT, + os: navigator.platform, + browser: JSON.stringify(getBrowserInfo()), + }) + } + var deviceSerial = ''; + var playUid = ''; + var accessToken = ''; + var uuidReg = /[a-z0-9]{32}/; + var deviceSerialReg = /[a-zA-Z0-9]{9}\/[0-9]{0,2}\./; + if (typeof playParams === 'string') { + var url = this.opt.currentSource; + if (uuidReg.test(url)) { + playUid = url.match(uuidReg)[0]; + } else if (deviceSerialReg.test(url)) { + deviceSerial = url.match(deviceSerialReg)[0].split('/')[0]; + } + } else if (typeof playParams === 'object') { + var url = playParams.url; + if (uuidReg.test(url)) { + playUid = url.match(uuidReg); + } else if (deviceSerialReg.test(url)) { + deviceSerial = url.match(deviceSerialReg)[0].split('/')[0]; + } + if (playParams.accessToken) { + accessToken = playParams.accessToken; + } + } + // 获取appKey + request(domain + '/jssdk/ezopen/getAppInfo?uuid=' + playUid + '&accessToken=' + accessToken + "&deviceSerial=" + deviceSerial + "&channelNo=1", + 'GET', + '', + '', + appInfoSuccess, + appInfoError + ); + }; + + // 事件监听 + EZUIPlayer.prototype.on = function (eventName, callback) { + if (typeof eventName !== 'string' || typeof callback !== 'function') { + return; + } + if (typeof this.handlers[eventName] === 'undefined') { + this.handlers[eventName] = []; + } + this.handlers[eventName].push(callback); + }; + + // 事件触发 + EZUIPlayer.prototype.emit = function () { + if (this.handlers[arguments[0]] instanceof Array) { + var handlers = this.handlers[arguments[0]]; + var l = handlers.length; + for (var i = 0; i < l; i++) { + handlers[i].apply(this, Array.prototype.slice.call(arguments, 1)); + } + } + }; + // 日志 + EZUIPlayer.prototype.log = function (msg, className) { + this.emit('log', msg, className); + }; + + EZUIPlayer.prototype.getRealUrl = function (playParams) { + var _this = this; + var apiDomain = 'https://open.ys7.com'; + if (playParams && playParams.env) { + apiDomain = playParams.env.domain; + } + /** jsDecoder 获取真实地址 -- 开始 */ + if (playParams && playParams.hasOwnProperty('decoderPath')) { + if (playParams && playParams.hasOwnProperty('userName') && playParams.hasOwnProperty('password')) { + // var cryJS = '/js/cryptico.min.js'; + + // addJs(cryJS, function () { }) + + + console.log("开始播放局域网"); + + getRealUrlPromise = function (resolve, reject, ezopenURL) { + // var realUrl = 'ws://10.11.36.57:7681/101?sessionID=64faad6d7e2ac432a623404914ecc9997ea8533cd1f71e6e72548104b1d7279f'; + // resolve(realUrl); + + var realUrl = ''; + // 向API请求真实地址 + var apiUrl = apiDomain + "/api/lapp/v2/live/laninfo/get"; + var apiSuccess = function (data) { + if (data.code == 200 || data.retcode == 0) { + //realUrl += 'ws://' + data.data.localIp + ':' + data.data.wssLocalPort + '10' + (playParams.url.indexOf('hd') === -1 ? '2' : '1'); + //test -start + data.data.localIp = '10.11.51.53'; + apiDomain = 'http://y.ys7.com:3100'; + // test-end + realUrl += 'ws://' + data.data.localIp + ':' + data.data.wssLocalPort + '/' + '10' + (playParams.url.indexOf('hd') === -1 ? '2' : '1'); + // 执行设备授权 + capabilitiesUrl = apiDomain + "/jssdk/ezopen/sessionLogin/capabilities?ip=" + data.data.localIp + "&username=" + playParams.userName + var capabilitiesSuccess = function (xmlDoc, textStatus, xhr) { + console.log("xmlDoc", xmlDoc, xmlDoc.split('')) + var userName = playParams.userName; + var password = playParams.password; + var sessionIDReg = /(.*)<\/sessionID>/i; + var challengeReg = /(.*)<\/challenge>/i; + var iterationsReg = /(.*)<\/iterations>/i; + var isIrreversibleReg = /(.*)<\/isIrreversible>/i; + var saltReg = /(.*)<\/salt>/i; + + var sessionID = sessionIDReg.exec(xmlDoc)[1]; + var challenge = challengeReg.exec(xmlDoc)[1]; + var iterations = iterationsReg.exec(xmlDoc)[1]; + var isIrreversible = isIrreversibleReg.exec(xmlDoc)[1] == 'true'; + var salt = saltReg.exec(xmlDoc)[1]; + console.log(sessionID, challenge, iterations, isIrreversible, salt) + + var szEncryptedPwd = ''; + if (!isIrreversible) { + szEncryptedPwd = SHA256(password) + challenge; + for (var i = 1; i < iterations; i++) { + szEncryptedPwd = SHA256(szEncryptedPwd); + } + } else { + szEncryptedPwd = SHA256(userName + salt + password); + szEncryptedPwd = SHA256(szEncryptedPwd + challenge); + for (var i = 2; i < iterations; i++) { + szEncryptedPwd = SHA256(szEncryptedPwd); + } + } + console.log("szEncryptedPwd", szEncryptedPwd) + // // session登录 + // var loginUrl = 'http://y.ys7.com:3100/jssdk/ezopen/sessionLogin?ip=' + '10.11.36.57' + '&encryptedPwd=' + szEncryptedPwd + '&sessionID=' + sessionID; + // var loginSuccess = function (data) { + // // debugger; + // } + // var loginError = function (err) { + // } + // // debugger + // request(loginUrl, 'GET', null, '', loginSuccess, loginError); + $.ajax({ + url: apiDomain + '/jssdk/ezopen/sessionLogin', + type: "post", + data: { + ip: data.data.localIp, + authXml: "" + playParams.userName + "" + szEncryptedPwd + "" + sessionID + "\r\n\tfalse\r\n\t2\r\n", + }, + success: function (data) { + console.log("data", data); + szWebsocketSessionID = data.WebSession.split("=")[1].split(";")[0]; + realUrl += '?sessionID=' + szWebsocketSessionID; + resolve(realUrl); + }, + error: function (xhr, textStatus, errorThrown) { + alert("error"); + } + }) + + } + + var deviceSerialReg = /[a-zA-Z0-9]{9}\/[0-9]{0,2}\./; + var deviceSerial = playParams.url.match(deviceSerialReg)[0].split('/')[0]; + + var capabilitiesError = function (error) { + // 将错误信息捕获到用户自定义错误回调中 + if (playParams && playParams.handleError) { + playParams.handleError(error); + } + } + request(capabilitiesUrl, 'GET', {}, '', capabilitiesSuccess, capabilitiesError); + + } + } + + var deviceSerialReg = /[a-zA-Z0-9]{9}\/[0-9]{0,2}\./; + var deviceSerial = playParams.url.match(deviceSerialReg)[0].split('/')[0]; + var apiParams = { + deviceSerial: deviceSerial, + accessToken: playParams.accessToken, + } + var apiError = function (error) { + // 将错误信息捕获到用户自定义错误回调中 + if (playParams && playParams.handleError) { + playParams.handleError(error); + } + } + request(apiUrl, 'POST', apiParams, '', apiSuccess, apiError); + + } + var urlList = playParams.url.split(',') + var promiseTaskList = []; + var promiseTaskFun = function (ezopenURL) { + return new Promise(function (resolve, reject) { return getRealUrlPromise(resolve, reject, ezopenURL) }) + }; + urlList.map(function (item, index) { + _this.loadingSet(index, { text: '获取设备播放地址' }) + promiseTaskList.push(promiseTaskFun(item)); + }); + var getRealUrlPromiseObj = Promise.all(promiseTaskList) + .then(function (result) { + // debugger + // 获取真实地址成功后,赋值到opt属性中 + _this.opt.sources = result; + _this.opt.currentSource = result[0]; + result.forEach(function (item, index) { + _this.loadingSet(index, { text: '获取播放地址成功' }) + }) + }) + .catch(function (err) { + // debugger + _this.log("获取真实地址错误" + JSON.stringify(err), 'error') + }) + return getRealUrlPromiseObj; + + } else { + // api 获取真实地址开始时间 + var getRealUrlDurationST = new Date().getTime(); + var getRealUrlPromise = function (resolve, reject, ezopenURL) { + var realUrl = ''; + if (!/^ezopen:\/\//.test(ezopenURL)) { // JSDecoder ws协议播放 + resolve(ezopenURL); + } else { + // var getPlayTokenST = new Date().getTime(); + // var nodeUrl = apiDomain + "/jssdk/ezopen/getStreamToken?accessToken=" + playParams.accessToken + '&num=10&type=' + (playParams.url.indexOf('live') !== -1 ? 'live' : 'playback'); + // var nodeSuccess = function (data) { + // if (data.retcode === 0) { + // realUrl = realUrl + data.data.params + '&ssn=' + data.data.tokens[0]; + // // _this.opt.currentSource = realUrl; + // ezuikitDclog({ + // systemName: PERFORMANCE_EZUIKIT, + // bn: 3, + // browser: JSON.stringify(getBrowserInfo()), + // duration: new Date().getTime() - getPlayTokenST, + // rt: 200, + // }) + // resolve(realUrl); + // } else { + // // 将错误信息捕获到用户自定义错误回调中 + // if (playParams && playParams.handleError) { + // playParams.handleError(data); + // } + // // 错误信息显示在状态中 + // if (data.msg) { + // _this.loadingSet(0, { text: data.msg, color: 'red' }); + // } + // ezuikitDclog({ + // systemName: PERFORMANCE_EZUIKIT, + // bn: 3, + // browser: JSON.stringify(getBrowserInfo()), + // duration: new Date().getTime() - getPlayTokenST, + // rt: data.retcode, + // msg: data.msg, + // }) + // resolve(JSON.stringify(data)); + // throw new Error('获取播放token失败'); + // } + // } + // var nodeError = function (error) { + // // 将错误信息捕获到用户自定义错误回调中 + // if (playParams && playParams.handleError) { + // playParams.handleError(error); + // } + // ezuikitDclog({ + // systemName: PERFORMANCE_EZUIKIT, + // bn: 3, + // browser: JSON.stringify(getBrowserInfo()), + // duration: new Date().getTime() - getPlayTokenST, + // rt: 500, + // msg: '获取取流token网络错误', + // }) + // resolve(JSON.stringify(error)) + // throw new Error('获取播放token失败', 'error'); + // } + // 向API请求真实地址 + var apiUrl = apiDomain + "/api/lapp/live/url/ezopen"; + var apiSuccess = function (data) { + if (data.code == 200 || data.retcode == 0) { + realUrl += data.data; + if(data.ext && data.ext.token){ + stream = data.ext.token; + var type= playParams.url.indexOf('live') !== -1 ? 'live' : 'playback'; + if(type === 'live'){ + realUrl = realUrl + '&auth=1&biz=4&cln=100' + '&ssn=' + stream; + }else { + realUrl = realUrl + '&auth=1&cln=100' + '&ssn=' + stream; + } + console.log(realUrl) + } + + /**参数容错处理 start*/ + if (data.data.indexOf('playback') !== -1) { //回放 + var wsBegin = getQueryString('begin', data.data) || getQueryString('begin', playParams.url); + var wsEnd = getQueryString('end', data.data) || getQueryString('end', playParams.url); + // 兼容各种时间格式 + if (!wsBegin) { + var defaultDate = new Date(); + realUrl = realUrl + '&begin=' + defaultDate.Format('yyyyMMdd') + 'T000000Z'; + } else { + realUrl = realUrl.replace('&begin=' + getQueryString('begin', data.data), '&begin=' + formatRecTime(wsBegin, '000000')) + if(!getQueryString('begin',realUrl)){ + realUrl += '&begin=' + formatRecTime(wsBegin, '000000'); + } + } + if (!wsEnd) { + var defaultDate = new Date(); + realUrl = realUrl + '&end=' + defaultDate.Format('yyyyMMdd') + 'T235959Z'; + } else { + realUrl = realUrl.replace('&end=' + getQueryString('end', data.data), '&end=' + formatRecTime(wsEnd, '235959')) + if(!getQueryString('end',realUrl)){ + realUrl += '&end=' + formatRecTime(wsEnd, '235959'); + } + } + // api错误处理 + if (!getQueryString('stream', data.data)) { + realUrl = realUrl.replace('stream', '&stream'); + } + if (playParams.url.indexOf('.cloud') !== -1) { + // 调用回放API接口获取回放片段 - start + var recBegin = reRormatRecTime(getQueryString('begin', realUrl)); + var recEnd = reRormatRecTime(getQueryString('end', realUrl)); + var deviceSerial = getQueryString('serial', realUrl) + var channelNo = getQueryString('chn', realUrl); + + var recSliceUrl = apiDomain + "/api/lapp/video/by/time"; + var recSliceParams = { + accessToken: playParams.accessToken, + recType: 1, + deviceSerial: deviceSerial, + channelNo: channelNo, + startTime: recBegin, + endTime: recEnd + } + function recAPISuccess(data) { + if (data.code == 200) { + var recSliceArr = []; + if (data.data && data.data.length > 0) { + recSliceArr = recSliceArrFun(data.data); + var recSliceArrJSON = JSON.stringify(recSliceArr).replace('\\', ''); + realUrl += ('&recSlice=' + recSliceArrJSON.replace('\\', '')); + // request(nodeUrl, 'GET', '', '', nodeSuccess, nodeError); + resolve(realUrl); + } else { + _this.log('未找到录像片段', 'error'); + _this.loadingSet(0, { text: '获取设备播放地址' }) + resolve(JSON.stringify({ code: -1, msg: "未找到录像片段" })) + // reject('未找到录像片段'); + } + } else { + _this.log(data.msg, 'error'); + _this.loadingSet(0, { text: '获取设备播放地址' }); + resolve(JSON.stringify({ code: -1, msg: "未找到录像片段" })) + //reject('未找到录像片段'); + } + function recSliceArrFun(data) { + var downloadPathArr = []; + var currentDP = downloadPathArr.length + data.forEach(function (item, index) { + if (downloadPathArr.length == 0 || (item.downloadPath !== downloadPathArr[downloadPathArr.length - 1].downloadPath)) { + downloadPathArr.push({ + downloadPath: item.downloadPath, + ownerId: item.ownerId, + iStorageVersion: item.iStorageVersion, + videoType: item.videoType, + iPlaySpeed: 0, + startTime: item.startTime, + endTime: item.endTime + }) + } else { + downloadPathArr[downloadPathArr.length - 1].endTime = item.endTime; + } + }) + return downloadPathArr; + } + } + function recAPIError(err) { + console.log("获取回放片段错误") + } + request(recSliceUrl, 'POST', recSliceParams, '', recAPISuccess, recAPIError); + + } else {// 本地回放 + //alarm rec - start + if (playParams.url.indexOf('alarmId') !== -1) { + console.log("进入alarmId回放") + // 调用回放API接口获取回放片段 - start + var alarmId = getQueryString('alarmId', realUrl) + var recBegin = reRormatRecTime(getQueryString('begin', realUrl)); + var recEnd = reRormatRecTime(getQueryString('end', realUrl)); + var deviceSerial = getQueryString('serial', realUrl) + var channelNo = getQueryString('chn', realUrl); + + var recSliceUrl = apiDomain + "/api/lapp/video/by/id"; + var recSliceParams = { + accessToken: playParams.accessToken, + // recType: 1, + deviceSerial: deviceSerial, + channelNo: channelNo, + alarmId: alarmId, + // startTime:recBegin, + // endTime:recEnd + } + function recAPISuccess(data) { + if (data.code == 200) { + var recSliceArr = []; + if (data.data) { + recSliceArr = recSliceArrFun([data.data]); + var recSliceArrJSON = JSON.stringify(recSliceArr).replace('\\', ''); + realUrl += ('&recSlice=' + recSliceArrJSON.replace('\\', '')); + console.log("realUrl", realUrl, data.data.recType); + if (data.data.recType == 1) { + realUrl = realUrl.replace('/playback', '/cloudplayback') + } else { + realUrl = realUrl.replace('/cloudplayback', '/playback') + + } + _this.opt.sources[0] = realUrl; + resolve(realUrl); + // request(nodeUrl, 'GET', '', '', nodeSuccess, nodeError); + } else { + _this.log('未找到录像片段', 'error'); + _this.loadingSet(0, { text: '获取设备播放地址' }) + resolve(JSON.stringify({ code: -1, msg: "未找到录像片段" })) + // reject('未找到录像片段'); + } + } else { + _this.log(data.msg, 'error'); + _this.loadingSet(0, { text: '获取设备播放地址' }); + resolve(JSON.stringify({ code: -1, msg: "未找到录像片段" })) + //reject('未找到录像片段'); + } + function recSliceArrFun(data) { + var downloadPathArr = []; + var currentDP = downloadPathArr.length + data.forEach(function (item, index) { + if (downloadPathArr.length == 0 || (item.downloadPath !== downloadPathArr[downloadPathArr.length - 1].downloadPath)) { + downloadPathArr.push({ + downloadPath: item.downloadPath, + ownerId: item.ownerId, + iStorageVersion: item.iStorageVersion, + videoType: item.videoType, + iPlaySpeed: 0, + startTime: item.startTime, + endTime: item.endTime + }) + } else { + downloadPathArr[downloadPathArr.length - 1].endTime = item.endTime; + } + }) + console.log("downloadPathArr", downloadPathArr) + return downloadPathArr; + } + } + function recAPIError(err) { + console.log("获取回放片段错误") + } + request(recSliceUrl, 'POST', recSliceParams, '', recAPISuccess, recAPIError); + } else { + // arlar rec - end + // request(nodeUrl, 'GET', '', '', nodeSuccess, nodeError); + resolve(realUrl); + } + } + + } else { + // 预览直接获取回放片段 + // request(nodeUrl, 'GET', '', '', nodeSuccess, nodeError); + resolve(realUrl); + } + getPlayTokenST = new Date().getTime(); + // 执行一次API服务请求上报 + var getRealUrlDurationET = new Date().getTime(); + ezuikitDclog({ + systemName: PERFORMANCE_EZUIKIT, + bn: 0, + browser: JSON.stringify(getBrowserInfo()), + duration: getRealUrlDurationET - getRealUrlDurationST, + rt: 200, + }) + } else { + // 将错误信息捕获到用户自定义错误回调中 + if (playParams && playParams.handleError) { + playParams.handleError(Object.assign({retcode: data.code || -1,msg: data.msg || '其他错误'})); + } + // 执行一次API服务请求服务错误上报 + var getRealUrlDurationET = new Date().getTime(); + ezuikitDclog({ + systemName: PERFORMANCE_EZUIKIT, + bn: 0, + browser: JSON.stringify(getBrowserInfo()), + duration: getRealUrlDurationET - getRealUrlDurationST, + rt: data.code || 500, + msg: data.msg || '未知服务错误' + }) + resolve(JSON.stringify(data), 'error') + //throw new Error('获取播放设备信息失败'); + } + /**参数容错处理 end*/ + } + var apiError = function (error) { + // 将错误信息捕获到用户自定义错误回调中 + if (playParams && playParams.handleError) { + playParams.handleError(Object.assign({retcode: error.code || -1,msg: error.msg || '其他错误'})); + } + var getRealUrlDurationET = new Date().getTime(); + ezuikitDclog({ + systemName: PERFORMANCE_EZUIKIT, + bn: 0, + browser: JSON.stringify(getBrowserInfo()), + duration: getRealUrlDurationET - getRealUrlDurationST, + rt: 500, + msg: data.msg || '网络错误' + }) + resolve(JSON.stringify(error)) + //throw new Error('获取播放设备信息失败'); + } + var isHttp = 'false'; + if (playParams && playParams.env && playParams.env.domain) { + isHttp = playParams.env.domain.indexOf('https') !== -1 ? 'false' : 'true'; + } else { + isHttp = window.location.href.indexOf('https') !== -1 ? 'false' : 'true'; + } + var apiParams = { + ezopen: ezopenURL, + userAgent: window.navigator.userAgent, + isFlv: false, + addressTypes: null, + isHttp: isHttp, + accessToken: playParams.accessToken, + } + request(apiUrl, 'POST', apiParams, '', apiSuccess, apiError); + } + } + var urlList = playParams.url.split(',') + var promiseTaskList = []; + var promiseTaskFun = function (ezopenURL) { + return new Promise(function (resolve, reject) { return getRealUrlPromise(resolve, reject, ezopenURL) }) + }; + urlList.map(function (item, index) { + _this.loadingSet(index, { text: '获取设备播放地址' }) + promiseTaskList.push(promiseTaskFun(item)); + }); + var getRealUrlPromiseObj = Promise.all(promiseTaskList) + .then(function (result) { + // 获取真实地址成功后,赋值到opt属性中 + _this.opt.sources = result; + _this.opt.currentSource = result[0]; + result.forEach(function (item, index) { + _this.loadingSet(index, { text: '获取播放地址成功' }) + }) + }) + .catch(function (err) { + _this.log("获取真实地址错误" + JSON.stringify(err), 'error') + }) + return getRealUrlPromiseObj; + } + } else { + if (!this.opt.currentSource) { + this.log('未找到合适的播放URL', 'error'); + return; + } + var me = this; + // 如果不是ezopen打头的,走原来的播放模式 + if (!/^ezopen:\/\//.test(this.opt.currentSource)) { + this.tryPlay(this.opt.currentSource); + } else { + // 如果是ezopen协议地址,先校验一下地址的合法性 + if (!/^ezopen:\/\//.test(this.opt.currentSource)) { + throw new Error('EZOPEN地址必须要以ezopen://开头'); + return; + } else if (this.opt.currentSource.indexOf('.com/') === -1) { + throw new Error('EZOPEN地址格式不正确'); + return; + } else if (!/[a-z\d]{32}(\.hd)?\.live/.test(this.opt.currentSource)) { + throw new Error('EZOPEN地址格式uuid格式不正确'); + return; + } else if (/(.*.hls.*|.*.m3u8.*|.*.wss.*|.*.flv.*|.*.rtmp.*){2,}/.test(this.opt.currentSource)) { + throw new Error('EZOPEN地址多于两个播放协议'); + return; + } else if (this.opt.currentSource.search(/(.hls|.m3u8|.wss|.flv|.rtmp)/) !== -1 && !/.live(.hls|.m3u8|.wss|.flv|.rtmp)/.test(this.opt.currentSource)) { + throw new Error('请指定正确的播放协议'); + return; + } else if (this.opt.currentSource.search(/(.hls|.m3u8|.wss|.flv|.rtmp)/) === -1 && !/[a-z\d]{32}(\.hd)?\.live$/.test(this.opt.currentSource)) { + throw new Error('EZOPEN地址结尾不正确'); + return; + } else { + /* 获取播放地址 - 开始 */ + var that = this; + addJs(flv_js, function () { + var para = { + "ezopen": that.opt.currentSource, + "userAgent": window.navigator.userAgent, + "isFlv": flvjs && flvjs.isSupported() ? flvjs.isSupported() : false, + "addressTypes": "HLS,RTMP,WS,FLV", + "isHttp": window.location.protocol.indexOf('s') > 0 ? false : true, + }; + + dclog({ + "ezopen": that.opt.currentSource, + "userAgent": window.navigator.userAgent, + "isFlv": flvjs && flvjs.isSupported() ? flvjs.isSupported() : false, + "addressTypes": "HLS,RTMP,WS,FLV", + "isHttp": window.location.protocol.indexOf('s') > 0 ? false : true, + 'systemName': 'EZOPEN', + }); + + that.log('---------------------------------------'); + that.log('入参(ezopen)是: ' + para.ezopen); + that.log('---------------------------------------'); + that.log('入参(userAgent)是: ' + para.userAgent); + that.log('---------------------------------------'); + that.log('入参(isFlv)是: ' + para.isFlv); + that.log('---------------------------------------'); + that.log('入参(addressTypes)是: ' + para.addressTypes); + that.log('---------------------------------------'); + that.log('入参(isHttp)是: ' + para.isHttp); + that.log('---------------------------------------'); + + var apiUrl = apiDomain + "/api/lapp/live/url/ezopen"; + var apiSuccess = function (data) { + if (data.code == 200) { + that.log('播放地址是: ' + data.data); + that.video.src = data.data; + that.video.load(); + that.tryPlay(data.data); + } else { + that.log('data: ' + JSON.stringify(data)); + throw new Error(data.msg); + return; + } + } + var apiError = function (error) { + console.log("getdecoder url from api error", error); + } + request(apiUrl, 'POST', para, '', apiSuccess, apiError); + }); + } /* 获取播放地址 - 结束 */ + } + } + // 格式化回放时间 + function formatRecTime(time, defaultTime) { + // 用户格式 无需更改 => 20182626T000000Z + // return time + // 用户格式需要更改 + //用户时间长度为 14 20181226000000 =》 20181226000000 + // 用户长度为12 201812260000 =》 201812260000 + defaultTime后面2位 + // 用户长度为10 2018122600 =》 201812260000 + defaultTime后面4位 + // 用户长度为8 20181226 =》 201812260000 + defaultTime后面6位 + // 结果 20181226000000 14位 + // 插入 TZ + var reg = /^[0-9]{8}T[0-9]{6}Z$/; + if (reg.test(time)) { // 用户格式 无需更改 => 20182626T000000Z + return time; + } else if (/[0-9]{8,14}/.test(time)) { + var start = 6 - (14 - time.length); + var end = defaultTime.length; + var standardTime = time + defaultTime.substring(start, end); + return standardTime.slice(0, 8) + 'T' + standardTime.slice(8) + 'Z'; + } else { + throw new Error('回放时间格式有误,请确认'); + } + } + function reRormatRecTime(time) { + var year = time.slice(0, 4); + var month = time.slice(4, 6); + var day = time.slice(6, 8); + var hour = time.slice(9, 11); + var minute = time.slice(11, 13); + var second = time.slice(13, 15); + var date = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second; + return new Date(date.replace(/-/g, '/')).getTime(); + } + }; + + // 尝试播放 + EZUIPlayer.prototype.tryPlay = function (playParams) { + this.log("开始尝试播放,播放配置参数为:"); + this.log(playParams); + var _this = this; + // JSDecoder 播放 + if (playParams && typeof playParams === 'object' && playParams.decoderPath) { + /** 初始化Decoder */ + // this.initDecoder(playParams); + // 自动播放 + // if(playParams.autoplay){ + // console.log('配置了自动播放'); + // setTimeout(function(){ + // _this.play(); + // },2000) + // } + } else { + this.opt.currentSource = playParams; + var me = this; + // 如果是HLS地址 + if (/\.m3u8/.test(playParams)) { + // 如果是手机浏览器环境,或者原生支持HLS播放的,直接使用video标签播放 + // 否则尝试使用hls.js播放, + // 最后使用flash + if (isMobile || isNativeSupportHls) { + this.log('使用原生video'); + this.video.style.heght = this.opt.height = Number(this.opt.width.replace(/px$/g, '')) * 9 / 16 + 'px'; + this.initVideoEvent(); + } else { + var isPlayUrlHttps = playParams.indexOf('https') !== -1; + if (isHttps && !isPlayUrlHttps) { //https网站,http视频源安全问题需要flash播放 + addJs(ckplayerJS, function () { + me.initCKPlayer(); + }); + } else { + addJs(hlsJS, function () { + isSupportHls = Hls.isSupported(); + if (isSupportHls) { + me.log('使用hls.js'); + me.initHLS(playParams); + } else { + useFlash = true; + me.log('2 使用flash'); + addJs(ckplayerJS, function () { + me.initCKPlayer(); + }); + } + }); + } + } + } else if (/^rtmp:/.test(playParams)) { + if (isMobile) { + this.opt.cur++; + this.tryPlay(playParams); + return; + } else { + addJs(ckplayerJS, function () { + me.initCKPlayer(playParams); + }); + } + } else if (/^wss:|^ws:/.test(playParams)) { + /* + * WS协议的JSMpeg的不支持IE11以下的版本 + * 开放平台官网不支持IE8打开,所以官网上面不兼容两个人版本IE9 ,和IE10 + * + * */ + if (!ltIE11()) { + addJs(mpegJS, function () { + me.initJSmpeg(playParams); + }); + } else { + alert('WS协议不支持Ie11以下的浏览器!请使用IE11,或者更高版本的浏览器'); + return; + } + } else if (/\.flv/.test(this.opt.currentSource)) { + if (!ltIE11()) { + addJs(ckplayerJS, function () { + me.initCKPlayer(); + }); + } else { + addJs(flv_js, function () { + me.log("使用flv.js播放"); + me.initflv(); + }); + } + } + } + }; + + // 初始化hls.js + EZUIPlayer.prototype.initHLS = function (hlsURL) { + var me = this; + var hls = new Hls({ defaultAudioCodec: 'mp4a.40.2' }); // 萤石设备默认使用 AAC LC 音频编码 + hls.loadSource(hlsURL); + hls.attachMedia(this.video); + hls.on(Hls.Events.MANIFEST_PARSED, function () { + if (me.opt.autoplay) { + me.video.play(); + } + me.initVideoEvent(); + }); + hls.on(Hls.Events.ERROR, function (event, data) { + if (data.fatal) { + switch (data.type) { + case Hls.ErrorTypes.NETWORK_ERROR: + // try to recover network error + console.log("fatal network error encountered, try to recover"); + hls.startLoad(); + break; + case Hls.ErrorTypes.MEDIA_ERROR: + console.log("fatal media error encountered, try to recover"); + hls.recoverMediaError(); + break; + default: + // cannot recover + hls.destroy(); + break; + } + } + }); + + this.hls = hls; + }; + + + // 初始化ckplayer + EZUIPlayer.prototype.initCKPlayer = function (url) { + this.log('ckplayer初始化'); + var me = this; + var events = { + 'play': function () { me.emit('play') }, + 'pause': function () { me.emit('pause') }, + 'error': function () { me.emit('error') } + }; + window.ckplayer_status = function () { + me.log(arguments); + events[arguments[0]] && events[arguments[0]](); + }; + + // 新增相同id的div标签,然后删除video标签 + this.videoFlash = document.createElement('DIV'); + this.video.parentNode.replaceChild(this.videoFlash, this.video); + this.video = this.videoFlash; + this.videoFlash.id = this.opt.parentId; + var flashvars = null; + // 如果rtmp服务器环境设置了视频暂停则断开链接 + // 需要修改ckplayer.js setup参数第30个值 + // 在播放暂停后点击播放是否采用重新链接的方式 + if (/^rtmp/.test(this.opt.currentSource)) { + flashvars = { + f: this.opt.currentSource, + c: 0, + p: this.opt.autoplay ? 1 : 0, + i: this.opt.poster, + lv: 1, + loaded: 'loadHandler' + }; + } else if (/\.m3u8/.test(this.opt.currentSource)) { + flashvars = { + s: 4, // 4-使用swf视频流插件播放 + f: m3u8SWF, + a: this.opt.currentSource, + c: 0, // 0-使用ckplayer.js的配置 1-使用ckplayer.xml的配置 + lv: 1, // 1-直播 0-普通方式 + p: this.opt.autoplay ? 1 : 0, // 1-默认播放 0-默认暂停 + i: this.opt.poster, + loaded: 'loadHandler' + }; + } else { + flashvars = { + f: this.opt.currentSource, + c: 0, + p: 1, + loaded: 'loadHandler' + }; + } + var params = { bgcolor: '#FFF', allowFullScreen: true, allowScriptAccess: 'always', wmode: 'transparent' }; + this.flashId = this.opt.parentId + 'flashId'; + window.CKobject.embedSWF(ckplayerSWF, this.opt.parentId, this.flashId, this.opt.width, this.opt.height, flashvars, params); + }; + + EZUIPlayer.prototype.initVideoEvent = function () { + var me = this; + var EVENT = { + 'loadstart': function (e) { + me.log('loadstart...当浏览器开始查找音频/视频时...'); + me.emit('loadstart', e); + }, + 'durationchange': function (e) { + me.log('durationchange...当音频/视频的时长已更改时...'); + me.emit('durationchange', e); + }, + 'loadedmetadata': function (e) { + me.log('loadedmetadata...当浏览器已加载音频/视频的元数据时...'); + me.emit('loadedmetadata', e); + }, + 'loadeddata': function (e) { + me.log('loadeddata...当浏览器已加载音频/视频的当前帧时...'); + me.emit('loadeddata', e); + }, + 'progress': function (e) { + me.log('progress...当浏览器正在下载音频/视频时...'); + me.emit('progress', e); + }, + 'canplay': function (e) { + me.log('canplay...当浏览器可以播放音频/视频时...'); + me.emit('canplay', e); + }, + 'canplaythrough': function (e) { + me.log('canplaythrough...当浏览器可在不因缓冲而停顿的情况下进行播放时...'); + me.emit('canplaythrough', e); + }, + 'abort': function (e) { + me.log('abort...当音频/视频的加载已放弃时...'); + me.emit('abort', e); + }, + 'emptied': function (e) { + me.log('emptied...当目前的播放列表为空时...'); + me.emit('emptied', e); + }, + 'ended': function (e) { + me.log('ended...当目前的播放列表已结束时...'); + me.emit('ended', e); + }, + 'pause': function (e) { + me.log('pause...当音频/视频已暂停时...'); + me.emit('pause', e); + }, + 'play': function (e) { + me.log('play...当音频/视频已开始或不再暂停时...'); + me.emit('play', e); + }, + 'playing': function (e) { + me.log('playing...当音频/视频在已因缓冲而暂停或停止后已就绪时...'); + me.emit('playing', e); + }, + 'ratechange': function (e) { + me.log('ratechange...当音频/视频的播放速度已更改时...'); + me.emit('ratechange', e); + }, + 'seeked': function (e) { + me.log('seeked...当用户已移动/跳跃到音频/视频中的新位置时...'); + me.emit('seeked', e); + }, + 'seeking': function (e) { + me.log('seeking...当用户开始移动/跳跃到音频/视频中的新位置时...'); + me.emit('seeking', e); + }, + 'stalled': function (e) { + me.log('stalled...当浏览器尝试获取媒体数据,但数据不可用时...'); + me.emit('stalled', e); + }, + 'suspend': function (e) { + me.log('suspend...当浏览器刻意不获取媒体数据时...'); + me.emit('suspend', e); + if (me.opt.autoplay) { + me.video.play(); + } + }, + 'timeupdate': function (e) { + //me.log('timeupdate...当目前的播放位置已更改时...'); + me.emit('timeupdate', e); + }, + 'volumechange': function (e) { + me.log('volumechange...当音量已更改时...'); + me.emit('volumechange', e); + }, + 'waiting': function (e) { + me.log('waiting...当视频由于需要缓冲下一帧而停止...'); + me.emit('waiting', e); + }, + 'error': function (e) { + me.log('error...当在音频/视频加载期间发生错误时...'); + me.emit('error', e); + } + + }; + for (var i in EVENT) { + this.video.addEventListener(i, EVENT[i], false); + } + + ios11Hack(this.video); + + }; + + EZUIPlayer.prototype.initJSmpeg = function (jsmpegUrl) { + this.canvasEle = document.createElement('canvas'); + this.canvasEle.style.width = this.opt.width; + this.canvasEle.style.height = this.opt.height; + this.video.parentNode.replaceChild(this.canvasEle, this.video); + this.canvasEle.id = this.opt.parentId; + var player; + if (player && player.destroy) { + player.destroy(); + } + player = new JSMpeg.Player(jsmpegUrl, { canvas: this.canvasEle }); + this.JSmpeg = player; + }; + + EZUIPlayer.prototype.initflv = function () { + if (flvjs.isSupported()) { + var player = this.video; + var hasControls = player.getAttribute('controls'); + if (!hasControls) { + player.setAttribute('controls', true); + } + var flvPlayer = flvjs.createPlayer({ + type: 'flv', + url: this.opt.currentSource, + isLive: true, + }, { + enableStashBuffer: true, + stashInitialSize: 128, + enableWorker: true + }); + + flvPlayer.attachMediaElement(player); + flvPlayer.load(); + flvPlayer.play(); + } else { + this.log("浏览器不支持flv播放"); + throw new Error('浏览器不支持flv播放'); + return; + } + this.flv = flvPlayer; + }; + EZUIPlayer.prototype.rePlay = function (playParams) { + this.loadingStart(); + // _this.loadingSet(0,{text:'获取设备播放地址'}) + var _this = this; + var getRealUrl = this.getRealUrl(playParams); + /**是否自动播放 */ + if (isPromise(getRealUrl)) { + getRealUrl.then(function (data) { + _this.play(playParams); + }) + .catch(function (err) { + console.log("播放错误", err) + }); + } + } + + EZUIPlayer.prototype.play = function (data) { + // debugger + //var index = params.index; + if (!!window['CKobject']) { + this.opt.autoplay = true; + this.initCKPlayer(); + } else if (!!this.video) { // video播放 包含flv, hls + if (!!this.hls) { // hls开始播放依赖 this.hls + this.opt.autoplay = true; + this.hls.startLoad(); + this.video.play(); + } else if (!!this.JSmpeg) { + this.JSmpeg.play(); + } else { // 其他开始播放使用原生video + this.opt.autoplay = true; + this.video.play(); + } + } else if (!!this.jSPlugin) { + var playParams = this.playParams; + + var audioId = 0 + if(playParams && playParams.audioId){ + audioId = playParams.audioId; + }else if(playParams && playParams.audioId === -1){ + audioId = undefined; + } + if ( typeof data === 'string'){ + playParams.url = data; + }else if(typeof data === 'object'){ + playParams = Object.assign(playParams,data); + } + var getRealUrl = this.getRealUrl(playParams); + var _this = this; + getRealUrl.then(function () { + function getPlayParams(url) { + var websocketConnectUrl = url.split('?')[0].replace('/live', '').replace('/playback', ''); + // console.log("playParams,",playParams,playParams.env.wsUrl) + // if(playParams && playParams.env && playParams.env.wsUrl){ + // websocketConnectUrl= playParams.env.wsUrl; + // } + console.log("_this.opt.sources.", _this.opt.sources) + var websocketStreamingParam = (url.indexOf('/live') === -1 ? (url.indexOf('cloudplayback') !== -1 ? '/cloudplayback?' : '/playback?') : '/live?') + url.split('?')[1]; + // 本地回放仅支持主码流 - 2019-11-05 修订 + if (websocketStreamingParam.indexOf('/playback') !== -1) { + websocketStreamingParam = websocketStreamingParam.replace("stream=2", 'stream=1'); + } + // 本地回放仅支持主码流 + return { websocketConnectUrl: websocketConnectUrl, websocketStreamingParam: websocketStreamingParam } + } + _this.opt.sources.forEach(function (item, index) { + if (getQueryString('dev', item) || item.indexOf('ws') !== -1) { + _this.log("开始播放, 第" + (index + 1) + '路,' + '地址:' + item); + _this.loadingSet(index, { text: '准备播放...', color: '#fff' }) + // 设置秘钥 - 如果地址中包含秘钥参数,播放前配置到JSPlugin对应实例中 + var validateCode = getQueryString('checkCode', item); + if (validateCode) { + _this.log('设置秘钥,视频路数:' + (index + 1) + '验证码:' + validateCode) + _this.jSPlugin.JS_SetSecretKey(index, validateCode); + } + var playST = new Date().getTime(); + + var wsUrl = '' + var wsParams = '' + if (_this.playParams && _this.playParams.hasOwnProperty('userName') && _this.playParams.hasOwnProperty('password')) { + wsUrl = item.split('?')[0]; + wsParams = { + sessionID: getQueryString('sessionID', item), + } + } else { + wsUrl = getPlayParams(item).websocketConnectUrl; + wsParams = { + playURL: getPlayParams(item).websocketStreamingParam + } + } + _this.jSPlugin.JS_Play(wsUrl, wsParams, index).then(function () { + _this.log('播放成功,当前播放第' + (index + 1) + '路'); + _this.loadingSet(index, { text: '播放成功...' }); + //单次播放日志上报 + ezuikitDclog({ + systemName: PERFORMANCE_EZUIKIT, + bn: 2, + browser: JSON.stringify(getBrowserInfo()), + duration: new Date().getTime() - playST, + rt: 200, + }) + // 播放成功 + ezuikitDclog({ + systemName: PERFORMANCE_EZUIKIT, + bn: 99, + browser: JSON.stringify(getBrowserInfo()), + duration: new Date().getTime() - playStartTime, + rt: 200, + }) + _this.loadingEnd(index); + // 默认开启声音 + // 默认开启第一路声音 + if (typeof(audioId) !== "undefined" && audioId === index) { + _this.log("默认开启第1路声音"); + setTimeout(function () { + var openSoundRT = _this.jSPlugin.JS_OpenSound(0); + console.log("openSoundRT", openSoundRT) + openSoundRT.then(function (data) { + _this.log('开启声音成功', data) + }) + .catch(function (err) { + _this.log('开启声音失败', 'error', err) + }) + }, 100) + } + // 播放成功回调 + if (playParams && playParams.handleSuccess) { + playParams.handleSuccess(); + } + // + // 播放成功日志上报 + var PlTp = 1; + if (playParams && playParams.url) { + if (playParams.url.indexOf('rec') !== -1) { + PlTp = 2; + } + } + dclog({ + systemName: PLAY_MAIN, + playurl: encodeURIComponent(item), + Time: (new Date()).Format('yyyy-MM-dd hh:mm:ss.S'), + Enc: 0, // 0 不加密 1 加密 + PlTp: PlTp, // 1 直播 2 回放 + Via: 2, // 2 服务端取流 + ErrCd: 0, + OpId: uuid(), + Cost: (new Date()).getTime() - _this.initTime, // 毫秒数 + Serial: getQueryString('dev', item), + Channel: getQueryString('chn', item), + }); + }, function (err) { + _this.log('播放失败' + JSON.stringify(err), 'error'); + var errorInfo = JSON.parse(_this.errorCode).find(function (item) { return item.detailCode.substr(-4) == err.oError.errorCode }); + ezuikitDclog({ + systemName: PERFORMANCE_EZUIKIT, + bn: 2, + browser: JSON.stringify(getBrowserInfo()), + duration: new Date().getTime() - playStartTime, + rt: err.oError ? err.oError.errorCode : 500, + msg: errorInfo ? errorInfo.description : '播放过程其他错误' + }) + var msg = errorInfo ? errorInfo.description : '播放过程其他错误'; + _this.loadingSet(index, { text: msg, color: 'red' }); + dclog({ + systemName: PLAY_MAIN, + playurl: encodeURIComponent(item), + cost: -1, + ErrCd: (err && err.oError && err.oError.errorCode && (err.oError.errorCode + "").substr(-4)) || -1, + Via: 2, + OpId: uuid(), + Serial: getQueryString('dev', item), + Channel: getQueryString('chn', item), + }); + if (playParams && playParams.handleError) { + var errorInfo = JSON.parse(_this.errorCode).find(function (item) { return item.detailCode.substr(-4) == err.oError.errorCode }) + playParams.handleError({ retcode: err.oError.errorCode, msg: errorInfo ? errorInfo.description : '其他错误' }); + } + }) + + } else { + if (isJSON(item) && JSON.parse(item).msg) { + _this.loadingSet(index, { text: JSON.parse(item).msg, color: 'red' }) + } + } + }) + }) + } + + + }; + EZUIPlayer.prototype.initDecoder = function (playParams) { + this.opt.id = playParams.id; + this.log("初始化解码器---开始"); + var _this = this; + var initDecoderDurationST = new Date().getTime(); + // DOM id + function initDecoder(resolve, reject) { + var jsPluginPath = playParams.decoderPath + '/js/jsPlugin-1.2.0.min.js'; + + /** 初始化解码器 */ + addJs(jsPluginPath, function () { + _this.log("下载解码器完成,开始初始化"); + /* decoder 属性配置 */ + _this.jSPlugin = new JSPlugin({ + szId: playParams.id, + // iType: 2, + // iMode: 0, + iWidth: playParams.width || 600, + iHeight: playParams.height || 400, + iMaxSplit: Math.ceil(Math.sqrt(playParams.url.split(",").length)), + iCurrentSplit: playParams.splitBasis || Math.ceil(Math.sqrt(playParams.url.split(",").length)), + szBasePath: playParams.decoderPath + '/js', + oStyle: { + border: "none", + background: "#000000" + } + }); + _this.jSPlugin.JS_SetWindowControlCallback({ + windowEventSelect: function (iWndIndex) { //插件选中窗口回调 + iWind = iWndIndex; + }, + pluginErrorHandler: function (iWndIndex, iErrorCode, oError) { //插件错误回调 + console.log(iWndIndex, iErrorCode, oError); + if (playParams && playParams.handleError) { + playParams.handleError({ retcode: iErrorCode, msg: oError ? oError : '播放失败,请重试' }); + if(playParams.url.indexOf("alarmId")!== -1) { + _this.loadingSetIcon(iWndIndex, 'retry'); + _this.loadingSet(iWndIndex, { text: '播放结束' }); + } else { + _this.loadingSetIcon(iWndIndex, 'retry'); + _this.loadingSet(iWndIndex, { text: '播放失败,请重试' }); + } + } + }, + }); + _this.jSPlugin.JS_SetOptions({ + //bSupportSound: false //是否支持音频,默认支持 + bSupporDoubleClickFull: typeof playParams.isSupporDoubleClickFull === 'undefined' ? true : playParams.isSupporDoubleClickFull, //是否双击窗口全屏,默认支持 + //bOnlySupportMSE: true //只支持MSE + bOnlySupportJSDecoder: (typeof playParams.useMSE === 'undefined' || playParams.useMSE === false) ? true : false, //是否强制使用jsdecoder + }).then(function () { + console.log("JS_SetOptions"); + }); + // 注册全屏事件 + window.onresize = function () { + _this.jSPlugin.JS_Resize(playParams.width || 600, playParams.height || 400); + } + _this.log("初始化解码器----完成"); + // 执行一次初始化解码器服务请求上报 + ezuikitDclog({ + systemName: PERFORMANCE_EZUIKIT, + bn: 1, + browser: JSON.stringify(getBrowserInfo()), + duration: new Date().getTime() - initDecoderDurationST, + rt: 200, + }) + resolve('200 OK') + }); + /** + * 加载错误码 + * 错误码维护平台 - omm管理系统 + */ + function success(data) { + if (data.code == 200) { + if (!window.localStorage) { + return false; + } else { + var storage = window.localStorage; + //写入a字段 + storage["errorCode"] = JSON.stringify(data.data); + _this.errorCode = storage['errorCode']; + } + } + } + if (!window.localStorage) { + request( + playParams.decoderPath + "/js/errorCode.json", + "get", + { + language: 1, + time: new Date().getTime(), + appKey: '26810f3acd794862b608b6cfbc32a6b8', + }, + '', + success + ); + } else { + var storage = window.localStorage; + var errorCode = storage.errorCode; + if (!errorCode) { + request( + playParams.decoderPath + "/js/errorCode.json", + "get", + { + language: 1, + time: new Date().getTime(), + appKey: '26810f3acd794862b608b6cfbc32a6b8', + }, + '', + success + ); + } else { + _this.errorCode = storage['errorCode']; + } + } + + + } + var initDecoderPromise = new Promise(initDecoder); + + return initDecoderPromise; + } + EZUIPlayer.prototype.stop = function (i, unDestory) { + // 执行停止 + this.log("停止播放" + this.opt.currentSource); + this.opt.autoplay = false; + if (!!window['CKobject']) { + //CKobject.getObjectById(this.flashId).destroy(); + this.video.src = "" + // this.video.remove(); + } else if (!!this.video) { + if (!!this.hls) { // hls停止依赖this.hls + // 通过暂停停止播放 + this.video.pause(); + this.video.src = "" + // 停止取流 + this.hls.stopLoad(); + } else if (!!this.flv) { + this.flv.pause(); + this.flv.unload(); + this.flv.detachMediaElement(); + this.flv.destroy(); + this.flv = null; + } else if (!!this.JSmpeg) { + this.JSmpeg.stop(); + // this.JSmpeg.destroy(); + } + } else if (!!this.jSPlugin) { + var _this = this; + if (typeof i === "undefined") { + return this.jSPlugin.JS_Stop(0).then(function () { + _this.log("停止播放成功" + _this.opt.currentSource); + console.log("stop success"); + // 额外销毁worker + // _this.jSPlugin.JS_DestroyWorker(); + _this.loadingEnd(0); + //removeChild(0); + }, function () { + _this.log("停止播放失败" + _this.opt.currentSource); + console.log("stop failed"); + }); + } else { + return this.jSPlugin.JS_Stop(i).then(function () { + _this.log("第" + i + "路停止播放成功" + _this.opt.currentSource); + _this.loadingEnd(i); + console.log("stop success"); + }, function () { + _this.log("第" + i + "路停止播放失败" + _this.opt.currentSource); + _this.loadingEnd(i); + console.log("stop failed"); + }); + // 额外销毁worker - 多窗口暂不销毁 + // this.jSPlugin.JS_DestroyWorker(); + //removeChild(i); + } + } + }; + EZUIPlayer.prototype.destroy = function (i) { + _this.jSPlugin.JS_DestroyWorker(); + } + + // 获取OSD时间 + // EZUIPlayer.prototype.getOSDTime = function (callback, iWind) { + // if (!!this.jSPlugin) { + // this.jSPlugin.JS_GetOSDTime(iWind || 0).then(function (iTime) { + // callback(iTime * 1000); + // }, function (err) { + // console.log("get OSD Time error", err); + // }); + // } else { + // throw new Error("Method not support"); + // } + // } + // 返回promise的getOSDTime方法 + EZUIPlayer.prototype.getOSDTime = function (wNum) { + const _this = this; + if (!!this.jSPlugin) { + return _this.jSPlugin.JS_GetOSDTime(wNum || 0); + } else { + throw new Error("Method not support"); + } + } + // 返回promise的getOSDTime方法 + EZUIPlayer.prototype.getVersion = function (wNum) { + const _this = this; + if (!!this.jSPlugin) { + console.log(_this.jSPlugin.JS_GetSdkVersion()); + } else { + throw new Error("Method not support"); + } + } + + // 开启声音 + EZUIPlayer.prototype.openSound = function (iWind) { + if (!!this.jSPlugin) { + var openSoundRT = this.jSPlugin.JS_OpenSound(iWind || 0); + openSoundRT === 0 ? this.log('开启声音成功') : this.log('开启声音失败', 'error'); + return openSoundRT; + } else { + throw new Error("Method not support"); + } + } + // 全屏 + EZUIPlayer.prototype.fullScreen = function () { + if (!!this.jSPlugin) { + return this.jSPlugin.JS_FullScreenDisplay(1); + } else { + throw new Error("Method not support"); + } + } + // 关闭声音 + EZUIPlayer.prototype.closeSound = function (iWind) { + if (!!this.jSPlugin) { + var closeSoundRT = this.jSPlugin.JS_CloseSound(iWind || 0); + closeSoundRT === 0 ? this.log('关闭声音成功') : this.log('关闭声音失败', 'error'); + return closeSoundRT; + } else { + throw new Error("Method not support"); + } + } + // 视频截图 + EZUIPlayer.prototype.capturePicture = function (iWind, pictureName) { + if (!!this.jSPlugin) { + return this.jSPlugin.JS_CapturePicture(iWind, pictureName) + } else { + throw new Error("Method not support"); + } + } + // 开始录像 + EZUIPlayer.prototype.startSave = function (iWind, fileName) { + if (!!this.jSPlugin) { + this.log("开始录制录像"); + return this.jSPlugin.JS_StartSave(iWind, fileName) + } else { + throw new Error("Method not support"); + } + } + // 结束录像 + EZUIPlayer.prototype.stopSave = function (iWind) { + if (!!this.jSPlugin) { + return this.jSPlugin.JS_StopSave(iWind); + this.log("结束录制录像"); + } else { + throw new Error("Method not support"); + } + } + EZUIPlayer.prototype.reSize = function (width, height) { + if (!!this.jSPlugin) { + return this.jSPlugin.JS_Resize(width, height); + } else { + throw new Error("Method not support"); + } + } + EZUIPlayer.prototype.pause = function () { + this.opt.autoplay = false; + if (!!window['CKobject']) { + CKobject.getObjectById(this.flashId).videoPause(); + } else if (!!this.video) { + if (!!this.JSmpeg) { + this.JSmpeg.pause(); + } else { + this.video.pause(); + } + } else if (!!this.jSPlugin) { + this.jSPlugin.JS_Pause(0).then(function () { + }, function () { + }); + } + }; + + EZUIPlayer.prototype.load = function () { + if (!!window['CKobject']) { + // flash load + } else if (!!this.video) { + this.video.load(); + } + }; + // 开启电子放大 + EZUIPlayer.prototype.enableZoom = function (iWind) { + if (!!this.jSPlugin) { + return this.jSPlugin.JS_EnableZoom(iWind || 0); + } else { + throw new Error("Method not support"); + } + } + // 关闭电子放大 + EZUIPlayer.prototype.closeZoom = function (iWind) { + if (!!this.jSPlugin) { + return this.jSPlugin.JS_DisableZoom(iWind || 0); + } else { + throw new Error("Method not support"); + } + } + + + + // iOS11手机HLS直播在m3u8响应时间过长后不继续请求的hack + function ios11Hack(video) { var isloadeddata = false; var isPlaying = false; var stalledCount = 0; video.addEventListener('loadeddata', function () { isloadeddata = true; }, false); video.addEventListener('stalled', function () { stalledCount++; if (!isPlaying) { if (stalledCount >= 2 && !isloadeddata) { video.load(); video.play(); isloadeddata = false; isPlaying = false; stalledCount = 0; } } }, false); video.addEventListener('playing', function () { isPlaying = true; }); } + function ltIE11() { var userAgent = navigator.userAgent; var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; if (isIE) { return true; } else { return false; } } + + + var EZUIKit = { + 'EZUIPlayer': EZUIPlayer, + }; + // 兼容1.4 以下旧版本 + // var EZUIPlayer = EZuikit.EZUIPlayer; + + if (!noGlobal) { + window.EZUIKit = EZUIKit; + // 兼容1.4 以下旧版本 + window.EZUIPlayer = EZUIPlayer; + } + return EZUIKit; +}); diff --git a/public/demo/index.html b/public/demo/index.html new file mode 100644 index 0000000..9999897 --- /dev/null +++ b/public/demo/index.html @@ -0,0 +1,223 @@ + + + + + + + + + + 监控详情 + + + + + + + + +
+
+ +
+
请通过操控云台来调整摄像机视角
+
+
+
+
+
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..1061f67 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..c49fffe --- /dev/null +++ b/public/index.php @@ -0,0 +1,31 @@ + +// +---------------------------------------------------------------------- +// [ 应用入口文件 ] +namespace think; + +require __DIR__ . '/../vendor/autoload.php'; + + +header( "Access-Control-Allow-Origin: *" ); +header( "Access-Control-Allow-Headers: content-type,token , autograph, Origin, X-Requested-With, Content-Type, Accept, Authorization" ); +header( 'Access-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS,PATCH' ); +// 执行HTTP应用并响应 + + +$http = ( new App() )->http; + +$response = $http->run(); + +$response->send(); + + + +$http->end( $response ); diff --git a/public/information.html b/public/information.html new file mode 100644 index 0000000..3d461f4 --- /dev/null +++ b/public/information.html @@ -0,0 +1,56 @@ + + + + + + + 个人信息保护指引 + + + + +
+ + + + + + + diff --git a/public/js/fonts/element-icons.ttf b/public/js/fonts/element-icons.ttf new file mode 100644 index 0000000..91b74de Binary files /dev/null and b/public/js/fonts/element-icons.ttf differ diff --git a/public/js/fonts/element-icons.woff b/public/js/fonts/element-icons.woff new file mode 100644 index 0000000..02b9a25 Binary files /dev/null and b/public/js/fonts/element-icons.woff differ diff --git a/public/js/index.min.css b/public/js/index.min.css new file mode 100644 index 0000000..2e6eaba --- /dev/null +++ b/public/js/index.min.css @@ -0,0 +1 @@ +@charset "UTF-8";.el-pagination--small .arrow.disabled,.el-table .hidden-columns,.el-table td.is-hidden>*,.el-table th.is-hidden>*,.el-table--hidden{visibility:hidden}.el-input__suffix,.el-tree.is-dragging .el-tree-node__content *{pointer-events:none}.el-dropdown .el-dropdown-selfdefine:focus:active,.el-dropdown .el-dropdown-selfdefine:focus:not(.focusing),.el-message__closeBtn:focus,.el-message__content:focus,.el-popover:focus,.el-popover:focus:active,.el-popover__reference:focus:hover,.el-popover__reference:focus:not(.focusing),.el-rate:active,.el-rate:focus,.el-tooltip:focus:hover,.el-tooltip:focus:not(.focusing),.el-upload-list__item.is-success:active,.el-upload-list__item.is-success:not(.focusing):focus{outline-width:0}@font-face{font-family:element-icons;src:url(fonts/element-icons.woff) format("woff"),url(fonts/element-icons.ttf) format("truetype");font-weight:400;font-display:auto;font-style:normal}[class*=" el-icon-"],[class^=el-icon-]{font-family:element-icons!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;vertical-align:baseline;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.el-icon-ice-cream-round:before{content:"\e6a0"}.el-icon-ice-cream-square:before{content:"\e6a3"}.el-icon-lollipop:before{content:"\e6a4"}.el-icon-potato-strips:before{content:"\e6a5"}.el-icon-milk-tea:before{content:"\e6a6"}.el-icon-ice-drink:before{content:"\e6a7"}.el-icon-ice-tea:before{content:"\e6a9"}.el-icon-coffee:before{content:"\e6aa"}.el-icon-orange:before{content:"\e6ab"}.el-icon-pear:before{content:"\e6ac"}.el-icon-apple:before{content:"\e6ad"}.el-icon-cherry:before{content:"\e6ae"}.el-icon-watermelon:before{content:"\e6af"}.el-icon-grape:before{content:"\e6b0"}.el-icon-refrigerator:before{content:"\e6b1"}.el-icon-goblet-square-full:before{content:"\e6b2"}.el-icon-goblet-square:before{content:"\e6b3"}.el-icon-goblet-full:before{content:"\e6b4"}.el-icon-goblet:before{content:"\e6b5"}.el-icon-cold-drink:before{content:"\e6b6"}.el-icon-coffee-cup:before{content:"\e6b8"}.el-icon-water-cup:before{content:"\e6b9"}.el-icon-hot-water:before{content:"\e6ba"}.el-icon-ice-cream:before{content:"\e6bb"}.el-icon-dessert:before{content:"\e6bc"}.el-icon-sugar:before{content:"\e6bd"}.el-icon-tableware:before{content:"\e6be"}.el-icon-burger:before{content:"\e6bf"}.el-icon-knife-fork:before{content:"\e6c1"}.el-icon-fork-spoon:before{content:"\e6c2"}.el-icon-chicken:before{content:"\e6c3"}.el-icon-food:before{content:"\e6c4"}.el-icon-dish-1:before{content:"\e6c5"}.el-icon-dish:before{content:"\e6c6"}.el-icon-moon-night:before{content:"\e6ee"}.el-icon-moon:before{content:"\e6f0"}.el-icon-cloudy-and-sunny:before{content:"\e6f1"}.el-icon-partly-cloudy:before{content:"\e6f2"}.el-icon-cloudy:before{content:"\e6f3"}.el-icon-sunny:before{content:"\e6f6"}.el-icon-sunset:before{content:"\e6f7"}.el-icon-sunrise-1:before{content:"\e6f8"}.el-icon-sunrise:before{content:"\e6f9"}.el-icon-heavy-rain:before{content:"\e6fa"}.el-icon-lightning:before{content:"\e6fb"}.el-icon-light-rain:before{content:"\e6fc"}.el-icon-wind-power:before{content:"\e6fd"}.el-icon-baseball:before{content:"\e712"}.el-icon-soccer:before{content:"\e713"}.el-icon-football:before{content:"\e715"}.el-icon-basketball:before{content:"\e716"}.el-icon-ship:before{content:"\e73f"}.el-icon-truck:before{content:"\e740"}.el-icon-bicycle:before{content:"\e741"}.el-icon-mobile-phone:before{content:"\e6d3"}.el-icon-service:before{content:"\e6d4"}.el-icon-key:before{content:"\e6e2"}.el-icon-unlock:before{content:"\e6e4"}.el-icon-lock:before{content:"\e6e5"}.el-icon-watch:before{content:"\e6fe"}.el-icon-watch-1:before{content:"\e6ff"}.el-icon-timer:before{content:"\e702"}.el-icon-alarm-clock:before{content:"\e703"}.el-icon-map-location:before{content:"\e704"}.el-icon-delete-location:before{content:"\e705"}.el-icon-add-location:before{content:"\e706"}.el-icon-location-information:before{content:"\e707"}.el-icon-location-outline:before{content:"\e708"}.el-icon-location:before{content:"\e79e"}.el-icon-place:before{content:"\e709"}.el-icon-discover:before{content:"\e70a"}.el-icon-first-aid-kit:before{content:"\e70b"}.el-icon-trophy-1:before{content:"\e70c"}.el-icon-trophy:before{content:"\e70d"}.el-icon-medal:before{content:"\e70e"}.el-icon-medal-1:before{content:"\e70f"}.el-icon-stopwatch:before{content:"\e710"}.el-icon-mic:before{content:"\e711"}.el-icon-copy-document:before{content:"\e718"}.el-icon-full-screen:before{content:"\e719"}.el-icon-switch-button:before{content:"\e71b"}.el-icon-aim:before{content:"\e71c"}.el-icon-crop:before{content:"\e71d"}.el-icon-odometer:before{content:"\e71e"}.el-icon-time:before{content:"\e71f"}.el-icon-bangzhu:before{content:"\e724"}.el-icon-close-notification:before{content:"\e726"}.el-icon-microphone:before{content:"\e727"}.el-icon-turn-off-microphone:before{content:"\e728"}.el-icon-position:before{content:"\e729"}.el-icon-postcard:before{content:"\e72a"}.el-icon-message:before{content:"\e72b"}.el-icon-chat-line-square:before{content:"\e72d"}.el-icon-chat-dot-square:before{content:"\e72e"}.el-icon-chat-dot-round:before{content:"\e72f"}.el-icon-chat-square:before{content:"\e730"}.el-icon-chat-line-round:before{content:"\e731"}.el-icon-chat-round:before{content:"\e732"}.el-icon-set-up:before{content:"\e733"}.el-icon-turn-off:before{content:"\e734"}.el-icon-open:before{content:"\e735"}.el-icon-connection:before{content:"\e736"}.el-icon-link:before{content:"\e737"}.el-icon-cpu:before{content:"\e738"}.el-icon-thumb:before{content:"\e739"}.el-icon-female:before{content:"\e73a"}.el-icon-male:before{content:"\e73b"}.el-icon-guide:before{content:"\e73c"}.el-icon-news:before{content:"\e73e"}.el-icon-price-tag:before{content:"\e744"}.el-icon-discount:before{content:"\e745"}.el-icon-wallet:before{content:"\e747"}.el-icon-coin:before{content:"\e748"}.el-icon-money:before{content:"\e749"}.el-icon-bank-card:before{content:"\e74a"}.el-icon-box:before{content:"\e74b"}.el-icon-present:before{content:"\e74c"}.el-icon-sell:before{content:"\e6d5"}.el-icon-sold-out:before{content:"\e6d6"}.el-icon-shopping-bag-2:before{content:"\e74d"}.el-icon-shopping-bag-1:before{content:"\e74e"}.el-icon-shopping-cart-2:before{content:"\e74f"}.el-icon-shopping-cart-1:before{content:"\e750"}.el-icon-shopping-cart-full:before{content:"\e751"}.el-icon-smoking:before{content:"\e752"}.el-icon-no-smoking:before{content:"\e753"}.el-icon-house:before{content:"\e754"}.el-icon-table-lamp:before{content:"\e755"}.el-icon-school:before{content:"\e756"}.el-icon-office-building:before{content:"\e757"}.el-icon-toilet-paper:before{content:"\e758"}.el-icon-notebook-2:before{content:"\e759"}.el-icon-notebook-1:before{content:"\e75a"}.el-icon-files:before{content:"\e75b"}.el-icon-collection:before{content:"\e75c"}.el-icon-receiving:before{content:"\e75d"}.el-icon-suitcase-1:before{content:"\e760"}.el-icon-suitcase:before{content:"\e761"}.el-icon-film:before{content:"\e763"}.el-icon-collection-tag:before{content:"\e765"}.el-icon-data-analysis:before{content:"\e766"}.el-icon-pie-chart:before{content:"\e767"}.el-icon-data-board:before{content:"\e768"}.el-icon-data-line:before{content:"\e76d"}.el-icon-reading:before{content:"\e769"}.el-icon-magic-stick:before{content:"\e76a"}.el-icon-coordinate:before{content:"\e76b"}.el-icon-mouse:before{content:"\e76c"}.el-icon-brush:before{content:"\e76e"}.el-icon-headset:before{content:"\e76f"}.el-icon-umbrella:before{content:"\e770"}.el-icon-scissors:before{content:"\e771"}.el-icon-mobile:before{content:"\e773"}.el-icon-attract:before{content:"\e774"}.el-icon-monitor:before{content:"\e775"}.el-icon-search:before{content:"\e778"}.el-icon-takeaway-box:before{content:"\e77a"}.el-icon-paperclip:before{content:"\e77d"}.el-icon-printer:before{content:"\e77e"}.el-icon-document-add:before{content:"\e782"}.el-icon-document:before{content:"\e785"}.el-icon-document-checked:before{content:"\e786"}.el-icon-document-copy:before{content:"\e787"}.el-icon-document-delete:before{content:"\e788"}.el-icon-document-remove:before{content:"\e789"}.el-icon-tickets:before{content:"\e78b"}.el-icon-folder-checked:before{content:"\e77f"}.el-icon-folder-delete:before{content:"\e780"}.el-icon-folder-remove:before{content:"\e781"}.el-icon-folder-add:before{content:"\e783"}.el-icon-folder-opened:before{content:"\e784"}.el-icon-folder:before{content:"\e78a"}.el-icon-edit-outline:before{content:"\e764"}.el-icon-edit:before{content:"\e78c"}.el-icon-date:before{content:"\e78e"}.el-icon-c-scale-to-original:before{content:"\e7c6"}.el-icon-view:before{content:"\e6ce"}.el-icon-loading:before{content:"\e6cf"}.el-icon-rank:before{content:"\e6d1"}.el-icon-sort-down:before{content:"\e7c4"}.el-icon-sort-up:before{content:"\e7c5"}.el-icon-sort:before{content:"\e6d2"}.el-icon-finished:before{content:"\e6cd"}.el-icon-refresh-left:before{content:"\e6c7"}.el-icon-refresh-right:before{content:"\e6c8"}.el-icon-refresh:before{content:"\e6d0"}.el-icon-video-play:before{content:"\e7c0"}.el-icon-video-pause:before{content:"\e7c1"}.el-icon-d-arrow-right:before{content:"\e6dc"}.el-icon-d-arrow-left:before{content:"\e6dd"}.el-icon-arrow-up:before{content:"\e6e1"}.el-icon-arrow-down:before{content:"\e6df"}.el-icon-arrow-right:before{content:"\e6e0"}.el-icon-arrow-left:before{content:"\e6de"}.el-icon-top-right:before{content:"\e6e7"}.el-icon-top-left:before{content:"\e6e8"}.el-icon-top:before{content:"\e6e6"}.el-icon-bottom:before{content:"\e6eb"}.el-icon-right:before{content:"\e6e9"}.el-icon-back:before{content:"\e6ea"}.el-icon-bottom-right:before{content:"\e6ec"}.el-icon-bottom-left:before{content:"\e6ed"}.el-icon-caret-top:before{content:"\e78f"}.el-icon-caret-bottom:before{content:"\e790"}.el-icon-caret-right:before{content:"\e791"}.el-icon-caret-left:before{content:"\e792"}.el-icon-d-caret:before{content:"\e79a"}.el-icon-share:before{content:"\e793"}.el-icon-menu:before{content:"\e798"}.el-icon-s-grid:before{content:"\e7a6"}.el-icon-s-check:before{content:"\e7a7"}.el-icon-s-data:before{content:"\e7a8"}.el-icon-s-opportunity:before{content:"\e7aa"}.el-icon-s-custom:before{content:"\e7ab"}.el-icon-s-claim:before{content:"\e7ad"}.el-icon-s-finance:before{content:"\e7ae"}.el-icon-s-comment:before{content:"\e7af"}.el-icon-s-flag:before{content:"\e7b0"}.el-icon-s-marketing:before{content:"\e7b1"}.el-icon-s-shop:before{content:"\e7b4"}.el-icon-s-open:before{content:"\e7b5"}.el-icon-s-management:before{content:"\e7b6"}.el-icon-s-ticket:before{content:"\e7b7"}.el-icon-s-release:before{content:"\e7b8"}.el-icon-s-home:before{content:"\e7b9"}.el-icon-s-promotion:before{content:"\e7ba"}.el-icon-s-operation:before{content:"\e7bb"}.el-icon-s-unfold:before{content:"\e7bc"}.el-icon-s-fold:before{content:"\e7a9"}.el-icon-s-platform:before{content:"\e7bd"}.el-icon-s-order:before{content:"\e7be"}.el-icon-s-cooperation:before{content:"\e7bf"}.el-icon-bell:before{content:"\e725"}.el-icon-message-solid:before{content:"\e799"}.el-icon-video-camera:before{content:"\e772"}.el-icon-video-camera-solid:before{content:"\e796"}.el-icon-camera:before{content:"\e779"}.el-icon-camera-solid:before{content:"\e79b"}.el-icon-download:before{content:"\e77c"}.el-icon-upload2:before{content:"\e77b"}.el-icon-upload:before{content:"\e7c3"}.el-icon-picture-outline-round:before{content:"\e75f"}.el-icon-picture-outline:before{content:"\e75e"}.el-icon-picture:before{content:"\e79f"}.el-icon-close:before{content:"\e6db"}.el-icon-check:before{content:"\e6da"}.el-icon-plus:before{content:"\e6d9"}.el-icon-minus:before{content:"\e6d8"}.el-icon-help:before{content:"\e73d"}.el-icon-s-help:before{content:"\e7b3"}.el-icon-circle-close:before{content:"\e78d"}.el-icon-circle-check:before{content:"\e720"}.el-icon-circle-plus-outline:before{content:"\e723"}.el-icon-remove-outline:before{content:"\e722"}.el-icon-zoom-out:before{content:"\e776"}.el-icon-zoom-in:before{content:"\e777"}.el-icon-error:before{content:"\e79d"}.el-icon-success:before{content:"\e79c"}.el-icon-circle-plus:before{content:"\e7a0"}.el-icon-remove:before{content:"\e7a2"}.el-icon-info:before{content:"\e7a1"}.el-icon-question:before{content:"\e7a4"}.el-icon-warning-outline:before{content:"\e6c9"}.el-icon-warning:before{content:"\e7a3"}.el-icon-goods:before{content:"\e7c2"}.el-icon-s-goods:before{content:"\e7b2"}.el-icon-star-off:before{content:"\e717"}.el-icon-star-on:before{content:"\e797"}.el-icon-more-outline:before{content:"\e6cc"}.el-icon-more:before{content:"\e794"}.el-icon-phone-outline:before{content:"\e6cb"}.el-icon-phone:before{content:"\e795"}.el-icon-user:before{content:"\e6e3"}.el-icon-user-solid:before{content:"\e7a5"}.el-icon-setting:before{content:"\e6ca"}.el-icon-s-tools:before{content:"\e7ac"}.el-icon-delete:before{content:"\e6d7"}.el-icon-delete-solid:before{content:"\e7c9"}.el-icon-eleme:before{content:"\e7c7"}.el-icon-platform-eleme:before{content:"\e7ca"}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0)}100%{-webkit-transform:rotateZ(360deg);transform:rotateZ(360deg)}}@keyframes rotating{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0)}100%{-webkit-transform:rotateZ(360deg);transform:rotateZ(360deg)}}.el-pagination{white-space:nowrap;padding:2px 5px;color:#303133;font-weight:700}.el-pagination::after,.el-pagination::before{display:table;content:""}.el-pagination::after{clear:both}.el-pagination button,.el-pagination span:not([class*=suffix]){display:inline-block;font-size:13px;min-width:35.5px;height:28px;line-height:28px;vertical-align:top;-webkit-box-sizing:border-box;box-sizing:border-box}.el-pagination .el-input__inner{text-align:center;-moz-appearance:textfield;line-height:normal}.el-pagination .el-input__suffix{right:0;-webkit-transform:scale(.8);transform:scale(.8)}.el-pagination .el-select .el-input{width:100px;margin:0 5px}.el-pagination .el-select .el-input .el-input__inner{padding-right:25px;border-radius:3px}.el-pagination button{border:none;padding:0 6px;background:0 0}.el-pagination button:focus{outline:0}.el-pagination button:hover{color:#409eff}.el-pagination button:disabled{color:#c0c4cc;background-color:#fff;cursor:not-allowed}.el-pagination .btn-next,.el-pagination .btn-prev{background:center center no-repeat #fff;background-size:16px;cursor:pointer;margin:0;color:#303133}.el-pagination .btn-next .el-icon,.el-pagination .btn-prev .el-icon{display:block;font-size:12px;font-weight:700}.el-pagination .btn-prev{padding-right:12px}.el-pagination .btn-next{padding-left:12px}.el-pagination .el-pager li.disabled{color:#c0c4cc;cursor:not-allowed}.el-pager li,.el-pager li.btn-quicknext:hover,.el-pager li.btn-quickprev:hover{cursor:pointer}.el-pagination--small .btn-next,.el-pagination--small .btn-prev,.el-pagination--small .el-pager li,.el-pagination--small .el-pager li.btn-quicknext,.el-pagination--small .el-pager li.btn-quickprev,.el-pagination--small .el-pager li:last-child{border-color:transparent;font-size:12px;line-height:22px;height:22px;min-width:22px}.el-pagination--small .more::before,.el-pagination--small li.more::before{line-height:24px}.el-pagination--small button,.el-pagination--small span:not([class*=suffix]){height:22px;line-height:22px}.el-pagination--small .el-pagination__editor,.el-pagination--small .el-pagination__editor.el-input .el-input__inner{height:22px}.el-pagination__sizes{margin:0 10px 0 0;font-weight:400;color:#606266}.el-pagination__sizes .el-input .el-input__inner{font-size:13px;padding-left:8px}.el-pagination__sizes .el-input .el-input__inner:hover{border-color:#409eff}.el-pagination__total{margin-right:10px;font-weight:400;color:#606266}.el-pagination__jump{margin-left:24px;font-weight:400;color:#606266}.el-pagination__jump .el-input__inner{padding:0 3px}.el-pagination__rightwrapper{float:right}.el-pagination__editor{line-height:18px;padding:0 2px;height:28px;text-align:center;margin:0 2px;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:3px}.el-pager,.el-pagination.is-background .btn-next,.el-pagination.is-background .btn-prev{padding:0}.el-pagination__editor.el-input{width:50px}.el-pagination__editor.el-input .el-input__inner{height:28px}.el-pagination__editor .el-input__inner::-webkit-inner-spin-button,.el-pagination__editor .el-input__inner::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.el-pagination.is-background .btn-next,.el-pagination.is-background .btn-prev,.el-pagination.is-background .el-pager li{margin:0 5px;background-color:#f4f4f5;color:#606266;min-width:30px;border-radius:2px}.el-pagination.is-background .btn-next.disabled,.el-pagination.is-background .btn-next:disabled,.el-pagination.is-background .btn-prev.disabled,.el-pagination.is-background .btn-prev:disabled,.el-pagination.is-background .el-pager li.disabled{color:#c0c4cc}.el-pagination.is-background .el-pager li:not(.disabled):hover{color:#409eff}.el-pagination.is-background .el-pager li:not(.disabled).active{background-color:#409eff;color:#fff}.el-dialog,.el-pager li{background:#fff;-webkit-box-sizing:border-box}.el-pagination.is-background.el-pagination--small .btn-next,.el-pagination.is-background.el-pagination--small .btn-prev,.el-pagination.is-background.el-pagination--small .el-pager li{margin:0 3px;min-width:22px}.el-pager,.el-pager li{vertical-align:top;margin:0;display:inline-block}.el-pager{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;font-size:0}.el-date-table,.el-table th{-webkit-user-select:none;-moz-user-select:none}.el-pager .more::before{line-height:30px}.el-pager li{padding:0 4px;font-size:13px;min-width:35.5px;height:28px;line-height:28px;box-sizing:border-box;text-align:center}.el-menu--collapse .el-menu .el-submenu,.el-menu--popup{min-width:200px}.el-pager li.btn-quicknext,.el-pager li.btn-quickprev{line-height:28px;color:#303133}.el-pager li.btn-quicknext.disabled,.el-pager li.btn-quickprev.disabled{color:#c0c4cc}.el-pager li.active+li{border-left:0}.el-pager li:hover{color:#409eff}.el-pager li.active{color:#409eff;cursor:default}@-webkit-keyframes v-modal-in{0%{opacity:0}}@-webkit-keyframes v-modal-out{100%{opacity:0}}.el-dialog{position:relative;margin:0 auto 50px;border-radius:2px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.3);box-shadow:0 1px 3px rgba(0,0,0,.3);box-sizing:border-box;width:50%}.el-dialog.is-fullscreen{width:100%;margin-top:0;margin-bottom:0;height:100%;overflow:auto}.el-dialog__wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;margin:0}.el-dialog__header{padding:20px 20px 10px}.el-dialog__headerbtn{position:absolute;top:20px;right:20px;padding:0;background:0 0;border:none;outline:0;cursor:pointer;font-size:16px}.el-dialog__headerbtn .el-dialog__close{color:#909399}.el-dialog__headerbtn:focus .el-dialog__close,.el-dialog__headerbtn:hover .el-dialog__close{color:#409eff}.el-dialog__title{line-height:24px;font-size:18px;color:#303133}.el-dialog__body{padding:30px 20px;color:#606266;font-size:14px;word-break:break-all}.el-dialog__footer{padding:10px 20px 20px;text-align:right;-webkit-box-sizing:border-box;box-sizing:border-box}.el-dialog--center{text-align:center}.el-dialog--center .el-dialog__body{text-align:initial;padding:25px 25px 30px}.el-dialog--center .el-dialog__footer{text-align:inherit}.dialog-fade-enter-active{-webkit-animation:dialog-fade-in .3s;animation:dialog-fade-in .3s}.dialog-fade-leave-active{-webkit-animation:dialog-fade-out .3s;animation:dialog-fade-out .3s}@-webkit-keyframes dialog-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}100%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}}@keyframes dialog-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}100%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}}@-webkit-keyframes dialog-fade-out{0%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}100%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}@keyframes dialog-fade-out{0%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}100%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}.el-autocomplete{position:relative;display:inline-block}.el-autocomplete-suggestion{margin:5px 0;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);border-radius:4px;border:1px solid #e4e7ed;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#fff}.el-dropdown-menu,.el-menu--collapse .el-submenu .el-menu{z-index:10;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-autocomplete-suggestion__wrap{max-height:280px;padding:10px 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-autocomplete-suggestion__list{margin:0;padding:0}.el-autocomplete-suggestion li{padding:0 20px;margin:0;line-height:34px;cursor:pointer;color:#606266;font-size:14px;list-style:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-autocomplete-suggestion li.highlighted,.el-autocomplete-suggestion li:hover{background-color:#f5f7fa}.el-autocomplete-suggestion li.divider{margin-top:6px;border-top:1px solid #000}.el-autocomplete-suggestion li.divider:last-child{margin-bottom:-6px}.el-autocomplete-suggestion.is-loading li{text-align:center;height:100px;line-height:100px;font-size:20px;color:#999}.el-autocomplete-suggestion.is-loading li::after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-autocomplete-suggestion.is-loading li:hover{background-color:#fff}.el-autocomplete-suggestion.is-loading .el-icon-loading{vertical-align:middle}.el-dropdown{display:inline-block;position:relative;color:#606266;font-size:14px}.el-dropdown .el-button-group{display:block}.el-dropdown .el-button-group .el-button{float:none}.el-dropdown .el-dropdown__caret-button{padding-left:5px;padding-right:5px;position:relative;border-left:none}.el-dropdown .el-dropdown__caret-button::before{content:'';position:absolute;display:block;width:1px;top:5px;bottom:5px;left:0;background:rgba(255,255,255,.5)}.el-dropdown .el-dropdown__caret-button.el-button--default::before{background:rgba(220,223,230,.5)}.el-dropdown .el-dropdown__caret-button:hover::before{top:0;bottom:0}.el-dropdown .el-dropdown__caret-button .el-dropdown__icon{padding-left:0}.el-dropdown__icon{font-size:12px;margin:0 3px}.el-dropdown-menu{position:absolute;top:0;left:0;padding:10px 0;margin:5px 0;background-color:#fff;border:1px solid #ebeef5;border-radius:4px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-dropdown-menu__item{list-style:none;line-height:36px;padding:0 20px;margin:0;font-size:14px;color:#606266;cursor:pointer;outline:0}.el-dropdown-menu__item:focus,.el-dropdown-menu__item:not(.is-disabled):hover{background-color:#ecf5ff;color:#66b1ff}.el-dropdown-menu__item i{margin-right:5px}.el-dropdown-menu__item--divided{position:relative;margin-top:6px;border-top:1px solid #ebeef5}.el-dropdown-menu__item--divided:before{content:'';height:6px;display:block;margin:0 -20px;background-color:#fff}.el-dropdown-menu__item.is-disabled{cursor:default;color:#bbb;pointer-events:none}.el-dropdown-menu--medium{padding:6px 0}.el-dropdown-menu--medium .el-dropdown-menu__item{line-height:30px;padding:0 17px;font-size:14px}.el-dropdown-menu--medium .el-dropdown-menu__item.el-dropdown-menu__item--divided{margin-top:6px}.el-dropdown-menu--medium .el-dropdown-menu__item.el-dropdown-menu__item--divided:before{height:6px;margin:0 -17px}.el-dropdown-menu--small{padding:6px 0}.el-dropdown-menu--small .el-dropdown-menu__item{line-height:27px;padding:0 15px;font-size:13px}.el-dropdown-menu--small .el-dropdown-menu__item.el-dropdown-menu__item--divided{margin-top:4px}.el-dropdown-menu--small .el-dropdown-menu__item.el-dropdown-menu__item--divided:before{height:4px;margin:0 -15px}.el-dropdown-menu--mini{padding:3px 0}.el-dropdown-menu--mini .el-dropdown-menu__item{line-height:24px;padding:0 10px;font-size:12px}.el-dropdown-menu--mini .el-dropdown-menu__item.el-dropdown-menu__item--divided{margin-top:3px}.el-dropdown-menu--mini .el-dropdown-menu__item.el-dropdown-menu__item--divided:before{height:3px;margin:0 -10px}.el-menu{border-right:solid 1px #e6e6e6;list-style:none;position:relative;margin:0;padding-left:0;background-color:#fff}.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover,.el-menu--horizontal>.el-submenu .el-submenu__title:hover{background-color:#fff}.el-menu::after,.el-menu::before{display:table;content:""}.el-menu::after{clear:both}.el-menu.el-menu--horizontal{border-bottom:solid 1px #e6e6e6}.el-menu--horizontal{border-right:none}.el-menu--horizontal>.el-menu-item{float:left;height:60px;line-height:60px;margin:0;border-bottom:2px solid transparent;color:#909399}.el-menu--horizontal>.el-menu-item a,.el-menu--horizontal>.el-menu-item a:hover{color:inherit}.el-menu--horizontal>.el-submenu{float:left}.el-menu--horizontal>.el-submenu:focus,.el-menu--horizontal>.el-submenu:hover{outline:0}.el-menu--horizontal>.el-submenu:focus .el-submenu__title,.el-menu--horizontal>.el-submenu:hover .el-submenu__title{color:#303133}.el-menu--horizontal>.el-submenu.is-active .el-submenu__title{border-bottom:2px solid #409eff;color:#303133}.el-menu--horizontal>.el-submenu .el-submenu__title{height:60px;line-height:60px;border-bottom:2px solid transparent;color:#909399}.el-menu--horizontal>.el-submenu .el-submenu__icon-arrow{position:static;vertical-align:middle;margin-left:8px;margin-top:-3px}.el-menu--horizontal .el-menu .el-menu-item,.el-menu--horizontal .el-menu .el-submenu__title{background-color:#fff;float:none;height:36px;line-height:36px;padding:0 10px;color:#909399}.el-menu--horizontal .el-menu .el-menu-item.is-active,.el-menu--horizontal .el-menu .el-submenu.is-active>.el-submenu__title{color:#303133}.el-menu--horizontal .el-menu-item:not(.is-disabled):focus,.el-menu--horizontal .el-menu-item:not(.is-disabled):hover{outline:0;color:#303133}.el-menu--horizontal>.el-menu-item.is-active{border-bottom:2px solid #409eff;color:#303133}.el-menu--collapse{width:64px}.el-menu--collapse>.el-menu-item [class^=el-icon-],.el-menu--collapse>.el-submenu>.el-submenu__title [class^=el-icon-]{margin:0;vertical-align:middle;width:24px;text-align:center}.el-menu--collapse>.el-menu-item .el-submenu__icon-arrow,.el-menu--collapse>.el-submenu>.el-submenu__title .el-submenu__icon-arrow{display:none}.el-menu--collapse>.el-menu-item span,.el-menu--collapse>.el-submenu>.el-submenu__title span{height:0;width:0;overflow:hidden;visibility:hidden;display:inline-block}.el-menu--collapse>.el-menu-item.is-active i{color:inherit}.el-menu--collapse .el-submenu{position:relative}.el-menu--collapse .el-submenu .el-menu{position:absolute;margin-left:5px;top:0;left:100%;border:1px solid #e4e7ed;border-radius:2px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-menu-item,.el-submenu__title{height:56px;line-height:56px;position:relative;-webkit-box-sizing:border-box;white-space:nowrap;list-style:none}.el-menu--collapse .el-submenu.is-opened>.el-submenu__title .el-submenu__icon-arrow{-webkit-transform:none;transform:none}.el-menu--popup{z-index:100;border:none;padding:5px 0;border-radius:2px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-menu--popup-bottom-start{margin-top:5px}.el-menu--popup-right-start{margin-left:5px;margin-right:5px}.el-menu-item{font-size:14px;color:#303133;padding:0 20px;cursor:pointer;-webkit-transition:border-color .3s,background-color .3s,color .3s;transition:border-color .3s,background-color .3s,color .3s;box-sizing:border-box}.el-menu-item *{vertical-align:middle}.el-menu-item i{color:#909399}.el-menu-item:focus,.el-menu-item:hover{outline:0;background-color:#ecf5ff}.el-menu-item.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-menu-item [class^=el-icon-]{margin-right:5px;width:24px;text-align:center;font-size:18px;vertical-align:middle}.el-menu-item.is-active{color:#409eff}.el-menu-item.is-active i{color:inherit}.el-submenu{list-style:none;margin:0;padding-left:0}.el-submenu__title{font-size:14px;color:#303133;padding:0 20px;cursor:pointer;-webkit-transition:border-color .3s,background-color .3s,color .3s;transition:border-color .3s,background-color .3s,color .3s;box-sizing:border-box}.el-submenu__title *{vertical-align:middle}.el-submenu__title i{color:#909399}.el-submenu__title:focus,.el-submenu__title:hover{outline:0;background-color:#ecf5ff}.el-submenu__title.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-submenu__title:hover{background-color:#ecf5ff}.el-submenu .el-menu{border:none}.el-submenu .el-menu-item{height:50px;line-height:50px;padding:0 45px;min-width:200px}.el-submenu__icon-arrow{position:absolute;top:50%;right:20px;margin-top:-7px;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;font-size:12px}.el-submenu.is-active .el-submenu__title{border-bottom-color:#409eff}.el-submenu.is-opened>.el-submenu__title .el-submenu__icon-arrow{-webkit-transform:rotateZ(180deg);transform:rotateZ(180deg)}.el-submenu.is-disabled .el-menu-item,.el-submenu.is-disabled .el-submenu__title{opacity:.25;cursor:not-allowed;background:0 0!important}.el-submenu [class^=el-icon-]{vertical-align:middle;margin-right:5px;width:24px;text-align:center;font-size:18px}.el-menu-item-group>ul{padding:0}.el-menu-item-group__title{padding:7px 0 7px 20px;line-height:normal;font-size:12px;color:#909399}.el-radio-button__inner,.el-radio-group{display:inline-block;line-height:1;vertical-align:middle}.horizontal-collapse-transition .el-submenu__title .el-submenu__icon-arrow{-webkit-transition:.2s;transition:.2s;opacity:0}.el-radio-group{font-size:0}.el-radio-button{position:relative;display:inline-block;outline:0}.el-radio-button__inner{white-space:nowrap;background:#fff;border:1px solid #dcdfe6;font-weight:500;border-left:0;color:#606266;-webkit-appearance:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;outline:0;margin:0;position:relative;cursor:pointer;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);padding:12px 20px;font-size:14px;border-radius:0}.el-radio-button__inner.is-round{padding:12px 20px}.el-radio-button__inner:hover{color:#409eff}.el-radio-button__inner [class*=el-icon-]{line-height:.9}.el-radio-button__inner [class*=el-icon-]+span{margin-left:5px}.el-radio-button:first-child .el-radio-button__inner{border-left:1px solid #dcdfe6;border-radius:4px 0 0 4px;-webkit-box-shadow:none!important;box-shadow:none!important}.el-radio-button__orig-radio{opacity:0;outline:0;position:absolute;z-index:-1}.el-radio-button__orig-radio:checked+.el-radio-button__inner{color:#fff;background-color:#409eff;border-color:#409eff;-webkit-box-shadow:-1px 0 0 0 #409eff;box-shadow:-1px 0 0 0 #409eff}.el-radio-button__orig-radio:disabled+.el-radio-button__inner{color:#c0c4cc;cursor:not-allowed;background-image:none;background-color:#fff;border-color:#ebeef5;-webkit-box-shadow:none;box-shadow:none}.el-radio-button__orig-radio:disabled:checked+.el-radio-button__inner{background-color:#f2f6fc}.el-radio-button:last-child .el-radio-button__inner{border-radius:0 4px 4px 0}.el-popover,.el-radio-button:first-child:last-child .el-radio-button__inner{border-radius:4px}.el-radio-button--medium .el-radio-button__inner{padding:10px 20px;font-size:14px;border-radius:0}.el-radio-button--medium .el-radio-button__inner.is-round{padding:10px 20px}.el-radio-button--small .el-radio-button__inner{padding:9px 15px;font-size:12px;border-radius:0}.el-radio-button--small .el-radio-button__inner.is-round{padding:9px 15px}.el-radio-button--mini .el-radio-button__inner{padding:7px 15px;font-size:12px;border-radius:0}.el-radio-button--mini .el-radio-button__inner.is-round{padding:7px 15px}.el-radio-button:focus:not(.is-focus):not(:active):not(.is-disabled){-webkit-box-shadow:0 0 2px 2px #409eff;box-shadow:0 0 2px 2px #409eff}.el-switch{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;font-size:14px;line-height:20px;height:20px;vertical-align:middle}.el-switch__core,.el-switch__label{display:inline-block;cursor:pointer}.el-switch.is-disabled .el-switch__core,.el-switch.is-disabled .el-switch__label{cursor:not-allowed}.el-switch__label{-webkit-transition:.2s;transition:.2s;height:20px;font-size:14px;font-weight:500;vertical-align:middle;color:#303133}.el-switch__label.is-active{color:#409eff}.el-switch__label--left{margin-right:10px}.el-switch__label--right{margin-left:10px}.el-switch__label *{line-height:1;font-size:14px;display:inline-block}.el-switch__input{position:absolute;width:0;height:0;opacity:0;margin:0}.el-switch__core{margin:0;position:relative;width:40px;height:20px;border:1px solid #dcdfe6;outline:0;border-radius:10px;-webkit-box-sizing:border-box;box-sizing:border-box;background:#dcdfe6;-webkit-transition:border-color .3s,background-color .3s;transition:border-color .3s,background-color .3s;vertical-align:middle}.el-switch__core:after{content:"";position:absolute;top:1px;left:1px;border-radius:100%;-webkit-transition:all .3s;transition:all .3s;width:16px;height:16px;background-color:#fff}.el-switch.is-checked .el-switch__core{border-color:#409eff;background-color:#409eff}.el-switch.is-checked .el-switch__core::after{left:100%;margin-left:-17px}.el-switch.is-disabled{opacity:.6}.el-switch--wide .el-switch__label.el-switch__label--left span{left:10px}.el-switch--wide .el-switch__label.el-switch__label--right span{right:10px}.el-switch .label-fade-enter,.el-switch .label-fade-leave-active{opacity:0}.el-select-dropdown{position:absolute;z-index:1001;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;margin:5px 0}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected{color:#409eff;background-color:#fff}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover{background-color:#f5f7fa}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected::after{position:absolute;right:20px;font-family:element-icons;content:"\e6da";font-size:12px;font-weight:700;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:#999;font-size:14px}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;padding:6px 0;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-select-dropdown__item{font-size:14px;padding:0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#606266;height:34px;line-height:34px;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer}.el-select-dropdown__item.is-disabled{color:#c0c4cc;cursor:not-allowed}.el-select-dropdown__item.is-disabled:hover{background-color:#fff}.el-select-dropdown__item.hover,.el-select-dropdown__item:hover{background-color:#f5f7fa}.el-select-dropdown__item.selected{color:#409eff;font-weight:700}.el-select-group{margin:0;padding:0}.el-select-group__wrap{position:relative;list-style:none;margin:0;padding:0}.el-select-group__wrap:not(:last-of-type){padding-bottom:24px}.el-select-group__wrap:not(:last-of-type)::after{content:'';position:absolute;display:block;left:20px;right:20px;bottom:12px;height:1px;background:#e4e7ed}.el-select-group__title{padding-left:20px;font-size:12px;color:#909399;line-height:30px}.el-select-group .el-select-dropdown__item{padding-left:20px}.el-select{display:inline-block;position:relative}.el-select .el-select__tags>span{display:contents}.el-select:hover .el-input__inner{border-color:#c0c4cc}.el-select .el-input__inner{cursor:pointer;padding-right:35px}.el-select .el-input__inner:focus{border-color:#409eff}.el-select .el-input .el-select__caret{color:#c0c4cc;font-size:14px;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;-webkit-transform:rotateZ(180deg);transform:rotateZ(180deg);cursor:pointer}.el-select .el-input .el-select__caret.is-reverse{-webkit-transform:rotateZ(0);transform:rotateZ(0)}.el-select .el-input .el-select__caret.is-show-close{font-size:14px;text-align:center;-webkit-transform:rotateZ(180deg);transform:rotateZ(180deg);border-radius:100%;color:#c0c4cc;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1)}.el-select .el-input .el-select__caret.is-show-close:hover{color:#909399}.el-select .el-input.is-disabled .el-input__inner{cursor:not-allowed}.el-select .el-input.is-disabled .el-input__inner:hover{border-color:#e4e7ed}.el-select .el-input.is-focus .el-input__inner{border-color:#409eff}.el-select>.el-input{display:block}.el-select__input{border:none;outline:0;padding:0;margin-left:15px;color:#666;font-size:14px;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px;background-color:transparent}.el-select__input.is-mini{height:14px}.el-select__close{cursor:pointer;position:absolute;top:8px;z-index:1000;right:25px;color:#c0c4cc;line-height:18px;font-size:14px}.el-select__close:hover{color:#909399}.el-select__tags{position:absolute;line-height:normal;white-space:normal;z-index:1;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap}.el-select .el-tag__close{margin-top:-2px}.el-select .el-tag{-webkit-box-sizing:border-box;box-sizing:border-box;border-color:transparent;margin:2px 0 2px 6px;background-color:#f0f2f5}.el-select .el-tag__close.el-icon-close{background-color:#c0c4cc;right:-7px;top:0;color:#fff}.el-select .el-tag__close.el-icon-close:hover{background-color:#909399}.el-table,.el-table__expanded-cell{background-color:#fff}.el-select .el-tag__close.el-icon-close::before{display:block;-webkit-transform:translate(0,.5px);transform:translate(0,.5px)}.el-table{position:relative;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-flex:1;-ms-flex:1;flex:1;width:100%;max-width:100%;font-size:14px;color:#606266}.el-table--mini,.el-table--small,.el-table__expand-icon{font-size:12px}.el-table__empty-block{min-height:60px;text-align:center;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-table__empty-text{line-height:60px;width:50%;color:#909399}.el-table__expand-column .cell{padding:0;text-align:center}.el-table__expand-icon{position:relative;cursor:pointer;color:#666;-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out;height:20px}.el-table__expand-icon--expanded{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.el-table__expand-icon>.el-icon{position:absolute;left:50%;top:50%;margin-left:-5px;margin-top:-5px}.el-table__expanded-cell[class*=cell]{padding:20px 50px}.el-table__expanded-cell:hover{background-color:transparent!important}.el-table__placeholder{display:inline-block;width:20px}.el-table__append-wrapper{overflow:hidden}.el-table--fit{border-right:0;border-bottom:0}.el-table--fit td.gutter,.el-table--fit th.gutter{border-right-width:1px}.el-table--scrollable-x .el-table__body-wrapper{overflow-x:auto}.el-table--scrollable-y .el-table__body-wrapper{overflow-y:auto}.el-table thead{color:#909399;font-weight:500}.el-table thead.is-group th{background:#f5f7fa}.el-table th,.el-table tr{background-color:#fff}.el-table td,.el-table th{padding:12px 0;min-width:0;-webkit-box-sizing:border-box;box-sizing:border-box;text-overflow:ellipsis;vertical-align:middle;position:relative;text-align:left}.el-table td.is-center,.el-table th.is-center{text-align:center}.el-table td.is-right,.el-table th.is-right{text-align:right}.el-table td.gutter,.el-table th.gutter{width:15px;border-right-width:0;border-bottom-width:0;padding:0}.el-table--medium td,.el-table--medium th{padding:10px 0}.el-table--small td,.el-table--small th{padding:8px 0}.el-table--mini td,.el-table--mini th{padding:6px 0}.el-table .cell,.el-table--border td:first-child .cell,.el-table--border th:first-child .cell{padding-left:10px}.el-table tr input[type=checkbox]{margin:0}.el-table td,.el-table th.is-leaf{border-bottom:1px solid #ebeef5}.el-table th.is-sortable{cursor:pointer}.el-table th{overflow:hidden;-ms-user-select:none;user-select:none}.el-table th>.cell{display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;vertical-align:middle;padding-left:10px;padding-right:10px;width:100%}.el-table th>.cell.highlight{color:#409eff}.el-table th.required>div::before{display:inline-block;content:"";width:8px;height:8px;border-radius:50%;background:#ff4d51;margin-right:5px;vertical-align:middle}.el-table td div{-webkit-box-sizing:border-box;box-sizing:border-box}.el-table td.gutter{width:0}.el-table .cell{-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;line-height:23px;padding-right:10px}.el-table .cell.el-tooltip{white-space:nowrap;min-width:50px}.el-table--border,.el-table--group{border:1px solid #ebeef5}.el-table--border::after,.el-table--group::after,.el-table::before{content:'';position:absolute;background-color:#ebeef5;z-index:1}.el-table--border::after,.el-table--group::after{top:0;right:0;width:1px;height:100%}.el-table::before{left:0;bottom:0;width:100%;height:1px}.el-table--border{border-right:none;border-bottom:none}.el-table--border.el-loading-parent--relative{border-color:transparent}.el-table--border td,.el-table--border th,.el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed{border-right:1px solid #ebeef5}.el-table--border th.gutter:last-of-type{border-bottom:1px solid #ebeef5;border-bottom-width:1px}.el-table--border th,.el-table__fixed-right-patch{border-bottom:1px solid #ebeef5}.el-table__fixed,.el-table__fixed-right{position:absolute;top:0;left:0;overflow-x:hidden;overflow-y:hidden;-webkit-box-shadow:0 0 10px rgba(0,0,0,.12);box-shadow:0 0 10px rgba(0,0,0,.12)}.el-table__fixed-right::before,.el-table__fixed::before{content:'';position:absolute;left:0;bottom:0;width:100%;height:1px;background-color:#ebeef5;z-index:4}.el-table__fixed-right-patch{position:absolute;top:-1px;right:0;background-color:#fff}.el-table__fixed-right{top:0;left:auto;right:0}.el-table__fixed-right .el-table__fixed-body-wrapper,.el-table__fixed-right .el-table__fixed-footer-wrapper,.el-table__fixed-right .el-table__fixed-header-wrapper{left:auto;right:0}.el-table__fixed-header-wrapper{position:absolute;left:0;top:0;z-index:3}.el-table__fixed-footer-wrapper{position:absolute;left:0;bottom:0;z-index:3}.el-table__fixed-footer-wrapper tbody td{border-top:1px solid #ebeef5;background-color:#f5f7fa;color:#606266}.el-table__fixed-body-wrapper{position:absolute;left:0;top:37px;overflow:hidden;z-index:3}.el-table__body-wrapper,.el-table__footer-wrapper,.el-table__header-wrapper{width:100%}.el-table__footer-wrapper{margin-top:-1px}.el-table__footer-wrapper td{border-top:1px solid #ebeef5}.el-table__body,.el-table__footer,.el-table__header{table-layout:fixed;border-collapse:separate}.el-table__footer-wrapper,.el-table__header-wrapper{overflow:hidden}.el-table__footer-wrapper tbody td,.el-table__header-wrapper tbody td{background-color:#f5f7fa;color:#606266}.el-table__body-wrapper{overflow:hidden;position:relative}.el-table__body-wrapper.is-scrolling-left~.el-table__fixed,.el-table__body-wrapper.is-scrolling-none~.el-table__fixed,.el-table__body-wrapper.is-scrolling-none~.el-table__fixed-right,.el-table__body-wrapper.is-scrolling-right~.el-table__fixed-right{-webkit-box-shadow:none;box-shadow:none}.el-picker-panel,.el-table-filter{-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-table__body-wrapper .el-table--border.is-scrolling-right~.el-table__fixed-right{border-left:1px solid #ebeef5}.el-table .caret-wrapper{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:34px;width:24px;vertical-align:middle;cursor:pointer;overflow:initial;position:relative}.el-table .sort-caret{width:0;height:0;border:5px solid transparent;position:absolute;left:7px}.el-table .sort-caret.ascending{border-bottom-color:#c0c4cc;top:5px}.el-table .sort-caret.descending{border-top-color:#c0c4cc;bottom:7px}.el-table .ascending .sort-caret.ascending{border-bottom-color:#409eff}.el-table .descending .sort-caret.descending{border-top-color:#409eff}.el-table .hidden-columns{position:absolute;z-index:-1}.el-table--striped .el-table__body tr.el-table__row--striped td{background:#fafafa}.el-table--striped .el-table__body tr.el-table__row--striped.current-row td{background-color:#ecf5ff}.el-table__body tr.hover-row.current-row>td,.el-table__body tr.hover-row.el-table__row--striped.current-row>td,.el-table__body tr.hover-row.el-table__row--striped>td,.el-table__body tr.hover-row>td{background-color:#f5f7fa}.el-table__body tr.current-row>td{background-color:#ecf5ff}.el-table__column-resize-proxy{position:absolute;left:200px;top:0;bottom:0;width:0;border-left:1px solid #ebeef5;z-index:10}.el-table__column-filter-trigger{display:inline-block;line-height:34px;cursor:pointer}.el-table__column-filter-trigger i{color:#909399;font-size:12px;-webkit-transform:scale(.75);transform:scale(.75)}.el-table--enable-row-transition .el-table__body td{-webkit-transition:background-color .25s ease;transition:background-color .25s ease}.el-table--enable-row-hover .el-table__body tr:hover>td{background-color:#f5f7fa}.el-table--fluid-height .el-table__fixed,.el-table--fluid-height .el-table__fixed-right{bottom:0;overflow:hidden}.el-table [class*=el-table__row--level] .el-table__expand-icon{display:inline-block;width:20px;line-height:20px;height:20px;text-align:center;margin-right:3px}.el-table-column--selection .cell{padding-left:14px;padding-right:14px}.el-table-filter{border:1px solid #ebeef5;border-radius:2px;background-color:#fff;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;margin:2px 0}.el-date-table td,.el-date-table td div{height:30px;-webkit-box-sizing:border-box}.el-table-filter__list{padding:5px 0;margin:0;list-style:none;min-width:100px}.el-table-filter__list-item{line-height:36px;padding:0 10px;cursor:pointer;font-size:14px}.el-table-filter__list-item:hover{background-color:#ecf5ff;color:#66b1ff}.el-table-filter__list-item.is-active{background-color:#409eff;color:#fff}.el-table-filter__content{min-width:100px}.el-table-filter__bottom{border-top:1px solid #ebeef5;padding:8px}.el-table-filter__bottom button{background:0 0;border:none;color:#606266;cursor:pointer;font-size:13px;padding:0 3px}.el-date-table td.in-range div,.el-date-table td.in-range div:hover,.el-date-table.is-week-mode .el-date-table__row.current div,.el-date-table.is-week-mode .el-date-table__row:hover div{background-color:#f2f6fc}.el-table-filter__bottom button:hover{color:#409eff}.el-table-filter__bottom button:focus{outline:0}.el-table-filter__bottom button.is-disabled{color:#c0c4cc;cursor:not-allowed}.el-table-filter__wrap{max-height:280px}.el-table-filter__checkbox-group{padding:10px}.el-table-filter__checkbox-group label.el-checkbox{display:block;margin-right:5px;margin-bottom:8px;margin-left:5px}.el-table-filter__checkbox-group .el-checkbox:last-child{margin-bottom:0}.el-date-table{font-size:12px;-ms-user-select:none;user-select:none}.el-date-table.is-week-mode .el-date-table__row:hover td.available:hover{color:#606266}.el-date-table.is-week-mode .el-date-table__row:hover td:first-child div{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table.is-week-mode .el-date-table__row:hover td:last-child div{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table td{width:32px;padding:4px 0;box-sizing:border-box;text-align:center;cursor:pointer;position:relative}.el-date-table td div{padding:3px 0;box-sizing:border-box}.el-date-table td span{width:24px;height:24px;display:block;margin:0 auto;line-height:24px;position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);border-radius:50%}.el-date-table td.next-month,.el-date-table td.prev-month{color:#c0c4cc}.el-date-table td.today{position:relative}.el-date-table td.today span{color:#409eff;font-weight:700}.el-date-table td.today.end-date span,.el-date-table td.today.start-date span{color:#fff}.el-date-table td.available:hover{color:#409eff}.el-date-table td.current:not(.disabled) span{color:#fff;background-color:#409eff}.el-date-table td.end-date div,.el-date-table td.start-date div{color:#fff}.el-date-table td.end-date span,.el-date-table td.start-date span{background-color:#409eff}.el-date-table td.start-date div{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table td.end-date div{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table td.disabled div{background-color:#f5f7fa;opacity:1;cursor:not-allowed;color:#c0c4cc}.el-date-table td.selected div{margin-left:5px;margin-right:5px;background-color:#f2f6fc;border-radius:15px}.el-date-table td.selected div:hover{background-color:#f2f6fc}.el-date-table td.selected span{background-color:#409eff;color:#fff;border-radius:15px}.el-date-table td.week{font-size:80%;color:#606266}.el-month-table,.el-year-table{font-size:12px;border-collapse:collapse}.el-date-table th{padding:5px;color:#606266;font-weight:400;border-bottom:solid 1px #ebeef5}.el-month-table{margin:-1px}.el-month-table td{text-align:center;padding:8px 0;cursor:pointer}.el-month-table td div{height:48px;padding:6px 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-month-table td.today .cell{color:#409eff;font-weight:700}.el-month-table td.today.end-date .cell,.el-month-table td.today.start-date .cell{color:#fff}.el-month-table td.disabled .cell{background-color:#f5f7fa;cursor:not-allowed;color:#c0c4cc}.el-month-table td.disabled .cell:hover{color:#c0c4cc}.el-month-table td .cell{width:60px;height:36px;display:block;line-height:36px;color:#606266;margin:0 auto;border-radius:18px}.el-month-table td .cell:hover{color:#409eff}.el-month-table td.in-range div,.el-month-table td.in-range div:hover{background-color:#f2f6fc}.el-month-table td.end-date div,.el-month-table td.start-date div{color:#fff}.el-month-table td.end-date .cell,.el-month-table td.start-date .cell{color:#fff;background-color:#409eff}.el-month-table td.start-date div{border-top-left-radius:24px;border-bottom-left-radius:24px}.el-month-table td.end-date div{border-top-right-radius:24px;border-bottom-right-radius:24px}.el-month-table td.current:not(.disabled) .cell{color:#409eff}.el-year-table{margin:-1px}.el-year-table .el-icon{color:#303133}.el-year-table td{text-align:center;padding:20px 3px;cursor:pointer}.el-year-table td.today .cell{color:#409eff;font-weight:700}.el-year-table td.disabled .cell{background-color:#f5f7fa;cursor:not-allowed;color:#c0c4cc}.el-year-table td.disabled .cell:hover{color:#c0c4cc}.el-year-table td .cell{width:48px;height:32px;display:block;line-height:32px;color:#606266;margin:0 auto}.el-year-table td .cell:hover,.el-year-table td.current:not(.disabled) .cell{color:#409eff}.el-date-range-picker{width:646px}.el-date-range-picker.has-sidebar{width:756px}.el-date-range-picker table{table-layout:fixed;width:100%}.el-date-range-picker .el-picker-panel__body{min-width:513px}.el-date-range-picker .el-picker-panel__content{margin:0}.el-date-range-picker__header{position:relative;text-align:center;height:28px}.el-date-range-picker__header [class*=arrow-left]{float:left}.el-date-range-picker__header [class*=arrow-right]{float:right}.el-date-range-picker__header div{font-size:16px;font-weight:500;margin-right:50px}.el-date-range-picker__content{float:left;width:50%;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:16px}.el-date-range-picker__content.is-left{border-right:1px solid #e4e4e4}.el-date-range-picker__content .el-date-range-picker__header div{margin-left:50px;margin-right:50px}.el-date-range-picker__editors-wrap{-webkit-box-sizing:border-box;box-sizing:border-box;display:table-cell}.el-date-range-picker__editors-wrap.is-right{text-align:right}.el-date-range-picker__time-header{position:relative;border-bottom:1px solid #e4e4e4;font-size:12px;padding:8px 5px 5px;display:table;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.el-date-range-picker__time-header>.el-icon-arrow-right{font-size:20px;vertical-align:middle;display:table-cell;color:#303133}.el-date-range-picker__time-picker-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-range-picker__time-picker-wrap .el-picker-panel{position:absolute;top:13px;right:0;z-index:1;background:#fff}.el-date-picker{width:322px}.el-date-picker.has-sidebar.has-time{width:434px}.el-date-picker.has-sidebar{width:438px}.el-date-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-picker .el-picker-panel__content{width:292px}.el-date-picker table{table-layout:fixed;width:100%}.el-date-picker__editor-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-picker__time-header{position:relative;border-bottom:1px solid #e4e4e4;font-size:12px;padding:8px 5px 5px;display:table;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.el-date-picker__header{margin:12px;text-align:center}.el-date-picker__header--bordered{margin-bottom:0;padding-bottom:12px;border-bottom:solid 1px #ebeef5}.el-date-picker__header--bordered+.el-picker-panel__content{margin-top:0}.el-date-picker__header-label{font-size:16px;font-weight:500;padding:0 5px;line-height:22px;text-align:center;cursor:pointer;color:#606266}.el-date-picker__header-label.active,.el-date-picker__header-label:hover{color:#409eff}.el-date-picker__prev-btn{float:left}.el-date-picker__next-btn{float:right}.el-date-picker__time-wrap{padding:10px;text-align:center}.el-date-picker__time-label{float:left;cursor:pointer;line-height:30px;margin-left:10px}.time-select{margin:5px 0;min-width:0}.time-select .el-picker-panel__content{max-height:200px;margin:0}.time-select-item{padding:8px 10px;font-size:14px;line-height:20px}.time-select-item.selected:not(.disabled){color:#409eff;font-weight:700}.time-select-item.disabled{color:#e4e7ed;cursor:not-allowed}.time-select-item:hover{background-color:#f5f7fa;font-weight:700;cursor:pointer}.el-date-editor{position:relative;display:inline-block;text-align:left}.el-date-editor.el-input,.el-date-editor.el-input__inner{width:220px}.el-date-editor--monthrange.el-input,.el-date-editor--monthrange.el-input__inner{width:300px}.el-date-editor--daterange.el-input,.el-date-editor--daterange.el-input__inner,.el-date-editor--timerange.el-input,.el-date-editor--timerange.el-input__inner{width:350px}.el-date-editor--datetimerange.el-input,.el-date-editor--datetimerange.el-input__inner{width:400px}.el-date-editor--dates .el-input__inner{text-overflow:ellipsis;white-space:nowrap}.el-date-editor .el-icon-circle-close{cursor:pointer}.el-date-editor .el-range__icon{font-size:14px;margin-left:-5px;color:#c0c4cc;float:left;line-height:32px}.el-date-editor .el-range-input,.el-date-editor .el-range-separator{height:100%;margin:0;text-align:center;display:inline-block;font-size:14px}.el-date-editor .el-range-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;outline:0;padding:0;width:39%;color:#606266}.el-date-editor .el-range-input::-webkit-input-placeholder{color:#c0c4cc}.el-date-editor .el-range-input:-ms-input-placeholder{color:#c0c4cc}.el-date-editor .el-range-input::-ms-input-placeholder{color:#c0c4cc}.el-date-editor .el-range-input::placeholder{color:#c0c4cc}.el-date-editor .el-range-separator{padding:0 5px;line-height:32px;width:5%;color:#303133}.el-date-editor .el-range__close-icon{font-size:14px;color:#c0c4cc;width:25px;display:inline-block;float:right;line-height:32px}.el-range-editor.el-input__inner{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:3px 10px}.el-range-editor .el-range-input{line-height:1}.el-range-editor.is-active,.el-range-editor.is-active:hover{border-color:#409eff}.el-range-editor--medium.el-input__inner{height:36px}.el-range-editor--medium .el-range-separator{line-height:28px;font-size:14px}.el-range-editor--medium .el-range-input{font-size:14px}.el-range-editor--medium .el-range__close-icon,.el-range-editor--medium .el-range__icon{line-height:28px}.el-range-editor--small.el-input__inner{height:32px}.el-range-editor--small .el-range-separator{line-height:24px;font-size:13px}.el-range-editor--small .el-range-input{font-size:13px}.el-range-editor--small .el-range__close-icon,.el-range-editor--small .el-range__icon{line-height:24px}.el-range-editor--mini.el-input__inner{height:28px}.el-range-editor--mini .el-range-separator{line-height:20px;font-size:12px}.el-range-editor--mini .el-range-input{font-size:12px}.el-range-editor--mini .el-range__close-icon,.el-range-editor--mini .el-range__icon{line-height:20px}.el-range-editor.is-disabled{background-color:#f5f7fa;border-color:#e4e7ed;color:#c0c4cc;cursor:not-allowed}.el-range-editor.is-disabled:focus,.el-range-editor.is-disabled:hover{border-color:#e4e7ed}.el-range-editor.is-disabled input{background-color:#f5f7fa;color:#c0c4cc;cursor:not-allowed}.el-range-editor.is-disabled input::-webkit-input-placeholder{color:#c0c4cc}.el-range-editor.is-disabled input:-ms-input-placeholder{color:#c0c4cc}.el-range-editor.is-disabled input::-ms-input-placeholder{color:#c0c4cc}.el-range-editor.is-disabled input::placeholder{color:#c0c4cc}.el-range-editor.is-disabled .el-range-separator{color:#c0c4cc}.el-picker-panel{color:#606266;border:1px solid #e4e7ed;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);background:#fff;border-radius:4px;line-height:30px;margin:5px 0}.el-popover,.el-time-panel{-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-picker-panel__body-wrapper::after,.el-picker-panel__body::after{content:"";display:table;clear:both}.el-picker-panel__content{position:relative;margin:15px}.el-picker-panel__footer{border-top:1px solid #e4e4e4;padding:4px;text-align:right;background-color:#fff;position:relative;font-size:0}.el-picker-panel__shortcut{display:block;width:100%;border:0;background-color:transparent;line-height:28px;font-size:14px;color:#606266;padding-left:12px;text-align:left;outline:0;cursor:pointer}.el-picker-panel__shortcut:hover{color:#409eff}.el-picker-panel__shortcut.active{background-color:#e6f1fe;color:#409eff}.el-picker-panel__btn{border:1px solid #dcdcdc;color:#333;line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:0;font-size:12px}.el-picker-panel__btn[disabled]{color:#ccc;cursor:not-allowed}.el-picker-panel__icon-btn{font-size:12px;color:#303133;border:0;background:0 0;cursor:pointer;outline:0;margin-top:8px}.el-picker-panel__icon-btn:hover{color:#409eff}.el-picker-panel__icon-btn.is-disabled{color:#bbb}.el-picker-panel__icon-btn.is-disabled:hover{cursor:not-allowed}.el-picker-panel__link-btn{vertical-align:middle}.el-picker-panel [slot=sidebar],.el-picker-panel__sidebar{position:absolute;top:0;bottom:0;width:110px;border-right:1px solid #e4e4e4;-webkit-box-sizing:border-box;box-sizing:border-box;padding-top:6px;background-color:#fff;overflow:auto}.el-picker-panel [slot=sidebar]+.el-picker-panel__body,.el-picker-panel__sidebar+.el-picker-panel__body{margin-left:110px}.el-time-spinner.has-seconds .el-time-spinner__wrapper{width:33.3%}.el-time-spinner__wrapper{max-height:190px;overflow:auto;display:inline-block;width:50%;vertical-align:top;position:relative}.el-time-spinner__wrapper .el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default){padding-bottom:15px}.el-time-spinner__input.el-input .el-input__inner,.el-time-spinner__list{padding:0;text-align:center}.el-time-spinner__wrapper.is-arrow{-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;overflow:hidden}.el-time-spinner__wrapper.is-arrow .el-time-spinner__list{-webkit-transform:translateY(-32px);transform:translateY(-32px)}.el-time-spinner__wrapper.is-arrow .el-time-spinner__item:hover:not(.disabled):not(.active){background:#fff;cursor:default}.el-time-spinner__arrow{font-size:12px;color:#909399;position:absolute;left:0;width:100%;z-index:1;text-align:center;height:30px;line-height:30px;cursor:pointer}.el-time-spinner__arrow:hover{color:#409eff}.el-time-spinner__arrow.el-icon-arrow-up{top:10px}.el-time-spinner__arrow.el-icon-arrow-down{bottom:10px}.el-time-spinner__input.el-input{width:70%}.el-time-spinner__list{margin:0;list-style:none}.el-time-spinner__list::after,.el-time-spinner__list::before{content:'';display:block;width:100%;height:80px}.el-time-spinner__item{height:32px;line-height:32px;font-size:12px;color:#606266}.el-time-spinner__item:hover:not(.disabled):not(.active){background:#f5f7fa;cursor:pointer}.el-time-spinner__item.active:not(.disabled){color:#303133;font-weight:700}.el-time-spinner__item.disabled{color:#c0c4cc;cursor:not-allowed}.el-time-panel{margin:5px 0;border:1px solid #e4e7ed;background-color:#fff;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);border-radius:2px;position:absolute;width:180px;left:0;z-index:1000;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:content-box;box-sizing:content-box}.el-slider__button,.el-slider__button-wrapper{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.el-time-panel__content{font-size:0;position:relative;overflow:hidden}.el-time-panel__content::after,.el-time-panel__content::before{content:"";top:50%;position:absolute;margin-top:-15px;height:32px;z-index:-1;left:0;right:0;-webkit-box-sizing:border-box;box-sizing:border-box;padding-top:6px;text-align:left;border-top:1px solid #e4e7ed;border-bottom:1px solid #e4e7ed}.el-time-panel__content::after{left:50%;margin-left:12%;margin-right:12%}.el-time-panel__content::before{padding-left:50%;margin-right:12%;margin-left:12%}.el-time-panel__content.has-seconds::after{left:calc(100% / 3 * 2)}.el-time-panel__content.has-seconds::before{padding-left:calc(100% / 3)}.el-time-panel__footer{border-top:1px solid #e4e4e4;padding:4px;height:36px;line-height:25px;text-align:right;-webkit-box-sizing:border-box;box-sizing:border-box}.el-time-panel__btn{border:none;line-height:28px;padding:0 5px;margin:0 5px;cursor:pointer;background-color:transparent;outline:0;font-size:12px;color:#303133}.el-time-panel__btn.confirm{font-weight:800;color:#409eff}.el-time-range-picker{width:354px;overflow:visible}.el-time-range-picker__content{position:relative;text-align:center;padding:10px}.el-time-range-picker__cell{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:4px 7px 7px;width:50%;display:inline-block}.el-time-range-picker__header{margin-bottom:5px;text-align:center;font-size:14px}.el-time-range-picker__body{border-radius:2px;border:1px solid #e4e7ed}.el-popover{position:absolute;background:#fff;min-width:150px;border:1px solid #ebeef5;padding:12px;z-index:2000;color:#606266;line-height:1.4;text-align:justify;font-size:14px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);word-break:break-all}.el-popover--plain{padding:18px 20px}.el-popover__title{color:#303133;font-size:16px;line-height:1;margin-bottom:12px}.v-modal-enter{-webkit-animation:v-modal-in .2s ease;animation:v-modal-in .2s ease}.v-modal-leave{-webkit-animation:v-modal-out .2s ease forwards;animation:v-modal-out .2s ease forwards}@keyframes v-modal-in{0%{opacity:0}}@keyframes v-modal-out{100%{opacity:0}}.v-modal{position:fixed;left:0;top:0;width:100%;height:100%;opacity:.5;background:#000}.el-popup-parent--hidden{overflow:hidden}.el-message-box{display:inline-block;width:420px;padding-bottom:10px;vertical-align:middle;background-color:#fff;border-radius:4px;border:1px solid #ebeef5;font-size:18px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);text-align:left;overflow:hidden;-webkit-backface-visibility:hidden;backface-visibility:hidden}.el-message-box__wrapper{position:fixed;top:0;bottom:0;left:0;right:0;text-align:center}.el-message-box__wrapper::after{content:"";display:inline-block;height:100%;width:0;vertical-align:middle}.el-message-box__header{position:relative;padding:15px 15px 10px}.el-message-box__title{padding-left:0;margin-bottom:0;font-size:18px;line-height:1;color:#303133}.el-message-box__headerbtn{position:absolute;top:15px;right:15px;padding:0;border:none;outline:0;background:0 0;font-size:16px;cursor:pointer}.el-form-item.is-error .el-input__inner,.el-form-item.is-error .el-input__inner:focus,.el-form-item.is-error .el-textarea__inner,.el-form-item.is-error .el-textarea__inner:focus,.el-message-box__input input.invalid,.el-message-box__input input.invalid:focus{border-color:#f56c6c}.el-message-box__headerbtn .el-message-box__close{color:#909399}.el-message-box__headerbtn:focus .el-message-box__close,.el-message-box__headerbtn:hover .el-message-box__close{color:#409eff}.el-message-box__content{padding:10px 15px;color:#606266;font-size:14px}.el-message-box__container{position:relative}.el-message-box__input{padding-top:15px}.el-message-box__status{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);font-size:24px!important}.el-message-box__status::before{padding-left:1px}.el-message-box__status+.el-message-box__message{padding-left:36px;padding-right:12px}.el-message-box__status.el-icon-success{color:#67c23a}.el-message-box__status.el-icon-info{color:#909399}.el-message-box__status.el-icon-warning{color:#e6a23c}.el-message-box__status.el-icon-error{color:#f56c6c}.el-message-box__message{margin:0}.el-message-box__message p{margin:0;line-height:24px}.el-message-box__errormsg{color:#f56c6c;font-size:12px;min-height:18px;margin-top:2px}.el-message-box__btns{padding:5px 15px 0;text-align:right}.el-message-box__btns button:nth-child(2){margin-left:10px}.el-message-box__btns-reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.el-message-box--center{padding-bottom:30px}.el-message-box--center .el-message-box__header{padding-top:30px}.el-message-box--center .el-message-box__title{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-message-box--center .el-message-box__status{position:relative;top:auto;padding-right:5px;text-align:center;-webkit-transform:translateY(-1px);transform:translateY(-1px)}.el-message-box--center .el-message-box__message{margin-left:0}.el-message-box--center .el-message-box__btns,.el-message-box--center .el-message-box__content{text-align:center}.el-message-box--center .el-message-box__content{padding-left:27px;padding-right:27px}.msgbox-fade-enter-active{-webkit-animation:msgbox-fade-in .3s;animation:msgbox-fade-in .3s}.msgbox-fade-leave-active{-webkit-animation:msgbox-fade-out .3s;animation:msgbox-fade-out .3s}@-webkit-keyframes msgbox-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}100%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}}@keyframes msgbox-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}100%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}}@-webkit-keyframes msgbox-fade-out{0%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}100%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}@keyframes msgbox-fade-out{0%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}100%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}.el-breadcrumb{font-size:14px;line-height:1}.el-breadcrumb::after,.el-breadcrumb::before{display:table;content:""}.el-breadcrumb::after{clear:both}.el-breadcrumb__separator{margin:0 9px;font-weight:700;color:#c0c4cc}.el-breadcrumb__separator[class*=icon]{margin:0 6px;font-weight:400}.el-breadcrumb__item{float:left}.el-breadcrumb__inner{color:#606266}.el-breadcrumb__inner a,.el-breadcrumb__inner.is-link{font-weight:700;text-decoration:none;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1);color:#303133}.el-breadcrumb__inner a:hover,.el-breadcrumb__inner.is-link:hover{color:#409eff;cursor:pointer}.el-breadcrumb__item:last-child .el-breadcrumb__inner,.el-breadcrumb__item:last-child .el-breadcrumb__inner a,.el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover,.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover{font-weight:400;color:#606266;cursor:text}.el-breadcrumb__item:last-child .el-breadcrumb__separator{display:none}.el-form--label-left .el-form-item__label{text-align:left}.el-form--label-top .el-form-item__label{float:none;display:inline-block;text-align:left;padding:0 0 10px}.el-form--inline .el-form-item{display:inline-block;margin-right:10px;vertical-align:top}.el-form--inline .el-form-item__label{float:none;display:inline-block}.el-form--inline .el-form-item__content{display:inline-block;vertical-align:top}.el-form--inline.el-form--label-top .el-form-item__content{display:block}.el-form-item{margin-bottom:22px}.el-form-item::after,.el-form-item::before{display:table;content:""}.el-form-item::after{clear:both}.el-form-item .el-form-item{margin-bottom:0}.el-form-item--mini.el-form-item,.el-form-item--small.el-form-item{margin-bottom:18px}.el-form-item .el-input__validateIcon{display:none}.el-form-item--medium .el-form-item__content,.el-form-item--medium .el-form-item__label{line-height:36px}.el-form-item--small .el-form-item__content,.el-form-item--small .el-form-item__label{line-height:32px}.el-form-item--small .el-form-item__error{padding-top:2px}.el-form-item--mini .el-form-item__content,.el-form-item--mini .el-form-item__label{line-height:28px}.el-form-item--mini .el-form-item__error{padding-top:1px}.el-form-item__label-wrap{float:left}.el-form-item__label-wrap .el-form-item__label{display:inline-block;float:none}.el-form-item__label{text-align:right;vertical-align:middle;float:left;font-size:14px;color:#606266;line-height:40px;padding:0 12px 0 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-form-item__content{line-height:40px;position:relative;font-size:14px}.el-form-item__content::after,.el-form-item__content::before{display:table;content:""}.el-form-item__content::after{clear:both}.el-form-item__content .el-input-group{vertical-align:top}.el-form-item__error{color:#f56c6c;font-size:12px;line-height:1;padding-top:4px;position:absolute;top:100%;left:0}.el-form-item__error--inline{position:relative;top:auto;left:auto;display:inline-block;margin-left:10px}.el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap>.el-form-item__label:before,.el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{content:'*';color:#f56c6c;margin-right:4px}.el-form-item.is-error .el-input-group__append .el-input__inner,.el-form-item.is-error .el-input-group__prepend .el-input__inner{border-color:transparent}.el-form-item.is-error .el-input__validateIcon{color:#f56c6c}.el-form-item--feedback .el-input__validateIcon{display:inline-block}.el-tabs__header{padding:0;position:relative;margin:0 0 15px}.el-tabs__active-bar{position:absolute;bottom:0;left:0;height:2px;background-color:#409eff;z-index:1;-webkit-transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);list-style:none}.el-tabs__new-tab{float:right;border:1px solid #d3dce6;height:18px;width:18px;line-height:18px;margin:12px 0 9px 10px;border-radius:3px;text-align:center;font-size:12px;color:#d3dce6;cursor:pointer;-webkit-transition:all .15s;transition:all .15s}.el-collapse-item__arrow,.el-tabs__nav{-webkit-transition:-webkit-transform .3s}.el-tabs__new-tab .el-icon-plus{-webkit-transform:scale(.8,.8);transform:scale(.8,.8)}.el-tabs__new-tab:hover{color:#409eff}.el-tabs__nav-wrap{overflow:hidden;margin-bottom:-1px;position:relative}.el-tabs__nav-wrap::after{content:"";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:#e4e7ed;z-index:1}.el-tabs--border-card>.el-tabs__header .el-tabs__nav-wrap::after,.el-tabs--card>.el-tabs__header .el-tabs__nav-wrap::after{content:none}.el-tabs__nav-wrap.is-scrollable{padding:0 20px;-webkit-box-sizing:border-box;box-sizing:border-box}.el-tabs__nav-scroll{overflow:hidden}.el-tabs__nav-next,.el-tabs__nav-prev{position:absolute;cursor:pointer;line-height:44px;font-size:12px;color:#909399}.el-tabs__nav-next{right:0}.el-tabs__nav-prev{left:0}.el-tabs__nav{white-space:nowrap;position:relative;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;float:left;z-index:2}.el-tabs__nav.is-stretch{min-width:100%;display:-webkit-box;display:-ms-flexbox;display:flex}.el-tabs__nav.is-stretch>*{-webkit-box-flex:1;-ms-flex:1;flex:1;text-align:center}.el-tabs__item{padding:0 20px;height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;line-height:40px;display:inline-block;list-style:none;font-size:14px;font-weight:500;color:#303133;position:relative}.el-tabs__item:focus,.el-tabs__item:focus:active{outline:0}.el-tabs__item:focus.is-active.is-focus:not(:active){-webkit-box-shadow:0 0 2px 2px #409eff inset;box-shadow:0 0 2px 2px #409eff inset;border-radius:3px}.el-tabs__item .el-icon-close{border-radius:50%;text-align:center;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);margin-left:5px}.el-tabs__item .el-icon-close:before{-webkit-transform:scale(.9);transform:scale(.9);display:inline-block}.el-tabs__item .el-icon-close:hover{background-color:#c0c4cc;color:#fff}.el-tabs__item.is-active{color:#409eff}.el-tabs__item:hover{color:#409eff;cursor:pointer}.el-tabs__item.is-disabled{color:#c0c4cc;cursor:default}.el-tabs__content{overflow:hidden;position:relative}.el-tabs--card>.el-tabs__header{border-bottom:1px solid #e4e7ed}.el-tabs--card>.el-tabs__header .el-tabs__nav{border:1px solid #e4e7ed;border-bottom:none;border-radius:4px 4px 0 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-tabs--card>.el-tabs__header .el-tabs__active-bar{display:none}.el-tabs--card>.el-tabs__header .el-tabs__item .el-icon-close{position:relative;font-size:12px;width:0;height:14px;vertical-align:middle;line-height:15px;overflow:hidden;top:-1px;right:-2px;-webkit-transform-origin:100% 50%;transform-origin:100% 50%}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable .el-icon-close,.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover .el-icon-close{width:14px}.el-tabs--card>.el-tabs__header .el-tabs__item{border-bottom:1px solid transparent;border-left:1px solid #e4e7ed;-webkit-transition:color .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1);transition:color .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1)}.el-tabs--card>.el-tabs__header .el-tabs__item:first-child{border-left:none}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover{padding-left:13px;padding-right:13px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active{border-bottom-color:#fff}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable{padding-left:20px;padding-right:20px}.el-tabs--border-card{background:#fff;border:1px solid #dcdfe6;-webkit-box-shadow:0 2px 4px 0 rgba(0,0,0,.12),0 0 6px 0 rgba(0,0,0,.04);box-shadow:0 2px 4px 0 rgba(0,0,0,.12),0 0 6px 0 rgba(0,0,0,.04)}.el-tabs--border-card>.el-tabs__content{padding:15px}.el-tabs--border-card>.el-tabs__header{background-color:#f5f7fa;border-bottom:1px solid #e4e7ed;margin:0}.el-tabs--border-card>.el-tabs__header .el-tabs__item{-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);border:1px solid transparent;margin-top:-1px;color:#909399}.el-tabs--border-card>.el-tabs__header .el-tabs__item+.el-tabs__item,.el-tabs--border-card>.el-tabs__header .el-tabs__item:first-child{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{color:#409eff;background-color:#fff;border-right-color:#dcdfe6;border-left-color:#dcdfe6}.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover{color:#409eff}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-disabled{color:#c0c4cc}.el-tabs--border-card>.el-tabs__header .is-scrollable .el-tabs__item:first-child{margin-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),.el-tabs--top .el-tabs__item.is-top:nth-child(2){padding-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:last-child,.el-tabs--bottom .el-tabs__item.is-top:last-child,.el-tabs--top .el-tabs__item.is-bottom:last-child,.el-tabs--top .el-tabs__item.is-top:last-child{padding-right:0}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2){padding-left:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child{padding-right:20px}.el-tabs--bottom .el-tabs__header.is-bottom{margin-bottom:0;margin-top:10px}.el-tabs--bottom.el-tabs--border-card .el-tabs__header.is-bottom{border-bottom:0;border-top:1px solid #dcdfe6}.el-tabs--bottom.el-tabs--border-card .el-tabs__nav-wrap.is-bottom{margin-top:-1px;margin-bottom:0}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom:not(.is-active){border:1px solid transparent}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom{margin:0 -1px -1px}.el-tabs--left,.el-tabs--right{overflow:hidden}.el-tabs--left .el-tabs__header.is-left,.el-tabs--left .el-tabs__header.is-right,.el-tabs--left .el-tabs__nav-scroll,.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__header.is-left,.el-tabs--right .el-tabs__header.is-right,.el-tabs--right .el-tabs__nav-scroll,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{height:100%}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__active-bar.is-right,.el-tabs--right .el-tabs__active-bar.is-left,.el-tabs--right .el-tabs__active-bar.is-right{top:0;bottom:auto;width:2px;height:auto}.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{margin-bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{height:30px;line-height:30px;width:100%;text-align:center;cursor:pointer}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i{-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg)}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{left:auto;top:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next{right:auto;bottom:0}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__nav-wrap.is-left::after{right:0;left:auto}.el-tabs--left .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--left .el-tabs__nav-wrap.is-right.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-right.is-scrollable{padding:30px 0}.el-tabs--left .el-tabs__nav-wrap.is-left::after,.el-tabs--left .el-tabs__nav-wrap.is-right::after,.el-tabs--right .el-tabs__nav-wrap.is-left::after,.el-tabs--right .el-tabs__nav-wrap.is-right::after{height:100%;width:2px;bottom:auto;top:0}.el-tabs--left .el-tabs__nav.is-left,.el-tabs--left .el-tabs__nav.is-right,.el-tabs--right .el-tabs__nav.is-left,.el-tabs--right .el-tabs__nav.is-right{float:none}.el-tabs--left .el-tabs__item.is-left,.el-tabs--left .el-tabs__item.is-right,.el-tabs--right .el-tabs__item.is-left,.el-tabs--right .el-tabs__item.is-right{display:block}.el-tabs--left.el-tabs--card .el-tabs__active-bar.is-left,.el-tabs--right.el-tabs--card .el-tabs__active-bar.is-right{display:none}.el-tabs--left .el-tabs__header.is-left{float:left;margin-bottom:0;margin-right:10px}.el-tabs--left .el-tabs__nav-wrap.is-left{margin-right:-1px}.el-tabs--left .el-tabs__item.is-left{text-align:right}.el-tabs--left.el-tabs--card .el-tabs__item.is-left{border-left:none;border-right:1px solid #e4e7ed;border-bottom:none;border-top:1px solid #e4e7ed;text-align:left}.el-tabs--left.el-tabs--card .el-tabs__item.is-left:first-child{border-right:1px solid #e4e7ed;border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active{border:1px solid #e4e7ed;border-right-color:#fff;border-left:none;border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:first-child{border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:last-child{border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__nav{border-radius:4px 0 0 4px;border-bottom:1px solid #e4e7ed;border-right:none}.el-tabs--left.el-tabs--card .el-tabs__new-tab{float:none}.el-tabs--left.el-tabs--border-card .el-tabs__header.is-left{border-right:1px solid #dfe4ed}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left{border:1px solid transparent;margin:-1px 0 -1px -1px}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left.is-active{border-color:#d1dbe5 transparent}.el-tabs--right .el-tabs__header.is-right{float:right;margin-bottom:0;margin-left:10px}.el-tabs--right .el-tabs__nav-wrap.is-right{margin-left:-1px}.el-tabs--right .el-tabs__nav-wrap.is-right::after{left:0;right:auto}.el-tabs--right .el-tabs__active-bar.is-right{left:0}.el-tabs--right.el-tabs--card .el-tabs__item.is-right{border-bottom:none;border-top:1px solid #e4e7ed}.el-tabs--right.el-tabs--card .el-tabs__item.is-right:first-child{border-left:1px solid #e4e7ed;border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active{border:1px solid #e4e7ed;border-left-color:#fff;border-right:none;border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:first-child{border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:last-child{border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__nav{border-radius:0 4px 4px 0;border-bottom:1px solid #e4e7ed;border-left:none}.el-tabs--right.el-tabs--border-card .el-tabs__header.is-right{border-left:1px solid #dfe4ed}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right{border:1px solid transparent;margin:-1px -1px -1px 0}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right.is-active{border-color:#d1dbe5 transparent}.slideInLeft-transition,.slideInRight-transition{display:inline-block}.slideInRight-enter{-webkit-animation:slideInRight-enter .3s;animation:slideInRight-enter .3s}.slideInRight-leave{position:absolute;left:0;right:0;-webkit-animation:slideInRight-leave .3s;animation:slideInRight-leave .3s}.slideInLeft-enter{-webkit-animation:slideInLeft-enter .3s;animation:slideInLeft-enter .3s}.slideInLeft-leave{position:absolute;left:0;right:0;-webkit-animation:slideInLeft-leave .3s;animation:slideInLeft-leave .3s}@-webkit-keyframes slideInRight-enter{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slideInRight-enter{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slideInRight-leave{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);opacity:0}}@keyframes slideInRight-leave{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);opacity:0}}@-webkit-keyframes slideInLeft-enter{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slideInLeft-enter{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slideInLeft-leave{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}}@keyframes slideInLeft-leave{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}}.el-tree{position:relative;cursor:default;background:#fff;color:#606266}.el-tree__empty-block{position:relative;min-height:60px;text-align:center;width:100%;height:100%}.el-tree__empty-text{position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#909399;font-size:14px}.el-tree__drop-indicator{position:absolute;left:0;right:0;height:1px;background-color:#409eff}.el-tree-node{white-space:nowrap;outline:0}.el-tree-node:focus>.el-tree-node__content{background-color:#f5f7fa}.el-tree-node.is-drop-inner>.el-tree-node__content .el-tree-node__label{background-color:#409eff;color:#fff}.el-tree-node__content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:26px;cursor:pointer}.el-tree-node__content>.el-tree-node__expand-icon{padding:6px}.el-tree-node__content>label.el-checkbox{margin-right:8px}.el-tree-node__content:hover{background-color:#f5f7fa}.el-tree.is-dragging .el-tree-node__content{cursor:move}.el-tree.is-dragging.is-drop-not-allow .el-tree-node__content{cursor:not-allowed}.el-tree-node__expand-icon{cursor:pointer;color:#c0c4cc;font-size:12px;-webkit-transform:rotate(0);transform:rotate(0);-webkit-transition:-webkit-transform .3s ease-in-out;transition:-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out;transition:transform .3s ease-in-out,-webkit-transform .3s ease-in-out}.el-tree-node__expand-icon.expanded{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.el-tree-node__expand-icon.is-leaf{color:transparent;cursor:default}.el-tree-node__label{font-size:14px}.el-tree-node__loading-icon{margin-right:8px;font-size:14px;color:#c0c4cc}.el-tree-node>.el-tree-node__children{overflow:hidden;background-color:transparent}.el-tree-node.is-expanded>.el-tree-node__children{display:block}.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:#f0f7ff}.el-alert{width:100%;padding:8px 16px;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;position:relative;background-color:#fff;overflow:hidden;opacity:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transition:opacity .2s;transition:opacity .2s}.el-alert.is-light .el-alert__closebtn{color:#c0c4cc}.el-alert.is-dark .el-alert__closebtn,.el-alert.is-dark .el-alert__description{color:#fff}.el-alert.is-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-alert--success.is-light{background-color:#f0f9eb;color:#67c23a}.el-alert--success.is-light .el-alert__description{color:#67c23a}.el-alert--success.is-dark{background-color:#67c23a;color:#fff}.el-alert--info.is-light{background-color:#f4f4f5;color:#909399}.el-alert--info.is-dark{background-color:#909399;color:#fff}.el-alert--info .el-alert__description{color:#909399}.el-alert--warning.is-light{background-color:#fdf6ec;color:#e6a23c}.el-alert--warning.is-light .el-alert__description{color:#e6a23c}.el-alert--warning.is-dark{background-color:#e6a23c;color:#fff}.el-alert--error.is-light{background-color:#fef0f0;color:#f56c6c}.el-alert--error.is-light .el-alert__description{color:#f56c6c}.el-alert--error.is-dark{background-color:#f56c6c;color:#fff}.el-alert__content{display:table-cell;padding:0 8px}.el-alert__icon{font-size:16px;width:16px}.el-alert__icon.is-big{font-size:28px;width:28px}.el-alert__title{font-size:13px;line-height:18px}.el-alert__title.is-bold{font-weight:700}.el-alert .el-alert__description{font-size:12px;margin:5px 0 0}.el-alert__closebtn{font-size:12px;opacity:1;position:absolute;top:12px;right:15px;cursor:pointer}.el-alert-fade-enter,.el-alert-fade-leave-active,.el-loading-fade-enter,.el-loading-fade-leave-active,.el-notification-fade-leave-active{opacity:0}.el-alert__closebtn.is-customed{font-style:normal;font-size:13px;top:9px}.el-notification{display:-webkit-box;display:-ms-flexbox;display:flex;width:330px;padding:14px 26px 14px 13px;border-radius:8px;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #ebeef5;position:fixed;background-color:#fff;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);-webkit-transition:opacity .3s,left .3s,right .3s,top .4s,bottom .3s,-webkit-transform .3s;transition:opacity .3s,left .3s,right .3s,top .4s,bottom .3s,-webkit-transform .3s;transition:opacity .3s,transform .3s,left .3s,right .3s,top .4s,bottom .3s;transition:opacity .3s,transform .3s,left .3s,right .3s,top .4s,bottom .3s,-webkit-transform .3s;overflow:hidden}.el-notification.right{right:16px}.el-notification.left{left:16px}.el-notification__group{margin-left:13px;margin-right:8px}.el-notification__title{font-weight:700;font-size:16px;color:#303133;margin:0}.el-notification__content{font-size:14px;line-height:21px;margin:6px 0 0;color:#606266;text-align:justify}.el-notification__content p{margin:0}.el-notification__icon{height:24px;width:24px;font-size:24px}.el-notification__closeBtn{position:absolute;top:18px;right:15px;cursor:pointer;color:#909399;font-size:16px}.el-notification__closeBtn:hover{color:#606266}.el-notification .el-icon-success{color:#67c23a}.el-notification .el-icon-error{color:#f56c6c}.el-notification .el-icon-info{color:#909399}.el-notification .el-icon-warning{color:#e6a23c}.el-notification-fade-enter.right{right:0;-webkit-transform:translateX(100%);transform:translateX(100%)}.el-notification-fade-enter.left{left:0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}.el-input-number{position:relative;display:inline-block;width:180px;line-height:38px}.el-input-number .el-input{display:block}.el-input-number .el-input__inner{-webkit-appearance:none;padding-left:50px;padding-right:50px;text-align:center}.el-input-number__decrease,.el-input-number__increase{position:absolute;z-index:1;top:1px;width:40px;height:auto;text-align:center;background:#f5f7fa;color:#606266;cursor:pointer;font-size:13px}.el-input-number__decrease:hover,.el-input-number__increase:hover{color:#409eff}.el-input-number__decrease:hover:not(.is-disabled)~.el-input .el-input__inner:not(.is-disabled),.el-input-number__increase:hover:not(.is-disabled)~.el-input .el-input__inner:not(.is-disabled){border-color:#409eff}.el-input-number__decrease.is-disabled,.el-input-number__increase.is-disabled{color:#c0c4cc;cursor:not-allowed}.el-input-number__increase{right:1px;border-radius:0 4px 4px 0;border-left:1px solid #dcdfe6}.el-input-number__decrease{left:1px;border-radius:4px 0 0 4px;border-right:1px solid #dcdfe6}.el-input-number.is-disabled .el-input-number__decrease,.el-input-number.is-disabled .el-input-number__increase{border-color:#e4e7ed;color:#e4e7ed}.el-input-number.is-disabled .el-input-number__decrease:hover,.el-input-number.is-disabled .el-input-number__increase:hover{color:#e4e7ed;cursor:not-allowed}.el-input-number--medium{width:200px;line-height:34px}.el-input-number--medium .el-input-number__decrease,.el-input-number--medium .el-input-number__increase{width:36px;font-size:14px}.el-input-number--medium .el-input__inner{padding-left:43px;padding-right:43px}.el-input-number--small{width:130px;line-height:30px}.el-input-number--small .el-input-number__decrease,.el-input-number--small .el-input-number__increase{width:32px;font-size:13px}.el-input-number--small .el-input-number__decrease [class*=el-icon],.el-input-number--small .el-input-number__increase [class*=el-icon]{-webkit-transform:scale(.9);transform:scale(.9)}.el-input-number--small .el-input__inner{padding-left:39px;padding-right:39px}.el-input-number--mini{width:130px;line-height:26px}.el-input-number--mini .el-input-number__decrease,.el-input-number--mini .el-input-number__increase{width:28px;font-size:12px}.el-input-number--mini .el-input-number__decrease [class*=el-icon],.el-input-number--mini .el-input-number__increase [class*=el-icon]{-webkit-transform:scale(.8);transform:scale(.8)}.el-input-number--mini .el-input__inner{padding-left:35px;padding-right:35px}.el-input-number.is-without-controls .el-input__inner{padding-left:15px;padding-right:15px}.el-input-number.is-controls-right .el-input__inner{padding-left:15px;padding-right:50px}.el-input-number.is-controls-right .el-input-number__decrease,.el-input-number.is-controls-right .el-input-number__increase{height:auto;line-height:19px}.el-input-number.is-controls-right .el-input-number__decrease [class*=el-icon],.el-input-number.is-controls-right .el-input-number__increase [class*=el-icon]{-webkit-transform:scale(.8);transform:scale(.8)}.el-input-number.is-controls-right .el-input-number__increase{border-radius:0 4px 0 0;border-bottom:1px solid #dcdfe6}.el-input-number.is-controls-right .el-input-number__decrease{right:1px;bottom:1px;top:auto;left:auto;border-right:none;border-left:1px solid #dcdfe6;border-radius:0 0 4px}.el-input-number.is-controls-right[class*=medium] [class*=decrease],.el-input-number.is-controls-right[class*=medium] [class*=increase]{line-height:17px}.el-input-number.is-controls-right[class*=small] [class*=decrease],.el-input-number.is-controls-right[class*=small] [class*=increase]{line-height:15px}.el-input-number.is-controls-right[class*=mini] [class*=decrease],.el-input-number.is-controls-right[class*=mini] [class*=increase]{line-height:13px}.el-tooltip__popper{position:absolute;border-radius:4px;padding:10px;z-index:2000;font-size:12px;line-height:1.2;min-width:10px;word-wrap:break-word}.el-tooltip__popper .popper__arrow,.el-tooltip__popper .popper__arrow::after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.el-tooltip__popper .popper__arrow{border-width:6px}.el-tooltip__popper .popper__arrow::after{content:" ";border-width:5px}.el-progress-bar__inner::after,.el-row::after,.el-row::before,.el-slider::after,.el-slider::before,.el-slider__button-wrapper::after,.el-upload-cover::after{content:""}.el-tooltip__popper[x-placement^=top]{margin-bottom:12px}.el-tooltip__popper[x-placement^=top] .popper__arrow{bottom:-6px;border-top-color:#303133;border-bottom-width:0}.el-tooltip__popper[x-placement^=top] .popper__arrow::after{bottom:1px;margin-left:-5px;border-top-color:#303133;border-bottom-width:0}.el-tooltip__popper[x-placement^=bottom]{margin-top:12px}.el-tooltip__popper[x-placement^=bottom] .popper__arrow{top:-6px;border-top-width:0;border-bottom-color:#303133}.el-tooltip__popper[x-placement^=bottom] .popper__arrow::after{top:1px;margin-left:-5px;border-top-width:0;border-bottom-color:#303133}.el-tooltip__popper[x-placement^=right]{margin-left:12px}.el-tooltip__popper[x-placement^=right] .popper__arrow{left:-6px;border-right-color:#303133;border-left-width:0}.el-tooltip__popper[x-placement^=right] .popper__arrow::after{bottom:-5px;left:1px;border-right-color:#303133;border-left-width:0}.el-tooltip__popper[x-placement^=left]{margin-right:12px}.el-tooltip__popper[x-placement^=left] .popper__arrow{right:-6px;border-right-width:0;border-left-color:#303133}.el-tooltip__popper[x-placement^=left] .popper__arrow::after{right:1px;bottom:-5px;margin-left:-5px;border-right-width:0;border-left-color:#303133}.el-tooltip__popper.is-dark{background:#303133;color:#fff}.el-tooltip__popper.is-light{background:#fff;border:1px solid #303133}.el-tooltip__popper.is-light[x-placement^=top] .popper__arrow{border-top-color:#303133}.el-tooltip__popper.is-light[x-placement^=top] .popper__arrow::after{border-top-color:#fff}.el-tooltip__popper.is-light[x-placement^=bottom] .popper__arrow{border-bottom-color:#303133}.el-tooltip__popper.is-light[x-placement^=bottom] .popper__arrow::after{border-bottom-color:#fff}.el-tooltip__popper.is-light[x-placement^=left] .popper__arrow{border-left-color:#303133}.el-tooltip__popper.is-light[x-placement^=left] .popper__arrow::after{border-left-color:#fff}.el-tooltip__popper.is-light[x-placement^=right] .popper__arrow{border-right-color:#303133}.el-tooltip__popper.is-light[x-placement^=right] .popper__arrow::after{border-right-color:#fff}.el-slider::after,.el-slider::before{display:table}.el-slider__button-wrapper .el-tooltip,.el-slider__button-wrapper::after{vertical-align:middle;display:inline-block}.el-slider::after{clear:both}.el-slider__runway{width:100%;height:6px;margin:16px 0;background-color:#e4e7ed;border-radius:3px;position:relative;cursor:pointer;vertical-align:middle}.el-slider__runway.show-input{margin-right:160px;width:auto}.el-slider__runway.disabled{cursor:default}.el-slider__runway.disabled .el-slider__bar{background-color:#c0c4cc}.el-slider__runway.disabled .el-slider__button{border-color:#c0c4cc}.el-slider__runway.disabled .el-slider__button-wrapper.dragging,.el-slider__runway.disabled .el-slider__button-wrapper.hover,.el-slider__runway.disabled .el-slider__button-wrapper:hover{cursor:not-allowed}.el-slider__runway.disabled .el-slider__button.dragging,.el-slider__runway.disabled .el-slider__button.hover,.el-slider__runway.disabled .el-slider__button:hover{-webkit-transform:scale(1);transform:scale(1);cursor:not-allowed}.el-slider__button-wrapper,.el-slider__stop{-webkit-transform:translateX(-50%);position:absolute}.el-slider__input{float:right;margin-top:3px;width:130px}.el-slider__input.el-input-number--mini{margin-top:5px}.el-slider__input.el-input-number--medium{margin-top:0}.el-slider__input.el-input-number--large{margin-top:-2px}.el-slider__bar{height:6px;background-color:#409eff;border-top-left-radius:3px;border-bottom-left-radius:3px;position:absolute}.el-slider__button-wrapper{height:36px;width:36px;z-index:1001;top:-15px;transform:translateX(-50%);background-color:transparent;text-align:center;user-select:none;line-height:normal}.el-slider__button-wrapper::after{height:100%}.el-slider__button-wrapper.hover,.el-slider__button-wrapper:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button-wrapper.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__button{width:16px;height:16px;border:2px solid #409eff;background-color:#fff;border-radius:50%;-webkit-transition:.2s;transition:.2s;user-select:none}.el-image-viewer__btn,.el-step__icon-inner{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.el-slider__button.dragging,.el-slider__button.hover,.el-slider__button:hover{-webkit-transform:scale(1.2);transform:scale(1.2)}.el-slider__button.hover,.el-slider__button:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__stop{height:6px;width:6px;border-radius:100%;background-color:#fff;transform:translateX(-50%)}.el-slider__marks{top:0;left:12px;width:18px;height:100%}.el-slider__marks-text{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);font-size:14px;color:#909399;margin-top:15px}.el-slider.is-vertical{position:relative}.el-slider.is-vertical .el-slider__runway{width:6px;height:100%;margin:0 16px}.el-slider.is-vertical .el-slider__bar{width:6px;height:auto;border-radius:0 0 3px 3px}.el-slider.is-vertical .el-slider__button-wrapper{top:auto;left:-15px;-webkit-transform:translateY(50%);transform:translateY(50%)}.el-slider.is-vertical .el-slider__stop{-webkit-transform:translateY(50%);transform:translateY(50%)}.el-slider.is-vertical.el-slider--with-input{padding-bottom:58px}.el-slider.is-vertical.el-slider--with-input .el-slider__input{overflow:visible;float:none;position:absolute;bottom:22px;width:36px;margin-top:15px}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input__inner{text-align:center;padding-left:5px;padding-right:5px}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__decrease,.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__increase{top:32px;margin-top:-1px;border:1px solid #dcdfe6;line-height:20px;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__decrease{width:18px;right:18px;border-bottom-left-radius:4px}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__increase{width:19px;border-bottom-right-radius:4px}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__increase~.el-input .el-input__inner{border-bottom-left-radius:0;border-bottom-right-radius:0}.el-slider.is-vertical.el-slider--with-input .el-slider__input:hover .el-input-number__decrease,.el-slider.is-vertical.el-slider--with-input .el-slider__input:hover .el-input-number__increase{border-color:#c0c4cc}.el-slider.is-vertical.el-slider--with-input .el-slider__input:active .el-input-number__decrease,.el-slider.is-vertical.el-slider--with-input .el-slider__input:active .el-input-number__increase{border-color:#409eff}.el-slider.is-vertical .el-slider__marks-text{margin-top:0;left:15px;-webkit-transform:translateY(50%);transform:translateY(50%)}.el-loading-parent--relative{position:relative!important}.el-loading-parent--hidden{overflow:hidden!important}.el-loading-mask{position:absolute;z-index:2000;background-color:rgba(255,255,255,.9);margin:0;top:0;right:0;bottom:0;left:0;-webkit-transition:opacity .3s;transition:opacity .3s}.el-loading-mask.is-fullscreen{position:fixed}.el-loading-mask.is-fullscreen .el-loading-spinner{margin-top:-25px}.el-loading-mask.is-fullscreen .el-loading-spinner .circular{height:50px;width:50px}.el-loading-spinner{top:50%;margin-top:-21px;width:100%;text-align:center;position:absolute}.el-col-pull-0,.el-col-pull-1,.el-col-pull-10,.el-col-pull-11,.el-col-pull-13,.el-col-pull-14,.el-col-pull-15,.el-col-pull-16,.el-col-pull-17,.el-col-pull-18,.el-col-pull-19,.el-col-pull-2,.el-col-pull-20,.el-col-pull-21,.el-col-pull-22,.el-col-pull-23,.el-col-pull-24,.el-col-pull-3,.el-col-pull-4,.el-col-pull-5,.el-col-pull-6,.el-col-pull-7,.el-col-pull-8,.el-col-pull-9,.el-col-push-0,.el-col-push-1,.el-col-push-10,.el-col-push-11,.el-col-push-12,.el-col-push-13,.el-col-push-14,.el-col-push-15,.el-col-push-16,.el-col-push-17,.el-col-push-18,.el-col-push-19,.el-col-push-2,.el-col-push-20,.el-col-push-21,.el-col-push-22,.el-col-push-23,.el-col-push-24,.el-col-push-3,.el-col-push-4,.el-col-push-5,.el-col-push-6,.el-col-push-7,.el-col-push-8,.el-col-push-9,.el-row{position:relative}.el-loading-spinner .el-loading-text{color:#409eff;margin:3px 0;font-size:14px}.el-loading-spinner .circular{height:42px;width:42px;-webkit-animation:loading-rotate 2s linear infinite;animation:loading-rotate 2s linear infinite}.el-loading-spinner .path{-webkit-animation:loading-dash 1.5s ease-in-out infinite;animation:loading-dash 1.5s ease-in-out infinite;stroke-dasharray:90,150;stroke-dashoffset:0;stroke-width:2;stroke:#409eff;stroke-linecap:round}.el-loading-spinner i{color:#409eff}@-webkit-keyframes loading-rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes loading-rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}100%{stroke-dasharray:90,150;stroke-dashoffset:-120px}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}100%{stroke-dasharray:90,150;stroke-dashoffset:-120px}}.el-row{-webkit-box-sizing:border-box;box-sizing:border-box}.el-row::after,.el-row::before{display:table}.el-row::after{clear:both}.el-row--flex{display:-webkit-box;display:-ms-flexbox;display:flex}.el-col-0,.el-row--flex:after,.el-row--flex:before{display:none}.el-row--flex.is-justify-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-row--flex.is-justify-end{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.el-row--flex.is-justify-space-between{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.el-row--flex.is-justify-space-around{-ms-flex-pack:distribute;justify-content:space-around}.el-row--flex.is-align-middle{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-row--flex.is-align-bottom{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}[class*=el-col-]{float:left;-webkit-box-sizing:border-box;box-sizing:border-box}.el-upload--picture-card,.el-upload-dragger{-webkit-box-sizing:border-box;cursor:pointer}.el-col-0{width:0%}.el-col-offset-0{margin-left:0}.el-col-pull-0{right:0}.el-col-push-0{left:0}.el-col-1{width:4.16667%}.el-col-offset-1{margin-left:4.16667%}.el-col-pull-1{right:4.16667%}.el-col-push-1{left:4.16667%}.el-col-2{width:8.33333%}.el-col-offset-2{margin-left:8.33333%}.el-col-pull-2{right:8.33333%}.el-col-push-2{left:8.33333%}.el-col-3{width:12.5%}.el-col-offset-3{margin-left:12.5%}.el-col-pull-3{right:12.5%}.el-col-push-3{left:12.5%}.el-col-4{width:16.66667%}.el-col-offset-4{margin-left:16.66667%}.el-col-pull-4{right:16.66667%}.el-col-push-4{left:16.66667%}.el-col-5{width:20.83333%}.el-col-offset-5{margin-left:20.83333%}.el-col-pull-5{right:20.83333%}.el-col-push-5{left:20.83333%}.el-col-6{width:25%}.el-col-offset-6{margin-left:25%}.el-col-pull-6{right:25%}.el-col-push-6{left:25%}.el-col-7{width:29.16667%}.el-col-offset-7{margin-left:29.16667%}.el-col-pull-7{right:29.16667%}.el-col-push-7{left:29.16667%}.el-col-8{width:33.33333%}.el-col-offset-8{margin-left:33.33333%}.el-col-pull-8{right:33.33333%}.el-col-push-8{left:33.33333%}.el-col-9{width:37.5%}.el-col-offset-9{margin-left:37.5%}.el-col-pull-9{right:37.5%}.el-col-push-9{left:37.5%}.el-col-10{width:41.66667%}.el-col-offset-10{margin-left:41.66667%}.el-col-pull-10{right:41.66667%}.el-col-push-10{left:41.66667%}.el-col-11{width:45.83333%}.el-col-offset-11{margin-left:45.83333%}.el-col-pull-11{right:45.83333%}.el-col-push-11{left:45.83333%}.el-col-12{width:50%}.el-col-offset-12{margin-left:50%}.el-col-pull-12{position:relative;right:50%}.el-col-push-12{left:50%}.el-col-13{width:54.16667%}.el-col-offset-13{margin-left:54.16667%}.el-col-pull-13{right:54.16667%}.el-col-push-13{left:54.16667%}.el-col-14{width:58.33333%}.el-col-offset-14{margin-left:58.33333%}.el-col-pull-14{right:58.33333%}.el-col-push-14{left:58.33333%}.el-col-15{width:62.5%}.el-col-offset-15{margin-left:62.5%}.el-col-pull-15{right:62.5%}.el-col-push-15{left:62.5%}.el-col-16{width:66.66667%}.el-col-offset-16{margin-left:66.66667%}.el-col-pull-16{right:66.66667%}.el-col-push-16{left:66.66667%}.el-col-17{width:70.83333%}.el-col-offset-17{margin-left:70.83333%}.el-col-pull-17{right:70.83333%}.el-col-push-17{left:70.83333%}.el-col-18{width:75%}.el-col-offset-18{margin-left:75%}.el-col-pull-18{right:75%}.el-col-push-18{left:75%}.el-col-19{width:79.16667%}.el-col-offset-19{margin-left:79.16667%}.el-col-pull-19{right:79.16667%}.el-col-push-19{left:79.16667%}.el-col-20{width:83.33333%}.el-col-offset-20{margin-left:83.33333%}.el-col-pull-20{right:83.33333%}.el-col-push-20{left:83.33333%}.el-col-21{width:87.5%}.el-col-offset-21{margin-left:87.5%}.el-col-pull-21{right:87.5%}.el-col-push-21{left:87.5%}.el-col-22{width:91.66667%}.el-col-offset-22{margin-left:91.66667%}.el-col-pull-22{right:91.66667%}.el-col-push-22{left:91.66667%}.el-col-23{width:95.83333%}.el-col-offset-23{margin-left:95.83333%}.el-col-pull-23{right:95.83333%}.el-col-push-23{left:95.83333%}.el-col-24{width:100%}.el-col-offset-24{margin-left:100%}.el-col-pull-24{right:100%}.el-col-push-24{left:100%}@media only screen and (max-width:767px){.el-col-xs-0{display:none;width:0%}.el-col-xs-offset-0{margin-left:0}.el-col-xs-pull-0{position:relative;right:0}.el-col-xs-push-0{position:relative;left:0}.el-col-xs-1{width:4.16667%}.el-col-xs-offset-1{margin-left:4.16667%}.el-col-xs-pull-1{position:relative;right:4.16667%}.el-col-xs-push-1{position:relative;left:4.16667%}.el-col-xs-2{width:8.33333%}.el-col-xs-offset-2{margin-left:8.33333%}.el-col-xs-pull-2{position:relative;right:8.33333%}.el-col-xs-push-2{position:relative;left:8.33333%}.el-col-xs-3{width:12.5%}.el-col-xs-offset-3{margin-left:12.5%}.el-col-xs-pull-3{position:relative;right:12.5%}.el-col-xs-push-3{position:relative;left:12.5%}.el-col-xs-4{width:16.66667%}.el-col-xs-offset-4{margin-left:16.66667%}.el-col-xs-pull-4{position:relative;right:16.66667%}.el-col-xs-push-4{position:relative;left:16.66667%}.el-col-xs-5{width:20.83333%}.el-col-xs-offset-5{margin-left:20.83333%}.el-col-xs-pull-5{position:relative;right:20.83333%}.el-col-xs-push-5{position:relative;left:20.83333%}.el-col-xs-6{width:25%}.el-col-xs-offset-6{margin-left:25%}.el-col-xs-pull-6{position:relative;right:25%}.el-col-xs-push-6{position:relative;left:25%}.el-col-xs-7{width:29.16667%}.el-col-xs-offset-7{margin-left:29.16667%}.el-col-xs-pull-7{position:relative;right:29.16667%}.el-col-xs-push-7{position:relative;left:29.16667%}.el-col-xs-8{width:33.33333%}.el-col-xs-offset-8{margin-left:33.33333%}.el-col-xs-pull-8{position:relative;right:33.33333%}.el-col-xs-push-8{position:relative;left:33.33333%}.el-col-xs-9{width:37.5%}.el-col-xs-offset-9{margin-left:37.5%}.el-col-xs-pull-9{position:relative;right:37.5%}.el-col-xs-push-9{position:relative;left:37.5%}.el-col-xs-10{width:41.66667%}.el-col-xs-offset-10{margin-left:41.66667%}.el-col-xs-pull-10{position:relative;right:41.66667%}.el-col-xs-push-10{position:relative;left:41.66667%}.el-col-xs-11{width:45.83333%}.el-col-xs-offset-11{margin-left:45.83333%}.el-col-xs-pull-11{position:relative;right:45.83333%}.el-col-xs-push-11{position:relative;left:45.83333%}.el-col-xs-12{width:50%}.el-col-xs-offset-12{margin-left:50%}.el-col-xs-pull-12{position:relative;right:50%}.el-col-xs-push-12{position:relative;left:50%}.el-col-xs-13{width:54.16667%}.el-col-xs-offset-13{margin-left:54.16667%}.el-col-xs-pull-13{position:relative;right:54.16667%}.el-col-xs-push-13{position:relative;left:54.16667%}.el-col-xs-14{width:58.33333%}.el-col-xs-offset-14{margin-left:58.33333%}.el-col-xs-pull-14{position:relative;right:58.33333%}.el-col-xs-push-14{position:relative;left:58.33333%}.el-col-xs-15{width:62.5%}.el-col-xs-offset-15{margin-left:62.5%}.el-col-xs-pull-15{position:relative;right:62.5%}.el-col-xs-push-15{position:relative;left:62.5%}.el-col-xs-16{width:66.66667%}.el-col-xs-offset-16{margin-left:66.66667%}.el-col-xs-pull-16{position:relative;right:66.66667%}.el-col-xs-push-16{position:relative;left:66.66667%}.el-col-xs-17{width:70.83333%}.el-col-xs-offset-17{margin-left:70.83333%}.el-col-xs-pull-17{position:relative;right:70.83333%}.el-col-xs-push-17{position:relative;left:70.83333%}.el-col-xs-18{width:75%}.el-col-xs-offset-18{margin-left:75%}.el-col-xs-pull-18{position:relative;right:75%}.el-col-xs-push-18{position:relative;left:75%}.el-col-xs-19{width:79.16667%}.el-col-xs-offset-19{margin-left:79.16667%}.el-col-xs-pull-19{position:relative;right:79.16667%}.el-col-xs-push-19{position:relative;left:79.16667%}.el-col-xs-20{width:83.33333%}.el-col-xs-offset-20{margin-left:83.33333%}.el-col-xs-pull-20{position:relative;right:83.33333%}.el-col-xs-push-20{position:relative;left:83.33333%}.el-col-xs-21{width:87.5%}.el-col-xs-offset-21{margin-left:87.5%}.el-col-xs-pull-21{position:relative;right:87.5%}.el-col-xs-push-21{position:relative;left:87.5%}.el-col-xs-22{width:91.66667%}.el-col-xs-offset-22{margin-left:91.66667%}.el-col-xs-pull-22{position:relative;right:91.66667%}.el-col-xs-push-22{position:relative;left:91.66667%}.el-col-xs-23{width:95.83333%}.el-col-xs-offset-23{margin-left:95.83333%}.el-col-xs-pull-23{position:relative;right:95.83333%}.el-col-xs-push-23{position:relative;left:95.83333%}.el-col-xs-24{width:100%}.el-col-xs-offset-24{margin-left:100%}.el-col-xs-pull-24{position:relative;right:100%}.el-col-xs-push-24{position:relative;left:100%}}@media only screen and (min-width:768px){.el-col-sm-0{display:none;width:0%}.el-col-sm-offset-0{margin-left:0}.el-col-sm-pull-0{position:relative;right:0}.el-col-sm-push-0{position:relative;left:0}.el-col-sm-1{width:4.16667%}.el-col-sm-offset-1{margin-left:4.16667%}.el-col-sm-pull-1{position:relative;right:4.16667%}.el-col-sm-push-1{position:relative;left:4.16667%}.el-col-sm-2{width:8.33333%}.el-col-sm-offset-2{margin-left:8.33333%}.el-col-sm-pull-2{position:relative;right:8.33333%}.el-col-sm-push-2{position:relative;left:8.33333%}.el-col-sm-3{width:12.5%}.el-col-sm-offset-3{margin-left:12.5%}.el-col-sm-pull-3{position:relative;right:12.5%}.el-col-sm-push-3{position:relative;left:12.5%}.el-col-sm-4{width:16.66667%}.el-col-sm-offset-4{margin-left:16.66667%}.el-col-sm-pull-4{position:relative;right:16.66667%}.el-col-sm-push-4{position:relative;left:16.66667%}.el-col-sm-5{width:20.83333%}.el-col-sm-offset-5{margin-left:20.83333%}.el-col-sm-pull-5{position:relative;right:20.83333%}.el-col-sm-push-5{position:relative;left:20.83333%}.el-col-sm-6{width:25%}.el-col-sm-offset-6{margin-left:25%}.el-col-sm-pull-6{position:relative;right:25%}.el-col-sm-push-6{position:relative;left:25%}.el-col-sm-7{width:29.16667%}.el-col-sm-offset-7{margin-left:29.16667%}.el-col-sm-pull-7{position:relative;right:29.16667%}.el-col-sm-push-7{position:relative;left:29.16667%}.el-col-sm-8{width:33.33333%}.el-col-sm-offset-8{margin-left:33.33333%}.el-col-sm-pull-8{position:relative;right:33.33333%}.el-col-sm-push-8{position:relative;left:33.33333%}.el-col-sm-9{width:37.5%}.el-col-sm-offset-9{margin-left:37.5%}.el-col-sm-pull-9{position:relative;right:37.5%}.el-col-sm-push-9{position:relative;left:37.5%}.el-col-sm-10{width:41.66667%}.el-col-sm-offset-10{margin-left:41.66667%}.el-col-sm-pull-10{position:relative;right:41.66667%}.el-col-sm-push-10{position:relative;left:41.66667%}.el-col-sm-11{width:45.83333%}.el-col-sm-offset-11{margin-left:45.83333%}.el-col-sm-pull-11{position:relative;right:45.83333%}.el-col-sm-push-11{position:relative;left:45.83333%}.el-col-sm-12{width:50%}.el-col-sm-offset-12{margin-left:50%}.el-col-sm-pull-12{position:relative;right:50%}.el-col-sm-push-12{position:relative;left:50%}.el-col-sm-13{width:54.16667%}.el-col-sm-offset-13{margin-left:54.16667%}.el-col-sm-pull-13{position:relative;right:54.16667%}.el-col-sm-push-13{position:relative;left:54.16667%}.el-col-sm-14{width:58.33333%}.el-col-sm-offset-14{margin-left:58.33333%}.el-col-sm-pull-14{position:relative;right:58.33333%}.el-col-sm-push-14{position:relative;left:58.33333%}.el-col-sm-15{width:62.5%}.el-col-sm-offset-15{margin-left:62.5%}.el-col-sm-pull-15{position:relative;right:62.5%}.el-col-sm-push-15{position:relative;left:62.5%}.el-col-sm-16{width:66.66667%}.el-col-sm-offset-16{margin-left:66.66667%}.el-col-sm-pull-16{position:relative;right:66.66667%}.el-col-sm-push-16{position:relative;left:66.66667%}.el-col-sm-17{width:70.83333%}.el-col-sm-offset-17{margin-left:70.83333%}.el-col-sm-pull-17{position:relative;right:70.83333%}.el-col-sm-push-17{position:relative;left:70.83333%}.el-col-sm-18{width:75%}.el-col-sm-offset-18{margin-left:75%}.el-col-sm-pull-18{position:relative;right:75%}.el-col-sm-push-18{position:relative;left:75%}.el-col-sm-19{width:79.16667%}.el-col-sm-offset-19{margin-left:79.16667%}.el-col-sm-pull-19{position:relative;right:79.16667%}.el-col-sm-push-19{position:relative;left:79.16667%}.el-col-sm-20{width:83.33333%}.el-col-sm-offset-20{margin-left:83.33333%}.el-col-sm-pull-20{position:relative;right:83.33333%}.el-col-sm-push-20{position:relative;left:83.33333%}.el-col-sm-21{width:87.5%}.el-col-sm-offset-21{margin-left:87.5%}.el-col-sm-pull-21{position:relative;right:87.5%}.el-col-sm-push-21{position:relative;left:87.5%}.el-col-sm-22{width:91.66667%}.el-col-sm-offset-22{margin-left:91.66667%}.el-col-sm-pull-22{position:relative;right:91.66667%}.el-col-sm-push-22{position:relative;left:91.66667%}.el-col-sm-23{width:95.83333%}.el-col-sm-offset-23{margin-left:95.83333%}.el-col-sm-pull-23{position:relative;right:95.83333%}.el-col-sm-push-23{position:relative;left:95.83333%}.el-col-sm-24{width:100%}.el-col-sm-offset-24{margin-left:100%}.el-col-sm-pull-24{position:relative;right:100%}.el-col-sm-push-24{position:relative;left:100%}}@media only screen and (min-width:992px){.el-col-md-0{display:none;width:0%}.el-col-md-offset-0{margin-left:0}.el-col-md-pull-0{position:relative;right:0}.el-col-md-push-0{position:relative;left:0}.el-col-md-1{width:4.16667%}.el-col-md-offset-1{margin-left:4.16667%}.el-col-md-pull-1{position:relative;right:4.16667%}.el-col-md-push-1{position:relative;left:4.16667%}.el-col-md-2{width:8.33333%}.el-col-md-offset-2{margin-left:8.33333%}.el-col-md-pull-2{position:relative;right:8.33333%}.el-col-md-push-2{position:relative;left:8.33333%}.el-col-md-3{width:12.5%}.el-col-md-offset-3{margin-left:12.5%}.el-col-md-pull-3{position:relative;right:12.5%}.el-col-md-push-3{position:relative;left:12.5%}.el-col-md-4{width:16.66667%}.el-col-md-offset-4{margin-left:16.66667%}.el-col-md-pull-4{position:relative;right:16.66667%}.el-col-md-push-4{position:relative;left:16.66667%}.el-col-md-5{width:20.83333%}.el-col-md-offset-5{margin-left:20.83333%}.el-col-md-pull-5{position:relative;right:20.83333%}.el-col-md-push-5{position:relative;left:20.83333%}.el-col-md-6{width:25%}.el-col-md-offset-6{margin-left:25%}.el-col-md-pull-6{position:relative;right:25%}.el-col-md-push-6{position:relative;left:25%}.el-col-md-7{width:29.16667%}.el-col-md-offset-7{margin-left:29.16667%}.el-col-md-pull-7{position:relative;right:29.16667%}.el-col-md-push-7{position:relative;left:29.16667%}.el-col-md-8{width:33.33333%}.el-col-md-offset-8{margin-left:33.33333%}.el-col-md-pull-8{position:relative;right:33.33333%}.el-col-md-push-8{position:relative;left:33.33333%}.el-col-md-9{width:37.5%}.el-col-md-offset-9{margin-left:37.5%}.el-col-md-pull-9{position:relative;right:37.5%}.el-col-md-push-9{position:relative;left:37.5%}.el-col-md-10{width:41.66667%}.el-col-md-offset-10{margin-left:41.66667%}.el-col-md-pull-10{position:relative;right:41.66667%}.el-col-md-push-10{position:relative;left:41.66667%}.el-col-md-11{width:45.83333%}.el-col-md-offset-11{margin-left:45.83333%}.el-col-md-pull-11{position:relative;right:45.83333%}.el-col-md-push-11{position:relative;left:45.83333%}.el-col-md-12{width:50%}.el-col-md-offset-12{margin-left:50%}.el-col-md-pull-12{position:relative;right:50%}.el-col-md-push-12{position:relative;left:50%}.el-col-md-13{width:54.16667%}.el-col-md-offset-13{margin-left:54.16667%}.el-col-md-pull-13{position:relative;right:54.16667%}.el-col-md-push-13{position:relative;left:54.16667%}.el-col-md-14{width:58.33333%}.el-col-md-offset-14{margin-left:58.33333%}.el-col-md-pull-14{position:relative;right:58.33333%}.el-col-md-push-14{position:relative;left:58.33333%}.el-col-md-15{width:62.5%}.el-col-md-offset-15{margin-left:62.5%}.el-col-md-pull-15{position:relative;right:62.5%}.el-col-md-push-15{position:relative;left:62.5%}.el-col-md-16{width:66.66667%}.el-col-md-offset-16{margin-left:66.66667%}.el-col-md-pull-16{position:relative;right:66.66667%}.el-col-md-push-16{position:relative;left:66.66667%}.el-col-md-17{width:70.83333%}.el-col-md-offset-17{margin-left:70.83333%}.el-col-md-pull-17{position:relative;right:70.83333%}.el-col-md-push-17{position:relative;left:70.83333%}.el-col-md-18{width:75%}.el-col-md-offset-18{margin-left:75%}.el-col-md-pull-18{position:relative;right:75%}.el-col-md-push-18{position:relative;left:75%}.el-col-md-19{width:79.16667%}.el-col-md-offset-19{margin-left:79.16667%}.el-col-md-pull-19{position:relative;right:79.16667%}.el-col-md-push-19{position:relative;left:79.16667%}.el-col-md-20{width:83.33333%}.el-col-md-offset-20{margin-left:83.33333%}.el-col-md-pull-20{position:relative;right:83.33333%}.el-col-md-push-20{position:relative;left:83.33333%}.el-col-md-21{width:87.5%}.el-col-md-offset-21{margin-left:87.5%}.el-col-md-pull-21{position:relative;right:87.5%}.el-col-md-push-21{position:relative;left:87.5%}.el-col-md-22{width:91.66667%}.el-col-md-offset-22{margin-left:91.66667%}.el-col-md-pull-22{position:relative;right:91.66667%}.el-col-md-push-22{position:relative;left:91.66667%}.el-col-md-23{width:95.83333%}.el-col-md-offset-23{margin-left:95.83333%}.el-col-md-pull-23{position:relative;right:95.83333%}.el-col-md-push-23{position:relative;left:95.83333%}.el-col-md-24{width:100%}.el-col-md-offset-24{margin-left:100%}.el-col-md-pull-24{position:relative;right:100%}.el-col-md-push-24{position:relative;left:100%}}@media only screen and (min-width:1200px){.el-col-lg-0{display:none;width:0%}.el-col-lg-offset-0{margin-left:0}.el-col-lg-pull-0{position:relative;right:0}.el-col-lg-push-0{position:relative;left:0}.el-col-lg-1{width:4.16667%}.el-col-lg-offset-1{margin-left:4.16667%}.el-col-lg-pull-1{position:relative;right:4.16667%}.el-col-lg-push-1{position:relative;left:4.16667%}.el-col-lg-2{width:8.33333%}.el-col-lg-offset-2{margin-left:8.33333%}.el-col-lg-pull-2{position:relative;right:8.33333%}.el-col-lg-push-2{position:relative;left:8.33333%}.el-col-lg-3{width:12.5%}.el-col-lg-offset-3{margin-left:12.5%}.el-col-lg-pull-3{position:relative;right:12.5%}.el-col-lg-push-3{position:relative;left:12.5%}.el-col-lg-4{width:16.66667%}.el-col-lg-offset-4{margin-left:16.66667%}.el-col-lg-pull-4{position:relative;right:16.66667%}.el-col-lg-push-4{position:relative;left:16.66667%}.el-col-lg-5{width:20.83333%}.el-col-lg-offset-5{margin-left:20.83333%}.el-col-lg-pull-5{position:relative;right:20.83333%}.el-col-lg-push-5{position:relative;left:20.83333%}.el-col-lg-6{width:25%}.el-col-lg-offset-6{margin-left:25%}.el-col-lg-pull-6{position:relative;right:25%}.el-col-lg-push-6{position:relative;left:25%}.el-col-lg-7{width:29.16667%}.el-col-lg-offset-7{margin-left:29.16667%}.el-col-lg-pull-7{position:relative;right:29.16667%}.el-col-lg-push-7{position:relative;left:29.16667%}.el-col-lg-8{width:33.33333%}.el-col-lg-offset-8{margin-left:33.33333%}.el-col-lg-pull-8{position:relative;right:33.33333%}.el-col-lg-push-8{position:relative;left:33.33333%}.el-col-lg-9{width:37.5%}.el-col-lg-offset-9{margin-left:37.5%}.el-col-lg-pull-9{position:relative;right:37.5%}.el-col-lg-push-9{position:relative;left:37.5%}.el-col-lg-10{width:41.66667%}.el-col-lg-offset-10{margin-left:41.66667%}.el-col-lg-pull-10{position:relative;right:41.66667%}.el-col-lg-push-10{position:relative;left:41.66667%}.el-col-lg-11{width:45.83333%}.el-col-lg-offset-11{margin-left:45.83333%}.el-col-lg-pull-11{position:relative;right:45.83333%}.el-col-lg-push-11{position:relative;left:45.83333%}.el-col-lg-12{width:50%}.el-col-lg-offset-12{margin-left:50%}.el-col-lg-pull-12{position:relative;right:50%}.el-col-lg-push-12{position:relative;left:50%}.el-col-lg-13{width:54.16667%}.el-col-lg-offset-13{margin-left:54.16667%}.el-col-lg-pull-13{position:relative;right:54.16667%}.el-col-lg-push-13{position:relative;left:54.16667%}.el-col-lg-14{width:58.33333%}.el-col-lg-offset-14{margin-left:58.33333%}.el-col-lg-pull-14{position:relative;right:58.33333%}.el-col-lg-push-14{position:relative;left:58.33333%}.el-col-lg-15{width:62.5%}.el-col-lg-offset-15{margin-left:62.5%}.el-col-lg-pull-15{position:relative;right:62.5%}.el-col-lg-push-15{position:relative;left:62.5%}.el-col-lg-16{width:66.66667%}.el-col-lg-offset-16{margin-left:66.66667%}.el-col-lg-pull-16{position:relative;right:66.66667%}.el-col-lg-push-16{position:relative;left:66.66667%}.el-col-lg-17{width:70.83333%}.el-col-lg-offset-17{margin-left:70.83333%}.el-col-lg-pull-17{position:relative;right:70.83333%}.el-col-lg-push-17{position:relative;left:70.83333%}.el-col-lg-18{width:75%}.el-col-lg-offset-18{margin-left:75%}.el-col-lg-pull-18{position:relative;right:75%}.el-col-lg-push-18{position:relative;left:75%}.el-col-lg-19{width:79.16667%}.el-col-lg-offset-19{margin-left:79.16667%}.el-col-lg-pull-19{position:relative;right:79.16667%}.el-col-lg-push-19{position:relative;left:79.16667%}.el-col-lg-20{width:83.33333%}.el-col-lg-offset-20{margin-left:83.33333%}.el-col-lg-pull-20{position:relative;right:83.33333%}.el-col-lg-push-20{position:relative;left:83.33333%}.el-col-lg-21{width:87.5%}.el-col-lg-offset-21{margin-left:87.5%}.el-col-lg-pull-21{position:relative;right:87.5%}.el-col-lg-push-21{position:relative;left:87.5%}.el-col-lg-22{width:91.66667%}.el-col-lg-offset-22{margin-left:91.66667%}.el-col-lg-pull-22{position:relative;right:91.66667%}.el-col-lg-push-22{position:relative;left:91.66667%}.el-col-lg-23{width:95.83333%}.el-col-lg-offset-23{margin-left:95.83333%}.el-col-lg-pull-23{position:relative;right:95.83333%}.el-col-lg-push-23{position:relative;left:95.83333%}.el-col-lg-24{width:100%}.el-col-lg-offset-24{margin-left:100%}.el-col-lg-pull-24{position:relative;right:100%}.el-col-lg-push-24{position:relative;left:100%}}@media only screen and (min-width:1920px){.el-col-xl-0{display:none;width:0%}.el-col-xl-offset-0{margin-left:0}.el-col-xl-pull-0{position:relative;right:0}.el-col-xl-push-0{position:relative;left:0}.el-col-xl-1{width:4.16667%}.el-col-xl-offset-1{margin-left:4.16667%}.el-col-xl-pull-1{position:relative;right:4.16667%}.el-col-xl-push-1{position:relative;left:4.16667%}.el-col-xl-2{width:8.33333%}.el-col-xl-offset-2{margin-left:8.33333%}.el-col-xl-pull-2{position:relative;right:8.33333%}.el-col-xl-push-2{position:relative;left:8.33333%}.el-col-xl-3{width:12.5%}.el-col-xl-offset-3{margin-left:12.5%}.el-col-xl-pull-3{position:relative;right:12.5%}.el-col-xl-push-3{position:relative;left:12.5%}.el-col-xl-4{width:16.66667%}.el-col-xl-offset-4{margin-left:16.66667%}.el-col-xl-pull-4{position:relative;right:16.66667%}.el-col-xl-push-4{position:relative;left:16.66667%}.el-col-xl-5{width:20.83333%}.el-col-xl-offset-5{margin-left:20.83333%}.el-col-xl-pull-5{position:relative;right:20.83333%}.el-col-xl-push-5{position:relative;left:20.83333%}.el-col-xl-6{width:25%}.el-col-xl-offset-6{margin-left:25%}.el-col-xl-pull-6{position:relative;right:25%}.el-col-xl-push-6{position:relative;left:25%}.el-col-xl-7{width:29.16667%}.el-col-xl-offset-7{margin-left:29.16667%}.el-col-xl-pull-7{position:relative;right:29.16667%}.el-col-xl-push-7{position:relative;left:29.16667%}.el-col-xl-8{width:33.33333%}.el-col-xl-offset-8{margin-left:33.33333%}.el-col-xl-pull-8{position:relative;right:33.33333%}.el-col-xl-push-8{position:relative;left:33.33333%}.el-col-xl-9{width:37.5%}.el-col-xl-offset-9{margin-left:37.5%}.el-col-xl-pull-9{position:relative;right:37.5%}.el-col-xl-push-9{position:relative;left:37.5%}.el-col-xl-10{width:41.66667%}.el-col-xl-offset-10{margin-left:41.66667%}.el-col-xl-pull-10{position:relative;right:41.66667%}.el-col-xl-push-10{position:relative;left:41.66667%}.el-col-xl-11{width:45.83333%}.el-col-xl-offset-11{margin-left:45.83333%}.el-col-xl-pull-11{position:relative;right:45.83333%}.el-col-xl-push-11{position:relative;left:45.83333%}.el-col-xl-12{width:50%}.el-col-xl-offset-12{margin-left:50%}.el-col-xl-pull-12{position:relative;right:50%}.el-col-xl-push-12{position:relative;left:50%}.el-col-xl-13{width:54.16667%}.el-col-xl-offset-13{margin-left:54.16667%}.el-col-xl-pull-13{position:relative;right:54.16667%}.el-col-xl-push-13{position:relative;left:54.16667%}.el-col-xl-14{width:58.33333%}.el-col-xl-offset-14{margin-left:58.33333%}.el-col-xl-pull-14{position:relative;right:58.33333%}.el-col-xl-push-14{position:relative;left:58.33333%}.el-col-xl-15{width:62.5%}.el-col-xl-offset-15{margin-left:62.5%}.el-col-xl-pull-15{position:relative;right:62.5%}.el-col-xl-push-15{position:relative;left:62.5%}.el-col-xl-16{width:66.66667%}.el-col-xl-offset-16{margin-left:66.66667%}.el-col-xl-pull-16{position:relative;right:66.66667%}.el-col-xl-push-16{position:relative;left:66.66667%}.el-col-xl-17{width:70.83333%}.el-col-xl-offset-17{margin-left:70.83333%}.el-col-xl-pull-17{position:relative;right:70.83333%}.el-col-xl-push-17{position:relative;left:70.83333%}.el-col-xl-18{width:75%}.el-col-xl-offset-18{margin-left:75%}.el-col-xl-pull-18{position:relative;right:75%}.el-col-xl-push-18{position:relative;left:75%}.el-col-xl-19{width:79.16667%}.el-col-xl-offset-19{margin-left:79.16667%}.el-col-xl-pull-19{position:relative;right:79.16667%}.el-col-xl-push-19{position:relative;left:79.16667%}.el-col-xl-20{width:83.33333%}.el-col-xl-offset-20{margin-left:83.33333%}.el-col-xl-pull-20{position:relative;right:83.33333%}.el-col-xl-push-20{position:relative;left:83.33333%}.el-col-xl-21{width:87.5%}.el-col-xl-offset-21{margin-left:87.5%}.el-col-xl-pull-21{position:relative;right:87.5%}.el-col-xl-push-21{position:relative;left:87.5%}.el-col-xl-22{width:91.66667%}.el-col-xl-offset-22{margin-left:91.66667%}.el-col-xl-pull-22{position:relative;right:91.66667%}.el-col-xl-push-22{position:relative;left:91.66667%}.el-col-xl-23{width:95.83333%}.el-col-xl-offset-23{margin-left:95.83333%}.el-col-xl-pull-23{position:relative;right:95.83333%}.el-col-xl-push-23{position:relative;left:95.83333%}.el-col-xl-24{width:100%}.el-col-xl-offset-24{margin-left:100%}.el-col-xl-pull-24{position:relative;right:100%}.el-col-xl-push-24{position:relative;left:100%}}@-webkit-keyframes progress{0%{background-position:0 0}100%{background-position:32px 0}}.el-upload{display:inline-block;text-align:center;cursor:pointer;outline:0}.el-upload__input{display:none}.el-upload__tip{font-size:12px;color:#606266;margin-top:7px}.el-upload iframe{position:absolute;z-index:-1;top:0;left:0;opacity:0}.el-upload--picture-card{background-color:#fbfdff;border:1px dashed #c0ccda;border-radius:6px;box-sizing:border-box;width:148px;height:148px;line-height:146px;vertical-align:top}.el-upload--picture-card i{font-size:28px;color:#8c939d}.el-upload--picture-card:hover,.el-upload:focus{border-color:#409eff;color:#409eff}.el-upload:focus .el-upload-dragger{border-color:#409eff}.el-upload-dragger{background-color:#fff;border:1px dashed #d9d9d9;border-radius:6px;box-sizing:border-box;width:360px;height:180px;text-align:center;position:relative;overflow:hidden}.el-upload-dragger .el-icon-upload{font-size:67px;color:#c0c4cc;margin:40px 0 16px;line-height:50px}.el-upload-dragger+.el-upload__tip{text-align:center}.el-upload-dragger~.el-upload__files{border-top:1px solid #dcdfe6;margin-top:7px;padding-top:5px}.el-upload-dragger .el-upload__text{color:#606266;font-size:14px;text-align:center}.el-upload-dragger .el-upload__text em{color:#409eff;font-style:normal}.el-upload-dragger:hover{border-color:#409eff}.el-upload-dragger.is-dragover{background-color:rgba(32,159,255,.06);border:2px dashed #409eff}.el-upload-list{margin:0;padding:0;list-style:none}.el-upload-list__item{-webkit-transition:all .5s cubic-bezier(.55,0,.1,1);transition:all .5s cubic-bezier(.55,0,.1,1);font-size:14px;color:#606266;line-height:1.8;margin-top:5px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;width:100%}.el-upload-list__item .el-progress{position:absolute;top:20px;width:100%}.el-upload-list__item .el-progress__text{position:absolute;right:0;top:-13px}.el-upload-list__item .el-progress-bar{margin-right:0;padding-right:0}.el-upload-list__item:first-child{margin-top:10px}.el-upload-list__item .el-icon-upload-success{color:#67c23a}.el-upload-list__item .el-icon-close{display:none;position:absolute;top:5px;right:5px;cursor:pointer;opacity:.75;color:#606266}.el-upload-list__item .el-icon-close:hover{opacity:1}.el-upload-list__item .el-icon-close-tip{display:none;position:absolute;top:5px;right:5px;font-size:12px;cursor:pointer;opacity:1;color:#409eff}.el-upload-list__item:hover{background-color:#f5f7fa}.el-upload-list__item:hover .el-icon-close{display:inline-block}.el-upload-list__item:hover .el-progress__text{display:none}.el-upload-list__item.is-success .el-upload-list__item-status-label{display:block}.el-upload-list__item.is-success .el-upload-list__item-name:focus,.el-upload-list__item.is-success .el-upload-list__item-name:hover{color:#409eff;cursor:pointer}.el-upload-list__item.is-success:focus:not(:hover) .el-icon-close-tip{display:inline-block}.el-upload-list__item.is-success:active .el-icon-close-tip,.el-upload-list__item.is-success:focus .el-upload-list__item-status-label,.el-upload-list__item.is-success:hover .el-upload-list__item-status-label,.el-upload-list__item.is-success:not(.focusing):focus .el-icon-close-tip{display:none}.el-upload-list.is-disabled .el-upload-list__item:hover .el-upload-list__item-status-label{display:block}.el-upload-list__item-name{color:#606266;display:block;margin-right:40px;overflow:hidden;padding-left:4px;text-overflow:ellipsis;-webkit-transition:color .3s;transition:color .3s;white-space:nowrap}.el-upload-list__item-name [class^=el-icon]{height:100%;margin-right:7px;color:#909399;line-height:inherit}.el-upload-list__item-status-label{position:absolute;right:5px;top:0;line-height:inherit;display:none}.el-upload-list__item-delete{position:absolute;right:10px;top:0;font-size:12px;color:#606266;display:none}.el-upload-list__item-delete:hover{color:#409eff}.el-upload-list--picture-card{margin:0;display:inline;vertical-align:top}.el-upload-list--picture-card .el-upload-list__item{overflow:hidden;background-color:#fff;border:1px solid #c0ccda;border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;width:148px;height:148px;margin:0 8px 8px 0;display:inline-block}.el-upload-list--picture-card .el-upload-list__item .el-icon-check,.el-upload-list--picture-card .el-upload-list__item .el-icon-circle-check{color:#fff}.el-upload-list--picture-card .el-upload-list__item .el-icon-close,.el-upload-list--picture-card .el-upload-list__item:hover .el-upload-list__item-status-label{display:none}.el-upload-list--picture-card .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture-card .el-upload-list__item-name{display:none}.el-upload-list--picture-card .el-upload-list__item-thumbnail{width:100%;height:100%}.el-upload-list--picture-card .el-upload-list__item-status-label{position:absolute;right:-15px;top:-6px;width:40px;height:24px;background:#13ce66;text-align:center;-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-shadow:0 0 1pc 1px rgba(0,0,0,.2);box-shadow:0 0 1pc 1px rgba(0,0,0,.2)}.el-upload-list--picture-card .el-upload-list__item-status-label i{font-size:12px;margin-top:11px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.el-upload-list--picture-card .el-upload-list__item-actions{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;text-align:center;color:#fff;opacity:0;font-size:20px;background-color:rgba(0,0,0,.5);-webkit-transition:opacity .3s;transition:opacity .3s}.el-upload-list--picture-card .el-upload-list__item-actions::after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-upload-list--picture-card .el-upload-list__item-actions span{display:none;cursor:pointer}.el-upload-list--picture-card .el-upload-list__item-actions span+span{margin-left:15px}.el-upload-list--picture-card .el-upload-list__item-actions .el-upload-list__item-delete{position:static;font-size:inherit;color:inherit}.el-upload-list--picture-card .el-upload-list__item-actions:hover{opacity:1}.el-upload-list--picture-card .el-upload-list__item-actions:hover span{display:inline-block}.el-upload-list--picture-card .el-progress{top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);bottom:auto;width:126px}.el-upload-list--picture-card .el-progress .el-progress__text{top:50%}.el-upload-list--picture .el-upload-list__item{overflow:hidden;z-index:0;background-color:#fff;border:1px solid #c0ccda;border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;margin-top:10px;padding:10px 10px 10px 90px;height:92px}.el-upload-list--picture .el-upload-list__item .el-icon-check,.el-upload-list--picture .el-upload-list__item .el-icon-circle-check{color:#fff}.el-upload-list--picture .el-upload-list__item:hover .el-upload-list__item-status-label{background:0 0;-webkit-box-shadow:none;box-shadow:none;top:-2px;right:-12px}.el-upload-list--picture .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name{line-height:70px;margin-top:0}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name i{display:none}.el-upload-list--picture .el-upload-list__item-thumbnail{vertical-align:middle;display:inline-block;width:70px;height:70px;float:left;position:relative;z-index:1;margin-left:-80px;background-color:#fff}.el-upload-list--picture .el-upload-list__item-name{display:block;margin-top:20px}.el-upload-list--picture .el-upload-list__item-name i{font-size:70px;line-height:1;position:absolute;left:9px;top:10px}.el-upload-list--picture .el-upload-list__item-status-label{position:absolute;right:-17px;top:-7px;width:46px;height:26px;background:#13ce66;text-align:center;-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-shadow:0 1px 1px #ccc;box-shadow:0 1px 1px #ccc}.el-upload-list--picture .el-upload-list__item-status-label i{font-size:12px;margin-top:12px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.el-upload-list--picture .el-progress{position:relative;top:-7px}.el-upload-cover{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;z-index:10;cursor:default}.el-upload-cover::after{display:inline-block;height:100%;vertical-align:middle}.el-upload-cover img{display:block;width:100%;height:100%}.el-upload-cover__label{position:absolute;right:-15px;top:-6px;width:40px;height:24px;background:#13ce66;text-align:center;-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-shadow:0 0 1pc 1px rgba(0,0,0,.2);box-shadow:0 0 1pc 1px rgba(0,0,0,.2)}.el-upload-cover__label i{font-size:12px;margin-top:11px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);color:#fff}.el-upload-cover__progress{display:inline-block;vertical-align:middle;position:static;width:243px}.el-upload-cover__progress+.el-upload__inner{opacity:0}.el-upload-cover__content{position:absolute;top:0;left:0;width:100%;height:100%}.el-upload-cover__interact{position:absolute;bottom:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.72);text-align:center}.el-upload-cover__interact .btn{display:inline-block;color:#fff;font-size:14px;cursor:pointer;vertical-align:middle;-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);margin-top:60px}.el-upload-cover__interact .btn span{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.el-upload-cover__interact .btn:not(:first-child){margin-left:35px}.el-upload-cover__interact .btn:hover{-webkit-transform:translateY(-13px);transform:translateY(-13px)}.el-upload-cover__interact .btn:hover span{opacity:1}.el-upload-cover__interact .btn i{color:#fff;display:block;font-size:24px;line-height:inherit;margin:0 auto 5px}.el-upload-cover__title{position:absolute;bottom:0;left:0;background-color:#fff;height:36px;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400;text-align:left;padding:0 10px;margin:0;line-height:36px;font-size:14px;color:#303133}.el-upload-cover+.el-upload__inner{opacity:0;position:relative;z-index:1}.el-progress{position:relative;line-height:1}.el-progress__text{font-size:14px;color:#606266;display:inline-block;vertical-align:middle;margin-left:10px;line-height:1}.el-progress__text i{vertical-align:middle;display:block}.el-progress--circle,.el-progress--dashboard{display:inline-block}.el-progress--circle .el-progress__text,.el-progress--dashboard .el-progress__text{position:absolute;top:50%;left:0;width:100%;text-align:center;margin:0;-webkit-transform:translate(0,-50%);transform:translate(0,-50%)}.el-progress--circle .el-progress__text i,.el-progress--dashboard .el-progress__text i{vertical-align:middle;display:inline-block}.el-progress--without-text .el-progress__text{display:none}.el-progress--without-text .el-progress-bar{padding-right:0;margin-right:0;display:block}.el-progress-bar,.el-progress-bar__inner::after,.el-progress-bar__innerText,.el-spinner{display:inline-block;vertical-align:middle}.el-progress--text-inside .el-progress-bar{padding-right:0;margin-right:0}.el-progress.is-success .el-progress-bar__inner{background-color:#67c23a}.el-progress.is-success .el-progress__text{color:#67c23a}.el-progress.is-warning .el-progress-bar__inner{background-color:#e6a23c}.el-progress.is-warning .el-progress__text{color:#e6a23c}.el-progress.is-exception .el-progress-bar__inner{background-color:#f56c6c}.el-progress.is-exception .el-progress__text{color:#f56c6c}.el-progress-bar{padding-right:50px;width:100%;margin-right:-55px;-webkit-box-sizing:border-box;box-sizing:border-box}.el-progress-bar__outer{height:6px;border-radius:100px;background-color:#ebeef5;overflow:hidden;position:relative;vertical-align:middle}.el-progress-bar__inner{position:absolute;left:0;top:0;height:100%;background-color:#409eff;text-align:right;border-radius:100px;line-height:1;white-space:nowrap;-webkit-transition:width .6s ease;transition:width .6s ease}.el-card,.el-message{border-radius:4px;overflow:hidden}.el-progress-bar__inner::after{height:100%}.el-progress-bar__innerText{color:#fff;font-size:12px;margin:0 5px}@keyframes progress{0%{background-position:0 0}100%{background-position:32px 0}}.el-time-spinner{width:100%;white-space:nowrap}.el-spinner-inner{-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite;width:50px;height:50px}.el-spinner-inner .path{stroke:#ececec;stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}.el-message{min-width:380px;-webkit-box-sizing:border-box;box-sizing:border-box;border-width:1px;border-style:solid;border-color:#ebeef5;position:fixed;left:50%;top:20px;-webkit-transform:translateX(-50%);transform:translateX(-50%);background-color:#edf2fc;-webkit-transition:opacity .3s,top .4s,-webkit-transform .4s;transition:opacity .3s,top .4s,-webkit-transform .4s;transition:opacity .3s,transform .4s,top .4s;transition:opacity .3s,transform .4s,top .4s,-webkit-transform .4s;padding:15px 15px 15px 20px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-message.is-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-message.is-closable .el-message__content{padding-right:16px}.el-message p{margin:0}.el-message--info .el-message__content{color:#909399}.el-message--success{background-color:#f0f9eb;border-color:#e1f3d8}.el-message--success .el-message__content{color:#67c23a}.el-message--warning{background-color:#fdf6ec;border-color:#faecd8}.el-message--warning .el-message__content{color:#e6a23c}.el-message--error{background-color:#fef0f0;border-color:#fde2e2}.el-message--error .el-message__content{color:#f56c6c}.el-message__icon{margin-right:10px}.el-message__content{padding:0;font-size:14px;line-height:1}.el-message__closeBtn{position:absolute;top:50%;right:15px;-webkit-transform:translateY(-50%);transform:translateY(-50%);cursor:pointer;color:#c0c4cc;font-size:16px}.el-message__closeBtn:hover{color:#909399}.el-message .el-icon-success{color:#67c23a}.el-message .el-icon-error{color:#f56c6c}.el-message .el-icon-info{color:#909399}.el-message .el-icon-warning{color:#e6a23c}.el-message-fade-enter,.el-message-fade-leave-active{opacity:0;-webkit-transform:translate(-50%,-100%);transform:translate(-50%,-100%)}.el-badge{position:relative;vertical-align:middle;display:inline-block}.el-badge__content{background-color:#f56c6c;border-radius:10px;color:#fff;display:inline-block;font-size:12px;height:18px;line-height:18px;padding:0 6px;text-align:center;white-space:nowrap;border:1px solid #fff}.el-badge__content.is-fixed{position:absolute;top:0;right:10px;-webkit-transform:translateY(-50%) translateX(100%);transform:translateY(-50%) translateX(100%)}.el-rate__icon,.el-rate__item{position:relative;display:inline-block}.el-badge__content.is-fixed.is-dot{right:5px}.el-badge__content.is-dot{height:8px;width:8px;padding:0;right:0;border-radius:50%}.el-badge__content--primary{background-color:#409eff}.el-badge__content--success{background-color:#67c23a}.el-badge__content--warning{background-color:#e6a23c}.el-badge__content--info{background-color:#909399}.el-badge__content--danger{background-color:#f56c6c}.el-card{border:1px solid #ebeef5;background-color:#fff;color:#303133;-webkit-transition:.3s;transition:.3s}.el-card.is-always-shadow,.el-card.is-hover-shadow:focus,.el-card.is-hover-shadow:hover{-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-card__header{padding:18px 20px;border-bottom:1px solid #ebeef5;-webkit-box-sizing:border-box;box-sizing:border-box}.el-card__body{padding:20px}.el-rate{height:20px;line-height:1}.el-rate__item{font-size:0;vertical-align:middle}.el-rate__icon{font-size:18px;margin-right:6px;color:#c0c4cc;-webkit-transition:.3s;transition:.3s}.el-rate__decimal,.el-rate__icon .path2{position:absolute;top:0;left:0}.el-rate__icon.hover{-webkit-transform:scale(1.15);transform:scale(1.15)}.el-rate__decimal{display:inline-block;overflow:hidden}.el-step.is-vertical,.el-steps{display:-webkit-box;display:-ms-flexbox}.el-rate__text{font-size:14px;vertical-align:middle}.el-steps{display:flex}.el-steps--simple{padding:13px 8%;border-radius:4px;background:#f5f7fa}.el-steps--horizontal{white-space:nowrap}.el-steps--vertical{height:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-flow:column;flex-flow:column}.el-step{position:relative;-ms-flex-negative:1;flex-shrink:1}.el-step:last-of-type .el-step__line{display:none}.el-step:last-of-type.is-flex{-ms-flex-preferred-size:auto!important;flex-basis:auto!important;-ms-flex-negative:0;flex-shrink:0;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0}.el-step:last-of-type .el-step__description,.el-step:last-of-type .el-step__main{padding-right:0}.el-step__head{position:relative;width:100%}.el-step__head.is-process{color:#303133;border-color:#303133}.el-step__head.is-wait{color:#c0c4cc;border-color:#c0c4cc}.el-step__head.is-success{color:#67c23a;border-color:#67c23a}.el-step__head.is-error{color:#f56c6c;border-color:#f56c6c}.el-step__head.is-finish{color:#409eff;border-color:#409eff}.el-step__icon{position:relative;z-index:1;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:24px;height:24px;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;background:#fff;-webkit-transition:.15s ease-out;transition:.15s ease-out}.el-step__icon.is-text{border-radius:50%;border:2px solid;border-color:inherit}.el-step__icon.is-icon{width:40px}.el-step__icon-inner{display:inline-block;user-select:none;text-align:center;font-weight:700;line-height:1;color:inherit}.el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:25px;font-weight:400}.el-step__icon-inner.is-status{-webkit-transform:translateY(1px);transform:translateY(1px)}.el-step__line{position:absolute;border-color:inherit;background-color:#c0c4cc}.el-step__line-inner{display:block;border-width:1px;border-style:solid;border-color:inherit;-webkit-transition:.15s ease-out;transition:.15s ease-out;-webkit-box-sizing:border-box;box-sizing:border-box;width:0;height:0}.el-step__main{white-space:normal;text-align:left}.el-step__title{font-size:16px;line-height:38px}.el-step__title.is-process{font-weight:700;color:#303133}.el-step__title.is-wait{color:#c0c4cc}.el-step__title.is-success{color:#67c23a}.el-step__title.is-error{color:#f56c6c}.el-step__title.is-finish{color:#409eff}.el-step__description{padding-right:10%;margin-top:-5px;font-size:12px;line-height:20px;font-weight:400}.el-step__description.is-process{color:#303133}.el-step__description.is-wait{color:#c0c4cc}.el-step__description.is-success{color:#67c23a}.el-step__description.is-error{color:#f56c6c}.el-step__description.is-finish{color:#409eff}.el-step.is-horizontal{display:inline-block}.el-step.is-horizontal .el-step__line{height:2px;top:11px;left:0;right:0}.el-step.is-vertical{display:flex}.el-step.is-vertical .el-step__head{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;width:24px}.el-step.is-vertical .el-step__main{padding-left:10px;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.el-step.is-vertical .el-step__title{line-height:24px;padding-bottom:8px}.el-step.is-vertical .el-step__line{width:2px;top:0;bottom:0;left:11px}.el-step.is-vertical .el-step__icon.is-icon{width:24px}.el-step.is-center .el-step__head,.el-step.is-center .el-step__main{text-align:center}.el-step.is-center .el-step__description{padding-left:20%;padding-right:20%}.el-step.is-center .el-step__line{left:50%;right:-50%}.el-step.is-simple{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-step.is-simple .el-step__head{width:auto;font-size:0;padding-right:10px}.el-step.is-simple .el-step__icon{background:0 0;width:16px;height:16px;font-size:12px}.el-step.is-simple .el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:18px}.el-step.is-simple .el-step__icon-inner.is-status{-webkit-transform:scale(.8) translateY(1px);transform:scale(.8) translateY(1px)}.el-step.is-simple .el-step__main{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.el-step.is-simple .el-step__title{font-size:16px;line-height:20px}.el-step.is-simple:not(:last-of-type) .el-step__title{max-width:50%;word-break:break-all}.el-step.is-simple .el-step__arrow{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-step.is-simple .el-step__arrow::after,.el-step.is-simple .el-step__arrow::before{content:'';display:inline-block;position:absolute;height:15px;width:1px;background:#c0c4cc}.el-step.is-simple .el-step__arrow::before{-webkit-transform:rotate(-45deg) translateY(-4px);transform:rotate(-45deg) translateY(-4px);-webkit-transform-origin:0 0;transform-origin:0 0}.el-step.is-simple .el-step__arrow::after{-webkit-transform:rotate(45deg) translateY(4px);transform:rotate(45deg) translateY(4px);-webkit-transform-origin:100% 100%;transform-origin:100% 100%}.el-step.is-simple:last-of-type .el-step__arrow{display:none}.el-carousel{position:relative}.el-carousel--horizontal{overflow-x:hidden}.el-carousel--vertical{overflow-y:hidden}.el-carousel__container{position:relative;height:300px}.el-carousel__arrow{border:none;outline:0;padding:0;margin:0;height:36px;width:36px;cursor:pointer;-webkit-transition:.3s;transition:.3s;border-radius:50%;background-color:rgba(31,45,61,.11);color:#fff;position:absolute;top:50%;z-index:10;-webkit-transform:translateY(-50%);transform:translateY(-50%);text-align:center;font-size:12px}.el-carousel__arrow--left{left:16px}.el-carousel__arrow--right{right:16px}.el-carousel__arrow:hover{background-color:rgba(31,45,61,.23)}.el-carousel__arrow i{cursor:pointer}.el-carousel__indicators{position:absolute;list-style:none;margin:0;padding:0;z-index:2}.el-carousel__indicators--horizontal{bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.el-carousel__indicators--vertical{right:0;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-carousel__indicators--outside{bottom:26px;text-align:center;position:static;-webkit-transform:none;transform:none}.el-carousel__indicators--outside .el-carousel__indicator:hover button{opacity:.64}.el-carousel__indicators--outside button{background-color:#c0c4cc;opacity:.24}.el-carousel__indicators--labels{left:0;right:0;-webkit-transform:none;transform:none;text-align:center}.el-carousel__indicators--labels .el-carousel__button{height:auto;width:auto;padding:2px 18px;font-size:12px}.el-carousel__indicators--labels .el-carousel__indicator{padding:6px 4px}.el-carousel__indicator{background-color:transparent;cursor:pointer}.el-carousel__indicator:hover button{opacity:.72}.el-carousel__indicator--horizontal{display:inline-block;padding:12px 4px}.el-carousel__indicator--vertical{padding:4px 12px}.el-carousel__indicator--vertical .el-carousel__button{width:2px;height:15px}.el-carousel__indicator.is-active button{opacity:1}.el-carousel__button{display:block;opacity:.48;width:30px;height:2px;background-color:#fff;border:none;outline:0;padding:0;margin:0;cursor:pointer;-webkit-transition:.3s;transition:.3s}.el-carousel__item,.el-carousel__mask{height:100%;top:0;left:0;position:absolute}.carousel-arrow-left-enter,.carousel-arrow-left-leave-active{-webkit-transform:translateY(-50%) translateX(-10px);transform:translateY(-50%) translateX(-10px);opacity:0}.carousel-arrow-right-enter,.carousel-arrow-right-leave-active{-webkit-transform:translateY(-50%) translateX(10px);transform:translateY(-50%) translateX(10px);opacity:0}.el-carousel__item{width:100%;display:inline-block;overflow:hidden;z-index:0}.el-carousel__item.is-active{z-index:2}.el-carousel__item.is-animating{-webkit-transition:-webkit-transform .4s ease-in-out;transition:-webkit-transform .4s ease-in-out;transition:transform .4s ease-in-out;transition:transform .4s ease-in-out,-webkit-transform .4s ease-in-out}.el-carousel__item--card{width:50%;-webkit-transition:-webkit-transform .4s ease-in-out;transition:-webkit-transform .4s ease-in-out;transition:transform .4s ease-in-out;transition:transform .4s ease-in-out,-webkit-transform .4s ease-in-out}.el-carousel__item--card.is-in-stage{cursor:pointer;z-index:1}.el-carousel__item--card.is-in-stage.is-hover .el-carousel__mask,.el-carousel__item--card.is-in-stage:hover .el-carousel__mask{opacity:.12}.el-carousel__item--card.is-active{z-index:2}.el-carousel__mask{width:100%;background-color:#fff;opacity:.24;-webkit-transition:.2s;transition:.2s}.el-fade-in-enter,.el-fade-in-leave-active,.el-fade-in-linear-enter,.el-fade-in-linear-leave,.el-fade-in-linear-leave-active,.fade-in-linear-enter,.fade-in-linear-leave,.fade-in-linear-leave-active{opacity:0}.fade-in-linear-enter-active,.fade-in-linear-leave-active{-webkit-transition:opacity .2s linear;transition:opacity .2s linear}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active{-webkit-transition:opacity .2s linear;transition:opacity .2s linear}.el-fade-in-enter-active,.el-fade-in-leave-active{-webkit-transition:all .3s cubic-bezier(.55,0,.1,1);transition:all .3s cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{-webkit-transition:all .3s cubic-bezier(.55,0,.1,1);transition:all .3s cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter,.el-zoom-in-center-leave-active{opacity:0;-webkit-transform:scaleX(0);transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);-webkit-transform-origin:center top;transform-origin:center top}.el-zoom-in-top-enter,.el-zoom-in-top-leave-active{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);-webkit-transform-origin:center bottom;transform-origin:center bottom}.el-zoom-in-bottom-enter,.el-zoom-in-bottom-leave-active{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;-webkit-transform:scale(1,1);transform:scale(1,1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);-webkit-transform-origin:top left;transform-origin:top left}.el-zoom-in-left-enter,.el-zoom-in-left-leave-active{opacity:0;-webkit-transform:scale(.45,.45);transform:scale(.45,.45)}.collapse-transition{-webkit-transition:.3s height ease-in-out,.3s padding-top ease-in-out,.3s padding-bottom ease-in-out;transition:.3s height ease-in-out,.3s padding-top ease-in-out,.3s padding-bottom ease-in-out}.horizontal-collapse-transition{-webkit-transition:.3s width ease-in-out,.3s padding-left ease-in-out,.3s padding-right ease-in-out;transition:.3s width ease-in-out,.3s padding-left ease-in-out,.3s padding-right ease-in-out}.el-list-enter-active,.el-list-leave-active{-webkit-transition:all 1s;transition:all 1s}.el-list-enter,.el-list-leave-active{opacity:0;-webkit-transform:translateY(-30px);transform:translateY(-30px)}.el-opacity-transition{-webkit-transition:opacity .3s cubic-bezier(.55,0,.1,1);transition:opacity .3s cubic-bezier(.55,0,.1,1)}.el-collapse{border-top:1px solid #ebeef5;border-bottom:1px solid #ebeef5}.el-collapse-item.is-disabled .el-collapse-item__header{color:#bbb;cursor:not-allowed}.el-collapse-item__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:48px;line-height:48px;background-color:#fff;color:#303133;cursor:pointer;border-bottom:1px solid #ebeef5;font-size:13px;font-weight:500;-webkit-transition:border-bottom-color .3s;transition:border-bottom-color .3s;outline:0}.el-collapse-item__arrow{margin:0 8px 0 auto;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;font-weight:300}.el-collapse-item__arrow.is-active{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.el-collapse-item__header.focusing:focus:not(:hover){color:#409eff}.el-collapse-item__header.is-active{border-bottom-color:transparent}.el-collapse-item__wrap{will-change:height;background-color:#fff;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;border-bottom:1px solid #ebeef5}.el-cascader__tags,.el-tag{-webkit-box-sizing:border-box}.el-collapse-item__content{padding-bottom:25px;font-size:13px;color:#303133;line-height:1.769230769230769}.el-collapse-item:last-child{margin-bottom:-1px}.el-popper .popper__arrow,.el-popper .popper__arrow::after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.el-popper .popper__arrow{border-width:6px;-webkit-filter:drop-shadow(0 2px 12px rgba(0, 0, 0, .03));filter:drop-shadow(0 2px 12px rgba(0, 0, 0, .03))}.el-popper .popper__arrow::after{content:" ";border-width:6px}.el-popper[x-placement^=top]{margin-bottom:12px}.el-popper[x-placement^=top] .popper__arrow{bottom:-6px;left:50%;margin-right:3px;border-top-color:#ebeef5;border-bottom-width:0}.el-popper[x-placement^=top] .popper__arrow::after{bottom:1px;margin-left:-6px;border-top-color:#fff;border-bottom-width:0}.el-popper[x-placement^=bottom]{margin-top:12px}.el-popper[x-placement^=bottom] .popper__arrow{top:-6px;left:50%;margin-right:3px;border-top-width:0;border-bottom-color:#ebeef5}.el-popper[x-placement^=bottom] .popper__arrow::after{top:1px;margin-left:-6px;border-top-width:0;border-bottom-color:#fff}.el-popper[x-placement^=right]{margin-left:12px}.el-popper[x-placement^=right] .popper__arrow{top:50%;left:-6px;margin-bottom:3px;border-right-color:#ebeef5;border-left-width:0}.el-popper[x-placement^=right] .popper__arrow::after{bottom:-6px;left:1px;border-right-color:#fff;border-left-width:0}.el-popper[x-placement^=left]{margin-right:12px}.el-popper[x-placement^=left] .popper__arrow{top:50%;right:-6px;margin-bottom:3px;border-right-width:0;border-left-color:#ebeef5}.el-popper[x-placement^=left] .popper__arrow::after{right:1px;bottom:-6px;margin-left:-6px;border-right-width:0;border-left-color:#fff}.el-tag{background-color:#ecf5ff;border-color:#d9ecff;display:inline-block;height:32px;padding:0 10px;line-height:30px;font-size:12px;color:#409eff;border-width:1px;border-style:solid;border-radius:4px;box-sizing:border-box;white-space:nowrap}.el-tag.is-hit{border-color:#409eff}.el-tag .el-tag__close{color:#409eff}.el-tag .el-tag__close:hover{color:#fff;background-color:#409eff}.el-tag.el-tag--info{background-color:#f4f4f5;border-color:#e9e9eb;color:#909399}.el-tag.el-tag--info.is-hit{border-color:#909399}.el-tag.el-tag--info .el-tag__close{color:#909399}.el-tag.el-tag--info .el-tag__close:hover{color:#fff;background-color:#909399}.el-tag.el-tag--success{background-color:#f0f9eb;border-color:#e1f3d8;color:#67c23a}.el-tag.el-tag--success.is-hit{border-color:#67c23a}.el-tag.el-tag--success .el-tag__close{color:#67c23a}.el-tag.el-tag--success .el-tag__close:hover{color:#fff;background-color:#67c23a}.el-tag.el-tag--warning{background-color:#fdf6ec;border-color:#faecd8;color:#e6a23c}.el-tag.el-tag--warning.is-hit{border-color:#e6a23c}.el-tag.el-tag--warning .el-tag__close{color:#e6a23c}.el-tag.el-tag--warning .el-tag__close:hover{color:#fff;background-color:#e6a23c}.el-tag.el-tag--danger{background-color:#fef0f0;border-color:#fde2e2;color:#f56c6c}.el-tag.el-tag--danger.is-hit{border-color:#f56c6c}.el-tag.el-tag--danger .el-tag__close{color:#f56c6c}.el-tag.el-tag--danger .el-tag__close:hover{color:#fff;background-color:#f56c6c}.el-tag .el-icon-close{border-radius:50%;text-align:center;position:relative;cursor:pointer;font-size:12px;height:16px;width:16px;line-height:16px;vertical-align:middle;top:-1px;right:-5px}.el-tag .el-icon-close::before{display:block}.el-tag--dark{background-color:#409eff;border-color:#409eff;color:#fff}.el-tag--dark.is-hit{border-color:#409eff}.el-tag--dark .el-tag__close{color:#fff}.el-tag--dark .el-tag__close:hover{color:#fff;background-color:#66b1ff}.el-tag--dark.el-tag--info{background-color:#909399;border-color:#909399;color:#fff}.el-tag--dark.el-tag--info.is-hit{border-color:#909399}.el-tag--dark.el-tag--info .el-tag__close{color:#fff}.el-tag--dark.el-tag--info .el-tag__close:hover{color:#fff;background-color:#a6a9ad}.el-tag--dark.el-tag--success{background-color:#67c23a;border-color:#67c23a;color:#fff}.el-tag--dark.el-tag--success.is-hit{border-color:#67c23a}.el-tag--dark.el-tag--success .el-tag__close{color:#fff}.el-tag--dark.el-tag--success .el-tag__close:hover{color:#fff;background-color:#85ce61}.el-tag--dark.el-tag--warning{background-color:#e6a23c;border-color:#e6a23c;color:#fff}.el-tag--dark.el-tag--warning.is-hit{border-color:#e6a23c}.el-tag--dark.el-tag--warning .el-tag__close{color:#fff}.el-tag--dark.el-tag--warning .el-tag__close:hover{color:#fff;background-color:#ebb563}.el-tag--dark.el-tag--danger{background-color:#f56c6c;border-color:#f56c6c;color:#fff}.el-tag--dark.el-tag--danger.is-hit{border-color:#f56c6c}.el-tag--dark.el-tag--danger .el-tag__close{color:#fff}.el-tag--dark.el-tag--danger .el-tag__close:hover{color:#fff;background-color:#f78989}.el-tag--plain{background-color:#fff;border-color:#b3d8ff;color:#409eff}.el-tag--plain.is-hit{border-color:#409eff}.el-tag--plain .el-tag__close{color:#409eff}.el-tag--plain .el-tag__close:hover{color:#fff;background-color:#409eff}.el-tag--plain.el-tag--info{background-color:#fff;border-color:#d3d4d6;color:#909399}.el-tag--plain.el-tag--info.is-hit{border-color:#909399}.el-tag--plain.el-tag--info .el-tag__close{color:#909399}.el-tag--plain.el-tag--info .el-tag__close:hover{color:#fff;background-color:#909399}.el-tag--plain.el-tag--success{background-color:#fff;border-color:#c2e7b0;color:#67c23a}.el-tag--plain.el-tag--success.is-hit{border-color:#67c23a}.el-tag--plain.el-tag--success .el-tag__close{color:#67c23a}.el-tag--plain.el-tag--success .el-tag__close:hover{color:#fff;background-color:#67c23a}.el-tag--plain.el-tag--warning{background-color:#fff;border-color:#f5dab1;color:#e6a23c}.el-tag--plain.el-tag--warning.is-hit{border-color:#e6a23c}.el-tag--plain.el-tag--warning .el-tag__close{color:#e6a23c}.el-tag--plain.el-tag--warning .el-tag__close:hover{color:#fff;background-color:#e6a23c}.el-tag--plain.el-tag--danger{background-color:#fff;border-color:#fbc4c4;color:#f56c6c}.el-tag--plain.el-tag--danger.is-hit{border-color:#f56c6c}.el-tag--plain.el-tag--danger .el-tag__close{color:#f56c6c}.el-tag--plain.el-tag--danger .el-tag__close:hover{color:#fff;background-color:#f56c6c}.el-tag--medium{height:28px;line-height:26px}.el-tag--medium .el-icon-close{-webkit-transform:scale(.8);transform:scale(.8)}.el-tag--small{height:24px;padding:0 8px;line-height:22px}.el-tag--small .el-icon-close{-webkit-transform:scale(.8);transform:scale(.8)}.el-tag--mini{height:20px;padding:0 5px;line-height:19px}.el-tag--mini .el-icon-close{margin-left:-3px;-webkit-transform:scale(.7);transform:scale(.7)}.el-cascader{display:inline-block;position:relative;font-size:14px;line-height:40px}.el-cascader:not(.is-disabled):hover .el-input__inner{cursor:pointer;border-color:#c0c4cc}.el-cascader .el-input .el-input__inner:focus,.el-cascader .el-input.is-focus .el-input__inner{border-color:#409eff}.el-cascader .el-input{cursor:pointer}.el-cascader .el-input .el-input__inner{text-overflow:ellipsis}.el-cascader .el-input .el-icon-arrow-down{-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;font-size:14px}.el-cascader .el-input .el-icon-arrow-down.is-reverse{-webkit-transform:rotateZ(180deg);transform:rotateZ(180deg)}.el-cascader .el-input .el-icon-circle-close:hover{color:#909399}.el-cascader--medium{font-size:14px;line-height:36px}.el-cascader--small{font-size:13px;line-height:32px}.el-cascader--mini{font-size:12px;line-height:28px}.el-cascader.is-disabled .el-cascader__label{z-index:2;color:#c0c4cc}.el-cascader__dropdown{margin:5px 0;font-size:14px;background:#fff;border:1px solid #e4e7ed;border-radius:4px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-cascader__tags{position:absolute;left:0;right:30px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;line-height:normal;text-align:left;box-sizing:border-box}.el-cascader__tags .el-tag{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:#f0f2f5}.el-cascader__tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__tags .el-tag>span{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__tags .el-tag .el-icon-close{-webkit-box-flex:0;-ms-flex:none;flex:none;background-color:#c0c4cc;color:#fff}.el-cascader__tags .el-tag .el-icon-close:hover{background-color:#909399}.el-cascader__suggestion-panel{border-radius:4px}.el-cascader__suggestion-list{max-height:204px;margin:0;padding:6px 0;font-size:14px;color:#606266;text-align:center}.el-cascader__suggestion-item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:34px;padding:0 15px;text-align:left;outline:0;cursor:pointer}.el-cascader__suggestion-item:focus,.el-cascader__suggestion-item:hover{background:#f5f7fa}.el-cascader__suggestion-item.is-checked{color:#409eff;font-weight:700}.el-cascader__suggestion-item>span{margin-right:10px}.el-cascader__empty-text{margin:10px 0;color:#c0c4cc}.el-cascader__search-input{-webkit-box-flex:1;-ms-flex:1;flex:1;height:24px;min-width:60px;margin:2px 0 2px 15px;padding:0;color:#606266;border:none;outline:0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-cascader__search-input::-webkit-input-placeholder{color:#c0c4cc}.el-cascader__search-input:-ms-input-placeholder{color:#c0c4cc}.el-cascader__search-input::-ms-input-placeholder{color:#c0c4cc}.el-cascader__search-input::placeholder{color:#c0c4cc}.el-color-predefine{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:12px;margin-top:8px;width:280px}.el-color-predefine__colors{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-wrap:wrap;flex-wrap:wrap}.el-color-predefine__color-selector{margin:0 0 8px 8px;width:20px;height:20px;border-radius:4px;cursor:pointer}.el-color-predefine__color-selector:nth-child(10n+1){margin-left:0}.el-color-predefine__color-selector.selected{-webkit-box-shadow:0 0 3px 2px #409eff;box-shadow:0 0 3px 2px #409eff}.el-color-predefine__color-selector>div{display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;border-radius:3px}.el-color-predefine__color-selector.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-hue-slider{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;width:280px;height:12px;background-color:red;padding:0 2px}.el-color-hue-slider__bar{position:relative;background:-webkit-gradient(linear,left top,right top,from(red),color-stop(17%,#ff0),color-stop(33%,#0f0),color-stop(50%,#0ff),color-stop(67%,#00f),color-stop(83%,#f0f),to(red));background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);height:100%}.el-color-hue-slider__thumb{position:absolute;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid #f0f0f0;-webkit-box-shadow:0 0 2px rgba(0,0,0,.6);box-shadow:0 0 2px rgba(0,0,0,.6);z-index:1}.el-color-hue-slider.is-vertical{width:12px;height:180px;padding:2px 0}.el-color-hue-slider.is-vertical .el-color-hue-slider__bar{background:-webkit-gradient(linear,left top,left bottom,from(red),color-stop(17%,#ff0),color-stop(33%,#0f0),color-stop(50%,#0ff),color-stop(67%,#00f),color-stop(83%,#f0f),to(red));background:linear-gradient(to bottom,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}.el-color-hue-slider.is-vertical .el-color-hue-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-svpanel{position:relative;width:280px;height:180px}.el-color-svpanel__black,.el-color-svpanel__white{position:absolute;top:0;left:0;right:0;bottom:0}.el-color-svpanel__white{background:-webkit-gradient(linear,left top,right top,from(#fff),to(rgba(255,255,255,0)));background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.el-color-svpanel__black{background:-webkit-gradient(linear,left bottom,left top,from(#000),to(rgba(0,0,0,0)));background:linear-gradient(to top,#000,rgba(0,0,0,0))}.el-color-svpanel__cursor{position:absolute}.el-color-svpanel__cursor>div{cursor:head;width:4px;height:4px;-webkit-box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);border-radius:50%;-webkit-transform:translate(-2px,-2px);transform:translate(-2px,-2px)}.el-color-alpha-slider{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;width:280px;height:12px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-alpha-slider__bar{position:relative;background:-webkit-gradient(linear,left top,right top,from(rgba(255,255,255,0)),to(white));background:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 100%);height:100%}.el-color-alpha-slider__thumb{position:absolute;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid #f0f0f0;-webkit-box-shadow:0 0 2px rgba(0,0,0,.6);box-shadow:0 0 2px rgba(0,0,0,.6);z-index:1}.el-color-alpha-slider.is-vertical{width:20px;height:180px}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__bar{background:-webkit-gradient(linear,left top,left bottom,from(rgba(255,255,255,0)),to(white));background:linear-gradient(to bottom,rgba(255,255,255,0) 0,#fff 100%)}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-dropdown{width:300px}.el-color-dropdown__main-wrapper{margin-bottom:6px}.el-color-dropdown__main-wrapper::after{content:"";display:table;clear:both}.el-color-dropdown__btns{margin-top:6px;text-align:right}.el-color-dropdown__value{float:left;line-height:26px;font-size:12px;color:#000;width:160px}.el-color-dropdown__btn{border:1px solid #dcdcdc;color:#333;line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:0;font-size:12px}.el-color-dropdown__btn[disabled]{color:#ccc;cursor:not-allowed}.el-color-dropdown__btn:hover{color:#409eff;border-color:#409eff}.el-color-dropdown__link-btn{cursor:pointer;color:#409eff;text-decoration:none;padding:15px;font-size:12px}.el-color-dropdown__link-btn:hover{color:tint(#409eff,20%)}.el-color-picker{display:inline-block;position:relative;line-height:normal;height:40px}.el-color-picker.is-disabled .el-color-picker__trigger{cursor:not-allowed}.el-color-picker--medium{height:36px}.el-color-picker--medium .el-color-picker__trigger{height:36px;width:36px}.el-color-picker--medium .el-color-picker__mask{height:34px;width:34px}.el-color-picker--small{height:32px}.el-color-picker--small .el-color-picker__trigger{height:32px;width:32px}.el-color-picker--small .el-color-picker__mask{height:30px;width:30px}.el-color-picker--small .el-color-picker__empty,.el-color-picker--small .el-color-picker__icon{-webkit-transform:translate3d(-50%,-50%,0) scale(.8);transform:translate3d(-50%,-50%,0) scale(.8)}.el-color-picker--mini{height:28px}.el-color-picker--mini .el-color-picker__trigger{height:28px;width:28px}.el-color-picker--mini .el-color-picker__mask{height:26px;width:26px}.el-color-picker--mini .el-color-picker__empty,.el-color-picker--mini .el-color-picker__icon{-webkit-transform:translate3d(-50%,-50%,0) scale(.8);transform:translate3d(-50%,-50%,0) scale(.8)}.el-color-picker__mask{height:38px;width:38px;border-radius:4px;position:absolute;top:1px;left:1px;z-index:1;cursor:not-allowed;background-color:rgba(255,255,255,.7)}.el-color-picker__trigger{display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;height:40px;width:40px;padding:4px;border:1px solid #e6e6e6;border-radius:4px;font-size:0;position:relative;cursor:pointer}.el-color-picker__color{position:relative;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #999;border-radius:2px;width:100%;height:100%;text-align:center}.el-color-picker__color.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-picker__color-inner{position:absolute;left:0;top:0;right:0;bottom:0}.el-color-picker__empty,.el-color-picker__icon{top:50%;left:50%;font-size:12px;position:absolute}.el-color-picker__empty{color:#999;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0)}.el-color-picker__icon{display:inline-block;width:100%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);color:#fff;text-align:center}.el-color-picker__panel{position:absolute;z-index:10;padding:6px;-webkit-box-sizing:content-box;box-sizing:content-box;background-color:#fff;border:1px solid #ebeef5;border-radius:4px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-textarea{position:relative;display:inline-block;width:100%;vertical-align:bottom;font-size:14px}.el-textarea__inner{display:block;resize:vertical;padding:5px 15px;line-height:1.5;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;font-size:inherit;color:#606266;background-color:#fff;background-image:none;border:1px solid #dcdfe6;border-radius:4px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.el-textarea__inner::-webkit-input-placeholder{color:#c0c4cc}.el-textarea__inner:-ms-input-placeholder{color:#c0c4cc}.el-textarea__inner::-ms-input-placeholder{color:#c0c4cc}.el-textarea__inner::placeholder{color:#c0c4cc}.el-textarea__inner:hover{border-color:#c0c4cc}.el-textarea__inner:focus{outline:0;border-color:#409eff}.el-textarea .el-input__count{color:#909399;background:#fff;position:absolute;font-size:12px;bottom:5px;right:10px}.el-textarea.is-disabled .el-textarea__inner{background-color:#f5f7fa;border-color:#e4e7ed;color:#c0c4cc;cursor:not-allowed}.el-textarea.is-disabled .el-textarea__inner::-webkit-input-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner:-ms-input-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner::-ms-input-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner::placeholder{color:#c0c4cc}.el-textarea.is-exceed .el-textarea__inner{border-color:#f56c6c}.el-textarea.is-exceed .el-input__count{color:#f56c6c}.el-input{position:relative;font-size:14px;display:inline-block;width:100%}.el-input::-webkit-scrollbar{z-index:11;width:6px}.el-input::-webkit-scrollbar:horizontal{height:6px}.el-input::-webkit-scrollbar-thumb{border-radius:5px;width:6px;background:#b4bccc}.el-input::-webkit-scrollbar-corner{background:#fff}.el-input::-webkit-scrollbar-track{background:#fff}.el-input::-webkit-scrollbar-track-piece{background:#fff;width:6px}.el-input .el-input__clear{color:#c0c4cc;font-size:14px;cursor:pointer;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1)}.el-input .el-input__clear:hover{color:#909399}.el-input .el-input__count{height:100%;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#909399;font-size:12px}.el-input .el-input__count .el-input__count-inner{background:#fff;line-height:initial;display:inline-block;padding:0 5px}.el-input__inner{-webkit-appearance:none;background-color:#fff;background-image:none;border-radius:4px;border:1px solid #dcdfe6;-webkit-box-sizing:border-box;box-sizing:border-box;color:#606266;display:inline-block;font-size:inherit;height:40px;line-height:40px;outline:0;padding:0 15px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}.el-input__prefix,.el-input__suffix{position:absolute;top:0;-webkit-transition:all .3s;height:100%;color:#c0c4cc;text-align:center}.el-input__inner::-webkit-input-placeholder{color:#c0c4cc}.el-input__inner:-ms-input-placeholder{color:#c0c4cc}.el-input__inner::-ms-input-placeholder{color:#c0c4cc}.el-input__inner::placeholder{color:#c0c4cc}.el-input__inner:hover{border-color:#c0c4cc}.el-input.is-active .el-input__inner,.el-input__inner:focus{border-color:#409eff;outline:0}.el-input__suffix{right:5px;transition:all .3s}.el-input__suffix-inner{pointer-events:all}.el-input__prefix{left:5px;transition:all .3s}.el-input__icon{height:100%;width:25px;text-align:center;-webkit-transition:all .3s;transition:all .3s;line-height:40px}.el-input__icon:after{content:'';height:100%;width:0;display:inline-block;vertical-align:middle}.el-input__validateIcon{pointer-events:none}.el-input.is-disabled .el-input__inner{background-color:#f5f7fa;border-color:#e4e7ed;color:#c0c4cc;cursor:not-allowed}.el-input.is-disabled .el-input__inner::-webkit-input-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner:-ms-input-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner::-ms-input-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner::placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__icon{cursor:not-allowed}.el-link,.el-transfer-panel__filter .el-icon-circle-close{cursor:pointer}.el-input.is-exceed .el-input__inner{border-color:#f56c6c}.el-input.is-exceed .el-input__suffix .el-input__count{color:#f56c6c}.el-input--suffix .el-input__inner{padding-right:30px}.el-input--prefix .el-input__inner{padding-left:30px}.el-input--medium{font-size:14px}.el-input--medium .el-input__inner{height:36px;line-height:36px}.el-input--medium .el-input__icon{line-height:36px}.el-input--small{font-size:13px}.el-input--small .el-input__inner{height:32px;line-height:32px}.el-input--small .el-input__icon{line-height:32px}.el-input--mini{font-size:12px}.el-input--mini .el-input__inner{height:28px;line-height:28px}.el-input--mini .el-input__icon{line-height:28px}.el-input-group{line-height:normal;display:inline-table;width:100%;border-collapse:separate;border-spacing:0}.el-input-group>.el-input__inner{vertical-align:middle;display:table-cell}.el-input-group__append,.el-input-group__prepend{background-color:#f5f7fa;color:#909399;vertical-align:middle;display:table-cell;position:relative;border:1px solid #dcdfe6;border-radius:4px;padding:0 20px;width:1px;white-space:nowrap}.el-input-group--prepend .el-input__inner,.el-input-group__append{border-top-left-radius:0;border-bottom-left-radius:0}.el-input-group--append .el-input__inner,.el-input-group__prepend{border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group__append:focus,.el-input-group__prepend:focus{outline:0}.el-input-group__append .el-button,.el-input-group__append .el-select,.el-input-group__prepend .el-button,.el-input-group__prepend .el-select{display:inline-block;margin:-10px -20px}.el-input-group__append button.el-button,.el-input-group__append div.el-select .el-input__inner,.el-input-group__append div.el-select:hover .el-input__inner,.el-input-group__prepend button.el-button,.el-input-group__prepend div.el-select .el-input__inner,.el-input-group__prepend div.el-select:hover .el-input__inner{border-color:transparent;background-color:transparent;color:inherit;border-top:0;border-bottom:0}.el-input-group__append .el-button,.el-input-group__append .el-input,.el-input-group__prepend .el-button,.el-input-group__prepend .el-input{font-size:inherit}.el-input-group__prepend{border-right:0}.el-input-group__append{border-left:0}.el-input-group--append .el-select .el-input.is-focus .el-input__inner,.el-input-group--prepend .el-select .el-input.is-focus .el-input__inner{border-color:transparent}.el-input__inner::-ms-clear{display:none;width:0;height:0}.el-transfer{font-size:14px}.el-transfer__buttons{display:inline-block;vertical-align:middle;padding:0 30px}.el-transfer__button{display:block;margin:0 auto;padding:10px;border-radius:50%;color:#fff;background-color:#409eff;font-size:0}.el-transfer-panel__item+.el-transfer-panel__item,.el-transfer__button [class*=el-icon-]+span{margin-left:0}.el-transfer__button.is-with-texts{border-radius:4px}.el-transfer__button.is-disabled,.el-transfer__button.is-disabled:hover{border:1px solid #dcdfe6;background-color:#f5f7fa;color:#c0c4cc}.el-transfer__button:first-child{margin-bottom:10px}.el-transfer__button:nth-child(2){margin:0}.el-transfer__button i,.el-transfer__button span{font-size:14px}.el-transfer-panel{border:1px solid #ebeef5;border-radius:4px;overflow:hidden;background:#fff;display:inline-block;vertical-align:middle;width:200px;max-height:100%;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative}.el-transfer-panel__body{height:246px}.el-transfer-panel__body.is-with-footer{padding-bottom:40px}.el-transfer-panel__list{margin:0;padding:6px 0;list-style:none;height:246px;overflow:auto;-webkit-box-sizing:border-box;box-sizing:border-box}.el-transfer-panel__list.is-filterable{height:194px;padding-top:0}.el-transfer-panel__item{height:30px;line-height:30px;padding-left:15px;display:block!important}.el-transfer-panel__item.el-checkbox{color:#606266}.el-transfer-panel__item:hover{color:#409eff}.el-transfer-panel__item.el-checkbox .el-checkbox__label{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:24px;line-height:30px}.el-transfer-panel__item .el-checkbox__input{position:absolute;top:8px}.el-transfer-panel__filter{text-align:center;margin:15px;-webkit-box-sizing:border-box;box-sizing:border-box;display:block;width:auto}.el-transfer-panel__filter .el-input__inner{height:32px;width:100%;font-size:12px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:16px;padding-right:10px;padding-left:30px}.el-transfer-panel__filter .el-input__icon{margin-left:5px}.el-transfer-panel .el-transfer-panel__header{height:40px;line-height:40px;background:#f5f7fa;margin:0;padding-left:15px;border-bottom:1px solid #ebeef5;-webkit-box-sizing:border-box;box-sizing:border-box;color:#000}.el-transfer-panel .el-transfer-panel__header .el-checkbox{display:block;line-height:40px}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label{font-size:16px;color:#303133;font-weight:400}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label span{position:absolute;right:15px;color:#909399;font-size:12px;font-weight:400}.el-divider__text,.el-link{font-weight:500;font-size:14px}.el-transfer-panel .el-transfer-panel__footer{height:40px;background:#fff;margin:0;padding:0;border-top:1px solid #ebeef5;position:absolute;bottom:0;left:0;width:100%;z-index:1}.el-transfer-panel .el-transfer-panel__footer::after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-container,.el-timeline-item__node{display:-webkit-box;display:-ms-flexbox}.el-transfer-panel .el-transfer-panel__footer .el-checkbox{padding-left:20px;color:#606266}.el-transfer-panel .el-transfer-panel__empty{margin:0;height:30px;line-height:30px;padding:6px 15px 0;color:#909399;text-align:center}.el-transfer-panel .el-checkbox__label{padding-left:8px}.el-transfer-panel .el-checkbox__inner{height:14px;width:14px;border-radius:3px}.el-transfer-panel .el-checkbox__inner::after{height:6px;width:3px;left:4px}.el-container{display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-box-sizing:border-box;box-sizing:border-box;min-width:0}.el-container.is-vertical,.el-drawer{-webkit-box-orient:vertical;-webkit-box-direction:normal}.el-aside,.el-header{-webkit-box-sizing:border-box}.el-container.is-vertical{-ms-flex-direction:column;flex-direction:column}.el-header{padding:0 20px;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0}.el-aside{overflow:auto;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0}.el-footer,.el-main{-webkit-box-sizing:border-box}.el-main{display:block;-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-preferred-size:auto;flex-basis:auto;overflow:auto;box-sizing:border-box;padding:20px}.el-footer{padding:0 20px;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0}.el-timeline{margin:0;font-size:14px;list-style:none}.el-timeline .el-timeline-item:last-child .el-timeline-item__tail{display:none}.el-timeline-item{position:relative;padding-bottom:20px}.el-timeline-item__wrapper{position:relative;padding-left:28px;top:-3px}.el-timeline-item__tail{position:absolute;left:4px;height:100%;border-left:2px solid #e4e7ed}.el-timeline-item__icon{color:#fff;font-size:13px}.el-timeline-item__node{position:absolute;background-color:#e4e7ed;border-radius:50%;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-image__error,.el-timeline-item__dot{display:-webkit-box;display:-ms-flexbox}.el-timeline-item__node--normal{left:-1px;width:12px;height:12px}.el-timeline-item__node--large{left:-2px;width:14px;height:14px}.el-timeline-item__node--primary{background-color:#409eff}.el-timeline-item__node--success{background-color:#67c23a}.el-timeline-item__node--warning{background-color:#e6a23c}.el-timeline-item__node--danger{background-color:#f56c6c}.el-timeline-item__node--info{background-color:#909399}.el-timeline-item__dot{position:absolute;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-timeline-item__content{color:#303133}.el-timeline-item__timestamp{color:#909399;line-height:1;font-size:13px}.el-timeline-item__timestamp.is-top{margin-bottom:8px;padding-top:4px}.el-timeline-item__timestamp.is-bottom{margin-top:8px}.el-link{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;vertical-align:middle;position:relative;text-decoration:none;outline:0;padding:0}.el-link.is-underline:hover:after{content:"";position:absolute;left:0;right:0;height:0;bottom:0;border-bottom:1px solid #409eff}.el-link.el-link--default:after,.el-link.el-link--primary.is-underline:hover:after,.el-link.el-link--primary:after{border-color:#409eff}.el-link.is-disabled{cursor:not-allowed}.el-link [class*=el-icon-]+span{margin-left:5px}.el-link.el-link--default{color:#606266}.el-link.el-link--default:hover{color:#409eff}.el-link.el-link--default.is-disabled{color:#c0c4cc}.el-link.el-link--primary{color:#409eff}.el-link.el-link--primary:hover{color:#66b1ff}.el-link.el-link--primary.is-disabled{color:#a0cfff}.el-link.el-link--danger.is-underline:hover:after,.el-link.el-link--danger:after{border-color:#f56c6c}.el-link.el-link--danger{color:#f56c6c}.el-link.el-link--danger:hover{color:#f78989}.el-link.el-link--danger.is-disabled{color:#fab6b6}.el-link.el-link--success.is-underline:hover:after,.el-link.el-link--success:after{border-color:#67c23a}.el-link.el-link--success{color:#67c23a}.el-link.el-link--success:hover{color:#85ce61}.el-link.el-link--success.is-disabled{color:#b3e19d}.el-link.el-link--warning.is-underline:hover:after,.el-link.el-link--warning:after{border-color:#e6a23c}.el-link.el-link--warning{color:#e6a23c}.el-link.el-link--warning:hover{color:#ebb563}.el-link.el-link--warning.is-disabled{color:#f3d19e}.el-link.el-link--info.is-underline:hover:after,.el-link.el-link--info:after{border-color:#909399}.el-link.el-link--info{color:#909399}.el-link.el-link--info:hover{color:#a6a9ad}.el-link.el-link--info.is-disabled{color:#c8c9cc}.el-divider{background-color:#dcdfe6;position:relative}.el-divider--horizontal{display:block;height:1px;width:100%;margin:24px 0}.el-divider--vertical{display:inline-block;width:1px;height:1em;margin:0 8px;vertical-align:middle;position:relative}.el-divider__text{position:absolute;background-color:#fff;padding:0 20px;color:#303133}.el-image__error,.el-image__placeholder{background:#f5f7fa}.el-divider__text.is-left{left:20px;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-divider__text.is-center{left:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%)}.el-divider__text.is-right{right:20px;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-image__error,.el-image__inner,.el-image__placeholder{width:100%;height:100%}.el-image{position:relative;display:inline-block;overflow:hidden}.el-image__inner{vertical-align:top}.el-image__inner--center{position:relative;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:block}.el-image__error{display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:14px;color:#c0c4cc;vertical-align:middle}.el-image__preview{cursor:pointer}.el-image-viewer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.el-image-viewer__btn{position:absolute;z-index:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:50%;opacity:.8;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;user-select:none}.el-button,.el-checkbox{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.el-image-viewer__close{top:40px;right:40px;width:40px;height:40px;font-size:24px;color:#fff;background-color:#606266}.el-image-viewer__canvas{width:100%;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-image-viewer__actions{left:50%;bottom:30px;-webkit-transform:translateX(-50%);transform:translateX(-50%);width:282px;height:44px;padding:0 23px;background-color:#606266;border-color:#fff;border-radius:22px}.el-image-viewer__actions__inner{width:100%;height:100%;text-align:justify;cursor:default;font-size:23px;color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.el-image-viewer__next,.el-image-viewer__prev{top:50%;width:44px;height:44px;font-size:24px;color:#fff;background-color:#606266;border-color:#fff}.el-image-viewer__prev{-webkit-transform:translateY(-50%);transform:translateY(-50%);left:40px}.el-image-viewer__next{-webkit-transform:translateY(-50%);transform:translateY(-50%);right:40px;text-indent:2px}.el-image-viewer__mask{position:absolute;width:100%;height:100%;top:0;left:0;opacity:.5;background:#000}.viewer-fade-enter-active{-webkit-animation:viewer-fade-in .3s;animation:viewer-fade-in .3s}.viewer-fade-leave-active{-webkit-animation:viewer-fade-out .3s;animation:viewer-fade-out .3s}@-webkit-keyframes viewer-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}100%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}}@keyframes viewer-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}100%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}}@-webkit-keyframes viewer-fade-out{0%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}100%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}@keyframes viewer-fade-out{0%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}100%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}.el-button{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #dcdfe6;color:#606266;-webkit-appearance:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;outline:0;margin:0;-webkit-transition:.1s;transition:.1s;font-weight:500;padding:12px 20px;font-size:14px;border-radius:4px}.el-button+.el-button{margin-left:10px}.el-button:focus,.el-button:hover{color:#409eff;border-color:#c6e2ff;background-color:#ecf5ff}.el-button:active{color:#3a8ee6;border-color:#3a8ee6;outline:0}.el-button::-moz-focus-inner{border:0}.el-button [class*=el-icon-]+span{margin-left:5px}.el-button.is-plain:focus,.el-button.is-plain:hover{background:#fff;border-color:#409eff;color:#409eff}.el-button.is-active,.el-button.is-plain:active{color:#3a8ee6;border-color:#3a8ee6}.el-button.is-plain:active{background:#fff;outline:0}.el-button.is-disabled,.el-button.is-disabled:focus,.el-button.is-disabled:hover{color:#c0c4cc;cursor:not-allowed;background-image:none;background-color:#fff;border-color:#ebeef5}.el-button.is-disabled.el-button--text{background-color:transparent}.el-button.is-disabled.is-plain,.el-button.is-disabled.is-plain:focus,.el-button.is-disabled.is-plain:hover{background-color:#fff;border-color:#ebeef5;color:#c0c4cc}.el-button.is-loading{position:relative;pointer-events:none}.el-button.is-loading:before{pointer-events:none;content:'';position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:inherit;background-color:rgba(255,255,255,.35)}.el-button.is-round{border-radius:20px;padding:12px 23px}.el-button.is-circle{border-radius:50%;padding:12px}.el-button--primary{color:#fff;background-color:#409eff;border-color:#409eff}.el-button--primary:focus,.el-button--primary:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}.el-button--primary.is-active,.el-button--primary:active{background:#3a8ee6;border-color:#3a8ee6;color:#fff}.el-button--primary:active{outline:0}.el-button--primary.is-disabled,.el-button--primary.is-disabled:active,.el-button--primary.is-disabled:focus,.el-button--primary.is-disabled:hover{color:#fff;background-color:#a0cfff;border-color:#a0cfff}.el-button--primary.is-plain{color:#409eff;background:#ecf5ff;border-color:#b3d8ff}.el-button--primary.is-plain:focus,.el-button--primary.is-plain:hover{background:#409eff;border-color:#409eff;color:#fff}.el-button--primary.is-plain:active{background:#3a8ee6;border-color:#3a8ee6;color:#fff;outline:0}.el-button--primary.is-plain.is-disabled,.el-button--primary.is-plain.is-disabled:active,.el-button--primary.is-plain.is-disabled:focus,.el-button--primary.is-plain.is-disabled:hover{color:#8cc5ff;background-color:#ecf5ff;border-color:#d9ecff}.el-button--success{color:#fff;background-color:#67c23a;border-color:#67c23a}.el-button--success:focus,.el-button--success:hover{background:#85ce61;border-color:#85ce61;color:#fff}.el-button--success.is-active,.el-button--success:active{background:#5daf34;border-color:#5daf34;color:#fff}.el-button--success:active{outline:0}.el-button--success.is-disabled,.el-button--success.is-disabled:active,.el-button--success.is-disabled:focus,.el-button--success.is-disabled:hover{color:#fff;background-color:#b3e19d;border-color:#b3e19d}.el-button--success.is-plain{color:#67c23a;background:#f0f9eb;border-color:#c2e7b0}.el-button--success.is-plain:focus,.el-button--success.is-plain:hover{background:#67c23a;border-color:#67c23a;color:#fff}.el-button--success.is-plain:active{background:#5daf34;border-color:#5daf34;color:#fff;outline:0}.el-button--success.is-plain.is-disabled,.el-button--success.is-plain.is-disabled:active,.el-button--success.is-plain.is-disabled:focus,.el-button--success.is-plain.is-disabled:hover{color:#a4da89;background-color:#f0f9eb;border-color:#e1f3d8}.el-button--warning{color:#fff;background-color:#e6a23c;border-color:#e6a23c}.el-button--warning:focus,.el-button--warning:hover{background:#ebb563;border-color:#ebb563;color:#fff}.el-button--warning.is-active,.el-button--warning:active{background:#cf9236;border-color:#cf9236;color:#fff}.el-button--warning:active{outline:0}.el-button--warning.is-disabled,.el-button--warning.is-disabled:active,.el-button--warning.is-disabled:focus,.el-button--warning.is-disabled:hover{color:#fff;background-color:#f3d19e;border-color:#f3d19e}.el-button--warning.is-plain{color:#e6a23c;background:#fdf6ec;border-color:#f5dab1}.el-button--warning.is-plain:focus,.el-button--warning.is-plain:hover{background:#e6a23c;border-color:#e6a23c;color:#fff}.el-button--warning.is-plain:active{background:#cf9236;border-color:#cf9236;color:#fff;outline:0}.el-button--warning.is-plain.is-disabled,.el-button--warning.is-plain.is-disabled:active,.el-button--warning.is-plain.is-disabled:focus,.el-button--warning.is-plain.is-disabled:hover{color:#f0c78a;background-color:#fdf6ec;border-color:#faecd8}.el-button--danger{color:#fff;background-color:#f56c6c;border-color:#f56c6c}.el-button--danger:focus,.el-button--danger:hover{background:#f78989;border-color:#f78989;color:#fff}.el-button--danger.is-active,.el-button--danger:active{background:#dd6161;border-color:#dd6161;color:#fff}.el-button--danger:active{outline:0}.el-button--danger.is-disabled,.el-button--danger.is-disabled:active,.el-button--danger.is-disabled:focus,.el-button--danger.is-disabled:hover{color:#fff;background-color:#fab6b6;border-color:#fab6b6}.el-button--danger.is-plain{color:#f56c6c;background:#fef0f0;border-color:#fbc4c4}.el-button--danger.is-plain:focus,.el-button--danger.is-plain:hover{background:#f56c6c;border-color:#f56c6c;color:#fff}.el-button--danger.is-plain:active{background:#dd6161;border-color:#dd6161;color:#fff;outline:0}.el-button--danger.is-plain.is-disabled,.el-button--danger.is-plain.is-disabled:active,.el-button--danger.is-plain.is-disabled:focus,.el-button--danger.is-plain.is-disabled:hover{color:#f9a7a7;background-color:#fef0f0;border-color:#fde2e2}.el-button--info{color:#fff;background-color:#909399;border-color:#909399}.el-button--info:focus,.el-button--info:hover{background:#a6a9ad;border-color:#a6a9ad;color:#fff}.el-button--info.is-active,.el-button--info:active{background:#82848a;border-color:#82848a;color:#fff}.el-button--info:active{outline:0}.el-button--info.is-disabled,.el-button--info.is-disabled:active,.el-button--info.is-disabled:focus,.el-button--info.is-disabled:hover{color:#fff;background-color:#c8c9cc;border-color:#c8c9cc}.el-button--info.is-plain{color:#909399;background:#f4f4f5;border-color:#d3d4d6}.el-button--info.is-plain:focus,.el-button--info.is-plain:hover{background:#909399;border-color:#909399;color:#fff}.el-button--info.is-plain:active{background:#82848a;border-color:#82848a;color:#fff;outline:0}.el-button--info.is-plain.is-disabled,.el-button--info.is-plain.is-disabled:active,.el-button--info.is-plain.is-disabled:focus,.el-button--info.is-plain.is-disabled:hover{color:#bcbec2;background-color:#f4f4f5;border-color:#e9e9eb}.el-button--text,.el-button--text.is-disabled,.el-button--text.is-disabled:focus,.el-button--text.is-disabled:hover,.el-button--text:active{border-color:transparent}.el-button--medium{padding:10px 20px;font-size:14px;border-radius:4px}.el-button--mini,.el-button--small{font-size:12px;border-radius:3px}.el-button--medium.is-round{padding:10px 20px}.el-button--medium.is-circle{padding:10px}.el-button--small,.el-button--small.is-round{padding:9px 15px}.el-button--small.is-circle{padding:9px}.el-button--mini,.el-button--mini.is-round{padding:7px 15px}.el-button--mini.is-circle{padding:7px}.el-button--text{color:#409eff;background:0 0;padding-left:0;padding-right:0}.el-button--text:focus,.el-button--text:hover{color:#66b1ff;border-color:transparent;background-color:transparent}.el-button--text:active{color:#3a8ee6;background-color:transparent}.el-button-group{display:inline-block;vertical-align:middle}.el-button-group::after,.el-button-group::before{display:table;content:""}.el-button-group::after{clear:both}.el-button-group>.el-button{float:left;position:relative}.el-button-group>.el-button+.el-button{margin-left:0}.el-button-group>.el-button.is-disabled{z-index:1}.el-button-group>.el-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.el-button-group>.el-button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.el-button-group>.el-button:first-child:last-child{border-radius:4px}.el-button-group>.el-button:first-child:last-child.is-round{border-radius:20px}.el-button-group>.el-button:first-child:last-child.is-circle{border-radius:50%}.el-button-group>.el-button:not(:first-child):not(:last-child){border-radius:0}.el-button-group>.el-button:not(:last-child){margin-right:-1px}.el-button-group>.el-button.is-active,.el-button-group>.el-button:active,.el-button-group>.el-button:focus,.el-button-group>.el-button:hover{z-index:1}.el-button-group>.el-dropdown>.el-button{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:rgba(255,255,255,.5)}.el-button-group .el-button--primary:first-child{border-right-color:rgba(255,255,255,.5)}.el-button-group .el-button--primary:last-child{border-left-color:rgba(255,255,255,.5)}.el-button-group .el-button--primary:not(:first-child):not(:last-child){border-left-color:rgba(255,255,255,.5);border-right-color:rgba(255,255,255,.5)}.el-button-group .el-button--success:first-child{border-right-color:rgba(255,255,255,.5)}.el-button-group .el-button--success:last-child{border-left-color:rgba(255,255,255,.5)}.el-button-group .el-button--success:not(:first-child):not(:last-child){border-left-color:rgba(255,255,255,.5);border-right-color:rgba(255,255,255,.5)}.el-button-group .el-button--warning:first-child{border-right-color:rgba(255,255,255,.5)}.el-button-group .el-button--warning:last-child{border-left-color:rgba(255,255,255,.5)}.el-button-group .el-button--warning:not(:first-child):not(:last-child){border-left-color:rgba(255,255,255,.5);border-right-color:rgba(255,255,255,.5)}.el-button-group .el-button--danger:first-child{border-right-color:rgba(255,255,255,.5)}.el-button-group .el-button--danger:last-child{border-left-color:rgba(255,255,255,.5)}.el-button-group .el-button--danger:not(:first-child):not(:last-child){border-left-color:rgba(255,255,255,.5);border-right-color:rgba(255,255,255,.5)}.el-button-group .el-button--info:first-child{border-right-color:rgba(255,255,255,.5)}.el-button-group .el-button--info:last-child{border-left-color:rgba(255,255,255,.5)}.el-button-group .el-button--info:not(:first-child):not(:last-child){border-left-color:rgba(255,255,255,.5);border-right-color:rgba(255,255,255,.5)}.el-calendar{background-color:#fff}.el-calendar__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:12px 20px;border-bottom:1px solid #ebeef5}.el-backtop,.el-page-header{display:-webkit-box;display:-ms-flexbox}.el-calendar__title{color:#000;-ms-flex-item-align:center;align-self:center}.el-calendar__body{padding:12px 20px 35px}.el-calendar-table{table-layout:fixed;width:100%}.el-calendar-table thead th{padding:12px 0;color:#606266;font-weight:400}.el-calendar-table:not(.is-range) td.next,.el-calendar-table:not(.is-range) td.prev{color:#c0c4cc}.el-backtop,.el-calendar-table td.is-today{color:#409eff}.el-calendar-table td{border-bottom:1px solid #ebeef5;border-right:1px solid #ebeef5;vertical-align:top;-webkit-transition:background-color .2s ease;transition:background-color .2s ease}.el-calendar-table td.is-selected{background-color:#f2f8fe}.el-calendar-table tr:first-child td{border-top:1px solid #ebeef5}.el-calendar-table tr td:first-child{border-left:1px solid #ebeef5}.el-calendar-table tr.el-calendar-table__row--hide-border td{border-top:none}.el-calendar-table .el-calendar-day{-webkit-box-sizing:border-box;box-sizing:border-box;padding:8px;height:85px}.el-calendar-table .el-calendar-day:hover{cursor:pointer;background-color:#f2f8fe}.el-backtop{position:fixed;background-color:#fff;width:40px;height:40px;border-radius:50%;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;font-size:20px;-webkit-box-shadow:0 0 6px rgba(0,0,0,.12);box-shadow:0 0 6px rgba(0,0,0,.12);cursor:pointer;z-index:5}.el-backtop:hover{background-color:#f2f6fc}.el-page-header{display:flex;line-height:24px}.el-page-header__left{display:-webkit-box;display:-ms-flexbox;display:flex;cursor:pointer;margin-right:40px;position:relative}.el-page-header__left::after{content:"";position:absolute;width:1px;height:16px;right:-20px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);background-color:#dcdfe6}.el-checkbox,.el-checkbox__input{display:inline-block;position:relative;white-space:nowrap}.el-page-header__left .el-icon-back{font-size:18px;margin-right:6px;-ms-flex-item-align:center;align-self:center}.el-page-header__title{font-size:14px;font-weight:500}.el-page-header__content{font-size:18px;color:#303133}.el-checkbox{color:#606266;font-weight:500;font-size:14px;cursor:pointer;user-select:none;margin-right:30px}.el-checkbox-button__inner,.el-radio{font-weight:500;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.el-checkbox.is-bordered{padding:9px 20px 9px 10px;border-radius:4px;border:1px solid #dcdfe6;-webkit-box-sizing:border-box;box-sizing:border-box;line-height:normal;height:40px}.el-checkbox.is-bordered.is-checked{border-color:#409eff}.el-checkbox.is-bordered.is-disabled{border-color:#ebeef5;cursor:not-allowed}.el-checkbox.is-bordered+.el-checkbox.is-bordered{margin-left:10px}.el-checkbox.is-bordered.el-checkbox--medium{padding:7px 20px 7px 10px;border-radius:4px;height:36px}.el-checkbox.is-bordered.el-checkbox--medium .el-checkbox__label{line-height:17px;font-size:14px}.el-checkbox.is-bordered.el-checkbox--medium .el-checkbox__inner{height:14px;width:14px}.el-checkbox.is-bordered.el-checkbox--small{padding:5px 15px 5px 10px;border-radius:3px;height:32px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__label{line-height:15px;font-size:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner::after{height:6px;width:2px}.el-checkbox.is-bordered.el-checkbox--mini{padding:3px 15px 3px 10px;border-radius:3px;height:28px}.el-checkbox.is-bordered.el-checkbox--mini .el-checkbox__label{line-height:12px;font-size:12px}.el-checkbox.is-bordered.el-checkbox--mini .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--mini .el-checkbox__inner::after{height:6px;width:2px}.el-checkbox__input{cursor:pointer;outline:0;line-height:1;vertical-align:middle}.el-checkbox__input.is-disabled .el-checkbox__inner{background-color:#edf2fc;border-color:#dcdfe6;cursor:not-allowed}.el-checkbox__input.is-disabled .el-checkbox__inner::after{cursor:not-allowed;border-color:#c0c4cc}.el-checkbox__input.is-disabled .el-checkbox__inner+.el-checkbox__label{cursor:not-allowed}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner{background-color:#f2f6fc;border-color:#dcdfe6}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after{border-color:#c0c4cc}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner{background-color:#f2f6fc;border-color:#dcdfe6}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner::before{background-color:#c0c4cc;border-color:#c0c4cc}.el-checkbox__input.is-checked .el-checkbox__inner,.el-checkbox__input.is-indeterminate .el-checkbox__inner{background-color:#409eff;border-color:#409eff}.el-checkbox__input.is-disabled+span.el-checkbox__label{color:#c0c4cc;cursor:not-allowed}.el-checkbox__input.is-checked .el-checkbox__inner::after{-webkit-transform:rotate(45deg) scaleY(1);transform:rotate(45deg) scaleY(1)}.el-checkbox__input.is-checked+.el-checkbox__label{color:#409eff}.el-checkbox__input.is-focus .el-checkbox__inner{border-color:#409eff}.el-checkbox__input.is-indeterminate .el-checkbox__inner::before{content:'';position:absolute;display:block;background-color:#fff;height:2px;-webkit-transform:scale(.5);transform:scale(.5);left:0;right:0;top:5px}.el-checkbox__input.is-indeterminate .el-checkbox__inner::after{display:none}.el-checkbox__inner{display:inline-block;position:relative;border:1px solid #dcdfe6;border-radius:2px;-webkit-box-sizing:border-box;box-sizing:border-box;width:14px;height:14px;background-color:#fff;z-index:1;-webkit-transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46);transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.el-checkbox__inner:hover{border-color:#409eff}.el-checkbox__inner::after{-webkit-box-sizing:content-box;box-sizing:content-box;content:"";border:1px solid #fff;border-left:0;border-top:0;height:7px;left:4px;position:absolute;top:1px;-webkit-transform:rotate(45deg) scaleY(0);transform:rotate(45deg) scaleY(0);width:3px;-webkit-transition:-webkit-transform .15s ease-in .05s;transition:-webkit-transform .15s ease-in .05s;transition:transform .15s ease-in .05s;transition:transform .15s ease-in .05s,-webkit-transform .15s ease-in .05s;-webkit-transform-origin:center;transform-origin:center}.el-checkbox__original{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.el-checkbox-button,.el-checkbox-button__inner{display:inline-block;position:relative}.el-checkbox__label{display:inline-block;padding-left:10px;line-height:19px;font-size:14px}.el-checkbox:last-of-type{margin-right:0}.el-checkbox-button__inner{line-height:1;white-space:nowrap;vertical-align:middle;cursor:pointer;background:#fff;border:1px solid #dcdfe6;border-left:0;color:#606266;-webkit-appearance:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;outline:0;margin:0;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);padding:12px 20px;font-size:14px;border-radius:0}.el-checkbox-button__inner.is-round{padding:12px 20px}.el-checkbox-button__inner:hover{color:#409eff}.el-checkbox-button__inner [class*=el-icon-]{line-height:.9}.el-radio,.el-radio__input{line-height:1;white-space:nowrap;outline:0}.el-checkbox-button__inner [class*=el-icon-]+span{margin-left:5px}.el-checkbox-button__original{opacity:0;outline:0;position:absolute;margin:0;z-index:-1}.el-radio,.el-radio__inner,.el-radio__input{position:relative;display:inline-block}.el-checkbox-button.is-checked .el-checkbox-button__inner{color:#fff;background-color:#409eff;border-color:#409eff;-webkit-box-shadow:-1px 0 0 0 #8cc5ff;box-shadow:-1px 0 0 0 #8cc5ff}.el-checkbox-button.is-checked:first-child .el-checkbox-button__inner{border-left-color:#409eff}.el-checkbox-button.is-disabled .el-checkbox-button__inner{color:#c0c4cc;cursor:not-allowed;background-image:none;background-color:#fff;border-color:#ebeef5;-webkit-box-shadow:none;box-shadow:none}.el-checkbox-button.is-disabled:first-child .el-checkbox-button__inner{border-left-color:#ebeef5}.el-checkbox-button:first-child .el-checkbox-button__inner{border-left:1px solid #dcdfe6;border-radius:4px 0 0 4px;-webkit-box-shadow:none!important;box-shadow:none!important}.el-checkbox-button.is-focus .el-checkbox-button__inner{border-color:#409eff}.el-checkbox-button:last-child .el-checkbox-button__inner{border-radius:0 4px 4px 0}.el-checkbox-button--medium .el-checkbox-button__inner{padding:10px 20px;font-size:14px;border-radius:0}.el-checkbox-button--medium .el-checkbox-button__inner.is-round{padding:10px 20px}.el-checkbox-button--small .el-checkbox-button__inner{padding:9px 15px;font-size:12px;border-radius:0}.el-checkbox-button--small .el-checkbox-button__inner.is-round{padding:9px 15px}.el-checkbox-button--mini .el-checkbox-button__inner{padding:7px 15px;font-size:12px;border-radius:0}.el-checkbox-button--mini .el-checkbox-button__inner.is-round{padding:7px 15px}.el-checkbox-group{font-size:0}.el-radio,.el-radio--medium.is-bordered .el-radio__label{font-size:14px}.el-radio{color:#606266;cursor:pointer;margin-right:30px}.el-cascader-node>.el-radio,.el-radio:last-child{margin-right:0}.el-radio.is-bordered{padding:12px 20px 0 10px;border-radius:4px;border:1px solid #dcdfe6;-webkit-box-sizing:border-box;box-sizing:border-box;height:40px}.el-radio.is-bordered.is-checked{border-color:#409eff}.el-radio.is-bordered.is-disabled{cursor:not-allowed;border-color:#ebeef5}.el-radio__input.is-disabled .el-radio__inner,.el-radio__input.is-disabled.is-checked .el-radio__inner{background-color:#f5f7fa;border-color:#e4e7ed}.el-radio.is-bordered+.el-radio.is-bordered{margin-left:10px}.el-radio--medium.is-bordered{padding:10px 20px 0 10px;border-radius:4px;height:36px}.el-radio--mini.is-bordered .el-radio__label,.el-radio--small.is-bordered .el-radio__label{font-size:12px}.el-radio--medium.is-bordered .el-radio__inner{height:14px;width:14px}.el-radio--small.is-bordered{padding:8px 15px 0 10px;border-radius:3px;height:32px}.el-radio--small.is-bordered .el-radio__inner{height:12px;width:12px}.el-radio--mini.is-bordered{padding:6px 15px 0 10px;border-radius:3px;height:28px}.el-radio--mini.is-bordered .el-radio__inner{height:12px;width:12px}.el-radio__input{cursor:pointer;vertical-align:middle}.el-radio__input.is-disabled .el-radio__inner{cursor:not-allowed}.el-radio__input.is-disabled .el-radio__inner::after{cursor:not-allowed;background-color:#f5f7fa}.el-radio__input.is-disabled .el-radio__inner+.el-radio__label{cursor:not-allowed}.el-radio__input.is-disabled.is-checked .el-radio__inner::after{background-color:#c0c4cc}.el-radio__input.is-disabled+span.el-radio__label{color:#c0c4cc;cursor:not-allowed}.el-radio__input.is-checked .el-radio__inner{border-color:#409eff;background:#409eff}.el-radio__input.is-checked .el-radio__inner::after{-webkit-transform:translate(-50%,-50%) scale(1);transform:translate(-50%,-50%) scale(1)}.el-radio__input.is-checked+.el-radio__label{color:#409eff}.el-radio__input.is-focus .el-radio__inner{border-color:#409eff}.el-radio__inner{border:1px solid #dcdfe6;border-radius:100%;width:14px;height:14px;background-color:#fff;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box}.el-radio__inner:hover{border-color:#409eff}.el-radio__inner::after{width:4px;height:4px;border-radius:100%;background-color:#fff;content:"";position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%) scale(0);transform:translate(-50%,-50%) scale(0);-webkit-transition:-webkit-transform .15s ease-in;transition:-webkit-transform .15s ease-in;transition:transform .15s ease-in;transition:transform .15s ease-in,-webkit-transform .15s ease-in}.el-radio__original{opacity:0;outline:0;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner{-webkit-box-shadow:0 0 2px 2px #409eff;box-shadow:0 0 2px 2px #409eff}.el-radio__label{font-size:14px;padding-left:10px}.el-scrollbar{overflow:hidden;position:relative}.el-scrollbar:active>.el-scrollbar__bar,.el-scrollbar:focus>.el-scrollbar__bar,.el-scrollbar:hover>.el-scrollbar__bar{opacity:1;-webkit-transition:opacity 340ms ease-out;transition:opacity 340ms ease-out}.el-scrollbar__wrap{overflow:scroll;height:100%}.el-scrollbar__wrap--hidden-default{scrollbar-width:none}.el-scrollbar__wrap--hidden-default::-webkit-scrollbar{width:0;height:0}.el-scrollbar__thumb{position:relative;display:block;width:0;height:0;cursor:pointer;border-radius:inherit;background-color:rgba(144,147,153,.3);-webkit-transition:.3s background-color;transition:.3s background-color}.el-scrollbar__thumb:hover{background-color:rgba(144,147,153,.5)}.el-scrollbar__bar{position:absolute;right:2px;bottom:2px;z-index:1;border-radius:4px;opacity:0;-webkit-transition:opacity 120ms ease-out;transition:opacity 120ms ease-out}.el-scrollbar__bar.is-vertical{width:6px;top:2px}.el-scrollbar__bar.is-vertical>div{width:100%}.el-scrollbar__bar.is-horizontal{height:6px;left:2px}.el-scrollbar__bar.is-horizontal>div{height:100%}.el-cascader-panel{display:-webkit-box;display:-ms-flexbox;display:flex;border-radius:4px;font-size:14px}.el-cascader-panel.is-bordered{border:1px solid #e4e7ed;border-radius:4px}.el-cascader-menu{min-width:180px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#606266;border-right:solid 1px #e4e7ed}.el-cascader-menu:last-child{border-right:none}.el-cascader-menu:last-child .el-cascader-node{padding-right:20px}.el-cascader-menu__wrap{height:204px}.el-cascader-menu__list{position:relative;min-height:100%;margin:0;padding:6px 0;list-style:none;-webkit-box-sizing:border-box;box-sizing:border-box}.el-avatar,.el-drawer{-webkit-box-sizing:border-box;overflow:hidden}.el-cascader-menu__hover-zone{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.el-cascader-menu__empty-text{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);text-align:center;color:#c0c4cc}.el-cascader-node{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0 30px 0 20px;height:34px;line-height:34px;outline:0}.el-cascader-node.is-selectable.in-active-path{color:#606266}.el-cascader-node.in-active-path,.el-cascader-node.is-active,.el-cascader-node.is-selectable.in-checked-path{color:#409eff;font-weight:700}.el-cascader-node:not(.is-disabled){cursor:pointer}.el-cascader-node:not(.is-disabled):focus,.el-cascader-node:not(.is-disabled):hover{background:#f5f7fa}.el-cascader-node.is-disabled{color:#c0c4cc;cursor:not-allowed}.el-cascader-node__prefix{position:absolute;left:10px}.el-cascader-node__postfix{position:absolute;right:10px}.el-cascader-node__label{-webkit-box-flex:1;-ms-flex:1;flex:1;padding:0 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-cascader-node>.el-radio .el-radio__label{padding-left:0}.el-avatar{display:inline-block;box-sizing:border-box;text-align:center;color:#fff;background:#c0c4cc;width:40px;height:40px;line-height:40px;font-size:14px}.el-avatar>img{display:block;height:100%;vertical-align:middle}.el-drawer,.el-drawer__header{display:-webkit-box;display:-ms-flexbox}.el-avatar--circle{border-radius:50%}.el-avatar--square{border-radius:4px}.el-avatar--icon{font-size:18px}.el-avatar--large{width:40px;height:40px;line-height:40px}.el-avatar--medium{width:36px;height:36px;line-height:36px}.el-avatar--small{width:28px;height:28px;line-height:28px}.el-drawer.btt,.el-drawer.ttb,.el-drawer__container{left:0;right:0;width:100%}.el-drawer.ltr,.el-drawer.rtl,.el-drawer__container{top:0;bottom:0;height:100%}@-webkit-keyframes el-drawer-fade-in{0%{opacity:0}100%{opacity:1}}@keyframes el-drawer-fade-in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes rtl-drawer-in{0%{-webkit-transform:translate(100%,0);transform:translate(100%,0)}100%{-webkit-transform:translate(0,0);transform:translate(0,0)}}@keyframes rtl-drawer-in{0%{-webkit-transform:translate(100%,0);transform:translate(100%,0)}100%{-webkit-transform:translate(0,0);transform:translate(0,0)}}@-webkit-keyframes rtl-drawer-out{0%{-webkit-transform:translate(0,0);transform:translate(0,0)}100%{-webkit-transform:translate(100%,0);transform:translate(100%,0)}}@keyframes rtl-drawer-out{0%{-webkit-transform:translate(0,0);transform:translate(0,0)}100%{-webkit-transform:translate(100%,0);transform:translate(100%,0)}}@-webkit-keyframes ltr-drawer-in{0%{-webkit-transform:translate(-100%,0);transform:translate(-100%,0)}100%{-webkit-transform:translate(0,0);transform:translate(0,0)}}@keyframes ltr-drawer-in{0%{-webkit-transform:translate(-100%,0);transform:translate(-100%,0)}100%{-webkit-transform:translate(0,0);transform:translate(0,0)}}@-webkit-keyframes ltr-drawer-out{0%{-webkit-transform:translate(0,0);transform:translate(0,0)}100%{-webkit-transform:translate(-100%,0);transform:translate(-100%,0)}}@keyframes ltr-drawer-out{0%{-webkit-transform:translate(0,0);transform:translate(0,0)}100%{-webkit-transform:translate(-100%,0);transform:translate(-100%,0)}}@-webkit-keyframes ttb-drawer-in{0%{-webkit-transform:translate(0,-100%);transform:translate(0,-100%)}100%{-webkit-transform:translate(0,0);transform:translate(0,0)}}@keyframes ttb-drawer-in{0%{-webkit-transform:translate(0,-100%);transform:translate(0,-100%)}100%{-webkit-transform:translate(0,0);transform:translate(0,0)}}@-webkit-keyframes ttb-drawer-out{0%{-webkit-transform:translate(0,0);transform:translate(0,0)}100%{-webkit-transform:translate(0,-100%);transform:translate(0,-100%)}}@keyframes ttb-drawer-out{0%{-webkit-transform:translate(0,0);transform:translate(0,0)}100%{-webkit-transform:translate(0,-100%);transform:translate(0,-100%)}}@-webkit-keyframes btt-drawer-in{0%{-webkit-transform:translate(0,100%);transform:translate(0,100%)}100%{-webkit-transform:translate(0,0);transform:translate(0,0)}}@keyframes btt-drawer-in{0%{-webkit-transform:translate(0,100%);transform:translate(0,100%)}100%{-webkit-transform:translate(0,0);transform:translate(0,0)}}@-webkit-keyframes btt-drawer-out{0%{-webkit-transform:translate(0,0);transform:translate(0,0)}100%{-webkit-transform:translate(0,100%);transform:translate(0,100%)}}@keyframes btt-drawer-out{0%{-webkit-transform:translate(0,0);transform:translate(0,0)}100%{-webkit-transform:translate(0,100%);transform:translate(0,100%)}}.el-drawer{position:absolute;box-sizing:border-box;background-color:#fff;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-shadow:0 8px 10px -5px rgba(0,0,0,.2),0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12);box-shadow:0 8px 10px -5px rgba(0,0,0,.2),0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12);outline:0}.el-drawer.rtl{-webkit-animation:rtl-drawer-out .3s;animation:rtl-drawer-out .3s;right:0}.el-drawer__open .el-drawer.rtl{-webkit-animation:rtl-drawer-in .3s 1ms;animation:rtl-drawer-in .3s 1ms}.el-drawer.ltr{-webkit-animation:ltr-drawer-out .3s;animation:ltr-drawer-out .3s;left:0}.el-drawer__open .el-drawer.ltr{-webkit-animation:ltr-drawer-in .3s 1ms;animation:ltr-drawer-in .3s 1ms}.el-drawer.ttb{-webkit-animation:ttb-drawer-out .3s;animation:ttb-drawer-out .3s;top:0}.el-drawer__open .el-drawer.ttb{-webkit-animation:ttb-drawer-in .3s 1ms;animation:ttb-drawer-in .3s 1ms}.el-drawer.btt{-webkit-animation:btt-drawer-out .3s;animation:btt-drawer-out .3s;bottom:0}.el-drawer__open .el-drawer.btt{-webkit-animation:btt-drawer-in .3s 1ms;animation:btt-drawer-in .3s 1ms}.el-drawer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden;margin:0}.el-drawer__header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#72767b;display:flex;margin-bottom:32px;padding:20px 20px 0}.el-drawer__header>:first-child{-webkit-box-flex:1;-ms-flex:1;flex:1}.el-drawer__title{margin:0;-webkit-box-flex:1;-ms-flex:1;flex:1;line-height:inherit;font-size:1rem}.el-drawer__close-btn{border:none;cursor:pointer;font-size:20px;color:inherit;background-color:transparent}.el-drawer__body{-webkit-box-flex:1;-ms-flex:1;flex:1}.el-drawer__body>*{-webkit-box-sizing:border-box;box-sizing:border-box}.el-drawer__container{position:relative}.el-drawer-fade-enter-active{-webkit-animation:el-drawer-fade-in .3s;animation:el-drawer-fade-in .3s}.el-drawer-fade-leave-active{animation:el-drawer-fade-in .3s reverse}.el-popconfirm__main{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-popconfirm__icon{margin-right:5px}.el-popconfirm__action{text-align:right;margin:0} \ No newline at end of file diff --git a/public/js/index.min.js b/public/js/index.min.js new file mode 100644 index 0000000..3d68257 --- /dev/null +++ b/public/js/index.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define("ELEMENT",["vue"],t):"object"==typeof exports?exports.ELEMENT=t(require("vue")):e.ELEMENT=t(e.Vue)}("undefined"!=typeof self?self:this,function(i){return s={},r.m=n=[function(e,t){e.exports=i},function(e,t,i){var n=i(4);e.exports=function(e,t,i){return void 0===i?n(e,t,!1):n(e,i,!1!==t)}},function(f,m,g){var v;!function(){"use strict";function e(){}var u={},c=/d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,t="[^\\s]+",h=/\[([^]*?)\]/gm;function i(e,t){for(var i=[],n=0,r=e.length;nr;)o(n,i=t[r++])&&(~l(s,i)||s.push(i));return s}},function(e,t,i){var n=i(40);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t){var i={}.toString;e.exports=function(e){return i.call(e).slice(8,-1)}},function(e,t,i){var n=i(25);e.exports=function(e){return Object(n(e))}},function(e,t,i){"use strict";function b(){return this}var y=i(20),w=i(23),_=i(43),x=i(9),C=i(31),k=i(69),S=i(32),D=i(72),$=i(13)("iterator"),E=!([].keys&&"next"in[].keys());e.exports=function(e,t,i,n,r,s,o){k(i,t,n);function a(e){if(!E&&e in f)return f[e];switch(e){case"keys":case"values":return function(){return new i(this,e)}}return function(){return new i(this,e)}}var l,u,c,h=t+" Iterator",d="values"==r,p=!1,f=e.prototype,m=f[$]||f["@@iterator"]||r&&f[r],g=m||a(r),v=r?d?a("entries"):g:void 0,n="Array"==t&&f.entries||m;if(n&&(c=D(n.call(new e)))!==Object.prototype&&c.next&&(S(c,h,!0),y||"function"==typeof c[$]||x(c,$,b)),d&&m&&"values"!==m.name&&(p=!0,g=function(){return m.call(this)}),y&&!o||!E&&!p&&f[$]||x(f,$,g),C[t]=g,C[h]=b,r)if(l={values:d?g:a("values"),keys:s?g:a("keys"),entries:v},o)for(u in l)u in f||_(f,u,l[u]);else w(w.P+w.F*(E||p),t,l);return l}},function(e,t,i){e.exports=i(9)},function(e,t,i){function n(){}var r=i(17),s=i(70),o=i(29),a=i(27)("IE_PROTO"),l=function(){var e=i(37)("iframe"),t=o.length;for(e.style.display="none",i(71).appendChild(e),e.src="javascript:",(e=e.contentWindow.document).open(),e.write(" + + + + +
+
+
+
+
请通过操控云台来调整摄像机视角
+
+
+
+
+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/public/nginx.htaccess b/public/nginx.htaccess new file mode 100644 index 0000000..e69de29 diff --git a/public/protocol.html b/public/protocol.html new file mode 100644 index 0000000..f408dc4 --- /dev/null +++ b/public/protocol.html @@ -0,0 +1,58 @@ + + + + + + + 用户隐私协议 + + + + +
+ + + + + + + diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..eb05362 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: diff --git a/public/router.php b/public/router.php new file mode 100644 index 0000000..4f916b4 --- /dev/null +++ b/public/router.php @@ -0,0 +1,17 @@ + +// +---------------------------------------------------------------------- +// $Id$ + +if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"])) { + return false; +} else { + require __DIR__ . "/index.php"; +} diff --git a/public/static/Ueditor/dialogs/anchor/anchor.html b/public/static/Ueditor/dialogs/anchor/anchor.html new file mode 100644 index 0000000..f277847 --- /dev/null +++ b/public/static/Ueditor/dialogs/anchor/anchor.html @@ -0,0 +1,40 @@ + + + + + + + + +
+ +
+ + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/attachment/attachment.css b/public/static/Ueditor/dialogs/attachment/attachment.css new file mode 100644 index 0000000..548b428 --- /dev/null +++ b/public/static/Ueditor/dialogs/attachment/attachment.css @@ -0,0 +1,681 @@ +@charset "utf-8"; +/* dialog样式 */ +.wrapper { + zoom: 1; + width: 630px; + *width: 626px; + height: 380px; + margin: 0 auto; + padding: 10px; + position: relative; + font-family: sans-serif; +} + +/*tab样式框大小*/ +.tabhead { + float:left; +} +.tabbody { + width: 100%; + height: 346px; + position: relative; + clear: both; +} + +.tabbody .panel { + position: absolute; + width: 0; + height: 0; + background: #fff; + overflow: hidden; + display: none; +} + +.tabbody .panel.focus { + width: 100%; + height: 346px; + display: block; +} + +/* 上传附件 */ +.tabbody #upload.panel { + width: 0; + height: 0; + overflow: hidden; + position: absolute !important; + clip: rect(1px, 1px, 1px, 1px); + background: #fff; + display: block; +} + +.tabbody #upload.panel.focus { + width: 100%; + height: 346px; + display: block; + clip: auto; +} + +#upload .queueList { + margin: 0; + width: 100%; + height: 100%; + position: absolute; + overflow: hidden; +} + +#upload p { + margin: 0; +} + +.element-invisible { + width: 0 !important; + height: 0 !important; + border: 0; + padding: 0; + margin: 0; + overflow: hidden; + position: absolute !important; + clip: rect(1px, 1px, 1px, 1px); +} + +#upload .placeholder { + margin: 10px; + border: 2px dashed #e6e6e6; + *border: 0px dashed #e6e6e6; + height: 172px; + padding-top: 150px; + text-align: center; + background: url(./images/image.png) center 70px no-repeat; + color: #cccccc; + font-size: 18px; + position: relative; + top:0; + *top: 10px; +} + +#upload .placeholder .webuploader-pick { + font-size: 18px; + background: #00b7ee; + border-radius: 3px; + line-height: 44px; + padding: 0 30px; + *width: 120px; + color: #fff; + display: inline-block; + margin: 0 auto 20px auto; + cursor: pointer; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); +} + +#upload .placeholder .webuploader-pick-hover { + background: #00a2d4; +} + + +#filePickerContainer { + text-align: center; +} + +#upload .placeholder .flashTip { + color: #666666; + font-size: 12px; + position: absolute; + width: 100%; + text-align: center; + bottom: 20px; +} + +#upload .placeholder .flashTip a { + color: #0785d1; + text-decoration: none; +} + +#upload .placeholder .flashTip a:hover { + text-decoration: underline; +} + +#upload .placeholder.webuploader-dnd-over { + border-color: #999999; +} + +#upload .filelist { + list-style: none; + margin: 0; + padding: 0; + overflow-x: hidden; + overflow-y: auto; + position: relative; + height: 300px; +} + +#upload .filelist:after { + content: ''; + display: block; + width: 0; + height: 0; + overflow: hidden; + clear: both; +} + +#upload .filelist li { + width: 113px; + height: 113px; + background: url(./images/bg.png); + text-align: center; + margin: 9px 0 0 9px; + *margin: 6px 0 0 6px; + position: relative; + display: block; + float: left; + overflow: hidden; + font-size: 12px; +} + +#upload .filelist li p.log { + position: relative; + top: -45px; +} + +#upload .filelist li p.title { + position: absolute; + top: 0; + left: 0; + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + top: 5px; + text-indent: 5px; + text-align: left; +} + +#upload .filelist li p.progress { + position: absolute; + width: 100%; + bottom: 0; + left: 0; + height: 8px; + overflow: hidden; + z-index: 50; + margin: 0; + border-radius: 0; + background: none; + -webkit-box-shadow: 0 0 0; +} + +#upload .filelist li p.progress span { + display: none; + overflow: hidden; + width: 0; + height: 100%; + background: #1483d8 url(./images/progress.png) repeat-x; + + -webit-transition: width 200ms linear; + -moz-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; + transition: width 200ms linear; + + -webkit-animation: progressmove 2s linear infinite; + -moz-animation: progressmove 2s linear infinite; + -o-animation: progressmove 2s linear infinite; + -ms-animation: progressmove 2s linear infinite; + animation: progressmove 2s linear infinite; + + -webkit-transform: translateZ(0); +} + +@-webkit-keyframes progressmove { + 0% { + background-position: 0 0; + } + 100% { + background-position: 17px 0; + } +} + +@-moz-keyframes progressmove { + 0% { + background-position: 0 0; + } + 100% { + background-position: 17px 0; + } +} + +@keyframes progressmove { + 0% { + background-position: 0 0; + } + 100% { + background-position: 17px 0; + } +} + +#upload .filelist li p.imgWrap { + position: relative; + z-index: 2; + line-height: 113px; + vertical-align: middle; + overflow: hidden; + width: 113px; + height: 113px; + + -webkit-transform-origin: 50% 50%; + -moz-transform-origin: 50% 50%; + -o-transform-origin: 50% 50%; + -ms-transform-origin: 50% 50%; + transform-origin: 50% 50%; + + -webit-transition: 200ms ease-out; + -moz-transition: 200ms ease-out; + -o-transition: 200ms ease-out; + -ms-transition: 200ms ease-out; + transition: 200ms ease-out; +} +#upload .filelist li p.imgWrap.notimage { + margin-top: 0; + width: 111px; + height: 111px; + border: 1px #eeeeee solid; +} +#upload .filelist li p.imgWrap.notimage i.file-preview { + margin-top: 15px; +} + +#upload .filelist li img { + width: 100%; +} + +#upload .filelist li p.error { + background: #f43838; + color: #fff; + position: absolute; + bottom: 0; + left: 0; + height: 28px; + line-height: 28px; + width: 100%; + z-index: 100; + display:none; +} + +#upload .filelist li .success { + display: block; + position: absolute; + left: 0; + bottom: 0; + height: 40px; + width: 100%; + z-index: 200; + background: url(./images/success.png) no-repeat right bottom; + background-image: url(./images/success.gif) \9; +} + +#upload .filelist li.filePickerBlock { + width: 113px; + height: 113px; + background: url(./images/image.png) no-repeat center 12px; + border: 1px solid #eeeeee; + border-radius: 0; +} +#upload .filelist li.filePickerBlock div.webuploader-pick { + width: 100%; + height: 100%; + margin: 0; + padding: 0; + opacity: 0; + background: none; + font-size: 0; +} + +#upload .filelist div.file-panel { + position: absolute; + height: 0; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#80000000', endColorstr='#80000000') \0; + background: rgba(0, 0, 0, 0.5); + width: 100%; + top: 0; + left: 0; + overflow: hidden; + z-index: 300; +} + +#upload .filelist div.file-panel span { + width: 24px; + height: 24px; + display: inline; + float: right; + text-indent: -9999px; + overflow: hidden; + background: url(./images/icons.png) no-repeat; + background: url(./images/icons.gif) no-repeat \9; + margin: 5px 1px 1px; + cursor: pointer; + -webkit-tap-highlight-color: rgba(0,0,0,0); + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +#upload .filelist div.file-panel span.rotateLeft { + display:none; + background-position: 0 -24px; +} + +#upload .filelist div.file-panel span.rotateLeft:hover { + background-position: 0 0; +} + +#upload .filelist div.file-panel span.rotateRight { + display:none; + background-position: -24px -24px; +} + +#upload .filelist div.file-panel span.rotateRight:hover { + background-position: -24px 0; +} + +#upload .filelist div.file-panel span.cancel { + background-position: -48px -24px; +} + +#upload .filelist div.file-panel span.cancel:hover { + background-position: -48px 0; +} + +#upload .statusBar { + height: 45px; + border-bottom: 1px solid #dadada; + margin: 0 10px; + padding: 0; + line-height: 45px; + vertical-align: middle; + position: relative; +} + +#upload .statusBar .progress { + border: 1px solid #1483d8; + width: 198px; + background: #fff; + height: 18px; + position: absolute; + top: 12px; + display: none; + text-align: center; + line-height: 18px; + color: #6dbfff; + margin: 0 10px 0 0; +} +#upload .statusBar .progress span.percentage { + width: 0; + height: 100%; + left: 0; + top: 0; + background: #1483d8; + position: absolute; +} +#upload .statusBar .progress span.text { + position: relative; + z-index: 10; +} + +#upload .statusBar .info { + display: inline-block; + font-size: 14px; + color: #666666; +} + +#upload .statusBar .btns { + position: absolute; + top: 7px; + right: 0; + line-height: 30px; +} + +#filePickerBtn { + display: inline-block; + float: left; +} +#upload .statusBar .btns .webuploader-pick, +#upload .statusBar .btns .uploadBtn, +#upload .statusBar .btns .uploadBtn.state-uploading, +#upload .statusBar .btns .uploadBtn.state-paused { + background: #ffffff; + border: 1px solid #cfcfcf; + color: #565656; + padding: 0 18px; + display: inline-block; + border-radius: 3px; + margin-left: 10px; + cursor: pointer; + font-size: 14px; + float: left; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +#upload .statusBar .btns .webuploader-pick-hover, +#upload .statusBar .btns .uploadBtn:hover, +#upload .statusBar .btns .uploadBtn.state-uploading:hover, +#upload .statusBar .btns .uploadBtn.state-paused:hover { + background: #f0f0f0; +} + +#upload .statusBar .btns .uploadBtn, +#upload .statusBar .btns .uploadBtn.state-paused{ + background: #00b7ee; + color: #fff; + border-color: transparent; +} +#upload .statusBar .btns .uploadBtn:hover, +#upload .statusBar .btns .uploadBtn.state-paused:hover{ + background: #00a2d4; +} + +#upload .statusBar .btns .uploadBtn.disabled { + pointer-events: none; + filter:alpha(opacity=60); + -moz-opacity:0.6; + -khtml-opacity: 0.6; + opacity: 0.6; +} + + + +/* 图片管理样式 */ +#online { + width: 100%; + height: 336px; + padding: 10px 0 0 0; +} +#online #fileList{ + width: 100%; + height: 100%; + overflow-x: hidden; + overflow-y: auto; + position: relative; +} +#online ul { + display: block; + list-style: none; + margin: 0; + padding: 0; +} +#online li { + float: left; + display: block; + list-style: none; + padding: 0; + width: 113px; + height: 113px; + margin: 0 0 9px 9px; + *margin: 0 0 6px 6px; + background-color: #eee; + overflow: hidden; + cursor: pointer; + position: relative; +} +#online li.clearFloat { + float: none; + clear: both; + display: block; + width:0; + height:0; + margin: 0; + padding: 0; +} +#online li img { + cursor: pointer; +} +#online li div.file-wrapper { + cursor: pointer; + position: absolute; + display: block; + width: 111px; + height: 111px; + border: 1px solid #eee; + background: url("./images/bg.png") repeat; +} +#online li div span.file-title{ + display: block; + padding: 0 3px; + margin: 3px 0 0 0; + font-size: 12px; + height: 13px; + color: #555555; + text-align: center; + width: 107px; + white-space: nowrap; + word-break: break-all; + overflow: hidden; + text-overflow: ellipsis; +} +#online li .icon { + cursor: pointer; + width: 113px; + height: 113px; + position: absolute; + top: 0; + left: 0; + z-index: 2; + border: 0; + background-repeat: no-repeat; +} +#online li .icon:hover { + width: 107px; + height: 107px; + border: 3px solid #1094fa; +} +#online li.selected .icon { + background-image: url(images/success.png); + background-image: url(images/success.gif) \9; + background-position: 75px 75px; +} +#online li.selected .icon:hover { + width: 107px; + height: 107px; + border: 3px solid #1094fa; + background-position: 72px 72px; +} + + +/* 在线文件的文件预览图标 */ +i.file-preview { + display: block; + margin: 10px auto; + width: 70px; + height: 70px; + background-image: url("./images/file-icons.png"); + background-image: url("./images/file-icons.gif") \9; + background-position: -140px center; + background-repeat: no-repeat; +} +i.file-preview.file-type-dir{ + background-position: 0 center; +} +i.file-preview.file-type-file{ + background-position: -140px center; +} +i.file-preview.file-type-filelist{ + background-position: -210px center; +} +i.file-preview.file-type-zip, +i.file-preview.file-type-rar, +i.file-preview.file-type-7z, +i.file-preview.file-type-tar, +i.file-preview.file-type-gz, +i.file-preview.file-type-bz2{ + background-position: -280px center; +} +i.file-preview.file-type-xls, +i.file-preview.file-type-xlsx{ + background-position: -350px center; +} +i.file-preview.file-type-doc, +i.file-preview.file-type-docx{ + background-position: -420px center; +} +i.file-preview.file-type-ppt, +i.file-preview.file-type-pptx{ + background-position: -490px center; +} +i.file-preview.file-type-vsd{ + background-position: -560px center; +} +i.file-preview.file-type-pdf{ + background-position: -630px center; +} +i.file-preview.file-type-txt, +i.file-preview.file-type-md, +i.file-preview.file-type-json, +i.file-preview.file-type-htm, +i.file-preview.file-type-xml, +i.file-preview.file-type-html, +i.file-preview.file-type-js, +i.file-preview.file-type-css, +i.file-preview.file-type-php, +i.file-preview.file-type-jsp, +i.file-preview.file-type-asp{ + background-position: -700px center; +} +i.file-preview.file-type-apk{ + background-position: -770px center; +} +i.file-preview.file-type-exe{ + background-position: -840px center; +} +i.file-preview.file-type-ipa{ + background-position: -910px center; +} +i.file-preview.file-type-mp4, +i.file-preview.file-type-swf, +i.file-preview.file-type-mkv, +i.file-preview.file-type-avi, +i.file-preview.file-type-flv, +i.file-preview.file-type-mov, +i.file-preview.file-type-mpg, +i.file-preview.file-type-mpeg, +i.file-preview.file-type-ogv, +i.file-preview.file-type-webm, +i.file-preview.file-type-rm, +i.file-preview.file-type-rmvb{ + background-position: -980px center; +} +i.file-preview.file-type-ogg, +i.file-preview.file-type-wav, +i.file-preview.file-type-wmv, +i.file-preview.file-type-mid, +i.file-preview.file-type-mp3{ + background-position: -1050px center; +} +i.file-preview.file-type-jpg, +i.file-preview.file-type-jpeg, +i.file-preview.file-type-gif, +i.file-preview.file-type-bmp, +i.file-preview.file-type-png, +i.file-preview.file-type-psd{ + background-position: -140px center; +} \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/attachment/attachment.html b/public/static/Ueditor/dialogs/attachment/attachment.html new file mode 100644 index 0000000..2ae9282 --- /dev/null +++ b/public/static/Ueditor/dialogs/attachment/attachment.html @@ -0,0 +1,60 @@ + + + + + ueditor图片对话框 + + + + + + + + + + + + + + +
+
+ + +
+
+ +
+
+
+
+ 0% + +
+
+
+
+
+
+
+
+
+
+
+
    +
  • +
+
+
+ + +
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/attachment/attachment.js b/public/static/Ueditor/dialogs/attachment/attachment.js new file mode 100644 index 0000000..bb2557f --- /dev/null +++ b/public/static/Ueditor/dialogs/attachment/attachment.js @@ -0,0 +1,760 @@ +/** + * User: Jinqn + * Date: 14-04-08 + * Time: 下午16:34 + * 上传图片对话框逻辑代码,包括tab: 远程图片/上传图片/在线图片/搜索图片 + */ + +(function () { + + var uploadFile, + onlineFile; + + window.onload = function () { + initTabs(); + initButtons(); + }; + + /* 初始化tab标签 */ + function initTabs() { + var tabs = $G('tabhead').children; + for (var i = 0; i < tabs.length; i++) { + domUtils.on(tabs[i], "click", function (e) { + var target = e.target || e.srcElement; + setTabFocus(target.getAttribute('data-content-id')); + }); + } + + setTabFocus('upload'); + } + + /* 初始化tabbody */ + function setTabFocus(id) { + if(!id) return; + var i, bodyId, tabs = $G('tabhead').children; + for (i = 0; i < tabs.length; i++) { + bodyId = tabs[i].getAttribute('data-content-id') + if (bodyId == id) { + domUtils.addClass(tabs[i], 'focus'); + domUtils.addClass($G(bodyId), 'focus'); + } else { + domUtils.removeClasses(tabs[i], 'focus'); + domUtils.removeClasses($G(bodyId), 'focus'); + } + } + switch (id) { + case 'upload': + uploadFile = uploadFile || new UploadFile('queueList'); + break; + case 'online': + onlineFile = onlineFile || new OnlineFile('fileList'); + break; + } + } + + /* 初始化onok事件 */ + function initButtons() { + + dialog.onok = function () { + var list = [], id, tabs = $G('tabhead').children; + for (var i = 0; i < tabs.length; i++) { + if (domUtils.hasClass(tabs[i], 'focus')) { + id = tabs[i].getAttribute('data-content-id'); + break; + } + } + + switch (id) { + case 'upload': + list = uploadFile.getInsertList(); + var count = uploadFile.getQueueCount(); + if (count) { + $('.info', '#queueList').html('' + '还有2个未上传文件'.replace(/[\d]/, count) + ''); + return false; + } + break; + case 'online': + list = onlineFile.getInsertList(); + break; + } + + editor.execCommand('insertfile', list); + }; + } + + + /* 上传附件 */ + function UploadFile(target) { + this.$wrap = target.constructor == String ? $('#' + target) : $(target); + this.init(); + } + UploadFile.prototype = { + init: function () { + this.fileList = []; + this.initContainer(); + this.initUploader(); + }, + initContainer: function () { + this.$queue = this.$wrap.find('.filelist'); + }, + /* 初始化容器 */ + initUploader: function () { + var _this = this, + $ = jQuery, // just in case. Make sure it's not an other libaray. + $wrap = _this.$wrap, + // 图片容器 + $queue = $wrap.find('.filelist'), + // 状态栏,包括进度和控制按钮 + $statusBar = $wrap.find('.statusBar'), + // 文件总体选择信息。 + $info = $statusBar.find('.info'), + // 上传按钮 + $upload = $wrap.find('.uploadBtn'), + // 上传按钮 + $filePickerBtn = $wrap.find('.filePickerBtn'), + // 上传按钮 + $filePickerBlock = $wrap.find('.filePickerBlock'), + // 没选择文件之前的内容。 + $placeHolder = $wrap.find('.placeholder'), + // 总体进度条 + $progress = $statusBar.find('.progress').hide(), + // 添加的文件数量 + fileCount = 0, + // 添加的文件总大小 + fileSize = 0, + // 优化retina, 在retina下这个值是2 + ratio = window.devicePixelRatio || 1, + // 缩略图大小 + thumbnailWidth = 113 * ratio, + thumbnailHeight = 113 * ratio, + // 可能有pedding, ready, uploading, confirm, done. + state = '', + // 所有文件的进度信息,key为file id + percentages = {}, + supportTransition = (function () { + var s = document.createElement('p').style, + r = 'transition' in s || + 'WebkitTransition' in s || + 'MozTransition' in s || + 'msTransition' in s || + 'OTransition' in s; + s = null; + return r; + })(), + // WebUploader实例 + uploader, + actionUrl = editor.getActionUrl(editor.getOpt('fileActionName')), + fileMaxSize = editor.getOpt('fileMaxSize'), + acceptExtensions = (editor.getOpt('fileAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, '');; + + if (!WebUploader.Uploader.support()) { + $('#filePickerReady').after($('
').html(lang.errorNotSupport)).hide(); + return; + } else if (!editor.getOpt('fileActionName')) { + $('#filePickerReady').after($('
').html(lang.errorLoadConfig)).hide(); + return; + } + + uploader = _this.uploader = WebUploader.create({ + pick: { + id: '#filePickerReady', + label: lang.uploadSelectFile + }, + swf: '../../third-party/webuploader/Uploader.swf', + server: actionUrl, + fileVal: editor.getOpt('fileFieldName'), + duplicate: true, + fileSingleSizeLimit: fileMaxSize, + compress: false + }); + uploader.addButton({ + id: '#filePickerBlock' + }); + uploader.addButton({ + id: '#filePickerBtn', + label: lang.uploadAddFile + }); + + setState('pedding'); + + // 当有文件添加进来时执行,负责view的创建 + function addFile(file) { + var $li = $('
  • ' + + '

    ' + file.name + '

    ' + + '

    ' + + '

    ' + + '
  • '), + + $btns = $('
    ' + + '' + lang.uploadDelete + '' + + '' + lang.uploadTurnRight + '' + + '' + lang.uploadTurnLeft + '
    ').appendTo($li), + $prgress = $li.find('p.progress span'), + $wrap = $li.find('p.imgWrap'), + $info = $('

    ').hide().appendTo($li), + + showError = function (code) { + switch (code) { + case 'exceed_size': + text = lang.errorExceedSize; + break; + case 'interrupt': + text = lang.errorInterrupt; + break; + case 'http': + text = lang.errorHttp; + break; + case 'not_allow_type': + text = lang.errorFileType; + break; + default: + text = lang.errorUploadRetry; + break; + } + $info.text(text).show(); + }; + + if (file.getStatus() === 'invalid') { + showError(file.statusText); + } else { + $wrap.text(lang.uploadPreview); + if ('|png|jpg|jpeg|bmp|gif|'.indexOf('|'+file.ext.toLowerCase()+'|') == -1) { + $wrap.empty().addClass('notimage').append('' + + '' + file.name + ''); + } else { + if (browser.ie && browser.version <= 7) { + $wrap.text(lang.uploadNoPreview); + } else { + uploader.makeThumb(file, function (error, src) { + if (error || !src) { + $wrap.text(lang.uploadNoPreview); + } else { + var $img = $(''); + $wrap.empty().append($img); + $img.on('error', function () { + $wrap.text(lang.uploadNoPreview); + }); + } + }, thumbnailWidth, thumbnailHeight); + } + } + percentages[ file.id ] = [ file.size, 0 ]; + file.rotation = 0; + + /* 检查文件格式 */ + if (!file.ext || acceptExtensions.indexOf(file.ext.toLowerCase()) == -1) { + showError('not_allow_type'); + uploader.removeFile(file); + } + } + + file.on('statuschange', function (cur, prev) { + if (prev === 'progress') { + $prgress.hide().width(0); + } else if (prev === 'queued') { + $li.off('mouseenter mouseleave'); + $btns.remove(); + } + // 成功 + if (cur === 'error' || cur === 'invalid') { + showError(file.statusText); + percentages[ file.id ][ 1 ] = 1; + } else if (cur === 'interrupt') { + showError('interrupt'); + } else if (cur === 'queued') { + percentages[ file.id ][ 1 ] = 0; + } else if (cur === 'progress') { + $info.hide(); + $prgress.css('display', 'block'); + } else if (cur === 'complete') { + } + + $li.removeClass('state-' + prev).addClass('state-' + cur); + }); + + $li.on('mouseenter', function () { + $btns.stop().animate({height: 30}); + }); + $li.on('mouseleave', function () { + $btns.stop().animate({height: 0}); + }); + + $btns.on('click', 'span', function () { + var index = $(this).index(), + deg; + + switch (index) { + case 0: + uploader.removeFile(file); + return; + case 1: + file.rotation += 90; + break; + case 2: + file.rotation -= 90; + break; + } + + if (supportTransition) { + deg = 'rotate(' + file.rotation + 'deg)'; + $wrap.css({ + '-webkit-transform': deg, + '-mos-transform': deg, + '-o-transform': deg, + 'transform': deg + }); + } else { + $wrap.css('filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + (~~((file.rotation / 90) % 4 + 4) % 4) + ')'); + } + + }); + + $li.insertBefore($filePickerBlock); + } + + // 负责view的销毁 + function removeFile(file) { + var $li = $('#' + file.id); + delete percentages[ file.id ]; + updateTotalProgress(); + $li.off().find('.file-panel').off().end().remove(); + } + + function updateTotalProgress() { + var loaded = 0, + total = 0, + spans = $progress.children(), + percent; + + $.each(percentages, function (k, v) { + total += v[ 0 ]; + loaded += v[ 0 ] * v[ 1 ]; + }); + + percent = total ? loaded / total : 0; + + spans.eq(0).text(Math.round(percent * 100) + '%'); + spans.eq(1).css('width', Math.round(percent * 100) + '%'); + updateStatus(); + } + + function setState(val, files) { + + if (val != state) { + + var stats = uploader.getStats(); + + $upload.removeClass('state-' + state); + $upload.addClass('state-' + val); + + switch (val) { + + /* 未选择文件 */ + case 'pedding': + $queue.addClass('element-invisible'); + $statusBar.addClass('element-invisible'); + $placeHolder.removeClass('element-invisible'); + $progress.hide(); $info.hide(); + uploader.refresh(); + break; + + /* 可以开始上传 */ + case 'ready': + $placeHolder.addClass('element-invisible'); + $queue.removeClass('element-invisible'); + $statusBar.removeClass('element-invisible'); + $progress.hide(); $info.show(); + $upload.text(lang.uploadStart); + uploader.refresh(); + break; + + /* 上传中 */ + case 'uploading': + $progress.show(); $info.hide(); + $upload.text(lang.uploadPause); + break; + + /* 暂停上传 */ + case 'paused': + $progress.show(); $info.hide(); + $upload.text(lang.uploadContinue); + break; + + case 'confirm': + $progress.show(); $info.hide(); + $upload.text(lang.uploadStart); + + stats = uploader.getStats(); + if (stats.successNum && !stats.uploadFailNum) { + setState('finish'); + return; + } + break; + + case 'finish': + $progress.hide(); $info.show(); + if (stats.uploadFailNum) { + $upload.text(lang.uploadRetry); + } else { + $upload.text(lang.uploadStart); + } + break; + } + + state = val; + updateStatus(); + + } + + if (!_this.getQueueCount()) { + $upload.addClass('disabled') + } else { + $upload.removeClass('disabled') + } + + } + + function updateStatus() { + var text = '', stats; + + if (state === 'ready') { + text = lang.updateStatusReady.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize)); + } else if (state === 'confirm') { + stats = uploader.getStats(); + if (stats.uploadFailNum) { + text = lang.updateStatusConfirm.replace('_', stats.successNum).replace('_', stats.successNum); + } + } else { + stats = uploader.getStats(); + text = lang.updateStatusFinish.replace('_', fileCount). + replace('_KB', WebUploader.formatSize(fileSize)). + replace('_', stats.successNum); + + if (stats.uploadFailNum) { + text += lang.updateStatusError.replace('_', stats.uploadFailNum); + } + } + + $info.html(text); + } + + uploader.on('fileQueued', function (file) { + fileCount++; + fileSize += file.size; + + if (fileCount === 1) { + $placeHolder.addClass('element-invisible'); + $statusBar.show(); + } + + addFile(file); + }); + + uploader.on('fileDequeued', function (file) { + fileCount--; + fileSize -= file.size; + + removeFile(file); + updateTotalProgress(); + }); + + uploader.on('filesQueued', function (file) { + if (!uploader.isInProgress() && (state == 'pedding' || state == 'finish' || state == 'confirm' || state == 'ready')) { + setState('ready'); + } + updateTotalProgress(); + }); + + uploader.on('all', function (type, files) { + switch (type) { + case 'uploadFinished': + setState('confirm', files); + break; + case 'startUpload': + /* 添加额外的GET参数 */ + var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '', + url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?':'&') + 'encode=utf-8&' + params); + uploader.option('server', url); + setState('uploading', files); + break; + case 'stopUpload': + setState('paused', files); + break; + } + }); + + uploader.on('uploadBeforeSend', function (file, data, header) { + //这里可以通过data对象添加POST参数 + header['X_Requested_With'] = 'XMLHttpRequest'; + // HaoChuan9421 + if(editor.options.headers && Object.prototype.toString.apply(editor.options.headers) === "[object Object]"){ + for(var key in editor.options.headers){ + header[key] = editor.options.headers[key] + } + } + }); + + uploader.on('uploadProgress', function (file, percentage) { + var $li = $('#' + file.id), + $percent = $li.find('.progress span'); + + $percent.css('width', percentage * 100 + '%'); + percentages[ file.id ][ 1 ] = percentage; + updateTotalProgress(); + }); + + uploader.on('uploadSuccess', function (file, ret) { + var $file = $('#' + file.id); + try { + var responseText = (ret._raw || ret), + json = utils.str2json(responseText); + if (json.state == 'SUCCESS') { + _this.fileList.push(json); + $file.append(''); + } else { + $file.find('.error').text(json.state).show(); + } + } catch (e) { + $file.find('.error').text(lang.errorServerUpload).show(); + } + }); + + uploader.on('uploadError', function (file, code) { + }); + uploader.on('error', function (code, file) { + if (code == 'Q_TYPE_DENIED' || code == 'F_EXCEED_SIZE') { + addFile(file); + } + }); + uploader.on('uploadComplete', function (file, ret) { + }); + + $upload.on('click', function () { + if ($(this).hasClass('disabled')) { + return false; + } + + if (state === 'ready') { + uploader.upload(); + } else if (state === 'paused') { + uploader.upload(); + } else if (state === 'uploading') { + uploader.stop(); + } + }); + + $upload.addClass('state-' + state); + updateTotalProgress(); + }, + getQueueCount: function () { + var file, i, status, readyFile = 0, files = this.uploader.getFiles(); + for (i = 0; file = files[i++]; ) { + status = file.getStatus(); + if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++; + } + return readyFile; + }, + getInsertList: function () { + var i, link, data, list = [], + prefix = editor.getOpt('fileUrlPrefix'); + for (i = 0; i < this.fileList.length; i++) { + data = this.fileList[i]; + link = data.url; + list.push({ + title: data.original || link.substr(link.lastIndexOf('/') + 1), + url: prefix + link + }); + } + return list; + } + }; + + + /* 在线附件 */ + function OnlineFile(target) { + this.container = utils.isString(target) ? document.getElementById(target) : target; + this.init(); + } + OnlineFile.prototype = { + init: function () { + this.initContainer(); + this.initEvents(); + this.initData(); + }, + /* 初始化容器 */ + initContainer: function () { + this.container.innerHTML = ''; + this.list = document.createElement('ul'); + this.clearFloat = document.createElement('li'); + + domUtils.addClass(this.list, 'list'); + domUtils.addClass(this.clearFloat, 'clearFloat'); + + this.list.appendChild(this.clearFloat); + this.container.appendChild(this.list); + }, + /* 初始化滚动事件,滚动到地步自动拉取数据 */ + initEvents: function () { + var _this = this; + + /* 滚动拉取图片 */ + domUtils.on($G('fileList'), 'scroll', function(e){ + var panel = this; + if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) { + _this.getFileData(); + } + }); + /* 选中图片 */ + domUtils.on(this.list, 'click', function (e) { + var target = e.target || e.srcElement, + li = target.parentNode; + + if (li.tagName.toLowerCase() == 'li') { + if (domUtils.hasClass(li, 'selected')) { + domUtils.removeClasses(li, 'selected'); + } else { + domUtils.addClass(li, 'selected'); + } + } + }); + }, + /* 初始化第一次的数据 */ + initData: function () { + + /* 拉取数据需要使用的值 */ + this.state = 0; + this.listSize = editor.getOpt('fileManagerListSize'); + this.listIndex = 0; + this.listEnd = false; + + /* 第一次拉取数据 */ + this.getFileData(); + }, + /* 向后台拉取图片列表数据 */ + getFileData: function () { + var _this = this; + + if(!_this.listEnd && !this.isLoadingData) { + this.isLoadingData = true; + ajax.request(editor.getActionUrl(editor.getOpt('fileManagerActionName')), { + timeout: 100000, + data: utils.extend({ + start: this.listIndex, + size: this.listSize + }, editor.queryCommandValue('serverparam')), + method: 'get', + onsuccess: function (r) { + try { + var json = eval('(' + r.responseText + ')'); + if (json.state == 'SUCCESS') { + _this.pushData(json.list); + _this.listIndex = parseInt(json.start) + parseInt(json.list.length); + if(_this.listIndex >= json.total) { + _this.listEnd = true; + } + _this.isLoadingData = false; + } + } catch (e) { + if(r.responseText.indexOf('ue_separate_ue') != -1) { + var list = r.responseText.split(r.responseText); + _this.pushData(list); + _this.listIndex = parseInt(list.length); + _this.listEnd = true; + _this.isLoadingData = false; + } + } + }, + onerror: function () { + _this.isLoadingData = false; + } + }); + } + }, + /* 添加图片到列表界面上 */ + pushData: function (list) { + var i, item, img, filetype, preview, icon, _this = this, + urlPrefix = editor.getOpt('fileManagerUrlPrefix'); + for (i = 0; i < list.length; i++) { + if(list[i] && list[i].url) { + item = document.createElement('li'); + icon = document.createElement('span'); + filetype = list[i].url.substr(list[i].url.lastIndexOf('.') + 1); + + if ( "png|jpg|jpeg|gif|bmp".indexOf(filetype) != -1 ) { + preview = document.createElement('img'); + domUtils.on(preview, 'load', (function(image){ + return function(){ + _this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight); + }; + })(preview)); + preview.width = 113; + preview.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) ); + } else { + var ic = document.createElement('i'), + textSpan = document.createElement('span'); + textSpan.innerHTML = list[i].url.substr(list[i].url.lastIndexOf('/') + 1); + preview = document.createElement('div'); + preview.appendChild(ic); + preview.appendChild(textSpan); + domUtils.addClass(preview, 'file-wrapper'); + domUtils.addClass(textSpan, 'file-title'); + domUtils.addClass(ic, 'file-type-' + filetype); + domUtils.addClass(ic, 'file-preview'); + } + domUtils.addClass(icon, 'icon'); + item.setAttribute('data-url', urlPrefix + list[i].url); + if (list[i].original) { + item.setAttribute('data-title', list[i].original); + } + + item.appendChild(preview); + item.appendChild(icon); + this.list.insertBefore(item, this.clearFloat); + } + } + }, + /* 改变图片大小 */ + scale: function (img, w, h, type) { + var ow = img.width, + oh = img.height; + + if (type == 'justify') { + if (ow >= oh) { + img.width = w; + img.height = h * oh / ow; + img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; + } else { + img.width = w * ow / oh; + img.height = h; + img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; + } + } else { + if (ow >= oh) { + img.width = w * ow / oh; + img.height = h; + img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; + } else { + img.width = w; + img.height = h * oh / ow; + img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; + } + } + }, + getInsertList: function () { + var i, lis = this.list.children, list = []; + for (i = 0; i < lis.length; i++) { + if (domUtils.hasClass(lis[i], 'selected')) { + var url = lis[i].getAttribute('data-url'); + var title = lis[i].getAttribute('data-title') || url.substr(url.lastIndexOf('/') + 1); + list.push({ + title: title, + url: url + }); + } + } + return list; + } + }; + + +})(); \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_chm.gif b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_chm.gif new file mode 100644 index 0000000..9ca4fb6 Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_chm.gif differ diff --git a/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_default.png b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_default.png new file mode 100644 index 0000000..50ac1cb Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_default.png differ diff --git a/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_doc.gif b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_doc.gif new file mode 100644 index 0000000..206fede Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_doc.gif differ diff --git a/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_exe.gif b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_exe.gif new file mode 100644 index 0000000..2e3b7a2 Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_exe.gif differ diff --git a/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_jpg.gif b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_jpg.gif new file mode 100644 index 0000000..5d5dec0 Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_jpg.gif differ diff --git a/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_mp3.gif b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_mp3.gif new file mode 100644 index 0000000..b351a1f Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_mp3.gif differ diff --git a/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_mv.gif b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_mv.gif new file mode 100644 index 0000000..26019b0 Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_mv.gif differ diff --git a/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_pdf.gif b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_pdf.gif new file mode 100644 index 0000000..bbb65c8 Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_pdf.gif differ diff --git a/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_ppt.gif b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_ppt.gif new file mode 100644 index 0000000..ccb26fb Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_ppt.gif differ diff --git a/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_psd.gif b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_psd.gif new file mode 100644 index 0000000..2e8743a Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_psd.gif differ diff --git a/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_rar.gif b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_rar.gif new file mode 100644 index 0000000..5359e46 Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_rar.gif differ diff --git a/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_txt.gif b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_txt.gif new file mode 100644 index 0000000..e7b8dd2 Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_txt.gif differ diff --git a/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_xls.gif b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_xls.gif new file mode 100644 index 0000000..e86c1c6 Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/fileTypeImages/icon_xls.gif differ diff --git a/public/static/Ueditor/dialogs/attachment/images/alignicon.gif b/public/static/Ueditor/dialogs/attachment/images/alignicon.gif new file mode 100644 index 0000000..005a5ac Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/images/alignicon.gif differ diff --git a/public/static/Ueditor/dialogs/attachment/images/alignicon.png b/public/static/Ueditor/dialogs/attachment/images/alignicon.png new file mode 100644 index 0000000..4b6c444 Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/images/alignicon.png differ diff --git a/public/static/Ueditor/dialogs/attachment/images/bg.png b/public/static/Ueditor/dialogs/attachment/images/bg.png new file mode 100644 index 0000000..580be0a Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/images/bg.png differ diff --git a/public/static/Ueditor/dialogs/attachment/images/file-icons.gif b/public/static/Ueditor/dialogs/attachment/images/file-icons.gif new file mode 100644 index 0000000..d8c02c2 Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/images/file-icons.gif differ diff --git a/public/static/Ueditor/dialogs/attachment/images/file-icons.png b/public/static/Ueditor/dialogs/attachment/images/file-icons.png new file mode 100644 index 0000000..3ff82c8 Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/images/file-icons.png differ diff --git a/public/static/Ueditor/dialogs/attachment/images/icons.gif b/public/static/Ueditor/dialogs/attachment/images/icons.gif new file mode 100644 index 0000000..78459de Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/images/icons.gif differ diff --git a/public/static/Ueditor/dialogs/attachment/images/icons.png b/public/static/Ueditor/dialogs/attachment/images/icons.png new file mode 100644 index 0000000..12e4700 Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/images/icons.png differ diff --git a/public/static/Ueditor/dialogs/attachment/images/image.png b/public/static/Ueditor/dialogs/attachment/images/image.png new file mode 100644 index 0000000..19699f6 Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/images/image.png differ diff --git a/public/static/Ueditor/dialogs/attachment/images/progress.png b/public/static/Ueditor/dialogs/attachment/images/progress.png new file mode 100644 index 0000000..717c486 Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/images/progress.png differ diff --git a/public/static/Ueditor/dialogs/attachment/images/success.gif b/public/static/Ueditor/dialogs/attachment/images/success.gif new file mode 100644 index 0000000..8d4f311 Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/images/success.gif differ diff --git a/public/static/Ueditor/dialogs/attachment/images/success.png b/public/static/Ueditor/dialogs/attachment/images/success.png new file mode 100644 index 0000000..94f968d Binary files /dev/null and b/public/static/Ueditor/dialogs/attachment/images/success.png differ diff --git a/public/static/Ueditor/dialogs/background/background.css b/public/static/Ueditor/dialogs/background/background.css new file mode 100644 index 0000000..5c41fe9 --- /dev/null +++ b/public/static/Ueditor/dialogs/background/background.css @@ -0,0 +1,94 @@ +.wrapper{ width: 424px;margin: 10px auto; zoom:1;position: relative} +.tabbody{height:225px;} +.tabbody .panel { position: absolute;width:100%; height:100%;background: #fff; display: none;} +.tabbody .focus { display: block;} + +body{font-size: 12px;color: #888;overflow: hidden;} +input,label{vertical-align:middle} +.clear{clear: both;} +.pl{padding-left: 18px;padding-left: 23px\9;} + +#imageList {width: 420px;height: 215px;margin-top: 10px;overflow: hidden;overflow-y: auto;} +#imageList div {float: left;width: 100px;height: 95px;margin: 5px 10px;} +#imageList img {cursor: pointer;border: 2px solid white;} + +.bgarea{margin: 10px;padding: 5px;height: 84%;border: 1px solid #A8A297;} +.content div{margin: 10px 0 10px 5px;} +.content .iptradio{margin: 0px 5px 5px 0px;} +.txt{width:280px;} + +.wrapcolor{height: 19px;} +div.color{float: left;margin: 0;} +#colorPicker{width: 17px;height: 17px;border: 1px solid #CCC;display: inline-block;border-radius: 3px;box-shadow: 2px 2px 5px #D3D6DA;margin: 0;float: left;} +div.alignment,#custom{margin-left: 23px;margin-left: 28px\9;} +#custom input{height: 15px;min-height: 15px;width:20px;} +#repeatType{width:100px;} + + +/* 图片管理样式 */ +#imgManager { + width: 100%; + height: 225px; +} +#imgManager #imageList{ + width: 100%; + overflow-x: hidden; + overflow-y: auto; +} +#imgManager ul { + display: block; + list-style: none; + margin: 0; + padding: 0; +} +#imgManager li { + float: left; + display: block; + list-style: none; + padding: 0; + width: 113px; + height: 113px; + margin: 9px 0 0 19px; + background-color: #eee; + overflow: hidden; + cursor: pointer; + position: relative; +} +#imgManager li.clearFloat { + float: none; + clear: both; + display: block; + width:0; + height:0; + margin: 0; + padding: 0; +} +#imgManager li img { + cursor: pointer; +} +#imgManager li .icon { + cursor: pointer; + width: 113px; + height: 113px; + position: absolute; + top: 0; + left: 0; + z-index: 2; + border: 0; + background-repeat: no-repeat; +} +#imgManager li .icon:hover { + width: 107px; + height: 107px; + border: 3px solid #1094fa; +} +#imgManager li.selected .icon { + background-image: url(images/success.png); + background-position: 75px 75px; +} +#imgManager li.selected .icon:hover { + width: 107px; + height: 107px; + border: 3px solid #1094fa; + background-position: 72px 72px; +} \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/background/background.html b/public/static/Ueditor/dialogs/background/background.html new file mode 100644 index 0000000..3cc2ac1 --- /dev/null +++ b/public/static/Ueditor/dialogs/background/background.html @@ -0,0 +1,56 @@ + + + + + + + + +
    +
    + + +
    +
    +
    +
    + +
    +
    + + +
    +
    +
    + : +
    +
    +
    +
    +
    + +
    +
    + : +
    +
    + :x:px  y:px +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + + diff --git a/public/static/Ueditor/dialogs/background/background.js b/public/static/Ueditor/dialogs/background/background.js new file mode 100644 index 0000000..9a4a131 --- /dev/null +++ b/public/static/Ueditor/dialogs/background/background.js @@ -0,0 +1,376 @@ +(function () { + + var onlineImage, + backupStyle = editor.queryCommandValue('background'); + + window.onload = function () { + initTabs(); + initColorSelector(); + }; + + /* 初始化tab标签 */ + function initTabs(){ + var tabs = $G('tabHeads').children; + for (var i = 0; i < tabs.length; i++) { + domUtils.on(tabs[i], "click", function (e) { + var target = e.target || e.srcElement; + for (var j = 0; j < tabs.length; j++) { + if(tabs[j] == target){ + tabs[j].className = "focus"; + var contentId = tabs[j].getAttribute('data-content-id'); + $G(contentId).style.display = "block"; + if(contentId == 'imgManager') { + initImagePanel(); + } + }else { + tabs[j].className = ""; + $G(tabs[j].getAttribute('data-content-id')).style.display = "none"; + } + } + }); + } + } + + /* 初始化颜色设置 */ + function initColorSelector () { + var obj = editor.queryCommandValue('background'); + if (obj) { + var color = obj['background-color'], + repeat = obj['background-repeat'] || 'repeat', + image = obj['background-image'] || '', + position = obj['background-position'] || 'center center', + pos = position.split(' '), + x = parseInt(pos[0]) || 0, + y = parseInt(pos[1]) || 0; + + if(repeat == 'no-repeat' && (x || y)) repeat = 'self'; + + image = image.match(/url[\s]*\(([^\)]*)\)/); + image = image ? image[1]:''; + updateFormState('colored', color, image, repeat, x, y); + } else { + updateFormState(); + } + + var updateHandler = function () { + updateFormState(); + updateBackground(); + } + domUtils.on($G('nocolorRadio'), 'click', updateBackground); + domUtils.on($G('coloredRadio'), 'click', updateHandler); + domUtils.on($G('url'), 'keyup', function(){ + if($G('url').value && $G('alignment').style.display == "none") { + utils.each($G('repeatType').children, function(item){ + item.selected = ('repeat' == item.getAttribute('value') ? 'selected':false); + }); + } + updateHandler(); + }); + domUtils.on($G('repeatType'), 'change', updateHandler); + domUtils.on($G('x'), 'keyup', updateBackground); + domUtils.on($G('y'), 'keyup', updateBackground); + + initColorPicker(); + } + + /* 初始化颜色选择器 */ + function initColorPicker() { + var me = editor, + cp = $G("colorPicker"); + + /* 生成颜色选择器ui对象 */ + var popup = new UE.ui.Popup({ + content: new UE.ui.ColorPicker({ + noColorText: me.getLang("clearColor"), + editor: me, + onpickcolor: function (t, color) { + updateFormState('colored', color); + updateBackground(); + UE.ui.Popup.postHide(); + }, + onpicknocolor: function (t, color) { + updateFormState('colored', 'transparent'); + updateBackground(); + UE.ui.Popup.postHide(); + } + }), + editor: me, + onhide: function () { + } + }); + + /* 设置颜色选择器 */ + domUtils.on(cp, "click", function () { + popup.showAnchor(this); + }); + domUtils.on(document, 'mousedown', function (evt) { + var el = evt.target || evt.srcElement; + UE.ui.Popup.postHide(el); + }); + domUtils.on(window, 'scroll', function () { + UE.ui.Popup.postHide(); + }); + } + + /* 初始化在线图片列表 */ + function initImagePanel() { + onlineImage = onlineImage || new OnlineImage('imageList'); + } + + /* 更新背景色设置面板 */ + function updateFormState (radio, color, url, align, x, y) { + var nocolorRadio = $G('nocolorRadio'), + coloredRadio = $G('coloredRadio'); + + if(radio) { + nocolorRadio.checked = (radio == 'colored' ? false:'checked'); + coloredRadio.checked = (radio == 'colored' ? 'checked':false); + } + if(color) { + domUtils.setStyle($G("colorPicker"), "background-color", color); + } + + if(url && /^\//.test(url)) { + var a = document.createElement('a'); + a.href = url; + browser.ie && (a.href = a.href); + url = browser.ie ? a.href:(a.protocol + '//' + a.host + a.pathname + a.search + a.hash); + } + + if(url || url === '') { + $G('url').value = url; + } + if(align) { + utils.each($G('repeatType').children, function(item){ + item.selected = (align == item.getAttribute('value') ? 'selected':false); + }); + } + if(x || y) { + $G('x').value = parseInt(x) || 0; + $G('y').value = parseInt(y) || 0; + } + + $G('alignment').style.display = coloredRadio.checked && $G('url').value ? '':'none'; + $G('custom').style.display = coloredRadio.checked && $G('url').value && $G('repeatType').value == 'self' ? '':'none'; + } + + /* 更新背景颜色 */ + function updateBackground () { + if ($G('coloredRadio').checked) { + var color = domUtils.getStyle($G("colorPicker"), "background-color"), + bgimg = $G("url").value, + align = $G("repeatType").value, + backgroundObj = { + "background-repeat": "no-repeat", + "background-position": "center center" + }; + + if (color) backgroundObj["background-color"] = color; + if (bgimg) backgroundObj["background-image"] = 'url(' + bgimg + ')'; + if (align == 'self') { + backgroundObj["background-position"] = $G("x").value + "px " + $G("y").value + "px"; + } else if (align == 'repeat-x' || align == 'repeat-y' || align == 'repeat') { + backgroundObj["background-repeat"] = align; + } + + editor.execCommand('background', backgroundObj); + } else { + editor.execCommand('background', null); + } + } + + + /* 在线图片 */ + function OnlineImage(target) { + this.container = utils.isString(target) ? document.getElementById(target) : target; + this.init(); + } + OnlineImage.prototype = { + init: function () { + this.reset(); + this.initEvents(); + }, + /* 初始化容器 */ + initContainer: function () { + this.container.innerHTML = ''; + this.list = document.createElement('ul'); + this.clearFloat = document.createElement('li'); + + domUtils.addClass(this.list, 'list'); + domUtils.addClass(this.clearFloat, 'clearFloat'); + + this.list.id = 'imageListUl'; + this.list.appendChild(this.clearFloat); + this.container.appendChild(this.list); + }, + /* 初始化滚动事件,滚动到地步自动拉取数据 */ + initEvents: function () { + var _this = this; + + /* 滚动拉取图片 */ + domUtils.on($G('imageList'), 'scroll', function(e){ + var panel = this; + if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) { + _this.getImageData(); + } + }); + /* 选中图片 */ + domUtils.on(this.container, 'click', function (e) { + var target = e.target || e.srcElement, + li = target.parentNode, + nodes = $G('imageListUl').childNodes; + + if (li.tagName.toLowerCase() == 'li') { + updateFormState('nocolor', null, ''); + for (var i = 0, node; node = nodes[i++];) { + if (node == li && !domUtils.hasClass(node, 'selected')) { + domUtils.addClass(node, 'selected'); + updateFormState('colored', null, li.firstChild.getAttribute("_src"), 'repeat'); + } else { + domUtils.removeClasses(node, 'selected'); + } + } + updateBackground(); + } + }); + }, + /* 初始化第一次的数据 */ + initData: function () { + + /* 拉取数据需要使用的值 */ + this.state = 0; + this.listSize = editor.getOpt('imageManagerListSize'); + this.listIndex = 0; + this.listEnd = false; + + /* 第一次拉取数据 */ + this.getImageData(); + }, + /* 重置界面 */ + reset: function() { + this.initContainer(); + this.initData(); + }, + /* 向后台拉取图片列表数据 */ + getImageData: function () { + var _this = this; + + if(!_this.listEnd && !this.isLoadingData) { + this.isLoadingData = true; + var url = editor.getActionUrl(editor.getOpt('imageManagerActionName')), + isJsonp = utils.isCrossDomainUrl(url); + ajax.request(url, { + 'timeout': 100000, + 'dataType': isJsonp ? 'jsonp':'', + 'data': utils.extend({ + start: this.listIndex, + size: this.listSize + }, editor.queryCommandValue('serverparam')), + 'method': 'get', + 'onsuccess': function (r) { + try { + var json = isJsonp ? r:eval('(' + r.responseText + ')'); + if (json.state == 'SUCCESS') { + _this.pushData(json.list); + _this.listIndex = parseInt(json.start) + parseInt(json.list.length); + if(_this.listIndex >= json.total) { + _this.listEnd = true; + } + _this.isLoadingData = false; + } + } catch (e) { + if(r.responseText.indexOf('ue_separate_ue') != -1) { + var list = r.responseText.split(r.responseText); + _this.pushData(list); + _this.listIndex = parseInt(list.length); + _this.listEnd = true; + _this.isLoadingData = false; + } + } + }, + 'onerror': function () { + _this.isLoadingData = false; + } + }); + } + }, + /* 添加图片到列表界面上 */ + pushData: function (list) { + var i, item, img, icon, _this = this, + urlPrefix = editor.getOpt('imageManagerUrlPrefix'); + for (i = 0; i < list.length; i++) { + if(list[i] && list[i].url) { + item = document.createElement('li'); + img = document.createElement('img'); + icon = document.createElement('span'); + + domUtils.on(img, 'load', (function(image){ + return function(){ + _this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight); + } + })(img)); + img.width = 113; + img.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) ); + img.setAttribute('_src', urlPrefix + list[i].url); + domUtils.addClass(icon, 'icon'); + + item.appendChild(img); + item.appendChild(icon); + this.list.insertBefore(item, this.clearFloat); + } + } + }, + /* 改变图片大小 */ + scale: function (img, w, h, type) { + var ow = img.width, + oh = img.height; + + if (type == 'justify') { + if (ow >= oh) { + img.width = w; + img.height = h * oh / ow; + img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; + } else { + img.width = w * ow / oh; + img.height = h; + img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; + } + } else { + if (ow >= oh) { + img.width = w * ow / oh; + img.height = h; + img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; + } else { + img.width = w; + img.height = h * oh / ow; + img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; + } + } + }, + getInsertList: function () { + var i, lis = this.list.children, list = [], align = getAlign(); + for (i = 0; i < lis.length; i++) { + if (domUtils.hasClass(lis[i], 'selected')) { + var img = lis[i].firstChild, + src = img.getAttribute('_src'); + list.push({ + src: src, + _src: src, + floatStyle: align + }); + } + + } + return list; + } + }; + + dialog.onok = function () { + updateBackground(); + editor.fireEvent('saveScene'); + }; + dialog.oncancel = function () { + editor.execCommand('background', backupStyle); + }; + +})(); \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/background/images/bg.png b/public/static/Ueditor/dialogs/background/images/bg.png new file mode 100644 index 0000000..580be0a Binary files /dev/null and b/public/static/Ueditor/dialogs/background/images/bg.png differ diff --git a/public/static/Ueditor/dialogs/background/images/success.png b/public/static/Ueditor/dialogs/background/images/success.png new file mode 100644 index 0000000..94f968d Binary files /dev/null and b/public/static/Ueditor/dialogs/background/images/success.png differ diff --git a/public/static/Ueditor/dialogs/charts/chart.config.js b/public/static/Ueditor/dialogs/charts/chart.config.js new file mode 100644 index 0000000..678b00d --- /dev/null +++ b/public/static/Ueditor/dialogs/charts/chart.config.js @@ -0,0 +1,65 @@ +/* + * 图表配置文件 + * */ + + +//不同类型的配置 +var typeConfig = [ + { + chart: { + type: 'line' + }, + plotOptions: { + line: { + dataLabels: { + enabled: false + }, + enableMouseTracking: true + } + } + }, { + chart: { + type: 'line' + }, + plotOptions: { + line: { + dataLabels: { + enabled: true + }, + enableMouseTracking: false + } + } + }, { + chart: { + type: 'area' + } + }, { + chart: { + type: 'bar' + } + }, { + chart: { + type: 'column' + } + }, { + chart: { + plotBackgroundColor: null, + plotBorderWidth: null, + plotShadow: false + }, + plotOptions: { + pie: { + allowPointSelect: true, + cursor: 'pointer', + dataLabels: { + enabled: true, + color: '#000000', + connectorColor: '#000000', + formatter: function() { + return ''+ this.point.name +': '+ ( Math.round( this.point.percentage*100 ) / 100 ) +' %'; + } + } + } + } + } +]; diff --git a/public/static/Ueditor/dialogs/charts/charts.css b/public/static/Ueditor/dialogs/charts/charts.css new file mode 100644 index 0000000..ac3c764 --- /dev/null +++ b/public/static/Ueditor/dialogs/charts/charts.css @@ -0,0 +1,165 @@ +html, body { + width: 100%; + height: 100%; + margin: 0; + padding: 0; + overflow-x: hidden; +} + +.main { + width: 100%; + overflow: hidden; +} + +.table-view { + height: 100%; + float: left; + margin: 20px; + width: 40%; +} + +.table-view .table-container { + width: 100%; + margin-bottom: 50px; + overflow: scroll; +} + +.table-view th { + padding: 5px 10px; + background-color: #F7F7F7; +} + +.table-view td { + width: 50px; + text-align: center; + padding:0; +} + +.table-container input { + width: 40px; + padding: 5px; + border: none; + outline: none; +} + +.table-view caption { + font-size: 18px; + text-align: left; +} + +.charts-view { + /*margin-left: 49%!important;*/ + width: 50%; + margin-left: 49%; + height: 400px; +} + +.charts-container { + border-left: 1px solid #c3c3c3; +} + +.charts-format fieldset { + padding-left: 20px; + margin-bottom: 50px; +} + +.charts-format legend { + padding-left: 10px; + padding-right: 10px; +} + +.format-item-container { + padding: 20px; +} + +.format-item-container label { + display: block; + margin: 10px 0; +} + +.charts-format .data-item { + border: 1px solid black; + outline: none; + padding: 2px 3px; +} + +/* 图表类型 */ + +.charts-type { + margin-top: 50px; + height: 300px; +} + +.scroll-view { + border: 1px solid #c3c3c3; + border-left: none; + border-right: none; + overflow: hidden; +} + +.scroll-container { + margin: 20px; + width: 100%; + overflow: hidden; +} + +.scroll-bed { + width: 10000px; + _margin-top: 20px; + -webkit-transition: margin-left .5s ease; + -moz-transition: margin-left .5s ease; + transition: margin-left .5s ease; +} + +.view-box { + display: inline-block; + *display: inline; + *zoom: 1; + margin-right: 20px; + border: 2px solid white; + line-height: 0; + overflow: hidden; + cursor: pointer; +} + +.view-box img { + border: 1px solid #cecece; +} + +.view-box.selected { + border-color: #7274A7; +} + +.button-container { + margin-bottom: 20px; + text-align: center; +} + +.button-container a { + display: inline-block; + width: 100px; + height: 25px; + line-height: 25px; + border: 1px solid #c2ccd1; + margin-right: 30px; + text-decoration: none; + color: black; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} + +.button-container a:HOVER { + background: #fcfcfc; +} + +.button-container a:ACTIVE { + border-top-color: #c2ccd1; + box-shadow:inset 0 5px 4px -4px rgba(49, 49, 64, 0.1); +} + +.edui-charts-not-data { + height: 100px; + line-height: 100px; + text-align: center; +} \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/charts/charts.html b/public/static/Ueditor/dialogs/charts/charts.html new file mode 100644 index 0000000..70e2314 --- /dev/null +++ b/public/static/Ueditor/dialogs/charts/charts.html @@ -0,0 +1,89 @@ + + + + chart + + + + + +
    +
    +

    +
    +

    +
    +
    +
    + +
    + + +
    +
    +
    +
    + +
    + + + + +
    +
    +
    + +
    + +

    +
    +
    +
    + +
    + +

    +
    +
    +
    +
    +
    +
    +
    +
    +

    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + + + + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/charts/charts.js b/public/static/Ueditor/dialogs/charts/charts.js new file mode 100644 index 0000000..37344fd --- /dev/null +++ b/public/static/Ueditor/dialogs/charts/charts.js @@ -0,0 +1,519 @@ +/* + * 图片转换对话框脚本 + **/ + +var tableData = [], + //编辑器页面table + editorTable = null, + chartsConfig = window.typeConfig, + resizeTimer = null, + //初始默认图表类型 + currentChartType = 0; + +window.onload = function () { + + editorTable = domUtils.findParentByTagName( editor.selection.getRange().startContainer, 'table', true); + + //未找到表格, 显示错误页面 + if ( !editorTable ) { + document.body.innerHTML = "
    未找到数据
    "; + return; + } + + //初始化图表类型选择 + initChartsTypeView(); + renderTable( editorTable ); + initEvent(); + initUserConfig( editorTable.getAttribute( "data-chart" ) ); + $( "#scrollBed .view-box:eq("+ currentChartType +")" ).trigger( "click" ); + updateViewType( currentChartType ); + + dialog.addListener( "resize", function () { + + if ( resizeTimer != null ) { + window.clearTimeout( resizeTimer ); + } + + resizeTimer = window.setTimeout( function () { + + resizeTimer = null; + + renderCharts(); + + }, 500 ); + + } ); + +}; + +function initChartsTypeView () { + + var contents = []; + + for ( var i = 0, len = chartsConfig.length; i
    ' ); + + } + + $( "#scrollBed" ).html( contents.join( "" ) ); + +} + +//渲染table, 以便用户修改数据 +function renderTable ( table ) { + + var tableHtml = []; + + //构造数据 + for ( var i = 0, row; row = table.rows[ i ]; i++ ) { + + tableData[ i ] = []; + tableHtml[ i ] = []; + + for ( var j = 0, cell; cell = row.cells[ j ]; j++ ) { + + var value = getCellValue( cell ); + + if ( i > 0 && j > 0 ) { + value = +value; + } + + if ( i === 0 || j === 0 ) { + tableHtml[ i ].push( ''+ value +'' ); + } else { + tableHtml[ i ].push( '' ); + } + + tableData[ i ][ j ] = value; + + } + + tableHtml[ i ] = tableHtml[ i ].join( "" ); + + } + + //draw 表格 + $( "#tableContainer" ).html( ''+ tableHtml.join( "" ) +'
    ' ); + +} + +/* + * 根据表格已有的图表属性初始化当前图表属性 + */ +function initUserConfig ( config ) { + + var parsedConfig = {}; + + if ( !config ) { + return; + } + + config = config.split( ";" ); + + $.each( config, function ( index, item ) { + + item = item.split( ":" ); + parsedConfig[ item[ 0 ] ] = item[ 1 ]; + + } ); + + setUserConfig( parsedConfig ); + +} + +function initEvent () { + + var cacheValue = null, + //图表类型数 + typeViewCount = chartsConfig.length- 1, + $chartsTypeViewBox = $( '#scrollBed .view-box' ); + + $( ".charts-format" ).delegate( ".format-ctrl", "change", function () { + + renderCharts(); + + } ) + + $( ".table-view" ).delegate( ".data-item", "focus", function () { + + cacheValue = this.value; + + } ).delegate( ".data-item", "blur", function () { + + if ( this.value !== cacheValue ) { + renderCharts(); + } + + cacheValue = null; + + } ); + + $( "#buttonContainer" ).delegate( "a", "click", function (e) { + + e.preventDefault(); + + if ( this.getAttribute( "data-title" ) === 'prev' ) { + + if ( currentChartType > 0 ) { + currentChartType--; + updateViewType( currentChartType ); + } + + } else { + + if ( currentChartType < typeViewCount ) { + currentChartType++; + updateViewType( currentChartType ); + } + + } + + } ); + + //图表类型变化 + $( '#scrollBed' ).delegate( ".view-box", "click", function (e) { + + var index = $( this ).attr( "data-chart-type" ); + $chartsTypeViewBox.removeClass( "selected" ); + $( $chartsTypeViewBox[ index ] ).addClass( "selected" ); + + currentChartType = index | 0; + + //饼图, 禁用部分配置 + if ( currentChartType === chartsConfig.length - 1 ) { + + disableNotPieConfig(); + + //启用完整配置 + } else { + + enableNotPieConfig(); + + } + + renderCharts(); + + } ); + +} + +function renderCharts () { + + var data = collectData(); + + $('#chartsContainer').highcharts( $.extend( {}, chartsConfig[ currentChartType ], { + + credits: { + enabled: false + }, + exporting: { + enabled: false + }, + title: { + text: data.title, + x: -20 //center + }, + subtitle: { + text: data.subTitle, + x: -20 + }, + xAxis: { + title: { + text: data.xTitle + }, + categories: data.categories + }, + yAxis: { + title: { + text: data.yTitle + }, + plotLines: [{ + value: 0, + width: 1, + color: '#808080' + }] + }, + tooltip: { + enabled: true, + valueSuffix: data.suffix + }, + legend: { + layout: 'vertical', + align: 'right', + verticalAlign: 'middle', + borderWidth: 1 + }, + series: data.series + + } )); + +} + +function updateViewType ( index ) { + + $( "#scrollBed" ).css( 'marginLeft', -index*324+'px' ); + +} + +function collectData () { + + var form = document.forms[ 'data-form' ], + data = null; + + if ( currentChartType !== chartsConfig.length - 1 ) { + + data = getSeriesAndCategories(); + $.extend( data, getUserConfig() ); + + //饼图数据格式 + } else { + data = getSeriesForPieChart(); + data.title = form[ 'title' ].value; + data.suffix = form[ 'unit' ].value; + } + + return data; + +} + +/** + * 获取用户配置信息 + */ +function getUserConfig () { + + var form = document.forms[ 'data-form' ], + info = { + title: form[ 'title' ].value, + subTitle: form[ 'sub-title' ].value, + xTitle: form[ 'x-title' ].value, + yTitle: form[ 'y-title' ].value, + suffix: form[ 'unit' ].value, + //数据对齐方式 + tableDataFormat: getTableDataFormat (), + //饼图提示文字 + tip: $( "#tipInput" ).val() + }; + + return info; + +} + +function setUserConfig ( config ) { + + var form = document.forms[ 'data-form' ]; + + config.title && ( form[ 'title' ].value = config.title ); + config.subTitle && ( form[ 'sub-title' ].value = config.subTitle ); + config.xTitle && ( form[ 'x-title' ].value = config.xTitle ); + config.yTitle && ( form[ 'y-title' ].value = config.yTitle ); + config.suffix && ( form[ 'unit' ].value = config.suffix ); + config.dataFormat == "-1" && ( form[ 'charts-format' ][ 1 ].checked = true ); + config.tip && ( form[ 'tip' ].value = config.tip ); + currentChartType = config.chartType || 0; + +} + +function getSeriesAndCategories () { + + var form = document.forms[ 'data-form' ], + series = [], + categories = [], + tmp = [], + tableData = getTableData(); + + //反转数据 + if ( getTableDataFormat() === "-1" ) { + + for ( var i = 0, len = tableData.length; i < len; i++ ) { + + for ( var j = 0, jlen = tableData[ i ].length; j < jlen; j++ ) { + + if ( !tmp[ j ] ) { + tmp[ j ] = []; + } + + tmp[ j ][ i ] = tableData[ i ][ j ]; + + } + + } + + tableData = tmp; + + } + + categories = tableData[0].slice( 1 ); + + for ( var i = 1, data; data = tableData[ i ]; i++ ) { + + series.push( { + name: data[ 0 ], + data: data.slice( 1 ) + } ); + + } + + return { + series: series, + categories: categories + }; + +} + +/* + * 获取数据源数据对齐方式 + */ +function getTableDataFormat () { + + var form = document.forms[ 'data-form' ], + items = form['charts-format']; + + return items[ 0 ].checked ? items[ 0 ].value : items[ 1 ].value; + +} + +/* + * 禁用非饼图类型的配置项 + */ +function disableNotPieConfig() { + + updateConfigItem( 'disable' ); + +} + +/* + * 启用非饼图类型的配置项 + */ +function enableNotPieConfig() { + + updateConfigItem( 'enable' ); + +} + +function updateConfigItem ( value ) { + + var table = $( "#showTable" )[ 0 ], + isDisable = value === 'disable' ? true : false; + + //table中的input处理 + for ( var i = 2 , row; row = table.rows[ i ]; i++ ) { + + for ( var j = 1, cell; cell = row.cells[ j ]; j++ ) { + + $( "input", cell ).attr( "disabled", isDisable ); + + } + + } + + //其他项处理 + $( "input.not-pie-item" ).attr( "disabled", isDisable ); + $( "#tipInput" ).attr( "disabled", !isDisable ) + +} + +/* + * 获取饼图数据 + * 饼图的数据只取第一行的 + **/ +function getSeriesForPieChart () { + + var series = { + type: 'pie', + name: $("#tipInput").val(), + data: [] + }, + tableData = getTableData(); + + + for ( var j = 1, jlen = tableData[ 0 ].length; j < jlen; j++ ) { + + var title = tableData[ 0 ][ j ], + val = tableData[ 1 ][ j ]; + + series.data.push( [ title, val ] ); + + } + + return { + series: [ series ] + }; + +} + +function getTableData () { + + var table = document.getElementById( "showTable" ), + xCount = table.rows[0].cells.length - 1, + values = getTableInputValue(); + + for ( var i = 0, value; value = values[ i ]; i++ ) { + + tableData[ Math.floor( i / xCount ) + 1 ][ i % xCount + 1 ] = values[ i ]; + + } + + return tableData; + +} + +function getTableInputValue () { + + var table = document.getElementById( "showTable" ), + inputs = table.getElementsByTagName( "input" ), + values = []; + + for ( var i = 0, input; input = inputs[ i ]; i++ ) { + values.push( input.value | 0 ); + } + + return values; + +} + +function getCellValue ( cell ) { + + var value = utils.trim( ( cell.innerText || cell.textContent || '' ) ); + + return value.replace( new RegExp( UE.dom.domUtils.fillChar, 'g' ), '' ).replace( /^\s+|\s+$/g, '' ); + +} + + +//dialog确认事件 +dialog.onok = function () { + + //收集信息 + var form = document.forms[ 'data-form' ], + info = getUserConfig(); + + //添加图表类型 + info.chartType = currentChartType; + + //同步表格数据到编辑器 + syncTableData(); + + //执行图表命令 + editor.execCommand( 'charts', info ); + +}; + +/* + * 同步图表编辑视图的表格数据到编辑器里的原始表格 + */ +function syncTableData () { + + var tableData = getTableData(); + + for ( var i = 1, row; row = editorTable.rows[ i ]; i++ ) { + + for ( var j = 1, cell; cell = row.cells[ j ]; j++ ) { + + cell.innerHTML = tableData[ i ] [ j ]; + + } + + } + +} \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/charts/images/charts0.png b/public/static/Ueditor/dialogs/charts/images/charts0.png new file mode 100644 index 0000000..9485e5e Binary files /dev/null and b/public/static/Ueditor/dialogs/charts/images/charts0.png differ diff --git a/public/static/Ueditor/dialogs/charts/images/charts1.png b/public/static/Ueditor/dialogs/charts/images/charts1.png new file mode 100644 index 0000000..b5a0039 Binary files /dev/null and b/public/static/Ueditor/dialogs/charts/images/charts1.png differ diff --git a/public/static/Ueditor/dialogs/charts/images/charts2.png b/public/static/Ueditor/dialogs/charts/images/charts2.png new file mode 100644 index 0000000..7c91a39 Binary files /dev/null and b/public/static/Ueditor/dialogs/charts/images/charts2.png differ diff --git a/public/static/Ueditor/dialogs/charts/images/charts3.png b/public/static/Ueditor/dialogs/charts/images/charts3.png new file mode 100644 index 0000000..a6bc29b Binary files /dev/null and b/public/static/Ueditor/dialogs/charts/images/charts3.png differ diff --git a/public/static/Ueditor/dialogs/charts/images/charts4.png b/public/static/Ueditor/dialogs/charts/images/charts4.png new file mode 100644 index 0000000..742006a Binary files /dev/null and b/public/static/Ueditor/dialogs/charts/images/charts4.png differ diff --git a/public/static/Ueditor/dialogs/charts/images/charts5.png b/public/static/Ueditor/dialogs/charts/images/charts5.png new file mode 100644 index 0000000..c49a296 Binary files /dev/null and b/public/static/Ueditor/dialogs/charts/images/charts5.png differ diff --git a/public/static/Ueditor/dialogs/emotion/emotion.css b/public/static/Ueditor/dialogs/emotion/emotion.css new file mode 100644 index 0000000..f801105 --- /dev/null +++ b/public/static/Ueditor/dialogs/emotion/emotion.css @@ -0,0 +1,43 @@ +.jd img{ + background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top; + cursor:pointer;width:35px;height:35px;display:block; +} +.pp img{ + background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top; + cursor:pointer;width:25px;height:25px;display:block; +} +.ldw img{ + background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top; + cursor:pointer;width:35px;height:35px;display:block; +} +.tsj img{ + background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top; + cursor:pointer;width:35px;height:35px;display:block; +} +.cat img{ + background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top; + cursor:pointer;width:35px;height:35px;display:block; +} +.bb img{ + background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top; + cursor:pointer;width:35px;height:35px;display:block; +} +.youa img{ + background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top; + cursor:pointer;width:35px;height:35px;display:block; +} + +.smileytable td {height: 37px;} +#tabPanel{margin-left:5px;overflow: hidden;} +#tabContent {float:left;background:#FFFFFF;} +#tabContent div{display: none;width:480px;overflow:hidden;} +#tabIconReview.show{left:17px;display:block;} +.menuFocus{background:#ACCD3C;} +.menuDefault{background:#FFFFFF;} +#tabIconReview{position:absolute;left:406px;left:398px \9;top:41px;z-index:65533;width:90px;height:76px;} +img.review{width:90px;height:76px;border:2px solid #9cb945;background:#FFFFFF;background-position:center;background-repeat:no-repeat;} + +.wrapper .tabbody{position:relative;float:left;clear:both;padding:10px;width: 95%;} +.tabbody table{width: 100%;} +.tabbody td{border:1px solid #BAC498;} +.tabbody td span{display: block;zoom:1;padding:0 4px;} \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/emotion/emotion.html b/public/static/Ueditor/dialogs/emotion/emotion.html new file mode 100644 index 0000000..fca0850 --- /dev/null +++ b/public/static/Ueditor/dialogs/emotion/emotion.html @@ -0,0 +1,54 @@ + + + + + + + + + + +
    +
    + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/emotion/emotion.js b/public/static/Ueditor/dialogs/emotion/emotion.js new file mode 100644 index 0000000..6e158a9 --- /dev/null +++ b/public/static/Ueditor/dialogs/emotion/emotion.js @@ -0,0 +1,186 @@ +window.onload = function () { + editor.setOpt({ + emotionLocalization:false + }); + + emotion.SmileyPath = editor.options.emotionLocalization === true ? 'images/' : "http://img.baidu.com/hi/"; + emotion.SmileyBox = createTabList( emotion.tabNum ); + emotion.tabExist = createArr( emotion.tabNum ); + + initImgName(); + initEvtHandler( "tabHeads" ); +}; + +function initImgName() { + for ( var pro in emotion.SmilmgName ) { + var tempName = emotion.SmilmgName[pro], + tempBox = emotion.SmileyBox[pro], + tempStr = ""; + + if ( tempBox.length ) return; + for ( var i = 1; i <= tempName[1]; i++ ) { + tempStr = tempName[0]; + if ( i < 10 ) tempStr = tempStr + '0'; + tempStr = tempStr + i + '.gif'; + tempBox.push( tempStr ); + } + } +} + +function initEvtHandler( conId ) { + var tabHeads = $G( conId ); + for ( var i = 0, j = 0; i < tabHeads.childNodes.length; i++ ) { + var tabObj = tabHeads.childNodes[i]; + if ( tabObj.nodeType == 1 ) { + domUtils.on( tabObj, "click", (function ( index ) { + return function () { + switchTab( index ); + }; + })( j ) ); + j++; + } + } + switchTab( 0 ); + $G( "tabIconReview" ).style.display = 'none'; +} + +function InsertSmiley( url, evt ) { + var obj = { + src:editor.options.emotionLocalization ? editor.options.UEDITOR_HOME_URL + "dialogs/emotion/" + url : url + }; + obj._src = obj.src; + editor.execCommand( 'insertimage', obj ); + if ( !evt.ctrlKey ) { + dialog.popup.hide(); + } +} + +function switchTab( index ) { + + autoHeight( index ); + if ( emotion.tabExist[index] == 0 ) { + emotion.tabExist[index] = 1; + createTab( 'tab' + index ); + } + //获取呈现元素句柄数组 + var tabHeads = $G( "tabHeads" ).getElementsByTagName( "span" ), + tabBodys = $G( "tabBodys" ).getElementsByTagName( "div" ), + i = 0, L = tabHeads.length; + //隐藏所有呈现元素 + for ( ; i < L; i++ ) { + tabHeads[i].className = ""; + tabBodys[i].style.display = "none"; + } + //显示对应呈现元素 + tabHeads[index].className = "focus"; + tabBodys[index].style.display = "block"; +} + +function autoHeight( index ) { + var iframe = dialog.getDom( "iframe" ), + parent = iframe.parentNode.parentNode; + switch ( index ) { + case 0: + iframe.style.height = "380px"; + parent.style.height = "392px"; + break; + case 1: + iframe.style.height = "220px"; + parent.style.height = "232px"; + break; + case 2: + iframe.style.height = "260px"; + parent.style.height = "272px"; + break; + case 3: + iframe.style.height = "300px"; + parent.style.height = "312px"; + break; + case 4: + iframe.style.height = "140px"; + parent.style.height = "152px"; + break; + case 5: + iframe.style.height = "260px"; + parent.style.height = "272px"; + break; + case 6: + iframe.style.height = "230px"; + parent.style.height = "242px"; + break; + default: + + } +} + + +function createTab( tabName ) { + var faceVersion = "?v=1.1", //版本号 + tab = $G( tabName ), //获取将要生成的Div句柄 + imagePath = emotion.SmileyPath + emotion.imageFolders[tabName], //获取显示表情和预览表情的路径 + positionLine = 11 / 2, //中间数 + iWidth = iHeight = 35, //图片长宽 + iColWidth = 3, //表格剩余空间的显示比例 + tableCss = emotion.imageCss[tabName], + cssOffset = emotion.imageCssOffset[tabName], + textHTML = [''], + i = 0, imgNum = emotion.SmileyBox[tabName].length, imgColNum = 11, faceImage, + sUrl, realUrl, posflag, offset, infor; + + for ( ; i < imgNum; ) { + textHTML.push( '' ); + for ( var j = 0; j < imgColNum; j++, i++ ) { + faceImage = emotion.SmileyBox[tabName][i]; + if ( faceImage ) { + sUrl = imagePath + faceImage + faceVersion; + realUrl = imagePath + faceImage; + posflag = j < positionLine ? 0 : 1; + offset = cssOffset * i * (-1) - 1; + infor = emotion.SmileyInfor[tabName][i]; + + textHTML.push( '' ); + } + textHTML.push( '' ); + } + textHTML.push( '
    ' ); + textHTML.push( '' ); + textHTML.push( '' ); + textHTML.push( '' ); + } else { + textHTML.push( '' ); + } + textHTML.push( '
    ' ); + textHTML = textHTML.join( "" ); + tab.innerHTML = textHTML; +} + +function over( td, srcPath, posFlag ) { + td.style.backgroundColor = "#ACCD3C"; + $G( 'faceReview' ).style.backgroundImage = "url(" + srcPath + ")"; + if ( posFlag == 1 ) $G( "tabIconReview" ).className = "show"; + $G( "tabIconReview" ).style.display = 'block'; +} + +function out( td ) { + td.style.backgroundColor = "transparent"; + var tabIconRevew = $G( "tabIconReview" ); + tabIconRevew.className = ""; + tabIconRevew.style.display = 'none'; +} + +function createTabList( tabNum ) { + var obj = {}; + for ( var i = 0; i < tabNum; i++ ) { + obj["tab" + i] = []; + } + return obj; +} + +function createArr( tabNum ) { + var arr = []; + for ( var i = 0; i < tabNum; i++ ) { + arr[i] = 0; + } + return arr; +} + diff --git a/public/static/Ueditor/dialogs/emotion/images/0.gif b/public/static/Ueditor/dialogs/emotion/images/0.gif new file mode 100644 index 0000000..6964168 Binary files /dev/null and b/public/static/Ueditor/dialogs/emotion/images/0.gif differ diff --git a/public/static/Ueditor/dialogs/emotion/images/bface.gif b/public/static/Ueditor/dialogs/emotion/images/bface.gif new file mode 100644 index 0000000..14fe618 Binary files /dev/null and b/public/static/Ueditor/dialogs/emotion/images/bface.gif differ diff --git a/public/static/Ueditor/dialogs/emotion/images/cface.gif b/public/static/Ueditor/dialogs/emotion/images/cface.gif new file mode 100644 index 0000000..bff947f Binary files /dev/null and b/public/static/Ueditor/dialogs/emotion/images/cface.gif differ diff --git a/public/static/Ueditor/dialogs/emotion/images/fface.gif b/public/static/Ueditor/dialogs/emotion/images/fface.gif new file mode 100644 index 0000000..0d8a6af Binary files /dev/null and b/public/static/Ueditor/dialogs/emotion/images/fface.gif differ diff --git a/public/static/Ueditor/dialogs/emotion/images/jxface2.gif b/public/static/Ueditor/dialogs/emotion/images/jxface2.gif new file mode 100644 index 0000000..a959c90 Binary files /dev/null and b/public/static/Ueditor/dialogs/emotion/images/jxface2.gif differ diff --git a/public/static/Ueditor/dialogs/emotion/images/neweditor-tab-bg.png b/public/static/Ueditor/dialogs/emotion/images/neweditor-tab-bg.png new file mode 100644 index 0000000..8f398b0 Binary files /dev/null and b/public/static/Ueditor/dialogs/emotion/images/neweditor-tab-bg.png differ diff --git a/public/static/Ueditor/dialogs/emotion/images/tface.gif b/public/static/Ueditor/dialogs/emotion/images/tface.gif new file mode 100644 index 0000000..1354f54 Binary files /dev/null and b/public/static/Ueditor/dialogs/emotion/images/tface.gif differ diff --git a/public/static/Ueditor/dialogs/emotion/images/wface.gif b/public/static/Ueditor/dialogs/emotion/images/wface.gif new file mode 100644 index 0000000..5667160 Binary files /dev/null and b/public/static/Ueditor/dialogs/emotion/images/wface.gif differ diff --git a/public/static/Ueditor/dialogs/emotion/images/yface.gif b/public/static/Ueditor/dialogs/emotion/images/yface.gif new file mode 100644 index 0000000..51608be Binary files /dev/null and b/public/static/Ueditor/dialogs/emotion/images/yface.gif differ diff --git a/public/static/Ueditor/dialogs/gmap/gmap.html b/public/static/Ueditor/dialogs/gmap/gmap.html new file mode 100644 index 0000000..c4cbfe6 --- /dev/null +++ b/public/static/Ueditor/dialogs/gmap/gmap.html @@ -0,0 +1,89 @@ + + + + + + + + + + +
    + + + + + + +
    +
    +
    + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/help/help.css b/public/static/Ueditor/dialogs/help/help.css new file mode 100644 index 0000000..4478475 --- /dev/null +++ b/public/static/Ueditor/dialogs/help/help.css @@ -0,0 +1,7 @@ +.wrapper{width: 370px;margin: 10px auto;zoom: 1;} +.tabbody{height: 360px;} +.tabbody .panel{width:100%;height: 360px;position: absolute;background: #fff;} +.tabbody .panel h1{font-size:26px;margin: 5px 0 0 5px;} +.tabbody .panel p{font-size:12px;margin: 5px 0 0 5px;} +.tabbody table{width:90%;line-height: 20px;margin: 5px 0 0 5px;;} +.tabbody table thead{font-weight: bold;line-height: 25px;} \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/help/help.html b/public/static/Ueditor/dialogs/help/help.html new file mode 100644 index 0000000..9e50060 --- /dev/null +++ b/public/static/Ueditor/dialogs/help/help.html @@ -0,0 +1,82 @@ + + + + 帮助 + + + + + +
    +
    + + +
    +
    +
    +

    UEditor

    +

    +

    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ctrl+b
    ctrl+c
    ctrl+x
    ctrl+v
    ctrl+y
    ctrl+z
    ctrl+i
    ctrl+u
    ctrl+a
    shift+enter
    alt+z
    +
    +
    +
    + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/help/help.js b/public/static/Ueditor/dialogs/help/help.js new file mode 100644 index 0000000..9a2272e --- /dev/null +++ b/public/static/Ueditor/dialogs/help/help.js @@ -0,0 +1,56 @@ +/** + * Created with JetBrains PhpStorm. + * User: xuheng + * Date: 12-9-26 + * Time: 下午1:06 + * To change this template use File | Settings | File Templates. + */ +/** + * tab点击处理事件 + * @param tabHeads + * @param tabBodys + * @param obj + */ +function clickHandler( tabHeads,tabBodys,obj ) { + //head样式更改 + for ( var k = 0, len = tabHeads.length; k < len; k++ ) { + tabHeads[k].className = ""; + } + obj.className = "focus"; + //body显隐 + var tabSrc = obj.getAttribute( "tabSrc" ); + for ( var j = 0, length = tabBodys.length; j < length; j++ ) { + var body = tabBodys[j], + id = body.getAttribute( "id" ); + body.onclick = function(){ + this.style.zoom = 1; + }; + if ( id != tabSrc ) { + body.style.zIndex = 1; + } else { + body.style.zIndex = 200; + } + } + +} + +/** + * TAB切换 + * @param tabParentId tab的父节点ID或者对象本身 + */ +function switchTab( tabParentId ) { + var tabElements = $G( tabParentId ).children, + tabHeads = tabElements[0].children, + tabBodys = tabElements[1].children; + + for ( var i = 0, length = tabHeads.length; i < length; i++ ) { + var head = tabHeads[i]; + if ( head.className === "focus" )clickHandler(tabHeads,tabBodys, head ); + head.onclick = function () { + clickHandler(tabHeads,tabBodys,this); + } + } +} +switchTab("helptab"); + +document.getElementById('version').innerHTML = parent.UE.version; \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/image/image.css b/public/static/Ueditor/dialogs/image/image.css new file mode 100644 index 0000000..52c2295 --- /dev/null +++ b/public/static/Ueditor/dialogs/image/image.css @@ -0,0 +1,894 @@ +@charset "utf-8"; +/* dialog样式 */ +.wrapper { + zoom: 1; + width: 630px; + *width: 626px; + height: 380px; + margin: 0 auto; + padding: 10px; + position: relative; + font-family: sans-serif; +} + +/*tab样式框大小*/ +.tabhead { + float:left; +} +.tabbody { + width: 100%; + height: 346px; + position: relative; + clear: both; +} + +.tabbody .panel { + position: absolute; + width: 0; + height: 0; + background: #fff; + overflow: hidden; + display: none; +} + +.tabbody .panel.focus { + width: 100%; + height: 346px; + display: block; +} + +/* 图片对齐方式 */ +.alignBar{ + float:right; + margin-top: 5px; + position: relative; +} + +.alignBar .algnLabel{ + float:left; + height: 20px; + line-height: 20px; +} + +.alignBar #alignIcon{ + zoom:1; + _display: inline; + display: inline-block; + position: relative; +} +.alignBar #alignIcon span{ + float: left; + cursor: pointer; + display: block; + width: 19px; + height: 17px; + margin-right: 3px; + margin-left: 3px; + background-image: url(./images/alignicon.jpg); +} +.alignBar #alignIcon .none-align{ + background-position: 0 -18px; +} +.alignBar #alignIcon .left-align{ + background-position: -20px -18px; +} +.alignBar #alignIcon .right-align{ + background-position: -40px -18px; +} +.alignBar #alignIcon .center-align{ + background-position: -60px -18px; +} +.alignBar #alignIcon .none-align.focus{ + background-position: 0 0; +} +.alignBar #alignIcon .left-align.focus{ + background-position: -20px 0; +} +.alignBar #alignIcon .right-align.focus{ + background-position: -40px 0; +} +.alignBar #alignIcon .center-align.focus{ + background-position: -60px 0; +} + + + + +/* 远程图片样式 */ +#remote { + z-index: 200; +} + +#remote .top{ + width: 100%; + margin-top: 25px; +} +#remote .left{ + display: block; + float: left; + width: 300px; + height:10px; +} +#remote .right{ + display: block; + float: right; + width: 300px; + height:10px; +} +#remote .row{ + margin-left: 20px; + clear: both; + height: 40px; +} + +#remote .row label{ + text-align: center; + width: 50px; + zoom:1; + _display: inline; + display:inline-block; + vertical-align: middle; +} +#remote .row label.algnLabel{ + float: left; + +} + +#remote input.text{ + width: 150px; + padding: 3px 6px; + font-size: 14px; + line-height: 1.42857143; + color: #555; + background-color: #fff; + background-image: none; + border: 1px solid #ccc; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +#remote input.text:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); +} +#remote #url{ + width: 500px; + margin-bottom: 2px; +} +#remote #width, +#remote #height{ + width: 20px; + margin-left: 2px; + margin-right: 2px; +} +#remote #border, +#remote #vhSpace, +#remote #title{ + width: 180px; + margin-right: 5px; +} +#remote #lock{ +} +#remote #lockicon{ + zoom: 1; + _display:inline; + display: inline-block; + width: 20px; + height: 20px; + background: url("../../themes/default/images/lock.gif") -13px -13px no-repeat; + vertical-align: middle; +} +#remote #preview{ + clear: both; + width: 260px; + height: 240px; + z-index: 9999; + margin-top: 10px; + background-color: #eee; + overflow: hidden; +} + +/* 上传图片 */ +.tabbody #upload.panel { + width: 0; + height: 0; + overflow: hidden; + position: absolute !important; + clip: rect(1px, 1px, 1px, 1px); + background: #fff; + display: block; +} + +.tabbody #upload.panel.focus { + width: 100%; + height: 346px; + display: block; + clip: auto; +} + +#upload .queueList { + margin: 0; + width: 100%; + height: 100%; + position: absolute; + overflow: hidden; +} + +#upload p { + margin: 0; +} + +.element-invisible { + width: 0 !important; + height: 0 !important; + border: 0; + padding: 0; + margin: 0; + overflow: hidden; + position: absolute !important; + clip: rect(1px, 1px, 1px, 1px); +} + +#upload .placeholder { + margin: 10px; + border: 2px dashed #e6e6e6; + *border: 0px dashed #e6e6e6; + height: 172px; + padding-top: 150px; + text-align: center; + background: url(./images/image.png) center 70px no-repeat; + color: #cccccc; + font-size: 18px; + position: relative; + top:0; + *top: 10px; +} + +#upload .placeholder .webuploader-pick { + font-size: 18px; + background: #00b7ee; + border-radius: 3px; + line-height: 44px; + padding: 0 30px; + *width: 120px; + color: #fff; + display: inline-block; + margin: 0 auto 20px auto; + cursor: pointer; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); +} + +#upload .placeholder .webuploader-pick-hover { + background: #00a2d4; +} + + +#filePickerContainer { + text-align: center; +} + +#upload .placeholder .flashTip { + color: #666666; + font-size: 12px; + position: absolute; + width: 100%; + text-align: center; + bottom: 20px; +} + +#upload .placeholder .flashTip a { + color: #0785d1; + text-decoration: none; +} + +#upload .placeholder .flashTip a:hover { + text-decoration: underline; +} + +#upload .placeholder.webuploader-dnd-over { + border-color: #999999; +} + +#upload .filelist { + list-style: none; + margin: 0; + padding: 0; + overflow-x: hidden; + overflow-y: auto; + position: relative; + height: 300px; +} + +#upload .filelist:after { + content: ''; + display: block; + width: 0; + height: 0; + overflow: hidden; + clear: both; + position: relative; +} + +#upload .filelist li { + width: 113px; + height: 113px; + background: url(./images/bg.png); + text-align: center; + margin: 9px 0 0 9px; + *margin: 6px 0 0 6px; + position: relative; + display: block; + float: left; + overflow: hidden; + font-size: 12px; +} + +#upload .filelist li p.log { + position: relative; + top: -45px; +} + +#upload .filelist li p.title { + position: absolute; + top: 0; + left: 0; + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + top: 5px; + text-indent: 5px; + text-align: left; +} + +#upload .filelist li p.progress { + position: absolute; + width: 100%; + bottom: 0; + left: 0; + height: 8px; + overflow: hidden; + z-index: 50; + margin: 0; + border-radius: 0; + background: none; + -webkit-box-shadow: 0 0 0; +} + +#upload .filelist li p.progress span { + display: none; + overflow: hidden; + width: 0; + height: 100%; + background: #1483d8 url(./images/progress.png) repeat-x; + + -webit-transition: width 200ms linear; + -moz-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; + transition: width 200ms linear; + + -webkit-animation: progressmove 2s linear infinite; + -moz-animation: progressmove 2s linear infinite; + -o-animation: progressmove 2s linear infinite; + -ms-animation: progressmove 2s linear infinite; + animation: progressmove 2s linear infinite; + + -webkit-transform: translateZ(0); +} + +@-webkit-keyframes progressmove { + 0% { + background-position: 0 0; + } + 100% { + background-position: 17px 0; + } +} + +@-moz-keyframes progressmove { + 0% { + background-position: 0 0; + } + 100% { + background-position: 17px 0; + } +} + +@keyframes progressmove { + 0% { + background-position: 0 0; + } + 100% { + background-position: 17px 0; + } +} + +#upload .filelist li p.imgWrap { + position: relative; + z-index: 2; + line-height: 113px; + vertical-align: middle; + overflow: hidden; + width: 113px; + height: 113px; + + -webkit-transform-origin: 50% 50%; + -moz-transform-origin: 50% 50%; + -o-transform-origin: 50% 50%; + -ms-transform-origin: 50% 50%; + transform-origin: 50% 50%; + + -webit-transition: 200ms ease-out; + -moz-transition: 200ms ease-out; + -o-transition: 200ms ease-out; + -ms-transition: 200ms ease-out; + transition: 200ms ease-out; +} + +#upload .filelist li img { + width: 100%; +} + +#upload .filelist li p.error { + background: #f43838; + color: #fff; + position: absolute; + bottom: 0; + left: 0; + height: 28px; + line-height: 28px; + width: 100%; + z-index: 100; + display:none; +} + +#upload .filelist li .success { + display: block; + position: absolute; + left: 0; + bottom: 0; + height: 40px; + width: 100%; + z-index: 200; + background: url(./images/success.png) no-repeat right bottom; + background: url(./images/success.gif) no-repeat right bottom \9; +} + +#upload .filelist li.filePickerBlock { + width: 113px; + height: 113px; + background: url(./images/image.png) no-repeat center 12px; + border: 1px solid #eeeeee; + border-radius: 0; +} +#upload .filelist li.filePickerBlock div.webuploader-pick { + width: 100%; + height: 100%; + margin: 0; + padding: 0; + opacity: 0; + background: none; + font-size: 0; +} + +#upload .filelist div.file-panel { + position: absolute; + height: 0; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#80000000', endColorstr='#80000000') \0; + background: rgba(0, 0, 0, 0.5); + width: 100%; + top: 0; + left: 0; + overflow: hidden; + z-index: 300; +} + +#upload .filelist div.file-panel span { + width: 24px; + height: 24px; + display: inline; + float: right; + text-indent: -9999px; + overflow: hidden; + background: url(./images/icons.png) no-repeat; + background: url(./images/icons.gif) no-repeat \9; + margin: 5px 1px 1px; + cursor: pointer; + -webkit-tap-highlight-color: rgba(0,0,0,0); + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +#upload .filelist div.file-panel span.rotateLeft { + display:none; + background-position: 0 -24px; +} + +#upload .filelist div.file-panel span.rotateLeft:hover { + background-position: 0 0; +} + +#upload .filelist div.file-panel span.rotateRight { + display:none; + background-position: -24px -24px; +} + +#upload .filelist div.file-panel span.rotateRight:hover { + background-position: -24px 0; +} + +#upload .filelist div.file-panel span.cancel { + background-position: -48px -24px; +} + +#upload .filelist div.file-panel span.cancel:hover { + background-position: -48px 0; +} + +#upload .statusBar { + height: 45px; + border-bottom: 1px solid #dadada; + margin: 0 10px; + padding: 0; + line-height: 45px; + vertical-align: middle; + position: relative; +} + +#upload .statusBar .progress { + border: 1px solid #1483d8; + width: 198px; + background: #fff; + height: 18px; + position: absolute; + top: 12px; + display: none; + text-align: center; + line-height: 18px; + color: #6dbfff; + margin: 0 10px 0 0; +} +#upload .statusBar .progress span.percentage { + width: 0; + height: 100%; + left: 0; + top: 0; + background: #1483d8; + position: absolute; +} +#upload .statusBar .progress span.text { + position: relative; + z-index: 10; +} + +#upload .statusBar .info { + display: inline-block; + font-size: 14px; + color: #666666; +} + +#upload .statusBar .btns { + position: absolute; + top: 7px; + right: 0; + line-height: 30px; +} + +#filePickerBtn { + display: inline-block; + float: left; +} +#upload .statusBar .btns .webuploader-pick, +#upload .statusBar .btns .uploadBtn, +#upload .statusBar .btns .uploadBtn.state-uploading, +#upload .statusBar .btns .uploadBtn.state-paused { + background: #ffffff; + border: 1px solid #cfcfcf; + color: #565656; + padding: 0 18px; + display: inline-block; + border-radius: 3px; + margin-left: 10px; + cursor: pointer; + font-size: 14px; + float: left; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +#upload .statusBar .btns .webuploader-pick-hover, +#upload .statusBar .btns .uploadBtn:hover, +#upload .statusBar .btns .uploadBtn.state-uploading:hover, +#upload .statusBar .btns .uploadBtn.state-paused:hover { + background: #f0f0f0; +} + +#upload .statusBar .btns .uploadBtn, +#upload .statusBar .btns .uploadBtn.state-paused{ + background: #00b7ee; + color: #fff; + border-color: transparent; +} +#upload .statusBar .btns .uploadBtn:hover, +#upload .statusBar .btns .uploadBtn.state-paused:hover{ + background: #00a2d4; +} + +#upload .statusBar .btns .uploadBtn.disabled { + pointer-events: none; + filter:alpha(opacity=60); + -moz-opacity:0.6; + -khtml-opacity: 0.6; + opacity: 0.6; +} + + + +/* 图片管理样式 */ +#online { + width: 100%; + height: 336px; + padding: 10px 0 0 0; +} +#online #imageList{ + width: 100%; + height: 100%; + overflow-x: hidden; + overflow-y: auto; + position: relative; +} +#online ul { + display: block; + list-style: none; + margin: 0; + padding: 0; +} +#online li { + float: left; + display: block; + list-style: none; + padding: 0; + width: 113px; + height: 113px; + margin: 0 0 9px 9px; + *margin: 0 0 6px 6px; + background-color: #eee; + overflow: hidden; + cursor: pointer; + position: relative; +} +#online li.clearFloat { + float: none; + clear: both; + display: block; + width:0; + height:0; + margin: 0; + padding: 0; +} +#online li img { + cursor: pointer; +} +#online li .icon { + cursor: pointer; + width: 113px; + height: 113px; + position: absolute; + top: 0; + left: 0; + z-index: 2; + border: 0; + background-repeat: no-repeat; +} +#online li .icon:hover { + width: 107px; + height: 107px; + border: 3px solid #1094fa; +} +#online li.selected .icon { + background-image: url(images/success.png); + background-image: url(images/success.gif)\9; + background-position: 75px 75px; +} +#online li.selected .icon:hover { + width: 107px; + height: 107px; + border: 3px solid #1094fa; + background-position: 72px 72px; +} + + +/* 图片搜索样式 */ +#search .searchBar { + width: 100%; + height: 30px; + margin: 10px 0 5px 0; + padding: 0; +} + +#search input.text{ + width: 150px; + padding: 3px 6px; + font-size: 14px; + line-height: 1.42857143; + color: #555; + background-color: #fff; + background-image: none; + border: 1px solid #ccc; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +#search input.text:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); +} +#search input.searchTxt { + margin-left:5px; + padding-left: 5px; + background: #FFF; + width: 300px; + *width: 260px; + height: 21px; + line-height: 21px; + float: left; + dislay: block; +} + +#search .searchType { + width: 65px; + height: 28px; + padding:0; + line-height: 28px; + border: 1px solid #d7d7d7; + border-radius: 0; + vertical-align: top; + margin-left: 5px; + float: left; + dislay: block; +} + +#search #searchBtn, +#search #searchReset { + display: inline-block; + margin-bottom: 0; + margin-right: 5px; + padding: 4px 10px; + font-weight: 400; + text-align: center; + vertical-align: middle; + cursor: pointer; + background-image: none; + border: 1px solid transparent; + white-space: nowrap; + font-size: 14px; + border-radius: 4px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + vertical-align: top; + float: right; +} + +#search #searchBtn { + color: white; + border-color: #285e8e; + background-color: #3b97d7; +} +#search #searchReset { + color: #333; + border-color: #ccc; + background-color: #fff; +} +#search #searchBtn:hover { + background-color: #3276b1; +} +#search #searchReset:hover { + background-color: #eee; +} + +#search .msg { + margin-left: 5px; +} + +#search .searchList{ + width: 100%; + height: 300px; + overflow: hidden; + clear: both; +} +#search .searchList ul{ + margin:0; + padding:0; + list-style:none; + clear: both; + width: 100%; + height: 100%; + overflow-x: hidden; + overflow-y: auto; + zoom: 1; + position: relative; +} + +#search .searchList li { + list-style:none; + float: left; + display: block; + width: 115px; + margin: 5px 10px 5px 20px; + *margin: 5px 10px 5px 15px; + padding:0; + font-size: 12px; + box-shadow: 0 1px 3px rgba(0, 0, 0, .3); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3); + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3); + position: relative; + vertical-align: top; + text-align: center; + overflow: hidden; + cursor: pointer; + filter: alpha(Opacity=100); + -moz-opacity: 1; + opacity: 1; + border: 2px solid #eee; +} + +#search .searchList li.selected { + filter: alpha(Opacity=40); + -moz-opacity: 0.4; + opacity: 0.4; + border: 2px solid #00a0e9; +} + +#search .searchList li p { + background-color: #eee; + margin: 0; + padding: 0; + position: relative; + width:100%; + height:115px; + overflow: hidden; +} + +#search .searchList li p img { + cursor: pointer; + border: 0; +} + +#search .searchList li a { + color: #999; + border-top: 1px solid #F2F2F2; + background: #FAFAFA; + text-align: center; + display: block; + padding: 0 5px; + width: 105px; + height:32px; + line-height:32px; + white-space:nowrap; + text-overflow:ellipsis; + text-decoration: none; + overflow: hidden; + word-break: break-all; +} + +#search .searchList a:hover { + text-decoration: underline; + color: #333; +} +#search .searchList .clearFloat{ + clear: both; +} \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/image/image.html b/public/static/Ueditor/dialogs/image/image.html new file mode 100644 index 0000000..08ca022 --- /dev/null +++ b/public/static/Ueditor/dialogs/image/image.html @@ -0,0 +1,120 @@ + + + + + ueditor图片对话框 + + + + + + + + + + + + + + +
    +
    + + + + +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    + + +
    +
    +
    +
    + +   px +   px + +
    +
    + + px +
    +
    + + px +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + 0% + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
      +
    • +
    +
    +
    + + +
    +
    +
    + + + + +
    +
    + + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/image/image.js b/public/static/Ueditor/dialogs/image/image.js new file mode 100644 index 0000000..0a59052 --- /dev/null +++ b/public/static/Ueditor/dialogs/image/image.js @@ -0,0 +1,1148 @@ +/** + * User: Jinqn + * Date: 14-04-08 + * Time: 下午16:34 + * 上传图片对话框逻辑代码,包括tab: 远程图片/上传图片/在线图片/搜索图片 + */ + +(function () { + + var remoteImage, + uploadImage, + onlineImage, + searchImage; + + window.onload = function () { + initTabs(); + initAlign(); + initButtons(); + }; + + /* 初始化tab标签 */ + function initTabs() { + var tabs = $G('tabhead').children; + for (var i = 0; i < tabs.length; i++) { + domUtils.on(tabs[i], "click", function (e) { + var target = e.target || e.srcElement; + setTabFocus(target.getAttribute('data-content-id')); + }); + } + + var img = editor.selection.getRange().getClosedNode(); + if (img && img.tagName && img.tagName.toLowerCase() == 'img') { + setTabFocus('remote'); + } else { + setTabFocus('upload'); + } + } + + /* 初始化tabbody */ + function setTabFocus(id) { + if(!id) return; + var i, bodyId, tabs = $G('tabhead').children; + for (i = 0; i < tabs.length; i++) { + bodyId = tabs[i].getAttribute('data-content-id'); + if (bodyId == id) { + domUtils.addClass(tabs[i], 'focus'); + domUtils.addClass($G(bodyId), 'focus'); + } else { + domUtils.removeClasses(tabs[i], 'focus'); + domUtils.removeClasses($G(bodyId), 'focus'); + } + } + switch (id) { + case 'remote': + remoteImage = remoteImage || new RemoteImage(); + break; + case 'upload': + setAlign(editor.getOpt('imageInsertAlign')); + uploadImage = uploadImage || new UploadImage('queueList'); + break; + case 'online': + setAlign(editor.getOpt('imageManagerInsertAlign')); + onlineImage = onlineImage || new OnlineImage('imageList'); + onlineImage.reset(); + break; + case 'search': + setAlign(editor.getOpt('imageManagerInsertAlign')); + searchImage = searchImage || new SearchImage(); + break; + } + } + + /* 初始化onok事件 */ + function initButtons() { + + dialog.onok = function () { + var remote = false, list = [], id, tabs = $G('tabhead').children; + for (var i = 0; i < tabs.length; i++) { + if (domUtils.hasClass(tabs[i], 'focus')) { + id = tabs[i].getAttribute('data-content-id'); + break; + } + } + + switch (id) { + case 'remote': + list = remoteImage.getInsertList(); + break; + case 'upload': + list = uploadImage.getInsertList(); + var count = uploadImage.getQueueCount(); + if (count) { + $('.info', '#queueList').html('' + '还有2个未上传文件'.replace(/[\d]/, count) + ''); + return false; + } + break; + case 'online': + list = onlineImage.getInsertList(); + break; + case 'search': + list = searchImage.getInsertList(); + remote = true; + break; + } + + if(list) { + editor.execCommand('insertimage', list); + remote && editor.fireEvent("catchRemoteImage"); + } + }; + } + + + /* 初始化对其方式的点击事件 */ + function initAlign(){ + /* 点击align图标 */ + domUtils.on($G("alignIcon"), 'click', function(e){ + var target = e.target || e.srcElement; + if(target.className && target.className.indexOf('-align') != -1) { + setAlign(target.getAttribute('data-align')); + } + }); + } + + /* 设置对齐方式 */ + function setAlign(align){ + align = align || 'none'; + var aligns = $G("alignIcon").children; + for(i = 0; i < aligns.length; i++){ + if(aligns[i].getAttribute('data-align') == align) { + domUtils.addClass(aligns[i], 'focus'); + $G("align").value = aligns[i].getAttribute('data-align'); + } else { + domUtils.removeClasses(aligns[i], 'focus'); + } + } + } + /* 获取对齐方式 */ + function getAlign(){ + var align = $G("align").value || 'none'; + return align == 'none' ? '':align; + } + + + /* 在线图片 */ + function RemoteImage(target) { + this.container = utils.isString(target) ? document.getElementById(target) : target; + this.init(); + } + RemoteImage.prototype = { + init: function () { + this.initContainer(); + this.initEvents(); + }, + initContainer: function () { + this.dom = { + 'url': $G('url'), + 'width': $G('width'), + 'height': $G('height'), + 'border': $G('border'), + 'vhSpace': $G('vhSpace'), + 'title': $G('title'), + 'align': $G('align') + }; + var img = editor.selection.getRange().getClosedNode(); + if (img) { + this.setImage(img); + } + }, + initEvents: function () { + var _this = this, + locker = $G('lock'); + + /* 改变url */ + domUtils.on($G("url"), 'keyup', updatePreview); + domUtils.on($G("border"), 'keyup', updatePreview); + domUtils.on($G("title"), 'keyup', updatePreview); + + domUtils.on($G("width"), 'keyup', function(){ + updatePreview(); + if(locker.checked) { + var proportion =locker.getAttribute('data-proportion'); + $G('height').value = Math.round(this.value / proportion); + } else { + _this.updateLocker(); + } + }); + domUtils.on($G("height"), 'keyup', function(){ + updatePreview(); + if(locker.checked) { + var proportion =locker.getAttribute('data-proportion'); + $G('width').value = Math.round(this.value * proportion); + } else { + _this.updateLocker(); + } + }); + domUtils.on($G("lock"), 'change', function(){ + var proportion = parseInt($G("width").value) /parseInt($G("height").value); + locker.setAttribute('data-proportion', proportion); + }); + + function updatePreview(){ + _this.setPreview(); + } + }, + updateLocker: function(){ + var width = $G('width').value, + height = $G('height').value, + locker = $G('lock'); + if(width && height && width == parseInt(width) && height == parseInt(height)) { + locker.disabled = false; + locker.title = ''; + } else { + locker.checked = false; + locker.disabled = 'disabled'; + locker.title = lang.remoteLockError; + } + }, + setImage: function(img){ + /* 不是正常的图片 */ + if (!img.tagName || img.tagName.toLowerCase() != 'img' && !img.getAttribute("src") || !img.src) return; + + var wordImgFlag = img.getAttribute("word_img"), + src = wordImgFlag ? wordImgFlag.replace("&", "&") : (img.getAttribute('_src') || img.getAttribute("src", 2).replace("&", "&")), + align = editor.queryCommandValue("imageFloat"); + + /* 防止onchange事件循环调用 */ + if (src !== $G("url").value) $G("url").value = src; + if(src) { + /* 设置表单内容 */ + $G("width").value = img.width || ''; + $G("height").value = img.height || ''; + $G("border").value = img.getAttribute("border") || '0'; + $G("vhSpace").value = img.getAttribute("vspace") || '0'; + $G("title").value = img.title || img.alt || ''; + setAlign(align); + this.setPreview(); + this.updateLocker(); + } + }, + getData: function(){ + var data = {}; + for(var k in this.dom){ + data[k] = this.dom[k].value; + } + return data; + }, + setPreview: function(){ + var url = $G('url').value, + ow = parseInt($G('width').value, 10) || 0, + oh = parseInt($G('height').value, 10) || 0, + border = parseInt($G('border').value, 10) || 0, + title = $G('title').value, + preview = $G('preview'), + width, + height; + + url = utils.unhtmlForUrl(url); + title = utils.unhtml(title); + + width = ((!ow || !oh) ? preview.offsetWidth:Math.min(ow, preview.offsetWidth)); + width = width+(border*2) > preview.offsetWidth ? width:(preview.offsetWidth - (border*2)); + height = (!ow || !oh) ? '':width*oh/ow; + + if(url) { + preview.innerHTML = ''; + } + }, + getInsertList: function () { + var data = this.getData(); + if(data['url']) { + return [{ + src: data['url'], + _src: data['url'], + width: data['width'] || '', + height: data['height'] || '', + border: data['border'] || '', + floatStyle: data['align'] || '', + vspace: data['vhSpace'] || '', + title: data['title'] || '', + alt: data['title'] || '', + style: "width:" + data['width'] + "px;height:" + data['height'] + "px;" + }]; + } else { + return []; + } + } + }; + + + + /* 上传图片 */ + function UploadImage(target) { + this.$wrap = target.constructor == String ? $('#' + target) : $(target); + this.init(); + } + UploadImage.prototype = { + init: function () { + this.imageList = []; + this.initContainer(); + this.initUploader(); + }, + initContainer: function () { + this.$queue = this.$wrap.find('.filelist'); + }, + /* 初始化容器 */ + initUploader: function () { + var _this = this, + $ = jQuery, // just in case. Make sure it's not an other libaray. + $wrap = _this.$wrap, + // 图片容器 + $queue = $wrap.find('.filelist'), + // 状态栏,包括进度和控制按钮 + $statusBar = $wrap.find('.statusBar'), + // 文件总体选择信息。 + $info = $statusBar.find('.info'), + // 上传按钮 + $upload = $wrap.find('.uploadBtn'), + // 上传按钮 + $filePickerBtn = $wrap.find('.filePickerBtn'), + // 上传按钮 + $filePickerBlock = $wrap.find('.filePickerBlock'), + // 没选择文件之前的内容。 + $placeHolder = $wrap.find('.placeholder'), + // 总体进度条 + $progress = $statusBar.find('.progress').hide(), + // 添加的文件数量 + fileCount = 0, + // 添加的文件总大小 + fileSize = 0, + // 优化retina, 在retina下这个值是2 + ratio = window.devicePixelRatio || 1, + // 缩略图大小 + thumbnailWidth = 113 * ratio, + thumbnailHeight = 113 * ratio, + // 可能有pedding, ready, uploading, confirm, done. + state = '', + // 所有文件的进度信息,key为file id + percentages = {}, + supportTransition = (function () { + var s = document.createElement('p').style, + r = 'transition' in s || + 'WebkitTransition' in s || + 'MozTransition' in s || + 'msTransition' in s || + 'OTransition' in s; + s = null; + return r; + })(), + // WebUploader实例 + uploader, + actionUrl = editor.getActionUrl(editor.getOpt('imageActionName')), + acceptExtensions = (editor.getOpt('imageAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, ''), + imageMaxSize = editor.getOpt('imageMaxSize'), + imageCompressBorder = editor.getOpt('imageCompressBorder'); + + if (!WebUploader.Uploader.support()) { + $('#filePickerReady').after($('
    ').html(lang.errorNotSupport)).hide(); + return; + } else if (!editor.getOpt('imageActionName')) { + $('#filePickerReady').after($('
    ').html(lang.errorLoadConfig)).hide(); + return; + } + + uploader = _this.uploader = WebUploader.create({ + pick: { + id: '#filePickerReady', + label: lang.uploadSelectFile + }, + accept: { + title: 'Images', + extensions: acceptExtensions, + mimeTypes: 'image/*' + }, + swf: '../../third-party/webuploader/Uploader.swf', + server: actionUrl, + fileVal: editor.getOpt('imageFieldName'), + duplicate: true, + fileSingleSizeLimit: imageMaxSize, // 默认 2 M + compress: editor.getOpt('imageCompressEnable') ? { + width: imageCompressBorder, + height: imageCompressBorder, + // 图片质量,只有type为`image/jpeg`的时候才有效。 + quality: 90, + // 是否允许放大,如果想要生成小图的时候不失真,此选项应该设置为false. + allowMagnify: false, + // 是否允许裁剪。 + crop: false, + // 是否保留头部meta信息。 + preserveHeaders: true + }:false + }); + uploader.addButton({ + id: '#filePickerBlock' + }); + uploader.addButton({ + id: '#filePickerBtn', + label: lang.uploadAddFile + }); + + setState('pedding'); + + // 当有文件添加进来时执行,负责view的创建 + function addFile(file) { + var $li = $('
  • ' + + '

    ' + file.name + '

    ' + + '

    ' + + '

    ' + + '
  • '), + + $btns = $('
    ' + + '' + lang.uploadDelete + '' + + '' + lang.uploadTurnRight + '' + + '' + lang.uploadTurnLeft + '
    ').appendTo($li), + $prgress = $li.find('p.progress span'), + $wrap = $li.find('p.imgWrap'), + $info = $('

    ').hide().appendTo($li), + + showError = function (code) { + switch (code) { + case 'exceed_size': + text = lang.errorExceedSize; + break; + case 'interrupt': + text = lang.errorInterrupt; + break; + case 'http': + text = lang.errorHttp; + break; + case 'not_allow_type': + text = lang.errorFileType; + break; + default: + text = lang.errorUploadRetry; + break; + } + $info.text(text).show(); + }; + + if (file.getStatus() === 'invalid') { + showError(file.statusText); + } else { + $wrap.text(lang.uploadPreview); + if (browser.ie && browser.version <= 7) { + $wrap.text(lang.uploadNoPreview); + } else { + uploader.makeThumb(file, function (error, src) { + if (error || !src) { + $wrap.text(lang.uploadNoPreview); + } else { + var $img = $(''); + $wrap.empty().append($img); + $img.on('error', function () { + $wrap.text(lang.uploadNoPreview); + }); + } + }, thumbnailWidth, thumbnailHeight); + } + percentages[ file.id ] = [ file.size, 0 ]; + file.rotation = 0; + + /* 检查文件格式 */ + if (!file.ext || acceptExtensions.indexOf(file.ext.toLowerCase()) == -1) { + showError('not_allow_type'); + uploader.removeFile(file); + } + } + + file.on('statuschange', function (cur, prev) { + if (prev === 'progress') { + $prgress.hide().width(0); + } else if (prev === 'queued') { + $li.off('mouseenter mouseleave'); + $btns.remove(); + } + // 成功 + if (cur === 'error' || cur === 'invalid') { + showError(file.statusText); + percentages[ file.id ][ 1 ] = 1; + } else if (cur === 'interrupt') { + showError('interrupt'); + } else if (cur === 'queued') { + percentages[ file.id ][ 1 ] = 0; + } else if (cur === 'progress') { + $info.hide(); + $prgress.css('display', 'block'); + } else if (cur === 'complete') { + } + + $li.removeClass('state-' + prev).addClass('state-' + cur); + }); + + $li.on('mouseenter', function () { + $btns.stop().animate({height: 30}); + }); + $li.on('mouseleave', function () { + $btns.stop().animate({height: 0}); + }); + + $btns.on('click', 'span', function () { + var index = $(this).index(), + deg; + + switch (index) { + case 0: + uploader.removeFile(file); + return; + case 1: + file.rotation += 90; + break; + case 2: + file.rotation -= 90; + break; + } + + if (supportTransition) { + deg = 'rotate(' + file.rotation + 'deg)'; + $wrap.css({ + '-webkit-transform': deg, + '-mos-transform': deg, + '-o-transform': deg, + 'transform': deg + }); + } else { + $wrap.css('filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + (~~((file.rotation / 90) % 4 + 4) % 4) + ')'); + } + + }); + + $li.insertBefore($filePickerBlock); + } + + // 负责view的销毁 + function removeFile(file) { + var $li = $('#' + file.id); + delete percentages[ file.id ]; + updateTotalProgress(); + $li.off().find('.file-panel').off().end().remove(); + } + + function updateTotalProgress() { + var loaded = 0, + total = 0, + spans = $progress.children(), + percent; + + $.each(percentages, function (k, v) { + total += v[ 0 ]; + loaded += v[ 0 ] * v[ 1 ]; + }); + + percent = total ? loaded / total : 0; + + spans.eq(0).text(Math.round(percent * 100) + '%'); + spans.eq(1).css('width', Math.round(percent * 100) + '%'); + updateStatus(); + } + + function setState(val, files) { + + if (val != state) { + + var stats = uploader.getStats(); + + $upload.removeClass('state-' + state); + $upload.addClass('state-' + val); + + switch (val) { + + /* 未选择文件 */ + case 'pedding': + $queue.addClass('element-invisible'); + $statusBar.addClass('element-invisible'); + $placeHolder.removeClass('element-invisible'); + $progress.hide(); $info.hide(); + uploader.refresh(); + break; + + /* 可以开始上传 */ + case 'ready': + $placeHolder.addClass('element-invisible'); + $queue.removeClass('element-invisible'); + $statusBar.removeClass('element-invisible'); + $progress.hide(); $info.show(); + $upload.text(lang.uploadStart); + uploader.refresh(); + break; + + /* 上传中 */ + case 'uploading': + $progress.show(); $info.hide(); + $upload.text(lang.uploadPause); + break; + + /* 暂停上传 */ + case 'paused': + $progress.show(); $info.hide(); + $upload.text(lang.uploadContinue); + break; + + case 'confirm': + $progress.show(); $info.hide(); + $upload.text(lang.uploadStart); + + stats = uploader.getStats(); + if (stats.successNum && !stats.uploadFailNum) { + setState('finish'); + return; + } + break; + + case 'finish': + $progress.hide(); $info.show(); + if (stats.uploadFailNum) { + $upload.text(lang.uploadRetry); + } else { + $upload.text(lang.uploadStart); + } + break; + } + + state = val; + updateStatus(); + + } + + if (!_this.getQueueCount()) { + $upload.addClass('disabled') + } else { + $upload.removeClass('disabled') + } + + } + + function updateStatus() { + var text = '', stats; + + if (state === 'ready') { + text = lang.updateStatusReady.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize)); + } else if (state === 'confirm') { + stats = uploader.getStats(); + if (stats.uploadFailNum) { + text = lang.updateStatusConfirm.replace('_', stats.successNum).replace('_', stats.successNum); + } + } else { + stats = uploader.getStats(); + text = lang.updateStatusFinish.replace('_', fileCount). + replace('_KB', WebUploader.formatSize(fileSize)). + replace('_', stats.successNum); + + if (stats.uploadFailNum) { + text += lang.updateStatusError.replace('_', stats.uploadFailNum); + } + } + + $info.html(text); + } + + uploader.on('fileQueued', function (file) { + fileCount++; + fileSize += file.size; + + if (fileCount === 1) { + $placeHolder.addClass('element-invisible'); + $statusBar.show(); + } + + addFile(file); + }); + + uploader.on('fileDequeued', function (file) { + fileCount--; + fileSize -= file.size; + + removeFile(file); + updateTotalProgress(); + }); + + uploader.on('filesQueued', function (file) { + if (!uploader.isInProgress() && (state == 'pedding' || state == 'finish' || state == 'confirm' || state == 'ready')) { + setState('ready'); + } + updateTotalProgress(); + }); + + uploader.on('all', function (type, files) { + switch (type) { + case 'uploadFinished': + setState('confirm', files); + break; + case 'startUpload': + /* 添加额外的GET参数 */ + var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '', + url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?':'&') + 'encode=utf-8&' + params); + uploader.option('server', url); + setState('uploading', files); + break; + case 'stopUpload': + setState('paused', files); + break; + } + }); + + uploader.on('uploadBeforeSend', function (file, data, header) { + //这里可以通过data对象添加POST参数 + header['X_Requested_With'] = 'XMLHttpRequest'; + // HaoChuan9421 + if(editor.options.headers && Object.prototype.toString.apply(editor.options.headers) === "[object Object]"){ + for(var key in editor.options.headers){ + header[key] = editor.options.headers[key] + } + } + }); + + uploader.on('uploadProgress', function (file, percentage) { + var $li = $('#' + file.id), + $percent = $li.find('.progress span'); + + $percent.css('width', percentage * 100 + '%'); + percentages[ file.id ][ 1 ] = percentage; + updateTotalProgress(); + }); + + uploader.on('uploadSuccess', function (file, ret) { + var $file = $('#' + file.id); + try { + var responseText = (ret._raw || ret), + json = utils.str2json(responseText); + if (json.state == 'SUCCESS') { + _this.imageList.push(json); + $file.append(''); + } else { + $file.find('.error').text(json.state).show(); + } + } catch (e) { + $file.find('.error').text(lang.errorServerUpload).show(); + } + }); + + uploader.on('uploadError', function (file, code) { + }); + uploader.on('error', function (code, file) { + if (code == 'Q_TYPE_DENIED' || code == 'F_EXCEED_SIZE') { + addFile(file); + } + }); + uploader.on('uploadComplete', function (file, ret) { + }); + + $upload.on('click', function () { + if ($(this).hasClass('disabled')) { + return false; + } + + if (state === 'ready') { + uploader.upload(); + } else if (state === 'paused') { + uploader.upload(); + } else if (state === 'uploading') { + uploader.stop(); + } + }); + + $upload.addClass('state-' + state); + updateTotalProgress(); + }, + getQueueCount: function () { + var file, i, status, readyFile = 0, files = this.uploader.getFiles(); + for (i = 0; file = files[i++]; ) { + status = file.getStatus(); + if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++; + } + return readyFile; + }, + destroy: function () { + this.$wrap.remove(); + }, + getInsertList: function () { + var i, data, list = [], + align = getAlign(), + prefix = editor.getOpt('imageUrlPrefix'); + for (i = 0; i < this.imageList.length; i++) { + data = this.imageList[i]; + list.push({ + src: prefix + data.url, + _src: prefix + data.url, + title: data.title, + alt: data.original, + floatStyle: align + }); + } + return list; + } + }; + + + /* 在线图片 */ + function OnlineImage(target) { + this.container = utils.isString(target) ? document.getElementById(target) : target; + this.init(); + } + OnlineImage.prototype = { + init: function () { + this.reset(); + this.initEvents(); + }, + /* 初始化容器 */ + initContainer: function () { + this.container.innerHTML = ''; + this.list = document.createElement('ul'); + this.clearFloat = document.createElement('li'); + + domUtils.addClass(this.list, 'list'); + domUtils.addClass(this.clearFloat, 'clearFloat'); + + this.list.appendChild(this.clearFloat); + this.container.appendChild(this.list); + }, + /* 初始化滚动事件,滚动到地步自动拉取数据 */ + initEvents: function () { + var _this = this; + + /* 滚动拉取图片 */ + domUtils.on($G('imageList'), 'scroll', function(e){ + var panel = this; + if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) { + _this.getImageData(); + } + }); + /* 选中图片 */ + domUtils.on(this.container, 'click', function (e) { + var target = e.target || e.srcElement, + li = target.parentNode; + + if (li.tagName.toLowerCase() == 'li') { + if (domUtils.hasClass(li, 'selected')) { + domUtils.removeClasses(li, 'selected'); + } else { + domUtils.addClass(li, 'selected'); + } + } + }); + }, + /* 初始化第一次的数据 */ + initData: function () { + + /* 拉取数据需要使用的值 */ + this.state = 0; + this.listSize = editor.getOpt('imageManagerListSize'); + this.listIndex = 0; + this.listEnd = false; + + /* 第一次拉取数据 */ + this.getImageData(); + }, + /* 重置界面 */ + reset: function() { + this.initContainer(); + this.initData(); + }, + /* 向后台拉取图片列表数据 */ + getImageData: function () { + var _this = this; + + if(!_this.listEnd && !this.isLoadingData) { + this.isLoadingData = true; + var url = editor.getActionUrl(editor.getOpt('imageManagerActionName')), + isJsonp = utils.isCrossDomainUrl(url); + ajax.request(url, { + 'timeout': 100000, + 'dataType': isJsonp ? 'jsonp':'', + 'data': utils.extend({ + start: this.listIndex, + size: this.listSize + }, editor.queryCommandValue('serverparam')), + 'method': 'get', + 'onsuccess': function (r) { + try { + var json = isJsonp ? r:eval('(' + r.responseText + ')'); + if (json.state == 'SUCCESS') { + _this.pushData(json.list); + _this.listIndex = parseInt(json.start) + parseInt(json.list.length); + if(_this.listIndex >= json.total) { + _this.listEnd = true; + } + _this.isLoadingData = false; + } + } catch (e) { + if(r.responseText.indexOf('ue_separate_ue') != -1) { + var list = r.responseText.split(r.responseText); + _this.pushData(list); + _this.listIndex = parseInt(list.length); + _this.listEnd = true; + _this.isLoadingData = false; + } + } + }, + 'onerror': function () { + _this.isLoadingData = false; + } + }); + } + }, + /* 添加图片到列表界面上 */ + pushData: function (list) { + var i, item, img, icon, _this = this, + urlPrefix = editor.getOpt('imageManagerUrlPrefix'); + for (i = 0; i < list.length; i++) { + if(list[i] && list[i].url) { + item = document.createElement('li'); + img = document.createElement('img'); + icon = document.createElement('span'); + + domUtils.on(img, 'load', (function(image){ + return function(){ + _this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight); + } + })(img)); + img.width = 113; + img.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) ); + img.setAttribute('_src', urlPrefix + list[i].url); + domUtils.addClass(icon, 'icon'); + + item.appendChild(img); + item.appendChild(icon); + this.list.insertBefore(item, this.clearFloat); + } + } + }, + /* 改变图片大小 */ + scale: function (img, w, h, type) { + var ow = img.width, + oh = img.height; + + if (type == 'justify') { + if (ow >= oh) { + img.width = w; + img.height = h * oh / ow; + img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; + } else { + img.width = w * ow / oh; + img.height = h; + img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; + } + } else { + if (ow >= oh) { + img.width = w * ow / oh; + img.height = h; + img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; + } else { + img.width = w; + img.height = h * oh / ow; + img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; + } + } + }, + getInsertList: function () { + var i, lis = this.list.children, list = [], align = getAlign(); + for (i = 0; i < lis.length; i++) { + if (domUtils.hasClass(lis[i], 'selected')) { + var img = lis[i].firstChild, + src = img.getAttribute('_src'); + list.push({ + src: src, + _src: src, + alt: src.substr(src.lastIndexOf('/') + 1), + floatStyle: align + }); + } + + } + return list; + } + }; + + /*搜索图片 */ + function SearchImage() { + this.init(); + } + SearchImage.prototype = { + init: function () { + this.initEvents(); + }, + initEvents: function(){ + var _this = this; + + /* 点击搜索按钮 */ + domUtils.on($G('searchBtn'), 'click', function(){ + var key = $G('searchTxt').value; + if(key && key != lang.searchRemind) { + _this.getImageData(); + } + }); + /* 点击清除妞 */ + domUtils.on($G('searchReset'), 'click', function(){ + $G('searchTxt').value = lang.searchRemind; + $G('searchListUl').innerHTML = ''; + $G('searchType').selectedIndex = 0; + }); + /* 搜索框聚焦 */ + domUtils.on($G('searchTxt'), 'focus', function(){ + var key = $G('searchTxt').value; + if(key && key == lang.searchRemind) { + $G('searchTxt').value = ''; + } + }); + /* 搜索框回车键搜索 */ + domUtils.on($G('searchTxt'), 'keydown', function(e){ + var keyCode = e.keyCode || e.which; + if (keyCode == 13) { + $G('searchBtn').click(); + } + }); + + /* 选中图片 */ + domUtils.on($G('searchList'), 'click', function(e){ + var target = e.target || e.srcElement, + li = target.parentNode.parentNode; + + if (li.tagName.toLowerCase() == 'li') { + if (domUtils.hasClass(li, 'selected')) { + domUtils.removeClasses(li, 'selected'); + } else { + domUtils.addClass(li, 'selected'); + } + } + }); + }, + encodeToGb2312:function (str){ + if(!str) return ''; + var strOut = "", + z = 'D2BBB6A18140C6DF814181428143CDF2D5C9C8FDC9CFCFC2D8A2B2BBD3EB8144D8A4B3F38145D7A8C7D2D8A7CAC08146C7F0B1FBD2B5B4D4B6ABCBBFD8A9814781488149B6AA814AC1BDD1CF814BC9A5D8AD814CB8F6D1BEE3DCD6D0814D814EB7E1814FB4AE8150C1D98151D8BC8152CDE8B5A4CEAAD6F78153C0F6BED9D8AF815481558156C4CB8157BEC38158D8B1C3B4D2E58159D6AECEDAD5A7BAF5B7A6C0D6815AC6B9C5D2C7C7815BB9D4815CB3CBD2D2815D815ED8BFBEC5C6F2D2B2CFB0CFE7815F816081618162CAE981638164D8C081658166816781688169816AC2F2C2D2816BC8E9816C816D816E816F817081718172817381748175C7AC8176817781788179817A817B817CC1CB817DD3E8D5F9817ECAC2B6FED8A1D3DABFF78180D4C6BBA5D8C1CEE5BEAE81818182D8A88183D1C7D0A9818481858186D8BDD9EFCDF6BFBA8187BDBBBAA5D2E0B2FABAE0C4B68188CFEDBEA9CDA4C1C18189818A818BC7D7D9F1818CD9F4818D818E818F8190C8CBD8E9819181928193D2DACAB2C8CAD8ECD8EAD8C6BDF6C6CDB3F08194D8EBBDF1BDE98195C8D4B4D381968197C2D88198B2D6D7D0CACBCBFBD5CCB8B6CFC98199819A819BD9DAD8F0C7AA819CD8EE819DB4FAC1EED2D4819E819FD8ED81A0D2C7D8EFC3C781A181A281A3D1F681A4D6D9D8F281A5D8F5BCFEBCDB81A681A781A8C8CE81A9B7DD81AAB7C281ABC6F381AC81AD81AE81AF81B081B181B2D8F8D2C181B381B4CEE9BCBFB7FCB7A5D0DD81B581B681B781B881B9D6DAD3C5BBEFBBE1D8F181BA81BBC9A1CEB0B4AB81BCD8F381BDC9CBD8F6C2D7D8F781BE81BFCEB1D8F981C081C181C2B2AEB9C081C3D9A381C4B0E981C5C1E681C6C9EC81C7CBC581C8CBC6D9A481C981CA81CB81CC81CDB5E881CE81CFB5AB81D081D181D281D381D481D5CEBBB5CDD7A1D7F4D3D381D6CCE581D7BACE81D8D9A2D9DCD3E0D8FDB7F0D7F7D8FED8FAD9A1C4E381D981DAD3B6D8F4D9DD81DBD8FB81DCC5E581DD81DEC0D081DF81E0D1F0B0DB81E181E2BCD1D9A681E3D9A581E481E581E681E7D9ACD9AE81E8D9ABCAB981E981EA81EBD9A9D6B681EC81ED81EEB3DED9A881EFC0FD81F0CACC81F1D9AA81F2D9A781F381F4D9B081F581F6B6B181F781F881F9B9A981FAD2C081FB81FCCFC081FD81FEC2C28240BDC4D5ECB2E0C7C8BFEBD9AD8241D9AF8242CEEABAEE82438244824582468247C7D682488249824A824B824C824D824E824F8250B1E3825182528253B4D9B6EDD9B48254825582568257BFA182588259825AD9DEC7CEC0FED9B8825B825C825D825E825FCBD7B7FD8260D9B58261D9B7B1A3D3E1D9B98262D0C58263D9B682648265D9B18266D9B2C1A9D9B382678268BCF3D0DEB8A98269BEE3826AD9BD826B826C826D826ED9BA826FB0B3827082718272D9C28273827482758276827782788279827A827B827C827D827E8280D9C4B1B68281D9BF82828283B5B98284BEF3828582868287CCC8BAF2D2D08288D9C38289828ABDE8828BB3AB828C828D828ED9C5BEEB828FD9C6D9BBC4DF8290D9BED9C1D9C0829182928293829482958296829782988299829A829BD5AE829CD6B5829DC7E3829E829F82A082A1D9C882A282A382A4BCD9D9CA82A582A682A7D9BC82A8D9CBC6AB82A982AA82AB82AC82ADD9C982AE82AF82B082B1D7F682B2CDA382B382B482B582B682B782B882B982BABDA182BB82BC82BD82BE82BF82C0D9CC82C182C282C382C482C582C682C782C882C9C5BCCDB582CA82CB82CCD9CD82CD82CED9C7B3A5BFFE82CF82D082D182D2B8B582D382D4C0FC82D582D682D782D8B0F882D982DA82DB82DC82DD82DE82DF82E082E182E282E382E482E582E682E782E882E982EA82EB82EC82EDB4F682EED9CE82EFD9CFB4A2D9D082F082F1B4DF82F282F382F482F582F6B0C182F782F882F982FA82FB82FC82FDD9D1C9B582FE8340834183428343834483458346834783488349834A834B834C834D834E834F83508351CFF1835283538354835583568357D9D283588359835AC1C5835B835C835D835E835F836083618362836383648365D9D6C9AE8366836783688369D9D5D9D4D9D7836A836B836C836DCBDB836EBDA9836F8370837183728373C6A7837483758376837783788379837A837B837C837DD9D3D9D8837E83808381D9D9838283838384838583868387C8E583888389838A838B838C838D838E838F839083918392839383948395C0DC8396839783988399839A839B839C839D839E839F83A083A183A283A383A483A583A683A783A883A983AA83AB83AC83AD83AE83AF83B083B183B2B6F9D8A3D4CA83B3D4AAD0D6B3E4D5D783B4CFC8B9E283B5BFCB83B6C3E283B783B883B9B6D283BA83BBCDC3D9EED9F083BC83BD83BEB5B383BFB6B583C083C183C283C383C4BEA483C583C6C8EB83C783C8C8AB83C983CAB0CBB9ABC1F9D9E283CBC0BCB9B283CCB9D8D0CBB1F8C6E4BEDFB5E4D7C883CDD1F8BCE6CADE83CE83CFBCBDD9E6D8E783D083D1C4DA83D283D3B8D4C8BD83D483D5B2E1D4D983D683D783D883D9C3B083DA83DBC3E1DAA2C8DF83DCD0B483DDBEFCC5A983DE83DF83E0B9DA83E1DAA383E2D4A9DAA483E383E483E583E683E7D9FBB6AC83E883E9B7EBB1F9D9FCB3E5BEF683EABFF6D2B1C0E483EB83EC83EDB6B3D9FED9FD83EE83EFBEBB83F083F183F2C6E083F3D7BCDAA183F4C1B983F5B5F2C1E883F683F7BCF583F8B4D583F983FA83FB83FC83FD83FE844084418442C1DD8443C4FD84448445BCB8B7B284468447B7EF84488449844A844B844C844DD9EC844EC6BE844FBFADBBCB84508451B5CA8452DBC9D0D78453CDB9B0BCB3F6BBF7DBCABAAF8454D4E4B5B6B5F3D8D6C8D084558456B7D6C7D0D8D78457BFAF84588459DBBBD8D8845A845BD0CCBBAE845C845D845EEBBEC1D0C1F5D4F2B8D5B4B4845FB3F584608461C9BE846284638464C5D0846584668467C5D9C0FB8468B1F08469D8D9B9CE846AB5BD846B846CD8DA846D846ED6C6CBA2C8AFC9B2B4CCBFCC846FB9F48470D8DBD8DCB6E7BCC1CCEA847184728473847484758476CFF78477D8DDC7B084788479B9D0BDA3847A847BCCDE847CC6CA847D847E848084818482D8E08483D8DE84848485D8DF848684878488B0FE8489BEE7848ACAA3BCF4848B848C848D848EB8B1848F8490B8EE849184928493849484958496849784988499849AD8E2849BBDCB849CD8E4D8E3849D849E849F84A084A1C5FC84A284A384A484A584A684A784A8D8E584A984AAD8E684AB84AC84AD84AE84AF84B084B1C1A684B2C8B0B0ECB9A6BCD3CEF1DBBDC1D384B384B484B584B6B6AFD6FAC5ACBDD9DBBEDBBF84B784B884B9C0F8BEA2C0CD84BA84BB84BC84BD84BE84BF84C084C184C284C3DBC0CAC684C484C584C6B2AA84C784C884C9D3C284CAC3E384CBD1AB84CC84CD84CE84CFDBC284D0C0D584D184D284D3DBC384D4BFB184D584D684D784D884D984DAC4BC84DB84DC84DD84DEC7DA84DF84E084E184E284E384E484E584E684E784E884E9DBC484EA84EB84EC84ED84EE84EF84F084F1D9E8C9D784F284F384F4B9B4CEF0D4C884F584F684F784F8B0FCB4D284F9D0D984FA84FB84FC84FDD9E984FEDECBD9EB8540854185428543D8B0BBAFB1B18544B3D7D8CE85458546D4D185478548BDB3BFEF8549CFBB854A854BD8D0854C854D854EB7CB854F85508551D8D185528553855485558556855785588559855A855BC6A5C7F8D2BD855C855DD8D2C4E4855ECAAE855FC7A78560D8A68561C9FDCEE7BBDCB0EB856285638564BBAAD0AD8565B1B0D7E4D7BF8566B5A5C2F4C4CF85678568B2A98569B2B7856AB1E5DFB2D5BCBFA8C2ACD8D5C2B1856BD8D4CED4856CDAE0856DCEC0856E856FD8B4C3AED3A1CEA38570BCB4C8B4C2D18571BEEDD0B68572DAE18573857485758576C7E485778578B3A78579B6F2CCFCC0FA857A857BC0F7857CD1B9D1E1D8C7857D857E85808581858285838584B2DE85858586C0E58587BAF185888589D8C8858AD4AD858B858CCFE1D8C9858DD8CACFC3858EB3F8BEC7858F859085918592D8CB8593859485958596859785988599DBCC859A859B859C859DC8A5859E859F85A0CFD885A1C8FEB2CE85A285A385A485A585A6D3D6B2E6BCB0D3D1CBABB7B485A785A885A9B7A285AA85ABCAE585ACC8A1CADCB1E4D0F085ADC5D185AE85AF85B0DBC5B5FE85B185B2BFDAB9C5BEE4C1ED85B3DFB6DFB5D6BBBDD0D5D9B0C8B6A3BFC9CCA8DFB3CAB7D3D285B4D8CFD2B6BAC5CBBECCBE85B5DFB7B5F0DFB485B685B785B8D3F585B9B3D4B8F785BADFBA85BBBACFBCAAB5F585BCCDACC3FBBAF3C0F4CDC2CFF2DFB8CFC585BDC2C0DFB9C2F085BE85BF85C0BEFD85C1C1DFCDCCD2F7B7CDDFC185C2DFC485C385C4B7F1B0C9B6D6B7D485C5BAACCCFDBFD4CBB1C6F485C6D6A8DFC585C7CEE2B3B385C885C9CEFCB4B585CACEC7BAF085CBCEE185CCD1BD85CD85CEDFC085CF85D0B4F485D1B3CA85D2B8E6DFBB85D385D485D585D6C4C585D7DFBCDFBDDFBEC5BBDFBFDFC2D4B1DFC385D8C7BACED885D985DA85DB85DC85DDC4D885DEDFCA85DFDFCF85E0D6DC85E185E285E385E485E585E685E785E8DFC9DFDACEB685E9BAC7DFCEDFC8C5DE85EA85EBC9EBBAF4C3FC85EC85EDBED785EEDFC685EFDFCD85F0C5D885F185F285F385F4D5A6BACD85F5BECCD3BDB8C085F6D6E485F7DFC7B9BEBFA785F885F9C1FCDFCBDFCC85FADFD085FB85FC85FD85FE8640DFDBDFE58641DFD7DFD6D7C9DFE3DFE4E5EBD2A7DFD28642BFA98643D4DB8644BFC8DFD4864586468647CFCC86488649DFDD864AD1CA864BDFDEB0A7C6B7DFD3864CBAE5864DB6DFCDDBB9FED4D5864E864FDFDFCFECB0A5DFE7DFD1D1C6DFD5DFD8DFD9DFDC8650BBA98651DFE0DFE18652DFE2DFE6DFE8D3B486538654865586568657B8E7C5B6DFEAC9DAC1A8C4C486588659BFDECFF8865A865B865CD5DCDFEE865D865E865F866086618662B2B88663BADFDFEC8664DBC18665D1E48666866786688669CBF4B4BD866AB0A6866B866C866D866E866FDFF1CCC6DFF286708671DFED867286738674867586768677DFE986788679867A867BDFEB867CDFEFDFF0BBBD867D867EDFF386808681DFF48682BBA38683CADBCEA8E0A7B3AA8684E0A6868586868687E0A186888689868A868BDFFE868CCDD9DFFC868DDFFA868EBFD0D7C4868FC9CC86908691DFF8B0A186928693869486958696DFFD869786988699869ADFFBE0A2869B869C869D869E869FE0A886A086A186A286A3B7C886A486A5C6A1C9B6C0B2DFF586A686A7C5BE86A8D8C4DFF9C4F686A986AA86AB86AC86AD86AEE0A3E0A4E0A5D0A586AF86B0E0B4CCE486B1E0B186B2BFA6E0AFCEB9E0ABC9C686B386B4C0AEE0AEBAEDBAB0E0A986B586B686B7DFF686B8E0B386B986BAE0B886BB86BC86BDB4ADE0B986BE86BFCFB2BAC886C0E0B086C186C286C386C486C586C686C7D0FA86C886C986CA86CB86CC86CD86CE86CF86D0E0AC86D1D4FB86D2DFF786D3C5E786D4E0AD86D5D3F786D6E0B6E0B786D786D886D986DA86DBE0C4D0E186DC86DD86DEE0BC86DF86E0E0C9E0CA86E186E286E3E0BEE0AAC9A4E0C186E4E0B286E586E686E786E886E9CAC8E0C386EAE0B586EBCECB86ECCBC3E0CDE0C6E0C286EDE0CB86EEE0BAE0BFE0C086EF86F0E0C586F186F2E0C7E0C886F3E0CC86F4E0BB86F586F686F786F886F9CBD4E0D586FAE0D6E0D286FB86FC86FD86FE87408741E0D0BCCE87428743E0D18744B8C2D8C587458746874787488749874A874B874CD0EA874D874EC2EF874F8750E0CFE0BD875187528753E0D4E0D387548755E0D78756875787588759E0DCE0D8875A875B875CD6F6B3B0875DD7EC875ECBBB875F8760E0DA8761CEFB876287638764BAD987658766876787688769876A876B876C876D876E876F8770E0E1E0DDD2AD87718772877387748775E0E287768777E0DBE0D9E0DF87788779E0E0877A877B877C877D877EE0DE8780E0E4878187828783C6F7D8ACD4EBE0E6CAC98784878587868787E0E587888789878A878BB8C1878C878D878E878FE0E7E0E887908791879287938794879587968797E0E9E0E387988799879A879B879C879D879EBABFCCE7879F87A087A1E0EA87A287A387A487A587A687A787A887A987AA87AB87AC87AD87AE87AF87B0CFF987B187B287B387B487B587B687B787B887B987BA87BBE0EB87BC87BD87BE87BF87C087C187C2C8C287C387C487C587C6BDC087C787C887C987CA87CB87CC87CD87CE87CF87D087D187D287D3C4D287D487D587D687D787D887D987DA87DB87DCE0EC87DD87DEE0ED87DF87E0C7F4CBC487E1E0EEBBD8D8B6D2F2E0EFCDC587E2B6DA87E387E487E587E687E787E8E0F187E9D4B087EA87EBC0A7B4D187EC87EDCEA7E0F087EE87EF87F0E0F2B9CC87F187F2B9FACDBCE0F387F387F487F5C6D4E0F487F6D4B287F7C8A6E0F6E0F587F887F987FA87FB87FC87FD87FE8840884188428843884488458846884788488849E0F7884A884BCDC1884C884D884ECAA5884F885088518852D4DADBD7DBD98853DBD8B9E7DBDCDBDDB5D888548855DBDA8856885788588859885ADBDBB3A1DBDF885B885CBBF8885DD6B7885EDBE0885F886088618862BEF988638864B7BB8865DBD0CCAEBFB2BBB5D7F8BFD38866886788688869886ABFE9886B886CBCE1CCB3DBDEB0D3CEEBB7D8D7B9C6C2886D886EC0A4886FCCB98870DBE7DBE1C6BADBE38871DBE88872C5F7887388748875DBEA88768877DBE9BFC088788879887ADBE6DBE5887B887C887D887E8880B4B9C0ACC2A2DBE2DBE48881888288838884D0CDDBED88858886888788888889C0DDDBF2888A888B888C888D888E888F8890B6E28891889288938894DBF3DBD2B9B8D4ABDBEC8895BFD1DBF08896DBD18897B5E68898DBEBBFE58899889A889BDBEE889CDBF1889D889E889FDBF988A088A188A288A388A488A588A688A788A8B9A1B0A388A988AA88AB88AC88AD88AE88AFC2F188B088B1B3C7DBEF88B288B3DBF888B4C6D2DBF488B588B6DBF5DBF7DBF688B788B8DBFE88B9D3F2B2BA88BA88BB88BCDBFD88BD88BE88BF88C088C188C288C388C4DCA488C5DBFB88C688C788C888C9DBFA88CA88CB88CCDBFCC5E0BBF988CD88CEDCA388CF88D0DCA588D1CCC388D288D388D4B6D1DDC088D588D688D7DCA188D8DCA288D988DA88DBC7B588DC88DD88DEB6E988DF88E088E1DCA788E288E388E488E5DCA688E6DCA9B1A488E788E8B5CC88E988EA88EB88EC88EDBFB088EE88EF88F088F188F2D1DF88F388F488F588F6B6C288F788F888F988FA88FB88FC88FD88FE894089418942894389448945DCA88946894789488949894A894B894CCBFAEBF3894D894E894FCBDC89508951CBFE895289538954CCC189558956895789588959C8FB895A895B895C895D895E895FDCAA89608961896289638964CCEEDCAB89658966896789688969896A896B896C896D896E896F897089718972897389748975DBD38976DCAFDCAC8977BEB38978CAFB8979897A897BDCAD897C897D897E89808981898289838984C9CAC4B989858986898789888989C7BDDCAE898A898B898CD4F6D0E6898D898E898F89908991899289938994C4ABB6D589958996899789988999899A899B899C899D899E899F89A089A189A289A389A489A589A6DBD489A789A889A989AAB1DA89AB89AC89ADDBD589AE89AF89B089B189B289B389B489B589B689B789B8DBD689B989BA89BBBABE89BC89BD89BE89BF89C089C189C289C389C489C589C689C789C889C9C8C089CA89CB89CC89CD89CE89CFCABFC8C989D0D7B389D1C9F989D289D3BFC789D489D5BAF889D689D7D2BC89D889D989DA89DB89DC89DD89DE89DFE2BA89E0B4A689E189E2B1B889E389E489E589E689E7B8B489E8CFC489E989EA89EB89ECD9E7CFA6CDE289ED89EED9EDB6E089EFD2B989F089F1B9BB89F289F389F489F5E2B9E2B789F6B4F389F7CCECCCABB7F289F8D8B2D1EBBABB89F9CAA789FA89FBCDB789FC89FDD2C4BFE4BCD0B6E189FEDEC58A408A418A428A43DEC6DBBC8A44D1D98A458A46C6E6C4CEB7EE8A47B7DC8A488A49BFFCD7E08A4AC6F58A4B8A4CB1BCDEC8BDB1CCD7DECA8A4DDEC98A4E8A4F8A508A518A52B5EC8A53C9DD8A548A55B0C28A568A578A588A598A5A8A5B8A5C8A5D8A5E8A5F8A608A618A62C5AEC5AB8A63C4CC8A64BCE9CBFD8A658A668A67BAC38A688A698A6AE5F9C8E7E5FACDFD8A6BD7B1B8BEC2E88A6CC8D18A6D8A6EE5FB8A6F8A708A718A72B6CABCCB8A738A74D1FDE6A18A75C3EE8A768A778A788A79E6A48A7A8A7B8A7C8A7DE5FEE6A5CDD78A7E8A80B7C1E5FCE5FDE6A38A818A82C4DDE6A88A838A84E6A78A858A868A878A888A898A8AC3C38A8BC6DE8A8C8A8DE6AA8A8E8A8F8A908A918A928A938A94C4B78A958A968A97E6A2CABC8A988A998A9A8A9BBDE3B9C3E6A6D0D5CEAF8A9C8A9DE6A9E6B08A9ED2A68A9FBDAAE6AD8AA08AA18AA28AA38AA4E6AF8AA5C0D18AA68AA7D2CC8AA88AA98AAABCA78AAB8AAC8AAD8AAE8AAF8AB08AB18AB28AB38AB48AB58AB6E6B18AB7D2F68AB88AB98ABAD7CB8ABBCDFE8ABCCDDEC2A6E6ABE6ACBDBFE6AEE6B38ABD8ABEE6B28ABF8AC08AC18AC2E6B68AC3E6B88AC48AC58AC68AC7C4EF8AC88AC98ACAC4C88ACB8ACCBEEAC9EF8ACD8ACEE6B78ACFB6F08AD08AD18AD2C3E48AD38AD48AD58AD68AD78AD88AD9D3E9E6B48ADAE6B58ADBC8A28ADC8ADD8ADE8ADF8AE0E6BD8AE18AE28AE3E6B98AE48AE58AE68AE78AE8C6C58AE98AEACDF1E6BB8AEB8AEC8AED8AEE8AEF8AF08AF18AF28AF38AF4E6BC8AF58AF68AF78AF8BBE98AF98AFA8AFB8AFC8AFD8AFE8B40E6BE8B418B428B438B44E6BA8B458B46C0B78B478B488B498B4A8B4B8B4C8B4D8B4E8B4FD3A4E6BFC9F4E6C38B508B51E6C48B528B538B548B55D0F68B568B578B588B598B5A8B5B8B5C8B5D8B5E8B5F8B608B618B628B638B648B658B668B67C3BD8B688B698B6A8B6B8B6C8B6D8B6EC3C4E6C28B6F8B708B718B728B738B748B758B768B778B788B798B7A8B7B8B7CE6C18B7D8B7E8B808B818B828B838B84E6C7CFB18B85EBF48B868B87E6CA8B888B898B8A8B8B8B8CE6C58B8D8B8EBCDEC9A98B8F8B908B918B928B938B94BCB58B958B96CFD38B978B988B998B9A8B9BE6C88B9CE6C98B9DE6CE8B9EE6D08B9F8BA08BA1E6D18BA28BA38BA4E6CBB5D58BA5E6CC8BA68BA7E6CF8BA88BA9C4DB8BAAE6C68BAB8BAC8BAD8BAE8BAFE6CD8BB08BB18BB28BB38BB48BB58BB68BB78BB88BB98BBA8BBB8BBC8BBD8BBE8BBF8BC08BC18BC28BC38BC48BC58BC6E6D28BC78BC88BC98BCA8BCB8BCC8BCD8BCE8BCF8BD08BD18BD2E6D4E6D38BD38BD48BD58BD68BD78BD88BD98BDA8BDB8BDC8BDD8BDE8BDF8BE08BE18BE28BE38BE48BE58BE68BE78BE88BE98BEA8BEB8BECE6D58BEDD9F88BEE8BEFE6D68BF08BF18BF28BF38BF48BF58BF68BF7E6D78BF88BF98BFA8BFB8BFC8BFD8BFE8C408C418C428C438C448C458C468C47D7D3E6DD8C48E6DEBFD7D4D08C49D7D6B4E6CBEFE6DAD8C3D7CED0A28C4AC3CF8C4B8C4CE6DFBCBEB9C2E6DBD1A78C4D8C4EBAA2C2CF8C4FD8AB8C508C518C52CAEBE5EE8C53E6DC8C54B7F58C558C568C578C58C8E68C598C5AC4F58C5B8C5CE5B2C4FE8C5DCBFCE5B3D5AC8C5ED3EECAD8B0B28C5FCBCECDEA8C608C61BAEA8C628C638C64E5B58C65E5B48C66D7DAB9D9D6E6B6A8CDF0D2CBB1A6CAB58C67B3E8C9F3BFCDD0FBCAD2E5B6BBC28C688C698C6ACFDCB9AC8C6B8C6C8C6D8C6ED4D78C6F8C70BAA6D1E7CFFCBCD28C71E5B7C8DD8C728C738C74BFEDB1F6CBDE8C758C76BCC58C77BCC4D2FAC3DCBFDC8C788C798C7A8C7BB8BB8C7C8C7D8C7EC3C28C80BAAED4A28C818C828C838C848C858C868C878C888C89C7DEC4AFB2EC8C8AB9D18C8B8C8CE5BBC1C88C8D8C8ED5AF8C8F8C908C918C928C93E5BC8C94E5BE8C958C968C978C988C998C9A8C9BB4E7B6D4CBC2D1B0B5BC8C9C8C9DCAD98C9EB7E28C9F8CA0C9E48CA1BDAB8CA28CA3CEBED7F08CA48CA58CA68CA7D0A18CA8C9D98CA98CAAB6FBE6D8BCE28CABB3BE8CACC9D08CADE6D9B3A28CAE8CAF8CB08CB1DECC8CB2D3C8DECD8CB3D2A28CB48CB58CB68CB7DECE8CB88CB98CBA8CBBBECD8CBC8CBDDECF8CBE8CBF8CC0CAACD2FCB3DFE5EAC4E1BEA1CEB2C4F2BED6C6A8B2E38CC18CC2BED38CC38CC4C7FCCCEBBDECCEDD8CC58CC6CABAC6C1E5ECD0BC8CC78CC88CC9D5B98CCA8CCB8CCCE5ED8CCD8CCE8CCF8CD0CAF48CD1CDC0C2C58CD2E5EF8CD3C2C4E5F08CD48CD58CD68CD78CD88CD98CDAE5F8CDCD8CDBC9BD8CDC8CDD8CDE8CDF8CE08CE18CE2D2D9E1A88CE38CE48CE58CE6D3EC8CE7CBEAC6F18CE88CE98CEA8CEB8CECE1AC8CED8CEE8CEFE1A7E1A98CF08CF1E1AAE1AF8CF28CF3B2ED8CF4E1ABB8DAE1ADE1AEE1B0B5BAE1B18CF58CF68CF78CF88CF9E1B3E1B88CFA8CFB8CFC8CFD8CFED1D28D40E1B6E1B5C1EB8D418D428D43E1B78D44D4C08D45E1B28D46E1BAB0B68D478D488D498D4AE1B48D4BBFF98D4CE1B98D4D8D4EE1BB8D4F8D508D518D528D538D54E1BE8D558D568D578D588D598D5AE1BC8D5B8D5C8D5D8D5E8D5F8D60D6C58D618D628D638D648D658D668D67CFBF8D688D69E1BDE1BFC2CD8D6AB6EB8D6BD3F88D6C8D6DC7CD8D6E8D6FB7E58D708D718D728D738D748D758D768D778D788D79BEFE8D7A8D7B8D7C8D7D8D7E8D80E1C0E1C18D818D82E1C7B3E78D838D848D858D868D878D88C6E98D898D8A8D8B8D8C8D8DB4DE8D8ED1C28D8F8D908D918D92E1C88D938D94E1C68D958D968D978D988D99E1C58D9AE1C3E1C28D9BB1C08D9C8D9D8D9ED5B8E1C48D9F8DA08DA18DA28DA3E1CB8DA48DA58DA68DA78DA88DA98DAA8DABE1CCE1CA8DAC8DAD8DAE8DAF8DB08DB18DB28DB3EFFA8DB48DB5E1D3E1D2C7B68DB68DB78DB88DB98DBA8DBB8DBC8DBD8DBE8DBF8DC0E1C98DC18DC2E1CE8DC3E1D08DC48DC58DC68DC78DC88DC98DCA8DCB8DCC8DCD8DCEE1D48DCFE1D1E1CD8DD08DD1E1CF8DD28DD38DD48DD5E1D58DD68DD78DD88DD98DDA8DDB8DDC8DDD8DDE8DDF8DE08DE18DE2E1D68DE38DE48DE58DE68DE78DE88DE98DEA8DEB8DEC8DED8DEE8DEF8DF08DF18DF28DF38DF48DF58DF68DF78DF8E1D78DF98DFA8DFBE1D88DFC8DFD8DFE8E408E418E428E438E448E458E468E478E488E498E4A8E4B8E4C8E4D8E4E8E4F8E508E518E528E538E548E55E1DA8E568E578E588E598E5A8E5B8E5C8E5D8E5E8E5F8E608E618E62E1DB8E638E648E658E668E678E688E69CEA18E6A8E6B8E6C8E6D8E6E8E6F8E708E718E728E738E748E758E76E7DD8E77B4A8D6DD8E788E79D1B2B3B28E7A8E7BB9A4D7F3C7C9BEDEB9AE8E7CCED78E7D8E7EB2EEDBCF8E80BCBAD2D1CBC8B0CD8E818E82CFEF8E838E848E858E868E87D9E3BDED8E888E89B1D2CAD0B2BC8E8ACBA7B7AB8E8BCAA68E8C8E8D8E8ECFA38E8F8E90E0F8D5CAE0FB8E918E92E0FAC5C1CCFB8E93C1B1E0F9D6E3B2AFD6C4B5DB8E948E958E968E978E988E998E9A8E9BB4F8D6A18E9C8E9D8E9E8E9F8EA0CFAFB0EF8EA18EA2E0FC8EA38EA48EA58EA68EA7E1A1B3A38EA88EA9E0FDE0FEC3B18EAA8EAB8EAC8EADC3DD8EAEE1A2B7F98EAF8EB08EB18EB28EB38EB4BBCF8EB58EB68EB78EB88EB98EBA8EBBE1A3C4BB8EBC8EBD8EBE8EBF8EC0E1A48EC18EC2E1A58EC38EC4E1A6B4B18EC58EC68EC78EC88EC98ECA8ECB8ECC8ECD8ECE8ECF8ED08ED18ED28ED3B8C9C6BDC4EA8ED4B2A28ED5D0D28ED6E7DBBBC3D3D7D3C48ED7B9E3E2CF8ED88ED98EDAD7AF8EDBC7ECB1D38EDC8EDDB4B2E2D18EDE8EDF8EE0D0F2C2AEE2D08EE1BFE2D3A6B5D7E2D2B5EA8EE2C3EDB8FD8EE3B8AE8EE4C5D3B7CFE2D48EE58EE68EE78EE8E2D3B6C8D7F98EE98EEA8EEB8EEC8EEDCDA58EEE8EEF8EF08EF18EF2E2D88EF3E2D6CAFCBFB5D3B9E2D58EF48EF58EF68EF7E2D78EF88EF98EFA8EFB8EFC8EFD8EFE8F408F418F42C1AEC0C88F438F448F458F468F478F48E2DBE2DAC0AA8F498F4AC1CE8F4B8F4C8F4D8F4EE2DC8F4F8F508F518F528F538F548F558F568F578F588F598F5AE2DD8F5BE2DE8F5C8F5D8F5E8F5F8F608F618F628F638F64DBC88F65D1D3CDA28F668F67BDA88F688F698F6ADEC3D8A5BFAADBCDD2ECC6FAC5AA8F6B8F6C8F6DDEC48F6EB1D7DFAE8F6F8F708F71CABD8F72DFB18F73B9AD8F74D2FD8F75B8A5BAEB8F768F77B3DA8F788F798F7AB5DCD5C58F7B8F7C8F7D8F7EC3D6CFD2BBA18F80E5F3E5F28F818F82E5F48F83CDE48F84C8F58F858F868F878F888F898F8A8F8BB5AFC7BF8F8CE5F68F8D8F8E8F8FECB08F908F918F928F938F948F958F968F978F988F998F9A8F9B8F9C8F9D8F9EE5E68F9FB9E9B5B18FA0C2BCE5E8E5E7E5E98FA18FA28FA38FA4D2CD8FA58FA68FA7E1EAD0CE8FA8CDAE8FA9D1E58FAA8FABB2CAB1EB8FACB1F2C5ED8FAD8FAED5C3D3B08FAFE1DC8FB08FB18FB2E1DD8FB3D2DB8FB4B3B9B1CB8FB58FB68FB7CDF9D5F7E1DE8FB8BEB6B4FD8FB9E1DFBADCE1E0BBB2C2C9E1E18FBA8FBB8FBCD0EC8FBDCDBD8FBE8FBFE1E28FC0B5C3C5C7E1E38FC18FC2E1E48FC38FC48FC58FC6D3F98FC78FC88FC98FCA8FCB8FCCE1E58FCDD1AD8FCE8FCFE1E6CEA28FD08FD18FD28FD38FD48FD5E1E78FD6B5C28FD78FD88FD98FDAE1E8BBD58FDB8FDC8FDD8FDE8FDFD0C4E2E0B1D8D2E48FE08FE1E2E18FE28FE3BCC9C8CC8FE4E2E3ECFEECFDDFAF8FE58FE68FE7E2E2D6BECDFCC3A68FE88FE98FEAE3C38FEB8FECD6D2E2E78FED8FEEE2E88FEF8FF0D3C78FF18FF2E2ECBFEC8FF3E2EDE2E58FF48FF5B3C08FF68FF78FF8C4EE8FF98FFAE2EE8FFB8FFCD0C38FFDBAF6E2E9B7DEBBB3CCACCBCBE2E4E2E6E2EAE2EB8FFE90409041E2F790429043E2F4D4F5E2F390449045C5AD9046D5FAC5C2B2C090479048E2EF9049E2F2C1AFCBBC904A904BB5A1E2F9904C904D904EBCB1E2F1D0D4D4B9E2F5B9D6E2F6904F90509051C7D390529053905490559056E2F0905790589059905A905BD7DCEDA1905C905DE2F8905EEDA5E2FECAD1905F906090619062906390649065C1B59066BBD090679068BFD69069BAE3906A906BCBA1906C906D906EEDA6EDA3906F9070EDA29071907290739074BBD6EDA7D0F490759076EDA4BADEB6F7E3A1B6B2CCF1B9A79077CFA2C7A190789079BFD2907A907BB6F1907CE2FAE2FBE2FDE2FCC4D5E3A2907DD3C1907E90809081E3A7C7C49082908390849085CFA490869087E3A9BAB790889089908A908BE3A8908CBBDA908DE3A3908E908F9090E3A4E3AA9091E3A69092CEF2D3C690939094BBBC90959096D4C39097C4FA90989099EDA8D0FCE3A5909AC3F5909BE3ADB1AF909CE3B2909D909E909FBCC290A090A1E3ACB5BF90A290A390A490A590A690A790A890A9C7E9E3B090AA90AB90ACBEAACDEF90AD90AE90AF90B090B1BBF390B290B390B4CCE890B590B6E3AF90B7E3B190B8CFA7E3AE90B9CEA9BBDD90BA90BB90BC90BD90BEB5EBBEE5B2D2B3CD90BFB1B9E3ABB2D1B5ACB9DFB6E890C090C1CFEBE3B790C2BBCC90C390C4C8C7D0CA90C590C690C790C890C9E3B8B3EE90CA90CB90CC90CDEDA990CED3FAD3E490CF90D090D1EDAAE3B9D2E290D290D390D490D590D6E3B590D790D890D990DAD3DE90DB90DC90DD90DEB8D0E3B390DF90E0E3B6B7DF90E1E3B4C0A290E290E390E4E3BA90E590E690E790E890E990EA90EB90EC90ED90EE90EF90F090F190F290F390F490F590F690F7D4B890F890F990FA90FB90FC90FD90FE9140B4C89141E3BB9142BBC59143C9F791449145C9E5914691479148C4BD9149914A914B914C914D914E914FEDAB9150915191529153C2FD9154915591569157BBDBBFAE91589159915A915B915C915D915ECEBF915F916091619162E3BC9163BFB6916491659166916791689169916A916B916C916D916E916F9170917191729173917491759176B1EF91779178D4F79179917A917B917C917DE3BE917E9180918191829183918491859186EDAD918791889189918A918B918C918D918E918FE3BFBAA9EDAC91909191E3BD91929193919491959196919791989199919A919BE3C0919C919D919E919F91A091A1BAB691A291A391A4B6AE91A591A691A791A891A9D0B891AAB0C3EDAE91AB91AC91AD91AE91AFEDAFC0C191B0E3C191B191B291B391B491B591B691B791B891B991BA91BB91BC91BD91BE91BF91C091C1C5B391C291C391C491C591C691C791C891C991CA91CB91CC91CD91CE91CFE3C291D091D191D291D391D491D591D691D791D8DCB291D991DA91DB91DC91DD91DEEDB091DFB8EA91E0CEECEAA7D0E7CAF9C8D6CFB7B3C9CED2BDE491E191E2E3DEBBF2EAA8D5BD91E3C6DDEAA991E491E591E6EAAA91E7EAACEAAB91E8EAAEEAAD91E991EA91EB91ECBDD891EDEAAF91EEC2BE91EF91F091F191F2B4C1B4F791F391F4BBA791F591F691F791F891F9ECE6ECE5B7BFCBF9B1E291FAECE791FB91FC91FDC9C8ECE8ECE991FECAD6DED0B2C5D4FA92409241C6CBB0C7B4F2C8D3924292439244CDD092459246BFB8924792489249924A924B924C924DBFDB924E924FC7A4D6B49250C0A9DED1C9A8D1EFC5A4B0E7B3B6C8C592519252B0E292539254B7F692559256C5FA92579258B6F39259D5D2B3D0BCBC925A925B925CB3AD925D925E925F9260BEF1B0D1926192629263926492659266D2D6CAE3D7A59267CDB6B6B6BFB9D5DB9268B8A7C5D79269926A926BDED2BFD9C2D5C7C0926CBBA4B1A8926D926EC5EA926F9270C5FBCCA79271927292739274B1A7927592769277B5D692789279927AC4A8927BDED3D1BAB3E9927CC3F2927D927EB7F79280D6F4B5A3B2F0C4B4C4E9C0ADDED49281B0E8C5C4C1E09282B9D59283BEDCCDD8B0CE9284CDCFDED6BED0D7BEDED5D5D0B0DD92859286C4E292879288C2A3BCF09289D3B5C0B9C5A1B2A6D4F1928A928BC0A8CAC3DED7D5FC928CB9B0928DC8ADCBA9928EDED9BFBD928F929092919292C6B4D7A7CAB0C4C39293B3D6B9D29294929592969297D6B8EAFCB0B492989299929A929BBFE6929C929DCCF4929E929F92A092A1CDDA92A292A392A4D6BFC2CE92A5CECECCA2D0AEC4D3B5B2DED8D5F5BCB7BBD392A692A7B0A492A8C5B2B4EC92A992AA92ABD5F192AC92ADEAFD92AE92AF92B092B192B292B3DEDACDA692B492B5CDEC92B692B792B892B9CEE6DEDC92BACDB1C0A692BB92BCD7BD92BDDEDBB0C6BAB4C9D3C4F3BEE892BE92BF92C092C1B2B692C292C392C492C592C692C792C892C9C0CCCBF092CABCF1BBBBB5B792CB92CC92CDC5F592CEDEE692CF92D092D1DEE3BEDD92D292D3DEDF92D492D592D692D7B4B7BDDD92D892D9DEE0C4ED92DA92DB92DC92DDCFC692DEB5E092DF92E092E192E2B6DECADAB5F4DEE592E3D5C692E4DEE1CCCDC6FE92E5C5C592E692E792E8D2B492E9BEF292EA92EB92EC92ED92EE92EF92F0C2D392F1CCBDB3B892F2BDD392F3BFD8CDC6D1DAB4EB92F4DEE4DEDDDEE792F5EAFE92F692F7C2B0DEE292F892F9D6C0B5A792FAB2F492FBDEE892FCDEF292FD92FE934093419342DEED9343DEF193449345C8E0934693479348D7E1DEEFC3E8CCE19349B2E5934A934B934CD2BE934D934E934F9350935193529353DEEE9354DEEBCED59355B4A79356935793589359935ABFABBEBE935B935CBDD2935D935E935F9360DEE99361D4AE9362DEDE9363DEEA9364936593669367C0BF9368DEECB2F3B8E9C2A79369936ABDC1936B936C936D936E936FDEF5DEF893709371B2ABB4A493729373B4EAC9A6937493759376937793789379DEF6CBD1937AB8E3937BDEF7DEFA937C937D937E9380DEF9938193829383CCC29384B0E1B4EE93859386938793889389938AE5BA938B938C938D938E938FD0AF93909391B2EB9392EBA19393DEF493949395C9E3DEF3B0DAD2A1B1F79396CCAF939793989399939A939B939C939DDEF0939ECBA4939F93A093A1D5AA93A293A393A493A593A6DEFB93A793A893A993AA93AB93AC93AD93AEB4DD93AFC4A693B093B193B2DEFD93B393B493B593B693B793B893B993BA93BB93BCC3FEC4A1DFA193BD93BE93BF93C093C193C293C3C1CC93C4DEFCBEEF93C5C6B293C693C793C893C993CA93CB93CC93CD93CEB3C5C8F693CF93D0CBBADEFE93D193D2DFA493D393D493D593D6D7B293D793D893D993DA93DBB3B793DC93DD93DE93DFC1C393E093E1C7CBB2A5B4E993E2D7AB93E393E493E593E6C4EC93E7DFA2DFA393E8DFA593E9BAB393EA93EB93ECDFA693EDC0DE93EE93EFC9C393F093F193F293F393F493F593F6B2D9C7E693F7DFA793F8C7DC93F993FA93FB93FCDFA8EBA293FD93FE944094419442CBD3944394449445DFAA9446DFA99447B2C194489449944A944B944C944D944E944F9450945194529453945494559456945794589459945A945B945C945D945E945F9460C5CA94619462946394649465946694679468DFAB9469946A946B946C946D946E946F9470D4DC94719472947394749475C8C19476947794789479947A947B947C947D947E948094819482DFAC94839484948594869487BEF094889489DFADD6A7948A948B948C948DEAB7EBB6CAD5948ED8FCB8C4948FB9A594909491B7C5D5FE94929493949494959496B9CA94979498D0A7F4CD9499949AB5D0949B949CC3F4949DBEC8949E949F94A0EBB7B0BD94A194A2BDCC94A3C1B294A4B1D6B3A894A594A694A7B8D2C9A294A894A9B6D894AA94AB94AC94ADEBB8BEB494AE94AF94B0CAFD94B1C7C394B2D5FB94B394B4B7F394B594B694B794B894B994BA94BB94BC94BD94BE94BF94C094C194C294C3CEC494C494C594C6D5ABB1F394C794C894C9ECB3B0DF94CAECB594CB94CC94CDB6B794CEC1CF94CFF5FAD0B194D094D1D5E594D2CED394D394D4BDEFB3E294D5B8AB94D6D5B694D7EDBD94D8B6CF94D9CBB9D0C294DA94DB94DC94DD94DE94DF94E094E1B7BD94E294E3ECB6CAA994E494E594E6C5D494E7ECB9ECB8C2C3ECB794E894E994EA94EBD0FDECBA94ECECBBD7E594ED94EEECBC94EF94F094F1ECBDC6EC94F294F394F494F594F694F794F894F9CEDE94FABCC894FB94FCC8D5B5A9BEC9D6BCD4E794FD94FED1AED0F1EAB8EAB9EABABAB59540954195429543CAB1BFF595449545CDFA9546954795489549954AEAC0954BB0BAEABE954C954DC0A5954E954F9550EABB9551B2FD9552C3F7BBE8955395549555D2D7CEF4EABF955695579558EABC9559955A955BEAC3955CD0C7D3B3955D955E955F9560B4BA9561C3C1D7F29562956395649565D5D19566CAC79567EAC595689569EAC4EAC7EAC6956A956B956C956D956ED6E7956FCFD495709571EACB9572BBCE9573957495759576957795789579BDFAC9CE957A957BEACC957C957DC9B9CFFEEACAD4CEEACDEACF957E9580CDED9581958295839584EAC99585EACE95869587CEEE9588BBDE9589B3BF958A958B958C958D958EC6D5BEB0CEFA958F95909591C7E79592BEA7EAD095939594D6C7959595969597C1C095989599959AD4DD959BEAD1959C959DCFBE959E959F95A095A1EAD295A295A395A495A5CAEE95A695A795A895A9C5AFB0B595AA95AB95AC95AD95AEEAD495AF95B095B195B295B395B495B595B695B7EAD3F4DF95B895B995BA95BB95BCC4BA95BD95BE95BF95C095C1B1A995C295C395C495C5E5DF95C695C795C895C9EAD595CA95CB95CC95CD95CE95CF95D095D195D295D395D495D595D695D795D895D995DA95DB95DC95DD95DE95DF95E095E195E295E3CAEF95E4EAD6EAD7C6D895E595E695E795E895E995EA95EB95ECEAD895ED95EEEAD995EF95F095F195F295F395F4D4BB95F5C7FAD2B7B8FC95F695F7EAC295F8B2DC95F995FAC2FC95FBD4F8CCE6D7EE95FC95FD95FE9640964196429643D4C2D3D0EBC3C5F39644B7FE96459646EBD4964796489649CBB7EBDE964AC0CA964B964C964DCDFB964EB3AF964FC6DA965096519652965396549655EBFC9656C4BE9657CEB4C4A9B1BED4FD9658CAF59659D6EC965A965BC6D3B6E4965C965D965E965FBBFA96609661D0E096629663C9B19664D4D3C8A896659666B8CB9667E8BEC9BC96689669E8BB966AC0EED0D3B2C4B4E5966BE8BC966C966DD5C8966E966F967096719672B6C59673E8BDCAF8B8DCCCF5967496759676C0B496779678D1EEE8BFE8C29679967ABABC967BB1ADBDDC967CEABDE8C3967DE8C6967EE8CB9680968196829683E8CC9684CBC9B0E59685BCAB96869687B9B996889689E8C1968ACDF7968BE8CA968C968D968E968FCEF69690969196929693D5ED9694C1D6E8C49695C3B69696B9FBD6A6E8C8969796989699CAE0D4E6969AE8C0969BE8C5E8C7969CC7B9B7E3969DE8C9969EBFDDE8D2969F96A0E8D796A1E8D5BCDCBCCFE8DB96A296A396A496A596A696A796A896A9E8DE96AAE8DAB1FA96AB96AC96AD96AE96AF96B096B196B296B396B4B0D8C4B3B8CCC6E2C8BEC8E196B596B696B7E8CFE8D4E8D696B8B9F1E8D8D7F596B9C4FB96BAE8DC96BB96BCB2E996BD96BE96BFE8D196C096C1BCED96C296C3BFC2E8CDD6F996C4C1F8B2F196C596C696C796C896C996CA96CB96CCE8DF96CDCAC1E8D996CE96CF96D096D1D5A496D2B1EAD5BBE8CEE8D0B6B0E8D396D3E8DDC0B896D4CAF796D5CBA896D696D7C6DCC0F596D896D996DA96DB96DCE8E996DD96DE96DFD0A396E096E196E296E396E496E596E6E8F2D6EA96E796E896E996EA96EB96EC96EDE8E0E8E196EE96EF96F0D1F9BACBB8F996F196F2B8F1D4D4E8EF96F3E8EEE8ECB9F0CCD2E8E6CEA6BFF296F4B0B8E8F1E8F096F5D7C096F6E8E496F7CDA9C9A396F8BBB8BDDBE8EA96F996FA96FB96FC96FD96FE9740974197429743E8E2E8E3E8E5B5B5E8E7C7C5E8EBE8EDBDB0D7AE9744E8F897459746974797489749974A974B974CE8F5974DCDB0E8F6974E974F9750975197529753975497559756C1BA9757E8E89758C3B7B0F09759975A975B975C975D975E975F9760E8F4976197629763E8F7976497659766B9A3976797689769976A976B976C976D976E976F9770C9D2977197729773C3CECEE0C0E69774977597769777CBF39778CCDDD0B59779977ACAE1977BE8F3977C977D977E9780978197829783978497859786BCEC9787E8F997889789978A978B978C978DC3DE978EC6E5978FB9F79790979197929793B0F497949795D7D897969797BCAC9798C5EF9799979A979B979C979DCCC4979E979FE9A697A097A197A297A397A497A597A697A797A897A9C9AD97AAE9A2C0E297AB97AC97ADBFC397AE97AF97B0E8FEB9D797B1E8FB97B297B397B497B5E9A497B697B797B8D2CE97B997BA97BB97BC97BDE9A397BED6B2D7B597BFE9A797C0BDB797C197C297C397C497C597C697C797C897C997CA97CB97CCE8FCE8FD97CD97CE97CFE9A197D097D197D297D397D497D597D697D7CDD697D897D9D2AC97DA97DB97DCE9B297DD97DE97DF97E0E9A997E197E297E3B4AA97E4B4BB97E597E6E9AB97E797E897E997EA97EB97EC97ED97EE97EF97F097F197F297F397F497F597F697F7D0A897F897F9E9A597FA97FBB3FE97FC97FDE9ACC0E397FEE9AA98409841E9B998429843E9B89844984598469847E9AE98489849E8FA984A984BE9A8984C984D984E984F9850BFACE9B1E9BA98519852C2A5985398549855E9AF9856B8C59857E9AD9858D3DCE9B4E9B5E9B79859985A985BE9C7985C985D985E985F98609861C0C6E9C598629863E9B098649865E9BBB0F19866986798689869986A986B986C986D986E986FE9BCD5A598709871E9BE9872E9BF987398749875E9C198769877C1F198789879C8B6987A987B987CE9BD987D987E988098819882E9C29883988498859886988798889889988AE9C3988BE9B3988CE9B6988DBBB1988E988F9890E9C0989198929893989498959896BCF7989798989899E9C4E9C6989A989B989C989D989E989F98A098A198A298A398A498A5E9CA98A698A798A898A9E9CE98AA98AB98AC98AD98AE98AF98B098B198B298B3B2DB98B4E9C898B598B698B798B898B998BA98BB98BC98BD98BEB7AE98BF98C098C198C298C398C498C598C698C798C898C998CAE9CBE9CC98CB98CC98CD98CE98CF98D0D5C198D1C4A398D298D398D498D598D698D7E9D898D8BAE198D998DA98DB98DCE9C998DDD3A398DE98DF98E0E9D498E198E298E398E498E598E698E7E9D7E9D098E898E998EA98EB98ECE9CF98ED98EEC7C198EF98F098F198F298F398F498F598F6E9D298F798F898F998FA98FB98FC98FDE9D9B3C898FEE9D399409941994299439944CFF0994599469947E9CD99489949994A994B994C994D994E994F995099519952B3F79953995499559956995799589959E9D6995A995BE9DA995C995D995ECCB4995F99609961CFAD99629963996499659966996799689969996AE9D5996BE9DCE9DB996C996D996E996F9970E9DE99719972997399749975997699779978E9D19979997A997B997C997D997E99809981E9DD9982E9DFC3CA9983998499859986998799889989998A998B998C998D998E998F9990999199929993999499959996999799989999999A999B999C999D999E999F99A099A199A299A399A499A599A699A799A899A999AA99AB99AC99AD99AE99AF99B099B199B299B399B499B599B699B799B899B999BA99BB99BC99BD99BE99BF99C099C199C299C399C499C599C699C799C899C999CA99CB99CC99CD99CE99CF99D099D199D299D399D499D599D699D799D899D999DA99DB99DC99DD99DE99DF99E099E199E299E399E499E599E699E799E899E999EA99EB99EC99ED99EE99EF99F099F199F299F399F499F5C7B7B4CEBBB6D0C0ECA399F699F7C5B799F899F999FA99FB99FC99FD99FE9A409A419A42D3FB9A439A449A459A46ECA49A47ECA5C6DB9A489A499A4ABFEE9A4B9A4C9A4D9A4EECA69A4F9A50ECA7D0AA9A51C7B89A529A53B8E89A549A559A569A579A589A599A5A9A5B9A5C9A5D9A5E9A5FECA89A609A619A629A639A649A659A669A67D6B9D5FDB4CBB2BDCEE4C6E79A689A69CDE19A6A9A6B9A6C9A6D9A6E9A6F9A709A719A729A739A749A759A769A77B4F59A78CBC0BCDF9A799A7A9A7B9A7CE9E2E9E3D1EAE9E59A7DB4F9E9E49A7ED1B3CAE2B2D09A80E9E89A819A829A839A84E9E6E9E79A859A86D6B39A879A889A89E9E9E9EA9A8A9A8B9A8C9A8D9A8EE9EB9A8F9A909A919A929A939A949A959A96E9EC9A979A989A999A9A9A9B9A9C9A9D9A9EECAFC5B9B6CE9A9FD2F39AA09AA19AA29AA39AA49AA59AA6B5EE9AA7BBD9ECB19AA89AA9D2E39AAA9AAB9AAC9AAD9AAECEE39AAFC4B89AB0C3BF9AB19AB2B6BED8B9B1C8B1CFB1D1C5FE9AB3B1D09AB4C3AB9AB59AB69AB79AB89AB9D5B19ABA9ABB9ABC9ABD9ABE9ABF9AC09AC1EBA4BAC19AC29AC39AC4CCBA9AC59AC69AC7EBA59AC8EBA79AC99ACA9ACBEBA89ACC9ACD9ACEEBA69ACF9AD09AD19AD29AD39AD49AD5EBA9EBABEBAA9AD69AD79AD89AD99ADAEBAC9ADBCACFD8B5C3F19ADCC3A5C6F8EBADC4CA9ADDEBAEEBAFEBB0B7D59ADE9ADF9AE0B7FA9AE1EBB1C7E29AE2EBB39AE3BAA4D1F5B0B1EBB2EBB49AE49AE59AE6B5AAC2C8C7E89AE7EBB59AE8CBAEE3DF9AE99AEAD3C09AEB9AEC9AED9AEED9DB9AEF9AF0CDA1D6ADC7F39AF19AF29AF3D9E0BBE39AF4BABAE3E29AF59AF69AF79AF89AF9CFAB9AFA9AFB9AFCE3E0C9C79AFDBAB99AFE9B409B41D1B4E3E1C8EAB9AFBDADB3D8CEDB9B429B43CCC09B449B459B46E3E8E3E9CDF49B479B489B499B4A9B4BCCAD9B4CBCB39B4DE3EA9B4EE3EB9B4F9B50D0DA9B519B529B53C6FBB7DA9B549B55C7DFD2CACED69B56E3E4E3EC9B57C9F2B3C19B589B59E3E79B5A9B5BC6E3E3E59B5C9B5DEDB3E3E69B5E9B5F9B609B61C9B39B62C5E69B639B649B65B9B59B66C3BB9B67E3E3C5BDC1A4C2D9B2D79B68E3EDBBA6C4AD9B69E3F0BEDA9B6A9B6BE3FBE3F5BAD39B6C9B6D9B6E9B6FB7D0D3CD9B70D6CED5D3B9C1D5B4D1D89B719B729B739B74D0B9C7F69B759B769B77C8AAB2B49B78C3DA9B799B7A9B7BE3EE9B7C9B7DE3FCE3EFB7A8E3F7E3F49B7E9B809B81B7BA9B829B83C5A29B84E3F6C5DDB2A8C6FC9B85C4E09B869B87D7A29B88C0E1E3F99B899B8AE3FAE3FDCCA9E3F39B8BD3BE9B8CB1C3EDB4E3F1E3F29B8DE3F8D0BAC6C3D4F3E3FE9B8E9B8FBDE09B909B91E4A79B929B93E4A69B949B959B96D1F3E4A39B97E4A99B989B999B9AC8F79B9B9B9C9B9D9B9ECFB49B9FE4A8E4AEC2E59BA09BA1B6B49BA29BA39BA49BA59BA69BA7BDF29BA8E4A29BA99BAABAE9E4AA9BAB9BACE4AC9BAD9BAEB6FDD6DEE4B29BAFE4AD9BB09BB19BB2E4A19BB3BBEECDDDC7A2C5C99BB49BB5C1F79BB6E4A49BB7C7B3BDACBDBDE4A59BB8D7C7B2E29BB9E4ABBCC3E4AF9BBABBEBE4B0C5A8E4B19BBB9BBC9BBD9BBED5E3BFA39BBFE4BA9BC0E4B79BC1E4BB9BC29BC3E4BD9BC49BC5C6D69BC69BC7BAC6C0CB9BC89BC99BCAB8A1E4B49BCB9BCC9BCD9BCED4A19BCF9BD0BAA3BDFE9BD19BD29BD3E4BC9BD49BD59BD69BD79BD8CDBF9BD99BDAC4F99BDB9BDCCFFBC9E69BDD9BDED3BF9BDFCFD19BE09BE1E4B39BE2E4B8E4B9CCE99BE39BE49BE59BE69BE7CCCE9BE8C0D4E4B5C1B0E4B6CED09BE9BBC1B5D39BEAC8F3BDA7D5C7C9ACB8A2E4CA9BEB9BECE4CCD1C49BED9BEED2BA9BEF9BF0BAAD9BF19BF2BAD49BF39BF49BF59BF69BF79BF8E4C3B5ED9BF99BFA9BFBD7CDE4C0CFFDE4BF9BFC9BFD9BFEC1DCCCCA9C409C419C429C43CAE79C449C459C469C47C4D79C48CCD4E4C89C499C4A9C4BE4C7E4C19C4CE4C4B5AD9C4D9C4ED3D99C4FE4C69C509C519C529C53D2F9B4E39C54BBB49C559C56C9EE9C57B4BE9C589C599C5ABBEC9C5BD1CD9C5CCCEDEDB59C5D9C5E9C5F9C609C619C629C639C64C7E59C659C669C679C68D4A89C69E4CBD7D5E4C29C6ABDA5E4C59C6B9C6CD3E69C6DE4C9C9F89C6E9C6FE4BE9C709C71D3E59C729C73C7FEB6C99C74D4FCB2B3E4D79C759C769C77CEC29C78E4CD9C79CEBC9C7AB8DB9C7B9C7CE4D69C7DBFCA9C7E9C809C81D3CE9C82C3EC9C839C849C859C869C879C889C899C8AC5C8E4D89C8B9C8C9C8D9C8E9C8F9C909C919C92CDC4E4CF9C939C949C959C96E4D4E4D59C97BAFE9C98CFE69C999C9AD5BF9C9B9C9C9C9DE4D29C9E9C9F9CA09CA19CA29CA39CA49CA59CA69CA79CA8E4D09CA99CAAE4CE9CAB9CAC9CAD9CAE9CAF9CB09CB19CB29CB39CB49CB59CB69CB79CB89CB9CDE5CAAA9CBA9CBB9CBCC0A39CBDBDA6E4D39CBE9CBFB8C89CC09CC19CC29CC39CC4E4E7D4B49CC59CC69CC79CC89CC99CCA9CCBE4DB9CCC9CCD9CCEC1EF9CCF9CD0E4E99CD19CD2D2E79CD39CD4E4DF9CD5E4E09CD69CD7CFAA9CD89CD99CDA9CDBCBDD9CDCE4DAE4D19CDDE4E59CDEC8DCE4E39CDF9CE0C4E7E4E29CE1E4E19CE29CE39CE4B3FCE4E89CE59CE69CE79CE8B5E19CE99CEA9CEBD7CC9CEC9CED9CEEE4E69CEFBBAC9CF0D7D2CCCFEBF89CF1E4E49CF29CF3B9F69CF49CF59CF6D6CDE4D9E4DCC2FAE4DE9CF7C2CBC0C4C2D09CF8B1F5CCB29CF99CFA9CFB9CFC9CFD9CFE9D409D419D429D43B5CE9D449D459D469D47E4EF9D489D499D4A9D4B9D4C9D4D9D4E9D4FC6AF9D509D519D52C6E19D539D54E4F59D559D569D579D589D59C2A99D5A9D5B9D5CC0ECD1DDE4EE9D5D9D5E9D5F9D609D619D629D639D649D659D66C4AE9D679D689D69E4ED9D6A9D6B9D6C9D6DE4F6E4F4C2FE9D6EE4DD9D6FE4F09D70CAFE9D71D5C49D729D73E4F19D749D759D769D779D789D799D7AD1FA9D7B9D7C9D7D9D7E9D809D819D82E4EBE4EC9D839D849D85E4F29D86CEAB9D879D889D899D8A9D8B9D8C9D8D9D8E9D8F9D90C5CB9D919D929D93C7B19D94C2BA9D959D969D97E4EA9D989D999D9AC1CA9D9B9D9C9D9D9D9E9D9F9DA0CCB6B3B19DA19DA29DA3E4FB9DA4E4F39DA59DA69DA7E4FA9DA8E4FD9DA9E4FC9DAA9DAB9DAC9DAD9DAE9DAF9DB0B3CE9DB19DB29DB3B3BAE4F79DB49DB5E4F9E4F8C5EC9DB69DB79DB89DB99DBA9DBB9DBC9DBD9DBE9DBF9DC09DC19DC2C0BD9DC39DC49DC59DC6D4E89DC79DC89DC99DCA9DCBE5A29DCC9DCD9DCE9DCF9DD09DD19DD29DD39DD49DD59DD6B0C49DD79DD8E5A49DD99DDAE5A39DDB9DDC9DDD9DDE9DDF9DE0BCA49DE1E5A59DE29DE39DE49DE59DE69DE7E5A19DE89DE99DEA9DEB9DEC9DED9DEEE4FEB1F49DEF9DF09DF19DF29DF39DF49DF59DF69DF79DF89DF9E5A89DFAE5A9E5A69DFB9DFC9DFD9DFE9E409E419E429E439E449E459E469E47E5A7E5AA9E489E499E4A9E4B9E4C9E4D9E4E9E4F9E509E519E529E539E549E559E569E579E589E599E5A9E5B9E5C9E5D9E5E9E5F9E609E619E629E639E649E659E669E679E68C6D99E699E6A9E6B9E6C9E6D9E6E9E6F9E70E5ABE5AD9E719E729E739E749E759E769E77E5AC9E789E799E7A9E7B9E7C9E7D9E7E9E809E819E829E839E849E859E869E879E889E89E5AF9E8A9E8B9E8CE5AE9E8D9E8E9E8F9E909E919E929E939E949E959E969E979E989E999E9A9E9B9E9C9E9D9E9EB9E09E9F9EA0E5B09EA19EA29EA39EA49EA59EA69EA79EA89EA99EAA9EAB9EAC9EAD9EAEE5B19EAF9EB09EB19EB29EB39EB49EB59EB69EB79EB89EB99EBABBF0ECE1C3F09EBBB5C6BBD29EBC9EBD9EBE9EBFC1E9D4EE9EC0BEC49EC19EC29EC3D7C69EC4D4D6B2D3ECBE9EC59EC69EC79EC8EAC19EC99ECA9ECBC2AFB4B69ECC9ECD9ECED1D79ECF9ED09ED1B3B49ED2C8B2BFBBECC09ED39ED4D6CB9ED59ED6ECBFECC19ED79ED89ED99EDA9EDB9EDC9EDD9EDE9EDF9EE09EE19EE29EE3ECC5BEE6CCBFC5DABEBC9EE4ECC69EE5B1FE9EE69EE79EE8ECC4D5A8B5E39EE9ECC2C1B6B3E39EEA9EEBECC3CBB8C0C3CCFE9EEC9EED9EEE9EEFC1D29EF0ECC89EF19EF29EF39EF49EF59EF69EF79EF89EF99EFA9EFB9EFC9EFDBAE6C0D39EFED6F29F409F419F42D1CC9F439F449F459F46BFBE9F47B7B3C9D5ECC7BBE29F48CCCCBDFDC8C89F49CFA99F4A9F4B9F4C9F4D9F4E9F4F9F50CDE99F51C5EB9F529F539F54B7E99F559F569F579F589F599F5A9F5B9F5C9F5D9F5E9F5FD1C9BAB89F609F619F629F639F64ECC99F659F66ECCA9F67BBC0ECCB9F68ECE2B1BAB7D99F699F6A9F6B9F6C9F6D9F6E9F6F9F709F719F729F73BDB99F749F759F769F779F789F799F7A9F7BECCCD1E6ECCD9F7C9F7D9F7E9F80C8BB9F819F829F839F849F859F869F879F889F899F8A9F8B9F8C9F8D9F8EECD19F8F9F909F919F92ECD39F93BBCD9F94BCE59F959F969F979F989F999F9A9F9B9F9C9F9D9F9E9F9F9FA09FA1ECCF9FA2C9B79FA39FA49FA59FA69FA7C3BA9FA8ECE3D5D5ECD09FA99FAA9FAB9FAC9FADD6F39FAE9FAF9FB0ECD2ECCE9FB19FB29FB39FB4ECD49FB5ECD59FB69FB7C9BF9FB89FB99FBA9FBB9FBC9FBDCFA89FBE9FBF9FC09FC19FC2D0DC9FC39FC49FC59FC6D1AC9FC79FC89FC99FCAC8DB9FCB9FCC9FCDECD6CEF59FCE9FCF9FD09FD19FD2CAECECDA9FD39FD49FD59FD69FD79FD89FD9ECD99FDA9FDB9FDCB0BE9FDD9FDE9FDF9FE09FE19FE2ECD79FE3ECD89FE49FE59FE6ECE49FE79FE89FE99FEA9FEB9FEC9FED9FEE9FEFC8BC9FF09FF19FF29FF39FF49FF59FF69FF79FF89FF9C1C79FFA9FFB9FFC9FFD9FFEECDCD1E0A040A041A042A043A044A045A046A047A048A049ECDBA04AA04BA04CA04DD4EFA04EECDDA04FA050A051A052A053A054DBC6A055A056A057A058A059A05AA05BA05CA05DA05EECDEA05FA060A061A062A063A064A065A066A067A068A069A06AB1ACA06BA06CA06DA06EA06FA070A071A072A073A074A075A076A077A078A079A07AA07BA07CA07DA07EA080A081ECDFA082A083A084A085A086A087A088A089A08AA08BECE0A08CD7A6A08DC5C0A08EA08FA090EBBCB0AEA091A092A093BEF4B8B8D2AFB0D6B5F9A094D8B3A095CBACA096E3DDA097A098A099A09AA09BA09CA09DC6ACB0E6A09EA09FA0A0C5C6EBB9A0A1A0A2A0A3A0A4EBBAA0A5A0A6A0A7EBBBA0A8A0A9D1C0A0AAC5A3A0ABEAF2A0ACC4B2A0ADC4B5C0CEA0AEA0AFA0B0EAF3C4C1A0B1CEEFA0B2A0B3A0B4A0B5EAF0EAF4A0B6A0B7C9FCA0B8A0B9C7A3A0BAA0BBA0BCCCD8CEFEA0BDA0BEA0BFEAF5EAF6CFACC0E7A0C0A0C1EAF7A0C2A0C3A0C4A0C5A0C6B6BFEAF8A0C7EAF9A0C8EAFAA0C9A0CAEAFBA0CBA0CCA0CDA0CEA0CFA0D0A0D1A0D2A0D3A0D4A0D5A0D6EAF1A0D7A0D8A0D9A0DAA0DBA0DCA0DDA0DEA0DFA0E0A0E1A0E2C8AEE1EBA0E3B7B8E1ECA0E4A0E5A0E6E1EDA0E7D7B4E1EEE1EFD3CCA0E8A0E9A0EAA0EBA0ECA0EDA0EEE1F1BFF1E1F0B5D2A0EFA0F0A0F1B1B7A0F2A0F3A0F4A0F5E1F3E1F2A0F6BAFCA0F7E1F4A0F8A0F9A0FAA0FBB9B7A0FCBED1A0FDA0FEAA40AA41C4FCAA42BADDBDC6AA43AA44AA45AA46AA47AA48E1F5E1F7AA49AA4AB6C0CFC1CAA8E1F6D5F8D3FCE1F8E1FCE1F9AA4BAA4CE1FAC0EAAA4DE1FEE2A1C0C7AA4EAA4FAA50AA51E1FBAA52E1FDAA53AA54AA55AA56AA57AA58E2A5AA59AA5AAA5BC1D4AA5CAA5DAA5EAA5FE2A3AA60E2A8B2FEE2A2AA61AA62AA63C3CDB2C2E2A7E2A6AA64AA65E2A4E2A9AA66AA67E2ABAA68AA69AA6AD0C9D6EDC3A8E2ACAA6BCFD7AA6CAA6DE2AEAA6EAA6FBAEFAA70AA71E9E0E2ADE2AAAA72AA73AA74AA75BBABD4B3AA76AA77AA78AA79AA7AAA7BAA7CAA7DAA7EAA80AA81AA82AA83E2B0AA84AA85E2AFAA86E9E1AA87AA88AA89AA8AE2B1AA8BAA8CAA8DAA8EAA8FAA90AA91AA92E2B2AA93AA94AA95AA96AA97AA98AA99AA9AAA9BAA9CAA9DE2B3CCA1AA9EE2B4AA9FAAA0AB40AB41AB42AB43AB44AB45AB46AB47AB48AB49AB4AAB4BE2B5AB4CAB4DAB4EAB4FAB50D0FEAB51AB52C2CAAB53D3F1AB54CDF5AB55AB56E7E0AB57AB58E7E1AB59AB5AAB5BAB5CBEC1AB5DAB5EAB5FAB60C2EAAB61AB62AB63E7E4AB64AB65E7E3AB66AB67AB68AB69AB6AAB6BCDE6AB6CC3B5AB6DAB6EE7E2BBB7CFD6AB6FC1E1E7E9AB70AB71AB72E7E8AB73AB74E7F4B2A3AB75AB76AB77AB78E7EAAB79E7E6AB7AAB7BAB7CAB7DAB7EE7ECE7EBC9BAAB80AB81D5E4AB82E7E5B7A9E7E7AB83AB84AB85AB86AB87AB88AB89E7EEAB8AAB8BAB8CAB8DE7F3AB8ED6E9AB8FAB90AB91AB92E7EDAB93E7F2AB94E7F1AB95AB96AB97B0E0AB98AB99AB9AAB9BE7F5AB9CAB9DAB9EAB9FABA0AC40AC41AC42AC43AC44AC45AC46AC47AC48AC49AC4AC7F2AC4BC0C5C0EDAC4CAC4DC1F0E7F0AC4EAC4FAC50AC51E7F6CBF6AC52AC53AC54AC55AC56AC57AC58AC59AC5AE8A2E8A1AC5BAC5CAC5DAC5EAC5FAC60D7C1AC61AC62E7FAE7F9AC63E7FBAC64E7F7AC65E7FEAC66E7FDAC67E7FCAC68AC69C1D5C7D9C5FDC5C3AC6AAC6BAC6CAC6DAC6EC7EDAC6FAC70AC71AC72E8A3AC73AC74AC75AC76AC77AC78AC79AC7AAC7BAC7CAC7DAC7EAC80AC81AC82AC83AC84AC85AC86E8A6AC87E8A5AC88E8A7BAF7E7F8E8A4AC89C8F0C9AAAC8AAC8BAC8CAC8DAC8EAC8FAC90AC91AC92AC93AC94AC95AC96E8A9AC97AC98B9E5AC99AC9AAC9BAC9CAC9DD1FEE8A8AC9EAC9FACA0AD40AD41AD42E8AAAD43E8ADE8AEAD44C1A7AD45AD46AD47E8AFAD48AD49AD4AE8B0AD4BAD4CE8ACAD4DE8B4AD4EAD4FAD50AD51AD52AD53AD54AD55AD56AD57AD58E8ABAD59E8B1AD5AAD5BAD5CAD5DAD5EAD5FAD60AD61E8B5E8B2E8B3AD62AD63AD64AD65AD66AD67AD68AD69AD6AAD6BAD6CAD6DAD6EAD6FAD70AD71E8B7AD72AD73AD74AD75AD76AD77AD78AD79AD7AAD7BAD7CAD7DAD7EAD80AD81AD82AD83AD84AD85AD86AD87AD88AD89E8B6AD8AAD8BAD8CAD8DAD8EAD8FAD90AD91AD92B9CFAD93F0ACAD94F0ADAD95C6B0B0EAC8BFAD96CDDFAD97AD98AD99AD9AAD9BAD9CAD9DCECDEAB1AD9EAD9FADA0AE40EAB2AE41C6BFB4C9AE42AE43AE44AE45AE46AE47AE48EAB3AE49AE4AAE4BAE4CD5E7AE4DAE4EAE4FAE50AE51AE52AE53AE54DDF9AE55EAB4AE56EAB5AE57EAB6AE58AE59AE5AAE5BB8CADFB0C9F5AE5CCCF0AE5DAE5EC9FAAE5FAE60AE61AE62AE63C9FBAE64AE65D3C3CBA6AE66B8A6F0AEB1C2AE67E5B8CCEFD3C9BCD7C9EAAE68B5E7AE69C4D0B5E9AE6AEEAEBBADAE6BAE6CE7DEAE6DEEAFAE6EAE6FAE70AE71B3A9AE72AE73EEB2AE74AE75EEB1BDE7AE76EEB0CEB7AE77AE78AE79AE7AC5CFAE7BAE7CAE7DAE7EC1F4DBCEEEB3D0F3AE80AE81AE82AE83AE84AE85AE86AE87C2D4C6E8AE88AE89AE8AB7ACAE8BAE8CAE8DAE8EAE8FAE90AE91EEB4AE92B3EBAE93AE94AE95BBFBEEB5AE96AE97AE98AE99AE9AE7DCAE9BAE9CAE9DEEB6AE9EAE9FBDAEAEA0AF40AF41AF42F1E2AF43AF44AF45CAE8AF46D2C9F0DAAF47F0DBAF48F0DCC1C6AF49B8EDBECEAF4AAF4BF0DEAF4CC5B1F0DDD1F1AF4DF0E0B0CCBDEAAF4EAF4FAF50AF51AF52D2DFF0DFAF53B4AFB7E8F0E6F0E5C6A3F0E1F0E2B4C3AF54AF55F0E3D5EEAF56AF57CCDBBED2BCB2AF58AF59AF5AF0E8F0E7F0E4B2A1AF5BD6A2D3B8BEB7C8ACAF5CAF5DF0EAAF5EAF5FAF60AF61D1F7AF62D6CCBADBF0E9AF63B6BBAF64AF65CDB4AF66AF67C6A6AF68AF69AF6AC1A1F0EBF0EEAF6BF0EDF0F0F0ECAF6CBBBEF0EFAF6DAF6EAF6FAF70CCB5F0F2AF71AF72B3D5AF73AF74AF75AF76B1D4AF77AF78F0F3AF79AF7AF0F4F0F6B4E1AF7BF0F1AF7CF0F7AF7DAF7EAF80AF81F0FAAF82F0F8AF83AF84AF85F0F5AF86AF87AF88AF89F0FDAF8AF0F9F0FCF0FEAF8BF1A1AF8CAF8DAF8ECEC1F1A4AF8FF1A3AF90C1F6F0FBCADDAF91AF92B4F1B1F1CCB1AF93F1A6AF94AF95F1A7AF96AF97F1ACD5CEF1A9AF98AF99C8B3AF9AAF9BAF9CF1A2AF9DF1ABF1A8F1A5AF9EAF9FF1AAAFA0B040B041B042B043B044B045B046B0A9F1ADB047B048B049B04AB04BB04CF1AFB04DF1B1B04EB04FB050B051B052F1B0B053F1AEB054B055B056B057D1A2B058B059B05AB05BB05CB05DB05EF1B2B05FB060B061F1B3B062B063B064B065B066B067B068B069B9EFB06AB06BB5C7B06CB0D7B0D9B06DB06EB06FD4EDB070B5C4B071BDD4BBCAF0A7B072B073B8DEB074B075F0A8B076B077B0A8B078F0A9B079B07ACDEEB07BB07CF0AAB07DB07EB080B081B082B083B084B085B086B087F0ABB088B089B08AB08BB08CB08DB08EB08FB090C6A4B091B092D6E5F1E4B093F1E5B094B095B096B097B098B099B09AB09BB09CB09DC3F3B09EB09FD3DBB0A0B140D6D1C5E8B141D3AFB142D2E6B143B144EEC1B0BBD5B5D1CEBCE0BAD0B145BFF8B146B8C7B5C1C5CCB147B148CAA2B149B14AB14BC3CBB14CB14DB14EB14FB150EEC2B151B152B153B154B155B156B157B158C4BFB6A2B159EDECC3A4B15AD6B1B15BB15CB15DCFE0EDEFB15EB15FC5CEB160B6DCB161B162CAA1B163B164EDEDB165B166EDF0EDF1C3BCB167BFB4B168EDEEB169B16AB16BB16CB16DB16EB16FB170B171B172B173EDF4EDF2B174B175B176B177D5E6C3DFB178EDF3B179B17AB17BEDF6B17CD5A3D1A3B17DB17EB180EDF5B181C3D0B182B183B184B185B186EDF7BFF4BEECEDF8B187CCF7B188D1DBB189B18AB18BD7C5D5F6B18CEDFCB18DB18EB18FEDFBB190B191B192B193B194B195B196B197EDF9EDFAB198B199B19AB19BB19CB19DB19EB19FEDFDBEA6B1A0B240B241B242B243CBAFEEA1B6BDB244EEA2C4C0B245EDFEB246B247BDDEB2C7B248B249B24AB24BB24CB24DB24EB24FB250B251B252B253B6C3B254B255B256EEA5D8BAEEA3EEA6B257B258B259C3E9B3F2B25AB25BB25CB25DB25EB25FEEA7EEA4CFB9B260B261EEA8C2F7B262B263B264B265B266B267B268B269B26AB26BB26CB26DEEA9EEAAB26EDEABB26FB270C6B3B271C7C6B272D6F5B5C9B273CBB2B274B275B276EEABB277B278CDABB279EEACB27AB27BB27CB27DB27ED5B0B280EEADB281F6C4B282B283B284B285B286B287B288B289B28AB28BB28CB28DB28EDBC7B28FB290B291B292B293B294B295B296B297B4A3B298B299B29AC3ACF1E6B29BB29CB29DB29EB29FCAB8D2D3B2A0D6AAB340EFF2B341BED8B342BDC3EFF3B6CCB0ABB343B344B345B346CAAFB347B348EDB6B349EDB7B34AB34BB34CB34DCEF9B7AFBFF3EDB8C2EBC9B0B34EB34FB350B351B352B353EDB9B354B355C6F6BFB3B356B357B358EDBCC5F8B359D1D0B35AD7A9EDBAEDBBB35BD1E2B35CEDBFEDC0B35DEDC4B35EB35FB360EDC8B361EDC6EDCED5E8B362EDC9B363B364EDC7EDBEB365B366C5E9B367B368B369C6C6B36AB36BC9E9D4D2EDC1EDC2EDC3EDC5B36CC0F9B36DB4A1B36EB36FB370B371B9E8B372EDD0B373B374B375B376EDD1B377EDCAB378EDCFB379CEF8B37AB37BCBB6EDCCEDCDB37CB37DB37EB380B381CFF5B382B383B384B385B386B387B388B389B38AB38BB38CB38DEDD2C1F2D3B2EDCBC8B7B38EB38FB390B391B392B393B394B395BCEFB396B397B398B399C5F0B39AB39BB39CB39DB39EB39FB3A0B440B441B442EDD6B443B5EFB444B445C2B5B0ADCBE9B446B447B1AEB448EDD4B449B44AB44BCDEBB5E2B44CEDD5EDD3EDD7B44DB44EB5FAB44FEDD8B450EDD9B451EDDCB452B1CCB453B454B455B456B457B458B459B45AC5F6BCEEEDDACCBCB2EAB45BB45CB45DB45EEDDBB45FB460B461B462C4EBB463B464B4C5B465B466B467B0F5B468B469B46AEDDFC0DAB4E8B46BB46CB46DB46EC5CDB46FB470B471EDDDBFC4B472B473B474EDDEB475B476B477B478B479B47AB47BB47CB47DB47EB480B481B482B483C4A5B484B485B486EDE0B487B488B489B48AB48BEDE1B48CEDE3B48DB48EC1D7B48FB490BBC7B491B492B493B494B495B496BDB8B497B498B499EDE2B49AB49BB49CB49DB49EB49FB4A0B540B541B542B543B544B545EDE4B546B547B548B549B54AB54BB54CB54DB54EB54FEDE6B550B551B552B553B554EDE5B555B556B557B558B559B55AB55BB55CB55DB55EB55FB560B561B562B563EDE7B564B565B566B567B568CABEECEAC0F1B569C9E7B56AECEBC6EEB56BB56CB56DB56EECECB56FC6EDECEDB570B571B572B573B574B575B576B577B578ECF0B579B57AD7E6ECF3B57BB57CECF1ECEEECEFD7A3C9F1CBEEECF4B57DECF2B57EB580CFE9B581ECF6C6B1B582B583B584B585BCC0B586ECF5B587B588B589B58AB58BB58CB58DB5BBBBF6B58EECF7B58FB590B591B592B593D9F7BDFBB594B595C2BBECF8B596B597B598B599ECF9B59AB59BB59CB59DB8A3B59EB59FB5A0B640B641B642B643B644B645B646ECFAB647B648B649B64AB64BB64CB64DB64EB64FB650B651B652ECFBB653B654B655B656B657B658B659B65AB65BB65CB65DECFCB65EB65FB660B661B662D3EDD8AEC0EBB663C7DDBACCB664D0E3CBBDB665CDBAB666B667B8D1B668B669B1FCB66AC7EFB66BD6D6B66CB66DB66EBFC6C3EBB66FB670EFF5B671B672C3D8B673B674B675B676B677B678D7E2B679B67AB67BEFF7B3D3B67CC7D8D1EDB67DD6C8B67EEFF8B680EFF6B681BBFDB3C6B682B683B684B685B686B687B688BDD5B689B68AD2C6B68BBBE0B68CB68DCFA1B68EEFFCEFFBB68FB690EFF9B691B692B693B694B3CCB695C9D4CBB0B696B697B698B699B69AEFFEB69BB69CB0DEB69DB69ED6C9B69FB6A0B740EFFDB741B3EDB742B743F6D5B744B745B746B747B748B749B74AB74BB74CB74DB74EB74FB750B751B752CEC8B753B754B755F0A2B756F0A1B757B5BEBCDABBFCB758B8E5B759B75AB75BB75CB75DB75EC4C2B75FB760B761B762B763B764B765B766B767B768F0A3B769B76AB76BB76CB76DCBEBB76EB76FB770B771B772B773B774B775B776B777B778B779B77AB77BB77CB77DB77EB780B781B782B783B784B785B786F0A6B787B788B789D1A8B78ABEBFC7EEF1B6F1B7BFD5B78BB78CB78DB78EB4A9F1B8CDBBB78FC7D4D5ADB790F1B9B791F1BAB792B793B794B795C7CFB796B797B798D2A4D6CFB799B79AF1BBBDD1B4B0BEBDB79BB79CB79DB4DCCED1B79EBFDFF1BDB79FB7A0B840B841BFFAF1BCB842F1BFB843B844B845F1BEF1C0B846B847B848B849B84AF1C1B84BB84CB84DB84EB84FB850B851B852B853B854B855C1FEB856B857B858B859B85AB85BB85CB85DB85EB85FB860C1A2B861B862B863B864B865B866B867B868B869B86ACAFAB86BB86CD5BEB86DB86EB86FB870BEBABEB9D5C2B871B872BFA2B873CDAFF1B5B874B875B876B877B878B879BDDFB87AB6CBB87BB87CB87DB87EB880B881B882B883B884D6F1F3C3B885B886F3C4B887B8CDB888B889B88AF3C6F3C7B88BB0CAB88CF3C5B88DF3C9CBF1B88EB88FB890F3CBB891D0A6B892B893B1CAF3C8B894B895B896F3CFB897B5D1B898B899F3D7B89AF3D2B89BB89CB89DF3D4F3D3B7FBB89EB1BFB89FF3CEF3CAB5DAB8A0F3D0B940B941F3D1B942F3D5B943B944B945B946F3CDB947BCE3B948C1FDB949F3D6B94AB94BB94CB94DB94EB94FF3DAB950F3CCB951B5C8B952BDEEF3DCB953B954B7A4BFF0D6FECDB2B955B4F0B956B2DFB957F3D8B958F3D9C9B8B959F3DDB95AB95BF3DEB95CF3E1B95DB95EB95FB960B961B962B963B964B965B966B967F3DFB968B969F3E3F3E2B96AB96BF3DBB96CBFEAB96DB3EFB96EF3E0B96FB970C7A9B971BCF2B972B973B974B975F3EBB976B977B978B979B97AB97BB97CB9BFB97DB97EF3E4B980B981B982B2ADBBFEB983CBE3B984B985B986B987F3EDF3E9B988B989B98AB9DCF3EEB98BB98CB98DF3E5F3E6F3EAC2E1F3ECF3EFF3E8BCFDB98EB98FB990CFE4B991B992F3F0B993B994B995F3E7B996B997B998B999B99AB99BB99CB99DF3F2B99EB99FB9A0BA40D7ADC6AABA41BA42BA43BA44F3F3BA45BA46BA47BA48F3F1BA49C2A8BA4ABA4BBA4CBA4DBA4EB8DDF3F5BA4FBA50F3F4BA51BA52BA53B4DBBA54BA55BA56F3F6F3F7BA57BA58BA59F3F8BA5ABA5BBA5CC0BABA5DBA5EC0E9BA5FBA60BA61BA62BA63C5F1BA64BA65BA66BA67F3FBBA68F3FABA69BA6ABA6BBA6CBA6DBA6EBA6FBA70B4D8BA71BA72BA73F3FEF3F9BA74BA75F3FCBA76BA77BA78BA79BA7ABA7BF3FDBA7CBA7DBA7EBA80BA81BA82BA83BA84F4A1BA85BA86BA87BA88BA89BA8AF4A3BBC9BA8BBA8CF4A2BA8DBA8EBA8FBA90BA91BA92BA93BA94BA95BA96BA97BA98BA99F4A4BA9ABA9BBA9CBA9DBA9EBA9FB2BEF4A6F4A5BAA0BB40BB41BB42BB43BB44BB45BB46BB47BB48BB49BCAEBB4ABB4BBB4CBB4DBB4EBB4FBB50BB51BB52BB53BB54BB55BB56BB57BB58BB59BB5ABB5BBB5CBB5DBB5EBB5FBB60BB61BB62BB63BB64BB65BB66BB67BB68BB69BB6ABB6BBB6CBB6DBB6EC3D7D9E1BB6FBB70BB71BB72BB73BB74C0E0F4CCD7D1BB75BB76BB77BB78BB79BB7ABB7BBB7CBB7DBB7EBB80B7DBBB81BB82BB83BB84BB85BB86BB87F4CEC1A3BB88BB89C6C9BB8AB4D6D5B3BB8BBB8CBB8DF4D0F4CFF4D1CBDABB8EBB8FF4D2BB90D4C1D6E0BB91BB92BB93BB94B7E0BB95BB96BB97C1B8BB98BB99C1BBF4D3BEACBB9ABB9BBB9CBB9DBB9EB4E2BB9FBBA0F4D4F4D5BEABBC40BC41F4D6BC42BC43BC44F4DBBC45F4D7F4DABC46BAFDBC47F4D8F4D9BC48BC49BC4ABC4BBC4CBC4DBC4EB8E2CCC7F4DCBC4FB2DABC50BC51C3D3BC52BC53D4E3BFB7BC54BC55BC56BC57BC58BC59BC5AF4DDBC5BBC5CBC5DBC5EBC5FBC60C5B4BC61BC62BC63BC64BC65BC66BC67BC68F4E9BC69BC6ACFB5BC6BBC6CBC6DBC6EBC6FBC70BC71BC72BC73BC74BC75BC76BC77BC78CEC9BC79BC7ABC7BBC7CBC7DBC7EBC80BC81BC82BC83BC84BC85BC86BC87BC88BC89BC8ABC8BBC8CBC8DBC8ECBD8BC8FCBF7BC90BC91BC92BC93BDF4BC94BC95BC96D7CFBC97BC98BC99C0DBBC9ABC9BBC9CBC9DBC9EBC9FBCA0BD40BD41BD42BD43BD44BD45BD46BD47BD48BD49BD4ABD4BBD4CBD4DBD4EBD4FBD50BD51BD52BD53BD54BD55BD56BD57BD58BD59BD5ABD5BBD5CBD5DBD5EBD5FBD60BD61BD62BD63BD64BD65BD66BD67BD68BD69BD6ABD6BBD6CBD6DBD6EBD6FBD70BD71BD72BD73BD74BD75BD76D0F5BD77BD78BD79BD7ABD7BBD7CBD7DBD7EF4EABD80BD81BD82BD83BD84BD85BD86BD87BD88BD89BD8ABD8BBD8CBD8DBD8EBD8FBD90BD91BD92BD93BD94BD95BD96BD97BD98BD99BD9ABD9BBD9CBD9DBD9EBD9FBDA0BE40BE41BE42BE43BE44BE45BE46BE47BE48BE49BE4ABE4BBE4CF4EBBE4DBE4EBE4FBE50BE51BE52BE53F4ECBE54BE55BE56BE57BE58BE59BE5ABE5BBE5CBE5DBE5EBE5FBE60BE61BE62BE63BE64BE65BE66BE67BE68BE69BE6ABE6BBE6CBE6DBE6EBE6FBE70BE71BE72BE73BE74BE75BE76BE77BE78BE79BE7ABE7BBE7CBE7DBE7EBE80BE81BE82BE83BE84BE85BE86BE87BE88BE89BE8ABE8BBE8CBE8DBE8EBE8FBE90BE91BE92BE93BE94BE95BE96BE97BE98BE99BE9ABE9BBE9CBE9DBE9EBE9FBEA0BF40BF41BF42BF43BF44BF45BF46BF47BF48BF49BF4ABF4BBF4CBF4DBF4EBF4FBF50BF51BF52BF53BF54BF55BF56BF57BF58BF59BF5ABF5BBF5CBF5DBF5EBF5FBF60BF61BF62BF63BF64BF65BF66BF67BF68BF69BF6ABF6BBF6CBF6DBF6EBF6FBF70BF71BF72BF73BF74BF75BF76BF77BF78BF79BF7ABF7BBF7CBF7DBF7EBF80F7E3BF81BF82BF83BF84BF85B7B1BF86BF87BF88BF89BF8AF4EDBF8BBF8CBF8DBF8EBF8FBF90BF91BF92BF93BF94BF95BF96BF97BF98BF99BF9ABF9BBF9CBF9DBF9EBF9FBFA0C040C041C042C043C044C045C046C047C048C049C04AC04BC04CC04DC04EC04FC050C051C052C053C054C055C056C057C058C059C05AC05BC05CC05DC05EC05FC060C061C062C063D7EBC064C065C066C067C068C069C06AC06BC06CC06DC06EC06FC070C071C072C073C074C075C076C077C078C079C07AC07BF4EEC07CC07DC07EE6F9BEC0E6FABAECE6FBCFCBE6FCD4BCBCB6E6FDE6FEBCCDC8D2CEB3E7A1C080B4BFE7A2C9B4B8D9C4C9C081D7DDC2DAB7D7D6BDCEC6B7C4C082C083C5A6E7A3CFDFE7A4E7A5E7A6C1B7D7E9C9F0CFB8D6AFD6D5E7A7B0EDE7A8E7A9C9DCD2EFBEADE7AAB0F3C8DEBDE1E7ABC8C6C084E7ACBBE6B8F8D1A4E7ADC2E7BEF8BDCACDB3E7AEE7AFBEEED0E5C085CBE7CCD0BCCCE7B0BCA8D0F7E7B1C086D0F8E7B2E7B3B4C2E7B4E7B5C9FECEACC3E0E7B7B1C1B3F1C087E7B8E7B9D7DBD5C0E7BAC2CCD7BAE7BBE7BCE7BDBCEAC3E5C0C2E7BEE7BFBCA9C088E7C0E7C1E7B6B6D0E7C2C089E7C3E7C4BBBAB5DEC2C6B1E0E7C5D4B5E7C6B8BFE7C8E7C7B7ECC08AE7C9B2F8E7CAE7CBE7CCE7CDE7CEE7CFE7D0D3A7CBF5E7D1E7D2E7D3E7D4C9C9E7D5E7D6E7D7E7D8E7D9BDC9E7DAF3BEC08BB8D7C08CC8B1C08DC08EC08FC090C091C092C093F3BFC094F3C0F3C1C095C096C097C098C099C09AC09BC09CC09DC09EB9DECDF8C09FC0A0D8E8BAB1C140C2DEEEB7C141B7A3C142C143C144C145EEB9C146EEB8B0D5C147C148C149C14AC14BEEBBD5D6D7EFC14CC14DC14ED6C3C14FC150EEBDCAF0C151EEBCC152C153C154C155EEBEC156C157C158C159EEC0C15AC15BEEBFC15CC15DC15EC15FC160C161C162C163D1F2C164C7BCC165C3C0C166C167C168C169C16AB8E1C16BC16CC16DC16EC16FC1E7C170C171F4C6D0DFF4C7C172CFDBC173C174C8BAC175C176F4C8C177C178C179C17AC17BC17CC17DF4C9F4CAC17EF4CBC180C181C182C183C184D9FAB8FEC185C186E5F1D3F0C187F4E0C188CECCC189C18AC18BB3E1C18CC18DC18EC18FF1B4C190D2EEC191F4E1C192C193C194C195C196CFE8F4E2C197C198C7CCC199C19AC19BC19CC19DC19EB5D4B4E4F4E4C19FC1A0C240F4E3F4E5C241C242F4E6C243C244C245C246F4E7C247BAB2B0BFC248F4E8C249C24AC24BC24CC24DC24EC24FB7ADD2EDC250C251C252D2ABC0CFC253BFBCEBA3D5DFEAC8C254C255C256C257F1F3B6F8CBA3C258C259C4CDC25AF1E7C25BF1E8B8FBF1E9BAC4D4C5B0D2C25CC25DF1EAC25EC25FC260F1EBC261F1ECC262C263F1EDF1EEF1EFF1F1F1F0C5D5C264C265C266C267C268C269F1F2C26AB6FAC26BF1F4D2AEDEC7CBCAC26CC26DB3DCC26EB5A2C26FB9A2C270C271C4F4F1F5C272C273F1F6C274C275C276C1C4C1FBD6B0F1F7C277C278C279C27AF1F8C27BC1AAC27CC27DC27EC6B8C280BEDBC281C282C283C284C285C286C287C288C289C28AC28BC28CC28DC28EF1F9B4CFC28FC290C291C292C293C294F1FAC295C296C297C298C299C29AC29BC29CC29DC29EC29FC2A0C340EDB2EDB1C341C342CBE0D2DEC343CBC1D5D8C344C8E2C345C0DFBCA1C346C347C348C349C34AC34BEBC1C34CC34DD0A4C34ED6E2C34FB6C7B8D8EBC0B8CEC350EBBFB3A6B9C9D6ABC351B7F4B7CAC352C353C354BCE7B7BEEBC6C355EBC7B0B9BFCFC356EBC5D3FDC357EBC8C358C359EBC9C35AC35BB7CEC35CEBC2EBC4C9F6D6D7D5CDD0B2EBCFCEB8EBD0C35DB5A8C35EC35FC360C361C362B1B3EBD2CCA5C363C364C365C366C367C368C369C5D6EBD3C36AEBD1C5DFEBCECAA4EBD5B0FBC36BC36CBAFAC36DC36ED8B7F1E3C36FEBCAEBCBEBCCEBCDEBD6E6C0EBD9C370BFE8D2C8EBD7EBDCB8ECEBD8C371BDBAC372D0D8C373B0B7C374EBDDC4DCC375C376C377C378D6ACC379C37AC37BB4E0C37CC37DC2F6BCB9C37EC380EBDAEBDBD4E0C6EAC4D4EBDFC5A7D9F5C381B2B1C382EBE4C383BDC5C384C385C386EBE2C387C388C389C38AC38BC38CC38DC38EC38FC390C391C392C393EBE3C394C395B8ACC396CDD1EBE5C397C398C399EBE1C39AC1B3C39BC39CC39DC39EC39FC6A2C3A0C440C441C442C443C444C445CCF3C446EBE6C447C0B0D2B8EBE7C448C449C44AB8AFB8ADC44BEBE8C7BBCDF3C44CC44DC44EEBEAEBEBC44FC450C451C452C453EBEDC454C455C456C457D0C8C458EBF2C459EBEEC45AC45BC45CEBF1C8F9C45DD1FCEBECC45EC45FEBE9C460C461C462C463B8B9CFD9C4E5EBEFEBF0CCDACDC8B0F2C464EBF6C465C466C467C468C469EBF5C46AB2B2C46BC46CC46DC46EB8E0C46FEBF7C470C471C472C473C474C475B1ECC476C477CCC5C4A4CFA5C478C479C47AC47BC47CEBF9C47DC47EECA2C480C5F2C481EBFAC482C483C484C485C486C487C488C489C9C5C48AC48BC48CC48DC48EC48FE2DFEBFEC490C491C492C493CDCEECA1B1DBD3B7C494C495D2DCC496C497C498EBFDC499EBFBC49AC49BC49CC49DC49EC49FC4A0C540C541C542C543C544C545C546C547C548C549C54AC54BC54CC54DC54EB3BCC54FC550C551EAB0C552C553D7D4C554F4ABB3F4C555C556C557C558C559D6C1D6C2C55AC55BC55CC55DC55EC55FD5E9BECAC560F4A7C561D2A8F4A8F4A9C562F4AABECBD3DFC563C564C565C566C567C9E0C9E1C568C569F3C2C56ACAE6C56BCCF2C56CC56DC56EC56FC570C571E2B6CBB4C572CEE8D6DBC573F4ADF4AEF4AFC574C575C576C577F4B2C578BABDF4B3B0E3F4B0C579F4B1BDA2B2D5C57AF4B6F4B7B6E6B2B0CFCFF4B4B4ACC57BF4B5C57CC57DF4B8C57EC580C581C582C583F4B9C584C585CDA7C586F4BAC587F4BBC588C589C58AF4BCC58BC58CC58DC58EC58FC590C591C592CBD2C593F4BDC594C595C596C597F4BEC598C599C59AC59BC59CC59DC59EC59FF4BFC5A0C640C641C642C643F4DEC1BCBCE8C644C9ABD1DEE5F5C645C646C647C648DCB3D2D5C649C64ADCB4B0ACDCB5C64BC64CBDDAC64DDCB9C64EC64FC650D8C2C651DCB7D3F3C652C9D6DCBADCB6C653DCBBC3A2C654C655C656C657DCBCDCC5DCBDC658C659CEDFD6A5C65ADCCFC65BDCCDC65CC65DDCD2BDE6C2ABC65EDCB8DCCBDCCEDCBEB7D2B0C5DCC7D0BEDCC1BBA8C65FB7BCDCCCC660C661DCC6DCBFC7DBC662C663C664D1BFDCC0C665C666DCCAC667C668DCD0C669C66ACEADDCC2C66BDCC3DCC8DCC9B2D4DCD1CBD5C66CD4B7DCDBDCDFCCA6DCE6C66DC3E7DCDCC66EC66FBFC1DCD9C670B0FAB9B6DCE5DCD3C671DCC4DCD6C8F4BFE0C672C673C674C675C9BBC676C677C678B1BDC679D3A2C67AC67BDCDAC67CC67DDCD5C67EC6BBC680DCDEC681C682C683C684C685D7C2C3AFB7B6C7D1C3A9DCE2DCD8DCEBDCD4C686C687DCDDC688BEA5DCD7C689DCE0C68AC68BDCE3DCE4C68CDCF8C68DC68EDCE1DDA2DCE7C68FC690C691C692C693C694C695C696C697C698BCEBB4C4C699C69AC3A3B2E7DCFAC69BDCF2C69CDCEFC69DDCFCDCEED2F0B2E8C69EC8D7C8E3DCFBC69FDCEDC6A0C740C741DCF7C742C743DCF5C744C745BEA3DCF4C746B2DDC747C748C749C74AC74BDCF3BCF6DCE8BBC4C74CC0F3C74DC74EC74FC750C751BCD4DCE9DCEAC752DCF1DCF6DCF9B5B4C753C8D9BBE7DCFEDCFDD3ABDDA1DDA3DDA5D2F1DDA4DDA6DDA7D2A9C754C755C756C757C758C759C75ABAC9DDA9C75BC75CDDB6DDB1DDB4C75DC75EC75FC760C761C762C763DDB0C6CEC764C765C0F2C766C767C768C769C9AFC76AC76BC76CDCECDDAEC76DC76EC76FC770DDB7C771C772DCF0DDAFC773DDB8C774DDACC775C776C777C778C779C77AC77BDDB9DDB3DDADC4AAC77CC77DC77EC780DDA8C0B3C1ABDDAADDABC781DDB2BBF1DDB5D3A8DDBAC782DDBBC3A7C783C784DDD2DDBCC785C786C787DDD1C788B9BDC789C78ABED5C78BBEFAC78CC78DBACAC78EC78FC790C791DDCAC792DDC5C793DDBFC794C795C796B2CBDDC3C797DDCBB2A4DDD5C798C799C79ADDBEC79BC79CC79DC6D0DDD0C79EC79FC7A0C840C841DDD4C1E2B7C6C842C843C844C845C846DDCEDDCFC847C848C849DDC4C84AC84BC84CDDBDC84DDDCDCCD1C84EDDC9C84FC850C851C852DDC2C3C8C6BCCEAEDDCCC853DDC8C854C855C856C857C858C859DDC1C85AC85BC85CDDC6C2DCC85DC85EC85FC860C861C862D3A9D3AADDD3CFF4C8F8C863C864C865C866C867C868C869C86ADDE6C86BC86CC86DC86EC86FC870DDC7C871C872C873DDE0C2E4C874C875C876C877C878C879C87AC87BDDE1C87CC87DC87EC880C881C882C883C884C885C886DDD7C887C888C889C88AC88BD6F8C88CDDD9DDD8B8F0DDD6C88DC88EC88FC890C6CFC891B6ADC892C893C894C895C896DDE2C897BAF9D4E1DDE7C898C899C89AB4D0C89BDDDAC89CBFFBDDE3C89DDDDFC89EDDDDC89FC8A0C940C941C942C943C944B5D9C945C946C947C948DDDBDDDCDDDEC949BDAFDDE4C94ADDE5C94BC94CC94DC94EC94FC950C951C952DDF5C953C3C9C954C955CBE2C956C957C958C959DDF2C95AC95BC95CC95DC95EC95FC960C961C962C963C964C965C966D8E1C967C968C6D1C969DDF4C96AC96BC96CD5F4DDF3DDF0C96DC96EDDECC96FDDEFC970DDE8C971C972D0EEC973C974C975C976C8D8DDEEC977C978DDE9C979C97ADDEACBF2C97BDDEDC97CC97DB1CDC97EC980C981C982C983C984C0B6C985BCBBDDF1C986C987DDF7C988DDF6DDEBC989C98AC98BC98CC98DC5EEC98EC98FC990DDFBC991C992C993C994C995C996C997C998C999C99AC99BDEA4C99CC99DDEA3C99EC99FC9A0CA40CA41CA42CA43CA44CA45CA46CA47CA48DDF8CA49CA4ACA4BCA4CC3EFCA4DC2FBCA4ECA4FCA50D5E1CA51CA52CEB5CA53CA54CA55CA56DDFDCA57B2CCCA58CA59CA5ACA5BCA5CCA5DCA5ECA5FCA60C4E8CADFCA61CA62CA63CA64CA65CA66CA67CA68CA69CA6AC7BEDDFADDFCDDFEDEA2B0AAB1CECA6BCA6CCA6DCA6ECA6FDEACCA70CA71CA72CA73DEA6BDB6C8EFCA74CA75CA76CA77CA78CA79CA7ACA7BCA7CCA7DCA7EDEA1CA80CA81DEA5CA82CA83CA84CA85DEA9CA86CA87CA88CA89CA8ADEA8CA8BCA8CCA8DDEA7CA8ECA8FCA90CA91CA92CA93CA94CA95CA96DEADCA97D4CCCA98CA99CA9ACA9BDEB3DEAADEAECA9CCA9DC0D9CA9ECA9FCAA0CB40CB41B1A1DEB6CB42DEB1CB43CB44CB45CB46CB47CB48CB49DEB2CB4ACB4BCB4CCB4DCB4ECB4FCB50CB51CB52CB53CB54D1A6DEB5CB55CB56CB57CB58CB59CB5ACB5BDEAFCB5CCB5DCB5EDEB0CB5FD0BDCB60CB61CB62DEB4CAEDDEB9CB63CB64CB65CB66CB67CB68DEB8CB69DEB7CB6ACB6BCB6CCB6DCB6ECB6FCB70DEBBCB71CB72CB73CB74CB75CB76CB77BDE5CB78CB79CB7ACB7BCB7CB2D8C3EACB7DCB7EDEBACB80C5BACB81CB82CB83CB84CB85CB86DEBCCB87CB88CB89CB8ACB8BCB8CCB8DCCD9CB8ECB8FCB90CB91B7AACB92CB93CB94CB95CB96CB97CB98CB99CB9ACB9BCB9CCB9DCB9ECB9FCBA0CC40CC41D4E5CC42CC43CC44DEBDCC45CC46CC47CC48CC49DEBFCC4ACC4BCC4CCC4DCC4ECC4FCC50CC51CC52CC53CC54C4A2CC55CC56CC57CC58DEC1CC59CC5ACC5BCC5CCC5DCC5ECC5FCC60CC61CC62CC63CC64CC65CC66CC67CC68DEBECC69DEC0CC6ACC6BCC6CCC6DCC6ECC6FCC70CC71CC72CC73CC74CC75CC76CC77D5BACC78CC79CC7ADEC2CC7BCC7CCC7DCC7ECC80CC81CC82CC83CC84CC85CC86CC87CC88CC89CC8ACC8BF2AEBBA2C2B2C5B0C2C7CC8CCC8DF2AFCC8ECC8FCC90CC91CC92D0E9CC93CC94CC95D3DDCC96CC97CC98EBBDCC99CC9ACC9BCC9CCC9DCC9ECC9FCCA0B3E6F2B0CD40F2B1CD41CD42CAADCD43CD44CD45CD46CD47CD48CD49BAE7F2B3F2B5F2B4CBE4CFBAF2B2CAB4D2CFC2ECCD4ACD4BCD4CCD4DCD4ECD4FCD50CEC3F2B8B0F6F2B7CD51CD52CD53CD54CD55F2BECD56B2CFCD57CD58CD59CD5ACD5BCD5CD1C1F2BACD5DCD5ECD5FCD60CD61F2BCD4E9CD62CD63F2BBF2B6F2BFF2BDCD64F2B9CD65CD66F2C7F2C4F2C6CD67CD68F2CAF2C2F2C0CD69CD6ACD6BF2C5CD6CCD6DCD6ECD6FCD70D6FBCD71CD72CD73F2C1CD74C7F9C9DFCD75F2C8B9C6B5B0CD76CD77F2C3F2C9F2D0F2D6CD78CD79BBD7CD7ACD7BCD7CF2D5CDDCCD7DD6EBCD7ECD80F2D2F2D4CD81CD82CD83CD84B8F2CD85CD86CD87CD88F2CBCD89CD8ACD8BF2CEC2F9CD8CD5DDF2CCF2CDF2CFF2D3CD8DCD8ECD8FF2D9D3BCCD90CD91CD92CD93B6EACD94CAF1CD95B7E4F2D7CD96CD97CD98F2D8F2DAF2DDF2DBCD99CD9AF2DCCD9BCD9CCD9DCD9ED1D1F2D1CD9FCDC9CDA0CECFD6A9CE40F2E3CE41C3DBCE42F2E0CE43CE44C0AFF2ECF2DECE45F2E1CE46CE47CE48F2E8CE49CE4ACE4BCE4CF2E2CE4DCE4EF2E7CE4FCE50F2E6CE51CE52F2E9CE53CE54CE55F2DFCE56CE57F2E4F2EACE58CE59CE5ACE5BCE5CCE5DCE5ED3ACF2E5B2F5CE5FCE60F2F2CE61D0ABCE62CE63CE64CE65F2F5CE66CE67CE68BBC8CE69F2F9CE6ACE6BCE6CCE6DCE6ECE6FF2F0CE70CE71F2F6F2F8F2FACE72CE73CE74CE75CE76CE77CE78CE79F2F3CE7AF2F1CE7BCE7CCE7DBAFBCE7EB5FBCE80CE81CE82CE83F2EFF2F7F2EDF2EECE84CE85CE86F2EBF3A6CE87F3A3CE88CE89F3A2CE8ACE8BF2F4CE8CC8DACE8DCE8ECE8FCE90CE91F2FBCE92CE93CE94F3A5CE95CE96CE97CE98CE99CE9ACE9BC3F8CE9CCE9DCE9ECE9FCEA0CF40CF41CF42F2FDCF43CF44F3A7F3A9F3A4CF45F2FCCF46CF47CF48F3ABCF49F3AACF4ACF4BCF4CCF4DC2DDCF4ECF4FF3AECF50CF51F3B0CF52CF53CF54CF55CF56F3A1CF57CF58CF59F3B1F3ACCF5ACF5BCF5CCF5DCF5EF3AFF2FEF3ADCF5FCF60CF61CF62CF63CF64CF65F3B2CF66CF67CF68CF69F3B4CF6ACF6BCF6CCF6DF3A8CF6ECF6FCF70CF71F3B3CF72CF73CF74F3B5CF75CF76CF77CF78CF79CF7ACF7BCF7CCF7DCF7ED0B7CF80CF81CF82CF83F3B8CF84CF85CF86CF87D9F9CF88CF89CF8ACF8BCF8CCF8DF3B9CF8ECF8FCF90CF91CF92CF93CF94CF95F3B7CF96C8E4F3B6CF97CF98CF99CF9AF3BACF9BCF9CCF9DCF9ECF9FF3BBB4C0CFA0D040D041D042D043D044D045D046D047D048D049D04AD04BD04CD04DEEC3D04ED04FD050D051D052D053F3BCD054D055F3BDD056D057D058D1AAD059D05AD05BF4ACD0C6D05CD05DD05ED05FD060D061D0D0D1DCD062D063D064D065D066D067CFCED068D069BDD6D06AD1C3D06BD06CD06DD06ED06FD070D071BAE2E1E9D2C2F1C2B2B9D072D073B1EDF1C3D074C9C0B3C4D075D9F2D076CBA5D077F1C4D078D079D07AD07BD6D4D07CD07DD07ED080D081F1C5F4C0F1C6D082D4ACF1C7D083B0C0F4C1D084D085F4C2D086D087B4FCD088C5DBD089D08AD08BD08CCCBBD08DD08ED08FD0E4D090D091D092D093D094CDE0D095D096D097D098D099F1C8D09AD9F3D09BD09CD09DD09ED09FD0A0B1BBD140CFAED141D142D143B8A4D144D145D146D147D148F1CAD149D14AD14BD14CF1CBD14DD14ED14FD150B2C3C1D1D151D152D7B0F1C9D153D154F1CCD155D156D157D158F1CED159D15AD15BD9F6D15CD2E1D4A3D15DD15EF4C3C8B9D15FD160D161D162D163F4C4D164D165F1CDF1CFBFE3F1D0D166D167F1D4D168D169D16AD16BD16CD16DD16EF1D6F1D1D16FC9D1C5E1D170D171D172C2E3B9FCD173D174F1D3D175F1D5D176D177D178B9D3D179D17AD17BD17CD17DD17ED180F1DBD181D182D183D184D185BAD6D186B0FDF1D9D187D188D189D18AD18BF1D8F1D2F1DAD18CD18DD18ED18FD190F1D7D191D192D193C8ECD194D195D196D197CDCAF1DDD198D199D19AD19BE5BDD19CD19DD19EF1DCD19FF1DED1A0D240D241D242D243D244D245D246D247D248F1DFD249D24ACFE5D24BD24CD24DD24ED24FD250D251D252D253D254D255D256D257D258D259D25AD25BD25CD25DD25ED25FD260D261D262D263F4C5BDF3D264D265D266D267D268D269F1E0D26AD26BD26CD26DD26ED26FD270D271D272D273D274D275D276D277D278D279D27AD27BD27CD27DF1E1D27ED280D281CEF7D282D2AAD283F1FBD284D285B8B2D286D287D288D289D28AD28BD28CD28DD28ED28FD290D291D292D293D294D295D296D297D298D299D29AD29BD29CD29DD29ED29FD2A0D340D341D342D343D344D345D346D347D348D349D34AD34BD34CD34DD34ED34FD350D351D352D353D354D355D356D357D358D359D35AD35BD35CD35DD35EBCFBB9DBD35FB9E6C3D9CAD3EAE8C0C0BEF5EAE9EAEAEAEBD360EAECEAEDEAEEEAEFBDC7D361D362D363F5FBD364D365D366F5FDD367F5FED368F5FCD369D36AD36BD36CBDE2D36DF6A1B4A5D36ED36FD370D371F6A2D372D373D374F6A3D375D376D377ECB2D378D379D37AD37BD37CD37DD37ED380D381D382D383D384D1D4D385D386D387D388D389D38AD9EAD38BD38CD38DD38ED38FD390D391D392D393D394D395D396D397D398D399D39AD39BD39CD39DD39ED39FD3A0D440D441D442D443D444D445D446D447D448D449D44AD44BD44CD44DD44ED44FD450D451D452D453D454D455D456D457D458D459D45AD45BD45CD45DD45ED45FF6A4D460D461D462D463D464D465D466D467D468EEBAD469D46AD46BD46CD46DD46ED46FD470D471D472D473D474D475D476D477D478D479D47AD47BD47CD47DD47ED480D481D482D483D484D485D486D487D488D489D48AD48BD48CD48DD48ED48FD490D491D492D493D494D495D496D497D498D499D5B2D49AD49BD49CD49DD49ED49FD4A0D540D541D542D543D544D545D546D547D3FECCDCD548D549D54AD54BD54CD54DD54ED54FCAC4D550D551D552D553D554D555D556D557D558D559D55AD55BD55CD55DD55ED55FD560D561D562D563D564D565D566D567D568D569D56AD56BD56CD56DD56ED56FD570D571D572D573D574D575D576D577D578D579D57AD57BD57CD57DD57ED580D581D582D583D584D585D586D587D588D589D58AD58BD58CD58DD58ED58FD590D591D592D593D594D595D596D597D598D599D59AD59BD59CD59DD59ED59FD5A0D640D641D642D643D644D645D646D647D648D649D64AD64BD64CD64DD64ED64FD650D651D652D653D654D655D656D657D658D659D65AD65BD65CD65DD65ED65FD660D661D662E5C0D663D664D665D666D667D668D669D66AD66BD66CD66DD66ED66FD670D671D672D673D674D675D676D677D678D679D67AD67BD67CD67DD67ED680D681F6A5D682D683D684D685D686D687D688D689D68AD68BD68CD68DD68ED68FD690D691D692D693D694D695D696D697D698D699D69AD69BD69CD69DD69ED69FD6A0D740D741D742D743D744D745D746D747D748D749D74AD74BD74CD74DD74ED74FD750D751D752D753D754D755D756D757D758D759D75AD75BD75CD75DD75ED75FBEAFD760D761D762D763D764C6A9D765D766D767D768D769D76AD76BD76CD76DD76ED76FD770D771D772D773D774D775D776D777D778D779D77AD77BD77CD77DD77ED780D781D782D783D784D785D786D787D788D789D78AD78BD78CD78DD78ED78FD790D791D792D793D794D795D796D797D798DAA5BCC6B6A9B8BCC8CFBCA5DAA6DAA7CCD6C8C3DAA8C6FDD799D1B5D2E9D1B6BCC7D79ABDB2BBE4DAA9DAAAD1C8DAABD0EDB6EFC2DBD79BCBCFB7EDC9E8B7C3BEF7D6A4DAACDAADC6C0D7E7CAB6D79CD5A9CBDFD5EFDAAED6DFB4CADAB0DAAFD79DD2EBDAB1DAB2DAB3CAD4DAB4CAABDAB5DAB6B3CFD6EFDAB7BBB0B5AEDAB8DAB9B9EED1AFD2E8DABAB8C3CFEAB2EFDABBDABCD79EBDEBCEDCD3EFDABDCEF3DABED3D5BBE5DABFCBB5CBD0DAC0C7EBD6EEDAC1C5B5B6C1DAC2B7CCBFCEDAC3DAC4CBADDAC5B5F7DAC6C1C2D7BBDAC7CCB8D79FD2EAC4B1DAC8B5FDBBD1DAC9D0B3DACADACBCEBDDACCDACDDACEB2F7DAD1DACFD1E8DAD0C3D5DAD2D7A0DAD3DAD4DAD5D0BBD2A5B0F9DAD6C7ABDAD7BDF7C3A1DAD8DAD9C3FDCCB7DADADADBC0BEC6D7DADCDADDC7B4DADEDADFB9C8D840D841D842D843D844D845D846D847D848BBEDD849D84AD84BD84CB6B9F4F8D84DF4F9D84ED84FCDE3D850D851D852D853D854D855D856D857F5B9D858D859D85AD85BEBE0D85CD85DD85ED85FD860D861CFF3BBBFD862D863D864D865D866D867D868BAC0D4A5D869D86AD86BD86CD86DD86ED86FE1D9D870D871D872D873F5F4B1AAB2F2D874D875D876D877D878D879D87AF5F5D87BD87CF5F7D87DD87ED880BAD1F5F6D881C3B2D882D883D884D885D886D887D888F5F9D889D88AD88BF5F8D88CD88DD88ED88FD890D891D892D893D894D895D896D897D898D899D89AD89BD89CD89DD89ED89FD8A0D940D941D942D943D944D945D946D947D948D949D94AD94BD94CD94DD94ED94FD950D951D952D953D954D955D956D957D958D959D95AD95BD95CD95DD95ED95FD960D961D962D963D964D965D966D967D968D969D96AD96BD96CD96DD96ED96FD970D971D972D973D974D975D976D977D978D979D97AD97BD97CD97DD97ED980D981D982D983D984D985D986D987D988D989D98AD98BD98CD98DD98ED98FD990D991D992D993D994D995D996D997D998D999D99AD99BD99CD99DD99ED99FD9A0DA40DA41DA42DA43DA44DA45DA46DA47DA48DA49DA4ADA4BDA4CDA4DDA4EB1B4D5EAB8BADA4FB9B1B2C6D4F0CFCDB0DCD5CBBBF5D6CAB7B7CCB0C6B6B1E1B9BAD6FCB9E1B7A1BCFAEADAEADBCCF9B9F3EADCB4FBC3B3B7D1BAD8EADDD4F4EADEBCD6BBDFEADFC1DEC2B8D4DFD7CAEAE0EAE1EAE4EAE2EAE3C9DEB8B3B6C4EAE5CAEAC9CDB4CDDA50DA51E2D9C5E2EAE6C0B5DA52D7B8EAE7D7ACC8FCD8D3D8CDD4DEDA53D4F9C9C4D3AEB8D3B3E0DA54C9E2F4F6DA55DA56DA57BAD5DA58F4F7DA59DA5AD7DFDA5BDA5CF4F1B8B0D5D4B8CFC6F0DA5DDA5EDA5FDA60DA61DA62DA63DA64DA65B3C3DA66DA67F4F2B3ACDA68DA69DA6ADA6BD4BDC7F7DA6CDA6DDA6EDA6FDA70F4F4DA71DA72F4F3DA73DA74DA75DA76DA77DA78DA79DA7ADA7BDA7CCCCBDA7DDA7EDA80C8A4DA81DA82DA83DA84DA85DA86DA87DA88DA89DA8ADA8BDA8CDA8DF4F5DA8ED7E3C5BFF5C0DA8FDA90F5BBDA91F5C3DA92F5C2DA93D6BAF5C1DA94DA95DA96D4BEF5C4DA97F5CCDA98DA99DA9ADA9BB0CFB5F8DA9CF5C9F5CADA9DC5DCDA9EDA9FDAA0DB40F5C5F5C6DB41DB42F5C7F5CBDB43BEE0F5C8B8FADB44DB45DB46F5D0F5D3DB47DB48DB49BFE7DB4AB9F2F5BCF5CDDB4BDB4CC2B7DB4DDB4EDB4FCCF8DB50BCF9DB51F5CEF5CFF5D1B6E5F5D2DB52F5D5DB53DB54DB55DB56DB57DB58DB59F5BDDB5ADB5BDB5CF5D4D3BBDB5DB3ECDB5EDB5FCCA4DB60DB61DB62DB63F5D6DB64DB65DB66DB67DB68DB69DB6ADB6BF5D7BEE1F5D8DB6CDB6DCCDFF5DBDB6EDB6FDB70DB71DB72B2C8D7D9DB73F5D9DB74F5DAF5DCDB75F5E2DB76DB77DB78F5E0DB79DB7ADB7BF5DFF5DDDB7CDB7DF5E1DB7EDB80F5DEF5E4F5E5DB81CCE3DB82DB83E5BFB5B8F5E3F5E8CCA3DB84DB85DB86DB87DB88F5E6F5E7DB89DB8ADB8BDB8CDB8DDB8EF5BEDB8FDB90DB91DB92DB93DB94DB95DB96DB97DB98DB99DB9AB1C4DB9BDB9CF5BFDB9DDB9EB5C5B2E4DB9FF5ECF5E9DBA0B6D7DC40F5EDDC41F5EADC42DC43DC44DC45DC46F5EBDC47DC48B4DADC49D4EADC4ADC4BDC4CF5EEDC4DB3F9DC4EDC4FDC50DC51DC52DC53DC54F5EFF5F1DC55DC56DC57F5F0DC58DC59DC5ADC5BDC5CDC5DDC5EF5F2DC5FF5F3DC60DC61DC62DC63DC64DC65DC66DC67DC68DC69DC6ADC6BC9EDB9AADC6CDC6DC7FBDC6EDC6FB6E3DC70DC71DC72DC73DC74DC75DC76CCC9DC77DC78DC79DC7ADC7BDC7CDC7DDC7EDC80DC81DC82DC83DC84DC85DC86DC87DC88DC89DC8AEAA6DC8BDC8CDC8DDC8EDC8FDC90DC91DC92DC93DC94DC95DC96DC97DC98DC99DC9ADC9BDC9CDC9DDC9EDC9FDCA0DD40DD41DD42DD43DD44DD45DD46DD47DD48DD49DD4ADD4BDD4CDD4DDD4EDD4FDD50DD51DD52DD53DD54DD55DD56DD57DD58DD59DD5ADD5BDD5CDD5DDD5EDD5FDD60DD61DD62DD63DD64DD65DD66DD67DD68DD69DD6ADD6BDD6CDD6DDD6EDD6FDD70DD71DD72DD73DD74DD75DD76DD77DD78DD79DD7ADD7BDD7CDD7DDD7EDD80DD81DD82DD83DD84DD85DD86DD87DD88DD89DD8ADD8BDD8CDD8DDD8EDD8FDD90DD91DD92DD93DD94DD95DD96DD97DD98DD99DD9ADD9BDD9CDD9DDD9EDD9FDDA0DE40DE41DE42DE43DE44DE45DE46DE47DE48DE49DE4ADE4BDE4CDE4DDE4EDE4FDE50DE51DE52DE53DE54DE55DE56DE57DE58DE59DE5ADE5BDE5CDE5DDE5EDE5FDE60B3B5D4FEB9ECD0F9DE61E9EDD7AAE9EEC2D6C8EDBAE4E9EFE9F0E9F1D6E1E9F2E9F3E9F5E9F4E9F6E9F7C7E1E9F8D4D8E9F9BDCEDE62E9FAE9FBBDCFE9FCB8A8C1BEE9FDB1B2BBD4B9F5E9FEDE63EAA1EAA2EAA3B7F8BCADDE64CAE4E0CED4AFCFBDD5B7EAA4D5DEEAA5D0C1B9BCDE65B4C7B1D9DE66DE67DE68C0B1DE69DE6ADE6BDE6CB1E6B1E7DE6DB1E8DE6EDE6FDE70DE71B3BDC8E8DE72DE73DE74DE75E5C1DE76DE77B1DFDE78DE79DE7AC1C9B4EFDE7BDE7CC7A8D3D8DE7DC6F9D1B8DE7EB9FDC2F5DE80DE81DE82DE83DE84D3ADDE85D4CBBDFCDE86E5C2B7B5E5C3DE87DE88BBB9D5E2DE89BDF8D4B6CEA5C1ACB3D9DE8ADE8BCCF6DE8CE5C6E5C4E5C8DE8DE5CAE5C7B5CFC6C8DE8EB5FCE5C5DE8FCAF6DE90DE91E5C9DE92DE93DE94C3D4B1C5BCA3DE95DE96DE97D7B7DE98DE99CDCBCBCDCACACCD3E5CCE5CBC4E6DE9ADE9BD1A1D1B7E5CDDE9CE5D0DE9DCDB8D6F0E5CFB5DDDE9ECDBEDE9FE5D1B6BADEA0DF40CDA8B9E4DF41CAC5B3D1CBD9D4ECE5D2B7EADF42DF43DF44E5CEDF45DF46DF47DF48DF49DF4AE5D5B4FEE5D6DF4BDF4CDF4DDF4EDF4FE5D3E5D4DF50D2DDDF51DF52C2DFB1C6DF53D3E2DF54DF55B6DDCBECDF56E5D7DF57DF58D3F6DF59DF5ADF5BDF5CDF5DB1E9DF5EB6F4E5DAE5D8E5D9B5C0DF5FDF60DF61D2C5E5DCDF62DF63E5DEDF64DF65DF66DF67DF68DF69E5DDC7B2DF6AD2A3DF6BDF6CE5DBDF6DDF6EDF6FDF70D4E2D5DADF71DF72DF73DF74DF75E5E0D7F1DF76DF77DF78DF79DF7ADF7BDF7CE5E1DF7DB1DCD1FBDF7EE5E2E5E4DF80DF81DF82DF83E5E3DF84DF85E5E5DF86DF87DF88DF89DF8AD2D8DF8BB5CBDF8CE7DFDF8DDAF5DF8EDAF8DF8FDAF6DF90DAF7DF91DF92DF93DAFAD0CFC4C7DF94DF95B0EEDF96DF97DF98D0B0DF99DAF9DF9AD3CABAAADBA2C7F1DF9BDAFCDAFBC9DBDAFDDF9CDBA1D7DEDAFEC1DADF9DDF9EDBA5DF9FDFA0D3F4E040E041DBA7DBA4E042DBA8E043E044BDBCE045E046E047C0C9DBA3DBA6D6A3E048DBA9E049E04AE04BDBADE04CE04DE04EDBAEDBACBAC2E04FE050E051BFA4DBABE052E053E054DBAAD4C7B2BFE055E056DBAFE057B9F9E058DBB0E059E05AE05BE05CB3BBE05DE05EE05FB5A6E060E061E062E063B6BCDBB1E064E065E066B6F5E067DBB2E068E069E06AE06BE06CE06DE06EE06FE070E071E072E073E074E075E076E077E078E079E07AE07BB1C9E07CE07DE07EE080DBB4E081E082E083DBB3DBB5E084E085E086E087E088E089E08AE08BE08CE08DE08EDBB7E08FDBB6E090E091E092E093E094E095E096DBB8E097E098E099E09AE09BE09CE09DE09EE09FDBB9E0A0E140DBBAE141E142D3CFF4FAC7F5D7C3C5E4F4FCF4FDF4FBE143BEC6E144E145E146E147D0EFE148E149B7D3E14AE14BD4CDCCAAE14CE14DF5A2F5A1BAA8F4FECBD6E14EE14FE150F5A4C0D2E151B3EAE152CDAAF5A5F5A3BDB4F5A8E153F5A9BDCDC3B8BFE1CBE1F5AAE154E155E156F5A6F5A7C4F0E157E158E159E15AE15BF5ACE15CB4BCE15DD7EDE15EB4D7F5ABF5AEE15FE160F5ADF5AFD0D1E161E162E163E164E165E166E167C3D1C8A9E168E169E16AE16BE16CE16DF5B0F5B1E16EE16FE170E171E172E173F5B2E174E175F5B3F5B4F5B5E176E177E178E179F5B7F5B6E17AE17BE17CE17DF5B8E17EE180E181E182E183E184E185E186E187E188E189E18AB2C9E18BD3D4CACDE18CC0EFD6D8D2B0C1BFE18DBDF0E18EE18FE190E191E192E193E194E195E196E197B8AAE198E199E19AE19BE19CE19DE19EE19FE1A0E240E241E242E243E244E245E246E247E248E249E24AE24BE24CE24DE24EE24FE250E251E252E253E254E255E256E257E258E259E25AE25BE25CE25DE25EE25FE260E261E262E263E264E265E266E267E268E269E26AE26BE26CE26DE26EE26FE270E271E272E273E274E275E276E277E278E279E27AE27BE27CE27DE27EE280E281E282E283E284E285E286E287E288E289E28AE28BE28CE28DE28EE28FE290E291E292E293E294E295E296E297E298E299E29AE29BE29CE29DE29EE29FE2A0E340E341E342E343E344E345E346E347E348E349E34AE34BE34CE34DE34EE34FE350E351E352E353E354E355E356E357E358E359E35AE35BE35CE35DE35EE35FE360E361E362E363E364E365E366E367E368E369E36AE36BE36CE36DBCF8E36EE36FE370E371E372E373E374E375E376E377E378E379E37AE37BE37CE37DE37EE380E381E382E383E384E385E386E387F6C6E388E389E38AE38BE38CE38DE38EE38FE390E391E392E393E394E395E396E397E398E399E39AE39BE39CE39DE39EE39FE3A0E440E441E442E443E444E445F6C7E446E447E448E449E44AE44BE44CE44DE44EE44FE450E451E452E453E454E455E456E457E458E459E45AE45BE45CE45DE45EF6C8E45FE460E461E462E463E464E465E466E467E468E469E46AE46BE46CE46DE46EE46FE470E471E472E473E474E475E476E477E478E479E47AE47BE47CE47DE47EE480E481E482E483E484E485E486E487E488E489E48AE48BE48CE48DE48EE48FE490E491E492E493E494E495E496E497E498E499E49AE49BE49CE49DE49EE49FE4A0E540E541E542E543E544E545E546E547E548E549E54AE54BE54CE54DE54EE54FE550E551E552E553E554E555E556E557E558E559E55AE55BE55CE55DE55EE55FE560E561E562E563E564E565E566E567E568E569E56AE56BE56CE56DE56EE56FE570E571E572E573F6C9E574E575E576E577E578E579E57AE57BE57CE57DE57EE580E581E582E583E584E585E586E587E588E589E58AE58BE58CE58DE58EE58FE590E591E592E593E594E595E596E597E598E599E59AE59BE59CE59DE59EE59FF6CAE5A0E640E641E642E643E644E645E646E647E648E649E64AE64BE64CE64DE64EE64FE650E651E652E653E654E655E656E657E658E659E65AE65BE65CE65DE65EE65FE660E661E662F6CCE663E664E665E666E667E668E669E66AE66BE66CE66DE66EE66FE670E671E672E673E674E675E676E677E678E679E67AE67BE67CE67DE67EE680E681E682E683E684E685E686E687E688E689E68AE68BE68CE68DE68EE68FE690E691E692E693E694E695E696E697E698E699E69AE69BE69CE69DF6CBE69EE69FE6A0E740E741E742E743E744E745E746E747F7E9E748E749E74AE74BE74CE74DE74EE74FE750E751E752E753E754E755E756E757E758E759E75AE75BE75CE75DE75EE75FE760E761E762E763E764E765E766E767E768E769E76AE76BE76CE76DE76EE76FE770E771E772E773E774E775E776E777E778E779E77AE77BE77CE77DE77EE780E781E782E783E784E785E786E787E788E789E78AE78BE78CE78DE78EE78FE790E791E792E793E794E795E796E797E798E799E79AE79BE79CE79DE79EE79FE7A0E840E841E842E843E844E845E846E847E848E849E84AE84BE84CE84DE84EF6CDE84FE850E851E852E853E854E855E856E857E858E859E85AE85BE85CE85DE85EE85FE860E861E862E863E864E865E866E867E868E869E86AE86BE86CE86DE86EE86FE870E871E872E873E874E875E876E877E878E879E87AF6CEE87BE87CE87DE87EE880E881E882E883E884E885E886E887E888E889E88AE88BE88CE88DE88EE88FE890E891E892E893E894EEC4EEC5EEC6D5EBB6A4EEC8EEC7EEC9EECAC7A5EECBEECCE895B7B0B5F6EECDEECFE896EECEE897B8C6EED0EED1EED2B6DBB3AED6D3C4C6B1B5B8D6EED3EED4D4BFC7D5BEFBCED9B9B3EED6EED5EED8EED7C5A5EED9EEDAC7AEEEDBC7AFEEDCB2A7EEDDEEDEEEDFEEE0EEE1D7EAEEE2EEE3BCD8EEE4D3CBCCFAB2ACC1E5EEE5C7A6C3ADE898EEE6EEE7EEE8EEE9EEEAEEEBEEECE899EEEDEEEEEEEFE89AE89BEEF0EEF1EEF2EEF4EEF3E89CEEF5CDADC2C1EEF6EEF7EEF8D5A1EEF9CFB3EEFAEEFBE89DEEFCEEFDEFA1EEFEEFA2B8F5C3FAEFA3EFA4BDC2D2BFB2F9EFA5EFA6EFA7D2F8EFA8D6FDEFA9C6CCE89EEFAAEFABC1B4EFACCFFACBF8EFAEEFADB3FAB9F8EFAFEFB0D0E2EFB1EFB2B7E6D0BFEFB3EFB4EFB5C8F1CCE0EFB6EFB7EFB8EFB9EFBAD5E0EFBBB4EDC3AAEFBCE89FEFBDEFBEEFBFE8A0CEFDEFC0C2E0B4B8D7B6BDF5E940CFC7EFC3EFC1EFC2EFC4B6A7BCFCBEE2C3CCEFC5EFC6E941EFC7EFCFEFC8EFC9EFCAC7C2EFF1B6CDEFCBE942EFCCEFCDB6C6C3BEEFCEE943EFD0EFD1EFD2D5F2E944EFD3C4F7E945EFD4C4F8EFD5EFD6B8E4B0F7EFD7EFD8EFD9E946EFDAEFDBEFDCEFDDE947EFDEBEB5EFE1EFDFEFE0E948EFE2EFE3C1CDEFE4EFE5EFE6EFE7EFE8EFE9EFEAEFEBEFECC0D8E949EFEDC1ADEFEEEFEFEFF0E94AE94BCFE2E94CE94DE94EE94FE950E951E952E953B3A4E954E955E956E957E958E959E95AE95BE95CE95DE95EE95FE960E961E962E963E964E965E966E967E968E969E96AE96BE96CE96DE96EE96FE970E971E972E973E974E975E976E977E978E979E97AE97BE97CE97DE97EE980E981E982E983E984E985E986E987E988E989E98AE98BE98CE98DE98EE98FE990E991E992E993E994E995E996E997E998E999E99AE99BE99CE99DE99EE99FE9A0EA40EA41EA42EA43EA44EA45EA46EA47EA48EA49EA4AEA4BEA4CEA4DEA4EEA4FEA50EA51EA52EA53EA54EA55EA56EA57EA58EA59EA5AEA5BC3C5E3C5C9C1E3C6EA5CB1D5CECAB4B3C8F2E3C7CFD0E3C8BCE4E3C9E3CAC3C6D5A2C4D6B9EBCEC5E3CBC3F6E3CCEA5DB7A7B8F3BAD2E3CDE3CED4C4E3CFEA5EE3D0D1CBE3D1E3D2E3D3E3D4D1D6E3D5B2FBC0BBE3D6EA5FC0ABE3D7E3D8E3D9EA60E3DAE3DBEA61B8B7DAE2EA62B6D3EA63DAE4DAE3EA64EA65EA66EA67EA68EA69EA6ADAE6EA6BEA6CEA6DC8EEEA6EEA6FDAE5B7C0D1F4D2F5D5F3BDD7EA70EA71EA72EA73D7E8DAE8DAE7EA74B0A2CDD3EA75DAE9EA76B8BDBCCAC2BDC2A4B3C2DAEAEA77C2AAC4B0BDB5EA78EA79CFDEEA7AEA7BEA7CDAEBC9C2EA7DEA7EEA80EA81EA82B1DDEA83EA84EA85DAECEA86B6B8D4BAEA87B3FDEA88EA89DAEDD4C9CFD5C5E3EA8ADAEEEA8BEA8CEA8DEA8EEA8FDAEFEA90DAF0C1EACCD5CFDDEA91EA92EA93EA94EA95EA96EA97EA98EA99EA9AEA9BEA9CEA9DD3E7C2A1EA9EDAF1EA9FEAA0CBE5EB40DAF2EB41CBE6D2FEEB42EB43EB44B8F4EB45EB46DAF3B0AFCFB6EB47EB48D5CFEB49EB4AEB4BEB4CEB4DEB4EEB4FEB50EB51EB52CBEDEB53EB54EB55EB56EB57EB58EB59EB5ADAF4EB5BEB5CE3C4EB5DEB5EC1A5EB5FEB60F6BFEB61EB62F6C0F6C1C4D1EB63C8B8D1E3EB64EB65D0DBD1C5BCAFB9CDEB66EFF4EB67EB68B4C6D3BAF6C2B3FBEB69EB6AF6C3EB6BEB6CB5F1EB6DEB6EEB6FEB70EB71EB72EB73EB74EB75EB76F6C5EB77EB78EB79EB7AEB7BEB7CEB7DD3EAF6A7D1A9EB7EEB80EB81EB82F6A9EB83EB84EB85F6A8EB86EB87C1E3C0D7EB88B1A2EB89EB8AEB8BEB8CCEEDEB8DD0E8F6ABEB8EEB8FCFF6EB90F6AAD5F0F6ACC3B9EB91EB92EB93BBF4F6AEF6ADEB94EB95EB96C4DEEB97EB98C1D8EB99EB9AEB9BEB9CEB9DCBAAEB9ECFBCEB9FEBA0EC40EC41EC42EC43EC44EC45EC46EC47EC48F6AFEC49EC4AF6B0EC4BEC4CF6B1EC4DC2B6EC4EEC4FEC50EC51EC52B0D4C5F9EC53EC54EC55EC56F6B2EC57EC58EC59EC5AEC5BEC5CEC5DEC5EEC5FEC60EC61EC62EC63EC64EC65EC66EC67EC68EC69C7E0F6A6EC6AEC6BBEB8EC6CEC6DBEB2EC6EB5E5EC6FEC70B7C7EC71BFBFC3D2C3E6EC72EC73D8CCEC74EC75EC76B8EFEC77EC78EC79EC7AEC7BEC7CEC7DEC7EEC80BDF9D1A5EC81B0D0EC82EC83EC84EC85EC86F7B0EC87EC88EC89EC8AEC8BEC8CEC8DEC8EF7B1EC8FEC90EC91EC92EC93D0ACEC94B0B0EC95EC96EC97F7B2F7B3EC98F7B4EC99EC9AEC9BC7CAEC9CEC9DEC9EEC9FECA0ED40ED41BECFED42ED43F7B7ED44ED45ED46ED47ED48ED49ED4AF7B6ED4BB1DEED4CF7B5ED4DED4EF7B8ED4FF7B9ED50ED51ED52ED53ED54ED55ED56ED57ED58ED59ED5AED5BED5CED5DED5EED5FED60ED61ED62ED63ED64ED65ED66ED67ED68ED69ED6AED6BED6CED6DED6EED6FED70ED71ED72ED73ED74ED75ED76ED77ED78ED79ED7AED7BED7CED7DED7EED80ED81CEA4C8CDED82BAABE8B8E8B9E8BABEC2ED83ED84ED85ED86ED87D2F4ED88D4CFC9D8ED89ED8AED8BED8CED8DED8EED8FED90ED91ED92ED93ED94ED95ED96ED97ED98ED99ED9AED9BED9CED9DED9EED9FEDA0EE40EE41EE42EE43EE44EE45EE46EE47EE48EE49EE4AEE4BEE4CEE4DEE4EEE4FEE50EE51EE52EE53EE54EE55EE56EE57EE58EE59EE5AEE5BEE5CEE5DEE5EEE5FEE60EE61EE62EE63EE64EE65EE66EE67EE68EE69EE6AEE6BEE6CEE6DEE6EEE6FEE70EE71EE72EE73EE74EE75EE76EE77EE78EE79EE7AEE7BEE7CEE7DEE7EEE80EE81EE82EE83EE84EE85EE86EE87EE88EE89EE8AEE8BEE8CEE8DEE8EEE8FEE90EE91EE92EE93EE94EE95EE96EE97EE98EE99EE9AEE9BEE9CEE9DEE9EEE9FEEA0EF40EF41EF42EF43EF44EF45D2B3B6A5C7EAF1FCCFEECBB3D0EBE7EFCDE7B9CBB6D9F1FDB0E4CBCCF1FED4A4C2ADC1ECC6C4BEB1F2A1BCD5EF46F2A2F2A3EF47F2A4D2C3C6B5EF48CDC7F2A5EF49D3B1BFC5CCE2EF4AF2A6F2A7D1D5B6EEF2A8F2A9B5DFF2AAF2ABEF4BB2FCF2ACF2ADC8A7EF4CEF4DEF4EEF4FEF50EF51EF52EF53EF54EF55EF56EF57EF58EF59EF5AEF5BEF5CEF5DEF5EEF5FEF60EF61EF62EF63EF64EF65EF66EF67EF68EF69EF6AEF6BEF6CEF6DEF6EEF6FEF70EF71B7E7EF72EF73ECA9ECAAECABEF74ECACEF75EF76C6AEECADECAEEF77EF78EF79B7C9CAB3EF7AEF7BEF7CEF7DEF7EEF80EF81E2B8F7CFEF82EF83EF84EF85EF86EF87EF88EF89EF8AEF8BEF8CEF8DEF8EEF8FEF90EF91EF92EF93EF94EF95EF96EF97EF98EF99EF9AEF9BEF9CEF9DEF9EEF9FEFA0F040F041F042F043F044F7D0F045F046B2CDF047F048F049F04AF04BF04CF04DF04EF04FF050F051F052F053F054F055F056F057F058F059F05AF05BF05CF05DF05EF05FF060F061F062F063F7D1F064F065F066F067F068F069F06AF06BF06CF06DF06EF06FF070F071F072F073F074F075F076F077F078F079F07AF07BF07CF07DF07EF080F081F082F083F084F085F086F087F088F089F7D3F7D2F08AF08BF08CF08DF08EF08FF090F091F092F093F094F095F096E2BBF097BCA2F098E2BCE2BDE2BEE2BFE2C0E2C1B7B9D2FBBDA4CACEB1A5CBC7F099E2C2B6FCC8C4E2C3F09AF09BBDC8F09CB1FDE2C4F09DB6F6E2C5C4D9F09EF09FE2C6CFDAB9DDE2C7C0A1F0A0E2C8B2F6F140E2C9F141C1F3E2CAE2CBC2F8E2CCE2CDE2CECAD7D8B8D9E5CFE3F142F143F144F145F146F147F148F149F14AF14BF14CF0A5F14DF14EDCB0F14FF150F151F152F153F154F155F156F157F158F159F15AF15BF15CF15DF15EF15FF160F161F162F163F164F165F166F167F168F169F16AF16BF16CF16DF16EF16FF170F171F172F173F174F175F176F177F178F179F17AF17BF17CF17DF17EF180F181F182F183F184F185F186F187F188F189F18AF18BF18CF18DF18EF18FF190F191F192F193F194F195F196F197F198F199F19AF19BF19CF19DF19EF19FF1A0F240F241F242F243F244F245F246F247F248F249F24AF24BF24CF24DF24EF24FF250F251F252F253F254F255F256F257F258F259F25AF25BF25CF25DF25EF25FF260F261F262F263F264F265F266F267F268F269F26AF26BF26CF26DF26EF26FF270F271F272F273F274F275F276F277F278F279F27AF27BF27CF27DF27EF280F281F282F283F284F285F286F287F288F289F28AF28BF28CF28DF28EF28FF290F291F292F293F294F295F296F297F298F299F29AF29BF29CF29DF29EF29FF2A0F340F341F342F343F344F345F346F347F348F349F34AF34BF34CF34DF34EF34FF350F351C2EDD4A6CDD4D1B1B3DBC7FDF352B2B5C2BFE6E0CABBE6E1E6E2BED4E6E3D7A4CDD5E6E5BCDDE6E4E6E6E6E7C2EEF353BDBEE6E8C2E6BAA7E6E9F354E6EAB3D2D1E9F355F356BFA5E6EBC6EFE6ECE6EDF357F358E6EEC6ADE6EFF359C9A7E6F0E6F1E6F2E5B9E6F3E6F4C2E2E6F5E6F6D6E8E6F7F35AE6F8B9C7F35BF35CF35DF35EF35FF360F361F7BBF7BAF362F363F364F365F7BEF7BCBAA1F366F7BFF367F7C0F368F369F36AF7C2F7C1F7C4F36BF36CF7C3F36DF36EF36FF370F371F7C5F7C6F372F373F374F375F7C7F376CBE8F377F378F379F37AB8DFF37BF37CF37DF37EF380F381F7D4F382F7D5F383F384F385F386F7D6F387F388F389F38AF7D8F38BF7DAF38CF7D7F38DF38EF38FF390F391F392F393F394F395F7DBF396F7D9F397F398F399F39AF39BF39CF39DD7D7F39EF39FF3A0F440F7DCF441F442F443F444F445F446F7DDF447F448F449F7DEF44AF44BF44CF44DF44EF44FF450F451F452F453F454F7DFF455F456F457F7E0F458F459F45AF45BF45CF45DF45EF45FF460F461F462DBCBF463F464D8AAF465F466F467F468F469F46AF46BF46CE5F7B9EDF46DF46EF46FF470BFFDBBEAF7C9C6C7F7C8F471F7CAF7CCF7CBF472F473F474F7CDF475CEBAF476F7CEF477F478C4A7F479F47AF47BF47CF47DF47EF480F481F482F483F484F485F486F487F488F489F48AF48BF48CF48DF48EF48FF490F491F492F493F494F495F496F497F498F499F49AF49BF49CF49DF49EF49FF4A0F540F541F542F543F544F545F546F547F548F549F54AF54BF54CF54DF54EF54FF550F551F552F553F554F555F556F557F558F559F55AF55BF55CF55DF55EF55FF560F561F562F563F564F565F566F567F568F569F56AF56BF56CF56DF56EF56FF570F571F572F573F574F575F576F577F578F579F57AF57BF57CF57DF57EF580F581F582F583F584F585F586F587F588F589F58AF58BF58CF58DF58EF58FF590F591F592F593F594F595F596F597F598F599F59AF59BF59CF59DF59EF59FF5A0F640F641F642F643F644F645F646F647F648F649F64AF64BF64CF64DF64EF64FF650F651F652F653F654F655F656F657F658F659F65AF65BF65CF65DF65EF65FF660F661F662F663F664F665F666F667F668F669F66AF66BF66CF66DF66EF66FF670F671F672F673F674F675F676F677F678F679F67AF67BF67CF67DF67EF680F681F682F683F684F685F686F687F688F689F68AF68BF68CF68DF68EF68FF690F691F692F693F694F695F696F697F698F699F69AF69BF69CF69DF69EF69FF6A0F740F741F742F743F744F745F746F747F748F749F74AF74BF74CF74DF74EF74FF750F751F752F753F754F755F756F757F758F759F75AF75BF75CF75DF75EF75FF760F761F762F763F764F765F766F767F768F769F76AF76BF76CF76DF76EF76FF770F771F772F773F774F775F776F777F778F779F77AF77BF77CF77DF77EF780D3E3F781F782F6CFF783C2B3F6D0F784F785F6D1F6D2F6D3F6D4F786F787F6D6F788B1ABF6D7F789F6D8F6D9F6DAF78AF6DBF6DCF78BF78CF78DF78EF6DDF6DECFCAF78FF6DFF6E0F6E1F6E2F6E3F6E4C0F0F6E5F6E6F6E7F6E8F6E9F790F6EAF791F6EBF6ECF792F6EDF6EEF6EFF6F0F6F1F6F2F6F3F6F4BEA8F793F6F5F6F6F6F7F6F8F794F795F796F797F798C8FAF6F9F6FAF6FBF6FCF799F79AF6FDF6FEF7A1F7A2F7A3F7A4F7A5F79BF79CF7A6F7A7F7A8B1EEF7A9F7AAF7ABF79DF79EF7ACF7ADC1DBF7AEF79FF7A0F7AFF840F841F842F843F844F845F846F847F848F849F84AF84BF84CF84DF84EF84FF850F851F852F853F854F855F856F857F858F859F85AF85BF85CF85DF85EF85FF860F861F862F863F864F865F866F867F868F869F86AF86BF86CF86DF86EF86FF870F871F872F873F874F875F876F877F878F879F87AF87BF87CF87DF87EF880F881F882F883F884F885F886F887F888F889F88AF88BF88CF88DF88EF88FF890F891F892F893F894F895F896F897F898F899F89AF89BF89CF89DF89EF89FF8A0F940F941F942F943F944F945F946F947F948F949F94AF94BF94CF94DF94EF94FF950F951F952F953F954F955F956F957F958F959F95AF95BF95CF95DF95EF95FF960F961F962F963F964F965F966F967F968F969F96AF96BF96CF96DF96EF96FF970F971F972F973F974F975F976F977F978F979F97AF97BF97CF97DF97EF980F981F982F983F984F985F986F987F988F989F98AF98BF98CF98DF98EF98FF990F991F992F993F994F995F996F997F998F999F99AF99BF99CF99DF99EF99FF9A0FA40FA41FA42FA43FA44FA45FA46FA47FA48FA49FA4AFA4BFA4CFA4DFA4EFA4FFA50FA51FA52FA53FA54FA55FA56FA57FA58FA59FA5AFA5BFA5CFA5DFA5EFA5FFA60FA61FA62FA63FA64FA65FA66FA67FA68FA69FA6AFA6BFA6CFA6DFA6EFA6FFA70FA71FA72FA73FA74FA75FA76FA77FA78FA79FA7AFA7BFA7CFA7DFA7EFA80FA81FA82FA83FA84FA85FA86FA87FA88FA89FA8AFA8BFA8CFA8DFA8EFA8FFA90FA91FA92FA93FA94FA95FA96FA97FA98FA99FA9AFA9BFA9CFA9DFA9EFA9FFAA0FB40FB41FB42FB43FB44FB45FB46FB47FB48FB49FB4AFB4BFB4CFB4DFB4EFB4FFB50FB51FB52FB53FB54FB55FB56FB57FB58FB59FB5AFB5BC4F1F0AFBCA6F0B0C3F9FB5CC5B8D1BBFB5DF0B1F0B2F0B3F0B4F0B5D1BCFB5ED1ECFB5FF0B7F0B6D4A7FB60CDD2F0B8F0BAF0B9F0BBF0BCFB61FB62B8EBF0BDBAE8FB63F0BEF0BFBEE9F0C0B6ECF0C1F0C2F0C3F0C4C8B5F0C5F0C6FB64F0C7C5F4FB65F0C8FB66FB67FB68F0C9FB69F0CAF7BDFB6AF0CBF0CCF0CDFB6BF0CEFB6CFB6DFB6EFB6FF0CFBAD7FB70F0D0F0D1F0D2F0D3F0D4F0D5F0D6F0D8FB71FB72D3A5F0D7FB73F0D9FB74FB75FB76FB77FB78FB79FB7AFB7BFB7CFB7DF5BAC2B9FB7EFB80F7E4FB81FB82FB83FB84F7E5F7E6FB85FB86F7E7FB87FB88FB89FB8AFB8BFB8CF7E8C2B4FB8DFB8EFB8FFB90FB91FB92FB93FB94FB95F7EAFB96F7EBFB97FB98FB99FB9AFB9BFB9CC2F3FB9DFB9EFB9FFBA0FC40FC41FC42FC43FC44FC45FC46FC47FC48F4F0FC49FC4AFC4BF4EFFC4CFC4DC2E9FC4EF7E1F7E2FC4FFC50FC51FC52FC53BBC6FC54FC55FC56FC57D9E4FC58FC59FC5ACAF2C0E8F0A4FC5BBADAFC5CFC5DC7ADFC5EFC5FFC60C4ACFC61FC62F7ECF7EDF7EEFC63F7F0F7EFFC64F7F1FC65FC66F7F4FC67F7F3FC68F7F2F7F5FC69FC6AFC6BFC6CF7F6FC6DFC6EFC6FFC70FC71FC72FC73FC74FC75EDE9FC76EDEAEDEBFC77F6BCFC78FC79FC7AFC7BFC7CFC7DFC7EFC80FC81FC82FC83FC84F6BDFC85F6BEB6A6FC86D8BEFC87FC88B9C4FC89FC8AFC8BD8BBFC8CDCB1FC8DFC8EFC8FFC90FC91FC92CAF3FC93F7F7FC94FC95FC96FC97FC98FC99FC9AFC9BFC9CF7F8FC9DFC9EF7F9FC9FFCA0FD40FD41FD42FD43FD44F7FBFD45F7FAFD46B1C7FD47F7FCF7FDFD48FD49FD4AFD4BFD4CF7FEFD4DFD4EFD4FFD50FD51FD52FD53FD54FD55FD56FD57C6EBECB4FD58FD59FD5AFD5BFD5CFD5DFD5EFD5FFD60FD61FD62FD63FD64FD65FD66FD67FD68FD69FD6AFD6BFD6CFD6DFD6EFD6FFD70FD71FD72FD73FD74FD75FD76FD77FD78FD79FD7AFD7BFD7CFD7DFD7EFD80FD81FD82FD83FD84FD85B3DDF6B3FD86FD87F6B4C1E4F6B5F6B6F6B7F6B8F6B9F6BAC8A3F6BBFD88FD89FD8AFD8BFD8CFD8DFD8EFD8FFD90FD91FD92FD93C1FAB9A8EDE8FD94FD95FD96B9EAD9DFFD97FD98FD99FD9AFD9'; + + for (var i = 0; i < str.length; i++) { + var c = str.charAt(i), + code = str.charCodeAt(i); + if (c == " ") strOut += "+"; + else if (code >= 19968 && code <= 40869) { + var index = code - 19968; + strOut += "%" + z.substr(index * 4, 2) + "%" + z.substr(index * 4 + 2, 2); + } else { + strOut += "%" + str.charCodeAt(i).toString(16); + } + } + return strOut; + }, + /* 改变图片大小 */ + scale: function (img, w, h) { + var ow = img.width, + oh = img.height; + + if (ow >= oh) { + img.width = w * ow / oh; + img.height = h; + img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; + } else { + img.width = w; + img.height = h * oh / ow; + img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; + } + }, + getImageData: function(){ + var _this = this, + key = $G('searchTxt').value, + type = $G('searchType').value, + keepOriginName = editor.options.keepOriginName ? "1" : "0", + url = "http://image.baidu.com/i?ct=201326592&cl=2&lm=-1&st=-1&tn=baiduimagejson&istype=2&rn=32&fm=index&pv=&word=" + _this.encodeToGb2312(key) + type + "&keeporiginname=" + keepOriginName + "&" + +new Date; + + $G('searchListUl').innerHTML = lang.searchLoading; + ajax.request(url, { + 'dataType': 'jsonp', + 'charset': 'GB18030', + 'onsuccess':function(json){ + var list = []; + if(json && json.data) { + for(var i = 0; i < json.data.length; i++) { + if(json.data[i].objURL) { + list.push({ + title: json.data[i].fromPageTitleEnc, + src: json.data[i].objURL, + url: json.data[i].fromURL + }); + } + } + } + _this.setList(list); + }, + 'onerror':function(){ + $G('searchListUl').innerHTML = lang.searchRetry; + } + }); + }, + /* 添加图片到列表界面上 */ + setList: function (list) { + var i, item, p, img, link, _this = this, + listUl = $G('searchListUl'); + + listUl.innerHTML = ''; + if(list.length) { + for (i = 0; i < list.length; i++) { + item = document.createElement('li'); + p = document.createElement('p'); + img = document.createElement('img'); + link = document.createElement('a'); + + img.onload = function () { + _this.scale(this, 113, 113); + }; + img.width = 113; + img.setAttribute('src', list[i].src); + + link.href = list[i].url; + link.target = '_blank'; + link.title = list[i].title; + link.innerHTML = list[i].title; + + p.appendChild(img); + item.appendChild(p); + item.appendChild(link); + listUl.appendChild(item); + } + } else { + listUl.innerHTML = lang.searchRetry; + } + }, + getInsertList: function () { + var child, + src, + align = getAlign(), + list = [], + items = $G('searchListUl').children; + for(var i = 0; i < items.length; i++) { + child = items[i].firstChild && items[i].firstChild.firstChild; + if(child.tagName && child.tagName.toLowerCase() == 'img' && domUtils.hasClass(items[i], 'selected')) { + src = child.src; + list.push({ + src: src, + _src: src, + alt: src.substr(src.lastIndexOf('/') + 1), + floatStyle: align + }); + } + } + return list; + } + }; + +})(); diff --git a/public/static/Ueditor/dialogs/image/images/alignicon.jpg b/public/static/Ueditor/dialogs/image/images/alignicon.jpg new file mode 100644 index 0000000..754755b Binary files /dev/null and b/public/static/Ueditor/dialogs/image/images/alignicon.jpg differ diff --git a/public/static/Ueditor/dialogs/image/images/bg.png b/public/static/Ueditor/dialogs/image/images/bg.png new file mode 100644 index 0000000..580be0a Binary files /dev/null and b/public/static/Ueditor/dialogs/image/images/bg.png differ diff --git a/public/static/Ueditor/dialogs/image/images/icons.gif b/public/static/Ueditor/dialogs/image/images/icons.gif new file mode 100644 index 0000000..78459de Binary files /dev/null and b/public/static/Ueditor/dialogs/image/images/icons.gif differ diff --git a/public/static/Ueditor/dialogs/image/images/icons.png b/public/static/Ueditor/dialogs/image/images/icons.png new file mode 100644 index 0000000..12e4700 Binary files /dev/null and b/public/static/Ueditor/dialogs/image/images/icons.png differ diff --git a/public/static/Ueditor/dialogs/image/images/image.png b/public/static/Ueditor/dialogs/image/images/image.png new file mode 100644 index 0000000..19699f6 Binary files /dev/null and b/public/static/Ueditor/dialogs/image/images/image.png differ diff --git a/public/static/Ueditor/dialogs/image/images/progress.png b/public/static/Ueditor/dialogs/image/images/progress.png new file mode 100644 index 0000000..717c486 Binary files /dev/null and b/public/static/Ueditor/dialogs/image/images/progress.png differ diff --git a/public/static/Ueditor/dialogs/image/images/success.gif b/public/static/Ueditor/dialogs/image/images/success.gif new file mode 100644 index 0000000..8d4f311 Binary files /dev/null and b/public/static/Ueditor/dialogs/image/images/success.gif differ diff --git a/public/static/Ueditor/dialogs/image/images/success.png b/public/static/Ueditor/dialogs/image/images/success.png new file mode 100644 index 0000000..94f968d Binary files /dev/null and b/public/static/Ueditor/dialogs/image/images/success.png differ diff --git a/public/static/Ueditor/dialogs/insertframe/insertframe.html b/public/static/Ueditor/dialogs/insertframe/insertframe.html new file mode 100644 index 0000000..7f1f3e9 --- /dev/null +++ b/public/static/Ueditor/dialogs/insertframe/insertframe.html @@ -0,0 +1,98 @@ + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    + + +
    px
    px
    + +
    +
    + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/internal.js b/public/static/Ueditor/dialogs/internal.js new file mode 100644 index 0000000..44dc17f --- /dev/null +++ b/public/static/Ueditor/dialogs/internal.js @@ -0,0 +1,81 @@ +(function () { + var parent = window.parent; + //dialog对象 + dialog = parent.$EDITORUI[window.frameElement.id.replace( /_iframe$/, '' )]; + //当前打开dialog的编辑器实例 + editor = dialog.editor; + + UE = parent.UE; + + domUtils = UE.dom.domUtils; + + utils = UE.utils; + + browser = UE.browser; + + ajax = UE.ajax; + + $G = function ( id ) { + return document.getElementById( id ) + }; + //focus元素 + $focus = function ( node ) { + setTimeout( function () { + if ( browser.ie ) { + var r = node.createTextRange(); + r.collapse( false ); + r.select(); + } else { + node.focus() + } + }, 0 ) + }; + utils.loadFile(document,{ + href:editor.options.themePath + editor.options.theme + "/dialogbase.css?cache="+Math.random(), + tag:"link", + type:"text/css", + rel:"stylesheet" + }); + lang = editor.getLang(dialog.className.split( "-" )[2]); + if(lang){ + domUtils.on(window,'load',function () { + + var langImgPath = editor.options.langPath + editor.options.lang + "/images/"; + //针对静态资源 + for ( var i in lang["static"] ) { + var dom = $G( i ); + if(!dom) continue; + var tagName = dom.tagName, + content = lang["static"][i]; + if(content.src){ + //clone + content = utils.extend({},content,false); + content.src = langImgPath + content.src; + } + if(content.style){ + content = utils.extend({},content,false); + content.style = content.style.replace(/url\s*\(/g,"url(" + langImgPath) + } + switch ( tagName.toLowerCase() ) { + case "var": + dom.parentNode.replaceChild( document.createTextNode( content ), dom ); + break; + case "select": + var ops = dom.options; + for ( var j = 0, oj; oj = ops[j]; ) { + oj.innerHTML = content.options[j++]; + } + for ( var p in content ) { + p != "options" && dom.setAttribute( p, content[p] ); + } + break; + default : + domUtils.setAttributes( dom, content); + } + } + } ); + } + + +})(); + diff --git a/public/static/Ueditor/dialogs/link/link.html b/public/static/Ueditor/dialogs/link/link.html new file mode 100644 index 0000000..55ab4d1 --- /dev/null +++ b/public/static/Ueditor/dialogs/link/link.html @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + + diff --git a/public/static/Ueditor/dialogs/map/map.html b/public/static/Ueditor/dialogs/map/map.html new file mode 100644 index 0000000..e763b8e --- /dev/null +++ b/public/static/Ueditor/dialogs/map/map.html @@ -0,0 +1,135 @@ + + + + + + + + + + +
    + + + + + + + + + +
    ::
    +
    + +
    + + + + + diff --git a/public/static/Ueditor/dialogs/map/show.html b/public/static/Ueditor/dialogs/map/show.html new file mode 100644 index 0000000..329cfeb --- /dev/null +++ b/public/static/Ueditor/dialogs/map/show.html @@ -0,0 +1,118 @@ + + + + + + + 百度地图API自定义地图 + + + + + + + +
    + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/music/music.css b/public/static/Ueditor/dialogs/music/music.css new file mode 100644 index 0000000..8fb7a94 --- /dev/null +++ b/public/static/Ueditor/dialogs/music/music.css @@ -0,0 +1,30 @@ +.wrapper{margin: 5px 10px;} + +.searchBar{height:30px;padding:7px 0 3px;text-align:center;} +.searchBtn{font-size:13px;height:24px;} + +.resultBar{width:460px;margin:5px auto;border: 1px solid #CCC;border-radius: 5px;box-shadow: 2px 2px 5px #D3D6DA;overflow: hidden;} + +.listPanel{overflow: hidden;} +.panelon{display:block;} +.paneloff{display:none} + +.page{width:220px;margin:20px auto;overflow: hidden;} +.pageon{float:right;width:24px;line-height:24px;height:24px;margin-right: 5px;background: none;border: none;color: #000;font-weight: bold;text-align:center} +.pageoff{float:right;width:24px;line-height:24px;height:24px;cursor:pointer;background-color: #fff; + border: 1px solid #E7ECF0;color: #2D64B3;margin-right: 5px;text-decoration: none;text-align:center;} + +.m-box{width:460px;} +.m-m{float: left;line-height: 20px;height: 20px;} +.m-h{height:24px;line-height:24px;padding-left: 46px;background-color:#FAFAFA;border-bottom: 1px solid #DAD8D8;font-weight: bold;font-size: 12px;color: #333;} +.m-l{float:left;width:40px; } +.m-t{float:left;width:140px;} +.m-s{float:left;width:110px;} +.m-z{float:left;width:100px;} +.m-try-t{float: left;width: 60px;;} + +.m-try{float:left;width:20px;height:20px;background:url('http://static.tieba.baidu.com/tb/editor/images/try_music.gif') no-repeat ;} +.m-trying{float:left;width:20px;height:20px;background:url('http://static.tieba.baidu.com/tb/editor/images/stop_music.gif') no-repeat ;} + +.loading{width:95px;height:7px;font-size:7px;margin:60px auto;background:url(http://static.tieba.baidu.com/tb/editor/images/loading.gif) no-repeat} +.empty{width:300px;height:40px;padding:2px;margin:50px auto;line-height:40px; color:#006699;text-align:center;} \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/music/music.html b/public/static/Ueditor/dialogs/music/music.html new file mode 100644 index 0000000..e7ef04f --- /dev/null +++ b/public/static/Ueditor/dialogs/music/music.html @@ -0,0 +1,32 @@ + + + + + 插入音乐 + + + + +
    + +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/music/music.js b/public/static/Ueditor/dialogs/music/music.js new file mode 100644 index 0000000..1c538bf --- /dev/null +++ b/public/static/Ueditor/dialogs/music/music.js @@ -0,0 +1,192 @@ +function Music() { + this.init(); +} +(function () { + var pages = [], + panels = [], + selectedItem = null; + Music.prototype = { + total:70, + pageSize:10, + dataUrl:"http://tingapi.ting.baidu.com/v1/restserver/ting?method=baidu.ting.search.common", + playerUrl:"http://box.baidu.com/widget/flash/bdspacesong.swf", + + init:function () { + var me = this; + domUtils.on($G("J_searchName"), "keyup", function (event) { + var e = window.event || event; + if (e.keyCode == 13) { + me.dosearch(); + } + }); + domUtils.on($G("J_searchBtn"), "click", function () { + me.dosearch(); + }); + }, + callback:function (data) { + var me = this; + me.data = data.song_list; + setTimeout(function () { + $G('J_resultBar').innerHTML = me._renderTemplate(data.song_list); + }, 300); + }, + dosearch:function () { + var me = this; + selectedItem = null; + var key = $G('J_searchName').value; + if (utils.trim(key) == "")return false; + key = encodeURIComponent(key); + me._sent(key); + }, + doselect:function (i) { + var me = this; + if (typeof i == 'object') { + selectedItem = i; + } else if (typeof i == 'number') { + selectedItem = me.data[i]; + } + }, + onpageclick:function (id) { + var me = this; + for (var i = 0; i < pages.length; i++) { + $G(pages[i]).className = 'pageoff'; + $G(panels[i]).className = 'paneloff'; + } + $G('page' + id).className = 'pageon'; + $G('panel' + id).className = 'panelon'; + }, + listenTest:function (elem) { + var me = this, + view = $G('J_preview'), + is_play_action = (elem.className == 'm-try'), + old_trying = me._getTryingElem(); + + if (old_trying) { + old_trying.className = 'm-try'; + view.innerHTML = ''; + } + if (is_play_action) { + elem.className = 'm-trying'; + view.innerHTML = me._buildMusicHtml(me._getUrl(true)); + } + }, + _sent:function (param) { + var me = this; + $G('J_resultBar').innerHTML = '
    '; + + utils.loadFile(document, { + src:me.dataUrl + '&query=' + param + '&page_size=' + me.total + '&callback=music.callback&.r=' + Math.random(), + tag:"script", + type:"text/javascript", + defer:"defer" + }); + }, + _removeHtml:function (str) { + var reg = /<\s*\/?\s*[^>]*\s*>/gi; + return str.replace(reg, ""); + }, + _getUrl:function (isTryListen) { + var me = this; + var param = 'from=tiebasongwidget&url=&name=' + encodeURIComponent(me._removeHtml(selectedItem.title)) + '&artist=' + + encodeURIComponent(me._removeHtml(selectedItem.author)) + '&extra=' + + encodeURIComponent(me._removeHtml(selectedItem.album_title)) + + '&autoPlay='+isTryListen+'' + '&loop=true'; + return me.playerUrl + "?" + param; + }, + _getTryingElem:function () { + var s = $G('J_listPanel').getElementsByTagName('span'); + + for (var i = 0; i < s.length; i++) { + if (s[i].className == 'm-trying') + return s[i]; + } + return null; + }, + _buildMusicHtml:function (playerUrl) { + var html = ' 12) + return s.substring(0, 5) + '...'; + if (!s) s = " "; + return s; + }, + _rebuildData:function (data) { + var me = this, + newData = [], + d = me.pageSize, + itembox; + for (var i = 0; i < data.length; i++) { + if ((i + d) % d == 0) { + itembox = []; + newData.push(itembox) + } + itembox.push(data[i]); + } + return newData; + }, + _renderTemplate:function (data) { + var me = this; + if (data.length == 0)return '
    ' + lang.emptyTxt + '
    '; + data = me._rebuildData(data); + var s = [], p = [], t = []; + s.push('
    '); + p.push('
    '); + for (var i = 0, tmpList; tmpList = data[i++];) { + panels.push('panel' + i); + pages.push('page' + i); + if (i == 1) { + s.push('
    '); + if (data.length != 1) { + t.push('
    ' + (i ) + '
    '); + } + } else { + s.push('
    '); + t.push('
    ' + (i ) + '
    '); + } + s.push('
    '); + s.push('
    ' + lang.chapter + '' + lang.singer + + '' + lang.special + '' + lang.listenTest + '
    '); + for (var j = 0, tmpObj; tmpObj = tmpList[j++];) { + s.push(''); + } + s.push('
    '); + s.push('
    '); + } + t.reverse(); + p.push(t.join('')); + s.push('
    '); + p.push('
    '); + return s.join('') + p.join(''); + }, + exec:function () { + var me = this; + if (selectedItem == null) return; + $G('J_preview').innerHTML = ""; + editor.execCommand('music', { + url:me._getUrl(false), + width:400, + height:95 + }); + } + }; +})(); + + + diff --git a/public/static/Ueditor/dialogs/preview/preview.html b/public/static/Ueditor/dialogs/preview/preview.html new file mode 100644 index 0000000..f6b433b --- /dev/null +++ b/public/static/Ueditor/dialogs/preview/preview.html @@ -0,0 +1,40 @@ + + + + + + + + + + +
    + +
    + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/scrawl/images/addimg.png b/public/static/Ueditor/dialogs/scrawl/images/addimg.png new file mode 100644 index 0000000..03a8713 Binary files /dev/null and b/public/static/Ueditor/dialogs/scrawl/images/addimg.png differ diff --git a/public/static/Ueditor/dialogs/scrawl/images/brush.png b/public/static/Ueditor/dialogs/scrawl/images/brush.png new file mode 100644 index 0000000..efa6fdb Binary files /dev/null and b/public/static/Ueditor/dialogs/scrawl/images/brush.png differ diff --git a/public/static/Ueditor/dialogs/scrawl/images/delimg.png b/public/static/Ueditor/dialogs/scrawl/images/delimg.png new file mode 100644 index 0000000..5a892e4 Binary files /dev/null and b/public/static/Ueditor/dialogs/scrawl/images/delimg.png differ diff --git a/public/static/Ueditor/dialogs/scrawl/images/delimgH.png b/public/static/Ueditor/dialogs/scrawl/images/delimgH.png new file mode 100644 index 0000000..2f0c5c9 Binary files /dev/null and b/public/static/Ueditor/dialogs/scrawl/images/delimgH.png differ diff --git a/public/static/Ueditor/dialogs/scrawl/images/empty.png b/public/static/Ueditor/dialogs/scrawl/images/empty.png new file mode 100644 index 0000000..0375196 Binary files /dev/null and b/public/static/Ueditor/dialogs/scrawl/images/empty.png differ diff --git a/public/static/Ueditor/dialogs/scrawl/images/emptyH.png b/public/static/Ueditor/dialogs/scrawl/images/emptyH.png new file mode 100644 index 0000000..838ca72 Binary files /dev/null and b/public/static/Ueditor/dialogs/scrawl/images/emptyH.png differ diff --git a/public/static/Ueditor/dialogs/scrawl/images/eraser.png b/public/static/Ueditor/dialogs/scrawl/images/eraser.png new file mode 100644 index 0000000..63e87ce Binary files /dev/null and b/public/static/Ueditor/dialogs/scrawl/images/eraser.png differ diff --git a/public/static/Ueditor/dialogs/scrawl/images/redo.png b/public/static/Ueditor/dialogs/scrawl/images/redo.png new file mode 100644 index 0000000..12cd9bb Binary files /dev/null and b/public/static/Ueditor/dialogs/scrawl/images/redo.png differ diff --git a/public/static/Ueditor/dialogs/scrawl/images/redoH.png b/public/static/Ueditor/dialogs/scrawl/images/redoH.png new file mode 100644 index 0000000..d9f33d3 Binary files /dev/null and b/public/static/Ueditor/dialogs/scrawl/images/redoH.png differ diff --git a/public/static/Ueditor/dialogs/scrawl/images/scale.png b/public/static/Ueditor/dialogs/scrawl/images/scale.png new file mode 100644 index 0000000..935a3f3 Binary files /dev/null and b/public/static/Ueditor/dialogs/scrawl/images/scale.png differ diff --git a/public/static/Ueditor/dialogs/scrawl/images/scaleH.png b/public/static/Ueditor/dialogs/scrawl/images/scaleH.png new file mode 100644 index 0000000..72e64a9 Binary files /dev/null and b/public/static/Ueditor/dialogs/scrawl/images/scaleH.png differ diff --git a/public/static/Ueditor/dialogs/scrawl/images/size.png b/public/static/Ueditor/dialogs/scrawl/images/size.png new file mode 100644 index 0000000..8366845 Binary files /dev/null and b/public/static/Ueditor/dialogs/scrawl/images/size.png differ diff --git a/public/static/Ueditor/dialogs/scrawl/images/undo.png b/public/static/Ueditor/dialogs/scrawl/images/undo.png new file mode 100644 index 0000000..084c7cc Binary files /dev/null and b/public/static/Ueditor/dialogs/scrawl/images/undo.png differ diff --git a/public/static/Ueditor/dialogs/scrawl/images/undoH.png b/public/static/Ueditor/dialogs/scrawl/images/undoH.png new file mode 100644 index 0000000..fde7eb3 Binary files /dev/null and b/public/static/Ueditor/dialogs/scrawl/images/undoH.png differ diff --git a/public/static/Ueditor/dialogs/scrawl/scrawl.css b/public/static/Ueditor/dialogs/scrawl/scrawl.css new file mode 100644 index 0000000..b18430d --- /dev/null +++ b/public/static/Ueditor/dialogs/scrawl/scrawl.css @@ -0,0 +1,72 @@ +/*common +*/ +body{margin: 0;} +table{width:100%;} +table td{padding:2px 4px;vertical-align: middle;} +a{text-decoration: none;} +em{font-style: normal;} +.border_style1{border: 1px solid #ccc;border-radius: 5px;box-shadow:2px 2px 5px #d3d6da;} +/*module +*/ +.main{margin: 8px;overflow: hidden;} + +.hot{float:left;height:335px;} +.drawBoard{position: relative; cursor: crosshair;} +.brushBorad{position: absolute;left:0;top:0;z-index: 998;} +.picBoard{border: none;text-align: center;line-height: 300px;cursor: default;} +.operateBar{margin-top:10px;font-size:12px;text-align: center;} +.operateBar span{margin-left: 10px;} + +.drawToolbar{float:right;width:110px;height:300px;overflow: hidden;} +.colorBar{margin-top:10px;font-size: 12px;text-align: center;} +.colorBar a{display:block;width: 10px;height: 10px;border:1px solid #1006F1;border-radius: 3px; box-shadow:2px 2px 5px #d3d6da;opacity: 0.3} +.sectionBar{margin-top:15px;font-size: 12px;text-align: center;} +.sectionBar a{display:inline-block;width:10px;height:12px;color: #888;text-indent: -999px;opacity: 0.3} +.size1{background: url('images/size.png') 1px center no-repeat ;} +.size2{background: url('images/size.png') -10px center no-repeat;} +.size3{background: url('images/size.png') -22px center no-repeat;} +.size4{background: url('images/size.png') -35px center no-repeat;} + +.addImgH{position: relative;} +.addImgH_form{position: absolute;left: 18px;top: -1px;width: 75px;height: 21px;opacity: 0;cursor: pointer;} +.addImgH_form input{width: 100%;} +/*scrawl遮罩层 +*/ +.maskLayerNull{display: none;} +.maskLayer{position: absolute;top:0;left:0;width: 100%; height: 100%;opacity: 0.7; + background-color: #fff;text-align:center;font-weight:bold;line-height:300px;z-index: 1000;} +/*btn state +*/ +.previousStepH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/undoH.png');cursor: pointer;} +.previousStepH .text{color:#888;cursor:pointer;} +.previousStep .icon{display: inline-block;width:16px;height:16px;background-image: url('images/undo.png');cursor:default;} +.previousStep .text{color:#ccc;cursor:default;} + +.nextStepH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/redoH.png');cursor: pointer;} +.nextStepH .text{color:#888;cursor:pointer;} +.nextStep .icon{display: inline-block;width:16px;height:16px;background-image: url('images/redo.png');cursor:default;} +.nextStep .text{color:#ccc;cursor:default;} + +.clearBoardH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/emptyH.png');cursor: pointer;} +.clearBoardH .text{color:#888;cursor:pointer;} +.clearBoard .icon{display: inline-block;width:16px;height:16px;background-image: url('images/empty.png');cursor:default;} +.clearBoard .text{color:#ccc;cursor:default;} + +.scaleBoardH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/scaleH.png');cursor: pointer;} +.scaleBoardH .text{color:#888;cursor:pointer;} +.scaleBoard .icon{display: inline-block;width:16px;height:16px;background-image: url('images/scale.png');cursor:default;} +.scaleBoard .text{color:#ccc;cursor:default;} + +.removeImgH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/delimgH.png');cursor: pointer;} +.removeImgH .text{color:#888;cursor:pointer;} +.removeImg .icon{display: inline-block;width:16px;height:16px;background-image: url('images/delimg.png');cursor:default;} +.removeImg .text{color:#ccc;cursor:default;} + +.addImgH .icon{vertical-align:top;display: inline-block;width:16px;height:16px;background-image: url('images/addimg.png')} +.addImgH .text{color:#888;cursor:pointer;} +/*icon +*/ +.brushIcon{display: inline-block;width:16px;height:16px;background-image: url('images/brush.png')} +.eraserIcon{display: inline-block;width:16px;height:16px;background-image: url('images/eraser.png')} + + diff --git a/public/static/Ueditor/dialogs/scrawl/scrawl.html b/public/static/Ueditor/dialogs/scrawl/scrawl.html new file mode 100644 index 0000000..9371abd --- /dev/null +++ b/public/static/Ueditor/dialogs/scrawl/scrawl.html @@ -0,0 +1,95 @@ + + + + + + + + + + +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + 1 + 3 + 5 + 7 +
    +
    + + 1 + 3 + 5 + 7 +
    +
    +
    + + +
    + +
    + +
    +
    +
    + + + + +
    +
    +
    +
    + + + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/scrawl/scrawl.js b/public/static/Ueditor/dialogs/scrawl/scrawl.js new file mode 100644 index 0000000..e0c005e --- /dev/null +++ b/public/static/Ueditor/dialogs/scrawl/scrawl.js @@ -0,0 +1,671 @@ +/** + * Created with JetBrains PhpStorm. + * User: xuheng + * Date: 12-5-22 + * Time: 上午11:38 + * To change this template use File | Settings | File Templates. + */ +var scrawl = function (options) { + options && this.initOptions(options); +}; +(function () { + var canvas = $G("J_brushBoard"), + context = canvas.getContext('2d'), + drawStep = [], //undo redo存储 + drawStepIndex = 0; //undo redo指针 + + scrawl.prototype = { + isScrawl:false, //是否涂鸦 + brushWidth:-1, //画笔粗细 + brushColor:"", //画笔颜色 + + initOptions:function (options) { + var me = this; + me.originalState(options);//初始页面状态 + me._buildToolbarColor(options.colorList);//动态生成颜色选择集合 + + me._addBoardListener(options.saveNum);//添加画板处理 + me._addOPerateListener(options.saveNum);//添加undo redo clearBoard处理 + me._addColorBarListener();//添加颜色选择处理 + me._addBrushBarListener();//添加画笔大小处理 + me._addEraserBarListener();//添加橡皮大小处理 + me._addAddImgListener();//添加增添背景图片处理 + me._addRemoveImgListenter();//删除背景图片处理 + me._addScalePicListenter();//添加缩放处理 + me._addClearSelectionListenter();//添加清楚选中状态处理 + + me._originalColorSelect(options.drawBrushColor);//初始化颜色选中 + me._originalBrushSelect(options.drawBrushSize);//初始化画笔选中 + me._clearSelection();//清楚选中状态 + }, + + originalState:function (options) { + var me = this; + + me.brushWidth = options.drawBrushSize;//同步画笔粗细 + me.brushColor = options.drawBrushColor;//同步画笔颜色 + + context.lineWidth = me.brushWidth;//初始画笔大小 + context.strokeStyle = me.brushColor;//初始画笔颜色 + context.fillStyle = "transparent";//初始画布背景颜色 + context.lineCap = "round";//去除锯齿 + context.fill(); + }, + _buildToolbarColor:function (colorList) { + var tmp = null, arr = []; + arr.push(""); + for (var i = 0, color; color = colorList[i++];) { + if ((i - 1) % 5 == 0) { + if (i != 1) { + arr.push(""); + } + arr.push(""); + } + tmp = '#' + color; + arr.push(""); + } + arr.push("
    "); + $G("J_colorBar").innerHTML = arr.join(""); + }, + + _addBoardListener:function (saveNum) { + var me = this, + margin = 0, + startX = -1, + startY = -1, + isMouseDown = false, + isMouseMove = false, + isMouseUp = false, + buttonPress = 0, button, flag = ''; + + margin = parseInt(domUtils.getComputedStyle($G("J_wrap"), "margin-left")); + drawStep.push(context.getImageData(0, 0, context.canvas.width, context.canvas.height)); + drawStepIndex += 1; + + domUtils.on(canvas, ["mousedown", "mousemove", "mouseup", "mouseout"], function (e) { + button = browser.webkit ? e.which : buttonPress; + switch (e.type) { + case 'mousedown': + buttonPress = 1; + flag = 1; + isMouseDown = true; + isMouseUp = false; + isMouseMove = false; + me.isScrawl = true; + startX = e.clientX - margin;//10为外边距总和 + startY = e.clientY - margin; + context.beginPath(); + break; + case 'mousemove' : + if (!flag && button == 0) { + return; + } + if (!flag && button) { + startX = e.clientX - margin;//10为外边距总和 + startY = e.clientY - margin; + context.beginPath(); + flag = 1; + } + if (isMouseUp || !isMouseDown) { + return; + } + var endX = e.clientX - margin, + endY = e.clientY - margin; + + context.moveTo(startX, startY); + context.lineTo(endX, endY); + context.stroke(); + startX = endX; + startY = endY; + isMouseMove = true; + break; + case 'mouseup': + buttonPress = 0; + if (!isMouseDown)return; + if (!isMouseMove) { + context.arc(startX, startY, context.lineWidth, 0, Math.PI * 2, false); + context.fillStyle = context.strokeStyle; + context.fill(); + } + context.closePath(); + me._saveOPerate(saveNum); + isMouseDown = false; + isMouseMove = false; + isMouseUp = true; + startX = -1; + startY = -1; + break; + case 'mouseout': + flag = ''; + buttonPress = 0; + if (button == 1) return; + context.closePath(); + break; + } + }); + }, + _addOPerateListener:function (saveNum) { + var me = this; + domUtils.on($G("J_previousStep"), "click", function () { + if (drawStepIndex > 1) { + drawStepIndex -= 1; + context.clearRect(0, 0, context.canvas.width, context.canvas.height); + context.putImageData(drawStep[drawStepIndex - 1], 0, 0); + me.btn2Highlight("J_nextStep"); + drawStepIndex == 1 && me.btn2disable("J_previousStep"); + } + }); + domUtils.on($G("J_nextStep"), "click", function () { + if (drawStepIndex > 0 && drawStepIndex < drawStep.length) { + context.clearRect(0, 0, context.canvas.width, context.canvas.height); + context.putImageData(drawStep[drawStepIndex], 0, 0); + drawStepIndex += 1; + me.btn2Highlight("J_previousStep"); + drawStepIndex == drawStep.length && me.btn2disable("J_nextStep"); + } + }); + domUtils.on($G("J_clearBoard"), "click", function () { + context.clearRect(0, 0, context.canvas.width, context.canvas.height); + drawStep = []; + me._saveOPerate(saveNum); + drawStepIndex = 1; + me.isScrawl = false; + me.btn2disable("J_previousStep"); + me.btn2disable("J_nextStep"); + me.btn2disable("J_clearBoard"); + }); + }, + _addColorBarListener:function () { + var me = this; + domUtils.on($G("J_colorBar"), "click", function (e) { + var target = me.getTarget(e), + color = target.title; + if (!!color) { + me._addColorSelect(target); + + me.brushColor = color; + context.globalCompositeOperation = "source-over"; + context.lineWidth = me.brushWidth; + context.strokeStyle = color; + } + }); + }, + _addBrushBarListener:function () { + var me = this; + domUtils.on($G("J_brushBar"), "click", function (e) { + var target = me.getTarget(e), + size = browser.ie ? target.innerText : target.text; + if (!!size) { + me._addBESelect(target); + + context.globalCompositeOperation = "source-over"; + context.lineWidth = parseInt(size); + context.strokeStyle = me.brushColor; + me.brushWidth = context.lineWidth; + } + }); + }, + _addEraserBarListener:function () { + var me = this; + domUtils.on($G("J_eraserBar"), "click", function (e) { + var target = me.getTarget(e), + size = browser.ie ? target.innerText : target.text; + if (!!size) { + me._addBESelect(target); + + context.lineWidth = parseInt(size); + context.globalCompositeOperation = "destination-out"; + context.strokeStyle = "#FFF"; + } + }); + }, + _addAddImgListener:function () { + var file = $G("J_imgTxt"); + if (!window.FileReader) { + $G("J_addImg").style.display = 'none'; + $G("J_removeImg").style.display = 'none'; + $G("J_sacleBoard").style.display = 'none'; + } + domUtils.on(file, "change", function (e) { + var frm = file.parentNode; + addMaskLayer(lang.backgroundUploading); + + var target = e.target || e.srcElement, + reader = new FileReader(); + reader.onload = function(evt){ + var target = evt.target || evt.srcElement; + ue_callback(target.result, 'SUCCESS'); + }; + reader.readAsDataURL(target.files[0]); + frm.reset(); + }); + }, + _addRemoveImgListenter:function () { + var me = this; + domUtils.on($G("J_removeImg"), "click", function () { + $G("J_picBoard").innerHTML = ""; + me.btn2disable("J_removeImg"); + me.btn2disable("J_sacleBoard"); + }); + }, + _addScalePicListenter:function () { + domUtils.on($G("J_sacleBoard"), "click", function () { + var picBoard = $G("J_picBoard"), + scaleCon = $G("J_scaleCon"), + img = picBoard.children[0]; + + if (img) { + if (!scaleCon) { + picBoard.style.cssText = "position:relative;z-index:999;"+picBoard.style.cssText; + img.style.cssText = "position: absolute;top:" + (canvas.height - img.height) / 2 + "px;left:" + (canvas.width - img.width) / 2 + "px;"; + var scale = new ScaleBoy(); + picBoard.appendChild(scale.init()); + scale.startScale(img); + } else { + if (scaleCon.style.visibility == "visible") { + scaleCon.style.visibility = "hidden"; + picBoard.style.position = ""; + picBoard.style.zIndex = ""; + } else { + scaleCon.style.visibility = "visible"; + picBoard.style.cssText += "position:relative;z-index:999"; + } + } + } + }); + }, + _addClearSelectionListenter:function () { + var doc = document; + domUtils.on(doc, 'mousemove', function (e) { + if (browser.ie && browser.version < 11) + doc.selection.clear(); + else + window.getSelection().removeAllRanges(); + }); + }, + _clearSelection:function () { + var list = ["J_operateBar", "J_colorBar", "J_brushBar", "J_eraserBar", "J_picBoard"]; + for (var i = 0, group; group = list[i++];) { + domUtils.unSelectable($G(group)); + } + }, + + _saveOPerate:function (saveNum) { + var me = this; + if (drawStep.length <= saveNum) { + if(drawStepIndex"); + } + scale.innerHTML = arr.join(""); + return scale; + } + + var rect = [ + //[left, top, width, height] + [1, 1, -1, -1], + [0, 1, 0, -1], + [0, 1, 1, -1], + [1, 0, -1, 0], + [0, 0, 1, 0], + [1, 0, -1, 1], + [0, 0, 0, 1], + [0, 0, 1, 1] + ]; + ScaleBoy.prototype = { + init:function () { + _appendStyle(); + var me = this, + scale = me.dom = _getDom(); + + me.scaleMousemove.fp = me; + domUtils.on(scale, 'mousedown', function (e) { + var target = e.target || e.srcElement; + me.start = {x:e.clientX, y:e.clientY}; + if (target.className.indexOf('hand') != -1) { + me.dir = target.className.replace('hand', ''); + } + domUtils.on(document.body, 'mousemove', me.scaleMousemove); + e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true; + }); + domUtils.on(document.body, 'mouseup', function (e) { + if (me.start) { + domUtils.un(document.body, 'mousemove', me.scaleMousemove); + if (me.moved) { + me.updateScaledElement({position:{x:scale.style.left, y:scale.style.top}, size:{w:scale.style.width, h:scale.style.height}}); + } + delete me.start; + delete me.moved; + delete me.dir; + } + }); + return scale; + }, + startScale:function (objElement) { + var me = this, Idom = me.dom; + + Idom.style.cssText = 'visibility:visible;top:' + objElement.style.top + ';left:' + objElement.style.left + ';width:' + objElement.offsetWidth + 'px;height:' + objElement.offsetHeight + 'px;'; + me.scalingElement = objElement; + }, + updateScaledElement:function (objStyle) { + var cur = this.scalingElement, + pos = objStyle.position, + size = objStyle.size; + if (pos) { + typeof pos.x != 'undefined' && (cur.style.left = pos.x); + typeof pos.y != 'undefined' && (cur.style.top = pos.y); + } + if (size) { + size.w && (cur.style.width = size.w); + size.h && (cur.style.height = size.h); + } + }, + updateStyleByDir:function (dir, offset) { + var me = this, + dom = me.dom, tmp; + + rect['def'] = [1, 1, 0, 0]; + if (rect[dir][0] != 0) { + tmp = parseInt(dom.style.left) + offset.x; + dom.style.left = me._validScaledProp('left', tmp) + 'px'; + } + if (rect[dir][1] != 0) { + tmp = parseInt(dom.style.top) + offset.y; + dom.style.top = me._validScaledProp('top', tmp) + 'px'; + } + if (rect[dir][2] != 0) { + tmp = dom.clientWidth + rect[dir][2] * offset.x; + dom.style.width = me._validScaledProp('width', tmp) + 'px'; + } + if (rect[dir][3] != 0) { + tmp = dom.clientHeight + rect[dir][3] * offset.y; + dom.style.height = me._validScaledProp('height', tmp) + 'px'; + } + if (dir === 'def') { + me.updateScaledElement({position:{x:dom.style.left, y:dom.style.top}}); + } + }, + scaleMousemove:function (e) { + var me = arguments.callee.fp, + start = me.start, + dir = me.dir || 'def', + offset = {x:e.clientX - start.x, y:e.clientY - start.y}; + + me.updateStyleByDir(dir, offset); + arguments.callee.fp.start = {x:e.clientX, y:e.clientY}; + arguments.callee.fp.moved = 1; + }, + _validScaledProp:function (prop, value) { + var ele = this.dom, + wrap = $G("J_picBoard"); + + value = isNaN(value) ? 0 : value; + switch (prop) { + case 'left': + return value < 0 ? 0 : (value + ele.clientWidth) > wrap.clientWidth ? wrap.clientWidth - ele.clientWidth : value; + case 'top': + return value < 0 ? 0 : (value + ele.clientHeight) > wrap.clientHeight ? wrap.clientHeight - ele.clientHeight : value; + case 'width': + return value <= 0 ? 1 : (value + ele.offsetLeft) > wrap.clientWidth ? wrap.clientWidth - ele.offsetLeft : value; + case 'height': + return value <= 0 ? 1 : (value + ele.offsetTop) > wrap.clientHeight ? wrap.clientHeight - ele.offsetTop : value; + } + } + }; +})(); + +//后台回调 +function ue_callback(url, state) { + var doc = document, + picBorard = $G("J_picBoard"), + img = doc.createElement("img"); + + //图片缩放 + function scale(img, max, oWidth, oHeight) { + var width = 0, height = 0, percent, ow = img.width || oWidth, oh = img.height || oHeight; + if (ow > max || oh > max) { + if (ow >= oh) { + if (width = ow - max) { + percent = (width / ow).toFixed(2); + img.height = oh - oh * percent; + img.width = max; + } + } else { + if (height = oh - max) { + percent = (height / oh).toFixed(2); + img.width = ow - ow * percent; + img.height = max; + } + } + } + } + + //移除遮罩层 + removeMaskLayer(); + //状态响应 + if (state == "SUCCESS") { + picBorard.innerHTML = ""; + img.onload = function () { + scale(this, 300); + picBorard.appendChild(img); + + var obj = new scrawl(); + obj.btn2Highlight("J_removeImg"); + //trace 2457 + obj.btn2Highlight("J_sacleBoard"); + }; + img.src = url; + } else { + alert(state); + } +} +//去掉遮罩层 +function removeMaskLayer() { + var maskLayer = $G("J_maskLayer"); + maskLayer.className = "maskLayerNull"; + maskLayer.innerHTML = ""; + dialog.buttons[0].setDisabled(false); +} +//添加遮罩层 +function addMaskLayer(html) { + var maskLayer = $G("J_maskLayer"); + dialog.buttons[0].setDisabled(true); + maskLayer.className = "maskLayer"; + maskLayer.innerHTML = html; +} +//执行确认按钮方法 +function exec(scrawlObj) { + if (scrawlObj.isScrawl) { + addMaskLayer(lang.scrawlUpLoading); + var base64 = scrawlObj.getCanvasData(); + if (!!base64) { + var options = { + timeout:100000, + onsuccess:function (xhr) { + if (!scrawlObj.isCancelScrawl) { + var responseObj; + responseObj = eval("(" + xhr.responseText + ")"); + if (responseObj.state == "SUCCESS") { + var imgObj = {}, + url = editor.options.scrawlUrlPrefix + responseObj.url; + imgObj.src = url; + imgObj._src = url; + imgObj.alt = responseObj.original || ''; + imgObj.title = responseObj.title || ''; + editor.execCommand("insertImage", imgObj); + dialog.close(); + } else { + alert(responseObj.state); + } + + } + }, + onerror:function () { + alert(lang.imageError); + dialog.close(); + } + }; + options[editor.getOpt('scrawlFieldName')] = base64; + + var actionUrl = editor.getActionUrl(editor.getOpt('scrawlActionName')), + params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '', + url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?':'&') + params); + ajax.request(url, options); + } + } else { + addMaskLayer(lang.noScarwl + "   "); + } +} + diff --git a/public/static/Ueditor/dialogs/searchreplace/searchreplace.html b/public/static/Ueditor/dialogs/searchreplace/searchreplace.html new file mode 100644 index 0000000..b91f190 --- /dev/null +++ b/public/static/Ueditor/dialogs/searchreplace/searchreplace.html @@ -0,0 +1,102 @@ + + + + + + + + + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    :
    + +
    + + +
    +   +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    + +
    + + + + +
    +   +
    + +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/searchreplace/searchreplace.js b/public/static/Ueditor/dialogs/searchreplace/searchreplace.js new file mode 100644 index 0000000..1b52857 --- /dev/null +++ b/public/static/Ueditor/dialogs/searchreplace/searchreplace.js @@ -0,0 +1,164 @@ +/** + * Created with JetBrains PhpStorm. + * User: xuheng + * Date: 12-9-26 + * Time: 下午12:29 + * To change this template use File | Settings | File Templates. + */ + +//清空上次查选的痕迹 +editor.firstForSR = 0; +editor.currentRangeForSR = null; +//给tab注册切换事件 +/** + * tab点击处理事件 + * @param tabHeads + * @param tabBodys + * @param obj + */ +function clickHandler( tabHeads,tabBodys,obj ) { + //head样式更改 + for ( var k = 0, len = tabHeads.length; k < len; k++ ) { + tabHeads[k].className = ""; + } + obj.className = "focus"; + //body显隐 + var tabSrc = obj.getAttribute( "tabSrc" ); + for ( var j = 0, length = tabBodys.length; j < length; j++ ) { + var body = tabBodys[j], + id = body.getAttribute( "id" ); + if ( id != tabSrc ) { + body.style.zIndex = 1; + } else { + body.style.zIndex = 200; + } + } + +} + +/** + * TAB切换 + * @param tabParentId tab的父节点ID或者对象本身 + */ +function switchTab( tabParentId ) { + var tabElements = $G( tabParentId ).children, + tabHeads = tabElements[0].children, + tabBodys = tabElements[1].children; + + for ( var i = 0, length = tabHeads.length; i < length; i++ ) { + var head = tabHeads[i]; + if ( head.className === "focus" )clickHandler(tabHeads,tabBodys, head ); + head.onclick = function () { + clickHandler(tabHeads,tabBodys,this); + } + } +} +$G('searchtab').onmousedown = function(){ + $G('search-msg').innerHTML = ''; + $G('replace-msg').innerHTML = '' +} +//是否区分大小写 +function getMatchCase(id) { + return $G(id).checked ? true : false; +} +//查找 +$G("nextFindBtn").onclick = function (txt, dir, mcase) { + var findtxt = $G("findtxt").value, obj; + if (!findtxt) { + return false; + } + obj = { + searchStr:findtxt, + dir:1, + casesensitive:getMatchCase("matchCase") + }; + if (!frCommond(obj)) { + var bk = editor.selection.getRange().createBookmark(); + $G('search-msg').innerHTML = lang.getEnd; + editor.selection.getRange().moveToBookmark(bk).select(); + + + } +}; +$G("nextReplaceBtn").onclick = function (txt, dir, mcase) { + var findtxt = $G("findtxt1").value, obj; + if (!findtxt) { + return false; + } + obj = { + searchStr:findtxt, + dir:1, + casesensitive:getMatchCase("matchCase1") + }; + frCommond(obj); +}; +$G("preFindBtn").onclick = function (txt, dir, mcase) { + var findtxt = $G("findtxt").value, obj; + if (!findtxt) { + return false; + } + obj = { + searchStr:findtxt, + dir:-1, + casesensitive:getMatchCase("matchCase") + }; + if (!frCommond(obj)) { + $G('search-msg').innerHTML = lang.getStart; + } +}; +$G("preReplaceBtn").onclick = function (txt, dir, mcase) { + var findtxt = $G("findtxt1").value, obj; + if (!findtxt) { + return false; + } + obj = { + searchStr:findtxt, + dir:-1, + casesensitive:getMatchCase("matchCase1") + }; + frCommond(obj); +}; +//替换 +$G("repalceBtn").onclick = function () { + var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj, + replacetxt = $G("replacetxt").value.replace(/^\s|\s$/g, ""); + if (!findtxt) { + return false; + } + if (findtxt == replacetxt || (!getMatchCase("matchCase1") && findtxt.toLowerCase() == replacetxt.toLowerCase())) { + return false; + } + obj = { + searchStr:findtxt, + dir:1, + casesensitive:getMatchCase("matchCase1"), + replaceStr:replacetxt + }; + frCommond(obj); +}; +//全部替换 +$G("repalceAllBtn").onclick = function () { + var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj, + replacetxt = $G("replacetxt").value.replace(/^\s|\s$/g, ""); + if (!findtxt) { + return false; + } + if (findtxt == replacetxt || (!getMatchCase("matchCase1") && findtxt.toLowerCase() == replacetxt.toLowerCase())) { + return false; + } + obj = { + searchStr:findtxt, + casesensitive:getMatchCase("matchCase1"), + replaceStr:replacetxt, + all:true + }; + var num = frCommond(obj); + if (num) { + $G('replace-msg').innerHTML = lang.countMsg.replace("{#count}", num); + } +}; +//执行 +var frCommond = function (obj) { + return editor.execCommand("searchreplace", obj); +}; +switchTab("searchtab"); \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/snapscreen/snapscreen.html b/public/static/Ueditor/dialogs/snapscreen/snapscreen.html new file mode 100644 index 0000000..cf8209e --- /dev/null +++ b/public/static/Ueditor/dialogs/snapscreen/snapscreen.html @@ -0,0 +1,58 @@ + + + + + + + + + +
    +

    +
    +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/spechars/spechars.html b/public/static/Ueditor/dialogs/spechars/spechars.html new file mode 100644 index 0000000..0b5c416 --- /dev/null +++ b/public/static/Ueditor/dialogs/spechars/spechars.html @@ -0,0 +1,21 @@ + + + + + + + + + +
    +
    +
    + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/spechars/spechars.js b/public/static/Ueditor/dialogs/spechars/spechars.js new file mode 100644 index 0000000..f4c155e --- /dev/null +++ b/public/static/Ueditor/dialogs/spechars/spechars.js @@ -0,0 +1,57 @@ +/** + * Created with JetBrains PhpStorm. + * User: xuheng + * Date: 12-9-26 + * Time: 下午1:09 + * To change this template use File | Settings | File Templates. + */ +var charsContent = [ + { name:"tsfh", title:lang.tsfh, content:toArray("、,。,·,ˉ,ˇ,¨,〃,々,—,~,‖,…,‘,’,“,”,〔,〕,〈,〉,《,》,「,」,『,』,〖,〗,【,】,±,×,÷,∶,∧,∨,∑,∏,∪,∩,∈,∷,√,⊥,∥,∠,⌒,⊙,∫,∮,≡,≌,≈,∽,∝,≠,≮,≯,≤,≥,∞,∵,∴,♂,♀,°,′,″,℃,$,¤,¢,£,‰,§,№,☆,★,○,●,◎,◇,◆,□,■,△,▲,※,→,←,↑,↓,〓,〡,〢,〣,〤,〥,〦,〧,〨,〩,㊣,㎎,㎏,㎜,㎝,㎞,㎡,㏄,㏎,㏑,㏒,㏕,︰,¬,¦,℡,ˊ,ˋ,˙,–,―,‥,‵,℅,℉,↖,↗,↘,↙,∕,∟,∣,≒,≦,≧,⊿,═,║,╒,╓,╔,╕,╖,╗,╘,╙,╚,╛,╜,╝,╞,╟,╠,╡,╢,╣,╤,╥,╦,╧,╨,╩,╪,╫,╬,╭,╮,╯,╰,╱,╲,╳,▁,▂,▃,▄,▅,▆,▇,�,█,▉,▊,▋,▌,▍,▎,▏,▓,▔,▕,▼,▽,◢,◣,◤,◥,☉,⊕,〒,〝,〞")}, + { name:"lmsz", title:lang.lmsz, content:toArray("ⅰ,ⅱ,ⅲ,ⅳ,ⅴ,ⅵ,ⅶ,ⅷ,ⅸ,ⅹ,Ⅰ,Ⅱ,Ⅲ,Ⅳ,Ⅴ,Ⅵ,Ⅶ,Ⅷ,Ⅸ,Ⅹ,Ⅺ,Ⅻ")}, + { name:"szfh", title:lang.szfh, content:toArray("⒈,⒉,⒊,⒋,⒌,⒍,⒎,⒏,⒐,⒑,⒒,⒓,⒔,⒕,⒖,⒗,⒘,⒙,⒚,⒛,⑴,⑵,⑶,⑷,⑸,⑹,⑺,⑻,⑼,⑽,⑾,⑿,⒀,⒁,⒂,⒃,⒄,⒅,⒆,⒇,①,②,③,④,⑤,⑥,⑦,⑧,⑨,⑩,㈠,㈡,㈢,㈣,㈤,㈥,㈦,㈧,㈨,㈩")}, + { name:"rwfh", title:lang.rwfh, content:toArray("ぁ,あ,ぃ,い,ぅ,う,ぇ,え,ぉ,お,か,が,き,ぎ,く,ぐ,け,げ,こ,ご,さ,ざ,し,じ,す,ず,せ,ぜ,そ,ぞ,た,だ,ち,ぢ,っ,つ,づ,て,で,と,ど,な,に,ぬ,ね,の,は,ば,ぱ,ひ,び,ぴ,ふ,ぶ,ぷ,へ,べ,ぺ,ほ,ぼ,ぽ,ま,み,む,め,も,ゃ,や,ゅ,ゆ,ょ,よ,ら,り,る,れ,ろ,ゎ,わ,ゐ,ゑ,を,ん,ァ,ア,ィ,イ,ゥ,ウ,ェ,エ,ォ,オ,カ,ガ,キ,ギ,ク,グ,ケ,ゲ,コ,ゴ,サ,ザ,シ,ジ,ス,ズ,セ,ゼ,ソ,ゾ,タ,ダ,チ,ヂ,ッ,ツ,ヅ,テ,デ,ト,ド,ナ,ニ,ヌ,ネ,ノ,ハ,バ,パ,ヒ,ビ,ピ,フ,ブ,プ,ヘ,ベ,ペ,ホ,ボ,ポ,マ,ミ,ム,メ,モ,ャ,ヤ,ュ,ユ,ョ,ヨ,ラ,リ,ル,レ,ロ,ヮ,ワ,ヰ,ヱ,ヲ,ン,ヴ,ヵ,ヶ")}, + { name:"xlzm", title:lang.xlzm, content:toArray("Α,Β,Γ,Δ,Ε,Ζ,Η,Θ,Ι,Κ,Λ,Μ,Ν,Ξ,Ο,Π,Ρ,Σ,Τ,Υ,Φ,Χ,Ψ,Ω,α,β,γ,δ,ε,ζ,η,θ,ι,κ,λ,μ,ν,ξ,ο,π,ρ,σ,τ,υ,φ,χ,ψ,ω")}, + { name:"ewzm", title:lang.ewzm, content:toArray("А,Б,В,Г,Д,Е,Ё,Ж,З,И,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Ъ,Ы,Ь,Э,Ю,Я,а,б,в,г,д,е,ё,ж,з,и,й,к,л,м,н,о,п,р,с,т,у,ф,х,ц,ч,ш,щ,ъ,ы,ь,э,ю,я")}, + { name:"pyzm", title:lang.pyzm, content:toArray("ā,á,ǎ,à,ē,é,ě,è,ī,í,ǐ,ì,ō,ó,ǒ,ò,ū,ú,ǔ,ù,ǖ,ǘ,ǚ,ǜ,ü")}, + { name:"yyyb", title:lang.yyyb, content:toArray("i:,i,e,æ,ʌ,ə:,ə,u:,u,ɔ:,ɔ,a:,ei,ai,ɔi,əu,au,iə,εə,uə,p,t,k,b,d,g,f,s,ʃ,θ,h,v,z,ʒ,ð,tʃ,tr,ts,dʒ,dr,dz,m,n,ŋ,l,r,w,j,")}, + { name:"zyzf", title:lang.zyzf, content:toArray("ㄅ,ㄆ,ㄇ,ㄈ,ㄉ,ㄊ,ㄋ,ㄌ,ㄍ,ㄎ,ㄏ,ㄐ,ㄑ,ㄒ,ㄓ,ㄔ,ㄕ,ㄖ,ㄗ,ㄘ,ㄙ,ㄚ,ㄛ,ㄜ,ㄝ,ㄞ,ㄟ,ㄠ,ㄡ,ㄢ,ㄣ,ㄤ,ㄥ,ㄦ,ㄧ,ㄨ")} +]; +(function createTab(content) { + for (var i = 0, ci; ci = content[i++];) { + var span = document.createElement("span"); + span.setAttribute("tabSrc", ci.name); + span.innerHTML = ci.title; + if (i == 1)span.className = "focus"; + domUtils.on(span, "click", function () { + var tmps = $G("tabHeads").children; + for (var k = 0, sk; sk = tmps[k++];) { + sk.className = ""; + } + tmps = $G("tabBodys").children; + for (var k = 0, sk; sk = tmps[k++];) { + sk.style.display = "none"; + } + this.className = "focus"; + $G(this.getAttribute("tabSrc")).style.display = ""; + }); + $G("tabHeads").appendChild(span); + domUtils.insertAfter(span, document.createTextNode("\n")); + var div = document.createElement("div"); + div.id = ci.name; + div.style.display = (i == 1) ? "" : "none"; + var cons = ci.content; + for (var j = 0, con; con = cons[j++];) { + var charSpan = document.createElement("span"); + charSpan.innerHTML = con; + domUtils.on(charSpan, "click", function () { + editor.execCommand("insertHTML", this.innerHTML); + dialog.close(); + }); + div.appendChild(charSpan); + } + $G("tabBodys").appendChild(div); + } +})(charsContent); +function toArray(str) { + return str.split(","); +} diff --git a/public/static/Ueditor/dialogs/table/dragicon.png b/public/static/Ueditor/dialogs/table/dragicon.png new file mode 100644 index 0000000..f26203b Binary files /dev/null and b/public/static/Ueditor/dialogs/table/dragicon.png differ diff --git a/public/static/Ueditor/dialogs/table/edittable.css b/public/static/Ueditor/dialogs/table/edittable.css new file mode 100644 index 0000000..c6f9396 --- /dev/null +++ b/public/static/Ueditor/dialogs/table/edittable.css @@ -0,0 +1,84 @@ +body{ + overflow: hidden; + width: 540px; +} +.wrapper { + margin: 10px auto 0; + font-size: 12px; + overflow: hidden; + width: 520px; + height: 315px; +} + +.clear { + clear: both; +} + +.wrapper .left { + float: left; + margin-left: 10px;; +} + +.wrapper .right { + float: right; + border-left: 2px dotted #EDEDED; + padding-left: 15px; +} + +.section { + margin-bottom: 15px; + width: 240px; + overflow: hidden; +} + +.section h3 { + font-weight: bold; + padding: 5px 0; + margin-bottom: 10px; + border-bottom: 1px solid #EDEDED; + font-size: 12px; +} + +.section ul { + list-style: none; + overflow: hidden; + clear: both; + +} + +.section li { + float: left; + width: 120px;; +} + +.section .tone { + width: 80px;; +} + +.section .preview { + width: 220px; +} + +.section .preview table { + text-align: center; + vertical-align: middle; + color: #666; +} + +.section .preview caption { + font-weight: bold; +} + +.section .preview td { + border-width: 1px; + border-style: solid; + height: 22px; +} + +.section .preview th { + border-style: solid; + border-color: #DDD; + border-width: 2px 1px 1px 1px; + height: 22px; + background-color: #F7F7F7; +} \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/table/edittable.html b/public/static/Ueditor/dialogs/table/edittable.html new file mode 100644 index 0000000..3c412fb --- /dev/null +++ b/public/static/Ueditor/dialogs/table/edittable.html @@ -0,0 +1,64 @@ + + + + + + + + +
    +
    +
    +

    +
      +
    • + +
    • +
    • + +
    • +
    +
      +
    • + +
    • +
    • + +
    • +
    +
    +
    +
    +

    +
      +
    • + +
    • +
    • + +
    • +
    +
    +
    +
    +

    +
      +
    • + + +
    • +
    +
    +
    +
    +
    +
    +

    +
    +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/table/edittable.js b/public/static/Ueditor/dialogs/table/edittable.js new file mode 100644 index 0000000..11dbee7 --- /dev/null +++ b/public/static/Ueditor/dialogs/table/edittable.js @@ -0,0 +1,237 @@ +/** + * Created with JetBrains PhpStorm. + * User: xuheng + * Date: 12-12-19 + * Time: 下午4:55 + * To change this template use File | Settings | File Templates. + */ +(function () { + var title = $G("J_title"), + titleCol = $G("J_titleCol"), + caption = $G("J_caption"), + sorttable = $G("J_sorttable"), + autoSizeContent = $G("J_autoSizeContent"), + autoSizePage = $G("J_autoSizePage"), + tone = $G("J_tone"), + me, + preview = $G("J_preview"); + + var editTable = function () { + me = this; + me.init(); + }; + editTable.prototype = { + init:function () { + var colorPiker = new UE.ui.ColorPicker({ + editor:editor + }), + colorPop = new UE.ui.Popup({ + editor:editor, + content:colorPiker + }); + + title.checked = editor.queryCommandState("inserttitle") == -1; + titleCol.checked = editor.queryCommandState("inserttitlecol") == -1; + caption.checked = editor.queryCommandState("insertcaption") == -1; + sorttable.checked = editor.queryCommandState("enablesort") == 1; + + var enablesortState = editor.queryCommandState("enablesort"), + disablesortState = editor.queryCommandState("disablesort"); + + sorttable.checked = !!(enablesortState < 0 && disablesortState >=0); + sorttable.disabled = !!(enablesortState < 0 && disablesortState < 0); + sorttable.title = enablesortState < 0 && disablesortState < 0 ? lang.errorMsg:''; + + me.createTable(title.checked, titleCol.checked, caption.checked); + me.setAutoSize(); + me.setColor(me.getColor()); + + domUtils.on(title, "click", me.titleHanler); + domUtils.on(titleCol, "click", me.titleColHanler); + domUtils.on(caption, "click", me.captionHanler); + domUtils.on(sorttable, "click", me.sorttableHanler); + domUtils.on(autoSizeContent, "click", me.autoSizeContentHanler); + domUtils.on(autoSizePage, "click", me.autoSizePageHanler); + + domUtils.on(tone, "click", function () { + colorPop.showAnchor(tone); + }); + domUtils.on(document, 'mousedown', function () { + colorPop.hide(); + }); + colorPiker.addListener("pickcolor", function () { + me.setColor(arguments[1]); + colorPop.hide(); + }); + colorPiker.addListener("picknocolor", function () { + me.setColor(""); + colorPop.hide(); + }); + }, + + createTable:function (hasTitle, hasTitleCol, hasCaption) { + var arr = [], + sortSpan = '^'; + arr.push(""); + if (hasCaption) { + arr.push("") + } + if (hasTitle) { + arr.push(""); + if(hasTitleCol) { arr.push(""); } + for (var j = 0; j < 5; j++) { + arr.push(""); + } + arr.push(""); + } + for (var i = 0; i < 6; i++) { + arr.push(""); + if(hasTitleCol) { arr.push("") } + for (var k = 0; k < 5; k++) { + arr.push("") + } + arr.push(""); + } + arr.push("
    " + lang.captionName + "
    " + lang.titleName + "" + lang.titleName + "
    " + lang.titleName + "" + lang.cellsName + "
    "); + preview.innerHTML = arr.join(""); + this.updateSortSpan(); + }, + titleHanler:function () { + var example = $G("J_example"), + frg=document.createDocumentFragment(), + color = domUtils.getComputedStyle(domUtils.getElementsByTagName(example, "td")[0], "border-color"), + colCount = example.rows[0].children.length; + + if (title.checked) { + example.insertRow(0); + for (var i = 0, node; i < colCount; i++) { + node = document.createElement("th"); + node.innerHTML = lang.titleName; + frg.appendChild(node); + } + example.rows[0].appendChild(frg); + + } else { + domUtils.remove(example.rows[0]); + } + me.setColor(color); + me.updateSortSpan(); + }, + titleColHanler:function () { + var example = $G("J_example"), + color = domUtils.getComputedStyle(domUtils.getElementsByTagName(example, "td")[0], "border-color"), + colArr = example.rows, + colCount = colArr.length; + + if (titleCol.checked) { + for (var i = 0, node; i < colCount; i++) { + node = document.createElement("th"); + node.innerHTML = lang.titleName; + colArr[i].insertBefore(node, colArr[i].children[0]); + } + } else { + for (var i = 0; i < colCount; i++) { + domUtils.remove(colArr[i].children[0]); + } + } + me.setColor(color); + me.updateSortSpan(); + }, + captionHanler:function () { + var example = $G("J_example"); + if (caption.checked) { + var row = document.createElement('caption'); + row.innerHTML = lang.captionName; + example.insertBefore(row, example.firstChild); + } else { + domUtils.remove(domUtils.getElementsByTagName(example, 'caption')[0]); + } + }, + sorttableHanler:function(){ + me.updateSortSpan(); + }, + autoSizeContentHanler:function () { + var example = $G("J_example"); + example.removeAttribute("width"); + }, + autoSizePageHanler:function () { + var example = $G("J_example"); + var tds = example.getElementsByTagName(example, "td"); + utils.each(tds, function (td) { + td.removeAttribute("width"); + }); + example.setAttribute('width', '100%'); + }, + updateSortSpan: function(){ + var example = $G("J_example"), + row = example.rows[0]; + + var spans = domUtils.getElementsByTagName(example,"span"); + utils.each(spans,function(span){ + span.parentNode.removeChild(span); + }); + if (sorttable.checked) { + utils.each(row.cells, function(cell, i){ + var span = document.createElement("span"); + span.innerHTML = "^"; + cell.appendChild(span); + }); + } + }, + getColor:function () { + var start = editor.selection.getStart(), color, + cell = domUtils.findParentByTagName(start, ["td", "th", "caption"], true); + color = cell && domUtils.getComputedStyle(cell, "border-color"); + if (!color) color = "#DDDDDD"; + return color; + }, + setColor:function (color) { + var example = $G("J_example"), + arr = domUtils.getElementsByTagName(example, "td").concat( + domUtils.getElementsByTagName(example, "th"), + domUtils.getElementsByTagName(example, "caption") + ); + + tone.value = color; + utils.each(arr, function (node) { + node.style.borderColor = color; + }); + + }, + setAutoSize:function () { + var me = this; + autoSizePage.checked = true; + me.autoSizePageHanler(); + } + }; + + new editTable; + + dialog.onok = function () { + editor.__hasEnterExecCommand = true; + + var checks = { + title:"inserttitle deletetitle", + titleCol:"inserttitlecol deletetitlecol", + caption:"insertcaption deletecaption", + sorttable:"enablesort disablesort" + }; + editor.fireEvent('saveScene'); + for(var i in checks){ + var cmds = checks[i].split(" "), + input = $G("J_" + i); + if(input["checked"]){ + editor.queryCommandState(cmds[0])!=-1 &&editor.execCommand(cmds[0]); + }else{ + editor.queryCommandState(cmds[1])!=-1 &&editor.execCommand(cmds[1]); + } + } + + editor.execCommand("edittable", tone.value); + autoSizeContent.checked ?editor.execCommand('adaptbytext') : ""; + autoSizePage.checked ? editor.execCommand("adaptbywindow") : ""; + editor.fireEvent('saveScene'); + + editor.__hasEnterExecCommand = false; + }; +})(); \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/table/edittd.html b/public/static/Ueditor/dialogs/table/edittd.html new file mode 100644 index 0000000..49a52f7 --- /dev/null +++ b/public/static/Ueditor/dialogs/table/edittd.html @@ -0,0 +1,61 @@ + + + + + + + + +
    + + +
    + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/table/edittip.html b/public/static/Ueditor/dialogs/table/edittip.html new file mode 100644 index 0000000..954f7bb --- /dev/null +++ b/public/static/Ueditor/dialogs/table/edittip.html @@ -0,0 +1,33 @@ + + + + 表格删除提示 + + + + +
    +
    + +
    +
    + +
    +
    + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/template/config.js b/public/static/Ueditor/dialogs/template/config.js new file mode 100644 index 0000000..417b8f7 --- /dev/null +++ b/public/static/Ueditor/dialogs/template/config.js @@ -0,0 +1,42 @@ +/** + * Created with JetBrains PhpStorm. + * User: xuheng + * Date: 12-8-8 + * Time: 下午2:00 + * To change this template use File | Settings | File Templates. + */ +var templates = [ + { + "pre":"pre0.png", + 'title':lang.blank, + 'preHtml':'

     欢迎使用UEditor!

    ', + "html":'

    欢迎使用UEditor!

    ' + + }, + { + "pre":"pre1.png", + 'title':lang.blog, + 'preHtml':'

    深入理解Range

    UEditor二次开发

    什么是Range

    对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。


    Range能干什么

    在“开始”选项卡上,通过从快速样式库中为所选文本选择一种外观,您可以方便地更改文档中所选文本的格式。

    ', + "html":'

    [键入文档标题]

    [键入文档副标题]

    [标题 1]

    对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。 您可以使用这些库来插入表格、页眉、页脚、列表、封面以及其他文档构建基块。 您创建的图片、图表或关系图也将与当前的文档外观协调一致。

    [标题 2]

    在“开始”选项卡上,通过从快速样式库中为所选文本选择一种外观,您可以方便地更改文档中所选文本的格式。 您还可以使用“开始”选项卡上的其他控件来直接设置文本格式。大多数控件都允许您选择是使用当前主题外观,还是使用某种直接指定的格式。

    [标题 3]

    对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。 您可以使用这些库来插入表格、页眉、页脚、列表、封面以及其他文档构建基块。 您创建的图片、图表或关系图也将与当前的文档外观协调一致。


    ' + + }, + { + "pre":"pre2.png", + 'title':lang.resume, + 'preHtml':'

    WEB前端开发简历


    联系电话:[键入您的电话]

    电子邮件:[键入您的电子邮件地址]

    家庭住址:[键入您的地址]

    目标职位

    WEB前端研发工程师

    学历

    1. [起止时间] [学校名称] [所学专业] [所获学位]

    工作经验


    ', + "html":'

    [此处键入简历标题]


    【此处插入照片】


    联系电话:[键入您的电话]


    电子邮件:[键入您的电子邮件地址]


    家庭住址:[键入您的地址]


    目标职位

    [此处键入您的期望职位]

    学历

    1. [键入起止时间] [键入学校名称] [键入所学专业] [键入所获学位]

    2. [键入起止时间] [键入学校名称] [键入所学专业] [键入所获学位]

    工作经验

    1. [键入起止时间] [键入公司名称] [键入职位名称]

      1. [键入负责项目] [键入项目简介]

      2. [键入负责项目] [键入项目简介]

    2. [键入起止时间] [键入公司名称] [键入职位名称]

      1. [键入负责项目] [键入项目简介]

    掌握技能

     [这里可以键入您所掌握的技能]

    ' + + }, + { + "pre":"pre3.png", + 'title':lang.richText, + 'preHtml':'

    [此处键入文章标题]

    图文混排方法

    图片居左,文字围绕图片排版

    方法:在文字前面插入图片,设置居左对齐,然后即可在右边输入多行文


    还有没有什么其他的环绕方式呢?这里是居右环绕


    欢迎大家多多尝试,为UEditor提供更多高质量模板!

    ', + "html":'


    [此处键入文章标题]

    图文混排方法

    1. 图片居左,文字围绕图片排版

    方法:在文字前面插入图片,设置居左对齐,然后即可在右边输入多行文本


    2. 图片居右,文字围绕图片排版

    方法:在文字前面插入图片,设置居右对齐,然后即可在左边输入多行文本


    3. 图片居中环绕排版

    方法:亲,这个真心没有办法。。。



    还有没有什么其他的环绕方式呢?这里是居右环绕


    欢迎大家多多尝试,为UEditor提供更多高质量模板!


    占位


    占位


    占位


    占位


    占位



    ' + }, + { + "pre":"pre4.png", + 'title':lang.sciPapers, + 'preHtml':'

    [键入文章标题]

    摘要:这里可以输入很长很长很长很长很长很长很长很长很差的摘要

    标题 1

    这里可以输入很多内容,可以图文混排,可以有列表等。

    标题 2

    1. 列表 1

    2. 列表 2

      1. 多级列表 1

      2. 多级列表 2

    3. 列表 3

    标题 3

    来个文字图文混排的


    ', + 'html':'

    [键入文章标题]

    摘要:这里可以输入很长很长很长很长很长很长很长很长很差的摘要

    标题 1

    这里可以输入很多内容,可以图文混排,可以有列表等。

    标题 2

    来个列表瞅瞅:

    1. 列表 1

    2. 列表 2

      1. 多级列表 1

      2. 多级列表 2

    3. 列表 3

    标题 3

    来个文字图文混排的

    这里可以多行

    右边是图片

    绝对没有问题的,不信你也可以试试看


    ' + } +]; \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/template/images/bg.gif b/public/static/Ueditor/dialogs/template/images/bg.gif new file mode 100644 index 0000000..8c1d10a Binary files /dev/null and b/public/static/Ueditor/dialogs/template/images/bg.gif differ diff --git a/public/static/Ueditor/dialogs/template/images/pre0.png b/public/static/Ueditor/dialogs/template/images/pre0.png new file mode 100644 index 0000000..8f3c16a Binary files /dev/null and b/public/static/Ueditor/dialogs/template/images/pre0.png differ diff --git a/public/static/Ueditor/dialogs/template/images/pre1.png b/public/static/Ueditor/dialogs/template/images/pre1.png new file mode 100644 index 0000000..5a03f96 Binary files /dev/null and b/public/static/Ueditor/dialogs/template/images/pre1.png differ diff --git a/public/static/Ueditor/dialogs/template/images/pre2.png b/public/static/Ueditor/dialogs/template/images/pre2.png new file mode 100644 index 0000000..5a55672 Binary files /dev/null and b/public/static/Ueditor/dialogs/template/images/pre2.png differ diff --git a/public/static/Ueditor/dialogs/template/images/pre3.png b/public/static/Ueditor/dialogs/template/images/pre3.png new file mode 100644 index 0000000..d852d29 Binary files /dev/null and b/public/static/Ueditor/dialogs/template/images/pre3.png differ diff --git a/public/static/Ueditor/dialogs/template/images/pre4.png b/public/static/Ueditor/dialogs/template/images/pre4.png new file mode 100644 index 0000000..0d7bc72 Binary files /dev/null and b/public/static/Ueditor/dialogs/template/images/pre4.png differ diff --git a/public/static/Ueditor/dialogs/template/template.css b/public/static/Ueditor/dialogs/template/template.css new file mode 100644 index 0000000..6c1608d --- /dev/null +++ b/public/static/Ueditor/dialogs/template/template.css @@ -0,0 +1,18 @@ +.wrap{ padding: 5px;font-size: 14px;} +.left{width:425px;float: left;} +.right{width:160px;border: 1px solid #ccc;float: right;padding: 5px;margin-right: 5px;} +.right .pre{height: 332px;overflow-y: auto;} +.right .preitem{border: white 1px solid;margin: 5px 0;padding: 2px 0;} +.right .preitem:hover{background-color: lemonChiffon;cursor: pointer;border: #ccc 1px solid;} +.right .preitem img{display: block;margin: 0 auto;width:100px;} +.clear{clear: both;} +.top{height:26px;line-height: 26px;padding: 5px;} +.bottom{height:320px;width:100%;margin: 0 auto;} +.transparent{ background: url("images/bg.gif") repeat;} +.bottom table tr td{border:1px dashed #ccc;} +#colorPicker{width: 17px;height: 17px;border: 1px solid #CCC;display: inline-block;border-radius: 3px;box-shadow: 2px 2px 5px #D3D6DA;} +.border_style1{padding:2px;border: 1px solid #ccc;border-radius: 5px;box-shadow:2px 2px 5px #d3d6da;} +p{margin: 5px 0} +table{clear:both;margin-bottom:10px;border-collapse:collapse;word-break:break-all;} +li{clear:both} +ol{padding-left:40px; } \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/template/template.html b/public/static/Ueditor/dialogs/template/template.html new file mode 100644 index 0000000..d9903a4 --- /dev/null +++ b/public/static/Ueditor/dialogs/template/template.html @@ -0,0 +1,26 @@ + + + + + + + + + +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + + + + diff --git a/public/static/Ueditor/dialogs/template/template.js b/public/static/Ueditor/dialogs/template/template.js new file mode 100644 index 0000000..80a334b --- /dev/null +++ b/public/static/Ueditor/dialogs/template/template.js @@ -0,0 +1,53 @@ +/** + * Created with JetBrains PhpStorm. + * User: xuheng + * Date: 12-8-8 + * Time: 下午2:09 + * To change this template use File | Settings | File Templates. + */ +(function () { + var me = editor, + preview = $G( "preview" ), + preitem = $G( "preitem" ), + tmps = templates, + currentTmp; + var initPre = function () { + var str = ""; + for ( var i = 0, tmp; tmp = tmps[i++]; ) { + str += '
    '; + } + preitem.innerHTML = str; + }; + var pre = function ( n ) { + var tmp = tmps[n - 1]; + currentTmp = tmp; + clearItem(); + domUtils.setStyles( preitem.childNodes[n - 1], { + "background-color":"lemonChiffon", + "border":"#ccc 1px solid" + } ); + preview.innerHTML = tmp.preHtml ? tmp.preHtml : ""; + }; + var clearItem = function () { + var items = preitem.children; + for ( var i = 0, item; item = items[i++]; ) { + domUtils.setStyles( item, { + "background-color":"", + "border":"white 1px solid" + } ); + } + }; + dialog.onok = function () { + if ( !$G( "issave" ).checked ){ + me.execCommand( "cleardoc" ); + } + var obj = { + html:currentTmp && currentTmp.html + }; + me.execCommand( "template", obj ); + }; + initPre(); + window.pre = pre; + pre(2) + +})(); \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/video/images/bg.png b/public/static/Ueditor/dialogs/video/images/bg.png new file mode 100644 index 0000000..580be0a Binary files /dev/null and b/public/static/Ueditor/dialogs/video/images/bg.png differ diff --git a/public/static/Ueditor/dialogs/video/images/center_focus.jpg b/public/static/Ueditor/dialogs/video/images/center_focus.jpg new file mode 100644 index 0000000..262b029 Binary files /dev/null and b/public/static/Ueditor/dialogs/video/images/center_focus.jpg differ diff --git a/public/static/Ueditor/dialogs/video/images/file-icons.gif b/public/static/Ueditor/dialogs/video/images/file-icons.gif new file mode 100644 index 0000000..d8c02c2 Binary files /dev/null and b/public/static/Ueditor/dialogs/video/images/file-icons.gif differ diff --git a/public/static/Ueditor/dialogs/video/images/file-icons.png b/public/static/Ueditor/dialogs/video/images/file-icons.png new file mode 100644 index 0000000..3ff82c8 Binary files /dev/null and b/public/static/Ueditor/dialogs/video/images/file-icons.png differ diff --git a/public/static/Ueditor/dialogs/video/images/icons.gif b/public/static/Ueditor/dialogs/video/images/icons.gif new file mode 100644 index 0000000..78459de Binary files /dev/null and b/public/static/Ueditor/dialogs/video/images/icons.gif differ diff --git a/public/static/Ueditor/dialogs/video/images/icons.png b/public/static/Ueditor/dialogs/video/images/icons.png new file mode 100644 index 0000000..12e4700 Binary files /dev/null and b/public/static/Ueditor/dialogs/video/images/icons.png differ diff --git a/public/static/Ueditor/dialogs/video/images/image.png b/public/static/Ueditor/dialogs/video/images/image.png new file mode 100644 index 0000000..19699f6 Binary files /dev/null and b/public/static/Ueditor/dialogs/video/images/image.png differ diff --git a/public/static/Ueditor/dialogs/video/images/left_focus.jpg b/public/static/Ueditor/dialogs/video/images/left_focus.jpg new file mode 100644 index 0000000..7886d27 Binary files /dev/null and b/public/static/Ueditor/dialogs/video/images/left_focus.jpg differ diff --git a/public/static/Ueditor/dialogs/video/images/none_focus.jpg b/public/static/Ueditor/dialogs/video/images/none_focus.jpg new file mode 100644 index 0000000..7c768dc Binary files /dev/null and b/public/static/Ueditor/dialogs/video/images/none_focus.jpg differ diff --git a/public/static/Ueditor/dialogs/video/images/progress.png b/public/static/Ueditor/dialogs/video/images/progress.png new file mode 100644 index 0000000..717c486 Binary files /dev/null and b/public/static/Ueditor/dialogs/video/images/progress.png differ diff --git a/public/static/Ueditor/dialogs/video/images/right_focus.jpg b/public/static/Ueditor/dialogs/video/images/right_focus.jpg new file mode 100644 index 0000000..173e10d Binary files /dev/null and b/public/static/Ueditor/dialogs/video/images/right_focus.jpg differ diff --git a/public/static/Ueditor/dialogs/video/images/success.gif b/public/static/Ueditor/dialogs/video/images/success.gif new file mode 100644 index 0000000..8d4f311 Binary files /dev/null and b/public/static/Ueditor/dialogs/video/images/success.gif differ diff --git a/public/static/Ueditor/dialogs/video/images/success.png b/public/static/Ueditor/dialogs/video/images/success.png new file mode 100644 index 0000000..94f968d Binary files /dev/null and b/public/static/Ueditor/dialogs/video/images/success.png differ diff --git a/public/static/Ueditor/dialogs/video/video.css b/public/static/Ueditor/dialogs/video/video.css new file mode 100644 index 0000000..5870e7a --- /dev/null +++ b/public/static/Ueditor/dialogs/video/video.css @@ -0,0 +1,635 @@ +@charset "utf-8"; +.wrapper{ width: 570px;_width:575px;margin: 10px auto; zoom:1;position: relative} +.tabbody{height: 335px;} +.tabbody .panel { + position: absolute; + width: 0; + height: 0; + background: #fff; + overflow: hidden; + display: none; +} +.tabbody .panel.focus { + width: 100%; + height: 335px; + display: block; +} + +.tabbody .panel table td{vertical-align: middle;} +#videoUrl { + width: 490px; + height: 21px; + line-height: 21px; + margin: 8px 5px; + background: #FFF; + border: 1px solid #d7d7d7; +} +#videoSearchTxt{margin-left:15px;background: #FFF;width:200px;height:21px;line-height:21px;border: 1px solid #d7d7d7;} +#searchList{width: 570px;overflow: auto;zoom:1;height: 270px;} +#searchList div{float: left;width: 120px;height: 135px;margin: 5px 15px;} +#searchList img{margin: 2px 8px;cursor: pointer;border: 2px solid #fff} /*不用缩略图*/ +#searchList p{margin-left: 10px;} +#videoType{ + width: 65px; + height: 23px; + line-height: 22px; + border: 1px solid #d7d7d7; +} +#videoSearchBtn,#videoSearchReset{ + /*width: 80px;*/ + height: 25px; + line-height: 25px; + background: #eee; + border: 1px solid #d7d7d7; + cursor: pointer; + padding: 0 5px; +} + + + +#preview{position: relative;width: 420px;padding:0;overflow: hidden; margin-left: 10px; _margin-left:5px; height: 280px;background-color: #ddd;float: left} +#preview .previewMsg {position:absolute;top:0;margin:0;padding:0;height:280px;width:100%;background-color: #666;} +#preview .previewMsg span{display:block;margin: 125px auto 0 auto;text-align:center;font-size:18px;color:#fff;} +#preview .previewVideo {position:absolute;top:0;margin:0;padding:0;height:280px;width:100%;} +.edui-video-wrapper fieldset{ + border: 1px solid #ddd; + padding-left: 5px; + margin-bottom: 20px; + padding-bottom: 5px; + width: 115px; +} + +#videoInfo {width: 120px;float: left;margin-left: 10px;_margin-left:7px;} +fieldset{ + border: 1px solid #ddd; + padding-left: 5px; + margin-bottom: 20px; + padding-bottom: 5px; + width: 115px; +} +fieldset legend{font-weight: bold;} +fieldset p{line-height: 30px;} +fieldset input.txt{ + width: 65px; + height: 21px; + line-height: 21px; + margin: 8px 5px; + background: #FFF; + border: 1px solid #d7d7d7; +} +label.url{font-weight: bold;margin-left: 5px;color: #06c;} +#videoFloat div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;} +#videoFloat .focus{opacity: 1;filter: alpha(opacity = 100)} +span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color: blue} + + + + +/* upload video */ +.tabbody #upload.panel { + width: 0; + height: 0; + overflow: hidden; + position: absolute !important; + clip: rect(1px, 1px, 1px, 1px); + background: #fff; + display: block; +} +.tabbody #upload.panel.focus { + width: 100%; + height: 335px; + display: block; + clip: auto; +} +#upload_alignment div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;} +#upload_alignment .focus{opacity: 1;filter: alpha(opacity = 100)} +#upload_left { width:427px; float:left; } +#upload_left .controller { height: 30px; clear: both; } +#uploadVideoInfo{margin-top:10px;float:right;padding-right:8px;} + +#upload .queueList { + margin: 0; +} + +#upload p { + margin: 0; +} + +.element-invisible { + width: 0 !important; + height: 0 !important; + border: 0; + padding: 0; + margin: 0; + overflow: hidden; + position: absolute !important; + clip: rect(1px, 1px, 1px, 1px); +} + +#upload .placeholder { + margin: 10px; + margin-right:0; + border: 2px dashed #e6e6e6; + *border: 0px dashed #e6e6e6; + height: 161px; + padding-top: 150px; + text-align: center; + width: 97%; + float: left; + background: url(./images/image.png) center 70px no-repeat; + color: #cccccc; + font-size: 18px; + position: relative; + top:0; + *margin-left: 0; + *left: 10px; +} + +#upload .placeholder .webuploader-pick { + font-size: 18px; + background: #00b7ee; + border-radius: 3px; + line-height: 44px; + padding: 0 30px; + *width: 120px; + color: #fff; + display: inline-block; + margin: 0 auto 20px auto; + cursor: pointer; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); +} + +#upload .placeholder .webuploader-pick-hover { + background: #00a2d4; +} + + +#filePickerContainer { + text-align: center; +} + +#upload .placeholder .flashTip { + color: #666666; + font-size: 12px; + position: absolute; + width: 100%; + text-align: center; + bottom: 20px; +} + +#upload .placeholder .flashTip a { + color: #0785d1; + text-decoration: none; +} + +#upload .placeholder .flashTip a:hover { + text-decoration: underline; +} + +#upload .placeholder.webuploader-dnd-over { + border-color: #999999; +} + +#upload .filelist { + list-style: none; + margin: 0; + padding: 0; + overflow-x: hidden; + overflow-y: auto; + position: relative; + height: 285px; +} + +#upload .filelist:after { + content: ''; + display: block; + width: 0; + height: 0; + overflow: hidden; + clear: both; +} + +#upload .filelist li { + width: 113px; + height: 113px; + background: url(./images/bg.png); + text-align: center; + margin: 15px 0 0 20px; + *margin: 15px 0 0 15px; + position: relative; + display: block; + float: left; + overflow: hidden; + font-size: 12px; +} + +#upload .filelist li p.log { + position: relative; + top: -45px; +} + +#upload .filelist li p.title { + position: absolute; + top: 0; + left: 0; + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + top: 5px; + text-indent: 5px; + text-align: left; +} + +#upload .filelist li p.progress { + position: absolute; + width: 100%; + bottom: 0; + left: 0; + height: 8px; + overflow: hidden; + z-index: 50; + margin: 0; + border-radius: 0; + background: none; + -webkit-box-shadow: 0 0 0; +} + +#upload .filelist li p.progress span { + display: none; + overflow: hidden; + width: 0; + height: 100%; + background: #1483d8 url(./images/progress.png) repeat-x; + + -webit-transition: width 200ms linear; + -moz-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; + transition: width 200ms linear; + + -webkit-animation: progressmove 2s linear infinite; + -moz-animation: progressmove 2s linear infinite; + -o-animation: progressmove 2s linear infinite; + -ms-animation: progressmove 2s linear infinite; + animation: progressmove 2s linear infinite; + + -webkit-transform: translateZ(0); +} + +@-webkit-keyframes progressmove { + 0% { + background-position: 0 0; + } + 100% { + background-position: 17px 0; + } +} + +@-moz-keyframes progressmove { + 0% { + background-position: 0 0; + } + 100% { + background-position: 17px 0; + } +} + +@keyframes progressmove { + 0% { + background-position: 0 0; + } + 100% { + background-position: 17px 0; + } +} + +#upload .filelist li p.imgWrap { + position: relative; + z-index: 2; + line-height: 113px; + vertical-align: middle; + overflow: hidden; + width: 113px; + height: 113px; + + -webkit-transform-origin: 50% 50%; + -moz-transform-origin: 50% 50%; + -o-transform-origin: 50% 50%; + -ms-transform-origin: 50% 50%; + transform-origin: 50% 50%; + + -webit-transition: 200ms ease-out; + -moz-transition: 200ms ease-out; + -o-transition: 200ms ease-out; + -ms-transition: 200ms ease-out; + transition: 200ms ease-out; +} +#upload .filelist li p.imgWrap.notimage { + margin-top: 0; + width: 111px; + height: 111px; + border: 1px #eeeeee solid; +} +#upload .filelist li p.imgWrap.notimage i.file-preview { + margin-top: 15px; +} + +#upload .filelist li img { + width: 100%; +} + +#upload .filelist li p.error { + background: #f43838; + color: #fff; + position: absolute; + bottom: 0; + left: 0; + height: 28px; + line-height: 28px; + width: 100%; + z-index: 100; + display:none; +} + +#upload .filelist li .success { + display: block; + position: absolute; + left: 0; + bottom: 0; + height: 40px; + width: 100%; + z-index: 200; + background: url(./images/success.png) no-repeat right bottom; + background-image: url(./images/success.gif) \9; +} + +#upload .filelist li.filePickerBlock { + width: 113px; + height: 113px; + background: url(./images/image.png) no-repeat center 12px; + border: 1px solid #eeeeee; + border-radius: 0; +} +#upload .filelist li.filePickerBlock div.webuploader-pick { + width: 100%; + height: 100%; + margin: 0; + padding: 0; + opacity: 0; + background: none; + font-size: 0; +} + +#upload .filelist div.file-panel { + position: absolute; + height: 0; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#80000000', endColorstr='#80000000') \0; + background: rgba(0, 0, 0, 0.5); + width: 100%; + top: 0; + left: 0; + overflow: hidden; + z-index: 300; +} + +#upload .filelist div.file-panel span { + width: 24px; + height: 24px; + display: inline; + float: right; + text-indent: -9999px; + overflow: hidden; + background: url(./images/icons.png) no-repeat; + background: url(./images/icons.gif) no-repeat \9; + margin: 5px 1px 1px; + cursor: pointer; + -webkit-tap-highlight-color: rgba(0,0,0,0); + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +#upload .filelist div.file-panel span.rotateLeft { + display:none; + background-position: 0 -24px; +} + +#upload .filelist div.file-panel span.rotateLeft:hover { + background-position: 0 0; +} + +#upload .filelist div.file-panel span.rotateRight { + display:none; + background-position: -24px -24px; +} + +#upload .filelist div.file-panel span.rotateRight:hover { + background-position: -24px 0; +} + +#upload .filelist div.file-panel span.cancel { + background-position: -48px -24px; +} + +#upload .filelist div.file-panel span.cancel:hover { + background-position: -48px 0; +} + +#upload .statusBar { + height: 45px; + border-bottom: 1px solid #dadada; + margin: 0 10px; + padding: 0; + line-height: 45px; + vertical-align: middle; + position: relative; +} + +#upload .statusBar .progress { + border: 1px solid #1483d8; + width: 198px; + background: #fff; + height: 18px; + position: absolute; + top: 12px; + display: none; + text-align: center; + line-height: 18px; + color: #6dbfff; + margin: 0 10px 0 0; +} +#upload .statusBar .progress span.percentage { + width: 0; + height: 100%; + left: 0; + top: 0; + background: #1483d8; + position: absolute; +} +#upload .statusBar .progress span.text { + position: relative; + z-index: 10; +} + +#upload .statusBar .info { + display: inline-block; + font-size: 14px; + color: #666666; +} + +#upload .statusBar .btns { + position: absolute; + top: 7px; + right: 0; + line-height: 30px; +} + +#filePickerBtn { + display: inline-block; + float: left; +} +#upload .statusBar .btns .webuploader-pick, +#upload .statusBar .btns .uploadBtn, +#upload .statusBar .btns .uploadBtn.state-uploading, +#upload .statusBar .btns .uploadBtn.state-paused { + background: #ffffff; + border: 1px solid #cfcfcf; + color: #565656; + padding: 0 18px; + display: inline-block; + border-radius: 3px; + margin-left: 10px; + cursor: pointer; + font-size: 14px; + float: left; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +#upload .statusBar .btns .webuploader-pick-hover, +#upload .statusBar .btns .uploadBtn:hover, +#upload .statusBar .btns .uploadBtn.state-uploading:hover, +#upload .statusBar .btns .uploadBtn.state-paused:hover { + background: #f0f0f0; +} + +#upload .statusBar .btns .uploadBtn, +#upload .statusBar .btns .uploadBtn.state-paused{ + background: #00b7ee; + color: #fff; + border-color: transparent; +} +#upload .statusBar .btns .uploadBtn:hover, +#upload .statusBar .btns .uploadBtn.state-paused:hover{ + background: #00a2d4; +} + +#upload .statusBar .btns .uploadBtn.disabled { + pointer-events: none; + filter:alpha(opacity=60); + -moz-opacity:0.6; + -khtml-opacity: 0.6; + opacity: 0.6; +} + + +/* 在线文件的文件预览图标 */ +i.file-preview { + display: block; + margin: 10px auto; + width: 70px; + height: 70px; + background-image: url("./images/file-icons.png"); + background-image: url("./images/file-icons.gif") \9; + background-position: -140px center; + background-repeat: no-repeat; +} +i.file-preview.file-type-dir{ + background-position: 0 center; +} +i.file-preview.file-type-file{ + background-position: -140px center; +} +i.file-preview.file-type-filelist{ + background-position: -210px center; +} +i.file-preview.file-type-zip, +i.file-preview.file-type-rar, +i.file-preview.file-type-7z, +i.file-preview.file-type-tar, +i.file-preview.file-type-gz, +i.file-preview.file-type-bz2{ + background-position: -280px center; +} +i.file-preview.file-type-xls, +i.file-preview.file-type-xlsx{ + background-position: -350px center; +} +i.file-preview.file-type-doc, +i.file-preview.file-type-docx{ + background-position: -420px center; +} +i.file-preview.file-type-ppt, +i.file-preview.file-type-pptx{ + background-position: -490px center; +} +i.file-preview.file-type-vsd{ + background-position: -560px center; +} +i.file-preview.file-type-pdf{ + background-position: -630px center; +} +i.file-preview.file-type-txt, +i.file-preview.file-type-md, +i.file-preview.file-type-json, +i.file-preview.file-type-htm, +i.file-preview.file-type-xml, +i.file-preview.file-type-html, +i.file-preview.file-type-js, +i.file-preview.file-type-css, +i.file-preview.file-type-php, +i.file-preview.file-type-jsp, +i.file-preview.file-type-asp{ + background-position: -700px center; +} +i.file-preview.file-type-apk{ + background-position: -770px center; +} +i.file-preview.file-type-exe{ + background-position: -840px center; +} +i.file-preview.file-type-ipa{ + background-position: -910px center; +} +i.file-preview.file-type-mp4, +i.file-preview.file-type-swf, +i.file-preview.file-type-mkv, +i.file-preview.file-type-avi, +i.file-preview.file-type-flv, +i.file-preview.file-type-mov, +i.file-preview.file-type-mpg, +i.file-preview.file-type-mpeg, +i.file-preview.file-type-ogv, +i.file-preview.file-type-webm, +i.file-preview.file-type-rm, +i.file-preview.file-type-rmvb{ + background-position: -980px center; +} +i.file-preview.file-type-ogg, +i.file-preview.file-type-wav, +i.file-preview.file-type-wmv, +i.file-preview.file-type-mid, +i.file-preview.file-type-mp3{ + background-position: -1050px center; +} +i.file-preview.file-type-jpg, +i.file-preview.file-type-jpeg, +i.file-preview.file-type-gif, +i.file-preview.file-type-bmp, +i.file-preview.file-type-png, +i.file-preview.file-type-psd{ + background-position: -140px center; +} \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/video/video.html b/public/static/Ueditor/dialogs/video/video.html new file mode 100644 index 0000000..5007882 --- /dev/null +++ b/public/static/Ueditor/dialogs/video/video.html @@ -0,0 +1,86 @@ + + + + + + + + + +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    + + + + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + 0% + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
      +
    • +
    +
    +
    +
    +
    + + + + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/video/video.js b/public/static/Ueditor/dialogs/video/video.js new file mode 100644 index 0000000..61c4a7e --- /dev/null +++ b/public/static/Ueditor/dialogs/video/video.js @@ -0,0 +1,797 @@ +/** + * Created by JetBrains PhpStorm. + * User: taoqili + * Date: 12-2-20 + * Time: 上午11:19 + * To change this template use File | Settings | File Templates. + */ + +(function(){ + + var video = {}, + uploadVideoList = [], + isModifyUploadVideo = false, + uploadFile; + + window.onload = function(){ + $focus($G("videoUrl")); + initTabs(); + initVideo(); + initUpload(); + }; + + /* 初始化tab标签 */ + function initTabs(){ + var tabs = $G('tabHeads').children; + for (var i = 0; i < tabs.length; i++) { + domUtils.on(tabs[i], "click", function (e) { + var j, bodyId, target = e.target || e.srcElement; + for (j = 0; j < tabs.length; j++) { + bodyId = tabs[j].getAttribute('data-content-id'); + if(tabs[j] == target){ + domUtils.addClass(tabs[j], 'focus'); + domUtils.addClass($G(bodyId), 'focus'); + }else { + domUtils.removeClasses(tabs[j], 'focus'); + domUtils.removeClasses($G(bodyId), 'focus'); + } + } + }); + } + } + + function initVideo(){ + createAlignButton( ["videoFloat", "upload_alignment"] ); + addUrlChangeListener($G("videoUrl")); + addOkListener(); + + //编辑视频时初始化相关信息 + (function(){ + var img = editor.selection.getRange().getClosedNode(),url; + if(img && img.className){ + var hasFakedClass = (img.className == "edui-faked-video"), + hasUploadClass = img.className.indexOf("edui-upload-video")!=-1; + if(hasFakedClass || hasUploadClass) { + $G("videoUrl").value = url = img.getAttribute("_url"); + $G("videoWidth").value = img.width; + $G("videoHeight").value = img.height; + var align = domUtils.getComputedStyle(img,"float"), + parentAlign = domUtils.getComputedStyle(img.parentNode,"text-align"); + updateAlignButton(parentAlign==="center"?"center":align); + } + if(hasUploadClass) { + isModifyUploadVideo = true; + } + } + createPreviewVideo(url); + })(); + } + + /** + * 监听确认和取消两个按钮事件,用户执行插入或者清空正在播放的视频实例操作 + */ + function addOkListener(){ + dialog.onok = function(){ + $G("preview").innerHTML = ""; + var currentTab = findFocus("tabHeads","tabSrc"); + switch(currentTab){ + case "video": + return insertSingle(); + break; + case "videoSearch": + return insertSearch("searchList"); + break; + case "upload": + return insertUpload(); + break; + } + }; + dialog.oncancel = function(){ + $G("preview").innerHTML = ""; + }; + } + + /** + * 依据传入的align值更新按钮信息 + * @param align + */ + function updateAlignButton( align ) { + var aligns = $G( "videoFloat" ).children; + for ( var i = 0, ci; ci = aligns[i++]; ) { + if ( ci.getAttribute( "name" ) == align ) { + if ( ci.className !="focus" ) { + ci.className = "focus"; + } + } else { + if ( ci.className =="focus" ) { + ci.className = ""; + } + } + } + } + + /** + * 将单个视频信息插入编辑器中 + */ + function insertSingle(){ + var width = $G("videoWidth"), + height = $G("videoHeight"), + url=$G('videoUrl').value, + align = findFocus("videoFloat","name"); + if(!url) return false; + if ( !checkNum( [width, height] ) ) return false; + editor.execCommand('insertvideo', { + url: convert_url(url), + width: width.value, + height: height.value, + align: align + }, isModifyUploadVideo ? 'upload':null); + } + + /** + * 将元素id下的所有代表视频的图片插入编辑器中 + * @param id + */ + function insertSearch(id){ + var imgs = domUtils.getElementsByTagName($G(id),"img"), + videoObjs=[]; + for(var i=0,img; img=imgs[i++];){ + if(img.getAttribute("selected")){ + videoObjs.push({ + url:img.getAttribute("ue_video_url"), + width:420, + height:280, + align:"none" + }); + } + } + editor.execCommand('insertvideo',videoObjs); + } + + /** + * 找到id下具有focus类的节点并返回该节点下的某个属性 + * @param id + * @param returnProperty + */ + function findFocus( id, returnProperty ) { + var tabs = $G( id ).children, + property; + for ( var i = 0, ci; ci = tabs[i++]; ) { + if ( ci.className=="focus" ) { + property = ci.getAttribute( returnProperty ); + break; + } + } + return property; + } + function convert_url(url){ + if ( !url ) return ''; + url = utils.trim(url) + .replace(/v\.youku\.com\/v_show\/id_([\w\-=]+)\.html/i, 'player.youku.com/player.php/sid/$1/v.swf') + .replace(/(www\.)?youtube\.com\/watch\?v=([\w\-]+)/i, "www.youtube.com/v/$2") + .replace(/youtu.be\/(\w+)$/i, "www.youtube.com/v/$1") + .replace(/v\.ku6\.com\/.+\/([\w\.]+)\.html.*$/i, "player.ku6.com/refer/$1/v.swf") + .replace(/www\.56\.com\/u\d+\/v_([\w\-]+)\.html/i, "player.56.com/v_$1.swf") + .replace(/www.56.com\/w\d+\/play_album\-aid\-\d+_vid\-([^.]+)\.html/i, "player.56.com/v_$1.swf") + .replace(/v\.pps\.tv\/play_([\w]+)\.html.*$/i, "player.pps.tv/player/sid/$1/v.swf") + .replace(/www\.letv\.com\/ptv\/vplay\/([\d]+)\.html.*$/i, "i7.imgs.letv.com/player/swfPlayer.swf?id=$1&autoplay=0") + .replace(/www\.tudou\.com\/programs\/view\/([\w\-]+)\/?/i, "www.tudou.com/v/$1") + .replace(/v\.qq\.com\/cover\/[\w]+\/[\w]+\/([\w]+)\.html/i, "static.video.qq.com/TPout.swf?vid=$1") + .replace(/v\.qq\.com\/.+[\?\&]vid=([^&]+).*$/i, "static.video.qq.com/TPout.swf?vid=$1") + .replace(/my\.tv\.sohu\.com\/[\w]+\/[\d]+\/([\d]+)\.shtml.*$/i, "share.vrs.sohu.com/my/v.swf&id=$1"); + + return url; + } + + /** + * 检测传入的所有input框中输入的长宽是否是正数 + * @param nodes input框集合, + */ + function checkNum( nodes ) { + for ( var i = 0, ci; ci = nodes[i++]; ) { + var value = ci.value; + if ( !isNumber( value ) && value) { + alert( lang.numError ); + ci.value = ""; + ci.focus(); + return false; + } + } + return true; + } + + /** + * 数字判断 + * @param value + */ + function isNumber( value ) { + return /(0|^[1-9]\d*$)/.test( value ); + } + + /** + * 创建图片浮动选择按钮 + * @param ids + */ + function createAlignButton( ids ) { + for ( var i = 0, ci; ci = ids[i++]; ) { + var floatContainer = $G( ci ), + nameMaps = {"none":lang['default'], "left":lang.floatLeft, "right":lang.floatRight, "center":lang.block}; + for ( var j in nameMaps ) { + var div = document.createElement( "div" ); + div.setAttribute( "name", j ); + if ( j == "none" ) div.className="focus"; + div.style.cssText = "background:url(images/" + j + "_focus.jpg);"; + div.setAttribute( "title", nameMaps[j] ); + floatContainer.appendChild( div ); + } + switchSelect( ci ); + } + } + + /** + * 选择切换 + * @param selectParentId + */ + function switchSelect( selectParentId ) { + var selects = $G( selectParentId ).children; + for ( var i = 0, ci; ci = selects[i++]; ) { + domUtils.on( ci, "click", function () { + for ( var j = 0, cj; cj = selects[j++]; ) { + cj.className = ""; + cj.removeAttribute && cj.removeAttribute( "class" ); + } + this.className = "focus"; + } ) + } + } + + /** + * 监听url改变事件 + * @param url + */ + function addUrlChangeListener(url){ + if (browser.ie) { + url.onpropertychange = function () { + createPreviewVideo( this.value ); + } + } else { + url.addEventListener( "input", function () { + createPreviewVideo( this.value ); + }, false ); + } + } + + /** + * 根据url生成视频预览 + * @param url + */ + function createPreviewVideo(url){ + if ( !url )return; + + var conUrl = convert_url(url); + + conUrl = utils.unhtmlForUrl(conUrl); + + $G("preview").innerHTML = '
    '+lang.urlError+'
    '+ + '' + + ''; + } + + + /* 插入上传视频 */ + function insertUpload(){ + var videoObjs=[], + uploadDir = editor.getOpt('videoUrlPrefix'), + width = parseInt($G('upload_width').value, 10) || 420, + height = parseInt($G('upload_height').value, 10) || 280, + align = findFocus("upload_alignment","name") || 'none'; + for(var key in uploadVideoList) { + var file = uploadVideoList[key]; + videoObjs.push({ + url: uploadDir + file.url, + width:width, + height:height, + align:align + }); + } + + var count = uploadFile.getQueueCount(); + if (count) { + $('.info', '#queueList').html('' + '还有2个未上传文件'.replace(/[\d]/, count) + ''); + return false; + } else { + editor.execCommand('insertvideo', videoObjs, 'upload'); + } + } + + /*初始化上传标签*/ + function initUpload(){ + uploadFile = new UploadFile('queueList'); + } + + + /* 上传附件 */ + function UploadFile(target) { + this.$wrap = target.constructor == String ? $('#' + target) : $(target); + this.init(); + } + UploadFile.prototype = { + init: function () { + this.fileList = []; + this.initContainer(); + this.initUploader(); + }, + initContainer: function () { + this.$queue = this.$wrap.find('.filelist'); + }, + /* 初始化容器 */ + initUploader: function () { + var _this = this, + $ = jQuery, // just in case. Make sure it's not an other libaray. + $wrap = _this.$wrap, + // 图片容器 + $queue = $wrap.find('.filelist'), + // 状态栏,包括进度和控制按钮 + $statusBar = $wrap.find('.statusBar'), + // 文件总体选择信息。 + $info = $statusBar.find('.info'), + // 上传按钮 + $upload = $wrap.find('.uploadBtn'), + // 上传按钮 + $filePickerBtn = $wrap.find('.filePickerBtn'), + // 上传按钮 + $filePickerBlock = $wrap.find('.filePickerBlock'), + // 没选择文件之前的内容。 + $placeHolder = $wrap.find('.placeholder'), + // 总体进度条 + $progress = $statusBar.find('.progress').hide(), + // 添加的文件数量 + fileCount = 0, + // 添加的文件总大小 + fileSize = 0, + // 优化retina, 在retina下这个值是2 + ratio = window.devicePixelRatio || 1, + // 缩略图大小 + thumbnailWidth = 113 * ratio, + thumbnailHeight = 113 * ratio, + // 可能有pedding, ready, uploading, confirm, done. + state = '', + // 所有文件的进度信息,key为file id + percentages = {}, + supportTransition = (function () { + var s = document.createElement('p').style, + r = 'transition' in s || + 'WebkitTransition' in s || + 'MozTransition' in s || + 'msTransition' in s || + 'OTransition' in s; + s = null; + return r; + })(), + // WebUploader实例 + uploader, + actionUrl = editor.getActionUrl(editor.getOpt('videoActionName')), + fileMaxSize = editor.getOpt('videoMaxSize'), + acceptExtensions = (editor.getOpt('videoAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, '');; + + if (!WebUploader.Uploader.support()) { + $('#filePickerReady').after($('
    ').html(lang.errorNotSupport)).hide(); + return; + } else if (!editor.getOpt('videoActionName')) { + $('#filePickerReady').after($('
    ').html(lang.errorLoadConfig)).hide(); + return; + } + + uploader = _this.uploader = WebUploader.create({ + pick: { + id: '#filePickerReady', + label: lang.uploadSelectFile + }, + swf: '../../third-party/webuploader/Uploader.swf', + server: actionUrl, + fileVal: editor.getOpt('videoFieldName'), + duplicate: true, + fileSingleSizeLimit: fileMaxSize, + compress: false + }); + uploader.addButton({ + id: '#filePickerBlock' + }); + uploader.addButton({ + id: '#filePickerBtn', + label: lang.uploadAddFile + }); + + setState('pedding'); + + // 当有文件添加进来时执行,负责view的创建 + function addFile(file) { + var $li = $('
  • ' + + '

    ' + file.name + '

    ' + + '

    ' + + '

    ' + + '
  • '), + + $btns = $('
    ' + + '' + lang.uploadDelete + '' + + '' + lang.uploadTurnRight + '' + + '' + lang.uploadTurnLeft + '
    ').appendTo($li), + $prgress = $li.find('p.progress span'), + $wrap = $li.find('p.imgWrap'), + $info = $('

    ').hide().appendTo($li), + + showError = function (code) { + switch (code) { + case 'exceed_size': + text = lang.errorExceedSize; + break; + case 'interrupt': + text = lang.errorInterrupt; + break; + case 'http': + text = lang.errorHttp; + break; + case 'not_allow_type': + text = lang.errorFileType; + break; + default: + text = lang.errorUploadRetry; + break; + } + $info.text(text).show(); + }; + + if (file.getStatus() === 'invalid') { + showError(file.statusText); + } else { + $wrap.text(lang.uploadPreview); + if ('|png|jpg|jpeg|bmp|gif|'.indexOf('|'+file.ext.toLowerCase()+'|') == -1) { + $wrap.empty().addClass('notimage').append('' + + '' + file.name + ''); + } else { + if (browser.ie && browser.version <= 7) { + $wrap.text(lang.uploadNoPreview); + } else { + uploader.makeThumb(file, function (error, src) { + if (error || !src || (/^data:/.test(src) && browser.ie && browser.version <= 7)) { + $wrap.text(lang.uploadNoPreview); + } else { + var $img = $(''); + $wrap.empty().append($img); + $img.on('error', function () { + $wrap.text(lang.uploadNoPreview); + }); + } + }, thumbnailWidth, thumbnailHeight); + } + } + percentages[ file.id ] = [ file.size, 0 ]; + file.rotation = 0; + + /* 检查文件格式 */ + if (!file.ext || acceptExtensions.indexOf(file.ext.toLowerCase()) == -1) { + showError('not_allow_type'); + uploader.removeFile(file); + } + } + + file.on('statuschange', function (cur, prev) { + if (prev === 'progress') { + $prgress.hide().width(0); + } else if (prev === 'queued') { + $li.off('mouseenter mouseleave'); + $btns.remove(); + } + // 成功 + if (cur === 'error' || cur === 'invalid') { + showError(file.statusText); + percentages[ file.id ][ 1 ] = 1; + } else if (cur === 'interrupt') { + showError('interrupt'); + } else if (cur === 'queued') { + percentages[ file.id ][ 1 ] = 0; + } else if (cur === 'progress') { + $info.hide(); + $prgress.css('display', 'block'); + } else if (cur === 'complete') { + } + + $li.removeClass('state-' + prev).addClass('state-' + cur); + }); + + $li.on('mouseenter', function () { + $btns.stop().animate({height: 30}); + }); + $li.on('mouseleave', function () { + $btns.stop().animate({height: 0}); + }); + + $btns.on('click', 'span', function () { + var index = $(this).index(), + deg; + + switch (index) { + case 0: + uploader.removeFile(file); + return; + case 1: + file.rotation += 90; + break; + case 2: + file.rotation -= 90; + break; + } + + if (supportTransition) { + deg = 'rotate(' + file.rotation + 'deg)'; + $wrap.css({ + '-webkit-transform': deg, + '-mos-transform': deg, + '-o-transform': deg, + 'transform': deg + }); + } else { + $wrap.css('filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + (~~((file.rotation / 90) % 4 + 4) % 4) + ')'); + } + + }); + + $li.insertBefore($filePickerBlock); + } + + // 负责view的销毁 + function removeFile(file) { + var $li = $('#' + file.id); + delete percentages[ file.id ]; + updateTotalProgress(); + $li.off().find('.file-panel').off().end().remove(); + } + + function updateTotalProgress() { + var loaded = 0, + total = 0, + spans = $progress.children(), + percent; + + $.each(percentages, function (k, v) { + total += v[ 0 ]; + loaded += v[ 0 ] * v[ 1 ]; + }); + + percent = total ? loaded / total : 0; + + spans.eq(0).text(Math.round(percent * 100) + '%'); + spans.eq(1).css('width', Math.round(percent * 100) + '%'); + updateStatus(); + } + + function setState(val, files) { + + if (val != state) { + + var stats = uploader.getStats(); + + $upload.removeClass('state-' + state); + $upload.addClass('state-' + val); + + switch (val) { + + /* 未选择文件 */ + case 'pedding': + $queue.addClass('element-invisible'); + $statusBar.addClass('element-invisible'); + $placeHolder.removeClass('element-invisible'); + $progress.hide(); $info.hide(); + uploader.refresh(); + break; + + /* 可以开始上传 */ + case 'ready': + $placeHolder.addClass('element-invisible'); + $queue.removeClass('element-invisible'); + $statusBar.removeClass('element-invisible'); + $progress.hide(); $info.show(); + $upload.text(lang.uploadStart); + uploader.refresh(); + break; + + /* 上传中 */ + case 'uploading': + $progress.show(); $info.hide(); + $upload.text(lang.uploadPause); + break; + + /* 暂停上传 */ + case 'paused': + $progress.show(); $info.hide(); + $upload.text(lang.uploadContinue); + break; + + case 'confirm': + $progress.show(); $info.hide(); + $upload.text(lang.uploadStart); + + stats = uploader.getStats(); + if (stats.successNum && !stats.uploadFailNum) { + setState('finish'); + return; + } + break; + + case 'finish': + $progress.hide(); $info.show(); + if (stats.uploadFailNum) { + $upload.text(lang.uploadRetry); + } else { + $upload.text(lang.uploadStart); + } + break; + } + + state = val; + updateStatus(); + + } + + if (!_this.getQueueCount()) { + $upload.addClass('disabled') + } else { + $upload.removeClass('disabled') + } + + } + + function updateStatus() { + var text = '', stats; + + if (state === 'ready') { + text = lang.updateStatusReady.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize)); + } else if (state === 'confirm') { + stats = uploader.getStats(); + if (stats.uploadFailNum) { + text = lang.updateStatusConfirm.replace('_', stats.successNum).replace('_', stats.successNum); + } + } else { + stats = uploader.getStats(); + text = lang.updateStatusFinish.replace('_', fileCount). + replace('_KB', WebUploader.formatSize(fileSize)). + replace('_', stats.successNum); + + if (stats.uploadFailNum) { + text += lang.updateStatusError.replace('_', stats.uploadFailNum); + } + } + + $info.html(text); + } + + uploader.on('fileQueued', function (file) { + fileCount++; + fileSize += file.size; + + if (fileCount === 1) { + $placeHolder.addClass('element-invisible'); + $statusBar.show(); + } + + addFile(file); + }); + + uploader.on('fileDequeued', function (file) { + fileCount--; + fileSize -= file.size; + + removeFile(file); + updateTotalProgress(); + }); + + uploader.on('filesQueued', function (file) { + if (!uploader.isInProgress() && (state == 'pedding' || state == 'finish' || state == 'confirm' || state == 'ready')) { + setState('ready'); + } + updateTotalProgress(); + }); + + uploader.on('all', function (type, files) { + switch (type) { + case 'uploadFinished': + setState('confirm', files); + break; + case 'startUpload': + /* 添加额外的GET参数 */ + var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '', + url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?':'&') + 'encode=utf-8&' + params); + uploader.option('server', url); + setState('uploading', files); + break; + case 'stopUpload': + setState('paused', files); + break; + } + }); + + uploader.on('uploadBeforeSend', function (file, data, header) { + //这里可以通过data对象添加POST参数 + header['X_Requested_With'] = 'XMLHttpRequest'; + // HaoChuan9421 + if(editor.options.headers && Object.prototype.toString.apply(editor.options.headers) === "[object Object]"){ + for(var key in editor.options.headers){ + header[key] = editor.options.headers[key] + } + } + }); + + uploader.on('uploadProgress', function (file, percentage) { + var $li = $('#' + file.id), + $percent = $li.find('.progress span'); + + $percent.css('width', percentage * 100 + '%'); + percentages[ file.id ][ 1 ] = percentage; + updateTotalProgress(); + }); + + uploader.on('uploadSuccess', function (file, ret) { + var $file = $('#' + file.id); + try { + var responseText = (ret._raw || ret), + json = utils.str2json(responseText); + if (json.state == 'SUCCESS') { + uploadVideoList.push({ + 'url': json.url, + 'type': json.type, + 'original':json.original + }); + $file.append(''); + } else { + $file.find('.error').text(json.state).show(); + } + } catch (e) { + $file.find('.error').text(lang.errorServerUpload).show(); + } + }); + + uploader.on('uploadError', function (file, code) { + }); + uploader.on('error', function (code, file) { + if (code == 'Q_TYPE_DENIED' || code == 'F_EXCEED_SIZE') { + addFile(file); + } + }); + uploader.on('uploadComplete', function (file, ret) { + }); + + $upload.on('click', function () { + if ($(this).hasClass('disabled')) { + return false; + } + + if (state === 'ready') { + uploader.upload(); + } else if (state === 'paused') { + uploader.upload(); + } else if (state === 'uploading') { + uploader.stop(); + } + }); + + $upload.addClass('state-' + state); + updateTotalProgress(); + }, + getQueueCount: function () { + var file, i, status, readyFile = 0, files = this.uploader.getFiles(); + for (i = 0; file = files[i++]; ) { + status = file.getStatus(); + if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++; + } + return readyFile; + }, + refresh: function(){ + this.uploader.refresh(); + } + }; + +})(); diff --git a/public/static/Ueditor/dialogs/webapp/webapp.html b/public/static/Ueditor/dialogs/webapp/webapp.html new file mode 100644 index 0000000..1614377 --- /dev/null +++ b/public/static/Ueditor/dialogs/webapp/webapp.html @@ -0,0 +1,53 @@ + + + + + + + + + +
    +
    +
    + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/wordimage/fClipboard_ueditor.swf b/public/static/Ueditor/dialogs/wordimage/fClipboard_ueditor.swf new file mode 100644 index 0000000..ac5d27f Binary files /dev/null and b/public/static/Ueditor/dialogs/wordimage/fClipboard_ueditor.swf differ diff --git a/public/static/Ueditor/dialogs/wordimage/imageUploader.swf b/public/static/Ueditor/dialogs/wordimage/imageUploader.swf new file mode 100644 index 0000000..2a554ca Binary files /dev/null and b/public/static/Ueditor/dialogs/wordimage/imageUploader.swf differ diff --git a/public/static/Ueditor/dialogs/wordimage/tangram.js b/public/static/Ueditor/dialogs/wordimage/tangram.js new file mode 100644 index 0000000..2ebd8fd --- /dev/null +++ b/public/static/Ueditor/dialogs/wordimage/tangram.js @@ -0,0 +1,1495 @@ +// Copyright (c) 2009, Baidu Inc. All rights reserved. +// +// Licensed under the BSD License +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http:// tangram.baidu.com/license.html +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /** + * @namespace T Tangram七巧板 + * @name T + * @version 1.6.0 +*/ + +/** + * 声明baidu包 + * @author: allstar, erik, meizz, berg + */ +var T, + baidu = T = baidu || {version: "1.5.0"}; +baidu.guid = "$BAIDU$"; +baidu.$$ = window[baidu.guid] = window[baidu.guid] || {global:{}}; + +/** + * 使用flash资源封装的一些功能 + * @namespace baidu.flash + */ +baidu.flash = baidu.flash || {}; + +/** + * 操作dom的方法 + * @namespace baidu.dom + */ +baidu.dom = baidu.dom || {}; + + +/** + * 从文档中获取指定的DOM元素 + * @name baidu.dom.g + * @function + * @grammar baidu.dom.g(id) + * @param {string|HTMLElement} id 元素的id或DOM元素. + * @shortcut g,T.G + * @meta standard + * @see baidu.dom.q + * + * @return {HTMLElement|null} 获取的元素,查找不到时返回null,如果参数不合法,直接返回参数. + */ +baidu.dom.g = function(id) { + if (!id) return null; + if ('string' == typeof id || id instanceof String) { + return document.getElementById(id); + } else if (id.nodeName && (id.nodeType == 1 || id.nodeType == 9)) { + return id; + } + return null; +}; +baidu.g = baidu.G = baidu.dom.g; + + +/** + * 操作数组的方法 + * @namespace baidu.array + */ + +baidu.array = baidu.array || {}; + + +/** + * 遍历数组中所有元素 + * @name baidu.array.each + * @function + * @grammar baidu.array.each(source, iterator[, thisObject]) + * @param {Array} source 需要遍历的数组 + * @param {Function} iterator 对每个数组元素进行调用的函数,该函数有两个参数,第一个为数组元素,第二个为数组索引值,function (item, index)。 + * @param {Object} [thisObject] 函数调用时的this指针,如果没有此参数,默认是当前遍历的数组 + * @remark + * each方法不支持对Object的遍历,对Object的遍历使用baidu.object.each 。 + * @shortcut each + * @meta standard + * + * @returns {Array} 遍历的数组 + */ + +baidu.each = baidu.array.forEach = baidu.array.each = function (source, iterator, thisObject) { + var returnValue, item, i, len = source.length; + + if ('function' == typeof iterator) { + for (i = 0; i < len; i++) { + item = source[i]; + returnValue = iterator.call(thisObject || source, item, i); + + if (returnValue === false) { + break; + } + } + } + return source; +}; + +/** + * 对语言层面的封装,包括类型判断、模块扩展、继承基类以及对象自定义事件的支持。 + * @namespace baidu.lang + */ +baidu.lang = baidu.lang || {}; + + +/** + * 判断目标参数是否为function或Function实例 + * @name baidu.lang.isFunction + * @function + * @grammar baidu.lang.isFunction(source) + * @param {Any} source 目标参数 + * @version 1.2 + * @see baidu.lang.isString,baidu.lang.isObject,baidu.lang.isNumber,baidu.lang.isArray,baidu.lang.isElement,baidu.lang.isBoolean,baidu.lang.isDate + * @meta standard + * @returns {boolean} 类型判断结果 + */ +baidu.lang.isFunction = function (source) { + return '[object Function]' == Object.prototype.toString.call(source); +}; + +/** + * 判断目标参数是否string类型或String对象 + * @name baidu.lang.isString + * @function + * @grammar baidu.lang.isString(source) + * @param {Any} source 目标参数 + * @shortcut isString + * @meta standard + * @see baidu.lang.isObject,baidu.lang.isNumber,baidu.lang.isArray,baidu.lang.isElement,baidu.lang.isBoolean,baidu.lang.isDate + * + * @returns {boolean} 类型判断结果 + */ +baidu.lang.isString = function (source) { + return '[object String]' == Object.prototype.toString.call(source); +}; +baidu.isString = baidu.lang.isString; + + +/** + * 判断浏览器类型和特性的属性 + * @namespace baidu.browser + */ +baidu.browser = baidu.browser || {}; + + +/** + * 判断是否为opera浏览器 + * @property opera opera版本号 + * @grammar baidu.browser.opera + * @meta standard + * @see baidu.browser.ie,baidu.browser.firefox,baidu.browser.safari,baidu.browser.chrome + * @returns {Number} opera版本号 + */ + +/** + * opera 从10开始不是用opera后面的字符串进行版本的判断 + * 在Browser identification最后添加Version + 数字进行版本标识 + * opera后面的数字保持在9.80不变 + */ +baidu.browser.opera = /opera(\/| )(\d+(\.\d+)?)(.+?(version\/(\d+(\.\d+)?)))?/i.test(navigator.userAgent) ? + ( RegExp["\x246"] || RegExp["\x242"] ) : undefined; + + +/** + * 在目标元素的指定位置插入HTML代码 + * @name baidu.dom.insertHTML + * @function + * @grammar baidu.dom.insertHTML(element, position, html) + * @param {HTMLElement|string} element 目标元素或目标元素的id + * @param {string} position 插入html的位置信息,取值为beforeBegin,afterBegin,beforeEnd,afterEnd + * @param {string} html 要插入的html + * @remark + * + * 对于position参数,大小写不敏感
    + * 参数的意思:beforeBegin<span>afterBegin this is span! beforeEnd</span> afterEnd
    + * 此外,如果使用本函数插入带有script标签的HTML字符串,script标签对应的脚本将不会被执行。 + * + * @shortcut insertHTML + * @meta standard + * + * @returns {HTMLElement} 目标元素 + */ +baidu.dom.insertHTML = function (element, position, html) { + element = baidu.dom.g(element); + var range,begin; + if (element.insertAdjacentHTML && !baidu.browser.opera) { + element.insertAdjacentHTML(position, html); + } else { + range = element.ownerDocument.createRange(); + position = position.toUpperCase(); + if (position == 'AFTERBEGIN' || position == 'BEFOREEND') { + range.selectNodeContents(element); + range.collapse(position == 'AFTERBEGIN'); + } else { + begin = position == 'BEFOREBEGIN'; + range[begin ? 'setStartBefore' : 'setEndAfter'](element); + range.collapse(begin); + } + range.insertNode(range.createContextualFragment(html)); + } + return element; +}; + +baidu.insertHTML = baidu.dom.insertHTML; + +/** + * 操作flash对象的方法,包括创建flash对象、获取flash对象以及判断flash插件的版本号 + * @namespace baidu.swf + */ +baidu.swf = baidu.swf || {}; + + +/** + * 浏览器支持的flash插件版本 + * @property version 浏览器支持的flash插件版本 + * @grammar baidu.swf.version + * @return {String} 版本号 + * @meta standard + */ +baidu.swf.version = (function () { + var n = navigator; + if (n.plugins && n.mimeTypes.length) { + var plugin = n.plugins["Shockwave Flash"]; + if (plugin && plugin.description) { + return plugin.description + .replace(/([a-zA-Z]|\s)+/, "") + .replace(/(\s)+r/, ".") + ".0"; + } + } else if (window.ActiveXObject && !window.opera) { + for (var i = 12; i >= 2; i--) { + try { + var c = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.' + i); + if (c) { + var version = c.GetVariable("$version"); + return version.replace(/WIN/g,'').replace(/,/g,'.'); + } + } catch(e) {} + } + } +})(); + +/** + * 操作字符串的方法 + * @namespace baidu.string + */ +baidu.string = baidu.string || {}; + + +/** + * 对目标字符串进行html编码 + * @name baidu.string.encodeHTML + * @function + * @grammar baidu.string.encodeHTML(source) + * @param {string} source 目标字符串 + * @remark + * 编码字符有5个:&<>"' + * @shortcut encodeHTML + * @meta standard + * @see baidu.string.decodeHTML + * + * @returns {string} html编码后的字符串 + */ +baidu.string.encodeHTML = function (source) { + return String(source) + .replace(/&/g,'&') + .replace(//g,'>') + .replace(/"/g, """) + .replace(/'/g, "'"); +}; + +baidu.encodeHTML = baidu.string.encodeHTML; + +/** + * 创建flash对象的html字符串 + * @name baidu.swf.createHTML + * @function + * @grammar baidu.swf.createHTML(options) + * + * @param {Object} options 创建flash的选项参数 + * @param {string} options.id 要创建的flash的标识 + * @param {string} options.url flash文件的url + * @param {String} options.errorMessage 未安装flash player或flash player版本号过低时的提示 + * @param {string} options.ver 最低需要的flash player版本号 + * @param {string} options.width flash的宽度 + * @param {string} options.height flash的高度 + * @param {string} options.align flash的对齐方式,允许值:middle/left/right/top/bottom + * @param {string} options.base 设置用于解析swf文件中的所有相对路径语句的基本目录或URL + * @param {string} options.bgcolor swf文件的背景色 + * @param {string} options.salign 设置缩放的swf文件在由width和height设置定义的区域内的位置。允许值:l/r/t/b/tl/tr/bl/br + * @param {boolean} options.menu 是否显示右键菜单,允许值:true/false + * @param {boolean} options.loop 播放到最后一帧时是否重新播放,允许值: true/false + * @param {boolean} options.play flash是否在浏览器加载时就开始播放。允许值:true/false + * @param {string} options.quality 设置flash播放的画质,允许值:low/medium/high/autolow/autohigh/best + * @param {string} options.scale 设置flash内容如何缩放来适应设置的宽高。允许值:showall/noborder/exactfit + * @param {string} options.wmode 设置flash的显示模式。允许值:window/opaque/transparent + * @param {string} options.allowscriptaccess 设置flash与页面的通信权限。允许值:always/never/sameDomain + * @param {string} options.allownetworking 设置swf文件中允许使用的网络API。允许值:all/internal/none + * @param {boolean} options.allowfullscreen 是否允许flash全屏。允许值:true/false + * @param {boolean} options.seamlesstabbing 允许设置执行无缝跳格,从而使用户能跳出flash应用程序。该参数只能在安装Flash7及更高版本的Windows中使用。允许值:true/false + * @param {boolean} options.devicefont 设置静态文本对象是否以设备字体呈现。允许值:true/false + * @param {boolean} options.swliveconnect 第一次加载flash时浏览器是否应启动Java。允许值:true/false + * @param {Object} options.vars 要传递给flash的参数,支持JSON或string类型。 + * + * @see baidu.swf.create + * @meta standard + * @returns {string} flash对象的html字符串 + */ +baidu.swf.createHTML = function (options) { + options = options || {}; + var version = baidu.swf.version, + needVersion = options['ver'] || '6.0.0', + vUnit1, vUnit2, i, k, len, item, tmpOpt = {}, + encodeHTML = baidu.string.encodeHTML; + for (k in options) { + tmpOpt[k] = options[k]; + } + options = tmpOpt; + if (version) { + version = version.split('.'); + needVersion = needVersion.split('.'); + for (i = 0; i < 3; i++) { + vUnit1 = parseInt(version[i], 10); + vUnit2 = parseInt(needVersion[i], 10); + if (vUnit2 < vUnit1) { + break; + } else if (vUnit2 > vUnit1) { + return ''; + } + } + } else { + return ''; + } + + var vars = options['vars'], + objProperties = ['classid', 'codebase', 'id', 'width', 'height', 'align']; + options['align'] = options['align'] || 'middle'; + options['classid'] = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'; + options['codebase'] = 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'; + options['movie'] = options['url'] || ''; + delete options['vars']; + delete options['url']; + if ('string' == typeof vars) { + options['flashvars'] = vars; + } else { + var fvars = []; + for (k in vars) { + item = vars[k]; + fvars.push(k + "=" + encodeURIComponent(item)); + } + options['flashvars'] = fvars.join('&'); + } + var str = [''); + var params = { + 'wmode' : 1, + 'scale' : 1, + 'quality' : 1, + 'play' : 1, + 'loop' : 1, + 'menu' : 1, + 'salign' : 1, + 'bgcolor' : 1, + 'base' : 1, + 'allowscriptaccess' : 1, + 'allownetworking' : 1, + 'allowfullscreen' : 1, + 'seamlesstabbing' : 1, + 'devicefont' : 1, + 'swliveconnect' : 1, + 'flashvars' : 1, + 'movie' : 1 + }; + + for (k in options) { + item = options[k]; + k = k.toLowerCase(); + if (params[k] && (item || item === false || item === 0)) { + str.push(''); + } + } + options['src'] = options['movie']; + options['name'] = options['id']; + delete options['id']; + delete options['movie']; + delete options['classid']; + delete options['codebase']; + options['type'] = 'application/x-shockwave-flash'; + options['pluginspage'] = 'http://www.macromedia.com/go/getflashplayer'; + str.push(''); + + return str.join(''); +}; + + +/** + * 在页面中创建一个flash对象 + * @name baidu.swf.create + * @function + * @grammar baidu.swf.create(options[, container]) + * + * @param {Object} options 创建flash的选项参数 + * @param {string} options.id 要创建的flash的标识 + * @param {string} options.url flash文件的url + * @param {String} options.errorMessage 未安装flash player或flash player版本号过低时的提示 + * @param {string} options.ver 最低需要的flash player版本号 + * @param {string} options.width flash的宽度 + * @param {string} options.height flash的高度 + * @param {string} options.align flash的对齐方式,允许值:middle/left/right/top/bottom + * @param {string} options.base 设置用于解析swf文件中的所有相对路径语句的基本目录或URL + * @param {string} options.bgcolor swf文件的背景色 + * @param {string} options.salign 设置缩放的swf文件在由width和height设置定义的区域内的位置。允许值:l/r/t/b/tl/tr/bl/br + * @param {boolean} options.menu 是否显示右键菜单,允许值:true/false + * @param {boolean} options.loop 播放到最后一帧时是否重新播放,允许值: true/false + * @param {boolean} options.play flash是否在浏览器加载时就开始播放。允许值:true/false + * @param {string} options.quality 设置flash播放的画质,允许值:low/medium/high/autolow/autohigh/best + * @param {string} options.scale 设置flash内容如何缩放来适应设置的宽高。允许值:showall/noborder/exactfit + * @param {string} options.wmode 设置flash的显示模式。允许值:window/opaque/transparent + * @param {string} options.allowscriptaccess 设置flash与页面的通信权限。允许值:always/never/sameDomain + * @param {string} options.allownetworking 设置swf文件中允许使用的网络API。允许值:all/internal/none + * @param {boolean} options.allowfullscreen 是否允许flash全屏。允许值:true/false + * @param {boolean} options.seamlesstabbing 允许设置执行无缝跳格,从而使用户能跳出flash应用程序。该参数只能在安装Flash7及更高版本的Windows中使用。允许值:true/false + * @param {boolean} options.devicefont 设置静态文本对象是否以设备字体呈现。允许值:true/false + * @param {boolean} options.swliveconnect 第一次加载flash时浏览器是否应启动Java。允许值:true/false + * @param {Object} options.vars 要传递给flash的参数,支持JSON或string类型。 + * + * @param {HTMLElement|string} [container] flash对象的父容器元素,不传递该参数时在当前代码位置创建flash对象。 + * @meta standard + * @see baidu.swf.createHTML,baidu.swf.getMovie + */ +baidu.swf.create = function (options, target) { + options = options || {}; + var html = baidu.swf.createHTML(options) + || options['errorMessage'] + || ''; + + if (target && 'string' == typeof target) { + target = document.getElementById(target); + } + baidu.dom.insertHTML( target || document.body ,'beforeEnd',html ); +}; +/** + * 判断是否为ie浏览器 + * @name baidu.browser.ie + * @field + * @grammar baidu.browser.ie + * @returns {Number} IE版本号 + */ +baidu.browser.ie = baidu.ie = /msie (\d+\.\d+)/i.test(navigator.userAgent) ? (document.documentMode || + RegExp['\x241']) : undefined; + +/** + * 移除数组中的项 + * @name baidu.array.remove + * @function + * @grammar baidu.array.remove(source, match) + * @param {Array} source 需要移除项的数组 + * @param {Any} match 要移除的项 + * @meta standard + * @see baidu.array.removeAt + * + * @returns {Array} 移除后的数组 + */ +baidu.array.remove = function (source, match) { + var len = source.length; + + while (len--) { + if (len in source && source[len] === match) { + source.splice(len, 1); + } + } + return source; +}; + +/** + * 判断目标参数是否Array对象 + * @name baidu.lang.isArray + * @function + * @grammar baidu.lang.isArray(source) + * @param {Any} source 目标参数 + * @meta standard + * @see baidu.lang.isString,baidu.lang.isObject,baidu.lang.isNumber,baidu.lang.isElement,baidu.lang.isBoolean,baidu.lang.isDate + * + * @returns {boolean} 类型判断结果 + */ +baidu.lang.isArray = function (source) { + return '[object Array]' == Object.prototype.toString.call(source); +}; + + + +/** + * 将一个变量转换成array + * @name baidu.lang.toArray + * @function + * @grammar baidu.lang.toArray(source) + * @param {mix} source 需要转换成array的变量 + * @version 1.3 + * @meta standard + * @returns {array} 转换后的array + */ +baidu.lang.toArray = function (source) { + if (source === null || source === undefined) + return []; + if (baidu.lang.isArray(source)) + return source; + if (typeof source.length !== 'number' || typeof source === 'string' || baidu.lang.isFunction(source)) { + return [source]; + } + if (source.item) { + var l = source.length, array = new Array(l); + while (l--) + array[l] = source[l]; + return array; + } + + return [].slice.call(source); +}; + +/** + * 获得flash对象的实例 + * @name baidu.swf.getMovie + * @function + * @grammar baidu.swf.getMovie(name) + * @param {string} name flash对象的名称 + * @see baidu.swf.create + * @meta standard + * @returns {HTMLElement} flash对象的实例 + */ +baidu.swf.getMovie = function (name) { + var movie = document[name], ret; + return baidu.browser.ie == 9 ? + movie && movie.length ? + (ret = baidu.array.remove(baidu.lang.toArray(movie),function(item){ + return item.tagName.toLowerCase() != "embed"; + })).length == 1 ? ret[0] : ret + : movie + : movie || window[name]; +}; + + +baidu.flash._Base = (function(){ + + var prefix = 'bd__flash__'; + + /** + * 创建一个随机的字符串 + * @private + * @return {String} + */ + function _createString(){ + return prefix + Math.floor(Math.random() * 2147483648).toString(36); + }; + + /** + * 检查flash状态 + * @private + * @param {Object} target flash对象 + * @return {Boolean} + */ + function _checkReady(target){ + if(typeof target !== 'undefined' && typeof target.flashInit !== 'undefined' && target.flashInit()){ + return true; + }else{ + return false; + } + }; + + /** + * 调用之前进行压栈的函数 + * @private + * @param {Array} callQueue 调用队列 + * @param {Object} target flash对象 + * @return {Null} + */ + function _callFn(callQueue, target){ + var result = null; + + callQueue = callQueue.reverse(); + baidu.each(callQueue, function(item){ + result = target.call(item.fnName, item.params); + item.callBack(result); + }); + }; + + /** + * 为传入的匿名函数创建函数名 + * @private + * @param {String|Function} fun 传入的匿名函数或者函数名 + * @return {String} + */ + function _createFunName(fun){ + var name = ''; + + if(baidu.lang.isFunction(fun)){ + name = _createString(); + window[name] = function(){ + fun.apply(window, arguments); + }; + + return name; + }else if(baidu.lang.isString){ + return fun; + } + }; + + /** + * 绘制flash + * @private + * @param {Object} options 创建参数 + * @return {Object} + */ + function _render(options){ + if(!options.id){ + options.id = _createString(); + } + + var container = options.container || ''; + delete(options.container); + + baidu.swf.create(options, container); + + return baidu.swf.getMovie(options.id); + }; + + return function(options, callBack){ + var me = this, + autoRender = (typeof options.autoRender !== 'undefined' ? options.autoRender : true), + createOptions = options.createOptions || {}, + target = null, + isReady = false, + callQueue = [], + timeHandle = null, + callBack = callBack || []; + + /** + * 将flash文件绘制到页面上 + * @public + * @return {Null} + */ + me.render = function(){ + target = _render(createOptions); + + if(callBack.length > 0){ + baidu.each(callBack, function(funName, index){ + callBack[index] = _createFunName(options[funName] || new Function()); + }); + } + me.call('setJSFuncName', [callBack]); + }; + + /** + * 返回flash状态 + * @return {Boolean} + */ + me.isReady = function(){ + return isReady; + }; + + /** + * 调用flash接口的统一入口 + * @param {String} fnName 调用的函数名 + * @param {Array} params 传入的参数组成的数组,若不许要参数,需传入空数组 + * @param {Function} [callBack] 异步调用后将返回值作为参数的调用回调函数,如无返回值,可以不传入此参数 + * @return {Null} + */ + me.call = function(fnName, params, callBack){ + if(!fnName) return null; + callBack = callBack || new Function(); + + var result = null; + + if(isReady){ + result = target.call(fnName, params); + callBack(result); + }else{ + callQueue.push({ + fnName: fnName, + params: params, + callBack: callBack + }); + + (!timeHandle) && (timeHandle = setInterval(_check, 200)); + } + }; + + /** + * 为传入的匿名函数创建函数名 + * @public + * @param {String|Function} fun 传入的匿名函数或者函数名 + * @return {String} + */ + me.createFunName = function(fun){ + return _createFunName(fun); + }; + + /** + * 检查flash是否ready, 并进行调用 + * @private + * @return {Null} + */ + function _check(){ + if(_checkReady(target)){ + clearInterval(timeHandle); + timeHandle = null; + _call(); + + isReady = true; + } + }; + + /** + * 调用之前进行压栈的函数 + * @private + * @return {Null} + */ + function _call(){ + _callFn(callQueue, target); + callQueue = []; + } + + autoRender && me.render(); + }; +})(); + + + +/** + * 创建flash based imageUploader + * @class + * @grammar baidu.flash.imageUploader(options) + * @param {Object} createOptions 创建flash时需要的参数,请参照baidu.swf.create文档 + * @config {Object} vars 创建imageUploader时所需要的参数 + * @config {Number} vars.gridWidth 每一个预览图片所占的宽度,应该为flash寛的整除 + * @config {Number} vars.gridHeight 每一个预览图片所占的高度,应该为flash高的整除 + * @config {Number} vars.picWidth 单张预览图片的宽度 + * @config {Number} vars.picHeight 单张预览图片的高度 + * @config {String} vars.uploadDataFieldName POST请求中图片数据的key,默认值'picdata' + * @config {String} vars.picDescFieldName POST请求中图片描述的key,默认值'picDesc' + * @config {Number} vars.maxSize 文件的最大体积,单位'MB' + * @config {Number} vars.compressSize 上传前如果图片体积超过该值,会先压缩 + * @config {Number} vars.maxNum:32 最大上传多少个文件 + * @config {Number} vars.compressLength 能接受的最大边长,超过该值会等比压缩 + * @config {String} vars.url 上传的url地址 + * @config {Number} vars.mode mode == 0时,是使用滚动条,mode == 1时,拉伸flash, 默认值为0 + * @see baidu.swf.createHTML + * @param {String} backgroundUrl 背景图片路径 + * @param {String} listBacgroundkUrl 布局控件背景 + * @param {String} buttonUrl 按钮图片不背景 + * @param {String|Function} selectFileCallback 选择文件的回调 + * @param {String|Function} exceedFileCallback文件超出限制的最大体积时的回调 + * @param {String|Function} deleteFileCallback 删除文件的回调 + * @param {String|Function} startUploadCallback 开始上传某个文件时的回调 + * @param {String|Function} uploadCompleteCallback 某个文件上传完成的回调 + * @param {String|Function} uploadErrorCallback 某个文件上传失败的回调 + * @param {String|Function} allCompleteCallback 全部上传完成时的回调 + * @param {String|Function} changeFlashHeight 改变Flash的高度,mode==1的时候才有用 + */ +baidu.flash.imageUploader = baidu.flash.imageUploader || function(options){ + + var me = this, + options = options || {}, + _flash = new baidu.flash._Base(options, [ + 'selectFileCallback', + 'exceedFileCallback', + 'deleteFileCallback', + 'startUploadCallback', + 'uploadCompleteCallback', + 'uploadErrorCallback', + 'allCompleteCallback', + 'changeFlashHeight' + ]); + /** + * 开始或回复上传图片 + * @public + * @return {Null} + */ + me.upload = function(){ + _flash.call('upload'); + }; + + /** + * 暂停上传图片 + * @public + * @return {Null} + */ + me.pause = function(){ + _flash.call('pause'); + }; + me.addCustomizedParams = function(index,obj){ + _flash.call('addCustomizedParams',[index,obj]); + } +}; + +/** + * 操作原生对象的方法 + * @namespace baidu.object + */ +baidu.object = baidu.object || {}; + + +/** + * 将源对象的所有属性拷贝到目标对象中 + * @author erik + * @name baidu.object.extend + * @function + * @grammar baidu.object.extend(target, source) + * @param {Object} target 目标对象 + * @param {Object} source 源对象 + * @see baidu.array.merge + * @remark + * +1.目标对象中,与源对象key相同的成员将会被覆盖。
    +2.源对象的prototype成员不会拷贝。 + + * @shortcut extend + * @meta standard + * + * @returns {Object} 目标对象 + */ +baidu.extend = +baidu.object.extend = function (target, source) { + for (var p in source) { + if (source.hasOwnProperty(p)) { + target[p] = source[p]; + } + } + + return target; +}; + + + + + +/** + * 创建flash based fileUploader + * @class + * @grammar baidu.flash.fileUploader(options) + * @param {Object} options + * @config {Object} createOptions 创建flash时需要的参数,请参照baidu.swf.create文档 + * @config {String} createOptions.width + * @config {String} createOptions.height + * @config {Number} maxNum 最大可选文件数 + * @config {Function|String} selectFile + * @config {Function|String} exceedMaxSize + * @config {Function|String} deleteFile + * @config {Function|String} uploadStart + * @config {Function|String} uploadComplete + * @config {Function|String} uploadError + * @config {Function|String} uploadProgress + */ +baidu.flash.fileUploader = baidu.flash.fileUploader || function(options){ + var me = this, + options = options || {}; + + options.createOptions = baidu.extend({ + wmod: 'transparent' + },options.createOptions || {}); + + var _flash = new baidu.flash._Base(options, [ + 'selectFile', + 'exceedMaxSize', + 'deleteFile', + 'uploadStart', + 'uploadComplete', + 'uploadError', + 'uploadProgress' + ]); + + _flash.call('setMaxNum', options.maxNum ? [options.maxNum] : [1]); + + /** + * 设置当鼠标移动到flash上时,是否变成手型 + * @public + * @param {Boolean} isCursor + * @return {Null} + */ + me.setHandCursor = function(isCursor){ + _flash.call('setHandCursor', [isCursor || false]); + }; + + /** + * 设置鼠标相应函数名 + * @param {String|Function} fun + */ + me.setMSFunName = function(fun){ + _flash.call('setMSFunName',[_flash.createFunName(fun)]); + }; + + /** + * 执行上传操作 + * @param {String} url 上传的url + * @param {String} fieldName 上传的表单字段名 + * @param {Object} postData 键值对,上传的POST数据 + * @param {Number|Array|null|-1} [index]上传的文件序列 + * Int值上传该文件 + * Array一次串行上传该序列文件 + * -1/null上传所有文件 + * @return {Null} + */ + me.upload = function(url, fieldName, postData, index){ + + if(typeof url !== 'string' || typeof fieldName !== 'string') return null; + if(typeof index === 'undefined') index = -1; + + _flash.call('upload', [url, fieldName, postData, index]); + }; + + /** + * 取消上传操作 + * @public + * @param {Number|-1} index + */ + me.cancel = function(index){ + if(typeof index === 'undefined') index = -1; + _flash.call('cancel', [index]); + }; + + /** + * 删除文件 + * @public + * @param {Number|Array} [index] 要删除的index,不传则全部删除 + * @param {Function} callBack + * */ + me.deleteFile = function(index, callBack){ + + var callBackAll = function(list){ + callBack && callBack(list); + }; + + if(typeof index === 'undefined'){ + _flash.call('deleteFilesAll', [], callBackAll); + return; + }; + + if(typeof index === 'Number') index = [index]; + index.sort(function(a,b){ + return b-a; + }); + baidu.each(index, function(item){ + _flash.call('deleteFileBy', item, callBackAll); + }); + }; + + /** + * 添加文件类型,支持macType + * @public + * @param {Object|Array[Object]} type {description:String, extention:String} + * @return {Null}; + */ + me.addFileType = function(type){ + var type = type || [[]]; + + if(type instanceof Array) type = [type]; + else type = [[type]]; + _flash.call('addFileTypes', type); + }; + + /** + * 设置文件类型,支持macType + * @public + * @param {Object|Array[Object]} type {description:String, extention:String} + * @return {Null}; + */ + me.setFileType = function(type){ + var type = type || [[]]; + + if(type instanceof Array) type = [type]; + else type = [[type]]; + _flash.call('setFileTypes', type); + }; + + /** + * 设置可选文件的数量限制 + * @public + * @param {Number} num + * @return {Null} + */ + me.setMaxNum = function(num){ + _flash.call('setMaxNum', [num]); + }; + + /** + * 设置可选文件大小限制,以兆M为单位 + * @public + * @param {Number} num,0为无限制 + * @return {Null} + */ + me.setMaxSize = function(num){ + _flash.call('setMaxSize', [num]); + }; + + /** + * @public + */ + me.getFileAll = function(callBack){ + _flash.call('getFileAll', [], callBack); + }; + + /** + * @public + * @param {Number} index + * @param {Function} [callBack] + */ + me.getFileByIndex = function(index, callBack){ + _flash.call('getFileByIndex', [], callBack); + }; + + /** + * @public + * @param {Number} index + * @param {function} [callBack] + */ + me.getStatusByIndex = function(index, callBack){ + _flash.call('getStatusByIndex', [], callBack); + }; +}; + +/** + * 使用动态script标签请求服务器资源,包括由服务器端的回调和浏览器端的回调 + * @namespace baidu.sio + */ +baidu.sio = baidu.sio || {}; + +/** + * + * @param {HTMLElement} src script节点 + * @param {String} url script节点的地址 + * @param {String} [charset] 编码 + */ +baidu.sio._createScriptTag = function(scr, url, charset){ + scr.setAttribute('type', 'text/javascript'); + charset && scr.setAttribute('charset', charset); + scr.setAttribute('src', url); + document.getElementsByTagName('head')[0].appendChild(scr); +}; + +/** + * 删除script的属性,再删除script标签,以解决修复内存泄漏的问题 + * + * @param {HTMLElement} src script节点 + */ +baidu.sio._removeScriptTag = function(scr){ + if (scr.clearAttributes) { + scr.clearAttributes(); + } else { + for (var attr in scr) { + if (scr.hasOwnProperty(attr)) { + delete scr[attr]; + } + } + } + if(scr && scr.parentNode){ + scr.parentNode.removeChild(scr); + } + scr = null; +}; + + +/** + * 通过script标签加载数据,加载完成由浏览器端触发回调 + * @name baidu.sio.callByBrowser + * @function + * @grammar baidu.sio.callByBrowser(url, opt_callback, opt_options) + * @param {string} url 加载数据的url + * @param {Function|string} opt_callback 数据加载结束时调用的函数或函数名 + * @param {Object} opt_options 其他可选项 + * @config {String} [charset] script的字符集 + * @config {Integer} [timeOut] 超时时间,超过这个时间将不再响应本请求,并触发onfailure函数 + * @config {Function} [onfailure] timeOut设定后才生效,到达超时时间时触发本函数 + * @remark + * 1、与callByServer不同,callback参数只支持Function类型,不支持string。 + * 2、如果请求了一个不存在的页面,callback函数在IE/opera下也会被调用,因此使用者需要在onsuccess函数中判断数据是否正确加载。 + * @meta standard + * @see baidu.sio.callByServer + */ +baidu.sio.callByBrowser = function (url, opt_callback, opt_options) { + var scr = document.createElement("SCRIPT"), + scriptLoaded = 0, + options = opt_options || {}, + charset = options['charset'], + callback = opt_callback || function(){}, + timeOut = options['timeOut'] || 0, + timer; + scr.onload = scr.onreadystatechange = function () { + if (scriptLoaded) { + return; + } + + var readyState = scr.readyState; + if ('undefined' == typeof readyState + || readyState == "loaded" + || readyState == "complete") { + scriptLoaded = 1; + try { + callback(); + clearTimeout(timer); + } finally { + scr.onload = scr.onreadystatechange = null; + baidu.sio._removeScriptTag(scr); + } + } + }; + + if( timeOut ){ + timer = setTimeout(function(){ + scr.onload = scr.onreadystatechange = null; + baidu.sio._removeScriptTag(scr); + options.onfailure && options.onfailure(); + }, timeOut); + } + + baidu.sio._createScriptTag(scr, url, charset); +}; + +/** + * 通过script标签加载数据,加载完成由服务器端触发回调 + * @name baidu.sio.callByServer + * @function + * @grammar baidu.sio.callByServer(url, callback[, opt_options]) + * @param {string} url 加载数据的url. + * @param {Function|string} callback 服务器端调用的函数或函数名。如果没有指定本参数,将在URL中寻找options['queryField']做为callback的方法名. + * @param {Object} opt_options 加载数据时的选项. + * @config {string} [charset] script的字符集 + * @config {string} [queryField] 服务器端callback请求字段名,默认为callback + * @config {Integer} [timeOut] 超时时间(单位:ms),超过这个时间将不再响应本请求,并触发onfailure函数 + * @config {Function} [onfailure] timeOut设定后才生效,到达超时时间时触发本函数 + * @remark + * 如果url中已经包含key为“options['queryField']”的query项,将会被替换成callback中参数传递或自动生成的函数名。 + * @meta standard + * @see baidu.sio.callByBrowser + */ +baidu.sio.callByServer = /**@function*/function(url, callback, opt_options) { + var scr = document.createElement('SCRIPT'), + prefix = 'bd__cbs__', + callbackName, + callbackImpl, + options = opt_options || {}, + charset = options['charset'], + queryField = options['queryField'] || 'callback', + timeOut = options['timeOut'] || 0, + timer, + reg = new RegExp('(\\?|&)' + queryField + '=([^&]*)'), + matches; + + if (baidu.lang.isFunction(callback)) { + callbackName = prefix + Math.floor(Math.random() * 2147483648).toString(36); + window[callbackName] = getCallBack(0); + } else if(baidu.lang.isString(callback)){ + callbackName = callback; + } else { + if (matches = reg.exec(url)) { + callbackName = matches[2]; + } + } + + if( timeOut ){ + timer = setTimeout(getCallBack(1), timeOut); + } + url = url.replace(reg, '\x241' + queryField + '=' + callbackName); + + if (url.search(reg) < 0) { + url += (url.indexOf('?') < 0 ? '?' : '&') + queryField + '=' + callbackName; + } + baidu.sio._createScriptTag(scr, url, charset); + + /* + * 返回一个函数,用于立即(挂在window上)或者超时(挂在setTimeout中)时执行 + */ + function getCallBack(onTimeOut){ + /*global callbackName, callback, scr, options;*/ + return function(){ + try { + if( onTimeOut ){ + options.onfailure && options.onfailure(); + }else{ + callback.apply(window, arguments); + clearTimeout(timer); + } + window[callbackName] = null; + delete window[callbackName]; + } catch (exception) { + } finally { + baidu.sio._removeScriptTag(scr); + } + } + } +}; + +/** + * 通过请求一个图片的方式令服务器存储一条日志 + * @function + * @grammar baidu.sio.log(url) + * @param {string} url 要发送的地址. + * @author: int08h,leeight + */ +baidu.sio.log = function(url) { + var img = new Image(), + key = 'tangram_sio_log_' + Math.floor(Math.random() * + 2147483648).toString(36); + window[key] = img; + + img.onload = img.onerror = img.onabort = function() { + img.onload = img.onerror = img.onabort = null; + + window[key] = null; + img = null; + }; + img.src = url; +}; + + + +/* + * Tangram + * Copyright 2009 Baidu Inc. All rights reserved. + * + * path: baidu/json.js + * author: erik + * version: 1.1.0 + * date: 2009/12/02 + */ + + +/** + * 操作json对象的方法 + * @namespace baidu.json + */ +baidu.json = baidu.json || {}; +/* + * Tangram + * Copyright 2009 Baidu Inc. All rights reserved. + * + * path: baidu/json/parse.js + * author: erik, berg + * version: 1.2 + * date: 2009/11/23 + */ + + + +/** + * 将字符串解析成json对象。注:不会自动祛除空格 + * @name baidu.json.parse + * @function + * @grammar baidu.json.parse(data) + * @param {string} source 需要解析的字符串 + * @remark + * 该方法的实现与ecma-262第五版中规定的JSON.parse不同,暂时只支持传入一个参数。后续会进行功能丰富。 + * @meta standard + * @see baidu.json.stringify,baidu.json.decode + * + * @returns {JSON} 解析结果json对象 + */ +baidu.json.parse = function (data) { + //2010/12/09:更新至不使用原生parse,不检测用户输入是否正确 + return (new Function("return (" + data + ")"))(); +}; +/* + * Tangram + * Copyright 2009 Baidu Inc. All rights reserved. + * + * path: baidu/json/decode.js + * author: erik, cat + * version: 1.3.4 + * date: 2010/12/23 + */ + + + +/** + * 将字符串解析成json对象,为过时接口,今后会被baidu.json.parse代替 + * @name baidu.json.decode + * @function + * @grammar baidu.json.decode(source) + * @param {string} source 需要解析的字符串 + * @meta out + * @see baidu.json.encode,baidu.json.parse + * + * @returns {JSON} 解析结果json对象 + */ +baidu.json.decode = baidu.json.parse; +/* + * Tangram + * Copyright 2009 Baidu Inc. All rights reserved. + * + * path: baidu/json/stringify.js + * author: erik + * version: 1.1.0 + * date: 2010/01/11 + */ + + + +/** + * 将json对象序列化 + * @name baidu.json.stringify + * @function + * @grammar baidu.json.stringify(value) + * @param {JSON} value 需要序列化的json对象 + * @remark + * 该方法的实现与ecma-262第五版中规定的JSON.stringify不同,暂时只支持传入一个参数。后续会进行功能丰富。 + * @meta standard + * @see baidu.json.parse,baidu.json.encode + * + * @returns {string} 序列化后的字符串 + */ +baidu.json.stringify = (function () { + /** + * 字符串处理时需要转义的字符表 + * @private + */ + var escapeMap = { + "\b": '\\b', + "\t": '\\t', + "\n": '\\n', + "\f": '\\f', + "\r": '\\r', + '"' : '\\"', + "\\": '\\\\' + }; + + /** + * 字符串序列化 + * @private + */ + function encodeString(source) { + if (/["\\\x00-\x1f]/.test(source)) { + source = source.replace( + /["\\\x00-\x1f]/g, + function (match) { + var c = escapeMap[match]; + if (c) { + return c; + } + c = match.charCodeAt(); + return "\\u00" + + Math.floor(c / 16).toString(16) + + (c % 16).toString(16); + }); + } + return '"' + source + '"'; + } + + /** + * 数组序列化 + * @private + */ + function encodeArray(source) { + var result = ["["], + l = source.length, + preComma, i, item; + + for (i = 0; i < l; i++) { + item = source[i]; + + switch (typeof item) { + case "undefined": + case "function": + case "unknown": + break; + default: + if(preComma) { + result.push(','); + } + result.push(baidu.json.stringify(item)); + preComma = 1; + } + } + result.push("]"); + return result.join(""); + } + + /** + * 处理日期序列化时的补零 + * @private + */ + function pad(source) { + return source < 10 ? '0' + source : source; + } + + /** + * 日期序列化 + * @private + */ + function encodeDate(source){ + return '"' + source.getFullYear() + "-" + + pad(source.getMonth() + 1) + "-" + + pad(source.getDate()) + "T" + + pad(source.getHours()) + ":" + + pad(source.getMinutes()) + ":" + + pad(source.getSeconds()) + '"'; + } + + return function (value) { + switch (typeof value) { + case 'undefined': + return 'undefined'; + + case 'number': + return isFinite(value) ? String(value) : "null"; + + case 'string': + return encodeString(value); + + case 'boolean': + return String(value); + + default: + if (value === null) { + return 'null'; + } else if (value instanceof Array) { + return encodeArray(value); + } else if (value instanceof Date) { + return encodeDate(value); + } else { + var result = ['{'], + encode = baidu.json.stringify, + preComma, + item; + + for (var key in value) { + if (Object.prototype.hasOwnProperty.call(value, key)) { + item = value[key]; + switch (typeof item) { + case 'undefined': + case 'unknown': + case 'function': + break; + default: + if (preComma) { + result.push(','); + } + preComma = 1; + result.push(encode(key) + ':' + encode(item)); + } + } + } + result.push('}'); + return result.join(''); + } + } + }; +})(); +/* + * Tangram + * Copyright 2009 Baidu Inc. All rights reserved. + * + * path: baidu/json/encode.js + * author: erik, cat + * version: 1.3.4 + * date: 2010/12/23 + */ + + + +/** + * 将json对象序列化,为过时接口,今后会被baidu.json.stringify代替 + * @name baidu.json.encode + * @function + * @grammar baidu.json.encode(value) + * @param {JSON} value 需要序列化的json对象 + * @meta out + * @see baidu.json.decode,baidu.json.stringify + * + * @returns {string} 序列化后的字符串 + */ +baidu.json.encode = baidu.json.stringify; diff --git a/public/static/Ueditor/dialogs/wordimage/wordimage.html b/public/static/Ueditor/dialogs/wordimage/wordimage.html new file mode 100644 index 0000000..6cf6067 --- /dev/null +++ b/public/static/Ueditor/dialogs/wordimage/wordimage.html @@ -0,0 +1,111 @@ + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    + +
    + : +
    +
    +
    + + + + + + \ No newline at end of file diff --git a/public/static/Ueditor/dialogs/wordimage/wordimage.js b/public/static/Ueditor/dialogs/wordimage/wordimage.js new file mode 100644 index 0000000..614a181 --- /dev/null +++ b/public/static/Ueditor/dialogs/wordimage/wordimage.js @@ -0,0 +1,155 @@ +/** + * Created by JetBrains PhpStorm. + * User: taoqili + * Date: 12-1-30 + * Time: 下午12:50 + * To change this template use File | Settings | File Templates. + */ + +var wordImage = {} +// (function(){ +var g = baidu.g, + flashObj, flashContainer + +wordImage.init = function (opt, callbacks) { + showLocalPath('localPath') + // createCopyButton("clipboard","localPath"); + createFlashUploader(opt, callbacks) + addUploadListener() + addOkListener() +} + +function hideFlash () { + flashObj = null + flashContainer.innerHTML = '' +} +function addOkListener () { + dialog.onok = function () { + if (!imageUrls.length) return + var urlPrefix = editor.getOpt('imageUrlPrefix'), + images = domUtils.getElementsByTagName(editor.document, 'img') + editor.fireEvent('saveScene') + for (var i = 0, img; img = images[i++];) { + var src = img.getAttribute('word_img') + if (!src) continue + for (var j = 0, url; url = imageUrls[j++];) { + if (src.indexOf(url.original.replace(' ', '')) != -1) { + img.src = urlPrefix + url.url + img.setAttribute('_src', urlPrefix + url.url) // 同时修改"_src"属性 + img.setAttribute('title', url.title) + domUtils.removeAttributes(img, ['word_img', 'style', 'width', 'height']) + editor.fireEvent('selectionchange') + break + } + } + } + editor.fireEvent('saveScene') + hideFlash() + } + dialog.oncancel = function () { + hideFlash() + } +} + +/** + * 绑定开始上传事件 + */ +function addUploadListener () { + g('upload').onclick = function () { + flashObj.upload() + this.style.display = 'none' + } +} + +function showLocalPath (id) { + // 单张编辑 + var img = editor.selection.getRange().getClosedNode() + var images = editor.execCommand('wordimage') + if (images.length == 1 || img && img.tagName == 'IMG') { + g(id).value = images[0] + return + } + var path = images[0] + var leftSlashIndex = path.lastIndexOf('/') || 0, // 不同版本的doc和浏览器都可能影响到这个符号,故直接判断两种 + rightSlashIndex = path.lastIndexOf('\\') || 0, + separater = leftSlashIndex > rightSlashIndex ? '/' : '\\' + + path = path.substring(0, path.lastIndexOf(separater) + 1) + g(id).value = path +} + +function createFlashUploader (opt, callbacks) { + // 由于lang.flashI18n是静态属性,不可以直接进行修改,否则会影响到后续内容 + var i18n = utils.extend({}, lang.flashI18n) + // 处理图片资源地址的编码,补全等问题 + for (var i in i18n) { + if (!(i in {'lang': 1, 'uploadingTF': 1, 'imageTF': 1, 'textEncoding': 1}) && i18n[i]) { + i18n[i] = encodeURIComponent(editor.options.langPath + editor.options.lang + '/images/' + i18n[i]) + } + } + opt = utils.extend(opt, i18n, false) + var option = { + createOptions: { + id: 'flash', + url: opt.flashUrl, + width: opt.width, + height: opt.height, + errorMessage: lang.flashError, + wmode: browser.safari ? 'transparent' : 'window', + ver: '10.0.0', + vars: opt, + container: opt.container + } + } + + option = extendProperty(callbacks, option) + flashObj = new baidu.flash.imageUploader(option) + flashContainer = $G(opt.container) +} + +function extendProperty (fromObj, toObj) { + for (var i in fromObj) { + if (!toObj[i]) { + toObj[i] = fromObj[i] + } + } + return toObj +} + +// })(); + +function getPasteData (id) { + baidu.g('msg').innerHTML = lang.copySuccess + '
    ' + setTimeout(function () { + baidu.g('msg').innerHTML = '' + }, 5000) + return baidu.g(id).value +} + +function createCopyButton (id, dataFrom) { + baidu.swf.create({ + id: 'copyFlash', + url: 'fClipboard_ueditor.swf', + width: '58', + height: '25', + errorMessage: '', + bgColor: '#CBCBCB', + wmode: 'transparent', + ver: '10.0.0', + vars: { + tid: dataFrom + } + }, id + ) + + var clipboard = baidu.swf.getMovie('copyFlash') + var clipinterval = setInterval(function () { + if (clipboard && clipboard.flashInit) { + clearInterval(clipinterval) + clipboard.setHandCursor(true) + clipboard.setContentFuncName('getPasteData') + // clipboard.setMEFuncName("mouseEventHandler"); + } + }, 500) +} +createCopyButton('clipboard', 'localPath') diff --git a/public/static/Ueditor/index.html b/public/static/Ueditor/index.html new file mode 100644 index 0000000..4e02992 --- /dev/null +++ b/public/static/Ueditor/index.html @@ -0,0 +1,175 @@ + + + + 完整demo + + + + + + + + + + +
    +

    完整demo

    + +
    +
    +
    + + + + + + + + + + + +
    +
    + + + + + + + +
    + +
    + + +
    + +
    +
    + + +
    + + + + \ No newline at end of file diff --git a/public/static/Ueditor/lang/en/en.js b/public/static/Ueditor/lang/en/en.js new file mode 100644 index 0000000..c7e22f5 --- /dev/null +++ b/public/static/Ueditor/lang/en/en.js @@ -0,0 +1,684 @@ +/** + * Created with JetBrains PhpStorm. + * User: taoqili + * Date: 12-6-12 + * Time: 下午6:57 + * To change this template use File | Settings | File Templates. + */ +UE.I18N['en'] = { + 'labelMap':{ + 'anchor':'Anchor', 'undo':'Undo', 'redo':'Redo', 'bold':'Bold', 'indent':'Indent', 'snapscreen':'SnapScreen', + 'italic':'Italic', 'underline':'Underline', 'strikethrough':'Strikethrough', 'subscript':'SubScript','fontborder':'text border', + 'superscript':'SuperScript', 'formatmatch':'Format Match', 'source':'Source', 'blockquote':'BlockQuote', + 'pasteplain':'PastePlain', 'selectall':'SelectAll', 'print':'Print', 'preview':'Preview', + 'horizontal':'Horizontal', 'removeformat':'RemoveFormat', 'time':'Time', 'date':'Date', + 'unlink':'Unlink', 'insertrow':'InsertRow', 'insertcol':'InsertCol', 'mergeright':'MergeRight', 'mergedown':'MergeDown', + 'deleterow':'DeleteRow', 'deletecol':'DeleteCol', 'splittorows':'SplitToRows','insertcode':'insert code', + 'splittocols':'SplitToCols', 'splittocells':'SplitToCells','deletecaption':'DeleteCaption','inserttitle':'InsertTitle', + 'mergecells':'MergeCells', 'deletetable':'DeleteTable', 'cleardoc':'Clear', 'insertparagraphbeforetable':"InsertParagraphBeforeTable", + 'fontfamily':'FontFamily', 'fontsize':'FontSize', 'paragraph':'Paragraph','simpleupload':'Single Image','insertimage':'Multi Image','edittable':'Edit Table', 'edittd':'Edit Td','link':'Link', + 'emotion':'Emotion', 'spechars':'Spechars', 'searchreplace':'SearchReplace', 'map':'BaiduMap', 'gmap':'GoogleMap', + 'insertvideo':'Video', 'help':'Help', 'justifyleft':'JustifyLeft', 'justifyright':'JustifyRight', 'justifycenter':'JustifyCenter', + 'justifyjustify':'Justify', 'forecolor':'FontColor', 'backcolor':'BackColor', 'insertorderedlist':'OL', + 'insertunorderedlist':'UL', 'fullscreen':'FullScreen', 'directionalityltr':'EnterFromLeft', 'directionalityrtl':'EnterFromRight', + 'rowspacingtop':'RowSpacingTop', 'rowspacingbottom':'RowSpacingBottom', 'pagebreak':'PageBreak', 'insertframe':'Iframe', 'imagenone':'Default', + 'imageleft':'ImageLeft', 'imageright':'ImageRight', 'attachment':'Attachment', 'imagecenter':'ImageCenter', 'wordimage':'WordImage', + 'lineheight':'LineHeight','edittip':'EditTip','customstyle':'CustomStyle', 'scrawl':'Scrawl', 'autotypeset':'AutoTypeset', + 'webapp':'WebAPP', 'touppercase':'UpperCase', 'tolowercase':'LowerCase','template':'Template','background':'Background','inserttable':'InsertTable', + 'music':'Music', 'charts': 'charts','drafts': 'Load from Drafts' + }, + 'insertorderedlist':{ + 'num':'1,2,3...', + 'num1':'1),2),3)...', + 'num2':'(1),(2),(3)...', + 'cn':'一,二,三....', + 'cn1':'一),二),三)....', + 'cn2':'(一),(二),(三)....', + 'decimal':'1,2,3...', + 'lower-alpha':'a,b,c...', + 'lower-roman':'i,ii,iii...', + 'upper-alpha':'A,B,C...', + 'upper-roman':'I,II,III...' + }, + 'insertunorderedlist':{ + 'circle':'○ Circle', + 'disc':'● Circle dot', + 'square':'■ Rectangle ', + 'dash' :'- Dash', + 'dot' : '。dot' + }, + 'paragraph':{'p':'Paragraph', 'h1':'Title 1', 'h2':'Title 2', 'h3':'Title 3', 'h4':'Title 4', 'h5':'Title 5', 'h6':'Title 6'}, + 'fontfamily':{ + 'songti':'Sim Sun', + 'kaiti':'Sim Kai', + 'heiti':'Sim Hei', + 'lishu':'Sim Li', + 'yahei': 'Microsoft YaHei', + 'andaleMono':'Andale Mono', + 'arial': 'Arial', + 'arialBlack':'Arial Black', + 'comicSansMs':'Comic Sans MS', + 'impact':'Impact', + 'timesNewRoman':'Times New Roman' + }, + 'customstyle':{ + 'tc':'Title center', + 'tl':'Title left', + 'im':'Important', + 'hi':'Highlight' + }, + 'autoupload': { + 'exceedSizeError': 'File Size Exceed', + 'exceedTypeError': 'File Type Not Allow', + 'jsonEncodeError': 'Server Return Format Error', + 'loading':"loading...", + 'loadError':"load error", + 'errorLoadConfig': 'Server config not loaded, upload can not work.', + }, + 'simpleupload':{ + 'exceedSizeError': 'File Size Exceed', + 'exceedTypeError': 'File Type Not Allow', + 'jsonEncodeError': 'Server Return Format Error', + 'loading':"loading...", + 'loadError':"load error", + 'errorLoadConfig': 'Server config not loaded, upload can not work.', + }, + 'elementPathTip':"Path", + 'wordCountTip':"Word Count", + 'wordCountMsg':'{#count} characters entered,{#leave} left. ', + 'wordOverFlowMsg':'The number of characters has exceeded allowable maximum values, the server may refuse to save!', + 'ok':"OK", + 'cancel':"Cancel", + 'closeDialog':"closeDialog", + 'tableDrag':"You must import the file uiUtils.js before drag! ", + 'autofloatMsg':"The plugin AutoFloat depends on EditorUI!", + 'loadconfigError': 'Get server config error.', + 'loadconfigFormatError': 'Server config format error.', + 'loadconfigHttpError': 'Get server config http error.', + 'snapScreen_plugin':{ + 'browserMsg':"Only IE supported!", + 'callBackErrorMsg':"The callback data is wrong,please check the config!", + 'uploadErrorMsg':"Upload error,please check your server environment! " + }, + 'insertcode':{ + 'as3':'ActionScript 3', + 'bash':'Bash/Shell', + 'cpp':'C/C++', + 'css':'CSS', + 'cf':'ColdFusion', + 'c#':'C#', + 'delphi':'Delphi', + 'diff':'Diff', + 'erlang':'Erlang', + 'groovy':'Groovy', + 'html':'HTML', + 'java':'Java', + 'jfx':'JavaFX', + 'js':'JavaScript', + 'pl':'Perl', + 'php':'PHP', + 'plain':'Plain Text', + 'ps':'PowerShell', + 'python':'Python', + 'ruby':'Ruby', + 'scala':'Scala', + 'sql':'SQL', + 'vb':'Visual Basic', + 'xml':'XML' + }, + 'confirmClear':"Do you confirm to clear the Document?", + 'contextMenu':{ + 'delete':"Delete", + 'selectall':"Select all", + 'deletecode':"Delete Code", + 'cleardoc':"Clear Document", + 'confirmclear':"Do you confirm to clear the Document?", + 'unlink':"Unlink", + 'paragraph':"Paragraph", + 'edittable':"Table property", + 'aligncell':'Align cell', + 'aligntable':'Table alignment', + 'tableleft':'Left float', + 'tablecenter':'Center', + 'tableright':'Right float', + 'aligntd':'Cell alignment', + 'edittd':"Cell property", + 'setbordervisible':'set table edge visible', + 'table':"Table", + 'justifyleft':'Justify Left', + 'justifyright':'Justify Right', + 'justifycenter':'Justify Center', + 'justifyjustify':'Default', + 'deletetable':"Delete table", + 'insertparagraphbefore':"InsertedBeforeLine", + 'insertparagraphafter':'InsertedAfterLine', + 'inserttable':'Insert table', + 'insertcaption':'Insert caption', + 'deletecaption':'Delete Caption', + 'inserttitle':'Insert Title', + 'deletetitle':'Delete Title', + 'inserttitlecol':'Insert Title Col', + 'deletetitlecol':'Delete Title Col', + 'averageDiseRow':'AverageDise Row', + 'averageDisCol':'AverageDis Col', + 'deleterow':"Delete row", + 'deletecol':"Delete col", + 'insertrow':"Insert row", + 'insertcol':"Insert col", + 'insertrownext':'Insert Row Next', + 'insertcolnext':'Insert Col Next', + 'mergeright':"Merge right", + 'mergeleft':"Merge left", + 'mergedown':"Merge down", + 'mergecells':"Merge cells", + 'splittocells':"Split to cells", + 'splittocols':"Split to Cols", + 'splittorows':"Split to Rows", + 'tablesort':'Table sorting', + 'enablesort':'Sorting Enable', + 'disablesort':'Sorting Disable', + 'reversecurrent':'Reverse current', + 'orderbyasc':'Order By ASCII', + 'reversebyasc':'Reverse By ASCII', + 'orderbynum':'Order By Num', + 'reversebynum':'Reverse By Num', + 'borderbk':'Border shading', + 'setcolor':'interlaced color', + 'unsetcolor':'Cancel interlacedcolor', + 'setbackground':'Background interlaced', + 'unsetbackground':'Cancel Bk interlaced', + 'redandblue':'Blue and red', + 'threecolorgradient':'Three-color gradient', + 'copy':"Copy(Ctrl + c)", + 'copymsg':"Browser does not support. Please use 'Ctrl + c' instead!", + 'paste':"Paste(Ctrl + v)", + 'pastemsg':"Browser does not support. Please use 'Ctrl + v' instead!" + }, + 'copymsg': "Browser does not support. Please use 'Ctrl + c' instead!", + 'pastemsg': "Browser does not support. Please use 'Ctrl + v' instead!", + 'anthorMsg':"Link", + 'clearColor':'Clear', + 'standardColor':'Standard color', + 'themeColor':'Theme color', + 'property':'Property', + 'default':'Default', + 'modify':'Modify', + 'justifyleft':'Justify Left', + 'justifyright':'Justify Right', + 'justifycenter':'Justify Center', + 'justify':'Default', + 'clear':'Clear', + 'anchorMsg':'Anchor', + 'delete':'Delete', + 'clickToUpload':"Click to upload", + 'unset':'Language hasn\'t been set!', + 't_row':'row', + 't_col':'col', + 'pasteOpt':'Paste Option', + 'pasteSourceFormat':"Keep Source Formatting", + 'tagFormat':'Keep tag', + 'pasteTextFormat':'Keep Text only', + 'more':'More', + 'autoTypeSet':{ + 'mergeLine':"Merge empty line", + 'delLine':"Del empty line", + 'removeFormat':"Remove format", + 'indent':"Indent", + 'alignment':"Alignment", + 'imageFloat':"Image float", + 'removeFontsize':"Remove font size", + 'removeFontFamily':"Remove fontFamily", + 'removeHtml':"Remove redundant HTML code", + 'pasteFilter':"Paste filter", + 'run':"Done", + 'symbol':'Symbol Conversion', + 'bdc2sb':'Full-width to Half-width', + 'tobdc':'Half-width to Full-width' + }, + + 'background':{ + 'static':{ + 'lang_background_normal':'Normal', + 'lang_background_local':'Online', + 'lang_background_set':'Background Set', + 'lang_background_none':'No Background', + 'lang_background_colored':'Colored Background', + 'lang_background_color':'Color Set', + 'lang_background_netimg':'Net-Image', + 'lang_background_align':'Align Type', + 'lang_background_position':'Position', + 'repeatType':{'options':["Center", "Repeat-x", "Repeat-y", "Tile","Custom"]} + }, + 'noUploadImage':"No pictures has been uploaded!", + 'toggleSelect':'Change the active state by click!\n Image Size: ' + }, + //===============dialog i18N======================= + 'insertimage':{ + 'static':{ + 'lang_tab_remote':"Insert", + 'lang_tab_upload':"Local", + 'lang_tab_online':"Manager", + 'lang_tab_search':"Search", + 'lang_input_url':"Address:", + 'lang_input_size':"Size:", + 'lang_input_width':"Width", + 'lang_input_height':"Height", + 'lang_input_border':"Border:", + 'lang_input_vhspace':"Margins:", + 'lang_input_title':"Title:", + 'lang_input_align':'Image Float Style:', + 'lang_imgLoading':"Loading...", + 'lang_start_upload':"Start Upload", + 'lock':{'title':"Lock rate"}, + 'searchType':{'title':"ImageType", 'options':["News", "Wallpaper", "emotions", "photo"]}, + 'searchTxt':{'value':"Enter the search keyword!"}, + 'searchBtn':{'value':"Search"}, + 'searchReset':{'value':"Clear"}, + 'noneAlign':{'title':'None Float'}, + 'leftAlign':{'title':'Left Float'}, + 'rightAlign':{'title':'Right Float'}, + 'centerAlign':{'title':'Center In A Line'} + }, + 'uploadSelectFile':'Select File', + 'uploadAddFile':'Add File', + 'uploadStart':'Start Upload', + 'uploadPause':'Pause Upload', + 'uploadContinue':'Continue Upload', + 'uploadRetry':'Retry Upload', + 'uploadDelete':'Delete', + 'uploadTurnLeft':'Turn Left', + 'uploadTurnRight':'Turn Right', + 'uploadPreview':'Doing Preview', + 'uploadNoPreview':'Can Not Preview', + 'updateStatusReady': 'Selected _ pictures, total _KB.', + 'updateStatusConfirm': '_ uploaded successfully and _ upload failed', + 'updateStatusFinish': 'Total _ pictures (_KB), _ uploaded successfully', + 'updateStatusError': ' and _ upload failed', + 'errorNotSupport': 'WebUploader does not support the browser you are using. Please upgrade your browser or flash player', + 'errorLoadConfig': 'Server config not loaded, upload can not work.', + 'errorExceedSize':'File Size Exceed', + 'errorFileType':'File Type Not Allow', + 'errorInterrupt':'File Upload Interrupted', + 'errorUploadRetry':'Upload Error, Please Retry.', + 'errorHttp':'Http Error', + 'errorServerUpload':'Server Result Error.', + 'remoteLockError':"Cannot Lock the Proportion between width and height", + 'numError':"Please enter the correct Num. e.g 123,400", + 'imageUrlError':"The image format may be wrong!", + 'imageLoadError':"Error,please check the network or URL!", + 'searchRemind':"Enter the search keyword!", + 'searchLoading':"Image is loading,please wait...", + 'searchRetry':" Sorry,can't find the image,please try again!" + }, + 'attachment':{ + 'static':{ + 'lang_tab_upload': 'Upload', + 'lang_tab_online': 'Online', + 'lang_start_upload':"Start upload", + 'lang_drop_remind':"You can drop files here, a single maximum of 300 files" + }, + 'uploadSelectFile':'Select File', + 'uploadAddFile':'Add File', + 'uploadStart':'Start Upload', + 'uploadPause':'Pause Upload', + 'uploadContinue':'Continue Upload', + 'uploadRetry':'Retry Upload', + 'uploadDelete':'Delete', + 'uploadTurnLeft':'Turn Left', + 'uploadTurnRight':'Turn Right', + 'uploadPreview':'Doing Preview', + 'updateStatusReady': 'Selected _ files, total _KB.', + 'updateStatusConfirm': '_ uploaded successfully and _ upload failed', + 'updateStatusFinish': 'Total _ files (_KB), _ uploaded successfully', + 'updateStatusError': ' and _ upload failed', + 'errorNotSupport': 'WebUploader does not support the browser you are using. Please upgrade your browser or flash player', + 'errorLoadConfig': 'Server config not loaded, upload can not work.', + 'errorExceedSize':'File Size Exceed', + 'errorFileType':'File Type Not Allow', + 'errorInterrupt':'File Upload Interrupted', + 'errorUploadRetry':'Upload Error, Please Retry.', + 'errorHttp':'Http Error', + 'errorServerUpload':'Server Result Error.' + }, + + 'insertvideo':{ + 'static':{ + 'lang_tab_insertV':"Video", + 'lang_tab_searchV':"Search", + 'lang_tab_uploadV':"Upload", + 'lang_video_url':" URL ", + 'lang_video_size':"Video Size", + 'lang_videoW':"Width", + 'lang_videoH':"Height", + 'lang_alignment':"Alignment", + 'videoSearchTxt':{'value':"Enter the search keyword!"}, + 'videoType':{'options':["All", "Hot", "Entertainment", "Funny", "Sports", "Science", "variety"]}, + 'videoSearchBtn':{'value':"Search in Baidu"}, + 'videoSearchReset':{'value':"Clear result"}, + + 'lang_input_fileStatus':' No file uploaded!', + 'startUpload':{'style':"background:url(upload.png) no-repeat;"}, + + 'lang_upload_size':"Video Size", + 'lang_upload_width':"Width", + 'lang_upload_height':"Height", + 'lang_upload_alignment':"Alignment", + 'lang_format_advice':"Recommends mp4 format." + }, + 'numError':"Please enter the correct Num. e.g 123,400", + 'floatLeft':"Float left", + 'floatRight':"Float right", + 'default':"Default", + 'block':"Display in block", + 'urlError':"The video url format may be wrong!", + 'loading':"  The video is loading, please wait…", + 'clickToSelect':"Click to select", + 'goToSource':'Visit source video ', + 'noVideo':"    Sorry,can't find the video,please try again!", + + 'browseFiles':'Open files', + 'uploadSuccess':'Upload Successful!', + 'delSuccessFile':'Remove from the success of the queue', + 'delFailSaveFile':'Remove the save failed file', + 'statusPrompt':' file(s) uploaded! ', + 'flashVersionError':'The current Flash version is too low, please update FlashPlayer,then try again!', + 'flashLoadingError':'The Flash failed loading! Please check the path or network state', + 'fileUploadReady':'Wait for uploading...', + 'delUploadQueue':'Remove from the uploading queue ', + 'limitPrompt1':'Can not choose more than single', + 'limitPrompt2':'file(s)!Please choose again!', + 'delFailFile':'Remove failure file', + 'fileSizeLimit':'File size exceeds the limit!', + 'emptyFile':'Can not upload an empty file!', + 'fileTypeError':'File type error!', + 'unknownError':'Unknown error!', + 'fileUploading':'Uploading,please wait...', + 'cancelUpload':'Cancel upload', + 'netError':'Network error', + 'failUpload':'Upload failed', + 'serverIOError':'Server IO error!', + 'noAuthority':'No Permission!', + 'fileNumLimit':'Upload limit to the number', + 'failCheck':'Authentication fails, the upload is skipped!', + 'fileCanceling':'Cancel, please wait...', + 'stopUploading':'Upload has stopped...', + + 'uploadSelectFile':'Select File', + 'uploadAddFile':'Add File', + 'uploadStart':'Start Upload', + 'uploadPause':'Pause Upload', + 'uploadContinue':'Continue Upload', + 'uploadRetry':'Retry Upload', + 'uploadDelete':'Delete', + 'uploadTurnLeft':'Turn Left', + 'uploadTurnRight':'Turn Right', + 'uploadPreview':'Doing Preview', + 'updateStatusReady': 'Selected _ files, total _KB.', + 'updateStatusConfirm': '_ uploaded successfully and _ upload failed', + 'updateStatusFinish': 'Total _ files (_KB), _ uploaded successfully', + 'updateStatusError': ' and _ upload failed', + 'errorNotSupport': 'WebUploader does not support the browser you are using. Please upgrade your browser or flash player', + 'errorLoadConfig': 'Server config not loaded, upload can not work.', + 'errorExceedSize':'File Size Exceed', + 'errorFileType':'File Type Not Allow', + 'errorInterrupt':'File Upload Interrupted', + 'errorUploadRetry':'Upload Error, Please Retry.', + 'errorHttp':'Http Error', + 'errorServerUpload':'Server Result Error.' + }, + 'webapp':{ + 'tip1':"This function provided by Baidu APP,please apply for baidu APPKey webmaster first!", + 'tip2':"And then open the file ueditor.config.js to set it! ", + 'applyFor':"APPLY FOR", + 'anthorApi':"Baidu API" + }, + 'template':{ + 'static':{ + 'lang_template_bkcolor':'Background Color', + 'lang_template_clear' : 'Keep Content', + 'lang_template_select':'Select Template' + }, + 'blank':"Blank", + 'blog':"Blog", + 'resume':"Resume", + 'richText':"Rich Text", + 'scrPapers':"Scientific Papers" + }, + scrawl:{ + 'static':{ + 'lang_input_previousStep':"Previous", + 'lang_input_nextsStep':"Next", + 'lang_input_clear':'Clear', + 'lang_input_addPic':'AddImage', + 'lang_input_ScalePic':'ScaleImage', + 'lang_input_removePic':'RemoveImage', + 'J_imgTxt':{title:'Add background image'} + }, + 'noScarwl':"No paint, a white paper...", + 'scrawlUpLoading':"Image is uploading, please wait...", + 'continueBtn':"Try again", + 'imageError':"Image failed to load!", + 'backgroundUploading':'Image is uploading,please wait...' + }, + 'music':{ + 'static':{ + 'lang_input_tips':"Input singer/song/album, search you interested in music!", + 'J_searchBtn':{value:'Search songs'} + }, + 'emptyTxt':'Not search to the relevant music results, please change a keyword try.', + 'chapter':'Songs', + 'singer':'Singer', + 'special':'Album', + 'listenTest':'Audition' + }, + anchor:{ + 'static':{ + 'lang_input_anchorName':'Anchor Name:' + } + }, + 'charts':{ + 'static':{ + 'lang_data_source':'Data source:', + 'lang_chart_format': 'Chart format:', + 'lang_data_align': 'Align', + 'lang_chart_align_same': 'Consistent with the X-axis Y-axis', + 'lang_chart_align_reverse': 'X-axis Y-axis opposite', + 'lang_chart_title': 'Title', + 'lang_chart_main_title': 'main title:', + 'lang_chart_sub_title': 'sub title:', + 'lang_chart_x_title': 'X-axis title:', + 'lang_chart_y_title': 'Y-axis title:', + 'lang_chart_tip': 'Prompt', + 'lang_cahrt_tip_prefix': 'prefix:', + 'lang_cahrt_tip_description': '仅饼图有效, 当鼠标移动到饼图中相应的块上时,提示框内的文字的前缀', + 'lang_chart_data_unit': 'Unit', + 'lang_chart_data_unit_title': 'unit:', + 'lang_chart_data_unit_description': '显示在每个数据点上的数据的单位, 比如: 温度的单位 ℃', + 'lang_chart_type': 'Chart type:', + 'lang_prev_btn': 'Previous', + 'lang_next_btn': 'Next' + } + }, + emotion:{ + 'static':{ + 'lang_input_choice':'Choice', + 'lang_input_Tuzki':'Tuzki', + 'lang_input_lvdouwa':'LvDouWa', + 'lang_input_BOBO':'BOBO', + 'lang_input_babyCat':'BabyCat', + 'lang_input_bubble':'Bubble', + 'lang_input_youa':'YouA' + } + }, + gmap:{ + 'static':{ + 'lang_input_address':'Address:', + 'lang_input_search':'Search', + 'address':{value:"Beijing"} + }, + searchError:'Unable to locate the address!' + }, + help:{ + 'static':{ + 'lang_input_about':'About', + 'lang_input_shortcuts':'Shortcuts', + 'lang_input_introduction':"UEditor is developed by Baidu Co.ltd. It is lightweight, customizable , focusing on user experience and etc. , UEditor is based on open source BSD license , allowing free use and redistribution.", + 'lang_Txt_shortcuts':'Shortcuts', + 'lang_Txt_func':'Function', + 'lang_Txt_bold':'Bold', + 'lang_Txt_copy':'Copy', + 'lang_Txt_cut':'Cut', + 'lang_Txt_Paste':'Paste', + 'lang_Txt_undo':'Undo', + 'lang_Txt_redo':'Redo', + 'lang_Txt_italic':'Italic', + 'lang_Txt_underline':'Underline', + 'lang_Txt_selectAll':'Select All', + 'lang_Txt_visualEnter':'Submit', + 'lang_Txt_fullscreen':'Fullscreen' + } + }, + insertframe:{ + 'static':{ + 'lang_input_address':'Address:', + 'lang_input_width':'Width:', + 'lang_input_height':'height:', + 'lang_input_isScroll':'Enable scrollbars:', + 'lang_input_frameborder':'Show frame border:', + 'lang_input_alignMode':'Alignment:', + 'align':{title:"Alignment", options:["Default", "Left", "Right", "Center"]} + }, + 'enterAddress':'Please enter an address!' + }, + link:{ + 'static':{ + 'lang_input_text':'Text:', + 'lang_input_url':'URL:', + 'lang_input_title':'Title:', + 'lang_input_target':'open in new window:' + }, + 'validLink':'Supports only effective when a link is selected', + 'httpPrompt':'The hyperlink you enter should start with "http|https|ftp://"!' + }, + map:{ + 'static':{ + lang_city:"City", + lang_address:"Address", + city:{value:"Beijing"}, + lang_search:"Search", + lang_dynamicmap:"Dynamic map" + }, + cityMsg:"Please enter the city name!", + errorMsg:"Can't find the place!" + }, + searchreplace:{ + 'static':{ + lang_tab_search:"Search", + lang_tab_replace:"Replace", + lang_search1:"Search", + lang_search2:"Search", + lang_replace:"Replace", + lang_searchReg:'Support regular expression ,which starts and ends with a slash ,for example "/expression/"', + lang_searchReg1:'Support regular expression ,which starts and ends with a slash ,for example "/expression/"', + lang_case_sensitive1:"Case sense", + lang_case_sensitive2:"Case sense", + nextFindBtn:{value:"Next"}, + preFindBtn:{value:"Preview"}, + nextReplaceBtn:{value:"Next"}, + preReplaceBtn:{value:"Preview"}, + repalceBtn:{value:"Replace"}, + repalceAllBtn:{value:"Replace all"} + }, + getEnd:"Has the search to the bottom!", + getStart:"Has the search to the top!", + countMsg:"Altogether replaced {#count} character(s)!" + }, + snapscreen:{ + 'static':{ + lang_showMsg:"You should install the UEditor screenshots program first!", + lang_download:"Download!", + lang_step1:"Step1:Download the program and then run it", + lang_step2:"Step2:After complete install,try to click the button again" + } + }, + spechars:{ + 'static':{}, + tsfh:"Special", + lmsz:"Roman", + szfh:"Numeral", + rwfh:"Japanese", + xlzm:"The Greek", + ewzm:"Russian", + pyzm:"Phonetic", + yyyb:"English", + zyzf:"Others" + }, + 'edittable':{ + 'static':{ + 'lang_tableStyle':'Table style', + 'lang_insertCaption':'Add table header row', + 'lang_insertTitle':'Add table title row', + 'lang_insertTitleCol':'Add table title col', + 'lang_tableSize':'Automatically adjust table size', + 'lang_autoSizeContent':'Adaptive by form text', + 'lang_orderbycontent':"Table of contents sortable", + 'lang_autoSizePage':'Page width adaptive', + 'lang_example':'Example', + 'lang_borderStyle':'Table Border', + 'lang_color':'Color:' + }, + captionName:'Caption', + titleName:'Title', + cellsName:'text', + errorMsg:'There are merged cells, can not sort.' + }, + 'edittip':{ + 'static':{ + lang_delRow:'Delete entire row', + lang_delCol:'Delete entire col' + } + }, + 'edittd':{ + 'static':{ + lang_tdBkColor:'Background Color:' + } + }, + 'formula':{ + 'static':{ + } + }, + wordimage:{ + 'static':{ + lang_resave:"The re-save step", + uploadBtn:{src:"upload.png", alt:"Upload"}, + clipboard:{style:"background: url(copy.png) -153px -1px no-repeat;"}, + lang_step:" 1. Click top button to copy the url and then open the dialog to paste it. 2. Open after choose photos uploaded process." + }, + fileType:"Image", + flashError:"Flash initialization failed!", + netError:"Network error! Please try again!", + copySuccess:"URL has been copied!", + + 'flashI18n':{ + lang:encodeURI( '{"UploadingState":"totalNum: ${a},uploadComplete: ${b}", "BeforeUpload":"waitingNum: ${a}", "ExceedSize":"Size exceed${a}", "ErrorInPreview":"Preview failed", "DefaultDescription":"Description", "LoadingImage":"Loading..."}' ), + uploadingTF:encodeURI( '{"font":"Arial", "size":12, "color":"0x000", "bold":"true", "italic":"false", "underline":"false"}' ), + imageTF:encodeURI( '{"font":"Arial", "size":11, "color":"red", "bold":"false", "italic":"false", "underline":"false"}' ), + textEncoding:"utf-8", + addImageSkinURL:"addImage.png", + allDeleteBtnUpSkinURL:"allDeleteBtnUpSkin.png", + allDeleteBtnHoverSkinURL:"allDeleteBtnHoverSkin.png", + rotateLeftBtnEnableSkinURL:"rotateLeftEnable.png", + rotateLeftBtnDisableSkinURL:"rotateLeftDisable.png", + rotateRightBtnEnableSkinURL:"rotateRightEnable.png", + rotateRightBtnDisableSkinURL:"rotateRightDisable.png", + deleteBtnEnableSkinURL:"deleteEnable.png", + deleteBtnDisableSkinURL:"deleteDisable.png", + backgroundURL:'', + listBackgroundURL:'', + buttonURL:'button.png' + } + }, + 'autosave': { + 'success':'Local conservation success' + } +}; diff --git a/public/static/Ueditor/lang/en/images/addimage.png b/public/static/Ueditor/lang/en/images/addimage.png new file mode 100644 index 0000000..3a2fd17 Binary files /dev/null and b/public/static/Ueditor/lang/en/images/addimage.png differ diff --git a/public/static/Ueditor/lang/en/images/alldeletebtnhoverskin.png b/public/static/Ueditor/lang/en/images/alldeletebtnhoverskin.png new file mode 100644 index 0000000..355eeab Binary files /dev/null and b/public/static/Ueditor/lang/en/images/alldeletebtnhoverskin.png differ diff --git a/public/static/Ueditor/lang/en/images/alldeletebtnupskin.png b/public/static/Ueditor/lang/en/images/alldeletebtnupskin.png new file mode 100644 index 0000000..61658ce Binary files /dev/null and b/public/static/Ueditor/lang/en/images/alldeletebtnupskin.png differ diff --git a/public/static/Ueditor/lang/en/images/background.png b/public/static/Ueditor/lang/en/images/background.png new file mode 100644 index 0000000..d5bf5fd Binary files /dev/null and b/public/static/Ueditor/lang/en/images/background.png differ diff --git a/public/static/Ueditor/lang/en/images/button.png b/public/static/Ueditor/lang/en/images/button.png new file mode 100644 index 0000000..098874c Binary files /dev/null and b/public/static/Ueditor/lang/en/images/button.png differ diff --git a/public/static/Ueditor/lang/en/images/copy.png b/public/static/Ueditor/lang/en/images/copy.png new file mode 100644 index 0000000..f982e8b Binary files /dev/null and b/public/static/Ueditor/lang/en/images/copy.png differ diff --git a/public/static/Ueditor/lang/en/images/deletedisable.png b/public/static/Ueditor/lang/en/images/deletedisable.png new file mode 100644 index 0000000..c8ee750 Binary files /dev/null and b/public/static/Ueditor/lang/en/images/deletedisable.png differ diff --git a/public/static/Ueditor/lang/en/images/deleteenable.png b/public/static/Ueditor/lang/en/images/deleteenable.png new file mode 100644 index 0000000..26acc88 Binary files /dev/null and b/public/static/Ueditor/lang/en/images/deleteenable.png differ diff --git a/public/static/Ueditor/lang/en/images/listbackground.png b/public/static/Ueditor/lang/en/images/listbackground.png new file mode 100644 index 0000000..4f82ccd Binary files /dev/null and b/public/static/Ueditor/lang/en/images/listbackground.png differ diff --git a/public/static/Ueditor/lang/en/images/localimage.png b/public/static/Ueditor/lang/en/images/localimage.png new file mode 100644 index 0000000..12c8e6a Binary files /dev/null and b/public/static/Ueditor/lang/en/images/localimage.png differ diff --git a/public/static/Ueditor/lang/en/images/music.png b/public/static/Ueditor/lang/en/images/music.png new file mode 100644 index 0000000..2f495fe Binary files /dev/null and b/public/static/Ueditor/lang/en/images/music.png differ diff --git a/public/static/Ueditor/lang/en/images/rotateleftdisable.png b/public/static/Ueditor/lang/en/images/rotateleftdisable.png new file mode 100644 index 0000000..741526e Binary files /dev/null and b/public/static/Ueditor/lang/en/images/rotateleftdisable.png differ diff --git a/public/static/Ueditor/lang/en/images/rotateleftenable.png b/public/static/Ueditor/lang/en/images/rotateleftenable.png new file mode 100644 index 0000000..e164ddb Binary files /dev/null and b/public/static/Ueditor/lang/en/images/rotateleftenable.png differ diff --git a/public/static/Ueditor/lang/en/images/rotaterightdisable.png b/public/static/Ueditor/lang/en/images/rotaterightdisable.png new file mode 100644 index 0000000..5a78c26 Binary files /dev/null and b/public/static/Ueditor/lang/en/images/rotaterightdisable.png differ diff --git a/public/static/Ueditor/lang/en/images/rotaterightenable.png b/public/static/Ueditor/lang/en/images/rotaterightenable.png new file mode 100644 index 0000000..d768531 Binary files /dev/null and b/public/static/Ueditor/lang/en/images/rotaterightenable.png differ diff --git a/public/static/Ueditor/lang/en/images/upload.png b/public/static/Ueditor/lang/en/images/upload.png new file mode 100644 index 0000000..7bb15b3 Binary files /dev/null and b/public/static/Ueditor/lang/en/images/upload.png differ diff --git a/public/static/Ueditor/lang/zh-cn/images/copy.png b/public/static/Ueditor/lang/zh-cn/images/copy.png new file mode 100644 index 0000000..b2536aa Binary files /dev/null and b/public/static/Ueditor/lang/zh-cn/images/copy.png differ diff --git a/public/static/Ueditor/lang/zh-cn/images/localimage.png b/public/static/Ueditor/lang/zh-cn/images/localimage.png new file mode 100644 index 0000000..7303c36 Binary files /dev/null and b/public/static/Ueditor/lang/zh-cn/images/localimage.png differ diff --git a/public/static/Ueditor/lang/zh-cn/images/music.png b/public/static/Ueditor/lang/zh-cn/images/music.png new file mode 100644 index 0000000..354edeb Binary files /dev/null and b/public/static/Ueditor/lang/zh-cn/images/music.png differ diff --git a/public/static/Ueditor/lang/zh-cn/images/upload.png b/public/static/Ueditor/lang/zh-cn/images/upload.png new file mode 100644 index 0000000..08d4d92 Binary files /dev/null and b/public/static/Ueditor/lang/zh-cn/images/upload.png differ diff --git a/public/static/Ueditor/lang/zh-cn/zh-cn.js b/public/static/Ueditor/lang/zh-cn/zh-cn.js new file mode 100644 index 0000000..b1e02c1 --- /dev/null +++ b/public/static/Ueditor/lang/zh-cn/zh-cn.js @@ -0,0 +1,669 @@ +/** + * Created with JetBrains PhpStorm. + * User: taoqili + * Date: 12-6-12 + * Time: 下午5:02 + * To change this template use File | Settings | File Templates. + */ +UE.I18N['zh-cn'] = { + 'labelMap':{ + 'anchor':'锚点', 'undo':'撤销', 'redo':'重做', 'bold':'加粗', 'indent':'首行缩进', 'snapscreen':'截图', + 'italic':'斜体', 'underline':'下划线', 'strikethrough':'删除线', 'subscript':'下标','fontborder':'字符边框', + 'superscript':'上标', 'formatmatch':'格式刷', 'source':'源代码', 'blockquote':'引用', + 'pasteplain':'纯文本粘贴模式', 'selectall':'全选', 'print':'打印', 'preview':'预览', + 'horizontal':'分隔线', 'removeformat':'清除格式', 'time':'时间', 'date':'日期', + 'unlink':'取消链接', 'insertrow':'前插入行', 'insertcol':'前插入列', 'mergeright':'右合并单元格', 'mergedown':'下合并单元格', + 'deleterow':'删除行', 'deletecol':'删除列', 'splittorows':'拆分成行', + 'splittocols':'拆分成列', 'splittocells':'完全拆分单元格','deletecaption':'删除表格标题','inserttitle':'插入标题', + 'mergecells':'合并多个单元格', 'deletetable':'删除表格', 'cleardoc':'清空文档','insertparagraphbeforetable':"表格前插入行",'insertcode':'代码语言', + 'fontfamily':'字体', 'fontsize':'字号', 'paragraph':'段落格式', 'simpleupload':'单图上传', 'insertimage':'多图上传','edittable':'表格属性','edittd':'单元格属性', 'link':'超链接', + 'emotion':'表情', 'spechars':'特殊字符', 'searchreplace':'查询替换', 'map':'Baidu地图', 'gmap':'Google地图', + 'insertvideo':'视频', 'help':'帮助', 'justifyleft':'居左对齐', 'justifyright':'居右对齐', 'justifycenter':'居中对齐', + 'justifyjustify':'两端对齐', 'forecolor':'字体颜色', 'backcolor':'背景色', 'insertorderedlist':'有序列表', + 'insertunorderedlist':'无序列表', 'fullscreen':'全屏', 'directionalityltr':'从左向右输入', 'directionalityrtl':'从右向左输入', + 'rowspacingtop':'段前距', 'rowspacingbottom':'段后距', 'pagebreak':'分页', 'insertframe':'插入Iframe', 'imagenone':'默认', + 'imageleft':'左浮动', 'imageright':'右浮动', 'attachment':'附件', 'imagecenter':'居中', 'wordimage':'图片转存', + 'lineheight':'行间距','edittip' :'编辑提示','customstyle':'自定义标题', 'autotypeset':'自动排版', + 'webapp':'百度应用','touppercase':'字母大写', 'tolowercase':'字母小写','background':'背景','template':'模板','scrawl':'涂鸦', + 'music':'音乐','inserttable':'插入表格','drafts': '从草稿箱加载', 'charts': '图表' + }, + 'insertorderedlist':{ + 'num':'1,2,3...', + 'num1':'1),2),3)...', + 'num2':'(1),(2),(3)...', + 'cn':'一,二,三....', + 'cn1':'一),二),三)....', + 'cn2':'(一),(二),(三)....', + 'decimal':'1,2,3...', + 'lower-alpha':'a,b,c...', + 'lower-roman':'i,ii,iii...', + 'upper-alpha':'A,B,C...', + 'upper-roman':'I,II,III...' + }, + 'insertunorderedlist':{ + 'circle':'○ 大圆圈', + 'disc':'● 小黑点', + 'square':'■ 小方块 ', + 'dash' :'— 破折号', + 'dot':' 。 小圆圈' + }, + 'paragraph':{'p':'段落', 'h1':'标题 1', 'h2':'标题 2', 'h3':'标题 3', 'h4':'标题 4', 'h5':'标题 5', 'h6':'标题 6'}, + 'fontfamily':{ + 'songti':'宋体', + 'kaiti':'楷体', + 'heiti':'黑体', + 'lishu':'隶书', + 'yahei':'微软雅黑', + 'andaleMono':'andale mono', + 'arial': 'arial', + 'arialBlack':'arial black', + 'comicSansMs':'comic sans ms', + 'impact':'impact', + 'timesNewRoman':'times new roman' + }, + 'customstyle':{ + 'tc':'标题居中', + 'tl':'标题居左', + 'im':'强调', + 'hi':'明显强调' + }, + 'autoupload': { + 'exceedSizeError': '文件大小超出限制', + 'exceedTypeError': '文件格式不允许', + 'jsonEncodeError': '服务器返回格式错误', + 'loading':"正在上传...", + 'loadError':"上传错误", + 'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!' + }, + 'simpleupload':{ + 'exceedSizeError': '文件大小超出限制', + 'exceedTypeError': '文件格式不允许', + 'jsonEncodeError': '服务器返回格式错误', + 'loading':"正在上传...", + 'loadError':"上传错误", + 'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!' + }, + 'elementPathTip':"元素路径", + 'wordCountTip':"字数统计", + 'wordCountMsg':'当前已输入{#count}个字符, 您还可以输入{#leave}个字符。 ', + 'wordOverFlowMsg':'字数超出最大允许值!', + 'ok':"确认", + 'cancel':"取消", + 'closeDialog':"关闭对话框", + 'tableDrag':"表格拖动必须引入uiUtils.js文件!", + 'autofloatMsg':"工具栏浮动依赖编辑器UI,您首先需要引入UI文件!", + 'loadconfigError': '获取后台配置项请求出错,上传功能将不能正常使用!', + 'loadconfigFormatError': '后台配置项返回格式出错,上传功能将不能正常使用!', + 'loadconfigHttpError': '请求后台配置项http错误,上传功能将不能正常使用!', + 'snapScreen_plugin':{ + 'browserMsg':"仅支持IE浏览器!", + 'callBackErrorMsg':"服务器返回数据有误,请检查配置项之后重试。", + 'uploadErrorMsg':"截图上传失败,请检查服务器端环境! " + }, + 'insertcode':{ + 'as3':'ActionScript 3', + 'bash':'Bash/Shell', + 'cpp':'C/C++', + 'css':'CSS', + 'cf':'ColdFusion', + 'c#':'C#', + 'delphi':'Delphi', + 'diff':'Diff', + 'erlang':'Erlang', + 'groovy':'Groovy', + 'html':'HTML', + 'java':'Java', + 'jfx':'JavaFX', + 'js':'JavaScript', + 'pl':'Perl', + 'php':'PHP', + 'plain':'Plain Text', + 'ps':'PowerShell', + 'python':'Python', + 'ruby':'Ruby', + 'scala':'Scala', + 'sql':'SQL', + 'vb':'Visual Basic', + 'xml':'XML' + }, + 'confirmClear':"确定清空当前文档么?", + 'contextMenu':{ + 'delete':"删除", + 'selectall':"全选", + 'deletecode':"删除代码", + 'cleardoc':"清空文档", + 'confirmclear':"确定清空当前文档么?", + 'unlink':"删除超链接", + 'paragraph':"段落格式", + 'edittable':"表格属性", + 'aligntd':"单元格对齐方式", + 'aligntable':'表格对齐方式', + 'tableleft':'左浮动', + 'tablecenter':'居中显示', + 'tableright':'右浮动', + 'edittd':"单元格属性", + 'setbordervisible':'设置表格边线可见', + 'justifyleft':'左对齐', + 'justifyright':'右对齐', + 'justifycenter':'居中对齐', + 'justifyjustify':'两端对齐', + 'table':"表格", + 'inserttable':'插入表格', + 'deletetable':"删除表格", + 'insertparagraphbefore':"前插入段落", + 'insertparagraphafter':'后插入段落', + 'deleterow':"删除当前行", + 'deletecol':"删除当前列", + 'insertrow':"前插入行", + 'insertcol':"左插入列", + 'insertrownext':'后插入行', + 'insertcolnext':'右插入列', + 'insertcaption':'插入表格名称', + 'deletecaption':'删除表格名称', + 'inserttitle':'插入表格标题行', + 'deletetitle':'删除表格标题行', + 'inserttitlecol':'插入表格标题列', + 'deletetitlecol':'删除表格标题列', + 'averageDiseRow':'平均分布各行', + 'averageDisCol':'平均分布各列', + 'mergeright':"向右合并", + 'mergeleft':"向左合并", + 'mergedown':"向下合并", + 'mergecells':"合并单元格", + 'splittocells':"完全拆分单元格", + 'splittocols':"拆分成列", + 'splittorows':"拆分成行", + 'tablesort':'表格排序', + 'enablesort':'设置表格可排序', + 'disablesort':'取消表格可排序', + 'reversecurrent':'逆序当前', + 'orderbyasc':'按ASCII字符升序', + 'reversebyasc':'按ASCII字符降序', + 'orderbynum':'按数值大小升序', + 'reversebynum':'按数值大小降序', + 'borderbk':'边框底纹', + 'setcolor':'表格隔行变色', + 'unsetcolor':'取消表格隔行变色', + 'setbackground':'选区背景隔行', + 'unsetbackground':'取消选区背景', + 'redandblue':'红蓝相间', + 'threecolorgradient':'三色渐变', + 'copy':"复制(Ctrl + c)", + 'copymsg': "浏览器不支持,请使用 'Ctrl + c'", + 'paste':"粘贴(Ctrl + v)", + 'pastemsg': "浏览器不支持,请使用 'Ctrl + v'" + }, + 'copymsg': "浏览器不支持,请使用 'Ctrl + c'", + 'pastemsg': "浏览器不支持,请使用 'Ctrl + v'", + 'anthorMsg':"链接", + 'clearColor':'清空颜色', + 'standardColor':'标准颜色', + 'themeColor':'主题颜色', + 'property':'属性', + 'default':'默认', + 'modify':'修改', + 'justifyleft':'左对齐', + 'justifyright':'右对齐', + 'justifycenter':'居中', + 'justify':'默认', + 'clear':'清除', + 'anchorMsg':'锚点', + 'delete':'删除', + 'clickToUpload':"点击上传", + 'unset':'尚未设置语言文件', + 't_row':'行', + 't_col':'列', + 'more':'更多', + 'pasteOpt':'粘贴选项', + 'pasteSourceFormat':"保留源格式", + 'tagFormat':'只保留标签', + 'pasteTextFormat':'只保留文本', + 'autoTypeSet':{ + 'mergeLine':"合并空行", + 'delLine':"清除空行", + 'removeFormat':"清除格式", + 'indent':"首行缩进", + 'alignment':"对齐方式", + 'imageFloat':"图片浮动", + 'removeFontsize':"清除字号", + 'removeFontFamily':"清除字体", + 'removeHtml':"清除冗余HTML代码", + 'pasteFilter':"粘贴过滤", + 'run':"执行", + 'symbol':'符号转换', + 'bdc2sb':'全角转半角', + 'tobdc':'半角转全角' + }, + + 'background':{ + 'static':{ + 'lang_background_normal':'背景设置', + 'lang_background_local':'在线图片', + 'lang_background_set':'选项', + 'lang_background_none':'无背景色', + 'lang_background_colored':'有背景色', + 'lang_background_color':'颜色设置', + 'lang_background_netimg':'网络图片', + 'lang_background_align':'对齐方式', + 'lang_background_position':'精确定位', + 'repeatType':{'options':["居中", "横向重复", "纵向重复", "平铺","自定义"]} + + }, + 'noUploadImage':"当前未上传过任何图片!", + 'toggleSelect':"单击可切换选中状态\n原图尺寸: " + }, + //===============dialog i18N======================= + 'insertimage':{ + 'static':{ + 'lang_tab_remote':"插入图片", //节点 + 'lang_tab_upload':"本地上传", + 'lang_tab_online':"在线管理", + 'lang_tab_search':"图片搜索", + 'lang_input_url':"地 址:", + 'lang_input_size':"大 小:", + 'lang_input_width':"宽度", + 'lang_input_height':"高度", + 'lang_input_border':"边 框:", + 'lang_input_vhspace':"边 距:", + 'lang_input_title':"描 述:", + 'lang_input_align':'图片浮动方式:', + 'lang_imgLoading':" 图片加载中……", + 'lang_start_upload':"开始上传", + 'lock':{'title':"锁定宽高比例"}, //属性 + 'searchType':{'title':"图片类型", 'options':["新闻", "壁纸", "表情", "头像"]}, //select的option + 'searchTxt':{'value':"请输入搜索关键词"}, + 'searchBtn':{'value':"百度一下"}, + 'searchReset':{'value':"清空搜索"}, + 'noneAlign':{'title':'无浮动'}, + 'leftAlign':{'title':'左浮动'}, + 'rightAlign':{'title':'右浮动'}, + 'centerAlign':{'title':'居中独占一行'} + }, + 'uploadSelectFile':'点击选择图片', + 'uploadAddFile':'继续添加', + 'uploadStart':'开始上传', + 'uploadPause':'暂停上传', + 'uploadContinue':'继续上传', + 'uploadRetry':'重试上传', + 'uploadDelete':'删除', + 'uploadTurnLeft':'向左旋转', + 'uploadTurnRight':'向右旋转', + 'uploadPreview':'预览中', + 'uploadNoPreview':'不能预览', + 'updateStatusReady': '选中_张图片,共_KB。', + 'updateStatusConfirm': '已成功上传_张照片,_张照片上传失败', + 'updateStatusFinish': '共_张(_KB),_张上传成功', + 'updateStatusError': ',_张上传失败。', + 'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。', + 'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!', + 'errorExceedSize':'文件大小超出', + 'errorFileType':'文件格式不允许', + 'errorInterrupt':'文件传输中断', + 'errorUploadRetry':'上传失败,请重试', + 'errorHttp':'http请求错误', + 'errorServerUpload':'服务器返回出错', + 'remoteLockError':"宽高不正确,不能所定比例", + 'numError':"请输入正确的长度或者宽度值!例如:123,400", + 'imageUrlError':"不允许的图片格式或者图片域!", + 'imageLoadError':"图片加载失败!请检查链接地址或网络状态!", + 'searchRemind':"请输入搜索关键词", + 'searchLoading':"图片加载中,请稍后……", + 'searchRetry':" :( ,抱歉,没有找到图片!请重试一次!" + }, + 'attachment':{ + 'static':{ + 'lang_tab_upload': '上传附件', + 'lang_tab_online': '在线附件', + 'lang_start_upload':"开始上传", + 'lang_drop_remind':"可以将文件拖到这里,单次最多可选100个文件" + }, + 'uploadSelectFile':'点击选择文件', + 'uploadAddFile':'继续添加', + 'uploadStart':'开始上传', + 'uploadPause':'暂停上传', + 'uploadContinue':'继续上传', + 'uploadRetry':'重试上传', + 'uploadDelete':'删除', + 'uploadTurnLeft':'向左旋转', + 'uploadTurnRight':'向右旋转', + 'uploadPreview':'预览中', + 'updateStatusReady': '选中_个文件,共_KB。', + 'updateStatusConfirm': '已成功上传_个文件,_个文件上传失败', + 'updateStatusFinish': '共_个(_KB),_个上传成功', + 'updateStatusError': ',_张上传失败。', + 'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。', + 'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!', + 'errorExceedSize':'文件大小超出', + 'errorFileType':'文件格式不允许', + 'errorInterrupt':'文件传输中断', + 'errorUploadRetry':'上传失败,请重试', + 'errorHttp':'http请求错误', + 'errorServerUpload':'服务器返回出错' + }, + 'insertvideo':{ + 'static':{ + 'lang_tab_insertV':"插入视频", + 'lang_tab_searchV':"搜索视频", + 'lang_tab_uploadV':"上传视频", + 'lang_video_url':"视频网址", + 'lang_video_size':"视频尺寸", + 'lang_videoW':"宽度", + 'lang_videoH':"高度", + 'lang_alignment':"对齐方式", + 'videoSearchTxt':{'value':"请输入搜索关键字!"}, + 'videoType':{'options':["全部", "热门", "娱乐", "搞笑", "体育", "科技", "综艺"]}, + 'videoSearchBtn':{'value':"百度一下"}, + 'videoSearchReset':{'value':"清空结果"}, + + 'lang_input_fileStatus':' 当前未上传文件', + 'startUpload':{'style':"background:url(upload.png) no-repeat;"}, + + 'lang_upload_size':"视频尺寸", + 'lang_upload_width':"宽度", + 'lang_upload_height':"高度", + 'lang_upload_alignment':"对齐方式", + 'lang_format_advice':"建议使用mp4格式." + + }, + 'numError':"请输入正确的数值,如123,400", + 'floatLeft':"左浮动", + 'floatRight':"右浮动", + '"default"':"默认", + 'block':"独占一行", + 'urlError':"输入的视频地址有误,请检查后再试!", + 'loading':"  视频加载中,请等待……", + 'clickToSelect':"点击选中", + 'goToSource':'访问源视频', + 'noVideo':"    抱歉,找不到对应的视频,请重试!", + + 'browseFiles':'浏览文件', + 'uploadSuccess':'上传成功!', + 'delSuccessFile':'从成功队列中移除', + 'delFailSaveFile':'移除保存失败文件', + 'statusPrompt':' 个文件已上传! ', + 'flashVersionError':'当前Flash版本过低,请更新FlashPlayer后重试!', + 'flashLoadingError':'Flash加载失败!请检查路径或网络状态', + 'fileUploadReady':'等待上传……', + 'delUploadQueue':'从上传队列中移除', + 'limitPrompt1':'单次不能选择超过', + 'limitPrompt2':'个文件!请重新选择!', + 'delFailFile':'移除失败文件', + 'fileSizeLimit':'文件大小超出限制!', + 'emptyFile':'空文件无法上传!', + 'fileTypeError':'文件类型不允许!', + 'unknownError':'未知错误!', + 'fileUploading':'上传中,请等待……', + 'cancelUpload':'取消上传', + 'netError':'网络错误', + 'failUpload':'上传失败!', + 'serverIOError':'服务器IO错误!', + 'noAuthority':'无权限!', + 'fileNumLimit':'上传个数限制', + 'failCheck':'验证失败,本次上传被跳过!', + 'fileCanceling':'取消中,请等待……', + 'stopUploading':'上传已停止……', + + 'uploadSelectFile':'点击选择文件', + 'uploadAddFile':'继续添加', + 'uploadStart':'开始上传', + 'uploadPause':'暂停上传', + 'uploadContinue':'继续上传', + 'uploadRetry':'重试上传', + 'uploadDelete':'删除', + 'uploadTurnLeft':'向左旋转', + 'uploadTurnRight':'向右旋转', + 'uploadPreview':'预览中', + 'updateStatusReady': '选中_个文件,共_KB。', + 'updateStatusConfirm': '成功上传_个,_个失败', + 'updateStatusFinish': '共_个(_KB),_个成功上传', + 'updateStatusError': ',_张上传失败。', + 'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。', + 'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!', + 'errorExceedSize':'文件大小超出', + 'errorFileType':'文件格式不允许', + 'errorInterrupt':'文件传输中断', + 'errorUploadRetry':'上传失败,请重试', + 'errorHttp':'http请求错误', + 'errorServerUpload':'服务器返回出错' + }, + 'webapp':{ + 'tip1':"本功能由百度APP提供,如看到此页面,请各位站长首先申请百度APPKey!", + 'tip2':"申请完成之后请至ueditor.config.js中配置获得的appkey! ", + 'applyFor':"点此申请", + 'anthorApi':"百度API" + }, + 'template':{ + 'static':{ + 'lang_template_bkcolor':'背景颜色', + 'lang_template_clear' : '保留原有内容', + 'lang_template_select' : '选择模板' + }, + 'blank':"空白文档", + 'blog':"博客文章", + 'resume':"个人简历", + 'richText':"图文混排", + 'sciPapers':"科技论文" + + + }, + 'scrawl':{ + 'static':{ + 'lang_input_previousStep':"上一步", + 'lang_input_nextsStep':"下一步", + 'lang_input_clear':'清空', + 'lang_input_addPic':'添加背景', + 'lang_input_ScalePic':'缩放背景', + 'lang_input_removePic':'删除背景', + 'J_imgTxt':{title:'添加背景图片'} + }, + 'noScarwl':"尚未作画,白纸一张~", + 'scrawlUpLoading':"涂鸦上传中,别急哦~", + 'continueBtn':"继续", + 'imageError':"糟糕,图片读取失败了!", + 'backgroundUploading':'背景图片上传中,别急哦~' + }, + 'music':{ + 'static':{ + 'lang_input_tips':"输入歌手/歌曲/专辑,搜索您感兴趣的音乐!", + 'J_searchBtn':{value:'搜索歌曲'} + }, + 'emptyTxt':'未搜索到相关音乐结果,请换一个关键词试试。', + 'chapter':'歌曲', + 'singer':'歌手', + 'special':'专辑', + 'listenTest':'试听' + }, + 'anchor':{ + 'static':{ + 'lang_input_anchorName':'锚点名字:' + } + }, + 'charts':{ + 'static':{ + 'lang_data_source':'数据源:', + 'lang_chart_format': '图表格式:', + 'lang_data_align': '数据对齐方式', + 'lang_chart_align_same': '数据源与图表X轴Y轴一致', + 'lang_chart_align_reverse': '数据源与图表X轴Y轴相反', + 'lang_chart_title': '图表标题', + 'lang_chart_main_title': '主标题:', + 'lang_chart_sub_title': '子标题:', + 'lang_chart_x_title': 'X轴标题:', + 'lang_chart_y_title': 'Y轴标题:', + 'lang_chart_tip': '提示文字', + 'lang_cahrt_tip_prefix': '提示文字前缀:', + 'lang_cahrt_tip_description': '仅饼图有效, 当鼠标移动到饼图中相应的块上时,提示框内的文字的前缀', + 'lang_chart_data_unit': '数据单位', + 'lang_chart_data_unit_title': '单位:', + 'lang_chart_data_unit_description': '显示在每个数据点上的数据的单位, 比如: 温度的单位 ℃', + 'lang_chart_type': '图表类型:', + 'lang_prev_btn': '上一个', + 'lang_next_btn': '下一个' + } + }, + 'emotion':{ + 'static':{ + 'lang_input_choice':'精选', + 'lang_input_Tuzki':'兔斯基', + 'lang_input_BOBO':'BOBO', + 'lang_input_lvdouwa':'绿豆蛙', + 'lang_input_babyCat':'baby猫', + 'lang_input_bubble':'泡泡', + 'lang_input_youa':'有啊' + } + }, + 'gmap':{ + 'static':{ + 'lang_input_address':'地址', + 'lang_input_search':'搜索', + 'address':{value:"北京"} + }, + searchError:'无法定位到该地址!' + }, + 'help':{ + 'static':{ + 'lang_input_about':'关于UEditor', + 'lang_input_shortcuts':'快捷键', + 'lang_input_introduction':'UEditor是由百度web前端研发部开发的所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点。开源基于BSD协议,允许自由使用和修改代码。', + 'lang_Txt_shortcuts':'快捷键', + 'lang_Txt_func':'功能', + 'lang_Txt_bold':'给选中字设置为加粗', + 'lang_Txt_copy':'复制选中内容', + 'lang_Txt_cut':'剪切选中内容', + 'lang_Txt_Paste':'粘贴', + 'lang_Txt_undo':'重新执行上次操作', + 'lang_Txt_redo':'撤销上一次操作', + 'lang_Txt_italic':'给选中字设置为斜体', + 'lang_Txt_underline':'给选中字加下划线', + 'lang_Txt_selectAll':'全部选中', + 'lang_Txt_visualEnter':'软回车', + 'lang_Txt_fullscreen':'全屏' + } + }, + 'insertframe':{ + 'static':{ + 'lang_input_address':'地址:', + 'lang_input_width':'宽度:', + 'lang_input_height':'高度:', + 'lang_input_isScroll':'允许滚动条:', + 'lang_input_frameborder':'显示框架边框:', + 'lang_input_alignMode':'对齐方式:', + 'align':{title:"对齐方式", options:["默认", "左对齐", "右对齐", "居中"]} + }, + 'enterAddress':'请输入地址!' + }, + 'link':{ + 'static':{ + 'lang_input_text':'文本内容:', + 'lang_input_url':'链接地址:', + 'lang_input_title':'标题:', + 'lang_input_target':'是否在新窗口打开:' + }, + 'validLink':'只支持选中一个链接时生效', + 'httpPrompt':'您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀' + }, + 'map':{ + 'static':{ + lang_city:"城市", + lang_address:"地址", + city:{value:"北京"}, + lang_search:"搜索", + lang_dynamicmap:"插入动态地图" + }, + cityMsg:"请选择城市", + errorMsg:"抱歉,找不到该位置!" + }, + 'searchreplace':{ + 'static':{ + lang_tab_search:"查找", + lang_tab_replace:"替换", + lang_search1:"查找", + lang_search2:"查找", + lang_replace:"替换", + lang_searchReg:'支持正则表达式,添加前后斜杠标示为正则表达式,例如“/表达式/”', + lang_searchReg1:'支持正则表达式,添加前后斜杠标示为正则表达式,例如“/表达式/”', + lang_case_sensitive1:"区分大小写", + lang_case_sensitive2:"区分大小写", + nextFindBtn:{value:"下一个"}, + preFindBtn:{value:"上一个"}, + nextReplaceBtn:{value:"下一个"}, + preReplaceBtn:{value:"上一个"}, + repalceBtn:{value:"替换"}, + repalceAllBtn:{value:"全部替换"} + }, + getEnd:"已经搜索到文章末尾!", + getStart:"已经搜索到文章头部", + countMsg:"总共替换了{#count}处!" + }, + 'snapscreen':{ + 'static':{ + lang_showMsg:"截图功能需要首先安装UEditor截图插件! ", + lang_download:"点此下载", + lang_step1:"第一步,下载UEditor截图插件并运行安装。", + lang_step2:"第二步,插件安装完成后即可使用,如不生效,请重启浏览器后再试!" + } + }, + 'spechars':{ + 'static':{}, + tsfh:"特殊字符", + lmsz:"罗马字符", + szfh:"数学字符", + rwfh:"日文字符", + xlzm:"希腊字母", + ewzm:"俄文字符", + pyzm:"拼音字母", + yyyb:"英语音标", + zyzf:"其他" + }, + 'edittable':{ + 'static':{ + 'lang_tableStyle':'表格样式', + 'lang_insertCaption':'添加表格名称行', + 'lang_insertTitle':'添加表格标题行', + 'lang_insertTitleCol':'添加表格标题列', + 'lang_orderbycontent':"使表格内容可排序", + 'lang_tableSize':'自动调整表格尺寸', + 'lang_autoSizeContent':'按表格文字自适应', + 'lang_autoSizePage':'按页面宽度自适应', + 'lang_example':'示例', + 'lang_borderStyle':'表格边框', + 'lang_color':'颜色:' + }, + captionName:'表格名称', + titleName:'标题', + cellsName:'内容', + errorMsg:'有合并单元格,不可排序' + }, + 'edittip':{ + 'static':{ + lang_delRow:'删除整行', + lang_delCol:'删除整列' + } + }, + 'edittd':{ + 'static':{ + lang_tdBkColor:'背景颜色:' + } + }, + 'formula':{ + 'static':{ + } + }, + 'wordimage':{ + 'static':{ + lang_resave:"转存步骤", + uploadBtn:{src:"upload.png",alt:"上传"}, + clipboard:{style:"background: url(copy.png) -153px -1px no-repeat;"}, + lang_step:"1、点击顶部复制按钮,将地址复制到剪贴板;2、点击添加照片按钮,在弹出的对话框中使用Ctrl+V粘贴地址;3、点击打开后选择图片上传流程。" + }, + 'fileType':"图片", + 'flashError':"FLASH初始化失败,请检查FLASH插件是否正确安装!", + 'netError':"网络连接错误,请重试!", + 'copySuccess':"图片地址已经复制!", + 'flashI18n':{} //留空默认中文 + }, + 'autosave': { + 'saving':'保存中...', + 'success':'本地保存成功' + } +}; diff --git a/public/static/Ueditor/php/Uploader.class.php b/public/static/Ueditor/php/Uploader.class.php new file mode 100644 index 0000000..b7d6bf8 --- /dev/null +++ b/public/static/Ueditor/php/Uploader.class.php @@ -0,0 +1,372 @@ + "临时文件错误", + "ERROR_TMP_FILE_NOT_FOUND" => "找不到临时文件", + "ERROR_SIZE_EXCEED" => "文件大小超出网站限制", + "ERROR_TYPE_NOT_ALLOWED" => "文件类型不允许", + "ERROR_CREATE_DIR" => "目录创建失败", + "ERROR_DIR_NOT_WRITEABLE" => "目录没有写权限", + "ERROR_FILE_MOVE" => "文件保存时出错", + "ERROR_FILE_NOT_FOUND" => "找不到上传文件", + "ERROR_WRITE_CONTENT" => "写入文件内容错误", + "ERROR_UNKNOWN" => "未知错误", + "ERROR_DEAD_LINK" => "链接不可用", + "ERROR_HTTP_LINK" => "链接不是http链接", + "ERROR_HTTP_CONTENTTYPE" => "链接contentType不正确", + "INVALID_URL" => "非法 URL", + "INVALID_IP" => "非法 IP" + ); + + /** + * 构造函数 + * @param string $fileField 表单名称 + * @param array $config 配置项 + * @param bool $base64 是否解析base64编码,可省略。若开启,则$fileField代表的是base64编码的字符串表单名 + */ + public function __construct($fileField, $config, $type = "upload") + { + $this->fileField = $fileField; + $this->config = $config; + $this->type = $type; + if ($type == "remote") { + $this->saveRemote(); + } else if($type == "base64") { + $this->upBase64(); + } else { + $this->upFile(); + } + + $this->stateMap['ERROR_TYPE_NOT_ALLOWED'] = iconv('unicode', 'utf-8', $this->stateMap['ERROR_TYPE_NOT_ALLOWED']); + } + + /** + * 上传文件的主处理方法 + * @return mixed + */ + private function upFile() + { + $file = $this->file = $_FILES[$this->fileField]; + if (!$file) { + $this->stateInfo = $this->getStateInfo("ERROR_FILE_NOT_FOUND"); + return; + } + if ($this->file['error']) { + $this->stateInfo = $this->getStateInfo($file['error']); + return; + } else if (!file_exists($file['tmp_name'])) { + $this->stateInfo = $this->getStateInfo("ERROR_TMP_FILE_NOT_FOUND"); + return; + } else if (!is_uploaded_file($file['tmp_name'])) { + $this->stateInfo = $this->getStateInfo("ERROR_TMPFILE"); + return; + } + + $this->oriName = $file['name']; + $this->fileSize = $file['size']; + $this->fileType = $this->getFileExt(); + $this->fullName = $this->getFullName(); + $this->filePath = $this->getFilePath(); + $this->fileName = $this->getFileName(); + $dirname = dirname($this->filePath); + + //检查文件大小是否超出限制 + if (!$this->checkSize()) { + $this->stateInfo = $this->getStateInfo("ERROR_SIZE_EXCEED"); + return; + } + + //检查是否不允许的文件格式 + if (!$this->checkType()) { + $this->stateInfo = $this->getStateInfo("ERROR_TYPE_NOT_ALLOWED"); + return; + } + + //创建目录失败 + if (!file_exists($dirname) && !mkdir($dirname, 0777, true)) { + $this->stateInfo = $this->getStateInfo("ERROR_CREATE_DIR"); + return; + } else if (!is_writeable($dirname)) { + $this->stateInfo = $this->getStateInfo("ERROR_DIR_NOT_WRITEABLE"); + return; + } + + //移动文件 + if (!(move_uploaded_file($file["tmp_name"], $this->filePath) && file_exists($this->filePath))) { //移动失败 + $this->stateInfo = $this->getStateInfo("ERROR_FILE_MOVE"); + } else { //移动成功 + $this->stateInfo = $this->stateMap[0]; + } + } + + /** + * 处理base64编码的图片上传 + * @return mixed + */ + private function upBase64() + { + $base64Data = $_POST[$this->fileField]; + $img = base64_decode($base64Data); + + $this->oriName = $this->config['oriName']; + $this->fileSize = strlen($img); + $this->fileType = $this->getFileExt(); + $this->fullName = $this->getFullName(); + $this->filePath = $this->getFilePath(); + $this->fileName = $this->getFileName(); + $dirname = dirname($this->filePath); + + //检查文件大小是否超出限制 + if (!$this->checkSize()) { + $this->stateInfo = $this->getStateInfo("ERROR_SIZE_EXCEED"); + return; + } + + //创建目录失败 + if (!file_exists($dirname) && !mkdir($dirname, 0777, true)) { + $this->stateInfo = $this->getStateInfo("ERROR_CREATE_DIR"); + return; + } else if (!is_writeable($dirname)) { + $this->stateInfo = $this->getStateInfo("ERROR_DIR_NOT_WRITEABLE"); + return; + } + + //移动文件 + if (!(file_put_contents($this->filePath, $img) && file_exists($this->filePath))) { //移动失败 + $this->stateInfo = $this->getStateInfo("ERROR_WRITE_CONTENT"); + } else { //移动成功 + $this->stateInfo = $this->stateMap[0]; + } + + } + + /** + * 拉取远程图片 + * @return mixed + */ + private function saveRemote() + { + $imgUrl = htmlspecialchars($this->fileField); + $imgUrl = str_replace("&", "&", $imgUrl); + + //http开头验证 + if (strpos($imgUrl, "http") !== 0) { + $this->stateInfo = $this->getStateInfo("ERROR_HTTP_LINK"); + return; + } + + preg_match('/(^https*:\/\/[^:\/]+)/', $imgUrl, $matches); + $host_with_protocol = count($matches) > 1 ? $matches[1] : ''; + + // 判断是否是合法 url + if (!filter_var($host_with_protocol, FILTER_VALIDATE_URL)) { + $this->stateInfo = $this->getStateInfo("INVALID_URL"); + return; + } + + preg_match('/^https*:\/\/(.+)/', $host_with_protocol, $matches); + $host_without_protocol = count($matches) > 1 ? $matches[1] : ''; + + // 此时提取出来的可能是 ip 也有可能是域名,先获取 ip + $ip = gethostbyname($host_without_protocol); + // 判断是否是私有 ip + if(!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE)) { + $this->stateInfo = $this->getStateInfo("INVALID_IP"); + return; + } + + //获取请求头并检测死链 + $heads = get_headers($imgUrl, 1); + if (!(stristr($heads[0], "200") && stristr($heads[0], "OK"))) { + $this->stateInfo = $this->getStateInfo("ERROR_DEAD_LINK"); + return; + } + //格式验证(扩展名验证和Content-Type验证) + $fileType = strtolower(strrchr($imgUrl, '.')); + if (!in_array($fileType, $this->config['allowFiles']) || !isset($heads['Content-Type']) || !stristr($heads['Content-Type'], "image")) { + $this->stateInfo = $this->getStateInfo("ERROR_HTTP_CONTENTTYPE"); + return; + } + + //打开输出缓冲区并获取远程图片 + ob_start(); + $context = stream_context_create( + array('http' => array( + 'follow_location' => false // don't follow redirects + )) + ); + readfile($imgUrl, false, $context); + $img = ob_get_contents(); + ob_end_clean(); + preg_match("/[\/]([^\/]*)[\.]?[^\.\/]*$/", $imgUrl, $m); + + $this->oriName = $m ? $m[1]:""; + $this->fileSize = strlen($img); + $this->fileType = $this->getFileExt(); + $this->fullName = $this->getFullName(); + $this->filePath = $this->getFilePath(); + $this->fileName = $this->getFileName(); + $dirname = dirname($this->filePath); + + //检查文件大小是否超出限制 + if (!$this->checkSize()) { + $this->stateInfo = $this->getStateInfo("ERROR_SIZE_EXCEED"); + return; + } + + //创建目录失败 + if (!file_exists($dirname) && !mkdir($dirname, 0777, true)) { + $this->stateInfo = $this->getStateInfo("ERROR_CREATE_DIR"); + return; + } else if (!is_writeable($dirname)) { + $this->stateInfo = $this->getStateInfo("ERROR_DIR_NOT_WRITEABLE"); + return; + } + + //移动文件 + if (!(file_put_contents($this->filePath, $img) && file_exists($this->filePath))) { //移动失败 + $this->stateInfo = $this->getStateInfo("ERROR_WRITE_CONTENT"); + } else { //移动成功 + $this->stateInfo = $this->stateMap[0]; + } + + } + + /** + * 上传错误检查 + * @param $errCode + * @return string + */ + private function getStateInfo($errCode) + { + return !$this->stateMap[$errCode] ? $this->stateMap["ERROR_UNKNOWN"] : $this->stateMap[$errCode]; + } + + /** + * 获取文件扩展名 + * @return string + */ + private function getFileExt() + { + return strtolower(strrchr($this->oriName, '.')); + } + + /** + * 重命名文件 + * @return string + */ + private function getFullName() + { + //替换日期事件 + $t = time(); + $d = explode('-', date("Y-y-m-d-H-i-s")); + $format = $this->config["pathFormat"]; + $format = str_replace("{yyyy}", $d[0], $format); + $format = str_replace("{yy}", $d[1], $format); + $format = str_replace("{mm}", $d[2], $format); + $format = str_replace("{dd}", $d[3], $format); + $format = str_replace("{hh}", $d[4], $format); + $format = str_replace("{ii}", $d[5], $format); + $format = str_replace("{ss}", $d[6], $format); + $format = str_replace("{time}", $t, $format); + + //过滤文件名的非法自负,并替换文件名 + $oriName = substr($this->oriName, 0, strrpos($this->oriName, '.')); + $oriName = preg_replace("/[\|\?\"\<\>\/\*\\\\]+/", '', $oriName); + $format = str_replace("{filename}", $oriName, $format); + + //替换随机字符串 + $randNum = rand(1, 10000000000) . rand(1, 10000000000); + if (preg_match("/\{rand\:([\d]*)\}/i", $format, $matches)) { + $format = preg_replace("/\{rand\:[\d]*\}/i", substr($randNum, 0, $matches[1]), $format); + } + + $ext = $this->getFileExt(); + return $format . $ext; + } + + /** + * 获取文件名 + * @return string + */ + private function getFileName () { + return substr($this->filePath, strrpos($this->filePath, '/') + 1); + } + + /** + * 获取文件完整路径 + * @return string + */ + private function getFilePath() + { + $fullname = $this->fullName; + $rootPath = $_SERVER['DOCUMENT_ROOT']; + + if (substr($fullname, 0, 1) != '/') { + $fullname = '/' . $fullname; + } + + return $rootPath . $fullname; + } + + /** + * 文件类型检测 + * @return bool + */ + private function checkType() + { + return in_array($this->getFileExt(), $this->config["allowFiles"]); + } + + /** + * 文件大小检测 + * @return bool + */ + private function checkSize() + { + return $this->fileSize <= ($this->config["maxSize"]); + } + + /** + * 获取当前上传成功文件的各项信息 + * @return array + */ + public function getFileInfo() + { + return array( + "state" => $this->stateInfo, + "url" => $this->fullName, + "title" => $this->fileName, + "original" => $this->oriName, + "type" => $this->fileType, + "size" => $this->fileSize + ); + } + +} \ No newline at end of file diff --git a/public/static/Ueditor/php/action_crawler.php b/public/static/Ueditor/php/action_crawler.php new file mode 100644 index 0000000..b9e18df --- /dev/null +++ b/public/static/Ueditor/php/action_crawler.php @@ -0,0 +1,44 @@ + $CONFIG['catcherPathFormat'], + "maxSize" => $CONFIG['catcherMaxSize'], + "allowFiles" => $CONFIG['catcherAllowFiles'], + "oriName" => "remote.png" +); +$fieldName = $CONFIG['catcherFieldName']; + +/* 抓取远程图片 */ +$list = array(); +if (isset($_POST[$fieldName])) { + $source = $_POST[$fieldName]; +} else { + $source = $_GET[$fieldName]; +} +foreach ($source as $imgUrl) { + $item = new Uploader($imgUrl, $config, "remote"); + $info = $item->getFileInfo(); + array_push($list, array( + "state" => $info["state"], + "url" => $info["url"], + "size" => $info["size"], + "title" => htmlspecialchars($info["title"]), + "original" => htmlspecialchars($info["original"]), + "source" => htmlspecialchars($imgUrl) + )); +} + +/* 返回抓取数据 */ +return json_encode(array( + 'state'=> count($list) ? 'SUCCESS':'ERROR', + 'list'=> $list +)); \ No newline at end of file diff --git a/public/static/Ueditor/php/action_list.php b/public/static/Ueditor/php/action_list.php new file mode 100644 index 0000000..bf9cd62 --- /dev/null +++ b/public/static/Ueditor/php/action_list.php @@ -0,0 +1,92 @@ + "no match file", + "list" => array(), + "start" => $start, + "total" => count($files) + )); +} + +/* 获取指定范围的列表 */ +$len = count($files); +for ($i = min($end, $len) - 1, $list = array(); $i < $len && $i >= 0 && $i >= $start; $i--){ + $list[] = $files[$i]; +} +//倒序 +//for ($i = $end, $list = array(); $i < $len && $i < $end; $i++){ +// $list[] = $files[$i]; +//} + +/* 返回数据 */ +$result = json_encode(array( + "state" => "SUCCESS", + "list" => $list, + "start" => $start, + "total" => count($files) +)); + +return $result; + + +/** + * 遍历获取目录下的指定类型的文件 + * @param $path + * @param array $files + * @return array + */ +function getfiles($path, $allowFiles, &$files = array()) +{ + if (!is_dir($path)) return null; + if(substr($path, strlen($path) - 1) != '/') $path .= '/'; + $handle = opendir($path); + while (false !== ($file = readdir($handle))) { + if ($file != '.' && $file != '..') { + $path2 = $path . $file; + if (is_dir($path2)) { + getfiles($path2, $allowFiles, $files); + } else { + if (preg_match("/\.(".$allowFiles.")$/i", $file)) { + $files[] = array( + 'url'=> substr($path2, strlen($_SERVER['DOCUMENT_ROOT'])), + 'mtime'=> filemtime($path2) + ); + } + } + } + } + return $files; +} \ No newline at end of file diff --git a/public/static/Ueditor/php/action_upload.php b/public/static/Ueditor/php/action_upload.php new file mode 100644 index 0000000..d55b659 --- /dev/null +++ b/public/static/Ueditor/php/action_upload.php @@ -0,0 +1,66 @@ + $CONFIG['imagePathFormat'], + "maxSize" => $CONFIG['imageMaxSize'], + "allowFiles" => $CONFIG['imageAllowFiles'] + ); + $fieldName = $CONFIG['imageFieldName']; + break; + case 'uploadscrawl': + $config = array( + "pathFormat" => $CONFIG['scrawlPathFormat'], + "maxSize" => $CONFIG['scrawlMaxSize'], + "allowFiles" => $CONFIG['scrawlAllowFiles'], + "oriName" => "scrawl.png" + ); + $fieldName = $CONFIG['scrawlFieldName']; + $base64 = "base64"; + break; + case 'uploadvideo': + $config = array( + "pathFormat" => $CONFIG['videoPathFormat'], + "maxSize" => $CONFIG['videoMaxSize'], + "allowFiles" => $CONFIG['videoAllowFiles'] + ); + $fieldName = $CONFIG['videoFieldName']; + break; + case 'uploadfile': + default: + $config = array( + "pathFormat" => $CONFIG['filePathFormat'], + "maxSize" => $CONFIG['fileMaxSize'], + "allowFiles" => $CONFIG['fileAllowFiles'] + ); + $fieldName = $CONFIG['fileFieldName']; + break; +} + +/* 生成上传实例对象并完成上传 */ +$up = new Uploader($fieldName, $config, $base64); + +/** + * 得到上传文件所对应的各个参数,数组结构 + * array( + * "state" => "", //上传状态,上传成功时必须返回"SUCCESS" + * "url" => "", //返回的地址 + * "title" => "", //新文件名 + * "original" => "", //原始文件名 + * "type" => "" //文件类型 + * "size" => "", //文件大小 + * ) + */ + +/* 返回数据 */ +return json_encode($up->getFileInfo()); diff --git a/public/static/Ueditor/php/config.json b/public/static/Ueditor/php/config.json new file mode 100644 index 0000000..dd5bc17 --- /dev/null +++ b/public/static/Ueditor/php/config.json @@ -0,0 +1,94 @@ +/* 前后端通信相关的配置,注释只允许使用多行方式 */ +{ + /* 上传图片配置项 */ + "imageActionName": "uploadimage", /* 执行上传图片的action名称 */ + "imageFieldName": "upfile", /* 提交的图片表单名称 */ + "imageMaxSize": 2048000, /* 上传大小限制,单位B */ + "imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 上传图片格式显示 */ + "imageCompressEnable": true, /* 是否压缩图片,默认是true */ + "imageCompressBorder": 1600, /* 图片压缩最长边限制 */ + "imageInsertAlign": "none", /* 插入的图片浮动方式 */ + "imageUrlPrefix": "", /* 图片访问路径前缀 */ + "imagePathFormat": "/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */ + /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */ + /* {time} 会替换成时间戳 */ + /* {yyyy} 会替换成四位年份 */ + /* {yy} 会替换成两位年份 */ + /* {mm} 会替换成两位月份 */ + /* {dd} 会替换成两位日期 */ + /* {hh} 会替换成两位小时 */ + /* {ii} 会替换成两位分钟 */ + /* {ss} 会替换成两位秒 */ + /* 非法字符 \ : * ? " < > | */ + /* 具请体看线上文档: fex.baidu.com/ueditor/#use-format_upload_filename */ + + /* 涂鸦图片上传配置项 */ + "scrawlActionName": "uploadscrawl", /* 执行上传涂鸦的action名称 */ + "scrawlFieldName": "upfile", /* 提交的图片表单名称 */ + "scrawlPathFormat": "/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "scrawlMaxSize": 2048000, /* 上传大小限制,单位B */ + "scrawlUrlPrefix": "", /* 图片访问路径前缀 */ + "scrawlInsertAlign": "none", + + /* 截图工具上传 */ + "snapscreenActionName": "uploadimage", /* 执行上传截图的action名称 */ + "snapscreenPathFormat": "/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "snapscreenUrlPrefix": "", /* 图片访问路径前缀 */ + "snapscreenInsertAlign": "none", /* 插入的图片浮动方式 */ + + /* 抓取远程图片配置 */ + "catcherLocalDomain": ["127.0.0.1", "localhost", "img.baidu.com"], + "catcherActionName": "catchimage", /* 执行抓取远程图片的action名称 */ + "catcherFieldName": "source", /* 提交的图片列表表单名称 */ + "catcherPathFormat": "/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "catcherUrlPrefix": "", /* 图片访问路径前缀 */ + "catcherMaxSize": 2048000, /* 上传大小限制,单位B */ + "catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 抓取图片格式显示 */ + + /* 上传视频配置 */ + "videoActionName": "uploadvideo", /* 执行上传视频的action名称 */ + "videoFieldName": "upfile", /* 提交的视频表单名称 */ + "videoPathFormat": "/ueditor/php/upload/video/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "videoUrlPrefix": "", /* 视频访问路径前缀 */ + "videoMaxSize": 102400000, /* 上传大小限制,单位B,默认100MB */ + "videoAllowFiles": [ + ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", + ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid"], /* 上传视频格式显示 */ + + /* 上传文件配置 */ + "fileActionName": "uploadfile", /* controller里,执行上传视频的action名称 */ + "fileFieldName": "upfile", /* 提交的文件表单名称 */ + "filePathFormat": "/ueditor/php/upload/file/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "fileUrlPrefix": "", /* 文件访问路径前缀 */ + "fileMaxSize": 51200000, /* 上传大小限制,单位B,默认50MB */ + "fileAllowFiles": [ + ".png", ".jpg", ".jpeg", ".gif", ".bmp", + ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", + ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid", + ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso", + ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml" + ], /* 上传文件格式显示 */ + + /* 列出指定目录下的图片 */ + "imageManagerActionName": "listimage", /* 执行图片管理的action名称 */ + "imageManagerListPath": "/ueditor/php/upload/image/", /* 指定要列出图片的目录 */ + "imageManagerListSize": 20, /* 每次列出文件数量 */ + "imageManagerUrlPrefix": "", /* 图片访问路径前缀 */ + "imageManagerInsertAlign": "none", /* 插入的图片浮动方式 */ + "imageManagerAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 列出的文件类型 */ + + /* 列出指定目录下的文件 */ + "fileManagerActionName": "listfile", /* 执行文件管理的action名称 */ + "fileManagerListPath": "/ueditor/php/upload/file/", /* 指定要列出文件的目录 */ + "fileManagerUrlPrefix": "", /* 文件访问路径前缀 */ + "fileManagerListSize": 20, /* 每次列出文件数量 */ + "fileManagerAllowFiles": [ + ".png", ".jpg", ".jpeg", ".gif", ".bmp", + ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", + ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid", + ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso", + ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml" + ] /* 列出的文件类型 */ + +} \ No newline at end of file diff --git a/public/static/Ueditor/php/controller.php b/public/static/Ueditor/php/controller.php new file mode 100644 index 0000000..feac890 --- /dev/null +++ b/public/static/Ueditor/php/controller.php @@ -0,0 +1,59 @@ + '请求地址出错' + )); + break; +} + +/* 输出结果 */ +if (isset($_GET["callback"])) { + if (preg_match("/^[\w_]+$/", $_GET["callback"])) { + echo htmlspecialchars($_GET["callback"]) . '(' . $result . ')'; + } else { + echo json_encode(array( + 'state'=> 'callback参数不合法' + )); + } +} else { + echo $result; +} \ No newline at end of file diff --git a/public/static/Ueditor/themes/default/css/ueditor.css b/public/static/Ueditor/themes/default/css/ueditor.css new file mode 100644 index 0000000..1f931c7 --- /dev/null +++ b/public/static/Ueditor/themes/default/css/ueditor.css @@ -0,0 +1,1919 @@ +/*基础UI构建 +*/ +/* common layer */ +.edui-default .edui-box { + border: none; + padding: 0; + margin: 0; + overflow: hidden; +} + +.edui-default a.edui-box { + display: block; + text-decoration: none; + color: black; +} + +.edui-default a.edui-box:hover { + text-decoration: none; +} + +.edui-default a.edui-box:active { + text-decoration: none; +} + +.edui-default table.edui-box { + border-collapse: collapse; +} + +.edui-default ul.edui-box { + list-style-type: none; +} + +div.edui-box { + position: relative; + display: -moz-inline-box !important; + display: inline-block !important; + vertical-align: top; +} + +.edui-default .edui-clearfix { + zoom: 1 +} + +.edui-default .edui-clearfix:after { + content: '\20'; + display: block; + clear: both; +} + + * html div.edui-box { + display: inline !important; +} + +*:first-child+html div.edui-box { + display: inline !important; +} + +/* control layout */ +.edui-default .edui-button-body, .edui-splitbutton-body, .edui-menubutton-body, .edui-combox-body { + position: relative; +} + +.edui-default .edui-popup { + position: absolute; + -webkit-user-select: none; + -moz-user-select: none; +} + +.edui-default .edui-popup .edui-shadow { + position: absolute; + z-index: -1; +} + +.edui-default .edui-popup .edui-bordereraser { + position: absolute; + overflow: hidden; +} + +.edui-default .edui-tablepicker .edui-canvas { + position: relative; +} + +.edui-default .edui-tablepicker .edui-canvas .edui-overlay { + position: absolute; +} + +.edui-default .edui-dialog-modalmask, .edui-dialog-dragmask { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} + +.edui-default .edui-toolbar { + position: relative; +} + +/* + * default theme + */ +.edui-default .edui-label { + cursor: default; +} + +.edui-default span.edui-clickable { + color: blue; + cursor: pointer; + text-decoration: underline; +} + +.edui-default span.edui-unclickable { + color: gray; + cursor: default; +} +/* 工具栏 */ +.edui-default .edui-toolbar { + cursor: default; + -webkit-user-select: none; + -moz-user-select: none; + padding: 1px; + overflow: hidden; /*全屏下单独一行不占位*/ + zoom: 1; + width:auto; + height:auto; +} + +.edui-default .edui-toolbar .edui-button, +.edui-default .edui-toolbar .edui-splitbutton, +.edui-default .edui-toolbar .edui-menubutton, +.edui-default .edui-toolbar .edui-combox { + margin: 1px; +} +/*UI工具栏、编辑区域、底部*/ +.edui-default .edui-editor { + border: 1px solid #d4d4d4; + background-color: white; + position: relative; + overflow: visible; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.edui-editor div{ + width:auto; + height:auto; + line-height: 1; +} +.edui-default .edui-editor-toolbarbox { + position: relative; + zoom: 1; + -webkit-box-shadow:0 1px 4px rgba(204, 204, 204, 0.6); + -moz-box-shadow:0 1px 4px rgba(204, 204, 204, 0.6); + box-shadow:0 1px 4px rgba(204, 204, 204, 0.6); + border-top-left-radius:2px; + border-top-right-radius:2px; +} + +.edui-default .edui-editor-toolbarboxouter { + border-bottom: 1px solid #d4d4d4; + background-color: #fafafa; + background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2)); + background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2); + background-image: -o-linear-gradient(top, #ffffff, #f2f2f2); + background-image: linear-gradient(to bottom, #ffffff, #f2f2f2); + background-repeat: repeat-x; + /*border: 1px solid #d4d4d4;*/ + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0); + *zoom: 1; + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); +} + +.edui-default .edui-editor-toolbarboxinner { + padding: 2px; +} + +.edui-default .edui-editor-iframeholder { + position: relative; + /*for fix ie6 toolbarmsg under iframe bug. relative -> static */ + /*_position: static !important;* +} + +.edui-default .edui-editor-iframeholder textarea { + font-family: consolas, "Courier New", "lucida console", monospace; + font-size: 12px; + line-height: 18px; +} + +.edui-default .edui-editor-bottombar { + /*border-top: 1px solid #ccc;*/ + /*height: 20px;*/ + /*width: 40%;*/ + /*float: left;*/ + /*overflow: hidden;*/ +} + +.edui-default .edui-editor-bottomContainer { + overflow: hidden; +} + +.edui-default .edui-editor-bottomContainer table { + width: 100%; + height: 0; + overflow: hidden; + border-spacing: 0; +} + +.edui-default .edui-editor-bottomContainer td { + white-space: nowrap; + border-top: 1px solid #ccc; + line-height: 20px; + font-size: 12px; + font-family: Arial, Helvetica, Tahoma, Verdana, Sans-Serif; +} + +.edui-default .edui-editor-wordcount { + text-align: right; + margin-right: 5px; + color: #aaa; +} +.edui-default .edui-editor-scale { + width: 12px; +} +.edui-default .edui-editor-scale .edui-editor-icon { + float: right; + width: 100%; + height: 12px; + margin-top: 10px; + background: url(../images/scale.png) no-repeat; + cursor: se-resize; +} +.edui-default .edui-editor-breadcrumb { + margin: 2px 0 0 3px; +} + +.edui-default .edui-editor-breadcrumb span { + cursor: pointer; + text-decoration: underline; + color: blue; +} + +.edui-default .edui-toolbar .edui-for-fullscreen { + float: right; +} + +.edui-default .edui-bubble .edui-popup-content { + border: 1px solid #DCAC6C; + background-color: #fff6d9; + padding: 5px; + font-size: 10pt; + font-family: "宋体"; +} + +.edui-default .edui-bubble .edui-shadow { + /*box-shadow: 1px 1px 3px #818181;*/ + /*-webkit-box-shadow: 2px 2px 3px #818181;*/ + /*-moz-box-shadow: 2px 2px 3px #818181;*/ + /*filter: progid:DXImageTransform.Microsoft.Blur(PixelRadius = '2', MakeShadow = 'true', ShadowOpacity = '0.5');*/ +} + +.edui-default .edui-editor-toolbarmsg { + background-color: #FFF6D9; + border-bottom: 1px solid #ccc; + position: absolute; + bottom: -25px; + left: 0; + z-index: 1009; + width: 99.9%; +} + +.edui-default .edui-editor-toolbarmsg-upload { + font-size: 14px; + color: blue; + width: 100px; + height: 16px; + line-height: 16px; + cursor: pointer; + position: absolute; + top: 5px; + left: 350px; +} + +.edui-default .edui-editor-toolbarmsg-label { + font-size: 12px; + line-height: 16px; + padding: 4px; +} + +.edui-default .edui-editor-toolbarmsg-close { + float: right; + width: 20px; + height: 16px; + line-height: 16px; + cursor: pointer; + color: red; +} +/*可选中菜单按钮*/ +.edui-default .edui-list .edui-bordereraser { + display: none; +} + +.edui-default .edui-listitem { + padding: 1px; + white-space: nowrap; +} + +.edui-default .edui-list .edui-state-hover { + position: relative; + background-color: #fff5d4; + border: 1px solid #dcac6c; + padding: 0; +} + +.edui-default .edui-for-fontfamily .edui-listitem-label { + min-width: 130px; + _width: 120px; + font-size: 12px; + height: 22px; + line-height: 22px; + padding-left: 5px; +} +.edui-default .edui-for-insertcode .edui-listitem-label { + min-width: 120px; + _width: 120px; + font-size: 12px; + height: 22px; + line-height: 22px; + padding-left: 5px; +} +.edui-default .edui-for-underline .edui-listitem-label { + min-width: 120px; + _width: 120px; + padding: 3px 5px; + font-size: 12px; +} + +.edui-default .edui-for-fontsize .edui-listitem-label { + min-width: 120px; + _width: 120px; + padding: 3px 5px; + +} + +.edui-default .edui-for-paragraph .edui-listitem-label { + min-width: 200px; + _width: 200px; + padding: 2px 5px; +} + +.edui-default .edui-for-rowspacingtop .edui-listitem-label, +.edui-default .edui-for-rowspacingbottom .edui-listitem-label { + min-width: 53px; + _width: 53px; + padding: 2px 5px; +} + +.edui-default .edui-for-lineheight .edui-listitem-label { + min-width: 53px; + _width: 53px; + padding: 2px 5px; +} + +.edui-default .edui-for-customstyle .edui-listitem-label { + min-width: 200px; + _width: 200px; + width: 200px !important; + padding: 2px 5px; +} +/* 可选中按钮弹出菜单*/ +.edui-default .edui-menu { + z-index: 3000; +} + +.edui-default .edui-menu .edui-popup-content { + padding: 3px; +} + +.edui-default .edui-menu-body { + _width: 150px; + min-width: 170px; + background: url("../images/sparator_v.png") repeat-y 25px; +} + +.edui-default .edui-menuitem-body { +} + +.edui-default .edui-menuitem { + height: 20px; + cursor: default; + vertical-align: top; +} + +.edui-default .edui-menuitem .edui-icon { + width: 20px !important; + height: 20px !important; + background: url(../images/icons.png) 0 -4000px; + background: url(../images/icons.gif) 0 -4000px\9; +} + +.edui-default .edui-menuitem .edui-label { + font-size: 12px; + line-height: 20px; + height: 20px; + padding-left: 10px; +} + +.edui-default .edui-state-checked .edui-menuitem-body { + background: url("../images/icons-all.gif") no-repeat 6px -205px; +} + +.edui-default .edui-state-disabled .edui-menuitem-label { + color: gray; +} + + +/*不可选中菜单按钮 */ +.edui-default .edui-toolbar .edui-combox-body .edui-button-body { + width: 60px; + font-size: 12px; + height: 20px; + line-height: 20px; + padding-left: 5px; + white-space: nowrap; + margin: 0 3px 0 0; +} + +.edui-default .edui-toolbar .edui-combox-body .edui-arrow { + background: url(../images/icons.png) -741px 0; + _background: url(../images/icons.gif) -741px 0; + height: 20px; + width: 9px; +} + +.edui-default .edui-toolbar .edui-combox .edui-combox-body { + border: 1px solid #CCC; + background-color: white; + border-radius: 2px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; +} + +.edui-default .edui-toolbar .edui-combox-body .edui-splitborder { + display: none; +} + +.edui-default .edui-toolbar .edui-combox-body .edui-arrow { + border-left: 1px solid #CCC; +} + +.edui-default .edui-toolbar .edui-state-hover .edui-combox-body { + background-color: #fff5d4; + border: 1px solid #dcac6c; +} + +.edui-default .edui-toolbar .edui-state-hover .edui-combox-body .edui-arrow { + border-left: 1px solid #dcac6c; +} + +.edui-default .edui-toolbar .edui-state-checked .edui-combox-body { + background-color: #FFE69F; + border: 1px solid #DCAC6C; +} + +.edui-toolbar .edui-state-checked .edui-combox-body .edui-arrow { + border-left: 1px solid #DCAC6C; +} + +.edui-toolbar .edui-state-disabled .edui-combox-body { + background-color: #F0F0EE; + opacity: 0.3; + filter: alpha(opacity = 30); +} + +.edui-toolbar .edui-state-opened .edui-combox-body { + background-color: white; + border: 1px solid gray; +} +/*普通按钮样式及状态*/ +.edui-default .edui-toolbar .edui-button .edui-icon, +.edui-default .edui-toolbar .edui-menubutton .edui-icon, +.edui-default .edui-toolbar .edui-splitbutton .edui-icon { + height: 20px !important; + width: 20px !important; + background-image: url(../images/icons.png); + background-image: url(../images/icons.gif) \9; +} + +.edui-default .edui-toolbar .edui-button .edui-button-wrap { + padding: 1px; + position: relative; +} + +.edui-default .edui-toolbar .edui-button .edui-state-hover .edui-button-wrap { + background-color: #fff5d4; + padding: 0; + border: 1px solid #dcac6c; +} + +.edui-default .edui-toolbar .edui-button .edui-state-checked .edui-button-wrap { + background-color: #ffe69f; + padding: 0; + border: 1px solid #dcac6c; + border-radius: 2px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; +} + +.edui-default .edui-toolbar .edui-button .edui-state-active .edui-button-wrap { + background-color: #ffffff; + padding: 0; + border: 1px solid gray; +} +.edui-default .edui-toolbar .edui-state-disabled .edui-label { + color: #ccc; +} +.edui-default .edui-toolbar .edui-state-disabled .edui-icon { + opacity: 0.3; + filter: alpha(opacity = 30); +} + +.edui-default .edui-for-lbinsertimage .edui-icon { + /* background: url(../images/videologo.gif) no-repeat 50% 50%; */ + background-position: -726px -77px; +} + +.edui-default .edui-for-lbinsertvideo .edui-icon { + /* background: url(../images/videologo.gif) no-repeat 50% 50%; */ + background-position: -320px -20px; +} + +.edui-default .edui-for-lbinsertmusic .edui-icon { + /* background: url(../images/videologo.gif) no-repeat 50% 50%; */ + background-position: -18px -40px; +} +/* toolbar icons */ +.edui-default .edui-for-undo .edui-icon { + background-position: -160px 0; +} + + +.edui-default .edui-for-redo .edui-icon { + background-position: -100px 0; +} + +.edui-default .edui-for-bold .edui-icon { + background-position: 0 0; +} + +.edui-default .edui-for-italic .edui-icon { + background-position: -60px 0; +} + +.edui-default .edui-for-fontborder .edui-icon { + background-position:-160px -40px; +} +.edui-default .edui-for-underline .edui-icon { + background-position: -140px 0; +} + +.edui-default .edui-for-strikethrough .edui-icon { + background-position: -120px 0; +} + +.edui-default .edui-for-subscript .edui-icon { + background-position: -600px 0; +} + +.edui-default .edui-for-superscript .edui-icon { + background-position: -620px 0; +} + +.edui-default .edui-for-blockquote .edui-icon { + background-position: -220px 0; +} + +.edui-default .edui-for-forecolor .edui-icon { + background-position: -720px 0; +} + +.edui-default .edui-for-backcolor .edui-icon { + background-position: -760px 0; +} + +.edui-default .edui-for-inserttable .edui-icon { + background-position: -580px -20px; +} + +.edui-default .edui-for-autotypeset .edui-icon { + background-position: -640px -40px; +} + +.edui-default .edui-for-justifyleft .edui-icon { + background-position: -460px 0; +} + +.edui-default .edui-for-justifycenter .edui-icon { + background-position: -420px 0; +} + +.edui-default .edui-for-justifyright .edui-icon { + background-position: -480px 0; +} + +.edui-default .edui-for-justifyjustify .edui-icon { + background-position: -440px 0; +} + +.edui-default .edui-for-insertorderedlist .edui-icon { + background-position: -80px 0; +} + +.edui-default .edui-for-insertunorderedlist .edui-icon { + background-position: -20px 0; +} + +.edui-default .edui-for-lineheight .edui-icon { + background-position: -725px -40px; +} + +.edui-default .edui-for-rowspacingbottom .edui-icon { + background-position: -745px -40px; +} + +.edui-default .edui-for-rowspacingtop .edui-icon { + background-position: -765px -40px; +} + +.edui-default .edui-for-horizontal .edui-icon { + background-position: -360px 0; +} + +.edui-default .edui-for-link .edui-icon { + background-position: -500px 0; +} + +.edui-default .edui-for-code .edui-icon { + background-position: -440px -40px; +} + +.edui-default .edui-for-insertimage .edui-icon { + background-position: -726px -77px; +} + +.edui-default .edui-for-insertframe .edui-icon { + background-position: -240px -40px; +} + +.edui-default .edui-for-emoticon .edui-icon { + background-position: -60px -20px; +} + +.edui-default .edui-for-spechars .edui-icon { + background-position: -240px 0; +} + +.edui-default .edui-for-help .edui-icon { + background-position: -340px 0; +} + +.edui-default .edui-for-print .edui-icon { + background-position: -440px -20px; +} + +.edui-default .edui-for-preview .edui-icon { + background-position: -420px -20px; +} + +.edui-default .edui-for-selectall .edui-icon { + background-position: -400px -20px; +} + +.edui-default .edui-for-searchreplace .edui-icon { + background-position: -520px -20px; +} + +.edui-default .edui-for-map .edui-icon { + background-position: -40px -40px; +} + +.edui-default .edui-for-gmap .edui-icon { + background-position: -260px -40px; +} + +.edui-default .edui-for-insertvideo .edui-icon { + background-position: -320px -20px; +} + +.edui-default .edui-for-time .edui-icon { + background-position: -160px -20px; +} + +.edui-default .edui-for-date .edui-icon { + background-position: -140px -20px; +} + +.edui-default .edui-for-cut .edui-icon { + background-position: -680px 0; +} + +.edui-default .edui-for-copy .edui-icon { + background-position: -700px 0; +} + +.edui-default .edui-for-paste .edui-icon { + background-position: -560px 0; +} + +.edui-default .edui-for-formatmatch .edui-icon { + background-position: -40px 0; +} + +.edui-default .edui-for-pasteplain .edui-icon { + background-position: -360px -20px; +} + +.edui-default .edui-for-directionalityltr .edui-icon { + background-position: -20px -20px; +} + +.edui-default .edui-for-directionalityrtl .edui-icon { + background-position: -40px -20px; +} + +.edui-default .edui-for-source .edui-icon { + background-position: -261px -0px; +} + +.edui-default .edui-for-removeformat .edui-icon { + background-position: -580px 0; +} + +.edui-default .edui-for-unlink .edui-icon { + background-position: -640px 0; +} + +.edui-default .edui-for-touppercase .edui-icon { + background-position: -786px 0; +} + +.edui-default .edui-for-tolowercase .edui-icon { + background-position: -806px 0; +} + +.edui-default .edui-for-insertrow .edui-icon { + background-position: -478px -76px; +} + +.edui-default .edui-for-insertrownext .edui-icon { + background-position: -498px -76px; +} + +.edui-default .edui-for-insertcol .edui-icon { + background-position: -455px -76px; +} + +.edui-default .edui-for-insertcolnext .edui-icon { + background-position: -429px -76px; +} + +.edui-default .edui-for-mergeright .edui-icon { + background-position: -60px -40px; +} + +.edui-default .edui-for-mergedown .edui-icon { + background-position: -80px -40px; +} + +.edui-default .edui-for-splittorows .edui-icon { + background-position: -100px -40px; +} + +.edui-default .edui-for-splittocols .edui-icon { + background-position: -120px -40px; +} + +.edui-default .edui-for-insertparagraphbeforetable .edui-icon { + background-position: -140px -40px; +} + +.edui-default .edui-for-deleterow .edui-icon { + background-position: -660px -20px; +} + +.edui-default .edui-for-deletecol .edui-icon { + background-position: -640px -20px; +} + +.edui-default .edui-for-splittocells .edui-icon { + background-position: -800px -20px; +} + +.edui-default .edui-for-mergecells .edui-icon { + background-position: -760px -20px; +} + +.edui-default .edui-for-deletetable .edui-icon { + background-position: -620px -20px; +} + +.edui-default .edui-for-cleardoc .edui-icon { + background-position: -520px 0; +} + +.edui-default .edui-for-fullscreen .edui-icon { + background-position: -100px -20px; +} + +.edui-default .edui-for-anchor .edui-icon { + background-position: -200px 0; +} + +.edui-default .edui-for-pagebreak .edui-icon { + background-position: -460px -40px; +} + +.edui-default .edui-for-imagenone .edui-icon { + background-position: -480px -40px; +} + +.edui-default .edui-for-imageleft .edui-icon { + background-position: -500px -40px; +} + +.edui-default .edui-for-wordimage .edui-icon { + background-position: -660px -40px; +} + +.edui-default .edui-for-imageright .edui-icon { + background-position: -520px -40px; +} + +.edui-default .edui-for-imagecenter .edui-icon { + background-position: -540px -40px; +} + +.edui-default .edui-for-indent .edui-icon { + background-position: -400px 0; +} + +.edui-default .edui-for-outdent .edui-icon { + background-position: -540px 0; +} + +.edui-default .edui-for-webapp .edui-icon { + background-position: -601px -40px +} + +.edui-default .edui-for-table .edui-icon { + background-position: -580px -20px; +} + +.edui-default .edui-for-edittable .edui-icon { + background-position: -420px -40px; +} + +.edui-default .edui-for-template .edui-icon { + background-position: -339px -40px; +} + +.edui-default .edui-for-delete .edui-icon { + background-position: -360px -40px; +} + +.edui-default .edui-for-attachment .edui-icon { + background-position: -620px -40px; +} + +.edui-default .edui-for-edittd .edui-icon { + background-position: -700px -40px; +} + +.edui-default .edui-for-snapscreen .edui-icon { + background-position: -581px -40px +} + +.edui-default .edui-for-scrawl .edui-icon { + background-position: -801px -41px +} + +.edui-default .edui-for-background .edui-icon { + background-position: -680px -40px; +} + +.edui-default .edui-for-music .edui-icon { + background-position: -18px -40px; +} + +.edui-default .edui-for-formula .edui-icon { + background-position: -200px -40px; +} + +.edui-default .edui-for-aligntd .edui-icon { + background-position: -236px -76px; +} + +.edui-default .edui-for-insertparagraphtrue .edui-icon { + background-position: -625px -76px; +} + +.edui-default .edui-for-insertparagraph .edui-icon { + background-position: -602px -76px; +} + +.edui-default .edui-for-insertcaption .edui-icon { + background-position: -336px -76px; +} + +.edui-default .edui-for-deletecaption .edui-icon { + background-position: -362px -76px; +} + +.edui-default .edui-for-inserttitle .edui-icon { + background-position: -286px -76px; +} + +.edui-default .edui-for-deletetitle .edui-icon { + background-position: -311px -76px; +} + +.edui-default .edui-for-aligntable .edui-icon { + background-position: -440px 0; +} + +.edui-default .edui-for-tablealignment-left .edui-icon { + background-position: -460px 0; +} + +.edui-default .edui-for-tablealignment-center .edui-icon { + background-position: -420px 0; +} + +.edui-default .edui-for-tablealignment-right .edui-icon { + background-position: -480px 0; +} + +.edui-default .edui-for-drafts .edui-icon { + background-position: -560px 0; +} + +.edui-default .edui-for-charts .edui-icon { + background: url( ../images/charts.png ) no-repeat 2px 3px!important; +} + +.edui-default .edui-for-inserttitlecol .edui-icon { + background-position: -673px -76px; +} + +.edui-default .edui-for-deletetitlecol .edui-icon { + background-position: -698px -76px; +} + +.edui-default .edui-for-simpleupload .edui-icon { + background-position: -380px 0px; +} +/*splitbutton*/ +.edui-default .edui-toolbar .edui-splitbutton-body .edui-arrow, +.edui-default .edui-toolbar .edui-menubutton-body .edui-arrow { + background: url(../images/icons.png) -741px 0; + _background: url(../images/icons.gif) -741px 0; + height: 20px; + width: 9px; +} + +.edui-default .edui-toolbar .edui-splitbutton .edui-splitbutton-body, +.edui-default .edui-toolbar .edui-menubutton .edui-menubutton-body { + padding: 1px; +} + +.edui-default .edui-toolbar .edui-splitborder { + width: 1px; + height: 20px; +} + +.edui-default .edui-toolbar .edui-state-hover .edui-splitborder { + width: 1px; + border-left: 0px solid #dcac6c; +} + +.edui-default .edui-toolbar .edui-state-active .edui-splitborder { + width: 0; + border-left: 1px solid gray; +} + +.edui-default .edui-toolbar .edui-state-opened .edui-splitborder { + width: 1px; + border: 0; +} + +.edui-default .edui-toolbar .edui-splitbutton .edui-state-hover .edui-splitbutton-body, +.edui-default .edui-toolbar .edui-menubutton .edui-state-hover .edui-menubutton-body { + background-color: #fff5d4; + border: 1px solid #dcac6c; + padding: 0; +} + +.edui-default .edui-toolbar .edui-splitbutton .edui-state-checked .edui-splitbutton-body, +.edui-default .edui-toolbar .edui-menubutton .edui-state-checked .edui-menubutton-body { + background-color: #FFE69F; + border: 1px solid #DCAC6C; + padding: 0; +} + +.edui-default .edui-toolbar .edui-splitbutton .edui-state-active .edui-splitbutton-body, +.edui-default .edui-toolbar .edui-menubutton .edui-state-active .edui-menubutton-body { + background-color: #ffffff; + border: 1px solid gray; + padding: 0; +} + +.edui-default .edui-state-disabled .edui-arrow { + opacity: 0.3; + _filter: alpha(opacity = 30); +} + +.edui-default .edui-toolbar .edui-splitbutton .edui-state-opened .edui-splitbutton-body, +.edui-default .edui-toolbar .edui-menubutton .edui-state-opened .edui-menubutton-body { + background-color: white; + border: 1px solid gray; + padding: 0; +} + +.edui-default .edui-for-insertorderedlist .edui-bordereraser, +.edui-default .edui-for-lineheight .edui-bordereraser, +.edui-default .edui-for-rowspacingtop .edui-bordereraser, +.edui-default .edui-for-rowspacingbottom .edui-bordereraser, +.edui-default .edui-for-insertunorderedlist .edui-bordereraser { + background-color: white; +} + +/* 解决嵌套导致的图标问题 */ +.edui-default .edui-for-insertorderedlist .edui-popup-body .edui-icon, +.edui-default .edui-for-lineheight .edui-popup-body .edui-icon, +.edui-default .edui-for-rowspacingtop .edui-popup-body .edui-icon, +.edui-default .edui-for-rowspacingbottom .edui-popup-body .edui-icon, +.edui-default .edui-for-insertunorderedlist .edui-popup-body .edui-icon { + /*background-position: 0 -40px;*/ + background-image: none ; +} + +/* 弹出菜单 */ +.edui-default .edui-popup { + z-index: 3000; + background-color: #ffffff; + width:auto; + height:auto; + +} + +.edui-default .edui-popup .edui-shadow { + left: 0; + top: 0; + width: 100%; + height: 100%; +} + +.edui-default .edui-popup-content { + border:1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + *border-right-width: 2px; + *border-bottom-width: 2px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 3px 4px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 3px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 3px 4px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; + padding: 5px; + background:#ffffff; +} + +.edui-default .edui-popup .edui-bordereraser { + background-color: white; + height: 3px; +} + +.edui-default .edui-menu .edui-bordereraser { + height: 3px; +} + +.edui-default .edui-anchor-topleft .edui-bordereraser { + left: 1px; + top: -2px; +} + +.edui-default .edui-anchor-topright .edui-bordereraser { + right: 1px; + top: -2px; +} + +.edui-default .edui-anchor-bottomleft .edui-bordereraser { + left: 0; + bottom: -6px; + height: 7px; + border-left: 1px solid gray; + border-right: 1px solid gray; +} + +.edui-default .edui-anchor-bottomright .edui-bordereraser { + right: 0; + bottom: -6px; + height: 7px; + border-left: 1px solid gray; + border-right: 1px solid gray; +} + +.edui-popup div{ + width:auto; + height:auto; +} +.edui-default .edui-editor-messageholder { + display: block; + width: 150px; + height: auto; + border: 0; + margin: 0; + padding: 0; + position: absolute; + top: 28px; + right: 3px; +} + +.edui-default .edui-message{ + min-height: 10px; + text-shadow: 0 1px 0 rgba(255,255,255,0.5); + padding: 0; + margin-bottom: 3px; + position: relative; +} +.edui-default .edui-message-body{ + border-radius: 3px; + padding: 8px 15px 8px 8px; + color: #c09853; + background-color: #fcf8e3; + border: 1px solid #fbeed5; +} +.edui-default .edui-message-type-info{ + color: #3a87ad; + background-color: #d9edf7; + border-color: #bce8f1 +} +.edui-default .edui-message-type-success{ + color: #468847; + background-color: #dff0d8; + border-color: #d6e9c6 +} +.edui-default .edui-message-type-danger, +.edui-default .edui-message-type-error{ + color: #b94a48; + background-color: #f2dede; + border-color: #eed3d7 +} +.edui-default .edui-message .edui-message-closer { + display: block; + width: 16px; + height: 16px; + line-height: 16px; + position: absolute; + top: 0; + right: 0; + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + float: right; + font-size: 20px; + font-weight: bold; + color: #999; + text-shadow: 0 1px 0 #fff; + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; +} +.edui-default .edui-message .edui-message-content { + font-size: 10pt; + word-wrap: break-word; + word-break: normal; +} +/* 弹出对话框按钮和对话框大小 */ +.edui-default .edui-dialog { + z-index: 2000; + position: absolute; + +} + +.edui-dialog div{ + width:auto; +} + +.edui-default .edui-dialog-wrap { + margin-right: 6px; + margin-bottom: 6px; +} + +.edui-default .edui-dialog-fullscreen-flag { + margin-right: 0; + margin-bottom: 0; +} + +.edui-default .edui-dialog-body { + position: relative; + padding:2px 0 0 2px; + _zoom: 1; +} + +.edui-default .edui-dialog-fullscreen-flag .edui-dialog-body { + padding: 0; +} + +.edui-default .edui-dialog-shadow { + position: absolute; + z-index: -1; + left: 0; + top: 0; + width: 100%; + height: 100%; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + *border-right-width: 2px; + *border-bottom-width: 2px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; +} + +.edui-default .edui-dialog-foot { + background-color: white; +} + +.edui-default .edui-dialog-titlebar { + height: 26px; + border-bottom: 1px solid #c6c6c6; + background: url(../images/dialog-title-bg.png) repeat-x bottom; + position: relative; + cursor: move; +} +.edui-default .edui-dialog-caption { + font-weight: bold; + font-size: 12px; + line-height: 26px; + padding-left: 5px; +} + +.edui-default .edui-dialog-draghandle { + height: 26px; +} + +.edui-default .edui-dialog-closebutton { + position: absolute !important; + right: 5px; + top: 3px; +} + +.edui-default .edui-dialog-closebutton .edui-button-body { + height: 20px; + width: 20px; + cursor: pointer; + background: url("../images/icons-all.gif") no-repeat 0 -59px; +} + +.edui-default .edui-dialog-closebutton .edui-state-hover .edui-button-body { + background: url("../images/icons-all.gif") no-repeat 0 -89px; +} + +.edui-default .edui-dialog-foot { + height: 40px; +} + +.edui-default .edui-dialog-buttons { + position: absolute; + right: 0; +} + +.edui-default .edui-dialog-buttons .edui-button { + margin-right: 10px; +} + +.edui-default .edui-dialog-buttons .edui-button .edui-button-body { + background: url("../images/icons-all.gif") no-repeat; + height: 24px; + width: 96px; + font-size: 12px; + line-height: 24px; + text-align: center; + cursor: default; +} + +.edui-default .edui-dialog-buttons .edui-button .edui-state-hover .edui-button-body { + background: url("../images/icons-all.gif") no-repeat 0 -30px; +} + +.edui-default .edui-dialog iframe { + border: 0; + padding: 0; + margin: 0; + vertical-align: top; +} + +.edui-default .edui-dialog-modalmask { + opacity: 0.3; + filter: alpha(opacity = 30); + background-color: #ccc; + position: absolute; + /*z-index: 1999;*/ +} + +.edui-default .edui-dialog-dragmask { + position: absolute; + /*z-index: 2001;*/ + background-color: transparent; + cursor: move; +} + +.edui-default .edui-dialog-content { + position: relative; +} + +.edui-default .dialogcontmask { + cursor: move; + visibility: hidden; + display: block; + position: absolute; + width: 100%; + height: 100%; + opacity: 0; + filter: alpha(opacity = 0); +} + +/*link-dialog*/ +.edui-default .edui-for-link .edui-dialog-content { + width: 420px; + height: 200px; + overflow: hidden; +} +/*background-dialog*/ +.edui-default .edui-for-background .edui-dialog-content { + width: 440px; + height: 280px; + overflow: hidden; +} + +/*template-dialog*/ +.edui-default .edui-for-template .edui-dialog-content { + width: 630px; + height: 390px; + overflow: hidden; +} + +/*scrawl-dialog*/ +.edui-default .edui-for-scrawl .edui-dialog-content { + width: 515px; + *width: 506px; + height: 360px; +} + +/*spechars-dialog*/ +.edui-default .edui-for-spechars .edui-dialog-content { + width: 620px; + height: 500px; + *width: 630px; + *height: 570px; +} + +/*image-dialog*/ +.edui-default .edui-for-insertimage .edui-dialog-content { + width: 650px; + height: 400px; + overflow: hidden; +} +/*webapp-dialog*/ +.edui-default .edui-for-webapp .edui-dialog-content { + width: 560px; + _width: 565px; + height: 450px; + overflow: hidden; +} + +/*image-insertframe*/ +.edui-default .edui-for-insertframe .edui-dialog-content { + width: 350px; + height: 200px; + overflow: hidden; +} + +/*wordImage-dialog*/ +.edui-default .edui-for-wordimage .edui-dialog-content { + width: 620px; + height: 380px; + overflow: hidden; +} + +/*attachment-dialog*/ +.edui-default .edui-for-attachment .edui-dialog-content { + width: 650px; + height: 400px; + overflow: hidden; +} + + +/*map-dialog*/ +.edui-default .edui-for-map .edui-dialog-content { + width: 550px; + height: 400px; +} + +/*gmap-dialog*/ +.edui-default .edui-for-gmap .edui-dialog-content { + width: 550px; + height: 400px; +} + +/*video-dialog*/ +.edui-default .edui-for-insertvideo .edui-dialog-content { + width: 590px; + height: 390px; +} + +/*anchor-dialog*/ +.edui-default .edui-for-anchor .edui-dialog-content { + width: 320px; + height: 60px; + overflow: hidden; +} + +/*searchreplace-dialog*/ +.edui-default .edui-for-searchreplace .edui-dialog-content { + width: 400px; + height: 220px; +} + +/*help-dialog*/ +.edui-default .edui-for-help .edui-dialog-content { + width: 400px; + height: 420px; +} + +/*edittable-dialog*/ +.edui-default .edui-for-edittable .edui-dialog-content { + width: 540px; + _width:590px; + height: 335px; +} + +/*edittip-dialog*/ +.edui-default .edui-for-edittip .edui-dialog-content { + width: 225px; + height: 60px; +} + +/*edittd-dialog*/ +.edui-default .edui-for-edittd .edui-dialog-content { + width: 240px; + height: 50px; +} +/*snapscreen-dialog*/ +.edui-default .edui-for-snapscreen .edui-dialog-content { + width: 400px; + height: 220px; +} + +/*music-dialog*/ +.edui-default .edui-for-music .edui-dialog-content { + width: 515px; + height: 360px; +} + +/*段落弹出菜单*/ +.edui-default .edui-for-paragraph .edui-listitem-label { + font-family: Tahoma, Verdana, Arial, Helvetica; +} + +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-p { + font-size: 22px; + line-height: 27px; +} + +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h1 { + font-weight: bolder; + font-size: 32px; + line-height: 36px; +} + +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h2 { + font-weight: bolder; + font-size: 27px; + line-height: 29px; +} + +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h3 { + font-weight: bolder; + font-size: 19px; + line-height: 23px; +} + +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h4 { + font-weight: bolder; + font-size: 16px; + line-height: 19px +} + +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h5 { + font-weight: bolder; + font-size: 13px; + line-height: 16px; +} + +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h6 { + font-weight: bolder; + font-size: 12px; + line-height: 14px; +} +/* 表格弹出菜单 */ +.edui-default .edui-for-inserttable .edui-splitborder { + display: none +} +.edui-default .edui-for-inserttable .edui-splitbutton-body .edui-arrow { + width: 0 +} +.edui-default .edui-toolbar .edui-for-inserttable .edui-state-active .edui-splitborder{ + border-left: 1px solid transparent; +} +.edui-default .edui-tablepicker .edui-infoarea { + height: 14px; + line-height: 14px; + font-size: 12px; + width: 220px; + margin-bottom: 3px; + clear: both; +} + +.edui-default .edui-tablepicker .edui-infoarea .edui-label { + float: left; +} + +.edui-default .edui-dialog-buttons .edui-label { + line-height: 24px; +} + +.edui-default .edui-tablepicker .edui-infoarea .edui-clickable { + float: right; +} + +.edui-default .edui-tablepicker .edui-pickarea { + background: url("../images/unhighlighted.gif") repeat; + height: 220px; + width: 220px; +} + +.edui-default .edui-tablepicker .edui-pickarea .edui-overlay { + background: url("../images/highlighted.gif") repeat; +} + +/* 颜色弹出菜单 */ +.edui-default .edui-colorpicker-topbar { + height: 27px; + width: 200px; + /*border-bottom: 1px gray dashed;*/ +} + +.edui-default .edui-colorpicker-preview { + height: 20px; + border: 1px inset black; + margin-left: 1px; + width: 128px; + float: left; +} + +.edui-default .edui-colorpicker-nocolor { + float: right; + margin-right: 1px; + font-size: 12px; + line-height: 14px; + height: 14px; + border: 1px solid #333; + padding: 3px 5px; + cursor: pointer; +} + +.edui-default .edui-colorpicker-tablefirstrow { + height: 30px; +} + +.edui-default .edui-colorpicker-colorcell { + width: 14px; + height: 14px; + display: block; + margin: 0; + cursor: pointer; +} + +.edui-default .edui-colorpicker-colorcell:hover { + width: 14px; + height: 14px; + margin: 0; +} +.edui-default .edui-colorpicker-advbtn{ + display: block; + text-align: center; + cursor: pointer; + height:20px; +} +.arrow_down{ + background: white url('../images/arrow_down.png') no-repeat center; +} +.arrow_up{ + background: white url('../images/arrow_up.png') no-repeat center; +} +/*高级的样式*/ +.edui-colorpicker-adv{ + position: relative; + overflow: hidden; + height: 180px; + display: none; +} +.edui-colorpicker-plant, .edui-colorpicker-hue { + border: solid 1px #666; +} +.edui-colorpicker-pad { + width: 150px; + height: 150px; + left: 14px; + top: 13px; + position: absolute; + background: red; + overflow: hidden; + cursor: crosshair; +} +.edui-colorpicker-cover{ + position: absolute; + top: 0; + left: 0; + width: 150px; + height: 150px; + background: url("../images/tangram-colorpicker.png") -160px -200px; +} +.edui-colorpicker-padDot{ + position: absolute; + top: 0; + left: 0; + width: 11px; + height: 11px; + overflow: hidden; + background: url(../images/tangram-colorpicker.png) 0px -200px repeat-x; + z-index: 1000; + +} +.edui-colorpicker-sliderMain { + position: absolute; + left: 171px; + top: 13px; + width: 19px; + height: 152px; + background: url(../images/tangram-colorpicker.png) -179px -12px no-repeat; + +} +.edui-colorpicker-slider { + width: 100%; + height: 100%; + cursor: pointer; +} +.edui-colorpicker-thumb{ + position: absolute; + top: 0; + cursor: pointer; + height: 3px; + left: -1px; + right: -1px; + border: 1px solid black; + background: white; + opacity: .8; +} +/*自动排版弹出菜单*/ +.edui-default .edui-autotypesetpicker .edui-autotypesetpicker-body { + font-size: 12px; + margin-bottom: 3px; + clear: both; +} + +.edui-default .edui-autotypesetpicker-body table { + border-collapse: separate; + border-spacing: 2px; +} + +.edui-default .edui-autotypesetpicker-body td { + font-size: 12px; + word-wrap:break-word; +} + +.edui-default .edui-autotypesetpicker-body td input { + margin: 3px 3px 3px 4px; + *margin: 1px 0 0 0; +} +/*自动排版弹出菜单*/ +.edui-default .edui-cellalignpicker .edui-cellalignpicker-body { + width: 70px; + font-size: 12px; + cursor: default; +} + +.edui-default .edui-cellalignpicker-body table { + border-collapse: separate; + border-spacing: 0; +} +.edui-default .edui-cellalignpicker-body td{ + padding: 1px; +} +.edui-default .edui-cellalignpicker-body .edui-icon{ + height: 20px; + width: 20px; + padding: 1px; + background-image: url(../images/table-cell-align.png); +} + +.edui-default .edui-cellalignpicker-body .edui-left{ + background-position: 0 0; +} + +.edui-default .edui-cellalignpicker-body .edui-center{ + background-position: -25px 0; +} +.edui-default .edui-cellalignpicker-body .edui-right{ + background-position: -51px 0; +} + +.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-left{ + background-position: -73px 0; +} + +.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-center{ + background-position: -98px 0; +} + +.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-right{ + background-position: -124px 0; +} + +.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-left { + background-position: -146px 0; + background-color: #f1f4f5; +} + +.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-center { + background-position: -245px 0; +} + +.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-right { + background-position: -271px 0; +} +/*分隔线*/ +.edui-default .edui-toolbar .edui-separator { + width: 2px; + height: 20px; + margin: 2px 4px 2px 3px; + background: url(../images/icons.png) -181px 0; + background: url(../images/icons.gif) -181px 0 \9; +} + +/*颜色按钮 */ +.edui-default .edui-toolbar .edui-colorbutton .edui-colorlump { + position: absolute; + overflow: hidden; + bottom: 1px; + left: 1px; + width: 18px; + height: 4px; +} +/*表情按钮及弹出菜单*/ +/*去除了表情的下拉箭头*/ +.edui-default .edui-for-emotion .edui-icon { + background-position: -60px -20px; +} +.edui-default .edui-for-emotion .edui-popup-content iframe +{ + width: 514px; + height: 380px; + overflow: hidden; +} +.edui-default .edui-for-emotion .edui-popup-content +{ + position: relative; + z-index: 555 +} + +.edui-default .edui-for-emotion .edui-splitborder { + display: none +} + +.edui-default .edui-for-emotion .edui-splitbutton-body .edui-arrow +{ + width: 0 +} +.edui-default .edui-toolbar .edui-for-emotion .edui-state-active .edui-splitborder +{ + border-left: 1px solid transparent; +} +/*contextmenu*/ +.edui-default .edui-hassubmenu .edui-arrow { + height: 20px; + width: 20px; + float: right; + background: url("../images/icons-all.gif") no-repeat 10px -233px; +} + +.edui-default .edui-menu-body .edui-menuitem { + padding: 1px; +} + +.edui-default .edui-menuseparator { + margin: 2px 0; + height: 1px; + overflow: hidden; +} + +.edui-default .edui-menuseparator-inner { + border-bottom: 1px solid #e2e3e3; + margin-left: 29px; + margin-right: 1px; +} + +.edui-default .edui-menu-body .edui-state-hover { + padding: 0 !important; + background-color: #fff5d4; + border: 1px solid #dcac6c; +} +/*弹出菜单*/ +.edui-default .edui-shortcutmenu { + padding: 2px; + width: 190px; + height: 50px; + background-color: #fff; + border: 1px solid #ccc; + border-radius: 5px; +} + +/*粘贴弹出菜单*/ +.edui-default .edui-wordpastepop .edui-popup-content{ + border: none; + padding: 0; + width: 54px; + height: 21px; +} +.edui-default .edui-pasteicon { + width: 100%; + height: 100%; + background-image: url('../images/wordpaste.png'); + background-position: 0 0; +} + +.edui-default .edui-pasteicon.edui-state-opened { + background-position: 0 -34px; +} + +.edui-default .edui-pastecontainer { + position: relative; + visibility: hidden; + width: 97px; + background: #fff; + border: 1px solid #ccc; +} + +.edui-default .edui-pastecontainer .edui-title { + font-weight: bold; + background: #F8F8FF; + height: 25px; + line-height: 25px; + font-size: 12px; + padding-left: 5px; +} + +.edui-default .edui-pastecontainer .edui-button { + overflow: hidden; + margin: 3px 0; +} + +.edui-default .edui-pastecontainer .edui-button .edui-richtxticon, +.edui-default .edui-pastecontainer .edui-button .edui-tagicon, +.edui-default .edui-pastecontainer .edui-button .edui-plaintxticon{ + float: left; + cursor: pointer; + width: 29px; + height: 29px; + margin-left: 5px; + background-image: url('../images/wordpaste.png'); + background-repeat: no-repeat; +} +.edui-default .edui-pastecontainer .edui-button .edui-richtxticon { + margin-left: 0; + background-position: -109px 0; +} +.edui-default .edui-pastecontainer .edui-button .edui-tagicon { + background-position: -148px 1px; +} + +.edui-default .edui-pastecontainer .edui-button .edui-plaintxticon { + background-position: -72px 0; +} + +.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-richtxticon { + background-position: -109px -34px; +} +.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-tagicon{ + background-position: -148px -34px; +} +.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-plaintxticon{ + background-position: -72px -34px; +} diff --git a/public/static/Ueditor/themes/default/css/ueditor.min.css b/public/static/Ueditor/themes/default/css/ueditor.min.css new file mode 100644 index 0000000..8ca74eb --- /dev/null +++ b/public/static/Ueditor/themes/default/css/ueditor.min.css @@ -0,0 +1,8 @@ +/*! + * UEditor + * version: ueditor + * build: Wed Dec 26 2018 17:25:05 GMT+0800 (CST) + */ + + +.edui-default .edui-box{border:0;padding:0;margin:0;overflow:hidden}.edui-default a.edui-box{display:block;text-decoration:none;color:#000}.edui-default a.edui-box:hover{text-decoration:none}.edui-default a.edui-box:active{text-decoration:none}.edui-default table.edui-box{border-collapse:collapse}.edui-default ul.edui-box{list-style-type:none}div.edui-box{position:relative;display:-moz-inline-box!important;display:inline-block!important;vertical-align:top}.edui-default .edui-clearfix{zoom:1}.edui-default .edui-clearfix:after{content:'\20';display:block;clear:both}* html div.edui-box{display:inline!important}:first-child+html div.edui-box{display:inline!important}.edui-default .edui-button-body,.edui-splitbutton-body,.edui-menubutton-body,.edui-combox-body{position:relative}.edui-default .edui-popup{position:absolute;-webkit-user-select:none;-moz-user-select:none}.edui-default .edui-popup .edui-shadow{position:absolute;z-index:-1}.edui-default .edui-popup .edui-bordereraser{position:absolute;overflow:hidden}.edui-default .edui-tablepicker .edui-canvas{position:relative}.edui-default .edui-tablepicker .edui-canvas .edui-overlay{position:absolute}.edui-default .edui-dialog-modalmask,.edui-dialog-dragmask{position:absolute;left:0;top:0;width:100%;height:100%}.edui-default .edui-toolbar{position:relative}.edui-default .edui-label{cursor:default}.edui-default span.edui-clickable{color:#00f;cursor:pointer;text-decoration:underline}.edui-default span.edui-unclickable{color:gray;cursor:default}.edui-default .edui-toolbar{cursor:default;-webkit-user-select:none;-moz-user-select:none;padding:1px;overflow:hidden;zoom:1;width:auto;height:auto}.edui-default .edui-toolbar .edui-button,.edui-default .edui-toolbar .edui-splitbutton,.edui-default .edui-toolbar .edui-menubutton,.edui-default .edui-toolbar .edui-combox{margin:1px}.edui-default .edui-editor{border:1px solid #d4d4d4;background-color:#fff;position:relative;overflow:visible;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.edui-editor div{width:auto;height:auto}.edui-default .edui-editor-toolbarbox{position:relative;zoom:1;-webkit-box-shadow:0 1px 4px rgba(204,204,204,.6);-moz-box-shadow:0 1px 4px rgba(204,204,204,.6);box-shadow:0 1px 4px rgba(204,204,204,.6);border-top-left-radius:2px;border-top-right-radius:2px}.edui-default .edui-editor-toolbarboxouter{border-bottom:1px solid #d4d4d4;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#f2f2f2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f2f2f2));background-image:-webkit-linear-gradient(top,#fff,#f2f2f2);background-image:-o-linear-gradient(top,#fff,#f2f2f2);background-image:linear-gradient(to bottom,#fff,#f2f2f2);background-repeat:repeat-x;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0);*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,.065);box-shadow:0 1px 4px rgba(0,0,0,.065)}.edui-default .edui-editor-toolbarboxinner{padding:2px}.edui-default .edui-editor-iframeholder{position:relative}.edui-default .edui-editor-bottomContainer{overflow:hidden}.edui-default .edui-editor-bottomContainer table{width:100%;height:0;overflow:hidden;border-spacing:0}.edui-default .edui-editor-bottomContainer td{white-space:nowrap;border-top:1px solid #ccc;line-height:20px;font-size:12px;font-family:Arial,Helvetica,Tahoma,Verdana,Sans-Serif}.edui-default .edui-editor-wordcount{text-align:right;margin-right:5px;color:#aaa}.edui-default .edui-editor-scale{width:12px}.edui-default .edui-editor-scale .edui-editor-icon{float:right;width:100%;height:12px;margin-top:10px;background:url(../images/scale.png) no-repeat;cursor:se-resize}.edui-default .edui-editor-breadcrumb{margin:2px 0 0 3px}.edui-default .edui-editor-breadcrumb span{cursor:pointer;text-decoration:underline;color:#00f}.edui-default .edui-toolbar .edui-for-fullscreen{float:right}.edui-default .edui-bubble .edui-popup-content{border:1px solid #DCAC6C;background-color:#fff6d9;padding:5px;font-size:10pt;font-family:"宋体"}.edui-default .edui-bubble .edui-shadow{}.edui-default .edui-editor-toolbarmsg{background-color:#FFF6D9;border-bottom:1px solid #ccc;position:absolute;bottom:-25px;left:0;z-index:1009;width:99.9%}.edui-default .edui-editor-toolbarmsg-upload{font-size:14px;color:#00f;width:100px;height:16px;line-height:16px;cursor:pointer;position:absolute;top:5px;left:350px}.edui-default .edui-editor-toolbarmsg-label{font-size:12px;line-height:16px;padding:4px}.edui-default .edui-editor-toolbarmsg-close{float:right;width:20px;height:16px;line-height:16px;cursor:pointer;color:red}.edui-default .edui-list .edui-bordereraser{display:none}.edui-default .edui-listitem{padding:1px;white-space:nowrap}.edui-default .edui-list .edui-state-hover{position:relative;background-color:#fff5d4;border:1px solid #dcac6c;padding:0}.edui-default .edui-for-fontfamily .edui-listitem-label{min-width:130px;_width:120px;font-size:12px;height:22px;line-height:22px;padding-left:5px}.edui-default .edui-for-insertcode .edui-listitem-label{min-width:120px;_width:120px;font-size:12px;height:22px;line-height:22px;padding-left:5px}.edui-default .edui-for-underline .edui-listitem-label{min-width:120px;_width:120px;padding:3px 5px;font-size:12px}.edui-default .edui-for-fontsize .edui-listitem-label{min-width:120px;_width:120px;padding:3px 5px}.edui-default .edui-for-paragraph .edui-listitem-label{min-width:200px;_width:200px;padding:2px 5px}.edui-default .edui-for-rowspacingtop .edui-listitem-label,.edui-default .edui-for-rowspacingbottom .edui-listitem-label{min-width:53px;_width:53px;padding:2px 5px}.edui-default .edui-for-lineheight .edui-listitem-label{min-width:53px;_width:53px;padding:2px 5px}.edui-default .edui-for-customstyle .edui-listitem-label{min-width:200px;_width:200px;width:200px!important;padding:2px 5px}.edui-default .edui-menu{z-index:3000}.edui-default .edui-menu .edui-popup-content{padding:3px}.edui-default .edui-menu-body{_width:150px;min-width:170px;background:url(../images/sparator_v.png) repeat-y 25px}.edui-default .edui-menuitem-body{}.edui-default .edui-menuitem{height:20px;cursor:default;vertical-align:top}.edui-default .edui-menuitem .edui-icon{width:20px!important;height:20px!important;background:url(../images/icons.png) 0 -4000px;background:url(../images/icons.gif) 0 -4000px\9}.edui-default .edui-menuitem .edui-label{font-size:12px;line-height:20px;height:20px;padding-left:10px}.edui-default .edui-state-checked .edui-menuitem-body{background:url(../images/icons-all.gif) no-repeat 6px -205px}.edui-default .edui-state-disabled .edui-menuitem-label{color:gray}.edui-default .edui-toolbar .edui-combox-body .edui-button-body{width:60px;font-size:12px;height:20px;line-height:20px;padding-left:5px;white-space:nowrap;margin:0 3px 0 0}.edui-default .edui-toolbar .edui-combox-body .edui-arrow{background:url(../images/icons.png) -741px 0;_background:url(../images/icons.gif) -741px 0;height:20px;width:9px}.edui-default .edui-toolbar .edui-combox .edui-combox-body{border:1px solid #CCC;background-color:#fff;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.edui-default .edui-toolbar .edui-combox-body .edui-splitborder{display:none}.edui-default .edui-toolbar .edui-combox-body .edui-arrow{border-left:1px solid #CCC}.edui-default .edui-toolbar .edui-state-hover .edui-combox-body{background-color:#fff5d4;border:1px solid #dcac6c}.edui-default .edui-toolbar .edui-state-hover .edui-combox-body .edui-arrow{border-left:1px solid #dcac6c}.edui-default .edui-toolbar .edui-state-checked .edui-combox-body{background-color:#FFE69F;border:1px solid #DCAC6C}.edui-toolbar .edui-state-checked .edui-combox-body .edui-arrow{border-left:1px solid #DCAC6C}.edui-toolbar .edui-state-disabled .edui-combox-body{background-color:#F0F0EE;opacity:.3;filter:alpha(opacity=30)}.edui-toolbar .edui-state-opened .edui-combox-body{background-color:#fff;border:1px solid gray}.edui-default .edui-toolbar .edui-button .edui-icon,.edui-default .edui-toolbar .edui-menubutton .edui-icon,.edui-default .edui-toolbar .edui-splitbutton .edui-icon{height:20px!important;width:20px!important;background-image:url(../images/icons.png);background-image:url(../images/icons.gif) \9}.edui-default .edui-toolbar .edui-button .edui-button-wrap{padding:1px;position:relative}.edui-default .edui-toolbar .edui-button .edui-state-hover .edui-button-wrap{background-color:#fff5d4;padding:0;border:1px solid #dcac6c}.edui-default .edui-toolbar .edui-button .edui-state-checked .edui-button-wrap{background-color:#ffe69f;padding:0;border:1px solid #dcac6c;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.edui-default .edui-toolbar .edui-button .edui-state-active .edui-button-wrap{background-color:#fff;padding:0;border:1px solid gray}.edui-default .edui-toolbar .edui-state-disabled .edui-label{color:#ccc}.edui-default .edui-toolbar .edui-state-disabled .edui-icon{opacity:.3;filter:alpha(opacity=30)}.edui-default .edui-for-undo .edui-icon{background-position:-160px 0}.edui-default .edui-for-redo .edui-icon{background-position:-100px 0}.edui-default .edui-for-bold .edui-icon{background-position:0 0}.edui-default .edui-for-italic .edui-icon{background-position:-60px 0}.edui-default .edui-for-fontborder .edui-icon{background-position:-160px -40px}.edui-default .edui-for-underline .edui-icon{background-position:-140px 0}.edui-default .edui-for-strikethrough .edui-icon{background-position:-120px 0}.edui-default .edui-for-subscript .edui-icon{background-position:-600px 0}.edui-default .edui-for-superscript .edui-icon{background-position:-620px 0}.edui-default .edui-for-blockquote .edui-icon{background-position:-220px 0}.edui-default .edui-for-forecolor .edui-icon{background-position:-720px 0}.edui-default .edui-for-backcolor .edui-icon{background-position:-760px 0}.edui-default .edui-for-inserttable .edui-icon{background-position:-580px -20px}.edui-default .edui-for-autotypeset .edui-icon{background-position:-640px -40px}.edui-default .edui-for-justifyleft .edui-icon{background-position:-460px 0}.edui-default .edui-for-justifycenter .edui-icon{background-position:-420px 0}.edui-default .edui-for-justifyright .edui-icon{background-position:-480px 0}.edui-default .edui-for-justifyjustify .edui-icon{background-position:-440px 0}.edui-default .edui-for-insertorderedlist .edui-icon{background-position:-80px 0}.edui-default .edui-for-insertunorderedlist .edui-icon{background-position:-20px 0}.edui-default .edui-for-lineheight .edui-icon{background-position:-725px -40px}.edui-default .edui-for-rowspacingbottom .edui-icon{background-position:-745px -40px}.edui-default .edui-for-rowspacingtop .edui-icon{background-position:-765px -40px}.edui-default .edui-for-horizontal .edui-icon{background-position:-360px 0}.edui-default .edui-for-link .edui-icon{background-position:-500px 0}.edui-default .edui-for-code .edui-icon{background-position:-440px -40px}.edui-default .edui-for-insertimage .edui-icon{background-position:-726px -77px}.edui-default .edui-for-insertframe .edui-icon{background-position:-240px -40px}.edui-default .edui-for-emoticon .edui-icon{background-position:-60px -20px}.edui-default .edui-for-spechars .edui-icon{background-position:-240px 0}.edui-default .edui-for-help .edui-icon{background-position:-340px 0}.edui-default .edui-for-print .edui-icon{background-position:-440px -20px}.edui-default .edui-for-preview .edui-icon{background-position:-420px -20px}.edui-default .edui-for-selectall .edui-icon{background-position:-400px -20px}.edui-default .edui-for-searchreplace .edui-icon{background-position:-520px -20px}.edui-default .edui-for-map .edui-icon{background-position:-40px -40px}.edui-default .edui-for-gmap .edui-icon{background-position:-260px -40px}.edui-default .edui-for-insertvideo .edui-icon{background-position:-320px -20px}.edui-default .edui-for-time .edui-icon{background-position:-160px -20px}.edui-default .edui-for-date .edui-icon{background-position:-140px -20px}.edui-default .edui-for-cut .edui-icon{background-position:-680px 0}.edui-default .edui-for-copy .edui-icon{background-position:-700px 0}.edui-default .edui-for-paste .edui-icon{background-position:-560px 0}.edui-default .edui-for-formatmatch .edui-icon{background-position:-40px 0}.edui-default .edui-for-pasteplain .edui-icon{background-position:-360px -20px}.edui-default .edui-for-directionalityltr .edui-icon{background-position:-20px -20px}.edui-default .edui-for-directionalityrtl .edui-icon{background-position:-40px -20px}.edui-default .edui-for-source .edui-icon{background-position:-261px -0px}.edui-default .edui-for-removeformat .edui-icon{background-position:-580px 0}.edui-default .edui-for-unlink .edui-icon{background-position:-640px 0}.edui-default .edui-for-touppercase .edui-icon{background-position:-786px 0}.edui-default .edui-for-tolowercase .edui-icon{background-position:-806px 0}.edui-default .edui-for-insertrow .edui-icon{background-position:-478px -76px}.edui-default .edui-for-insertrownext .edui-icon{background-position:-498px -76px}.edui-default .edui-for-insertcol .edui-icon{background-position:-455px -76px}.edui-default .edui-for-insertcolnext .edui-icon{background-position:-429px -76px}.edui-default .edui-for-mergeright .edui-icon{background-position:-60px -40px}.edui-default .edui-for-mergedown .edui-icon{background-position:-80px -40px}.edui-default .edui-for-splittorows .edui-icon{background-position:-100px -40px}.edui-default .edui-for-splittocols .edui-icon{background-position:-120px -40px}.edui-default .edui-for-insertparagraphbeforetable .edui-icon{background-position:-140px -40px}.edui-default .edui-for-deleterow .edui-icon{background-position:-660px -20px}.edui-default .edui-for-deletecol .edui-icon{background-position:-640px -20px}.edui-default .edui-for-splittocells .edui-icon{background-position:-800px -20px}.edui-default .edui-for-mergecells .edui-icon{background-position:-760px -20px}.edui-default .edui-for-deletetable .edui-icon{background-position:-620px -20px}.edui-default .edui-for-cleardoc .edui-icon{background-position:-520px 0}.edui-default .edui-for-fullscreen .edui-icon{background-position:-100px -20px}.edui-default .edui-for-anchor .edui-icon{background-position:-200px 0}.edui-default .edui-for-pagebreak .edui-icon{background-position:-460px -40px}.edui-default .edui-for-imagenone .edui-icon{background-position:-480px -40px}.edui-default .edui-for-imageleft .edui-icon{background-position:-500px -40px}.edui-default .edui-for-wordimage .edui-icon{background-position:-660px -40px}.edui-default .edui-for-imageright .edui-icon{background-position:-520px -40px}.edui-default .edui-for-imagecenter .edui-icon{background-position:-540px -40px}.edui-default .edui-for-indent .edui-icon{background-position:-400px 0}.edui-default .edui-for-outdent .edui-icon{background-position:-540px 0}.edui-default .edui-for-webapp .edui-icon{background-position:-601px -40px}.edui-default .edui-for-table .edui-icon{background-position:-580px -20px}.edui-default .edui-for-edittable .edui-icon{background-position:-420px -40px}.edui-default .edui-for-template .edui-icon{background-position:-339px -40px}.edui-default .edui-for-delete .edui-icon{background-position:-360px -40px}.edui-default .edui-for-attachment .edui-icon{background-position:-620px -40px}.edui-default .edui-for-edittd .edui-icon{background-position:-700px -40px}.edui-default .edui-for-snapscreen .edui-icon{background-position:-581px -40px}.edui-default .edui-for-scrawl .edui-icon{background-position:-801px -41px}.edui-default .edui-for-background .edui-icon{background-position:-680px -40px}.edui-default .edui-for-music .edui-icon{background-position:-18px -40px}.edui-default .edui-for-formula .edui-icon{background-position:-200px -40px}.edui-default .edui-for-aligntd .edui-icon{background-position:-236px -76px}.edui-default .edui-for-insertparagraphtrue .edui-icon{background-position:-625px -76px}.edui-default .edui-for-insertparagraph .edui-icon{background-position:-602px -76px}.edui-default .edui-for-insertcaption .edui-icon{background-position:-336px -76px}.edui-default .edui-for-deletecaption .edui-icon{background-position:-362px -76px}.edui-default .edui-for-inserttitle .edui-icon{background-position:-286px -76px}.edui-default .edui-for-deletetitle .edui-icon{background-position:-311px -76px}.edui-default .edui-for-aligntable .edui-icon{background-position:-440px 0}.edui-default .edui-for-tablealignment-left .edui-icon{background-position:-460px 0}.edui-default .edui-for-tablealignment-center .edui-icon{background-position:-420px 0}.edui-default .edui-for-tablealignment-right .edui-icon{background-position:-480px 0}.edui-default .edui-for-drafts .edui-icon{background-position:-560px 0}.edui-default .edui-for-charts .edui-icon{background:url( ../images/charts.png ) no-repeat 2px 3px!important}.edui-default .edui-for-inserttitlecol .edui-icon{background-position:-673px -76px}.edui-default .edui-for-deletetitlecol .edui-icon{background-position:-698px -76px}.edui-default .edui-for-simpleupload .edui-icon{background-position:-380px 0}.edui-default .edui-toolbar .edui-splitbutton-body .edui-arrow,.edui-default .edui-toolbar .edui-menubutton-body .edui-arrow{background:url(../images/icons.png) -741px 0;_background:url(../images/icons.gif) -741px 0;height:20px;width:9px}.edui-default .edui-toolbar .edui-splitbutton .edui-splitbutton-body,.edui-default .edui-toolbar .edui-menubutton .edui-menubutton-body{padding:1px}.edui-default .edui-toolbar .edui-splitborder{width:1px;height:20px}.edui-default .edui-toolbar .edui-state-hover .edui-splitborder{width:1px;border-left:0 solid #dcac6c}.edui-default .edui-toolbar .edui-state-active .edui-splitborder{width:0;border-left:1px solid gray}.edui-default .edui-toolbar .edui-state-opened .edui-splitborder{width:1px;border:0}.edui-default .edui-toolbar .edui-splitbutton .edui-state-hover .edui-splitbutton-body,.edui-default .edui-toolbar .edui-menubutton .edui-state-hover .edui-menubutton-body{background-color:#fff5d4;border:1px solid #dcac6c;padding:0}.edui-default .edui-toolbar .edui-splitbutton .edui-state-checked .edui-splitbutton-body,.edui-default .edui-toolbar .edui-menubutton .edui-state-checked .edui-menubutton-body{background-color:#FFE69F;border:1px solid #DCAC6C;padding:0}.edui-default .edui-toolbar .edui-splitbutton .edui-state-active .edui-splitbutton-body,.edui-default .edui-toolbar .edui-menubutton .edui-state-active .edui-menubutton-body{background-color:#fff;border:1px solid gray;padding:0}.edui-default .edui-state-disabled .edui-arrow{opacity:.3;_filter:alpha(opacity=30)}.edui-default .edui-toolbar .edui-splitbutton .edui-state-opened .edui-splitbutton-body,.edui-default .edui-toolbar .edui-menubutton .edui-state-opened .edui-menubutton-body{background-color:#fff;border:1px solid gray;padding:0}.edui-default .edui-for-insertorderedlist .edui-bordereraser,.edui-default .edui-for-lineheight .edui-bordereraser,.edui-default .edui-for-rowspacingtop .edui-bordereraser,.edui-default .edui-for-rowspacingbottom .edui-bordereraser,.edui-default .edui-for-insertunorderedlist .edui-bordereraser{background-color:#fff}.edui-default .edui-for-insertorderedlist .edui-popup-body .edui-icon,.edui-default .edui-for-lineheight .edui-popup-body .edui-icon,.edui-default .edui-for-rowspacingtop .edui-popup-body .edui-icon,.edui-default .edui-for-rowspacingbottom .edui-popup-body .edui-icon,.edui-default .edui-for-insertunorderedlist .edui-popup-body .edui-icon{background-image:none}.edui-default .edui-popup{z-index:3000;background-color:#fff;width:auto;height:auto}.edui-default .edui-popup .edui-shadow{left:0;top:0;width:100%;height:100%}.edui-default .edui-popup-content{border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 4px rgba(0,0,0,.2);-moz-box-shadow:0 3px 4px rgba(0,0,0,.2);box-shadow:0 3px 4px rgba(0,0,0,.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;padding:5px;background:#fff}.edui-default .edui-popup .edui-bordereraser{background-color:#fff;height:3px}.edui-default .edui-menu .edui-bordereraser{height:3px}.edui-default .edui-anchor-topleft .edui-bordereraser{left:1px;top:-2px}.edui-default .edui-anchor-topright .edui-bordereraser{right:1px;top:-2px}.edui-default .edui-anchor-bottomleft .edui-bordereraser{left:0;bottom:-6px;height:7px;border-left:1px solid gray;border-right:1px solid gray}.edui-default .edui-anchor-bottomright .edui-bordereraser{right:0;bottom:-6px;height:7px;border-left:1px solid gray;border-right:1px solid gray}.edui-popup div{width:auto;height:auto}.edui-default .edui-editor-messageholder{display:block;width:150px;height:auto;border:0;margin:0;padding:0;position:absolute;top:28px;right:3px}.edui-default .edui-message{min-height:10px;text-shadow:0 1px 0 rgba(255,255,255,.5);padding:0;margin-bottom:3px;position:relative}.edui-default .edui-message-body{border-radius:3px;padding:8px 15px 8px 8px;color:#c09853;background-color:#fcf8e3;border:1px solid #fbeed5}.edui-default .edui-message-type-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.edui-default .edui-message-type-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.edui-default .edui-message-type-danger,.edui-default .edui-message-type-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.edui-default .edui-message .edui-message-closer{display:block;width:16px;height:16px;line-height:16px;position:absolute;top:0;right:0;padding:0;cursor:pointer;background:transparent;border:0;float:right;font-size:20px;font-weight:700;color:#999;text-shadow:0 1px 0 #fff;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}.edui-default .edui-message .edui-message-content{font-size:10pt;word-wrap:break-word;word-break:normal}.edui-default .edui-dialog{z-index:2000;position:absolute}.edui-dialog div{width:auto}.edui-default .edui-dialog-wrap{margin-right:6px;margin-bottom:6px}.edui-default .edui-dialog-fullscreen-flag{margin-right:0;margin-bottom:0}.edui-default .edui-dialog-body{position:relative;padding:2px 0 0 2px;_zoom:1}.edui-default .edui-dialog-fullscreen-flag .edui-dialog-body{padding:0}.edui-default .edui-dialog-shadow{position:absolute;z-index:-1;left:0;top:0;width:100%;height:100%;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.edui-default .edui-dialog-foot{background-color:#fff}.edui-default .edui-dialog-titlebar{height:26px;border-bottom:1px solid #c6c6c6;background:url(../images/dialog-title-bg.png) repeat-x bottom;position:relative;cursor:move}.edui-default .edui-dialog-caption{font-weight:700;font-size:12px;line-height:26px;padding-left:5px}.edui-default .edui-dialog-draghandle{height:26px}.edui-default .edui-dialog-closebutton{position:absolute!important;right:5px;top:3px}.edui-default .edui-dialog-closebutton .edui-button-body{height:20px;width:20px;cursor:pointer;background:url(../images/icons-all.gif) no-repeat 0 -59px}.edui-default .edui-dialog-closebutton .edui-state-hover .edui-button-body{background:url(../images/icons-all.gif) no-repeat 0 -89px}.edui-default .edui-dialog-foot{height:40px}.edui-default .edui-dialog-buttons{position:absolute;right:0}.edui-default .edui-dialog-buttons .edui-button{margin-right:10px}.edui-default .edui-dialog-buttons .edui-button .edui-button-body{background:url(../images/icons-all.gif) no-repeat;height:24px;width:96px;font-size:12px;line-height:24px;text-align:center;cursor:default}.edui-default .edui-dialog-buttons .edui-button .edui-state-hover .edui-button-body{background:url(../images/icons-all.gif) no-repeat 0 -30px}.edui-default .edui-dialog iframe{border:0;padding:0;margin:0;vertical-align:top}.edui-default .edui-dialog-modalmask{opacity:.3;filter:alpha(opacity=30);background-color:#ccc;position:absolute}.edui-default .edui-dialog-dragmask{position:absolute;background-color:transparent;cursor:move}.edui-default .edui-dialog-content{position:relative}.edui-default .dialogcontmask{cursor:move;visibility:hidden;display:block;position:absolute;width:100%;height:100%;opacity:0;filter:alpha(opacity=0)}.edui-default .edui-for-link .edui-dialog-content{width:420px;height:200px;overflow:hidden}.edui-default .edui-for-background .edui-dialog-content{width:440px;height:280px;overflow:hidden}.edui-default .edui-for-template .edui-dialog-content{width:630px;height:390px;overflow:hidden}.edui-default .edui-for-scrawl .edui-dialog-content{width:515px;*width:506px;height:360px}.edui-default .edui-for-spechars .edui-dialog-content{width:620px;height:500px;*width:630px;*height:570px}.edui-default .edui-for-insertimage .edui-dialog-content{width:650px;height:400px;overflow:hidden}.edui-default .edui-for-webapp .edui-dialog-content{width:560px;_width:565px;height:450px;overflow:hidden}.edui-default .edui-for-insertframe .edui-dialog-content{width:350px;height:200px;overflow:hidden}.edui-default .edui-for-wordimage .edui-dialog-content{width:620px;height:380px;overflow:hidden}.edui-default .edui-for-attachment .edui-dialog-content{width:650px;height:400px;overflow:hidden}.edui-default .edui-for-map .edui-dialog-content{width:550px;height:400px}.edui-default .edui-for-gmap .edui-dialog-content{width:550px;height:400px}.edui-default .edui-for-insertvideo .edui-dialog-content{width:590px;height:390px}.edui-default .edui-for-anchor .edui-dialog-content{width:320px;height:60px;overflow:hidden}.edui-default .edui-for-searchreplace .edui-dialog-content{width:400px;height:220px}.edui-default .edui-for-help .edui-dialog-content{width:400px;height:420px}.edui-default .edui-for-edittable .edui-dialog-content{width:540px;_width:590px;height:335px}.edui-default .edui-for-edittip .edui-dialog-content{width:225px;height:60px}.edui-default .edui-for-edittd .edui-dialog-content{width:240px;height:50px}.edui-default .edui-for-snapscreen .edui-dialog-content{width:400px;height:220px}.edui-default .edui-for-music .edui-dialog-content{width:515px;height:360px}.edui-default .edui-for-paragraph .edui-listitem-label{font-family:Tahoma,Verdana,Arial,Helvetica}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-p{font-size:22px;line-height:27px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h1{font-weight:bolder;font-size:32px;line-height:36px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h2{font-weight:bolder;font-size:27px;line-height:29px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h3{font-weight:bolder;font-size:19px;line-height:23px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h4{font-weight:bolder;font-size:16px;line-height:19px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h5{font-weight:bolder;font-size:13px;line-height:16px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h6{font-weight:bolder;font-size:12px;line-height:14px}.edui-default .edui-for-inserttable .edui-splitborder{display:none}.edui-default .edui-for-inserttable .edui-splitbutton-body .edui-arrow{width:0}.edui-default .edui-toolbar .edui-for-inserttable .edui-state-active .edui-splitborder{border-left:1px solid transparent}.edui-default .edui-tablepicker .edui-infoarea{height:14px;line-height:14px;font-size:12px;width:220px;margin-bottom:3px;clear:both}.edui-default .edui-tablepicker .edui-infoarea .edui-label{float:left}.edui-default .edui-dialog-buttons .edui-label{line-height:24px}.edui-default .edui-tablepicker .edui-infoarea .edui-clickable{float:right}.edui-default .edui-tablepicker .edui-pickarea{background:url(../images/unhighlighted.gif) repeat;height:220px;width:220px}.edui-default .edui-tablepicker .edui-pickarea .edui-overlay{background:url(../images/highlighted.gif) repeat}.edui-default .edui-colorpicker-topbar{height:27px;width:200px}.edui-default .edui-colorpicker-preview{height:20px;border:1px inset #000;margin-left:1px;width:128px;float:left}.edui-default .edui-colorpicker-nocolor{float:right;margin-right:1px;font-size:12px;line-height:14px;height:14px;border:1px solid #333;padding:3px 5px;cursor:pointer}.edui-default .edui-colorpicker-tablefirstrow{height:30px}.edui-default .edui-colorpicker-colorcell{width:14px;height:14px;display:block;margin:0;cursor:pointer}.edui-default .edui-colorpicker-colorcell:hover{width:14px;height:14px;margin:0}.edui-default .edui-colorpicker-advbtn{display:block;text-align:center;cursor:pointer;height:20px}.arrow_down{background:#fff url(../images/arrow_down.png) no-repeat center}.arrow_up{background:#fff url(../images/arrow_up.png) no-repeat center}.edui-colorpicker-adv{position:relative;overflow:hidden;height:180px;display:none}.edui-colorpicker-plant,.edui-colorpicker-hue{border:solid 1px #666}.edui-colorpicker-pad{width:150px;height:150px;left:14px;top:13px;position:absolute;background:red;overflow:hidden;cursor:crosshair}.edui-colorpicker-cover{position:absolute;top:0;left:0;width:150px;height:150px;background:url(../images/tangram-colorpicker.png) -160px -200px}.edui-colorpicker-padDot{position:absolute;top:0;left:0;width:11px;height:11px;overflow:hidden;background:url(../images/tangram-colorpicker.png) 0 -200px repeat-x;z-index:1000}.edui-colorpicker-sliderMain{position:absolute;left:171px;top:13px;width:19px;height:152px;background:url(../images/tangram-colorpicker.png) -179px -12px no-repeat}.edui-colorpicker-slider{width:100%;height:100%;cursor:pointer}.edui-colorpicker-thumb{position:absolute;top:0;cursor:pointer;height:3px;left:-1px;right:-1px;border:1px solid #000;background:#fff;opacity:.8}.edui-default .edui-autotypesetpicker .edui-autotypesetpicker-body{font-size:12px;margin-bottom:3px;clear:both}.edui-default .edui-autotypesetpicker-body table{border-collapse:separate;border-spacing:2px}.edui-default .edui-autotypesetpicker-body td{font-size:12px;word-wrap:break-word}.edui-default .edui-autotypesetpicker-body td input{margin:3px 3px 3px 4px;*margin:1px 0 0}.edui-default .edui-cellalignpicker .edui-cellalignpicker-body{width:70px;font-size:12px;cursor:default}.edui-default .edui-cellalignpicker-body table{border-collapse:separate;border-spacing:0}.edui-default .edui-cellalignpicker-body td{padding:1px}.edui-default .edui-cellalignpicker-body .edui-icon{height:20px;width:20px;padding:1px;background-image:url(../images/table-cell-align.png)}.edui-default .edui-cellalignpicker-body .edui-left{background-position:0 0}.edui-default .edui-cellalignpicker-body .edui-center{background-position:-25px 0}.edui-default .edui-cellalignpicker-body .edui-right{background-position:-51px 0}.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-left{background-position:-73px 0}.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-center{background-position:-98px 0}.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-right{background-position:-124px 0}.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-left{background-position:-146px 0;background-color:#f1f4f5}.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-center{background-position:-245px 0}.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-right{background-position:-271px 0}.edui-default .edui-toolbar .edui-separator{width:2px;height:20px;margin:2px 4px 2px 3px;background:url(../images/icons.png) -181px 0;background:url(../images/icons.gif) -181px 0 \9}.edui-default .edui-toolbar .edui-colorbutton .edui-colorlump{position:absolute;overflow:hidden;bottom:1px;left:1px;width:18px;height:4px}.edui-default .edui-for-emotion .edui-icon{background-position:-60px -20px}.edui-default .edui-for-emotion .edui-popup-content iframe{width:514px;height:380px;overflow:hidden}.edui-default .edui-for-emotion .edui-popup-content{position:relative;z-index:555}.edui-default .edui-for-emotion .edui-splitborder{display:none}.edui-default .edui-for-emotion .edui-splitbutton-body .edui-arrow{width:0}.edui-default .edui-toolbar .edui-for-emotion .edui-state-active .edui-splitborder{border-left:1px solid transparent}.edui-default .edui-hassubmenu .edui-arrow{height:20px;width:20px;float:right;background:url(../images/icons-all.gif) no-repeat 10px -233px}.edui-default .edui-menu-body .edui-menuitem{padding:1px}.edui-default .edui-menuseparator{margin:2px 0;height:1px;overflow:hidden}.edui-default .edui-menuseparator-inner{border-bottom:1px solid #e2e3e3;margin-left:29px;margin-right:1px}.edui-default .edui-menu-body .edui-state-hover{padding:0!important;background-color:#fff5d4;border:1px solid #dcac6c}.edui-default .edui-shortcutmenu{padding:2px;width:190px;height:50px;background-color:#fff;border:1px solid #ccc;border-radius:5px}.edui-default .edui-wordpastepop .edui-popup-content{border:0;padding:0;width:54px;height:21px}.edui-default .edui-pasteicon{width:100%;height:100%;background-image:url(../images/wordpaste.png);background-position:0 0}.edui-default .edui-pasteicon.edui-state-opened{background-position:0 -34px}.edui-default .edui-pastecontainer{position:relative;visibility:hidden;width:97px;background:#fff;border:1px solid #ccc}.edui-default .edui-pastecontainer .edui-title{font-weight:700;background:#F8F8FF;height:25px;line-height:25px;font-size:12px;padding-left:5px}.edui-default .edui-pastecontainer .edui-button{overflow:hidden;margin:3px 0}.edui-default .edui-pastecontainer .edui-button .edui-richtxticon,.edui-default .edui-pastecontainer .edui-button .edui-tagicon,.edui-default .edui-pastecontainer .edui-button .edui-plaintxticon{float:left;cursor:pointer;width:29px;height:29px;margin-left:5px;background-image:url(../images/wordpaste.png);background-repeat:no-repeat}.edui-default .edui-pastecontainer .edui-button .edui-richtxticon{margin-left:0;background-position:-109px 0}.edui-default .edui-pastecontainer .edui-button .edui-tagicon{background-position:-148px 1px}.edui-default .edui-pastecontainer .edui-button .edui-plaintxticon{background-position:-72px 0}.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-richtxticon{background-position:-109px -34px}.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-tagicon{background-position:-148px -34px}.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-plaintxticon{background-position:-72px -34px} \ No newline at end of file diff --git a/public/static/Ueditor/themes/default/dialogbase.css b/public/static/Ueditor/themes/default/dialogbase.css new file mode 100644 index 0000000..cd663d5 --- /dev/null +++ b/public/static/Ueditor/themes/default/dialogbase.css @@ -0,0 +1,100 @@ +/*弹出对话框页面样式组件 +*/ + +/*reset +*/ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + outline: 0; + font-size: 100%; +} + +body { + line-height: 1; +} + +ol, ul { + list-style: none; +} + +blockquote, q { + quotes: none; +} + +ins { + text-decoration: none; +} + +del { + text-decoration: line-through; +} + +table { + border-collapse: collapse; + border-spacing: 0; +} + +/*module +*/ +body { + background-color: #fff; + font: 12px/1.5 sans-serif, "宋体", "Arial Narrow", HELVETICA; + color: #646464; +} + +/*tab*/ +.tabhead { + position: relative; + z-index: 10; +} + +.tabhead span { + display: inline-block; + padding: 0 5px; + height: 30px; + border: 1px solid #ccc; + background: url("images/dialog-title-bg.png") repeat-x; + text-align: center; + line-height: 30px; + cursor: pointer; + *margin-right: 5px; +} + +.tabhead span.focus { + height: 31px; + border-bottom: none; + background: #fff; +} + +.tabbody { + position: relative; + top: -1px; + margin: 0 auto; + border: 1px solid #ccc; +} + +/*button*/ +a.button { + display: block; + text-align: center; + line-height: 24px; + text-decoration: none; + height: 24px; + width: 95px; + border: 0; + color: #838383; + background: url(../../themes/default/images/icons-all.gif) no-repeat; +} + +a.button:hover { + background-position: 0 -30px; +} \ No newline at end of file diff --git a/public/static/Ueditor/themes/default/images/anchor.gif b/public/static/Ueditor/themes/default/images/anchor.gif new file mode 100644 index 0000000..5aa797b Binary files /dev/null and b/public/static/Ueditor/themes/default/images/anchor.gif differ diff --git a/public/static/Ueditor/themes/default/images/arrow.png b/public/static/Ueditor/themes/default/images/arrow.png new file mode 100644 index 0000000..d900886 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/arrow.png differ diff --git a/public/static/Ueditor/themes/default/images/arrow_down.png b/public/static/Ueditor/themes/default/images/arrow_down.png new file mode 100644 index 0000000..e9257e8 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/arrow_down.png differ diff --git a/public/static/Ueditor/themes/default/images/arrow_up.png b/public/static/Ueditor/themes/default/images/arrow_up.png new file mode 100644 index 0000000..74277af Binary files /dev/null and b/public/static/Ueditor/themes/default/images/arrow_up.png differ diff --git a/public/static/Ueditor/themes/default/images/button-bg.gif b/public/static/Ueditor/themes/default/images/button-bg.gif new file mode 100644 index 0000000..ec7fa2e Binary files /dev/null and b/public/static/Ueditor/themes/default/images/button-bg.gif differ diff --git a/public/static/Ueditor/themes/default/images/cancelbutton.gif b/public/static/Ueditor/themes/default/images/cancelbutton.gif new file mode 100644 index 0000000..df4bc2c Binary files /dev/null and b/public/static/Ueditor/themes/default/images/cancelbutton.gif differ diff --git a/public/static/Ueditor/themes/default/images/charts.png b/public/static/Ueditor/themes/default/images/charts.png new file mode 100644 index 0000000..713965c Binary files /dev/null and b/public/static/Ueditor/themes/default/images/charts.png differ diff --git a/public/static/Ueditor/themes/default/images/cursor_h.gif b/public/static/Ueditor/themes/default/images/cursor_h.gif new file mode 100644 index 0000000..d7c3e7e Binary files /dev/null and b/public/static/Ueditor/themes/default/images/cursor_h.gif differ diff --git a/public/static/Ueditor/themes/default/images/cursor_h.png b/public/static/Ueditor/themes/default/images/cursor_h.png new file mode 100644 index 0000000..2088fc2 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/cursor_h.png differ diff --git a/public/static/Ueditor/themes/default/images/cursor_v.gif b/public/static/Ueditor/themes/default/images/cursor_v.gif new file mode 100644 index 0000000..bb508db Binary files /dev/null and b/public/static/Ueditor/themes/default/images/cursor_v.gif differ diff --git a/public/static/Ueditor/themes/default/images/cursor_v.png b/public/static/Ueditor/themes/default/images/cursor_v.png new file mode 100644 index 0000000..6f39ca3 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/cursor_v.png differ diff --git a/public/static/Ueditor/themes/default/images/dialog-title-bg.png b/public/static/Ueditor/themes/default/images/dialog-title-bg.png new file mode 100644 index 0000000..f744f26 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/dialog-title-bg.png differ diff --git a/public/static/Ueditor/themes/default/images/filescan.png b/public/static/Ueditor/themes/default/images/filescan.png new file mode 100644 index 0000000..1d27158 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/filescan.png differ diff --git a/public/static/Ueditor/themes/default/images/highlighted.gif b/public/static/Ueditor/themes/default/images/highlighted.gif new file mode 100644 index 0000000..9272b49 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/highlighted.gif differ diff --git a/public/static/Ueditor/themes/default/images/icons-all.gif b/public/static/Ueditor/themes/default/images/icons-all.gif new file mode 100644 index 0000000..21915e5 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/icons-all.gif differ diff --git a/public/static/Ueditor/themes/default/images/icons.gif b/public/static/Ueditor/themes/default/images/icons.gif new file mode 100644 index 0000000..7abd30a Binary files /dev/null and b/public/static/Ueditor/themes/default/images/icons.gif differ diff --git a/public/static/Ueditor/themes/default/images/icons.png b/public/static/Ueditor/themes/default/images/icons.png new file mode 100644 index 0000000..c015e3a Binary files /dev/null and b/public/static/Ueditor/themes/default/images/icons.png differ diff --git a/public/static/Ueditor/themes/default/images/loaderror.png b/public/static/Ueditor/themes/default/images/loaderror.png new file mode 100644 index 0000000..35ff333 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/loaderror.png differ diff --git a/public/static/Ueditor/themes/default/images/loading.gif b/public/static/Ueditor/themes/default/images/loading.gif new file mode 100644 index 0000000..b713e27 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/loading.gif differ diff --git a/public/static/Ueditor/themes/default/images/lock.gif b/public/static/Ueditor/themes/default/images/lock.gif new file mode 100644 index 0000000..b4e6d78 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/lock.gif differ diff --git a/public/static/Ueditor/themes/default/images/neweditor-tab-bg.png b/public/static/Ueditor/themes/default/images/neweditor-tab-bg.png new file mode 100644 index 0000000..8f398b0 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/neweditor-tab-bg.png differ diff --git a/public/static/Ueditor/themes/default/images/pagebreak.gif b/public/static/Ueditor/themes/default/images/pagebreak.gif new file mode 100644 index 0000000..8d1cffd Binary files /dev/null and b/public/static/Ueditor/themes/default/images/pagebreak.gif differ diff --git a/public/static/Ueditor/themes/default/images/scale.png b/public/static/Ueditor/themes/default/images/scale.png new file mode 100644 index 0000000..f45adb5 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/scale.png differ diff --git a/public/static/Ueditor/themes/default/images/sortable.png b/public/static/Ueditor/themes/default/images/sortable.png new file mode 100644 index 0000000..1bca649 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/sortable.png differ diff --git a/public/static/Ueditor/themes/default/images/spacer.gif b/public/static/Ueditor/themes/default/images/spacer.gif new file mode 100644 index 0000000..5bfd67a Binary files /dev/null and b/public/static/Ueditor/themes/default/images/spacer.gif differ diff --git a/public/static/Ueditor/themes/default/images/sparator_v.png b/public/static/Ueditor/themes/default/images/sparator_v.png new file mode 100644 index 0000000..8cf5662 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/sparator_v.png differ diff --git a/public/static/Ueditor/themes/default/images/table-cell-align.png b/public/static/Ueditor/themes/default/images/table-cell-align.png new file mode 100644 index 0000000..ddf4285 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/table-cell-align.png differ diff --git a/public/static/Ueditor/themes/default/images/tangram-colorpicker.png b/public/static/Ueditor/themes/default/images/tangram-colorpicker.png new file mode 100644 index 0000000..738e500 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/tangram-colorpicker.png differ diff --git a/public/static/Ueditor/themes/default/images/toolbar_bg.png b/public/static/Ueditor/themes/default/images/toolbar_bg.png new file mode 100644 index 0000000..7ab685f Binary files /dev/null and b/public/static/Ueditor/themes/default/images/toolbar_bg.png differ diff --git a/public/static/Ueditor/themes/default/images/unhighlighted.gif b/public/static/Ueditor/themes/default/images/unhighlighted.gif new file mode 100644 index 0000000..7ad0b67 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/unhighlighted.gif differ diff --git a/public/static/Ueditor/themes/default/images/upload.png b/public/static/Ueditor/themes/default/images/upload.png new file mode 100644 index 0000000..08d4d92 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/upload.png differ diff --git a/public/static/Ueditor/themes/default/images/videologo.gif b/public/static/Ueditor/themes/default/images/videologo.gif new file mode 100644 index 0000000..555af74 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/videologo.gif differ diff --git a/public/static/Ueditor/themes/default/images/word.gif b/public/static/Ueditor/themes/default/images/word.gif new file mode 100644 index 0000000..9ef5d09 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/word.gif differ diff --git a/public/static/Ueditor/themes/default/images/wordpaste.png b/public/static/Ueditor/themes/default/images/wordpaste.png new file mode 100644 index 0000000..9367758 Binary files /dev/null and b/public/static/Ueditor/themes/default/images/wordpaste.png differ diff --git a/public/static/Ueditor/themes/iframe.css b/public/static/Ueditor/themes/iframe.css new file mode 100644 index 0000000..774013a --- /dev/null +++ b/public/static/Ueditor/themes/iframe.css @@ -0,0 +1 @@ +/*可以在这里添加你自己的css*/ diff --git a/public/static/Ueditor/third-party/SyntaxHighlighter/shCore.js b/public/static/Ueditor/third-party/SyntaxHighlighter/shCore.js new file mode 100644 index 0000000..3249184 --- /dev/null +++ b/public/static/Ueditor/third-party/SyntaxHighlighter/shCore.js @@ -0,0 +1,3655 @@ +// XRegExp 1.5.1 +// (c) 2007-2012 Steven Levithan +// MIT License +// +// Provides an augmented, extensible, cross-browser implementation of regular expressions, +// including support for additional syntax, flags, and methods + +var XRegExp; + +if (XRegExp) { + // Avoid running twice, since that would break references to native globals + throw Error("can't load XRegExp twice in the same frame"); +} + +// Run within an anonymous function to protect variables and avoid new globals +(function (undefined) { + + //--------------------------------- + // Constructor + //--------------------------------- + + // Accepts a pattern and flags; returns a new, extended `RegExp` object. Differs from a native + // regular expression in that additional syntax and flags are supported and cross-browser + // syntax inconsistencies are ameliorated. `XRegExp(/regex/)` clones an existing regex and + // converts to type XRegExp + XRegExp = function (pattern, flags) { + var output = [], + currScope = XRegExp.OUTSIDE_CLASS, + pos = 0, + context, tokenResult, match, chr, regex; + + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) + throw TypeError("can't supply flags when constructing one RegExp from another"); + return clone(pattern); + } + // Tokens become part of the regex construction process, so protect against infinite + // recursion when an XRegExp is constructed within a token handler or trigger + if (isInsideConstructor) + throw Error("can't call the XRegExp constructor within token definition functions"); + + flags = flags || ""; + context = { // `this` object for custom tokens + hasNamedCapture: false, + captureNames: [], + hasFlag: function (flag) {return flags.indexOf(flag) > -1;}, + setFlag: function (flag) {flags += flag;} + }; + + while (pos < pattern.length) { + // Check for custom tokens at the current position + tokenResult = runTokens(pattern, pos, currScope, context); + + if (tokenResult) { + output.push(tokenResult.output); + pos += (tokenResult.match[0].length || 1); + } else { + // Check for native multicharacter metasequences (excluding character classes) at + // the current position + if (match = nativ.exec.call(nativeTokens[currScope], pattern.slice(pos))) { + output.push(match[0]); + pos += match[0].length; + } else { + chr = pattern.charAt(pos); + if (chr === "[") + currScope = XRegExp.INSIDE_CLASS; + else if (chr === "]") + currScope = XRegExp.OUTSIDE_CLASS; + // Advance position one character + output.push(chr); + pos++; + } + } + } + + regex = RegExp(output.join(""), nativ.replace.call(flags, flagClip, "")); + regex._xregexp = { + source: pattern, + captureNames: context.hasNamedCapture ? context.captureNames : null + }; + return regex; + }; + + + //--------------------------------- + // Public properties + //--------------------------------- + + XRegExp.version = "1.5.1"; + + // Token scope bitflags + XRegExp.INSIDE_CLASS = 1; + XRegExp.OUTSIDE_CLASS = 2; + + + //--------------------------------- + // Private variables + //--------------------------------- + + var replacementToken = /\$(?:(\d\d?|[$&`'])|{([$\w]+)})/g, + flagClip = /[^gimy]+|([\s\S])(?=[\s\S]*\1)/g, // Nonnative and duplicate flags + quantifier = /^(?:[?*+]|{\d+(?:,\d*)?})\??/, + isInsideConstructor = false, + tokens = [], + // Copy native globals for reference ("native" is an ES3 reserved keyword) + nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split + }, + compliantExecNpcg = nativ.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups + compliantLastIndexIncrement = function () { + var x = /^/g; + nativ.test.call(x, ""); + return !x.lastIndex; + }(), + hasNativeY = RegExp.prototype.sticky !== undefined, + nativeTokens = {}; + + // `nativeTokens` match native multicharacter metasequences only (including deprecated octals, + // excluding character classes) + nativeTokens[XRegExp.INSIDE_CLASS] = /^(?:\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S]))/; + nativeTokens[XRegExp.OUTSIDE_CLASS] = /^(?:\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??)/; + + + //--------------------------------- + // Public methods + //--------------------------------- + + // Lets you extend or change XRegExp syntax and create custom flags. This is used internally by + // the XRegExp library and can be used to create XRegExp plugins. This function is intended for + // users with advanced knowledge of JavaScript's regular expression syntax and behavior. It can + // be disabled by `XRegExp.freezeTokens` + XRegExp.addToken = function (regex, handler, scope, trigger) { + tokens.push({ + pattern: clone(regex, "g" + (hasNativeY ? "y" : "")), + handler: handler, + scope: scope || XRegExp.OUTSIDE_CLASS, + trigger: trigger || null + }); + }; + + // Accepts a pattern and flags; returns an extended `RegExp` object. If the pattern and flag + // combination has previously been cached, the cached copy is returned; otherwise the newly + // created regex is cached + XRegExp.cache = function (pattern, flags) { + var key = pattern + "/" + (flags || ""); + return XRegExp.cache[key] || (XRegExp.cache[key] = XRegExp(pattern, flags)); + }; + + // Accepts a `RegExp` instance; returns a copy with the `/g` flag set. The copy has a fresh + // `lastIndex` (set to zero). If you want to copy a regex without forcing the `global` + // property, use `XRegExp(regex)`. Do not use `RegExp(regex)` because it will not preserve + // special properties required for named capture + XRegExp.copyAsGlobal = function (regex) { + return clone(regex, "g"); + }; + + // Accepts a string; returns the string with regex metacharacters escaped. The returned string + // can safely be used at any point within a regex to match the provided literal string. Escaped + // characters are [ ] { } ( ) * + ? - . , \ ^ $ | # and whitespace + XRegExp.escape = function (str) { + return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + }; + + // Accepts a string to search, regex to search with, position to start the search within the + // string (default: 0), and an optional Boolean indicating whether matches must start at-or- + // after the position or at the specified position only. This function ignores the `lastIndex` + // of the provided regex in its own handling, but updates the property for compatibility + XRegExp.execAt = function (str, regex, pos, anchored) { + var r2 = clone(regex, "g" + ((anchored && hasNativeY) ? "y" : "")), + match; + r2.lastIndex = pos = pos || 0; + match = r2.exec(str); // Run the altered `exec` (required for `lastIndex` fix, etc.) + if (anchored && match && match.index !== pos) + match = null; + if (regex.global) + regex.lastIndex = match ? r2.lastIndex : 0; + return match; + }; + + // Breaks the unrestorable link to XRegExp's private list of tokens, thereby preventing + // syntax and flag changes. Should be run after XRegExp and any plugins are loaded + XRegExp.freezeTokens = function () { + XRegExp.addToken = function () { + throw Error("can't run addToken after freezeTokens"); + }; + }; + + // Accepts any value; returns a Boolean indicating whether the argument is a `RegExp` object. + // Note that this is also `true` for regex literals and regexes created by the `XRegExp` + // constructor. This works correctly for variables created in another frame, when `instanceof` + // and `constructor` checks would fail to work as intended + XRegExp.isRegExp = function (o) { + return Object.prototype.toString.call(o) === "[object RegExp]"; + }; + + // Executes `callback` once per match within `str`. Provides a simpler and cleaner way to + // iterate over regex matches compared to the traditional approaches of subverting + // `String.prototype.replace` or repeatedly calling `exec` within a `while` loop + XRegExp.iterate = function (str, regex, callback, context) { + var r2 = clone(regex, "g"), + i = -1, match; + while (match = r2.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.) + if (regex.global) + regex.lastIndex = r2.lastIndex; // Doing this to follow expectations if `lastIndex` is checked within `callback` + callback.call(context, match, ++i, str, regex); + if (r2.lastIndex === match.index) + r2.lastIndex++; + } + if (regex.global) + regex.lastIndex = 0; + }; + + // Accepts a string and an array of regexes; returns the result of using each successive regex + // to search within the matches of the previous regex. The array of regexes can also contain + // objects with `regex` and `backref` properties, in which case the named or numbered back- + // references specified are passed forward to the next regex or returned. E.g.: + // var xregexpImgFileNames = XRegExp.matchChain(html, [ + // {regex: /]+)>/i, backref: 1}, // tag attributes + // {regex: XRegExp('(?ix) \\s src=" (? [^"]+ )'), backref: "src"}, // src attribute values + // {regex: XRegExp("^http://xregexp\\.com(/[^#?]+)", "i"), backref: 1}, // xregexp.com paths + // /[^\/]+$/ // filenames (strip directory paths) + // ]); + XRegExp.matchChain = function (str, chain) { + return function recurseChain (values, level) { + var item = chain[level].regex ? chain[level] : {regex: chain[level]}, + regex = clone(item.regex, "g"), + matches = [], i; + for (i = 0; i < values.length; i++) { + XRegExp.iterate(values[i], regex, function (match) { + matches.push(item.backref ? (match[item.backref] || "") : match[0]); + }); + } + return ((level === chain.length - 1) || !matches.length) ? + matches : recurseChain(matches, level + 1); + }([str], 0); + }; + + + //--------------------------------- + // New RegExp prototype methods + //--------------------------------- + + // Accepts a context object and arguments array; returns the result of calling `exec` with the + // first value in the arguments array. the context is ignored but is accepted for congruity + // with `Function.prototype.apply` + RegExp.prototype.apply = function (context, args) { + return this.exec(args[0]); + }; + + // Accepts a context object and string; returns the result of calling `exec` with the provided + // string. the context is ignored but is accepted for congruity with `Function.prototype.call` + RegExp.prototype.call = function (context, str) { + return this.exec(str); + }; + + + //--------------------------------- + // Overriden native methods + //--------------------------------- + + // Adds named capture support (with backreferences returned as `result.name`), and fixes two + // cross-browser issues per ES3: + // - Captured values for nonparticipating capturing groups should be returned as `undefined`, + // rather than the empty string. + // - `lastIndex` should not be incremented after zero-length matches. + RegExp.prototype.exec = function (str) { + var match, name, r2, origLastIndex; + if (!this.global) + origLastIndex = this.lastIndex; + match = nativ.exec.apply(this, arguments); + if (match) { + // Fix browsers whose `exec` methods don't consistently return `undefined` for + // nonparticipating capturing groups + if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) { + r2 = RegExp(this.source, nativ.replace.call(getNativeFlags(this), "g", "")); + // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + nativ.replace.call((str + "").slice(match.index), r2, function () { + for (var i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) + match[i] = undefined; + } + }); + } + // Attach named capture properties + if (this._xregexp && this._xregexp.captureNames) { + for (var i = 1; i < match.length; i++) { + name = this._xregexp.captureNames[i - 1]; + if (name) + match[name] = match[i]; + } + } + // Fix browsers that increment `lastIndex` after zero-length matches + if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) + this.lastIndex--; + } + if (!this.global) + this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) + return match; + }; + + // Fix browser bugs in native method + RegExp.prototype.test = function (str) { + // Use the native `exec` to skip some processing overhead, even though the altered + // `exec` would take care of the `lastIndex` fixes + var match, origLastIndex; + if (!this.global) + origLastIndex = this.lastIndex; + match = nativ.exec.call(this, str); + // Fix browsers that increment `lastIndex` after zero-length matches + if (match && !compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) + this.lastIndex--; + if (!this.global) + this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) + return !!match; + }; + + // Adds named capture support and fixes browser bugs in native method + String.prototype.match = function (regex) { + if (!XRegExp.isRegExp(regex)) + regex = RegExp(regex); // Native `RegExp` + if (regex.global) { + var result = nativ.match.apply(this, arguments); + regex.lastIndex = 0; // Fix IE bug + return result; + } + return regex.exec(this); // Run the altered `exec` + }; + + // Adds support for `${n}` tokens for named and numbered backreferences in replacement text, + // and provides named backreferences to replacement functions as `arguments[0].name`. Also + // fixes cross-browser differences in replacement text syntax when performing a replacement + // using a nonregex search value, and the value of replacement regexes' `lastIndex` property + // during replacement iterations. Note that this doesn't support SpiderMonkey's proprietary + // third (`flags`) parameter + String.prototype.replace = function (search, replacement) { + var isRegex = XRegExp.isRegExp(search), + captureNames, result, str, origLastIndex; + + // There are too many combinations of search/replacement types/values and browser bugs that + // preclude passing to native `replace`, so don't try + //if (...) + // return nativ.replace.apply(this, arguments); + + if (isRegex) { + if (search._xregexp) + captureNames = search._xregexp.captureNames; // Array or `null` + if (!search.global) + origLastIndex = search.lastIndex; + } else { + search = search + ""; // Type conversion + } + + if (Object.prototype.toString.call(replacement) === "[object Function]") { + result = nativ.replace.call(this + "", search, function () { + if (captureNames) { + // Change the `arguments[0]` string primitive to a String object which can store properties + arguments[0] = new String(arguments[0]); + // Store named backreferences on `arguments[0]` + for (var i = 0; i < captureNames.length; i++) { + if (captureNames[i]) + arguments[0][captureNames[i]] = arguments[i + 1]; + } + } + // Update `lastIndex` before calling `replacement` (fix browsers) + if (isRegex && search.global) + search.lastIndex = arguments[arguments.length - 2] + arguments[0].length; + return replacement.apply(null, arguments); + }); + } else { + str = this + ""; // Type conversion, so `args[args.length - 1]` will be a string (given nonstring `this`) + result = nativ.replace.call(str, search, function () { + var args = arguments; // Keep this function's `arguments` available through closure + return nativ.replace.call(replacement + "", replacementToken, function ($0, $1, $2) { + // Numbered backreference (without delimiters) or special variable + if ($1) { + switch ($1) { + case "$": return "$"; + case "&": return args[0]; + case "`": return args[args.length - 1].slice(0, args[args.length - 2]); + case "'": return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + // Numbered backreference + default: + // What does "$10" mean? + // - Backreference 10, if 10 or more capturing groups exist + // - Backreference 1 followed by "0", if 1-9 capturing groups exist + // - Otherwise, it's the string "$10" + // Also note: + // - Backreferences cannot be more than two digits (enforced by `replacementToken`) + // - "$01" is equivalent to "$1" if a capturing group exists, otherwise it's the string "$01" + // - There is no "$0" token ("$&" is the entire match) + var literalNumbers = ""; + $1 = +$1; // Type conversion; drop leading zero + if (!$1) // `$1` was "0" or "00" + return $0; + while ($1 > args.length - 3) { + literalNumbers = String.prototype.slice.call($1, -1) + literalNumbers; + $1 = Math.floor($1 / 10); // Drop the last digit + } + return ($1 ? args[$1] || "" : "$") + literalNumbers; + } + // Named backreference or delimited numbered backreference + } else { + // What does "${n}" mean? + // - Backreference to numbered capture n. Two differences from "$n": + // - n can be more than two digits + // - Backreference 0 is allowed, and is the entire match + // - Backreference to named capture n, if it exists and is not a number overridden by numbered capture + // - Otherwise, it's the string "${n}" + var n = +$2; // Type conversion; drop leading zeros + if (n <= args.length - 3) + return args[n]; + n = captureNames ? indexOf(captureNames, $2) : -1; + return n > -1 ? args[n + 1] : $0; + } + }); + }); + } + + if (isRegex) { + if (search.global) + search.lastIndex = 0; // Fix IE, Safari bug (last tested IE 9.0.5, Safari 5.1.2 on Windows) + else + search.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) + } + + return result; + }; + + // A consistent cross-browser, ES3 compliant `split` + String.prototype.split = function (s /* separator */, limit) { + // If separator `s` is not a regex, use the native `split` + if (!XRegExp.isRegExp(s)) + return nativ.split.apply(this, arguments); + + var str = this + "", // Type conversion + output = [], + lastLastIndex = 0, + match, lastLength; + + // Behavior for `limit`: if it's... + // - `undefined`: No limit + // - `NaN` or zero: Return an empty array + // - A positive number: Use `Math.floor(limit)` + // - A negative number: No limit + // - Other: Type-convert, then use the above rules + if (limit === undefined || +limit < 0) { + limit = Infinity; + } else { + limit = Math.floor(+limit); + if (!limit) + return []; + } + + // This is required if not `s.global`, and it avoids needing to set `s.lastIndex` to zero + // and restore it to its original value when we're done using the regex + s = XRegExp.copyAsGlobal(s); + + while (match = s.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.) + if (s.lastIndex > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + + if (match.length > 1 && match.index < str.length) + Array.prototype.push.apply(output, match.slice(1)); + + lastLength = match[0].length; + lastLastIndex = s.lastIndex; + + if (output.length >= limit) + break; + } + + if (s.lastIndex === match.index) + s.lastIndex++; + } + + if (lastLastIndex === str.length) { + if (!nativ.test.call(s, "") || lastLength) + output.push(""); + } else { + output.push(str.slice(lastLastIndex)); + } + + return output.length > limit ? output.slice(0, limit) : output; + }; + + + //--------------------------------- + // Private helper functions + //--------------------------------- + + // Supporting function for `XRegExp`, `XRegExp.copyAsGlobal`, etc. Returns a copy of a `RegExp` + // instance with a fresh `lastIndex` (set to zero), preserving properties required for named + // capture. Also allows adding new flags in the process of copying the regex + function clone (regex, additionalFlags) { + if (!XRegExp.isRegExp(regex)) + throw TypeError("type RegExp expected"); + var x = regex._xregexp; + regex = XRegExp(regex.source, getNativeFlags(regex) + (additionalFlags || "")); + if (x) { + regex._xregexp = { + source: x.source, + captureNames: x.captureNames ? x.captureNames.slice(0) : null + }; + } + return regex; + } + + function getNativeFlags (regex) { + return (regex.global ? "g" : "") + + (regex.ignoreCase ? "i" : "") + + (regex.multiline ? "m" : "") + + (regex.extended ? "x" : "") + // Proposed for ES4; included in AS3 + (regex.sticky ? "y" : ""); + } + + function runTokens (pattern, index, scope, context) { + var i = tokens.length, + result, match, t; + // Protect against constructing XRegExps within token handler and trigger functions + isInsideConstructor = true; + // Must reset `isInsideConstructor`, even if a `trigger` or `handler` throws + try { + while (i--) { // Run in reverse order + t = tokens[i]; + if ((scope & t.scope) && (!t.trigger || t.trigger.call(context))) { + t.pattern.lastIndex = index; + match = t.pattern.exec(pattern); // Running the altered `exec` here allows use of named backreferences, etc. + if (match && match.index === index) { + result = { + output: t.handler.call(context, match, scope), + match: match + }; + break; + } + } + } + } catch (err) { + throw err; + } finally { + isInsideConstructor = false; + } + return result; + } + + function indexOf (array, item, from) { + if (Array.prototype.indexOf) // Use the native array method if available + return array.indexOf(item, from); + for (var i = from || 0; i < array.length; i++) { + if (array[i] === item) + return i; + } + return -1; + } + + + //--------------------------------- + // Built-in tokens + //--------------------------------- + + // Augment XRegExp's regular expression syntax and flags. Note that when adding tokens, the + // third (`scope`) argument defaults to `XRegExp.OUTSIDE_CLASS` + + // Comment pattern: (?# ) + XRegExp.addToken( + /\(\?#[^)]*\)/, + function (match) { + // Keep tokens separated unless the following token is a quantifier + return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)"; + } + ); + + // Capturing group (match the opening parenthesis only). + // Required for support of named capturing groups + XRegExp.addToken( + /\((?!\?)/, + function () { + this.captureNames.push(null); + return "("; + } + ); + + // Named capturing group (match the opening delimiter only): (? + XRegExp.addToken( + /\(\?<([$\w]+)>/, + function (match) { + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return "("; + } + ); + + // Named backreference: \k + XRegExp.addToken( + /\\k<([\w$]+)>/, + function (match) { + var index = indexOf(this.captureNames, match[1]); + // Keep backreferences separate from subsequent literal numbers. Preserve back- + // references to named groups that are undefined at this point as literal strings + return index > -1 ? + "\\" + (index + 1) + (isNaN(match.input.charAt(match.index + match[0].length)) ? "" : "(?:)") : + match[0]; + } + ); + + // Empty character class: [] or [^] + XRegExp.addToken( + /\[\^?]/, + function (match) { + // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. + // (?!) should work like \b\B, but is unreliable in Firefox + return match[0] === "[]" ? "\\b\\B" : "[\\s\\S]"; + } + ); + + // Mode modifier at the start of the pattern only, with any combination of flags imsx: (?imsx) + // Does not support x(?i), (?-i), (?i-m), (?i: ), (?i)(?m), etc. + XRegExp.addToken( + /^\(\?([imsx]+)\)/, + function (match) { + this.setFlag(match[1]); + return ""; + } + ); + + // Whitespace and comments, in free-spacing (aka extended) mode only + XRegExp.addToken( + /(?:\s+|#.*)+/, + function (match) { + // Keep tokens separated unless the following token is a quantifier + return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)"; + }, + XRegExp.OUTSIDE_CLASS, + function () {return this.hasFlag("x");} + ); + + // Dot, in dotall (aka singleline) mode only + XRegExp.addToken( + /\./, + function () {return "[\\s\\S]";}, + XRegExp.OUTSIDE_CLASS, + function () {return this.hasFlag("s");} + ); + + + //--------------------------------- + // Backward compatibility + //--------------------------------- + + // Uncomment the following block for compatibility with XRegExp 1.0-1.2: + /* + XRegExp.matchWithinChain = XRegExp.matchChain; + RegExp.prototype.addFlags = function (s) {return clone(this, s);}; + RegExp.prototype.execAll = function (s) {var r = []; XRegExp.iterate(s, this, function (m) {r.push(m);}); return r;}; + RegExp.prototype.forEachExec = function (s, f, c) {return XRegExp.iterate(s, this, f, c);}; + RegExp.prototype.validate = function (s) {var r = RegExp("^(?:" + this.source + ")$(?!\\s)", getNativeFlags(this)); if (this.global) this.lastIndex = 0; return s.search(r) === 0;}; + */ + +})(); + +// +// Begin anonymous function. This is used to contain local scope variables without polutting global scope. +// +if (typeof(SyntaxHighlighter) == 'undefined') var SyntaxHighlighter = function() { + +// CommonJS + if (typeof(require) != 'undefined' && typeof(XRegExp) == 'undefined') + { + XRegExp = require('XRegExp').XRegExp; + } + +// Shortcut object which will be assigned to the SyntaxHighlighter variable. +// This is a shorthand for local reference in order to avoid long namespace +// references to SyntaxHighlighter.whatever... + var sh = { + defaults : { + /** Additional CSS class names to be added to highlighter elements. */ + 'class-name' : '', + + /** First line number. */ + 'first-line' : 1, + + /** + * Pads line numbers. Possible values are: + * + * false - don't pad line numbers. + * true - automaticaly pad numbers with minimum required number of leading zeroes. + * [int] - length up to which pad line numbers. + */ + 'pad-line-numbers' : false, + + /** Lines to highlight. */ + 'highlight' : false, + + /** Title to be displayed above the code block. */ + 'title' : null, + + /** Enables or disables smart tabs. */ + 'smart-tabs' : true, + + /** Gets or sets tab size. */ + 'tab-size' : 4, + + /** Enables or disables gutter. */ + 'gutter' : true, + + /** Enables or disables toolbar. */ + 'toolbar' : true, + + /** Enables quick code copy and paste from double click. */ + 'quick-code' : true, + + /** Forces code view to be collapsed. */ + 'collapse' : false, + + /** Enables or disables automatic links. */ + 'auto-links' : false, + + /** Gets or sets light mode. Equavalent to turning off gutter and toolbar. */ + 'light' : false, + + 'unindent' : true, + + 'html-script' : false + }, + + config : { + space : ' ', + + /** Enables use of + * + * ``` + */ + findParent:function (node, filterFn, includeSelf) { + if (node && !domUtils.isBody(node)) { + node = includeSelf ? node : node.parentNode; + while (node) { + if (!filterFn || filterFn(node) || domUtils.isBody(node)) { + return filterFn && !filterFn(node) && domUtils.isBody(node) ? null : node; + } + node = node.parentNode; + } + } + return null; + }, + /** + * 查找node的节点名为tagName的第一个祖先节点, 查找的起点是node节点的父节点。 + * @method findParentByTagName + * @param { Node } node 需要查找的节点对象 + * @param { Array } tagNames 需要查找的父节点的名称数组 + * @warning 查找的终点是到body节点为止 + * @return { Node | NULL } 如果找到符合条件的节点, 则返回该节点, 否则返回NULL + * @example + * ```javascript + * var node = UE.dom.domUtils.findParentByTagName( document.getElementsByTagName("div")[0], [ "BODY" ] ); + * //output: BODY + * console.log( node.tagName ); + * ``` + */ + + /** + * 查找node的节点名为tagName的祖先节点, 如果includeSelf的值为true,则查找的起点是给定的节点node, + * 否则, 起点是node的父节点。 + * @method findParentByTagName + * @param { Node } node 需要查找的节点对象 + * @param { Array } tagNames 需要查找的父节点的名称数组 + * @param { Boolean } includeSelf 查找过程是否包含node节点自身 + * @warning 查找的终点是到body节点为止 + * @return { Node | NULL } 如果找到符合条件的节点, 则返回该节点, 否则返回NULL + * @example + * ```javascript + * var queryTarget = document.getElementsByTagName("div")[0]; + * var node = UE.dom.domUtils.findParentByTagName( queryTarget, [ "DIV" ], true ); + * //output: true + * console.log( queryTarget === node ); + * ``` + */ + findParentByTagName:function (node, tagNames, includeSelf, excludeFn) { + tagNames = utils.listToMap(utils.isArray(tagNames) ? tagNames : [tagNames]); + return domUtils.findParent(node, function (node) { + return tagNames[node.tagName] && !(excludeFn && excludeFn(node)); + }, includeSelf); + }, + /** + * 查找节点node的祖先节点集合, 查找的起点是给定节点的父节点,结果集中不包含给定的节点。 + * @method findParents + * @param { Node } node 需要查找的节点对象 + * @return { Array } 给定节点的祖先节点数组 + * @grammar UE.dom.domUtils.findParents(node) => Array //返回一个祖先节点数组集合,不包含自身 + * @grammar UE.dom.domUtils.findParents(node,includeSelf) => Array //返回一个祖先节点数组集合,includeSelf指定是否包含自身 + * @grammar UE.dom.domUtils.findParents(node,includeSelf,filterFn) => Array //返回一个祖先节点数组集合,filterFn指定过滤条件,返回true的node将被选取 + * @grammar UE.dom.domUtils.findParents(node,includeSelf,filterFn,closerFirst) => Array //返回一个祖先节点数组集合,closerFirst为true的话,node的直接父亲节点是数组的第0个 + */ + + /** + * 查找节点node的祖先节点集合, 如果includeSelf的值为true, + * 则返回的结果集中允许出现当前给定的节点, 否则, 该节点不会出现在其结果集中。 + * @method findParents + * @param { Node } node 需要查找的节点对象 + * @param { Boolean } includeSelf 查找的结果中是否允许包含当前查找的节点对象 + * @return { Array } 给定节点的祖先节点数组 + */ + findParents:function (node, includeSelf, filterFn, closerFirst) { + var parents = includeSelf && ( filterFn && filterFn(node) || !filterFn ) ? [node] : []; + while (node = domUtils.findParent(node, filterFn)) { + parents.push(node); + } + return closerFirst ? parents : parents.reverse(); + }, + + /** + * 在节点node后面插入新节点newNode + * @method insertAfter + * @param { Node } node 目标节点 + * @param { Node } newNode 新插入的节点, 该节点将置于目标节点之后 + * @return { Node } 新插入的节点 + */ + insertAfter:function (node, newNode) { + return node.nextSibling ? node.parentNode.insertBefore(newNode, node.nextSibling): + node.parentNode.appendChild(newNode); + }, + + /** + * 删除节点node及其下属的所有节点 + * @method remove + * @param { Node } node 需要删除的节点对象 + * @return { Node } 返回刚删除的节点对象 + * @example + * ```html + *
    + *
    你好
    + *
    + * + * ``` + */ + + /** + * 删除节点node,并根据keepChildren的值决定是否保留子节点 + * @method remove + * @param { Node } node 需要删除的节点对象 + * @param { Boolean } keepChildren 是否需要保留子节点 + * @return { Node } 返回刚删除的节点对象 + * @example + * ```html + *
    + *
    你好
    + *
    + * + * ``` + */ + remove:function (node, keepChildren) { + var parent = node.parentNode, + child; + if (parent) { + if (keepChildren && node.hasChildNodes()) { + while (child = node.firstChild) { + parent.insertBefore(child, node); + } + } + parent.removeChild(node); + } + return node; + }, + + /** + * 取得node节点的下一个兄弟节点, 如果该节点其后没有兄弟节点, 则递归查找其父节点之后的第一个兄弟节点, + * 直到找到满足条件的节点或者递归到BODY节点之后才会结束。 + * @method getNextDomNode + * @param { Node } node 需要获取其后的兄弟节点的节点对象 + * @return { Node | NULL } 如果找满足条件的节点, 则返回该节点, 否则返回NULL + * @example + * ```html + * + *
    + * + *
    + * xxx + * + * + * ``` + * @example + * ```html + * + *
    + * + * xxx + *
    + * xxx + * + * + * ``` + */ + + /** + * 取得node节点的下一个兄弟节点, 如果startFromChild的值为ture,则先获取其子节点, + * 如果有子节点则直接返回第一个子节点;如果没有子节点或者startFromChild的值为false, + * 则执行getNextDomNode(Node node)的查找过程。 + * @method getNextDomNode + * @param { Node } node 需要获取其后的兄弟节点的节点对象 + * @param { Boolean } startFromChild 查找过程是否从其子节点开始 + * @return { Node | NULL } 如果找满足条件的节点, 则返回该节点, 否则返回NULL + * @see UE.dom.domUtils.getNextDomNode(Node) + */ + getNextDomNode:function (node, startFromChild, filterFn, guard) { + return getDomNode(node, 'firstChild', 'nextSibling', startFromChild, filterFn, guard); + }, + getPreDomNode:function (node, startFromChild, filterFn, guard) { + return getDomNode(node, 'lastChild', 'previousSibling', startFromChild, filterFn, guard); + }, + /** + * 检测节点node是否属是UEditor定义的bookmark节点 + * @method isBookmarkNode + * @private + * @param { Node } node 需要检测的节点对象 + * @return { Boolean } 是否是bookmark节点 + * @example + * ```html + * + * + * ``` + */ + isBookmarkNode:function (node) { + return node.nodeType == 1 && node.id && /^_baidu_bookmark_/i.test(node.id); + }, + /** + * 获取节点node所属的window对象 + * @method getWindow + * @param { Node } node 节点对象 + * @return { Window } 当前节点所属的window对象 + * @example + * ```javascript + * //output: true + * console.log( UE.dom.domUtils.getWindow( document.body ) === window ); + * ``` + */ + getWindow:function (node) { + var doc = node.ownerDocument || node; + return doc.defaultView || doc.parentWindow; + }, + /** + * 获取离nodeA与nodeB最近的公共的祖先节点 + * @method getCommonAncestor + * @param { Node } nodeA 第一个节点 + * @param { Node } nodeB 第二个节点 + * @remind 如果给定的两个节点是同一个节点, 将直接返回该节点。 + * @return { Node | NULL } 如果未找到公共节点, 返回NULL, 否则返回最近的公共祖先节点。 + * @example + * ```javascript + * var commonAncestor = UE.dom.domUtils.getCommonAncestor( document.body, document.body.firstChild ); + * //output: true + * console.log( commonAncestor.tagName.toLowerCase() === 'body' ); + * ``` + */ + getCommonAncestor:function (nodeA, nodeB) { + if (nodeA === nodeB) + return nodeA; + var parentsA = [nodeA] , parentsB = [nodeB], parent = nodeA, i = -1; + while (parent = parent.parentNode) { + if (parent === nodeB) { + return parent; + } + parentsA.push(parent); + } + parent = nodeB; + while (parent = parent.parentNode) { + if (parent === nodeA) + return parent; + parentsB.push(parent); + } + parentsA.reverse(); + parentsB.reverse(); + while (i++, parentsA[i] === parentsB[i]) { + } + return i == 0 ? null : parentsA[i - 1]; + + }, + /** + * 清除node节点左右连续为空的兄弟inline节点 + * @method clearEmptySibling + * @param { Node } node 执行的节点对象, 如果该节点的左右连续的兄弟节点是空的inline节点, + * 则这些兄弟节点将被删除 + * @grammar UE.dom.domUtils.clearEmptySibling(node,ignoreNext) //ignoreNext指定是否忽略右边空节点 + * @grammar UE.dom.domUtils.clearEmptySibling(node,ignoreNext,ignorePre) //ignorePre指定是否忽略左边空节点 + * @example + * ```html + * + *
    + * + * + * + * xxx + * + * + * + * ``` + */ + + /** + * 清除node节点左右连续为空的兄弟inline节点, 如果ignoreNext的值为true, + * 则忽略对右边兄弟节点的操作。 + * @method clearEmptySibling + * @param { Node } node 执行的节点对象, 如果该节点的左右连续的兄弟节点是空的inline节点, + * @param { Boolean } ignoreNext 是否忽略忽略对右边的兄弟节点的操作 + * 则这些兄弟节点将被删除 + * @see UE.dom.domUtils.clearEmptySibling(Node) + */ + + /** + * 清除node节点左右连续为空的兄弟inline节点, 如果ignoreNext的值为true, + * 则忽略对右边兄弟节点的操作, 如果ignorePre的值为true,则忽略对左边兄弟节点的操作。 + * @method clearEmptySibling + * @param { Node } node 执行的节点对象, 如果该节点的左右连续的兄弟节点是空的inline节点, + * @param { Boolean } ignoreNext 是否忽略忽略对右边的兄弟节点的操作 + * @param { Boolean } ignorePre 是否忽略忽略对左边的兄弟节点的操作 + * 则这些兄弟节点将被删除 + * @see UE.dom.domUtils.clearEmptySibling(Node) + */ + clearEmptySibling:function (node, ignoreNext, ignorePre) { + function clear(next, dir) { + var tmpNode; + while (next && !domUtils.isBookmarkNode(next) && (domUtils.isEmptyInlineElement(next) + //这里不能把空格算进来会吧空格干掉,出现文字间的空格丢掉了 + || !new RegExp('[^\t\n\r' + domUtils.fillChar + ']').test(next.nodeValue) )) { + tmpNode = next[dir]; + domUtils.remove(next); + next = tmpNode; + } + } + !ignoreNext && clear(node.nextSibling, 'nextSibling'); + !ignorePre && clear(node.previousSibling, 'previousSibling'); + }, + /** + * 将一个文本节点textNode拆分成两个文本节点,offset指定拆分位置 + * @method split + * @param { Node } textNode 需要拆分的文本节点对象 + * @param { int } offset 需要拆分的位置, 位置计算从0开始 + * @return { Node } 拆分后形成的新节点 + * @example + * ```html + *
    abcdef
    + * + * ``` + */ + split:function (node, offset) { + var doc = node.ownerDocument; + if (browser.ie && offset == node.nodeValue.length) { + var next = doc.createTextNode(''); + return domUtils.insertAfter(node, next); + } + var retval = node.splitText(offset); + //ie8下splitText不会跟新childNodes,我们手动触发他的更新 + if (browser.ie8) { + var tmpNode = doc.createTextNode(''); + domUtils.insertAfter(retval, tmpNode); + domUtils.remove(tmpNode); + } + return retval; + }, + + /** + * 检测文本节点textNode是否为空节点(包括空格、换行、占位符等字符) + * @method isWhitespace + * @param { Node } node 需要检测的节点对象 + * @return { Boolean } 检测的节点是否为空 + * @example + * ```html + *
    + * + *
    + * + * ``` + */ + isWhitespace:function (node) { + return !new RegExp('[^ \t\n\r' + domUtils.fillChar + ']').test(node.nodeValue); + }, + /** + * 获取元素element相对于viewport的位置坐标 + * @method getXY + * @param { Node } element 需要计算位置的节点对象 + * @return { Object } 返回形如{x:left,y:top}的一个key-value映射对象, 其中键x代表水平偏移距离, + * y代表垂直偏移距离。 + * + * @example + * ```javascript + * var location = UE.dom.domUtils.getXY( document.getElementById("test") ); + * //output: test的坐标为: 12, 24 + * console.log( 'test的坐标为: ', location.x, ',', location.y ); + * ``` + */ + getXY:function (element) { + var x = 0, y = 0; + while (element.offsetParent) { + y += element.offsetTop; + x += element.offsetLeft; + element = element.offsetParent; + } + return { 'x':x, 'y':y}; + }, + /** + * 为元素element绑定原生DOM事件,type为事件类型,handler为处理函数 + * @method on + * @param { Node } element 需要绑定事件的节点对象 + * @param { String } type 绑定的事件类型 + * @param { Function } handler 事件处理器 + * @example + * ```javascript + * UE.dom.domUtils.on(document.body,"click",function(e){ + * //e为事件对象,this为被点击元素对戏那个 + * }); + * ``` + */ + + /** + * 为元素element绑定原生DOM事件,type为事件类型,handler为处理函数 + * @method on + * @param { Node } element 需要绑定事件的节点对象 + * @param { Array } type 绑定的事件类型数组 + * @param { Function } handler 事件处理器 + * @example + * ```javascript + * UE.dom.domUtils.on(document.body,["click","mousedown"],function(evt){ + * //evt为事件对象,this为被点击元素对象 + * }); + * ``` + */ + on:function (element, type, handler) { + + var types = utils.isArray(type) ? type : utils.trim(type).split(/\s+/), + k = types.length; + if (k) while (k--) { + type = types[k]; + if (element.addEventListener) { + element.addEventListener(type, handler, false); + } else { + if (!handler._d) { + handler._d = { + els : [] + }; + } + var key = type + handler.toString(),index = utils.indexOf(handler._d.els,element); + if (!handler._d[key] || index == -1) { + if(index == -1){ + handler._d.els.push(element); + } + if(!handler._d[key]){ + handler._d[key] = function (evt) { + return handler.call(evt.srcElement, evt || window.event); + }; + } + + + element.attachEvent('on' + type, handler._d[key]); + } + } + } + element = null; + }, + /** + * 解除DOM事件绑定 + * @method un + * @param { Node } element 需要解除事件绑定的节点对象 + * @param { String } type 需要接触绑定的事件类型 + * @param { Function } handler 对应的事件处理器 + * @example + * ```javascript + * UE.dom.domUtils.un(document.body,"click",function(evt){ + * //evt为事件对象,this为被点击元素对象 + * }); + * ``` + */ + + /** + * 解除DOM事件绑定 + * @method un + * @param { Node } element 需要解除事件绑定的节点对象 + * @param { Array } type 需要接触绑定的事件类型数组 + * @param { Function } handler 对应的事件处理器 + * @example + * ```javascript + * UE.dom.domUtils.un(document.body, ["click","mousedown"],function(evt){ + * //evt为事件对象,this为被点击元素对象 + * }); + * ``` + */ + un:function (element, type, handler) { + var types = utils.isArray(type) ? type : utils.trim(type).split(/\s+/), + k = types.length; + if (k) while (k--) { + type = types[k]; + if (element.removeEventListener) { + element.removeEventListener(type, handler, false); + } else { + var key = type + handler.toString(); + try{ + element.detachEvent('on' + type, handler._d ? handler._d[key] : handler); + }catch(e){} + if (handler._d && handler._d[key]) { + var index = utils.indexOf(handler._d.els,element); + if(index!=-1){ + handler._d.els.splice(index,1); + } + handler._d.els.length == 0 && delete handler._d[key]; + } + } + } + }, + + /** + * 比较节点nodeA与节点nodeB是否具有相同的标签名、属性名以及属性值 + * @method isSameElement + * @param { Node } nodeA 需要比较的节点 + * @param { Node } nodeB 需要比较的节点 + * @return { Boolean } 两个节点是否具有相同的标签名、属性名以及属性值 + * @example + * ```html + * ssss + * bbbbb + * ssss + * bbbbb + * + * + * ``` + */ + isSameElement:function (nodeA, nodeB) { + if (nodeA.tagName != nodeB.tagName) { + return false; + } + var thisAttrs = nodeA.attributes, + otherAttrs = nodeB.attributes; + if (!ie && thisAttrs.length != otherAttrs.length) { + return false; + } + var attrA, attrB, al = 0, bl = 0; + for (var i = 0; attrA = thisAttrs[i++];) { + if (attrA.nodeName == 'style') { + if (attrA.specified) { + al++; + } + if (domUtils.isSameStyle(nodeA, nodeB)) { + continue; + } else { + return false; + } + } + if (ie) { + if (attrA.specified) { + al++; + attrB = otherAttrs.getNamedItem(attrA.nodeName); + } else { + continue; + } + } else { + attrB = nodeB.attributes[attrA.nodeName]; + } + if (!attrB.specified || attrA.nodeValue != attrB.nodeValue) { + return false; + } + } + // 有可能attrB的属性包含了attrA的属性之外还有自己的属性 + if (ie) { + for (i = 0; attrB = otherAttrs[i++];) { + if (attrB.specified) { + bl++; + } + } + if (al != bl) { + return false; + } + } + return true; + }, + + /** + * 判断节点nodeA与节点nodeB的元素的style属性是否一致 + * @method isSameStyle + * @param { Node } nodeA 需要比较的节点 + * @param { Node } nodeB 需要比较的节点 + * @return { Boolean } 两个节点是否具有相同的style属性值 + * @example + * ```html + * ssss + * bbbbb + * ssss + * bbbbb + * + * + * ``` + */ + isSameStyle:function (nodeA, nodeB) { + var styleA = nodeA.style.cssText.replace(/( ?; ?)/g, ';').replace(/( ?: ?)/g, ':'), + styleB = nodeB.style.cssText.replace(/( ?; ?)/g, ';').replace(/( ?: ?)/g, ':'); + if (browser.opera) { + styleA = nodeA.style; + styleB = nodeB.style; + if (styleA.length != styleB.length) + return false; + for (var p in styleA) { + if (/^(\d+|csstext)$/i.test(p)) { + continue; + } + if (styleA[p] != styleB[p]) { + return false; + } + } + return true; + } + if (!styleA || !styleB) { + return styleA == styleB; + } + styleA = styleA.split(';'); + styleB = styleB.split(';'); + if (styleA.length != styleB.length) { + return false; + } + for (var i = 0, ci; ci = styleA[i++];) { + if (utils.indexOf(styleB, ci) == -1) { + return false; + } + } + return true; + }, + /** + * 检查节点node是否为block元素 + * @method isBlockElm + * @param { Node } node 需要检测的节点对象 + * @return { Boolean } 是否是block元素节点 + * @warning 该方法的判断规则如下: 如果该元素原本是block元素, 则不论该元素当前的css样式是什么都会返回true; + * 否则,检测该元素的css样式, 如果该元素当前是block元素, 则返回true。 其余情况下都返回false。 + * @example + * ```html + * + * + *
    + * + * + * ``` + */ + isBlockElm:function (node) { + return node.nodeType == 1 && (dtd.$block[node.tagName] || styleBlock[domUtils.getComputedStyle(node, 'display')]) && !dtd.$nonChild[node.tagName]; + }, + /** + * 检测node节点是否为body节点 + * @method isBody + * @param { Element } node 需要检测的dom元素 + * @return { Boolean } 给定的元素是否是body元素 + * @example + * ```javascript + * //output: true + * console.log( UE.dom.domUtils.isBody( document.body ) ); + * ``` + */ + isBody:function (node) { + return node && node.nodeType == 1 && node.tagName.toLowerCase() == 'body'; + }, + /** + * 以node节点为分界,将该节点的指定祖先节点parent拆分成两个独立的节点, + * 拆分形成的两个节点之间是node节点 + * @method breakParent + * @param { Node } node 作为分界的节点对象 + * @param { Node } parent 该节点必须是node节点的祖先节点, 且是block节点。 + * @return { Node } 给定的node分界节点 + * @example + * ```javascript + * + * var node = document.createElement("span"), + * wrapNode = document.createElement( "div" ), + * parent = document.createElement("p"); + * + * parent.appendChild( node ); + * wrapNode.appendChild( parent ); + * + * //拆分前 + * //output:

    + * console.log( wrapNode.innerHTML ); + * + * + * UE.dom.domUtils.breakParent( node, parent ); + * //拆分后 + * //output:

    + * console.log( wrapNode.innerHTML ); + * + * ``` + */ + breakParent:function (node, parent) { + var tmpNode, + parentClone = node, + clone = node, + leftNodes, + rightNodes; + do { + parentClone = parentClone.parentNode; + if (leftNodes) { + tmpNode = parentClone.cloneNode(false); + tmpNode.appendChild(leftNodes); + leftNodes = tmpNode; + tmpNode = parentClone.cloneNode(false); + tmpNode.appendChild(rightNodes); + rightNodes = tmpNode; + } else { + leftNodes = parentClone.cloneNode(false); + rightNodes = leftNodes.cloneNode(false); + } + while (tmpNode = clone.previousSibling) { + leftNodes.insertBefore(tmpNode, leftNodes.firstChild); + } + while (tmpNode = clone.nextSibling) { + rightNodes.appendChild(tmpNode); + } + clone = parentClone; + } while (parent !== parentClone); + tmpNode = parent.parentNode; + tmpNode.insertBefore(leftNodes, parent); + tmpNode.insertBefore(rightNodes, parent); + tmpNode.insertBefore(node, rightNodes); + domUtils.remove(parent); + return node; + }, + /** + * 检查节点node是否是空inline节点 + * @method isEmptyInlineElement + * @param { Node } node 需要检测的节点对象 + * @return { Number } 如果给定的节点是空的inline节点, 则返回1, 否则返回0。 + * @example + * ```html + * => 1 + * => 1 + * => 1 + * xx => 0 + * ``` + */ + isEmptyInlineElement:function (node) { + if (node.nodeType != 1 || !dtd.$removeEmpty[ node.tagName ]) { + return 0; + } + node = node.firstChild; + while (node) { + //如果是创建的bookmark就跳过 + if (domUtils.isBookmarkNode(node)) { + return 0; + } + if (node.nodeType == 1 && !domUtils.isEmptyInlineElement(node) || + node.nodeType == 3 && !domUtils.isWhitespace(node) + ) { + return 0; + } + node = node.nextSibling; + } + return 1; + + }, + + /** + * 删除node节点下首尾两端的空白文本子节点 + * @method trimWhiteTextNode + * @param { Element } node 需要执行删除操作的元素对象 + * @example + * ```javascript + * var node = document.createElement("div"); + * + * node.appendChild( document.createTextNode( "" ) ); + * + * node.appendChild( document.createElement("div") ); + * + * node.appendChild( document.createTextNode( "" ) ); + * + * //3 + * console.log( node.childNodes.length ); + * + * UE.dom.domUtils.trimWhiteTextNode( node ); + * + * //1 + * console.log( node.childNodes.length ); + * ``` + */ + trimWhiteTextNode:function (node) { + function remove(dir) { + var child; + while ((child = node[dir]) && child.nodeType == 3 && domUtils.isWhitespace(child)) { + node.removeChild(child); + } + } + remove('firstChild'); + remove('lastChild'); + }, + + /** + * 合并node节点下相同的子节点 + * @name mergeChild + * @desc + * UE.dom.domUtils.mergeChild(node,tagName) //tagName要合并的子节点的标签 + * @example + *

    xxaaxx

    + * ==> UE.dom.domUtils.mergeChild(node,'span') + *

    xxaaxx

    + */ + mergeChild:function (node, tagName, attrs) { + var list = domUtils.getElementsByTagName(node, node.tagName.toLowerCase()); + for (var i = 0, ci; ci = list[i++];) { + if (!ci.parentNode || domUtils.isBookmarkNode(ci)) { + continue; + } + //span单独处理 + if (ci.tagName.toLowerCase() == 'span') { + if (node === ci.parentNode) { + domUtils.trimWhiteTextNode(node); + if (node.childNodes.length == 1) { + node.style.cssText = ci.style.cssText + ";" + node.style.cssText; + domUtils.remove(ci, true); + continue; + } + } + ci.style.cssText = node.style.cssText + ';' + ci.style.cssText; + if (attrs) { + var style = attrs.style; + if (style) { + style = style.split(';'); + for (var j = 0, s; s = style[j++];) { + ci.style[utils.cssStyleToDomStyle(s.split(':')[0])] = s.split(':')[1]; + } + } + } + if (domUtils.isSameStyle(ci, node)) { + domUtils.remove(ci, true); + } + continue; + } + if (domUtils.isSameElement(node, ci)) { + domUtils.remove(ci, true); + } + } + }, + + /** + * 原生方法getElementsByTagName的封装 + * @method getElementsByTagName + * @param { Node } node 目标节点对象 + * @param { String } tagName 需要查找的节点的tagName, 多个tagName以空格分割 + * @return { Array } 符合条件的节点集合 + */ + getElementsByTagName:function (node, name,filter) { + if(filter && utils.isString(filter)){ + var className = filter; + filter = function(node){return domUtils.hasClass(node,className)} + } + name = utils.trim(name).replace(/[ ]{2,}/g,' ').split(' '); + var arr = []; + for(var n = 0,ni;ni=name[n++];){ + var list = node.getElementsByTagName(ni); + for (var i = 0, ci; ci = list[i++];) { + if(!filter || filter(ci)) + arr.push(ci); + } + } + + return arr; + }, + /** + * 将节点node提取到父节点上 + * @method mergeToParent + * @param { Element } node 需要提取的元素对象 + * @example + * ```html + *
    + *
    + * + *
    + *
    + * + * + * ``` + */ + mergeToParent:function (node) { + var parent = node.parentNode; + while (parent && dtd.$removeEmpty[parent.tagName]) { + if (parent.tagName == node.tagName || parent.tagName == 'A') {//针对a标签单独处理 + domUtils.trimWhiteTextNode(parent); + //span需要特殊处理 不处理这样的情况 xxxxxxxxx + if (parent.tagName == 'SPAN' && !domUtils.isSameStyle(parent, node) + || (parent.tagName == 'A' && node.tagName == 'SPAN')) { + if (parent.childNodes.length > 1 || parent !== node.parentNode) { + node.style.cssText = parent.style.cssText + ";" + node.style.cssText; + parent = parent.parentNode; + continue; + } else { + parent.style.cssText += ";" + node.style.cssText; + //trace:952 a标签要保持下划线 + if (parent.tagName == 'A') { + parent.style.textDecoration = 'underline'; + } + } + } + if (parent.tagName != 'A') { + parent === node.parentNode && domUtils.remove(node, true); + break; + } + } + parent = parent.parentNode; + } + }, + /** + * 合并节点node的左右兄弟节点 + * @method mergeSibling + * @param { Element } node 需要合并的目标节点 + * @example + * ```html + * xxxxoooxxxx + * + * + * ``` + */ + + /** + * 合并节点node的左右兄弟节点, 可以根据给定的条件选择是否忽略合并左节点。 + * @method mergeSibling + * @param { Element } node 需要合并的目标节点 + * @param { Boolean } ignorePre 是否忽略合并左节点 + * @example + * ```html + * xxxxoooxxxx + * + * + * ``` + */ + + /** + * 合并节点node的左右兄弟节点,可以根据给定的条件选择是否忽略合并左右节点。 + * @method mergeSibling + * @param { Element } node 需要合并的目标节点 + * @param { Boolean } ignorePre 是否忽略合并左节点 + * @param { Boolean } ignoreNext 是否忽略合并右节点 + * @remind 如果同时忽略左右节点, 则该操作什么也不会做 + * @example + * ```html + * xxxxoooxxxx + * + * + * ``` + */ + mergeSibling:function (node, ignorePre, ignoreNext) { + function merge(rtl, start, node) { + var next; + if ((next = node[rtl]) && !domUtils.isBookmarkNode(next) && next.nodeType == 1 && domUtils.isSameElement(node, next)) { + while (next.firstChild) { + if (start == 'firstChild') { + node.insertBefore(next.lastChild, node.firstChild); + } else { + node.appendChild(next.firstChild); + } + } + domUtils.remove(next); + } + } + !ignorePre && merge('previousSibling', 'firstChild', node); + !ignoreNext && merge('nextSibling', 'lastChild', node); + }, + + /** + * 设置节点node及其子节点不会被选中 + * @method unSelectable + * @param { Element } node 需要执行操作的dom元素 + * @remind 执行该操作后的节点, 将不能被鼠标选中 + * @example + * ```javascript + * UE.dom.domUtils.unSelectable( document.body ); + * ``` + */ + unSelectable:ie && browser.ie9below || browser.opera ? function (node) { + //for ie9 + node.onselectstart = function () { + return false; + }; + node.onclick = node.onkeyup = node.onkeydown = function () { + return false; + }; + node.unselectable = 'on'; + node.setAttribute("unselectable", "on"); + for (var i = 0, ci; ci = node.all[i++];) { + switch (ci.tagName.toLowerCase()) { + case 'iframe' : + case 'textarea' : + case 'input' : + case 'select' : + break; + default : + ci.unselectable = 'on'; + node.setAttribute("unselectable", "on"); + } + } + } : function (node) { + node.style.MozUserSelect = + node.style.webkitUserSelect = + node.style.msUserSelect = + node.style.KhtmlUserSelect = 'none'; + }, + /** + * 删除节点node上的指定属性名称的属性 + * @method removeAttributes + * @param { Node } node 需要删除属性的节点对象 + * @param { String } attrNames 可以是空格隔开的多个属性名称,该操作将会依次删除相应的属性 + * @example + * ```html + *
    + * xxxxx + *
    + * + * + * ``` + */ + + /** + * 删除节点node上的指定属性名称的属性 + * @method removeAttributes + * @param { Node } node 需要删除属性的节点对象 + * @param { Array } attrNames 需要删除的属性名数组 + * @example + * ```html + *
    + * xxxxx + *
    + * + * + * ``` + */ + removeAttributes:function (node, attrNames) { + attrNames = utils.isArray(attrNames) ? attrNames : utils.trim(attrNames).replace(/[ ]{2,}/g,' ').split(' '); + for (var i = 0, ci; ci = attrNames[i++];) { + ci = attrFix[ci] || ci; + switch (ci) { + case 'className': + node[ci] = ''; + break; + case 'style': + node.style.cssText = ''; + var val = node.getAttributeNode('style'); + !browser.ie && val && node.removeAttributeNode(val); + } + node.removeAttribute(ci); + } + }, + /** + * 在doc下创建一个标签名为tag,属性为attrs的元素 + * @method createElement + * @param { DomDocument } doc 新创建的元素属于该document节点创建 + * @param { String } tagName 需要创建的元素的标签名 + * @param { Object } attrs 新创建的元素的属性key-value集合 + * @return { Element } 新创建的元素对象 + * @example + * ```javascript + * var ele = UE.dom.domUtils.createElement( document, 'div', { + * id: 'test' + * } ); + * + * //output: DIV + * console.log( ele.tagName ); + * + * //output: test + * console.log( ele.id ); + * + * ``` + */ + createElement:function (doc, tag, attrs) { + return domUtils.setAttributes(doc.createElement(tag), attrs) + }, + /** + * 为节点node添加属性attrs,attrs为属性键值对 + * @method setAttributes + * @param { Element } node 需要设置属性的元素对象 + * @param { Object } attrs 需要设置的属性名-值对 + * @return { Element } 设置属性的元素对象 + * @example + * ```html + * + * + * + * + */ + setAttributes:function (node, attrs) { + for (var attr in attrs) { + if(attrs.hasOwnProperty(attr)){ + var value = attrs[attr]; + switch (attr) { + case 'class': + //ie下要这样赋值,setAttribute不起作用 + node.className = value; + break; + case 'style' : + node.style.cssText = node.style.cssText + ";" + value; + break; + case 'innerHTML': + node[attr] = value; + break; + case 'value': + node.value = value; + break; + default: + node.setAttribute(attrFix[attr] || attr, value); + } + } + } + return node; + }, + + /** + * 获取元素element经过计算后的样式值 + * @method getComputedStyle + * @param { Element } element 需要获取样式的元素对象 + * @param { String } styleName 需要获取的样式名 + * @return { String } 获取到的样式值 + * @example + * ```html + * + * + * + * + * + * ``` + */ + getComputedStyle:function (element, styleName) { + //一下的属性单独处理 + var pros = 'width height top left'; + + if(pros.indexOf(styleName) > -1){ + return element['offset' + styleName.replace(/^\w/,function(s){return s.toUpperCase()})] + 'px'; + } + //忽略文本节点 + if (element.nodeType == 3) { + element = element.parentNode; + } + //ie下font-size若body下定义了font-size,则从currentStyle里会取到这个font-size. 取不到实际值,故此修改. + if (browser.ie && browser.version < 9 && styleName == 'font-size' && !element.style.fontSize && + !dtd.$empty[element.tagName] && !dtd.$nonChild[element.tagName]) { + var span = element.ownerDocument.createElement('span'); + span.style.cssText = 'padding:0;border:0;font-family:simsun;'; + span.innerHTML = '.'; + element.appendChild(span); + var result = span.offsetHeight; + element.removeChild(span); + span = null; + return result + 'px'; + } + try { + var value = domUtils.getStyle(element, styleName) || + (window.getComputedStyle ? domUtils.getWindow(element).getComputedStyle(element, '').getPropertyValue(styleName) : + ( element.currentStyle || element.style )[utils.cssStyleToDomStyle(styleName)]); + + } catch (e) { + return ""; + } + return utils.transUnitToPx(utils.fixColor(styleName, value)); + }, + /** + * 删除元素element指定的className + * @method removeClasses + * @param { Element } ele 需要删除class的元素节点 + * @param { String } classNames 需要删除的className, 多个className之间以空格分开 + * @example + * ```html + * xxx + * + * + * ``` + */ + + /** + * 删除元素element指定的className + * @method removeClasses + * @param { Element } ele 需要删除class的元素节点 + * @param { Array } classNames 需要删除的className数组 + * @example + * ```html + * xxx + * + * + * ``` + */ + removeClasses:function (elm, classNames) { + classNames = utils.isArray(classNames) ? classNames : + utils.trim(classNames).replace(/[ ]{2,}/g,' ').split(' '); + for(var i = 0,ci,cls = elm.className;ci=classNames[i++];){ + cls = cls.replace(new RegExp('\\b' + ci + '\\b'),'') + } + cls = utils.trim(cls).replace(/[ ]{2,}/g,' '); + if(cls){ + elm.className = cls; + }else{ + domUtils.removeAttributes(elm,['class']); + } + }, + /** + * 给元素element添加className + * @method addClass + * @param { Node } ele 需要增加className的元素 + * @param { String } classNames 需要添加的className, 多个className之间以空格分割 + * @remind 相同的类名不会被重复添加 + * @example + * ```html + * + * + * + * ``` + */ + + /** + * 判断元素element是否包含给定的样式类名className + * @method hasClass + * @param { Node } ele 需要检测的元素 + * @param { Array } classNames 需要检测的className数组 + * @return { Boolean } 元素是否包含所有给定的className + * @example + * ```html + * + * + * + * ``` + */ + hasClass:function (element, className) { + if(utils.isRegExp(className)){ + return className.test(element.className) + } + className = utils.trim(className).replace(/[ ]{2,}/g,' ').split(' '); + for(var i = 0,ci,cls = element.className;ci=className[i++];){ + if(!new RegExp('\\b' + ci + '\\b','i').test(cls)){ + return false; + } + } + return i - 1 == className.length; + }, + + /** + * 阻止事件默认行为 + * @method preventDefault + * @param { Event } evt 需要阻止默认行为的事件对象 + * @example + * ```javascript + * UE.dom.domUtils.preventDefault( evt ); + * ``` + */ + preventDefault:function (evt) { + evt.preventDefault ? evt.preventDefault() : (evt.returnValue = false); + }, + /** + * 删除元素element指定的样式 + * @method removeStyle + * @param { Element } element 需要删除样式的元素 + * @param { String } styleName 需要删除的样式名 + * @example + * ```html + * + * + * + * ``` + */ + removeStyle:function (element, name) { + if(browser.ie ){ + //针对color先单独处理一下 + if(name == 'color'){ + name = '(^|;)' + name; + } + element.style.cssText = element.style.cssText.replace(new RegExp(name + '[^:]*:[^;]+;?','ig'),'') + }else{ + if (element.style.removeProperty) { + element.style.removeProperty (name); + }else { + element.style.removeAttribute (utils.cssStyleToDomStyle(name)); + } + } + + + if (!element.style.cssText) { + domUtils.removeAttributes(element, ['style']); + } + }, + /** + * 获取元素element的style属性的指定值 + * @method getStyle + * @param { Element } element 需要获取属性值的元素 + * @param { String } styleName 需要获取的style的名称 + * @warning 该方法仅获取元素style属性中所标明的值 + * @return { String } 该元素包含指定的style属性值 + * @example + * ```html + *
    + * + * + * ``` + */ + getStyle:function (element, name) { + var value = element.style[ utils.cssStyleToDomStyle(name) ]; + return utils.fixColor(name, value); + }, + /** + * 为元素element设置样式属性值 + * @method setStyle + * @param { Element } element 需要设置样式的元素 + * @param { String } styleName 样式名 + * @param { String } styleValue 样式值 + * @example + * ```html + *
    + * + * + * ``` + */ + setStyle:function (element, name, value) { + element.style[utils.cssStyleToDomStyle(name)] = value; + if(!utils.trim(element.style.cssText)){ + this.removeAttributes(element,'style') + } + }, + /** + * 为元素element设置多个样式属性值 + * @method setStyles + * @param { Element } element 需要设置样式的元素 + * @param { Object } styles 样式名值对 + * @example + * ```html + *
    + * + * + * ``` + */ + setStyles:function (element, styles) { + for (var name in styles) { + if (styles.hasOwnProperty(name)) { + domUtils.setStyle(element, name, styles[name]); + } + } + }, + /** + * 删除_moz_dirty属性 + * @private + * @method removeDirtyAttr + */ + removeDirtyAttr:function (node) { + for (var i = 0, ci, nodes = node.getElementsByTagName('*'); ci = nodes[i++];) { + ci.removeAttribute('_moz_dirty'); + } + node.removeAttribute('_moz_dirty'); + }, + /** + * 获取子节点的数量 + * @method getChildCount + * @param { Element } node 需要检测的元素 + * @return { Number } 给定的node元素的子节点数量 + * @example + * ```html + *
    + * + *
    + * + * + * ``` + */ + + /** + * 根据给定的过滤规则, 获取符合条件的子节点的数量 + * @method getChildCount + * @param { Element } node 需要检测的元素 + * @param { Function } fn 过滤器, 要求对符合条件的子节点返回true, 反之则要求返回false + * @return { Number } 符合过滤条件的node元素的子节点数量 + * @example + * ```html + *
    + * + *
    + * + * + * ``` + */ + getChildCount:function (node, fn) { + var count = 0, first = node.firstChild; + fn = fn || function () { + return 1; + }; + while (first) { + if (fn(first)) { + count++; + } + first = first.nextSibling; + } + return count; + }, + + /** + * 判断给定节点是否为空节点 + * @method isEmptyNode + * @param { Node } node 需要检测的节点对象 + * @return { Boolean } 节点是否为空 + * @example + * ```javascript + * UE.dom.domUtils.isEmptyNode( document.body ); + * ``` + */ + isEmptyNode:function (node) { + return !node.firstChild || domUtils.getChildCount(node, function (node) { + return !domUtils.isBr(node) && !domUtils.isBookmarkNode(node) && !domUtils.isWhitespace(node) + }) == 0 + }, + clearSelectedArr:function (nodes) { + var node; + while (node = nodes.pop()) { + domUtils.removeAttributes(node, ['class']); + } + }, + /** + * 将显示区域滚动到指定节点的位置 + * @method scrollToView + * @param {Node} node 节点 + * @param {window} win window对象 + * @param {Number} offsetTop 距离上方的偏移量 + */ + scrollToView:function (node, win, offsetTop) { + var getViewPaneSize = function () { + var doc = win.document, + mode = doc.compatMode == 'CSS1Compat'; + return { + width:( mode ? doc.documentElement.clientWidth : doc.body.clientWidth ) || 0, + height:( mode ? doc.documentElement.clientHeight : doc.body.clientHeight ) || 0 + }; + }, + getScrollPosition = function (win) { + if ('pageXOffset' in win) { + return { + x:win.pageXOffset || 0, + y:win.pageYOffset || 0 + }; + } + else { + var doc = win.document; + return { + x:doc.documentElement.scrollLeft || doc.body.scrollLeft || 0, + y:doc.documentElement.scrollTop || doc.body.scrollTop || 0 + }; + } + }; + var winHeight = getViewPaneSize().height, offset = winHeight * -1 + offsetTop; + offset += (node.offsetHeight || 0); + var elementPosition = domUtils.getXY(node); + offset += elementPosition.y; + var currentScroll = getScrollPosition(win).y; + // offset += 50; + if (offset > currentScroll || offset < currentScroll - winHeight) { + win.scrollTo(0, offset + (offset < 0 ? -20 : 20)); + } + }, + /** + * 判断给定节点是否为br + * @method isBr + * @param { Node } node 需要判断的节点对象 + * @return { Boolean } 给定的节点是否是br节点 + */ + isBr:function (node) { + return node.nodeType == 1 && node.tagName == 'BR'; + }, + /** + * 判断给定的节点是否是一个“填充”节点 + * @private + * @method isFillChar + * @param { Node } node 需要判断的节点 + * @param { Boolean } isInStart 是否从节点内容的开始位置匹配 + * @returns { Boolean } 节点是否是填充节点 + */ + isFillChar:function (node,isInStart) { + if(node.nodeType != 3) + return false; + var text = node.nodeValue; + if(isInStart){ + return new RegExp('^' + domUtils.fillChar).test(text) + } + return !text.replace(new RegExp(domUtils.fillChar,'g'), '').length + }, + isStartInblock:function (range) { + var tmpRange = range.cloneRange(), + flag = 0, + start = tmpRange.startContainer, + tmp; + if(start.nodeType == 1 && start.childNodes[tmpRange.startOffset]){ + start = start.childNodes[tmpRange.startOffset]; + var pre = start.previousSibling; + while(pre && domUtils.isFillChar(pre)){ + start = pre; + pre = pre.previousSibling; + } + } + if(this.isFillChar(start,true) && tmpRange.startOffset == 1){ + tmpRange.setStartBefore(start); + start = tmpRange.startContainer; + } + + while (start && domUtils.isFillChar(start)) { + tmp = start; + start = start.previousSibling + } + if (tmp) { + tmpRange.setStartBefore(tmp); + start = tmpRange.startContainer; + } + if (start.nodeType == 1 && domUtils.isEmptyNode(start) && tmpRange.startOffset == 1) { + tmpRange.setStart(start, 0).collapse(true); + } + while (!tmpRange.startOffset) { + start = tmpRange.startContainer; + if (domUtils.isBlockElm(start) || domUtils.isBody(start)) { + flag = 1; + break; + } + var pre = tmpRange.startContainer.previousSibling, + tmpNode; + if (!pre) { + tmpRange.setStartBefore(tmpRange.startContainer); + } else { + while (pre && domUtils.isFillChar(pre)) { + tmpNode = pre; + pre = pre.previousSibling; + } + if (tmpNode) { + tmpRange.setStartBefore(tmpNode); + } else { + tmpRange.setStartBefore(tmpRange.startContainer); + } + } + } + return flag && !domUtils.isBody(tmpRange.startContainer) ? 1 : 0; + }, + + /** + * 判断给定的元素是否是一个空元素 + * @method isEmptyBlock + * @param { Element } node 需要判断的元素 + * @return { Boolean } 是否是空元素 + * @example + * ```html + *
    + * + * + * ``` + */ + + /** + * 根据指定的判断规则判断给定的元素是否是一个空元素 + * @method isEmptyBlock + * @param { Element } node 需要判断的元素 + * @param { RegExp } reg 对内容执行判断的正则表达式对象 + * @return { Boolean } 是否是空元素 + */ + isEmptyBlock:function (node,reg) { + // HaoChuan9421 + if(!node){ + return; + } + if(node.nodeType != 1) + return 0; + reg = reg || new RegExp('[ \xa0\t\r\n' + domUtils.fillChar + ']', 'g'); + + if (node[browser.ie ? 'innerText' : 'textContent'].replace(reg, '').length > 0) { + return 0; + } + for (var n in dtd.$isNotEmpty) { + if (node.getElementsByTagName(n).length) { + return 0; + } + } + return 1; + }, + + /** + * 移动元素使得该元素的位置移动指定的偏移量的距离 + * @method setViewportOffset + * @param { Element } element 需要设置偏移量的元素 + * @param { Object } offset 偏移量, 形如{ left: 100, top: 50 }的一个键值对, 表示该元素将在 + * 现有的位置上向水平方向偏移offset.left的距离, 在竖直方向上偏移 + * offset.top的距离 + * @example + * ```html + *
    + * + * + * ``` + */ + setViewportOffset:function (element, offset) { + var left = parseInt(element.style.left) | 0; + var top = parseInt(element.style.top) | 0; + var rect = element.getBoundingClientRect(); + var offsetLeft = offset.left - rect.left; + var offsetTop = offset.top - rect.top; + if (offsetLeft) { + element.style.left = left + offsetLeft + 'px'; + } + if (offsetTop) { + element.style.top = top + offsetTop + 'px'; + } + }, + + /** + * 用“填充字符”填充节点 + * @method fillNode + * @private + * @param { DomDocument } doc 填充的节点所在的docment对象 + * @param { Node } node 需要填充的节点对象 + * @example + * ```html + *
    + * + * + * ``` + */ + fillNode:function (doc, node) { + var tmpNode = browser.ie ? doc.createTextNode(domUtils.fillChar) : doc.createElement('br'); + node.innerHTML = ''; + node.appendChild(tmpNode); + }, + + /** + * 把节点src的所有子节点追加到另一个节点tag上去 + * @method moveChild + * @param { Node } src 源节点, 该节点下的所有子节点将被移除 + * @param { Node } tag 目标节点, 从源节点移除的子节点将被追加到该节点下 + * @example + * ```html + *
    + * + *
    + *
    + *
    + *
    + * + * + * ``` + */ + + /** + * 把节点src的所有子节点移动到另一个节点tag上去, 可以通过dir参数控制附加的行为是“追加”还是“插入顶部” + * @method moveChild + * @param { Node } src 源节点, 该节点下的所有子节点将被移除 + * @param { Node } tag 目标节点, 从源节点移除的子节点将被附加到该节点下 + * @param { Boolean } dir 附加方式, 如果为true, 则附加进去的节点将被放到目标节点的顶部, 反之,则放到末尾 + * @example + * ```html + *
    + * + *
    + *
    + *
    + *
    + * + * + * ``` + */ + moveChild:function (src, tag, dir) { + while (src.firstChild) { + if (dir && tag.firstChild) { + tag.insertBefore(src.lastChild, tag.firstChild); + } else { + tag.appendChild(src.firstChild); + } + } + }, + + /** + * 判断节点的标签上是否不存在任何属性 + * @method hasNoAttributes + * @private + * @param { Node } node 需要检测的节点对象 + * @return { Boolean } 节点是否不包含任何属性 + * @example + * ```html + *
    xxxx
    + * + * + * ``` + */ + hasNoAttributes:function (node) { + return browser.ie ? /^<\w+\s*?>/.test(node.outerHTML) : node.attributes.length == 0; + }, + + /** + * 检测节点是否是UEditor所使用的辅助节点 + * @method isCustomeNode + * @private + * @param { Node } node 需要检测的节点 + * @remind 辅助节点是指编辑器要完成工作临时添加的节点, 在输出的时候将会从编辑器内移除, 不会影响最终的结果。 + * @return { Boolean } 给定的节点是否是一个辅助节点 + */ + isCustomeNode:function (node) { + return node.nodeType == 1 && node.getAttribute('_ue_custom_node_'); + }, + + /** + * 检测节点的标签是否是给定的标签 + * @method isTagNode + * @param { Node } node 需要检测的节点对象 + * @param { String } tagName 标签 + * @return { Boolean } 节点的标签是否是给定的标签 + * @example + * ```html + *
    + * + * + * ``` + */ + isTagNode:function (node, tagNames) { + return node.nodeType == 1 && new RegExp('\\b' + node.tagName + '\\b','i').test(tagNames) + }, + + /** + * 给定一个节点数组,在通过指定的过滤器过滤后, 获取其中满足过滤条件的第一个节点 + * @method filterNodeList + * @param { Array } nodeList 需要过滤的节点数组 + * @param { Function } fn 过滤器, 对符合条件的节点, 执行结果返回true, 反之则返回false + * @return { Node | NULL } 如果找到符合过滤条件的节点, 则返回该节点, 否则返回NULL + * @example + * ```javascript + * var divNodes = document.getElementsByTagName("div"); + * divNodes = [].slice.call( divNodes, 0 ); + * + * //output: null + * console.log( UE.dom.domUtils.filterNodeList( divNodes, function ( node ) { + * return node.tagName.toLowerCase() !== 'div'; + * } ) ); + * ``` + */ + + /** + * 给定一个节点数组nodeList和一组标签名tagNames, 获取其中能够匹配标签名的节点集合中的第一个节点 + * @method filterNodeList + * @param { Array } nodeList 需要过滤的节点数组 + * @param { String } tagNames 需要匹配的标签名, 多个标签名之间用空格分割 + * @return { Node | NULL } 如果找到标签名匹配的节点, 则返回该节点, 否则返回NULL + * @example + * ```javascript + * var divNodes = document.getElementsByTagName("div"); + * divNodes = [].slice.call( divNodes, 0 ); + * + * //output: null + * console.log( UE.dom.domUtils.filterNodeList( divNodes, 'a span' ) ); + * ``` + */ + + /** + * 给定一个节点数组,在通过指定的过滤器过滤后, 如果参数forAll为true, 则会返回所有满足过滤 + * 条件的节点集合, 否则, 返回满足条件的节点集合中的第一个节点 + * @method filterNodeList + * @param { Array } nodeList 需要过滤的节点数组 + * @param { Function } fn 过滤器, 对符合条件的节点, 执行结果返回true, 反之则返回false + * @param { Boolean } forAll 是否返回整个节点数组, 如果该参数为false, 则返回节点集合中的第一个节点 + * @return { Array | Node | NULL } 如果找到符合过滤条件的节点, 则根据参数forAll的值决定返回满足 + * 过滤条件的节点数组或第一个节点, 否则返回NULL + * @example + * ```javascript + * var divNodes = document.getElementsByTagName("div"); + * divNodes = [].slice.call( divNodes, 0 ); + * + * //output: 3(假定有3个div) + * console.log( divNodes.length ); + * + * var nodes = UE.dom.domUtils.filterNodeList( divNodes, function ( node ) { + * return node.tagName.toLowerCase() === 'div'; + * }, true ); + * + * //output: 3 + * console.log( nodes.length ); + * + * var node = UE.dom.domUtils.filterNodeList( divNodes, function ( node ) { + * return node.tagName.toLowerCase() === 'div'; + * }, false ); + * + * //output: div + * console.log( node.nodeName ); + * ``` + */ + filterNodeList : function(nodelist,filter,forAll){ + var results = []; + if(!utils .isFunction(filter)){ + var str = filter; + filter = function(n){ + return utils.indexOf(utils.isArray(str) ? str:str.split(' '), n.tagName.toLowerCase()) != -1 + }; + } + utils.each(nodelist,function(n){ + filter(n) && results.push(n) + }); + return results.length == 0 ? null : results.length == 1 || !forAll ? results[0] : results + }, + + /** + * 查询给定的range选区是否在给定的node节点内,且在该节点的最末尾 + * @method isInNodeEndBoundary + * @param { UE.dom.Range } rng 需要判断的range对象, 该对象的startContainer不能为NULL + * @param node 需要检测的节点对象 + * @return { Number } 如果给定的选取range对象是在node内部的最末端, 则返回1, 否则返回0 + */ + isInNodeEndBoundary : function (rng,node){ + var start = rng.startContainer; + if(start.nodeType == 3 && rng.startOffset != start.nodeValue.length){ + return 0; + } + if(start.nodeType == 1 && rng.startOffset != start.childNodes.length){ + return 0; + } + while(start !== node){ + if(start.nextSibling){ + return 0 + }; + start = start.parentNode; + } + return 1; + }, + isBoundaryNode : function (node,dir){ + var tmp; + while(!domUtils.isBody(node)){ + tmp = node; + node = node.parentNode; + if(tmp !== node[dir]){ + return false; + } + } + return true; + }, + fillHtml : browser.ie11below ? ' ' : '
    ' +}; +var fillCharReg = new RegExp(domUtils.fillChar, 'g'); + +// core/Range.js +/** + * Range封装 + * @file + * @module UE.dom + * @class Range + * @since 1.2.6.1 + */ + +/** + * dom操作封装 + * @unfile + * @module UE.dom + */ + +/** + * Range实现类,本类是UEditor底层核心类,封装不同浏览器之间的Range操作。 + * @unfile + * @module UE.dom + * @class Range + */ + + +(function () { + var guid = 0, + fillChar = domUtils.fillChar, + fillData; + + /** + * 更新range的collapse状态 + * @param {Range} range range对象 + */ + function updateCollapse(range) { + range.collapsed = + range.startContainer && range.endContainer && + range.startContainer === range.endContainer && + range.startOffset == range.endOffset; + } + + function selectOneNode(rng){ + return !rng.collapsed && rng.startContainer.nodeType == 1 && rng.startContainer === rng.endContainer && rng.endOffset - rng.startOffset == 1 + } + function setEndPoint(toStart, node, offset, range) { + //如果node是自闭合标签要处理 + if (node.nodeType == 1 && (dtd.$empty[node.tagName] || dtd.$nonChild[node.tagName])) { + offset = domUtils.getNodeIndex(node) + (toStart ? 0 : 1); + node = node.parentNode; + } + if (toStart) { + range.startContainer = node; + range.startOffset = offset; + if (!range.endContainer) { + range.collapse(true); + } + } else { + range.endContainer = node; + range.endOffset = offset; + if (!range.startContainer) { + range.collapse(false); + } + } + updateCollapse(range); + return range; + } + + function execContentsAction(range, action) { + //调整边界 + //range.includeBookmark(); + var start = range.startContainer, + end = range.endContainer, + startOffset = range.startOffset, + endOffset = range.endOffset, + doc = range.document, + frag = doc.createDocumentFragment(), + tmpStart, tmpEnd; + if (start.nodeType == 1) { + start = start.childNodes[startOffset] || (tmpStart = start.appendChild(doc.createTextNode(''))); + } + if (end.nodeType == 1) { + end = end.childNodes[endOffset] || (tmpEnd = end.appendChild(doc.createTextNode(''))); + } + if (start === end && start.nodeType == 3) { + frag.appendChild(doc.createTextNode(start.substringData(startOffset, endOffset - startOffset))); + //is not clone + if (action) { + start.deleteData(startOffset, endOffset - startOffset); + range.collapse(true); + } + return frag; + } + var current, currentLevel, clone = frag, + startParents = domUtils.findParents(start, true), endParents = domUtils.findParents(end, true); + for (var i = 0; startParents[i] == endParents[i];) { + i++; + } + for (var j = i, si; si = startParents[j]; j++) { + current = si.nextSibling; + if (si == start) { + if (!tmpStart) { + if (range.startContainer.nodeType == 3) { + clone.appendChild(doc.createTextNode(start.nodeValue.slice(startOffset))); + //is not clone + if (action) { + start.deleteData(startOffset, start.nodeValue.length - startOffset); + } + } else { + clone.appendChild(!action ? start.cloneNode(true) : start); + } + } + } else { + currentLevel = si.cloneNode(false); + clone.appendChild(currentLevel); + } + while (current) { + if (current === end || current === endParents[j]) { + break; + } + si = current.nextSibling; + clone.appendChild(!action ? current.cloneNode(true) : current); + current = si; + } + clone = currentLevel; + } + clone = frag; + if (!startParents[i]) { + clone.appendChild(startParents[i - 1].cloneNode(false)); + clone = clone.firstChild; + } + for (var j = i, ei; ei = endParents[j]; j++) { + current = ei.previousSibling; + if (ei == end) { + if (!tmpEnd && range.endContainer.nodeType == 3) { + clone.appendChild(doc.createTextNode(end.substringData(0, endOffset))); + //is not clone + if (action) { + end.deleteData(0, endOffset); + } + } + } else { + currentLevel = ei.cloneNode(false); + clone.appendChild(currentLevel); + } + //如果两端同级,右边第一次已经被开始做了 + if (j != i || !startParents[i]) { + while (current) { + if (current === start) { + break; + } + ei = current.previousSibling; + clone.insertBefore(!action ? current.cloneNode(true) : current, clone.firstChild); + current = ei; + } + } + clone = currentLevel; + } + if (action) { + range.setStartBefore(!endParents[i] ? endParents[i - 1] : !startParents[i] ? startParents[i - 1] : endParents[i]).collapse(true); + } + tmpStart && domUtils.remove(tmpStart); + tmpEnd && domUtils.remove(tmpEnd); + return frag; + } + + /** + * 创建一个跟document绑定的空的Range实例 + * @constructor + * @param { Document } document 新建的选区所属的文档对象 + */ + + /** + * @property { Node } startContainer 当前Range的开始边界的容器节点, 可以是一个元素节点或者是文本节点 + */ + + /** + * @property { Node } startOffset 当前Range的开始边界容器节点的偏移量, 如果是元素节点, + * 该值就是childNodes中的第几个节点, 如果是文本节点就是文本内容的第几个字符 + */ + + /** + * @property { Node } endContainer 当前Range的结束边界的容器节点, 可以是一个元素节点或者是文本节点 + */ + + /** + * @property { Node } endOffset 当前Range的结束边界容器节点的偏移量, 如果是元素节点, + * 该值就是childNodes中的第几个节点, 如果是文本节点就是文本内容的第几个字符 + */ + + /** + * @property { Boolean } collapsed 当前Range是否闭合 + * @default true + * @remind Range是闭合的时候, startContainer === endContainer && startOffset === endOffset + */ + + /** + * @property { Document } document 当前Range所属的Document对象 + * @remind 不同range的的document属性可以是不同的 + */ + var Range = dom.Range = function (document) { + var me = this; + me.startContainer = + me.startOffset = + me.endContainer = + me.endOffset = null; + me.document = document; + me.collapsed = true; + }; + + /** + * 删除fillData + * @param doc + * @param excludeNode + */ + function removeFillData(doc, excludeNode) { + try { + if (fillData && domUtils.inDoc(fillData, doc)) { + if (!fillData.nodeValue.replace(fillCharReg, '').length) { + var tmpNode = fillData.parentNode; + domUtils.remove(fillData); + while (tmpNode && domUtils.isEmptyInlineElement(tmpNode) && + //safari的contains有bug + (browser.safari ? !(domUtils.getPosition(tmpNode,excludeNode) & domUtils.POSITION_CONTAINS) : !tmpNode.contains(excludeNode)) + ) { + fillData = tmpNode.parentNode; + domUtils.remove(tmpNode); + tmpNode = fillData; + } + } else { + fillData.nodeValue = fillData.nodeValue.replace(fillCharReg, ''); + } + } + } catch (e) { + } + } + + /** + * @param node + * @param dir + */ + function mergeSibling(node, dir) { + var tmpNode; + node = node[dir]; + while (node && domUtils.isFillChar(node)) { + tmpNode = node[dir]; + domUtils.remove(node); + node = tmpNode; + } + } + + Range.prototype = { + + /** + * 克隆选区的内容到一个DocumentFragment里 + * @method cloneContents + * @return { DocumentFragment | NULL } 如果选区是闭合的将返回null, 否则, 返回包含所clone内容的DocumentFragment元素 + * @example + * ```html + * + * + * xx[xxx]x + * + * + * + * ``` + */ + cloneContents:function () { + return this.collapsed ? null : execContentsAction(this, 0); + }, + + /** + * 删除当前选区范围中的所有内容 + * @method deleteContents + * @remind 执行完该操作后, 当前Range对象变成了闭合状态 + * @return { UE.dom.Range } 当前操作的Range对象 + * @example + * ```html + * + * + * xx[xxx]x + * + * + * + * ``` + */ + deleteContents:function () { + var txt; + if (!this.collapsed) { + execContentsAction(this, 1); + } + if (browser.webkit) { + txt = this.startContainer; + if (txt.nodeType == 3 && !txt.nodeValue.length) { + this.setStartBefore(txt).collapse(true); + domUtils.remove(txt); + } + } + return this; + }, + + /** + * 将当前选区的内容提取到一个DocumentFragment里 + * @method extractContents + * @remind 执行该操作后, 选区将变成闭合状态 + * @warning 执行该操作后, 原来选区所选中的内容将从dom树上剥离出来 + * @return { DocumentFragment } 返回包含所提取内容的DocumentFragment对象 + * @example + * ```html + * + * + * xx[xxx]x + * + * + * + */ + extractContents:function () { + return this.collapsed ? null : execContentsAction(this, 2); + }, + + /** + * 设置Range的开始容器节点和偏移量 + * @method setStart + * @remind 如果给定的节点是元素节点,那么offset指的是其子元素中索引为offset的元素, + * 如果是文本节点,那么offset指的是其文本内容的第offset个字符 + * @remind 如果提供的容器节点是一个不能包含子元素的节点, 则该选区的开始容器将被设置 + * 为该节点的父节点, 此时, 其距离开始容器的偏移量也变成了该节点在其父节点 + * 中的索引 + * @param { Node } node 将被设为当前选区开始边界容器的节点对象 + * @param { int } offset 选区的开始位置偏移量 + * @return { UE.dom.Range } 当前range对象 + * @example + * ```html + * + * xxxxxxxxxxxxx[xxx] + * + * + * ``` + * @example + * ```html + * + * xxx[xx]x + * + * + * ``` + */ + setStart:function (node, offset) { + return setEndPoint(true, node, offset, this); + }, + + /** + * 设置Range的结束容器和偏移量 + * @method setEnd + * @param { Node } node 作为当前选区结束边界容器的节点对象 + * @param { int } offset 结束边界的偏移量 + * @see UE.dom.Range:setStart(Node,int) + * @return { UE.dom.Range } 当前range对象 + */ + setEnd:function (node, offset) { + return setEndPoint(false, node, offset, this); + }, + + /** + * 将Range开始位置设置到node节点之后 + * @method setStartAfter + * @remind 该操作将会把给定节点的父节点作为range的开始容器, 且偏移量是该节点在其父节点中的位置索引+1 + * @param { Node } node 选区的开始边界将紧接着该节点之后 + * @return { UE.dom.Range } 当前range对象 + * @example + * ```html + * + * xxxxxxx[xxxx] + * + * + * ``` + */ + setStartAfter:function (node) { + return this.setStart(node.parentNode, domUtils.getNodeIndex(node) + 1); + }, + + /** + * 将Range开始位置设置到node节点之前 + * @method setStartBefore + * @remind 该操作将会把给定节点的父节点作为range的开始容器, 且偏移量是该节点在其父节点中的位置索引 + * @param { Node } node 新的选区开始位置在该节点之前 + * @see UE.dom.Range:setStartAfter(Node) + * @return { UE.dom.Range } 当前range对象 + */ + setStartBefore:function (node) { + return this.setStart(node.parentNode, domUtils.getNodeIndex(node)); + }, + + /** + * 将Range结束位置设置到node节点之后 + * @method setEndAfter + * @remind 该操作将会把给定节点的父节点作为range的结束容器, 且偏移量是该节点在其父节点中的位置索引+1 + * @param { Node } node 目标节点 + * @see UE.dom.Range:setStartAfter(Node) + * @return { UE.dom.Range } 当前range对象 + * @example + * ```html + * + * [xxxxxxx]xxxx + * + * + * ``` + */ + setEndAfter:function (node) { + return this.setEnd(node.parentNode, domUtils.getNodeIndex(node) + 1); + }, + + /** + * 将Range结束位置设置到node节点之前 + * @method setEndBefore + * @remind 该操作将会把给定节点的父节点作为range的结束容器, 且偏移量是该节点在其父节点中的位置索引 + * @param { Node } node 目标节点 + * @see UE.dom.Range:setEndAfter(Node) + * @return { UE.dom.Range } 当前range对象 + */ + setEndBefore:function (node) { + return this.setEnd(node.parentNode, domUtils.getNodeIndex(node)); + }, + + /** + * 设置Range的开始位置到node节点内的第一个子节点之前 + * @method setStartAtFirst + * @remind 选区的开始容器将变成给定的节点, 且偏移量为0 + * @remind 如果给定的节点是元素节点, 则该节点必须是允许包含子节点的元素。 + * @param { Node } node 目标节点 + * @see UE.dom.Range:setStartBefore(Node) + * @return { UE.dom.Range } 当前range对象 + * @example + * ```html + * + * xxxxx[xx]xxxx + * + * + * ``` + */ + setStartAtFirst:function (node) { + return this.setStart(node, 0); + }, + + /** + * 设置Range的开始位置到node节点内的最后一个节点之后 + * @method setStartAtLast + * @remind 选区的开始容器将变成给定的节点, 且偏移量为该节点的子节点数 + * @remind 如果给定的节点是元素节点, 则该节点必须是允许包含子节点的元素。 + * @param { Node } node 目标节点 + * @see UE.dom.Range:setStartAtFirst(Node) + * @return { UE.dom.Range } 当前range对象 + */ + setStartAtLast:function (node) { + return this.setStart(node, node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length); + }, + + /** + * 设置Range的结束位置到node节点内的第一个节点之前 + * @method setEndAtFirst + * @param { Node } node 目标节点 + * @remind 选区的结束容器将变成给定的节点, 且偏移量为0 + * @remind node必须是一个元素节点, 且必须是允许包含子节点的元素。 + * @see UE.dom.Range:setStartAtFirst(Node) + * @return { UE.dom.Range } 当前range对象 + */ + setEndAtFirst:function (node) { + return this.setEnd(node, 0); + }, + + /** + * 设置Range的结束位置到node节点内的最后一个节点之后 + * @method setEndAtLast + * @param { Node } node 目标节点 + * @remind 选区的结束容器将变成给定的节点, 且偏移量为该节点的子节点数量 + * @remind node必须是一个元素节点, 且必须是允许包含子节点的元素。 + * @see UE.dom.Range:setStartAtFirst(Node) + * @return { UE.dom.Range } 当前range对象 + */ + setEndAtLast:function (node) { + return this.setEnd(node, node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length); + }, + + /** + * 选中给定节点 + * @method selectNode + * @remind 此时, 选区的开始容器和结束容器都是该节点的父节点, 其startOffset是该节点在父节点中的位置索引, + * 而endOffset为startOffset+1 + * @param { Node } node 需要选中的节点 + * @return { UE.dom.Range } 当前range对象,此时的range仅包含当前给定的节点对象 + * @example + * ```html + * + * xxxxx[xx]xxxx + * + * + * ``` + */ + selectNode:function (node) { + return this.setStartBefore(node).setEndAfter(node); + }, + + /** + * 选中给定节点内部的所有节点 + * @method selectNodeContents + * @remind 此时, 选区的开始容器和结束容器都是该节点, 其startOffset为0, + * 而endOffset是该节点的子节点数。 + * @param { Node } node 目标节点, 当前range将包含该节点内的所有节点 + * @return { UE.dom.Range } 当前range对象, 此时range仅包含给定节点的所有子节点 + * @example + * ```html + * + * xxxxx[xx]xxxx + * + * + * ``` + */ + selectNodeContents:function (node) { + return this.setStart(node, 0).setEndAtLast(node); + }, + + /** + * clone当前Range对象 + * @method cloneRange + * @remind 返回的range是一个全新的range对象, 其内部所有属性与当前被clone的range相同。 + * @return { UE.dom.Range } 当前range对象的一个副本 + */ + cloneRange:function () { + var me = this; + return new Range(me.document).setStart(me.startContainer, me.startOffset).setEnd(me.endContainer, me.endOffset); + + }, + + /** + * 向当前选区的结束处闭合选区 + * @method collapse + * @return { UE.dom.Range } 当前range对象 + * @example + * ```html + * + * xxxxx[xx]xxxx + * + * + * ``` + */ + + /** + * 闭合当前选区,根据给定的toStart参数项决定是向当前选区开始处闭合还是向结束处闭合, + * 如果toStart的值为true,则向开始位置闭合, 反之,向结束位置闭合。 + * @method collapse + * @param { Boolean } toStart 是否向选区开始处闭合 + * @return { UE.dom.Range } 当前range对象,此时range对象处于闭合状态 + * @see UE.dom.Range:collapse() + * @example + * ```html + * + * xxxxx[xx]xxxx + * + * + * ``` + */ + collapse:function (toStart) { + var me = this; + if (toStart) { + me.endContainer = me.startContainer; + me.endOffset = me.startOffset; + } else { + me.startContainer = me.endContainer; + me.startOffset = me.endOffset; + } + me.collapsed = true; + return me; + }, + + /** + * 调整range的开始位置和结束位置,使其"收缩"到最小的位置 + * @method shrinkBoundary + * @return { UE.dom.Range } 当前range对象 + * @example + * ```html + * xxxx[xxxxx] => xxxx[xxxxx] + * ``` + * + * @example + * ```html + * + * x[xx]xxx + * + * + * ``` + * + * @example + * ```html + * [xxxxxxxxxxx] => [xxxxxxxxxxx] + * ``` + */ + + /** + * 调整range的开始位置和结束位置,使其"收缩"到最小的位置, + * 如果ignoreEnd的值为true,则忽略对结束位置的调整 + * @method shrinkBoundary + * @param { Boolean } ignoreEnd 是否忽略对结束位置的调整 + * @return { UE.dom.Range } 当前range对象 + * @see UE.dom.domUtils.Range:shrinkBoundary() + */ + shrinkBoundary:function (ignoreEnd) { + var me = this, child, + collapsed = me.collapsed; + function check(node){ + return node.nodeType == 1 && !domUtils.isBookmarkNode(node) && !dtd.$empty[node.tagName] && !dtd.$nonChild[node.tagName] + } + while (me.startContainer.nodeType == 1 //是element + && (child = me.startContainer.childNodes[me.startOffset]) //子节点也是element + && check(child)) { + me.setStart(child, 0); + } + if (collapsed) { + return me.collapse(true); + } + if (!ignoreEnd) { + while (me.endContainer.nodeType == 1//是element + && me.endOffset > 0 //如果是空元素就退出 endOffset=0那么endOffst-1为负值,childNodes[endOffset]报错 + && (child = me.endContainer.childNodes[me.endOffset - 1]) //子节点也是element + && check(child)) { + me.setEnd(child, child.childNodes.length); + } + } + return me; + }, + + /** + * 获取离当前选区内包含的所有节点最近的公共祖先节点, + * @method getCommonAncestor + * @remind 返回的公共祖先节点一定不是range自身的容器节点, 但有可能是一个文本节点 + * @return { Node } 当前range对象内所有节点的公共祖先节点 + * @example + * ```html + * //选区示例 + * xxxx[xxx]xxxxxx + * + * ``` + */ + + /** + * 获取当前选区所包含的所有节点的公共祖先节点, 可以根据给定的参数 includeSelf 决定获取到 + * 的公共祖先节点是否可以是当前选区的startContainer或endContainer节点, 如果 includeSelf + * 的取值为true, 则返回的节点可以是自身的容器节点, 否则, 则不能是容器节点 + * @method getCommonAncestor + * @param { Boolean } includeSelf 是否允许获取到的公共祖先节点是当前range对象的容器节点 + * @return { Node } 当前range对象内所有节点的公共祖先节点 + * @see UE.dom.Range:getCommonAncestor() + * @example + * ```html + * + * + * + * xxxxxxxxx[xxx]xxxxxxxx + * + * + * + * + * ``` + */ + + /** + * 获取当前选区所包含的所有节点的公共祖先节点, 可以根据给定的参数 includeSelf 决定获取到 + * 的公共祖先节点是否可以是当前选区的startContainer或endContainer节点, 如果 includeSelf + * 的取值为true, 则返回的节点可以是自身的容器节点, 否则, 则不能是容器节点; 同时可以根据 + * ignoreTextNode 参数的取值决定是否忽略类型为文本节点的祖先节点。 + * @method getCommonAncestor + * @param { Boolean } includeSelf 是否允许获取到的公共祖先节点是当前range对象的容器节点 + * @param { Boolean } ignoreTextNode 获取祖先节点的过程中是否忽略类型为文本节点的祖先节点 + * @return { Node } 当前range对象内所有节点的公共祖先节点 + * @see UE.dom.Range:getCommonAncestor() + * @see UE.dom.Range:getCommonAncestor(Boolean) + * @example + * ```html + * + * + * + * xxxxxxxx[x]xxxxxxxxxxx + * + * + * + * + * ``` + */ + getCommonAncestor:function (includeSelf, ignoreTextNode) { + var me = this, + start = me.startContainer, + end = me.endContainer; + if (start === end) { + if (includeSelf && selectOneNode(this)) { + start = start.childNodes[me.startOffset]; + if(start.nodeType == 1) + return start; + } + //只有在上来就相等的情况下才会出现是文本的情况 + return ignoreTextNode && start.nodeType == 3 ? start.parentNode : start; + } + return domUtils.getCommonAncestor(start, end); + }, + + /** + * 调整当前Range的开始和结束边界容器,如果是容器节点是文本节点,就调整到包含该文本节点的父节点上 + * @method trimBoundary + * @remind 该操作有可能会引起文本节点被切开 + * @return { UE.dom.Range } 当前range对象 + * @example + * ```html + * + * //选区示例 + * xxx[xxxxx]xxx + * + * + * ``` + */ + + /** + * 调整当前Range的开始和结束边界容器,如果是容器节点是文本节点,就调整到包含该文本节点的父节点上, + * 可以根据 ignoreEnd 参数的值决定是否调整对结束边界的调整 + * @method trimBoundary + * @param { Boolean } ignoreEnd 是否忽略对结束边界的调整 + * @return { UE.dom.Range } 当前range对象 + * @example + * ```html + * + * //选区示例 + * xxx[xxxxx]xxx + * + * + * ``` + */ + trimBoundary:function (ignoreEnd) { + this.txtToElmBoundary(); + var start = this.startContainer, + offset = this.startOffset, + collapsed = this.collapsed, + end = this.endContainer; + if (start.nodeType == 3) { + if (offset == 0) { + this.setStartBefore(start); + } else { + if (offset >= start.nodeValue.length) { + this.setStartAfter(start); + } else { + var textNode = domUtils.split(start, offset); + //跟新结束边界 + if (start === end) { + this.setEnd(textNode, this.endOffset - offset); + } else if (start.parentNode === end) { + this.endOffset += 1; + } + this.setStartBefore(textNode); + } + } + if (collapsed) { + return this.collapse(true); + } + } + if (!ignoreEnd) { + offset = this.endOffset; + end = this.endContainer; + if (end.nodeType == 3) { + if (offset == 0) { + this.setEndBefore(end); + } else { + offset < end.nodeValue.length && domUtils.split(end, offset); + this.setEndAfter(end); + } + } + } + return this; + }, + + /** + * 如果选区在文本的边界上,就扩展选区到文本的父节点上, 如果当前选区是闭合的, 则什么也不做 + * @method txtToElmBoundary + * @remind 该操作不会修改dom节点 + * @return { UE.dom.Range } 当前range对象 + */ + + /** + * 如果选区在文本的边界上,就扩展选区到文本的父节点上, 如果当前选区是闭合的, 则根据参数项 + * ignoreCollapsed 的值决定是否执行该调整 + * @method txtToElmBoundary + * @param { Boolean } ignoreCollapsed 是否忽略选区的闭合状态, 如果该参数取值为true, 则 + * 不论选区是否闭合, 都会执行该操作, 反之, 则不会对闭合的选区执行该操作 + * @return { UE.dom.Range } 当前range对象 + */ + txtToElmBoundary:function (ignoreCollapsed) { + function adjust(r, c) { + var container = r[c + 'Container'], + offset = r[c + 'Offset']; + if (container.nodeType == 3) { + if (!offset) { + r['set' + c.replace(/(\w)/, function (a) { + return a.toUpperCase(); + }) + 'Before'](container); + } else if (offset >= container.nodeValue.length) { + r['set' + c.replace(/(\w)/, function (a) { + return a.toUpperCase(); + }) + 'After' ](container); + } + } + } + + if (ignoreCollapsed || !this.collapsed) { + adjust(this, 'start'); + adjust(this, 'end'); + } + return this; + }, + + /** + * 在当前选区的开始位置前插入节点,新插入的节点会被该range包含 + * @method insertNode + * @param { Node } node 需要插入的节点 + * @remind 插入的节点可以是一个DocumentFragment依次插入多个节点 + * @return { UE.dom.Range } 当前range对象 + */ + insertNode:function (node) { + var first = node, length = 1; + if (node.nodeType == 11) { + first = node.firstChild; + length = node.childNodes.length; + } + this.trimBoundary(true); + var start = this.startContainer, + offset = this.startOffset; + var nextNode = start.childNodes[ offset ]; + if (nextNode) { + start.insertBefore(node, nextNode); + } else { + start.appendChild(node); + } + if (first.parentNode === this.endContainer) { + this.endOffset = this.endOffset + length; + } + return this.setStartBefore(first); + }, + + /** + * 闭合选区到当前选区的开始位置, 并且定位光标到闭合后的位置 + * @method setCursor + * @return { UE.dom.Range } 当前range对象 + * @see UE.dom.Range:collapse() + */ + + /** + * 闭合选区,可以根据参数toEnd的值控制选区是向前闭合还是向后闭合, 并且定位光标到闭合后的位置。 + * @method setCursor + * @param { Boolean } toEnd 是否向后闭合, 如果为true, 则闭合选区时, 将向结束容器方向闭合, + * 反之,则向开始容器方向闭合 + * @return { UE.dom.Range } 当前range对象 + * @see UE.dom.Range:collapse(Boolean) + */ + setCursor:function (toEnd, noFillData) { + return this.collapse(!toEnd).select(noFillData); + }, + + /** + * 创建当前range的一个书签,记录下当前range的位置,方便当dom树改变时,还能找回原来的选区位置 + * @method createBookmark + * @param { Boolean } serialize 控制返回的标记位置是对当前位置的引用还是ID,如果该值为true,则 + * 返回标记位置的ID, 反之则返回标记位置节点的引用 + * @return { Object } 返回一个书签记录键值对, 其包含的key有: start => 开始标记的ID或者引用, + * end => 结束标记的ID或引用, id => 当前标记的类型, 如果为true,则表示 + * 返回的记录的类型为ID, 反之则为引用 + */ + createBookmark:function (serialize, same) { + var endNode, + startNode = this.document.createElement('span'); + startNode.style.cssText = 'display:none;line-height:0px;'; + startNode.appendChild(this.document.createTextNode('\u200D')); + startNode.id = '_baidu_bookmark_start_' + (same ? '' : guid++); + + if (!this.collapsed) { + endNode = startNode.cloneNode(true); + endNode.id = '_baidu_bookmark_end_' + (same ? '' : guid++); + } + this.insertNode(startNode); + if (endNode) { + this.collapse().insertNode(endNode).setEndBefore(endNode); + } + this.setStartAfter(startNode); + return { + start:serialize ? startNode.id : startNode, + end:endNode ? serialize ? endNode.id : endNode : null, + id:serialize + } + }, + + /** + * 调整当前range的边界到书签位置,并删除该书签对象所标记的位置内的节点 + * @method moveToBookmark + * @param { BookMark } bookmark createBookmark所创建的标签对象 + * @return { UE.dom.Range } 当前range对象 + * @see UE.dom.Range:createBookmark(Boolean) + */ + moveToBookmark:function (bookmark) { + var start = bookmark.id ? this.document.getElementById(bookmark.start) : bookmark.start, + end = bookmark.end && bookmark.id ? this.document.getElementById(bookmark.end) : bookmark.end; + this.setStartBefore(start); + domUtils.remove(start); + if (end) { + this.setEndBefore(end); + domUtils.remove(end); + } else { + this.collapse(true); + } + return this; + }, + + /** + * 调整range的边界,使其"放大"到最近的父节点 + * @method enlarge + * @remind 会引起选区的变化 + * @return { UE.dom.Range } 当前range对象 + */ + + /** + * 调整range的边界,使其"放大"到最近的父节点,根据参数 toBlock 的取值, 可以 + * 要求扩大之后的父节点是block节点 + * @method enlarge + * @param { Boolean } toBlock 是否要求扩大之后的父节点必须是block节点 + * @return { UE.dom.Range } 当前range对象 + */ + enlarge:function (toBlock, stopFn) { + var isBody = domUtils.isBody, + pre, node, tmp = this.document.createTextNode(''); + if (toBlock) { + node = this.startContainer; + if (node.nodeType == 1) { + if (node.childNodes[this.startOffset]) { + pre = node = node.childNodes[this.startOffset] + } else { + node.appendChild(tmp); + pre = node = tmp; + } + } else { + pre = node; + } + while (1) { + if (domUtils.isBlockElm(node)) { + node = pre; + while ((pre = node.previousSibling) && !domUtils.isBlockElm(pre)) { + node = pre; + } + this.setStartBefore(node); + break; + } + pre = node; + node = node.parentNode; + } + node = this.endContainer; + if (node.nodeType == 1) { + if (pre = node.childNodes[this.endOffset]) { + node.insertBefore(tmp, pre); + } else { + node.appendChild(tmp); + } + pre = node = tmp; + } else { + pre = node; + } + while (1) { + if (domUtils.isBlockElm(node)) { + node = pre; + while ((pre = node.nextSibling) && !domUtils.isBlockElm(pre)) { + node = pre; + } + this.setEndAfter(node); + break; + } + pre = node; + node = node.parentNode; + } + if (tmp.parentNode === this.endContainer) { + this.endOffset--; + } + domUtils.remove(tmp); + } + + // 扩展边界到最大 + if (!this.collapsed) { + while (this.startOffset == 0) { + if (stopFn && stopFn(this.startContainer)) { + break; + } + if (isBody(this.startContainer)) { + break; + } + this.setStartBefore(this.startContainer); + } + while (this.endOffset == (this.endContainer.nodeType == 1 ? this.endContainer.childNodes.length : this.endContainer.nodeValue.length)) { + if (stopFn && stopFn(this.endContainer)) { + break; + } + if (isBody(this.endContainer)) { + break; + } + this.setEndAfter(this.endContainer); + } + } + return this; + }, + enlargeToBlockElm:function(ignoreEnd){ + while(!domUtils.isBlockElm(this.startContainer)){ + this.setStartBefore(this.startContainer); + } + if(!ignoreEnd){ + while(!domUtils.isBlockElm(this.endContainer)){ + this.setEndAfter(this.endContainer); + } + } + return this; + }, + /** + * 调整Range的边界,使其"缩小"到最合适的位置 + * @method adjustmentBoundary + * @return { UE.dom.Range } 当前range对象 + * @see UE.dom.Range:shrinkBoundary() + */ + adjustmentBoundary:function () { + if (!this.collapsed) { + while (!domUtils.isBody(this.startContainer) && + this.startOffset == this.startContainer[this.startContainer.nodeType == 3 ? 'nodeValue' : 'childNodes'].length && + this.startContainer[this.startContainer.nodeType == 3 ? 'nodeValue' : 'childNodes'].length + ) { + + this.setStartAfter(this.startContainer); + } + while (!domUtils.isBody(this.endContainer) && !this.endOffset && + this.endContainer[this.endContainer.nodeType == 3 ? 'nodeValue' : 'childNodes'].length + ) { + this.setEndBefore(this.endContainer); + } + } + return this; + }, + + /** + * 给range选区中的内容添加给定的inline标签 + * @method applyInlineStyle + * @param { String } tagName 需要添加的标签名 + * @example + * ```html + *

    xxxx[xxxx]x

    ==> range.applyInlineStyle("strong") ==>

    xxxx[xxxx]x

    + * ``` + */ + + /** + * 给range选区中的内容添加给定的inline标签, 并且为标签附加上一些初始化属性。 + * @method applyInlineStyle + * @param { String } tagName 需要添加的标签名 + * @param { Object } attrs 跟随新添加的标签的属性 + * @return { UE.dom.Range } 当前选区 + * @example + * ```html + *

    xxxx[xxxx]x

    + * + * ==> + * + * + * range.applyInlineStyle("strong",{"style":"font-size:12px"}) + * + * ==> + * + *

    xxxx[xxxx]x

    + * ``` + */ + applyInlineStyle:function (tagName, attrs, list) { + if (this.collapsed)return this; + this.trimBoundary().enlarge(false, + function (node) { + return node.nodeType == 1 && domUtils.isBlockElm(node) + }).adjustmentBoundary(); + var bookmark = this.createBookmark(), + end = bookmark.end, + filterFn = function (node) { + return node.nodeType == 1 ? node.tagName.toLowerCase() != 'br' : !domUtils.isWhitespace(node); + }, + current = domUtils.getNextDomNode(bookmark.start, false, filterFn), + node, + pre, + range = this.cloneRange(); + while (current && (domUtils.getPosition(current, end) & domUtils.POSITION_PRECEDING)) { + if (current.nodeType == 3 || dtd[tagName][current.tagName]) { + range.setStartBefore(current); + node = current; + while (node && (node.nodeType == 3 || dtd[tagName][node.tagName]) && node !== end) { + pre = node; + node = domUtils.getNextDomNode(node, node.nodeType == 1, null, function (parent) { + return dtd[tagName][parent.tagName]; + }); + } + var frag = range.setEndAfter(pre).extractContents(), elm; + if (list && list.length > 0) { + var level, top; + top = level = list[0].cloneNode(false); + for (var i = 1, ci; ci = list[i++];) { + level.appendChild(ci.cloneNode(false)); + level = level.firstChild; + } + elm = level; + } else { + elm = range.document.createElement(tagName); + } + if (attrs) { + domUtils.setAttributes(elm, attrs); + } + elm.appendChild(frag); + range.insertNode(list ? top : elm); + //处理下滑线在a上的情况 + var aNode; + if (tagName == 'span' && attrs.style && /text\-decoration/.test(attrs.style) && (aNode = domUtils.findParentByTagName(elm, 'a', true))) { + domUtils.setAttributes(aNode, attrs); + domUtils.remove(elm, true); + elm = aNode; + } else { + domUtils.mergeSibling(elm); + domUtils.clearEmptySibling(elm); + } + //去除子节点相同的 + domUtils.mergeChild(elm, attrs); + current = domUtils.getNextDomNode(elm, false, filterFn); + domUtils.mergeToParent(elm); + if (node === end) { + break; + } + } else { + current = domUtils.getNextDomNode(current, true, filterFn); + } + } + return this.moveToBookmark(bookmark); + }, + + /** + * 移除当前选区内指定的inline标签,但保留其中的内容 + * @method removeInlineStyle + * @param { String } tagName 需要移除的标签名 + * @return { UE.dom.Range } 当前的range对象 + * @example + * ```html + * xx[xxxxyyyzz]z => range.removeInlineStyle(["em"]) => xx[xxxxyyyzz]z + * ``` + */ + + /** + * 移除当前选区内指定的一组inline标签,但保留其中的内容 + * @method removeInlineStyle + * @param { Array } tagNameArr 需要移除的标签名的数组 + * @return { UE.dom.Range } 当前的range对象 + * @see UE.dom.Range:removeInlineStyle(String) + */ + removeInlineStyle:function (tagNames) { + if (this.collapsed)return this; + tagNames = utils.isArray(tagNames) ? tagNames : [tagNames]; + this.shrinkBoundary().adjustmentBoundary(); + var start = this.startContainer, end = this.endContainer; + while (1) { + if (start.nodeType == 1) { + if (utils.indexOf(tagNames, start.tagName.toLowerCase()) > -1) { + break; + } + if (start.tagName.toLowerCase() == 'body') { + start = null; + break; + } + } + start = start.parentNode; + } + while (1) { + if (end.nodeType == 1) { + if (utils.indexOf(tagNames, end.tagName.toLowerCase()) > -1) { + break; + } + if (end.tagName.toLowerCase() == 'body') { + end = null; + break; + } + } + end = end.parentNode; + } + var bookmark = this.createBookmark(), + frag, + tmpRange; + if (start) { + tmpRange = this.cloneRange().setEndBefore(bookmark.start).setStartBefore(start); + frag = tmpRange.extractContents(); + tmpRange.insertNode(frag); + domUtils.clearEmptySibling(start, true); + start.parentNode.insertBefore(bookmark.start, start); + } + if (end) { + tmpRange = this.cloneRange().setStartAfter(bookmark.end).setEndAfter(end); + frag = tmpRange.extractContents(); + tmpRange.insertNode(frag); + domUtils.clearEmptySibling(end, false, true); + end.parentNode.insertBefore(bookmark.end, end.nextSibling); + } + var current = domUtils.getNextDomNode(bookmark.start, false, function (node) { + return node.nodeType == 1; + }), next; + while (current && current !== bookmark.end) { + next = domUtils.getNextDomNode(current, true, function (node) { + return node.nodeType == 1; + }); + if (utils.indexOf(tagNames, current.tagName.toLowerCase()) > -1) { + domUtils.remove(current, true); + } + current = next; + } + return this.moveToBookmark(bookmark); + }, + + /** + * 获取当前选中的自闭合的节点 + * @method getClosedNode + * @return { Node | NULL } 如果当前选中的是自闭合节点, 则返回该节点, 否则返回NULL + */ + getClosedNode:function () { + var node; + if (!this.collapsed) { + var range = this.cloneRange().adjustmentBoundary().shrinkBoundary(); + if (selectOneNode(range)) { + var child = range.startContainer.childNodes[range.startOffset]; + if (child && child.nodeType == 1 && (dtd.$empty[child.tagName] || dtd.$nonChild[child.tagName])) { + node = child; + } + } + } + return node; + }, + + /** + * 在页面上高亮range所表示的选区 + * @method select + * @return { UE.dom.Range } 返回当前Range对象 + */ + //这里不区分ie9以上,trace:3824 + select:browser.ie ? function (noFillData, textRange) { + var nativeRange; + if (!this.collapsed) + this.shrinkBoundary(); + var node = this.getClosedNode(); + if (node && !textRange) { + try { + nativeRange = this.document.body.createControlRange(); + nativeRange.addElement(node); + nativeRange.select(); + } catch (e) {} + return this; + } + var bookmark = this.createBookmark(), + start = bookmark.start, + end; + nativeRange = this.document.body.createTextRange(); + nativeRange.moveToElementText(start); + nativeRange.moveStart('character', 1); + if (!this.collapsed) { + var nativeRangeEnd = this.document.body.createTextRange(); + end = bookmark.end; + nativeRangeEnd.moveToElementText(end); + nativeRange.setEndPoint('EndToEnd', nativeRangeEnd); + } else { + if (!noFillData && this.startContainer.nodeType != 3) { + //使用|x固定住光标 + var tmpText = this.document.createTextNode(fillChar), + tmp = this.document.createElement('span'); + tmp.appendChild(this.document.createTextNode(fillChar)); + start.parentNode.insertBefore(tmp, start); + start.parentNode.insertBefore(tmpText, start); + //当点b,i,u时,不能清除i上边的b + removeFillData(this.document, tmpText); + fillData = tmpText; + mergeSibling(tmp, 'previousSibling'); + mergeSibling(start, 'nextSibling'); + nativeRange.moveStart('character', -1); + nativeRange.collapse(true); + } + } + this.moveToBookmark(bookmark); + tmp && domUtils.remove(tmp); + //IE在隐藏状态下不支持range操作,catch一下 + try { + nativeRange.select(); + } catch (e) { + } + return this; + } : function (notInsertFillData) { + function checkOffset(rng){ + + function check(node,offset,dir){ + if(node.nodeType == 3 && node.nodeValue.length < offset){ + rng[dir + 'Offset'] = node.nodeValue.length + } + } + check(rng.startContainer,rng.startOffset,'start'); + check(rng.endContainer,rng.endOffset,'end'); + } + var win = domUtils.getWindow(this.document), + sel = win.getSelection(), + txtNode; + //FF下关闭自动长高时滚动条在关闭dialog时会跳 + //ff下如果不body.focus将不能定位闭合光标到编辑器内 + browser.gecko ? this.document.body.focus() : win.focus(); + if (sel) { + sel.removeAllRanges(); + // trace:870 chrome/safari后边是br对于闭合得range不能定位 所以去掉了判断 + // this.startContainer.nodeType != 3 &&! ((child = this.startContainer.childNodes[this.startOffset]) && child.nodeType == 1 && child.tagName == 'BR' + if (this.collapsed && !notInsertFillData) { +// //opear如果没有节点接着,原生的不能够定位,不能在body的第一级插入空白节点 +// if (notInsertFillData && browser.opera && !domUtils.isBody(this.startContainer) && this.startContainer.nodeType == 1) { +// var tmp = this.document.createTextNode(''); +// this.insertNode(tmp).setStart(tmp, 0).collapse(true); +// } +// + //处理光标落在文本节点的情况 + //处理以下的情况 + //|xxxx + //xxxx|xxxx + //xxxx| + var start = this.startContainer,child = start; + if(start.nodeType == 1){ + child = start.childNodes[this.startOffset]; + + } + if( !(start.nodeType == 3 && this.startOffset) && + (child ? + (!child.previousSibling || child.previousSibling.nodeType != 3) + : + (!start.lastChild || start.lastChild.nodeType != 3) + ) + ){ + txtNode = this.document.createTextNode(fillChar); + //跟着前边走 + this.insertNode(txtNode); + removeFillData(this.document, txtNode); + mergeSibling(txtNode, 'previousSibling'); + mergeSibling(txtNode, 'nextSibling'); + fillData = txtNode; + this.setStart(txtNode, browser.webkit ? 1 : 0).collapse(true); + } + } + var nativeRange = this.document.createRange(); + if(this.collapsed && browser.opera && this.startContainer.nodeType == 1){ + var child = this.startContainer.childNodes[this.startOffset]; + if(!child){ + //往前靠拢 + child = this.startContainer.lastChild; + if( child && domUtils.isBr(child)){ + this.setStartBefore(child).collapse(true); + } + }else{ + //向后靠拢 + while(child && domUtils.isBlockElm(child)){ + if(child.nodeType == 1 && child.childNodes[0]){ + child = child.childNodes[0] + }else{ + break; + } + } + child && this.setStartBefore(child).collapse(true) + } + + } + //是createAddress最后一位算的不准,现在这里进行微调 + checkOffset(this); + nativeRange.setStart(this.startContainer, this.startOffset); + nativeRange.setEnd(this.endContainer, this.endOffset); + sel.addRange(nativeRange); + } + return this; + }, + + /** + * 滚动到当前range开始的位置 + * @method scrollToView + * @param { Window } win 当前range对象所属的window对象 + * @return { UE.dom.Range } 当前Range对象 + */ + + /** + * 滚动到距离当前range开始位置 offset 的位置处 + * @method scrollToView + * @param { Window } win 当前range对象所属的window对象 + * @param { Number } offset 距离range开始位置处的偏移量, 如果为正数, 则向下偏移, 反之, 则向上偏移 + * @return { UE.dom.Range } 当前Range对象 + */ + scrollToView:function (win, offset) { + win = win ? window : domUtils.getWindow(this.document); + var me = this, + span = me.document.createElement('span'); + //trace:717 + span.innerHTML = ' '; + me.cloneRange().insertNode(span); + domUtils.scrollToView(span, win, offset); + domUtils.remove(span); + return me; + }, + + /** + * 判断当前选区内容是否占位符 + * @private + * @method inFillChar + * @return { Boolean } 如果是占位符返回true,否则返回false + */ + inFillChar : function(){ + var start = this.startContainer; + if(this.collapsed && start.nodeType == 3 + && start.nodeValue.replace(new RegExp('^' + domUtils.fillChar),'').length + 1 == start.nodeValue.length + ){ + return true; + } + return false; + }, + + /** + * 保存 + * @method createAddress + * @private + * @return { Boolean } 返回开始和结束的位置 + * @example + * ```html + * + *

    + * aaaa + * + * + * bbbb + * + * + *

    + * + * + * + * ``` + */ + createAddress : function(ignoreEnd,ignoreTxt){ + var addr = {},me = this; + + function getAddress(isStart){ + var node = isStart ? me.startContainer : me.endContainer; + var parents = domUtils.findParents(node,true,function(node){return !domUtils.isBody(node)}), + addrs = []; + for(var i = 0,ci;ci = parents[i++];){ + addrs.push(domUtils.getNodeIndex(ci,ignoreTxt)); + } + var firstIndex = 0; + + if(ignoreTxt){ + if(node.nodeType == 3){ + var tmpNode = node.previousSibling; + while(tmpNode && tmpNode.nodeType == 3){ + firstIndex += tmpNode.nodeValue.replace(fillCharReg,'').length; + tmpNode = tmpNode.previousSibling; + } + firstIndex += (isStart ? me.startOffset : me.endOffset)// - (fillCharReg.test(node.nodeValue) ? 1 : 0 ) + }else{ + node = node.childNodes[ isStart ? me.startOffset : me.endOffset]; + if(node){ + firstIndex = domUtils.getNodeIndex(node,ignoreTxt); + }else{ + node = isStart ? me.startContainer : me.endContainer; + var first = node.firstChild; + while(first){ + if(domUtils.isFillChar(first)){ + first = first.nextSibling; + continue; + } + firstIndex++; + if(first.nodeType == 3){ + while( first && first.nodeType == 3){ + first = first.nextSibling; + } + }else{ + first = first.nextSibling; + } + } + } + } + + }else{ + firstIndex = isStart ? domUtils.isFillChar(node) ? 0 : me.startOffset : me.endOffset + } + if(firstIndex < 0){ + firstIndex = 0; + } + addrs.push(firstIndex); + return addrs; + } + addr.startAddress = getAddress(true); + if(!ignoreEnd){ + addr.endAddress = me.collapsed ? [].concat(addr.startAddress) : getAddress(); + } + return addr; + }, + + /** + * 保存 + * @method createAddress + * @private + * @return { Boolean } 返回开始和结束的位置 + * @example + * ```html + * + *

    + * aaaa + * + * + * bbbb + * + * + *

    + * + * + * + * ``` + */ + moveToAddress : function(addr,ignoreEnd){ + var me = this; + function getNode(address,isStart){ + var tmpNode = me.document.body, + parentNode,offset; + for(var i= 0,ci,l=address.length;i + * + * + * + * + * + * + * + * + * ``` + */ + + /** + * 遍历range内的节点。 + * 每当遍历一个节点时, 都会执行参数项 doFn 指定的函数, 该函数的接受当前遍历的节点 + * 作为其参数。 + * 可以通过参数项 filterFn 来指定一个过滤器, 只有符合该过滤器过滤规则的节点才会触 + * 发doFn函数的执行 + * @method traversal + * @param { Function } doFn 对每个遍历的节点要执行的方法, 该方法接受当前遍历的节点作为其参数 + * @param { Function } filterFn 过滤器, 该函数接受当前遍历的节点作为参数, 如果该节点满足过滤 + * 规则, 请返回true, 该节点会触发doFn, 否则, 请返回false, 则该节点不 + * 会触发doFn。 + * @return { UE.dom.Range } 当前range对象 + * @see UE.dom.Range:traversal(Function) + * @example + * ```html + * + * + * + * + * + * + * + * + * + * + * ``` + */ + traversal:function(doFn,filterFn){ + if (this.collapsed) + return this; + var bookmark = this.createBookmark(), + end = bookmark.end, + current = domUtils.getNextDomNode(bookmark.start, false, filterFn); + while (current && current !== end && (domUtils.getPosition(current, end) & domUtils.POSITION_PRECEDING)) { + var tmpNode = domUtils.getNextDomNode(current,false,filterFn); + doFn(current); + current = tmpNode; + } + return this.moveToBookmark(bookmark); + } + }; +})(); + +// core/Selection.js +/** + * 选集 + * @file + * @module UE.dom + * @class Selection + * @since 1.2.6.1 + */ + +/** + * 选区集合 + * @unfile + * @module UE.dom + * @class Selection + */ +(function () { + + function getBoundaryInformation( range, start ) { + var getIndex = domUtils.getNodeIndex; + range = range.duplicate(); + range.collapse( start ); + var parent = range.parentElement(); + //如果节点里没有子节点,直接退出 + if ( !parent.hasChildNodes() ) { + return {container:parent, offset:0}; + } + var siblings = parent.children, + child, + testRange = range.duplicate(), + startIndex = 0, endIndex = siblings.length - 1, index = -1, + distance; + while ( startIndex <= endIndex ) { + index = Math.floor( (startIndex + endIndex) / 2 ); + child = siblings[index]; + testRange.moveToElementText( child ); + var position = testRange.compareEndPoints( 'StartToStart', range ); + if ( position > 0 ) { + endIndex = index - 1; + } else if ( position < 0 ) { + startIndex = index + 1; + } else { + //trace:1043 + return {container:parent, offset:getIndex( child )}; + } + } + if ( index == -1 ) { + testRange.moveToElementText( parent ); + testRange.setEndPoint( 'StartToStart', range ); + distance = testRange.text.replace( /(\r\n|\r)/g, '\n' ).length; + siblings = parent.childNodes; + if ( !distance ) { + child = siblings[siblings.length - 1]; + return {container:child, offset:child.nodeValue.length}; + } + + var i = siblings.length; + while ( distance > 0 ){ + distance -= siblings[ --i ].nodeValue.length; + } + return {container:siblings[i], offset:-distance}; + } + testRange.collapse( position > 0 ); + testRange.setEndPoint( position > 0 ? 'StartToStart' : 'EndToStart', range ); + distance = testRange.text.replace( /(\r\n|\r)/g, '\n' ).length; + if ( !distance ) { + return dtd.$empty[child.tagName] || dtd.$nonChild[child.tagName] ? + {container:parent, offset:getIndex( child ) + (position > 0 ? 0 : 1)} : + {container:child, offset:position > 0 ? 0 : child.childNodes.length} + } + while ( distance > 0 ) { + try { + var pre = child; + child = child[position > 0 ? 'previousSibling' : 'nextSibling']; + distance -= child.nodeValue.length; + } catch ( e ) { + return {container:parent, offset:getIndex( pre )}; + } + } + return {container:child, offset:position > 0 ? -distance : child.nodeValue.length + distance} + } + + /** + * 将ieRange转换为Range对象 + * @param {Range} ieRange ieRange对象 + * @param {Range} range Range对象 + * @return {Range} range 返回转换后的Range对象 + */ + function transformIERangeToRange( ieRange, range ) { + if ( ieRange.item ) { + range.selectNode( ieRange.item( 0 ) ); + } else { + var bi = getBoundaryInformation( ieRange, true ); + range.setStart( bi.container, bi.offset ); + if ( ieRange.compareEndPoints( 'StartToEnd', ieRange ) != 0 ) { + bi = getBoundaryInformation( ieRange, false ); + range.setEnd( bi.container, bi.offset ); + } + } + return range; + } + + /** + * 获得ieRange + * @param {Selection} sel Selection对象 + * @return {ieRange} 得到ieRange + */ + function _getIERange( sel ) { + var ieRange; + //ie下有可能报错 + try { + ieRange = sel.getNative().createRange(); + } catch ( e ) { + return null; + } + var el = ieRange.item ? ieRange.item( 0 ) : ieRange.parentElement(); + if ( ( el.ownerDocument || el ) === sel.document ) { + return ieRange; + } + return null; + } + + var Selection = dom.Selection = function ( doc ) { + var me = this, iframe; + me.document = doc; + if ( browser.ie9below ) { + iframe = domUtils.getWindow( doc ).frameElement; + domUtils.on( iframe, 'beforedeactivate', function () { + me._bakIERange = me.getIERange(); + } ); + domUtils.on( iframe, 'activate', function () { + try { + if ( !_getIERange( me ) && me._bakIERange ) { + me._bakIERange.select(); + } + } catch ( ex ) { + } + me._bakIERange = null; + } ); + } + iframe = doc = null; + }; + + Selection.prototype = { + + rangeInBody : function(rng,txtRange){ + var node = browser.ie9below || txtRange ? rng.item ? rng.item() : rng.parentElement() : rng.startContainer; + + return node === this.document.body || domUtils.inDoc(node,this.document); + }, + + /** + * 获取原生seleciton对象 + * @method getNative + * @return { Object } 获得selection对象 + * @example + * ```javascript + * editor.selection.getNative(); + * ``` + */ + getNative:function () { + var doc = this.document; + try { + return !doc ? null : browser.ie9below ? doc.selection : domUtils.getWindow( doc ).getSelection(); + } catch ( e ) { + return null; + } + }, + + /** + * 获得ieRange + * @method getIERange + * @return { Object } 返回ie原生的Range + * @example + * ```javascript + * editor.selection.getIERange(); + * ``` + */ + getIERange:function () { + var ieRange = _getIERange( this ); + if ( !ieRange ) { + if ( this._bakIERange ) { + return this._bakIERange; + } + } + return ieRange; + }, + + /** + * 缓存当前选区的range和选区的开始节点 + * @method cache + */ + cache:function () { + this.clear(); + this._cachedRange = this.getRange(); + this._cachedStartElement = this.getStart(); + this._cachedStartElementPath = this.getStartElementPath(); + }, + + /** + * 获取选区开始位置的父节点到body + * @method getStartElementPath + * @return { Array } 返回父节点集合 + * @example + * ```javascript + * editor.selection.getStartElementPath(); + * ``` + */ + getStartElementPath:function () { + if ( this._cachedStartElementPath ) { + return this._cachedStartElementPath; + } + var start = this.getStart(); + if ( start ) { + return domUtils.findParents( start, true, null, true ) + } + return []; + }, + + /** + * 清空缓存 + * @method clear + */ + clear:function () { + this._cachedStartElementPath = this._cachedRange = this._cachedStartElement = null; + }, + + /** + * 编辑器是否得到了选区 + * @method isFocus + */ + isFocus:function () { + try { + if(browser.ie9below){ + + var nativeRange = _getIERange(this); + return !!(nativeRange && this.rangeInBody(nativeRange)); + }else{ + return !!this.getNative().rangeCount; + } + } catch ( e ) { + return false; + } + + }, + + /** + * 获取选区对应的Range + * @method getRange + * @return { Object } 得到Range对象 + * @example + * ```javascript + * editor.selection.getRange(); + * ``` + */ + getRange:function () { + var me = this; + function optimze( range ) { + var child = me.document.body.firstChild, + collapsed = range.collapsed; + while ( child && child.firstChild ) { + range.setStart( child, 0 ); + child = child.firstChild; + } + if ( !range.startContainer ) { + range.setStart( me.document.body, 0 ) + } + if ( collapsed ) { + range.collapse( true ); + } + } + + if ( me._cachedRange != null ) { + return this._cachedRange; + } + var range = new baidu.editor.dom.Range( me.document ); + + if ( browser.ie9below ) { + var nativeRange = me.getIERange(); + if ( nativeRange ) { + //备份的_bakIERange可能已经实效了,dom树发生了变化比如从源码模式切回来,所以try一下,实效就放到body开始位置 + try{ + transformIERangeToRange( nativeRange, range ); + }catch(e){ + optimze( range ); + } + + } else { + optimze( range ); + } + } else { + var sel = me.getNative(); + if ( sel && sel.rangeCount ) { + var firstRange = sel.getRangeAt( 0 ); + var lastRange = sel.getRangeAt( sel.rangeCount - 1 ); + range.setStart( firstRange.startContainer, firstRange.startOffset ).setEnd( lastRange.endContainer, lastRange.endOffset ); + if ( range.collapsed && domUtils.isBody( range.startContainer ) && !range.startOffset ) { + optimze( range ); + } + } else { + //trace:1734 有可能已经不在dom树上了,标识的节点 + if ( this._bakRange && domUtils.inDoc( this._bakRange.startContainer, this.document ) ){ + return this._bakRange; + } + optimze( range ); + } + } + return this._bakRange = range; + }, + + /** + * 获取开始元素,用于状态反射 + * @method getStart + * @return { Element } 获得开始元素 + * @example + * ```javascript + * editor.selection.getStart(); + * ``` + */ + getStart:function () { + if ( this._cachedStartElement ) { + return this._cachedStartElement; + } + var range = browser.ie9below ? this.getIERange() : this.getRange(), + tmpRange, + start, tmp, parent; + if ( browser.ie9below ) { + if ( !range ) { + //todo 给第一个值可能会有问题 + return this.document.body.firstChild; + } + //control元素 + if ( range.item ){ + return range.item( 0 ); + } + tmpRange = range.duplicate(); + //修正ie下x[xx] 闭合后 x|xx + tmpRange.text.length > 0 && tmpRange.moveStart( 'character', 1 ); + tmpRange.collapse( 1 ); + start = tmpRange.parentElement(); + parent = tmp = range.parentElement(); + while ( tmp = tmp.parentNode ) { + if ( tmp == start ) { + start = parent; + break; + } + } + } else { + range.shrinkBoundary(); + start = range.startContainer; + if ( start.nodeType == 1 && start.hasChildNodes() ){ + start = start.childNodes[Math.min( start.childNodes.length - 1, range.startOffset )]; + } + if ( start.nodeType == 3 ){ + return start.parentNode; + } + } + return start; + }, + + /** + * 得到选区中的文本 + * @method getText + * @return { String } 选区中包含的文本 + * @example + * ```javascript + * editor.selection.getText(); + * ``` + */ + getText:function () { + var nativeSel, nativeRange; + if ( this.isFocus() && (nativeSel = this.getNative()) ) { + nativeRange = browser.ie9below ? nativeSel.createRange() : nativeSel.getRangeAt( 0 ); + return browser.ie9below ? nativeRange.text : nativeRange.toString(); + } + return ''; + }, + + /** + * 清除选区 + * @method clearRange + * @example + * ```javascript + * editor.selection.clearRange(); + * ``` + */ + clearRange : function(){ + this.getNative()[browser.ie9below ? 'empty' : 'removeAllRanges'](); + } + }; +})(); + +// core/Editor.js +/** + * 编辑器主类,包含编辑器提供的大部分公用接口 + * @file + * @module UE + * @class Editor + * @since 1.2.6.1 + */ + +/** + * UEditor公用空间,UEditor所有的功能都挂载在该空间下 + * @unfile + * @module UE + */ + +/** + * UEditor的核心类,为用户提供与编辑器交互的接口。 + * @unfile + * @module UE + * @class Editor + */ + +(function () { + var uid = 0, _selectionChangeTimer; + + /** + * 获取编辑器的html内容,赋值到编辑器所在表单的textarea文本域里面 + * @private + * @method setValue + * @param { UE.Editor } editor 编辑器事例 + */ + function setValue(form, editor) { + var textarea; + if (editor.textarea) { + if (utils.isString(editor.textarea)) { + for (var i = 0, ti, tis = domUtils.getElementsByTagName(form, 'textarea'); ti = tis[i++];) { + if (ti.id == 'ueditor_textarea_' + editor.options.textarea) { + textarea = ti; + break; + } + } + } else { + textarea = editor.textarea; + } + } + if (!textarea) { + form.appendChild(textarea = domUtils.createElement(document, 'textarea', { + 'name': editor.options.textarea, + 'id': 'ueditor_textarea_' + editor.options.textarea, + 'style': "display:none" + })); + //不要产生多个textarea + editor.textarea = textarea; + } + !textarea.getAttribute('name') && textarea.setAttribute('name', editor.options.textarea ); + textarea.value = editor.hasContents() ? + (editor.options.allHtmlEnabled ? editor.getAllHtml() : editor.getContent(null, null, true)) : + '' + } + function loadPlugins(me){ + //初始化插件 + for (var pi in UE.plugins) { + UE.plugins[pi].call(me); + } + + } + function checkCurLang(I18N){ + for(var lang in I18N){ + return lang + } + } + + function langReadied(me){ + me.langIsReady = true; + + me.fireEvent("langReady"); + } + + /** + * 编辑器准备就绪后会触发该事件 + * @module UE + * @class Editor + * @event ready + * @remind render方法执行完成之后,会触发该事件 + * @remind + * @example + * ```javascript + * editor.addListener( 'ready', function( editor ) { + * editor.execCommand( 'focus' ); //编辑器家在完成后,让编辑器拿到焦点 + * } ); + * ``` + */ + /** + * 执行destroy方法,会触发该事件 + * @module UE + * @class Editor + * @event destroy + * @see UE.Editor:destroy() + */ + /** + * 执行reset方法,会触发该事件 + * @module UE + * @class Editor + * @event reset + * @see UE.Editor:reset() + */ + /** + * 执行focus方法,会触发该事件 + * @module UE + * @class Editor + * @event focus + * @see UE.Editor:focus(Boolean) + */ + /** + * 语言加载完成会触发该事件 + * @module UE + * @class Editor + * @event langReady + */ + /** + * 运行命令之后会触发该命令 + * @module UE + * @class Editor + * @event beforeExecCommand + */ + /** + * 运行命令之后会触发该命令 + * @module UE + * @class Editor + * @event afterExecCommand + */ + /** + * 运行命令之前会触发该命令 + * @module UE + * @class Editor + * @event firstBeforeExecCommand + */ + /** + * 在getContent方法执行之前会触发该事件 + * @module UE + * @class Editor + * @event beforeGetContent + * @see UE.Editor:getContent() + */ + /** + * 在getContent方法执行之后会触发该事件 + * @module UE + * @class Editor + * @event afterGetContent + * @see UE.Editor:getContent() + */ + /** + * 在getAllHtml方法执行时会触发该事件 + * @module UE + * @class Editor + * @event getAllHtml + * @see UE.Editor:getAllHtml() + */ + /** + * 在setContent方法执行之前会触发该事件 + * @module UE + * @class Editor + * @event beforeSetContent + * @see UE.Editor:setContent(String) + */ + /** + * 在setContent方法执行之后会触发该事件 + * @module UE + * @class Editor + * @event afterSetContent + * @see UE.Editor:setContent(String) + */ + /** + * 每当编辑器内部选区发生改变时,将触发该事件 + * @event selectionchange + * @warning 该事件的触发非常频繁,不建议在该事件的处理过程中做重量级的处理 + * @example + * ```javascript + * editor.addListener( 'selectionchange', function( editor ) { + * console.log('选区发生改变'); + * } + */ + /** + * 在所有selectionchange的监听函数执行之前,会触发该事件 + * @module UE + * @class Editor + * @event beforeSelectionChange + * @see UE.Editor:selectionchange + */ + /** + * 在所有selectionchange的监听函数执行完之后,会触发该事件 + * @module UE + * @class Editor + * @event afterSelectionChange + * @see UE.Editor:selectionchange + */ + /** + * 编辑器内容发生改变时会触发该事件 + * @module UE + * @class Editor + * @event contentChange + */ + + + /** + * 以默认参数构建一个编辑器实例 + * @constructor + * @remind 通过 改构造方法实例化的编辑器,不带ui层.需要render到一个容器,编辑器实例才能正常渲染到页面 + * @example + * ```javascript + * var editor = new UE.Editor(); + * editor.execCommand('blod'); + * ``` + * @see UE.Config + */ + + /** + * 以给定的参数集合创建一个编辑器实例,对于未指定的参数,将应用默认参数。 + * @constructor + * @remind 通过 改构造方法实例化的编辑器,不带ui层.需要render到一个容器,编辑器实例才能正常渲染到页面 + * @param { Object } setting 创建编辑器的参数 + * @example + * ```javascript + * var editor = new UE.Editor(); + * editor.execCommand('blod'); + * ``` + * @see UE.Config + */ + var Editor = UE.Editor = function (options) { + var me = this; + me.uid = uid++; + EventBase.call(me); + me.commands = {}; + me.options = utils.extend(utils.clone(options || {}), UEDITOR_CONFIG, true); + me.shortcutkeys = {}; + me.inputRules = []; + me.outputRules = []; + //设置默认的常用属性 + me.setOpt(Editor.defaultOptions(me)); + + /* 尝试异步加载后台配置 */ + // me.loadServerConfig(); + + if(!utils.isEmptyObject(UE.I18N)){ + //修改默认的语言类型 + me.options.lang = checkCurLang(UE.I18N); + UE.plugin.load(me); + langReadied(me); + + }else{ + utils.loadFile(document, { + src: me.options.langPath + me.options.lang + "/" + me.options.lang + ".js", + tag: "script", + type: "text/javascript", + defer: "defer" + }, function () { + UE.plugin.load(me); + langReadied(me); + }); + } + + UE.instants['ueditorInstant' + me.uid] = me; + }; + Editor.prototype = { + registerCommand : function(name,obj){ + this.commands[name] = obj; + }, + /** + * 编辑器对外提供的监听ready事件的接口, 通过调用该方法,达到的效果与监听ready事件是一致的 + * @method ready + * @param { Function } fn 编辑器ready之后所执行的回调, 如果在注册事件之前编辑器已经ready,将会 + * 立即触发该回调。 + * @remind 需要等待编辑器加载完成后才能执行的代码,可以使用该方法传入 + * @example + * ```javascript + * editor.ready( function( editor ) { + * editor.setContent('初始化完毕'); + * } ); + * ``` + * @see UE.Editor.event:ready + */ + ready: function (fn) { + var me = this; + if (fn) { + me.isReady ? fn.apply(me) : me.addListener('ready', fn); + } + }, + + /** + * 该方法是提供给插件里面使用,设置配置项默认值 + * @method setOpt + * @warning 三处设置配置项的优先级: 实例化时传入参数 > setOpt()设置 > config文件里设置 + * @warning 该方法仅供编辑器插件内部和编辑器初始化时调用,其他地方不能调用。 + * @param { String } key 编辑器的可接受的选项名称 + * @param { * } val 该选项可接受的值 + * @example + * ```javascript + * editor.setOpt( 'initContent', '欢迎使用编辑器' ); + * ``` + */ + + /** + * 该方法是提供给插件里面使用,以{key:value}集合的方式设置插件内用到的配置项默认值 + * @method setOpt + * @warning 三处设置配置项的优先级: 实例化时传入参数 > setOpt()设置 > config文件里设置 + * @warning 该方法仅供编辑器插件内部和编辑器初始化时调用,其他地方不能调用。 + * @param { Object } options 将要设置的选项的键值对对象 + * @example + * ```javascript + * editor.setOpt( { + * 'initContent': '欢迎使用编辑器' + * } ); + * ``` + */ + setOpt: function (key, val) { + var obj = {}; + if (utils.isString(key)) { + obj[key] = val + } else { + obj = key; + } + utils.extend(this.options, obj, true); + }, + getOpt:function(key){ + return this.options[key] + }, + /** + * 销毁编辑器实例,使用textarea代替 + * @method destroy + * @example + * ```javascript + * editor.destroy(); + * ``` + */ + destroy: function () { + + var me = this; + me.fireEvent('destroy'); + var container = me.container.parentNode; + var textarea = me.textarea; + if (!textarea) { + textarea = document.createElement('textarea'); + container.parentNode.insertBefore(textarea, container); + } else { + textarea.style.display = '' + } + + textarea.style.width = me.iframe.offsetWidth + 'px'; + textarea.style.height = me.iframe.offsetHeight + 'px'; + textarea.value = me.getContent(); + textarea.id = me.key; + container.innerHTML = ''; + domUtils.remove(container); + var key = me.key; + //trace:2004 + for (var p in me) { + if (me.hasOwnProperty(p)) { + delete this[p]; + } + } + UE.delEditor(key); + }, + + /** + * 渲染编辑器的DOM到指定容器 + * @method render + * @param { String } containerId 指定一个容器ID + * @remind 执行该方法,会触发ready事件 + * @warning 必须且只能调用一次 + */ + + /** + * 渲染编辑器的DOM到指定容器 + * @method render + * @param { Element } containerDom 直接指定容器对象 + * @remind 执行该方法,会触发ready事件 + * @warning 必须且只能调用一次 + */ + render: function (container) { + var me = this, + options = me.options, + getStyleValue=function(attr){ + return parseInt(domUtils.getComputedStyle(container,attr)); + }; + if (utils.isString(container)) { + container = document.getElementById(container); + } + if (container) { + if(options.initialFrameWidth){ + options.minFrameWidth = options.initialFrameWidth + }else{ + options.minFrameWidth = options.initialFrameWidth = container.offsetWidth; + } + if(options.initialFrameHeight){ + options.minFrameHeight = options.initialFrameHeight + }else{ + options.initialFrameHeight = options.minFrameHeight = container.offsetHeight; + } + + container.style.width = /%$/.test(options.initialFrameWidth) ? '100%' : options.initialFrameWidth- + getStyleValue("padding-left")- getStyleValue("padding-right") +'px'; + container.style.height = /%$/.test(options.initialFrameHeight) ? '100%' : options.initialFrameHeight - + getStyleValue("padding-top")- getStyleValue("padding-bottom") +'px'; + + container.style.zIndex = options.zIndex; + + var html = ( ie && browser.version < 9 ? '' : '') + + '' + + '' + + ( options.iframeCssUrl ? '' : '' ) + + (options.initialStyle ? '' : '') + + '' + + ''; + container.appendChild(domUtils.createElement(document, 'iframe', { + id: 'ueditor_' + me.uid, + width: "100%", + height: "100%", + frameborder: "0", + //先注释掉了,加的原因忘记了,但开启会直接导致全屏模式下内容多时不会出现滚动条 +// scrolling :'no', + src: 'javascript:void(function(){document.open();' + (options.customDomain && document.domain != location.hostname ? 'document.domain="' + document.domain + '";' : '') + + 'document.write("' + html + '");document.close();}())' + })); + container.style.overflow = 'hidden'; + //解决如果是给定的百分比,会导致高度算不对的问题 + setTimeout(function(){ + if( /%$/.test(options.initialFrameWidth)){ + options.minFrameWidth = options.initialFrameWidth = container.offsetWidth; + //如果这里给定宽度,会导致ie在拖动窗口大小时,编辑区域不随着变化 +// container.style.width = options.initialFrameWidth + 'px'; + } + if(/%$/.test(options.initialFrameHeight)){ + options.minFrameHeight = options.initialFrameHeight = container.offsetHeight; + container.style.height = options.initialFrameHeight + 'px'; + } + }) + } + }, + + /** + * 编辑器初始化 + * @method _setup + * @private + * @param { Element } doc 编辑器Iframe中的文档对象 + */ + _setup: function (doc) { + + var me = this, + options = me.options; + if (ie) { + doc.body.disabled = true; + doc.body.contentEditable = true; + doc.body.disabled = false; + } else { + doc.body.contentEditable = true; + } + doc.body.spellcheck = false; + me.document = doc; + me.window = doc.defaultView || doc.parentWindow; + me.iframe = me.window.frameElement; + me.body = doc.body; + me.selection = new dom.Selection(doc); + //gecko初始化就能得到range,无法判断isFocus了 + var geckoSel; + if (browser.gecko && (geckoSel = this.selection.getNative())) { + geckoSel.removeAllRanges(); + } + this._initEvents(); + //为form提交提供一个隐藏的textarea + for (var form = this.iframe.parentNode; !domUtils.isBody(form); form = form.parentNode) { + if (form.tagName == 'FORM') { + me.form = form; + if(me.options.autoSyncData){ + domUtils.on(me.window,'blur',function(){ + setValue(form,me); + }); + }else{ + domUtils.on(form, 'submit', function () { + setValue(this, me); + }); + } + break; + } + } + if (options.initialContent) { + if (options.autoClearinitialContent) { + var oldExecCommand = me.execCommand; + me.execCommand = function () { + me.fireEvent('firstBeforeExecCommand'); + return oldExecCommand.apply(me, arguments); + }; + this._setDefaultContent(options.initialContent); + } else + this.setContent(options.initialContent, false, true); + } + + //编辑器不能为空内容 + + if (domUtils.isEmptyNode(me.body)) { + me.body.innerHTML = '

    ' + (browser.ie ? '' : '
    ') + '

    '; + } + //如果要求focus, 就把光标定位到内容开始 + if (options.focus) { + setTimeout(function () { + me.focus(me.options.focusInEnd); + //如果自动清除开着,就不需要做selectionchange; + !me.options.autoClearinitialContent && me._selectionChange(); + }, 0); + } + if (!me.container) { + me.container = this.iframe.parentNode; + } + if (options.fullscreen && me.ui) { + me.ui.setFullScreen(true); + } + + try { + me.document.execCommand('2D-position', false, false); + } catch (e) { + } + try { + me.document.execCommand('enableInlineTableEditing', false, false); + } catch (e) { + } + try { + me.document.execCommand('enableObjectResizing', false, false); + } catch (e) { + } + + //挂接快捷键 + me._bindshortcutKeys(); + me.isReady = 1; + me.fireEvent('ready'); + options.onready && options.onready.call(me); + if (!browser.ie9below) { + domUtils.on(me.window, ['blur', 'focus'], function (e) { + //chrome下会出现alt+tab切换时,导致选区位置不对 + if (e.type == 'blur') { + me._bakRange = me.selection.getRange(); + try { + me._bakNativeRange = me.selection.getNative().getRangeAt(0); + me.selection.getNative().removeAllRanges(); + } catch (e) { + me._bakNativeRange = null; + } + + } else { + try { + me._bakRange && me._bakRange.select(); + } catch (e) { + } + } + }); + } + //trace:1518 ff3.6body不够寛,会导致点击空白处无法获得焦点 + if (browser.gecko && browser.version <= 10902) { + //修复ff3.6初始化进来,不能点击获得焦点 + me.body.contentEditable = false; + setTimeout(function () { + me.body.contentEditable = true; + }, 100); + setInterval(function () { + me.body.style.height = me.iframe.offsetHeight - 20 + 'px' + }, 100) + } + + !options.isShow && me.setHide(); + options.readonly && me.setDisabled(); + }, + + /** + * 同步数据到编辑器所在的form + * 从编辑器的容器节点向上查找form元素,若找到,就同步编辑内容到找到的form里,为提交数据做准备,主要用于是手动提交的情况 + * 后台取得数据的键值,使用你容器上的name属性,如果没有就使用参数里的textarea项 + * @method sync + * @example + * ```javascript + * editor.sync(); + * form.sumbit(); //form变量已经指向了form元素 + * ``` + */ + + /** + * 根据传入的formId,在页面上查找要同步数据的表单,若找到,就同步编辑内容到找到的form里,为提交数据做准备 + * 后台取得数据的键值,该键值默认使用给定的编辑器容器的name属性,如果没有name属性则使用参数项里给定的“textarea”项 + * @method sync + * @param { String } formID 指定一个要同步数据的form的id,编辑器的数据会同步到你指定form下 + */ + sync: function (formId) { + var me = this, + form = formId ? document.getElementById(formId) : + domUtils.findParent(me.iframe.parentNode, function (node) { + return node.tagName == 'FORM' + }, true); + form && setValue(form, me); + }, + + /** + * 设置编辑器高度 + * @method setHeight + * @remind 当配置项autoHeightEnabled为真时,该方法无效 + * @param { Number } number 设置的高度值,纯数值,不带单位 + * @example + * ```javascript + * editor.setHeight(number); + * ``` + */ + setHeight: function (height,notSetHeight) { + if (height !== parseInt(this.iframe.parentNode.style.height)) { + this.iframe.parentNode.style.height = height + 'px'; + } + !notSetHeight && (this.options.minFrameHeight = this.options.initialFrameHeight = height); + this.body.style.height = height + 'px'; + !notSetHeight && this.trigger('setHeight') + }, + + /** + * 为编辑器的编辑命令提供快捷键 + * 这个接口是为插件扩展提供的接口,主要是为新添加的插件,如果需要添加快捷键,所提供的接口 + * @method addshortcutkey + * @param { Object } keyset 命令名和快捷键键值对对象,多个按钮的快捷键用“+”分隔 + * @example + * ```javascript + * editor.addshortcutkey({ + * "Bold" : "ctrl+66",//^B + * "Italic" : "ctrl+73", //^I + * }); + * ``` + */ + /** + * 这个接口是为插件扩展提供的接口,主要是为新添加的插件,如果需要添加快捷键,所提供的接口 + * @method addshortcutkey + * @param { String } cmd 触发快捷键时,响应的命令 + * @param { String } keys 快捷键的字符串,多个按钮用“+”分隔 + * @example + * ```javascript + * editor.addshortcutkey("Underline", "ctrl+85"); //^U + * ``` + */ + addshortcutkey: function (cmd, keys) { + var obj = {}; + if (keys) { + obj[cmd] = keys + } else { + obj = cmd; + } + utils.extend(this.shortcutkeys, obj) + }, + + /** + * 对编辑器设置keydown事件监听,绑定快捷键和命令,当快捷键组合触发成功,会响应对应的命令 + * @method _bindshortcutKeys + * @private + */ + _bindshortcutKeys: function () { + var me = this, shortcutkeys = this.shortcutkeys; + me.addListener('keydown', function (type, e) { + var keyCode = e.keyCode || e.which; + for (var i in shortcutkeys) { + var tmp = shortcutkeys[i].split(','); + for (var t = 0, ti; ti = tmp[t++];) { + ti = ti.split(':'); + var key = ti[0], param = ti[1]; + if (/^(ctrl)(\+shift)?\+(\d+)$/.test(key.toLowerCase()) || /^(\d+)$/.test(key)) { + if (( (RegExp.$1 == 'ctrl' ? (e.ctrlKey || e.metaKey) : 0) + && (RegExp.$2 != "" ? e[RegExp.$2.slice(1) + "Key"] : 1) + && keyCode == RegExp.$3 + ) || + keyCode == RegExp.$1 + ) { + if (me.queryCommandState(i,param) != -1) + me.execCommand(i, param); + domUtils.preventDefault(e); + } + } + } + + } + }); + }, + + /** + * 获取编辑器的内容 + * @method getContent + * @warning 该方法获取到的是经过编辑器内置的过滤规则进行过滤后得到的内容 + * @return { String } 编辑器的内容字符串, 如果编辑器的内容为空,或者是空的标签内容(如:”<p><br/></p>“), 则返回空字符串 + * @example + * ```javascript + * //编辑器html内容:

    123456

    + * var content = editor.getContent(); //返回值:

    123456

    + * ``` + */ + + /** + * 获取编辑器的内容。 可以通过参数定义编辑器内置的判空规则 + * @method getContent + * @param { Function } fn 自定的判空规则, 要求该方法返回一个boolean类型的值, + * 代表当前编辑器的内容是否空, + * 如果返回true, 则该方法将直接返回空字符串;如果返回false,则编辑器将返回 + * 经过内置过滤规则处理后的内容。 + * @remind 该方法在处理包含有初始化内容的时候能起到很好的作用。 + * @warning 该方法获取到的是经过编辑器内置的过滤规则进行过滤后得到的内容 + * @return { String } 编辑器的内容字符串 + * @example + * ```javascript + * // editor 是一个编辑器的实例 + * var content = editor.getContent( function ( editor ) { + * return editor.body.innerHTML === '欢迎使用UEditor'; //返回空字符串 + * } ); + * ``` + */ + getContent: function (cmd, fn,notSetCursor,ignoreBlank,formatter) { + var me = this; + if (cmd && utils.isFunction(cmd)) { + fn = cmd; + cmd = ''; + } + if (fn ? !fn() : !this.hasContents()) { + return ''; + } + me.fireEvent('beforegetcontent'); + var root = UE.htmlparser(me.body.innerHTML,ignoreBlank); + me.filterOutputRule(root); + me.fireEvent('aftergetcontent', cmd,root); + return root.toHtml(formatter); + }, + + /** + * 取得完整的html代码,可以直接显示成完整的html文档 + * @method getAllHtml + * @return { String } 编辑器的内容html文档字符串 + * @eaxmple + * ```javascript + * editor.getAllHtml(); //返回格式大致是: ...... + * ``` + */ + getAllHtml: function () { + var me = this, + headHtml = [], + html = ''; + me.fireEvent('getAllHtml', headHtml); + if (browser.ie && browser.version > 8) { + var headHtmlForIE9 = ''; + utils.each(me.document.styleSheets, function (si) { + headHtmlForIE9 += ( si.href ? '' : ''); + }); + utils.each(me.document.getElementsByTagName('script'), function (si) { + headHtmlForIE9 += si.outerHTML; + }); + + } + return '' + (me.options.charset ? '' : '') + + (headHtmlForIE9 || me.document.getElementsByTagName('head')[0].innerHTML) + headHtml.join('\n') + '' + + '' + me.getContent(null, null, true) + ''; + }, + + /** + * 得到编辑器的纯文本内容,但会保留段落格式 + * @method getPlainTxt + * @return { String } 编辑器带段落格式的纯文本内容字符串 + * @example + * ```javascript + * //编辑器html内容:

    1

    2

    + * console.log(editor.getPlainTxt()); //输出:"1\n2\n + * ``` + */ + getPlainTxt: function () { + var reg = new RegExp(domUtils.fillChar, 'g'), + html = this.body.innerHTML.replace(/[\n\r]/g, '');//ie要先去了\n在处理 + html = html.replace(/<(p|div)[^>]*>(| )<\/\1>/gi, '\n') + .replace(//gi, '\n') + .replace(/<[^>/]+>/g, '') + .replace(/(\n)?<\/([^>]+)>/g, function (a, b, c) { + return dtd.$block[c] ? '\n' : b ? b : ''; + }); + //取出来的空格会有c2a0会变成乱码,处理这种情况\u00a0 + return html.replace(reg, '').replace(/\u00a0/g, ' ').replace(/ /g, ' '); + }, + + /** + * 获取编辑器中的纯文本内容,没有段落格式 + * @method getContentTxt + * @return { String } 编辑器不带段落格式的纯文本内容字符串 + * @example + * ```javascript + * //编辑器html内容:

    1

    2

    + * console.log(editor.getPlainTxt()); //输出:"12 + * ``` + */ + getContentTxt: function () { + var reg = new RegExp(domUtils.fillChar, 'g'); + //取出来的空格会有c2a0会变成乱码,处理这种情况\u00a0 + return this.body[browser.ie ? 'innerText' : 'textContent'].replace(reg, '').replace(/\u00a0/g, ' '); + }, + + /** + * 设置编辑器的内容,可修改编辑器当前的html内容 + * @method setContent + * @warning 通过该方法插入的内容,是经过编辑器内置的过滤规则进行过滤后得到的内容 + * @warning 该方法会触发selectionchange事件 + * @param { String } html 要插入的html内容 + * @example + * ```javascript + * editor.getContent('

    test

    '); + * ``` + */ + + /** + * 设置编辑器的内容,可修改编辑器当前的html内容 + * @method setContent + * @warning 通过该方法插入的内容,是经过编辑器内置的过滤规则进行过滤后得到的内容 + * @warning 该方法会触发selectionchange事件 + * @param { String } html 要插入的html内容 + * @param { Boolean } isAppendTo 若传入true,不清空原来的内容,在最后插入内容,否则,清空内容再插入 + * @example + * ```javascript + * //假设设置前的编辑器内容是

    old text

    + * editor.setContent('

    new text

    ', true); //插入的结果是

    old text

    new text

    + * ``` + */ + setContent: function (html, isAppendTo, notFireSelectionchange) { + var me = this; + + me.fireEvent('beforesetcontent', html); + var root = UE.htmlparser(html); + me.filterInputRule(root); + html = root.toHtml(); + + me.body.innerHTML = (isAppendTo ? me.body.innerHTML : '') + html; + + + function isCdataDiv(node){ + return node.tagName == 'DIV' && node.getAttribute('cdata_tag'); + } + //给文本或者inline节点套p标签 + if (me.options.enterTag == 'p') { + + var child = this.body.firstChild, tmpNode; + if (!child || child.nodeType == 1 && + (dtd.$cdata[child.tagName] || isCdataDiv(child) || + domUtils.isCustomeNode(child) + ) + && child === this.body.lastChild) { + this.body.innerHTML = '

    ' + (browser.ie ? ' ' : '
    ') + '

    ' + this.body.innerHTML; + + } else { + var p = me.document.createElement('p'); + while (child) { + while (child && (child.nodeType == 3 || child.nodeType == 1 && dtd.p[child.tagName] && !dtd.$cdata[child.tagName])) { + tmpNode = child.nextSibling; + p.appendChild(child); + child = tmpNode; + } + if (p.firstChild) { + if (!child) { + me.body.appendChild(p); + break; + } else { + child.parentNode.insertBefore(p, child); + p = me.document.createElement('p'); + } + } + child = child.nextSibling; + } + } + } + me.fireEvent('aftersetcontent'); + me.fireEvent('contentchange'); + + !notFireSelectionchange && me._selectionChange(); + //清除保存的选区 + me._bakRange = me._bakIERange = me._bakNativeRange = null; + //trace:1742 setContent后gecko能得到焦点问题 + var geckoSel; + if (browser.gecko && (geckoSel = this.selection.getNative())) { + geckoSel.removeAllRanges(); + } + if(me.options.autoSyncData){ + me.form && setValue(me.form,me); + } + }, + + /** + * 让编辑器获得焦点,默认focus到编辑器头部 + * @method focus + * @example + * ```javascript + * editor.focus() + * ``` + */ + + /** + * 让编辑器获得焦点,toEnd确定focus位置 + * @method focus + * @param { Boolean } toEnd 默认focus到编辑器头部,toEnd为true时focus到内容尾部 + * @example + * ```javascript + * editor.focus(true) + * ``` + */ + focus: function (toEnd) { + try { + var me = this, + rng = me.selection.getRange(); + if (toEnd) { + var node = me.body.lastChild; + if(node && node.nodeType == 1 && !dtd.$empty[node.tagName]){ + if(domUtils.isEmptyBlock(node)){ + rng.setStartAtFirst(node) + }else{ + rng.setStartAtLast(node) + } + rng.collapse(true); + } + rng.setCursor(true); + } else { + if(!rng.collapsed && domUtils.isBody(rng.startContainer) && rng.startOffset == 0){ + + var node = me.body.firstChild; + if(node && node.nodeType == 1 && !dtd.$empty[node.tagName]){ + rng.setStartAtFirst(node).collapse(true); + } + } + + rng.select(true); + + } + this.fireEvent('focus selectionchange'); + } catch (e) { + } + + }, + isFocus:function(){ + return this.selection.isFocus(); + }, + blur:function(){ + var sel = this.selection.getNative(); + if(sel.empty && browser.ie){ + var nativeRng = document.body.createTextRange(); + nativeRng.moveToElementText(document.body); + nativeRng.collapse(true); + nativeRng.select(); + sel.empty() + }else{ + sel.removeAllRanges() + } + + //this.fireEvent('blur selectionchange'); + }, + /** + * 初始化UE事件及部分事件代理 + * @method _initEvents + * @private + */ + _initEvents: function () { + var me = this, + doc = me.document, + win = me.window; + me._proxyDomEvent = utils.bind(me._proxyDomEvent, me); + domUtils.on(doc, ['click', 'contextmenu', 'mousedown', 'keydown', 'keyup', 'keypress', 'mouseup', 'mouseover', 'mouseout', 'selectstart'], me._proxyDomEvent); + domUtils.on(win, ['focus', 'blur'], me._proxyDomEvent); + domUtils.on(me.body,'drop',function(e){ + //阻止ff下默认的弹出新页面打开图片 + if(browser.gecko && e.stopPropagation) { e.stopPropagation(); } + me.fireEvent('contentchange') + }); + domUtils.on(doc, ['mouseup', 'keydown'], function (evt) { + //特殊键不触发selectionchange + if (evt.type == 'keydown' && (evt.ctrlKey || evt.metaKey || evt.shiftKey || evt.altKey)) { + return; + } + if (evt.button == 2)return; + me._selectionChange(250, evt); + }); + }, + /** + * 触发事件代理 + * @method _proxyDomEvent + * @private + * @return { * } fireEvent的返回值 + * @see UE.EventBase:fireEvent(String) + */ + _proxyDomEvent: function (evt) { + if(this.fireEvent('before' + evt.type.replace(/^on/, '').toLowerCase()) === false){ + return false; + } + if(this.fireEvent(evt.type.replace(/^on/, ''), evt) === false){ + return false; + } + return this.fireEvent('after' + evt.type.replace(/^on/, '').toLowerCase()) + }, + /** + * 变化选区 + * @method _selectionChange + * @private + */ + _selectionChange: function (delay, evt) { + var me = this; + //有光标才做selectionchange 为了解决未focus时点击source不能触发更改工具栏状态的问题(source命令notNeedUndo=1) +// if ( !me.selection.isFocus() ){ +// return; +// } + + + var hackForMouseUp = false; + var mouseX, mouseY; + if (browser.ie && browser.version < 9 && evt && evt.type == 'mouseup') { + var range = this.selection.getRange(); + if (!range.collapsed) { + hackForMouseUp = true; + mouseX = evt.clientX; + mouseY = evt.clientY; + } + } + clearTimeout(_selectionChangeTimer); + _selectionChangeTimer = setTimeout(function () { + if (!me.selection || !me.selection.getNative()) { + return; + } + //修复一个IE下的bug: 鼠标点击一段已选择的文本中间时,可能在mouseup后的一段时间内取到的range是在selection的type为None下的错误值. + //IE下如果用户是拖拽一段已选择文本,则不会触发mouseup事件,所以这里的特殊处理不会对其有影响 + var ieRange; + if (hackForMouseUp && me.selection.getNative().type == 'None') { + ieRange = me.document.body.createTextRange(); + try { + ieRange.moveToPoint(mouseX, mouseY); + } catch (ex) { + ieRange = null; + } + } + var bakGetIERange; + if (ieRange) { + bakGetIERange = me.selection.getIERange; + me.selection.getIERange = function () { + return ieRange; + }; + } + me.selection.cache(); + if (bakGetIERange) { + me.selection.getIERange = bakGetIERange; + } + if (me.selection._cachedRange && me.selection._cachedStartElement) { + me.fireEvent('beforeselectionchange'); + // 第二个参数causeByUi为true代表由用户交互造成的selectionchange. + me.fireEvent('selectionchange', !!evt); + me.fireEvent('afterselectionchange'); + me.selection.clear(); + } + }, delay || 50); + }, + + /** + * 执行编辑命令 + * @method _callCmdFn + * @private + * @param { String } fnName 函数名称 + * @param { * } args 传给命令函数的参数 + * @return { * } 返回命令函数运行的返回值 + */ + _callCmdFn: function (fnName, args) { + var cmdName = args[0].toLowerCase(), + cmd, cmdFn; + cmd = this.commands[cmdName] || UE.commands[cmdName]; + cmdFn = cmd && cmd[fnName]; + //没有querycommandstate或者没有command的都默认返回0 + if ((!cmd || !cmdFn) && fnName == 'queryCommandState') { + return 0; + } else if (cmdFn) { + return cmdFn.apply(this, args); + } + }, + + /** + * 执行编辑命令cmdName,完成富文本编辑效果 + * @method execCommand + * @param { String } cmdName 需要执行的命令 + * @remind 具体命令的使用请参考命令列表 + * @return { * } 返回命令函数运行的返回值 + * @example + * ```javascript + * editor.execCommand(cmdName); + * ``` + */ + execCommand: function (cmdName) { + cmdName = cmdName.toLowerCase(); + var me = this, + result, + cmd = me.commands[cmdName] || UE.commands[cmdName]; + if (!cmd || !cmd.execCommand) { + return null; + } + if (!cmd.notNeedUndo && !me.__hasEnterExecCommand) { + me.__hasEnterExecCommand = true; + if (me.queryCommandState.apply(me,arguments) != -1) { + me.fireEvent('saveScene'); + me.fireEvent.apply(me, ['beforeexeccommand', cmdName].concat(arguments)); + result = this._callCmdFn('execCommand', arguments); + //保存场景时,做了内容对比,再看是否进行contentchange触发,这里多触发了一次,去掉 +// (!cmd.ignoreContentChange && !me._ignoreContentChange) && me.fireEvent('contentchange'); + me.fireEvent.apply(me, ['afterexeccommand', cmdName].concat(arguments)); + me.fireEvent('saveScene'); + } + me.__hasEnterExecCommand = false; + } else { + result = this._callCmdFn('execCommand', arguments); + (!me.__hasEnterExecCommand && !cmd.ignoreContentChange && !me._ignoreContentChange) && me.fireEvent('contentchange') + } + (!me.__hasEnterExecCommand && !cmd.ignoreContentChange && !me._ignoreContentChange) && me._selectionChange(); + return result; + }, + + /** + * 根据传入的command命令,查选编辑器当前的选区,返回命令的状态 + * @method queryCommandState + * @param { String } cmdName 需要查询的命令名称 + * @remind 具体命令的使用请参考命令列表 + * @return { Number } number 返回放前命令的状态,返回值三种情况:(-1|0|1) + * @example + * ```javascript + * editor.queryCommandState(cmdName) => (-1|0|1) + * ``` + * @see COMMAND.LIST + */ + queryCommandState: function (cmdName) { + return this._callCmdFn('queryCommandState', arguments); + }, + + /** + * 根据传入的command命令,查选编辑器当前的选区,根据命令返回相关的值 + * @method queryCommandValue + * @param { String } cmdName 需要查询的命令名称 + * @remind 具体命令的使用请参考命令列表 + * @remind 只有部分插件有此方法 + * @return { * } 返回每个命令特定的当前状态值 + * @grammar editor.queryCommandValue(cmdName) => {*} + * @see COMMAND.LIST + */ + queryCommandValue: function (cmdName) { + return this._callCmdFn('queryCommandValue', arguments); + }, + + /** + * 检查编辑区域中是否有内容 + * @method hasContents + * @remind 默认有文本内容,或者有以下节点都不认为是空 + * table,ul,ol,dl,iframe,area,base,col,hr,img,embed,input,link,meta,param + * @return { Boolean } 检查有内容返回true,否则返回false + * @example + * ```javascript + * editor.hasContents() + * ``` + */ + + /** + * 检查编辑区域中是否有内容,若包含参数tags中的节点类型,直接返回true + * @method hasContents + * @param { Array } tags 传入数组判断时用到的节点类型 + * @return { Boolean } 若文档中包含tags数组里对应的tag,返回true,否则返回false + * @example + * ```javascript + * editor.hasContents(['span']); + * ``` + */ + hasContents: function (tags) { + if (tags) { + for (var i = 0, ci; ci = tags[i++];) { + if (this.document.getElementsByTagName(ci).length > 0) { + return true; + } + } + } + if (!domUtils.isEmptyBlock(this.body)) { + return true + } + //随时添加,定义的特殊标签如果存在,不能认为是空 + tags = ['div']; + for (i = 0; ci = tags[i++];) { + var nodes = domUtils.getElementsByTagName(this.document, ci); + for (var n = 0, cn; cn = nodes[n++];) { + if (domUtils.isCustomeNode(cn)) { + return true; + } + } + } + return false; + }, + + /** + * 重置编辑器,可用来做多个tab使用同一个编辑器实例 + * @method reset + * @remind 此方法会清空编辑器内容,清空回退列表,会触发reset事件 + * @example + * ```javascript + * editor.reset() + * ``` + */ + reset: function () { + this.fireEvent('reset'); + }, + + /** + * 设置当前编辑区域可以编辑 + * @method setEnabled + * @example + * ```javascript + * editor.setEnabled() + * ``` + */ + setEnabled: function () { + var me = this, range; + if (me.body.contentEditable == 'false') { + me.body.contentEditable = true; + range = me.selection.getRange(); + //有可能内容丢失了 + try { + range.moveToBookmark(me.lastBk); + delete me.lastBk + } catch (e) { + range.setStartAtFirst(me.body).collapse(true) + } + range.select(true); + if (me.bkqueryCommandState) { + me.queryCommandState = me.bkqueryCommandState; + delete me.bkqueryCommandState; + } + if (me.bkqueryCommandValue) { + me.queryCommandValue = me.bkqueryCommandValue; + delete me.bkqueryCommandValue; + } + me.fireEvent('selectionchange'); + } + }, + enable: function () { + return this.setEnabled(); + }, + + /** 设置当前编辑区域不可编辑 + * @method setDisabled + */ + + /** 设置当前编辑区域不可编辑,except中的命令除外 + * @method setDisabled + * @param { String } except 例外命令的字符串 + * @remind 即使设置了disable,此处配置的例外命令仍然可以执行 + * @example + * ```javascript + * editor.setDisabled('bold'); //禁用工具栏中除加粗之外的所有功能 + * ``` + */ + + /** 设置当前编辑区域不可编辑,except中的命令除外 + * @method setDisabled + * @param { Array } except 例外命令的字符串数组,数组中的命令仍然可以执行 + * @remind 即使设置了disable,此处配置的例外命令仍然可以执行 + * @example + * ```javascript + * editor.setDisabled(['bold','insertimage']); //禁用工具栏中除加粗和插入图片之外的所有功能 + * ``` + */ + setDisabled: function (except) { + var me = this; + except = except ? utils.isArray(except) ? except : [except] : []; + if (me.body.contentEditable == 'true') { + if (!me.lastBk) { + me.lastBk = me.selection.getRange().createBookmark(true); + } + me.body.contentEditable = false; + me.bkqueryCommandState = me.queryCommandState; + me.bkqueryCommandValue = me.queryCommandValue; + me.queryCommandState = function (type) { + if (utils.indexOf(except, type) != -1) { + return me.bkqueryCommandState.apply(me, arguments); + } + return -1; + }; + me.queryCommandValue = function (type) { + if (utils.indexOf(except, type) != -1) { + return me.bkqueryCommandValue.apply(me, arguments); + } + return null; + }; + me.fireEvent('selectionchange'); + } + }, + disable: function (except) { + return this.setDisabled(except); + }, + + /** + * 设置默认内容 + * @method _setDefaultContent + * @private + * @param { String } cont 要存入的内容 + */ + _setDefaultContent: function () { + function clear() { + var me = this; + if (me.document.getElementById('initContent')) { + me.body.innerHTML = '

    ' + (ie ? '' : '
    ') + '

    '; + me.removeListener('firstBeforeExecCommand focus', clear); + setTimeout(function () { + me.focus(); + me._selectionChange(); + }, 0) + } + } + + return function (cont) { + var me = this; + me.body.innerHTML = '

    ' + cont + '

    '; + + me.addListener('firstBeforeExecCommand focus', clear); + } + }(), + + /** + * 显示编辑器 + * @method setShow + * @example + * ```javascript + * editor.setShow() + * ``` + */ + setShow: function () { + var me = this, range = me.selection.getRange(); + if (me.container.style.display == 'none') { + //有可能内容丢失了 + try { + range.moveToBookmark(me.lastBk); + delete me.lastBk + } catch (e) { + range.setStartAtFirst(me.body).collapse(true) + } + //ie下focus实效,所以做了个延迟 + setTimeout(function () { + range.select(true); + }, 100); + me.container.style.display = ''; + } + + }, + show: function () { + return this.setShow(); + }, + /** + * 隐藏编辑器 + * @method setHide + * @example + * ```javascript + * editor.setHide() + * ``` + */ + setHide: function () { + var me = this; + if (!me.lastBk) { + me.lastBk = me.selection.getRange().createBookmark(true); + } + me.container.style.display = 'none' + }, + hide: function () { + return this.setHide(); + }, + + /** + * 根据指定的路径,获取对应的语言资源 + * @method getLang + * @param { String } path 路径根据的是lang目录下的语言文件的路径结构 + * @return { Object | String } 根据路径返回语言资源的Json格式对象或者语言字符串 + * @example + * ```javascript + * editor.getLang('contextMenu.delete'); //如果当前是中文,那返回是的是'删除' + * ``` + */ + getLang: function (path) { + // HaoChuan9421 + if(!this.options){ + return ''; + } + var lang = UE.I18N[this.options.lang]; + if (!lang) { + throw Error("not import language file"); + } + path = (path || "").split("."); + for (var i = 0, ci; ci = path[i++];) { + lang = lang[ci]; + if (!lang)break; + } + return lang; + }, + + /** + * 计算编辑器html内容字符串的长度 + * @method getContentLength + * @return { Number } 返回计算的长度 + * @example + * ```javascript + * //编辑器html内容

    132

    + * editor.getContentLength() //返回27 + * ``` + */ + /** + * 计算编辑器当前纯文本内容的长度 + * @method getContentLength + * @param { Boolean } ingoneHtml 传入true时,只按照纯文本来计算 + * @return { Number } 返回计算的长度,内容中有hr/img/iframe标签,长度加1 + * @example + * ```javascript + * //编辑器html内容

    132

    + * editor.getContentLength() //返回3 + * ``` + */ + getContentLength: function (ingoneHtml, tagNames) { + var count = this.getContent(false,false,true).length; + if (ingoneHtml) { + tagNames = (tagNames || []).concat([ 'hr', 'img', 'iframe']); + count = this.getContentTxt().replace(/[\t\r\n]+/g, '').length; + for (var i = 0, ci; ci = tagNames[i++];) { + count += this.document.getElementsByTagName(ci).length; + } + } + return count; + }, + + /** + * 注册输入过滤规则 + * @method addInputRule + * @param { Function } rule 要添加的过滤规则 + * @example + * ```javascript + * editor.addInputRule(function(root){ + * $.each(root.getNodesByTagName('div'),function(i,node){ + * node.tagName="p"; + * }); + * }); + * ``` + */ + addInputRule: function (rule) { + this.inputRules.push(rule); + }, + + /** + * 执行注册的过滤规则 + * @method filterInputRule + * @param { UE.uNode } root 要过滤的uNode节点 + * @remind 执行editor.setContent方法和执行'inserthtml'命令后,会运行该过滤函数 + * @example + * ```javascript + * editor.filterInputRule(editor.body); + * ``` + * @see UE.Editor:addInputRule + */ + filterInputRule: function (root) { + for (var i = 0, ci; ci = this.inputRules[i++];) { + ci.call(this, root) + } + }, + + /** + * 注册输出过滤规则 + * @method addOutputRule + * @param { Function } rule 要添加的过滤规则 + * @example + * ```javascript + * editor.addOutputRule(function(root){ + * $.each(root.getNodesByTagName('p'),function(i,node){ + * node.tagName="div"; + * }); + * }); + * ``` + */ + addOutputRule: function (rule) { + this.outputRules.push(rule) + }, + + /** + * 根据输出过滤规则,过滤编辑器内容 + * @method filterOutputRule + * @remind 执行editor.getContent方法的时候,会先运行该过滤函数 + * @param { UE.uNode } root 要过滤的uNode节点 + * @example + * ```javascript + * editor.filterOutputRule(editor.body); + * ``` + * @see UE.Editor:addOutputRule + */ + filterOutputRule: function (root) { + for (var i = 0, ci; ci = this.outputRules[i++];) { + ci.call(this, root) + } + }, + + /** + * 根据action名称获取请求的路径 + * @method getActionUrl + * @remind 假如没有设置serverUrl,会根据imageUrl设置默认的controller路径 + * @param { String } action action名称 + * @example + * ```javascript + * editor.getActionUrl('config'); //返回 "/ueditor/php/controller.php?action=config" + * editor.getActionUrl('image'); //返回 "/ueditor/php/controller.php?action=uplaodimage" + * editor.getActionUrl('scrawl'); //返回 "/ueditor/php/controller.php?action=uplaodscrawl" + * editor.getActionUrl('imageManager'); //返回 "/ueditor/php/controller.php?action=listimage" + * ``` + */ + getActionUrl: function(action){ + var actionName = this.getOpt(action) || action, + imageUrl = this.getOpt('imageUrl'), + serverUrl = this.getOpt('serverUrl'); + + if(!serverUrl && imageUrl) { + serverUrl = imageUrl.replace(/^(.*[\/]).+([\.].+)$/, '$1controller$2'); + } + + if(serverUrl) { + serverUrl = serverUrl + (serverUrl.indexOf('?') == -1 ? '?':'&') + 'action=' + (actionName || ''); + return utils.formatUrl(serverUrl); + } else { + return ''; + } + } + }; + utils.inherits(Editor, EventBase); +})(); + + +// core/Editor.defaultoptions.js +//维护编辑器一下默认的不在插件中的配置项 +UE.Editor.defaultOptions = function(editor){ + + var _url = editor.options.UEDITOR_HOME_URL; + return { + isShow: true, + initialContent: '', + initialStyle:'', + autoClearinitialContent: false, + iframeCssUrl: _url + 'themes/iframe.css', + textarea: 'editorValue', + focus: false, + focusInEnd: true, + autoClearEmptyNode: true, + fullscreen: false, + readonly: false, + zIndex: 999, + imagePopup: true, + enterTag: 'p', + customDomain: false, + lang: 'zh-cn', + langPath: _url + 'lang/', + theme: 'default', + themePath: _url + 'themes/', + allHtmlEnabled: false, + scaleEnabled: false, + tableNativeEditInFF: false, + autoSyncData : true, + fileNameFormat: '{time}{rand:6}' + } +}; + +// core/loadconfig.js +(function(){ + + UE.Editor.prototype.loadServerConfig = function(){ + var me = this; + setTimeout(function(){ + try{ + me.options.imageUrl && me.setOpt('serverUrl', me.options.imageUrl.replace(/^(.*[\/]).+([\.].+)$/, '$1controller$2')); + + var configUrl = me.getActionUrl('config'), + isJsonp = utils.isCrossDomainUrl(configUrl); + + /* 发出ajax请求 */ + me._serverConfigLoaded = false; + + configUrl && UE.ajax.request(configUrl,{ + 'method': 'GET', + 'dataType': isJsonp ? 'jsonp':'', + 'onsuccess':function(r){ + try { + var config = isJsonp ? r:eval("("+r.responseText+")"); + utils.extend(me.options, config); + me.fireEvent('serverConfigLoaded'); + me._serverConfigLoaded = true; + } catch (e) { + showErrorMsg(me.getLang('loadconfigFormatError')); + } + }, + 'onerror':function(){ + showErrorMsg(me.getLang('loadconfigHttpError')); + } + }); + } catch(e){ + showErrorMsg(me.getLang('loadconfigError')); + } + }); + + function showErrorMsg(msg) { + console && console.error(msg); + //me.fireEvent('showMessage', { + // 'title': msg, + // 'type': 'error' + //}); + } + }; + + UE.Editor.prototype.isServerConfigLoaded = function(){ + var me = this; + return me._serverConfigLoaded || false; + }; + + UE.Editor.prototype.afterConfigReady = function(handler){ + if (!handler || !utils.isFunction(handler)) return; + var me = this; + var readyHandler = function(){ + handler.apply(me, arguments); + me.removeListener('serverConfigLoaded', readyHandler); + }; + + if (me.isServerConfigLoaded()) { + handler.call(me, 'serverConfigLoaded'); + } else { + me.addListener('serverConfigLoaded', readyHandler); + } + }; + +})(); + + +// core/ajax.js +/** + * @file + * @module UE.ajax + * @since 1.2.6.1 + */ + +/** + * 提供对ajax请求的支持 + * @module UE.ajax + */ +UE.ajax = function() { + + //创建一个ajaxRequest对象 + var fnStr = 'XMLHttpRequest()'; + try { + new ActiveXObject("Msxml2.XMLHTTP"); + fnStr = 'ActiveXObject(\'Msxml2.XMLHTTP\')'; + } catch (e) { + try { + new ActiveXObject("Microsoft.XMLHTTP"); + fnStr = 'ActiveXObject(\'Microsoft.XMLHTTP\')' + } catch (e) { + } + } + var creatAjaxRequest = new Function('return new ' + fnStr); + + + /** + * 将json参数转化成适合ajax提交的参数列表 + * @param json + */ + function json2str(json) { + var strArr = []; + for (var i in json) { + //忽略默认的几个参数 + if(i=="method" || i=="timeout" || i=="async" || i=="dataType" || i=="callback") continue; + //忽略控制 + if(json[i] == undefined || json[i] == null) continue; + //传递过来的对象和函数不在提交之列 + if (!((typeof json[i]).toLowerCase() == "function" || (typeof json[i]).toLowerCase() == "object")) { + strArr.push( encodeURIComponent(i) + "="+encodeURIComponent(json[i]) ); + } else if (utils.isArray(json[i])) { + //支持传数组内容 + for(var j = 0; j < json[i].length; j++) { + strArr.push( encodeURIComponent(i) + "[]="+encodeURIComponent(json[i][j]) ); + } + } + } + return strArr.join("&"); + } + + function doAjax(url, ajaxOptions) { + var xhr = creatAjaxRequest(), + //是否超时 + timeIsOut = false, + //默认参数 + defaultAjaxOptions = { + method:"POST", + timeout:5000, + async:true, + data:{},//需要传递对象的话只能覆盖 + onsuccess:function() { + }, + onerror:function() { + } + }; + + if (typeof url === "object") { + ajaxOptions = url; + url = ajaxOptions.url; + } + if (!xhr || !url) return; + var ajaxOpts = ajaxOptions ? utils.extend(defaultAjaxOptions,ajaxOptions) : defaultAjaxOptions; + + var submitStr = json2str(ajaxOpts); // { name:"Jim",city:"Beijing" } --> "name=Jim&city=Beijing" + //如果用户直接通过data参数传递json对象过来,则也要将此json对象转化为字符串 + if (!utils.isEmptyObject(ajaxOpts.data)){ + submitStr += (submitStr? "&":"") + json2str(ajaxOpts.data); + } + //超时检测 + var timerID = setTimeout(function() { + if (xhr.readyState != 4) { + timeIsOut = true; + xhr.abort(); + clearTimeout(timerID); + } + }, ajaxOpts.timeout); + + var method = ajaxOpts.method.toUpperCase(); + var str = url + (url.indexOf("?")==-1?"?":"&") + (method=="POST"?"":submitStr+ "&noCache=" + +new Date); + xhr.open(method, str, ajaxOpts.async); + xhr.onreadystatechange = function() { + if (xhr.readyState == 4) { + if (!timeIsOut && xhr.status == 200) { + ajaxOpts.onsuccess(xhr); + } else { + ajaxOpts.onerror(xhr); + } + } + }; + if (method == "POST") { + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + xhr.send(submitStr); + } else { + xhr.send(null); + } + } + + function doJsonp(url, opts) { + + var successhandler = opts.onsuccess || function(){}, + scr = document.createElement('SCRIPT'), + options = opts || {}, + charset = options['charset'], + callbackField = options['jsonp'] || 'callback', + callbackFnName, + timeOut = options['timeOut'] || 0, + timer, + reg = new RegExp('(\\?|&)' + callbackField + '=([^&]*)'), + matches; + + if (utils.isFunction(successhandler)) { + callbackFnName = 'bd__editor__' + Math.floor(Math.random() * 2147483648).toString(36); + window[callbackFnName] = getCallBack(0); + } else if(utils.isString(successhandler)){ + callbackFnName = successhandler; + } else { + if (matches = reg.exec(url)) { + callbackFnName = matches[2]; + } + } + + url = url.replace(reg, '\x241' + callbackField + '=' + callbackFnName); + + if (url.search(reg) < 0) { + url += (url.indexOf('?') < 0 ? '?' : '&') + callbackField + '=' + callbackFnName; + } + + var queryStr = json2str(opts); // { name:"Jim",city:"Beijing" } --> "name=Jim&city=Beijing" + //如果用户直接通过data参数传递json对象过来,则也要将此json对象转化为字符串 + if (!utils.isEmptyObject(opts.data)){ + queryStr += (queryStr? "&":"") + json2str(opts.data); + } + if (queryStr) { + url = url.replace(/\?/, '?' + queryStr + '&'); + } + + scr.onerror = getCallBack(1); + if( timeOut ){ + timer = setTimeout(getCallBack(1), timeOut); + } + createScriptTag(scr, url, charset); + + function createScriptTag(scr, url, charset) { + scr.setAttribute('type', 'text/javascript'); + scr.setAttribute('defer', 'defer'); + charset && scr.setAttribute('charset', charset); + scr.setAttribute('src', url); + document.getElementsByTagName('head')[0].appendChild(scr); + } + + function getCallBack(onTimeOut){ + return function(){ + try { + if(onTimeOut){ + options.onerror && options.onerror(); + }else{ + try{ + clearTimeout(timer); + successhandler.apply(window, arguments); + } catch (e){} + } + } catch (exception) { + options.onerror && options.onerror.call(window, exception); + } finally { + options.oncomplete && options.oncomplete.apply(window, arguments); + scr.parentNode && scr.parentNode.removeChild(scr); + window[callbackFnName] = null; + try { + delete window[callbackFnName]; + }catch(e){} + } + } + } + } + + return { + /** + * 根据给定的参数项,向指定的url发起一个ajax请求。 ajax请求完成后,会根据请求结果调用相应回调: 如果请求 + * 成功, 则调用onsuccess回调, 失败则调用 onerror 回调 + * @method request + * @param { URLString } url ajax请求的url地址 + * @param { Object } ajaxOptions ajax请求选项的键值对,支持的选项如下: + * @example + * ```javascript + * //向sayhello.php发起一个异步的Ajax GET请求, 请求超时时间为10s, 请求完成后执行相应的回调。 + * UE.ajax.requeset( 'sayhello.php', { + * + * //请求方法。可选值: 'GET', 'POST',默认值是'POST' + * method: 'GET', + * + * //超时时间。 默认为5000, 单位是ms + * timeout: 10000, + * + * //是否是异步请求。 true为异步请求, false为同步请求 + * async: true, + * + * //请求携带的数据。如果请求为GET请求, data会经过stringify后附加到请求url之后。 + * data: { + * name: 'ueditor' + * }, + * + * //请求成功后的回调, 该回调接受当前的XMLHttpRequest对象作为参数。 + * onsuccess: function ( xhr ) { + * console.log( xhr.responseText ); + * }, + * + * //请求失败或者超时后的回调。 + * onerror: function ( xhr ) { + * alert( 'Ajax请求失败' ); + * } + * + * } ); + * ``` + */ + + /** + * 根据给定的参数项发起一个ajax请求, 参数项里必须包含一个url地址。 ajax请求完成后,会根据请求结果调用相应回调: 如果请求 + * 成功, 则调用onsuccess回调, 失败则调用 onerror 回调。 + * @method request + * @warning 如果在参数项里未提供一个key为“url”的地址值,则该请求将直接退出。 + * @param { Object } ajaxOptions ajax请求选项的键值对,支持的选项如下: + * @example + * ```javascript + * + * //向sayhello.php发起一个异步的Ajax POST请求, 请求超时时间为5s, 请求完成后不执行任何回调。 + * UE.ajax.requeset( 'sayhello.php', { + * + * //请求的地址, 该项是必须的。 + * url: 'sayhello.php' + * + * } ); + * ``` + */ + request:function(url, opts) { + if (opts && opts.dataType == 'jsonp') { + doJsonp(url, opts); + } else { + doAjax(url, opts); + } + }, + getJSONP:function(url, data, fn) { + var opts = { + 'data': data, + 'oncomplete': fn + }; + doJsonp(url, opts); + } + }; + + +}(); + + +// core/filterword.js +/** + * UE过滤word的静态方法 + * @file + */ + +/** + * UEditor公用空间,UEditor所有的功能都挂载在该空间下 + * @module UE + */ + + +/** + * 根据传入html字符串过滤word + * @module UE + * @since 1.2.6.1 + * @method filterWord + * @param { String } html html字符串 + * @return { String } 已过滤后的结果字符串 + * @example + * ```javascript + * UE.filterWord(html); + * ``` + */ +var filterWord = UE.filterWord = function () { + + //是否是word过来的内容 + function isWordDocument( str ) { + return /(class="?Mso|style="[^"]*\bmso\-|w:WordDocument|<(v|o):|lang=)/ig.test( str ); + } + //去掉小数 + function transUnit( v ) { + v = v.replace( /[\d.]+\w+/g, function ( m ) { + return utils.transUnitToPx(m); + } ); + return v; + } + + function filterPasteWord( str ) { + return str.replace(/[\t\r\n]+/g,' ') + .replace( //ig, "" ) + //转换图片 + .replace(/]*>[\s\S]*?.<\/v:shape>/gi,function(str){ + //opera能自己解析出image所这里直接返回空 + if(browser.opera){ + return ''; + } + try{ + //有可能是bitmap占为图,无用,直接过滤掉,主要体现在粘贴excel表格中 + if(/Bitmap/i.test(str)){ + return ''; + } + var width = str.match(/width:([ \d.]*p[tx])/i)[1], + height = str.match(/height:([ \d.]*p[tx])/i)[1], + src = str.match(/src=\s*"([^"]*)"/i)[1]; + return ''; + } catch(e){ + return ''; + } + }) + //针对wps添加的多余标签处理 + .replace(/<\/?div[^>]*>/g,'') + //去掉多余的属性 + .replace( /v:\w+=(["']?)[^'"]+\1/g, '' ) + .replace( /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|xml|meta|link|style|\w+:\w+)(?=[\s\/>]))[^>]*>/gi, "" ) + .replace( /

    ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "

    $1

    " ) + //去掉多余的属性 + .replace( /\s+(class|lang|align)\s*=\s*(['"]?)([\w-]+)\2/ig, function(str,name,marks,val){ + //保留list的标示 + return name == 'class' && val == 'MsoListParagraph' ? str : '' + }) + //清除多余的font/span不能匹配 有可能是空格 + .replace( /<(font|span)[^>]*>(\s*)<\/\1>/gi, function(a,b,c){ + return c.replace(/[\t\r\n ]+/g,' ') + }) + //处理style的问题 + .replace( /(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi, function( str, tag, tmp, style ) { + var n = [], + s = style.replace( /^\s+|\s+$/, '' ) + .replace(/'/g,'\'') + .replace( /"/gi, "'" ) + .replace(/[\d.]+(cm|pt)/g,function(str){ + return utils.transUnitToPx(str) + }) + .split( /;\s*/g ); + + for ( var i = 0,v; v = s[i];i++ ) { + + var name, value, + parts = v.split( ":" ); + + if ( parts.length == 2 ) { + name = parts[0].toLowerCase(); + value = parts[1].toLowerCase(); + if(/^(background)\w*/.test(name) && value.replace(/(initial|\s)/g,'').length == 0 + || + /^(margin)\w*/.test(name) && /^0\w+$/.test(value) + ){ + continue; + } + + switch ( name ) { + case "mso-padding-alt": + case "mso-padding-top-alt": + case "mso-padding-right-alt": + case "mso-padding-bottom-alt": + case "mso-padding-left-alt": + case "mso-margin-alt": + case "mso-margin-top-alt": + case "mso-margin-right-alt": + case "mso-margin-bottom-alt": + case "mso-margin-left-alt": + //ie下会出现挤到一起的情况 + //case "mso-table-layout-alt": + case "mso-height": + case "mso-width": + case "mso-vertical-align-alt": + //trace:1819 ff下会解析出padding在table上 + if(!/]/.test(html)) { + return UE.htmlparser(html).children[0] + } else { + return new uNode({ + type:'element', + children:[], + tagName:html + }) + } + }; + uNode.createText = function (data,noTrans) { + return new UE.uNode({ + type:'text', + 'data':noTrans ? data : utils.unhtml(data || '') + }) + }; + function nodeToHtml(node, arr, formatter, current) { + switch (node.type) { + case 'root': + for (var i = 0, ci; ci = node.children[i++];) { + //插入新行 + if (formatter && ci.type == 'element' && !dtd.$inlineWithA[ci.tagName] && i > 1) { + insertLine(arr, current, true); + insertIndent(arr, current) + } + nodeToHtml(ci, arr, formatter, current) + } + break; + case 'text': + isText(node, arr); + break; + case 'element': + isElement(node, arr, formatter, current); + break; + case 'comment': + isComment(node, arr, formatter); + } + return arr; + } + + function isText(node, arr) { + if(node.parentNode.tagName == 'pre'){ + //源码模式下输入html标签,不能做转换处理,直接输出 + arr.push(node.data) + }else{ + arr.push(notTransTagName[node.parentNode.tagName] ? utils.html(node.data) : node.data.replace(/[ ]{2}/g,'  ')) + } + + } + + function isElement(node, arr, formatter, current) { + var attrhtml = ''; + if (node.attrs) { + attrhtml = []; + var attrs = node.attrs; + for (var a in attrs) { + //这里就针对 + //

    '

    + //这里边的\"做转换,要不用innerHTML直接被截断了,属性src + //有可能做的不够 + attrhtml.push(a + (attrs[a] !== undefined ? '="' + (notTransAttrs[a] ? utils.html(attrs[a]).replace(/["]/g, function (a) { + return '"' + }) : utils.unhtml(attrs[a])) + '"' : '')) + } + attrhtml = attrhtml.join(' '); + } + arr.push('<' + node.tagName + + (attrhtml ? ' ' + attrhtml : '') + + (dtd.$empty[node.tagName] ? '\/' : '' ) + '>' + ); + //插入新行 + if (formatter && !dtd.$inlineWithA[node.tagName] && node.tagName != 'pre') { + if(node.children && node.children.length){ + current = insertLine(arr, current, true); + insertIndent(arr, current) + } + + } + if (node.children && node.children.length) { + for (var i = 0, ci; ci = node.children[i++];) { + if (formatter && ci.type == 'element' && !dtd.$inlineWithA[ci.tagName] && i > 1) { + insertLine(arr, current); + insertIndent(arr, current) + } + nodeToHtml(ci, arr, formatter, current) + } + } + if (!dtd.$empty[node.tagName]) { + if (formatter && !dtd.$inlineWithA[node.tagName] && node.tagName != 'pre') { + + if(node.children && node.children.length){ + current = insertLine(arr, current); + insertIndent(arr, current) + } + } + arr.push('<\/' + node.tagName + '>'); + } + + } + + function isComment(node, arr) { + arr.push(''); + } + + function getNodeById(root, id) { + var node; + if (root.type == 'element' && root.getAttr('id') == id) { + return root; + } + if (root.children && root.children.length) { + for (var i = 0, ci; ci = root.children[i++];) { + if (node = getNodeById(ci, id)) { + return node; + } + } + } + } + + function getNodesByTagName(node, tagName, arr) { + if (node.type == 'element' && node.tagName == tagName) { + arr.push(node); + } + if (node.children && node.children.length) { + for (var i = 0, ci; ci = node.children[i++];) { + getNodesByTagName(ci, tagName, arr) + } + } + } + function nodeTraversal(root,fn){ + if(root.children && root.children.length){ + for(var i= 0,ci;ci=root.children[i];){ + nodeTraversal(ci,fn); + //ci被替换的情况,这里就不再走 fn了 + if(ci.parentNode ){ + if(ci.children && ci.children.length){ + fn(ci) + } + if(ci.parentNode) i++ + } + } + }else{ + fn(root) + } + + } + uNode.prototype = { + + /** + * 当前节点对象,转换成html文本 + * @method toHtml + * @return { String } 返回转换后的html字符串 + * @example + * ```javascript + * node.toHtml(); + * ``` + */ + + /** + * 当前节点对象,转换成html文本 + * @method toHtml + * @param { Boolean } formatter 是否格式化返回值 + * @return { String } 返回转换后的html字符串 + * @example + * ```javascript + * node.toHtml( true ); + * ``` + */ + toHtml:function (formatter) { + var arr = []; + nodeToHtml(this, arr, formatter, 0); + return arr.join('') + }, + + /** + * 获取节点的html内容 + * @method innerHTML + * @warning 假如节点的type不是'element',或节点的标签名称不在dtd列表里,直接返回当前节点 + * @return { String } 返回节点的html内容 + * @example + * ```javascript + * var htmlstr = node.innerHTML(); + * ``` + */ + + /** + * 设置节点的html内容 + * @method innerHTML + * @warning 假如节点的type不是'element',或节点的标签名称不在dtd列表里,直接返回当前节点 + * @param { String } htmlstr 传入要设置的html内容 + * @return { UE.uNode } 返回节点本身 + * @example + * ```javascript + * node.innerHTML('text'); + * ``` + */ + innerHTML:function (htmlstr) { + if (this.type != 'element' || dtd.$empty[this.tagName]) { + return this; + } + if (utils.isString(htmlstr)) { + if(this.children){ + for (var i = 0, ci; ci = this.children[i++];) { + ci.parentNode = null; + } + } + this.children = []; + var tmpRoot = UE.htmlparser(htmlstr); + for (var i = 0, ci; ci = tmpRoot.children[i++];) { + this.children.push(ci); + ci.parentNode = this; + } + return this; + } else { + var tmpRoot = new UE.uNode({ + type:'root', + children:this.children + }); + return tmpRoot.toHtml(); + } + }, + + /** + * 获取节点的纯文本内容 + * @method innerText + * @warning 假如节点的type不是'element',或节点的标签名称不在dtd列表里,直接返回当前节点 + * @return { String } 返回节点的存文本内容 + * @example + * ```javascript + * var textStr = node.innerText(); + * ``` + */ + + /** + * 设置节点的纯文本内容 + * @method innerText + * @warning 假如节点的type不是'element',或节点的标签名称不在dtd列表里,直接返回当前节点 + * @param { String } textStr 传入要设置的文本内容 + * @return { UE.uNode } 返回节点本身 + * @example + * ```javascript + * node.innerText('text'); + * ``` + */ + innerText:function (textStr,noTrans) { + if (this.type != 'element' || dtd.$empty[this.tagName]) { + return this; + } + if (textStr) { + if(this.children){ + for (var i = 0, ci; ci = this.children[i++];) { + ci.parentNode = null; + } + } + this.children = []; + this.appendChild(uNode.createText(textStr,noTrans)); + return this; + } else { + return this.toHtml().replace(/<[^>]+>/g, ''); + } + }, + + /** + * 获取当前对象的data属性 + * @method getData + * @return { Object } 若节点的type值是elemenet,返回空字符串,否则返回节点的data属性 + * @example + * ```javascript + * node.getData(); + * ``` + */ + getData:function () { + if (this.type == 'element') + return ''; + return this.data + }, + + /** + * 获取当前节点下的第一个子节点 + * @method firstChild + * @return { UE.uNode } 返回第一个子节点 + * @example + * ```javascript + * node.firstChild(); //返回第一个子节点 + * ``` + */ + firstChild:function () { +// if (this.type != 'element' || dtd.$empty[this.tagName]) { +// return this; +// } + return this.children ? this.children[0] : null; + }, + + /** + * 获取当前节点下的最后一个子节点 + * @method lastChild + * @return { UE.uNode } 返回最后一个子节点 + * @example + * ```javascript + * node.lastChild(); //返回最后一个子节点 + * ``` + */ + lastChild:function () { +// if (this.type != 'element' || dtd.$empty[this.tagName] ) { +// return this; +// } + return this.children ? this.children[this.children.length - 1] : null; + }, + + /** + * 获取和当前节点有相同父亲节点的前一个节点 + * @method previousSibling + * @return { UE.uNode } 返回前一个节点 + * @example + * ```javascript + * node.children[2].previousSibling(); //返回子节点node.children[1] + * ``` + */ + previousSibling : function(){ + var parent = this.parentNode; + for (var i = 0, ci; ci = parent.children[i]; i++) { + if (ci === this) { + return i == 0 ? null : parent.children[i-1]; + } + } + + }, + + /** + * 获取和当前节点有相同父亲节点的后一个节点 + * @method nextSibling + * @return { UE.uNode } 返回后一个节点,找不到返回null + * @example + * ```javascript + * node.children[2].nextSibling(); //如果有,返回子节点node.children[3] + * ``` + */ + nextSibling : function(){ + var parent = this.parentNode; + for (var i = 0, ci; ci = parent.children[i++];) { + if (ci === this) { + return parent.children[i]; + } + } + }, + + /** + * 用新的节点替换当前节点 + * @method replaceChild + * @param { UE.uNode } target 要替换成该节点参数 + * @param { UE.uNode } source 要被替换掉的节点 + * @return { UE.uNode } 返回替换之后的节点对象 + * @example + * ```javascript + * node.replaceChild(newNode, childNode); //用newNode替换childNode,childNode是node的子节点 + * ``` + */ + replaceChild:function (target, source) { + if (this.children) { + if(target.parentNode){ + target.parentNode.removeChild(target); + } + for (var i = 0, ci; ci = this.children[i]; i++) { + if (ci === source) { + this.children.splice(i, 1, target); + source.parentNode = null; + target.parentNode = this; + return target; + } + } + } + }, + + /** + * 在节点的子节点列表最后位置插入一个节点 + * @method appendChild + * @param { UE.uNode } node 要插入的节点 + * @return { UE.uNode } 返回刚插入的子节点 + * @example + * ```javascript + * node.appendChild( newNode ); //在node内插入子节点newNode + * ``` + */ + appendChild:function (node) { + if (this.type == 'root' || (this.type == 'element' && !dtd.$empty[this.tagName])) { + if (!this.children) { + this.children = [] + } + if(node.parentNode){ + node.parentNode.removeChild(node); + } + for (var i = 0, ci; ci = this.children[i]; i++) { + if (ci === node) { + this.children.splice(i, 1); + break; + } + } + this.children.push(node); + node.parentNode = this; + return node; + } + + + }, + + /** + * 在传入节点的前面插入一个节点 + * @method insertBefore + * @param { UE.uNode } target 要插入的节点 + * @param { UE.uNode } source 在该参数节点前面插入 + * @return { UE.uNode } 返回刚插入的子节点 + * @example + * ```javascript + * node.parentNode.insertBefore(newNode, node); //在node节点后面插入newNode + * ``` + */ + insertBefore:function (target, source) { + if (this.children) { + if(target.parentNode){ + target.parentNode.removeChild(target); + } + for (var i = 0, ci; ci = this.children[i]; i++) { + if (ci === source) { + this.children.splice(i, 0, target); + target.parentNode = this; + return target; + } + } + + } + }, + + /** + * 在传入节点的后面插入一个节点 + * @method insertAfter + * @param { UE.uNode } target 要插入的节点 + * @param { UE.uNode } source 在该参数节点后面插入 + * @return { UE.uNode } 返回刚插入的子节点 + * @example + * ```javascript + * node.parentNode.insertAfter(newNode, node); //在node节点后面插入newNode + * ``` + */ + insertAfter:function (target, source) { + if (this.children) { + if(target.parentNode){ + target.parentNode.removeChild(target); + } + for (var i = 0, ci; ci = this.children[i]; i++) { + if (ci === source) { + this.children.splice(i + 1, 0, target); + target.parentNode = this; + return target; + } + + } + } + }, + + /** + * 从当前节点的子节点列表中,移除节点 + * @method removeChild + * @param { UE.uNode } node 要移除的节点引用 + * @param { Boolean } keepChildren 是否保留移除节点的子节点,若传入true,自动把移除节点的子节点插入到移除的位置 + * @return { * } 返回刚移除的子节点 + * @example + * ```javascript + * node.removeChild(childNode,true); //在node的子节点列表中移除child节点,并且吧child的子节点插入到移除的位置 + * ``` + */ + removeChild:function (node,keepChildren) { + if (this.children) { + for (var i = 0, ci; ci = this.children[i]; i++) { + if (ci === node) { + this.children.splice(i, 1); + ci.parentNode = null; + if(keepChildren && ci.children && ci.children.length){ + for(var j= 0,cj;cj=ci.children[j];j++){ + this.children.splice(i+j,0,cj); + cj.parentNode = this; + + } + } + return ci; + } + } + } + }, + + /** + * 获取当前节点所代表的元素属性,即获取attrs对象下的属性值 + * @method getAttr + * @param { String } attrName 要获取的属性名称 + * @return { * } 返回attrs对象下的属性值 + * @example + * ```javascript + * node.getAttr('title'); + * ``` + */ + getAttr:function (attrName) { + return this.attrs && this.attrs[attrName.toLowerCase()] + }, + + /** + * 设置当前节点所代表的元素属性,即设置attrs对象下的属性值 + * @method setAttr + * @param { String } attrName 要设置的属性名称 + * @param { * } attrVal 要设置的属性值,类型视设置的属性而定 + * @return { * } 返回attrs对象下的属性值 + * @example + * ```javascript + * node.setAttr('title','标题'); + * ``` + */ + setAttr:function (attrName, attrVal) { + if (!attrName) { + delete this.attrs; + return; + } + if(!this.attrs){ + this.attrs = {}; + } + if (utils.isObject(attrName)) { + for (var a in attrName) { + if (!attrName[a]) { + delete this.attrs[a] + } else { + this.attrs[a.toLowerCase()] = attrName[a]; + } + } + } else { + if (!attrVal) { + delete this.attrs[attrName] + } else { + this.attrs[attrName.toLowerCase()] = attrVal; + } + + } + }, + + /** + * 获取当前节点在父节点下的位置索引 + * @method getIndex + * @return { Number } 返回索引数值,如果没有父节点,返回-1 + * @example + * ```javascript + * node.getIndex(); + * ``` + */ + getIndex:function(){ + var parent = this.parentNode; + for(var i= 0,ci;ci=parent.children[i];i++){ + if(ci === this){ + return i; + } + } + return -1; + }, + + /** + * 在当前节点下,根据id查找节点 + * @method getNodeById + * @param { String } id 要查找的id + * @return { UE.uNode } 返回找到的节点 + * @example + * ```javascript + * node.getNodeById('textId'); + * ``` + */ + getNodeById:function (id) { + var node; + if (this.children && this.children.length) { + for (var i = 0, ci; ci = this.children[i++];) { + if (node = getNodeById(ci, id)) { + return node; + } + } + } + }, + + /** + * 在当前节点下,根据元素名称查找节点列表 + * @method getNodesByTagName + * @param { String } tagNames 要查找的元素名称 + * @return { Array } 返回找到的节点列表 + * @example + * ```javascript + * node.getNodesByTagName('span'); + * ``` + */ + getNodesByTagName:function (tagNames) { + tagNames = utils.trim(tagNames).replace(/[ ]{2,}/g, ' ').split(' '); + var arr = [], me = this; + utils.each(tagNames, function (tagName) { + if (me.children && me.children.length) { + for (var i = 0, ci; ci = me.children[i++];) { + getNodesByTagName(ci, tagName, arr) + } + } + }); + return arr; + }, + + /** + * 根据样式名称,获取节点的样式值 + * @method getStyle + * @param { String } name 要获取的样式名称 + * @return { String } 返回样式值 + * @example + * ```javascript + * node.getStyle('font-size'); + * ``` + */ + getStyle:function (name) { + var cssStyle = this.getAttr('style'); + if (!cssStyle) { + return '' + } + var reg = new RegExp('(^|;)\\s*' + name + ':([^;]+)','i'); + var match = cssStyle.match(reg); + if (match && match[0]) { + return match[2] + } + return ''; + }, + + /** + * 给节点设置样式 + * @method setStyle + * @param { String } name 要设置的的样式名称 + * @param { String } val 要设置的的样值 + * @example + * ```javascript + * node.setStyle('font-size', '12px'); + * ``` + */ + setStyle:function (name, val) { + function exec(name, val) { + var reg = new RegExp('(^|;)\\s*' + name + ':([^;]+;?)', 'gi'); + cssStyle = cssStyle.replace(reg, '$1'); + if (val) { + cssStyle = name + ':' + utils.unhtml(val) + ';' + cssStyle + } + + } + + var cssStyle = this.getAttr('style'); + if (!cssStyle) { + cssStyle = ''; + } + if (utils.isObject(name)) { + for (var a in name) { + exec(a, name[a]) + } + } else { + exec(name, val) + } + this.setAttr('style', utils.trim(cssStyle)) + }, + + /** + * 传入一个函数,递归遍历当前节点下的所有节点 + * @method traversal + * @param { Function } fn 遍历到节点的时,传入节点作为参数,运行此函数 + * @example + * ```javascript + * traversal(node, function(){ + * console.log(node.type); + * }); + * ``` + */ + traversal:function(fn){ + if(this.children && this.children.length){ + nodeTraversal(this,fn); + } + return this; + } + } +})(); + + +// core/htmlparser.js +/** + * html字符串转换成uNode节点 + * @file + * @module UE + * @since 1.2.6.1 + */ + +/** + * UEditor公用空间,UEditor所有的功能都挂载在该空间下 + * @unfile + * @module UE + */ + +/** + * html字符串转换成uNode节点的静态方法 + * @method htmlparser + * @param { String } htmlstr 要转换的html代码 + * @param { Boolean } ignoreBlank 若设置为true,转换的时候忽略\n\r\t等空白字符 + * @return { uNode } 给定的html片段转换形成的uNode对象 + * @example + * ```javascript + * var root = UE.htmlparser('

    htmlparser

    ', true); + * ``` + */ + +var htmlparser = UE.htmlparser = function (htmlstr,ignoreBlank) { + //todo 原来的方式 [^"'<>\/] 有\/就不能配对上 ') + } + html.push('') + } + //禁止指定table-width + return '
    这样的标签了 + //先去掉了,加上的原因忘了,这里先记录 + var re_tag = /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\s\/<>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g, + re_attr = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g; + + //ie下取得的html可能会有\n存在,要去掉,在处理replace(/[\t\r\n]*/g,'');代码高量的\n不能去除 + var allowEmptyTags = { + b:1,code:1,i:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,span:1, + sub:1,img:1,sup:1,font:1,big:1,small:1,iframe:1,a:1,br:1,pre:1 + }; + htmlstr = htmlstr.replace(new RegExp(domUtils.fillChar, 'g'), ''); + if(!ignoreBlank){ + htmlstr = htmlstr.replace(new RegExp('[\\r\\t\\n'+(ignoreBlank?'':' ')+']*<\/?(\\w+)\\s*(?:[^>]*)>[\\r\\t\\n'+(ignoreBlank?'':' ')+']*','g'), function(a,b){ + //br暂时单独处理 + if(b && allowEmptyTags[b.toLowerCase()]){ + return a.replace(/(^[\n\r]+)|([\n\r]+$)/g,''); + } + return a.replace(new RegExp('^[\\r\\n'+(ignoreBlank?'':' ')+']+'),'').replace(new RegExp('[\\r\\n'+(ignoreBlank?'':' ')+']+$'),''); + }); + } + + var notTransAttrs = { + 'href':1, + 'src':1 + }; + + var uNode = UE.uNode, + needParentNode = { + 'td':'tr', + 'tr':['tbody','thead','tfoot'], + 'tbody':'table', + 'th':'tr', + 'thead':'table', + 'tfoot':'table', + 'caption':'table', + 'li':['ul', 'ol'], + 'dt':'dl', + 'dd':'dl', + 'option':'select' + }, + needChild = { + 'ol':'li', + 'ul':'li' + }; + + function text(parent, data) { + + if(needChild[parent.tagName]){ + var tmpNode = uNode.createElement(needChild[parent.tagName]); + parent.appendChild(tmpNode); + tmpNode.appendChild(uNode.createText(data)); + parent = tmpNode; + }else{ + + parent.appendChild(uNode.createText(data)); + } + } + + function element(parent, tagName, htmlattr) { + var needParentTag; + if (needParentTag = needParentNode[tagName]) { + var tmpParent = parent,hasParent; + while(tmpParent.type != 'root'){ + if(utils.isArray(needParentTag) ? utils.indexOf(needParentTag, tmpParent.tagName) != -1 : needParentTag == tmpParent.tagName){ + parent = tmpParent; + hasParent = true; + break; + } + tmpParent = tmpParent.parentNode; + } + if(!hasParent){ + parent = element(parent, utils.isArray(needParentTag) ? needParentTag[0] : needParentTag) + } + } + //按dtd处理嵌套 +// if(parent.type != 'root' && !dtd[parent.tagName][tagName]) +// parent = parent.parentNode; + var elm = new uNode({ + parentNode:parent, + type:'element', + tagName:tagName.toLowerCase(), + //是自闭合的处理一下 + children:dtd.$empty[tagName] ? null : [] + }); + //如果属性存在,处理属性 + if (htmlattr) { + var attrs = {}, match; + while (match = re_attr.exec(htmlattr)) { + attrs[match[1].toLowerCase()] = notTransAttrs[match[1].toLowerCase()] ? (match[2] || match[3] || match[4]) : utils.unhtml(match[2] || match[3] || match[4]) + } + elm.attrs = attrs; + } + //trace:3970 +// //如果parent下不能放elm +// if(dtd.$inline[parent.tagName] && dtd.$block[elm.tagName] && !dtd[parent.tagName][elm.tagName]){ +// parent = parent.parentNode; +// elm.parentNode = parent; +// } + parent.children.push(elm); + //如果是自闭合节点返回父亲节点 + return dtd.$empty[tagName] ? parent : elm + } + + function comment(parent, data) { + parent.children.push(new uNode({ + type:'comment', + data:data, + parentNode:parent + })); + } + + var match, currentIndex = 0, nextIndex = 0; + //设置根节点 + var root = new uNode({ + type:'root', + children:[] + }); + var currentParent = root; + + while (match = re_tag.exec(htmlstr)) { + currentIndex = match.index; + try{ + if (currentIndex > nextIndex) { + //text node + text(currentParent, htmlstr.slice(nextIndex, currentIndex)); + } + if (match[3]) { + + if(dtd.$cdata[currentParent.tagName]){ + text(currentParent, match[0]); + }else{ + //start tag + currentParent = element(currentParent, match[3].toLowerCase(), match[4]); + } + + + } else if (match[1]) { + if(currentParent.type != 'root'){ + if(dtd.$cdata[currentParent.tagName] && !dtd.$cdata[match[1]]){ + text(currentParent, match[0]); + }else{ + var tmpParent = currentParent; + while(currentParent.type == 'element' && currentParent.tagName != match[1].toLowerCase()){ + currentParent = currentParent.parentNode; + if(currentParent.type == 'root'){ + currentParent = tmpParent; + throw 'break' + } + } + //end tag + currentParent = currentParent.parentNode; + } + + } + + } else if (match[2]) { + //comment + comment(currentParent, match[2]) + } + }catch(e){} + + nextIndex = re_tag.lastIndex; + + } + //如果结束是文本,就有可能丢掉,所以这里手动判断一下 + //例如
  • sdfsdfsdf
  • sdfsdfsdfsdf + if (nextIndex < htmlstr.length) { + text(currentParent, htmlstr.slice(nextIndex)); + } + return root; +}; + + +// core/filternode.js +/** + * UE过滤节点的静态方法 + * @file + */ + +/** + * UEditor公用空间,UEditor所有的功能都挂载在该空间下 + * @module UE + */ + + +/** + * 根据传入节点和过滤规则过滤相应节点 + * @module UE + * @since 1.2.6.1 + * @method filterNode + * @param { Object } root 指定root节点 + * @param { Object } rules 过滤规则json对象 + * @example + * ```javascript + * UE.filterNode(root,editor.options.filterRules); + * ``` + */ +var filterNode = UE.filterNode = function () { + function filterNode(node,rules){ + switch (node.type) { + case 'text': + break; + case 'element': + var val; + if(val = rules[node.tagName]){ + if(val === '-'){ + node.parentNode.removeChild(node) + }else if(utils.isFunction(val)){ + var parentNode = node.parentNode, + index = node.getIndex(); + val(node); + if(node.parentNode){ + if(node.children){ + for(var i = 0,ci;ci=node.children[i];){ + filterNode(ci,rules); + if(ci.parentNode){ + i++; + } + } + } + }else{ + for(var i = index,ci;ci=parentNode.children[i];){ + filterNode(ci,rules); + if(ci.parentNode){ + i++; + } + } + } + + + }else{ + var attrs = val['$']; + if(attrs && node.attrs){ + var tmpAttrs = {},tmpVal; + for(var a in attrs){ + tmpVal = node.getAttr(a); + //todo 只先对style单独处理 + if(a == 'style' && utils.isArray(attrs[a])){ + var tmpCssStyle = []; + utils.each(attrs[a],function(v){ + var tmp; + if(tmp = node.getStyle(v)){ + tmpCssStyle.push(v + ':' + tmp); + } + }); + tmpVal = tmpCssStyle.join(';') + } + if(tmpVal){ + tmpAttrs[a] = tmpVal; + } + + } + node.attrs = tmpAttrs; + } + if(node.children){ + for(var i = 0,ci;ci=node.children[i];){ + filterNode(ci,rules); + if(ci.parentNode){ + i++; + } + } + } + } + }else{ + //如果不在名单里扣出子节点并删除该节点,cdata除外 + if(dtd.$cdata[node.tagName]){ + node.parentNode.removeChild(node) + }else{ + var parentNode = node.parentNode, + index = node.getIndex(); + node.parentNode.removeChild(node,true); + for(var i = index,ci;ci=parentNode.children[i];){ + filterNode(ci,rules); + if(ci.parentNode){ + i++; + } + } + } + } + break; + case 'comment': + node.parentNode.removeChild(node) + } + + } + return function(root,rules){ + if(utils.isEmptyObject(rules)){ + return root; + } + var val; + if(val = rules['-']){ + utils.each(val.split(' '),function(k){ + rules[k] = '-' + }) + } + for(var i= 0,ci;ci=root.children[i];){ + filterNode(ci,rules); + if(ci.parentNode){ + i++; + } + } + return root; + } +}(); + +// core/plugin.js +/** + * Created with JetBrains PhpStorm. + * User: campaign + * Date: 10/8/13 + * Time: 6:15 PM + * To change this template use File | Settings | File Templates. + */ +UE.plugin = function(){ + var _plugins = {}; + return { + register : function(pluginName,fn,oldOptionName,afterDisabled){ + if(oldOptionName && utils.isFunction(oldOptionName)){ + afterDisabled = oldOptionName; + oldOptionName = null + } + _plugins[pluginName] = { + optionName : oldOptionName || pluginName, + execFn : fn, + //当插件被禁用时执行 + afterDisabled : afterDisabled + } + }, + load : function(editor){ + utils.each(_plugins,function(plugin){ + var _export = plugin.execFn.call(editor); + if(editor.options[plugin.optionName] !== false){ + if(_export){ + //后边需要再做扩展 + utils.each(_export,function(v,k){ + switch(k.toLowerCase()){ + case 'shortcutkey': + editor.addshortcutkey(v); + break; + case 'bindevents': + utils.each(v,function(fn,eventName){ + editor.addListener(eventName,fn); + }); + break; + case 'bindmultievents': + utils.each(utils.isArray(v) ? v:[v],function(event){ + var types = utils.trim(event.type).split(/\s+/); + utils.each(types,function(eventName){ + editor.addListener(eventName, event.handler); + }); + }); + break; + case 'commands': + utils.each(v,function(execFn,execName){ + editor.commands[execName] = execFn + }); + break; + case 'outputrule': + editor.addOutputRule(v); + break; + case 'inputrule': + editor.addInputRule(v); + break; + case 'defaultoptions': + editor.setOpt(v) + } + }) + } + + }else if(plugin.afterDisabled){ + plugin.afterDisabled.call(editor) + } + + }); + //向下兼容 + utils.each(UE.plugins,function(plugin){ + plugin.call(editor); + }); + }, + run : function(pluginName,editor){ + var plugin = _plugins[pluginName]; + if(plugin){ + plugin.exeFn.call(editor) + } + } + } +}(); + +// core/keymap.js +var keymap = UE.keymap = { + 'Backspace' : 8, + 'Tab' : 9, + 'Enter' : 13, + + 'Shift':16, + 'Control':17, + 'Alt':18, + 'CapsLock':20, + + 'Esc':27, + + 'Spacebar':32, + + 'PageUp':33, + 'PageDown':34, + 'End':35, + 'Home':36, + + 'Left':37, + 'Up':38, + 'Right':39, + 'Down':40, + + 'Insert':45, + + 'Del':46, + + 'NumLock':144, + + 'Cmd':91, + + '=':187, + '-':189, + + "b":66, + 'i':73, + //回退 + 'z':90, + 'y':89, + //粘贴 + 'v' : 86, + 'x' : 88, + + 's' : 83, + + 'n' : 78 +}; + +// core/localstorage.js +//存储媒介封装 +var LocalStorage = UE.LocalStorage = (function () { + + var storage = window.localStorage || getUserData() || null, + LOCAL_FILE = 'localStorage'; + + return { + + saveLocalData: function (key, data) { + + if (storage && data) { + storage.setItem(key, data); + return true; + } + + return false; + + }, + + getLocalData: function (key) { + + if (storage) { + return storage.getItem(key); + } + + return null; + + }, + + removeItem: function (key) { + + storage && storage.removeItem(key); + + } + + }; + + function getUserData() { + + var container = document.createElement("div"); + container.style.display = "none"; + + if (!container.addBehavior) { + return null; + } + + container.addBehavior("#default#userdata"); + + return { + + getItem: function (key) { + + var result = null; + + try { + document.body.appendChild(container); + container.load(LOCAL_FILE); + result = container.getAttribute(key); + document.body.removeChild(container); + } catch (e) { + } + + return result; + + }, + + setItem: function (key, value) { + + document.body.appendChild(container); + container.setAttribute(key, value); + container.save(LOCAL_FILE); + document.body.removeChild(container); + + }, + + //// 暂时没有用到 + //clear: function () { + // + // var expiresTime = new Date(); + // expiresTime.setFullYear(expiresTime.getFullYear() - 1); + // document.body.appendChild(container); + // container.expires = expiresTime.toUTCString(); + // container.save(LOCAL_FILE); + // document.body.removeChild(container); + // + //}, + + removeItem: function (key) { + + document.body.appendChild(container); + container.removeAttribute(key); + container.save(LOCAL_FILE); + document.body.removeChild(container); + + } + + }; + + } + +})(); + +(function () { + + var ROOTKEY = 'ueditor_preference'; + + UE.Editor.prototype.setPreferences = function(key,value){ + var obj = {}; + if (utils.isString(key)) { + obj[ key ] = value; + } else { + obj = key; + } + var data = LocalStorage.getLocalData(ROOTKEY); + if (data && (data = utils.str2json(data))) { + utils.extend(data, obj); + } else { + data = obj; + } + data && LocalStorage.saveLocalData(ROOTKEY, utils.json2str(data)); + }; + + UE.Editor.prototype.getPreferences = function(key){ + var data = LocalStorage.getLocalData(ROOTKEY); + if (data && (data = utils.str2json(data))) { + return key ? data[key] : data + } + return null; + }; + + UE.Editor.prototype.removePreferences = function (key) { + var data = LocalStorage.getLocalData(ROOTKEY); + if (data && (data = utils.str2json(data))) { + data[key] = undefined; + delete data[key] + } + data && LocalStorage.saveLocalData(ROOTKEY, utils.json2str(data)); + }; + +})(); + + +// plugins/defaultfilter.js +///import core +///plugin 编辑器默认的过滤转换机制 + +UE.plugins['defaultfilter'] = function () { + var me = this; + me.setOpt({ + 'allowDivTransToP':true, + 'disabledTableInTable':true + }); + //默认的过滤处理 + //进入编辑器的内容处理 + me.addInputRule(function (root) { + var allowDivTransToP = this.options.allowDivTransToP; + var val; + function tdParent(node){ + while(node && node.type == 'element'){ + if(node.tagName == 'td'){ + return true; + } + node = node.parentNode; + } + return false; + } + //进行默认的处理 + root.traversal(function (node) { + if (node.type == 'element') { + if (!dtd.$cdata[node.tagName] && me.options.autoClearEmptyNode && dtd.$inline[node.tagName] && !dtd.$empty[node.tagName] && (!node.attrs || utils.isEmptyObject(node.attrs))) { + if (!node.firstChild()) node.parentNode.removeChild(node); + else if (node.tagName == 'span' && (!node.attrs || utils.isEmptyObject(node.attrs))) { + node.parentNode.removeChild(node, true) + } + return; + } + switch (node.tagName) { + case 'style': + case 'script': + node.setAttr({ + cdata_tag: node.tagName, + cdata_data: (node.innerHTML() || ''), + '_ue_custom_node_':'true' + }); + node.tagName = 'div'; + node.innerHTML(''); + break; + case 'a': + if (val = node.getAttr('href')) { + node.setAttr('_href', val) + } + break; + case 'img': + //todo base64暂时去掉,后边做远程图片上传后,干掉这个 + if (val = node.getAttr('src')) { + if (/^data:/.test(val)) { + node.parentNode.removeChild(node); + break; + } + } + node.setAttr('_src', node.getAttr('src')); + break; + case 'span': + if (browser.webkit && (val = node.getStyle('white-space'))) { + if (/nowrap|normal/.test(val)) { + node.setStyle('white-space', ''); + if (me.options.autoClearEmptyNode && utils.isEmptyObject(node.attrs)) { + node.parentNode.removeChild(node, true) + } + } + } + val = node.getAttr('id'); + if(val && /^_baidu_bookmark_/i.test(val)){ + node.parentNode.removeChild(node) + } + break; + case 'p': + if (val = node.getAttr('align')) { + node.setAttr('align'); + node.setStyle('text-align', val) + } + //trace:3431 +// var cssStyle = node.getAttr('style'); +// if (cssStyle) { +// cssStyle = cssStyle.replace(/(margin|padding)[^;]+/g, ''); +// node.setAttr('style', cssStyle) +// +// } + //p标签不允许嵌套 + utils.each(node.children,function(n){ + if(n.type == 'element' && n.tagName == 'p'){ + var next = n.nextSibling(); + node.parentNode.insertAfter(n,node); + var last = n; + while(next){ + var tmp = next.nextSibling(); + node.parentNode.insertAfter(next,last); + last = next; + next = tmp; + } + return false; + } + }); + if (!node.firstChild()) { + node.innerHTML(browser.ie ? ' ' : '
    ') + } + break; + case 'div': + if(node.getAttr('cdata_tag')){ + break; + } + //针对代码这里不处理插入代码的div + val = node.getAttr('class'); + if(val && /^line number\d+/.test(val)){ + break; + } + if(!allowDivTransToP){ + break; + } + var tmpNode, p = UE.uNode.createElement('p'); + while (tmpNode = node.firstChild()) { + if (tmpNode.type == 'text' || !UE.dom.dtd.$block[tmpNode.tagName]) { + p.appendChild(tmpNode); + } else { + if (p.firstChild()) { + node.parentNode.insertBefore(p, node); + p = UE.uNode.createElement('p'); + } else { + node.parentNode.insertBefore(tmpNode, node); + } + } + } + if (p.firstChild()) { + node.parentNode.insertBefore(p, node); + } + node.parentNode.removeChild(node); + break; + case 'dl': + node.tagName = 'ul'; + break; + case 'dt': + case 'dd': + node.tagName = 'li'; + break; + case 'li': + var className = node.getAttr('class'); + if (!className || !/list\-/.test(className)) { + node.setAttr() + } + var tmpNodes = node.getNodesByTagName('ol ul'); + UE.utils.each(tmpNodes, function (n) { + node.parentNode.insertAfter(n, node); + }); + break; + case 'td': + case 'th': + case 'caption': + if(!node.children || !node.children.length){ + node.appendChild(browser.ie11below ? UE.uNode.createText(' ') : UE.uNode.createElement('br')) + } + break; + case 'table': + if(me.options.disabledTableInTable && tdParent(node)){ + node.parentNode.insertBefore(UE.uNode.createText(node.innerText()),node); + node.parentNode.removeChild(node) + } + } + + } +// if(node.type == 'comment'){ +// node.parentNode.removeChild(node); +// } + }) + + }); + + //从编辑器出去的内容处理 + me.addOutputRule(function (root) { + + var val; + root.traversal(function (node) { + if (node.type == 'element') { + + if (me.options.autoClearEmptyNode && dtd.$inline[node.tagName] && !dtd.$empty[node.tagName] && (!node.attrs || utils.isEmptyObject(node.attrs))) { + + if (!node.firstChild()) node.parentNode.removeChild(node); + else if (node.tagName == 'span' && (!node.attrs || utils.isEmptyObject(node.attrs))) { + node.parentNode.removeChild(node, true) + } + return; + } + switch (node.tagName) { + case 'div': + if (val = node.getAttr('cdata_tag')) { + node.tagName = val; + node.appendChild(UE.uNode.createText(node.getAttr('cdata_data'))); + node.setAttr({cdata_tag: '', cdata_data: '','_ue_custom_node_':''}); + } + break; + case 'a': + if (val = node.getAttr('_href')) { + node.setAttr({ + 'href': utils.html(val), + '_href': '' + }) + } + break; + break; + case 'span': + val = node.getAttr('id'); + if(val && /^_baidu_bookmark_/i.test(val)){ + node.parentNode.removeChild(node) + } + break; + case 'img': + if (val = node.getAttr('_src')) { + node.setAttr({ + 'src': node.getAttr('_src'), + '_src': '' + }) + } + + + } + } + + }) + + + }); +}; + + +// plugins/inserthtml.js +/** + * 插入html字符串插件 + * @file + * @since 1.2.6.1 + */ + +/** + * 插入html代码 + * @command inserthtml + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { String } html 插入的html字符串 + * @remaind 插入的标签内容是在当前的选区位置上插入,如果当前是闭合状态,那直接插入内容, 如果当前是选中状态,将先清除当前选中内容后,再做插入 + * @warning 注意:该命令会对当前选区的位置,对插入的内容进行过滤转换处理。 过滤的规则遵循html语意化的原则。 + * @example + * ```javascript + * //xxx[BB]xxx 当前选区为非闭合选区,选中BB这两个文本 + * //执行命令,插入CC + * //插入后的效果 xxxCCxxx + * //

    xx|xxx

    当前选区为闭合状态 + * //插入

    CC

    + * //结果

    xx

    CC

    xxx

    + * //

    xxxx

    |

    xxx

    当前选区在两个p标签之间 + * //插入 xxxx + * //结果

    xxxx

    xxxx

    xxx

    + * ``` + */ + +UE.commands['inserthtml'] = { + execCommand: function (command,html,notNeedFilter){ + var me = this, + range, + div; + if(!html){ + return; + } + if(me.fireEvent('beforeinserthtml',html) === true){ + return; + } + range = me.selection.getRange(); + div = range.document.createElement( 'div' ); + div.style.display = 'inline'; + + if (!notNeedFilter) { + var root = UE.htmlparser(html); + //如果给了过滤规则就先进行过滤 + if(me.options.filterRules){ + UE.filterNode(root,me.options.filterRules); + } + //执行默认的处理 + me.filterInputRule(root); + html = root.toHtml() + } + div.innerHTML = utils.trim( html ); + + if ( !range.collapsed ) { + var tmpNode = range.startContainer; + if(domUtils.isFillChar(tmpNode)){ + range.setStartBefore(tmpNode) + } + tmpNode = range.endContainer; + if(domUtils.isFillChar(tmpNode)){ + range.setEndAfter(tmpNode) + } + range.txtToElmBoundary(); + //结束边界可能放到了br的前边,要把br包含进来 + // x[xxx]
    + if(range.endContainer && range.endContainer.nodeType == 1){ + tmpNode = range.endContainer.childNodes[range.endOffset]; + if(tmpNode && domUtils.isBr(tmpNode)){ + range.setEndAfter(tmpNode); + } + } + if(range.startOffset == 0){ + tmpNode = range.startContainer; + if(domUtils.isBoundaryNode(tmpNode,'firstChild') ){ + tmpNode = range.endContainer; + if(range.endOffset == (tmpNode.nodeType == 3 ? tmpNode.nodeValue.length : tmpNode.childNodes.length) && domUtils.isBoundaryNode(tmpNode,'lastChild')){ + me.body.innerHTML = '

    '+(browser.ie ? '' : '
    ')+'

    '; + range.setStart(me.body.firstChild,0).collapse(true) + + } + } + } + !range.collapsed && range.deleteContents(); + if(range.startContainer.nodeType == 1){ + var child = range.startContainer.childNodes[range.startOffset],pre; + if(child && domUtils.isBlockElm(child) && (pre = child.previousSibling) && domUtils.isBlockElm(pre)){ + range.setEnd(pre,pre.childNodes.length).collapse(); + while(child.firstChild){ + pre.appendChild(child.firstChild); + } + domUtils.remove(child); + } + } + + } + + + var child,parent,pre,tmp,hadBreak = 0, nextNode; + //如果当前位置选中了fillchar要干掉,要不会产生空行 + if(range.inFillChar()){ + child = range.startContainer; + if(domUtils.isFillChar(child)){ + range.setStartBefore(child).collapse(true); + domUtils.remove(child); + }else if(domUtils.isFillChar(child,true)){ + child.nodeValue = child.nodeValue.replace(fillCharReg,''); + range.startOffset--; + range.collapsed && range.collapse(true) + } + } + //列表单独处理 + var li = domUtils.findParentByTagName(range.startContainer,'li',true); + if(li){ + var next,last; + while(child = div.firstChild){ + //针对hr单独处理一下先 + while(child && (child.nodeType == 3 || !domUtils.isBlockElm(child) || child.tagName=='HR' )){ + next = child.nextSibling; + range.insertNode( child).collapse(); + last = child; + child = next; + + } + if(child){ + if(/^(ol|ul)$/i.test(child.tagName)){ + while(child.firstChild){ + last = child.firstChild; + domUtils.insertAfter(li,child.firstChild); + li = li.nextSibling; + } + domUtils.remove(child) + }else{ + var tmpLi; + next = child.nextSibling; + tmpLi = me.document.createElement('li'); + domUtils.insertAfter(li,tmpLi); + tmpLi.appendChild(child); + last = child; + child = next; + li = tmpLi; + } + } + } + li = domUtils.findParentByTagName(range.startContainer,'li',true); + if(domUtils.isEmptyBlock(li)){ + domUtils.remove(li) + } + if(last){ + + range.setStartAfter(last).collapse(true).select(true) + } + }else{ + while ( child = div.firstChild ) { + if(hadBreak){ + var p = me.document.createElement('p'); + while(child && (child.nodeType == 3 || !dtd.$block[child.tagName])){ + nextNode = child.nextSibling; + p.appendChild(child); + child = nextNode; + } + if(p.firstChild){ + + child = p + } + } + range.insertNode( child ); + nextNode = child.nextSibling; + if ( !hadBreak && child.nodeType == domUtils.NODE_ELEMENT && domUtils.isBlockElm( child ) ){ + + parent = domUtils.findParent( child,function ( node ){ return domUtils.isBlockElm( node ); } ); + if ( parent && parent.tagName.toLowerCase() != 'body' && !(dtd[parent.tagName][child.nodeName] && child.parentNode === parent)){ + if(!dtd[parent.tagName][child.nodeName]){ + pre = parent; + }else{ + tmp = child.parentNode; + while (tmp !== parent){ + pre = tmp; + tmp = tmp.parentNode; + + } + } + + + domUtils.breakParent( child, pre || tmp ); + //去掉break后前一个多余的节点

    |<[p> ==>

    |

    + var pre = child.previousSibling; + domUtils.trimWhiteTextNode(pre); + if(!pre.childNodes.length){ + domUtils.remove(pre); + } + //trace:2012,在非ie的情况,切开后剩下的节点有可能不能点入光标添加br占位 + + if(!browser.ie && + (next = child.nextSibling) && + domUtils.isBlockElm(next) && + next.lastChild && + !domUtils.isBr(next.lastChild)){ + next.appendChild(me.document.createElement('br')); + } + hadBreak = 1; + } + } + var next = child.nextSibling; + if(!div.firstChild && next && domUtils.isBlockElm(next)){ + + range.setStart(next,0).collapse(true); + break; + } + range.setEndAfter( child ).collapse(); + + } + + child = range.startContainer; + + if(nextNode && domUtils.isBr(nextNode)){ + domUtils.remove(nextNode) + } + //用chrome可能有空白展位符 + if(domUtils.isBlockElm(child) && domUtils.isEmptyNode(child)){ + if(nextNode = child.nextSibling){ + domUtils.remove(child); + if(nextNode.nodeType == 1 && dtd.$block[nextNode.tagName]){ + + range.setStart(nextNode,0).collapse(true).shrinkBoundary() + } + }else{ + + try{ + child.innerHTML = browser.ie ? domUtils.fillChar : '
    '; + }catch(e){ + range.setStartBefore(child); + domUtils.remove(child) + } + + } + + } + //加上true因为在删除表情等时会删两次,第一次是删的fillData + try{ + range.select(true); + }catch(e){} + + } + + + + setTimeout(function(){ + range = me.selection.getRange(); + range.scrollToView(me.autoHeightEnabled,me.autoHeightEnabled ? domUtils.getXY(me.iframe).y:0); + me.fireEvent('afterinserthtml', html); + },200); + } +}; + + +// plugins/autotypeset.js +/** + * 自动排版 + * @file + * @since 1.2.6.1 + */ + +/** + * 对当前编辑器的内容执行自动排版, 排版的行为根据config配置文件里的“autotypeset”选项进行控制。 + * @command autotypeset + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'autotypeset' ); + * ``` + */ + +UE.plugins['autotypeset'] = function(){ + + this.setOpt({'autotypeset': { + mergeEmptyline: true, //合并空行 + removeClass: true, //去掉冗余的class + removeEmptyline: false, //去掉空行 + textAlign:"left", //段落的排版方式,可以是 left,right,center,justify 去掉这个属性表示不执行排版 + imageBlockLine: 'center', //图片的浮动方式,独占一行剧中,左右浮动,默认: center,left,right,none 去掉这个属性表示不执行排版 + pasteFilter: false, //根据规则过滤没事粘贴进来的内容 + clearFontSize: false, //去掉所有的内嵌字号,使用编辑器默认的字号 + clearFontFamily: false, //去掉所有的内嵌字体,使用编辑器默认的字体 + removeEmptyNode: false, // 去掉空节点 + //可以去掉的标签 + removeTagNames: utils.extend({div:1},dtd.$removeEmpty), + indent: false, // 行首缩进 + indentValue : '2em', //行首缩进的大小 + bdc2sb: false, + tobdc: false + }}); + + var me = this, + opt = me.options.autotypeset, + remainClass = { + 'selectTdClass':1, + 'pagebreak':1, + 'anchorclass':1 + }, + remainTag = { + 'li':1 + }, + tags = { + div:1, + p:1, + //trace:2183 这些也认为是行 + blockquote:1,center:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1, + span:1 + }, + highlightCont; + //升级了版本,但配置项目里没有autotypeset + if(!opt){ + return; + } + + readLocalOpts(); + + function isLine(node,notEmpty){ + if(!node || node.nodeType == 3) + return 0; + if(domUtils.isBr(node)) + return 1; + if(node && node.parentNode && tags[node.tagName.toLowerCase()]){ + if(highlightCont && highlightCont.contains(node) + || + node.getAttribute('pagebreak') + ){ + return 0; + } + + return notEmpty ? !domUtils.isEmptyBlock(node) : domUtils.isEmptyBlock(node,new RegExp('[\\s'+domUtils.fillChar + +']','g')); + } + } + + function removeNotAttributeSpan(node){ + if(!node.style.cssText){ + domUtils.removeAttributes(node,['style']); + if(node.tagName.toLowerCase() == 'span' && domUtils.hasNoAttributes(node)){ + domUtils.remove(node,true); + } + } + } + function autotype(type,html){ + + var me = this,cont; + if(html){ + if(!opt.pasteFilter){ + return; + } + cont = me.document.createElement('div'); + cont.innerHTML = html.html; + }else{ + cont = me.document.body; + } + var nodes = domUtils.getElementsByTagName(cont,'*'); + + // 行首缩进,段落方向,段间距,段内间距 + for(var i=0,ci;ci=nodes[i++];){ + + if(me.fireEvent('excludeNodeinautotype',ci) === true){ + continue; + } + //font-size + if(opt.clearFontSize && ci.style.fontSize){ + domUtils.removeStyle(ci,'font-size'); + + removeNotAttributeSpan(ci); + + } + //font-family + if(opt.clearFontFamily && ci.style.fontFamily){ + domUtils.removeStyle(ci,'font-family'); + removeNotAttributeSpan(ci); + } + + if(isLine(ci)){ + //合并空行 + if(opt.mergeEmptyline ){ + var next = ci.nextSibling,tmpNode,isBr = domUtils.isBr(ci); + while(isLine(next)){ + tmpNode = next; + next = tmpNode.nextSibling; + if(isBr && (!next || next && !domUtils.isBr(next))){ + break; + } + domUtils.remove(tmpNode); + } + + } + //去掉空行,保留占位的空行 + if(opt.removeEmptyline && domUtils.inDoc(ci,cont) && !remainTag[ci.parentNode.tagName.toLowerCase()] ){ + if(domUtils.isBr(ci)){ + next = ci.nextSibling; + if(next && !domUtils.isBr(next)){ + continue; + } + } + domUtils.remove(ci); + continue; + + } + + } + if(isLine(ci,true) && ci.tagName != 'SPAN'){ + if(opt.indent){ + ci.style.textIndent = opt.indentValue; + } + if(opt.textAlign){ + ci.style.textAlign = opt.textAlign; + } + // if(opt.lineHeight) + // ci.style.lineHeight = opt.lineHeight + 'cm'; + + } + + //去掉class,保留的class不去掉 + if(opt.removeClass && ci.className && !remainClass[ci.className.toLowerCase()]){ + + if(highlightCont && highlightCont.contains(ci)){ + continue; + } + domUtils.removeAttributes(ci,['class']); + } + + //表情不处理 + if(opt.imageBlockLine && ci.tagName.toLowerCase() == 'img' && !ci.getAttribute('emotion')){ + if(html){ + var img = ci; + switch (opt.imageBlockLine){ + case 'left': + case 'right': + case 'none': + var pN = img.parentNode,tmpNode,pre,next; + while(dtd.$inline[pN.tagName] || pN.tagName == 'A'){ + pN = pN.parentNode; + } + tmpNode = pN; + if(tmpNode.tagName == 'P' && domUtils.getStyle(tmpNode,'text-align') == 'center'){ + if(!domUtils.isBody(tmpNode) && domUtils.getChildCount(tmpNode,function(node){return !domUtils.isBr(node) && !domUtils.isWhitespace(node)}) == 1){ + pre = tmpNode.previousSibling; + next = tmpNode.nextSibling; + if(pre && next && pre.nodeType == 1 && next.nodeType == 1 && pre.tagName == next.tagName && domUtils.isBlockElm(pre)){ + pre.appendChild(tmpNode.firstChild); + while(next.firstChild){ + pre.appendChild(next.firstChild); + } + domUtils.remove(tmpNode); + domUtils.remove(next); + }else{ + domUtils.setStyle(tmpNode,'text-align',''); + } + + + } + + + } + domUtils.setStyle(img,'float', opt.imageBlockLine); + break; + case 'center': + if(me.queryCommandValue('imagefloat') != 'center'){ + pN = img.parentNode; + domUtils.setStyle(img,'float','none'); + tmpNode = img; + while(pN && domUtils.getChildCount(pN,function(node){return !domUtils.isBr(node) && !domUtils.isWhitespace(node)}) == 1 + && (dtd.$inline[pN.tagName] || pN.tagName == 'A')){ + tmpNode = pN; + pN = pN.parentNode; + } + var pNode = me.document.createElement('p'); + domUtils.setAttributes(pNode,{ + + style:'text-align:center' + }); + tmpNode.parentNode.insertBefore(pNode,tmpNode); + pNode.appendChild(tmpNode); + domUtils.setStyle(tmpNode,'float',''); + + } + + + } + } else { + var range = me.selection.getRange(); + range.selectNode(ci).select(); + me.execCommand('imagefloat', opt.imageBlockLine); + } + + } + + //去掉冗余的标签 + if(opt.removeEmptyNode){ + if(opt.removeTagNames[ci.tagName.toLowerCase()] && domUtils.hasNoAttributes(ci) && domUtils.isEmptyBlock(ci)){ + domUtils.remove(ci); + } + } + } + if(opt.tobdc){ + var root = UE.htmlparser(cont.innerHTML); + root.traversal(function(node){ + if(node.type == 'text'){ + node.data = ToDBC(node.data) + } + }); + cont.innerHTML = root.toHtml() + } + if(opt.bdc2sb){ + var root = UE.htmlparser(cont.innerHTML); + root.traversal(function(node){ + if(node.type == 'text'){ + node.data = DBC2SB(node.data) + } + }); + cont.innerHTML = root.toHtml() + } + if(html){ + html.html = cont.innerHTML; + } + } + if(opt.pasteFilter){ + me.addListener('beforepaste',autotype); + } + + function DBC2SB(str) { + var result = ''; + for (var i = 0; i < str.length; i++) { + var code = str.charCodeAt(i); //获取当前字符的unicode编码 + if (code >= 65281 && code <= 65373)//在这个unicode编码范围中的是所有的英文字母已经各种字符 + { + result += String.fromCharCode(str.charCodeAt(i) - 65248); //把全角字符的unicode编码转换为对应半角字符的unicode码 + } else if (code == 12288)//空格 + { + result += String.fromCharCode(str.charCodeAt(i) - 12288 + 32); + } else { + result += str.charAt(i); + } + } + return result; + } + function ToDBC(txtstring) { + txtstring = utils.html(txtstring); + var tmp = ""; + var mark = "";/*用于判断,如果是html尖括里的标记,则不进行全角的转换*/ + for (var i = 0; i < txtstring.length; i++) { + if (txtstring.charCodeAt(i) == 32) { + tmp = tmp + String.fromCharCode(12288); + } + else if (txtstring.charCodeAt(i) < 127) { + tmp = tmp + String.fromCharCode(txtstring.charCodeAt(i) + 65248); + } + else { + tmp += txtstring.charAt(i); + } + } + return tmp; + } + + function readLocalOpts() { + var cookieOpt = me.getPreferences('autotypeset'); + utils.extend(me.options.autotypeset, cookieOpt); + } + + me.commands['autotypeset'] = { + execCommand:function () { + me.removeListener('beforepaste',autotype); + if(opt.pasteFilter){ + me.addListener('beforepaste',autotype); + } + autotype.call(me) + } + + }; + +}; + + + +// plugins/autosubmit.js +/** + * 快捷键提交 + * @file + * @since 1.2.6.1 + */ + +/** + * 提交表单 + * @command autosubmit + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'autosubmit' ); + * ``` + */ + +UE.plugin.register('autosubmit',function(){ + return { + shortcutkey:{ + "autosubmit":"ctrl+13" //手动提交 + }, + commands:{ + 'autosubmit':{ + execCommand:function () { + var me=this, + form = domUtils.findParentByTagName(me.iframe,"form", false); + if (form){ + if(me.fireEvent("beforesubmit")===false){ + return; + } + me.sync(); + form.submit(); + } + } + } + } + } +}); + +// plugins/background.js +/** + * 背景插件,为UEditor提供设置背景功能 + * @file + * @since 1.2.6.1 + */ +UE.plugin.register('background', function () { + var me = this, + cssRuleId = 'editor_background', + isSetColored, + reg = new RegExp('body[\\s]*\\{(.+)\\}', 'i'); + + function stringToObj(str) { + var obj = {}, styles = str.split(';'); + utils.each(styles, function (v) { + var index = v.indexOf(':'), + key = utils.trim(v.substr(0, index)).toLowerCase(); + key && (obj[key] = utils.trim(v.substr(index + 1) || '')); + }); + return obj; + } + + function setBackground(obj) { + if (obj) { + var styles = []; + for (var name in obj) { + if (obj.hasOwnProperty(name)) { + styles.push(name + ":" + obj[name] + '; '); + } + } + utils.cssRule(cssRuleId, styles.length ? ('body{' + styles.join("") + '}') : '', me.document); + } else { + utils.cssRule(cssRuleId, '', me.document) + } + } + //重写editor.hasContent方法 + + var orgFn = me.hasContents; + me.hasContents = function(){ + if(me.queryCommandValue('background')){ + return true + } + return orgFn.apply(me,arguments); + }; + return { + bindEvents: { + 'getAllHtml': function (type, headHtml) { + var body = this.body, + su = domUtils.getComputedStyle(body, "background-image"), + url = ""; + if (su.indexOf(me.options.imagePath) > 0) { + url = su.substring(su.indexOf(me.options.imagePath), su.length - 1).replace(/"|\(|\)/ig, ""); + } else { + url = su != "none" ? su.replace(/url\("?|"?\)/ig, "") : ""; + } + var html = ' '; + headHtml.push(html); + }, + 'aftersetcontent': function () { + if(isSetColored == false) setBackground(); + } + }, + inputRule: function (root) { + isSetColored = false; + utils.each(root.getNodesByTagName('p'), function (p) { + var styles = p.getAttr('data-background'); + if (styles) { + isSetColored = true; + setBackground(stringToObj(styles)); + p.parentNode.removeChild(p); + } + }) + }, + outputRule: function (root) { + var me = this, + styles = (utils.cssRule(cssRuleId, me.document) || '').replace(/[\n\r]+/g, '').match(reg); + if (styles) { + root.appendChild(UE.uNode.createElement('


    ')); + } + }, + commands: { + 'background': { + execCommand: function (cmd, obj) { + setBackground(obj); + }, + queryCommandValue: function () { + var me = this, + styles = (utils.cssRule(cssRuleId, me.document) || '').replace(/[\n\r]+/g, '').match(reg); + return styles ? stringToObj(styles[1]) : null; + }, + notNeedUndo: true + } + } + } +}); + +// plugins/image.js +/** + * 图片插入、排版插件 + * @file + * @since 1.2.6.1 + */ + +/** + * 图片对齐方式 + * @command imagefloat + * @method execCommand + * @remind 值center为独占一行居中 + * @param { String } cmd 命令字符串 + * @param { String } align 对齐方式,可传left、right、none、center + * @remaind center表示图片独占一行 + * @example + * ```javascript + * editor.execCommand( 'imagefloat', 'center' ); + * ``` + */ + +/** + * 如果选区所在位置是图片区域 + * @command imagefloat + * @method queryCommandValue + * @param { String } cmd 命令字符串 + * @return { String } 返回图片对齐方式 + * @example + * ```javascript + * editor.queryCommandValue( 'imagefloat' ); + * ``` + */ + +UE.commands['imagefloat'] = { + execCommand:function (cmd, align) { + var me = this, + range = me.selection.getRange(); + if (!range.collapsed) { + var img = range.getClosedNode(); + if (img && img.tagName == 'IMG') { + switch (align) { + case 'left': + case 'right': + case 'none': + var pN = img.parentNode, tmpNode, pre, next; + while (dtd.$inline[pN.tagName] || pN.tagName == 'A') { + pN = pN.parentNode; + } + tmpNode = pN; + if (tmpNode.tagName == 'P' && domUtils.getStyle(tmpNode, 'text-align') == 'center') { + if (!domUtils.isBody(tmpNode) && domUtils.getChildCount(tmpNode, function (node) { + return !domUtils.isBr(node) && !domUtils.isWhitespace(node); + }) == 1) { + pre = tmpNode.previousSibling; + next = tmpNode.nextSibling; + if (pre && next && pre.nodeType == 1 && next.nodeType == 1 && pre.tagName == next.tagName && domUtils.isBlockElm(pre)) { + pre.appendChild(tmpNode.firstChild); + while (next.firstChild) { + pre.appendChild(next.firstChild); + } + domUtils.remove(tmpNode); + domUtils.remove(next); + } else { + domUtils.setStyle(tmpNode, 'text-align', ''); + } + + + } + + range.selectNode(img).select(); + } + domUtils.setStyle(img, 'float', align == 'none' ? '' : align); + if(align == 'none'){ + domUtils.removeAttributes(img,'align'); + } + + break; + case 'center': + if (me.queryCommandValue('imagefloat') != 'center') { + pN = img.parentNode; + domUtils.setStyle(img, 'float', ''); + domUtils.removeAttributes(img,'align'); + tmpNode = img; + while (pN && domUtils.getChildCount(pN, function (node) { + return !domUtils.isBr(node) && !domUtils.isWhitespace(node); + }) == 1 + && (dtd.$inline[pN.tagName] || pN.tagName == 'A')) { + tmpNode = pN; + pN = pN.parentNode; + } + range.setStartBefore(tmpNode).setCursor(false); + pN = me.document.createElement('div'); + pN.appendChild(tmpNode); + domUtils.setStyle(tmpNode, 'float', ''); + + me.execCommand('insertHtml', '

    ' + pN.innerHTML + '

    '); + + tmpNode = me.document.getElementById('_img_parent_tmp'); + tmpNode.removeAttribute('id'); + tmpNode = tmpNode.firstChild; + range.selectNode(tmpNode).select(); + //去掉后边多余的元素 + next = tmpNode.parentNode.nextSibling; + if (next && domUtils.isEmptyNode(next)) { + domUtils.remove(next); + } + + } + + break; + } + + } + } + }, + queryCommandValue:function () { + var range = this.selection.getRange(), + startNode, floatStyle; + if (range.collapsed) { + return 'none'; + } + startNode = range.getClosedNode(); + if (startNode && startNode.nodeType == 1 && startNode.tagName == 'IMG') { + floatStyle = domUtils.getComputedStyle(startNode, 'float') || startNode.getAttribute('align'); + + if (floatStyle == 'none') { + floatStyle = domUtils.getComputedStyle(startNode.parentNode, 'text-align') == 'center' ? 'center' : floatStyle; + } + return { + left:1, + right:1, + center:1 + }[floatStyle] ? floatStyle : 'none'; + } + return 'none'; + + + }, + queryCommandState:function () { + var range = this.selection.getRange(), + startNode; + + if (range.collapsed) return -1; + + startNode = range.getClosedNode(); + if (startNode && startNode.nodeType == 1 && startNode.tagName == 'IMG') { + return 0; + } + return -1; + } +}; + + +/** + * 插入图片 + * @command insertimage + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { Object } opt 属性键值对,这些属性都将被复制到当前插入图片 + * @remind 该命令第二个参数可接受一个图片配置项对象的数组,可以插入多张图片, + * 此时数组的每一个元素都是一个Object类型的图片属性集合。 + * @example + * ```javascript + * editor.execCommand( 'insertimage', { + * src:'a/b/c.jpg', + * width:'100', + * height:'100' + * } ); + * ``` + * @example + * ```javascript + * editor.execCommand( 'insertimage', [{ + * src:'a/b/c.jpg', + * width:'100', + * height:'100' + * },{ + * src:'a/b/d.jpg', + * width:'100', + * height:'100' + * }] ); + * ``` + */ + +UE.commands['insertimage'] = { + execCommand:function (cmd, opt) { + opt = utils.isArray(opt) ? opt : [opt]; + if (!opt.length) { + return; + } + var me = this, + range = me.selection.getRange(), + img = range.getClosedNode(); + + if(me.fireEvent('beforeinsertimage', opt) === true){ + return; + } + + function unhtmlData(imgCi) { + + utils.each('width,height,border,hspace,vspace'.split(','), function (item) { + + if (imgCi[item]) { + imgCi[item] = parseInt(imgCi[item], 10) || 0; + } + }); + + utils.each('src,_src'.split(','), function (item) { + + if (imgCi[item]) { + imgCi[item] = utils.unhtmlForUrl(imgCi[item]); + } + }); + utils.each('title,alt'.split(','), function (item) { + + if (imgCi[item]) { + imgCi[item] = utils.unhtml(imgCi[item]); + } + }); + } + + if (img && /img/i.test(img.tagName) && (img.className != "edui-faked-video" || img.className.indexOf("edui-upload-video")!=-1) && !img.getAttribute("word_img")) { + var first = opt.shift(); + var floatStyle = first['floatStyle']; + delete first['floatStyle']; +//// img.style.border = (first.border||0) +"px solid #000"; +//// img.style.margin = (first.margin||0) +"px"; +// img.style.cssText += ';margin:' + (first.margin||0) +"px;" + 'border:' + (first.border||0) +"px solid #000"; + domUtils.setAttributes(img, first); + me.execCommand('imagefloat', floatStyle); + if (opt.length > 0) { + range.setStartAfter(img).setCursor(false, true); + me.execCommand('insertimage', opt); + } + + } else { + var html = [], str = '', ci; + ci = opt[0]; + if (opt.length == 1) { + unhtmlData(ci); + + str = '' + ci.alt + ''; + if (ci['floatStyle'] == 'center') { + str = '

    ' + str + '

    '; + } + html.push(str); + + } else { + for (var i = 0; ci = opt[i++];) { + unhtmlData(ci); + str = '

    '; + html.push(str); + } + } + + me.execCommand('insertHtml', html.join('')); + } + + me.fireEvent('afterinsertimage', opt) + } +}; + + +// plugins/justify.js +/** + * 段落格式 + * @file + * @since 1.2.6.1 + */ + +/** + * 段落对齐方式 + * @command justify + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { String } align 对齐方式:left => 居左,right => 居右,center => 居中,justify => 两端对齐 + * @example + * ```javascript + * editor.execCommand( 'justify', 'center' ); + * ``` + */ +/** + * 如果选区所在位置是段落区域,返回当前段落对齐方式 + * @command justify + * @method queryCommandValue + * @param { String } cmd 命令字符串 + * @return { String } 返回段落对齐方式 + * @example + * ```javascript + * editor.queryCommandValue( 'justify' ); + * ``` + */ + +UE.plugins['justify']=function(){ + var me=this, + block = domUtils.isBlockElm, + defaultValue = { + left:1, + right:1, + center:1, + justify:1 + }, + doJustify = function (range, style) { + var bookmark = range.createBookmark(), + filterFn = function (node) { + return node.nodeType == 1 ? node.tagName.toLowerCase() != 'br' && !domUtils.isBookmarkNode(node) : !domUtils.isWhitespace(node); + }; + + range.enlarge(true); + var bookmark2 = range.createBookmark(), + current = domUtils.getNextDomNode(bookmark2.start, false, filterFn), + tmpRange = range.cloneRange(), + tmpNode; + while (current && !(domUtils.getPosition(current, bookmark2.end) & domUtils.POSITION_FOLLOWING)) { + if (current.nodeType == 3 || !block(current)) { + tmpRange.setStartBefore(current); + while (current && current !== bookmark2.end && !block(current)) { + tmpNode = current; + current = domUtils.getNextDomNode(current, false, null, function (node) { + return !block(node); + }); + } + tmpRange.setEndAfter(tmpNode); + var common = tmpRange.getCommonAncestor(); + if (!domUtils.isBody(common) && block(common)) { + domUtils.setStyles(common, utils.isString(style) ? {'text-align':style} : style); + current = common; + } else { + var p = range.document.createElement('p'); + domUtils.setStyles(p, utils.isString(style) ? {'text-align':style} : style); + var frag = tmpRange.extractContents(); + p.appendChild(frag); + tmpRange.insertNode(p); + current = p; + } + current = domUtils.getNextDomNode(current, false, filterFn); + } else { + current = domUtils.getNextDomNode(current, true, filterFn); + } + } + return range.moveToBookmark(bookmark2).moveToBookmark(bookmark); + }; + + UE.commands['justify'] = { + execCommand:function (cmdName, align) { + var range = this.selection.getRange(), + txt; + + //闭合时单独处理 + if (range.collapsed) { + txt = this.document.createTextNode('p'); + range.insertNode(txt); + } + doJustify(range, align); + if (txt) { + range.setStartBefore(txt).collapse(true); + domUtils.remove(txt); + } + + range.select(); + + + return true; + }, + queryCommandValue:function () { + var startNode = this.selection.getStart(), + value = domUtils.getComputedStyle(startNode, 'text-align'); + return defaultValue[value] ? value : 'left'; + }, + queryCommandState:function () { + var start = this.selection.getStart(), + cell = start && domUtils.findParentByTagName(start, ["td", "th","caption"], true); + + return cell? -1:0; + } + + }; +}; + + +// plugins/font.js +/** + * 字体颜色,背景色,字号,字体,下划线,删除线 + * @file + * @since 1.2.6.1 + */ + +/** + * 字体颜色 + * @command forecolor + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { String } value 色值(必须十六进制) + * @example + * ```javascript + * editor.execCommand( 'forecolor', '#000' ); + * ``` + */ +/** + * 返回选区字体颜色 + * @command forecolor + * @method queryCommandValue + * @param { String } cmd 命令字符串 + * @return { String } 返回字体颜色 + * @example + * ```javascript + * editor.queryCommandValue( 'forecolor' ); + * ``` + */ + +/** + * 字体背景颜色 + * @command backcolor + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { String } value 色值(必须十六进制) + * @example + * ```javascript + * editor.execCommand( 'backcolor', '#000' ); + * ``` + */ +/** + * 返回选区字体颜色 + * @command backcolor + * @method queryCommandValue + * @param { String } cmd 命令字符串 + * @return { String } 返回字体背景颜色 + * @example + * ```javascript + * editor.queryCommandValue( 'backcolor' ); + * ``` + */ + +/** + * 字体大小 + * @command fontsize + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { String } value 字体大小 + * @example + * ```javascript + * editor.execCommand( 'fontsize', '14px' ); + * ``` + */ +/** + * 返回选区字体大小 + * @command fontsize + * @method queryCommandValue + * @param { String } cmd 命令字符串 + * @return { String } 返回字体大小 + * @example + * ```javascript + * editor.queryCommandValue( 'fontsize' ); + * ``` + */ + +/** + * 字体样式 + * @command fontfamily + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { String } value 字体样式 + * @example + * ```javascript + * editor.execCommand( 'fontfamily', '微软雅黑' ); + * ``` + */ +/** + * 返回选区字体样式 + * @command fontfamily + * @method queryCommandValue + * @param { String } cmd 命令字符串 + * @return { String } 返回字体样式 + * @example + * ```javascript + * editor.queryCommandValue( 'fontfamily' ); + * ``` + */ + +/** + * 字体下划线,与删除线互斥 + * @command underline + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'underline' ); + * ``` + */ + +/** + * 字体删除线,与下划线互斥 + * @command strikethrough + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'strikethrough' ); + * ``` + */ + +/** + * 字体边框 + * @command fontborder + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'fontborder' ); + * ``` + */ + +UE.plugins['font'] = function () { + var me = this, + fonts = { + 'forecolor': 'color', + 'backcolor': 'background-color', + 'fontsize': 'font-size', + 'fontfamily': 'font-family', + 'underline': 'text-decoration', + 'strikethrough': 'text-decoration', + 'fontborder': 'border' + }, + needCmd = {'underline': 1, 'strikethrough': 1, 'fontborder': 1}, + needSetChild = { + 'forecolor': 'color', + 'backcolor': 'background-color', + 'fontsize': 'font-size', + 'fontfamily': 'font-family' + + }; + me.setOpt({ + 'fontfamily': [ + { name: 'songti', val: '宋体,SimSun'}, + { name: 'yahei', val: '微软雅黑,Microsoft YaHei'}, + { name: 'kaiti', val: '楷体,楷体_GB2312, SimKai'}, + { name: 'heiti', val: '黑体, SimHei'}, + { name: 'lishu', val: '隶书, SimLi'}, + { name: 'andaleMono', val: 'andale mono'}, + { name: 'arial', val: 'arial, helvetica,sans-serif'}, + { name: 'arialBlack', val: 'arial black,avant garde'}, + { name: 'comicSansMs', val: 'comic sans ms'}, + { name: 'impact', val: 'impact,chicago'}, + { name: 'timesNewRoman', val: 'times new roman'} + ], + 'fontsize': [10, 11, 12, 14, 16, 18, 20, 24, 36] + }); + + function mergeWithParent(node){ + var parent; + while(parent = node.parentNode){ + if(parent.tagName == 'SPAN' && domUtils.getChildCount(parent,function(child){ + return !domUtils.isBookmarkNode(child) && !domUtils.isBr(child) + }) == 1) { + parent.style.cssText += node.style.cssText; + domUtils.remove(node,true); + node = parent; + + }else{ + break; + } + } + + } + function mergeChild(rng,cmdName,value){ + if(needSetChild[cmdName]){ + rng.adjustmentBoundary(); + if(!rng.collapsed && rng.startContainer.nodeType == 1){ + var start = rng.startContainer.childNodes[rng.startOffset]; + if(start && domUtils.isTagNode(start,'span')){ + var bk = rng.createBookmark(); + utils.each(domUtils.getElementsByTagName(start, 'span'), function (span) { + if (!span.parentNode || domUtils.isBookmarkNode(span))return; + if(cmdName == 'backcolor' && domUtils.getComputedStyle(span,'background-color').toLowerCase() === value){ + return; + } + domUtils.removeStyle(span,needSetChild[cmdName]); + if(span.style.cssText.replace(/^\s+$/,'').length == 0){ + domUtils.remove(span,true) + } + }); + rng.moveToBookmark(bk) + } + } + } + + } + function mergesibling(rng,cmdName,value) { + var collapsed = rng.collapsed, + bk = rng.createBookmark(), common; + if (collapsed) { + common = bk.start.parentNode; + while (dtd.$inline[common.tagName]) { + common = common.parentNode; + } + } else { + common = domUtils.getCommonAncestor(bk.start, bk.end); + } + utils.each(domUtils.getElementsByTagName(common, 'span'), function (span) { + if (!span.parentNode || domUtils.isBookmarkNode(span))return; + if (/\s*border\s*:\s*none;?\s*/i.test(span.style.cssText)) { + if(/^\s*border\s*:\s*none;?\s*$/.test(span.style.cssText)){ + domUtils.remove(span, true); + }else{ + domUtils.removeStyle(span,'border'); + } + return + } + if (/border/i.test(span.style.cssText) && span.parentNode.tagName == 'SPAN' && /border/i.test(span.parentNode.style.cssText)) { + span.style.cssText = span.style.cssText.replace(/border[^:]*:[^;]+;?/gi, ''); + } + if(!(cmdName=='fontborder' && value=='none')){ + var next = span.nextSibling; + while (next && next.nodeType == 1 && next.tagName == 'SPAN' ) { + if(domUtils.isBookmarkNode(next) && cmdName == 'fontborder') { + span.appendChild(next); + next = span.nextSibling; + continue; + } + if (next.style.cssText == span.style.cssText) { + domUtils.moveChild(next, span); + domUtils.remove(next); + } + if (span.nextSibling === next) + break; + next = span.nextSibling; + } + } + + + mergeWithParent(span); + if(browser.ie && browser.version > 8 ){ + //拷贝父亲们的特别的属性,这里只做背景颜色的处理 + var parent = domUtils.findParent(span,function(n){return n.tagName == 'SPAN' && /background-color/.test(n.style.cssText)}); + if(parent && !/background-color/.test(span.style.cssText)){ + span.style.backgroundColor = parent.style.backgroundColor; + } + } + + }); + rng.moveToBookmark(bk); + mergeChild(rng,cmdName,value) + } + + me.addInputRule(function (root) { + utils.each(root.getNodesByTagName('u s del font strike'), function (node) { + if (node.tagName == 'font') { + var cssStyle = []; + for (var p in node.attrs) { + switch (p) { + case 'size': + cssStyle.push('font-size:' + + ({ + '1':'10', + '2':'12', + '3':'16', + '4':'18', + '5':'24', + '6':'32', + '7':'48' + }[node.attrs[p]] || node.attrs[p]) + 'px'); + break; + case 'color': + cssStyle.push('color:' + node.attrs[p]); + break; + case 'face': + cssStyle.push('font-family:' + node.attrs[p]); + break; + case 'style': + cssStyle.push(node.attrs[p]); + } + } + node.attrs = { + 'style': cssStyle.join(';') + }; + } else { + var val = node.tagName == 'u' ? 'underline' : 'line-through'; + node.attrs = { + 'style': (node.getAttr('style') || '') + 'text-decoration:' + val + ';' + } + } + node.tagName = 'span'; + }); +// utils.each(root.getNodesByTagName('span'), function (node) { +// var val; +// if(val = node.getAttr('class')){ +// if(/fontstrikethrough/.test(val)){ +// node.setStyle('text-decoration','line-through'); +// if(node.attrs['class']){ +// node.attrs['class'] = node.attrs['class'].replace(/fontstrikethrough/,''); +// }else{ +// node.setAttr('class') +// } +// } +// if(/fontborder/.test(val)){ +// node.setStyle('border','1px solid #000'); +// if(node.attrs['class']){ +// node.attrs['class'] = node.attrs['class'].replace(/fontborder/,''); +// }else{ +// node.setAttr('class') +// } +// } +// } +// }); + }); +// me.addOutputRule(function(root){ +// utils.each(root.getNodesByTagName('span'), function (node) { +// var val; +// if(val = node.getStyle('text-decoration')){ +// if(/line-through/.test(val)){ +// if(node.attrs['class']){ +// node.attrs['class'] += ' fontstrikethrough'; +// }else{ +// node.setAttr('class','fontstrikethrough') +// } +// } +// +// node.setStyle('text-decoration') +// } +// if(val = node.getStyle('border')){ +// if(/1px/.test(val) && /solid/.test(val)){ +// if(node.attrs['class']){ +// node.attrs['class'] += ' fontborder'; +// +// }else{ +// node.setAttr('class','fontborder') +// } +// } +// node.setStyle('border') +// +// } +// }); +// }); + for (var p in fonts) { + (function (cmd, style) { + UE.commands[cmd] = { + execCommand: function (cmdName, value) { + value = value || (this.queryCommandState(cmdName) ? 'none' : cmdName == 'underline' ? 'underline' : + cmdName == 'fontborder' ? '1px solid #000' : + 'line-through'); + var me = this, + range = this.selection.getRange(), + text; + + if (value == 'default') { + + if (range.collapsed) { + text = me.document.createTextNode('font'); + range.insertNode(text).select(); + + } + me.execCommand('removeFormat', 'span,a', style); + if (text) { + range.setStartBefore(text).collapse(true); + domUtils.remove(text); + } + mergesibling(range,cmdName,value); + range.select() + } else { + if (!range.collapsed) { + if (needCmd[cmd] && me.queryCommandValue(cmd)) { + me.execCommand('removeFormat', 'span,a', style); + } + range = me.selection.getRange(); + + range.applyInlineStyle('span', {'style': style + ':' + value}); + mergesibling(range, cmdName,value); + range.select(); + } else { + + var span = domUtils.findParentByTagName(range.startContainer, 'span', true); + text = me.document.createTextNode('font'); + if (span && !span.children.length && !span[browser.ie ? 'innerText' : 'textContent'].replace(fillCharReg, '').length) { + //for ie hack when enter + range.insertNode(text); + if (needCmd[cmd]) { + range.selectNode(text).select(); + me.execCommand('removeFormat', 'span,a', style, null); + + span = domUtils.findParentByTagName(text, 'span', true); + range.setStartBefore(text); + + } + span && (span.style.cssText += ';' + style + ':' + value); + range.collapse(true).select(); + + + } else { + range.insertNode(text); + range.selectNode(text).select(); + span = range.document.createElement('span'); + + if (needCmd[cmd]) { + //a标签内的不处理跳过 + if (domUtils.findParentByTagName(text, 'a', true)) { + range.setStartBefore(text).setCursor(); + domUtils.remove(text); + return; + } + me.execCommand('removeFormat', 'span,a', style); + } + + span.style.cssText = style + ':' + value; + + + text.parentNode.insertBefore(span, text); + //修复,span套span 但样式不继承的问题 + if (!browser.ie || browser.ie && browser.version == 9) { + var spanParent = span.parentNode; + while (!domUtils.isBlockElm(spanParent)) { + if (spanParent.tagName == 'SPAN') { + //opera合并style不会加入";" + span.style.cssText = spanParent.style.cssText + ";" + span.style.cssText; + } + spanParent = spanParent.parentNode; + } + } + + + if (opera) { + setTimeout(function () { + range.setStart(span, 0).collapse(true); + mergesibling(range, cmdName,value); + range.select(); + }); + } else { + range.setStart(span, 0).collapse(true); + mergesibling(range,cmdName,value); + range.select(); + } + + //trace:981 + //domUtils.mergeToParent(span) + } + domUtils.remove(text); + } + + + } + return true; + }, + queryCommandValue: function (cmdName) { + var startNode = this.selection.getStart(); + + //trace:946 + if (cmdName == 'underline' || cmdName == 'strikethrough') { + var tmpNode = startNode, value; + while (tmpNode && !domUtils.isBlockElm(tmpNode) && !domUtils.isBody(tmpNode)) { + if (tmpNode.nodeType == 1) { + value = domUtils.getComputedStyle(tmpNode, style); + if (value != 'none') { + return value; + } + } + + tmpNode = tmpNode.parentNode; + } + return 'none'; + } + if (cmdName == 'fontborder') { + var tmp = startNode, val; + while (tmp && dtd.$inline[tmp.tagName]) { + if (val = domUtils.getComputedStyle(tmp, 'border')) { + + if (/1px/.test(val) && /solid/.test(val)) { + return val; + } + } + tmp = tmp.parentNode; + } + return '' + } + + if( cmdName == 'FontSize' ) { + var styleVal = domUtils.getComputedStyle(startNode, style), + tmp = /^([\d\.]+)(\w+)$/.exec( styleVal ); + + if( tmp ) { + + return Math.floor( tmp[1] ) + tmp[2]; + + } + + return styleVal; + + } + + return domUtils.getComputedStyle(startNode, style); + }, + queryCommandState: function (cmdName) { + if (!needCmd[cmdName]) + return 0; + var val = this.queryCommandValue(cmdName); + if (cmdName == 'fontborder') { + return /1px/.test(val) && /solid/.test(val) + } else { + return cmdName == 'underline' ? /underline/.test(val) : /line\-through/.test(val); + + } + + } + }; + })(p, fonts[p]); + } +}; + +// plugins/link.js +/** + * 超链接 + * @file + * @since 1.2.6.1 + */ + +/** + * 插入超链接 + * @command link + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { Object } options 设置自定义属性,例如:url、title、target + * @example + * ```javascript + * editor.execCommand( 'link', '{ + * url:'ueditor.baidu.com', + * title:'ueditor', + * target:'_blank' + * }' ); + * ``` + */ +/** + * 返回当前选中的第一个超链接节点 + * @command link + * @method queryCommandValue + * @param { String } cmd 命令字符串 + * @return { Element } 超链接节点 + * @example + * ```javascript + * editor.queryCommandValue( 'link' ); + * ``` + */ + +/** + * 取消超链接 + * @command unlink + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'unlink'); + * ``` + */ + +UE.plugins['link'] = function(){ + function optimize( range ) { + var start = range.startContainer,end = range.endContainer; + + if ( start = domUtils.findParentByTagName( start, 'a', true ) ) { + range.setStartBefore( start ); + } + if ( end = domUtils.findParentByTagName( end, 'a', true ) ) { + range.setEndAfter( end ); + } + } + + + UE.commands['unlink'] = { + execCommand : function() { + var range = this.selection.getRange(), + bookmark; + if(range.collapsed && !domUtils.findParentByTagName( range.startContainer, 'a', true )){ + return; + } + bookmark = range.createBookmark(); + optimize( range ); + range.removeInlineStyle( 'a' ).moveToBookmark( bookmark ).select(); + }, + queryCommandState : function(){ + return !this.highlight && this.queryCommandValue('link') ? 0 : -1; + } + + }; + function doLink(range,opt,me){ + var rngClone = range.cloneRange(), + link = me.queryCommandValue('link'); + optimize( range = range.adjustmentBoundary() ); + var start = range.startContainer; + if(start.nodeType == 1 && link){ + start = start.childNodes[range.startOffset]; + if(start && start.nodeType == 1 && start.tagName == 'A' && /^(?:https?|ftp|file)\s*:\s*\/\//.test(start[browser.ie?'innerText':'textContent'])){ + start[browser.ie ? 'innerText' : 'textContent'] = utils.html(opt.textValue||opt.href); + + } + } + if( !rngClone.collapsed || link){ + range.removeInlineStyle( 'a' ); + rngClone = range.cloneRange(); + } + + if ( rngClone.collapsed ) { + var a = range.document.createElement( 'a'), + text = ''; + if(opt.textValue){ + + text = utils.html(opt.textValue); + delete opt.textValue; + }else{ + text = utils.html(opt.href); + + } + domUtils.setAttributes( a, opt ); + start = domUtils.findParentByTagName( rngClone.startContainer, 'a', true ); + if(start && domUtils.isInNodeEndBoundary(rngClone,start)){ + range.setStartAfter(start).collapse(true); + + } + a[browser.ie ? 'innerText' : 'textContent'] = text; + range.insertNode(a).selectNode( a ); + } else { + range.applyInlineStyle( 'a', opt ); + + } + } + UE.commands['link'] = { + execCommand : function( cmdName, opt ) { + var range; + opt._href && (opt._href = utils.unhtml(opt._href,/[<">]/g)); + opt.href && (opt.href = utils.unhtml(opt.href,/[<">]/g)); + opt.textValue && (opt.textValue = utils.unhtml(opt.textValue,/[<">]/g)); + doLink(range=this.selection.getRange(),opt,this); + //闭合都不加占位符,如果加了会在a后边多个占位符节点,导致a是图片背景组成的列表,出现空白问题 + range.collapse().select(true); + + }, + queryCommandValue : function() { + var range = this.selection.getRange(), + node; + if ( range.collapsed ) { +// node = this.selection.getStart(); + //在ie下getstart()取值偏上了 + node = range.startContainer; + node = node.nodeType == 1 ? node : node.parentNode; + + if ( node && (node = domUtils.findParentByTagName( node, 'a', true )) && ! domUtils.isInNodeEndBoundary(range,node)) { + + return node; + } + } else { + //trace:1111 如果是

    xx

    startContainer是p就会找不到a + range.shrinkBoundary(); + var start = range.startContainer.nodeType == 3 || !range.startContainer.childNodes[range.startOffset] ? range.startContainer : range.startContainer.childNodes[range.startOffset], + end = range.endContainer.nodeType == 3 || range.endOffset == 0 ? range.endContainer : range.endContainer.childNodes[range.endOffset-1], + common = range.getCommonAncestor(); + node = domUtils.findParentByTagName( common, 'a', true ); + if ( !node && common.nodeType == 1){ + + var as = common.getElementsByTagName( 'a' ), + ps,pe; + + for ( var i = 0,ci; ci = as[i++]; ) { + ps = domUtils.getPosition( ci, start ),pe = domUtils.getPosition( ci,end); + if ( (ps & domUtils.POSITION_FOLLOWING || ps & domUtils.POSITION_CONTAINS) + && + (pe & domUtils.POSITION_PRECEDING || pe & domUtils.POSITION_CONTAINS) + ) { + node = ci; + break; + } + } + } + return node; + } + + }, + queryCommandState : function() { + //判断如果是视频的话连接不可用 + //fix 853 + var img = this.selection.getRange().getClosedNode(), + flag = img && (img.className == "edui-faked-video" || img.className.indexOf("edui-upload-video")!=-1); + return flag ? -1 : 0; + } + }; +}; + +// plugins/iframe.js +///import core +///import plugins\inserthtml.js +///commands 插入框架 +///commandsName InsertFrame +///commandsTitle 插入Iframe +///commandsDialog dialogs\insertframe + +UE.plugins['insertframe'] = function() { + var me =this; + function deleteIframe(){ + me._iframe && delete me._iframe; + } + + me.addListener("selectionchange",function(){ + deleteIframe(); + }); + +}; + + + +// plugins/scrawl.js +///import core +///commands 涂鸦 +///commandsName Scrawl +///commandsTitle 涂鸦 +///commandsDialog dialogs\scrawl +UE.commands['scrawl'] = { + queryCommandState : function(){ + return ( browser.ie && browser.version <= 8 ) ? -1 :0; + } +}; + + +// plugins/removeformat.js +/** + * 清除格式 + * @file + * @since 1.2.6.1 + */ + +/** + * 清除文字样式 + * @command removeformat + * @method execCommand + * @param { String } cmd 命令字符串 + * @param {String} tags 以逗号隔开的标签。如:strong + * @param {String} style 样式如:color + * @param {String} attrs 属性如:width + * @example + * ```javascript + * editor.execCommand( 'removeformat', 'strong','color','width' ); + * ``` + */ + +UE.plugins['removeformat'] = function(){ + var me = this; + me.setOpt({ + 'removeFormatTags': 'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var', + 'removeFormatAttributes':'class,style,lang,width,height,align,hspace,valign' + }); + me.commands['removeformat'] = { + execCommand : function( cmdName, tags, style, attrs,notIncludeA ) { + + var tagReg = new RegExp( '^(?:' + (tags || this.options.removeFormatTags).replace( /,/g, '|' ) + ')$', 'i' ) , + removeFormatAttributes = style ? [] : (attrs || this.options.removeFormatAttributes).split( ',' ), + range = new dom.Range( this.document ), + bookmark,node,parent, + filter = function( node ) { + return node.nodeType == 1; + }; + + function isRedundantSpan (node) { + if (node.nodeType == 3 || node.tagName.toLowerCase() != 'span'){ + return 0; + } + if (browser.ie) { + //ie 下判断实效,所以只能简单用style来判断 + //return node.style.cssText == '' ? 1 : 0; + var attrs = node.attributes; + if ( attrs.length ) { + for ( var i = 0,l = attrs.length; i + var node = range.startContainer, + tmp, + collapsed = range.collapsed; + while(node.nodeType == 1 && domUtils.isEmptyNode(node) && dtd.$removeEmpty[node.tagName]){ + tmp = node.parentNode; + range.setStartBefore(node); + //trace:937 + //更新结束边界 + if(range.startContainer === range.endContainer){ + range.endOffset--; + } + domUtils.remove(node); + node = tmp; + } + + if(!collapsed){ + node = range.endContainer; + while(node.nodeType == 1 && domUtils.isEmptyNode(node) && dtd.$removeEmpty[node.tagName]){ + tmp = node.parentNode; + range.setEndBefore(node); + domUtils.remove(node); + + node = tmp; + } + + + } + } + + + + range = this.selection.getRange(); + doRemove( range ); + range.select(); + + } + + }; + +}; + + +// plugins/blockquote.js +/** + * 添加引用 + * @file + * @since 1.2.6.1 + */ + +/** + * 添加引用 + * @command blockquote + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'blockquote' ); + * ``` + */ + +/** + * 添加引用 + * @command blockquote + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { Object } attrs 节点属性 + * @example + * ```javascript + * editor.execCommand( 'blockquote',{ + * style: "color: red;" + * } ); + * ``` + */ + + +UE.plugins['blockquote'] = function(){ + var me = this; + function getObj(editor){ + return domUtils.filterNodeList(editor.selection.getStartElementPath(),'blockquote'); + } + me.commands['blockquote'] = { + execCommand : function( cmdName, attrs ) { + var range = this.selection.getRange(), + obj = getObj(this), + blockquote = dtd.blockquote, + bookmark = range.createBookmark(); + + if ( obj ) { + + var start = range.startContainer, + startBlock = domUtils.isBlockElm(start) ? start : domUtils.findParent(start,function(node){return domUtils.isBlockElm(node)}), + + end = range.endContainer, + endBlock = domUtils.isBlockElm(end) ? end : domUtils.findParent(end,function(node){return domUtils.isBlockElm(node)}); + + //处理一下li + startBlock = domUtils.findParentByTagName(startBlock,'li',true) || startBlock; + endBlock = domUtils.findParentByTagName(endBlock,'li',true) || endBlock; + + + if(startBlock.tagName == 'LI' || startBlock.tagName == 'TD' || startBlock === obj || domUtils.isBody(startBlock)){ + domUtils.remove(obj,true); + }else{ + domUtils.breakParent(startBlock,obj); + } + + if(startBlock !== endBlock){ + obj = domUtils.findParentByTagName(endBlock,'blockquote'); + if(obj){ + if(endBlock.tagName == 'LI' || endBlock.tagName == 'TD'|| domUtils.isBody(endBlock)){ + obj.parentNode && domUtils.remove(obj,true); + }else{ + domUtils.breakParent(endBlock,obj); + } + + } + } + + var blockquotes = domUtils.getElementsByTagName(this.document,'blockquote'); + for(var i=0,bi;bi=blockquotes[i++];){ + if(!bi.childNodes.length){ + domUtils.remove(bi); + }else if(domUtils.getPosition(bi,startBlock)&domUtils.POSITION_FOLLOWING && domUtils.getPosition(bi,endBlock)&domUtils.POSITION_PRECEDING){ + domUtils.remove(bi,true); + } + } + + + + + } else { + + var tmpRange = range.cloneRange(), + node = tmpRange.startContainer.nodeType == 1 ? tmpRange.startContainer : tmpRange.startContainer.parentNode, + preNode = node, + doEnd = 1; + + //调整开始 + while ( 1 ) { + if ( domUtils.isBody(node) ) { + if ( preNode !== node ) { + if ( range.collapsed ) { + tmpRange.selectNode( preNode ); + doEnd = 0; + } else { + tmpRange.setStartBefore( preNode ); + } + }else{ + tmpRange.setStart(node,0); + } + + break; + } + if ( !blockquote[node.tagName] ) { + if ( range.collapsed ) { + tmpRange.selectNode( preNode ); + } else{ + tmpRange.setStartBefore( preNode); + } + break; + } + + preNode = node; + node = node.parentNode; + } + + //调整结束 + if ( doEnd ) { + preNode = node = node = tmpRange.endContainer.nodeType == 1 ? tmpRange.endContainer : tmpRange.endContainer.parentNode; + while ( 1 ) { + + if ( domUtils.isBody( node ) ) { + if ( preNode !== node ) { + + tmpRange.setEndAfter( preNode ); + + } else { + tmpRange.setEnd( node, node.childNodes.length ); + } + + break; + } + if ( !blockquote[node.tagName] ) { + tmpRange.setEndAfter( preNode ); + break; + } + + preNode = node; + node = node.parentNode; + } + + } + + + node = range.document.createElement( 'blockquote' ); + domUtils.setAttributes( node, attrs ); + node.appendChild( tmpRange.extractContents() ); + tmpRange.insertNode( node ); + //去除重复的 + var childs = domUtils.getElementsByTagName(node,'blockquote'); + for(var i=0,ci;ci=childs[i++];){ + if(ci.parentNode){ + domUtils.remove(ci,true); + } + } + + } + range.moveToBookmark( bookmark ).select(); + }, + queryCommandState : function() { + return getObj(this) ? 1 : 0; + } + }; +}; + + + +// plugins/convertcase.js +/** + * 大小写转换 + * @file + * @since 1.2.6.1 + */ + +/** + * 把选区内文本变大写,与“tolowercase”命令互斥 + * @command touppercase + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'touppercase' ); + * ``` + */ + +/** + * 把选区内文本变小写,与“touppercase”命令互斥 + * @command tolowercase + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'tolowercase' ); + * ``` + */ +UE.commands['touppercase'] = +UE.commands['tolowercase'] = { + execCommand:function (cmd) { + var me = this; + var rng = me.selection.getRange(); + if(rng.collapsed){ + return rng; + } + var bk = rng.createBookmark(), + bkEnd = bk.end, + filterFn = function( node ) { + return !domUtils.isBr(node) && !domUtils.isWhitespace( node ); + }, + curNode = domUtils.getNextDomNode( bk.start, false, filterFn ); + while ( curNode && (domUtils.getPosition( curNode, bkEnd ) & domUtils.POSITION_PRECEDING) ) { + + if ( curNode.nodeType == 3 ) { + curNode.nodeValue = curNode.nodeValue[cmd == 'touppercase' ? 'toUpperCase' : 'toLowerCase'](); + } + curNode = domUtils.getNextDomNode( curNode, true, filterFn ); + if(curNode === bkEnd){ + break; + } + + } + rng.moveToBookmark(bk).select(); + } +}; + + + +// plugins/indent.js +/** + * 首行缩进 + * @file + * @since 1.2.6.1 + */ + +/** + * 缩进 + * @command indent + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'indent' ); + * ``` + */ +UE.commands['indent'] = { + execCommand : function() { + var me = this,value = me.queryCommandState("indent") ? "0em" : (me.options.indentValue || '2em'); + me.execCommand('Paragraph','p',{style:'text-indent:'+ value}); + }, + queryCommandState : function() { + var pN = domUtils.filterNodeList(this.selection.getStartElementPath(),'p h1 h2 h3 h4 h5 h6'); + return pN && pN.style.textIndent && parseInt(pN.style.textIndent) ? 1 : 0; + } + +}; +UE.commands['lbinsertimage'] = { + execCommand:function(cmdname){ + Bus.default.$emit('showLbUpload',{val:true,fileType:'image',ueditor:this}); + } +}; +UE.commands['lbinsertvideo'] = { + execCommand:function(cmdname){ + Bus.default.$emit('showLbUpload',{val:true,fileType:'video',ueditor:this}); + } +}; +UE.commands['lbinsertmusic'] = { + execCommand:function(cmdname){ + Bus.default.$emit('showLbUpload',{val:true,fileType:'audio',ueditor:this}); + } +}; + +// plugins/print.js +/** + * 打印 + * @file + * @since 1.2.6.1 + */ + +/** + * 打印 + * @command print + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'print' ); + * ``` + */ +UE.commands['print'] = { + execCommand : function(){ + this.window.print(); + }, + notNeedUndo : 1 +}; + + + +// plugins/preview.js +/** + * 预览 + * @file + * @since 1.2.6.1 + */ + +/** + * 预览 + * @command preview + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'preview' ); + * ``` + */ +UE.commands['preview'] = { + execCommand : function(){ + var w = window.open('', '_blank', ''), + d = w.document; + d.open(); + d.write('
    '+this.getContent(null,null,true)+'
    '); + d.close(); + }, + notNeedUndo : 1 +}; + + +// plugins/selectall.js +/** + * 全选 + * @file + * @since 1.2.6.1 + */ + +/** + * 选中所有内容 + * @command selectall + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'selectall' ); + * ``` + */ +UE.plugins['selectall'] = function(){ + var me = this; + me.commands['selectall'] = { + execCommand : function(){ + //去掉了原生的selectAll,因为会出现报错和当内容为空时,不能出现闭合状态的光标 + var me = this,body = me.body, + range = me.selection.getRange(); + range.selectNodeContents(body); + if(domUtils.isEmptyBlock(body)){ + //opera不能自动合并到元素的里边,要手动处理一下 + if(browser.opera && body.firstChild && body.firstChild.nodeType == 1){ + range.setStartAtFirst(body.firstChild); + } + range.collapse(true); + } + range.select(true); + }, + notNeedUndo : 1 + }; + + + //快捷键 + me.addshortcutkey({ + "selectAll" : "ctrl+65" + }); +}; + + +// plugins/paragraph.js +/** + * 段落样式 + * @file + * @since 1.2.6.1 + */ + +/** + * 段落格式 + * @command paragraph + * @method execCommand + * @param { String } cmd 命令字符串 + * @param {String} style 标签值为:'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' + * @param {Object} attrs 标签的属性 + * @example + * ```javascript + * editor.execCommand( 'Paragraph','h1','{ + * class:'test' + * }' ); + * ``` + */ + +/** + * 返回选区内节点标签名 + * @command paragraph + * @method queryCommandValue + * @param { String } cmd 命令字符串 + * @return { String } 节点标签名 + * @example + * ```javascript + * editor.queryCommandValue( 'Paragraph' ); + * ``` + */ + +UE.plugins['paragraph'] = function() { + var me = this, + block = domUtils.isBlockElm, + notExchange = ['TD','LI','PRE'], + + doParagraph = function(range,style,attrs,sourceCmdName){ + var bookmark = range.createBookmark(), + filterFn = function( node ) { + return node.nodeType == 1 ? node.tagName.toLowerCase() != 'br' && !domUtils.isBookmarkNode(node) : !domUtils.isWhitespace( node ); + }, + para; + + range.enlarge( true ); + var bookmark2 = range.createBookmark(), + current = domUtils.getNextDomNode( bookmark2.start, false, filterFn ), + tmpRange = range.cloneRange(), + tmpNode; + while ( current && !(domUtils.getPosition( current, bookmark2.end ) & domUtils.POSITION_FOLLOWING) ) { + if ( current.nodeType == 3 || !block( current ) ) { + tmpRange.setStartBefore( current ); + while ( current && current !== bookmark2.end && !block( current ) ) { + tmpNode = current; + current = domUtils.getNextDomNode( current, false, null, function( node ) { + return !block( node ); + } ); + } + tmpRange.setEndAfter( tmpNode ); + + para = range.document.createElement( style ); + if(attrs){ + domUtils.setAttributes(para,attrs); + if(sourceCmdName && sourceCmdName == 'customstyle' && attrs.style){ + para.style.cssText = attrs.style; + } + } + para.appendChild( tmpRange.extractContents() ); + //需要内容占位 + if(domUtils.isEmptyNode(para)){ + domUtils.fillChar(range.document,para); + + } + + tmpRange.insertNode( para ); + + var parent = para.parentNode; + //如果para上一级是一个block元素且不是body,td就删除它 + if ( block( parent ) && !domUtils.isBody( para.parentNode ) && utils.indexOf(notExchange,parent.tagName)==-1) { + //存储dir,style + if(!(sourceCmdName && sourceCmdName == 'customstyle')){ + parent.getAttribute('dir') && para.setAttribute('dir',parent.getAttribute('dir')); + //trace:1070 + parent.style.cssText && (para.style.cssText = parent.style.cssText + ';' + para.style.cssText); + //trace:1030 + parent.style.textAlign && !para.style.textAlign && (para.style.textAlign = parent.style.textAlign); + parent.style.textIndent && !para.style.textIndent && (para.style.textIndent = parent.style.textIndent); + parent.style.padding && !para.style.padding && (para.style.padding = parent.style.padding); + } + + //trace:1706 选择的就是h1-6要删除 + if(attrs && /h\d/i.test(parent.tagName) && !/h\d/i.test(para.tagName) ){ + domUtils.setAttributes(parent,attrs); + if(sourceCmdName && sourceCmdName == 'customstyle' && attrs.style){ + parent.style.cssText = attrs.style; + } + domUtils.remove(para,true); + para = parent; + }else{ + domUtils.remove( para.parentNode, true ); + } + + } + if( utils.indexOf(notExchange,parent.tagName)!=-1){ + current = parent; + }else{ + current = para; + } + + + current = domUtils.getNextDomNode( current, false, filterFn ); + } else { + current = domUtils.getNextDomNode( current, true, filterFn ); + } + } + return range.moveToBookmark( bookmark2 ).moveToBookmark( bookmark ); + }; + me.setOpt('paragraph',{'p':'', 'h1':'', 'h2':'', 'h3':'', 'h4':'', 'h5':'', 'h6':''}); + me.commands['paragraph'] = { + execCommand : function( cmdName, style,attrs,sourceCmdName ) { + var range = this.selection.getRange(); + //闭合时单独处理 + if(range.collapsed){ + var txt = this.document.createTextNode('p'); + range.insertNode(txt); + //去掉冗余的fillchar + if(browser.ie){ + var node = txt.previousSibling; + if(node && domUtils.isWhitespace(node)){ + domUtils.remove(node); + } + node = txt.nextSibling; + if(node && domUtils.isWhitespace(node)){ + domUtils.remove(node); + } + } + + } + range = doParagraph(range,style,attrs,sourceCmdName); + if(txt){ + range.setStartBefore(txt).collapse(true); + pN = txt.parentNode; + + domUtils.remove(txt); + + if(domUtils.isBlockElm(pN)&&domUtils.isEmptyNode(pN)){ + domUtils.fillNode(this.document,pN); + } + + } + + if(browser.gecko && range.collapsed && range.startContainer.nodeType == 1){ + var child = range.startContainer.childNodes[range.startOffset]; + if(child && child.nodeType == 1 && child.tagName.toLowerCase() == style){ + range.setStart(child,0).collapse(true); + } + } + //trace:1097 原来有true,原因忘了,但去了就不能清除多余的占位符了 + range.select(); + + + return true; + }, + queryCommandValue : function() { + var node = domUtils.filterNodeList(this.selection.getStartElementPath(),'p h1 h2 h3 h4 h5 h6'); + return node ? node.tagName.toLowerCase() : ''; + } + }; +}; + + +// plugins/directionality.js +/** + * 设置文字输入的方向的插件 + * @file + * @since 1.2.6.1 + */ +(function() { + var block = domUtils.isBlockElm , + getObj = function(editor){ +// var startNode = editor.selection.getStart(), +// parents; +// if ( startNode ) { +// //查找所有的是block的父亲节点 +// parents = domUtils.findParents( startNode, true, block, true ); +// for ( var i = 0,ci; ci = parents[i++]; ) { +// if ( ci.getAttribute( 'dir' ) ) { +// return ci; +// } +// } +// } + return domUtils.filterNodeList(editor.selection.getStartElementPath(),function(n){return n && n.nodeType == 1 && n.getAttribute('dir')}); + + }, + doDirectionality = function(range,editor,forward){ + + var bookmark, + filterFn = function( node ) { + return node.nodeType == 1 ? !domUtils.isBookmarkNode(node) : !domUtils.isWhitespace(node); + }, + + obj = getObj( editor ); + + if ( obj && range.collapsed ) { + obj.setAttribute( 'dir', forward ); + return range; + } + bookmark = range.createBookmark(); + range.enlarge( true ); + var bookmark2 = range.createBookmark(), + current = domUtils.getNextDomNode( bookmark2.start, false, filterFn ), + tmpRange = range.cloneRange(), + tmpNode; + while ( current && !(domUtils.getPosition( current, bookmark2.end ) & domUtils.POSITION_FOLLOWING) ) { + if ( current.nodeType == 3 || !block( current ) ) { + tmpRange.setStartBefore( current ); + while ( current && current !== bookmark2.end && !block( current ) ) { + tmpNode = current; + current = domUtils.getNextDomNode( current, false, null, function( node ) { + return !block( node ); + } ); + } + tmpRange.setEndAfter( tmpNode ); + var common = tmpRange.getCommonAncestor(); + if ( !domUtils.isBody( common ) && block( common ) ) { + //遍历到了block节点 + common.setAttribute( 'dir', forward ); + current = common; + } else { + //没有遍历到,添加一个block节点 + var p = range.document.createElement( 'p' ); + p.setAttribute( 'dir', forward ); + var frag = tmpRange.extractContents(); + p.appendChild( frag ); + tmpRange.insertNode( p ); + current = p; + } + + current = domUtils.getNextDomNode( current, false, filterFn ); + } else { + current = domUtils.getNextDomNode( current, true, filterFn ); + } + } + return range.moveToBookmark( bookmark2 ).moveToBookmark( bookmark ); + }; + + /** + * 文字输入方向 + * @command directionality + * @method execCommand + * @param { String } cmdName 命令字符串 + * @param { String } forward 传入'ltr'表示从左向右输入,传入'rtl'表示从右向左输入 + * @example + * ```javascript + * editor.execCommand( 'directionality', 'ltr'); + * ``` + */ + + /** + * 查询当前选区的文字输入方向 + * @command directionality + * @method queryCommandValue + * @param { String } cmdName 命令字符串 + * @return { String } 返回'ltr'表示从左向右输入,返回'rtl'表示从右向左输入 + * @example + * ```javascript + * editor.queryCommandValue( 'directionality'); + * ``` + */ + UE.commands['directionality'] = { + execCommand : function( cmdName,forward ) { + var range = this.selection.getRange(); + //闭合时单独处理 + if(range.collapsed){ + var txt = this.document.createTextNode('d'); + range.insertNode(txt); + } + doDirectionality(range,this,forward); + if(txt){ + range.setStartBefore(txt).collapse(true); + domUtils.remove(txt); + } + + range.select(); + return true; + }, + queryCommandValue : function() { + var node = getObj(this); + return node ? node.getAttribute('dir') : 'ltr'; + } + }; +})(); + + + +// plugins/horizontal.js +/** + * 插入分割线插件 + * @file + * @since 1.2.6.1 + */ + +/** + * 插入分割线 + * @command horizontal + * @method execCommand + * @param { String } cmdName 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'horizontal' ); + * ``` + */ +UE.plugins['horizontal'] = function(){ + var me = this; + me.commands['horizontal'] = { + execCommand : function( cmdName ) { + var me = this; + if(me.queryCommandState(cmdName)!==-1){ + me.execCommand('insertHtml','
    '); + var range = me.selection.getRange(), + start = range.startContainer; + if(start.nodeType == 1 && !start.childNodes[range.startOffset] ){ + + var tmp; + if(tmp = start.childNodes[range.startOffset - 1]){ + if(tmp.nodeType == 1 && tmp.tagName == 'HR'){ + if(me.options.enterTag == 'p'){ + tmp = me.document.createElement('p'); + range.insertNode(tmp); + range.setStart(tmp,0).setCursor(); + + }else{ + tmp = me.document.createElement('br'); + range.insertNode(tmp); + range.setStartBefore(tmp).setCursor(); + } + } + } + + } + return true; + } + + }, + //边界在table里不能加分隔线 + queryCommandState : function() { + return domUtils.filterNodeList(this.selection.getStartElementPath(),'table') ? -1 : 0; + } + }; +// me.addListener('delkeyup',function(){ +// var rng = this.selection.getRange(); +// if(browser.ie && browser.version > 8){ +// rng.txtToElmBoundary(true); +// if(domUtils.isStartInblock(rng)){ +// var tmpNode = rng.startContainer; +// var pre = tmpNode.previousSibling; +// if(pre && domUtils.isTagNode(pre,'hr')){ +// domUtils.remove(pre); +// rng.select(); +// return; +// } +// } +// } +// if(domUtils.isBody(rng.startContainer)){ +// var hr = rng.startContainer.childNodes[rng.startOffset -1]; +// if(hr && hr.nodeName == 'HR'){ +// var next = hr.nextSibling; +// if(next){ +// rng.setStart(next,0) +// }else if(hr.previousSibling){ +// rng.setStartAtLast(hr.previousSibling) +// }else{ +// var p = this.document.createElement('p'); +// hr.parentNode.insertBefore(p,hr); +// domUtils.fillNode(this.document,p); +// rng.setStart(p,0); +// } +// domUtils.remove(hr); +// rng.setCursor(false,true); +// } +// } +// }) + me.addListener('delkeydown',function(name,evt){ + var rng = this.selection.getRange(); + rng.txtToElmBoundary(true); + if(domUtils.isStartInblock(rng)){ + var tmpNode = rng.startContainer; + var pre = tmpNode.previousSibling; + if(pre && domUtils.isTagNode(pre,'hr')){ + domUtils.remove(pre); + rng.select(); + domUtils.preventDefault(evt); + return true; + + } + } + + }) +}; + + + +// plugins/time.js +/** + * 插入时间和日期 + * @file + * @since 1.2.6.1 + */ + +/** + * 插入时间,默认格式:12:59:59 + * @command time + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'time'); + * ``` + */ + +/** + * 插入日期,默认格式:2013-08-30 + * @command date + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'date'); + * ``` + */ +UE.commands['time'] = UE.commands["date"] = { + execCommand : function(cmd, format){ + var date = new Date; + + function formatTime(date, format) { + var hh = ('0' + date.getHours()).slice(-2), + ii = ('0' + date.getMinutes()).slice(-2), + ss = ('0' + date.getSeconds()).slice(-2); + format = format || 'hh:ii:ss'; + return format.replace(/hh/ig, hh).replace(/ii/ig, ii).replace(/ss/ig, ss); + } + function formatDate(date, format) { + var yyyy = ('000' + date.getFullYear()).slice(-4), + yy = yyyy.slice(-2), + mm = ('0' + (date.getMonth()+1)).slice(-2), + dd = ('0' + date.getDate()).slice(-2); + format = format || 'yyyy-mm-dd'; + return format.replace(/yyyy/ig, yyyy).replace(/yy/ig, yy).replace(/mm/ig, mm).replace(/dd/ig, dd); + } + + this.execCommand('insertHtml',cmd == "time" ? formatTime(date, format):formatDate(date, format) ); + } +}; + + +// plugins/rowspacing.js +/** + * 段前段后间距插件 + * @file + * @since 1.2.6.1 + */ + +/** + * 设置段间距 + * @command rowspacing + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { String } value 段间距的值,以px为单位 + * @param { String } dir 间距位置,top或bottom,分别表示段前和段后 + * @example + * ```javascript + * editor.execCommand( 'rowspacing', '10', 'top' ); + * ``` + */ + +UE.plugins['rowspacing'] = function(){ + var me = this; + me.setOpt({ + 'rowspacingtop':['5', '10', '15', '20', '25'], + 'rowspacingbottom':['5', '10', '15', '20', '25'] + + }); + me.commands['rowspacing'] = { + execCommand : function( cmdName,value,dir ) { + this.execCommand('paragraph','p',{style:'margin-'+dir+':'+value + 'px'}); + return true; + }, + queryCommandValue : function(cmdName,dir) { + var pN = domUtils.filterNodeList(this.selection.getStartElementPath(),function(node){return domUtils.isBlockElm(node) }), + value; + //trace:1026 + if(pN){ + value = domUtils.getComputedStyle(pN,'margin-'+dir).replace(/[^\d]/g,''); + return !value ? 0 : value; + } + return 0; + + } + }; +}; + + + + +// plugins/lineheight.js +/** + * 设置行内间距 + * @file + * @since 1.2.6.1 + */ +UE.plugins['lineheight'] = function(){ + var me = this; + me.setOpt({'lineheight':['1', '1.5','1.75','2', '3', '4', '5']}); + + /** + * 行距 + * @command lineheight + * @method execCommand + * @param { String } cmdName 命令字符串 + * @param { String } value 传入的行高值, 该值是当前字体的倍数, 例如: 1.5, 1.75 + * @example + * ```javascript + * editor.execCommand( 'lineheight', 1.5); + * ``` + */ + /** + * 查询当前选区内容的行高大小 + * @command lineheight + * @method queryCommandValue + * @param { String } cmd 命令字符串 + * @return { String } 返回当前行高大小 + * @example + * ```javascript + * editor.queryCommandValue( 'lineheight' ); + * ``` + */ + + me.commands['lineheight'] = { + execCommand : function( cmdName,value ) { + this.execCommand('paragraph','p',{style:'line-height:'+ (value == "1" ? "normal" : value + 'em') }); + return true; + }, + queryCommandValue : function() { + var pN = domUtils.filterNodeList(this.selection.getStartElementPath(),function(node){return domUtils.isBlockElm(node)}); + if(pN){ + var value = domUtils.getComputedStyle(pN,'line-height'); + return value == 'normal' ? 1 : value.replace(/[^\d.]*/ig,""); + } + } + }; +}; + + + + +// plugins/insertcode.js +/** + * 插入代码插件 + * @file + * @since 1.2.6.1 + */ + +UE.plugins['insertcode'] = function() { + var me = this; + me.ready(function(){ + utils.cssRule('pre','pre{margin:.5em 0;padding:.4em .6em;border-radius:8px;background:#f8f8f8;}', + me.document) + }); + me.setOpt('insertcode',{ + 'as3':'ActionScript3', + 'bash':'Bash/Shell', + 'cpp':'C/C++', + 'css':'Css', + 'cf':'CodeFunction', + 'c#':'C#', + 'delphi':'Delphi', + 'diff':'Diff', + 'erlang':'Erlang', + 'groovy':'Groovy', + 'html':'Html', + 'java':'Java', + 'jfx':'JavaFx', + 'js':'Javascript', + 'pl':'Perl', + 'php':'Php', + 'plain':'Plain Text', + 'ps':'PowerShell', + 'python':'Python', + 'ruby':'Ruby', + 'scala':'Scala', + 'sql':'Sql', + 'vb':'Vb', + 'xml':'Xml' + }); + + /** + * 插入代码 + * @command insertcode + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { String } lang 插入代码的语言 + * @example + * ```javascript + * editor.execCommand( 'insertcode', 'javascript' ); + * ``` + */ + + /** + * 如果选区所在位置是插入插入代码区域,返回代码的语言 + * @command insertcode + * @method queryCommandValue + * @param { String } cmd 命令字符串 + * @return { String } 返回代码的语言 + * @example + * ```javascript + * editor.queryCommandValue( 'insertcode' ); + * ``` + */ + + me.commands['insertcode'] = { + execCommand : function(cmd,lang){ + var me = this, + rng = me.selection.getRange(), + pre = domUtils.findParentByTagName(rng.startContainer,'pre',true); + if(pre){ + pre.className = 'brush:'+lang+';toolbar:false;'; + }else{ + var code = ''; + if(rng.collapsed){ + code = browser.ie && browser.ie11below ? (browser.version <= 8 ? ' ':''):'
    '; + }else{ + var frag = rng.extractContents(); + var div = me.document.createElement('div'); + div.appendChild(frag); + + utils.each(UE.filterNode(UE.htmlparser(div.innerHTML.replace(/[\r\t]/g,'')),me.options.filterTxtRules).children,function(node){ + if(browser.ie && browser.ie11below && browser.version > 8){ + + if(node.type =='element'){ + if(node.tagName == 'br'){ + code += '\n' + }else if(!dtd.$empty[node.tagName]){ + utils.each(node.children,function(cn){ + if(cn.type =='element'){ + if(cn.tagName == 'br'){ + code += '\n' + }else if(!dtd.$empty[node.tagName]){ + code += cn.innerText(); + } + }else{ + code += cn.data + } + }) + if(!/\n$/.test(code)){ + code += '\n'; + } + } + }else{ + code += node.data + '\n' + } + if(!node.nextSibling() && /\n$/.test(code)){ + code = code.replace(/\n$/,''); + } + }else{ + if(browser.ie && browser.ie11below){ + + if(node.type =='element'){ + if(node.tagName == 'br'){ + code += '
    ' + }else if(!dtd.$empty[node.tagName]){ + utils.each(node.children,function(cn){ + if(cn.type =='element'){ + if(cn.tagName == 'br'){ + code += '
    ' + }else if(!dtd.$empty[node.tagName]){ + code += cn.innerText(); + } + }else{ + code += cn.data + } + }); + if(!/br>$/.test(code)){ + code += '
    '; + } + } + }else{ + code += node.data + '
    ' + } + if(!node.nextSibling() && /
    $/.test(code)){ + code = code.replace(/
    $/,''); + } + + }else{ + code += (node.type == 'element' ? (dtd.$empty[node.tagName] ? '' : node.innerText()) : node.data); + if(!/br\/?\s*>$/.test(code)){ + if(!node.nextSibling()) + return; + code += '
    ' + } + } + + } + + }); + } + me.execCommand('inserthtml','
    '+code+'
    ',true); + + pre = me.document.getElementById('coder'); + domUtils.removeAttributes(pre,'id'); + var tmpNode = pre.previousSibling; + + if(tmpNode && (tmpNode.nodeType == 3 && tmpNode.nodeValue.length == 1 && browser.ie && browser.version == 6 || domUtils.isEmptyBlock(tmpNode))){ + + domUtils.remove(tmpNode) + } + var rng = me.selection.getRange(); + if(domUtils.isEmptyBlock(pre)){ + rng.setStart(pre,0).setCursor(false,true) + }else{ + rng.selectNodeContents(pre).select() + } + } + + + + }, + queryCommandValue : function(){ + var path = this.selection.getStartElementPath(); + var lang = ''; + utils.each(path,function(node){ + if(node.nodeName =='PRE'){ + var match = node.className.match(/brush:([^;]+)/); + lang = match && match[1] ? match[1] : ''; + return false; + } + }); + return lang; + } + }; + + me.addInputRule(function(root){ + utils.each(root.getNodesByTagName('pre'),function(pre){ + var brs = pre.getNodesByTagName('br'); + if(brs.length){ + browser.ie && browser.ie11below && browser.version > 8 && utils.each(brs,function(br){ + var txt = UE.uNode.createText('\n'); + br.parentNode.insertBefore(txt,br); + br.parentNode.removeChild(br); + }); + return; + } + if(browser.ie && browser.ie11below && browser.version > 8) + return; + var code = pre.innerText().split(/\n/); + pre.innerHTML(''); + utils.each(code,function(c){ + if(c.length){ + pre.appendChild(UE.uNode.createText(c)); + } + pre.appendChild(UE.uNode.createElement('br')) + }) + }) + }); + me.addOutputRule(function(root){ + utils.each(root.getNodesByTagName('pre'),function(pre){ + var code = ''; + utils.each(pre.children,function(n){ + if(n.type == 'text'){ + //在ie下文本内容有可能末尾带有\n要去掉 + //trace:3396 + code += n.data.replace(/[ ]/g,' ').replace(/\n$/,''); + }else{ + if(n.tagName == 'br'){ + code += '\n' + }else{ + code += (!dtd.$empty[n.tagName] ? '' : n.innerText()); + } + + } + + }); + + pre.innerText(code.replace(/( |\n)+$/,'')) + }) + }); + //不需要判断highlight的command列表 + me.notNeedCodeQuery ={ + help:1, + undo:1, + redo:1, + source:1, + print:1, + searchreplace:1, + fullscreen:1, + preview:1, + insertparagraph:1, + elementpath:1, + insertcode:1, + inserthtml:1, + selectall:1 + }; + //将queyCommamndState重置 + var orgQuery = me.queryCommandState; + me.queryCommandState = function(cmd){ + var me = this; + + if(!me.notNeedCodeQuery[cmd.toLowerCase()] && me.selection && me.queryCommandValue('insertcode')){ + return -1; + } + return UE.Editor.prototype.queryCommandState.apply(this,arguments) + }; + me.addListener('beforeenterkeydown',function(){ + var rng = me.selection.getRange(); + var pre = domUtils.findParentByTagName(rng.startContainer,'pre',true); + if(pre){ + me.fireEvent('saveScene'); + if(!rng.collapsed){ + rng.deleteContents(); + } + if(!browser.ie || browser.ie9above){ + var tmpNode = me.document.createElement('br'),pre; + rng.insertNode(tmpNode).setStartAfter(tmpNode).collapse(true); + var next = tmpNode.nextSibling; + if(!next && (!browser.ie || browser.version > 10)){ + rng.insertNode(tmpNode.cloneNode(false)); + }else{ + rng.setStartAfter(tmpNode); + } + pre = tmpNode.previousSibling; + var tmp; + while(pre ){ + tmp = pre; + pre = pre.previousSibling; + if(!pre || pre.nodeName == 'BR'){ + pre = tmp; + break; + } + } + if(pre){ + var str = ''; + while(pre && pre.nodeName != 'BR' && new RegExp('^[\\s'+domUtils.fillChar+']*$').test(pre.nodeValue)){ + str += pre.nodeValue; + pre = pre.nextSibling; + } + if(pre.nodeName != 'BR'){ + var match = pre.nodeValue.match(new RegExp('^([\\s'+domUtils.fillChar+']+)')); + if(match && match[1]){ + str += match[1] + } + + } + if(str){ + str = me.document.createTextNode(str); + rng.insertNode(str).setStartAfter(str); + } + } + rng.collapse(true).select(true); + }else{ + if(browser.version > 8){ + + var txt = me.document.createTextNode('\n'); + var start = rng.startContainer; + if(rng.startOffset == 0){ + var preNode = start.previousSibling; + if(preNode){ + rng.insertNode(txt); + var fillchar = me.document.createTextNode(' '); + rng.setStartAfter(txt).insertNode(fillchar).setStart(fillchar,0).collapse(true).select(true) + } + }else{ + rng.insertNode(txt).setStartAfter(txt); + var fillchar = me.document.createTextNode(' '); + start = rng.startContainer.childNodes[rng.startOffset]; + if(start && !/^\n/.test(start.nodeValue)){ + rng.setStartBefore(txt) + } + rng.insertNode(fillchar).setStart(fillchar,0).collapse(true).select(true) + } + + }else{ + var tmpNode = me.document.createElement('br'); + rng.insertNode(tmpNode); + rng.insertNode(me.document.createTextNode(domUtils.fillChar)); + rng.setStartAfter(tmpNode); + pre = tmpNode.previousSibling; + var tmp; + while(pre ){ + tmp = pre; + pre = pre.previousSibling; + if(!pre || pre.nodeName == 'BR'){ + pre = tmp; + break; + } + } + if(pre){ + var str = ''; + while(pre && pre.nodeName != 'BR' && new RegExp('^[ '+domUtils.fillChar+']*$').test(pre.nodeValue)){ + str += pre.nodeValue; + pre = pre.nextSibling; + } + if(pre.nodeName != 'BR'){ + var match = pre.nodeValue.match(new RegExp('^([ '+domUtils.fillChar+']+)')); + if(match && match[1]){ + str += match[1] + } + + } + + str = me.document.createTextNode(str); + rng.insertNode(str).setStartAfter(str); + } + rng.collapse(true).select(); + } + + + } + me.fireEvent('saveScene'); + return true; + } + + + }); + + me.addListener('tabkeydown',function(cmd,evt){ + var rng = me.selection.getRange(); + var pre = domUtils.findParentByTagName(rng.startContainer,'pre',true); + if(pre){ + me.fireEvent('saveScene'); + if(evt.shiftKey){ + + }else{ + if(!rng.collapsed){ + var bk = rng.createBookmark(); + var start = bk.start.previousSibling; + + while(start){ + if(pre.firstChild === start && !domUtils.isBr(start)){ + pre.insertBefore(me.document.createTextNode(' '),start); + + break; + } + if(domUtils.isBr(start)){ + pre.insertBefore(me.document.createTextNode(' '),start.nextSibling); + + break; + } + start = start.previousSibling; + } + var end = bk.end; + start = bk.start.nextSibling; + if(pre.firstChild === bk.start){ + pre.insertBefore(me.document.createTextNode(' '),start.nextSibling) + + } + while(start && start !== end){ + if(domUtils.isBr(start) && start.nextSibling){ + if(start.nextSibling === end){ + break; + } + pre.insertBefore(me.document.createTextNode(' '),start.nextSibling) + } + + start = start.nextSibling; + } + rng.moveToBookmark(bk).select(); + }else{ + var tmpNode = me.document.createTextNode(' '); + rng.insertNode(tmpNode).setStartAfter(tmpNode).collapse(true).select(true); + } + } + + + me.fireEvent('saveScene'); + return true; + } + + + }); + + + me.addListener('beforeinserthtml',function(evtName,html){ + var me = this, + rng = me.selection.getRange(), + pre = domUtils.findParentByTagName(rng.startContainer,'pre',true); + if(pre){ + if(!rng.collapsed){ + rng.deleteContents() + } + var htmlstr = ''; + if(browser.ie && browser.version > 8){ + + utils.each(UE.filterNode(UE.htmlparser(html),me.options.filterTxtRules).children,function(node){ + if(node.type =='element'){ + if(node.tagName == 'br'){ + htmlstr += '\n' + }else if(!dtd.$empty[node.tagName]){ + utils.each(node.children,function(cn){ + if(cn.type =='element'){ + if(cn.tagName == 'br'){ + htmlstr += '\n' + }else if(!dtd.$empty[node.tagName]){ + htmlstr += cn.innerText(); + } + }else{ + htmlstr += cn.data + } + }) + if(!/\n$/.test(htmlstr)){ + htmlstr += '\n'; + } + } + }else{ + htmlstr += node.data + '\n' + } + if(!node.nextSibling() && /\n$/.test(htmlstr)){ + htmlstr = htmlstr.replace(/\n$/,''); + } + }); + var tmpNode = me.document.createTextNode(utils.html(htmlstr.replace(/ /g,' '))); + rng.insertNode(tmpNode).selectNode(tmpNode).select(); + }else{ + var frag = me.document.createDocumentFragment(); + + utils.each(UE.filterNode(UE.htmlparser(html),me.options.filterTxtRules).children,function(node){ + if(node.type =='element'){ + if(node.tagName == 'br'){ + frag.appendChild(me.document.createElement('br')) + }else if(!dtd.$empty[node.tagName]){ + utils.each(node.children,function(cn){ + if(cn.type =='element'){ + if(cn.tagName == 'br'){ + + frag.appendChild(me.document.createElement('br')) + }else if(!dtd.$empty[node.tagName]){ + frag.appendChild(me.document.createTextNode(utils.html(cn.innerText().replace(/ /g,' ')))); + + } + }else{ + frag.appendChild(me.document.createTextNode(utils.html( cn.data.replace(/ /g,' ')))); + + } + }) + if(frag.lastChild.nodeName != 'BR'){ + frag.appendChild(me.document.createElement('br')) + } + } + }else{ + frag.appendChild(me.document.createTextNode(utils.html( node.data.replace(/ /g,' ')))); + } + if(!node.nextSibling() && frag.lastChild.nodeName == 'BR'){ + frag.removeChild(frag.lastChild) + } + + + }); + rng.insertNode(frag).select(); + + } + + return true; + } + }); + //方向键的处理 + me.addListener('keydown',function(cmd,evt){ + var me = this,keyCode = evt.keyCode || evt.which; + if(keyCode == 40){ + var rng = me.selection.getRange(),pre,start = rng.startContainer; + if(rng.collapsed && (pre = domUtils.findParentByTagName(rng.startContainer,'pre',true)) && !pre.nextSibling){ + var last = pre.lastChild + while(last && last.nodeName == 'BR'){ + last = last.previousSibling; + } + if(last === start || rng.startContainer === pre && rng.startOffset == pre.childNodes.length){ + me.execCommand('insertparagraph'); + domUtils.preventDefault(evt) + } + + } + } + }); + //trace:3395 + me.addListener('delkeydown',function(type,evt){ + var rng = this.selection.getRange(); + rng.txtToElmBoundary(true); + var start = rng.startContainer; + if(domUtils.isTagNode(start,'pre') && rng.collapsed && domUtils.isStartInblock(rng)){ + var p = me.document.createElement('p'); + domUtils.fillNode(me.document,p); + start.parentNode.insertBefore(p,start); + domUtils.remove(start); + rng.setStart(p,0).setCursor(false,true); + domUtils.preventDefault(evt); + return true; + } + }) +}; + + +// plugins/cleardoc.js +/** + * 清空文档插件 + * @file + * @since 1.2.6.1 + */ + +/** + * 清空文档 + * @command cleardoc + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * //editor 是编辑器实例 + * editor.execCommand('cleardoc'); + * ``` + */ + +UE.commands['cleardoc'] = { + execCommand : function( cmdName) { + var me = this, + enterTag = me.options.enterTag, + range = me.selection.getRange(); + if(enterTag == "br"){ + me.body.innerHTML = "
    "; + range.setStart(me.body,0).setCursor(); + }else{ + me.body.innerHTML = "

    "+(ie ? "" : "
    ")+"

    "; + range.setStart(me.body.firstChild,0).setCursor(false,true); + } + setTimeout(function(){ + me.fireEvent("clearDoc"); + },0); + + } +}; + + + +// plugins/anchor.js +/** + * 锚点插件,为UEditor提供插入锚点支持 + * @file + * @since 1.2.6.1 + */ +UE.plugin.register('anchor', function (){ + + return { + bindEvents:{ + 'ready':function(){ + utils.cssRule('anchor', + '.anchorclass{background: url(\'' + + this.options.themePath + + this.options.theme +'/images/anchor.gif\') no-repeat scroll left center transparent;cursor: auto;display: inline-block;height: 16px;width: 15px;}', + this.document); + } + }, + outputRule: function(root){ + utils.each(root.getNodesByTagName('img'),function(a){ + var val; + if(val = a.getAttr('anchorname')){ + a.tagName = 'a'; + a.setAttr({ + anchorname : '', + name : val, + 'class' : '' + }) + } + }) + }, + inputRule:function(root){ + utils.each(root.getNodesByTagName('a'),function(a){ + var val; + if((val = a.getAttr('name')) && !a.getAttr('href')){ + a.tagName = 'img'; + a.setAttr({ + anchorname :a.getAttr('name'), + 'class' : 'anchorclass' + }); + a.setAttr('name') + + } + }) + + }, + commands:{ + /** + * 插入锚点 + * @command anchor + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { String } name 锚点名称字符串 + * @example + * ```javascript + * //editor 是编辑器实例 + * editor.execCommand('anchor', 'anchor1'); + * ``` + */ + 'anchor':{ + execCommand:function (cmd, name) { + var range = this.selection.getRange(),img = range.getClosedNode(); + if (img && img.getAttribute('anchorname')) { + if (name) { + img.setAttribute('anchorname', name); + } else { + range.setStartBefore(img).setCursor(); + domUtils.remove(img); + } + } else { + if (name) { + //只在选区的开始插入 + var anchor = this.document.createElement('img'); + range.collapse(true); + domUtils.setAttributes(anchor,{ + 'anchorname':name, + 'class':'anchorclass' + }); + range.insertNode(anchor).setStartAfter(anchor).setCursor(false,true); + } + } + } + } + } + } +}); + + +// plugins/wordcount.js +///import core +///commands 字数统计 +///commandsName WordCount,wordCount +///commandsTitle 字数统计 +/* + * Created by JetBrains WebStorm. + * User: taoqili + * Date: 11-9-7 + * Time: 下午8:18 + * To change this template use File | Settings | File Templates. + */ + +UE.plugins['wordcount'] = function(){ + var me = this; + me.setOpt('wordCount',true); + me.addListener('contentchange',function(){ + me.fireEvent('wordcount'); + }); + var timer; + me.addListener('ready',function(){ + var me = this; + domUtils.on(me.body,"keyup",function(evt){ + var code = evt.keyCode||evt.which, + //忽略的按键,ctr,alt,shift,方向键 + ignores = {"16":1,"18":1,"20":1,"37":1,"38":1,"39":1,"40":1}; + if(code in ignores) return; + clearTimeout(timer); + timer = setTimeout(function(){ + me.fireEvent('wordcount'); + },200) + }) + }); +}; + + +// plugins/pagebreak.js +/** + * 分页功能插件 + * @file + * @since 1.2.6.1 + */ +UE.plugins['pagebreak'] = function () { + var me = this, + notBreakTags = ['td']; + me.setOpt('pageBreakTag','_ueditor_page_break_tag_'); + + function fillNode(node){ + if(domUtils.isEmptyBlock(node)){ + var firstChild = node.firstChild,tmpNode; + + while(firstChild && firstChild.nodeType == 1 && domUtils.isEmptyBlock(firstChild)){ + tmpNode = firstChild; + firstChild = firstChild.firstChild; + } + !tmpNode && (tmpNode = node); + domUtils.fillNode(me.document,tmpNode); + } + } + //分页符样式添加 + + me.ready(function(){ + utils.cssRule('pagebreak','.pagebreak{display:block;clear:both !important;cursor:default !important;width: 100% !important;margin:0;}',me.document); + }); + function isHr(node){ + return node && node.nodeType == 1 && node.tagName == 'HR' && node.className == 'pagebreak'; + } + me.addInputRule(function(root){ + root.traversal(function(node){ + if(node.type == 'text' && node.data == me.options.pageBreakTag){ + var hr = UE.uNode.createElement('
    '); + node.parentNode.insertBefore(hr,node); + node.parentNode.removeChild(node) + } + }) + }); + me.addOutputRule(function(node){ + utils.each(node.getNodesByTagName('hr'),function(n){ + if(n.getAttr('class') == 'pagebreak'){ + var txt = UE.uNode.createText(me.options.pageBreakTag); + n.parentNode.insertBefore(txt,n); + n.parentNode.removeChild(n); + } + }) + + }); + + /** + * 插入分页符 + * @command pagebreak + * @method execCommand + * @param { String } cmd 命令字符串 + * @remind 在表格中插入分页符会把表格切分成两部分 + * @remind 获取编辑器内的数据时, 编辑器会把分页符转换成“_ueditor_page_break_tag_”字符串, + * 以便于提交数据到服务器端后处理分页。 + * @example + * ```javascript + * editor.execCommand( 'pagebreak'); //插入一个hr标签,带有样式类名pagebreak + * ``` + */ + + me.commands['pagebreak'] = { + execCommand:function () { + var range = me.selection.getRange(),hr = me.document.createElement('hr'); + domUtils.setAttributes(hr,{ + 'class' : 'pagebreak', + noshade:"noshade", + size:"5" + }); + domUtils.unSelectable(hr); + //table单独处理 + var node = domUtils.findParentByTagName(range.startContainer, notBreakTags, true), + + parents = [], pN; + if (node) { + switch (node.tagName) { + case 'TD': + pN = node.parentNode; + if (!pN.previousSibling) { + var table = domUtils.findParentByTagName(pN, 'table'); +// var tableWrapDiv = table.parentNode; +// if(tableWrapDiv && tableWrapDiv.nodeType == 1 +// && tableWrapDiv.tagName == 'DIV' +// && tableWrapDiv.getAttribute('dropdrag') +// ){ +// domUtils.remove(tableWrapDiv,true); +// } + table.parentNode.insertBefore(hr, table); + parents = domUtils.findParents(hr, true); + + } else { + pN.parentNode.insertBefore(hr, pN); + parents = domUtils.findParents(hr); + + } + pN = parents[1]; + if (hr !== pN) { + domUtils.breakParent(hr, pN); + + } + //table要重写绑定一下拖拽 + me.fireEvent('afteradjusttable',me.document); + } + + } else { + + if (!range.collapsed) { + range.deleteContents(); + var start = range.startContainer; + while ( !domUtils.isBody(start) && domUtils.isBlockElm(start) && domUtils.isEmptyNode(start)) { + range.setStartBefore(start).collapse(true); + domUtils.remove(start); + start = range.startContainer; + } + + } + range.insertNode(hr); + + var pN = hr.parentNode, nextNode; + while (!domUtils.isBody(pN)) { + domUtils.breakParent(hr, pN); + nextNode = hr.nextSibling; + if (nextNode && domUtils.isEmptyBlock(nextNode)) { + domUtils.remove(nextNode); + } + pN = hr.parentNode; + } + nextNode = hr.nextSibling; + var pre = hr.previousSibling; + if(isHr(pre)){ + domUtils.remove(pre); + }else{ + pre && fillNode(pre); + } + + if(!nextNode){ + var p = me.document.createElement('p'); + + hr.parentNode.appendChild(p); + domUtils.fillNode(me.document,p); + range.setStart(p,0).collapse(true); + }else{ + if(isHr(nextNode)){ + domUtils.remove(nextNode); + }else{ + fillNode(nextNode); + } + range.setEndAfter(hr).collapse(false); + } + + range.select(true); + + } + + } + }; +}; + +// plugins/wordimage.js +///import core +///commands 本地图片引导上传 +///commandsName WordImage +///commandsTitle 本地图片引导上传 +///commandsDialog dialogs\wordimage + +UE.plugin.register('wordimage',function(){ + var me = this, + images = []; + return { + commands : { + 'wordimage':{ + execCommand:function () { + var images = domUtils.getElementsByTagName(me.body, "img"); + var urlList = []; + for (var i = 0, ci; ci = images[i++];) { + var url = ci.getAttribute("word_img"); + url && urlList.push(url); + } + return urlList; + }, + queryCommandState:function () { + images = domUtils.getElementsByTagName(me.body, "img"); + for (var i = 0, ci; ci = images[i++];) { + if (ci.getAttribute("word_img")) { + return 1; + } + } + return -1; + }, + notNeedUndo:true + } + }, + inputRule : function (root) { + utils.each(root.getNodesByTagName('img'), function (img) { + var attrs = img.attrs, + flag = parseInt(attrs.width) < 128 || parseInt(attrs.height) < 43, + opt = me.options, + src = opt.UEDITOR_HOME_URL + 'themes/default/images/spacer.gif'; + if (attrs['src'] && /^(?:(file:\/+))/.test(attrs['src'])) { + img.setAttr({ + width:attrs.width, + height:attrs.height, + alt:attrs.alt, + word_img: attrs.src, + src:src, + 'style':'background:url(' + ( flag ? opt.themePath + opt.theme + '/images/word.gif' : opt.langPath + opt.lang + '/images/localimage.png') + ') no-repeat center center;border:1px solid #ddd' + }) + } + }) + } + } +}); + +// plugins/dragdrop.js +UE.plugins['dragdrop'] = function (){ + + var me = this; + me.ready(function(){ + domUtils.on(this.body,'dragend',function(){ + var rng = me.selection.getRange(); + var node = rng.getClosedNode()||me.selection.getStart(); + + if(node && node.tagName == 'IMG'){ + + var pre = node.previousSibling,next; + while(next = node.nextSibling){ + if(next.nodeType == 1 && next.tagName == 'SPAN' && !next.firstChild){ + domUtils.remove(next) + }else{ + break; + } + } + + + if((pre && pre.nodeType == 1 && !domUtils.isEmptyBlock(pre) || !pre) && (!next || next && !domUtils.isEmptyBlock(next))){ + if(pre && pre.tagName == 'P' && !domUtils.isEmptyBlock(pre)){ + pre.appendChild(node); + domUtils.moveChild(next,pre); + domUtils.remove(next); + }else if(next && next.tagName == 'P' && !domUtils.isEmptyBlock(next)){ + next.insertBefore(node,next.firstChild); + } + + if(pre && pre.tagName == 'P' && domUtils.isEmptyBlock(pre)){ + domUtils.remove(pre) + } + if(next && next.tagName == 'P' && domUtils.isEmptyBlock(next)){ + domUtils.remove(next) + } + rng.selectNode(node).select(); + me.fireEvent('saveScene'); + + } + + } + + }) + }); + me.addListener('keyup', function(type, evt) { + var keyCode = evt.keyCode || evt.which; + if (keyCode == 13) { + var rng = me.selection.getRange(),node; + if(node = domUtils.findParentByTagName(rng.startContainer,'p',true)){ + if(domUtils.getComputedStyle(node,'text-align') == 'center'){ + domUtils.removeStyle(node,'text-align') + } + } + } + }) +}; + + +// plugins/undo.js +/** + * undo redo + * @file + * @since 1.2.6.1 + */ + +/** + * 撤销上一次执行的命令 + * @command undo + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'undo' ); + * ``` + */ + +/** + * 重做上一次执行的命令 + * @command redo + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'redo' ); + * ``` + */ + +UE.plugins['undo'] = function () { + var saveSceneTimer; + var me = this, + maxUndoCount = me.options.maxUndoCount || 20, + maxInputCount = me.options.maxInputCount || 20, + fillchar = new RegExp(domUtils.fillChar + '|<\/hr>', 'gi');// ie会产生多余的 + var noNeedFillCharTags = { + ol:1,ul:1,table:1,tbody:1,tr:1,body:1 + }; + var orgState = me.options.autoClearEmptyNode; + function compareAddr(indexA, indexB) { + if (indexA.length != indexB.length) + return 0; + for (var i = 0, l = indexA.length; i < l; i++) { + if (indexA[i] != indexB[i]) + return 0 + } + return 1; + } + + function compareRangeAddress(rngAddrA, rngAddrB) { + if (rngAddrA.collapsed != rngAddrB.collapsed) { + return 0; + } + if (!compareAddr(rngAddrA.startAddress, rngAddrB.startAddress) || !compareAddr(rngAddrA.endAddress, rngAddrB.endAddress)) { + return 0; + } + return 1; + } + + function UndoManager() { + this.list = []; + this.index = 0; + this.hasUndo = false; + this.hasRedo = false; + this.undo = function () { + if (this.hasUndo) { + if (!this.list[this.index - 1] && this.list.length == 1) { + this.reset(); + return; + } + while (this.list[this.index].content == this.list[this.index - 1].content) { + this.index--; + if (this.index == 0) { + return this.restore(0); + } + } + this.restore(--this.index); + } + }; + this.redo = function () { + if (this.hasRedo) { + while (this.list[this.index].content == this.list[this.index + 1].content) { + this.index++; + if (this.index == this.list.length - 1) { + return this.restore(this.index); + } + } + this.restore(++this.index); + } + }; + + this.restore = function () { + var me = this.editor; + var scene = this.list[this.index]; + var root = UE.htmlparser(scene.content.replace(fillchar, '')); + me.options.autoClearEmptyNode = false; + me.filterInputRule(root); + me.options.autoClearEmptyNode = orgState; + //trace:873 + //去掉展位符 + me.document.body.innerHTML = root.toHtml(); + me.fireEvent('afterscencerestore'); + //处理undo后空格不展位的问题 + if (browser.ie) { + utils.each(domUtils.getElementsByTagName(me.document,'td th caption p'),function(node){ + if(domUtils.isEmptyNode(node)){ + domUtils.fillNode(me.document, node); + } + }) + } + + try{ + var rng = new dom.Range(me.document).moveToAddress(scene.address); + rng.select(noNeedFillCharTags[rng.startContainer.nodeName.toLowerCase()]); + }catch(e){} + + this.update(); + this.clearKey(); + //不能把自己reset了 + me.fireEvent('reset', true); + }; + + this.getScene = function () { + var me = this.editor; + var rng = me.selection.getRange(), + rngAddress = rng.createAddress(false,true); + me.fireEvent('beforegetscene'); + var root = UE.htmlparser(me.body.innerHTML); + me.options.autoClearEmptyNode = false; + me.filterOutputRule(root); + me.options.autoClearEmptyNode = orgState; + var cont = root.toHtml(); + //trace:3461 + //这个会引起回退时导致空格丢失的情况 +// browser.ie && (cont = cont.replace(/> <').replace(/\s*\s*/g, '>')); + me.fireEvent('aftergetscene'); + + return { + address:rngAddress, + content:cont + } + }; + this.save = function (notCompareRange,notSetCursor) { + clearTimeout(saveSceneTimer); + var currentScene = this.getScene(notSetCursor), + lastScene = this.list[this.index]; + + if(lastScene && lastScene.content != currentScene.content){ + me.trigger('contentchange') + } + //内容相同位置相同不存 + if (lastScene && lastScene.content == currentScene.content && + ( notCompareRange ? 1 : compareRangeAddress(lastScene.address, currentScene.address) ) + ) { + return; + } + this.list = this.list.slice(0, this.index + 1); + this.list.push(currentScene); + //如果大于最大数量了,就把最前的剔除 + if (this.list.length > maxUndoCount) { + this.list.shift(); + } + this.index = this.list.length - 1; + this.clearKey(); + //跟新undo/redo状态 + this.update(); + + }; + this.update = function () { + this.hasRedo = !!this.list[this.index + 1]; + this.hasUndo = !!this.list[this.index - 1]; + }; + this.reset = function () { + this.list = []; + this.index = 0; + this.hasUndo = false; + this.hasRedo = false; + this.clearKey(); + }; + this.clearKey = function () { + keycont = 0; + lastKeyCode = null; + }; + } + + me.undoManger = new UndoManager(); + me.undoManger.editor = me; + function saveScene() { + this.undoManger.save(); + } + + me.addListener('saveScene', function () { + var args = Array.prototype.splice.call(arguments,1); + this.undoManger.save.apply(this.undoManger,args); + }); + +// me.addListener('beforeexeccommand', saveScene); +// me.addListener('afterexeccommand', saveScene); + + me.addListener('reset', function (type, exclude) { + if (!exclude) { + this.undoManger.reset(); + } + }); + me.commands['redo'] = me.commands['undo'] = { + execCommand:function (cmdName) { + this.undoManger[cmdName](); + }, + queryCommandState:function (cmdName) { + return this.undoManger['has' + (cmdName.toLowerCase() == 'undo' ? 'Undo' : 'Redo')] ? 0 : -1; + }, + notNeedUndo:1 + }; + + var keys = { + // /*Backspace*/ 8:1, /*Delete*/ 46:1, + /*Shift*/ 16:1, /*Ctrl*/ 17:1, /*Alt*/ 18:1, + 37:1, 38:1, 39:1, 40:1 + + }, + keycont = 0, + lastKeyCode; + //输入法状态下不计算字符数 + var inputType = false; + me.addListener('ready', function () { + domUtils.on(this.body, 'compositionstart', function () { + inputType = true; + }); + domUtils.on(this.body, 'compositionend', function () { + inputType = false; + }) + }); + //快捷键 + me.addshortcutkey({ + "Undo":"ctrl+90", //undo + "Redo":"ctrl+89" //redo + + }); + var isCollapsed = true; + me.addListener('keydown', function (type, evt) { + + var me = this; + var keyCode = evt.keyCode || evt.which; + if (!keys[keyCode] && !evt.ctrlKey && !evt.metaKey && !evt.shiftKey && !evt.altKey) { + if (inputType) + return; + + if(!me.selection.getRange().collapsed){ + me.undoManger.save(false,true); + isCollapsed = false; + return; + } + if (me.undoManger.list.length == 0) { + me.undoManger.save(true); + } + clearTimeout(saveSceneTimer); + function save(cont){ + cont.undoManger.save(false,true); + cont.fireEvent('selectionchange'); + } + saveSceneTimer = setTimeout(function(){ + if(inputType){ + var interalTimer = setInterval(function(){ + if(!inputType){ + save(me); + clearInterval(interalTimer) + } + },300) + return; + } + save(me); + },200); + + lastKeyCode = keyCode; + keycont++; + if (keycont >= maxInputCount ) { + save(me) + } + } + }); + me.addListener('keyup', function (type, evt) { + var keyCode = evt.keyCode || evt.which; + if (!keys[keyCode] && !evt.ctrlKey && !evt.metaKey && !evt.shiftKey && !evt.altKey) { + if (inputType) + return; + if(!isCollapsed){ + this.undoManger.save(false,true); + isCollapsed = true; + } + } + }); + //扩展实例,添加关闭和开启命令undo + me.stopCmdUndo = function(){ + me.__hasEnterExecCommand = true; + }; + me.startCmdUndo = function(){ + me.__hasEnterExecCommand = false; + } +}; + + +// plugins/copy.js +UE.plugin.register('copy', function () { + + var me = this; + + function initZeroClipboard() { + + ZeroClipboard.config({ + debug: false, + swfPath: me.options.UEDITOR_HOME_URL + 'third-party/zeroclipboard/ZeroClipboard.swf' + }); + + var client = me.zeroclipboard = new ZeroClipboard(); + + // 复制内容 + client.on('copy', function (e) { + var client = e.client, + rng = me.selection.getRange(), + div = document.createElement('div'); + + div.appendChild(rng.cloneContents()); + client.setText(div.innerText || div.textContent); + client.setHtml(div.innerHTML); + rng.select(); + }); + // hover事件传递到target + client.on('mouseover mouseout', function (e) { + var target = e.target; + if (e.type == 'mouseover') { + domUtils.addClass(target, 'edui-state-hover'); + } else if (e.type == 'mouseout') { + domUtils.removeClasses(target, 'edui-state-hover'); + } + }); + // flash加载不成功 + client.on('wrongflash noflash', function () { + ZeroClipboard.destroy(); + }); + } + + return { + bindEvents: { + 'ready': function () { + if (!browser.ie) { + if (window.ZeroClipboard) { + initZeroClipboard(); + } else { + utils.loadFile(document, { + src: me.options.UEDITOR_HOME_URL + "third-party/zeroclipboard/ZeroClipboard.js", + tag: "script", + type: "text/javascript", + defer: "defer" + }, function () { + initZeroClipboard(); + }); + } + } + } + }, + commands: { + 'copy': { + execCommand: function (cmd) { + if (!me.document.execCommand('copy')) { + alert(me.getLang('copymsg')); + } + } + } + } + } +}); + + +// plugins/paste.js +///import core +///import plugins/inserthtml.js +///import plugins/undo.js +///import plugins/serialize.js +///commands 粘贴 +///commandsName PastePlain +///commandsTitle 纯文本粘贴模式 +/** + * @description 粘贴 + * @author zhanyi + */ +UE.plugins['paste'] = function () { + function getClipboardData(callback) { + var doc = this.document; + if (doc.getElementById('baidu_pastebin')) { + return; + } + var range = this.selection.getRange(), + bk = range.createBookmark(), + //创建剪贴的容器div + pastebin = doc.createElement('div'); + pastebin.id = 'baidu_pastebin'; + // Safari 要求div必须有内容,才能粘贴内容进来 + browser.webkit && pastebin.appendChild(doc.createTextNode(domUtils.fillChar + domUtils.fillChar)); + doc.body.appendChild(pastebin); + //trace:717 隐藏的span不能得到top + //bk.start.innerHTML = ' '; + bk.start.style.display = ''; + pastebin.style.cssText = "position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:" + + //要在现在光标平行的位置加入,否则会出现跳动的问题 + domUtils.getXY(bk.start).y + 'px'; + + range.selectNodeContents(pastebin).select(true); + + setTimeout(function () { + if (browser.webkit) { + for (var i = 0, pastebins = doc.querySelectorAll('#baidu_pastebin'), pi; pi = pastebins[i++];) { + if (domUtils.isEmptyNode(pi)) { + domUtils.remove(pi); + } else { + pastebin = pi; + break; + } + } + } + try { + pastebin.parentNode.removeChild(pastebin); + } catch (e) { + } + range.moveToBookmark(bk).select(true); + callback(pastebin); + }, 0); + } + + var me = this; + + me.setOpt({ + retainOnlyLabelPasted : false + }); + + var txtContent, htmlContent, address; + + function getPureHtml(html){ + return html.replace(/<(\/?)([\w\-]+)([^>]*)>/gi, function (a, b, tagName, attrs) { + tagName = tagName.toLowerCase(); + if ({img: 1}[tagName]) { + return a; + } + attrs = attrs.replace(/([\w\-]*?)\s*=\s*(("([^"]*)")|('([^']*)')|([^\s>]+))/gi, function (str, atr, val) { + if ({ + 'src': 1, + 'href': 1, + 'name': 1 + }[atr.toLowerCase()]) { + return atr + '=' + val + ' ' + } + return '' + }); + if ({ + 'span': 1, + 'div': 1 + }[tagName]) { + return '' + } else { + + return '<' + b + tagName + ' ' + utils.trim(attrs) + '>' + } + + }); + } + function filter(div) { + var html; + if (div.firstChild) { + //去掉cut中添加的边界值 + var nodes = domUtils.getElementsByTagName(div, 'span'); + for (var i = 0, ni; ni = nodes[i++];) { + if (ni.id == '_baidu_cut_start' || ni.id == '_baidu_cut_end') { + domUtils.remove(ni); + } + } + + if (browser.webkit) { + + var brs = div.querySelectorAll('div br'); + for (var i = 0, bi; bi = brs[i++];) { + var pN = bi.parentNode; + if (pN.tagName == 'DIV' && pN.childNodes.length == 1) { + pN.innerHTML = '


    '; + domUtils.remove(pN); + } + } + var divs = div.querySelectorAll('#baidu_pastebin'); + for (var i = 0, di; di = divs[i++];) { + var tmpP = me.document.createElement('p'); + di.parentNode.insertBefore(tmpP, di); + while (di.firstChild) { + tmpP.appendChild(di.firstChild); + } + domUtils.remove(di); + } + + var metas = div.querySelectorAll('meta'); + for (var i = 0, ci; ci = metas[i++];) { + domUtils.remove(ci); + } + + var brs = div.querySelectorAll('br'); + for (i = 0; ci = brs[i++];) { + if (/^apple-/i.test(ci.className)) { + domUtils.remove(ci); + } + } + } + if (browser.gecko) { + var dirtyNodes = div.querySelectorAll('[_moz_dirty]'); + for (i = 0; ci = dirtyNodes[i++];) { + ci.removeAttribute('_moz_dirty'); + } + } + if (!browser.ie) { + var spans = div.querySelectorAll('span.Apple-style-span'); + for (var i = 0, ci; ci = spans[i++];) { + domUtils.remove(ci, true); + } + } + + //ie下使用innerHTML会产生多余的\r\n字符,也会产生 这里过滤掉 + html = div.innerHTML;//.replace(/>(?:(\s| )*?)<'); + + //过滤word粘贴过来的冗余属性 + html = UE.filterWord(html); + //取消了忽略空白的第二个参数,粘贴过来的有些是有空白的,会被套上相关的标签 + var root = UE.htmlparser(html); + //如果给了过滤规则就先进行过滤 + if (me.options.filterRules) { + UE.filterNode(root, me.options.filterRules); + } + //执行默认的处理 + me.filterInputRule(root); + //针对chrome的处理 + if (browser.webkit) { + var br = root.lastChild(); + if (br && br.type == 'element' && br.tagName == 'br') { + root.removeChild(br) + } + utils.each(me.body.querySelectorAll('div'), function (node) { + if (domUtils.isEmptyBlock(node)) { + domUtils.remove(node,true) + } + }) + } + html = {'html': root.toHtml()}; + me.fireEvent('beforepaste', html, root); + //抢了默认的粘贴,那后边的内容就不执行了,比如表格粘贴 + if(!html.html){ + return; + } + root = UE.htmlparser(html.html,true); + //如果开启了纯文本模式 + if (me.queryCommandState('pasteplain') === 1) { + me.execCommand('insertHtml', UE.filterNode(root, me.options.filterTxtRules).toHtml(), true); + } else { + //文本模式 + UE.filterNode(root, me.options.filterTxtRules); + txtContent = root.toHtml(); + //完全模式 + htmlContent = html.html; + + address = me.selection.getRange().createAddress(true); + me.execCommand('insertHtml', me.getOpt('retainOnlyLabelPasted') === true ? getPureHtml(htmlContent) : htmlContent, true); + } + me.fireEvent("afterpaste", html); + } + } + + me.addListener('pasteTransfer', function (cmd, plainType) { + + if (address && txtContent && htmlContent && txtContent != htmlContent) { + var range = me.selection.getRange(); + range.moveToAddress(address, true); + + if (!range.collapsed) { + + while (!domUtils.isBody(range.startContainer) + ) { + var start = range.startContainer; + if(start.nodeType == 1){ + start = start.childNodes[range.startOffset]; + if(!start){ + range.setStartBefore(range.startContainer); + continue; + } + var pre = start.previousSibling; + + if(pre && pre.nodeType == 3 && new RegExp('^[\n\r\t '+domUtils.fillChar+']*$').test(pre.nodeValue)){ + range.setStartBefore(pre) + } + } + if(range.startOffset == 0){ + range.setStartBefore(range.startContainer); + }else{ + break; + } + + } + while (!domUtils.isBody(range.endContainer) + ) { + var end = range.endContainer; + if(end.nodeType == 1){ + end = end.childNodes[range.endOffset]; + if(!end){ + range.setEndAfter(range.endContainer); + continue; + } + var next = end.nextSibling; + if(next && next.nodeType == 3 && new RegExp('^[\n\r\t'+domUtils.fillChar+']*$').test(next.nodeValue)){ + range.setEndAfter(next) + } + } + if(range.endOffset == range.endContainer[range.endContainer.nodeType == 3 ? 'nodeValue' : 'childNodes'].length){ + range.setEndAfter(range.endContainer); + }else{ + break; + } + + } + + } + + range.deleteContents(); + range.select(true); + me.__hasEnterExecCommand = true; + var html = htmlContent; + if (plainType === 2 ) { + html = getPureHtml(html); + } else if (plainType) { + html = txtContent; + } + me.execCommand('inserthtml', html, true); + me.__hasEnterExecCommand = false; + var rng = me.selection.getRange(); + while (!domUtils.isBody(rng.startContainer) && !rng.startOffset && + rng.startContainer[rng.startContainer.nodeType == 3 ? 'nodeValue' : 'childNodes'].length + ) { + rng.setStartBefore(rng.startContainer); + } + var tmpAddress = rng.createAddress(true); + address.endAddress = tmpAddress.startAddress; + } + }); + + me.addListener('ready', function () { + domUtils.on(me.body, 'cut', function () { + var range = me.selection.getRange(); + if (!range.collapsed && me.undoManger) { + me.undoManger.save(); + } + }); + + //ie下beforepaste在点击右键时也会触发,所以用监控键盘才处理 + domUtils.on(me.body, browser.ie || browser.opera ? 'keydown' : 'paste', function (e) { + if ((browser.ie || browser.opera) && ((!e.ctrlKey && !e.metaKey) || e.keyCode != '86')) { + return; + } + getClipboardData.call(me, function (div) { + filter(div); + }); + }); + + }); + + me.commands['paste'] = { + execCommand: function (cmd) { + if (browser.ie) { + getClipboardData.call(me, function (div) { + filter(div); + }); + me.document.execCommand('paste'); + } else { + alert(me.getLang('pastemsg')); + } + } + } +}; + + + +// plugins/puretxtpaste.js +/** + * 纯文本粘贴插件 + * @file + * @since 1.2.6.1 + */ + +UE.plugins['pasteplain'] = function(){ + var me = this; + me.setOpt({ + 'pasteplain':false, + 'filterTxtRules' : function(){ + function transP(node){ + node.tagName = 'p'; + node.setStyle(); + } + function removeNode(node){ + node.parentNode.removeChild(node,true) + } + return { + //直接删除及其字节点内容 + '-' : 'script style object iframe embed input select', + 'p': {$:{}}, + 'br':{$:{}}, + div: function (node) { + var tmpNode, p = UE.uNode.createElement('p'); + while (tmpNode = node.firstChild()) { + if (tmpNode.type == 'text' || !UE.dom.dtd.$block[tmpNode.tagName]) { + p.appendChild(tmpNode); + } else { + if (p.firstChild()) { + node.parentNode.insertBefore(p, node); + p = UE.uNode.createElement('p'); + } else { + node.parentNode.insertBefore(tmpNode, node); + } + } + } + if (p.firstChild()) { + node.parentNode.insertBefore(p, node); + } + node.parentNode.removeChild(node); + }, + ol: removeNode, + ul: removeNode, + dl:removeNode, + dt:removeNode, + dd:removeNode, + 'li':removeNode, + 'caption':transP, + 'th':transP, + 'tr':transP, + 'h1':transP,'h2':transP,'h3':transP,'h4':transP,'h5':transP,'h6':transP, + 'td':function(node){ + //没有内容的td直接删掉 + var txt = !!node.innerText(); + if(txt){ + node.parentNode.insertAfter(UE.uNode.createText('    '),node); + } + node.parentNode.removeChild(node,node.innerText()) + } + } + }() + }); + //暂时这里支持一下老版本的属性 + var pasteplain = me.options.pasteplain; + + /** + * 启用或取消纯文本粘贴模式 + * @command pasteplain + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.queryCommandState( 'pasteplain' ); + * ``` + */ + + /** + * 查询当前是否处于纯文本粘贴模式 + * @command pasteplain + * @method queryCommandState + * @param { String } cmd 命令字符串 + * @return { int } 如果处于纯文本模式,返回1,否则,返回0 + * @example + * ```javascript + * editor.queryCommandState( 'pasteplain' ); + * ``` + */ + me.commands['pasteplain'] = { + queryCommandState: function (){ + return pasteplain ? 1 : 0; + }, + execCommand: function (){ + pasteplain = !pasteplain|0; + }, + notNeedUndo : 1 + }; +}; + +// plugins/list.js +/** + * 有序列表,无序列表插件 + * @file + * @since 1.2.6.1 + */ + +UE.plugins['list'] = function () { + var me = this, + notExchange = { + 'TD':1, + 'PRE':1, + 'BLOCKQUOTE':1 + }; + var customStyle = { + 'cn' : 'cn-1-', + 'cn1' : 'cn-2-', + 'cn2' : 'cn-3-', + 'num': 'num-1-', + 'num1' : 'num-2-', + 'num2' : 'num-3-', + 'dash' : 'dash', + 'dot':'dot' + }; + + me.setOpt( { + 'autoTransWordToList':false, + 'insertorderedlist':{ + 'num':'', + 'num1':'', + 'num2':'', + 'cn':'', + 'cn1':'', + 'cn2':'', + 'decimal':'', + 'lower-alpha':'', + 'lower-roman':'', + 'upper-alpha':'', + 'upper-roman':'' + }, + 'insertunorderedlist':{ + 'circle':'', + 'disc':'', + 'square':'', + 'dash' : '', + 'dot':'' + }, + listDefaultPaddingLeft : '30', + listiconpath : 'http://bs.baidu.com/listicon/', + maxListLevel : -1,//-1不限制 + disablePInList:false + } ); + function listToArray(list){ + var arr = []; + for(var p in list){ + arr.push(p) + } + return arr; + } + var listStyle = { + 'OL':listToArray(me.options.insertorderedlist), + 'UL':listToArray(me.options.insertunorderedlist) + }; + var liiconpath = me.options.listiconpath; + + //根据用户配置,调整customStyle + for(var s in customStyle){ + if(!me.options.insertorderedlist.hasOwnProperty(s) && !me.options.insertunorderedlist.hasOwnProperty(s)){ + delete customStyle[s]; + } + } + + me.ready(function () { + var customCss = []; + for(var p in customStyle){ + if(p == 'dash' || p == 'dot'){ + customCss.push('li.list-' + customStyle[p] + '{background-image:url(' + liiconpath +customStyle[p]+'.gif)}'); + customCss.push('ul.custom_'+p+'{list-style:none;}ul.custom_'+p+' li{background-position:0 3px;background-repeat:no-repeat}'); + }else{ + for(var i= 0;i<99;i++){ + customCss.push('li.list-' + customStyle[p] + i + '{background-image:url(' + liiconpath + 'list-'+customStyle[p] + i + '.gif)}') + } + customCss.push('ol.custom_'+p+'{list-style:none;}ol.custom_'+p+' li{background-position:0 3px;background-repeat:no-repeat}'); + } + switch(p){ + case 'cn': + customCss.push('li.list-'+p+'-paddingleft-1{padding-left:25px}'); + customCss.push('li.list-'+p+'-paddingleft-2{padding-left:40px}'); + customCss.push('li.list-'+p+'-paddingleft-3{padding-left:55px}'); + break; + case 'cn1': + customCss.push('li.list-'+p+'-paddingleft-1{padding-left:30px}'); + customCss.push('li.list-'+p+'-paddingleft-2{padding-left:40px}'); + customCss.push('li.list-'+p+'-paddingleft-3{padding-left:55px}'); + break; + case 'cn2': + customCss.push('li.list-'+p+'-paddingleft-1{padding-left:40px}'); + customCss.push('li.list-'+p+'-paddingleft-2{padding-left:55px}'); + customCss.push('li.list-'+p+'-paddingleft-3{padding-left:68px}'); + break; + case 'num': + case 'num1': + customCss.push('li.list-'+p+'-paddingleft-1{padding-left:25px}'); + break; + case 'num2': + customCss.push('li.list-'+p+'-paddingleft-1{padding-left:35px}'); + customCss.push('li.list-'+p+'-paddingleft-2{padding-left:40px}'); + break; + case 'dash': + customCss.push('li.list-'+p+'-paddingleft{padding-left:35px}'); + break; + case 'dot': + customCss.push('li.list-'+p+'-paddingleft{padding-left:20px}'); + } + } + customCss.push('.list-paddingleft-1{padding-left:0}'); + customCss.push('.list-paddingleft-2{padding-left:'+me.options.listDefaultPaddingLeft+'px}'); + customCss.push('.list-paddingleft-3{padding-left:'+me.options.listDefaultPaddingLeft*2+'px}'); + //如果不给宽度会在自定应样式里出现滚动条 + utils.cssRule('list', 'ol,ul{margin:0;pading:0;'+(browser.ie ? '' : 'width:95%')+'}li{clear:both;}'+customCss.join('\n'), me.document); + }); + //单独处理剪切的问题 + me.ready(function(){ + domUtils.on(me.body,'cut',function(){ + setTimeout(function(){ + var rng = me.selection.getRange(),li; + //trace:3416 + if(!rng.collapsed){ + if(li = domUtils.findParentByTagName(rng.startContainer,'li',true)){ + if(!li.nextSibling && domUtils.isEmptyBlock(li)){ + var pn = li.parentNode,node; + if(node = pn.previousSibling){ + domUtils.remove(pn); + rng.setStartAtLast(node).collapse(true); + rng.select(true); + }else if(node = pn.nextSibling){ + domUtils.remove(pn); + rng.setStartAtFirst(node).collapse(true); + rng.select(true); + }else{ + var tmpNode = me.document.createElement('p'); + domUtils.fillNode(me.document,tmpNode); + pn.parentNode.insertBefore(tmpNode,pn); + domUtils.remove(pn); + rng.setStart(tmpNode,0).collapse(true); + rng.select(true); + } + } + } + } + + }) + }) + }); + + function getStyle(node){ + var cls = node.className; + if(domUtils.hasClass(node,/custom_/)){ + return cls.match(/custom_(\w+)/)[1] + } + return domUtils.getStyle(node, 'list-style-type') + + } + + me.addListener('beforepaste',function(type,html){ + var me = this, + rng = me.selection.getRange(),li; + var root = UE.htmlparser(html.html,true); + if(li = domUtils.findParentByTagName(rng.startContainer,'li',true)){ + var list = li.parentNode,tagName = list.tagName == 'OL' ? 'ul':'ol'; + utils.each(root.getNodesByTagName(tagName),function(n){ + n.tagName = list.tagName; + n.setAttr(); + if(n.parentNode === root){ + type = getStyle(list) || (list.tagName == 'OL' ? 'decimal' : 'disc') + }else{ + var className = n.parentNode.getAttr('class'); + if(className && /custom_/.test(className)){ + type = className.match(/custom_(\w+)/)[1] + }else{ + type = n.parentNode.getStyle('list-style-type'); + } + if(!type){ + type = list.tagName == 'OL' ? 'decimal' : 'disc'; + } + } + var index = utils.indexOf(listStyle[list.tagName], type); + if(n.parentNode !== root) + index = index + 1 == listStyle[list.tagName].length ? 0 : index + 1; + var currentStyle = listStyle[list.tagName][index]; + if(customStyle[currentStyle]){ + n.setAttr('class', 'custom_' + currentStyle) + + }else{ + n.setStyle('list-style-type',currentStyle) + } + }) + + } + + html.html = root.toHtml(); + }); + //导出时,去掉p标签 + me.getOpt('disablePInList') === true && me.addOutputRule(function(root){ + utils.each(root.getNodesByTagName('li'),function(li){ + var newChildrens = [],index=0; + utils.each(li.children,function(n){ + if(n.tagName == 'p'){ + var tmpNode; + while(tmpNode = n.children.pop()) { + newChildrens.splice(index,0,tmpNode); + tmpNode.parentNode = li; + lastNode = tmpNode; + } + tmpNode = newChildrens[newChildrens.length-1]; + if(!tmpNode || tmpNode.type != 'element' || tmpNode.tagName != 'br'){ + var br = UE.uNode.createElement('br'); + br.parentNode = li; + newChildrens.push(br); + } + + index = newChildrens.length; + } + }); + if(newChildrens.length){ + li.children = newChildrens; + } + }); + }); + //进入编辑器的li要套p标签 + me.addInputRule(function(root){ + utils.each(root.getNodesByTagName('li'),function(li){ + var tmpP = UE.uNode.createElement('p'); + for(var i= 0,ci;ci=li.children[i];){ + if(ci.type == 'text' || dtd.p[ci.tagName]){ + tmpP.appendChild(ci); + }else{ + if(tmpP.firstChild()){ + li.insertBefore(tmpP,ci); + tmpP = UE.uNode.createElement('p'); + i = i + 2; + }else{ + i++; + } + + } + } + if(tmpP.firstChild() && !tmpP.parentNode || !li.firstChild()){ + li.appendChild(tmpP); + } + //trace:3357 + //p不能为空 + if (!tmpP.firstChild()) { + tmpP.innerHTML(browser.ie ? ' ' : '
    ') + } + //去掉末尾的空白 + var p = li.firstChild(); + var lastChild = p.lastChild(); + if(lastChild && lastChild.type == 'text' && /^\s*$/.test(lastChild.data)){ + p.removeChild(lastChild) + } + }); + if(me.options.autoTransWordToList){ + var orderlisttype = { + 'num1':/^\d+\)/, + 'decimal':/^\d+\./, + 'lower-alpha':/^[a-z]+\)/, + 'upper-alpha':/^[A-Z]+\./, + 'cn':/^[\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+[\u3001]/, + 'cn2':/^\([\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+\)/ + }, + unorderlisttype = { + 'square':'n' + }; + function checkListType(content,container){ + var span = container.firstChild(); + if(span && span.type == 'element' && span.tagName == 'span' && /Wingdings|Symbol/.test(span.getStyle('font-family'))){ + for(var p in unorderlisttype){ + if(unorderlisttype[p] == span.data){ + return p + } + } + return 'disc' + } + for(var p in orderlisttype){ + if(orderlisttype[p].test(content)){ + return p; + } + } + + } + utils.each(root.getNodesByTagName('p'),function(node){ + if(node.getAttr('class') != 'MsoListParagraph'){ + return + } + + //word粘贴过来的会带有margin要去掉,但这样也可能会误命中一些央视 + node.setStyle('margin',''); + node.setStyle('margin-left',''); + node.setAttr('class',''); + + function appendLi(list,p,type){ + if(list.tagName == 'ol'){ + if(browser.ie){ + var first = p.firstChild(); + if(first.type =='element' && first.tagName == 'span' && orderlisttype[type].test(first.innerText())){ + p.removeChild(first); + } + }else{ + p.innerHTML(p.innerHTML().replace(orderlisttype[type],'')); + } + }else{ + p.removeChild(p.firstChild()) + } + + var li = UE.uNode.createElement('li'); + li.appendChild(p); + list.appendChild(li); + } + var tmp = node,type,cacheNode = node; + + if(node.parentNode.tagName != 'li' && (type = checkListType(node.innerText(),node))){ + + var list = UE.uNode.createElement(me.options.insertorderedlist.hasOwnProperty(type) ? 'ol' : 'ul'); + if(customStyle[type]){ + list.setAttr('class','custom_'+type) + }else{ + list.setStyle('list-style-type',type) + } + while(node && node.parentNode.tagName != 'li' && checkListType(node.innerText(),node)){ + tmp = node.nextSibling(); + if(!tmp){ + node.parentNode.insertBefore(list,node) + } + appendLi(list,node,type); + node = tmp; + } + if(!list.parentNode && node && node.parentNode){ + node.parentNode.insertBefore(list,node) + } + } + var span = cacheNode.firstChild(); + if(span && span.type == 'element' && span.tagName == 'span' && /^\s*( )+\s*$/.test(span.innerText())){ + span.parentNode.removeChild(span) + } + }) + } + + }); + + //调整索引标签 + me.addListener('contentchange',function(){ + adjustListStyle(me.document) + }); + + function adjustListStyle(doc,ignore){ + utils.each(domUtils.getElementsByTagName(doc,'ol ul'),function(node){ + + if(!domUtils.inDoc(node,doc)) + return; + + var parent = node.parentNode; + if(parent.tagName == node.tagName){ + var nodeStyleType = getStyle(node) || (node.tagName == 'OL' ? 'decimal' : 'disc'), + parentStyleType = getStyle(parent) || (parent.tagName == 'OL' ? 'decimal' : 'disc'); + if(nodeStyleType == parentStyleType){ + var styleIndex = utils.indexOf(listStyle[node.tagName], nodeStyleType); + styleIndex = styleIndex + 1 == listStyle[node.tagName].length ? 0 : styleIndex + 1; + setListStyle(node,listStyle[node.tagName][styleIndex]) + } + + } + var index = 0,type = 2; + if( domUtils.hasClass(node,/custom_/)){ + if(!(/[ou]l/i.test(parent.tagName) && domUtils.hasClass(parent,/custom_/))){ + type = 1; + } + }else{ + if(/[ou]l/i.test(parent.tagName) && domUtils.hasClass(parent,/custom_/)){ + type = 3; + } + } + + var style = domUtils.getStyle(node, 'list-style-type'); + style && (node.style.cssText = 'list-style-type:' + style); + node.className = utils.trim(node.className.replace(/list-paddingleft-\w+/,'')) + ' list-paddingleft-' + type; + utils.each(domUtils.getElementsByTagName(node,'li'),function(li){ + li.style.cssText && (li.style.cssText = ''); + if(!li.firstChild){ + domUtils.remove(li); + return; + } + if(li.parentNode !== node){ + return; + } + index++; + if(domUtils.hasClass(node,/custom_/) ){ + var paddingLeft = 1,currentStyle = getStyle(node); + if(node.tagName == 'OL'){ + if(currentStyle){ + switch(currentStyle){ + case 'cn' : + case 'cn1': + case 'cn2': + if(index > 10 && (index % 10 == 0 || index > 10 && index < 20)){ + paddingLeft = 2 + }else if(index > 20){ + paddingLeft = 3 + } + break; + case 'num2' : + if(index > 9){ + paddingLeft = 2 + } + } + } + li.className = 'list-'+customStyle[currentStyle]+ index + ' ' + 'list-'+currentStyle+'-paddingleft-' + paddingLeft; + }else{ + li.className = 'list-'+customStyle[currentStyle] + ' ' + 'list-'+currentStyle+'-paddingleft'; + } + }else{ + li.className = li.className.replace(/list-[\w\-]+/gi,''); + } + var className = li.getAttribute('class'); + if(className !== null && !className.replace(/\s/g,'')){ + domUtils.removeAttributes(li,'class') + } + }); + !ignore && adjustList(node,node.tagName.toLowerCase(),getStyle(node)||domUtils.getStyle(node, 'list-style-type'),true); + }) + } + function adjustList(list, tag, style,ignoreEmpty) { + var nextList = list.nextSibling; + if (nextList && nextList.nodeType == 1 && nextList.tagName.toLowerCase() == tag && (getStyle(nextList) || domUtils.getStyle(nextList, 'list-style-type') || (tag == 'ol' ? 'decimal' : 'disc')) == style) { + domUtils.moveChild(nextList, list); + if (nextList.childNodes.length == 0) { + domUtils.remove(nextList); + } + } + if(nextList && domUtils.isFillChar(nextList)){ + domUtils.remove(nextList); + } + var preList = list.previousSibling; + if (preList && preList.nodeType == 1 && preList.tagName.toLowerCase() == tag && (getStyle(preList) || domUtils.getStyle(preList, 'list-style-type') || (tag == 'ol' ? 'decimal' : 'disc')) == style) { + domUtils.moveChild(list, preList); + } + if(preList && domUtils.isFillChar(preList)){ + domUtils.remove(preList); + } + !ignoreEmpty && domUtils.isEmptyBlock(list) && domUtils.remove(list); + if(getStyle(list)){ + adjustListStyle(list.ownerDocument,true) + } + } + + function setListStyle(list,style){ + if(customStyle[style]){ + list.className = 'custom_' + style; + } + try{ + domUtils.setStyle(list, 'list-style-type', style); + }catch(e){} + } + function clearEmptySibling(node) { + var tmpNode = node.previousSibling; + if (tmpNode && domUtils.isEmptyBlock(tmpNode)) { + domUtils.remove(tmpNode); + } + tmpNode = node.nextSibling; + if (tmpNode && domUtils.isEmptyBlock(tmpNode)) { + domUtils.remove(tmpNode); + } + } + + me.addListener('keydown', function (type, evt) { + function preventAndSave() { + evt.preventDefault ? evt.preventDefault() : (evt.returnValue = false); + me.fireEvent('contentchange'); + me.undoManger && me.undoManger.save(); + } + function findList(node,filterFn){ + while(node && !domUtils.isBody(node)){ + if(filterFn(node)){ + return null + } + if(node.nodeType == 1 && /[ou]l/i.test(node.tagName)){ + return node; + } + node = node.parentNode; + } + return null; + } + var keyCode = evt.keyCode || evt.which; + if (keyCode == 13 && !evt.shiftKey) {//回车 + var rng = me.selection.getRange(), + parent = domUtils.findParent(rng.startContainer,function(node){return domUtils.isBlockElm(node)},true), + li = domUtils.findParentByTagName(rng.startContainer,'li',true); + if(parent && parent.tagName != 'PRE' && !li){ + var html = parent.innerHTML.replace(new RegExp(domUtils.fillChar, 'g'),''); + if(/^\s*1\s*\.[^\d]/.test(html)){ + parent.innerHTML = html.replace(/^\s*1\s*\./,''); + rng.setStartAtLast(parent).collapse(true).select(); + me.__hasEnterExecCommand = true; + me.execCommand('insertorderedlist'); + me.__hasEnterExecCommand = false; + } + } + var range = me.selection.getRange(), + start = findList(range.startContainer,function (node) { + return node.tagName == 'TABLE'; + }), + end = range.collapsed ? start : findList(range.endContainer,function (node) { + return node.tagName == 'TABLE'; + }); + + if (start && end && start === end) { + + if (!range.collapsed) { + start = domUtils.findParentByTagName(range.startContainer, 'li', true); + end = domUtils.findParentByTagName(range.endContainer, 'li', true); + if (start && end && start === end) { + range.deleteContents(); + li = domUtils.findParentByTagName(range.startContainer, 'li', true); + if (li && domUtils.isEmptyBlock(li)) { + + pre = li.previousSibling; + next = li.nextSibling; + p = me.document.createElement('p'); + + domUtils.fillNode(me.document, p); + parentList = li.parentNode; + if (pre && next) { + range.setStart(next, 0).collapse(true).select(true); + domUtils.remove(li); + + } else { + if (!pre && !next || !pre) { + + parentList.parentNode.insertBefore(p, parentList); + + + } else { + li.parentNode.parentNode.insertBefore(p, parentList.nextSibling); + } + domUtils.remove(li); + if (!parentList.firstChild) { + domUtils.remove(parentList); + } + range.setStart(p, 0).setCursor(); + + + } + preventAndSave(); + return; + + } + } else { + var tmpRange = range.cloneRange(), + bk = tmpRange.collapse(false).createBookmark(); + + range.deleteContents(); + tmpRange.moveToBookmark(bk); + var li = domUtils.findParentByTagName(tmpRange.startContainer, 'li', true); + + clearEmptySibling(li); + tmpRange.select(); + preventAndSave(); + return; + } + } + + + li = domUtils.findParentByTagName(range.startContainer, 'li', true); + + if (li) { + if (domUtils.isEmptyBlock(li)) { + bk = range.createBookmark(); + var parentList = li.parentNode; + if (li !== parentList.lastChild) { + domUtils.breakParent(li, parentList); + clearEmptySibling(li); + } else { + + parentList.parentNode.insertBefore(li, parentList.nextSibling); + if (domUtils.isEmptyNode(parentList)) { + domUtils.remove(parentList); + } + } + //嵌套不处理 + if (!dtd.$list[li.parentNode.tagName]) { + + if (!domUtils.isBlockElm(li.firstChild)) { + p = me.document.createElement('p'); + li.parentNode.insertBefore(p, li); + while (li.firstChild) { + p.appendChild(li.firstChild); + } + domUtils.remove(li); + } else { + domUtils.remove(li, true); + } + } + range.moveToBookmark(bk).select(); + + + } else { + var first = li.firstChild; + if (!first || !domUtils.isBlockElm(first)) { + var p = me.document.createElement('p'); + + !li.firstChild && domUtils.fillNode(me.document, p); + while (li.firstChild) { + + p.appendChild(li.firstChild); + } + li.appendChild(p); + first = p; + } + + var span = me.document.createElement('span'); + + range.insertNode(span); + domUtils.breakParent(span, li); + + var nextLi = span.nextSibling; + first = nextLi.firstChild; + + if (!first) { + p = me.document.createElement('p'); + + domUtils.fillNode(me.document, p); + nextLi.appendChild(p); + first = p; + } + if (domUtils.isEmptyNode(first)) { + first.innerHTML = ''; + domUtils.fillNode(me.document, first); + } + + range.setStart(first, 0).collapse(true).shrinkBoundary().select(); + domUtils.remove(span); + var pre = nextLi.previousSibling; + if (pre && domUtils.isEmptyBlock(pre)) { + pre.innerHTML = '

    '; + domUtils.fillNode(me.document, pre.firstChild); + } + + } +// } + preventAndSave(); + } + + + } + + + } + if (keyCode == 8) { + //修中ie中li下的问题 + range = me.selection.getRange(); + if (range.collapsed && domUtils.isStartInblock(range)) { + tmpRange = range.cloneRange().trimBoundary(); + li = domUtils.findParentByTagName(range.startContainer, 'li', true); + //要在li的最左边,才能处理 + if (li && domUtils.isStartInblock(tmpRange)) { + start = domUtils.findParentByTagName(range.startContainer, 'p', true); + if (start && start !== li.firstChild) { + var parentList = domUtils.findParentByTagName(start,['ol','ul']); + domUtils.breakParent(start,parentList); + clearEmptySibling(start); + me.fireEvent('contentchange'); + range.setStart(start,0).setCursor(false,true); + me.fireEvent('saveScene'); + domUtils.preventDefault(evt); + return; + } + + if (li && (pre = li.previousSibling)) { + if (keyCode == 46 && li.childNodes.length) { + return; + } + //有可能上边的兄弟节点是个2级菜单,要追加到2级菜单的最后的li + if (dtd.$list[pre.tagName]) { + pre = pre.lastChild; + } + me.undoManger && me.undoManger.save(); + first = li.firstChild; + if (domUtils.isBlockElm(first)) { + if (domUtils.isEmptyNode(first)) { +// range.setEnd(pre, pre.childNodes.length).shrinkBoundary().collapse().select(true); + pre.appendChild(first); + range.setStart(first, 0).setCursor(false, true); + //first不是唯一的节点 + while (li.firstChild) { + pre.appendChild(li.firstChild); + } + } else { + + span = me.document.createElement('span'); + range.insertNode(span); + //判断pre是否是空的节点,如果是


    类型的空节点,干掉p标签防止它占位 + if (domUtils.isEmptyBlock(pre)) { + pre.innerHTML = ''; + } + domUtils.moveChild(li, pre); + range.setStartBefore(span).collapse(true).select(true); + + domUtils.remove(span); + + } + } else { + if (domUtils.isEmptyNode(li)) { + var p = me.document.createElement('p'); + pre.appendChild(p); + range.setStart(p, 0).setCursor(); +// range.setEnd(pre, pre.childNodes.length).shrinkBoundary().collapse().select(true); + } else { + range.setEnd(pre, pre.childNodes.length).collapse().select(true); + while (li.firstChild) { + pre.appendChild(li.firstChild); + } + } + } + domUtils.remove(li); + me.fireEvent('contentchange'); + me.fireEvent('saveScene'); + domUtils.preventDefault(evt); + return; + + } + //trace:980 + + if (li && !li.previousSibling) { + var parentList = li.parentNode; + var bk = range.createBookmark(); + if(domUtils.isTagNode(parentList.parentNode,'ol ul')){ + parentList.parentNode.insertBefore(li,parentList); + if(domUtils.isEmptyNode(parentList)){ + domUtils.remove(parentList) + } + }else{ + + while(li.firstChild){ + parentList.parentNode.insertBefore(li.firstChild,parentList); + } + + domUtils.remove(li); + if(domUtils.isEmptyNode(parentList)){ + domUtils.remove(parentList) + } + + } + range.moveToBookmark(bk).setCursor(false,true); + me.fireEvent('contentchange'); + me.fireEvent('saveScene'); + domUtils.preventDefault(evt); + return; + + } + + + } + + + } + + } + }); + + me.addListener('keyup',function(type, evt){ + var keyCode = evt.keyCode || evt.which; + if (keyCode == 8) { + var rng = me.selection.getRange(),list; + if(list = domUtils.findParentByTagName(rng.startContainer,['ol', 'ul'],true)){ + adjustList(list,list.tagName.toLowerCase(),getStyle(list)||domUtils.getComputedStyle(list,'list-style-type'),true) + } + } + }); + //处理tab键 + me.addListener('tabkeydown',function(){ + + var range = me.selection.getRange(); + + //控制级数 + function checkLevel(li){ + if(me.options.maxListLevel != -1){ + var level = li.parentNode,levelNum = 0; + while(/[ou]l/i.test(level.tagName)){ + levelNum++; + level = level.parentNode; + } + if(levelNum >= me.options.maxListLevel){ + return true; + } + } + } + //只以开始为准 + //todo 后续改进 + var li = domUtils.findParentByTagName(range.startContainer, 'li', true); + if(li){ + + var bk; + if(range.collapsed){ + if(checkLevel(li)) + return true; + var parentLi = li.parentNode, + list = me.document.createElement(parentLi.tagName), + index = utils.indexOf(listStyle[list.tagName], getStyle(parentLi)||domUtils.getComputedStyle(parentLi, 'list-style-type')); + index = index + 1 == listStyle[list.tagName].length ? 0 : index + 1; + var currentStyle = listStyle[list.tagName][index]; + setListStyle(list,currentStyle); + if(domUtils.isStartInblock(range)){ + me.fireEvent('saveScene'); + bk = range.createBookmark(); + parentLi.insertBefore(list, li); + list.appendChild(li); + adjustList(list,list.tagName.toLowerCase(),currentStyle); + me.fireEvent('contentchange'); + range.moveToBookmark(bk).select(true); + return true; + } + }else{ + me.fireEvent('saveScene'); + bk = range.createBookmark(); + for(var i= 0,closeList,parents = domUtils.findParents(li),ci;ci=parents[i++];){ + if(domUtils.isTagNode(ci,'ol ul')){ + closeList = ci; + break; + } + } + var current = li; + if(bk.end){ + while(current && !(domUtils.getPosition(current, bk.end) & domUtils.POSITION_FOLLOWING)){ + if(checkLevel(current)){ + current = domUtils.getNextDomNode(current,false,null,function(node){return node !== closeList}); + continue; + } + var parentLi = current.parentNode, + list = me.document.createElement(parentLi.tagName), + index = utils.indexOf(listStyle[list.tagName], getStyle(parentLi)||domUtils.getComputedStyle(parentLi, 'list-style-type')); + var currentIndex = index + 1 == listStyle[list.tagName].length ? 0 : index + 1; + var currentStyle = listStyle[list.tagName][currentIndex]; + setListStyle(list,currentStyle); + parentLi.insertBefore(list, current); + while(current && !(domUtils.getPosition(current, bk.end) & domUtils.POSITION_FOLLOWING)){ + li = current.nextSibling; + list.appendChild(current); + if(!li || domUtils.isTagNode(li,'ol ul')){ + if(li){ + while(li = li.firstChild){ + if(li.tagName == 'LI'){ + break; + } + } + }else{ + li = domUtils.getNextDomNode(current,false,null,function(node){return node !== closeList}); + } + break; + } + current = li; + } + adjustList(list,list.tagName.toLowerCase(),currentStyle); + current = li; + } + } + me.fireEvent('contentchange'); + range.moveToBookmark(bk).select(); + return true; + } + } + + }); + function getLi(start){ + while(start && !domUtils.isBody(start)){ + if(start.nodeName == 'TABLE'){ + return null; + } + if(start.nodeName == 'LI'){ + return start + } + start = start.parentNode; + } + } + + /** + * 有序列表,与“insertunorderedlist”命令互斥 + * @command insertorderedlist + * @method execCommand + * @param { String } command 命令字符串 + * @param { String } style 插入的有序列表类型,值为:decimal,lower-alpha,lower-roman,upper-alpha,upper-roman,cn,cn1,cn2,num,num1,num2 + * @example + * ```javascript + * editor.execCommand( 'insertorderedlist','decimal'); + * ``` + */ + /** + * 查询当前选区内容是否有序列表 + * @command insertorderedlist + * @method queryCommandState + * @param { String } cmd 命令字符串 + * @return { int } 如果当前选区是有序列表返回1,否则返回0 + * @example + * ```javascript + * editor.queryCommandState( 'insertorderedlist' ); + * ``` + */ + /** + * 查询当前选区内容是否有序列表 + * @command insertorderedlist + * @method queryCommandValue + * @param { String } cmd 命令字符串 + * @return { String } 返回当前有序列表的类型,值为null或decimal,lower-alpha,lower-roman,upper-alpha,upper-roman,cn,cn1,cn2,num,num1,num2 + * @example + * ```javascript + * editor.queryCommandValue( 'insertorderedlist' ); + * ``` + */ + + /** + * 无序列表,与“insertorderedlist”命令互斥 + * @command insertunorderedlist + * @method execCommand + * @param { String } command 命令字符串 + * @param { String } style 插入的无序列表类型,值为:circle,disc,square,dash,dot + * @example + * ```javascript + * editor.execCommand( 'insertunorderedlist','circle'); + * ``` + */ + /** + * 查询当前是否有word文档粘贴进来的图片 + * @command insertunorderedlist + * @method insertunorderedlist + * @param { String } command 命令字符串 + * @return { int } 如果当前选区是无序列表返回1,否则返回0 + * @example + * ```javascript + * editor.queryCommandState( 'insertunorderedlist' ); + * ``` + */ + /** + * 查询当前选区内容是否有序列表 + * @command insertunorderedlist + * @method queryCommandValue + * @param { String } command 命令字符串 + * @return { String } 返回当前无序列表的类型,值为null或circle,disc,square,dash,dot + * @example + * ```javascript + * editor.queryCommandValue( 'insertunorderedlist' ); + * ``` + */ + + me.commands['insertorderedlist'] = + me.commands['insertunorderedlist'] = { + execCommand:function (command, style) { + + if (!style) { + style = command.toLowerCase() == 'insertorderedlist' ? 'decimal' : 'disc'; + } + var me = this, + range = this.selection.getRange(), + filterFn = function (node) { + return node.nodeType == 1 ? node.tagName.toLowerCase() != 'br' : !domUtils.isWhitespace(node); + }, + tag = command.toLowerCase() == 'insertorderedlist' ? 'ol' : 'ul', + frag = me.document.createDocumentFragment(); + //去掉是因为会出现选到末尾,导致adjustmentBoundary缩到ol/ul的位置 + //range.shrinkBoundary();//.adjustmentBoundary(); + range.adjustmentBoundary().shrinkBoundary(); + var bko = range.createBookmark(true), + start = getLi(me.document.getElementById(bko.start)), + modifyStart = 0, + end = getLi(me.document.getElementById(bko.end)), + modifyEnd = 0, + startParent, endParent, + list, tmp; + + if (start || end) { + start && (startParent = start.parentNode); + if (!bko.end) { + end = start; + } + end && (endParent = end.parentNode); + + if (startParent === endParent) { + while (start !== end) { + tmp = start; + start = start.nextSibling; + if (!domUtils.isBlockElm(tmp.firstChild)) { + var p = me.document.createElement('p'); + while (tmp.firstChild) { + p.appendChild(tmp.firstChild); + } + tmp.appendChild(p); + } + frag.appendChild(tmp); + } + tmp = me.document.createElement('span'); + startParent.insertBefore(tmp, end); + if (!domUtils.isBlockElm(end.firstChild)) { + p = me.document.createElement('p'); + while (end.firstChild) { + p.appendChild(end.firstChild); + } + end.appendChild(p); + } + frag.appendChild(end); + domUtils.breakParent(tmp, startParent); + if (domUtils.isEmptyNode(tmp.previousSibling)) { + domUtils.remove(tmp.previousSibling); + } + if (domUtils.isEmptyNode(tmp.nextSibling)) { + domUtils.remove(tmp.nextSibling) + } + var nodeStyle = getStyle(startParent) || domUtils.getComputedStyle(startParent, 'list-style-type') || (command.toLowerCase() == 'insertorderedlist' ? 'decimal' : 'disc'); + if (startParent.tagName.toLowerCase() == tag && nodeStyle == style) { + for (var i = 0, ci, tmpFrag = me.document.createDocumentFragment(); ci = frag.firstChild;) { + if(domUtils.isTagNode(ci,'ol ul')){ +// 删除时,子列表不处理 +// utils.each(domUtils.getElementsByTagName(ci,'li'),function(li){ +// while(li.firstChild){ +// tmpFrag.appendChild(li.firstChild); +// } +// +// }); + tmpFrag.appendChild(ci); + }else{ + while (ci.firstChild) { + + tmpFrag.appendChild(ci.firstChild); + domUtils.remove(ci); + } + } + + } + tmp.parentNode.insertBefore(tmpFrag, tmp); + } else { + list = me.document.createElement(tag); + setListStyle(list,style); + list.appendChild(frag); + tmp.parentNode.insertBefore(list, tmp); + } + + domUtils.remove(tmp); + list && adjustList(list, tag, style); + range.moveToBookmark(bko).select(); + return; + } + //开始 + if (start) { + while (start) { + tmp = start.nextSibling; + if (domUtils.isTagNode(start, 'ol ul')) { + frag.appendChild(start); + } else { + var tmpfrag = me.document.createDocumentFragment(), + hasBlock = 0; + while (start.firstChild) { + if (domUtils.isBlockElm(start.firstChild)) { + hasBlock = 1; + } + tmpfrag.appendChild(start.firstChild); + } + if (!hasBlock) { + var tmpP = me.document.createElement('p'); + tmpP.appendChild(tmpfrag); + frag.appendChild(tmpP); + } else { + frag.appendChild(tmpfrag); + } + domUtils.remove(start); + } + + start = tmp; + } + startParent.parentNode.insertBefore(frag, startParent.nextSibling); + if (domUtils.isEmptyNode(startParent)) { + range.setStartBefore(startParent); + domUtils.remove(startParent); + } else { + range.setStartAfter(startParent); + } + modifyStart = 1; + } + + if (end && domUtils.inDoc(endParent, me.document)) { + //结束 + start = endParent.firstChild; + while (start && start !== end) { + tmp = start.nextSibling; + if (domUtils.isTagNode(start, 'ol ul')) { + frag.appendChild(start); + } else { + tmpfrag = me.document.createDocumentFragment(); + hasBlock = 0; + while (start.firstChild) { + if (domUtils.isBlockElm(start.firstChild)) { + hasBlock = 1; + } + tmpfrag.appendChild(start.firstChild); + } + if (!hasBlock) { + tmpP = me.document.createElement('p'); + tmpP.appendChild(tmpfrag); + frag.appendChild(tmpP); + } else { + frag.appendChild(tmpfrag); + } + domUtils.remove(start); + } + start = tmp; + } + var tmpDiv = domUtils.createElement(me.document, 'div', { + 'tmpDiv':1 + }); + domUtils.moveChild(end, tmpDiv); + + frag.appendChild(tmpDiv); + domUtils.remove(end); + endParent.parentNode.insertBefore(frag, endParent); + range.setEndBefore(endParent); + if (domUtils.isEmptyNode(endParent)) { + domUtils.remove(endParent); + } + + modifyEnd = 1; + } + + + } + + if (!modifyStart) { + range.setStartBefore(me.document.getElementById(bko.start)); + } + if (bko.end && !modifyEnd) { + range.setEndAfter(me.document.getElementById(bko.end)); + } + range.enlarge(true, function (node) { + return notExchange[node.tagName]; + }); + + frag = me.document.createDocumentFragment(); + + var bk = range.createBookmark(), + current = domUtils.getNextDomNode(bk.start, false, filterFn), + tmpRange = range.cloneRange(), + tmpNode, + block = domUtils.isBlockElm; + + while (current && current !== bk.end && (domUtils.getPosition(current, bk.end) & domUtils.POSITION_PRECEDING)) { + + if (current.nodeType == 3 || dtd.li[current.tagName]) { + if (current.nodeType == 1 && dtd.$list[current.tagName]) { + while (current.firstChild) { + frag.appendChild(current.firstChild); + } + tmpNode = domUtils.getNextDomNode(current, false, filterFn); + domUtils.remove(current); + current = tmpNode; + continue; + + } + tmpNode = current; + tmpRange.setStartBefore(current); + + while (current && current !== bk.end && (!block(current) || domUtils.isBookmarkNode(current) )) { + tmpNode = current; + current = domUtils.getNextDomNode(current, false, null, function (node) { + return !notExchange[node.tagName]; + }); + } + + if (current && block(current)) { + tmp = domUtils.getNextDomNode(tmpNode, false, filterFn); + if (tmp && domUtils.isBookmarkNode(tmp)) { + current = domUtils.getNextDomNode(tmp, false, filterFn); + tmpNode = tmp; + } + } + tmpRange.setEndAfter(tmpNode); + + current = domUtils.getNextDomNode(tmpNode, false, filterFn); + + var li = range.document.createElement('li'); + + li.appendChild(tmpRange.extractContents()); + if(domUtils.isEmptyNode(li)){ + var tmpNode = range.document.createElement('p'); + while(li.firstChild){ + tmpNode.appendChild(li.firstChild) + } + li.appendChild(tmpNode); + } + frag.appendChild(li); + } else { + current = domUtils.getNextDomNode(current, true, filterFn); + } + } + range.moveToBookmark(bk).collapse(true); + list = me.document.createElement(tag); + setListStyle(list,style); + list.appendChild(frag); + range.insertNode(list); + //当前list上下看能否合并 + adjustList(list, tag, style); + //去掉冗余的tmpDiv + for (var i = 0, ci, tmpDivs = domUtils.getElementsByTagName(list, 'div'); ci = tmpDivs[i++];) { + if (ci.getAttribute('tmpDiv')) { + domUtils.remove(ci, true) + } + } + range.moveToBookmark(bko).select(); + + }, + queryCommandState:function (command) { + var tag = command.toLowerCase() == 'insertorderedlist' ? 'ol' : 'ul'; + var path = this.selection.getStartElementPath(); + for(var i= 0,ci;ci = path[i++];){ + if(ci.nodeName == 'TABLE'){ + return 0 + } + if(tag == ci.nodeName.toLowerCase()){ + return 1 + }; + } + return 0; + + }, + queryCommandValue:function (command) { + var tag = command.toLowerCase() == 'insertorderedlist' ? 'ol' : 'ul'; + var path = this.selection.getStartElementPath(), + node; + for(var i= 0,ci;ci = path[i++];){ + if(ci.nodeName == 'TABLE'){ + node = null; + break; + } + if(tag == ci.nodeName.toLowerCase()){ + node = ci; + break; + }; + } + return node ? getStyle(node) || domUtils.getComputedStyle(node, 'list-style-type') : null; + } + }; +}; + + + +// plugins/source.js +/** + * 源码编辑插件 + * @file + * @since 1.2.6.1 + */ + +(function (){ + var sourceEditors = { + textarea: function (editor, holder){ + var textarea = holder.ownerDocument.createElement('textarea'); + textarea.style.cssText = 'position:absolute;resize:none;width:100%;height:100%;border:0;padding:0;margin:0;overflow-y:auto;'; + // todo: IE下只有onresize属性可用... 很纠结 + if (browser.ie && browser.version < 8) { + textarea.style.width = holder.offsetWidth + 'px'; + textarea.style.height = holder.offsetHeight + 'px'; + holder.onresize = function (){ + textarea.style.width = holder.offsetWidth + 'px'; + textarea.style.height = holder.offsetHeight + 'px'; + }; + } + holder.appendChild(textarea); + return { + setContent: function (content){ + textarea.value = content; + }, + getContent: function (){ + return textarea.value; + }, + select: function (){ + var range; + if (browser.ie) { + range = textarea.createTextRange(); + range.collapse(true); + range.select(); + } else { + //todo: chrome下无法设置焦点 + textarea.setSelectionRange(0, 0); + textarea.focus(); + } + }, + dispose: function (){ + holder.removeChild(textarea); + // todo + holder.onresize = null; + textarea = null; + holder = null; + } + }; + }, + codemirror: function (editor, holder){ + + var codeEditor = window.CodeMirror(holder, { + mode: "text/html", + tabMode: "indent", + lineNumbers: true, + lineWrapping:true + }); + var dom = codeEditor.getWrapperElement(); + dom.style.cssText = 'position:absolute;left:0;top:0;width:100%;height:100%;font-family:consolas,"Courier new",monospace;font-size:13px;'; + codeEditor.getScrollerElement().style.cssText = 'position:absolute;left:0;top:0;width:100%;height:100%;'; + codeEditor.refresh(); + return { + getCodeMirror:function(){ + return codeEditor; + }, + setContent: function (content){ + codeEditor.setValue(content); + }, + getContent: function (){ + return codeEditor.getValue(); + }, + select: function (){ + codeEditor.focus(); + }, + dispose: function (){ + holder.removeChild(dom); + dom = null; + codeEditor = null; + } + }; + } + }; + + UE.plugins['source'] = function (){ + var me = this; + var opt = this.options; + var sourceMode = false; + var sourceEditor; + var orgSetContent; + opt.sourceEditor = browser.ie ? 'textarea' : (opt.sourceEditor || 'codemirror'); + + me.setOpt({ + sourceEditorFirst:false + }); + function createSourceEditor(holder){ + return sourceEditors[opt.sourceEditor == 'codemirror' && window.CodeMirror ? 'codemirror' : 'textarea'](me, holder); + } + + var bakCssText; + //解决在源码模式下getContent不能得到最新的内容问题 + var oldGetContent, + bakAddress; + + /** + * 切换源码模式和编辑模式 + * @command source + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'source'); + * ``` + */ + + /** + * 查询当前编辑区域的状态是源码模式还是可视化模式 + * @command source + * @method queryCommandState + * @param { String } cmd 命令字符串 + * @return { int } 如果当前是源码编辑模式,返回1,否则返回0 + * @example + * ```javascript + * editor.queryCommandState( 'source' ); + * ``` + */ + + me.commands['source'] = { + execCommand: function (){ + + sourceMode = !sourceMode; + if (sourceMode) { + bakAddress = me.selection.getRange().createAddress(false,true); + me.undoManger && me.undoManger.save(true); + if(browser.gecko){ + me.body.contentEditable = false; + } + + bakCssText = me.iframe.style.cssText; + me.iframe.style.cssText += 'position:absolute;left:-32768px;top:-32768px;'; + + + me.fireEvent('beforegetcontent'); + var root = UE.htmlparser(me.body.innerHTML); + me.filterOutputRule(root); + root.traversal(function (node) { + if (node.type == 'element') { + switch (node.tagName) { + case 'td': + case 'th': + case 'caption': + if(node.children && node.children.length == 1){ + if(node.firstChild().tagName == 'br' ){ + node.removeChild(node.firstChild()) + } + }; + break; + case 'pre': + node.innerText(node.innerText().replace(/ /g,' ')) + + } + } + }); + + me.fireEvent('aftergetcontent'); + + var content = root.toHtml(true); + + sourceEditor = createSourceEditor(me.iframe.parentNode); + + sourceEditor.setContent(content); + + orgSetContent = me.setContent; + + me.setContent = function(html){ + //这里暂时不触发事件,防止报错 + var root = UE.htmlparser(html); + me.filterInputRule(root); + html = root.toHtml(); + sourceEditor.setContent(html); + }; + + setTimeout(function (){ + sourceEditor.select(); + me.addListener('fullscreenchanged', function(){ + try{ + sourceEditor.getCodeMirror().refresh() + }catch(e){} + }); + }); + + //重置getContent,源码模式下取值也能是最新的数据 + oldGetContent = me.getContent; + me.getContent = function (){ + return sourceEditor.getContent() || '

    ' + (browser.ie ? '' : '
    ')+'

    '; + }; + } else { + me.iframe.style.cssText = bakCssText; + var cont = sourceEditor.getContent() || '

    ' + (browser.ie ? '' : '
    ')+'

    '; + //处理掉block节点前后的空格,有可能会误命中,暂时不考虑 + cont = cont.replace(new RegExp('[\\r\\t\\n ]*<\/?(\\w+)\\s*(?:[^>]*)>','g'), function(a,b){ + if(b && !dtd.$inlineWithA[b.toLowerCase()]){ + return a.replace(/(^[\n\r\t ]*)|([\n\r\t ]*$)/g,''); + } + return a.replace(/(^[\n\r\t]*)|([\n\r\t]*$)/g,'') + }); + + me.setContent = orgSetContent; + + me.setContent(cont); + sourceEditor.dispose(); + sourceEditor = null; + //还原getContent方法 + me.getContent = oldGetContent; + var first = me.body.firstChild; + //trace:1106 都删除空了,下边会报错,所以补充一个p占位 + if(!first){ + me.body.innerHTML = '

    '+(browser.ie?'':'
    ')+'

    '; + first = me.body.firstChild; + } + + + //要在ifm为显示时ff才能取到selection,否则报错 + //这里不能比较位置了 + me.undoManger && me.undoManger.save(true); + + if(browser.gecko){ + + var input = document.createElement('input'); + input.style.cssText = 'position:absolute;left:0;top:-32768px'; + + document.body.appendChild(input); + + me.body.contentEditable = false; + setTimeout(function(){ + domUtils.setViewportOffset(input, { left: -32768, top: 0 }); + input.focus(); + setTimeout(function(){ + me.body.contentEditable = true; + me.selection.getRange().moveToAddress(bakAddress).select(true); + domUtils.remove(input); + }); + + }); + }else{ + //ie下有可能报错,比如在代码顶头的情况 + try{ + me.selection.getRange().moveToAddress(bakAddress).select(true); + }catch(e){} + + } + } + this.fireEvent('sourcemodechanged', sourceMode); + }, + queryCommandState: function (){ + return sourceMode|0; + }, + notNeedUndo : 1 + }; + var oldQueryCommandState = me.queryCommandState; + + me.queryCommandState = function (cmdName){ + cmdName = cmdName.toLowerCase(); + if (sourceMode) { + //源码模式下可以开启的命令 + return cmdName in { + 'source' : 1, + 'fullscreen' : 1 + } ? 1 : -1 + } + return oldQueryCommandState.apply(this, arguments); + }; + + if(opt.sourceEditor == "codemirror"){ + + me.addListener("ready",function(){ + utils.loadFile(document,{ + src : opt.codeMirrorJsUrl || opt.UEDITOR_HOME_URL + "third-party/codemirror/codemirror.js", + tag : "script", + type : "text/javascript", + defer : "defer" + },function(){ + if(opt.sourceEditorFirst){ + setTimeout(function(){ + me.execCommand("source"); + },0); + } + }); + utils.loadFile(document,{ + tag : "link", + rel : "stylesheet", + type : "text/css", + href : opt.codeMirrorCssUrl || opt.UEDITOR_HOME_URL + "third-party/codemirror/codemirror.css" + }); + + }); + } + + }; + +})(); + +// plugins/enterkey.js +///import core +///import plugins/undo.js +///commands 设置回车标签p或br +///commandsName EnterKey +///commandsTitle 设置回车标签p或br +/** + * @description 处理回车 + * @author zhanyi + */ +UE.plugins['enterkey'] = function() { + var hTag, + me = this, + tag = me.options.enterTag; + me.addListener('keyup', function(type, evt) { + + var keyCode = evt.keyCode || evt.which; + if (keyCode == 13) { + var range = me.selection.getRange(), + start = range.startContainer, + doSave; + + //修正在h1-h6里边回车后不能嵌套p的问题 + if (!browser.ie) { + + if (/h\d/i.test(hTag)) { + if (browser.gecko) { + var h = domUtils.findParentByTagName(start, [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6','blockquote','caption','table'], true); + if (!h) { + me.document.execCommand('formatBlock', false, '

    '); + doSave = 1; + } + } else { + //chrome remove div + if (start.nodeType == 1) { + var tmp = me.document.createTextNode(''),div; + range.insertNode(tmp); + div = domUtils.findParentByTagName(tmp, 'div', true); + if (div) { + var p = me.document.createElement('p'); + while (div.firstChild) { + p.appendChild(div.firstChild); + } + div.parentNode.insertBefore(p, div); + domUtils.remove(div); + range.setStartBefore(tmp).setCursor(); + doSave = 1; + } + domUtils.remove(tmp); + + } + } + + if (me.undoManger && doSave) { + me.undoManger.save(); + } + } + //没有站位符,会出现多行的问题 + browser.opera && range.select(); + }else{ + me.fireEvent('saveScene',true,true) + } + } + }); + + me.addListener('keydown', function(type, evt) { + var keyCode = evt.keyCode || evt.which; + if (keyCode == 13) {//回车 + if(me.fireEvent('beforeenterkeydown')){ + domUtils.preventDefault(evt); + return; + } + me.fireEvent('saveScene',true,true); + hTag = ''; + + + var range = me.selection.getRange(); + + if (!range.collapsed) { + //跨td不能删 + var start = range.startContainer, + end = range.endContainer, + startTd = domUtils.findParentByTagName(start, 'td', true), + endTd = domUtils.findParentByTagName(end, 'td', true); + if (startTd && endTd && startTd !== endTd || !startTd && endTd || startTd && !endTd) { + evt.preventDefault ? evt.preventDefault() : ( evt.returnValue = false); + return; + } + } + if (tag == 'p') { + + + if (!browser.ie) { + + start = domUtils.findParentByTagName(range.startContainer, ['ol','ul','p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6','blockquote','caption'], true); + + //opera下执行formatblock会在table的场景下有问题,回车在opera原生支持很好,所以暂时在opera去掉调用这个原生的command + //trace:2431 + if (!start && !browser.opera) { + + me.document.execCommand('formatBlock', false, '

    '); + + if (browser.gecko) { + range = me.selection.getRange(); + start = domUtils.findParentByTagName(range.startContainer, 'p', true); + start && domUtils.removeDirtyAttr(start); + } + + + } else { + hTag = start.tagName; + start.tagName.toLowerCase() == 'p' && browser.gecko && domUtils.removeDirtyAttr(start); + } + + } + + } else { + evt.preventDefault ? evt.preventDefault() : ( evt.returnValue = false); + + if (!range.collapsed) { + range.deleteContents(); + start = range.startContainer; + if (start.nodeType == 1 && (start = start.childNodes[range.startOffset])) { + while (start.nodeType == 1) { + if (dtd.$empty[start.tagName]) { + range.setStartBefore(start).setCursor(); + if (me.undoManger) { + me.undoManger.save(); + } + return false; + } + if (!start.firstChild) { + var br = range.document.createElement('br'); + start.appendChild(br); + range.setStart(start, 0).setCursor(); + if (me.undoManger) { + me.undoManger.save(); + } + return false; + } + start = start.firstChild; + } + if (start === range.startContainer.childNodes[range.startOffset]) { + br = range.document.createElement('br'); + range.insertNode(br).setCursor(); + + } else { + range.setStart(start, 0).setCursor(); + } + + + } else { + br = range.document.createElement('br'); + range.insertNode(br).setStartAfter(br).setCursor(); + } + + + } else { + br = range.document.createElement('br'); + range.insertNode(br); + var parent = br.parentNode; + if (parent.lastChild === br) { + br.parentNode.insertBefore(br.cloneNode(true), br); + range.setStartBefore(br); + } else { + range.setStartAfter(br); + } + range.setCursor(); + + } + + } + + } + }); +}; + + +// plugins/keystrokes.js +/* 处理特殊键的兼容性问题 */ +UE.plugins['keystrokes'] = function() { + var me = this; + var collapsed = true; + me.addListener('keydown', function(type, evt) { + var keyCode = evt.keyCode || evt.which, + rng = me.selection.getRange(); + + //处理全选的情况 + if(!rng.collapsed && !(evt.ctrlKey || evt.shiftKey || evt.altKey || evt.metaKey) && (keyCode >= 65 && keyCode <=90 + || keyCode >= 48 && keyCode <= 57 || + keyCode >= 96 && keyCode <= 111 || { + 13:1, + 8:1, + 46:1 + }[keyCode]) + ){ + + var tmpNode = rng.startContainer; + if(domUtils.isFillChar(tmpNode)){ + rng.setStartBefore(tmpNode) + } + tmpNode = rng.endContainer; + if(domUtils.isFillChar(tmpNode)){ + rng.setEndAfter(tmpNode) + } + rng.txtToElmBoundary(); + //结束边界可能放到了br的前边,要把br包含进来 + // x[xxx]
    + if(rng.endContainer && rng.endContainer.nodeType == 1){ + tmpNode = rng.endContainer.childNodes[rng.endOffset]; + if(tmpNode && domUtils.isBr(tmpNode)){ + rng.setEndAfter(tmpNode); + } + } + if(rng.startOffset == 0){ + tmpNode = rng.startContainer; + if(domUtils.isBoundaryNode(tmpNode,'firstChild') ){ + tmpNode = rng.endContainer; + if(rng.endOffset == (tmpNode.nodeType == 3 ? tmpNode.nodeValue.length : tmpNode.childNodes.length) && domUtils.isBoundaryNode(tmpNode,'lastChild')){ + me.fireEvent('saveScene'); + me.body.innerHTML = '

    '+(browser.ie ? '' : '
    ')+'

    '; + rng.setStart(me.body.firstChild,0).setCursor(false,true); + me._selectionChange(); + return; + } + } + } + } + + //处理backspace + if (keyCode == keymap.Backspace) { + rng = me.selection.getRange(); + collapsed = rng.collapsed; + if(me.fireEvent('delkeydown',evt)){ + return; + } + var start,end; + //避免按两次删除才能生效的问题 + if(rng.collapsed && rng.inFillChar()){ + start = rng.startContainer; + + if(domUtils.isFillChar(start)){ + rng.setStartBefore(start).shrinkBoundary(true).collapse(true); + domUtils.remove(start) + }else{ + start.nodeValue = start.nodeValue.replace(new RegExp('^' + domUtils.fillChar ),''); + rng.startOffset--; + rng.collapse(true).select(true) + } + } + + //解决选中control元素不能删除的问题 + if (start = rng.getClosedNode()) { + me.fireEvent('saveScene'); + rng.setStartBefore(start); + domUtils.remove(start); + rng.setCursor(); + me.fireEvent('saveScene'); + domUtils.preventDefault(evt); + return; + } + //阻止在table上的删除 + if (!browser.ie) { + start = domUtils.findParentByTagName(rng.startContainer, 'table', true); + end = domUtils.findParentByTagName(rng.endContainer, 'table', true); + if (start && !end || !start && end || start !== end) { + evt.preventDefault(); + return; + } + } + + } + //处理tab键的逻辑 + if (keyCode == keymap.Tab) { + //不处理以下标签 + var excludeTagNameForTabKey = { + 'ol' : 1, + 'ul' : 1, + 'table':1 + }; + //处理组件里的tab按下事件 + if(me.fireEvent('tabkeydown',evt)){ + domUtils.preventDefault(evt); + return; + } + var range = me.selection.getRange(); + me.fireEvent('saveScene'); + for (var i = 0,txt = '',tabSize = me.options.tabSize|| 4,tabNode = me.options.tabNode || ' '; i < tabSize; i++) { + txt += tabNode; + } + var span = me.document.createElement('span'); + span.innerHTML = txt + domUtils.fillChar; + if (range.collapsed) { + range.insertNode(span.cloneNode(true).firstChild).setCursor(true); + } else { + var filterFn = function(node) { + return domUtils.isBlockElm(node) && !excludeTagNameForTabKey[node.tagName.toLowerCase()] + + }; + //普通的情况 + start = domUtils.findParent(range.startContainer, filterFn,true); + end = domUtils.findParent(range.endContainer, filterFn,true); + if (start && end && start === end) { + range.deleteContents(); + range.insertNode(span.cloneNode(true).firstChild).setCursor(true); + } else { + var bookmark = range.createBookmark(); + range.enlarge(true); + var bookmark2 = range.createBookmark(), + current = domUtils.getNextDomNode(bookmark2.start, false, filterFn); + while (current && !(domUtils.getPosition(current, bookmark2.end) & domUtils.POSITION_FOLLOWING)) { + current.insertBefore(span.cloneNode(true).firstChild, current.firstChild); + current = domUtils.getNextDomNode(current, false, filterFn); + } + range.moveToBookmark(bookmark2).moveToBookmark(bookmark).select(); + } + } + domUtils.preventDefault(evt) + } + //trace:1634 + //ff的del键在容器空的时候,也会删除 + if(browser.gecko && keyCode == 46){ + range = me.selection.getRange(); + if(range.collapsed){ + start = range.startContainer; + if(domUtils.isEmptyBlock(start)){ + var parent = start.parentNode; + while(domUtils.getChildCount(parent) == 1 && !domUtils.isBody(parent)){ + start = parent; + parent = parent.parentNode; + } + if(start === parent.lastChild) + evt.preventDefault(); + return; + } + } + } + }); + me.addListener('keyup', function(type, evt) { + var keyCode = evt.keyCode || evt.which, + rng,me = this; + if(keyCode == keymap.Backspace){ + if(me.fireEvent('delkeyup')){ + return; + } + rng = me.selection.getRange(); + if(rng.collapsed){ + var tmpNode, + autoClearTagName = ['h1','h2','h3','h4','h5','h6']; + if(tmpNode = domUtils.findParentByTagName(rng.startContainer,autoClearTagName,true)){ + if(domUtils.isEmptyBlock(tmpNode)){ + var pre = tmpNode.previousSibling; + if(pre && pre.nodeName != 'TABLE'){ + domUtils.remove(tmpNode); + rng.setStartAtLast(pre).setCursor(false,true); + return; + }else{ + var next = tmpNode.nextSibling; + if(next && next.nodeName != 'TABLE'){ + domUtils.remove(tmpNode); + rng.setStartAtFirst(next).setCursor(false,true); + return; + } + } + } + } + //处理当删除到body时,要重新给p标签展位 + if(domUtils.isBody(rng.startContainer)){ + var tmpNode = domUtils.createElement(me.document,'p',{ + 'innerHTML' : browser.ie ? domUtils.fillChar : '
    ' + }); + rng.insertNode(tmpNode).setStart(tmpNode,0).setCursor(false,true); + } + } + + + //chrome下如果删除了inline标签,浏览器会有记忆,在输入文字还是会套上刚才删除的标签,所以这里再选一次就不会了 + if( !collapsed && (rng.startContainer.nodeType == 3 || rng.startContainer.nodeType == 1 && domUtils.isEmptyBlock(rng.startContainer))){ + if(browser.ie){ + var span = rng.document.createElement('span'); + rng.insertNode(span).setStartBefore(span).collapse(true); + rng.select(); + domUtils.remove(span) + }else{ + rng.select() + } + + } + } + + + }) +}; + +// plugins/fiximgclick.js +///import core +///commands 修复chrome下图片不能点击的问题,出现八个角可改变大小 +///commandsName FixImgClick +///commandsTitle 修复chrome下图片不能点击的问题,出现八个角可改变大小 +//修复chrome下图片不能点击的问题,出现八个角可改变大小 + +UE.plugins['fiximgclick'] = (function () { + + var elementUpdated = false; + function Scale() { + this.editor = null; + this.resizer = null; + this.cover = null; + this.doc = document; + this.prePos = {x: 0, y: 0}; + this.startPos = {x: 0, y: 0}; + } + + (function () { + var rect = [ + //[left, top, width, height] + [0, 0, -1, -1], + [0, 0, 0, -1], + [0, 0, 1, -1], + [0, 0, -1, 0], + [0, 0, 1, 0], + [0, 0, -1, 1], + [0, 0, 0, 1], + [0, 0, 1, 1] + ]; + + Scale.prototype = { + init: function (editor) { + var me = this; + me.editor = editor; + me.startPos = this.prePos = {x: 0, y: 0}; + me.dragId = -1; + + var hands = [], + cover = me.cover = document.createElement('div'), + resizer = me.resizer = document.createElement('div'); + + cover.id = me.editor.ui.id + '_imagescale_cover'; + cover.style.cssText = 'position:absolute;display:none;z-index:' + (me.editor.options.zIndex) + ';filter:alpha(opacity=0); opacity:0;background:#CCC;'; + domUtils.on(cover, 'mousedown click', function () { + me.hide(); + }); + + for (i = 0; i < 8; i++) { + hands.push(''); + } + resizer.id = me.editor.ui.id + '_imagescale'; + resizer.className = 'edui-editor-imagescale'; + resizer.innerHTML = hands.join(''); + resizer.style.cssText += ';display:none;border:1px solid #3b77ff;z-index:' + (me.editor.options.zIndex) + ';'; + + me.editor.ui.getDom().appendChild(cover); + me.editor.ui.getDom().appendChild(resizer); + + me.initStyle(); + me.initEvents(); + }, + initStyle: function () { + utils.cssRule('imagescale', '.edui-editor-imagescale{display:none;position:absolute;border:1px solid #38B2CE;cursor:hand;-webkit-box-sizing: content-box;-moz-box-sizing: content-box;box-sizing: content-box;}' + + '.edui-editor-imagescale span{position:absolute;width:6px;height:6px;overflow:hidden;font-size:0px;display:block;background-color:#3C9DD0;}' + + '.edui-editor-imagescale .edui-editor-imagescale-hand0{cursor:nw-resize;top:0;margin-top:-4px;left:0;margin-left:-4px;}' + + '.edui-editor-imagescale .edui-editor-imagescale-hand1{cursor:n-resize;top:0;margin-top:-4px;left:50%;margin-left:-4px;}' + + '.edui-editor-imagescale .edui-editor-imagescale-hand2{cursor:ne-resize;top:0;margin-top:-4px;left:100%;margin-left:-3px;}' + + '.edui-editor-imagescale .edui-editor-imagescale-hand3{cursor:w-resize;top:50%;margin-top:-4px;left:0;margin-left:-4px;}' + + '.edui-editor-imagescale .edui-editor-imagescale-hand4{cursor:e-resize;top:50%;margin-top:-4px;left:100%;margin-left:-3px;}' + + '.edui-editor-imagescale .edui-editor-imagescale-hand5{cursor:sw-resize;top:100%;margin-top:-3px;left:0;margin-left:-4px;}' + + '.edui-editor-imagescale .edui-editor-imagescale-hand6{cursor:s-resize;top:100%;margin-top:-3px;left:50%;margin-left:-4px;}' + + '.edui-editor-imagescale .edui-editor-imagescale-hand7{cursor:se-resize;top:100%;margin-top:-3px;left:100%;margin-left:-3px;}'); + }, + initEvents: function () { + var me = this; + + me.startPos.x = me.startPos.y = 0; + me.isDraging = false; + }, + _eventHandler: function (e) { + var me = this; + switch (e.type) { + case 'mousedown': + var hand = e.target || e.srcElement, hand; + if (hand.className.indexOf('edui-editor-imagescale-hand') != -1 && me.dragId == -1) { + me.dragId = hand.className.slice(-1); + me.startPos.x = me.prePos.x = e.clientX; + me.startPos.y = me.prePos.y = e.clientY; + domUtils.on(me.doc,'mousemove', me.proxy(me._eventHandler, me)); + } + break; + case 'mousemove': + if (me.dragId != -1) { + me.updateContainerStyle(me.dragId, {x: e.clientX - me.prePos.x, y: e.clientY - me.prePos.y}); + me.prePos.x = e.clientX; + me.prePos.y = e.clientY; + elementUpdated = true; + me.updateTargetElement(); + + } + break; + case 'mouseup': + if (me.dragId != -1) { + me.updateContainerStyle(me.dragId, {x: e.clientX - me.prePos.x, y: e.clientY - me.prePos.y}); + me.updateTargetElement(); + if (me.target.parentNode) me.attachTo(me.target); + me.dragId = -1; + } + domUtils.un(me.doc,'mousemove', me.proxy(me._eventHandler, me)); + //修复只是点击挪动点,但没有改变大小,不应该触发contentchange + if(elementUpdated){ + elementUpdated = false; + me.editor.fireEvent('contentchange'); + } + + break; + default: + break; + } + }, + updateTargetElement: function () { + var me = this; + domUtils.setStyles(me.target, { + 'width': me.resizer.style.width, + 'height': me.resizer.style.height + }); + me.target.width = parseInt(me.resizer.style.width); + me.target.height = parseInt(me.resizer.style.height); + me.attachTo(me.target); + }, + updateContainerStyle: function (dir, offset) { + var me = this, + dom = me.resizer, tmp; + + if (rect[dir][0] != 0) { + tmp = parseInt(dom.style.left) + offset.x; + dom.style.left = me._validScaledProp('left', tmp) + 'px'; + } + if (rect[dir][1] != 0) { + tmp = parseInt(dom.style.top) + offset.y; + dom.style.top = me._validScaledProp('top', tmp) + 'px'; + } + if (rect[dir][2] != 0) { + tmp = dom.clientWidth + rect[dir][2] * offset.x; + dom.style.width = me._validScaledProp('width', tmp) + 'px'; + } + if (rect[dir][3] != 0) { + tmp = dom.clientHeight + rect[dir][3] * offset.y; + dom.style.height = me._validScaledProp('height', tmp) + 'px'; + } + }, + _validScaledProp: function (prop, value) { + var ele = this.resizer, + wrap = document; + + value = isNaN(value) ? 0 : value; + switch (prop) { + case 'left': + return value < 0 ? 0 : (value + ele.clientWidth) > wrap.clientWidth ? wrap.clientWidth - ele.clientWidth : value; + case 'top': + return value < 0 ? 0 : (value + ele.clientHeight) > wrap.clientHeight ? wrap.clientHeight - ele.clientHeight : value; + case 'width': + return value <= 0 ? 1 : (value + ele.offsetLeft) > wrap.clientWidth ? wrap.clientWidth - ele.offsetLeft : value; + case 'height': + return value <= 0 ? 1 : (value + ele.offsetTop) > wrap.clientHeight ? wrap.clientHeight - ele.offsetTop : value; + } + }, + hideCover: function () { + this.cover.style.display = 'none'; + }, + showCover: function () { + var me = this, + editorPos = domUtils.getXY(me.editor.ui.getDom()), + iframePos = domUtils.getXY(me.editor.iframe); + + domUtils.setStyles(me.cover, { + 'width': me.editor.iframe.offsetWidth + 'px', + 'height': me.editor.iframe.offsetHeight + 'px', + 'top': iframePos.y - editorPos.y + 'px', + 'left': iframePos.x - editorPos.x + 'px', + 'position': 'absolute', + 'display': '' + }) + }, + show: function (targetObj) { + var me = this; + me.resizer.style.display = 'block'; + if(targetObj) me.attachTo(targetObj); + + domUtils.on(this.resizer, 'mousedown', me.proxy(me._eventHandler, me)); + domUtils.on(me.doc, 'mouseup', me.proxy(me._eventHandler, me)); + + me.showCover(); + me.editor.fireEvent('afterscaleshow', me); + me.editor.fireEvent('saveScene'); + }, + hide: function () { + var me = this; + me.hideCover(); + me.resizer.style.display = 'none'; + + domUtils.un(me.resizer, 'mousedown', me.proxy(me._eventHandler, me)); + domUtils.un(me.doc, 'mouseup', me.proxy(me._eventHandler, me)); + me.editor.fireEvent('afterscalehide', me); + }, + proxy: function( fn, context ) { + return function(e) { + return fn.apply( context || this, arguments); + }; + }, + attachTo: function (targetObj) { + var me = this, + target = me.target = targetObj, + resizer = this.resizer, + imgPos = domUtils.getXY(target), + iframePos = domUtils.getXY(me.editor.iframe), + editorPos = domUtils.getXY(resizer.parentNode); + + domUtils.setStyles(resizer, { + 'width': target.width + 'px', + 'height': target.height + 'px', + 'left': iframePos.x + imgPos.x - me.editor.document.body.scrollLeft - editorPos.x - parseInt(resizer.style.borderLeftWidth) + 'px', + // 'top': iframePos.y + imgPos.y - me.editor.document.body.scrollTop - editorPos.y - parseInt(resizer.style.borderTopWidth) + 'px' + 'top': iframePos.y + imgPos.y - me.editor.document.documentElement.scrollTop - editorPos.y - parseInt(resizer.style.borderTopWidth) + 'px' + }); + } + } + })(); + + return function () { + var me = this, + imageScale; + + me.setOpt('imageScaleEnabled', true); + + if ( !browser.ie && me.options.imageScaleEnabled) { + me.addListener('click', function (type, e) { + + var range = me.selection.getRange(), + img = range.getClosedNode(); + + if (img && img.tagName == 'IMG' && me.body.contentEditable!="false") { + + if (img.className.indexOf("edui-faked-music") != -1 || + img.getAttribute("anchorname") || + domUtils.hasClass(img, 'loadingclass') || + domUtils.hasClass(img, 'loaderrorclass')) { return } + + if (!imageScale) { + imageScale = new Scale(); + imageScale.init(me); + me.ui.getDom().appendChild(imageScale.resizer); + + var _keyDownHandler = function (e) { + imageScale.hide(); + if(imageScale.target) me.selection.getRange().selectNode(imageScale.target).select(); + }, _mouseDownHandler = function (e) { + var ele = e.target || e.srcElement; + if (ele && (ele.className===undefined || ele.className.indexOf('edui-editor-imagescale') == -1)) { + _keyDownHandler(e); + } + }, timer; + + me.addListener('afterscaleshow', function (e) { + me.addListener('beforekeydown', _keyDownHandler); + me.addListener('beforemousedown', _mouseDownHandler); + domUtils.on(document, 'keydown', _keyDownHandler); + domUtils.on(document,'mousedown', _mouseDownHandler); + me.selection.getNative().removeAllRanges(); + }); + me.addListener('afterscalehide', function (e) { + me.removeListener('beforekeydown', _keyDownHandler); + me.removeListener('beforemousedown', _mouseDownHandler); + domUtils.un(document, 'keydown', _keyDownHandler); + domUtils.un(document,'mousedown', _mouseDownHandler); + var target = imageScale.target; + if (target.parentNode) { + me.selection.getRange().selectNode(target).select(); + } + }); + //TODO 有iframe的情况,mousedown不能往下传。。 + domUtils.on(imageScale.resizer, 'mousedown', function (e) { + me.selection.getNative().removeAllRanges(); + var ele = e.target || e.srcElement; + if (ele && ele.className.indexOf('edui-editor-imagescale-hand') == -1) { + timer = setTimeout(function () { + imageScale.hide(); + if(imageScale.target) me.selection.getRange().selectNode(ele).select(); + }, 200); + } + }); + domUtils.on(imageScale.resizer, 'mouseup', function (e) { + var ele = e.target || e.srcElement; + if (ele && ele.className.indexOf('edui-editor-imagescale-hand') == -1) { + clearTimeout(timer); + } + }); + } + imageScale.show(img); + } else { + if (imageScale && imageScale.resizer.style.display != 'none') imageScale.hide(); + } + }); + } + + if (browser.webkit) { + me.addListener('click', function (type, e) { + if (e.target.tagName == 'IMG' && me.body.contentEditable!="false") { + var range = new dom.Range(me.document); + range.selectNode(e.target).select(); + } + }); + } + } +})(); + +// plugins/autolink.js +///import core +///commands 为非ie浏览器自动添加a标签 +///commandsName AutoLink +///commandsTitle 自动增加链接 +/** + * @description 为非ie浏览器自动添加a标签 + * @author zhanyi + */ + +UE.plugin.register('autolink',function(){ + var cont = 0; + + return !browser.ie ? { + + bindEvents:{ + 'reset' : function(){ + cont = 0; + }, + 'keydown':function(type, evt) { + var me = this; + var keyCode = evt.keyCode || evt.which; + + if (keyCode == 32 || keyCode == 13) { + + var sel = me.selection.getNative(), + range = sel.getRangeAt(0).cloneRange(), + offset, + charCode; + + var start = range.startContainer; + while (start.nodeType == 1 && range.startOffset > 0) { + start = range.startContainer.childNodes[range.startOffset - 1]; + if (!start){ + break; + } + range.setStart(start, start.nodeType == 1 ? start.childNodes.length : start.nodeValue.length); + range.collapse(true); + start = range.startContainer; + } + + do{ + if (range.startOffset == 0) { + start = range.startContainer.previousSibling; + + while (start && start.nodeType == 1) { + start = start.lastChild; + } + if (!start || domUtils.isFillChar(start)){ + break; + } + offset = start.nodeValue.length; + } else { + start = range.startContainer; + offset = range.startOffset; + } + range.setStart(start, offset - 1); + charCode = range.toString().charCodeAt(0); + } while (charCode != 160 && charCode != 32); + + if (range.toString().replace(new RegExp(domUtils.fillChar, 'g'), '').match(/(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i)) { + while(range.toString().length){ + if(/^(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i.test(range.toString())){ + break; + } + try{ + range.setStart(range.startContainer,range.startOffset+1); + }catch(e){ + //trace:2121 + var start = range.startContainer; + while(!(next = start.nextSibling)){ + if(domUtils.isBody(start)){ + return; + } + start = start.parentNode; + + } + range.setStart(next,0); + + } + + } + //range的开始边界已经在a标签里的不再处理 + if(domUtils.findParentByTagName(range.startContainer,'a',true)){ + return; + } + var a = me.document.createElement('a'),text = me.document.createTextNode(' '),href; + + me.undoManger && me.undoManger.save(); + a.appendChild(range.extractContents()); + a.href = a.innerHTML = a.innerHTML.replace(/<[^>]+>/g,''); + href = a.getAttribute("href").replace(new RegExp(domUtils.fillChar,'g'),''); + href = /^(?:https?:\/\/)/ig.test(href) ? href : "http://"+ href; + a.setAttribute('_src',utils.html(href)); + a.href = utils.html(href); + + range.insertNode(a); + a.parentNode.insertBefore(text, a.nextSibling); + range.setStart(text, 0); + range.collapse(true); + sel.removeAllRanges(); + sel.addRange(range); + me.undoManger && me.undoManger.save(); + } + } + } + } + }:{} + },function(){ + var keyCodes = { + 37:1, 38:1, 39:1, 40:1, + 13:1,32:1 + }; + function checkIsCludeLink(node){ + if(node.nodeType == 3){ + return null + } + if(node.nodeName == 'A'){ + return node; + } + var lastChild = node.lastChild; + + while(lastChild){ + if(lastChild.nodeName == 'A'){ + return lastChild; + } + if(lastChild.nodeType == 3){ + if(domUtils.isWhitespace(lastChild)){ + lastChild = lastChild.previousSibling; + continue; + } + return null + } + lastChild = lastChild.lastChild; + } + } + browser.ie && this.addListener('keyup',function(cmd,evt){ + var me = this,keyCode = evt.keyCode; + if(keyCodes[keyCode]){ + var rng = me.selection.getRange(); + var start = rng.startContainer; + + if(keyCode == 13){ + while(start && !domUtils.isBody(start) && !domUtils.isBlockElm(start)){ + start = start.parentNode; + } + if(start && !domUtils.isBody(start) && start.nodeName == 'P'){ + var pre = start.previousSibling; + if(pre && pre.nodeType == 1){ + var pre = checkIsCludeLink(pre); + if(pre && !pre.getAttribute('_href')){ + domUtils.remove(pre,true); + } + } + } + }else if(keyCode == 32 ){ + if(start.nodeType == 3 && /^\s$/.test(start.nodeValue)){ + start = start.previousSibling; + if(start && start.nodeName == 'A' && !start.getAttribute('_href')){ + domUtils.remove(start,true); + } + } + }else { + start = domUtils.findParentByTagName(start,'a',true); + if(start && !start.getAttribute('_href')){ + var bk = rng.createBookmark(); + + domUtils.remove(start,true); + rng.moveToBookmark(bk).select(true) + } + } + + } + + + }); + } +); + +// plugins/autoheight.js +///import core +///commands 当输入内容超过编辑器高度时,编辑器自动增高 +///commandsName AutoHeight,autoHeightEnabled +///commandsTitle 自动增高 +/** + * @description 自动伸展 + * @author zhanyi + */ +UE.plugins['autoheight'] = function () { + var me = this; + //提供开关,就算加载也可以关闭 + me.autoHeightEnabled = me.options.autoHeightEnabled !== false; + if (!me.autoHeightEnabled) { + return; + } + + var bakOverflow, + lastHeight = 0, + options = me.options, + currentHeight, + timer; + + function adjustHeight() { + var me = this; + clearTimeout(timer); + if(isFullscreen)return; + if (!me.queryCommandState || me.queryCommandState && me.queryCommandState('source') != 1) { + timer = setTimeout(function(){ + + var node = me.body.lastChild; + while(node && node.nodeType != 1){ + node = node.previousSibling; + } + if(node && node.nodeType == 1){ + node.style.clear = 'both'; + currentHeight = Math.max(domUtils.getXY(node).y + node.offsetHeight + 25 ,Math.max(options.minFrameHeight, options.initialFrameHeight)) ; + if (currentHeight != lastHeight) { + if (currentHeight !== parseInt(me.iframe.parentNode.style.height)) { + me.iframe.parentNode.style.height = currentHeight + 'px'; + } + me.body.style.height = currentHeight + 'px'; + lastHeight = currentHeight; + } + domUtils.removeStyle(node,'clear'); + } + + + },50) + } + } + var isFullscreen; + me.addListener('fullscreenchanged',function(cmd,f){ + isFullscreen = f + }); + me.addListener('destroy', function () { + me.removeListener('contentchange afterinserthtml keyup mouseup',adjustHeight) + }); + me.enableAutoHeight = function () { + var me = this; + if (!me.autoHeightEnabled) { + return; + } + var doc = me.document; + me.autoHeightEnabled = true; + bakOverflow = doc.body.style.overflowY; + doc.body.style.overflowY = 'hidden'; + me.addListener('contentchange afterinserthtml keyup mouseup',adjustHeight); + //ff不给事件算得不对 + + setTimeout(function () { + adjustHeight.call(me); + }, browser.gecko ? 100 : 0); + me.fireEvent('autoheightchanged', me.autoHeightEnabled); + }; + me.disableAutoHeight = function () { + + me.body.style.overflowY = bakOverflow || ''; + + me.removeListener('contentchange', adjustHeight); + me.removeListener('keyup', adjustHeight); + me.removeListener('mouseup', adjustHeight); + me.autoHeightEnabled = false; + me.fireEvent('autoheightchanged', me.autoHeightEnabled); + }; + + me.on('setHeight',function(){ + me.disableAutoHeight() + }); + me.addListener('ready', function () { + me.enableAutoHeight(); + //trace:1764 + var timer; + domUtils.on(browser.ie ? me.body : me.document, browser.webkit ? 'dragover' : 'drop', function () { + clearTimeout(timer); + timer = setTimeout(function () { + //trace:3681 + adjustHeight.call(me); + }, 100); + + }); + //修复内容过多时,回到顶部,顶部内容被工具栏遮挡问题 + var lastScrollY; + window.onscroll = function(){ + if(lastScrollY === null){ + lastScrollY = this.scrollY + }else if(this.scrollY == 0 && lastScrollY != 0){ + me.window.scrollTo(0,0); + lastScrollY = null; + } + } + }); + + +}; + + + +// plugins/autofloat.js +///import core +///commands 悬浮工具栏 +///commandsName AutoFloat,autoFloatEnabled +///commandsTitle 悬浮工具栏 +/** + * modified by chengchao01 + * 注意: 引入此功能后,在IE6下会将body的背景图片覆盖掉! + */ +UE.plugins['autofloat'] = function() { + var me = this, + lang = me.getLang(); + me.setOpt({ + topOffset:0 + }); + var optsAutoFloatEnabled = me.options.autoFloatEnabled !== false, + topOffset = me.options.topOffset; + + + //如果不固定toolbar的位置,则直接退出 + if(!optsAutoFloatEnabled){ + return; + } + var uiUtils = UE.ui.uiUtils, + LteIE6 = browser.ie && browser.version <= 6, + quirks = browser.quirks; + + function checkHasUI(){ + if(!UE.ui){ + alert(lang.autofloatMsg); + return 0; + } + return 1; + } + function fixIE6FixedPos(){ + var docStyle = document.body.style; + docStyle.backgroundImage = 'url("about:blank")'; + docStyle.backgroundAttachment = 'fixed'; + } + var bakCssText, + placeHolder = document.createElement('div'), + toolbarBox,orgTop, + getPosition, + flag =true; //ie7模式下需要偏移 + function setFloating(){ + var toobarBoxPos = domUtils.getXY(toolbarBox), + origalFloat = domUtils.getComputedStyle(toolbarBox,'position'), + origalLeft = domUtils.getComputedStyle(toolbarBox,'left'); + toolbarBox.style.width = toolbarBox.offsetWidth + 'px'; + toolbarBox.style.zIndex = me.options.zIndex * 1 + 1; + toolbarBox.parentNode.insertBefore(placeHolder, toolbarBox); + if (LteIE6 || (quirks && browser.ie)) { + if(toolbarBox.style.position != 'absolute'){ + toolbarBox.style.position = 'absolute'; + } + toolbarBox.style.top = (document.body.scrollTop||document.documentElement.scrollTop) - orgTop + topOffset + 'px'; + } else { + if (browser.ie7Compat && flag) { + flag = false; + toolbarBox.style.left = domUtils.getXY(toolbarBox).x - document.documentElement.getBoundingClientRect().left+2 + 'px'; + } + if(toolbarBox.style.position != 'fixed'){ + toolbarBox.style.position = 'fixed'; + toolbarBox.style.top = topOffset +"px"; + ((origalFloat == 'absolute' || origalFloat == 'relative') && parseFloat(origalLeft)) && (toolbarBox.style.left = toobarBoxPos.x + 'px'); + } + } + } + function unsetFloating(){ + flag = true; + if(placeHolder.parentNode){ + placeHolder.parentNode.removeChild(placeHolder); + } + + toolbarBox.style.cssText = bakCssText; + } + + function updateFloating(){ + var rect3 = getPosition(me.container); + var offset=me.options.toolbarTopOffset||0; + if (rect3.top < 0 && rect3.bottom - toolbarBox.offsetHeight > offset) { + setFloating(); + }else{ + unsetFloating(); + } + } + var defer_updateFloating = utils.defer(function(){ + updateFloating(); + },browser.ie ? 200 : 100,true); + + me.addListener('destroy',function(){ + domUtils.un(window, ['scroll','resize'], updateFloating); + me.removeListener('keydown', defer_updateFloating); + }); + + me.addListener('ready', function(){ + if(checkHasUI(me)){ + //加载了ui组件,但在new时,没有加载ui,导致编辑器实例上没有ui类,所以这里做判断 + if(!me.ui){ + return; + } + getPosition = uiUtils.getClientRect; + toolbarBox = me.ui.getDom('toolbarbox'); + orgTop = getPosition(toolbarBox).top; + bakCssText = toolbarBox.style.cssText; + placeHolder.style.height = toolbarBox.offsetHeight + 'px'; + if(LteIE6){ + fixIE6FixedPos(); + } + domUtils.on(window, ['scroll','resize'], updateFloating); + me.addListener('keydown', defer_updateFloating); + + me.addListener('beforefullscreenchange', function (t, enabled){ + if (enabled) { + unsetFloating(); + } + }); + me.addListener('fullscreenchanged', function (t, enabled){ + if (!enabled) { + updateFloating(); + } + }); + me.addListener('sourcemodechanged', function (t, enabled){ + setTimeout(function (){ + updateFloating(); + },0); + }); + me.addListener("clearDoc",function(){ + setTimeout(function(){ + updateFloating(); + },0); + + }) + } + }); +}; + + +// plugins/video.js +/** + * video插件, 为UEditor提供视频插入支持 + * @file + * @since 1.2.6.1 + */ + +UE.plugins['video'] = function (){ + var me =this; + + /** + * 创建插入视频字符窜 + * @param url 视频地址 + * @param width 视频宽度 + * @param height 视频高度 + * @param align 视频对齐 + * @param toEmbed 是否以flash代替显示 + * @param addParagraph 是否需要添加P 标签 + */ + function creatInsertStr(url,width,height,id,align,classname,type){ + url = utils.unhtmlForUrl(url); + align = utils.unhtml(align); + classname = utils.unhtml(classname).trim(); + + width = parseInt(width, 10) || 0; + height = parseInt(height, 10) || 0; + + var str; + switch (type){ + case 'image': + str = '' + break; + case 'embed': + str = ''; + break; + case 'video': + var ext = url.substr(url.lastIndexOf('.') + 1); + if(ext == 'ogv') ext = 'ogg'; + str = '' + + ''; + break; + } + return str; + } + + function switchImgAndVideo(root,img2video){ + utils.each(root.getNodesByTagName(img2video ? 'img' : 'embed video'),function(node){ + var className = node.getAttr('class'); + if(className && className.indexOf('edui-faked-video') != -1){ + var html = creatInsertStr( img2video ? node.getAttr('_url') : node.getAttr('src'),node.getAttr('width'),node.getAttr('height'),null,node.getStyle('float') || '',className,img2video ? 'embed':'image'); + node.parentNode.replaceChild(UE.uNode.createElement(html),node); + } + if(className && className.indexOf('edui-upload-video') != -1){ + var html = creatInsertStr( img2video ? node.getAttr('_url') : node.getAttr('src'),node.getAttr('width'),node.getAttr('height'),null,node.getStyle('float') || '',className,img2video ? 'video':'image'); + node.parentNode.replaceChild(UE.uNode.createElement(html),node); + } + }) + } + + me.addOutputRule(function(root){ + switchImgAndVideo(root,true) + }); + me.addInputRule(function(root){ + switchImgAndVideo(root) + }); + + /** + * 插入视频 + * @command insertvideo + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { Object } videoAttr 键值对对象, 描述一个视频的所有属性 + * @example + * ```javascript + * + * var videoAttr = { + * //视频地址 + * url: 'http://www.youku.com/xxx', + * //视频宽高值, 单位px + * width: 200, + * height: 100 + * }; + * + * //editor 是编辑器实例 + * //向编辑器插入单个视频 + * editor.execCommand( 'insertvideo', videoAttr ); + * ``` + */ + + /** + * 插入视频 + * @command insertvideo + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { Array } videoArr 需要插入的视频的数组, 其中的每一个元素都是一个键值对对象, 描述了一个视频的所有属性 + * @example + * ```javascript + * + * var videoAttr1 = { + * //视频地址 + * url: 'http://www.youku.com/xxx', + * //视频宽高值, 单位px + * width: 200, + * height: 100 + * }, + * videoAttr2 = { + * //视频地址 + * url: 'http://www.youku.com/xxx', + * //视频宽高值, 单位px + * width: 200, + * height: 100 + * } + * + * //editor 是编辑器实例 + * //该方法将会向编辑器内插入两个视频 + * editor.execCommand( 'insertvideo', [ videoAttr1, videoAttr2 ] ); + * ``` + */ + + /** + * 查询当前光标所在处是否是一个视频 + * @command insertvideo + * @method queryCommandState + * @param { String } cmd 需要查询的命令字符串 + * @return { int } 如果当前光标所在处的元素是一个视频对象, 则返回1,否则返回0 + * @example + * ```javascript + * + * //editor 是编辑器实例 + * editor.queryCommandState( 'insertvideo' ); + * ``` + */ + me.commands["insertvideo"] = { + execCommand: function (cmd, videoObjs, type){ + + videoObjs = utils.isArray(videoObjs)?videoObjs:[videoObjs]; + var html = [],id = 'tmpVedio', cl; + for(var i=0,vi,len = videoObjs.length;i 0) { + return 0; + } + for (var i in dtd.$isNotEmpty) if (dtd.$isNotEmpty.hasOwnProperty(i)) { + if (node.getElementsByTagName(i).length) { + return 0; + } + } + return 1; + }; + UETable.getWidth = function (cell) { + if (!cell)return 0; + return parseInt(domUtils.getComputedStyle(cell, "width"), 10); + }; + + /** + * 获取单元格或者单元格组的“对齐”状态。 如果当前的检测对象是一个单元格组, 只有在满足所有单元格的 水平和竖直 对齐属性都相同的 + * 条件时才会返回其状态值,否则将返回null; 如果当前只检测了一个单元格, 则直接返回当前单元格的对齐状态; + * @param table cell or table cells , 支持单个单元格dom对象 或者 单元格dom对象数组 + * @return { align: 'left' || 'right' || 'center', valign: 'top' || 'middle' || 'bottom' } 或者 null + */ + UETable.getTableCellAlignState = function ( cells ) { + + !utils.isArray( cells ) && ( cells = [cells] ); + + var result = {}, + status = ['align', 'valign'], + tempStatus = null, + isSame = true;//状态是否相同 + + utils.each( cells, function( cellNode ){ + + utils.each( status, function( currentState ){ + + tempStatus = cellNode.getAttribute( currentState ); + + if( !result[ currentState ] && tempStatus ) { + result[ currentState ] = tempStatus; + } else if( !result[ currentState ] || ( tempStatus !== result[ currentState ] ) ) { + isSame = false; + return false; + } + + } ); + + return isSame; + + }); + + return isSame ? result : null; + + }; + + /** + * 根据当前选区获取相关的table信息 + * @return {Object} + */ + UETable.getTableItemsByRange = function (editor) { + var start = editor.selection.getStart(); + + //ff下会选中bookmark + if( start && start.id && start.id.indexOf('_baidu_bookmark_start_') === 0 && start.nextSibling) { + start = start.nextSibling; + } + + //在table或者td边缘有可能存在选中tr的情况 + var cell = start && domUtils.findParentByTagName(start, ["td", "th"], true), + tr = cell && cell.parentNode, + caption = start && domUtils.findParentByTagName(start, 'caption', true), + table = caption ? caption.parentNode : tr && tr.parentNode.parentNode; + + return { + cell:cell, + tr:tr, + table:table, + caption:caption + } + }; + UETable.getUETableBySelected = function (editor) { + var table = UETable.getTableItemsByRange(editor).table; + if (table && table.ueTable && table.ueTable.selectedTds.length) { + return table.ueTable; + } + return null; + }; + + UETable.getDefaultValue = function (editor, table) { + var borderMap = { + thin:'0px', + medium:'1px', + thick:'2px' + }, + tableBorder, tdPadding, tdBorder, tmpValue; + if (!table) { + table = editor.document.createElement('table'); + table.insertRow(0).insertCell(0).innerHTML = 'xxx'; + editor.body.appendChild(table); + var td = table.getElementsByTagName('td')[0]; + tmpValue = domUtils.getComputedStyle(table, 'border-left-width'); + tableBorder = parseInt(borderMap[tmpValue] || tmpValue, 10); + tmpValue = domUtils.getComputedStyle(td, 'padding-left'); + tdPadding = parseInt(borderMap[tmpValue] || tmpValue, 10); + tmpValue = domUtils.getComputedStyle(td, 'border-left-width'); + tdBorder = parseInt(borderMap[tmpValue] || tmpValue, 10); + domUtils.remove(table); + return { + tableBorder:tableBorder, + tdPadding:tdPadding, + tdBorder:tdBorder + }; + } else { + td = table.getElementsByTagName('td')[0]; + tmpValue = domUtils.getComputedStyle(table, 'border-left-width'); + tableBorder = parseInt(borderMap[tmpValue] || tmpValue, 10); + tmpValue = domUtils.getComputedStyle(td, 'padding-left'); + tdPadding = parseInt(borderMap[tmpValue] || tmpValue, 10); + tmpValue = domUtils.getComputedStyle(td, 'border-left-width'); + tdBorder = parseInt(borderMap[tmpValue] || tmpValue, 10); + return { + tableBorder:tableBorder, + tdPadding:tdPadding, + tdBorder:tdBorder + }; + } + }; + /** + * 根据当前点击的td或者table获取索引对象 + * @param tdOrTable + */ + UETable.getUETable = function (tdOrTable) { + var tag = tdOrTable.tagName.toLowerCase(); + tdOrTable = (tag == "td" || tag == "th" || tag == 'caption') ? domUtils.findParentByTagName(tdOrTable, "table", true) : tdOrTable; + if (!tdOrTable.ueTable) { + tdOrTable.ueTable = new UETable(tdOrTable); + } + return tdOrTable.ueTable; + }; + + UETable.cloneCell = function(cell,ignoreMerge,keepPro){ + if (!cell || utils.isString(cell)) { + return this.table.ownerDocument.createElement(cell || 'td'); + } + var flag = domUtils.hasClass(cell, "selectTdClass"); + flag && domUtils.removeClasses(cell, "selectTdClass"); + var tmpCell = cell.cloneNode(true); + if (ignoreMerge) { + tmpCell.rowSpan = tmpCell.colSpan = 1; + } + //去掉宽高 + !keepPro && domUtils.removeAttributes(tmpCell,'width height'); + !keepPro && domUtils.removeAttributes(tmpCell,'style'); + + tmpCell.style.borderLeftStyle = ""; + tmpCell.style.borderTopStyle = ""; + tmpCell.style.borderLeftColor = cell.style.borderRightColor; + tmpCell.style.borderLeftWidth = cell.style.borderRightWidth; + tmpCell.style.borderTopColor = cell.style.borderBottomColor; + tmpCell.style.borderTopWidth = cell.style.borderBottomWidth; + flag && domUtils.addClass(cell, "selectTdClass"); + return tmpCell; + } + + UETable.prototype = { + getMaxRows:function () { + var rows = this.table.rows, maxLen = 1; + for (var i = 0, row; row = rows[i]; i++) { + var currentMax = 1; + for (var j = 0, cj; cj = row.cells[j++];) { + currentMax = Math.max(cj.rowSpan || 1, currentMax); + } + maxLen = Math.max(currentMax + i, maxLen); + } + return maxLen; + }, + /** + * 获取当前表格的最大列数 + */ + getMaxCols:function () { + var rows = this.table.rows, maxLen = 0, cellRows = {}; + for (var i = 0, row; row = rows[i]; i++) { + var cellsNum = 0; + for (var j = 0, cj; cj = row.cells[j++];) { + cellsNum += (cj.colSpan || 1); + if (cj.rowSpan && cj.rowSpan > 1) { + for (var k = 1; k < cj.rowSpan; k++) { + if (!cellRows['row_' + (i + k)]) { + cellRows['row_' + (i + k)] = (cj.colSpan || 1); + } else { + cellRows['row_' + (i + k)]++ + } + } + + } + } + cellsNum += cellRows['row_' + i] || 0; + maxLen = Math.max(cellsNum, maxLen); + } + return maxLen; + }, + getCellColIndex:function (cell) { + + }, + /** + * 获取当前cell旁边的单元格, + * @param cell + * @param right + */ + getHSideCell:function (cell, right) { + try { + var cellInfo = this.getCellInfo(cell), + previewRowIndex, previewColIndex; + var len = this.selectedTds.length, + range = this.cellsRange; + //首行或者首列没有前置单元格 + if ((!right && (!len ? !cellInfo.colIndex : !range.beginColIndex)) || (right && (!len ? (cellInfo.colIndex == (this.colsNum - 1)) : (range.endColIndex == this.colsNum - 1)))) return null; + + previewRowIndex = !len ? cellInfo.rowIndex : range.beginRowIndex; + previewColIndex = !right ? ( !len ? (cellInfo.colIndex < 1 ? 0 : (cellInfo.colIndex - 1)) : range.beginColIndex - 1) + : ( !len ? cellInfo.colIndex + 1 : range.endColIndex + 1); + return this.getCell(this.indexTable[previewRowIndex][previewColIndex].rowIndex, this.indexTable[previewRowIndex][previewColIndex].cellIndex); + } catch (e) { + showError(e); + } + }, + getTabNextCell:function (cell, preRowIndex) { + var cellInfo = this.getCellInfo(cell), + rowIndex = preRowIndex || cellInfo.rowIndex, + colIndex = cellInfo.colIndex + 1 + (cellInfo.colSpan - 1), + nextCell; + try { + nextCell = this.getCell(this.indexTable[rowIndex][colIndex].rowIndex, this.indexTable[rowIndex][colIndex].cellIndex); + } catch (e) { + try { + rowIndex = rowIndex * 1 + 1; + colIndex = 0; + nextCell = this.getCell(this.indexTable[rowIndex][colIndex].rowIndex, this.indexTable[rowIndex][colIndex].cellIndex); + } catch (e) { + } + } + return nextCell; + + }, + /** + * 获取视觉上的后置单元格 + * @param cell + * @param bottom + */ + getVSideCell:function (cell, bottom, ignoreRange) { + try { + var cellInfo = this.getCellInfo(cell), + nextRowIndex, nextColIndex; + var len = this.selectedTds.length && !ignoreRange, + range = this.cellsRange; + //末行或者末列没有后置单元格 + if ((!bottom && (cellInfo.rowIndex == 0)) || (bottom && (!len ? (cellInfo.rowIndex + cellInfo.rowSpan > this.rowsNum - 1) : (range.endRowIndex == this.rowsNum - 1)))) return null; + + nextRowIndex = !bottom ? ( !len ? cellInfo.rowIndex - 1 : range.beginRowIndex - 1) + : ( !len ? (cellInfo.rowIndex + cellInfo.rowSpan) : range.endRowIndex + 1); + nextColIndex = !len ? cellInfo.colIndex : range.beginColIndex; + return this.getCell(this.indexTable[nextRowIndex][nextColIndex].rowIndex, this.indexTable[nextRowIndex][nextColIndex].cellIndex); + } catch (e) { + showError(e); + } + }, + /** + * 获取相同结束位置的单元格,xOrY指代了是获取x轴相同还是y轴相同 + */ + getSameEndPosCells:function (cell, xOrY) { + try { + var flag = (xOrY.toLowerCase() === "x"), + end = domUtils.getXY(cell)[flag ? 'x' : 'y'] + cell["offset" + (flag ? 'Width' : 'Height')], + rows = this.table.rows, + cells = null, returns = []; + for (var i = 0; i < this.rowsNum; i++) { + cells = rows[i].cells; + for (var j = 0, tmpCell; tmpCell = cells[j++];) { + var tmpEnd = domUtils.getXY(tmpCell)[flag ? 'x' : 'y'] + tmpCell["offset" + (flag ? 'Width' : 'Height')]; + //对应行的td已经被上面行rowSpan了 + if (tmpEnd > end && flag) break; + if (cell == tmpCell || end == tmpEnd) { + //只获取单一的单元格 + //todo 仅获取单一单元格在特定情况下会造成returns为空,从而影响后续的拖拽实现,修正这个。需考虑性能 + if (tmpCell[flag ? "colSpan" : "rowSpan"] == 1) { + returns.push(tmpCell); + } + if (flag) break; + } + } + } + return returns; + } catch (e) { + showError(e); + } + }, + setCellContent:function (cell, content) { + cell.innerHTML = content || (browser.ie ? domUtils.fillChar : "
    "); + }, + cloneCell:UETable.cloneCell, + /** + * 获取跟当前单元格的右边竖线为左边的所有未合并单元格 + */ + getSameStartPosXCells:function (cell) { + try { + var start = domUtils.getXY(cell).x + cell.offsetWidth, + rows = this.table.rows, cells , returns = []; + for (var i = 0; i < this.rowsNum; i++) { + cells = rows[i].cells; + for (var j = 0, tmpCell; tmpCell = cells[j++];) { + var tmpStart = domUtils.getXY(tmpCell).x; + if (tmpStart > start) break; + if (tmpStart == start && tmpCell.colSpan == 1) { + returns.push(tmpCell); + break; + } + } + } + return returns; + } catch (e) { + showError(e); + } + }, + /** + * 更新table对应的索引表 + */ + update:function (table) { + this.table = table || this.table; + this.selectedTds = []; + this.cellsRange = {}; + this.indexTable = []; + var rows = this.table.rows, + rowsNum = this.getMaxRows(), + dNum = rowsNum - rows.length, + colsNum = this.getMaxCols(); + while (dNum--) { + this.table.insertRow(rows.length); + } + this.rowsNum = rowsNum; + this.colsNum = colsNum; + for (var i = 0, len = rows.length; i < len; i++) { + this.indexTable[i] = new Array(colsNum); + } + //填充索引表 + for (var rowIndex = 0, row; row = rows[rowIndex]; rowIndex++) { + for (var cellIndex = 0, cell, cells = row.cells; cell = cells[cellIndex]; cellIndex++) { + //修正整行被rowSpan时导致的行数计算错误 + if (cell.rowSpan > rowsNum) { + cell.rowSpan = rowsNum; + } + var colIndex = cellIndex, + rowSpan = cell.rowSpan || 1, + colSpan = cell.colSpan || 1; + //当已经被上一行rowSpan或者被前一列colSpan了,则跳到下一个单元格进行 + while (this.indexTable[rowIndex][colIndex]) colIndex++; + for (var j = 0; j < rowSpan; j++) { + for (var k = 0; k < colSpan; k++) { + this.indexTable[rowIndex + j][colIndex + k] = { + rowIndex:rowIndex, + cellIndex:cellIndex, + colIndex:colIndex, + rowSpan:rowSpan, + colSpan:colSpan + } + } + } + } + } + //修复残缺td + for (j = 0; j < rowsNum; j++) { + for (k = 0; k < colsNum; k++) { + if (this.indexTable[j][k] === undefined) { + row = rows[j]; + cell = row.cells[row.cells.length - 1]; + cell = cell ? cell.cloneNode(true) : this.table.ownerDocument.createElement("td"); + this.setCellContent(cell); + if (cell.colSpan !== 1)cell.colSpan = 1; + if (cell.rowSpan !== 1)cell.rowSpan = 1; + row.appendChild(cell); + this.indexTable[j][k] = { + rowIndex:j, + cellIndex:cell.cellIndex, + colIndex:k, + rowSpan:1, + colSpan:1 + } + } + } + } + //当框选后删除行或者列后撤销,需要重建选区。 + var tds = domUtils.getElementsByTagName(this.table, "td"), + selectTds = []; + utils.each(tds, function (td) { + if (domUtils.hasClass(td, "selectTdClass")) { + selectTds.push(td); + } + }); + if (selectTds.length) { + var start = selectTds[0], + end = selectTds[selectTds.length - 1], + startInfo = this.getCellInfo(start), + endInfo = this.getCellInfo(end); + this.selectedTds = selectTds; + this.cellsRange = { + beginRowIndex:startInfo.rowIndex, + beginColIndex:startInfo.colIndex, + endRowIndex:endInfo.rowIndex + endInfo.rowSpan - 1, + endColIndex:endInfo.colIndex + endInfo.colSpan - 1 + }; + } + //给第一行设置firstRow的样式名称,在排序图标的样式上使用到 + if(!domUtils.hasClass(this.table.rows[0], "firstRow")) { + domUtils.addClass(this.table.rows[0], "firstRow"); + for(var i = 1; i< this.table.rows.length; i++) { + domUtils.removeClasses(this.table.rows[i], "firstRow"); + } + } + }, + /** + * 获取单元格的索引信息 + */ + getCellInfo:function (cell) { + if (!cell) return; + var cellIndex = cell.cellIndex, + rowIndex = cell.parentNode.rowIndex, + rowInfo = this.indexTable[rowIndex], + numCols = this.colsNum; + for (var colIndex = cellIndex; colIndex < numCols; colIndex++) { + var cellInfo = rowInfo[colIndex]; + if (cellInfo.rowIndex === rowIndex && cellInfo.cellIndex === cellIndex) { + return cellInfo; + } + } + }, + /** + * 根据行列号获取单元格 + */ + getCell:function (rowIndex, cellIndex) { + return rowIndex < this.rowsNum && this.table.rows[rowIndex].cells[cellIndex] || null; + }, + /** + * 删除单元格 + */ + deleteCell:function (cell, rowIndex) { + rowIndex = typeof rowIndex == 'number' ? rowIndex : cell.parentNode.rowIndex; + var row = this.table.rows[rowIndex]; + row.deleteCell(cell.cellIndex); + }, + /** + * 根据始末两个单元格获取被框选的所有单元格范围 + */ + getCellsRange:function (cellA, cellB) { + function checkRange(beginRowIndex, beginColIndex, endRowIndex, endColIndex) { + var tmpBeginRowIndex = beginRowIndex, + tmpBeginColIndex = beginColIndex, + tmpEndRowIndex = endRowIndex, + tmpEndColIndex = endColIndex, + cellInfo, colIndex, rowIndex; + // 通过indexTable检查是否存在超出TableRange上边界的情况 + if (beginRowIndex > 0) { + for (colIndex = beginColIndex; colIndex < endColIndex; colIndex++) { + cellInfo = me.indexTable[beginRowIndex][colIndex]; + rowIndex = cellInfo.rowIndex; + if (rowIndex < beginRowIndex) { + tmpBeginRowIndex = Math.min(rowIndex, tmpBeginRowIndex); + } + } + } + // 通过indexTable检查是否存在超出TableRange右边界的情况 + if (endColIndex < me.colsNum) { + for (rowIndex = beginRowIndex; rowIndex < endRowIndex; rowIndex++) { + cellInfo = me.indexTable[rowIndex][endColIndex]; + colIndex = cellInfo.colIndex + cellInfo.colSpan - 1; + if (colIndex > endColIndex) { + tmpEndColIndex = Math.max(colIndex, tmpEndColIndex); + } + } + } + // 检查是否有超出TableRange下边界的情况 + if (endRowIndex < me.rowsNum) { + for (colIndex = beginColIndex; colIndex < endColIndex; colIndex++) { + cellInfo = me.indexTable[endRowIndex][colIndex]; + rowIndex = cellInfo.rowIndex + cellInfo.rowSpan - 1; + if (rowIndex > endRowIndex) { + tmpEndRowIndex = Math.max(rowIndex, tmpEndRowIndex); + } + } + } + // 检查是否有超出TableRange左边界的情况 + if (beginColIndex > 0) { + for (rowIndex = beginRowIndex; rowIndex < endRowIndex; rowIndex++) { + cellInfo = me.indexTable[rowIndex][beginColIndex]; + colIndex = cellInfo.colIndex; + if (colIndex < beginColIndex) { + tmpBeginColIndex = Math.min(cellInfo.colIndex, tmpBeginColIndex); + } + } + } + //递归调用直至所有完成所有框选单元格的扩展 + if (tmpBeginRowIndex != beginRowIndex || tmpBeginColIndex != beginColIndex || tmpEndRowIndex != endRowIndex || tmpEndColIndex != endColIndex) { + return checkRange(tmpBeginRowIndex, tmpBeginColIndex, tmpEndRowIndex, tmpEndColIndex); + } else { + // 不需要扩展TableRange的情况 + return { + beginRowIndex:beginRowIndex, + beginColIndex:beginColIndex, + endRowIndex:endRowIndex, + endColIndex:endColIndex + }; + } + } + + try { + var me = this, + cellAInfo = me.getCellInfo(cellA); + if (cellA === cellB) { + return { + beginRowIndex:cellAInfo.rowIndex, + beginColIndex:cellAInfo.colIndex, + endRowIndex:cellAInfo.rowIndex + cellAInfo.rowSpan - 1, + endColIndex:cellAInfo.colIndex + cellAInfo.colSpan - 1 + }; + } + var cellBInfo = me.getCellInfo(cellB); + // 计算TableRange的四个边 + var beginRowIndex = Math.min(cellAInfo.rowIndex, cellBInfo.rowIndex), + beginColIndex = Math.min(cellAInfo.colIndex, cellBInfo.colIndex), + endRowIndex = Math.max(cellAInfo.rowIndex + cellAInfo.rowSpan - 1, cellBInfo.rowIndex + cellBInfo.rowSpan - 1), + endColIndex = Math.max(cellAInfo.colIndex + cellAInfo.colSpan - 1, cellBInfo.colIndex + cellBInfo.colSpan - 1); + + return checkRange(beginRowIndex, beginColIndex, endRowIndex, endColIndex); + } catch (e) { + //throw e; + } + }, + /** + * 依据cellsRange获取对应的单元格集合 + */ + getCells:function (range) { + //每次获取cells之前必须先清除上次的选择,否则会对后续获取操作造成影响 + this.clearSelected(); + var beginRowIndex = range.beginRowIndex, + beginColIndex = range.beginColIndex, + endRowIndex = range.endRowIndex, + endColIndex = range.endColIndex, + cellInfo, rowIndex, colIndex, tdHash = {}, returnTds = []; + for (var i = beginRowIndex; i <= endRowIndex; i++) { + for (var j = beginColIndex; j <= endColIndex; j++) { + cellInfo = this.indexTable[i][j]; + rowIndex = cellInfo.rowIndex; + colIndex = cellInfo.colIndex; + // 如果Cells里已经包含了此Cell则跳过 + var key = rowIndex + '|' + colIndex; + if (tdHash[key]) continue; + tdHash[key] = 1; + if (rowIndex < i || colIndex < j || rowIndex + cellInfo.rowSpan - 1 > endRowIndex || colIndex + cellInfo.colSpan - 1 > endColIndex) { + return null; + } + returnTds.push(this.getCell(rowIndex, cellInfo.cellIndex)); + } + } + return returnTds; + }, + /** + * 清理已经选中的单元格 + */ + clearSelected:function () { + UETable.removeSelectedClass(this.selectedTds); + this.selectedTds = []; + this.cellsRange = {}; + }, + /** + * 根据range设置已经选中的单元格 + */ + setSelected:function (range) { + var cells = this.getCells(range); + UETable.addSelectedClass(cells); + this.selectedTds = cells; + this.cellsRange = range; + }, + isFullRow:function () { + var range = this.cellsRange; + return (range.endColIndex - range.beginColIndex + 1) == this.colsNum; + }, + isFullCol:function () { + var range = this.cellsRange, + table = this.table, + ths = table.getElementsByTagName("th"), + rows = range.endRowIndex - range.beginRowIndex + 1; + return !ths.length ? rows == this.rowsNum : rows == this.rowsNum || (rows == this.rowsNum - 1); + + }, + /** + * 获取视觉上的前置单元格,默认是左边,top传入时 + * @param cell + * @param top + */ + getNextCell:function (cell, bottom, ignoreRange) { + try { + var cellInfo = this.getCellInfo(cell), + nextRowIndex, nextColIndex; + var len = this.selectedTds.length && !ignoreRange, + range = this.cellsRange; + //末行或者末列没有后置单元格 + if ((!bottom && (cellInfo.rowIndex == 0)) || (bottom && (!len ? (cellInfo.rowIndex + cellInfo.rowSpan > this.rowsNum - 1) : (range.endRowIndex == this.rowsNum - 1)))) return null; + + nextRowIndex = !bottom ? ( !len ? cellInfo.rowIndex - 1 : range.beginRowIndex - 1) + : ( !len ? (cellInfo.rowIndex + cellInfo.rowSpan) : range.endRowIndex + 1); + nextColIndex = !len ? cellInfo.colIndex : range.beginColIndex; + return this.getCell(this.indexTable[nextRowIndex][nextColIndex].rowIndex, this.indexTable[nextRowIndex][nextColIndex].cellIndex); + } catch (e) { + showError(e); + } + }, + getPreviewCell:function (cell, top) { + try { + var cellInfo = this.getCellInfo(cell), + previewRowIndex, previewColIndex; + var len = this.selectedTds.length, + range = this.cellsRange; + //首行或者首列没有前置单元格 + if ((!top && (!len ? !cellInfo.colIndex : !range.beginColIndex)) || (top && (!len ? (cellInfo.rowIndex > (this.colsNum - 1)) : (range.endColIndex == this.colsNum - 1)))) return null; + + previewRowIndex = !top ? ( !len ? cellInfo.rowIndex : range.beginRowIndex ) + : ( !len ? (cellInfo.rowIndex < 1 ? 0 : (cellInfo.rowIndex - 1)) : range.beginRowIndex); + previewColIndex = !top ? ( !len ? (cellInfo.colIndex < 1 ? 0 : (cellInfo.colIndex - 1)) : range.beginColIndex - 1) + : ( !len ? cellInfo.colIndex : range.endColIndex + 1); + return this.getCell(this.indexTable[previewRowIndex][previewColIndex].rowIndex, this.indexTable[previewRowIndex][previewColIndex].cellIndex); + } catch (e) { + showError(e); + } + }, + /** + * 移动单元格中的内容 + */ + moveContent:function (cellTo, cellFrom) { + if (UETable.isEmptyBlock(cellFrom)) return; + if (UETable.isEmptyBlock(cellTo)) { + cellTo.innerHTML = cellFrom.innerHTML; + return; + } + var child = cellTo.lastChild; + if (child.nodeType == 3 || !dtd.$block[child.tagName]) { + cellTo.appendChild(cellTo.ownerDocument.createElement('br')) + } + while (child = cellFrom.firstChild) { + cellTo.appendChild(child); + } + }, + /** + * 向右合并单元格 + */ + mergeRight:function (cell) { + var cellInfo = this.getCellInfo(cell), + rightColIndex = cellInfo.colIndex + cellInfo.colSpan, + rightCellInfo = this.indexTable[cellInfo.rowIndex][rightColIndex], + rightCell = this.getCell(rightCellInfo.rowIndex, rightCellInfo.cellIndex); + //合并 + cell.colSpan = cellInfo.colSpan + rightCellInfo.colSpan; + //被合并的单元格不应存在宽度属性 + cell.removeAttribute("width"); + //移动内容 + this.moveContent(cell, rightCell); + //删掉被合并的Cell + this.deleteCell(rightCell, rightCellInfo.rowIndex); + this.update(); + }, + /** + * 向下合并单元格 + */ + mergeDown:function (cell) { + var cellInfo = this.getCellInfo(cell), + downRowIndex = cellInfo.rowIndex + cellInfo.rowSpan, + downCellInfo = this.indexTable[downRowIndex][cellInfo.colIndex], + downCell = this.getCell(downCellInfo.rowIndex, downCellInfo.cellIndex); + cell.rowSpan = cellInfo.rowSpan + downCellInfo.rowSpan; + cell.removeAttribute("height"); + this.moveContent(cell, downCell); + this.deleteCell(downCell, downCellInfo.rowIndex); + this.update(); + }, + /** + * 合并整个range中的内容 + */ + mergeRange:function () { + //由于合并操作可以在任意时刻进行,所以无法通过鼠标位置等信息实时生成range,只能通过缓存实例中的cellsRange对象来访问 + var range = this.cellsRange, + leftTopCell = this.getCell(range.beginRowIndex, this.indexTable[range.beginRowIndex][range.beginColIndex].cellIndex); + + if (leftTopCell.tagName == "TH" && range.endRowIndex !== range.beginRowIndex) { + var index = this.indexTable, + info = this.getCellInfo(leftTopCell); + leftTopCell = this.getCell(1, index[1][info.colIndex].cellIndex); + range = this.getCellsRange(leftTopCell, this.getCell(index[this.rowsNum - 1][info.colIndex].rowIndex, index[this.rowsNum - 1][info.colIndex].cellIndex)); + } + + // 删除剩余的Cells + var cells = this.getCells(range); + for(var i= 0,ci;ci=cells[i++];){ + if (ci !== leftTopCell) { + this.moveContent(leftTopCell, ci); + this.deleteCell(ci); + } + } + // 修改左上角Cell的rowSpan和colSpan,并调整宽度属性设置 + leftTopCell.rowSpan = range.endRowIndex - range.beginRowIndex + 1; + leftTopCell.rowSpan > 1 && leftTopCell.removeAttribute("height"); + leftTopCell.colSpan = range.endColIndex - range.beginColIndex + 1; + leftTopCell.colSpan > 1 && leftTopCell.removeAttribute("width"); + if (leftTopCell.rowSpan == this.rowsNum && leftTopCell.colSpan != 1) { + leftTopCell.colSpan = 1; + } + + if (leftTopCell.colSpan == this.colsNum && leftTopCell.rowSpan != 1) { + var rowIndex = leftTopCell.parentNode.rowIndex; + //解决IE下的表格操作问题 + if( this.table.deleteRow ) { + for (var i = rowIndex+ 1, curIndex=rowIndex+ 1, len=leftTopCell.rowSpan; i < len; i++) { + this.table.deleteRow(curIndex); + } + } else { + for (var i = 0, len=leftTopCell.rowSpan - 1; i < len; i++) { + var row = this.table.rows[rowIndex + 1]; + row.parentNode.removeChild(row); + } + } + leftTopCell.rowSpan = 1; + } + this.update(); + }, + /** + * 插入一行单元格 + */ + insertRow:function (rowIndex, sourceCell) { + var numCols = this.colsNum, + table = this.table, + row = table.insertRow(rowIndex), cell, + isInsertTitle = typeof sourceCell == 'string' && sourceCell.toUpperCase() == 'TH'; + + function replaceTdToTh(colIndex, cell, tableRow) { + if (colIndex == 0) { + var tr = tableRow.nextSibling || tableRow.previousSibling, + th = tr.cells[colIndex]; + if (th.tagName == 'TH') { + th = cell.ownerDocument.createElement("th"); + th.appendChild(cell.firstChild); + tableRow.insertBefore(th, cell); + domUtils.remove(cell) + } + }else{ + if (cell.tagName == 'TH') { + var td = cell.ownerDocument.createElement("td"); + td.appendChild(cell.firstChild); + tableRow.insertBefore(td, cell); + domUtils.remove(cell) + } + } + } + + //首行直接插入,无需考虑部分单元格被rowspan的情况 + if (rowIndex == 0 || rowIndex == this.rowsNum) { + for (var colIndex = 0; colIndex < numCols; colIndex++) { + cell = this.cloneCell(sourceCell, true); + this.setCellContent(cell); + cell.getAttribute('vAlign') && cell.setAttribute('vAlign', cell.getAttribute('vAlign')); + row.appendChild(cell); + if(!isInsertTitle) replaceTdToTh(colIndex, cell, row); + } + } else { + var infoRow = this.indexTable[rowIndex], + cellIndex = 0; + for (colIndex = 0; colIndex < numCols; colIndex++) { + var cellInfo = infoRow[colIndex]; + //如果存在某个单元格的rowspan穿过待插入行的位置,则修改该单元格的rowspan即可,无需插入单元格 + if (cellInfo.rowIndex < rowIndex) { + cell = this.getCell(cellInfo.rowIndex, cellInfo.cellIndex); + cell.rowSpan = cellInfo.rowSpan + 1; + } else { + cell = this.cloneCell(sourceCell, true); + this.setCellContent(cell); + row.appendChild(cell); + } + if(!isInsertTitle) replaceTdToTh(colIndex, cell, row); + } + } + //框选时插入不触发contentchange,需要手动更新索引。 + this.update(); + return row; + }, + /** + * 删除一行单元格 + * @param rowIndex + */ + deleteRow:function (rowIndex) { + var row = this.table.rows[rowIndex], + infoRow = this.indexTable[rowIndex], + colsNum = this.colsNum, + count = 0; //处理计数 + for (var colIndex = 0; colIndex < colsNum;) { + var cellInfo = infoRow[colIndex], + cell = this.getCell(cellInfo.rowIndex, cellInfo.cellIndex); + if (cell.rowSpan > 1) { + if (cellInfo.rowIndex == rowIndex) { + var clone = cell.cloneNode(true); + clone.rowSpan = cell.rowSpan - 1; + clone.innerHTML = ""; + cell.rowSpan = 1; + var nextRowIndex = rowIndex + 1, + nextRow = this.table.rows[nextRowIndex], + insertCellIndex, + preMerged = this.getPreviewMergedCellsNum(nextRowIndex, colIndex) - count; + if (preMerged < colIndex) { + insertCellIndex = colIndex - preMerged - 1; + //nextRow.insertCell(insertCellIndex); + domUtils.insertAfter(nextRow.cells[insertCellIndex], clone); + } else { + if (nextRow.cells.length) nextRow.insertBefore(clone, nextRow.cells[0]) + } + count += 1; + //cell.parentNode.removeChild(cell); + } + } + colIndex += cell.colSpan || 1; + } + var deleteTds = [], cacheMap = {}; + for (colIndex = 0; colIndex < colsNum; colIndex++) { + var tmpRowIndex = infoRow[colIndex].rowIndex, + tmpCellIndex = infoRow[colIndex].cellIndex, + key = tmpRowIndex + "_" + tmpCellIndex; + if (cacheMap[key])continue; + cacheMap[key] = 1; + cell = this.getCell(tmpRowIndex, tmpCellIndex); + deleteTds.push(cell); + } + var mergeTds = []; + utils.each(deleteTds, function (td) { + if (td.rowSpan == 1) { + td.parentNode.removeChild(td); + } else { + mergeTds.push(td); + } + }); + utils.each(mergeTds, function (td) { + td.rowSpan--; + }); + row.parentNode.removeChild(row); + //浏览器方法本身存在bug,采用自定义方法删除 + //this.table.deleteRow(rowIndex); + this.update(); + }, + insertCol:function (colIndex, sourceCell, defaultValue) { + var rowsNum = this.rowsNum, + rowIndex = 0, + tableRow, cell, + backWidth = parseInt((this.table.offsetWidth - (this.colsNum + 1) * 20 - (this.colsNum + 1)) / (this.colsNum + 1), 10), + isInsertTitleCol = typeof sourceCell == 'string' && sourceCell.toUpperCase() == 'TH'; + + function replaceTdToTh(rowIndex, cell, tableRow) { + if (rowIndex == 0) { + var th = cell.nextSibling || cell.previousSibling; + if (th.tagName == 'TH') { + th = cell.ownerDocument.createElement("th"); + th.appendChild(cell.firstChild); + tableRow.insertBefore(th, cell); + domUtils.remove(cell) + } + }else{ + if (cell.tagName == 'TH') { + var td = cell.ownerDocument.createElement("td"); + td.appendChild(cell.firstChild); + tableRow.insertBefore(td, cell); + domUtils.remove(cell) + } + } + } + + var preCell; + if (colIndex == 0 || colIndex == this.colsNum) { + for (; rowIndex < rowsNum; rowIndex++) { + tableRow = this.table.rows[rowIndex]; + preCell = tableRow.cells[colIndex == 0 ? colIndex : tableRow.cells.length]; + cell = this.cloneCell(sourceCell, true); //tableRow.insertCell(colIndex == 0 ? colIndex : tableRow.cells.length); + this.setCellContent(cell); + cell.setAttribute('vAlign', cell.getAttribute('vAlign')); + preCell && cell.setAttribute('width', preCell.getAttribute('width')); + if (!colIndex) { + tableRow.insertBefore(cell, tableRow.cells[0]); + } else { + domUtils.insertAfter(tableRow.cells[tableRow.cells.length - 1], cell); + } + if(!isInsertTitleCol) replaceTdToTh(rowIndex, cell, tableRow) + } + } else { + for (; rowIndex < rowsNum; rowIndex++) { + var cellInfo = this.indexTable[rowIndex][colIndex]; + if (cellInfo.colIndex < colIndex) { + cell = this.getCell(cellInfo.rowIndex, cellInfo.cellIndex); + cell.colSpan = cellInfo.colSpan + 1; + } else { + tableRow = this.table.rows[rowIndex]; + preCell = tableRow.cells[cellInfo.cellIndex]; + + cell = this.cloneCell(sourceCell, true);//tableRow.insertCell(cellInfo.cellIndex); + this.setCellContent(cell); + cell.setAttribute('vAlign', cell.getAttribute('vAlign')); + preCell && cell.setAttribute('width', preCell.getAttribute('width')); + //防止IE下报错 + preCell ? tableRow.insertBefore(cell, preCell) : tableRow.appendChild(cell); + } + if(!isInsertTitleCol) replaceTdToTh(rowIndex, cell, tableRow); + } + } + //框选时插入不触发contentchange,需要手动更新索引 + this.update(); + this.updateWidth(backWidth, defaultValue || {tdPadding:10, tdBorder:1}); + }, + updateWidth:function (width, defaultValue) { + var table = this.table, + tmpWidth = UETable.getWidth(table) - defaultValue.tdPadding * 2 - defaultValue.tdBorder + width; + if (tmpWidth < table.ownerDocument.body.offsetWidth) { + table.setAttribute("width", tmpWidth); + return; + } + var tds = domUtils.getElementsByTagName(this.table, "td th"); + utils.each(tds, function (td) { + td.setAttribute("width", width); + }) + }, + deleteCol:function (colIndex) { + var indexTable = this.indexTable, + tableRows = this.table.rows, + backTableWidth = this.table.getAttribute("width"), + backTdWidth = 0, + rowsNum = this.rowsNum, + cacheMap = {}; + for (var rowIndex = 0; rowIndex < rowsNum;) { + var infoRow = indexTable[rowIndex], + cellInfo = infoRow[colIndex], + key = cellInfo.rowIndex + '_' + cellInfo.colIndex; + // 跳过已经处理过的Cell + if (cacheMap[key])continue; + cacheMap[key] = 1; + var cell = this.getCell(cellInfo.rowIndex, cellInfo.cellIndex); + if (!backTdWidth) backTdWidth = cell && parseInt(cell.offsetWidth / cell.colSpan, 10).toFixed(0); + // 如果Cell的colSpan大于1, 就修改colSpan, 否则就删掉这个Cell + if (cell.colSpan > 1) { + cell.colSpan--; + } else { + tableRows[rowIndex].deleteCell(cellInfo.cellIndex); + } + rowIndex += cellInfo.rowSpan || 1; + } + this.table.setAttribute("width", backTableWidth - backTdWidth); + this.update(); + }, + splitToCells:function (cell) { + var me = this, + cells = this.splitToRows(cell); + utils.each(cells, function (cell) { + me.splitToCols(cell); + }) + }, + splitToRows:function (cell) { + var cellInfo = this.getCellInfo(cell), + rowIndex = cellInfo.rowIndex, + colIndex = cellInfo.colIndex, + results = []; + // 修改Cell的rowSpan + cell.rowSpan = 1; + results.push(cell); + // 补齐单元格 + for (var i = rowIndex, endRow = rowIndex + cellInfo.rowSpan; i < endRow; i++) { + if (i == rowIndex)continue; + var tableRow = this.table.rows[i], + tmpCell = tableRow.insertCell(colIndex - this.getPreviewMergedCellsNum(i, colIndex)); + tmpCell.colSpan = cellInfo.colSpan; + this.setCellContent(tmpCell); + tmpCell.setAttribute('vAlign', cell.getAttribute('vAlign')); + tmpCell.setAttribute('align', cell.getAttribute('align')); + if (cell.style.cssText) { + tmpCell.style.cssText = cell.style.cssText; + } + results.push(tmpCell); + } + this.update(); + return results; + }, + getPreviewMergedCellsNum:function (rowIndex, colIndex) { + var indexRow = this.indexTable[rowIndex], + num = 0; + for (var i = 0; i < colIndex;) { + var colSpan = indexRow[i].colSpan, + tmpRowIndex = indexRow[i].rowIndex; + num += (colSpan - (tmpRowIndex == rowIndex ? 1 : 0)); + i += colSpan; + } + return num; + }, + splitToCols:function (cell) { + var backWidth = (cell.offsetWidth / cell.colSpan - 22).toFixed(0), + + cellInfo = this.getCellInfo(cell), + rowIndex = cellInfo.rowIndex, + colIndex = cellInfo.colIndex, + results = []; + // 修改Cell的rowSpan + cell.colSpan = 1; + cell.setAttribute("width", backWidth); + results.push(cell); + // 补齐单元格 + for (var j = colIndex, endCol = colIndex + cellInfo.colSpan; j < endCol; j++) { + if (j == colIndex)continue; + var tableRow = this.table.rows[rowIndex], + tmpCell = tableRow.insertCell(this.indexTable[rowIndex][j].cellIndex + 1); + tmpCell.rowSpan = cellInfo.rowSpan; + this.setCellContent(tmpCell); + tmpCell.setAttribute('vAlign', cell.getAttribute('vAlign')); + tmpCell.setAttribute('align', cell.getAttribute('align')); + tmpCell.setAttribute('width', backWidth); + if (cell.style.cssText) { + tmpCell.style.cssText = cell.style.cssText; + } + //处理th的情况 + if (cell.tagName == 'TH') { + var th = cell.ownerDocument.createElement('th'); + th.appendChild(tmpCell.firstChild); + th.setAttribute('vAlign', cell.getAttribute('vAlign')); + th.rowSpan = tmpCell.rowSpan; + tableRow.insertBefore(th, tmpCell); + domUtils.remove(tmpCell); + } + results.push(tmpCell); + } + this.update(); + return results; + }, + isLastCell:function (cell, rowsNum, colsNum) { + rowsNum = rowsNum || this.rowsNum; + colsNum = colsNum || this.colsNum; + var cellInfo = this.getCellInfo(cell); + return ((cellInfo.rowIndex + cellInfo.rowSpan) == rowsNum) && + ((cellInfo.colIndex + cellInfo.colSpan) == colsNum); + }, + getLastCell:function (cells) { + cells = cells || this.table.getElementsByTagName("td"); + var firstInfo = this.getCellInfo(cells[0]); + var me = this, last = cells[0], + tr = last.parentNode, + cellsNum = 0, cols = 0, rows; + utils.each(cells, function (cell) { + if (cell.parentNode == tr)cols += cell.colSpan || 1; + cellsNum += cell.rowSpan * cell.colSpan || 1; + }); + rows = cellsNum / cols; + utils.each(cells, function (cell) { + if (me.isLastCell(cell, rows, cols)) { + last = cell; + return false; + } + }); + return last; + + }, + selectRow:function (rowIndex) { + var indexRow = this.indexTable[rowIndex], + start = this.getCell(indexRow[0].rowIndex, indexRow[0].cellIndex), + end = this.getCell(indexRow[this.colsNum - 1].rowIndex, indexRow[this.colsNum - 1].cellIndex), + range = this.getCellsRange(start, end); + this.setSelected(range); + }, + selectTable:function () { + var tds = this.table.getElementsByTagName("td"), + range = this.getCellsRange(tds[0], tds[tds.length - 1]); + this.setSelected(range); + }, + setBackground:function (cells, value) { + if (typeof value === "string") { + utils.each(cells, function (cell) { + cell.style.backgroundColor = value; + }) + } else if (typeof value === "object") { + value = utils.extend({ + repeat:true, + colorList:["#ddd", "#fff"] + }, value); + var rowIndex = this.getCellInfo(cells[0]).rowIndex, + count = 0, + colors = value.colorList, + getColor = function (list, index, repeat) { + return list[index] ? list[index] : repeat ? list[index % list.length] : ""; + }; + for (var i = 0, cell; cell = cells[i++];) { + var cellInfo = this.getCellInfo(cell); + cell.style.backgroundColor = getColor(colors, ((rowIndex + count) == cellInfo.rowIndex) ? count : ++count, value.repeat); + } + } + }, + removeBackground:function (cells) { + utils.each(cells, function (cell) { + cell.style.backgroundColor = ""; + }) + } + + + }; + function showError(e) { + } +})(); + +// plugins/table.cmds.js +/** + * Created with JetBrains PhpStorm. + * User: taoqili + * Date: 13-2-20 + * Time: 下午6:25 + * To change this template use File | Settings | File Templates. + */ +; +(function () { + var UT = UE.UETable, + getTableItemsByRange = function (editor) { + return UT.getTableItemsByRange(editor); + }, + getUETableBySelected = function (editor) { + return UT.getUETableBySelected(editor) + }, + getDefaultValue = function (editor, table) { + return UT.getDefaultValue(editor, table); + }, + getUETable = function (tdOrTable) { + return UT.getUETable(tdOrTable); + }; + + + UE.commands['inserttable'] = { + queryCommandState: function () { + return getTableItemsByRange(this).table ? -1 : 0; + }, + execCommand: function (cmd, opt) { + function createTable(opt, tdWidth) { + var html = [], + rowsNum = opt.numRows, + colsNum = opt.numCols; + for (var r = 0; r < rowsNum; r++) { + html.push(''); + for (var c = 0; c < colsNum; c++) { + html.push('
  • ' + (browser.ie && browser.version < 11 ? domUtils.fillChar : '
    ') + '
    ' + html.join('') + '
    ' + } + + if (!opt) { + opt = utils.extend({}, { + numCols: this.options.defaultCols, + numRows: this.options.defaultRows, + tdvalign: this.options.tdvalign + }) + } + var me = this; + var range = this.selection.getRange(), + start = range.startContainer, + firstParentBlock = domUtils.findParent(start, function (node) { + return domUtils.isBlockElm(node); + }, true) || me.body; + + var defaultValue = getDefaultValue(me), + tableWidth = firstParentBlock.offsetWidth, + tdWidth = Math.floor(tableWidth / opt.numCols - defaultValue.tdPadding * 2 - defaultValue.tdBorder); + + //todo其他属性 + !opt.tdvalign && (opt.tdvalign = me.options.tdvalign); + me.execCommand("inserthtml", createTable(opt, tdWidth)); + } + }; + + UE.commands['insertparagraphbeforetable'] = { + queryCommandState: function () { + return getTableItemsByRange(this).cell ? 0 : -1; + }, + execCommand: function () { + var table = getTableItemsByRange(this).table; + if (table) { + var p = this.document.createElement("p"); + p.innerHTML = browser.ie ? ' ' : '
    '; + table.parentNode.insertBefore(p, table); + this.selection.getRange().setStart(p, 0).setCursor(); + } + } + }; + + UE.commands['deletetable'] = { + queryCommandState: function () { + var rng = this.selection.getRange(); + return domUtils.findParentByTagName(rng.startContainer, 'table', true) ? 0 : -1; + }, + execCommand: function (cmd, table) { + var rng = this.selection.getRange(); + table = table || domUtils.findParentByTagName(rng.startContainer, 'table', true); + if (table) { + var next = table.nextSibling; + if (!next) { + next = domUtils.createElement(this.document, 'p', { + 'innerHTML': browser.ie ? domUtils.fillChar : '
    ' + }); + table.parentNode.insertBefore(next, table); + } + domUtils.remove(table); + rng = this.selection.getRange(); + if (next.nodeType == 3) { + rng.setStartBefore(next) + } else { + rng.setStart(next, 0) + } + rng.setCursor(false, true) + this.fireEvent("tablehasdeleted") + + } + + } + }; + UE.commands['cellalign'] = { + queryCommandState: function () { + return getSelectedArr(this).length ? 0 : -1 + }, + execCommand: function (cmd, align) { + var selectedTds = getSelectedArr(this); + if (selectedTds.length) { + for (var i = 0, ci; ci = selectedTds[i++];) { + ci.setAttribute('align', align); + } + } + } + }; + UE.commands['cellvalign'] = { + queryCommandState: function () { + return getSelectedArr(this).length ? 0 : -1; + }, + execCommand: function (cmd, valign) { + var selectedTds = getSelectedArr(this); + if (selectedTds.length) { + for (var i = 0, ci; ci = selectedTds[i++];) { + ci.setAttribute('vAlign', valign); + } + } + } + }; + UE.commands['insertcaption'] = { + queryCommandState: function () { + var table = getTableItemsByRange(this).table; + if (table) { + return table.getElementsByTagName('caption').length == 0 ? 1 : -1; + } + return -1; + }, + execCommand: function () { + var table = getTableItemsByRange(this).table; + if (table) { + var caption = this.document.createElement('caption'); + caption.innerHTML = browser.ie ? domUtils.fillChar : '
    '; + table.insertBefore(caption, table.firstChild); + var range = this.selection.getRange(); + range.setStart(caption, 0).setCursor(); + } + + } + }; + UE.commands['deletecaption'] = { + queryCommandState: function () { + var rng = this.selection.getRange(), + table = domUtils.findParentByTagName(rng.startContainer, 'table'); + if (table) { + return table.getElementsByTagName('caption').length == 0 ? -1 : 1; + } + return -1; + }, + execCommand: function () { + var rng = this.selection.getRange(), + table = domUtils.findParentByTagName(rng.startContainer, 'table'); + if (table) { + domUtils.remove(table.getElementsByTagName('caption')[0]); + var range = this.selection.getRange(); + range.setStart(table.rows[0].cells[0], 0).setCursor(); + } + + } + }; + UE.commands['inserttitle'] = { + queryCommandState: function () { + var table = getTableItemsByRange(this).table; + if (table) { + var firstRow = table.rows[0]; + return firstRow.cells[firstRow.cells.length-1].tagName.toLowerCase() != 'th' ? 0 : -1 + } + return -1; + }, + execCommand: function () { + var table = getTableItemsByRange(this).table; + if (table) { + getUETable(table).insertRow(0, 'th'); + } + var th = table.getElementsByTagName('th')[0]; + this.selection.getRange().setStart(th, 0).setCursor(false, true); + } + }; + UE.commands['deletetitle'] = { + queryCommandState: function () { + var table = getTableItemsByRange(this).table; + if (table) { + var firstRow = table.rows[0]; + return firstRow.cells[firstRow.cells.length-1].tagName.toLowerCase() == 'th' ? 0 : -1 + } + return -1; + }, + execCommand: function () { + var table = getTableItemsByRange(this).table; + if (table) { + domUtils.remove(table.rows[0]) + } + var td = table.getElementsByTagName('td')[0]; + this.selection.getRange().setStart(td, 0).setCursor(false, true); + } + }; + UE.commands['inserttitlecol'] = { + queryCommandState: function () { + var table = getTableItemsByRange(this).table; + if (table) { + var lastRow = table.rows[table.rows.length-1]; + return lastRow.getElementsByTagName('th').length ? -1 : 0; + } + return -1; + }, + execCommand: function (cmd) { + var table = getTableItemsByRange(this).table; + if (table) { + getUETable(table).insertCol(0, 'th'); + } + resetTdWidth(table, this); + var th = table.getElementsByTagName('th')[0]; + this.selection.getRange().setStart(th, 0).setCursor(false, true); + } + }; + UE.commands['deletetitlecol'] = { + queryCommandState: function () { + var table = getTableItemsByRange(this).table; + if (table) { + var lastRow = table.rows[table.rows.length-1]; + return lastRow.getElementsByTagName('th').length ? 0 : -1; + } + return -1; + }, + execCommand: function () { + var table = getTableItemsByRange(this).table; + if (table) { + for(var i = 0; i< table.rows.length; i++ ){ + domUtils.remove(table.rows[i].children[0]) + } + } + resetTdWidth(table, this); + var td = table.getElementsByTagName('td')[0]; + this.selection.getRange().setStart(td, 0).setCursor(false, true); + } + }; + + UE.commands["mergeright"] = { + queryCommandState: function (cmd) { + var tableItems = getTableItemsByRange(this), + table = tableItems.table, + cell = tableItems.cell; + + if (!table || !cell) return -1; + var ut = getUETable(table); + if (ut.selectedTds.length) return -1; + + var cellInfo = ut.getCellInfo(cell), + rightColIndex = cellInfo.colIndex + cellInfo.colSpan; + if (rightColIndex >= ut.colsNum) return -1; // 如果处于最右边则不能向右合并 + + var rightCellInfo = ut.indexTable[cellInfo.rowIndex][rightColIndex], + rightCell = table.rows[rightCellInfo.rowIndex].cells[rightCellInfo.cellIndex]; + if (!rightCell || cell.tagName != rightCell.tagName) return -1; // TH和TD不能相互合并 + + // 当且仅当两个Cell的开始列号和结束列号一致时能进行合并 + return (rightCellInfo.rowIndex == cellInfo.rowIndex && rightCellInfo.rowSpan == cellInfo.rowSpan) ? 0 : -1; + }, + execCommand: function (cmd) { + var rng = this.selection.getRange(), + bk = rng.createBookmark(true); + var cell = getTableItemsByRange(this).cell, + ut = getUETable(cell); + ut.mergeRight(cell); + rng.moveToBookmark(bk).select(); + } + }; + UE.commands["mergedown"] = { + queryCommandState: function (cmd) { + var tableItems = getTableItemsByRange(this), + table = tableItems.table, + cell = tableItems.cell; + + if (!table || !cell) return -1; + var ut = getUETable(table); + if (ut.selectedTds.length)return -1; + + var cellInfo = ut.getCellInfo(cell), + downRowIndex = cellInfo.rowIndex + cellInfo.rowSpan; + if (downRowIndex >= ut.rowsNum) return -1; // 如果处于最下边则不能向下合并 + + var downCellInfo = ut.indexTable[downRowIndex][cellInfo.colIndex], + downCell = table.rows[downCellInfo.rowIndex].cells[downCellInfo.cellIndex]; + if (!downCell || cell.tagName != downCell.tagName) return -1; // TH和TD不能相互合并 + + // 当且仅当两个Cell的开始列号和结束列号一致时能进行合并 + return (downCellInfo.colIndex == cellInfo.colIndex && downCellInfo.colSpan == cellInfo.colSpan) ? 0 : -1; + }, + execCommand: function () { + var rng = this.selection.getRange(), + bk = rng.createBookmark(true); + var cell = getTableItemsByRange(this).cell, + ut = getUETable(cell); + ut.mergeDown(cell); + rng.moveToBookmark(bk).select(); + } + }; + UE.commands["mergecells"] = { + queryCommandState: function () { + return getUETableBySelected(this) ? 0 : -1; + }, + execCommand: function () { + var ut = getUETableBySelected(this); + if (ut && ut.selectedTds.length) { + var cell = ut.selectedTds[0]; + ut.mergeRange(); + var rng = this.selection.getRange(); + if (domUtils.isEmptyBlock(cell)) { + rng.setStart(cell, 0).collapse(true) + } else { + rng.selectNodeContents(cell) + } + rng.select(); + } + + + } + }; + UE.commands["insertrow"] = { + queryCommandState: function () { + var tableItems = getTableItemsByRange(this), + cell = tableItems.cell; + return cell && (cell.tagName == "TD" || (cell.tagName == 'TH' && tableItems.tr !== tableItems.table.rows[0])) && + getUETable(tableItems.table).rowsNum < this.options.maxRowNum ? 0 : -1; + }, + execCommand: function () { + var rng = this.selection.getRange(), + bk = rng.createBookmark(true); + var tableItems = getTableItemsByRange(this), + cell = tableItems.cell, + table = tableItems.table, + ut = getUETable(table), + cellInfo = ut.getCellInfo(cell); + //ut.insertRow(!ut.selectedTds.length ? cellInfo.rowIndex:ut.cellsRange.beginRowIndex,''); + if (!ut.selectedTds.length) { + ut.insertRow(cellInfo.rowIndex, cell); + } else { + var range = ut.cellsRange; + for (var i = 0, len = range.endRowIndex - range.beginRowIndex + 1; i < len; i++) { + ut.insertRow(range.beginRowIndex, cell); + } + } + rng.moveToBookmark(bk).select(); + if (table.getAttribute("interlaced") === "enabled")this.fireEvent("interlacetable", table); + } + }; + //后插入行 + UE.commands["insertrownext"] = { + queryCommandState: function () { + var tableItems = getTableItemsByRange(this), + cell = tableItems.cell; + return cell && (cell.tagName == "TD") && getUETable(tableItems.table).rowsNum < this.options.maxRowNum ? 0 : -1; + }, + execCommand: function () { + var rng = this.selection.getRange(), + bk = rng.createBookmark(true); + var tableItems = getTableItemsByRange(this), + cell = tableItems.cell, + table = tableItems.table, + ut = getUETable(table), + cellInfo = ut.getCellInfo(cell); + //ut.insertRow(!ut.selectedTds.length? cellInfo.rowIndex + cellInfo.rowSpan : ut.cellsRange.endRowIndex + 1,''); + if (!ut.selectedTds.length) { + ut.insertRow(cellInfo.rowIndex + cellInfo.rowSpan, cell); + } else { + var range = ut.cellsRange; + for (var i = 0, len = range.endRowIndex - range.beginRowIndex + 1; i < len; i++) { + ut.insertRow(range.endRowIndex + 1, cell); + } + } + rng.moveToBookmark(bk).select(); + if (table.getAttribute("interlaced") === "enabled")this.fireEvent("interlacetable", table); + } + }; + UE.commands["deleterow"] = { + queryCommandState: function () { + var tableItems = getTableItemsByRange(this); + return tableItems.cell ? 0 : -1; + }, + execCommand: function () { + var cell = getTableItemsByRange(this).cell, + ut = getUETable(cell), + cellsRange = ut.cellsRange, + cellInfo = ut.getCellInfo(cell), + preCell = ut.getVSideCell(cell), + nextCell = ut.getVSideCell(cell, true), + rng = this.selection.getRange(); + if (utils.isEmptyObject(cellsRange)) { + ut.deleteRow(cellInfo.rowIndex); + } else { + for (var i = cellsRange.beginRowIndex; i < cellsRange.endRowIndex + 1; i++) { + ut.deleteRow(cellsRange.beginRowIndex); + } + } + var table = ut.table; + if (!table.getElementsByTagName('td').length) { + var nextSibling = table.nextSibling; + domUtils.remove(table); + if (nextSibling) { + rng.setStart(nextSibling, 0).setCursor(false, true); + } + } else { + if (cellInfo.rowSpan == 1 || cellInfo.rowSpan == cellsRange.endRowIndex - cellsRange.beginRowIndex + 1) { + if (nextCell || preCell) rng.selectNodeContents(nextCell || preCell).setCursor(false, true); + } else { + var newCell = ut.getCell(cellInfo.rowIndex, ut.indexTable[cellInfo.rowIndex][cellInfo.colIndex].cellIndex); + if (newCell) rng.selectNodeContents(newCell).setCursor(false, true); + } + } + if (table.getAttribute("interlaced") === "enabled")this.fireEvent("interlacetable", table); + } + }; + UE.commands["insertcol"] = { + queryCommandState: function (cmd) { + var tableItems = getTableItemsByRange(this), + cell = tableItems.cell; + return cell && (cell.tagName == "TD" || (cell.tagName == 'TH' && cell !== tableItems.tr.cells[0])) && + getUETable(tableItems.table).colsNum < this.options.maxColNum ? 0 : -1; + }, + execCommand: function (cmd) { + var rng = this.selection.getRange(), + bk = rng.createBookmark(true); + if (this.queryCommandState(cmd) == -1)return; + var cell = getTableItemsByRange(this).cell, + ut = getUETable(cell), + cellInfo = ut.getCellInfo(cell); + + //ut.insertCol(!ut.selectedTds.length ? cellInfo.colIndex:ut.cellsRange.beginColIndex); + if (!ut.selectedTds.length) { + ut.insertCol(cellInfo.colIndex, cell); + } else { + var range = ut.cellsRange; + for (var i = 0, len = range.endColIndex - range.beginColIndex + 1; i < len; i++) { + ut.insertCol(range.beginColIndex, cell); + } + } + rng.moveToBookmark(bk).select(true); + } + }; + UE.commands["insertcolnext"] = { + queryCommandState: function () { + var tableItems = getTableItemsByRange(this), + cell = tableItems.cell; + return cell && getUETable(tableItems.table).colsNum < this.options.maxColNum ? 0 : -1; + }, + execCommand: function () { + var rng = this.selection.getRange(), + bk = rng.createBookmark(true); + var cell = getTableItemsByRange(this).cell, + ut = getUETable(cell), + cellInfo = ut.getCellInfo(cell); + //ut.insertCol(!ut.selectedTds.length ? cellInfo.colIndex + cellInfo.colSpan:ut.cellsRange.endColIndex +1); + if (!ut.selectedTds.length) { + ut.insertCol(cellInfo.colIndex + cellInfo.colSpan, cell); + } else { + var range = ut.cellsRange; + for (var i = 0, len = range.endColIndex - range.beginColIndex + 1; i < len; i++) { + ut.insertCol(range.endColIndex + 1, cell); + } + } + rng.moveToBookmark(bk).select(); + } + }; + + UE.commands["deletecol"] = { + queryCommandState: function () { + var tableItems = getTableItemsByRange(this); + return tableItems.cell ? 0 : -1; + }, + execCommand: function () { + var cell = getTableItemsByRange(this).cell, + ut = getUETable(cell), + range = ut.cellsRange, + cellInfo = ut.getCellInfo(cell), + preCell = ut.getHSideCell(cell), + nextCell = ut.getHSideCell(cell, true); + if (utils.isEmptyObject(range)) { + ut.deleteCol(cellInfo.colIndex); + } else { + for (var i = range.beginColIndex; i < range.endColIndex + 1; i++) { + ut.deleteCol(range.beginColIndex); + } + } + var table = ut.table, + rng = this.selection.getRange(); + + if (!table.getElementsByTagName('td').length) { + var nextSibling = table.nextSibling; + domUtils.remove(table); + if (nextSibling) { + rng.setStart(nextSibling, 0).setCursor(false, true); + } + } else { + if (domUtils.inDoc(cell, this.document)) { + rng.setStart(cell, 0).setCursor(false, true); + } else { + if (nextCell && domUtils.inDoc(nextCell, this.document)) { + rng.selectNodeContents(nextCell).setCursor(false, true); + } else { + if (preCell && domUtils.inDoc(preCell, this.document)) { + rng.selectNodeContents(preCell).setCursor(true, true); + } + } + } + } + } + }; + UE.commands["splittocells"] = { + queryCommandState: function () { + var tableItems = getTableItemsByRange(this), + cell = tableItems.cell; + if (!cell) return -1; + var ut = getUETable(tableItems.table); + if (ut.selectedTds.length > 0) return -1; + return cell && (cell.colSpan > 1 || cell.rowSpan > 1) ? 0 : -1; + }, + execCommand: function () { + var rng = this.selection.getRange(), + bk = rng.createBookmark(true); + var cell = getTableItemsByRange(this).cell, + ut = getUETable(cell); + ut.splitToCells(cell); + rng.moveToBookmark(bk).select(); + } + }; + UE.commands["splittorows"] = { + queryCommandState: function () { + var tableItems = getTableItemsByRange(this), + cell = tableItems.cell; + if (!cell) return -1; + var ut = getUETable(tableItems.table); + if (ut.selectedTds.length > 0) return -1; + return cell && cell.rowSpan > 1 ? 0 : -1; + }, + execCommand: function () { + var rng = this.selection.getRange(), + bk = rng.createBookmark(true); + var cell = getTableItemsByRange(this).cell, + ut = getUETable(cell); + ut.splitToRows(cell); + rng.moveToBookmark(bk).select(); + } + }; + UE.commands["splittocols"] = { + queryCommandState: function () { + var tableItems = getTableItemsByRange(this), + cell = tableItems.cell; + if (!cell) return -1; + var ut = getUETable(tableItems.table); + if (ut.selectedTds.length > 0) return -1; + return cell && cell.colSpan > 1 ? 0 : -1; + }, + execCommand: function () { + var rng = this.selection.getRange(), + bk = rng.createBookmark(true); + var cell = getTableItemsByRange(this).cell, + ut = getUETable(cell); + ut.splitToCols(cell); + rng.moveToBookmark(bk).select(); + + } + }; + + UE.commands["adaptbytext"] = + UE.commands["adaptbywindow"] = { + queryCommandState: function () { + return getTableItemsByRange(this).table ? 0 : -1 + }, + execCommand: function (cmd) { + var tableItems = getTableItemsByRange(this), + table = tableItems.table; + if (table) { + if (cmd == 'adaptbywindow') { + resetTdWidth(table, this); + } else { + var cells = domUtils.getElementsByTagName(table, "td th"); + utils.each(cells, function (cell) { + cell.removeAttribute("width"); + }); + table.removeAttribute("width"); + } + } + } + }; + + //平均分配各列 + UE.commands['averagedistributecol'] = { + queryCommandState: function () { + var ut = getUETableBySelected(this); + if (!ut) return -1; + return ut.isFullRow() || ut.isFullCol() ? 0 : -1; + }, + execCommand: function (cmd) { + var me = this, + ut = getUETableBySelected(me); + + function getAverageWidth() { + var tb = ut.table, + averageWidth, sumWidth = 0, colsNum = 0, + tbAttr = getDefaultValue(me, tb); + + if (ut.isFullRow()) { + sumWidth = tb.offsetWidth; + colsNum = ut.colsNum; + } else { + var begin = ut.cellsRange.beginColIndex, + end = ut.cellsRange.endColIndex, + node; + for (var i = begin; i <= end;) { + node = ut.selectedTds[i]; + sumWidth += node.offsetWidth; + i += node.colSpan; + colsNum += 1; + } + } + averageWidth = Math.ceil(sumWidth / colsNum) - tbAttr.tdBorder * 2 - tbAttr.tdPadding * 2; + return averageWidth; + } + + function setAverageWidth(averageWidth) { + utils.each(domUtils.getElementsByTagName(ut.table, "th"), function (node) { + node.setAttribute("width", ""); + }); + var cells = ut.isFullRow() ? domUtils.getElementsByTagName(ut.table, "td") : ut.selectedTds; + + utils.each(cells, function (node) { + if (node.colSpan == 1) { + node.setAttribute("width", averageWidth); + } + }); + } + + if (ut && ut.selectedTds.length) { + setAverageWidth(getAverageWidth()); + } + } + }; + //平均分配各行 + UE.commands['averagedistributerow'] = { + queryCommandState: function () { + var ut = getUETableBySelected(this); + if (!ut) return -1; + if (ut.selectedTds && /th/ig.test(ut.selectedTds[0].tagName)) return -1; + return ut.isFullRow() || ut.isFullCol() ? 0 : -1; + }, + execCommand: function (cmd) { + var me = this, + ut = getUETableBySelected(me); + + function getAverageHeight() { + var averageHeight, rowNum, sumHeight = 0, + tb = ut.table, + tbAttr = getDefaultValue(me, tb), + tdpadding = parseInt(domUtils.getComputedStyle(tb.getElementsByTagName('td')[0], "padding-top")); + + if (ut.isFullCol()) { + var captionArr = domUtils.getElementsByTagName(tb, "caption"), + thArr = domUtils.getElementsByTagName(tb, "th"), + captionHeight, thHeight; + + if (captionArr.length > 0) { + captionHeight = captionArr[0].offsetHeight; + } + if (thArr.length > 0) { + thHeight = thArr[0].offsetHeight; + } + + sumHeight = tb.offsetHeight - (captionHeight || 0) - (thHeight || 0); + rowNum = thArr.length == 0 ? ut.rowsNum : (ut.rowsNum - 1); + } else { + var begin = ut.cellsRange.beginRowIndex, + end = ut.cellsRange.endRowIndex, + count = 0, + trs = domUtils.getElementsByTagName(tb, "tr"); + for (var i = begin; i <= end; i++) { + sumHeight += trs[i].offsetHeight; + count += 1; + } + rowNum = count; + } + //ie8下是混杂模式 + if (browser.ie && browser.version < 9) { + averageHeight = Math.ceil(sumHeight / rowNum); + } else { + averageHeight = Math.ceil(sumHeight / rowNum) - tbAttr.tdBorder * 2 - tdpadding * 2; + } + return averageHeight; + } + + function setAverageHeight(averageHeight) { + var cells = ut.isFullCol() ? domUtils.getElementsByTagName(ut.table, "td") : ut.selectedTds; + utils.each(cells, function (node) { + if (node.rowSpan == 1) { + node.setAttribute("height", averageHeight); + } + }); + } + + if (ut && ut.selectedTds.length) { + setAverageHeight(getAverageHeight()); + } + } + }; + + //单元格对齐方式 + UE.commands['cellalignment'] = { + queryCommandState: function () { + return getTableItemsByRange(this).table ? 0 : -1 + }, + execCommand: function (cmd, data) { + var me = this, + ut = getUETableBySelected(me); + + if (!ut) { + var start = me.selection.getStart(), + cell = start && domUtils.findParentByTagName(start, ["td", "th", "caption"], true); + if (!/caption/ig.test(cell.tagName)) { + domUtils.setAttributes(cell, data); + } else { + cell.style.textAlign = data.align; + cell.style.verticalAlign = data.vAlign; + } + me.selection.getRange().setCursor(true); + } else { + utils.each(ut.selectedTds, function (cell) { + domUtils.setAttributes(cell, data); + }); + } + }, + /** + * 查询当前点击的单元格的对齐状态, 如果当前已经选择了多个单元格, 则会返回所有单元格经过统一协调过后的状态 + * @see UE.UETable.getTableCellAlignState + */ + queryCommandValue: function (cmd) { + + var activeMenuCell = getTableItemsByRange( this).cell; + + if( !activeMenuCell ) { + activeMenuCell = getSelectedArr(this)[0]; + } + + if (!activeMenuCell) { + + return null; + + } else { + + //获取同时选中的其他单元格 + var cells = UE.UETable.getUETable(activeMenuCell).selectedTds; + + !cells.length && ( cells = activeMenuCell ); + + return UE.UETable.getTableCellAlignState(cells); + + } + + } + }; + //表格对齐方式 + UE.commands['tablealignment'] = { + queryCommandState: function () { + if (browser.ie && browser.version < 8) { + return -1; + } + return getTableItemsByRange(this).table ? 0 : -1 + }, + execCommand: function (cmd, value) { + var me = this, + start = me.selection.getStart(), + table = start && domUtils.findParentByTagName(start, ["table"], true); + + if (table) { + table.setAttribute("align",value); + } + } + }; + + //表格属性 + UE.commands['edittable'] = { + queryCommandState: function () { + return getTableItemsByRange(this).table ? 0 : -1 + }, + execCommand: function (cmd, color) { + var rng = this.selection.getRange(), + table = domUtils.findParentByTagName(rng.startContainer, 'table'); + if (table) { + var arr = domUtils.getElementsByTagName(table, "td").concat( + domUtils.getElementsByTagName(table, "th"), + domUtils.getElementsByTagName(table, "caption") + ); + utils.each(arr, function (node) { + node.style.borderColor = color; + }); + } + } + }; + //单元格属性 + UE.commands['edittd'] = { + queryCommandState: function () { + return getTableItemsByRange(this).table ? 0 : -1 + }, + execCommand: function (cmd, bkColor) { + var me = this, + ut = getUETableBySelected(me); + + if (!ut) { + var start = me.selection.getStart(), + cell = start && domUtils.findParentByTagName(start, ["td", "th", "caption"], true); + if (cell) { + cell.style.backgroundColor = bkColor; + } + } else { + utils.each(ut.selectedTds, function (cell) { + cell.style.backgroundColor = bkColor; + }); + } + } + }; + + UE.commands["settablebackground"] = { + queryCommandState: function () { + return getSelectedArr(this).length > 1 ? 0 : -1; + }, + execCommand: function (cmd, value) { + var cells, ut; + cells = getSelectedArr(this); + ut = getUETable(cells[0]); + ut.setBackground(cells, value); + } + }; + + UE.commands["cleartablebackground"] = { + queryCommandState: function () { + var cells = getSelectedArr(this); + if (!cells.length)return -1; + for (var i = 0, cell; cell = cells[i++];) { + if (cell.style.backgroundColor !== "") return 0; + } + return -1; + }, + execCommand: function () { + var cells = getSelectedArr(this), + ut = getUETable(cells[0]); + ut.removeBackground(cells); + } + }; + + UE.commands["interlacetable"] = UE.commands["uninterlacetable"] = { + queryCommandState: function (cmd) { + var table = getTableItemsByRange(this).table; + if (!table) return -1; + var interlaced = table.getAttribute("interlaced"); + if (cmd == "interlacetable") { + //TODO 待定 + //是否需要待定,如果设置,则命令只能单次执行成功,但反射具备toggle效果;否则可以覆盖前次命令,但反射将不存在toggle效果 + return (interlaced === "enabled") ? -1 : 0; + } else { + return (!interlaced || interlaced === "disabled") ? -1 : 0; + } + }, + execCommand: function (cmd, classList) { + var table = getTableItemsByRange(this).table; + if (cmd == "interlacetable") { + table.setAttribute("interlaced", "enabled"); + this.fireEvent("interlacetable", table, classList); + } else { + table.setAttribute("interlaced", "disabled"); + this.fireEvent("uninterlacetable", table); + } + } + }; + UE.commands["setbordervisible"] = { + queryCommandState: function (cmd) { + var table = getTableItemsByRange(this).table; + if (!table) return -1; + return 0; + }, + execCommand: function () { + var table = getTableItemsByRange(this).table; + utils.each(domUtils.getElementsByTagName(table,'td'),function(td){ + td.style.borderWidth = '1px'; + td.style.borderStyle = 'solid'; + }) + } + }; + function resetTdWidth(table, editor) { + var tds = domUtils.getElementsByTagName(table,'td th'); + utils.each(tds, function (td) { + td.removeAttribute("width"); + }); + table.setAttribute('width', getTableWidth(editor, true, getDefaultValue(editor, table))); + var tdsWidths = []; + setTimeout(function () { + utils.each(tds, function (td) { + (td.colSpan == 1) && tdsWidths.push(td.offsetWidth) + }) + utils.each(tds, function (td,i) { + (td.colSpan == 1) && td.setAttribute("width", tdsWidths[i] + ""); + }) + }, 0); + } + + function getTableWidth(editor, needIEHack, defaultValue) { + var body = editor.body; + return body.offsetWidth - (needIEHack ? parseInt(domUtils.getComputedStyle(body, 'margin-left'), 10) * 2 : 0) - defaultValue.tableBorder * 2 - (editor.options.offsetWidth || 0); + } + + function getSelectedArr(editor) { + var cell = getTableItemsByRange(editor).cell; + if (cell) { + var ut = getUETable(cell); + return ut.selectedTds.length ? ut.selectedTds : [cell]; + } else { + return []; + } + } +})(); + + +// plugins/table.action.js +/** + * Created with JetBrains PhpStorm. + * User: taoqili + * Date: 12-10-12 + * Time: 上午10:05 + * To change this template use File | Settings | File Templates. + */ +UE.plugins['table'] = function () { + var me = this, + tabTimer = null, + //拖动计时器 + tableDragTimer = null, + //双击计时器 + tableResizeTimer = null, + //单元格最小宽度 + cellMinWidth = 5, + isInResizeBuffer = false, + //单元格边框大小 + cellBorderWidth = 5, + //鼠标偏移距离 + offsetOfTableCell = 10, + //记录在有限时间内的点击状态, 共有3个取值, 0, 1, 2。 0代表未初始化, 1代表单击了1次,2代表2次 + singleClickState = 0, + userActionStatus = null, + //双击允许的时间范围 + dblclickTime = 360, + UT = UE.UETable, + getUETable = function (tdOrTable) { + return UT.getUETable(tdOrTable); + }, + getUETableBySelected = function (editor) { + return UT.getUETableBySelected(editor); + }, + getDefaultValue = function (editor, table) { + return UT.getDefaultValue(editor, table); + }, + removeSelectedClass = function (cells) { + return UT.removeSelectedClass(cells); + }; + + function showError(e) { +// throw e; + } + me.ready(function(){ + var me = this; + var orgGetText = me.selection.getText; + me.selection.getText = function(){ + var table = getUETableBySelected(me); + if(table){ + var str = ''; + utils.each(table.selectedTds,function(td){ + str += td[browser.ie?'innerText':'textContent']; + }) + return str; + }else{ + return orgGetText.call(me.selection) + } + + } + }) + + //处理拖动及框选相关方法 + var startTd = null, //鼠标按下时的锚点td + currentTd = null, //当前鼠标经过时的td + onDrag = "", //指示当前拖动状态,其值可为"","h","v" ,分别表示未拖动状态,横向拖动状态,纵向拖动状态,用于鼠标移动过程中的判断 + onBorder = false, //检测鼠标按下时是否处在单元格边缘位置 + dragButton = null, + dragOver = false, + dragLine = null, //模拟的拖动线 + dragTd = null; //发生拖动的目标td + + var mousedown = false, + //todo 判断混乱模式 + needIEHack = true; + + me.setOpt({ + 'maxColNum':20, + 'maxRowNum':100, + 'defaultCols':5, + 'defaultRows':5, + 'tdvalign':'top', + 'cursorpath':me.options.UEDITOR_HOME_URL + "themes/default/images/cursor_", + 'tableDragable':false, + 'classList':["ue-table-interlace-color-single","ue-table-interlace-color-double"] + }); + me.getUETable = getUETable; + var commands = { + 'deletetable':1, + 'inserttable':1, + 'cellvalign':1, + 'insertcaption':1, + 'deletecaption':1, + 'inserttitle':1, + 'deletetitle':1, + "mergeright":1, + "mergedown":1, + "mergecells":1, + "insertrow":1, + "insertrownext":1, + "deleterow":1, + "insertcol":1, + "insertcolnext":1, + "deletecol":1, + "splittocells":1, + "splittorows":1, + "splittocols":1, + "adaptbytext":1, + "adaptbywindow":1, + "adaptbycustomer":1, + "insertparagraph":1, + "insertparagraphbeforetable":1, + "averagedistributecol":1, + "averagedistributerow":1 + }; + me.ready(function () { + utils.cssRule('table', + //选中的td上的样式 + '.selectTdClass{background-color:#edf5fa !important}' + + 'table.noBorderTable td,table.noBorderTable th,table.noBorderTable caption{border:1px dashed #ddd !important}' + + //插入的表格的默认样式 + 'table{margin-bottom:10px;border-collapse:collapse;display:table;}' + + 'td,th{padding: 5px 10px;border: 1px solid #DDD;}' + + 'caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}' + + 'th{border-top:1px solid #BBB;background-color:#F7F7F7;}' + + 'table tr.firstRow th{border-top-width:2px;}' + + '.ue-table-interlace-color-single{ background-color: #fcfcfc; } .ue-table-interlace-color-double{ background-color: #f7faff; }' + + 'td p{margin:0;padding:0;}', me.document); + + var tableCopyList, isFullCol, isFullRow; + //注册del/backspace事件 + me.addListener('keydown', function (cmd, evt) { + var me = this; + var keyCode = evt.keyCode || evt.which; + + if (keyCode == 8) { + + var ut = getUETableBySelected(me); + if (ut && ut.selectedTds.length) { + + if (ut.isFullCol()) { + me.execCommand('deletecol') + } else if (ut.isFullRow()) { + me.execCommand('deleterow') + } else { + me.fireEvent('delcells'); + } + domUtils.preventDefault(evt); + } + + var caption = domUtils.findParentByTagName(me.selection.getStart(), 'caption', true), + range = me.selection.getRange(); + if (range.collapsed && caption && isEmptyBlock(caption)) { + me.fireEvent('saveScene'); + var table = caption.parentNode; + domUtils.remove(caption); + if (table) { + range.setStart(table.rows[0].cells[0], 0).setCursor(false, true); + } + me.fireEvent('saveScene'); + } + + } + + if (keyCode == 46) { + + ut = getUETableBySelected(me); + if (ut) { + me.fireEvent('saveScene'); + for (var i = 0, ci; ci = ut.selectedTds[i++];) { + domUtils.fillNode(me.document, ci) + } + me.fireEvent('saveScene'); + domUtils.preventDefault(evt); + + } + + } + if (keyCode == 13) { + + var rng = me.selection.getRange(), + caption = domUtils.findParentByTagName(rng.startContainer, 'caption', true); + if (caption) { + var table = domUtils.findParentByTagName(caption, 'table'); + if (!rng.collapsed) { + + rng.deleteContents(); + me.fireEvent('saveScene'); + } else { + if (caption) { + rng.setStart(table.rows[0].cells[0], 0).setCursor(false, true); + } + } + domUtils.preventDefault(evt); + return; + } + if (rng.collapsed) { + var table = domUtils.findParentByTagName(rng.startContainer, 'table'); + if (table) { + var cell = table.rows[0].cells[0], + start = domUtils.findParentByTagName(me.selection.getStart(), ['td', 'th'], true), + preNode = table.previousSibling; + if (cell === start && (!preNode || preNode.nodeType == 1 && preNode.tagName == 'TABLE' ) && domUtils.isStartInblock(rng)) { + var first = domUtils.findParent(me.selection.getStart(), function(n){return domUtils.isBlockElm(n)}, true); + if(first && ( /t(h|d)/i.test(first.tagName) || first === start.firstChild )){ + me.execCommand('insertparagraphbeforetable'); + domUtils.preventDefault(evt); + } + + } + } + } + } + + if ((evt.ctrlKey || evt.metaKey) && evt.keyCode == '67') { + tableCopyList = null; + var ut = getUETableBySelected(me); + if (ut) { + var tds = ut.selectedTds; + isFullCol = ut.isFullCol(); + isFullRow = ut.isFullRow(); + tableCopyList = [ + [ut.cloneCell(tds[0],null,true)] + ]; + for (var i = 1, ci; ci = tds[i]; i++) { + if (ci.parentNode !== tds[i - 1].parentNode) { + tableCopyList.push([ut.cloneCell(ci,null,true)]); + } else { + tableCopyList[tableCopyList.length - 1].push(ut.cloneCell(ci,null,true)); + } + + } + } + } + }); + me.addListener("tablehasdeleted",function(){ + toggleDraggableState(this, false, "", null); + if (dragButton)domUtils.remove(dragButton); + }); + + me.addListener('beforepaste', function (cmd, html) { + var me = this; + var rng = me.selection.getRange(); + if (domUtils.findParentByTagName(rng.startContainer, 'caption', true)) { + var div = me.document.createElement("div"); + div.innerHTML = html.html; + //trace:3729 + html.html = div[browser.ie9below ? 'innerText' : 'textContent']; + return; + } + var table = getUETableBySelected(me); + if (tableCopyList) { + me.fireEvent('saveScene'); + var rng = me.selection.getRange(); + var td = domUtils.findParentByTagName(rng.startContainer, ['td', 'th'], true), tmpNode, preNode; + if (td) { + var ut = getUETable(td); + if (isFullRow) { + var rowIndex = ut.getCellInfo(td).rowIndex; + if (td.tagName == 'TH') { + rowIndex++; + } + for (var i = 0, ci; ci = tableCopyList[i++];) { + var tr = ut.insertRow(rowIndex++, "td"); + for (var j = 0, cj; cj = ci[j]; j++) { + var cell = tr.cells[j]; + if (!cell) { + cell = tr.insertCell(j) + } + cell.innerHTML = cj.innerHTML; + cj.getAttribute('width') && cell.setAttribute('width', cj.getAttribute('width')); + cj.getAttribute('vAlign') && cell.setAttribute('vAlign', cj.getAttribute('vAlign')); + cj.getAttribute('align') && cell.setAttribute('align', cj.getAttribute('align')); + cj.style.cssText && (cell.style.cssText = cj.style.cssText) + } + for (var j = 0, cj; cj = tr.cells[j]; j++) { + if (!ci[j]) + break; + cj.innerHTML = ci[j].innerHTML; + ci[j].getAttribute('width') && cj.setAttribute('width', ci[j].getAttribute('width')); + ci[j].getAttribute('vAlign') && cj.setAttribute('vAlign', ci[j].getAttribute('vAlign')); + ci[j].getAttribute('align') && cj.setAttribute('align', ci[j].getAttribute('align')); + ci[j].style.cssText && (cj.style.cssText = ci[j].style.cssText) + } + } + } else { + if (isFullCol) { + cellInfo = ut.getCellInfo(td); + var maxColNum = 0; + for (var j = 0, ci = tableCopyList[0], cj; cj = ci[j++];) { + maxColNum += cj.colSpan || 1; + } + me.__hasEnterExecCommand = true; + for (i = 0; i < maxColNum; i++) { + me.execCommand('insertcol'); + } + me.__hasEnterExecCommand = false; + td = ut.table.rows[0].cells[cellInfo.cellIndex]; + if (td.tagName == 'TH') { + td = ut.table.rows[1].cells[cellInfo.cellIndex]; + } + } + for (var i = 0, ci; ci = tableCopyList[i++];) { + tmpNode = td; + for (var j = 0, cj; cj = ci[j++];) { + if (td) { + td.innerHTML = cj.innerHTML; + //todo 定制处理 + cj.getAttribute('width') && td.setAttribute('width', cj.getAttribute('width')); + cj.getAttribute('vAlign') && td.setAttribute('vAlign', cj.getAttribute('vAlign')); + cj.getAttribute('align') && td.setAttribute('align', cj.getAttribute('align')); + cj.style.cssText && (td.style.cssText = cj.style.cssText); + preNode = td; + td = td.nextSibling; + } else { + var cloneTd = cj.cloneNode(true); + domUtils.removeAttributes(cloneTd, ['class', 'rowSpan', 'colSpan']); + + preNode.parentNode.appendChild(cloneTd) + } + } + td = ut.getNextCell(tmpNode, true, true); + if (!tableCopyList[i]) + break; + if (!td) { + var cellInfo = ut.getCellInfo(tmpNode); + ut.table.insertRow(ut.table.rows.length); + ut.update(); + td = ut.getVSideCell(tmpNode, true); + } + } + } + ut.update(); + } else { + table = me.document.createElement('table'); + for (var i = 0, ci; ci = tableCopyList[i++];) { + var tr = table.insertRow(table.rows.length); + for (var j = 0, cj; cj = ci[j++];) { + cloneTd = UT.cloneCell(cj,null,true); + domUtils.removeAttributes(cloneTd, ['class']); + tr.appendChild(cloneTd) + } + if (j == 2 && cloneTd.rowSpan > 1) { + cloneTd.rowSpan = 1; + } + } + + var defaultValue = getDefaultValue(me), + width = me.body.offsetWidth - + (needIEHack ? parseInt(domUtils.getComputedStyle(me.body, 'margin-left'), 10) * 2 : 0) - defaultValue.tableBorder * 2 - (me.options.offsetWidth || 0); + me.execCommand('insertHTML', '' + table.innerHTML.replace(/>\s*<').replace(/\bth\b/gi, "td") + '
    ') + } + me.fireEvent('contentchange'); + me.fireEvent('saveScene'); + html.html = ''; + return true; + } else { + var div = me.document.createElement("div"), tables; + div.innerHTML = html.html; + tables = div.getElementsByTagName("table"); + if (domUtils.findParentByTagName(me.selection.getStart(), 'table')) { + utils.each(tables, function (t) { + domUtils.remove(t) + }); + if (domUtils.findParentByTagName(me.selection.getStart(), 'caption', true)) { + div.innerHTML = div[browser.ie ? 'innerText' : 'textContent']; + } + } else { + utils.each(tables, function (table) { + removeStyleSize(table, true); + domUtils.removeAttributes(table, ['style', 'border']); + utils.each(domUtils.getElementsByTagName(table, "td"), function (td) { + if (isEmptyBlock(td)) { + domUtils.fillNode(me.document, td); + } + removeStyleSize(td, true); +// domUtils.removeAttributes(td, ['style']) + }); + }); + } + html.html = div.innerHTML; + } + }); + + me.addListener('afterpaste', function () { + utils.each(domUtils.getElementsByTagName(me.body, "table"), function (table) { + if (table.offsetWidth > me.body.offsetWidth) { + var defaultValue = getDefaultValue(me, table); + table.style.width = me.body.offsetWidth - (needIEHack ? parseInt(domUtils.getComputedStyle(me.body, 'margin-left'), 10) * 2 : 0) - defaultValue.tableBorder * 2 - (me.options.offsetWidth || 0) + 'px' + } + }) + }); + me.addListener('blur', function () { + tableCopyList = null; + }); + var timer; + me.addListener('keydown', function () { + clearTimeout(timer); + timer = setTimeout(function () { + var rng = me.selection.getRange(), + cell = domUtils.findParentByTagName(rng.startContainer, ['th', 'td'], true); + if (cell) { + var table = cell.parentNode.parentNode.parentNode; + if (table.offsetWidth > table.getAttribute("width")) { + cell.style.wordBreak = "break-all"; + } + } + + }, 100); + }); + me.addListener("selectionchange", function () { + toggleDraggableState(me, false, "", null); + }); + + + //内容变化时触发索引更新 + //todo 可否考虑标记检测,如果不涉及表格的变化就不进行索引重建和更新 + me.addListener("contentchange", function () { + var me = this; + //尽可能排除一些不需要更新的状况 + hideDragLine(me); + if (getUETableBySelected(me))return; + var rng = me.selection.getRange(); + var start = rng.startContainer; + start = domUtils.findParentByTagName(start, ['td', 'th'], true); + utils.each(domUtils.getElementsByTagName(me.document, 'table'), function (table) { + if (me.fireEvent("excludetable", table) === true) return; + table.ueTable = new UT(table); + //trace:3742 +// utils.each(domUtils.getElementsByTagName(me.document, 'td'), function (td) { +// +// if (domUtils.isEmptyBlock(td) && td !== start) { +// domUtils.fillNode(me.document, td); +// if (browser.ie && browser.version == 6) { +// td.innerHTML = ' ' +// } +// } +// }); +// utils.each(domUtils.getElementsByTagName(me.document, 'th'), function (th) { +// if (domUtils.isEmptyBlock(th) && th !== start) { +// domUtils.fillNode(me.document, th); +// if (browser.ie && browser.version == 6) { +// th.innerHTML = ' ' +// } +// } +// }); + table.onmouseover = function () { + me.fireEvent('tablemouseover', table); + }; + table.onmousemove = function () { + me.fireEvent('tablemousemove', table); + me.options.tableDragable && toggleDragButton(true, this, me); + utils.defer(function(){ + me.fireEvent('contentchange',50) + },true) + }; + table.onmouseout = function () { + me.fireEvent('tablemouseout', table); + toggleDraggableState(me, false, "", null); + hideDragLine(me); + }; + table.onclick = function (evt) { + evt = me.window.event || evt; + var target = getParentTdOrTh(evt.target || evt.srcElement); + if (!target)return; + var ut = getUETable(target), + table = ut.table, + cellInfo = ut.getCellInfo(target), + cellsRange, + rng = me.selection.getRange(); +// if ("topLeft" == inPosition(table, mouseCoords(evt))) { +// cellsRange = ut.getCellsRange(ut.table.rows[0].cells[0], ut.getLastCell()); +// ut.setSelected(cellsRange); +// return; +// } +// if ("bottomRight" == inPosition(table, mouseCoords(evt))) { +// +// return; +// } + if (inTableSide(table, target, evt, true)) { + var endTdCol = ut.getCell(ut.indexTable[ut.rowsNum - 1][cellInfo.colIndex].rowIndex, ut.indexTable[ut.rowsNum - 1][cellInfo.colIndex].cellIndex); + if (evt.shiftKey && ut.selectedTds.length) { + if (ut.selectedTds[0] !== endTdCol) { + cellsRange = ut.getCellsRange(ut.selectedTds[0], endTdCol); + ut.setSelected(cellsRange); + } else { + rng && rng.selectNodeContents(endTdCol).select(); + } + } else { + if (target !== endTdCol) { + cellsRange = ut.getCellsRange(target, endTdCol); + ut.setSelected(cellsRange); + } else { + rng && rng.selectNodeContents(endTdCol).select(); + } + } + return; + } + if (inTableSide(table, target, evt)) { + var endTdRow = ut.getCell(ut.indexTable[cellInfo.rowIndex][ut.colsNum - 1].rowIndex, ut.indexTable[cellInfo.rowIndex][ut.colsNum - 1].cellIndex); + if (evt.shiftKey && ut.selectedTds.length) { + if (ut.selectedTds[0] !== endTdRow) { + cellsRange = ut.getCellsRange(ut.selectedTds[0], endTdRow); + ut.setSelected(cellsRange); + } else { + rng && rng.selectNodeContents(endTdRow).select(); + } + } else { + if (target !== endTdRow) { + cellsRange = ut.getCellsRange(target, endTdRow); + ut.setSelected(cellsRange); + } else { + rng && rng.selectNodeContents(endTdRow).select(); + } + } + } + }; + }); + + switchBorderColor(me, true); + }); + + domUtils.on(me.document, "mousemove", mouseMoveEvent); + + domUtils.on(me.document, "mouseout", function (evt) { + var target = evt.target || evt.srcElement; + if (target.tagName == "TABLE") { + toggleDraggableState(me, false, "", null); + } + }); + /** + * 表格隔行变色 + */ + me.addListener("interlacetable",function(type,table,classList){ + if(!table) return; + var me = this, + rows = table.rows, + len = rows.length, + getClass = function(list,index,repeat){ + return list[index] ? list[index] : repeat ? list[index % list.length]: ""; + }; + for(var i = 0;i 1 ? currentRowIndex : ua.getCellInfo(cell).rowIndex; + var nextCell = ua.getTabNextCell(cell, currentRowIndex); + if (nextCell) { + if (isEmptyBlock(nextCell)) { + range.setStart(nextCell, 0).setCursor(false, true) + } else { + range.selectNodeContents(nextCell).select() + } + } else { + me.fireEvent('saveScene'); + me.__hasEnterExecCommand = true; + this.execCommand('insertrownext'); + me.__hasEnterExecCommand = false; + range = this.selection.getRange(); + range.setStart(table.rows[table.rows.length - 1].cells[0], 0).setCursor(); + me.fireEvent('saveScene'); + } + } + return true; + } + + }); + browser.ie && me.addListener('selectionchange', function () { + toggleDraggableState(this, false, "", null); + }); + me.addListener("keydown", function (type, evt) { + var me = this; + //处理在表格的最后一个输入tab产生新的表格 + var keyCode = evt.keyCode || evt.which; + if (keyCode == 8 || keyCode == 46) { + return; + } + var notCtrlKey = !evt.ctrlKey && !evt.metaKey && !evt.shiftKey && !evt.altKey; + notCtrlKey && removeSelectedClass(domUtils.getElementsByTagName(me.body, "td")); + var ut = getUETableBySelected(me); + if (!ut) return; + notCtrlKey && ut.clearSelected(); + }); + + me.addListener("beforegetcontent", function () { + switchBorderColor(this, false); + browser.ie && utils.each(this.document.getElementsByTagName('caption'), function (ci) { + if (domUtils.isEmptyNode(ci)) { + ci.innerHTML = ' ' + } + }); + }); + me.addListener("aftergetcontent", function () { + switchBorderColor(this, true); + }); + me.addListener("getAllHtml", function () { + removeSelectedClass(me.document.getElementsByTagName("td")); + }); + //修正全屏状态下插入的表格宽度在非全屏状态下撑开编辑器的情况 + me.addListener("fullscreenchanged", function (type, fullscreen) { + if (!fullscreen) { + var ratio = this.body.offsetWidth / document.body.offsetWidth, + tables = domUtils.getElementsByTagName(this.body, "table"); + utils.each(tables, function (table) { + if (table.offsetWidth < me.body.offsetWidth) return false; + var tds = domUtils.getElementsByTagName(table, "td"), + backWidths = []; + utils.each(tds, function (td) { + backWidths.push(td.offsetWidth); + }); + for (var i = 0, td; td = tds[i]; i++) { + td.setAttribute("width", Math.floor(backWidths[i] * ratio)); + } + table.setAttribute("width", Math.floor(getTableWidth(me, needIEHack, getDefaultValue(me)))) + }); + } + }); + + //重写execCommand命令,用于处理框选时的处理 + var oldExecCommand = me.execCommand; + me.execCommand = function (cmd, datatat) { + + var me = this, + args = arguments; + + cmd = cmd.toLowerCase(); + var ut = getUETableBySelected(me), tds, + range = new dom.Range(me.document), + cmdFun = me.commands[cmd] || UE.commands[cmd], + result; + if (!cmdFun) return; + if (ut && !commands[cmd] && !cmdFun.notNeedUndo && !me.__hasEnterExecCommand) { + me.__hasEnterExecCommand = true; + me.fireEvent("beforeexeccommand", cmd); + tds = ut.selectedTds; + var lastState = -2, lastValue = -2, value, state; + for (var i = 0, td; td = tds[i]; i++) { + if (isEmptyBlock(td)) { + range.setStart(td, 0).setCursor(false, true) + } else { + range.selectNode(td).select(true); + } + state = me.queryCommandState(cmd); + value = me.queryCommandValue(cmd); + if (state != -1) { + if (lastState !== state || lastValue !== value) { + me._ignoreContentChange = true; + result = oldExecCommand.apply(me, arguments); + me._ignoreContentChange = false; + + } + lastState = me.queryCommandState(cmd); + lastValue = me.queryCommandValue(cmd); + if (domUtils.isEmptyBlock(td)) { + domUtils.fillNode(me.document, td) + } + } + } + range.setStart(tds[0], 0).shrinkBoundary(true).setCursor(false, true); + me.fireEvent('contentchange'); + me.fireEvent("afterexeccommand", cmd); + me.__hasEnterExecCommand = false; + me._selectionChange(); + } else { + result = oldExecCommand.apply(me, arguments); + } + return result; + }; + + + }); + /** + * 删除obj的宽高style,改成属性宽高 + * @param obj + * @param replaceToProperty + */ + function removeStyleSize(obj, replaceToProperty) { + removeStyle(obj, "width", true); + removeStyle(obj, "height", true); + } + + function removeStyle(obj, styleName, replaceToProperty) { + if (obj.style[styleName]) { + replaceToProperty && obj.setAttribute(styleName, parseInt(obj.style[styleName], 10)); + obj.style[styleName] = ""; + } + } + + function getParentTdOrTh(ele) { + if (ele.tagName == "TD" || ele.tagName == "TH") return ele; + var td; + if (td = domUtils.findParentByTagName(ele, "td", true) || domUtils.findParentByTagName(ele, "th", true)) return td; + return null; + } + + function isEmptyBlock(node) { + var reg = new RegExp(domUtils.fillChar, 'g'); + if (node[browser.ie ? 'innerText' : 'textContent'].replace(/^\s*$/, '').replace(reg, '').length > 0) { + return 0; + } + for (var n in dtd.$isNotEmpty) { + if (node.getElementsByTagName(n).length) { + return 0; + } + } + return 1; + } + + + function mouseCoords(evt) { + if (evt.pageX || evt.pageY) { + return { x:evt.pageX, y:evt.pageY }; + } + return { + x:evt.clientX + me.document.body.scrollLeft - me.document.body.clientLeft, + y:evt.clientY + me.document.body.scrollTop - me.document.body.clientTop + }; + } + + function mouseMoveEvent(evt) { + + if( isEditorDisabled() ) { + return; + } + + try { + + //普通状态下鼠标移动 + var target = getParentTdOrTh(evt.target || evt.srcElement), + pos; + + //区分用户的行为是拖动还是双击 + if( isInResizeBuffer ) { + + me.body.style.webkitUserSelect = 'none'; + + if( Math.abs( userActionStatus.x - evt.clientX ) > offsetOfTableCell || Math.abs( userActionStatus.y - evt.clientY ) > offsetOfTableCell ) { + clearTableDragTimer(); + isInResizeBuffer = false; + singleClickState = 0; + //drag action + tableBorderDrag(evt); + } + } + + //修改单元格大小时的鼠标移动 + if (onDrag && dragTd) { + singleClickState = 0; + me.body.style.webkitUserSelect = 'none'; + me.selection.getNative()[browser.ie9below ? 'empty' : 'removeAllRanges'](); + pos = mouseCoords(evt); + toggleDraggableState(me, true, onDrag, pos, target); + if (onDrag == "h") { + dragLine.style.left = getPermissionX(dragTd, evt) + "px"; + } else if (onDrag == "v") { + dragLine.style.top = getPermissionY(dragTd, evt) + "px"; + } + return; + } + //当鼠标处于table上时,修改移动过程中的光标状态 + if (target) { + //针对使用table作为容器的组件不触发拖拽效果 + if (me.fireEvent('excludetable', target) === true) + return; + pos = mouseCoords(evt); + var state = getRelation(target, pos), + table = domUtils.findParentByTagName(target, "table", true); + + if (inTableSide(table, target, evt, true)) { + if (me.fireEvent("excludetable", table) === true) return; + me.body.style.cursor = "url(" + me.options.cursorpath + "h.png),pointer"; + } else if (inTableSide(table, target, evt)) { + if (me.fireEvent("excludetable", table) === true) return; + me.body.style.cursor = "url(" + me.options.cursorpath + "v.png),pointer"; + } else { + me.body.style.cursor = "text"; + var curCell = target; + if (/\d/.test(state)) { + state = state.replace(/\d/, ''); + target = getUETable(target).getPreviewCell(target, state == "v"); + } + //位于第一行的顶部或者第一列的左边时不可拖动 + toggleDraggableState(me, target ? !!state : false, target ? state : '', pos, target); + + } + } else { + toggleDragButton(false, table, me); + } + + } catch (e) { + showError(e); + } + } + + var dragButtonTimer; + + function toggleDragButton(show, table, editor) { + if (!show) { + if (dragOver)return; + dragButtonTimer = setTimeout(function () { + !dragOver && dragButton && dragButton.parentNode && dragButton.parentNode.removeChild(dragButton); + }, 2000); + } else { + createDragButton(table, editor); + } + } + + function createDragButton(table, editor) { + var pos = domUtils.getXY(table), + doc = table.ownerDocument; + if (dragButton && dragButton.parentNode)return dragButton; + dragButton = doc.createElement("div"); + dragButton.contentEditable = false; + dragButton.innerHTML = ""; + dragButton.style.cssText = "width:15px;height:15px;background-image:url(" + editor.options.UEDITOR_HOME_URL + "dialogs/table/dragicon.png);position: absolute;cursor:move;top:" + (pos.y - 15) + "px;left:" + (pos.x) + "px;"; + domUtils.unSelectable(dragButton); + dragButton.onmouseover = function (evt) { + dragOver = true; + }; + dragButton.onmouseout = function (evt) { + dragOver = false; + }; + domUtils.on(dragButton, 'click', function (type, evt) { + doClick(evt, this); + }); + domUtils.on(dragButton, 'dblclick', function (type, evt) { + doDblClick(evt); + }); + domUtils.on(dragButton, 'dragstart', function (type, evt) { + domUtils.preventDefault(evt); + }); + var timer; + + function doClick(evt, button) { + // 部分浏览器下需要清理 + clearTimeout(timer); + timer = setTimeout(function () { + editor.fireEvent("tableClicked", table, button); + }, 300); + } + + function doDblClick(evt) { + clearTimeout(timer); + var ut = getUETable(table), + start = table.rows[0].cells[0], + end = ut.getLastCell(), + range = ut.getCellsRange(start, end); + editor.selection.getRange().setStart(start, 0).setCursor(false, true); + ut.setSelected(range); + } + + doc.body.appendChild(dragButton); + } + + +// function inPosition(table, pos) { +// var tablePos = domUtils.getXY(table), +// width = table.offsetWidth, +// height = table.offsetHeight; +// if (pos.x - tablePos.x < 5 && pos.y - tablePos.y < 5) { +// return "topLeft"; +// } else if (tablePos.x + width - pos.x < 5 && tablePos.y + height - pos.y < 5) { +// return "bottomRight"; +// } +// } + + function inTableSide(table, cell, evt, top) { + var pos = mouseCoords(evt), + state = getRelation(cell, pos); + + if (top) { + var caption = table.getElementsByTagName("caption")[0], + capHeight = caption ? caption.offsetHeight : 0; + return (state == "v1") && ((pos.y - domUtils.getXY(table).y - capHeight) < 8); + } else { + return (state == "h1") && ((pos.x - domUtils.getXY(table).x) < 8); + } + } + + /** + * 获取拖动时允许的X轴坐标 + * @param dragTd + * @param evt + */ + function getPermissionX(dragTd, evt) { + var ut = getUETable(dragTd); + if (ut) { + var preTd = ut.getSameEndPosCells(dragTd, "x")[0], + nextTd = ut.getSameStartPosXCells(dragTd)[0], + mouseX = mouseCoords(evt).x, + left = (preTd ? domUtils.getXY(preTd).x : domUtils.getXY(ut.table).x) + 20 , + right = nextTd ? domUtils.getXY(nextTd).x + nextTd.offsetWidth - 20 : (me.body.offsetWidth + 5 || parseInt(domUtils.getComputedStyle(me.body, "width"), 10)); + + left += cellMinWidth; + right -= cellMinWidth; + + return mouseX < left ? left : mouseX > right ? right : mouseX; + } + } + + /** + * 获取拖动时允许的Y轴坐标 + */ + function getPermissionY(dragTd, evt) { + try { + var top = domUtils.getXY(dragTd).y, + mousePosY = mouseCoords(evt).y; + return mousePosY < top ? top : mousePosY; + } catch (e) { + showError(e); + } + } + + /** + * 移动状态切换 + */ + function toggleDraggableState(editor, draggable, dir, mousePos, cell) { + try { + editor.body.style.cursor = dir == "h" ? "col-resize" : dir == "v" ? "row-resize" : "text"; + if (browser.ie) { + if (dir && !mousedown && !getUETableBySelected(editor)) { + getDragLine(editor, editor.document); + showDragLineAt(dir, cell); + } else { + hideDragLine(editor) + } + } + onBorder = draggable; + } catch (e) { + showError(e); + } + } + + /** + * 获取与UETable相关的resize line + * @param uetable UETable对象 + */ + function getResizeLineByUETable() { + + var lineId = '_UETableResizeLine', + line = this.document.getElementById( lineId ); + + if( !line ) { + line = this.document.createElement("div"); + line.id = lineId; + line.contnetEditable = false; + line.setAttribute("unselectable", "on"); + + var styles = { + width: 2*cellBorderWidth + 1 + 'px', + position: 'absolute', + 'z-index': 100000, + cursor: 'col-resize', + background: 'red', + display: 'none' + }; + + //切换状态 + line.onmouseout = function(){ + this.style.display = 'none'; + }; + + utils.extend( line.style, styles ); + + this.document.body.appendChild( line ); + + } + + return line; + + } + + /** + * 更新resize-line + */ + function updateResizeLine( cell, uetable ) { + + var line = getResizeLineByUETable.call( this ), + table = uetable.table, + styles = { + top: domUtils.getXY( table ).y + 'px', + left: domUtils.getXY( cell).x + cell.offsetWidth - cellBorderWidth + 'px', + display: 'block', + height: table.offsetHeight + 'px' + }; + + utils.extend( line.style, styles ); + + } + + /** + * 显示resize-line + */ + function showResizeLine( cell ) { + + var uetable = getUETable( cell ); + + updateResizeLine.call( this, cell, uetable ); + + } + + /** + * 获取鼠标与当前单元格的相对位置 + * @param ele + * @param mousePos + */ + function getRelation(ele, mousePos) { + var elePos = domUtils.getXY(ele); + + if( !elePos ) { + return ''; + } + + if (elePos.x + ele.offsetWidth - mousePos.x < cellBorderWidth) { + return "h"; + } + if (mousePos.x - elePos.x < cellBorderWidth) { + return 'h1' + } + if (elePos.y + ele.offsetHeight - mousePos.y < cellBorderWidth) { + return "v"; + } + if (mousePos.y - elePos.y < cellBorderWidth) { + return 'v1' + } + return ''; + } + + function mouseDownEvent(type, evt) { + + if( isEditorDisabled() ) { + return ; + } + + userActionStatus = { + x: evt.clientX, + y: evt.clientY + }; + + //右键菜单单独处理 + if (evt.button == 2) { + var ut = getUETableBySelected(me), + flag = false; + + if (ut) { + var td = getTargetTd(me, evt); + utils.each(ut.selectedTds, function (ti) { + if (ti === td) { + flag = true; + } + }); + if (!flag) { + removeSelectedClass(domUtils.getElementsByTagName(me.body, "th td")); + ut.clearSelected() + } else { + td = ut.selectedTds[0]; + setTimeout(function () { + me.selection.getRange().setStart(td, 0).setCursor(false, true); + }, 0); + + } + } + } else { + tableClickHander( evt ); + } + + } + + //清除表格的计时器 + function clearTableTimer() { + tabTimer && clearTimeout( tabTimer ); + tabTimer = null; + } + + //双击收缩 + function tableDbclickHandler(evt) { + singleClickState = 0; + evt = evt || me.window.event; + var target = getParentTdOrTh(evt.target || evt.srcElement); + if (target) { + var h; + if (h = getRelation(target, mouseCoords(evt))) { + + hideDragLine( me ); + + if (h == 'h1') { + h = 'h'; + if (inTableSide(domUtils.findParentByTagName(target, "table"), target, evt)) { + me.execCommand('adaptbywindow'); + } else { + target = getUETable(target).getPreviewCell(target); + if (target) { + var rng = me.selection.getRange(); + rng.selectNodeContents(target).setCursor(true, true) + } + } + } + if (h == 'h') { + var ut = getUETable(target), + table = ut.table, + cells = getCellsByMoveBorder( target, table, true ); + + cells = extractArray( cells, 'left' ); + + ut.width = ut.offsetWidth; + + var oldWidth = [], + newWidth = []; + + utils.each( cells, function( cell ){ + + oldWidth.push( cell.offsetWidth ); + + } ); + + utils.each( cells, function( cell ){ + + cell.removeAttribute("width"); + + } ); + + window.setTimeout( function(){ + + //是否允许改变 + var changeable = true; + + utils.each( cells, function( cell, index ){ + + var width = cell.offsetWidth; + + if( width > oldWidth[index] ) { + changeable = false; + return false; + } + + newWidth.push( width ); + + } ); + + var change = changeable ? newWidth : oldWidth; + + utils.each( cells, function( cell, index ){ + + cell.width = change[index] - getTabcellSpace(); + + } ); + + + }, 0 ); + +// minWidth -= cellMinWidth; +// +// table.removeAttribute("width"); +// utils.each(cells, function (cell) { +// cell.style.width = ""; +// cell.width -= minWidth; +// }); + + } + } + } + } + + function tableClickHander( evt ) { + + removeSelectedClass(domUtils.getElementsByTagName(me.body, "td th")); + //trace:3113 + //选中单元格,点击table外部,不会清掉table上挂的ueTable,会引起getUETableBySelected方法返回值 + utils.each(me.document.getElementsByTagName('table'), function (t) { + t.ueTable = null; + }); + startTd = getTargetTd(me, evt); + if( !startTd ) return; + var table = domUtils.findParentByTagName(startTd, "table", true); + ut = getUETable(table); + ut && ut.clearSelected(); + + //判断当前鼠标状态 + if (!onBorder) { + me.document.body.style.webkitUserSelect = ''; + mousedown = true; + me.addListener('mouseover', mouseOverEvent); + } else { + //边框上的动作处理 + borderActionHandler( evt ); + } + + + } + + //处理表格边框上的动作, 这里做延时处理,避免两种动作互相影响 + function borderActionHandler( evt ) { + + if ( browser.ie ) { + evt = reconstruct(evt ); + } + + clearTableDragTimer(); + + //是否正在等待resize的缓冲中 + isInResizeBuffer = true; + + tableDragTimer = setTimeout(function(){ + tableBorderDrag( evt ); + }, dblclickTime); + + } + + function extractArray( originArr, key ) { + + var result = [], + tmp = null; + + for( var i = 0, len = originArr.length; i 0 && singleClickState--; + }, dblclickTime ); + + if( singleClickState === 2 ) { + + singleClickState = 0; + tableDbclickHandler(evt); + return; + + } + + } + + if (evt.button == 2)return; + var me = this; + //清除表格上原生跨选问题 + var range = me.selection.getRange(), + start = domUtils.findParentByTagName(range.startContainer, 'table', true), + end = domUtils.findParentByTagName(range.endContainer, 'table', true); + + if (start || end) { + if (start === end) { + start = domUtils.findParentByTagName(range.startContainer, ['td', 'th', 'caption'], true); + end = domUtils.findParentByTagName(range.endContainer, ['td', 'th', 'caption'], true); + if (start !== end) { + me.selection.clearRange() + } + } else { + me.selection.clearRange() + } + } + mousedown = false; + me.document.body.style.webkitUserSelect = ''; + //拖拽状态下的mouseUP + if ( onDrag && dragTd ) { + + me.selection.getNative()[browser.ie9below ? 'empty' : 'removeAllRanges'](); + + singleClickState = 0; + dragLine = me.document.getElementById('ue_tableDragLine'); + + // trace 3973 + if (dragLine) { + var dragTdPos = domUtils.getXY(dragTd), + dragLinePos = domUtils.getXY(dragLine); + + switch (onDrag) { + case "h": + changeColWidth(dragTd, dragLinePos.x - dragTdPos.x); + break; + case "v": + changeRowHeight(dragTd, dragLinePos.y - dragTdPos.y - dragTd.offsetHeight); + break; + default: + } + onDrag = ""; + dragTd = null; + + hideDragLine(me); + me.fireEvent('saveScene'); + return; + } + } + //正常状态下的mouseup + if (!startTd) { + var target = domUtils.findParentByTagName(evt.target || evt.srcElement, "td", true); + if (!target) target = domUtils.findParentByTagName(evt.target || evt.srcElement, "th", true); + if (target && (target.tagName == "TD" || target.tagName == "TH")) { + if (me.fireEvent("excludetable", target) === true) return; + range = new dom.Range(me.document); + range.setStart(target, 0).setCursor(false, true); + } + } else { + var ut = getUETable(startTd), + cell = ut ? ut.selectedTds[0] : null; + if (cell) { + range = new dom.Range(me.document); + if (domUtils.isEmptyBlock(cell)) { + range.setStart(cell, 0).setCursor(false, true); + } else { + range.selectNodeContents(cell).shrinkBoundary().setCursor(false, true); + } + } else { + range = me.selection.getRange().shrinkBoundary(); + if (!range.collapsed) { + var start = domUtils.findParentByTagName(range.startContainer, ['td', 'th'], true), + end = domUtils.findParentByTagName(range.endContainer, ['td', 'th'], true); + //在table里边的不能清除 + if (start && !end || !start && end || start && end && start !== end) { + range.setCursor(false, true); + } + } + } + startTd = null; + me.removeListener('mouseover', mouseOverEvent); + } + me._selectionChange(250, evt); + } + + function mouseOverEvent(type, evt) { + + if( isEditorDisabled() ) { + return; + } + + var me = this, + tar = evt.target || evt.srcElement; + currentTd = domUtils.findParentByTagName(tar, "td", true) || domUtils.findParentByTagName(tar, "th", true); + //需要判断两个TD是否位于同一个表格内 + if (startTd && currentTd && + ((startTd.tagName == "TD" && currentTd.tagName == "TD") || (startTd.tagName == "TH" && currentTd.tagName == "TH")) && + domUtils.findParentByTagName(startTd, 'table') == domUtils.findParentByTagName(currentTd, 'table')) { + var ut = getUETable(currentTd); + if (startTd != currentTd) { + me.document.body.style.webkitUserSelect = 'none'; + me.selection.getNative()[browser.ie9below ? 'empty' : 'removeAllRanges'](); + var range = ut.getCellsRange(startTd, currentTd); + ut.setSelected(range); + } else { + me.document.body.style.webkitUserSelect = ''; + ut.clearSelected(); + } + + } + evt.preventDefault ? evt.preventDefault() : (evt.returnValue = false); + } + + function setCellHeight(cell, height, backHeight) { + var lineHight = parseInt(domUtils.getComputedStyle(cell, "line-height"), 10), + tmpHeight = backHeight + height; + height = tmpHeight < lineHight ? lineHight : tmpHeight; + if (cell.style.height) cell.style.height = ""; + cell.rowSpan == 1 ? cell.setAttribute("height", height) : (cell.removeAttribute && cell.removeAttribute("height")); + } + + function getWidth(cell) { + if (!cell)return 0; + return parseInt(domUtils.getComputedStyle(cell, "width"), 10); + } + + function changeColWidth(cell, changeValue) { + + var ut = getUETable(cell); + if (ut) { + + //根据当前移动的边框获取相关的单元格 + var table = ut.table, + cells = getCellsByMoveBorder( cell, table ); + + table.style.width = ""; + table.removeAttribute("width"); + + //修正改变量 + changeValue = correctChangeValue( changeValue, cell, cells ); + + if (cell.nextSibling) { + + var i=0; + + utils.each( cells, function( cellGroup ){ + + cellGroup.left.width = (+cellGroup.left.width)+changeValue; + cellGroup.right && ( cellGroup.right.width = (+cellGroup.right.width)-changeValue ); + + } ); + + } else { + + utils.each( cells, function( cellGroup ){ + cellGroup.left.width -= -changeValue; + } ); + + } + } + + } + + function isEditorDisabled() { + return me.body.contentEditable === "false"; + } + + function changeRowHeight(td, changeValue) { + if (Math.abs(changeValue) < 10) return; + var ut = getUETable(td); + if (ut) { + var cells = ut.getSameEndPosCells(td, "y"), + //备份需要连带变化的td的原始高度,否则后期无法获取正确的值 + backHeight = cells[0] ? cells[0].offsetHeight : 0; + for (var i = 0, cell; cell = cells[i++];) { + setCellHeight(cell, changeValue, backHeight); + } + } + + } + + /** + * 获取调整单元格大小的相关单元格 + * @isContainMergeCell 返回的结果中是否包含发生合并后的单元格 + */ + function getCellsByMoveBorder( cell, table, isContainMergeCell ) { + + if( !table ) { + table = domUtils.findParentByTagName( cell, 'table' ); + } + + if( !table ) { + return null; + } + + //获取到该单元格所在行的序列号 + var index = domUtils.getNodeIndex( cell ), + temp = cell, + rows = table.rows, + colIndex = 0; + + while( temp ) { + //获取到当前单元格在未发生单元格合并时的序列 + if( temp.nodeType === 1 ) { + colIndex += (temp.colSpan || 1); + } + temp = temp.previousSibling; + } + + temp = null; + + //记录想关的单元格 + var borderCells = []; + + utils.each(rows, function( tabRow ){ + + var cells = tabRow.cells, + currIndex = 0; + + utils.each( cells, function( tabCell ){ + + currIndex += (tabCell.colSpan || 1); + + if( currIndex === colIndex ) { + + borderCells.push({ + left: tabCell, + right: tabCell.nextSibling || null + }); + + return false; + + } else if( currIndex > colIndex ) { + + if( isContainMergeCell ) { + borderCells.push({ + left: tabCell + }); + } + + return false; + } + + + } ); + + }); + + return borderCells; + + } + + + /** + * 通过给定的单元格集合获取最小的单元格width + */ + function getMinWidthByTableCells( cells ) { + + var minWidth = Number.MAX_VALUE; + + for( var i = 0, curCell; curCell = cells[ i ] ; i++ ) { + + minWidth = Math.min( minWidth, curCell.width || getTableCellWidth( curCell ) ); + + } + + return minWidth; + + } + + function correctChangeValue( changeValue, relatedCell, cells ) { + + //为单元格的paading预留空间 + changeValue -= getTabcellSpace(); + + if( changeValue < 0 ) { + return 0; + } + + changeValue -= getTableCellWidth( relatedCell ); + + //确定方向 + var direction = changeValue < 0 ? 'left':'right'; + + changeValue = Math.abs(changeValue); + + //只关心非最后一个单元格就可以 + utils.each( cells, function( cellGroup ){ + + var curCell = cellGroup[direction]; + + //为单元格保留最小空间 + if( curCell ) { + changeValue = Math.min( changeValue, getTableCellWidth( curCell )-cellMinWidth ); + } + + + } ); + + + //修正越界 + changeValue = changeValue < 0 ? 0 : changeValue; + + return direction === 'left' ? -changeValue : changeValue; + + } + + function getTableCellWidth( cell ) { + + var width = 0, + //偏移纠正量 + offset = 0, + width = cell.offsetWidth - getTabcellSpace(); + + //最后一个节点纠正一下 + if( !cell.nextSibling ) { + + width -= getTableCellOffset( cell ); + + } + + width = width < 0 ? 0 : width; + + try { + cell.width = width; + } catch(e) { + } + + return width; + + } + + /** + * 获取单元格所在表格的最末单元格的偏移量 + */ + function getTableCellOffset( cell ) { + + tab = domUtils.findParentByTagName( cell, "table", false); + + if( tab.offsetVal === undefined ) { + + var prev = cell.previousSibling; + + if( prev ) { + + //最后一个单元格和前一个单元格的width diff结果 如果恰好为一个border width, 则条件成立 + tab.offsetVal = cell.offsetWidth - prev.offsetWidth === UT.borderWidth ? UT.borderWidth : 0; + + } else { + tab.offsetVal = 0; + } + + } + + return tab.offsetVal; + + } + + function getTabcellSpace() { + + if( UT.tabcellSpace === undefined ) { + + var cell = null, + tab = me.document.createElement("table"), + tbody = me.document.createElement("tbody"), + trow = me.document.createElement("tr"), + tabcell = me.document.createElement("td"), + mirror = null; + + tabcell.style.cssText = 'border: 0;'; + tabcell.width = 1; + + trow.appendChild( tabcell ); + trow.appendChild( mirror = tabcell.cloneNode( false ) ); + + tbody.appendChild( trow ); + + tab.appendChild( tbody ); + + tab.style.cssText = "visibility: hidden;"; + + me.body.appendChild( tab ); + + UT.paddingSpace = tabcell.offsetWidth - 1; + + var tmpTabWidth = tab.offsetWidth; + + tabcell.style.cssText = ''; + mirror.style.cssText = ''; + + UT.borderWidth = ( tab.offsetWidth - tmpTabWidth ) / 3; + + UT.tabcellSpace = UT.paddingSpace + UT.borderWidth; + + me.body.removeChild( tab ); + + } + + getTabcellSpace = function(){ return UT.tabcellSpace; }; + + return UT.tabcellSpace; + + } + + function getDragLine(editor, doc) { + if (mousedown)return; + dragLine = editor.document.createElement("div"); + domUtils.setAttributes(dragLine, { + id:"ue_tableDragLine", + unselectable:'on', + contenteditable:false, + 'onresizestart':'return false', + 'ondragstart':'return false', + 'onselectstart':'return false', + style:"background-color:blue;position:absolute;padding:0;margin:0;background-image:none;border:0px none;opacity:0;filter:alpha(opacity=0)" + }); + editor.body.appendChild(dragLine); + } + + function hideDragLine(editor) { + if (mousedown)return; + var line; + while (line = editor.document.getElementById('ue_tableDragLine')) { + domUtils.remove(line) + } + } + + /** + * 依据state(v|h)在cell位置显示横线 + * @param state + * @param cell + */ + function showDragLineAt(state, cell) { + if (!cell) return; + var table = domUtils.findParentByTagName(cell, "table"), + caption = table.getElementsByTagName('caption'), + width = table.offsetWidth, + height = table.offsetHeight - (caption.length > 0 ? caption[0].offsetHeight : 0), + tablePos = domUtils.getXY(table), + cellPos = domUtils.getXY(cell), css; + switch (state) { + case "h": + css = 'height:' + height + 'px;top:' + (tablePos.y + (caption.length > 0 ? caption[0].offsetHeight : 0)) + 'px;left:' + (cellPos.x + cell.offsetWidth); + dragLine.style.cssText = css + 'px;position: absolute;display:block;background-color:blue;width:1px;border:0; color:blue;opacity:.3;filter:alpha(opacity=30)'; + break; + case "v": + css = 'width:' + width + 'px;left:' + tablePos.x + 'px;top:' + (cellPos.y + cell.offsetHeight ); + //必须加上border:0和color:blue,否则低版ie不支持背景色显示 + dragLine.style.cssText = css + 'px;overflow:hidden;position: absolute;display:block;background-color:blue;height:1px;border:0;color:blue;opacity:.2;filter:alpha(opacity=20)'; + break; + default: + } + } + + /** + * 当表格边框颜色为白色时设置为虚线,true为添加虚线 + * @param editor + * @param flag + */ + function switchBorderColor(editor, flag) { + var tableArr = domUtils.getElementsByTagName(editor.body, "table"), color; + for (var i = 0, node; node = tableArr[i++];) { + var td = domUtils.getElementsByTagName(node, "td"); + if (td[0]) { + if (flag) { + color = (td[0].style.borderColor).replace(/\s/g, ""); + if (/(#ffffff)|(rgb\(255,255,255\))/ig.test(color)) + domUtils.addClass(node, "noBorderTable") + } else { + domUtils.removeClasses(node, "noBorderTable") + } + } + + } + } + + function getTableWidth(editor, needIEHack, defaultValue) { + var body = editor.body; + return body.offsetWidth - (needIEHack ? parseInt(domUtils.getComputedStyle(body, 'margin-left'), 10) * 2 : 0) - defaultValue.tableBorder * 2 - (editor.options.offsetWidth || 0); + } + + /** + * 获取当前拖动的单元格 + */ + function getTargetTd(editor, evt) { + + var target = domUtils.findParentByTagName(evt.target || evt.srcElement, ["td", "th"], true), + dir = null; + + if( !target ) { + return null; + } + + dir = getRelation( target, mouseCoords( evt ) ); + + //如果有前一个节点, 需要做一个修正, 否则可能会得到一个错误的td + + if( !target ) { + return null; + } + + if( dir === 'h1' && target.previousSibling ) { + + var position = domUtils.getXY( target), + cellWidth = target.offsetWidth; + + if( Math.abs( position.x + cellWidth - evt.clientX ) > cellWidth / 3 ) { + target = target.previousSibling; + } + + } else if( dir === 'v1' && target.parentNode.previousSibling ) { + + var position = domUtils.getXY( target), + cellHeight = target.offsetHeight; + + if( Math.abs( position.y + cellHeight - evt.clientY ) > cellHeight / 3 ) { + target = target.parentNode.previousSibling.firstChild; + } + + } + + + //排除了非td内部以及用于代码高亮部分的td + return target && !(editor.fireEvent("excludetable", target) === true) ? target : null; + } + +}; + + +// plugins/table.sort.js +/** + * Created with JetBrains PhpStorm. + * User: Jinqn + * Date: 13-10-12 + * Time: 上午10:20 + * To change this template use File | Settings | File Templates. + */ + +UE.UETable.prototype.sortTable = function (sortByCellIndex, compareFn) { + var table = this.table, + rows = table.rows, + trArray = [], + flag = rows[0].cells[0].tagName === "TH", + lastRowIndex = 0; + if(this.selectedTds.length){ + var range = this.cellsRange, + len = range.endRowIndex + 1; + for (var i = range.beginRowIndex; i < len; i++) { + trArray[i] = rows[i]; + } + trArray.splice(0,range.beginRowIndex); + lastRowIndex = (range.endRowIndex +1) === this.rowsNum ? 0 : range.endRowIndex +1; + }else{ + for (var i = 0,len = rows.length; i < len; i++) { + trArray[i] = rows[i]; + } + } + + var Fn = { + 'reversecurrent': function(td1,td2){ + return 1; + }, + 'orderbyasc': function(td1,td2){ + var value1 = td1.innerText||td1.textContent, + value2 = td2.innerText||td2.textContent; + return value1.localeCompare(value2); + }, + 'reversebyasc': function(td1,td2){ + var value1 = td1.innerHTML, + value2 = td2.innerHTML; + return value2.localeCompare(value1); + }, + 'orderbynum': function(td1,td2){ + var value1 = td1[browser.ie ? 'innerText':'textContent'].match(/\d+/), + value2 = td2[browser.ie ? 'innerText':'textContent'].match(/\d+/); + if(value1) value1 = +value1[0]; + if(value2) value2 = +value2[0]; + return (value1||0) - (value2||0); + }, + 'reversebynum': function(td1,td2){ + var value1 = td1[browser.ie ? 'innerText':'textContent'].match(/\d+/), + value2 = td2[browser.ie ? 'innerText':'textContent'].match(/\d+/); + if(value1) value1 = +value1[0]; + if(value2) value2 = +value2[0]; + return (value2||0) - (value1||0); + } + }; + + //对表格设置排序的标记data-sort-type + table.setAttribute('data-sort-type', compareFn && typeof compareFn === "string" && Fn[compareFn] ? compareFn:''); + + //th不参与排序 + flag && trArray.splice(0, 1); + trArray = utils.sort(trArray,function (tr1, tr2) { + var result; + if (compareFn && typeof compareFn === "function") { + result = compareFn.call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]); + } else if (compareFn && typeof compareFn === "number") { + result = 1; + } else if (compareFn && typeof compareFn === "string" && Fn[compareFn]) { + result = Fn[compareFn].call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]); + } else { + result = Fn['orderbyasc'].call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]); + } + return result; + }); + var fragment = table.ownerDocument.createDocumentFragment(); + for (var j = 0, len = trArray.length; j < len; j++) { + fragment.appendChild(trArray[j]); + } + var tbody = table.getElementsByTagName("tbody")[0]; + if(!lastRowIndex){ + tbody.appendChild(fragment); + }else{ + tbody.insertBefore(fragment,rows[lastRowIndex- range.endRowIndex + range.beginRowIndex - 1]) + } +}; + +UE.plugins['tablesort'] = function () { + var me = this, + UT = UE.UETable, + getUETable = function (tdOrTable) { + return UT.getUETable(tdOrTable); + }, + getTableItemsByRange = function (editor) { + return UT.getTableItemsByRange(editor); + }; + + + me.ready(function () { + //添加表格可排序的样式 + utils.cssRule('tablesort', + 'table.sortEnabled tr.firstRow th,table.sortEnabled tr.firstRow td{padding-right:20px;background-repeat: no-repeat;background-position: center right;' + + ' background-image:url(' + me.options.themePath + me.options.theme + '/images/sortable.png);}', + me.document); + + //做单元格合并操作时,清除可排序标识 + me.addListener("afterexeccommand", function (type, cmd) { + if( cmd == 'mergeright' || cmd == 'mergedown' || cmd == 'mergecells') { + this.execCommand('disablesort'); + } + }); + }); + + + + //表格排序 + UE.commands['sorttable'] = { + queryCommandState: function () { + var me = this, + tableItems = getTableItemsByRange(me); + if (!tableItems.cell) return -1; + var table = tableItems.table, + cells = table.getElementsByTagName("td"); + for (var i = 0, cell; cell = cells[i++];) { + if (cell.rowSpan != 1 || cell.colSpan != 1) return -1; + } + return 0; + }, + execCommand: function (cmd, fn) { + var me = this, + range = me.selection.getRange(), + bk = range.createBookmark(true), + tableItems = getTableItemsByRange(me), + cell = tableItems.cell, + ut = getUETable(tableItems.table), + cellInfo = ut.getCellInfo(cell); + ut.sortTable(cellInfo.cellIndex, fn); + range.moveToBookmark(bk); + try{ + range.select(); + }catch(e){} + } + }; + + //设置表格可排序,清除表格可排序 + UE.commands["enablesort"] = UE.commands["disablesort"] = { + queryCommandState: function (cmd) { + var table = getTableItemsByRange(this).table; + if(table && cmd=='enablesort') { + var cells = domUtils.getElementsByTagName(table, 'th td'); + for(var i = 0; i1 || cells[i].getAttribute('rowspan')>1) return -1; + } + } + + return !table ? -1: cmd=='enablesort' ^ table.getAttribute('data-sort')!='sortEnabled' ? -1:0; + }, + execCommand: function (cmd) { + var table = getTableItemsByRange(this).table; + table.setAttribute("data-sort", cmd == "enablesort" ? "sortEnabled" : "sortDisabled"); + cmd == "enablesort" ? domUtils.addClass(table,"sortEnabled"):domUtils.removeClasses(table,"sortEnabled"); + } + }; +}; + + +// plugins/contextmenu.js +///import core +///commands 右键菜单 +///commandsName ContextMenu +///commandsTitle 右键菜单 +/** + * 右键菜单 + * @function + * @name baidu.editor.plugins.contextmenu + * @author zhanyi + */ + +UE.plugins['contextmenu'] = function () { + var me = this; + me.setOpt('enableContextMenu',true); + if(me.getOpt('enableContextMenu') === false){ + return; + } + var lang = me.getLang( "contextMenu" ), + menu, + items = me.options.contextMenu || [ + {label:lang['selectall'], cmdName:'selectall'}, + { + label:lang.cleardoc, + cmdName:'cleardoc', + exec:function () { + if ( confirm( lang.confirmclear ) ) { + this.execCommand( 'cleardoc' ); + } + } + }, + '-', + { + label:lang.unlink, + cmdName:'unlink' + }, + '-', + { + group:lang.paragraph, + icon:'justifyjustify', + subMenu:[ + { + label:lang.justifyleft, + cmdName:'justify', + value:'left' + }, + { + label:lang.justifyright, + cmdName:'justify', + value:'right' + }, + { + label:lang.justifycenter, + cmdName:'justify', + value:'center' + }, + { + label:lang.justifyjustify, + cmdName:'justify', + value:'justify' + } + ] + }, + '-', + { + group:lang.table, + icon:'table', + subMenu:[ + { + label:lang.inserttable, + cmdName:'inserttable' + }, + { + label:lang.deletetable, + cmdName:'deletetable' + }, + '-', + { + label:lang.deleterow, + cmdName:'deleterow' + }, + { + label:lang.deletecol, + cmdName:'deletecol' + }, + { + label:lang.insertcol, + cmdName:'insertcol' + }, + { + label:lang.insertcolnext, + cmdName:'insertcolnext' + }, + { + label:lang.insertrow, + cmdName:'insertrow' + }, + { + label:lang.insertrownext, + cmdName:'insertrownext' + }, + '-', + { + label:lang.insertcaption, + cmdName:'insertcaption' + }, + { + label:lang.deletecaption, + cmdName:'deletecaption' + }, + { + label:lang.inserttitle, + cmdName:'inserttitle' + }, + { + label:lang.deletetitle, + cmdName:'deletetitle' + }, + { + label:lang.inserttitlecol, + cmdName:'inserttitlecol' + }, + { + label:lang.deletetitlecol, + cmdName:'deletetitlecol' + }, + '-', + { + label:lang.mergecells, + cmdName:'mergecells' + }, + { + label:lang.mergeright, + cmdName:'mergeright' + }, + { + label:lang.mergedown, + cmdName:'mergedown' + }, + '-', + { + label:lang.splittorows, + cmdName:'splittorows' + }, + { + label:lang.splittocols, + cmdName:'splittocols' + }, + { + label:lang.splittocells, + cmdName:'splittocells' + }, + '-', + { + label:lang.averageDiseRow, + cmdName:'averagedistributerow' + }, + { + label:lang.averageDisCol, + cmdName:'averagedistributecol' + }, + '-', + { + label:lang.edittd, + cmdName:'edittd', + exec:function () { + if ( UE.ui['edittd'] ) { + new UE.ui['edittd']( this ); + } + this.getDialog('edittd').open(); + } + }, + { + label:lang.edittable, + cmdName:'edittable', + exec:function () { + if ( UE.ui['edittable'] ) { + new UE.ui['edittable']( this ); + } + this.getDialog('edittable').open(); + } + }, + { + label:lang.setbordervisible, + cmdName:'setbordervisible' + } + ] + }, + { + group:lang.tablesort, + icon:'tablesort', + subMenu:[ + { + label:lang.enablesort, + cmdName:'enablesort' + }, + { + label:lang.disablesort, + cmdName:'disablesort' + }, + '-', + { + label:lang.reversecurrent, + cmdName:'sorttable', + value:'reversecurrent' + }, + { + label:lang.orderbyasc, + cmdName:'sorttable', + value:'orderbyasc' + }, + { + label:lang.reversebyasc, + cmdName:'sorttable', + value:'reversebyasc' + }, + { + label:lang.orderbynum, + cmdName:'sorttable', + value:'orderbynum' + }, + { + label:lang.reversebynum, + cmdName:'sorttable', + value:'reversebynum' + } + ] + }, + { + group:lang.borderbk, + icon:'borderBack', + subMenu:[ + { + label:lang.setcolor, + cmdName:"interlacetable", + exec:function(){ + this.execCommand("interlacetable"); + } + }, + { + label:lang.unsetcolor, + cmdName:"uninterlacetable", + exec:function(){ + this.execCommand("uninterlacetable"); + } + }, + { + label:lang.setbackground, + cmdName:"settablebackground", + exec:function(){ + this.execCommand("settablebackground",{repeat:true,colorList:["#bbb","#ccc"]}); + } + }, + { + label:lang.unsetbackground, + cmdName:"cleartablebackground", + exec:function(){ + this.execCommand("cleartablebackground"); + } + }, + { + label:lang.redandblue, + cmdName:"settablebackground", + exec:function(){ + this.execCommand("settablebackground",{repeat:true,colorList:["red","blue"]}); + } + }, + { + label:lang.threecolorgradient, + cmdName:"settablebackground", + exec:function(){ + this.execCommand("settablebackground",{repeat:true,colorList:["#aaa","#bbb","#ccc"]}); + } + } + ] + }, + { + group:lang.aligntd, + icon:'aligntd', + subMenu:[ + { + cmdName:'cellalignment', + value:{align:'left',vAlign:'top'} + }, + { + cmdName:'cellalignment', + value:{align:'center',vAlign:'top'} + }, + { + cmdName:'cellalignment', + value:{align:'right',vAlign:'top'} + }, + { + cmdName:'cellalignment', + value:{align:'left',vAlign:'middle'} + }, + { + cmdName:'cellalignment', + value:{align:'center',vAlign:'middle'} + }, + { + cmdName:'cellalignment', + value:{align:'right',vAlign:'middle'} + }, + { + cmdName:'cellalignment', + value:{align:'left',vAlign:'bottom'} + }, + { + cmdName:'cellalignment', + value:{align:'center',vAlign:'bottom'} + }, + { + cmdName:'cellalignment', + value:{align:'right',vAlign:'bottom'} + } + ] + }, + { + group:lang.aligntable, + icon:'aligntable', + subMenu:[ + { + cmdName:'tablealignment', + className: 'left', + label:lang.tableleft, + value:"left" + }, + { + cmdName:'tablealignment', + className: 'center', + label:lang.tablecenter, + value:"center" + }, + { + cmdName:'tablealignment', + className: 'right', + label:lang.tableright, + value:"right" + } + ] + }, + '-', + { + label:lang.insertparagraphbefore, + cmdName:'insertparagraph', + value:true + }, + { + label:lang.insertparagraphafter, + cmdName:'insertparagraph' + }, + { + label:lang['copy'], + cmdName:'copy' + }, + { + label:lang['paste'], + cmdName:'paste' + } + ]; + if ( !items.length ) { + return; + } + var uiUtils = UE.ui.uiUtils; + + me.addListener( 'contextmenu', function ( type, evt ) { + + var offset = uiUtils.getViewportOffsetByEvent( evt ); + me.fireEvent( 'beforeselectionchange' ); + if ( menu ) { + menu.destroy(); + } + for ( var i = 0, ti, contextItems = []; ti = items[i]; i++ ) { + var last; + (function ( item ) { + if ( item == '-' ) { + if ( (last = contextItems[contextItems.length - 1 ] ) && last !== '-' ) { + contextItems.push( '-' ); + } + } else if ( item.hasOwnProperty( "group" ) ) { + for ( var j = 0, cj, subMenu = []; cj = item.subMenu[j]; j++ ) { + (function ( subItem ) { + if ( subItem == '-' ) { + if ( (last = subMenu[subMenu.length - 1 ] ) && last !== '-' ) { + subMenu.push( '-' ); + }else{ + subMenu.splice(subMenu.length-1); + } + } else { + if ( (me.commands[subItem.cmdName] || UE.commands[subItem.cmdName] || subItem.query) && + (subItem.query ? subItem.query() : me.queryCommandState( subItem.cmdName )) > -1 ) { + subMenu.push( { + 'label':subItem.label || me.getLang( "contextMenu." + subItem.cmdName + (subItem.value || '') )||"", + 'className':'edui-for-' +subItem.cmdName + ( subItem.className ? ( ' edui-for-' + subItem.cmdName + '-' + subItem.className ) : '' ), + onclick:subItem.exec ? function () { + subItem.exec.call( me ); + } : function () { + me.execCommand( subItem.cmdName, subItem.value ); + } + } ); + } + } + })( cj ); + } + if ( subMenu.length ) { + function getLabel(){ + switch (item.icon){ + case "table": + return me.getLang( "contextMenu.table" ); + case "justifyjustify": + return me.getLang( "contextMenu.paragraph" ); + case "aligntd": + return me.getLang("contextMenu.aligntd"); + case "aligntable": + return me.getLang("contextMenu.aligntable"); + case "tablesort": + return lang.tablesort; + case "borderBack": + return lang.borderbk; + default : + return ''; + } + } + contextItems.push( { + //todo 修正成自动获取方式 + 'label':getLabel(), + className:'edui-for-' + item.icon, + 'subMenu':{ + items:subMenu, + editor:me + } + } ); + } + + } else { + //有可能commmand没有加载右键不能出来,或者没有command也想能展示出来添加query方法 + if ( (me.commands[item.cmdName] || UE.commands[item.cmdName] || item.query) && + (item.query ? item.query.call(me) : me.queryCommandState( item.cmdName )) > -1 ) { + + contextItems.push( { + 'label':item.label || me.getLang( "contextMenu." + item.cmdName ), + className:'edui-for-' + (item.icon ? item.icon : item.cmdName + (item.value || '')), + onclick:item.exec ? function () { + item.exec.call( me ); + } : function () { + me.execCommand( item.cmdName, item.value ); + } + } ); + } + + } + + })( ti ); + } + if ( contextItems[contextItems.length - 1] == '-' ) { + contextItems.pop(); + } + + menu = new UE.ui.Menu( { + items:contextItems, + className:"edui-contextmenu", + editor:me + } ); + menu.render(); + menu.showAt( offset ); + + me.fireEvent("aftershowcontextmenu",menu); + + domUtils.preventDefault( evt ); + if ( browser.ie ) { + var ieRange; + try { + ieRange = me.selection.getNative().createRange(); + } catch ( e ) { + return; + } + if ( ieRange.item ) { + var range = new dom.Range( me.document ); + range.selectNode( ieRange.item( 0 ) ).select( true, true ); + } + } + }); + + // 添加复制的flash按钮 + me.addListener('aftershowcontextmenu', function(type, menu) { + if (me.zeroclipboard) { + var items = menu.items; + for (var key in items) { + if (items[key].className == 'edui-for-copy') { + me.zeroclipboard.clip(items[key].getDom()); + } + } + } + }); + +}; + + +// plugins/shortcutmenu.js +///import core +///commands 弹出菜单 +// commandsName popupmenu +///commandsTitle 弹出菜单 +/** + * 弹出菜单 + * @function + * @name baidu.editor.plugins.popupmenu + * @author xuheng + */ + +UE.plugins['shortcutmenu'] = function () { + var me = this, + menu, + items = me.options.shortcutMenu || []; + + if (!items.length) { + return; + } + + me.addListener ('contextmenu mouseup' , function (type , e) { + var me = this, + customEvt = { + type : type , + target : e.target || e.srcElement , + screenX : e.screenX , + screenY : e.screenY , + clientX : e.clientX , + clientY : e.clientY + }; + + setTimeout (function () { + var rng = me.selection.getRange (); + if (rng.collapsed === false || type == "contextmenu") { + + if (!menu) { + menu = new baidu.editor.ui.ShortCutMenu ({ + editor : me , + items : items , + theme : me.options.theme , + className : 'edui-shortcutmenu' + }); + + menu.render (); + me.fireEvent ("afterrendershortcutmenu" , menu); + } + + menu.show (customEvt , !!UE.plugins['contextmenu']); + } + }); + + if (type == 'contextmenu') { + domUtils.preventDefault (e); + if (browser.ie9below) { + var ieRange; + try { + ieRange = me.selection.getNative().createRange(); + } catch (e) { + return; + } + if (ieRange.item) { + var range = new dom.Range (me.document); + range.selectNode (ieRange.item (0)).select (true , true); + + } + } + } + }); + + me.addListener ('keydown' , function (type) { + if (type == "keydown") { + menu && !menu.isHidden && menu.hide (); + } + + }); + +}; + + + + +// plugins/basestyle.js +/** + * B、I、sub、super命令支持 + * @file + * @since 1.2.6.1 + */ + +UE.plugins['basestyle'] = function(){ + + /** + * 字体加粗 + * @command bold + * @param { String } cmd 命令字符串 + * @remind 对已加粗的文本内容执行该命令, 将取消加粗 + * @method execCommand + * @example + * ```javascript + * //editor是编辑器实例 + * //对当前选中的文本内容执行加粗操作 + * //第一次执行, 文本内容加粗 + * editor.execCommand( 'bold' ); + * + * //第二次执行, 文本内容取消加粗 + * editor.execCommand( 'bold' ); + * ``` + */ + + + /** + * 字体倾斜 + * @command italic + * @method execCommand + * @param { String } cmd 命令字符串 + * @remind 对已倾斜的文本内容执行该命令, 将取消倾斜 + * @example + * ```javascript + * //editor是编辑器实例 + * //对当前选中的文本内容执行斜体操作 + * //第一次操作, 文本内容将变成斜体 + * editor.execCommand( 'italic' ); + * + * //再次对同一文本内容执行, 则文本内容将恢复正常 + * editor.execCommand( 'italic' ); + * ``` + */ + + /** + * 下标文本,与“superscript”命令互斥 + * @command subscript + * @method execCommand + * @remind 把选中的文本内容切换成下标文本, 如果当前选中的文本已经是下标, 则该操作会把文本内容还原成正常文本 + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * //editor是编辑器实例 + * //对当前选中的文本内容执行下标操作 + * //第一次操作, 文本内容将变成下标文本 + * editor.execCommand( 'subscript' ); + * + * //再次对同一文本内容执行, 则文本内容将恢复正常 + * editor.execCommand( 'subscript' ); + * ``` + */ + + /** + * 上标文本,与“subscript”命令互斥 + * @command superscript + * @method execCommand + * @remind 把选中的文本内容切换成上标文本, 如果当前选中的文本已经是上标, 则该操作会把文本内容还原成正常文本 + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * //editor是编辑器实例 + * //对当前选中的文本内容执行上标操作 + * //第一次操作, 文本内容将变成上标文本 + * editor.execCommand( 'superscript' ); + * + * //再次对同一文本内容执行, 则文本内容将恢复正常 + * editor.execCommand( 'superscript' ); + * ``` + */ + var basestyles = { + 'bold':['strong','b'], + 'italic':['em','i'], + 'subscript':['sub'], + 'superscript':['sup'] + }, + getObj = function(editor,tagNames){ + return domUtils.filterNodeList(editor.selection.getStartElementPath(),tagNames); + }, + me = this; + //添加快捷键 + me.addshortcutkey({ + "Bold" : "ctrl+66",//^B + "Italic" : "ctrl+73", //^I + "Underline" : "ctrl+85"//^U + }); + me.addInputRule(function(root){ + utils.each(root.getNodesByTagName('b i'),function(node){ + switch (node.tagName){ + case 'b': + node.tagName = 'strong'; + break; + case 'i': + node.tagName = 'em'; + } + }); + }); + for ( var style in basestyles ) { + (function( cmd, tagNames ) { + me.commands[cmd] = { + execCommand : function( cmdName ) { + var range = me.selection.getRange(),obj = getObj(this,tagNames); + if ( range.collapsed ) { + if ( obj ) { + var tmpText = me.document.createTextNode(''); + range.insertNode( tmpText ).removeInlineStyle( tagNames ); + range.setStartBefore(tmpText); + domUtils.remove(tmpText); + } else { + var tmpNode = range.document.createElement( tagNames[0] ); + if(cmdName == 'superscript' || cmdName == 'subscript'){ + tmpText = me.document.createTextNode(''); + range.insertNode(tmpText) + .removeInlineStyle(['sub','sup']) + .setStartBefore(tmpText) + .collapse(true); + } + range.insertNode( tmpNode ).setStart( tmpNode, 0 ); + } + range.collapse( true ); + } else { + if(cmdName == 'superscript' || cmdName == 'subscript'){ + if(!obj || obj.tagName.toLowerCase() != cmdName){ + range.removeInlineStyle(['sub','sup']); + } + } + obj ? range.removeInlineStyle( tagNames ) : range.applyInlineStyle( tagNames[0] ); + } + range.select(); + }, + queryCommandState : function() { + return getObj(this,tagNames) ? 1 : 0; + } + }; + })( style, basestyles[style] ); + } +}; + + + +// plugins/elementpath.js +/** + * 选取路径命令 + * @file + */ +UE.plugins['elementpath'] = function(){ + var currentLevel, + tagNames, + me = this; + me.setOpt('elementPathEnabled',true); + if(!me.options.elementPathEnabled){ + return; + } + me.commands['elementpath'] = { + execCommand : function( cmdName, level ) { + var start = tagNames[level], + range = me.selection.getRange(); + currentLevel = level*1; + range.selectNode(start).select(); + }, + queryCommandValue : function() { + //产生一个副本,不能修改原来的startElementPath; + var parents = [].concat(this.selection.getStartElementPath()).reverse(), + names = []; + tagNames = parents; + for(var i=0,ci;ci=parents[i];i++){ + if(ci.nodeType == 3) { + continue; + } + var name = ci.tagName.toLowerCase(); + if(name == 'img' && ci.getAttribute('anchorname')){ + name = 'anchor'; + } + names[i] = name; + if(currentLevel == i){ + currentLevel = -1; + break; + } + } + return names; + } + }; +}; + + + +// plugins/formatmatch.js +/** + * 格式刷,只格式inline的 + * @file + * @since 1.2.6.1 + */ + +/** + * 格式刷 + * @command formatmatch + * @method execCommand + * @remind 该操作不能复制段落格式 + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * //editor是编辑器实例 + * //获取格式刷 + * editor.execCommand( 'formatmatch' ); + * ``` + */ +UE.plugins['formatmatch'] = function(){ + + var me = this, + list = [],img, + flag = 0; + + me.addListener('reset',function(){ + list = []; + flag = 0; + }); + + function addList(type,evt){ + + if(browser.webkit){ + var target = evt.target.tagName == 'IMG' ? evt.target : null; + } + + function addFormat(range){ + + if(text){ + range.selectNode(text); + } + return range.applyInlineStyle(list[list.length-1].tagName,null,list); + + } + + me.undoManger && me.undoManger.save(); + + var range = me.selection.getRange(), + imgT = target || range.getClosedNode(); + if(img && imgT && imgT.tagName == 'IMG'){ + //trace:964 + + imgT.style.cssText += ';float:' + (img.style.cssFloat || img.style.styleFloat ||'none') + ';display:' + (img.style.display||'inline'); + + img = null; + }else{ + if(!img){ + var collapsed = range.collapsed; + if(collapsed){ + var text = me.document.createTextNode('match'); + range.insertNode(text).select(); + + + } + me.__hasEnterExecCommand = true; + //不能把block上的属性干掉 + //trace:1553 + var removeFormatAttributes = me.options.removeFormatAttributes; + me.options.removeFormatAttributes = ''; + me.execCommand('removeformat'); + me.options.removeFormatAttributes = removeFormatAttributes; + me.__hasEnterExecCommand = false; + //trace:969 + range = me.selection.getRange(); + if(list.length){ + addFormat(range); + } + if(text){ + range.setStartBefore(text).collapse(true); + + } + range.select(); + text && domUtils.remove(text); + } + + } + + + + + me.undoManger && me.undoManger.save(); + me.removeListener('mouseup',addList); + flag = 0; + } + + me.commands['formatmatch'] = { + execCommand : function( cmdName ) { + + if(flag){ + flag = 0; + list = []; + me.removeListener('mouseup',addList); + return; + } + + + + var range = me.selection.getRange(); + img = range.getClosedNode(); + if(!img || img.tagName != 'IMG'){ + range.collapse(true).shrinkBoundary(); + var start = range.startContainer; + list = domUtils.findParents(start,true,function(node){ + return !domUtils.isBlockElm(node) && node.nodeType == 1; + }); + //a不能加入格式刷, 并且克隆节点 + for(var i=0,ci;ci=list[i];i++){ + if(ci.tagName == 'A'){ + list.splice(i,1); + break; + } + } + + } + + me.addListener('mouseup',addList); + flag = 1; + + + }, + queryCommandState : function() { + return flag; + }, + notNeedUndo : 1 + }; +}; + + + +// plugins/searchreplace.js +///import core +///commands 查找替换 +///commandsName SearchReplace +///commandsTitle 查询替换 +///commandsDialog dialogs\searchreplace +/** + * @description 查找替换 + * @author zhanyi + */ + +UE.plugin.register('searchreplace',function(){ + var me = this; + + var _blockElm = {'table':1,'tbody':1,'tr':1,'ol':1,'ul':1}; + + function findTextInString(textContent,opt,currentIndex){ + var str = opt.searchStr; + if(opt.dir == -1){ + textContent = textContent.split('').reverse().join(''); + str = str.split('').reverse().join(''); + currentIndex = textContent.length - currentIndex; + + } + var reg = new RegExp(str,'g' + (opt.casesensitive ? '' : 'i')),match; + + while(match = reg.exec(textContent)){ + if(match.index >= currentIndex){ + return opt.dir == -1 ? textContent.length - match.index - opt.searchStr.length : match.index; + } + } + return -1 + } + function findTextBlockElm(node,currentIndex,opt){ + var textContent,index,methodName = opt.all || opt.dir == 1 ? 'getNextDomNode' : 'getPreDomNode'; + if(domUtils.isBody(node)){ + node = node.firstChild; + } + var first = 1; + while(node){ + textContent = node.nodeType == 3 ? node.nodeValue : node[browser.ie ? 'innerText' : 'textContent']; + index = findTextInString(textContent,opt,currentIndex ); + first = 0; + if(index!=-1){ + return { + 'node':node, + 'index':index + } + } + node = domUtils[methodName](node); + while(node && _blockElm[node.nodeName.toLowerCase()]){ + node = domUtils[methodName](node,true); + } + if(node){ + currentIndex = opt.dir == -1 ? (node.nodeType == 3 ? node.nodeValue : node[browser.ie ? 'innerText' : 'textContent']).length : 0; + } + + } + } + function findNTextInBlockElm(node,index,str){ + var currentIndex = 0, + currentNode = node.firstChild, + currentNodeLength = 0, + result; + while(currentNode){ + if(currentNode.nodeType == 3){ + currentNodeLength = currentNode.nodeValue.replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,'').length; + currentIndex += currentNodeLength; + if(currentIndex >= index){ + return { + 'node':currentNode, + 'index': currentNodeLength - (currentIndex - index) + } + } + }else if(!dtd.$empty[currentNode.tagName]){ + currentNodeLength = currentNode[browser.ie ? 'innerText' : 'textContent'].replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,'').length + currentIndex += currentNodeLength; + if(currentIndex >= index){ + result = findNTextInBlockElm(currentNode,currentNodeLength - (currentIndex - index),str); + if(result){ + return result; + } + } + } + currentNode = domUtils.getNextDomNode(currentNode); + + } + } + + function searchReplace(me,opt){ + + var rng = me.selection.getRange(), + startBlockNode, + searchStr = opt.searchStr, + span = me.document.createElement('span'); + span.innerHTML = '$$ueditor_searchreplace_key$$'; + + rng.shrinkBoundary(true); + + //判断是不是第一次选中 + if(!rng.collapsed){ + rng.select(); + var rngText = me.selection.getText(); + if(new RegExp('^' + opt.searchStr + '$',(opt.casesensitive ? '' : 'i')).test(rngText)){ + if(opt.replaceStr != undefined){ + replaceText(rng,opt.replaceStr); + rng.select(); + return true; + }else{ + rng.collapse(opt.dir == -1) + } + + } + } + + + rng.insertNode(span); + rng.enlargeToBlockElm(true); + startBlockNode = rng.startContainer; + var currentIndex = startBlockNode[browser.ie ? 'innerText' : 'textContent'].indexOf('$$ueditor_searchreplace_key$$'); + rng.setStartBefore(span); + domUtils.remove(span); + var result = findTextBlockElm(startBlockNode,currentIndex,opt); + if(result){ + var rngStart = findNTextInBlockElm(result.node,result.index,searchStr); + var rngEnd = findNTextInBlockElm(result.node,result.index + searchStr.length,searchStr); + rng.setStart(rngStart.node,rngStart.index).setEnd(rngEnd.node,rngEnd.index); + + if(opt.replaceStr !== undefined){ + replaceText(rng,opt.replaceStr) + } + rng.select(); + return true; + }else{ + rng.setCursor() + } + + } + function replaceText(rng,str){ + + str = me.document.createTextNode(str); + rng.deleteContents().insertNode(str); + + } + return { + commands:{ + 'searchreplace':{ + execCommand:function(cmdName,opt){ + utils.extend(opt,{ + all : false, + casesensitive : false, + dir : 1 + },true); + var num = 0; + if(opt.all){ + + var rng = me.selection.getRange(), + first = me.body.firstChild; + if(first && first.nodeType == 1){ + rng.setStart(first,0); + rng.shrinkBoundary(true); + }else if(first.nodeType == 3){ + rng.setStartBefore(first) + } + rng.collapse(true).select(true); + if(opt.replaceStr !== undefined){ + me.fireEvent('saveScene'); + } + while(searchReplace(this,opt)){ + num++; + } + if(num){ + me.fireEvent('saveScene'); + } + }else{ + if(opt.replaceStr !== undefined){ + me.fireEvent('saveScene'); + } + if(searchReplace(this,opt)){ + num++ + } + if(num){ + me.fireEvent('saveScene'); + } + + } + + return num; + }, + notNeedUndo:1 + } + } + } +}); + +// plugins/customstyle.js +/** + * 自定义样式 + * @file + * @since 1.2.6.1 + */ + +/** + * 根据config配置文件里“customstyle”选项的值对匹配的标签执行样式替换。 + * @command customstyle + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand( 'customstyle' ); + * ``` + */ +UE.plugins['customstyle'] = function() { + var me = this; + me.setOpt({ 'customstyle':[ + {tag:'h1',name:'tc', style:'font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;'}, + {tag:'h1',name:'tl', style:'font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:left;margin:0 0 10px 0;'}, + {tag:'span',name:'im', style:'font-size:16px;font-style:italic;font-weight:bold;line-height:18px;'}, + {tag:'span',name:'hi', style:'font-size:16px;font-style:italic;font-weight:bold;color:rgb(51, 153, 204);line-height:18px;'} + ]}); + me.commands['customstyle'] = { + execCommand : function(cmdName, obj) { + var me = this, + tagName = obj.tag, + node = domUtils.findParent(me.selection.getStart(), function(node) { + return node.getAttribute('label'); + }, true), + range,bk,tmpObj = {}; + for (var p in obj) { + if(obj[p]!==undefined) + tmpObj[p] = obj[p]; + } + delete tmpObj.tag; + if (node && node.getAttribute('label') == obj.label) { + range = this.selection.getRange(); + bk = range.createBookmark(); + if (range.collapsed) { + //trace:1732 删掉自定义标签,要有p来回填站位 + if(dtd.$block[node.tagName]){ + var fillNode = me.document.createElement('p'); + domUtils.moveChild(node, fillNode); + node.parentNode.insertBefore(fillNode, node); + domUtils.remove(node); + }else{ + domUtils.remove(node,true); + } + + } else { + + var common = domUtils.getCommonAncestor(bk.start, bk.end), + nodes = domUtils.getElementsByTagName(common, tagName); + if(new RegExp(tagName,'i').test(common.tagName)){ + nodes.push(common); + } + for (var i = 0,ni; ni = nodes[i++];) { + if (ni.getAttribute('label') == obj.label) { + var ps = domUtils.getPosition(ni, bk.start),pe = domUtils.getPosition(ni, bk.end); + if ((ps & domUtils.POSITION_FOLLOWING || ps & domUtils.POSITION_CONTAINS) + && + (pe & domUtils.POSITION_PRECEDING || pe & domUtils.POSITION_CONTAINS) + ) + if (dtd.$block[tagName]) { + var fillNode = me.document.createElement('p'); + domUtils.moveChild(ni, fillNode); + ni.parentNode.insertBefore(fillNode, ni); + } + domUtils.remove(ni, true); + } + } + node = domUtils.findParent(common, function(node) { + return node.getAttribute('label') == obj.label; + }, true); + if (node) { + + domUtils.remove(node, true); + + } + + } + range.moveToBookmark(bk).select(); + } else { + if (dtd.$block[tagName]) { + this.execCommand('paragraph', tagName, tmpObj,'customstyle'); + range = me.selection.getRange(); + if (!range.collapsed) { + range.collapse(); + node = domUtils.findParent(me.selection.getStart(), function(node) { + return node.getAttribute('label') == obj.label; + }, true); + var pNode = me.document.createElement('p'); + domUtils.insertAfter(node, pNode); + domUtils.fillNode(me.document, pNode); + range.setStart(pNode, 0).setCursor(); + } + } else { + + range = me.selection.getRange(); + if (range.collapsed) { + node = me.document.createElement(tagName); + domUtils.setAttributes(node, tmpObj); + range.insertNode(node).setStart(node, 0).setCursor(); + + return; + } + + bk = range.createBookmark(); + range.applyInlineStyle(tagName, tmpObj).moveToBookmark(bk).select(); + } + } + + }, + queryCommandValue : function() { + var parent = domUtils.filterNodeList( + this.selection.getStartElementPath(), + function(node){return node.getAttribute('label')} + ); + return parent ? parent.getAttribute('label') : ''; + } + }; + //当去掉customstyle是,如果是块元素,用p代替 + me.addListener('keyup', function(type, evt) { + var keyCode = evt.keyCode || evt.which; + + if (keyCode == 32 || keyCode == 13) { + var range = me.selection.getRange(); + if (range.collapsed) { + var node = domUtils.findParent(me.selection.getStart(), function(node) { + return node.getAttribute('label'); + }, true); + if (node && dtd.$block[node.tagName] && domUtils.isEmptyNode(node)) { + var p = me.document.createElement('p'); + domUtils.insertAfter(node, p); + domUtils.fillNode(me.document, p); + domUtils.remove(node); + range.setStart(p, 0).setCursor(); + + + } + } + } + }); +}; + +// plugins/catchremoteimage.js +///import core +///commands 远程图片抓取 +///commandsName catchRemoteImage,catchremoteimageenable +///commandsTitle 远程图片抓取 +/** + * 远程图片抓取,当开启本插件时所有不符合本地域名的图片都将被抓取成为本地服务器上的图片 + */ +UE.plugins['catchremoteimage'] = function () { + var me = this, + ajax = UE.ajax; + + /* 设置默认值 */ + if (me.options.catchRemoteImageEnable === false) return; + me.setOpt({ + catchRemoteImageEnable: false + }); + + me.addListener("afterpaste", function () { + me.fireEvent("catchRemoteImage"); + }); + + me.addListener("catchRemoteImage", function () { + + var catcherLocalDomain = me.getOpt('catcherLocalDomain'), + catcherActionUrl = me.getActionUrl(me.getOpt('catcherActionName')), + catcherUrlPrefix = me.getOpt('catcherUrlPrefix'), + catcherFieldName = me.getOpt('catcherFieldName'); + + var remoteImages = [], + imgs = domUtils.getElementsByTagName(me.document, "img"), + test = function (src, urls) { + if (src.indexOf(location.host) != -1 || /(^\.)|(^\/)/.test(src)) { + return true; + } + if (urls) { + for (var j = 0, url; url = urls[j++];) { + if (src.indexOf(url) !== -1) { + return true; + } + } + } + return false; + }; + + for (var i = 0, ci; ci = imgs[i++];) { + if (ci.getAttribute("word_img")) { + continue; + } + var src = ci.getAttribute("_src") || ci.src || ""; + if (/^(https?|ftp):/i.test(src) && !test(src, catcherLocalDomain)) { + remoteImages.push(src); + } + } + + if (remoteImages.length) { + catchremoteimage(remoteImages, { + //成功抓取 + success: function (r) { + try { + var info = r.state !== undefined ? r:eval("(" + r.responseText + ")"); + } catch (e) { + return; + } + + /* 获取源路径和新路径 */ + var i, j, ci, cj, oldSrc, newSrc, list = info.list; + + for (i = 0; ci = imgs[i++];) { + oldSrc = ci.getAttribute("_src") || ci.src || ""; + for (j = 0; cj = list[j++];) { + if (oldSrc == cj.source && cj.state == "SUCCESS") { //抓取失败时不做替换处理 + newSrc = catcherUrlPrefix + cj.url; + domUtils.setAttributes(ci, { + "src": newSrc, + "_src": newSrc + }); + break; + } + } + } + me.fireEvent('catchremotesuccess') + }, + //回调失败,本次请求超时 + error: function () { + me.fireEvent("catchremoteerror"); + } + }); + } + + function catchremoteimage(imgs, callbacks) { + var params = utils.serializeParam(me.queryCommandValue('serverparam')) || '', + url = utils.formatUrl(catcherActionUrl + (catcherActionUrl.indexOf('?') == -1 ? '?':'&') + params), + isJsonp = utils.isCrossDomainUrl(url), + opt = { + 'method': 'POST', + 'dataType': isJsonp ? 'jsonp':'', + 'timeout': 60000, //单位:毫秒,回调请求超时设置。目标用户如果网速不是很快的话此处建议设置一个较大的数值 + 'onsuccess': callbacks["success"], + 'onerror': callbacks["error"] + }; + opt[catcherFieldName] = imgs; + ajax.request(url, opt); + } + + }); +}; + +// plugins/snapscreen.js +/** + * 截屏插件,为UEditor提供插入支持 + * @file + * @since 1.4.2 + */ +UE.plugin.register('snapscreen', function (){ + + var me = this; + var snapplugin; + + function getLocation(url){ + var search, + a = document.createElement('a'), + params = utils.serializeParam(me.queryCommandValue('serverparam')) || ''; + + a.href = url; + if (browser.ie) { + a.href = a.href; + } + + + search = a.search; + if (params) { + search = search + (search.indexOf('?') == -1 ? '?':'&')+ params; + search = search.replace(/[&]+/ig, '&'); + } + return { + 'port': a.port, + 'hostname': a.hostname, + 'path': a.pathname + search || + a.hash + } + } + + return { + commands:{ + /** + * 字体背景颜色 + * @command snapscreen + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand('snapscreen'); + * ``` + */ + 'snapscreen':{ + execCommand:function (cmd) { + var url, local, res; + var lang = me.getLang("snapScreen_plugin"); + + if(!snapplugin){ + var container = me.container; + var doc = me.container.ownerDocument || me.container.document; + snapplugin = doc.createElement("object"); + try{snapplugin.type = "application/x-pluginbaidusnap";}catch(e){ + return; + } + snapplugin.style.cssText = "position:absolute;left:-9999px;width:0;height:0;"; + snapplugin.setAttribute("width","0"); + snapplugin.setAttribute("height","0"); + container.appendChild(snapplugin); + } + + function onSuccess(rs){ + try{ + rs = eval("("+ rs +")"); + if(rs.state == 'SUCCESS'){ + var opt = me.options; + me.execCommand('insertimage', { + src: opt.snapscreenUrlPrefix + rs.url, + _src: opt.snapscreenUrlPrefix + rs.url, + alt: rs.title || '', + floatStyle: opt.snapscreenImgAlign + }); + } else { + alert(rs.state); + } + }catch(e){ + alert(lang.callBackErrorMsg); + } + } + url = me.getActionUrl(me.getOpt('snapscreenActionName')); + local = getLocation(url); + setTimeout(function () { + try{ + res =snapplugin.saveSnapshot(local.hostname, local.path, local.port); + }catch(e){ + me.ui._dialogs['snapscreenDialog'].open(); + return; + } + + onSuccess(res); + }, 50); + }, + queryCommandState: function(){ + return (navigator.userAgent.indexOf("Windows",0) != -1) ? 0:-1; + } + } + } + } +}); + + +// plugins/insertparagraph.js +/** + * 插入段落 + * @file + * @since 1.2.6.1 + */ + + +/** + * 插入段落 + * @command insertparagraph + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * //editor是编辑器实例 + * editor.execCommand( 'insertparagraph' ); + * ``` + */ + +UE.commands['insertparagraph'] = { + execCommand : function( cmdName,front) { + var me = this, + range = me.selection.getRange(), + start = range.startContainer,tmpNode; + while(start ){ + if(domUtils.isBody(start)){ + break; + } + tmpNode = start; + start = start.parentNode; + } + if(tmpNode){ + var p = me.document.createElement('p'); + if(front){ + tmpNode.parentNode.insertBefore(p,tmpNode) + }else{ + tmpNode.parentNode.insertBefore(p,tmpNode.nextSibling) + } + domUtils.fillNode(me.document,p); + range.setStart(p,0).setCursor(false,true); + } + } +}; + + + +// plugins/webapp.js +/** + * 百度应用 + * @file + * @since 1.2.6.1 + */ + + +/** + * 插入百度应用 + * @command webapp + * @method execCommand + * @remind 需要百度APPKey + * @remind 百度应用主页: http://app.baidu.com/ + * @param { Object } appOptions 应用所需的参数项, 支持的key有: title=>应用标题, width=>应用容器宽度, + * height=>应用容器高度,logo=>应用logo,url=>应用地址 + * @example + * ```javascript + * //editor是编辑器实例 + * //在编辑器里插入一个“植物大战僵尸”的APP + * editor.execCommand( 'webapp' , { + * title: '植物大战僵尸', + * width: 560, + * height: 465, + * logo: '应用展示的图片', + * url: '百度应用的地址' + * } ); + * ``` + */ + +//UE.plugins['webapp'] = function () { +// var me = this; +// function createInsertStr( obj, toIframe, addParagraph ) { +// return !toIframe ? +// (addParagraph ? '

    ' : '') + '' + +// (addParagraph ? '

    ' : '') +// : +// ''; +// } +// +// function switchImgAndIframe( img2frame ) { +// var tmpdiv, +// nodes = domUtils.getElementsByTagName( me.document, !img2frame ? "iframe" : "img" ); +// for ( var i = 0, node; node = nodes[i++]; ) { +// if ( node.className != "edui-faked-webapp" ){ +// continue; +// } +// tmpdiv = me.document.createElement( "div" ); +// tmpdiv.innerHTML = createInsertStr( img2frame ? {url:node.getAttribute( "_url" ), width:node.width, height:node.height,title:node.title,logo:node.style.backgroundImage.replace("url(","").replace(")","")} : {url:node.getAttribute( "src", 2 ),title:node.title, width:node.width, height:node.height,logo:node.getAttribute("logo_url")}, img2frame ? true : false,false ); +// node.parentNode.replaceChild( tmpdiv.firstChild, node ); +// } +// } +// +// me.addListener( "beforegetcontent", function () { +// switchImgAndIframe( true ); +// } ); +// me.addListener( 'aftersetcontent', function () { +// switchImgAndIframe( false ); +// } ); +// me.addListener( 'aftergetcontent', function ( cmdName ) { +// if ( cmdName == 'aftergetcontent' && me.queryCommandState( 'source' ) ){ +// return; +// } +// switchImgAndIframe( false ); +// } ); +// +// me.commands['webapp'] = { +// execCommand:function ( cmd, obj ) { +// me.execCommand( "inserthtml", createInsertStr( obj, false,true ) ); +// } +// }; +//}; + +UE.plugin.register('webapp', function (){ + var me = this; + function createInsertStr(obj,toEmbed){ + return !toEmbed ? + '' + : + '' + + } + return { + outputRule: function(root){ + utils.each(root.getNodesByTagName('img'),function(node){ + var html; + if(node.getAttr('class') == 'edui-faked-webapp'){ + html = createInsertStr({ + title:node.getAttr('title'), + 'width':node.getAttr('width'), + 'height':node.getAttr('height'), + 'align':node.getAttr('align'), + 'cssfloat':node.getStyle('float'), + 'url':node.getAttr("_url"), + 'logo':node.getAttr('_logo_url') + },true); + var embed = UE.uNode.createElement(html); + node.parentNode.replaceChild(embed,node); + } + }) + }, + inputRule:function(root){ + utils.each(root.getNodesByTagName('iframe'),function(node){ + if(node.getAttr('class') == 'edui-faked-webapp'){ + var img = UE.uNode.createElement(createInsertStr({ + title:node.getAttr('title'), + 'width':node.getAttr('width'), + 'height':node.getAttr('height'), + 'align':node.getAttr('align'), + 'cssfloat':node.getStyle('float'), + 'url':node.getAttr("src"), + 'logo':node.getAttr('logo_url') + })); + node.parentNode.replaceChild(img,node); + } + }) + + }, + commands:{ + /** + * 插入百度应用 + * @command webapp + * @method execCommand + * @remind 需要百度APPKey + * @remind 百度应用主页: http://app.baidu.com/ + * @param { Object } appOptions 应用所需的参数项, 支持的key有: title=>应用标题, width=>应用容器宽度, + * height=>应用容器高度,logo=>应用logo,url=>应用地址 + * @example + * ```javascript + * //editor是编辑器实例 + * //在编辑器里插入一个“植物大战僵尸”的APP + * editor.execCommand( 'webapp' , { + * title: '植物大战僵尸', + * width: 560, + * height: 465, + * logo: '应用展示的图片', + * url: '百度应用的地址' + * } ); + * ``` + */ + 'webapp':{ + execCommand:function (cmd, obj) { + + var me = this, + str = createInsertStr(utils.extend(obj,{ + align:'none' + }), false); + me.execCommand("inserthtml",str); + }, + queryCommandState:function () { + var me = this, + img = me.selection.getRange().getClosedNode(), + flag = img && (img.className == "edui-faked-webapp"); + return flag ? 1 : 0; + } + } + } + } +}); + +// plugins/template.js +///import core +///import plugins\inserthtml.js +///import plugins\cleardoc.js +///commands 模板 +///commandsName template +///commandsTitle 模板 +///commandsDialog dialogs\template +UE.plugins['template'] = function () { + UE.commands['template'] = { + execCommand:function (cmd, obj) { + obj.html && this.execCommand("inserthtml", obj.html); + } + }; + this.addListener("click", function (type, evt) { + var el = evt.target || evt.srcElement, + range = this.selection.getRange(); + var tnode = domUtils.findParent(el, function (node) { + if (node.className && domUtils.hasClass(node, "ue_t")) { + return node; + } + }, true); + tnode && range.selectNode(tnode).shrinkBoundary().select(); + }); + this.addListener("keydown", function (type, evt) { + var range = this.selection.getRange(); + if (!range.collapsed) { + if (!evt.ctrlKey && !evt.metaKey && !evt.shiftKey && !evt.altKey) { + var tnode = domUtils.findParent(range.startContainer, function (node) { + if (node.className && domUtils.hasClass(node, "ue_t")) { + return node; + } + }, true); + if (tnode) { + domUtils.removeClasses(tnode, ["ue_t"]); + } + } + } + }); +}; + + +// plugins/music.js +/** + * 插入音乐命令 + * @file + */ +UE.plugin.register('music', function (){ + var me = this; + function creatInsertStr(url,width,height,align,cssfloat,toEmbed){ + return !toEmbed ? + '' + : + ''; + } + return { + outputRule: function(root){ + utils.each(root.getNodesByTagName('img'),function(node){ + var html; + if(node.getAttr('class') == 'edui-faked-music'){ + var cssfloat = node.getStyle('float'); + var align = node.getAttr('align'); + html = creatInsertStr(node.getAttr("_url"), node.getAttr('width'), node.getAttr('height'), align, cssfloat, true); + var embed = UE.uNode.createElement(html); + node.parentNode.replaceChild(embed,node); + } + }) + }, + inputRule:function(root){ + utils.each(root.getNodesByTagName('embed'),function(node){ + if(node.getAttr('class') == 'edui-faked-music'){ + var cssfloat = node.getStyle('float'); + var align = node.getAttr('align'); + html = creatInsertStr(node.getAttr("src"), node.getAttr('width'), node.getAttr('height'), align, cssfloat,false); + var img = UE.uNode.createElement(html); + node.parentNode.replaceChild(img,node); + } + }) + + }, + commands:{ + /** + * 插入音乐 + * @command music + * @method execCommand + * @param { Object } musicOptions 插入音乐的参数项, 支持的key有: url=>音乐地址; + * width=>音乐容器宽度;height=>音乐容器高度;align=>音乐文件的对齐方式, 可选值有: left, center, right, none + * @example + * ```javascript + * //editor是编辑器实例 + * //在编辑器里插入一个“植物大战僵尸”的APP + * editor.execCommand( 'music' , { + * width: 400, + * height: 95, + * align: "center", + * url: "音乐地址" + * } ); + * ``` + */ + 'music':{ + execCommand:function (cmd, musicObj) { + var me = this, + str = creatInsertStr(musicObj.url, musicObj.width || 400, musicObj.height || 95, "none", false); + me.execCommand("inserthtml",str); + }, + queryCommandState:function () { + var me = this, + img = me.selection.getRange().getClosedNode(), + flag = img && (img.className == "edui-faked-music"); + return flag ? 1 : 0; + } + } + } + } +}); + +// plugins/autoupload.js +/** + * @description + * 1.拖放文件到编辑区域,自动上传并插入到选区 + * 2.插入粘贴板的图片,自动上传并插入到选区 + * @author Jinqn + * @date 2013-10-14 + */ +UE.plugin.register('autoupload', function (){ + + function sendAndInsertFile(file, editor) { + var me = editor; + //模拟数据 + var fieldName, urlPrefix, maxSize, allowFiles, actionUrl, + loadingHtml, errorHandler, successHandler, + filetype = /image\/\w+/i.test(file.type) ? 'image':'file', + loadingId = 'loading_' + (+new Date()).toString(36); + + fieldName = me.getOpt(filetype + 'FieldName'); + urlPrefix = me.getOpt(filetype + 'UrlPrefix'); + maxSize = me.getOpt(filetype + 'MaxSize'); + allowFiles = me.getOpt(filetype + 'AllowFiles'); + actionUrl = me.getActionUrl(me.getOpt(filetype + 'ActionName')); + errorHandler = function(title) { + var loader = me.document.getElementById(loadingId); + loader && domUtils.remove(loader); + me.fireEvent('showmessage', { + 'id': loadingId, + 'content': title, + 'type': 'error', + 'timeout': 4000 + }); + }; + + if (filetype == 'image') { + loadingHtml = ''; + successHandler = function(data) { + var link = urlPrefix + data.url, + loader = me.document.getElementById(loadingId); + if (loader) { + loader.setAttribute('src', link); + loader.setAttribute('_src', link); + loader.setAttribute('title', data.title || ''); + loader.setAttribute('alt', data.original || ''); + loader.removeAttribute('id'); + domUtils.removeClasses(loader, 'loadingclass'); + } + }; + } else { + loadingHtml = '

    ' + + '' + + '

    '; + successHandler = function(data) { + var link = urlPrefix + data.url, + loader = me.document.getElementById(loadingId); + + var rng = me.selection.getRange(), + bk = rng.createBookmark(); + rng.selectNode(loader).select(); + me.execCommand('insertfile', {'url': link}); + rng.moveToBookmark(bk).select(); + }; + } + + /* 插入loading的占位符 */ + me.execCommand('inserthtml', loadingHtml); + + /* 判断后端配置是否没有加载成功 */ + if (!me.getOpt(filetype + 'ActionName')) { + errorHandler(me.getLang('autoupload.errorLoadConfig')); + return; + } + /* 判断文件大小是否超出限制 */ + if(file.size > maxSize) { + errorHandler(me.getLang('autoupload.exceedSizeError')); + return; + } + /* 判断文件格式是否超出允许 */ + var fileext = file.name ? file.name.substr(file.name.lastIndexOf('.')):''; + if ((fileext && filetype != 'image') || (allowFiles && (allowFiles.join('') + '.').indexOf(fileext.toLowerCase() + '.') == -1)) { + errorHandler(me.getLang('autoupload.exceedTypeError')); + return; + } + + /* 创建Ajax并提交 */ + var xhr = new XMLHttpRequest(), + fd = new FormData(), + params = utils.serializeParam(me.queryCommandValue('serverparam')) || '', + url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?':'&') + params); + + fd.append(fieldName, file, file.name || ('blob.' + file.type.substr('image/'.length))); + fd.append('type', 'ajax'); + xhr.open("post", url, true); + xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); + xhr.addEventListener('load', function (e) { + try{ + var json = (new Function("return " + utils.trim(e.target.response)))(); + if (json.state == 'SUCCESS' && json.url) { + successHandler(json); + } else { + errorHandler(json.state); + } + }catch(er){ + errorHandler(me.getLang('autoupload.loadError')); + } + }); + xhr.send(fd); + } + + function getPasteImage(e){ + return e.clipboardData && e.clipboardData.items && e.clipboardData.items.length == 1 && /^image\//.test(e.clipboardData.items[0].type) ? e.clipboardData.items:null; + } + function getDropImage(e){ + return e.dataTransfer && e.dataTransfer.files ? e.dataTransfer.files:null; + } + + return { + outputRule: function(root){ + utils.each(root.getNodesByTagName('img'),function(n){ + if (/\b(loaderrorclass)|(bloaderrorclass)\b/.test(n.getAttr('class'))) { + n.parentNode.removeChild(n); + } + }); + utils.each(root.getNodesByTagName('p'),function(n){ + if (/\bloadpara\b/.test(n.getAttr('class'))) { + n.parentNode.removeChild(n); + } + }); + }, + bindEvents:{ + //插入粘贴板的图片,拖放插入图片 + 'ready':function(e){ + var me = this; + if(window.FormData && window.FileReader) { + domUtils.on(me.body, 'paste drop', function(e){ + var hasImg = false, + items; + //获取粘贴板文件列表或者拖放文件列表 + items = e.type == 'paste' ? getPasteImage(e):getDropImage(e); + if(items){ + var len = items.length, + file; + while (len--){ + file = items[len]; + if(file.getAsFile) file = file.getAsFile(); + if(file && file.size > 0) { + sendAndInsertFile(file, me); + hasImg = true; + } + } + hasImg && e.preventDefault(); + } + + }); + //取消拖放图片时出现的文字光标位置提示 + domUtils.on(me.body, 'dragover', function (e) { + if(e.dataTransfer.types[0] == 'Files') { + e.preventDefault(); + } + }); + + //设置loading的样式 + utils.cssRule('loading', + '.loadingclass{display:inline-block;cursor:default;background: url(\'' + + this.options.themePath + + this.options.theme +'/images/loading.gif\') no-repeat center center transparent;border:1px solid #cccccc;margin-left:1px;height: 22px;width: 22px;}\n' + + '.loaderrorclass{display:inline-block;cursor:default;background: url(\'' + + this.options.themePath + + this.options.theme +'/images/loaderror.png\') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;' + + '}', + this.document); + } + } + } + } +}); + +// plugins/autosave.js +UE.plugin.register('autosave', function (){ + + var me = this, + //无限循环保护 + lastSaveTime = new Date(), + //最小保存间隔时间 + MIN_TIME = 20, + //auto save key + saveKey = null; + + function save ( editor ) { + + var saveData; + + if ( new Date() - lastSaveTime < MIN_TIME ) { + return; + } + + if ( !editor.hasContents() ) { + //这里不能调用命令来删除, 会造成事件死循环 + saveKey && me.removePreferences( saveKey ); + return; + } + + lastSaveTime = new Date(); + + editor._saveFlag = null; + + saveData = me.body.innerHTML; + + if ( editor.fireEvent( "beforeautosave", { + content: saveData + } ) === false ) { + return; + } + + me.setPreferences( saveKey, saveData ); + + editor.fireEvent( "afterautosave", { + content: saveData + } ); + + } + + return { + defaultOptions: { + //默认间隔时间 + saveInterval: 500, + enableAutoSave: true // HaoChuan9421 + }, + bindEvents:{ + 'ready':function(){ + + var _suffix = "-drafts-data", + key = null; + + if ( me.key ) { + key = me.key + _suffix; + } else { + key = ( me.container.parentNode.id || 'ue-common' ) + _suffix; + } + + //页面地址+编辑器ID 保持唯一 + saveKey = ( location.protocol + location.host + location.pathname ).replace( /[.:\/]/g, '_' ) + key; + + }, + + 'contentchange': function () { + // HaoChuan9421 + if (!me.getOpt('enableAutoSave')) { + return; + } + + if ( !saveKey ) { + return; + } + + if ( me._saveFlag ) { + window.clearTimeout( me._saveFlag ); + } + + if ( me.options.saveInterval > 0 ) { + + me._saveFlag = window.setTimeout( function () { + + save( me ); + + }, me.options.saveInterval ); + + } else { + + save(me); + + } + + + } + }, + commands:{ + 'clearlocaldata':{ + execCommand:function (cmd, name) { + if ( saveKey && me.getPreferences( saveKey ) ) { + me.removePreferences( saveKey ) + } + }, + notNeedUndo: true, + ignoreContentChange:true + }, + + 'getlocaldata':{ + execCommand:function (cmd, name) { + return saveKey ? me.getPreferences( saveKey ) || '' : ''; + }, + notNeedUndo: true, + ignoreContentChange:true + }, + + 'drafts':{ + execCommand:function (cmd, name) { + if ( saveKey ) { + me.body.innerHTML = me.getPreferences( saveKey ) || '

    '+domUtils.fillHtml+'

    '; + me.focus(true); + } + }, + queryCommandState: function () { + return saveKey ? ( me.getPreferences( saveKey ) === null ? -1 : 0 ) : -1; + }, + notNeedUndo: true, + ignoreContentChange:true + } + } + } + +}); + +// plugins/charts.js +UE.plugin.register('charts', function (){ + + var me = this; + + return { + bindEvents: { + 'chartserror': function () { + } + }, + commands:{ + 'charts': { + execCommand: function ( cmd, data ) { + + var tableNode = domUtils.findParentByTagName(this.selection.getRange().startContainer, 'table', true), + flagText = [], + config = {}; + + if ( !tableNode ) { + return false; + } + + if ( !validData( tableNode ) ) { + me.fireEvent( "chartserror" ); + return false; + } + + config.title = data.title || ''; + config.subTitle = data.subTitle || ''; + config.xTitle = data.xTitle || ''; + config.yTitle = data.yTitle || ''; + config.suffix = data.suffix || ''; + config.tip = data.tip || ''; + //数据对齐方式 + config.dataFormat = data.tableDataFormat || ''; + //图表类型 + config.chartType = data.chartType || 0; + + for ( var key in config ) { + + if ( !config.hasOwnProperty( key ) ) { + continue; + } + + flagText.push( key+":"+config[ key ] ); + + } + + tableNode.setAttribute( "data-chart", flagText.join( ";" ) ); + domUtils.addClass( tableNode, "edui-charts-table" ); + + + + }, + queryCommandState: function ( cmd, name ) { + + var tableNode = domUtils.findParentByTagName(this.selection.getRange().startContainer, 'table', true); + return tableNode && validData( tableNode ) ? 0 : -1; + + } + } + }, + inputRule:function(root){ + utils.each(root.getNodesByTagName('table'),function( tableNode ){ + + if ( tableNode.getAttr("data-chart") !== undefined ) { + tableNode.setAttr("style"); + } + + }) + + }, + outputRule:function(root){ + utils.each(root.getNodesByTagName('table'),function( tableNode ){ + + if ( tableNode.getAttr("data-chart") !== undefined ) { + tableNode.setAttr("style", "display: none;"); + } + + }) + + } + } + + function validData ( table ) { + + var firstRows = null, + cellCount = 0; + + //行数不够 + if ( table.rows.length < 2 ) { + return false; + } + + //列数不够 + if ( table.rows[0].cells.length < 2 ) { + return false; + } + + //第一行所有cell必须是th + firstRows = table.rows[ 0 ].cells; + cellCount = firstRows.length; + + for ( var i = 0, cell; cell = firstRows[ i ]; i++ ) { + + if ( cell.tagName.toLowerCase() !== 'th' ) { + return false; + } + + } + + for ( var i = 1, row; row = table.rows[ i ]; i++ ) { + + //每行单元格数不匹配, 返回false + if ( row.cells.length != cellCount ) { + return false; + } + + //第一列不是th也返回false + if ( row.cells[0].tagName.toLowerCase() !== 'th' ) { + return false; + } + + for ( var j = 1, cell; cell = row.cells[ j ]; j++ ) { + + var value = utils.trim( ( cell.innerText || cell.textContent || '' ) ); + + value = value.replace( new RegExp( UE.dom.domUtils.fillChar, 'g' ), '' ).replace( /^\s+|\s+$/g, '' ); + + //必须是数字 + if ( !/^\d*\.?\d+$/.test( value ) ) { + return false; + } + + } + + } + + return true; + + } + +}); + +// plugins/section.js +/** + * 目录大纲支持插件 + * @file + * @since 1.3.0 + */ +UE.plugin.register('section', function (){ + /* 目录节点对象 */ + function Section(option){ + this.tag = ''; + this.level = -1, + this.dom = null; + this.nextSection = null; + this.previousSection = null; + this.parentSection = null; + this.startAddress = []; + this.endAddress = []; + this.children = []; + } + function getSection(option) { + var section = new Section(); + return utils.extend(section, option); + } + function getNodeFromAddress(startAddress, root) { + var current = root; + for(var i = 0;i < startAddress.length; i++) { + if(!current.childNodes) return null; + current = current.childNodes[startAddress[i]]; + } + return current; + } + + var me = this; + + return { + bindMultiEvents:{ + type: 'aftersetcontent afterscencerestore', + handler: function(){ + me.fireEvent('updateSections'); + } + }, + bindEvents:{ + /* 初始化、拖拽、粘贴、执行setcontent之后 */ + 'ready': function (){ + me.fireEvent('updateSections'); + domUtils.on(me.body, 'drop paste', function(){ + me.fireEvent('updateSections'); + }); + }, + /* 执行paragraph命令之后 */ + 'afterexeccommand': function (type, cmd) { + if(cmd == 'paragraph') { + me.fireEvent('updateSections'); + } + }, + /* 部分键盘操作,触发updateSections事件 */ + 'keyup': function (type, e) { + var me = this, + range = me.selection.getRange(); + if(range.collapsed != true) { + me.fireEvent('updateSections'); + } else { + var keyCode = e.keyCode || e.which; + if(keyCode == 13 || keyCode == 8 || keyCode == 46) { + me.fireEvent('updateSections'); + } + } + } + }, + commands:{ + 'getsections': { + execCommand: function (cmd, levels) { + var levelFn = levels || ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; + + for (var i = 0; i < levelFn.length; i++) { + if (typeof levelFn[i] == 'string') { + levelFn[i] = function(fn){ + return function(node){ + return node.tagName == fn.toUpperCase() + }; + }(levelFn[i]); + } else if (typeof levelFn[i] != 'function') { + levelFn[i] = function (node) { + return null; + } + } + } + function getSectionLevel(node) { + for (var i = 0; i < levelFn.length; i++) { + if (levelFn[i](node)) return i; + } + return -1; + } + + var me = this, + Directory = getSection({'level':-1, 'title':'root'}), + previous = Directory; + + function traversal(node, Directory) { + var level, + tmpSection = null, + parent, + child, + children = node.childNodes; + for (var i = 0, len = children.length; i < len; i++) { + child = children[i]; + level = getSectionLevel(child); + if (level >= 0) { + var address = me.selection.getRange().selectNode(child).createAddress(true).startAddress, + current = getSection({ + 'tag': child.tagName, + 'title': child.innerText || child.textContent || '', + 'level': level, + 'dom': child, + 'startAddress': utils.clone(address, []), + 'endAddress': utils.clone(address, []), + 'children': [] + }); + previous.nextSection = current; + current.previousSection = previous; + parent = previous; + while(level <= parent.level){ + parent = parent.parentSection; + } + current.parentSection = parent; + parent.children.push(current); + tmpSection = previous = current; + } else { + child.nodeType === 1 && traversal(child, Directory); + tmpSection && tmpSection.endAddress[tmpSection.endAddress.length - 1] ++; + } + } + } + traversal(me.body, Directory); + return Directory; + }, + notNeedUndo: true + }, + 'movesection': { + execCommand: function (cmd, sourceSection, targetSection, isAfter) { + + var me = this, + targetAddress, + target; + + if(!sourceSection || !targetSection || targetSection.level == -1) return; + + targetAddress = isAfter ? targetSection.endAddress:targetSection.startAddress; + target = getNodeFromAddress(targetAddress, me.body); + + /* 判断目标地址是否被源章节包含 */ + if(!targetAddress || !target || isContainsAddress(sourceSection.startAddress, sourceSection.endAddress, targetAddress)) return; + + var startNode = getNodeFromAddress(sourceSection.startAddress, me.body), + endNode = getNodeFromAddress(sourceSection.endAddress, me.body), + current, + nextNode; + + if(isAfter) { + current = endNode; + while ( current && !(domUtils.getPosition( startNode, current ) & domUtils.POSITION_FOLLOWING) ) { + nextNode = current.previousSibling; + domUtils.insertAfter(target, current); + if(current == startNode) break; + current = nextNode; + } + } else { + current = startNode; + while ( current && !(domUtils.getPosition( current, endNode ) & domUtils.POSITION_FOLLOWING) ) { + nextNode = current.nextSibling; + target.parentNode.insertBefore(current, target); + if(current == endNode) break; + current = nextNode; + } + } + + me.fireEvent('updateSections'); + + /* 获取地址的包含关系 */ + function isContainsAddress(startAddress, endAddress, addressTarget){ + var isAfterStartAddress = false, + isBeforeEndAddress = false; + for(var i = 0; i< startAddress.length; i++){ + if(i >= addressTarget.length) break; + if(addressTarget[i] > startAddress[i]) { + isAfterStartAddress = true; + break; + } else if(addressTarget[i] < startAddress[i]) { + break; + } + } + for(var i = 0; i< endAddress.length; i++){ + if(i >= addressTarget.length) break; + if(addressTarget[i] < startAddress[i]) { + isBeforeEndAddress = true; + break; + } else if(addressTarget[i] > startAddress[i]) { + break; + } + } + return isAfterStartAddress && isBeforeEndAddress; + } + } + }, + 'deletesection': { + execCommand: function (cmd, section, keepChildren) { + var me = this; + + if(!section) return; + + function getNodeFromAddress(startAddress) { + var current = me.body; + for(var i = 0;i < startAddress.length; i++) { + if(!current.childNodes) return null; + current = current.childNodes[startAddress[i]]; + } + return current; + } + + var startNode = getNodeFromAddress(section.startAddress), + endNode = getNodeFromAddress(section.endAddress), + current = startNode, + nextNode; + + if(!keepChildren) { + while ( current && domUtils.inDoc(endNode, me.document) && !(domUtils.getPosition( current, endNode ) & domUtils.POSITION_FOLLOWING) ) { + nextNode = current.nextSibling; + domUtils.remove(current); + current = nextNode; + } + } else { + domUtils.remove(current); + } + + me.fireEvent('updateSections'); + } + }, + 'selectsection': { + execCommand: function (cmd, section) { + if(!section && !section.dom) return false; + var me = this, + range = me.selection.getRange(), + address = { + 'startAddress':utils.clone(section.startAddress, []), + 'endAddress':utils.clone(section.endAddress, []) + }; + address.endAddress[address.endAddress.length - 1]++; + range.moveToAddress(address).select().scrollToView(); + return true; + }, + notNeedUndo: true + }, + 'scrolltosection': { + execCommand: function (cmd, section) { + if(!section && !section.dom) return false; + var me = this, + range = me.selection.getRange(), + address = { + 'startAddress':section.startAddress, + 'endAddress':section.endAddress + }; + address.endAddress[address.endAddress.length - 1]++; + range.moveToAddress(address).scrollToView(); + return true; + }, + notNeedUndo: true + } + } + } +}); + +// plugins/simpleupload.js +/** + * @description + * 简单上传:点击按钮,直接选择文件上传。 + * 原 UEditor 作者使用了 form 表单 + iframe 的方式上传 + * 但由于同源策略的限制,父页面无法访问跨域的 iframe 内容 + * 导致无法获取接口返回的数据,使得单图上传无法在跨域的情况下使用 + * 这里改为普通的XHR上传,兼容到IE10+ + * @author HaoChuan9421 + * @date 2018-12-20 + */ +UE.plugin.register('simpleupload', function() { + var me = this, + containerBtn, + timestrap = (+new Date()).toString(36); + + function initUploadBtn() { + var w = containerBtn.offsetWidth || 20, + h = containerBtn.offsetHeight || 20, + btnStyle = 'display:block;width:' + w + 'px;height:' + h + 'px;overflow:hidden;border:0;margin:0;padding:0;position:absolute;top:0;left:0;filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity: 0;opacity: 0;cursor:pointer;'; + + var form = document.createElement('form'); + var input = document.createElement('input'); + form.id = 'edui_form_' + timestrap; + form.enctype = 'multipart/form-data'; + form.style = btnStyle; + input.id = 'edui_input_' + timestrap; + input.type = 'file' + input.accept = 'image/*'; + input.name = me.options.imageFieldName; + input.style = btnStyle; + form.appendChild(input); + containerBtn.appendChild(form); + + input.addEventListener('change', function(event) { + if (!input.value) return; + var loadingId = 'loading_' + (+new Date()).toString(36); + var imageActionUrl = me.getActionUrl(me.getOpt('imageActionName')); + var params = utils.serializeParam(me.queryCommandValue('serverparam')) || ''; + var action = utils.formatUrl(imageActionUrl + (imageActionUrl.indexOf('?') == -1 ? '?' : '&') + params); + var allowFiles = me.getOpt('imageAllowFiles'); + me.focus(); + me.execCommand('inserthtml', ''); + + function showErrorLoader(title) { + if (loadingId) { + var loader = me.document.getElementById(loadingId); + loader && domUtils.remove(loader); + me.fireEvent('showmessage', { + 'id': loadingId, + 'content': title, + 'type': 'error', + 'timeout': 4000 + }); + } + } + /* 判断后端配置是否没有加载成功 */ + if (!me.getOpt('imageActionName')) { + showErrorLoader(me.getLang('autoupload.errorLoadConfig')); + return; + } + // 判断文件格式是否错误 + var filename = input.value, + fileext = filename ? filename.substr(filename.lastIndexOf('.')) : ''; + if (!fileext || (allowFiles && (allowFiles.join('') + '.').indexOf(fileext.toLowerCase() + '.') == -1)) { + showErrorLoader(me.getLang('simpleupload.exceedTypeError')); + return; + } + + var xhr = new XMLHttpRequest() + xhr.open('post', action, true) + if (me.options.headers && Object.prototype.toString.apply(me.options.headers) === "[object Object]") { + for (var key in me.options.headers) { + xhr.setRequestHeader(key, me.options.headers[key]) + } + } + xhr.onload = function() { + if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304) { + var res = JSON.parse(xhr.responseText) + var link = me.options.imageUrlPrefix + res.url; + + if (res.state == 'SUCCESS' && res.url) { + loader = me.document.getElementById(loadingId); + loader.setAttribute('src', link); + loader.setAttribute('_src', link); + loader.setAttribute('title', res.title || ''); + loader.setAttribute('alt', res.original || ''); + loader.removeAttribute('id'); + domUtils.removeClasses(loader, 'loadingclass'); + me.fireEvent("contentchange"); + } else { + showErrorLoader(res.state); + } + } else { + showErrorLoader(me.getLang('simpleupload.loadError')); + } + }; + xhr.onerror = function() { + showErrorLoader(me.getLang('simpleupload.loadError')); + }; + xhr.send(new FormData(form)); + form.reset(); + }) + } + + return { + bindEvents: { + 'ready': function() { + //设置loading的样式 + utils.cssRule('loading', + '.loadingclass{display:inline-block;cursor:default;background: url(\'' + + this.options.themePath + + this.options.theme + '/images/loading.gif\') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}\n' + + '.loaderrorclass{display:inline-block;cursor:default;background: url(\'' + + this.options.themePath + + this.options.theme + '/images/loaderror.png\') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;' + + '}', + this.document); + }, + /* 初始化简单上传按钮 */ + 'simpleuploadbtnready': function(type, container) { + containerBtn = container; + me.afterConfigReady(initUploadBtn); + } + }, + outputRule: function(root) { + utils.each(root.getNodesByTagName('img'), function(n) { + if (/\b(loaderrorclass)|(bloaderrorclass)\b/.test(n.getAttr('class'))) { + n.parentNode.removeChild(n); + } + }); + } + } +}); + +// plugins/serverparam.js +/** + * 服务器提交的额外参数列表设置插件 + * @file + * @since 1.2.6.1 + */ +UE.plugin.register('serverparam', function (){ + + var me = this, + serverParam = {}; + + return { + commands:{ + /** + * 修改服务器提交的额外参数列表,清除所有项 + * @command serverparam + * @method execCommand + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.execCommand('serverparam'); + * editor.queryCommandValue('serverparam'); //返回空 + * ``` + */ + /** + * 修改服务器提交的额外参数列表,删除指定项 + * @command serverparam + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { String } key 要清除的属性 + * @example + * ```javascript + * editor.execCommand('serverparam', 'name'); //删除属性name + * ``` + */ + /** + * 修改服务器提交的额外参数列表,使用键值添加项 + * @command serverparam + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { String } key 要添加的属性 + * @param { String } value 要添加属性的值 + * @example + * ```javascript + * editor.execCommand('serverparam', 'name', 'hello'); + * editor.queryCommandValue('serverparam'); //返回对象 {'name': 'hello'} + * ``` + */ + /** + * 修改服务器提交的额外参数列表,传入键值对对象添加多项 + * @command serverparam + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { Object } key 传入的键值对对象 + * @example + * ```javascript + * editor.execCommand('serverparam', {'name': 'hello'}); + * editor.queryCommandValue('serverparam'); //返回对象 {'name': 'hello'} + * ``` + */ + /** + * 修改服务器提交的额外参数列表,使用自定义函数添加多项 + * @command serverparam + * @method execCommand + * @param { String } cmd 命令字符串 + * @param { Function } key 自定义获取参数的函数 + * @example + * ```javascript + * editor.execCommand('serverparam', function(editor){ + * return {'key': 'value'}; + * }); + * editor.queryCommandValue('serverparam'); //返回对象 {'key': 'value'} + * ``` + */ + + /** + * 获取服务器提交的额外参数列表 + * @command serverparam + * @method queryCommandValue + * @param { String } cmd 命令字符串 + * @example + * ```javascript + * editor.queryCommandValue( 'serverparam' ); //返回对象 {'key': 'value'} + * ``` + */ + 'serverparam':{ + execCommand:function (cmd, key, value) { + if (key === undefined || key === null) { //不传参数,清空列表 + serverParam = {}; + } else if (utils.isString(key)) { //传入键值 + if(value === undefined || value === null) { + delete serverParam[key]; + } else { + serverParam[key] = value; + } + } else if (utils.isObject(key)) { //传入对象,覆盖列表项 + utils.extend(serverParam, key, true); + } else if (utils.isFunction(key)){ //传入函数,添加列表项 + utils.extend(serverParam, key(), true); + } + }, + queryCommandValue: function(){ + return serverParam || {}; + } + } + } + } +}); + + +// plugins/insertfile.js +/** + * 插入附件 + */ +UE.plugin.register('insertfile', function (){ + + var me = this; + + function getFileIcon(url){ + var ext = url.substr(url.lastIndexOf('.') + 1).toLowerCase(), + maps = { + "rar":"icon_rar.gif", + "zip":"icon_rar.gif", + "tar":"icon_rar.gif", + "gz":"icon_rar.gif", + "bz2":"icon_rar.gif", + "doc":"icon_doc.gif", + "docx":"icon_doc.gif", + "pdf":"icon_pdf.gif", + "mp3":"icon_mp3.gif", + "xls":"icon_xls.gif", + "chm":"icon_chm.gif", + "ppt":"icon_ppt.gif", + "pptx":"icon_ppt.gif", + "avi":"icon_mv.gif", + "rmvb":"icon_mv.gif", + "wmv":"icon_mv.gif", + "flv":"icon_mv.gif", + "swf":"icon_mv.gif", + "rm":"icon_mv.gif", + "exe":"icon_exe.gif", + "psd":"icon_psd.gif", + "txt":"icon_txt.gif", + "jpg":"icon_jpg.gif", + "png":"icon_jpg.gif", + "jpeg":"icon_jpg.gif", + "gif":"icon_jpg.gif", + "ico":"icon_jpg.gif", + "bmp":"icon_jpg.gif" + }; + return maps[ext] ? maps[ext]:maps['txt']; + } + + return { + commands:{ + 'insertfile': { + execCommand: function (command, filelist){ + filelist = utils.isArray(filelist) ? filelist : [filelist]; + + var i, item, icon, title, + html = '', + URL = me.getOpt('UEDITOR_HOME_URL'), + iconDir = URL + (URL.substr(URL.length - 1) == '/' ? '':'/') + 'dialogs/attachment/fileTypeImages/'; + for (i = 0; i < filelist.length; i++) { + item = filelist[i]; + icon = iconDir + getFileIcon(item.url); + title = item.title || item.url.substr(item.url.lastIndexOf('/') + 1); + html += '

    ' + + '' + + '' + title + '' + + '

    '; + } + me.execCommand('insertHtml', html); + } + } + } + } +}); + + + + +// plugins/xssFilter.js +/** + * @file xssFilter.js + * @desc xss过滤器 + * @author robbenmu + */ + +UE.plugins.xssFilter = function() { + + var config = UEDITOR_CONFIG; + var whitList = config.whitList; + + function filter(node) { + + var tagName = node.tagName; + var attrs = node.attrs; + + if (!whitList.hasOwnProperty(tagName)) { + node.parentNode.removeChild(node); + return false; + } + + UE.utils.each(attrs, function (val, key) { + + if (whitList[tagName].indexOf(key) === -1) { + node.setAttr(key); + } + }); + } + + // 添加inserthtml\paste等操作用的过滤规则 + if (whitList && config.xssFilterRules) { + this.options.filterRules = function () { + + var result = {}; + + UE.utils.each(whitList, function(val, key) { + result[key] = function (node) { + return filter(node); + }; + }); + + return result; + }(); + } + + var tagList = []; + + UE.utils.each(whitList, function (val, key) { + tagList.push(key); + }); + + // 添加input过滤规则 + // + if (whitList && config.inputXssFilter) { + this.addInputRule(function (root) { + + root.traversal(function(node) { + if (node.type !== 'element') { + return false; + } + filter(node); + }); + }); + } + // 添加output过滤规则 + // + if (whitList && config.outputXssFilter) { + this.addOutputRule(function (root) { + + root.traversal(function(node) { + if (node.type !== 'element') { + return false; + } + filter(node); + }); + }); + } + +}; + + +// ui/ui.js +var baidu = baidu || {}; +baidu.editor = baidu.editor || {}; +UE.ui = baidu.editor.ui = {}; + +// ui/uiutils.js +(function (){ + var browser = baidu.editor.browser, + domUtils = baidu.editor.dom.domUtils; + + var magic = '$EDITORUI'; + var root = window[magic] = {}; + var uidMagic = 'ID' + magic; + var uidCount = 0; + + var uiUtils = baidu.editor.ui.uiUtils = { + uid: function (obj){ + return (obj ? obj[uidMagic] || (obj[uidMagic] = ++ uidCount) : ++ uidCount); + }, + hook: function ( fn, callback ) { + var dg; + if (fn && fn._callbacks) { + dg = fn; + } else { + dg = function (){ + var q; + if (fn) { + q = fn.apply(this, arguments); + } + var callbacks = dg._callbacks; + var k = callbacks.length; + while (k --) { + var r = callbacks[k].apply(this, arguments); + if (q === undefined) { + q = r; + } + } + return q; + }; + dg._callbacks = []; + } + dg._callbacks.push(callback); + return dg; + }, + createElementByHtml: function (html){ + var el = document.createElement('div'); + el.innerHTML = html; + el = el.firstChild; + el.parentNode.removeChild(el); + return el; + }, + getViewportElement: function (){ + return (browser.ie && browser.quirks) ? + document.body : document.documentElement; + }, + getClientRect: function (element){ + var bcr; + //trace IE6下在控制编辑器显隐时可能会报错,catch一下 + try{ + bcr = element.getBoundingClientRect(); + }catch(e){ + bcr={left:0,top:0,height:0,width:0} + } + var rect = { + left: Math.round(bcr.left), + top: Math.round(bcr.top), + height: Math.round(bcr.bottom - bcr.top), + width: Math.round(bcr.right - bcr.left) + }; + var doc; + while ((doc = element.ownerDocument) !== document && + (element = domUtils.getWindow(doc).frameElement)) { + bcr = element.getBoundingClientRect(); + rect.left += bcr.left; + rect.top += bcr.top; + } + rect.bottom = rect.top + rect.height; + rect.right = rect.left + rect.width; + return rect; + }, + getViewportRect: function (){ + var viewportEl = uiUtils.getViewportElement(); + var width = (window.innerWidth || viewportEl.clientWidth) | 0; + var height = (window.innerHeight ||viewportEl.clientHeight) | 0; + return { + left: 0, + top: 0, + height: height, + width: width, + bottom: height, + right: width + }; + }, + setViewportOffset: function (element, offset){ + var rect; + var fixedLayer = uiUtils.getFixedLayer(); + if (element.parentNode === fixedLayer) { + element.style.left = offset.left + 'px'; + element.style.top = offset.top + 'px'; + } else { + domUtils.setViewportOffset(element, offset); + } + }, + getEventOffset: function (evt){ + var el = evt.target || evt.srcElement; + var rect = uiUtils.getClientRect(el); + var offset = uiUtils.getViewportOffsetByEvent(evt); + return { + left: offset.left - rect.left, + top: offset.top - rect.top + }; + }, + getViewportOffsetByEvent: function (evt){ + var el = evt.target || evt.srcElement; + var frameEl = domUtils.getWindow(el).frameElement; + var offset = { + left: evt.clientX, + top: evt.clientY + }; + if (frameEl && el.ownerDocument !== document) { + var rect = uiUtils.getClientRect(frameEl); + offset.left += rect.left; + offset.top += rect.top; + } + return offset; + }, + setGlobal: function (id, obj){ + root[id] = obj; + return magic + '["' + id + '"]'; + }, + unsetGlobal: function (id){ + delete root[id]; + }, + copyAttributes: function (tgt, src){ + var attributes = src.attributes; + var k = attributes.length; + while (k --) { + var attrNode = attributes[k]; + if ( attrNode.nodeName != 'style' && attrNode.nodeName != 'class' && (!browser.ie || attrNode.specified) ) { + tgt.setAttribute(attrNode.nodeName, attrNode.nodeValue); + } + } + if (src.className) { + domUtils.addClass(tgt,src.className); + } + if (src.style.cssText) { + tgt.style.cssText += ';' + src.style.cssText; + } + }, + removeStyle: function (el, styleName){ + if (el.style.removeProperty) { + el.style.removeProperty(styleName); + } else if (el.style.removeAttribute) { + el.style.removeAttribute(styleName); + } else throw ''; + }, + contains: function (elA, elB){ + return elA && elB && (elA === elB ? false : ( + elA.contains ? elA.contains(elB) : + elA.compareDocumentPosition(elB) & 16 + )); + }, + startDrag: function (evt, callbacks,doc){ + var doc = doc || document; + var startX = evt.clientX; + var startY = evt.clientY; + function handleMouseMove(evt){ + var x = evt.clientX - startX; + var y = evt.clientY - startY; + callbacks.ondragmove(x, y,evt); + if (evt.stopPropagation) { + evt.stopPropagation(); + } else { + evt.cancelBubble = true; + } + } + if (doc.addEventListener) { + function handleMouseUp(evt){ + doc.removeEventListener('mousemove', handleMouseMove, true); + doc.removeEventListener('mouseup', handleMouseUp, true); + window.removeEventListener('mouseup', handleMouseUp, true); + callbacks.ondragstop(); + } + doc.addEventListener('mousemove', handleMouseMove, true); + doc.addEventListener('mouseup', handleMouseUp, true); + window.addEventListener('mouseup', handleMouseUp, true); + + evt.preventDefault(); + } else { + var elm = evt.srcElement; + elm.setCapture(); + function releaseCaptrue(){ + elm.releaseCapture(); + elm.detachEvent('onmousemove', handleMouseMove); + elm.detachEvent('onmouseup', releaseCaptrue); + elm.detachEvent('onlosecaptrue', releaseCaptrue); + callbacks.ondragstop(); + } + elm.attachEvent('onmousemove', handleMouseMove); + elm.attachEvent('onmouseup', releaseCaptrue); + elm.attachEvent('onlosecaptrue', releaseCaptrue); + evt.returnValue = false; + } + callbacks.ondragstart(); + }, + getFixedLayer: function (){ + var layer = document.getElementById('edui_fixedlayer'); + if (layer == null) { + layer = document.createElement('div'); + layer.id = 'edui_fixedlayer'; + document.body.appendChild(layer); + if (browser.ie && browser.version <= 8) { + layer.style.position = 'absolute'; + bindFixedLayer(); + setTimeout(updateFixedOffset); + } else { + layer.style.position = 'fixed'; + } + layer.style.left = '0'; + layer.style.top = '0'; + layer.style.width = '0'; + layer.style.height = '0'; + } + return layer; + }, + makeUnselectable: function (element){ + if (browser.opera || (browser.ie && browser.version < 9)) { + element.unselectable = 'on'; + if (element.hasChildNodes()) { + for (var i=0; i
    '; + } + }; + utils.inherits(Separator, UIBase); + +})(); + + +// ui/mask.js +///import core +///import uicore +(function (){ + var utils = baidu.editor.utils, + domUtils = baidu.editor.dom.domUtils, + UIBase = baidu.editor.ui.UIBase, + uiUtils = baidu.editor.ui.uiUtils; + + var Mask = baidu.editor.ui.Mask = function (options){ + this.initOptions(options); + this.initUIBase(); + }; + Mask.prototype = { + getHtmlTpl: function (){ + return '
    '; + }, + postRender: function (){ + var me = this; + domUtils.on(window, 'resize', function (){ + setTimeout(function (){ + if (!me.isHidden()) { + me._fill(); + } + }); + }); + }, + show: function (zIndex){ + this._fill(); + this.getDom().style.display = ''; + this.getDom().style.zIndex = zIndex; + }, + hide: function (){ + this.getDom().style.display = 'none'; + this.getDom().style.zIndex = ''; + }, + isHidden: function (){ + return this.getDom().style.display == 'none'; + }, + _onMouseDown: function (){ + return false; + }, + _onClick: function (e, target){ + this.fireEvent('click', e, target); + }, + _fill: function (){ + var el = this.getDom(); + var vpRect = uiUtils.getViewportRect(); + el.style.width = vpRect.width + 'px'; + el.style.height = vpRect.height + 'px'; + } + }; + utils.inherits(Mask, UIBase); +})(); + + +// ui/popup.js +///import core +///import uicore +(function () { + var utils = baidu.editor.utils, + uiUtils = baidu.editor.ui.uiUtils, + domUtils = baidu.editor.dom.domUtils, + UIBase = baidu.editor.ui.UIBase, + Popup = baidu.editor.ui.Popup = function (options){ + this.initOptions(options); + this.initPopup(); + }; + + var allPopups = []; + function closeAllPopup( evt,el ){ + for ( var i = 0; i < allPopups.length; i++ ) { + var pop = allPopups[i]; + if (!pop.isHidden()) { + if (pop.queryAutoHide(el) !== false) { + if(evt&&/scroll/ig.test(evt.type)&&pop.className=="edui-wordpastepop") return; + pop.hide(); + } + } + } + + if(allPopups.length) + pop.editor.fireEvent("afterhidepop"); + } + + Popup.postHide = closeAllPopup; + + var ANCHOR_CLASSES = ['edui-anchor-topleft','edui-anchor-topright', + 'edui-anchor-bottomleft','edui-anchor-bottomright']; + Popup.prototype = { + SHADOW_RADIUS: 5, + content: null, + _hidden: false, + autoRender: true, + canSideLeft: true, + canSideUp: true, + initPopup: function (){ + this.initUIBase(); + allPopups.push( this ); + }, + getHtmlTpl: function (){ + return '
    ' + + '
    ' + + ' ' + + '
    ' + + '
    ' + + this.getContentHtmlTpl() + + '
    ' + + '
    ' + + '
    '; + }, + getContentHtmlTpl: function (){ + if(this.content){ + if (typeof this.content == 'string') { + return this.content; + } + return this.content.renderHtml(); + }else{ + return '' + } + + }, + _UIBase_postRender: UIBase.prototype.postRender, + postRender: function (){ + + + if (this.content instanceof UIBase) { + this.content.postRender(); + } + + //捕获鼠标滚轮 + if( this.captureWheel && !this.captured ) { + + this.captured = true; + + var winHeight = ( document.documentElement.clientHeight || document.body.clientHeight ) - 80, + _height = this.getDom().offsetHeight, + _top = uiUtils.getClientRect( this.combox.getDom() ).top, + content = this.getDom('content'), + ifr = this.getDom('body').getElementsByTagName('iframe'), + me = this; + + ifr.length && ( ifr = ifr[0] ); + + while( _top + _height > winHeight ) { + _height -= 30; + } + content.style.height = _height + 'px'; + //同步更改iframe高度 + ifr && ( ifr.style.height = _height + 'px' ); + + //阻止在combox上的鼠标滚轮事件, 防止用户的正常操作被误解 + if( window.XMLHttpRequest ) { + + domUtils.on( content, ( 'onmousewheel' in document.body ) ? 'mousewheel' :'DOMMouseScroll' , function(e){ + + if(e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + } + + if( e.wheelDelta ) { + + content.scrollTop -= ( e.wheelDelta / 120 )*60; + + } else { + + content.scrollTop -= ( e.detail / -3 )*60; + + } + + }); + + } else { + + //ie6 + domUtils.on( this.getDom(), 'mousewheel' , function(e){ + + e.returnValue = false; + + me.getDom('content').scrollTop -= ( e.wheelDelta / 120 )*60; + + }); + + } + + } + this.fireEvent('postRenderAfter'); + this.hide(true); + this._UIBase_postRender(); + }, + _doAutoRender: function (){ + if (!this.getDom() && this.autoRender) { + this.render(); + } + }, + mesureSize: function (){ + var box = this.getDom('content'); + return uiUtils.getClientRect(box); + }, + fitSize: function (){ + if( this.captureWheel && this.sized ) { + return this.__size; + } + this.sized = true; + var popBodyEl = this.getDom('body'); + popBodyEl.style.width = ''; + popBodyEl.style.height = ''; + var size = this.mesureSize(); + if( this.captureWheel ) { + popBodyEl.style.width = -(-20 -size.width) + 'px'; + var height = parseInt( this.getDom('content').style.height, 10 ); + !window.isNaN( height ) && ( size.height = height ); + } else { + popBodyEl.style.width = size.width + 'px'; + } + popBodyEl.style.height = size.height + 'px'; + this.__size = size; + this.captureWheel && (this.getDom('content').style.overflow = 'auto'); + return size; + }, + showAnchor: function ( element, hoz ){ + this.showAnchorRect( uiUtils.getClientRect( element ), hoz ); + }, + showAnchorRect: function ( rect, hoz, adj ){ + this._doAutoRender(); + var vpRect = uiUtils.getViewportRect(); + this.getDom().style.visibility = 'hidden'; + this._show(); + var popSize = this.fitSize(); + + var sideLeft, sideUp, left, top; + if (hoz) { + sideLeft = this.canSideLeft && (rect.right + popSize.width > vpRect.right && rect.left > popSize.width); + sideUp = this.canSideUp && (rect.top + popSize.height > vpRect.bottom && rect.bottom > popSize.height); + left = (sideLeft ? rect.left - popSize.width : rect.right); + top = (sideUp ? rect.bottom - popSize.height : rect.top); + } else { + sideLeft = this.canSideLeft && (rect.right + popSize.width > vpRect.right && rect.left > popSize.width); + sideUp = this.canSideUp && (rect.top + popSize.height > vpRect.bottom && rect.bottom > popSize.height); + left = (sideLeft ? rect.right - popSize.width : rect.left); + top = (sideUp ? rect.top - popSize.height : rect.bottom); + } + + var popEl = this.getDom(); + uiUtils.setViewportOffset(popEl, { + left: left, + top: top + }); + domUtils.removeClasses(popEl, ANCHOR_CLASSES); + popEl.className += ' ' + ANCHOR_CLASSES[(sideUp ? 1 : 0) * 2 + (sideLeft ? 1 : 0)]; + if(this.editor){ + popEl.style.zIndex = this.editor.container.style.zIndex * 1 + 10; + baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex = popEl.style.zIndex - 1; + } + this.getDom().style.visibility = 'visible'; + + }, + showAt: function (offset) { + var left = offset.left; + var top = offset.top; + var rect = { + left: left, + top: top, + right: left, + bottom: top, + height: 0, + width: 0 + }; + this.showAnchorRect(rect, false, true); + }, + _show: function (){ + if (this._hidden) { + var box = this.getDom(); + box.style.display = ''; + this._hidden = false; +// if (box.setActive) { +// box.setActive(); +// } + this.fireEvent('show'); + } + }, + isHidden: function (){ + return this._hidden; + }, + show: function (){ + this._doAutoRender(); + this._show(); + }, + hide: function (notNofity){ + if (!this._hidden && this.getDom()) { + this.getDom().style.display = 'none'; + this._hidden = true; + if (!notNofity) { + this.fireEvent('hide'); + } + } + }, + queryAutoHide: function (el){ + return !el || !uiUtils.contains(this.getDom(), el); + } + }; + utils.inherits(Popup, UIBase); + + domUtils.on( document, 'mousedown', function ( evt ) { + var el = evt.target || evt.srcElement; + closeAllPopup( evt,el ); + } ); + domUtils.on( window, 'scroll', function (evt,el) { + closeAllPopup( evt,el ); + } ); + +})(); + + +// ui/colorpicker.js +///import core +///import uicore +(function (){ + var utils = baidu.editor.utils, + UIBase = baidu.editor.ui.UIBase, + ColorPicker = baidu.editor.ui.ColorPicker = function (options){ + this.initOptions(options); + this.noColorText = this.noColorText || this.editor.getLang("clearColor"); + this.initUIBase(); + }; + + ColorPicker.prototype = { + getHtmlTpl: function (){ + return genColorPicker(this.noColorText,this.editor); + }, + _onTableClick: function (evt){ + var tgt = evt.target || evt.srcElement; + var color = tgt.getAttribute('data-color'); + if (color) { + this.fireEvent('pickcolor', color); + } + }, + _onTableOver: function (evt){ + var tgt = evt.target || evt.srcElement; + var color = tgt.getAttribute('data-color'); + if (color) { + this.getDom('preview').style.backgroundColor = color; + } + }, + _onTableOut: function (){ + this.getDom('preview').style.backgroundColor = ''; + }, + _onPickNoColor: function (){ + this.fireEvent('picknocolor'); + } + }; + utils.inherits(ColorPicker, UIBase); + + var COLORS = ( + 'ffffff,000000,eeece1,1f497d,4f81bd,c0504d,9bbb59,8064a2,4bacc6,f79646,' + + 'f2f2f2,7f7f7f,ddd9c3,c6d9f0,dbe5f1,f2dcdb,ebf1dd,e5e0ec,dbeef3,fdeada,' + + 'd8d8d8,595959,c4bd97,8db3e2,b8cce4,e5b9b7,d7e3bc,ccc1d9,b7dde8,fbd5b5,' + + 'bfbfbf,3f3f3f,938953,548dd4,95b3d7,d99694,c3d69b,b2a2c7,92cddc,fac08f,' + + 'a5a5a5,262626,494429,17365d,366092,953734,76923c,5f497a,31859b,e36c09,' + + '7f7f7f,0c0c0c,1d1b10,0f243e,244061,632423,4f6128,3f3151,205867,974806,' + + 'c00000,ff0000,ffc000,ffff00,92d050,00b050,00b0f0,0070c0,002060,7030a0,').split(','); + + function genColorPicker(noColorText,editor){ + var html = '
    ' + + '
    ' + + '
    ' + + '
    '+ noColorText +'
    ' + + '
    ' + + '' + + ''+ + ''; + for (var i=0; i':'')+''; + } + html += i<70 ? '':''; + } + html += '
    '+editor.getLang("themeColor")+'
    '+editor.getLang("standardColor")+'
    '; + return html; + } +})(); + + +// ui/tablepicker.js +///import core +///import uicore +(function (){ + var utils = baidu.editor.utils, + uiUtils = baidu.editor.ui.uiUtils, + UIBase = baidu.editor.ui.UIBase; + + var TablePicker = baidu.editor.ui.TablePicker = function (options){ + this.initOptions(options); + this.initTablePicker(); + }; + TablePicker.prototype = { + defaultNumRows: 10, + defaultNumCols: 10, + maxNumRows: 20, + maxNumCols: 20, + numRows: 10, + numCols: 10, + lengthOfCellSide: 22, + initTablePicker: function (){ + this.initUIBase(); + }, + getHtmlTpl: function (){ + var me = this; + return '
    ' + + '
    ' + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    '; + }, + _UIBase_render: UIBase.prototype.render, + render: function (holder){ + this._UIBase_render(holder); + this.getDom('label').innerHTML = '0'+this.editor.getLang("t_row")+' x 0'+this.editor.getLang("t_col"); + }, + _track: function (numCols, numRows){ + var style = this.getDom('overlay').style; + var sideLen = this.lengthOfCellSide; + style.width = numCols * sideLen + 'px'; + style.height = numRows * sideLen + 'px'; + var label = this.getDom('label'); + label.innerHTML = numCols +this.editor.getLang("t_col")+' x ' + numRows + this.editor.getLang("t_row"); + this.numCols = numCols; + this.numRows = numRows; + }, + _onMouseOver: function (evt, el){ + var rel = evt.relatedTarget || evt.fromElement; + if (!uiUtils.contains(el, rel) && el !== rel) { + this.getDom('label').innerHTML = '0'+this.editor.getLang("t_col")+' x 0'+this.editor.getLang("t_row"); + this.getDom('overlay').style.visibility = ''; + } + }, + _onMouseOut: function (evt, el){ + var rel = evt.relatedTarget || evt.toElement; + if (!uiUtils.contains(el, rel) && el !== rel) { + this.getDom('label').innerHTML = '0'+this.editor.getLang("t_col")+' x 0'+this.editor.getLang("t_row"); + this.getDom('overlay').style.visibility = 'hidden'; + } + }, + _onMouseMove: function (evt, el){ + var style = this.getDom('overlay').style; + var offset = uiUtils.getEventOffset(evt); + var sideLen = this.lengthOfCellSide; + var numCols = Math.ceil(offset.left / sideLen); + var numRows = Math.ceil(offset.top / sideLen); + this._track(numCols, numRows); + }, + _onClick: function (){ + this.fireEvent('picktable', this.numCols, this.numRows); + } + }; + utils.inherits(TablePicker, UIBase); +})(); + + +// ui/stateful.js +(function (){ + var browser = baidu.editor.browser, + domUtils = baidu.editor.dom.domUtils, + uiUtils = baidu.editor.ui.uiUtils; + + var TPL_STATEFUL = 'onmousedown="$$.Stateful_onMouseDown(event, this);"' + + ' onmouseup="$$.Stateful_onMouseUp(event, this);"' + + ( browser.ie ? ( + ' onmouseenter="$$.Stateful_onMouseEnter(event, this);"' + + ' onmouseleave="$$.Stateful_onMouseLeave(event, this);"' ) + : ( + ' onmouseover="$$.Stateful_onMouseOver(event, this);"' + + ' onmouseout="$$.Stateful_onMouseOut(event, this);"' )); + + baidu.editor.ui.Stateful = { + alwalysHoverable: false, + target:null,//目标元素和this指向dom不一样 + Stateful_init: function (){ + this._Stateful_dGetHtmlTpl = this.getHtmlTpl; + this.getHtmlTpl = this.Stateful_getHtmlTpl; + }, + Stateful_getHtmlTpl: function (){ + var tpl = this._Stateful_dGetHtmlTpl(); + // 使用function避免$转义 + return tpl.replace(/stateful/g, function (){ return TPL_STATEFUL; }); + }, + Stateful_onMouseEnter: function (evt, el){ + this.target=el; + if (!this.isDisabled() || this.alwalysHoverable) { + this.addState('hover'); + this.fireEvent('over'); + } + }, + Stateful_onMouseLeave: function (evt, el){ + if (!this.isDisabled() || this.alwalysHoverable) { + this.removeState('hover'); + this.removeState('active'); + this.fireEvent('out'); + } + }, + Stateful_onMouseOver: function (evt, el){ + var rel = evt.relatedTarget; + if (!uiUtils.contains(el, rel) && el !== rel) { + this.Stateful_onMouseEnter(evt, el); + } + }, + Stateful_onMouseOut: function (evt, el){ + var rel = evt.relatedTarget; + if (!uiUtils.contains(el, rel) && el !== rel) { + this.Stateful_onMouseLeave(evt, el); + } + }, + Stateful_onMouseDown: function (evt, el){ + if (!this.isDisabled()) { + this.addState('active'); + } + }, + Stateful_onMouseUp: function (evt, el){ + if (!this.isDisabled()) { + this.removeState('active'); + } + }, + Stateful_postRender: function (){ + if (this.disabled && !this.hasState('disabled')) { + this.addState('disabled'); + } + }, + hasState: function (state){ + return domUtils.hasClass(this.getStateDom(), 'edui-state-' + state); + }, + addState: function (state){ + if (!this.hasState(state)) { + this.getStateDom().className += ' edui-state-' + state; + } + }, + removeState: function (state){ + if (this.hasState(state)) { + domUtils.removeClasses(this.getStateDom(), ['edui-state-' + state]); + } + }, + getStateDom: function (){ + return this.getDom('state'); + }, + isChecked: function (){ + return this.hasState('checked'); + }, + setChecked: function (checked){ + if (!this.isDisabled() && checked) { + this.addState('checked'); + } else { + this.removeState('checked'); + } + }, + isDisabled: function (){ + return this.hasState('disabled'); + }, + setDisabled: function (disabled){ + if (disabled) { + this.removeState('hover'); + this.removeState('checked'); + this.removeState('active'); + this.addState('disabled'); + } else { + this.removeState('disabled'); + } + } + }; +})(); + + +// ui/button.js +///import core +///import uicore +///import ui/stateful.js +(function (){ + var utils = baidu.editor.utils, + UIBase = baidu.editor.ui.UIBase, + Stateful = baidu.editor.ui.Stateful, + Button = baidu.editor.ui.Button = function (options){ + if(options.name){ + var btnName = options.name; + var cssRules = options.cssRules; + if(!options.className){ + options.className = 'edui-for-' + btnName; + } + options.cssRules = '.edui-default .edui-for-'+ btnName +' .edui-icon {'+ cssRules +'}' + } + this.initOptions(options); + this.initButton(); + }; + Button.prototype = { + uiName: 'button', + label: '', + title: '', + showIcon: true, + showText: true, + cssRules:'', + initButton: function (){ + this.initUIBase(); + this.Stateful_init(); + if(this.cssRules){ + utils.cssRule('edui-customize-'+this.name+'-style',this.cssRules); + } + }, + getHtmlTpl: function (){ + return '
    ' + + '
    ' + + '
    ' + + (this.showIcon ? '
    ' : '') + + (this.showText ? '
    ' + this.label + '
    ' : '') + + '
    ' + + '
    ' + + '
    '; + }, + postRender: function (){ + this.Stateful_postRender(); + this.setDisabled(this.disabled) + }, + _onMouseDown: function (e){ + var target = e.target || e.srcElement, + tagName = target && target.tagName && target.tagName.toLowerCase(); + if (tagName == 'input' || tagName == 'object' || tagName == 'object') { + return false; + } + }, + _onClick: function (){ + if (!this.isDisabled()) { + this.fireEvent('click'); + } + }, + setTitle: function(text){ + var label = this.getDom('label'); + label.innerHTML = text; + } + }; + utils.inherits(Button, UIBase); + utils.extend(Button.prototype, Stateful); + +})(); + + +// ui/splitbutton.js +///import core +///import uicore +///import ui/stateful.js +(function (){ + var utils = baidu.editor.utils, + uiUtils = baidu.editor.ui.uiUtils, + domUtils = baidu.editor.dom.domUtils, + UIBase = baidu.editor.ui.UIBase, + Stateful = baidu.editor.ui.Stateful, + SplitButton = baidu.editor.ui.SplitButton = function (options){ + this.initOptions(options); + this.initSplitButton(); + }; + SplitButton.prototype = { + popup: null, + uiName: 'splitbutton', + title: '', + initSplitButton: function (){ + this.initUIBase(); + this.Stateful_init(); + var me = this; + if (this.popup != null) { + var popup = this.popup; + this.popup = null; + this.setPopup(popup); + } + }, + _UIBase_postRender: UIBase.prototype.postRender, + postRender: function (){ + this.Stateful_postRender(); + this._UIBase_postRender(); + }, + setPopup: function (popup){ + if (this.popup === popup) return; + if (this.popup != null) { + this.popup.dispose(); + } + popup.addListener('show', utils.bind(this._onPopupShow, this)); + popup.addListener('hide', utils.bind(this._onPopupHide, this)); + popup.addListener('postrender', utils.bind(function (){ + popup.getDom('body').appendChild( + uiUtils.createElementByHtml('
    ') + ); + popup.getDom().className += ' ' + this.className; + }, this)); + this.popup = popup; + }, + _onPopupShow: function (){ + this.addState('opened'); + }, + _onPopupHide: function (){ + this.removeState('opened'); + }, + getHtmlTpl: function (){ + return '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    '; + }, + showPopup: function (){ + // 当popup往上弹出的时候,做特殊处理 + var rect = uiUtils.getClientRect(this.getDom()); + rect.top -= this.popup.SHADOW_RADIUS; + rect.height += this.popup.SHADOW_RADIUS; + this.popup.showAnchorRect(rect); + }, + _onArrowClick: function (event, el){ + if (!this.isDisabled()) { + this.showPopup(); + } + }, + _onButtonClick: function (){ + if (!this.isDisabled()) { + this.fireEvent('buttonclick'); + } + } + }; + utils.inherits(SplitButton, UIBase); + utils.extend(SplitButton.prototype, Stateful, true); + +})(); + + +// ui/colorbutton.js +///import core +///import uicore +///import ui/colorpicker.js +///import ui/popup.js +///import ui/splitbutton.js +(function (){ + var utils = baidu.editor.utils, + uiUtils = baidu.editor.ui.uiUtils, + ColorPicker = baidu.editor.ui.ColorPicker, + Popup = baidu.editor.ui.Popup, + SplitButton = baidu.editor.ui.SplitButton, + ColorButton = baidu.editor.ui.ColorButton = function (options){ + this.initOptions(options); + this.initColorButton(); + }; + ColorButton.prototype = { + initColorButton: function (){ + var me = this; + this.popup = new Popup({ + content: new ColorPicker({ + noColorText: me.editor.getLang("clearColor"), + editor:me.editor, + onpickcolor: function (t, color){ + me._onPickColor(color); + }, + onpicknocolor: function (t, color){ + me._onPickNoColor(color); + } + }), + editor:me.editor + }); + this.initSplitButton(); + }, + _SplitButton_postRender: SplitButton.prototype.postRender, + postRender: function (){ + this._SplitButton_postRender(); + this.getDom('button_body').appendChild( + uiUtils.createElementByHtml('
    ') + ); + this.getDom().className += ' edui-colorbutton'; + }, + setColor: function (color){ + this.getDom('colorlump').style.backgroundColor = color; + this.color = color; + }, + _onPickColor: function (color){ + if (this.fireEvent('pickcolor', color) !== false) { + this.setColor(color); + this.popup.hide(); + } + }, + _onPickNoColor: function (color){ + if (this.fireEvent('picknocolor') !== false) { + this.popup.hide(); + } + } + }; + utils.inherits(ColorButton, SplitButton); + +})(); + + +// ui/tablebutton.js +///import core +///import uicore +///import ui/popup.js +///import ui/tablepicker.js +///import ui/splitbutton.js +(function (){ + var utils = baidu.editor.utils, + Popup = baidu.editor.ui.Popup, + TablePicker = baidu.editor.ui.TablePicker, + SplitButton = baidu.editor.ui.SplitButton, + TableButton = baidu.editor.ui.TableButton = function (options){ + this.initOptions(options); + this.initTableButton(); + }; + TableButton.prototype = { + initTableButton: function (){ + var me = this; + this.popup = new Popup({ + content: new TablePicker({ + editor:me.editor, + onpicktable: function (t, numCols, numRows){ + me._onPickTable(numCols, numRows); + } + }), + 'editor':me.editor + }); + this.initSplitButton(); + }, + _onPickTable: function (numCols, numRows){ + if (this.fireEvent('picktable', numCols, numRows) !== false) { + this.popup.hide(); + } + } + }; + utils.inherits(TableButton, SplitButton); + +})(); + + +// ui/autotypesetpicker.js +///import core +///import uicore +(function () { + var utils = baidu.editor.utils, + UIBase = baidu.editor.ui.UIBase; + + var AutoTypeSetPicker = baidu.editor.ui.AutoTypeSetPicker = function (options) { + this.initOptions(options); + this.initAutoTypeSetPicker(); + }; + AutoTypeSetPicker.prototype = { + initAutoTypeSetPicker:function () { + this.initUIBase(); + }, + getHtmlTpl:function () { + var me = this.editor, + opt = me.options.autotypeset, + lang = me.getLang("autoTypeSet"); + + var textAlignInputName = 'textAlignValue' + me.uid, + imageBlockInputName = 'imageBlockLineValue' + me.uid, + symbolConverInputName = 'symbolConverValue' + me.uid; + + return '
    ' + + '
    ' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '
    ' + lang.mergeLine + '' + lang.delLine + '
    ' + lang.removeFormat + '' + lang.indent + '
    ' + lang.alignment + '' + + '' + me.getLang("justifyleft") + + '' + me.getLang("justifycenter") + + '' + me.getLang("justifyright") + + '
    ' + lang.imageFloat + '' + + '' + me.getLang("default") + + '' + me.getLang("justifyleft") + + '' + me.getLang("justifycenter") + + '' + me.getLang("justifyright") + + '
    ' + lang.removeFontsize + '' + lang.removeFontFamily + '
    ' + lang.removeHtml + '
    ' + lang.pasteFilter + '
    ' + lang.symbol + '' + + '' + lang.bdc2sb + + '' + lang.tobdc + '' + + '
    ' + + '
    ' + + '
    '; + + + }, + _UIBase_render:UIBase.prototype.render + }; + utils.inherits(AutoTypeSetPicker, UIBase); +})(); + + +// ui/autotypesetbutton.js +///import core +///import uicore +///import ui/popup.js +///import ui/autotypesetpicker.js +///import ui/splitbutton.js +(function (){ + var utils = baidu.editor.utils, + Popup = baidu.editor.ui.Popup, + AutoTypeSetPicker = baidu.editor.ui.AutoTypeSetPicker, + SplitButton = baidu.editor.ui.SplitButton, + AutoTypeSetButton = baidu.editor.ui.AutoTypeSetButton = function (options){ + this.initOptions(options); + this.initAutoTypeSetButton(); + }; + function getPara(me){ + + var opt = {}, + cont = me.getDom(), + editorId = me.editor.uid, + inputType = null, + attrName = null, + ipts = domUtils.getElementsByTagName(cont,"input"); + for(var i=ipts.length-1,ipt;ipt=ipts[i--];){ + inputType = ipt.getAttribute("type"); + if(inputType=="checkbox"){ + attrName = ipt.getAttribute("name"); + opt[attrName] && delete opt[attrName]; + if(ipt.checked){ + var attrValue = document.getElementById( attrName + "Value" + editorId ); + if(attrValue){ + if(/input/ig.test(attrValue.tagName)){ + opt[attrName] = attrValue.value; + } else { + var iptChilds = attrValue.getElementsByTagName("input"); + for(var j=iptChilds.length-1,iptchild;iptchild=iptChilds[j--];){ + if(iptchild.checked){ + opt[attrName] = iptchild.value; + break; + } + } + } + } else { + opt[attrName] = true; + } + } else { + opt[attrName] = false; + } + } else { + opt[ipt.getAttribute("value")] = ipt.checked; + } + + } + + var selects = domUtils.getElementsByTagName(cont,"select"); + for(var i=0,si;si=selects[i++];){ + var attr = si.getAttribute('name'); + opt[attr] = opt[attr] ? si.value : ''; + } + + utils.extend(me.editor.options.autotypeset,opt); + + me.editor.setPreferences('autotypeset', opt); + } + + AutoTypeSetButton.prototype = { + initAutoTypeSetButton: function (){ + + var me = this; + this.popup = new Popup({ + //传入配置参数 + content: new AutoTypeSetPicker({editor:me.editor}), + 'editor':me.editor, + hide : function(){ + if (!this._hidden && this.getDom()) { + getPara(this); + this.getDom().style.display = 'none'; + this._hidden = true; + this.fireEvent('hide'); + } + } + }); + var flag = 0; + this.popup.addListener('postRenderAfter',function(){ + var popupUI = this; + if(flag)return; + var cont = this.getDom(), + btn = cont.getElementsByTagName('button')[0]; + + btn.onclick = function(){ + getPara(popupUI); + me.editor.execCommand('autotypeset'); + popupUI.hide() + }; + + domUtils.on(cont, 'click', function(e) { + var target = e.target || e.srcElement, + editorId = me.editor.uid; + if (target && target.tagName == 'INPUT') { + + // 点击图片浮动的checkbox,去除对应的radio + if (target.name == 'imageBlockLine' || target.name == 'textAlign' || target.name == 'symbolConver') { + var checked = target.checked, + radioTd = document.getElementById( target.name + 'Value' + editorId), + radios = radioTd.getElementsByTagName('input'), + defalutSelect = { + 'imageBlockLine': 'none', + 'textAlign': 'left', + 'symbolConver': 'tobdc' + }; + + for (var i = 0; i < radios.length; i++) { + if (checked) { + if (radios[i].value == defalutSelect[target.name]) { + radios[i].checked = 'checked'; + } + } else { + radios[i].checked = false; + } + } + } + // 点击radio,选中对应的checkbox + if (target.name == ('imageBlockLineValue' + editorId) || target.name == ('textAlignValue' + editorId) || target.name == 'bdc') { + var checkboxs = target.parentNode.previousSibling.getElementsByTagName('input'); + checkboxs && (checkboxs[0].checked = true); + } + + getPara(popupUI); + } + }); + + flag = 1; + }); + this.initSplitButton(); + } + }; + utils.inherits(AutoTypeSetButton, SplitButton); + +})(); + + +// ui/cellalignpicker.js +///import core +///import uicore +(function () { + var utils = baidu.editor.utils, + Popup = baidu.editor.ui.Popup, + Stateful = baidu.editor.ui.Stateful, + UIBase = baidu.editor.ui.UIBase; + + /** + * 该参数将新增一个参数: selected, 参数类型为一个Object, 形如{ 'align': 'center', 'valign': 'top' }, 表示单元格的初始 + * 对齐状态为: 竖直居上,水平居中; 其中 align的取值为:'center', 'left', 'right'; valign的取值为: 'top', 'middle', 'bottom' + * @update 2013/4/2 hancong03@baidu.com + */ + var CellAlignPicker = baidu.editor.ui.CellAlignPicker = function (options) { + this.initOptions(options); + this.initSelected(); + this.initCellAlignPicker(); + }; + CellAlignPicker.prototype = { + //初始化选中状态, 该方法将根据传递进来的参数获取到应该选中的对齐方式图标的索引 + initSelected: function(){ + + var status = { + + valign: { + top: 0, + middle: 1, + bottom: 2 + }, + align: { + left: 0, + center: 1, + right: 2 + }, + count: 3 + + }, + result = -1; + + if( this.selected ) { + this.selectedIndex = status.valign[ this.selected.valign ] * status.count + status.align[ this.selected.align ]; + } + + }, + initCellAlignPicker:function () { + this.initUIBase(); + this.Stateful_init(); + }, + getHtmlTpl:function () { + + var alignType = [ 'left', 'center', 'right' ], + COUNT = 9, + tempClassName = null, + tempIndex = -1, + tmpl = []; + + + for( var i= 0; i'); + + tmpl.push( '
    ' ); + + tempIndex === 2 && tmpl.push(''); + + } + + return '
    ' + + '
    ' + + '' + + tmpl.join('') + + '
    ' + + '
    ' + + '
    '; + }, + getStateDom: function (){ + return this.target; + }, + _onClick: function (evt){ + var target= evt.target || evt.srcElement; + if(/icon/.test(target.className)){ + this.items[target.parentNode.getAttribute("index")].onclick(); + Popup.postHide(evt); + } + }, + _UIBase_render:UIBase.prototype.render + }; + utils.inherits(CellAlignPicker, UIBase); + utils.extend(CellAlignPicker.prototype, Stateful,true); +})(); + + + + + +// ui/pastepicker.js +///import core +///import uicore +(function () { + var utils = baidu.editor.utils, + Stateful = baidu.editor.ui.Stateful, + uiUtils = baidu.editor.ui.uiUtils, + UIBase = baidu.editor.ui.UIBase; + + var PastePicker = baidu.editor.ui.PastePicker = function (options) { + this.initOptions(options); + this.initPastePicker(); + }; + PastePicker.prototype = { + initPastePicker:function () { + this.initUIBase(); + this.Stateful_init(); + }, + getHtmlTpl:function () { + return '
    ' + + '
    ' + + '
    ' + this.editor.getLang("pasteOpt") + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + }, + getStateDom:function () { + return this.target; + }, + format:function (param) { + this.editor.ui._isTransfer = true; + this.editor.fireEvent('pasteTransfer', param); + }, + _onClick:function (cur) { + var node = domUtils.getNextDomNode(cur), + screenHt = uiUtils.getViewportRect().height, + subPop = uiUtils.getClientRect(node); + + if ((subPop.top + subPop.height) > screenHt) + node.style.top = (-subPop.height - cur.offsetHeight) + "px"; + else + node.style.top = ""; + + if (/hidden/ig.test(domUtils.getComputedStyle(node, "visibility"))) { + node.style.visibility = "visible"; + domUtils.addClass(cur, "edui-state-opened"); + } else { + node.style.visibility = "hidden"; + domUtils.removeClasses(cur, "edui-state-opened") + } + }, + _UIBase_render:UIBase.prototype.render + }; + utils.inherits(PastePicker, UIBase); + utils.extend(PastePicker.prototype, Stateful, true); +})(); + + + + + + +// ui/toolbar.js +(function (){ + var utils = baidu.editor.utils, + uiUtils = baidu.editor.ui.uiUtils, + UIBase = baidu.editor.ui.UIBase, + Toolbar = baidu.editor.ui.Toolbar = function (options){ + this.initOptions(options); + this.initToolbar(); + }; + Toolbar.prototype = { + items: null, + initToolbar: function (){ + this.items = this.items || []; + this.initUIBase(); + }, + add: function (item,index){ + if(index === undefined){ + this.items.push(item); + }else{ + this.items.splice(index,0,item) + } + + }, + getHtmlTpl: function (){ + var buff = []; + for (var i=0; i' + + buff.join('') + + '
    ' + }, + postRender: function (){ + var box = this.getDom(); + for (var i=0; i
    '; + }, + postRender:function () { + }, + queryAutoHide:function () { + return true; + } + }; + Menu.prototype = { + items:null, + uiName:'menu', + initMenu:function () { + this.items = this.items || []; + this.initPopup(); + this.initItems(); + }, + initItems:function () { + for (var i = 0; i < this.items.length; i++) { + var item = this.items[i]; + if (item == '-') { + this.items[i] = this.getSeparator(); + } else if (!(item instanceof MenuItem)) { + item.editor = this.editor; + item.theme = this.editor.options.theme; + this.items[i] = this.createItem(item); + } + } + }, + getSeparator:function () { + return menuSeparator; + }, + createItem:function (item) { + //新增一个参数menu, 该参数存储了menuItem所对应的menu引用 + item.menu = this; + return new MenuItem(item); + }, + _Popup_getContentHtmlTpl:Popup.prototype.getContentHtmlTpl, + getContentHtmlTpl:function () { + if (this.items.length == 0) { + return this._Popup_getContentHtmlTpl(); + } + var buff = []; + for (var i = 0; i < this.items.length; i++) { + var item = this.items[i]; + buff[i] = item.renderHtml(); + } + return ('
    ' + buff.join('') + '
    '); + }, + _Popup_postRender:Popup.prototype.postRender, + postRender:function () { + var me = this; + for (var i = 0; i < this.items.length; i++) { + var item = this.items[i]; + item.ownerMenu = this; + item.postRender(); + } + domUtils.on(this.getDom(), 'mouseover', function (evt) { + evt = evt || event; + var rel = evt.relatedTarget || evt.fromElement; + var el = me.getDom(); + if (!uiUtils.contains(el, rel) && el !== rel) { + me.fireEvent('over'); + } + }); + this._Popup_postRender(); + }, + queryAutoHide:function (el) { + if (el) { + if (uiUtils.contains(this.getDom(), el)) { + return false; + } + for (var i = 0; i < this.items.length; i++) { + var item = this.items[i]; + if (item.queryAutoHide(el) === false) { + return false; + } + } + } + }, + clearItems:function () { + for (var i = 0; i < this.items.length; i++) { + var item = this.items[i]; + clearTimeout(item._showingTimer); + clearTimeout(item._closingTimer); + if (item.subMenu) { + item.subMenu.destroy(); + } + } + this.items = []; + }, + destroy:function () { + if (this.getDom()) { + domUtils.remove(this.getDom()); + } + this.clearItems(); + }, + dispose:function () { + this.destroy(); + } + }; + utils.inherits(Menu, Popup); + + /** + * @update 2013/04/03 hancong03 新增一个参数menu, 该参数存储了menuItem所对应的menu引用 + * @type {Function} + */ + var MenuItem = baidu.editor.ui.MenuItem = function (options) { + this.initOptions(options); + this.initUIBase(); + this.Stateful_init(); + if (this.subMenu && !(this.subMenu instanceof Menu)) { + if (options.className && options.className.indexOf("aligntd") != -1) { + var me = this; + + //获取单元格对齐初始状态 + this.subMenu.selected = this.editor.queryCommandValue( 'cellalignment' ); + + this.subMenu = new Popup({ + content:new CellAlignPicker(this.subMenu), + parentMenu:me, + editor:me.editor, + destroy:function () { + if (this.getDom()) { + domUtils.remove(this.getDom()); + } + } + }); + this.subMenu.addListener("postRenderAfter", function () { + domUtils.on(this.getDom(), "mouseover", function () { + me.addState('opened'); + }); + }); + } else { + this.subMenu = new Menu(this.subMenu); + } + } + }; + MenuItem.prototype = { + label:'', + subMenu:null, + ownerMenu:null, + uiName:'menuitem', + alwalysHoverable:true, + getHtmlTpl:function () { + return '
    ' + + '
    ' + + this.renderLabelHtml() + + '
    ' + + '
    '; + }, + postRender:function () { + var me = this; + this.addListener('over', function () { + me.ownerMenu.fireEvent('submenuover', me); + if (me.subMenu) { + me.delayShowSubMenu(); + } + }); + if (this.subMenu) { + this.getDom().className += ' edui-hassubmenu'; + this.subMenu.render(); + this.addListener('out', function () { + me.delayHideSubMenu(); + }); + this.subMenu.addListener('over', function () { + clearTimeout(me._closingTimer); + me._closingTimer = null; + me.addState('opened'); + }); + this.ownerMenu.addListener('hide', function () { + me.hideSubMenu(); + }); + this.ownerMenu.addListener('submenuover', function (t, subMenu) { + if (subMenu !== me) { + me.delayHideSubMenu(); + } + }); + this.subMenu._bakQueryAutoHide = this.subMenu.queryAutoHide; + this.subMenu.queryAutoHide = function (el) { + if (el && uiUtils.contains(me.getDom(), el)) { + return false; + } + return this._bakQueryAutoHide(el); + }; + } + this.getDom().style.tabIndex = '-1'; + uiUtils.makeUnselectable(this.getDom()); + this.Stateful_postRender(); + }, + delayShowSubMenu:function () { + var me = this; + if (!me.isDisabled()) { + me.addState('opened'); + clearTimeout(me._showingTimer); + clearTimeout(me._closingTimer); + me._closingTimer = null; + me._showingTimer = setTimeout(function () { + me.showSubMenu(); + }, 250); + } + }, + delayHideSubMenu:function () { + var me = this; + if (!me.isDisabled()) { + me.removeState('opened'); + clearTimeout(me._showingTimer); + if (!me._closingTimer) { + me._closingTimer = setTimeout(function () { + if (!me.hasState('opened')) { + me.hideSubMenu(); + } + me._closingTimer = null; + }, 400); + } + } + }, + renderLabelHtml:function () { + return '
    ' + + '
    ' + + '
    ' + (this.label || '') + '
    '; + }, + getStateDom:function () { + return this.getDom(); + }, + queryAutoHide:function (el) { + if (this.subMenu && this.hasState('opened')) { + return this.subMenu.queryAutoHide(el); + } + }, + _onClick:function (event, this_) { + if (this.hasState('disabled')) return; + if (this.fireEvent('click', event, this_) !== false) { + if (this.subMenu) { + this.showSubMenu(); + } else { + Popup.postHide(event); + } + } + }, + showSubMenu:function () { + var rect = uiUtils.getClientRect(this.getDom()); + rect.right -= 5; + rect.left += 2; + rect.width -= 7; + rect.top -= 4; + rect.bottom += 4; + rect.height += 8; + this.subMenu.showAnchorRect(rect, true, true); + }, + hideSubMenu:function () { + this.subMenu.hide(); + } + }; + utils.inherits(MenuItem, UIBase); + utils.extend(MenuItem.prototype, Stateful, true); +})(); + + +// ui/combox.js +///import core +///import uicore +///import ui/menu.js +///import ui/splitbutton.js +(function (){ + // todo: menu和item提成通用list + var utils = baidu.editor.utils, + uiUtils = baidu.editor.ui.uiUtils, + Menu = baidu.editor.ui.Menu, + SplitButton = baidu.editor.ui.SplitButton, + Combox = baidu.editor.ui.Combox = function (options){ + this.initOptions(options); + this.initCombox(); + }; + Combox.prototype = { + uiName: 'combox', + onbuttonclick:function () { + this.showPopup(); + }, + initCombox: function (){ + var me = this; + this.items = this.items || []; + for (var i=0; i vpRect.right) { + left = vpRect.right - rect.width; + } + var top = offset.top; + if (top + rect.height > vpRect.bottom) { + top = vpRect.bottom - rect.height; + } + el.style.left = Math.max(left, 0) + 'px'; + el.style.top = Math.max(top, 0) + 'px'; + }, + showAtCenter: function (){ + + var vpRect = uiUtils.getViewportRect(); + + if ( !this.fullscreen ) { + this.getDom().style.display = ''; + var popSize = this.fitSize(); + var titleHeight = this.getDom('titlebar').offsetHeight | 0; + var left = vpRect.width / 2 - popSize.width / 2; + var top = vpRect.height / 2 - (popSize.height - titleHeight) / 2 - titleHeight; + var popEl = this.getDom(); + this.safeSetOffset({ + left: Math.max(left | 0, 0), + top: Math.max(top | 0, 0) + }); + if (!domUtils.hasClass(popEl, 'edui-state-centered')) { + popEl.className += ' edui-state-centered'; + } + } else { + var dialogWrapNode = this.getDom(), + contentNode = this.getDom('content'); + + dialogWrapNode.style.display = "block"; + + var wrapRect = UE.ui.uiUtils.getClientRect( dialogWrapNode ), + contentRect = UE.ui.uiUtils.getClientRect( contentNode ); + dialogWrapNode.style.left = "-100000px"; + + contentNode.style.width = ( vpRect.width - wrapRect.width + contentRect.width ) + "px"; + contentNode.style.height = ( vpRect.height - wrapRect.height + contentRect.height ) + "px"; + + dialogWrapNode.style.width = vpRect.width + "px"; + dialogWrapNode.style.height = vpRect.height + "px"; + dialogWrapNode.style.left = 0; + + //保存环境的overflow值 + this._originalContext = { + html: { + overflowX: document.documentElement.style.overflowX, + overflowY: document.documentElement.style.overflowY + }, + body: { + overflowX: document.body.style.overflowX, + overflowY: document.body.style.overflowY + } + }; + + document.documentElement.style.overflowX = 'hidden'; + document.documentElement.style.overflowY = 'hidden'; + document.body.style.overflowX = 'hidden'; + document.body.style.overflowY = 'hidden'; + + } + + this._show(); + }, + getContentHtml: function (){ + var contentHtml = ''; + if (typeof this.content == 'string') { + contentHtml = this.content; + } else if (this.iframeUrl) { + contentHtml = ''; + } + return contentHtml; + }, + getHtmlTpl: function (){ + var footHtml = ''; + + if (this.buttons) { + var buff = []; + for (var i=0; i' + buff.join('') + '
    ' + + '
    '; + } + + return '
    ' + + '
    ' + + '
    ' + + '
    ' + + '' + (this.title || '') + '' + + '
    ' + + this.closeButton.renderHtml() + + '
    ' + + '
    '+ ( this.autoReset ? '' : this.getContentHtml()) +'
    ' + + footHtml + + '
    '; + }, + postRender: function (){ + // todo: 保持居中/记住上次关闭位置选项 + if (!this.modalMask.getDom()) { + this.modalMask.render(); + this.modalMask.hide(); + } + if (!this.dragMask.getDom()) { + this.dragMask.render(); + this.dragMask.hide(); + } + var me = this; + this.addListener('show', function (){ + me.modalMask.show(this.getDom().style.zIndex - 2); + }); + this.addListener('hide', function (){ + me.modalMask.hide(); + }); + if (this.buttons) { + for (var i=0; i'; + me.editor.container.style.zIndex && (this.getDom().style.zIndex = me.editor.container.style.zIndex * 1 + 1); + } + } + // canSideUp:false, + // canSideLeft:false + }); + this.onbuttonclick = function(){ + this.showPopup(); + }; + this.initSplitButton(); + } + + }; + + utils.inherits(MultiMenuPop, SplitButton); +})(); + + +// ui/shortcutmenu.js +(function () { + var UI = baidu.editor.ui, + UIBase = UI.UIBase, + uiUtils = UI.uiUtils, + utils = baidu.editor.utils, + domUtils = baidu.editor.dom.domUtils; + + var allMenus = [],//存储所有快捷菜单 + timeID, + isSubMenuShow = false;//是否有子pop显示 + + var ShortCutMenu = UI.ShortCutMenu = function (options) { + this.initOptions (options); + this.initShortCutMenu (); + }; + + ShortCutMenu.postHide = hideAllMenu; + + ShortCutMenu.prototype = { + isHidden : true , + SPACE : 5 , + initShortCutMenu : function () { + this.items = this.items || []; + this.initUIBase (); + this.initItems (); + this.initEvent (); + allMenus.push (this); + } , + initEvent : function () { + var me = this, + doc = me.editor.document; + + domUtils.on (doc , "mousemove" , function (e) { + if (me.isHidden === false) { + //有pop显示就不隐藏快捷菜单 + if (me.getSubMenuMark () || me.eventType == "contextmenu") return; + + + var flag = true, + el = me.getDom (), + wt = el.offsetWidth, + ht = el.offsetHeight, + distanceX = wt / 2 + me.SPACE,//距离中心X标准 + distanceY = ht / 2,//距离中心Y标准 + x = Math.abs (e.screenX - me.left),//离中心距离横坐标 + y = Math.abs (e.screenY - me.top);//离中心距离纵坐标 + + clearTimeout (timeID); + timeID = setTimeout (function () { + if (y > 0 && y < distanceY) { + me.setOpacity (el , "1"); + } else if (y > distanceY && y < distanceY + 70) { + me.setOpacity (el , "0.5"); + flag = false; + } else if (y > distanceY + 70 && y < distanceY + 140) { + me.hide (); + } + + if (flag && x > 0 && x < distanceX) { + me.setOpacity (el , "1") + } else if (x > distanceX && x < distanceX + 70) { + me.setOpacity (el , "0.5") + } else if (x > distanceX + 70 && x < distanceX + 140) { + me.hide (); + } + }); + } + }); + + //ie\ff下 mouseout不准 + if (browser.chrome) { + domUtils.on (doc , "mouseout" , function (e) { + var relatedTgt = e.relatedTarget || e.toElement; + + if (relatedTgt == null || relatedTgt.tagName == "HTML") { + me.hide (); + } + }); + } + + me.editor.addListener ("afterhidepop" , function () { + if (!me.isHidden) { + isSubMenuShow = true; + } + }); + + } , + initItems : function () { + if (utils.isArray (this.items)) { + for (var i = 0, len = this.items.length ; i < len ; i++) { + var item = this.items[i].toLowerCase (); + + if (UI[item]) { + this.items[i] = new UI[item] (this.editor); + this.items[i].className += " edui-shortcutsubmenu "; + } + } + } + } , + setOpacity : function (el , value) { + if (browser.ie && browser.version < 9) { + el.style.filter = "alpha(opacity = " + parseFloat (value) * 100 + ");" + } else { + el.style.opacity = value; + } + } , + getSubMenuMark : function () { + isSubMenuShow = false; + var layerEle = uiUtils.getFixedLayer (); + var list = domUtils.getElementsByTagName (layerEle , "div" , function (node) { + return domUtils.hasClass (node , "edui-shortcutsubmenu edui-popup") + }); + + for (var i = 0, node ; node = list[i++] ;) { + if (node.style.display != "none") { + isSubMenuShow = true; + } + } + return isSubMenuShow; + } , + show : function (e , hasContextmenu) { + var me = this, + offset = {}, + el = this.getDom (), + fixedlayer = uiUtils.getFixedLayer (); + + function setPos (offset) { + if (offset.left < 0) { + offset.left = 0; + } + if (offset.top < 0) { + offset.top = 0; + } + el.style.cssText = "position:absolute;left:" + offset.left + "px;top:" + offset.top + "px;"; + } + + function setPosByCxtMenu (menu) { + if (!menu.tagName) { + menu = menu.getDom (); + } + offset.left = parseInt (menu.style.left); + offset.top = parseInt (menu.style.top); + offset.top -= el.offsetHeight + 15; + setPos (offset); + } + + + me.eventType = e.type; + el.style.cssText = "display:block;left:-9999px"; + + if (e.type == "contextmenu" && hasContextmenu) { + var menu = domUtils.getElementsByTagName (fixedlayer , "div" , "edui-contextmenu")[0]; + if (menu) { + setPosByCxtMenu (menu) + } else { + me.editor.addListener ("aftershowcontextmenu" , function (type , menu) { + setPosByCxtMenu (menu); + }); + } + } else { + offset = uiUtils.getViewportOffsetByEvent (e); + offset.top -= el.offsetHeight + me.SPACE; + offset.left += me.SPACE + 20; + setPos (offset); + me.setOpacity (el , 0.2); + } + + + me.isHidden = false; + me.left = e.screenX + el.offsetWidth / 2 - me.SPACE; + me.top = e.screenY - (el.offsetHeight / 2) - me.SPACE; + + if (me.editor) { + el.style.zIndex = me.editor.container.style.zIndex * 1 + 10; + fixedlayer.style.zIndex = el.style.zIndex - 1; + } + } , + hide : function () { + if (this.getDom ()) { + this.getDom ().style.display = "none"; + } + this.isHidden = true; + } , + postRender : function () { + if (utils.isArray (this.items)) { + for (var i = 0, item ; item = this.items[i++] ;) { + item.postRender (); + } + } + } , + getHtmlTpl : function () { + var buff; + if (utils.isArray (this.items)) { + buff = []; + for (var i = 0 ; i < this.items.length ; i++) { + buff[i] = this.items[i].renderHtml (); + } + buff = buff.join (""); + } else { + buff = this.items; + } + + return '
    ' + + buff + + '
    '; + } + }; + + utils.inherits (ShortCutMenu , UIBase); + + function hideAllMenu (e) { + var tgt = e.target || e.srcElement, + cur = domUtils.findParent (tgt , function (node) { + return domUtils.hasClass (node , "edui-shortcutmenu") || domUtils.hasClass (node , "edui-popup"); + } , true); + + if (!cur) { + for (var i = 0, menu ; menu = allMenus[i++] ;) { + menu.hide () + } + } + } + + domUtils.on (document , 'mousedown' , function (e) { + hideAllMenu (e); + }); + + domUtils.on (window , 'scroll' , function (e) { + hideAllMenu (e); + }); + +}) (); + + +// ui/breakline.js +(function (){ + var utils = baidu.editor.utils, + UIBase = baidu.editor.ui.UIBase, + Breakline = baidu.editor.ui.Breakline = function (options){ + this.initOptions(options); + this.initSeparator(); + }; + Breakline.prototype = { + uiName: 'Breakline', + initSeparator: function (){ + this.initUIBase(); + }, + getHtmlTpl: function (){ + return '
    '; + } + }; + utils.inherits(Breakline, UIBase); + +})(); + + +// ui/message.js +///import core +///import uicore +(function () { + var utils = baidu.editor.utils, + domUtils = baidu.editor.dom.domUtils, + UIBase = baidu.editor.ui.UIBase, + Message = baidu.editor.ui.Message = function (options){ + this.initOptions(options); + this.initMessage(); + }; + + Message.prototype = { + initMessage: function (){ + this.initUIBase(); + }, + getHtmlTpl: function (){ + return '
    ' + + '
    ×
    ' + + '
    ' + + ' ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    '; + }, + reset: function(opt){ + var me = this; + if (!opt.keepshow) { + clearTimeout(this.timer); + me.timer = setTimeout(function(){ + me.hide(); + }, opt.timeout || 4000); + } + + opt.content !== undefined && me.setContent(opt.content); + opt.type !== undefined && me.setType(opt.type); + + me.show(); + }, + postRender: function(){ + var me = this, + closer = this.getDom('closer'); + closer && domUtils.on(closer, 'click', function(){ + me.hide(); + }); + }, + setContent: function(content){ + this.getDom('content').innerHTML = content; + }, + setType: function(type){ + type = type || 'info'; + var body = this.getDom('body'); + body.className = body.className.replace(/edui-message-type-[\w-]+/, 'edui-message-type-' + type); + }, + getContent: function(){ + return this.getDom('content').innerHTML; + }, + getType: function(){ + var arr = this.getDom('body').match(/edui-message-type-([\w-]+)/); + return arr ? arr[1]:''; + }, + show: function (){ + this.getDom().style.display = 'block'; + }, + hide: function (){ + var dom = this.getDom(); + if (dom) { + dom.style.display = 'none'; + dom.parentNode && dom.parentNode.removeChild(dom); + } + } + }; + + utils.inherits(Message, UIBase); + +})(); + + +// adapter/editorui.js +//ui跟编辑器的适配層 +//那个按钮弹出是dialog,是下拉筐等都是在这个js中配置 +//自己写的ui也要在这里配置,放到baidu.editor.ui下边,当编辑器实例化的时候会根据ueditor.config中的toolbars找到相应的进行实例化 +(function () { + var utils = baidu.editor.utils; + var editorui = baidu.editor.ui; + var _Dialog = editorui.Dialog; + editorui.buttons = {}; + + editorui.Dialog = function (options) { + var dialog = new _Dialog(options); + dialog.addListener('hide', function () { + + if (dialog.editor) { + var editor = dialog.editor; + try { + if (browser.gecko) { + var y = editor.window.scrollY, + x = editor.window.scrollX; + editor.body.focus(); + editor.window.scrollTo(x, y); + } else { + editor.focus(); + } + + + } catch (ex) { + } + } + }); + return dialog; + }; + + var iframeUrlMap = { + 'anchor':'~/dialogs/anchor/anchor.html', + 'insertimage':'~/dialogs/image/image.html', + 'link':'~/dialogs/link/link.html', + 'spechars':'~/dialogs/spechars/spechars.html', + 'searchreplace':'~/dialogs/searchreplace/searchreplace.html', + 'map':'~/dialogs/map/map.html', + 'gmap':'~/dialogs/gmap/gmap.html', + 'insertvideo':'~/dialogs/video/video.html', + 'help':'~/dialogs/help/help.html', + 'preview':'~/dialogs/preview/preview.html', + 'emotion':'~/dialogs/emotion/emotion.html', + 'wordimage':'~/dialogs/wordimage/wordimage.html', + 'attachment':'~/dialogs/attachment/attachment.html', + 'insertframe':'~/dialogs/insertframe/insertframe.html', + 'edittip':'~/dialogs/table/edittip.html', + 'edittable':'~/dialogs/table/edittable.html', + 'edittd':'~/dialogs/table/edittd.html', + 'webapp':'~/dialogs/webapp/webapp.html', + 'snapscreen':'~/dialogs/snapscreen/snapscreen.html', + 'scrawl':'~/dialogs/scrawl/scrawl.html', + 'music':'~/dialogs/music/music.html', + 'template':'~/dialogs/template/template.html', + 'background':'~/dialogs/background/background.html', + 'charts': '~/dialogs/charts/charts.html' + }; + //为工具栏添加按钮,以下都是统一的按钮触发命令,所以写在一起 + var btnCmds = ['undo', 'redo', 'formatmatch', + 'bold', 'italic', 'underline', 'fontborder', 'touppercase', 'tolowercase', + 'strikethrough', 'subscript', 'superscript', 'source', 'indent', 'outdent', + 'blockquote', 'pasteplain', 'pagebreak', + 'selectall', 'print','horizontal', 'removeformat', 'time', 'date', 'unlink', + 'insertparagraphbeforetable', 'insertrow', 'insertcol', 'mergeright', 'mergedown', 'deleterow', + 'deletecol', 'splittorows', 'splittocols', 'splittocells', 'mergecells', 'deletetable', 'drafts', + 'lbinsertimage','lbinsertvideo','lbinsertmusic']; + + for (var i = 0, ci; ci = btnCmds[i++];) { + ci = ci.toLowerCase(); + editorui[ci] = function (cmd) { + return function (editor) { + var ui = new editorui.Button({ + className:'edui-for-' + cmd, + title:editor.options.labelMap[cmd] || editor.getLang("labelMap." + cmd) || '', + onclick:function () { + editor.execCommand(cmd); + }, + theme:editor.options.theme, + showText:false + }); + editorui.buttons[cmd] = ui; + editor.addListener('selectionchange', function (type, causeByUi, uiReady) { + var state = editor.queryCommandState(cmd); + if (state == -1) { + ui.setDisabled(true); + ui.setChecked(false); + } else { + if (!uiReady) { + ui.setDisabled(false); + ui.setChecked(state); + } + } + }); + return ui; + }; + }(ci); + } + + //清除文档 + editorui.cleardoc = function (editor) { + var ui = new editorui.Button({ + className:'edui-for-cleardoc', + title:editor.options.labelMap.cleardoc || editor.getLang("labelMap.cleardoc") || '', + theme:editor.options.theme, + onclick:function () { + if (confirm(editor.getLang("confirmClear"))) { + editor.execCommand('cleardoc'); + } + } + }); + editorui.buttons["cleardoc"] = ui; + editor.addListener('selectionchange', function () { + ui.setDisabled(editor.queryCommandState('cleardoc') == -1); + }); + return ui; + }; + + //排版,图片排版,文字方向 + var typeset = { + 'justify':['left', 'right', 'center', 'justify'], + 'imagefloat':['none', 'left', 'center', 'right'], + 'directionality':['ltr', 'rtl'] + }; + + for (var p in typeset) { + + (function (cmd, val) { + for (var i = 0, ci; ci = val[i++];) { + (function (cmd2) { + editorui[cmd.replace('float', '') + cmd2] = function (editor) { + var ui = new editorui.Button({ + className:'edui-for-' + cmd.replace('float', '') + cmd2, + title:editor.options.labelMap[cmd.replace('float', '') + cmd2] || editor.getLang("labelMap." + cmd.replace('float', '') + cmd2) || '', + theme:editor.options.theme, + onclick:function () { + editor.execCommand(cmd, cmd2); + } + }); + editorui.buttons[cmd] = ui; + editor.addListener('selectionchange', function (type, causeByUi, uiReady) { + ui.setDisabled(editor.queryCommandState(cmd) == -1); + ui.setChecked(editor.queryCommandValue(cmd) == cmd2 && !uiReady); + }); + return ui; + }; + })(ci) + } + })(p, typeset[p]) + } + + //字体颜色和背景颜色 + for (var i = 0, ci; ci = ['backcolor', 'forecolor'][i++];) { + editorui[ci] = function (cmd) { + return function (editor) { + var ui = new editorui.ColorButton({ + className:'edui-for-' + cmd, + color:'default', + title:editor.options.labelMap[cmd] || editor.getLang("labelMap." + cmd) || '', + editor:editor, + onpickcolor:function (t, color) { + editor.execCommand(cmd, color); + }, + onpicknocolor:function () { + editor.execCommand(cmd, 'default'); + this.setColor('transparent'); + this.color = 'default'; + }, + onbuttonclick:function () { + editor.execCommand(cmd, this.color); + } + }); + editorui.buttons[cmd] = ui; + editor.addListener('selectionchange', function () { + ui.setDisabled(editor.queryCommandState(cmd) == -1); + }); + return ui; + }; + }(ci); + } + + + var dialogBtns = { + noOk:['searchreplace', 'help', 'spechars', 'webapp','preview'], + ok:['attachment', 'anchor', 'link', 'insertimage', 'map', 'gmap', 'insertframe', 'wordimage', + 'insertvideo', 'insertframe', 'edittip', 'edittable', 'edittd', 'scrawl', 'template', 'music', 'background', 'charts'] + }; + + for (var p in dialogBtns) { + (function (type, vals) { + for (var i = 0, ci; ci = vals[i++];) { + //todo opera下存在问题 + if (browser.opera && ci === "searchreplace") { + continue; + } + (function (cmd) { + editorui[cmd] = function (editor, iframeUrl, title) { + iframeUrl = iframeUrl || (editor.options.iframeUrlMap || {})[cmd] || iframeUrlMap[cmd]; + title = editor.options.labelMap[cmd] || editor.getLang("labelMap." + cmd) || ''; + + var dialog; + //没有iframeUrl不创建dialog + if (iframeUrl) { + dialog = new editorui.Dialog(utils.extend({ + iframeUrl:editor.ui.mapUrl(iframeUrl), + editor:editor, + className:'edui-for-' + cmd, + title:title, + holdScroll: cmd === 'insertimage', + fullscreen: /charts|preview/.test(cmd), + closeDialog:editor.getLang("closeDialog") + }, type == 'ok' ? { + buttons:[ + { + className:'edui-okbutton', + label:editor.getLang("ok"), + editor:editor, + onclick:function () { + dialog.close(true); + } + }, + { + className:'edui-cancelbutton', + label:editor.getLang("cancel"), + editor:editor, + onclick:function () { + dialog.close(false); + } + } + ] + } : {})); + + editor.ui._dialogs[cmd + "Dialog"] = dialog; + } + + var ui = new editorui.Button({ + className:'edui-for-' + cmd, + title:title, + onclick:function () { + if (dialog) { + switch (cmd) { + case "wordimage": + var images = editor.execCommand("wordimage"); + if (images && images.length) { + dialog.render(); + dialog.open(); + } + break; + case "scrawl": + if (editor.queryCommandState("scrawl") != -1) { + dialog.render(); + dialog.open(); + } + + break; + default: + dialog.render(); + dialog.open(); + } + } + }, + theme:editor.options.theme, + disabled:(cmd == 'scrawl' && editor.queryCommandState("scrawl") == -1) || ( cmd == 'charts' ) + }); + editorui.buttons[cmd] = ui; + editor.addListener('selectionchange', function () { + //只存在于右键菜单而无工具栏按钮的ui不需要检测状态 + var unNeedCheckState = {'edittable':1}; + if (cmd in unNeedCheckState)return; + + var state = editor.queryCommandState(cmd); + if (ui.getDom()) { + ui.setDisabled(state == -1); + ui.setChecked(state); + } + + }); + + return ui; + }; + })(ci.toLowerCase()) + } + })(p, dialogBtns[p]); + } + + editorui.snapscreen = function (editor, iframeUrl, title) { + title = editor.options.labelMap['snapscreen'] || editor.getLang("labelMap.snapscreen") || ''; + var ui = new editorui.Button({ + className:'edui-for-snapscreen', + title:title, + onclick:function () { + editor.execCommand("snapscreen"); + }, + theme:editor.options.theme + + }); + editorui.buttons['snapscreen'] = ui; + iframeUrl = iframeUrl || (editor.options.iframeUrlMap || {})["snapscreen"] || iframeUrlMap["snapscreen"]; + if (iframeUrl) { + var dialog = new editorui.Dialog({ + iframeUrl:editor.ui.mapUrl(iframeUrl), + editor:editor, + className:'edui-for-snapscreen', + title:title, + buttons:[ + { + className:'edui-okbutton', + label:editor.getLang("ok"), + editor:editor, + onclick:function () { + dialog.close(true); + } + }, + { + className:'edui-cancelbutton', + label:editor.getLang("cancel"), + editor:editor, + onclick:function () { + dialog.close(false); + } + } + ] + + }); + dialog.render(); + editor.ui._dialogs["snapscreenDialog"] = dialog; + } + editor.addListener('selectionchange', function () { + ui.setDisabled(editor.queryCommandState('snapscreen') == -1); + }); + return ui; + }; + + editorui.insertcode = function (editor, list, title) { + list = editor.options['insertcode'] || []; + title = editor.options.labelMap['insertcode'] || editor.getLang("labelMap.insertcode") || ''; + // if (!list.length) return; + var items = []; + utils.each(list,function(key,val){ + items.push({ + label:key, + value:val, + theme:editor.options.theme, + renderLabelHtml:function () { + return '
    ' + (this.label || '') + '
    '; + } + }); + }); + + var ui = new editorui.Combox({ + editor:editor, + items:items, + onselect:function (t, index) { + editor.execCommand('insertcode', this.items[index].value); + }, + onbuttonclick:function () { + this.showPopup(); + }, + title:title, + initValue:title, + className:'edui-for-insertcode', + indexByValue:function (value) { + if (value) { + for (var i = 0, ci; ci = this.items[i]; i++) { + if (ci.value.indexOf(value) != -1) + return i; + } + } + + return -1; + } + }); + editorui.buttons['insertcode'] = ui; + editor.addListener('selectionchange', function (type, causeByUi, uiReady) { + if (!uiReady) { + var state = editor.queryCommandState('insertcode'); + if (state == -1) { + ui.setDisabled(true); + } else { + ui.setDisabled(false); + var value = editor.queryCommandValue('insertcode'); + if(!value){ + ui.setValue(title); + return; + } + //trace:1871 ie下从源码模式切换回来时,字体会带单引号,而且会有逗号 + value && (value = value.replace(/['"]/g, '').split(',')[0]); + ui.setValue(value); + + } + } + + }); + return ui; + }; + editorui.fontfamily = function (editor, list, title) { + + list = editor.options['fontfamily'] || []; + title = editor.options.labelMap['fontfamily'] || editor.getLang("labelMap.fontfamily") || ''; + if (!list.length) return; + for (var i = 0, ci, items = []; ci = list[i]; i++) { + var langLabel = editor.getLang('fontfamily')[ci.name] || ""; + (function (key, val) { + items.push({ + label:key, + value:val, + theme:editor.options.theme, + renderLabelHtml:function () { + return '
    ' + (this.label || '') + '
    '; + } + }); + })(ci.label || langLabel, ci.val) + } + var ui = new editorui.Combox({ + editor:editor, + items:items, + onselect:function (t, index) { + editor.execCommand('FontFamily', this.items[index].value); + }, + onbuttonclick:function () { + this.showPopup(); + }, + title:title, + initValue:title, + className:'edui-for-fontfamily', + indexByValue:function (value) { + if (value) { + for (var i = 0, ci; ci = this.items[i]; i++) { + if (ci.value.indexOf(value) != -1) + return i; + } + } + + return -1; + } + }); + editorui.buttons['fontfamily'] = ui; + editor.addListener('selectionchange', function (type, causeByUi, uiReady) { + if (!uiReady) { + var state = editor.queryCommandState('FontFamily'); + if (state == -1) { + ui.setDisabled(true); + } else { + ui.setDisabled(false); + var value = editor.queryCommandValue('FontFamily'); + //trace:1871 ie下从源码模式切换回来时,字体会带单引号,而且会有逗号 + value && (value = value.replace(/['"]/g, '').split(',')[0]); + ui.setValue(value); + + } + } + + }); + return ui; + }; + + editorui.fontsize = function (editor, list, title) { + title = editor.options.labelMap['fontsize'] || editor.getLang("labelMap.fontsize") || ''; + list = list || editor.options['fontsize'] || []; + if (!list.length) return; + var items = []; + for (var i = 0; i < list.length; i++) { + var size = list[i] + 'px'; + items.push({ + label:size, + value:size, + theme:editor.options.theme, + renderLabelHtml:function () { + return '
    ' + (this.label || '') + '
    '; + } + }); + } + var ui = new editorui.Combox({ + editor:editor, + items:items, + title:title, + initValue:title, + onselect:function (t, index) { + editor.execCommand('FontSize', this.items[index].value); + }, + onbuttonclick:function () { + this.showPopup(); + }, + className:'edui-for-fontsize' + }); + editorui.buttons['fontsize'] = ui; + editor.addListener('selectionchange', function (type, causeByUi, uiReady) { + if (!uiReady) { + var state = editor.queryCommandState('FontSize'); + if (state == -1) { + ui.setDisabled(true); + } else { + ui.setDisabled(false); + ui.setValue(editor.queryCommandValue('FontSize')); + } + } + + }); + return ui; + }; + + editorui.paragraph = function (editor, list, title) { + title = editor.options.labelMap['paragraph'] || editor.getLang("labelMap.paragraph") || ''; + list = editor.options['paragraph'] || []; + if (utils.isEmptyObject(list)) return; + var items = []; + for (var i in list) { + items.push({ + value:i, + label:list[i] || editor.getLang("paragraph")[i], + theme:editor.options.theme, + renderLabelHtml:function () { + return '
    ' + (this.label || '') + '
    '; + } + }) + } + var ui = new editorui.Combox({ + editor:editor, + items:items, + title:title, + initValue:title, + className:'edui-for-paragraph', + onselect:function (t, index) { + editor.execCommand('Paragraph', this.items[index].value); + }, + onbuttonclick:function () { + this.showPopup(); + } + }); + editorui.buttons['paragraph'] = ui; + editor.addListener('selectionchange', function (type, causeByUi, uiReady) { + if (!uiReady) { + var state = editor.queryCommandState('Paragraph'); + if (state == -1) { + ui.setDisabled(true); + } else { + ui.setDisabled(false); + var value = editor.queryCommandValue('Paragraph'); + var index = ui.indexByValue(value); + if (index != -1) { + ui.setValue(value); + } else { + ui.setValue(ui.initValue); + } + } + } + + }); + return ui; + }; + + + //自定义标题 + editorui.customstyle = function (editor) { + var list = editor.options['customstyle'] || [], + title = editor.options.labelMap['customstyle'] || editor.getLang("labelMap.customstyle") || ''; + if (!list.length)return; + var langCs = editor.getLang('customstyle'); + for (var i = 0, items = [], t; t = list[i++];) { + (function (t) { + var ck = {}; + ck.label = t.label ? t.label : langCs[t.name]; + ck.style = t.style; + ck.className = t.className; + ck.tag = t.tag; + items.push({ + label:ck.label, + value:ck, + theme:editor.options.theme, + renderLabelHtml:function () { + return '
    ' + '<' + ck.tag + ' ' + (ck.className ? ' class="' + ck.className + '"' : "") + + (ck.style ? ' style="' + ck.style + '"' : "") + '>' + ck.label + "<\/" + ck.tag + ">" + + '
    '; + } + }); + })(t); + } + + var ui = new editorui.Combox({ + editor:editor, + items:items, + title:title, + initValue:title, + className:'edui-for-customstyle', + onselect:function (t, index) { + editor.execCommand('customstyle', this.items[index].value); + }, + onbuttonclick:function () { + this.showPopup(); + }, + indexByValue:function (value) { + for (var i = 0, ti; ti = this.items[i++];) { + if (ti.label == value) { + return i - 1 + } + } + return -1; + } + }); + editorui.buttons['customstyle'] = ui; + editor.addListener('selectionchange', function (type, causeByUi, uiReady) { + if (!uiReady) { + var state = editor.queryCommandState('customstyle'); + if (state == -1) { + ui.setDisabled(true); + } else { + ui.setDisabled(false); + var value = editor.queryCommandValue('customstyle'); + var index = ui.indexByValue(value); + if (index != -1) { + ui.setValue(value); + } else { + ui.setValue(ui.initValue); + } + } + } + + }); + return ui; + }; + editorui.inserttable = function (editor, iframeUrl, title) { + title = editor.options.labelMap['inserttable'] || editor.getLang("labelMap.inserttable") || ''; + var ui = new editorui.TableButton({ + editor:editor, + title:title, + className:'edui-for-inserttable', + onpicktable:function (t, numCols, numRows) { + editor.execCommand('InsertTable', {numRows:numRows, numCols:numCols, border:1}); + }, + onbuttonclick:function () { + this.showPopup(); + } + }); + editorui.buttons['inserttable'] = ui; + editor.addListener('selectionchange', function () { + ui.setDisabled(editor.queryCommandState('inserttable') == -1); + }); + return ui; + }; + + editorui.lineheight = function (editor) { + var val = editor.options.lineheight || []; + if (!val.length)return; + for (var i = 0, ci, items = []; ci = val[i++];) { + items.push({ + //todo:写死了 + label:ci, + value:ci, + theme:editor.options.theme, + onclick:function () { + editor.execCommand("lineheight", this.value); + } + }) + } + var ui = new editorui.MenuButton({ + editor:editor, + className:'edui-for-lineheight', + title:editor.options.labelMap['lineheight'] || editor.getLang("labelMap.lineheight") || '', + items:items, + onbuttonclick:function () { + var value = editor.queryCommandValue('LineHeight') || this.value; + editor.execCommand("LineHeight", value); + } + }); + editorui.buttons['lineheight'] = ui; + editor.addListener('selectionchange', function () { + var state = editor.queryCommandState('LineHeight'); + if (state == -1) { + ui.setDisabled(true); + } else { + ui.setDisabled(false); + var value = editor.queryCommandValue('LineHeight'); + value && ui.setValue((value + '').replace(/cm/, '')); + ui.setChecked(state) + } + }); + return ui; + }; + + var rowspacings = ['top', 'bottom']; + for (var r = 0, ri; ri = rowspacings[r++];) { + (function (cmd) { + editorui['rowspacing' + cmd] = function (editor) { + var val = editor.options['rowspacing' + cmd] || []; + if (!val.length) return null; + for (var i = 0, ci, items = []; ci = val[i++];) { + items.push({ + label:ci, + value:ci, + theme:editor.options.theme, + onclick:function () { + editor.execCommand("rowspacing", this.value, cmd); + } + }) + } + var ui = new editorui.MenuButton({ + editor:editor, + className:'edui-for-rowspacing' + cmd, + title:editor.options.labelMap['rowspacing' + cmd] || editor.getLang("labelMap.rowspacing" + cmd) || '', + items:items, + onbuttonclick:function () { + var value = editor.queryCommandValue('rowspacing', cmd) || this.value; + editor.execCommand("rowspacing", value, cmd); + } + }); + editorui.buttons[cmd] = ui; + editor.addListener('selectionchange', function () { + var state = editor.queryCommandState('rowspacing', cmd); + if (state == -1) { + ui.setDisabled(true); + } else { + ui.setDisabled(false); + var value = editor.queryCommandValue('rowspacing', cmd); + value && ui.setValue((value + '').replace(/%/, '')); + ui.setChecked(state) + } + }); + return ui; + } + })(ri) + } + //有序,无序列表 + var lists = ['insertorderedlist', 'insertunorderedlist']; + for (var l = 0, cl; cl = lists[l++];) { + (function (cmd) { + editorui[cmd] = function (editor) { + var vals = editor.options[cmd], + _onMenuClick = function () { + editor.execCommand(cmd, this.value); + }, items = []; + for (var i in vals) { + items.push({ + label:vals[i] || editor.getLang()[cmd][i] || "", + value:i, + theme:editor.options.theme, + onclick:_onMenuClick + }) + } + var ui = new editorui.MenuButton({ + editor:editor, + className:'edui-for-' + cmd, + title:editor.getLang("labelMap." + cmd) || '', + 'items':items, + onbuttonclick:function () { + var value = editor.queryCommandValue(cmd) || this.value; + editor.execCommand(cmd, value); + } + }); + editorui.buttons[cmd] = ui; + editor.addListener('selectionchange', function () { + var state = editor.queryCommandState(cmd); + if (state == -1) { + ui.setDisabled(true); + } else { + ui.setDisabled(false); + var value = editor.queryCommandValue(cmd); + ui.setValue(value); + ui.setChecked(state) + } + }); + return ui; + }; + })(cl) + } + + editorui.fullscreen = function (editor, title) { + title = editor.options.labelMap['fullscreen'] || editor.getLang("labelMap.fullscreen") || ''; + var ui = new editorui.Button({ + className:'edui-for-fullscreen', + title:title, + theme:editor.options.theme, + onclick:function () { + if (editor.ui) { + editor.ui.setFullScreen(!editor.ui.isFullScreen()); + } + this.setChecked(editor.ui.isFullScreen()); + } + }); + editorui.buttons['fullscreen'] = ui; + editor.addListener('selectionchange', function () { + var state = editor.queryCommandState('fullscreen'); + ui.setDisabled(state == -1); + ui.setChecked(editor.ui.isFullScreen()); + }); + return ui; + }; + + // 表情 + editorui["emotion"] = function (editor, iframeUrl) { + var cmd = "emotion"; + var ui = new editorui.MultiMenuPop({ + title:editor.options.labelMap[cmd] || editor.getLang("labelMap." + cmd + "") || '', + editor:editor, + className:'edui-for-' + cmd, + iframeUrl:editor.ui.mapUrl(iframeUrl || (editor.options.iframeUrlMap || {})[cmd] || iframeUrlMap[cmd]) + }); + editorui.buttons[cmd] = ui; + + editor.addListener('selectionchange', function () { + ui.setDisabled(editor.queryCommandState(cmd) == -1) + }); + return ui; + }; + + editorui.autotypeset = function (editor) { + var ui = new editorui.AutoTypeSetButton({ + editor:editor, + title:editor.options.labelMap['autotypeset'] || editor.getLang("labelMap.autotypeset") || '', + className:'edui-for-autotypeset', + onbuttonclick:function () { + editor.execCommand('autotypeset') + } + }); + editorui.buttons['autotypeset'] = ui; + editor.addListener('selectionchange', function () { + ui.setDisabled(editor.queryCommandState('autotypeset') == -1); + }); + return ui; + }; + + /* 简单上传插件 */ + editorui["simpleupload"] = function (editor) { + var name = 'simpleupload', + ui = new editorui.Button({ + className:'edui-for-' + name, + title:editor.options.labelMap[name] || editor.getLang("labelMap." + name) || '', + onclick:function () {}, + theme:editor.options.theme, + showText:false + }); + editorui.buttons[name] = ui; + editor.addListener('ready', function() { + + var b = ui.getDom('body'), + iconSpan = b.children[0]; + editor.fireEvent('simpleuploadbtnready', iconSpan); + }); + editor.addListener('selectionchange', function (type, causeByUi, uiReady) { + var state = editor.queryCommandState(name); + if (state == -1) { + ui.setDisabled(true); + ui.setChecked(false); + } else { + if (!uiReady) { + ui.setDisabled(false); + ui.setChecked(state); + } + } + }); + return ui; + }; + +})(); + + +// adapter/editor.js +///import core +///commands 全屏 +///commandsName FullScreen +///commandsTitle 全屏 +(function () { + var utils = baidu.editor.utils, + uiUtils = baidu.editor.ui.uiUtils, + UIBase = baidu.editor.ui.UIBase, + domUtils = baidu.editor.dom.domUtils; + var nodeStack = []; + + function EditorUI(options) { + this.initOptions(options); + this.initEditorUI(); + } + + EditorUI.prototype = { + uiName:'editor', + initEditorUI:function () { + this.editor.ui = this; + this._dialogs = {}; + this.initUIBase(); + this._initToolbars(); + var editor = this.editor, + me = this; + + editor.addListener('ready', function () { + //提供getDialog方法 + editor.getDialog = function (name) { + return editor.ui._dialogs[name + "Dialog"]; + }; + domUtils.on(editor.window, 'scroll', function (evt) { + baidu.editor.ui.Popup.postHide(evt); + }); + //提供编辑器实时宽高(全屏时宽高不变化) + editor.ui._actualFrameWidth = editor.options.initialFrameWidth; + + UE.browser.ie && UE.browser.version === 6 && editor.container.ownerDocument.execCommand("BackgroundImageCache", false, true); + + //display bottom-bar label based on config + if (editor.options.elementPathEnabled) { + editor.ui.getDom('elementpath').innerHTML = '
    ' + editor.getLang("elementPathTip") + ':
    '; + } + if (editor.options.wordCount) { + function countFn() { + setCount(editor,me); + domUtils.un(editor.document, "click", arguments.callee); + } + domUtils.on(editor.document, "click", countFn); + editor.ui.getDom('wordcount').innerHTML = editor.getLang("wordCountTip"); + } + editor.ui._scale(); + if (editor.options.scaleEnabled) { + if (editor.autoHeightEnabled) { + editor.disableAutoHeight(); + } + me.enableScale(); + } else { + me.disableScale(); + } + if (!editor.options.elementPathEnabled && !editor.options.wordCount && !editor.options.scaleEnabled) { + editor.ui.getDom('elementpath').style.display = "none"; + editor.ui.getDom('wordcount').style.display = "none"; + editor.ui.getDom('scale').style.display = "none"; + } + + if (!editor.selection.isFocus())return; + editor.fireEvent('selectionchange', false, true); + + + }); + + editor.addListener('mousedown', function (t, evt) { + var el = evt.target || evt.srcElement; + baidu.editor.ui.Popup.postHide(evt, el); + baidu.editor.ui.ShortCutMenu.postHide(evt); + + }); + editor.addListener("delcells", function () { + if (UE.ui['edittip']) { + new UE.ui['edittip'](editor); + } + editor.getDialog('edittip').open(); + }); + + var pastePop, isPaste = false, timer; + editor.addListener("afterpaste", function () { + if(editor.queryCommandState('pasteplain')) + return; + if(baidu.editor.ui.PastePicker){ + pastePop = new baidu.editor.ui.Popup({ + content:new baidu.editor.ui.PastePicker({editor:editor}), + editor:editor, + className:'edui-wordpastepop' + }); + pastePop.render(); + } + isPaste = true; + }); + + editor.addListener("afterinserthtml", function () { + clearTimeout(timer); + timer = setTimeout(function () { + if (pastePop && (isPaste || editor.ui._isTransfer)) { + if(pastePop.isHidden()){ + var span = domUtils.createElement(editor.document, 'span', { + 'style':"line-height:0px;", + 'innerHTML':'\ufeff' + }), + range = editor.selection.getRange(); + range.insertNode(span); + var tmp= getDomNode(span, 'firstChild', 'previousSibling'); + tmp && pastePop.showAnchor(tmp.nodeType == 3 ? tmp.parentNode : tmp); + domUtils.remove(span); + }else{ + pastePop.show(); + } + delete editor.ui._isTransfer; + isPaste = false; + } + }, 200) + }); + editor.addListener('contextmenu', function (t, evt) { + baidu.editor.ui.Popup.postHide(evt); + }); + editor.addListener('keydown', function (t, evt) { + if (pastePop) pastePop.dispose(evt); + var keyCode = evt.keyCode || evt.which; + if(evt.altKey&&keyCode==90){ + UE.ui.buttons['fullscreen'].onclick(); + } + }); + editor.addListener('wordcount', function (type) { + setCount(this,me); + }); + function setCount(editor,ui) { + editor.setOpt({ + wordCount:true, + maximumWords:6000, + wordCountMsg:editor.options.wordCountMsg || editor.getLang("wordCountMsg"), + wordOverFlowMsg:editor.options.wordOverFlowMsg || editor.getLang("wordOverFlowMsg") + }); + var opt = editor.options, + max = opt.maximumWords, + msg = opt.wordCountMsg , + errMsg = opt.wordOverFlowMsg, + countDom = ui.getDom('wordcount'); + if (!opt.wordCount) { + return; + } + var count = editor.getContentLength(true); + if (count > max) { + countDom.innerHTML = errMsg; + editor.fireEvent("wordcountoverflow"); + } else { + countDom.innerHTML = msg.replace("{#leave}", max - count).replace("{#count}", count); + } + } + + editor.addListener('selectionchange', function () { + if (editor.options.elementPathEnabled) { + me[(editor.queryCommandState('elementpath') == -1 ? 'dis' : 'en') + 'ableElementPath']() + } + if (editor.options.scaleEnabled) { + me[(editor.queryCommandState('scale') == -1 ? 'dis' : 'en') + 'ableScale'](); + + } + }); + var popup = new baidu.editor.ui.Popup({ + editor:editor, + content:'', + className:'edui-bubble', + _onEditButtonClick:function () { + this.hide(); + editor.ui._dialogs.linkDialog.open(); + }, + _onImgEditButtonClick:function (name) { + this.hide(); + editor.ui._dialogs[name] && editor.ui._dialogs[name].open(); + + }, + _onImgSetFloat:function (value) { + this.hide(); + editor.execCommand("imagefloat", value); + + }, + _setIframeAlign:function (value) { + var frame = popup.anchorEl; + var newFrame = frame.cloneNode(true); + switch (value) { + case -2: + newFrame.setAttribute("align", ""); + break; + case -1: + newFrame.setAttribute("align", "left"); + break; + case 1: + newFrame.setAttribute("align", "right"); + break; + } + frame.parentNode.insertBefore(newFrame, frame); + domUtils.remove(frame); + popup.anchorEl = newFrame; + popup.showAnchor(popup.anchorEl); + }, + _updateIframe:function () { + var frame = editor._iframe = popup.anchorEl; + if(domUtils.hasClass(frame, 'ueditor_baidumap')) { + editor.selection.getRange().selectNode(frame).select(); + editor.ui._dialogs.mapDialog.open(); + popup.hide(); + } else { + editor.ui._dialogs.insertframeDialog.open(); + popup.hide(); + } + }, + _onRemoveButtonClick:function (cmdName) { + editor.execCommand(cmdName); + this.hide(); + }, + queryAutoHide:function (el) { + if (el && el.ownerDocument == editor.document) { + if (el.tagName.toLowerCase() == 'img' || domUtils.findParentByTagName(el, 'a', true)) { + return el !== popup.anchorEl; + } + } + return baidu.editor.ui.Popup.prototype.queryAutoHide.call(this, el); + } + }); + popup.render(); + if (editor.options.imagePopup) { + editor.addListener('mouseover', function (t, evt) { + evt = evt || window.event; + var el = evt.target || evt.srcElement; + if (editor.ui._dialogs.insertframeDialog && /iframe/ig.test(el.tagName)) { + var html = popup.formatHtml( + '' + editor.getLang("property") + ': ' + editor.getLang("default") + '  ' + editor.getLang("justifyleft") + '  ' + editor.getLang("justifyright") + '  ' + + ' ' + editor.getLang("modify") + ''); + if (html) { + popup.getDom('content').innerHTML = html; + popup.anchorEl = el; + popup.showAnchor(popup.anchorEl); + } else { + popup.hide(); + } + } + }); + editor.addListener('selectionchange', function (t, causeByUi) { + if (!causeByUi) return; + var html = '', str = "", + img = editor.selection.getRange().getClosedNode(), + dialogs = editor.ui._dialogs; + if (img && img.tagName == 'IMG') { + var dialogName = 'insertimageDialog'; + if (img.className.indexOf("edui-faked-video") != -1 || img.className.indexOf("edui-upload-video") != -1) { + dialogName = "insertvideoDialog" + } + if (img.className.indexOf("edui-faked-webapp") != -1) { + dialogName = "webappDialog" + } + if (img.src.indexOf("http://api.map.baidu.com") != -1) { + dialogName = "mapDialog" + } + if (img.className.indexOf("edui-faked-music") != -1) { + dialogName = "musicDialog" + } + if (img.src.indexOf("http://maps.google.com/maps/api/staticmap") != -1) { + dialogName = "gmapDialog" + } + if (img.getAttribute("anchorname")) { + dialogName = "anchorDialog"; + html = popup.formatHtml( + '' + editor.getLang("property") + ': ' + editor.getLang("modify") + '  ' + + '' + editor.getLang("delete") + ''); + } + if (img.getAttribute("word_img")) { + //todo 放到dialog去做查询 + editor.word_img = [img.getAttribute("word_img")]; + dialogName = "wordimageDialog" + } + if(domUtils.hasClass(img, 'loadingclass') || domUtils.hasClass(img, 'loaderrorclass')) { + dialogName = ""; + } + if (!dialogs[dialogName]) { + return; + } + str = '' + editor.getLang("property") + ': '+ + '' + editor.getLang("default") + '  ' + + '' + editor.getLang("justifyleft") + '  ' + + '' + editor.getLang("justifyright") + '  ' + + '' + editor.getLang("justifycenter") + '  '+ + '' + editor.getLang("modify") + ''; + + !html && (html = popup.formatHtml(str)) + + } + if (editor.ui._dialogs.linkDialog) { + var link = editor.queryCommandValue('link'); + var url; + if (link && (url = (link.getAttribute('_href') || link.getAttribute('href', 2)))) { + var txt = url; + if (url.length > 30) { + txt = url.substring(0, 20) + "..."; + } + if (html) { + html += '
    ' + } + html += popup.formatHtml( + '' + editor.getLang("anthorMsg") + ': ' + txt + '' + + ' ' + editor.getLang("modify") + '' + + ' ' + editor.getLang("clear") + ''); + popup.showAnchor(link); + } + } + + if (html) { + popup.getDom('content').innerHTML = html; + popup.anchorEl = img || link; + popup.showAnchor(popup.anchorEl); + } else { + popup.hide(); + } + }); + } + + }, + _initToolbars:function () { + var editor = this.editor; + var toolbars = this.toolbars || []; + var toolbarUis = []; + for (var i = 0; i < toolbars.length; i++) { + var toolbar = toolbars[i]; + var toolbarUi = new baidu.editor.ui.Toolbar({theme:editor.options.theme}); + for (var j = 0; j < toolbar.length; j++) { + var toolbarItem = toolbar[j]; + var toolbarItemUi = null; + if (typeof toolbarItem == 'string') { + toolbarItem = toolbarItem.toLowerCase(); + if (toolbarItem == '|') { + toolbarItem = 'Separator'; + } + if(toolbarItem == '||'){ + toolbarItem = 'Breakline'; + } + if (baidu.editor.ui[toolbarItem]) { + toolbarItemUi = new baidu.editor.ui[toolbarItem](editor); + } + + //fullscreen这里单独处理一下,放到首行去 + if (toolbarItem == 'fullscreen') { + if (toolbarUis && toolbarUis[0]) { + toolbarUis[0].items.splice(0, 0, toolbarItemUi); + } else { + toolbarItemUi && toolbarUi.items.splice(0, 0, toolbarItemUi); + } + + continue; + + + } + } else { + toolbarItemUi = toolbarItem; + } + if (toolbarItemUi && toolbarItemUi.id) { + + toolbarUi.add(toolbarItemUi); + } + } + toolbarUis[i] = toolbarUi; + } + + //接受外部定制的UI(修复因 utils.each 无法准确的循环出对象的全部元素而导致的自定义 UI 不符合预期的 BUG by HaoChuan9421) + + // utils.each(UE._customizeUI,function(obj,key){ + // var itemUI,index; + // if(obj.id && obj.id != editor.key){ + // return false; + // } + // itemUI = obj.execFn.call(editor,editor,key); + // if(itemUI){ + // index = obj.index; + // if(index === undefined){ + // index = toolbarUi.items.length; + // } + // toolbarUi.add(itemUI,index) + // } + // }); + + + for(var key in UE._customizeUI){ + var obj = UE._customizeUI[key] + var itemUI,index; + if(!obj.id || obj.id == editor.key){ + itemUI = obj.execFn.call(editor,editor,key); + if(itemUI){ + index = obj.index; + if(index === undefined){ + index = toolbarUi.items.length; + } + toolbarUi.add(itemUI,index) + } + } + } + + this.toolbars = toolbarUis; + }, + getHtmlTpl:function () { + return '
    ' + + '
    ' + + (this.toolbars.length ? + '
    ' + + this.renderToolbarBoxHtml() + + '
    ' : '') + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + //modify wdcount by matao + '
    ' + + '' + + '' + + '' + + '
    ' + + '
    ' + + '
    '; + }, + showWordImageDialog:function () { + this._dialogs['wordimageDialog'].open(); + }, + renderToolbarBoxHtml:function () { + var buff = []; + for (var i = 0; i < this.toolbars.length; i++) { + buff.push(this.toolbars[i].renderHtml()); + } + return buff.join(''); + }, + setFullScreen:function (fullscreen) { + + var editor = this.editor, + container = editor.container.parentNode.parentNode; + if (this._fullscreen != fullscreen) { + this._fullscreen = fullscreen; + this.editor.fireEvent('beforefullscreenchange', fullscreen); + if (baidu.editor.browser.gecko) { + var bk = editor.selection.getRange().createBookmark(); + } + if (fullscreen) { + while (container.tagName != "BODY") { + var position = baidu.editor.dom.domUtils.getComputedStyle(container, "position"); + nodeStack.push(position); + container.style.position = "static"; + container = container.parentNode; + } + this._bakHtmlOverflow = document.documentElement.style.overflow; + this._bakBodyOverflow = document.body.style.overflow; + this._bakAutoHeight = this.editor.autoHeightEnabled; + this._bakScrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop); + + this._bakEditorContaninerWidth = editor.iframe.parentNode.offsetWidth; + if (this._bakAutoHeight) { + //当全屏时不能执行自动长高 + editor.autoHeightEnabled = false; + this.editor.disableAutoHeight(); + } + + document.documentElement.style.overflow = 'hidden'; + //修复,滚动条不收起的问题 + + window.scrollTo(0,window.scrollY); + this._bakCssText = this.getDom().style.cssText; + this._bakCssText1 = this.getDom('iframeholder').style.cssText; + editor.iframe.parentNode.style.width = ''; + this._updateFullScreen(); + } else { + while (container.tagName != "BODY") { + container.style.position = nodeStack.shift(); + container = container.parentNode; + } + this.getDom().style.cssText = this._bakCssText; + this.getDom('iframeholder').style.cssText = this._bakCssText1; + if (this._bakAutoHeight) { + editor.autoHeightEnabled = true; + this.editor.enableAutoHeight(); + } + + document.documentElement.style.overflow = this._bakHtmlOverflow; + document.body.style.overflow = this._bakBodyOverflow; + editor.iframe.parentNode.style.width = this._bakEditorContaninerWidth + 'px'; + window.scrollTo(0, this._bakScrollTop); + } + if (browser.gecko && editor.body.contentEditable === 'true') { + var input = document.createElement('input'); + document.body.appendChild(input); + editor.body.contentEditable = false; + setTimeout(function () { + input.focus(); + setTimeout(function () { + editor.body.contentEditable = true; + editor.fireEvent('fullscreenchanged', fullscreen); + editor.selection.getRange().moveToBookmark(bk).select(true); + baidu.editor.dom.domUtils.remove(input); + fullscreen && window.scroll(0, 0); + }, 0) + }, 0) + } + + if(editor.body.contentEditable === 'true'){ + this.editor.fireEvent('fullscreenchanged', fullscreen); + this.triggerLayout(); + } + + } + }, + _updateFullScreen:function () { + if (this._fullscreen) { + var vpRect = uiUtils.getViewportRect(); + this.getDom().style.cssText = 'border:0;position:absolute;left:0;top:' + (this.editor.options.topOffset || 0) + 'px;width:' + vpRect.width + 'px;height:' + vpRect.height + 'px;z-index:' + (this.getDom().style.zIndex * 1 + 100); + uiUtils.setViewportOffset(this.getDom(), { left:0, top:this.editor.options.topOffset || 0 }); + this.editor.setHeight(vpRect.height - this.getDom('toolbarbox').offsetHeight - this.getDom('bottombar').offsetHeight - (this.editor.options.topOffset || 0),true); + //不手动调一下,会导致全屏失效 + if(browser.gecko){ + try{ + window.onresize(); + }catch(e){ + + } + + } + } + }, + _updateElementPath:function () { + var bottom = this.getDom('elementpath'), list; + if (this.elementPathEnabled && (list = this.editor.queryCommandValue('elementpath'))) { + + var buff = []; + for (var i = 0, ci; ci = list[i]; i++) { + buff[i] = this.formatHtml('' + ci + ''); + } + bottom.innerHTML = '
    ' + this.editor.getLang("elementPathTip") + ': ' + buff.join(' > ') + '
    '; + + } else { + bottom.style.display = 'none' + } + }, + disableElementPath:function () { + var bottom = this.getDom('elementpath'); + bottom.innerHTML = ''; + bottom.style.display = 'none'; + this.elementPathEnabled = false; + + }, + enableElementPath:function () { + var bottom = this.getDom('elementpath'); + bottom.style.display = ''; + this.elementPathEnabled = true; + this._updateElementPath(); + }, + _scale:function () { + var doc = document, + editor = this.editor, + editorHolder = editor.container, + editorDocument = editor.document, + toolbarBox = this.getDom("toolbarbox"), + bottombar = this.getDom("bottombar"), + scale = this.getDom("scale"), + scalelayer = this.getDom("scalelayer"); + + var isMouseMove = false, + position = null, + minEditorHeight = 0, + minEditorWidth = editor.options.minFrameWidth, + pageX = 0, + pageY = 0, + scaleWidth = 0, + scaleHeight = 0; + + function down() { + position = domUtils.getXY(editorHolder); + + if (!minEditorHeight) { + minEditorHeight = editor.options.minFrameHeight + toolbarBox.offsetHeight + bottombar.offsetHeight; + } + + scalelayer.style.cssText = "position:absolute;left:0;display:;top:0;background-color:#41ABFF;opacity:0.4;filter: Alpha(opacity=40);width:" + editorHolder.offsetWidth + "px;height:" + + editorHolder.offsetHeight + "px;z-index:" + (editor.options.zIndex + 1); + + domUtils.on(doc, "mousemove", move); + domUtils.on(editorDocument, "mouseup", up); + domUtils.on(doc, "mouseup", up); + } + + var me = this; + //by xuheng 全屏时关掉缩放 + this.editor.addListener('fullscreenchanged', function (e, fullScreen) { + if (fullScreen) { + me.disableScale(); + + } else { + if (me.editor.options.scaleEnabled) { + me.enableScale(); + var tmpNode = me.editor.document.createElement('span'); + me.editor.body.appendChild(tmpNode); + me.editor.body.style.height = Math.max(domUtils.getXY(tmpNode).y, me.editor.iframe.offsetHeight - 20) + 'px'; + domUtils.remove(tmpNode) + } + } + }); + function move(event) { + clearSelection(); + var e = event || window.event; + pageX = e.pageX || (doc.documentElement.scrollLeft + e.clientX); + pageY = e.pageY || (doc.documentElement.scrollTop + e.clientY); + scaleWidth = pageX - position.x; + scaleHeight = pageY - position.y; + + if (scaleWidth >= minEditorWidth) { + isMouseMove = true; + scalelayer.style.width = scaleWidth + 'px'; + } + if (scaleHeight >= minEditorHeight) { + isMouseMove = true; + scalelayer.style.height = scaleHeight + "px"; + } + } + + function up() { + if (isMouseMove) { + isMouseMove = false; + editor.ui._actualFrameWidth = scalelayer.offsetWidth - 2; + editorHolder.style.width = editor.ui._actualFrameWidth + 'px'; + + editor.setHeight(scalelayer.offsetHeight - bottombar.offsetHeight - toolbarBox.offsetHeight - 2,true); + } + if (scalelayer) { + scalelayer.style.display = "none"; + } + clearSelection(); + domUtils.un(doc, "mousemove", move); + domUtils.un(editorDocument, "mouseup", up); + domUtils.un(doc, "mouseup", up); + } + + function clearSelection() { + if (browser.ie) + doc.selection.clear(); + else + window.getSelection().removeAllRanges(); + } + + this.enableScale = function () { + //trace:2868 + if (editor.queryCommandState("source") == 1) return; + scale.style.display = ""; + this.scaleEnabled = true; + domUtils.on(scale, "mousedown", down); + }; + this.disableScale = function () { + scale.style.display = "none"; + this.scaleEnabled = false; + domUtils.un(scale, "mousedown", down); + }; + }, + isFullScreen:function () { + return this._fullscreen; + }, + postRender:function () { + UIBase.prototype.postRender.call(this); + for (var i = 0; i < this.toolbars.length; i++) { + this.toolbars[i].postRender(); + } + var me = this; + var timerId, + domUtils = baidu.editor.dom.domUtils, + updateFullScreenTime = function () { + clearTimeout(timerId); + timerId = setTimeout(function () { + me._updateFullScreen(); + }); + }; + domUtils.on(window, 'resize', updateFullScreenTime); + + me.addListener('destroy', function () { + domUtils.un(window, 'resize', updateFullScreenTime); + clearTimeout(timerId); + }) + }, + showToolbarMsg:function (msg, flag) { + this.getDom('toolbarmsg_label').innerHTML = msg; + this.getDom('toolbarmsg').style.display = ''; + // + if (!flag) { + var w = this.getDom('upload_dialog'); + w.style.display = 'none'; + } + }, + hideToolbarMsg:function () { + this.getDom('toolbarmsg').style.display = 'none'; + }, + mapUrl:function (url) { + return url ? url.replace('~/', this.editor.options.UEDITOR_HOME_URL || '') : '' + }, + triggerLayout:function () { + var dom = this.getDom(); + if (dom.style.zoom == '1') { + dom.style.zoom = '100%'; + } else { + dom.style.zoom = '1'; + } + } + }; + utils.inherits(EditorUI, baidu.editor.ui.UIBase); + + + var instances = {}; + + + UE.ui.Editor = function (options) { + var editor = new UE.Editor(options); + editor.options.editor = editor; + utils.loadFile(document, { + href:editor.options.themePath + editor.options.theme + "/css/ueditor.css", + tag:"link", + type:"text/css", + rel:"stylesheet" + }); + + var oldRender = editor.render; + editor.render = function (holder) { + if (holder.constructor === String) { + editor.key = holder; + instances[holder] = editor; + } + utils.domReady(function () { + editor.langIsReady ? renderUI() : editor.addListener("langReady", renderUI); + function renderUI() { + editor.setOpt({ + labelMap:editor.options.labelMap || editor.getLang('labelMap') + }); + new EditorUI(editor.options); + if (holder) { + if (holder.constructor === String) { + holder = document.getElementById(holder); + } + holder && holder.getAttribute('name') && ( editor.options.textarea = holder.getAttribute('name')); + if (holder && /script|textarea/ig.test(holder.tagName)) { + var newDiv = document.createElement('div'); + holder.parentNode.insertBefore(newDiv, holder); + var cont = holder.value || holder.innerHTML; + editor.options.initialContent = /^[\t\r\n ]*$/.test(cont) ? editor.options.initialContent : + cont.replace(/>[\n\r\t]+([ ]{4})+/g, '>') + .replace(/[\n\r\t]+([ ]{4})+[\n\r\t]+<'); + holder.className && (newDiv.className = holder.className); + holder.style.cssText && (newDiv.style.cssText = holder.style.cssText); + if (/textarea/i.test(holder.tagName)) { + editor.textarea = holder; + editor.textarea.style.display = 'none'; + + + } else { + holder.parentNode.removeChild(holder); + + + } + if(holder.id){ + newDiv.id = holder.id; + domUtils.removeAttributes(holder,'id'); + } + holder = newDiv; + holder.innerHTML = ''; + } + + } + domUtils.addClass(holder, "edui-" + editor.options.theme); + editor.ui.render(holder); + var opt = editor.options; + //给实例添加一个编辑器的容器引用 + editor.container = editor.ui.getDom(); + var parents = domUtils.findParents(holder,true); + var displays = []; + for(var i = 0 ,ci;ci=parents[i];i++){ + displays[i] = ci.style.display; + ci.style.display = 'block' + } + if (opt.initialFrameWidth) { + opt.minFrameWidth = opt.initialFrameWidth; + } else { + opt.minFrameWidth = opt.initialFrameWidth = holder.offsetWidth; + var styleWidth = holder.style.width; + if(/%$/.test(styleWidth)) { + opt.initialFrameWidth = styleWidth; + } + } + if (opt.initialFrameHeight) { + opt.minFrameHeight = opt.initialFrameHeight; + } else { + opt.initialFrameHeight = opt.minFrameHeight = holder.offsetHeight; + } + for(var i = 0 ,ci;ci=parents[i];i++){ + ci.style.display = displays[i] + } + //编辑器最外容器设置了高度,会导致,编辑器不占位 + //todo 先去掉,没有找到原因 + if(holder.style.height){ + holder.style.height = '' + } + editor.container.style.width = opt.initialFrameWidth + (/%$/.test(opt.initialFrameWidth) ? '' : 'px'); + editor.container.style.zIndex = opt.zIndex; + oldRender.call(editor, editor.ui.getDom('iframeholder')); + editor.fireEvent("afteruiready"); + } + }) + }; + return editor; + }; + + + /** + * @file + * @name UE + * @short UE + * @desc UEditor的顶部命名空间 + */ + /** + * @name getEditor + * @since 1.2.4+ + * @grammar UE.getEditor(id,[opt]) => Editor实例 + * @desc 提供一个全局的方法得到编辑器实例 + * + * * ''id'' 放置编辑器的容器id, 如果容器下的编辑器已经存在,就直接返回 + * * ''opt'' 编辑器的可选参数 + * @example + * UE.getEditor('containerId',{onready:function(){//创建一个编辑器实例 + * this.setContent('hello') + * }}); + * UE.getEditor('containerId'); //返回刚创建的实例 + * + */ + UE.getEditor = function (id, opt) { + var editor = instances[id]; + if (!editor) { + editor = instances[id] = new UE.ui.Editor(opt); + editor.render(id); + } + return editor; + }; + + + UE.delEditor = function (id) { + var editor; + if (editor = instances[id]) { + editor.key && editor.destroy(); + delete instances[id] + } + }; + + UE.registerUI = function(uiName,fn,index,editorId){ + utils.each(uiName.split(/\s+/), function (name) { + UE._customizeUI[name] = { + id : editorId, + execFn:fn, + index:index + }; + }) + + } + +})(); + +// adapter/message.js +UE.registerUI('message', function(editor) { + + var editorui = baidu.editor.ui; + var Message = editorui.Message; + var holder; + var _messageItems = []; + var me = editor; + + me.addListener('ready', function(){ + holder = document.getElementById(me.ui.id + '_message_holder'); + updateHolderPos(); + // HaoChuan9421 + // setTimeout(function(){ + // updateHolderPos(); + // }, 500); + }); + + me.addListener('showmessage', function(type, opt){ + opt = utils.isString(opt) ? { + 'content': opt + } : opt; + var message = new Message({ + 'timeout': opt.timeout, + 'type': opt.type, + 'content': opt.content, + 'keepshow': opt.keepshow, + 'editor': me + }), + mid = opt.id || ('msg_' + (+new Date()).toString(36)); + message.render(holder); + _messageItems[mid] = message; + message.reset(opt); + updateHolderPos(); + return mid; + }); + + me.addListener('updatemessage',function(type, id, opt){ + opt = utils.isString(opt) ? { + 'content': opt + } : opt; + var message = _messageItems[id]; + message.render(holder); + message && message.reset(opt); + }); + + me.addListener('hidemessage',function(type, id){ + var message = _messageItems[id]; + message && message.hide(); + }); + + function updateHolderPos(){ + var toolbarbox = me.ui.getDom('toolbarbox'); + if (toolbarbox) { + holder.style.top = toolbarbox.offsetHeight + 3 + 'px'; + } + holder.style.zIndex = Math.max(me.options.zIndex, me.iframe.style.zIndex) + 1; + } + +}); + + +// adapter/autosave.js +UE.registerUI('autosave', function(editor) { + var timer = null,uid = null; + editor.on('afterautosave',function(){ + clearTimeout(timer); + + timer = setTimeout(function(){ + if(uid){ + editor.trigger('hidemessage',uid); + } + uid = editor.trigger('showmessage',{ + content : editor.getLang('autosave.success'), + timeout : 2000 + }); + + },2000) + }) + +}); + + + +})(); diff --git a/public/static/Ueditor/ueditor.all.min.js b/public/static/Ueditor/ueditor.all.min.js new file mode 100644 index 0000000..cc73bea --- /dev/null +++ b/public/static/Ueditor/ueditor.all.min.js @@ -0,0 +1,17 @@ +/*! + * UEditor + * version: ueditor + * build: Wed Dec 26 2018 17:25:05 GMT+0800 (CST) + */ +!function(){function getListener(a,b,c){var d;return b=b.toLowerCase(),(d=a.__allListeners||c&&(a.__allListeners={}))&&(d[b]||c&&(d[b]=[]))}function getDomNode(a,b,c,d,e,f){var g,h=d&&a[b];for(!h&&(h=a[c]);!h&&(g=(g||a).parentNode);){if("BODY"==g.tagName||f&&!f(g))return null;h=g[c]}return h&&e&&!e(h)?getDomNode(h,b,c,!1,e):h}UEDITOR_CONFIG=window.UEDITOR_CONFIG||{};var baidu=window.baidu||{};window.baidu=baidu,window.UE=baidu.editor=window.UE||{},UE.plugins={},UE.commands={},UE.instants={},UE.I18N={},UE._customizeUI={},UE.version="1.4.3";var dom=UE.dom={},browser=UE.browser=function(){var a=navigator.userAgent.toLowerCase(),b=window.opera,c={ie:/(msie\s|trident.*rv:)([\w.]+)/.test(a),opera:!!b&&b.version,webkit:a.indexOf(" applewebkit/")>-1,mac:a.indexOf("macintosh")>-1,quirks:"BackCompat"==document.compatMode};c.gecko="Gecko"==navigator.product&&!c.webkit&&!c.opera&&!c.ie;var d=0;if(c.ie){var e=a.match(/(?:msie\s([\w.]+))/),f=a.match(/(?:trident.*rv:([\w.]+))/);d=e&&f&&e[1]&&f[1]?Math.max(1*e[1],1*f[1]):e&&e[1]?1*e[1]:f&&f[1]?1*f[1]:0,c.ie11Compat=11==document.documentMode,c.ie9Compat=9==document.documentMode,c.ie8=!!document.documentMode,c.ie8Compat=8==document.documentMode,c.ie7Compat=7==d&&!document.documentMode||7==document.documentMode,c.ie6Compat=d<7||c.quirks,c.ie9above=d>8,c.ie9below=d<9,c.ie11above=d>10,c.ie11below=d<11}if(c.gecko){var g=a.match(/rv:([\d\.]+)/);g&&(g=g[1].split("."),d=1e4*g[0]+100*(g[1]||0)+1*(g[2]||0))}return/chrome\/(\d+\.\d)/i.test(a)&&(c.chrome=+RegExp.$1),/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(a)&&!/chrome/i.test(a)&&(c.safari=+(RegExp.$1||RegExp.$2)),c.opera&&(d=parseFloat(b.version())),c.webkit&&(d=parseFloat(a.match(/ applewebkit\/(\d+)/)[1])),c.version=d,c.isCompatible=!c.mobile&&(c.ie&&d>=6||c.gecko&&d>=10801||c.opera&&d>=9.5||c.air&&d>=1||c.webkit&&d>=522||!1),c}(),ie=browser.ie,webkit=browser.webkit,gecko=browser.gecko,opera=browser.opera,utils=UE.utils={each:function(a,b,c){if(null!=a)if(a.length===+a.length){for(var d=0,e=a.length;d=c&&a===b)return d=e,!1}),d},removeItem:function(a,b){for(var c=0,d=a.length;c'](?:(amp|lt|quot|gt|#39|nbsp|#\d+);)?/g,function(a,b){return b?a:{"<":"<","&":"&",'"':""",">":">","'":"'"}[a]}):""},unhtmlForUrl:function(a,b){return a?a.replace(b||/[<">']/g,function(a){return{"<":"<","&":"&",'"':""",">":">","'":"'"}[a]}):""},html:function(a){return a?a.replace(/&((g|l|quo)t|amp|#39|nbsp);/g,function(a){return{"<":"<","&":"&",""":'"',">":">","'":"'"," ":" "}[a]}):""},cssStyleToDomStyle:function(){var a=document.createElement("div").style,b={"float":void 0!=a.cssFloat?"cssFloat":void 0!=a.styleFloat?"styleFloat":"float"};return function(a){return b[a]||(b[a]=a.toLowerCase().replace(/-./g,function(a){return a.charAt(1).toUpperCase()}))}}(),loadFile:function(){function a(a,c){try{for(var d,e=0;d=b[e++];)if(d.doc===a&&d.url==(c.src||c.href))return d}catch(f){return null}}var b=[];return function(c,d,e){var f=a(c,d);if(f)return void(f.ready?e&&e():f.funs.push(e));if(b.push({doc:c,url:d.src||d.href,funs:[e]}),!c.body){var g=[];for(var h in d)"tag"!=h&&g.push(h+'="'+d[h]+'"');return void c.write("<"+d.tag+" "+g.join(" ")+" >")}if(!d.id||!c.getElementById(d.id)){var i=c.createElement(d.tag);delete d.tag;for(var h in d)i.setAttribute(h,d[h]);i.onload=i.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(f=a(c,d),f.funs.length>0){f.ready=1;for(var b;b=f.funs.pop();)b()}i.onload=i.onreadystatechange=null}},i.onerror=function(){throw Error("The load "+(d.href||d.src)+" fails,check the url settings of file ueditor.config.js ")},c.getElementsByTagName("head")[0].appendChild(i)}}}(),isEmptyObject:function(a){if(null==a)return!0;if(this.isArray(a)||this.isString(a))return 0===a.length;for(var b in a)if(a.hasOwnProperty(b))return!1;return!0},fixColor:function(a,b){if(/color/i.test(a)&&/rgba?/.test(b)){var c=b.split(",");if(c.length>3)return"";b="#";for(var d,e=0;d=c[e++];)d=parseInt(d.replace(/[^\d]/gi,""),10).toString(16),b+=1==d.length?"0"+d:d;b=b.toUpperCase()}return b},optCss:function(a){function b(a,b){if(!a)return"";var c=a.top,d=a.bottom,e=a.left,f=a.right,g="";if(c&&e&&d&&f)g+=";"+b+":"+(c==d&&d==e&&e==f?c:c==d&&e==f?c+" "+e:e==f?c+" "+e+" "+d:c+" "+f+" "+d+" "+e)+";";else for(var h in a)g+=";"+b+"-"+h+":"+a[h]+";";return g}var c,d;return a=a.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi,function(a,b,e,f){if(1==f.split(" ").length)switch(b){case"padding":return!c&&(c={}),c[e]=f,"";case"margin":return!d&&(d={}),d[e]=f,"";case"border":return"initial"==f?"":a}return a}),a+=b(c,"padding")+b(d,"margin"),a.replace(/^[ \n\r\t;]*|[ \n\r\t]*$/,"").replace(/;([ \n\r\t]+)|\1;/g,";").replace(/(&((l|g)t|quot|#39))?;{2,}/g,function(a,b){return b?b+";;":";"})},clone:function(a,b){var c;b=b||{};for(var d in a)a.hasOwnProperty(d)&&(c=a[d],"object"==typeof c?(b[d]=utils.isArray(c)?[]:{},utils.clone(a[d],b[d])):b[d]=c);return b},transUnitToPx:function(a){if(!/(pt|cm)/.test(a))return a;var b;switch(a.replace(/([\d.]+)(\w+)/,function(c,d,e){a=d,b=e}),b){case"cm":a=25*parseFloat(a);break;case"pt":a=Math.round(96*parseFloat(a)/72)}return a+(a?"px":"")},domReady:function(){function a(a){a.isReady=!0;for(var c;c=b.pop();c());}var b=[];return function(c,d){d=d||window;var e=d.document;c&&b.push(c),"complete"===e.readyState?a(e):(e.isReady&&a(e),browser.ie&&11!=browser.version?(!function(){if(!e.isReady){try{e.documentElement.doScroll("left")}catch(b){return void setTimeout(arguments.callee,0)}a(e)}}(),d.attachEvent("onload",function(){a(e)})):(e.addEventListener("DOMContentLoaded",function(){e.removeEventListener("DOMContentLoaded",arguments.callee,!1),a(e)},!1),d.addEventListener("load",function(){a(e)},!1)))}}(),cssRule:browser.ie&&11!=browser.version?function(a,b,c){var d,e;if(void 0===b||b&&b.nodeType&&9==b.nodeType){if(c=b&&b.nodeType&&9==b.nodeType?b:c||document,d=c.indexList||(c.indexList={}),e=d[a],void 0!==e)return c.styleSheets[e].cssText}else{if(c=c||document,d=c.indexList||(c.indexList={}),e=d[a],""===b)return void 0!==e&&(c.styleSheets[e].cssText="",delete d[a],!0);void 0!==e?sheetStyle=c.styleSheets[e]:(sheetStyle=c.createStyleSheet("",e=c.styleSheets.length),d[a]=e),sheetStyle.cssText=b}}:function(a,b,c){var d;return void 0===b||b&&b.nodeType&&9==b.nodeType?(c=b&&b.nodeType&&9==b.nodeType?b:c||document,d=c.getElementById(a),d?d.innerHTML:void 0):(c=c||document,d=c.getElementById(a),""===b?!!d&&(d.parentNode.removeChild(d),!0):void(d?d.innerHTML=b:(d=c.createElement("style"),d.id=a,d.innerHTML=b,c.getElementsByTagName("head")[0].appendChild(d))))},sort:function(a,b){b=b||function(a,b){return a.localeCompare(b)};for(var c=0,d=a.length;c0){var g=a[c];a[c]=a[e],a[e]=g}return a},serializeParam:function(a){var b=[];for(var c in a)if("method"!=c&&"timeout"!=c&&"async"!=c)if("function"!=(typeof a[c]).toLowerCase()&&"object"!=(typeof a[c]).toLowerCase())b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));else if(utils.isArray(a[c]))for(var d=0;d1||b!==a.parentNode){a.style.cssText=b.style.cssText+";"+a.style.cssText,b=b.parentNode;continue}b.style.cssText+=";"+a.style.cssText,"A"==b.tagName&&(b.style.textDecoration="underline")}if("A"!=b.tagName){b===a.parentNode&&domUtils.remove(a,!0);break}}b=b.parentNode}},mergeSibling:function(a,b,c){function d(a,b,c){var d;if((d=c[a])&&!domUtils.isBookmarkNode(d)&&1==d.nodeType&&domUtils.isSameElement(c,d)){for(;d.firstChild;)"firstChild"==b?c.insertBefore(d.lastChild,c.firstChild):c.appendChild(d.firstChild);domUtils.remove(d)}}!b&&d("previousSibling","firstChild",a),!c&&d("nextSibling","lastChild",a)},unSelectable:ie&&browser.ie9below||browser.opera?function(a){a.onselectstart=function(){return!1},a.onclick=a.onkeyup=a.onkeydown=function(){return!1},a.unselectable="on",a.setAttribute("unselectable","on");for(var b,c=0;b=a.all[c++];)switch(b.tagName.toLowerCase()){case"iframe":case"textarea":case"input":case"select":break;default:b.unselectable="on",a.setAttribute("unselectable","on")}}:function(a){a.style.MozUserSelect=a.style.webkitUserSelect=a.style.msUserSelect=a.style.KhtmlUserSelect="none"},removeAttributes:function(a,b){b=utils.isArray(b)?b:utils.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0;c=b[d++];){switch(c=attrFix[c]||c){case"className":a[c]="";break;case"style":a.style.cssText="";var e=a.getAttributeNode("style");!browser.ie&&e&&a.removeAttributeNode(e)}a.removeAttribute(c)}},createElement:function(a,b,c){return domUtils.setAttributes(a.createElement(b),c)},setAttributes:function(a,b){for(var c in b)if(b.hasOwnProperty(c)){var d=b[c];switch(c){case"class":a.className=d;break;case"style":a.style.cssText=a.style.cssText+";"+d;break;case"innerHTML":a[c]=d;break;case"value":a.value=d;break;default:a.setAttribute(attrFix[c]||c,d)}}return a},getComputedStyle:function(a,b){var c="width height top left";if(c.indexOf(b)>-1)return a["offset"+b.replace(/^\w/,function(a){return a.toUpperCase()})]+"px";if(3==a.nodeType&&(a=a.parentNode),browser.ie&&browser.version<9&&"font-size"==b&&!a.style.fontSize&&!dtd.$empty[a.tagName]&&!dtd.$nonChild[a.tagName]){var d=a.ownerDocument.createElement("span");d.style.cssText="padding:0;border:0;font-family:simsun;",d.innerHTML=".",a.appendChild(d);var e=d.offsetHeight;return a.removeChild(d),d=null,e+"px"}try{var f=domUtils.getStyle(a,b)||(window.getComputedStyle?domUtils.getWindow(a).getComputedStyle(a,"").getPropertyValue(b):(a.currentStyle||a.style)[utils.cssStyleToDomStyle(b)])}catch(g){return""}return utils.transUnitToPx(utils.fixColor(b,f))},removeClasses:function(a,b){b=utils.isArray(b)?b:utils.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)e=e.replace(new RegExp("\\b"+c+"\\b"),"");e=utils.trim(e).replace(/[ ]{2,}/g," "),e?a.className=e:domUtils.removeAttributes(a,["class"])},addClass:function(a,b){if(a){b=utils.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)new RegExp("\\b"+c+"\\b").test(e)||(e+=" "+c);a.className=utils.trim(e)}},hasClass:function(a,b){if(utils.isRegExp(b))return b.test(a.className);b=utils.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)if(!new RegExp("\\b"+c+"\\b","i").test(e))return!1;return d-1==b.length},preventDefault:function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},removeStyle:function(a,b){browser.ie?("color"==b&&(b="(^|;)"+b),a.style.cssText=a.style.cssText.replace(new RegExp(b+"[^:]*:[^;]+;?","ig"),"")):a.style.removeProperty?a.style.removeProperty(b):a.style.removeAttribute(utils.cssStyleToDomStyle(b)),a.style.cssText||domUtils.removeAttributes(a,["style"])},getStyle:function(a,b){var c=a.style[utils.cssStyleToDomStyle(b)];return utils.fixColor(b,c)},setStyle:function(a,b,c){a.style[utils.cssStyleToDomStyle(b)]=c,utils.trim(a.style.cssText)||this.removeAttributes(a,"style")},setStyles:function(a,b){for(var c in b)b.hasOwnProperty(c)&&domUtils.setStyle(a,c,b[c])},removeDirtyAttr:function(a){for(var b,c=0,d=a.getElementsByTagName("*");b=d[c++];)b.removeAttribute("_moz_dirty");a.removeAttribute("_moz_dirty")},getChildCount:function(a,b){var c=0,d=a.firstChild;for(b=b||function(){return 1};d;)b(d)&&c++,d=d.nextSibling;return c},isEmptyNode:function(a){return!a.firstChild||0==domUtils.getChildCount(a,function(a){return!domUtils.isBr(a)&&!domUtils.isBookmarkNode(a)&&!domUtils.isWhitespace(a)})},clearSelectedArr:function(a){for(var b;b=a.pop();)domUtils.removeAttributes(b,["class"])},scrollToView:function(a,b,c){var d=function(){var a=b.document,c="CSS1Compat"==a.compatMode;return{width:(c?a.documentElement.clientWidth:a.body.clientWidth)||0,height:(c?a.documentElement.clientHeight:a.body.clientHeight)||0}},e=function(a){if("pageXOffset"in a)return{x:a.pageXOffset||0,y:a.pageYOffset||0};var b=a.document;return{x:b.documentElement.scrollLeft||b.body.scrollLeft||0,y:b.documentElement.scrollTop||b.body.scrollTop||0}},f=d().height,g=f*-1+c;g+=a.offsetHeight||0;var h=domUtils.getXY(a);g+=h.y;var i=e(b).y;(g>i||g0)return 0;for(var c in dtd.$isNotEmpty)if(a.getElementsByTagName(c).length)return 0;return 1}},setViewportOffset:function(a,b){var c=0|parseInt(a.style.left),d=0|parseInt(a.style.top),e=a.getBoundingClientRect(),f=b.left-e.left,g=b.top-e.top;f&&(a.style.left=c+f+"px"),g&&(a.style.top=d+g+"px")},fillNode:function(a,b){var c=browser.ie?a.createTextNode(domUtils.fillChar):a.createElement("br");b.innerHTML="",b.appendChild(c)},moveChild:function(a,b,c){for(;a.firstChild;)c&&b.firstChild?b.insertBefore(a.lastChild,b.firstChild):b.appendChild(a.firstChild)},hasNoAttributes:function(a){return browser.ie?/^<\w+\s*?>/.test(a.outerHTML):0==a.attributes.length},isCustomeNode:function(a){return 1==a.nodeType&&a.getAttribute("_ue_custom_node_")},isTagNode:function(a,b){return 1==a.nodeType&&new RegExp("\\b"+a.tagName+"\\b","i").test(b)},filterNodeList:function(a,b,c){var d=[];if(!utils.isFunction(b)){var e=b;b=function(a){return utils.indexOf(utils.isArray(e)?e:e.split(" "),a.tagName.toLowerCase())!=-1}}return utils.each(a,function(a){b(a)&&d.push(a)}),0==d.length?null:1!=d.length&&c?d:d[0]},isInNodeEndBoundary:function(a,b){var c=a.startContainer;if(3==c.nodeType&&a.startOffset!=c.nodeValue.length)return 0;if(1==c.nodeType&&a.startOffset!=c.childNodes.length)return 0;for(;c!==b;){if(c.nextSibling)return 0;c=c.parentNode}return 1},isBoundaryNode:function(a,b){for(var c;!domUtils.isBody(a);)if(c=a,a=a.parentNode,c!==a[b])return!1;return!0},fillHtml:browser.ie11below?" ":"
    "},fillCharReg=new RegExp(domUtils.fillChar,"g");!function(){function a(a){a.collapsed=a.startContainer&&a.endContainer&&a.startContainer===a.endContainer&&a.startOffset==a.endOffset}function b(a){return!a.collapsed&&1==a.startContainer.nodeType&&a.startContainer===a.endContainer&&a.endOffset-a.startOffset==1}function c(b,c,d,e){return 1==c.nodeType&&(dtd.$empty[c.tagName]||dtd.$nonChild[c.tagName])&&(d=domUtils.getNodeIndex(c)+(b?0:1),c=c.parentNode),b?(e.startContainer=c,e.startOffset=d,e.endContainer||e.collapse(!0)):(e.endContainer=c,e.endOffset=d,e.startContainer||e.collapse(!1)),a(e),e}function d(a,b){var c,d,e=a.startContainer,f=a.endContainer,g=a.startOffset,h=a.endOffset,i=a.document,j=i.createDocumentFragment();if(1==e.nodeType&&(e=e.childNodes[g]||(c=e.appendChild(i.createTextNode("")))),1==f.nodeType&&(f=f.childNodes[h]||(d=f.appendChild(i.createTextNode("")))),e===f&&3==e.nodeType)return j.appendChild(i.createTextNode(e.substringData(g,h-g))),b&&(e.deleteData(g,h-g),a.collapse(!0)),j;for(var k,l,m=j,n=domUtils.findParents(e,!0),o=domUtils.findParents(f,!0),p=0;n[p]==o[p];)p++;for(var q,r=p;q=n[r];r++){for(k=q.nextSibling,q==e?c||(3==a.startContainer.nodeType?(m.appendChild(i.createTextNode(e.nodeValue.slice(g))),b&&e.deleteData(g,e.nodeValue.length-g)):m.appendChild(b?e:e.cloneNode(!0))):(l=q.cloneNode(!1),m.appendChild(l));k&&k!==f&&k!==o[r];)q=k.nextSibling,m.appendChild(b?k:k.cloneNode(!0)),k=q;m=l}m=j,n[p]||(m.appendChild(n[p-1].cloneNode(!1)),m=m.firstChild);for(var s,r=p;s=o[r];r++){if(k=s.previousSibling,s==f?d||3!=a.endContainer.nodeType||(m.appendChild(i.createTextNode(f.substringData(0,h))),b&&f.deleteData(0,h)):(l=s.cloneNode(!1),m.appendChild(l)),r!=p||!n[p])for(;k&&k!==e;)s=k.previousSibling,m.insertBefore(b?k:k.cloneNode(!0),m.firstChild),k=s;m=l}return b&&a.setStartBefore(o[p]?n[p]?o[p]:n[p-1]:o[p-1]).collapse(!0),c&&domUtils.remove(c),d&&domUtils.remove(d),j}function e(a,b){try{if(g&&domUtils.inDoc(g,a))if(g.nodeValue.replace(fillCharReg,"").length)g.nodeValue=g.nodeValue.replace(fillCharReg,"");else{var c=g.parentNode;for(domUtils.remove(g);c&&domUtils.isEmptyInlineElement(c)&&(browser.safari?!(domUtils.getPosition(c,b)&domUtils.POSITION_CONTAINS):!c.contains(b));)g=c.parentNode,domUtils.remove(c),c=g; +}}catch(d){}}function f(a,b){var c;for(a=a[b];a&&domUtils.isFillChar(a);)c=a[b],domUtils.remove(a),a=c}var g,h=0,i=domUtils.fillChar,j=dom.Range=function(a){var b=this;b.startContainer=b.startOffset=b.endContainer=b.endOffset=null,b.document=a,b.collapsed=!0};j.prototype={cloneContents:function(){return this.collapsed?null:d(this,0)},deleteContents:function(){var a;return this.collapsed||d(this,1),browser.webkit&&(a=this.startContainer,3!=a.nodeType||a.nodeValue.length||(this.setStartBefore(a).collapse(!0),domUtils.remove(a))),this},extractContents:function(){return this.collapsed?null:d(this,2)},setStart:function(a,b){return c(!0,a,b,this)},setEnd:function(a,b){return c(!1,a,b,this)},setStartAfter:function(a){return this.setStart(a.parentNode,domUtils.getNodeIndex(a)+1)},setStartBefore:function(a){return this.setStart(a.parentNode,domUtils.getNodeIndex(a))},setEndAfter:function(a){return this.setEnd(a.parentNode,domUtils.getNodeIndex(a)+1)},setEndBefore:function(a){return this.setEnd(a.parentNode,domUtils.getNodeIndex(a))},setStartAtFirst:function(a){return this.setStart(a,0)},setStartAtLast:function(a){return this.setStart(a,3==a.nodeType?a.nodeValue.length:a.childNodes.length)},setEndAtFirst:function(a){return this.setEnd(a,0)},setEndAtLast:function(a){return this.setEnd(a,3==a.nodeType?a.nodeValue.length:a.childNodes.length)},selectNode:function(a){return this.setStartBefore(a).setEndAfter(a)},selectNodeContents:function(a){return this.setStart(a,0).setEndAtLast(a)},cloneRange:function(){var a=this;return new j(a.document).setStart(a.startContainer,a.startOffset).setEnd(a.endContainer,a.endOffset)},collapse:function(a){var b=this;return a?(b.endContainer=b.startContainer,b.endOffset=b.startOffset):(b.startContainer=b.endContainer,b.startOffset=b.endOffset),b.collapsed=!0,b},shrinkBoundary:function(a){function b(a){return 1==a.nodeType&&!domUtils.isBookmarkNode(a)&&!dtd.$empty[a.tagName]&&!dtd.$nonChild[a.tagName]}for(var c,d=this,e=d.collapsed;1==d.startContainer.nodeType&&(c=d.startContainer.childNodes[d.startOffset])&&b(c);)d.setStart(c,0);if(e)return d.collapse(!0);if(!a)for(;1==d.endContainer.nodeType&&d.endOffset>0&&(c=d.endContainer.childNodes[d.endOffset-1])&&b(c);)d.setEnd(c,c.childNodes.length);return d},getCommonAncestor:function(a,c){var d=this,e=d.startContainer,f=d.endContainer;return e===f?a&&b(this)&&(e=e.childNodes[d.startOffset],1==e.nodeType)?e:c&&3==e.nodeType?e.parentNode:e:domUtils.getCommonAncestor(e,f)},trimBoundary:function(a){this.txtToElmBoundary();var b=this.startContainer,c=this.startOffset,d=this.collapsed,e=this.endContainer;if(3==b.nodeType){if(0==c)this.setStartBefore(b);else if(c>=b.nodeValue.length)this.setStartAfter(b);else{var f=domUtils.split(b,c);b===e?this.setEnd(f,this.endOffset-c):b.parentNode===e&&(this.endOffset+=1),this.setStartBefore(f)}if(d)return this.collapse(!0)}return a||(c=this.endOffset,e=this.endContainer,3==e.nodeType&&(0==c?this.setEndBefore(e):(c=c.nodeValue.length&&a["set"+b.replace(/(\w)/,function(a){return a.toUpperCase()})+"After"](c):a["set"+b.replace(/(\w)/,function(a){return a.toUpperCase()})+"Before"](c))}return!a&&this.collapsed||(b(this,"start"),b(this,"end")),this},insertNode:function(a){var b=a,c=1;11==a.nodeType&&(b=a.firstChild,c=a.childNodes.length),this.trimBoundary(!0);var d=this.startContainer,e=this.startOffset,f=d.childNodes[e];return f?d.insertBefore(a,f):d.appendChild(a),b.parentNode===this.endContainer&&(this.endOffset=this.endOffset+c),this.setStartBefore(b)},setCursor:function(a,b){return this.collapse(!a).select(b)},createBookmark:function(a,b){var c,d=this.document.createElement("span");return d.style.cssText="display:none;line-height:0px;",d.appendChild(this.document.createTextNode("‍")),d.id="_baidu_bookmark_start_"+(b?"":h++),this.collapsed||(c=d.cloneNode(!0),c.id="_baidu_bookmark_end_"+(b?"":h++)),this.insertNode(d),c&&this.collapse().insertNode(c).setEndBefore(c),this.setStartAfter(d),{start:a?d.id:d,end:c?a?c.id:c:null,id:a}},moveToBookmark:function(a){var b=a.id?this.document.getElementById(a.start):a.start,c=a.end&&a.id?this.document.getElementById(a.end):a.end;return this.setStartBefore(b),domUtils.remove(b),c?(this.setEndBefore(c),domUtils.remove(c)):this.collapse(!0),this},enlarge:function(a,b){var c,d,e=domUtils.isBody,f=this.document.createTextNode("");if(a){for(d=this.startContainer,1==d.nodeType?d.childNodes[this.startOffset]?c=d=d.childNodes[this.startOffset]:(d.appendChild(f),c=d=f):c=d;;){if(domUtils.isBlockElm(d)){for(d=c;(c=d.previousSibling)&&!domUtils.isBlockElm(c);)d=c;this.setStartBefore(d);break}c=d,d=d.parentNode}for(d=this.endContainer,1==d.nodeType?((c=d.childNodes[this.endOffset])?d.insertBefore(f,c):d.appendChild(f),c=d=f):c=d;;){if(domUtils.isBlockElm(d)){for(d=c;(c=d.nextSibling)&&!domUtils.isBlockElm(c);)d=c;this.setEndAfter(d);break}c=d,d=d.parentNode}f.parentNode===this.endContainer&&this.endOffset--,domUtils.remove(f)}if(!this.collapsed){for(;!(0!=this.startOffset||b&&b(this.startContainer)||e(this.startContainer));)this.setStartBefore(this.startContainer);for(;!(this.endOffset!=(1==this.endContainer.nodeType?this.endContainer.childNodes.length:this.endContainer.nodeValue.length)||b&&b(this.endContainer)||e(this.endContainer));)this.setEndAfter(this.endContainer)}return this},enlargeToBlockElm:function(a){for(;!domUtils.isBlockElm(this.startContainer);)this.setStartBefore(this.startContainer);if(!a)for(;!domUtils.isBlockElm(this.endContainer);)this.setEndAfter(this.endContainer);return this},adjustmentBoundary:function(){if(!this.collapsed){for(;!domUtils.isBody(this.startContainer)&&this.startOffset==this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length&&this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length;)this.setStartAfter(this.startContainer);for(;!domUtils.isBody(this.endContainer)&&!this.endOffset&&this.endContainer[3==this.endContainer.nodeType?"nodeValue":"childNodes"].length;)this.setEndBefore(this.endContainer)}return this},applyInlineStyle:function(a,b,c){if(this.collapsed)return this;this.trimBoundary().enlarge(!1,function(a){return 1==a.nodeType&&domUtils.isBlockElm(a)}).adjustmentBoundary();for(var d,e,f=this.createBookmark(),g=f.end,h=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase():!domUtils.isWhitespace(a)},i=domUtils.getNextDomNode(f.start,!1,h),j=this.cloneRange();i&&domUtils.getPosition(i,g)&domUtils.POSITION_PRECEDING;)if(3==i.nodeType||dtd[a][i.tagName]){for(j.setStartBefore(i),d=i;d&&(3==d.nodeType||dtd[a][d.tagName])&&d!==g;)e=d,d=domUtils.getNextDomNode(d,1==d.nodeType,null,function(b){return dtd[a][b.tagName]});var k,l=j.setEndAfter(e).extractContents();if(c&&c.length>0){var m,n;n=m=c[0].cloneNode(!1);for(var o,p=1;o=c[p++];)m.appendChild(o.cloneNode(!1)),m=m.firstChild;k=m}else k=j.document.createElement(a);b&&domUtils.setAttributes(k,b),k.appendChild(l),j.insertNode(c?n:k);var q;if("span"==a&&b.style&&/text\-decoration/.test(b.style)&&(q=domUtils.findParentByTagName(k,"a",!0))?(domUtils.setAttributes(q,b),domUtils.remove(k,!0),k=q):(domUtils.mergeSibling(k),domUtils.clearEmptySibling(k)),domUtils.mergeChild(k,b),i=domUtils.getNextDomNode(k,!1,h),domUtils.mergeToParent(k),d===g)break}else i=domUtils.getNextDomNode(i,!0,h);return this.moveToBookmark(f)},removeInlineStyle:function(a){if(this.collapsed)return this;a=utils.isArray(a)?a:[a],this.shrinkBoundary().adjustmentBoundary();for(var b=this.startContainer,c=this.endContainer;;){if(1==b.nodeType){if(utils.indexOf(a,b.tagName.toLowerCase())>-1)break;if("body"==b.tagName.toLowerCase()){b=null;break}}b=b.parentNode}for(;;){if(1==c.nodeType){if(utils.indexOf(a,c.tagName.toLowerCase())>-1)break;if("body"==c.tagName.toLowerCase()){c=null;break}}c=c.parentNode}var d,e,f=this.createBookmark();b&&(e=this.cloneRange().setEndBefore(f.start).setStartBefore(b),d=e.extractContents(),e.insertNode(d),domUtils.clearEmptySibling(b,!0),b.parentNode.insertBefore(f.start,b)),c&&(e=this.cloneRange().setStartAfter(f.end).setEndAfter(c),d=e.extractContents(),e.insertNode(d),domUtils.clearEmptySibling(c,!1,!0),c.parentNode.insertBefore(f.end,c.nextSibling));for(var g,h=domUtils.getNextDomNode(f.start,!1,function(a){return 1==a.nodeType});h&&h!==f.end;)g=domUtils.getNextDomNode(h,!0,function(a){return 1==a.nodeType}),utils.indexOf(a,h.tagName.toLowerCase())>-1&&domUtils.remove(h,!0),h=g;return this.moveToBookmark(f)},getClosedNode:function(){var a;if(!this.collapsed){var c=this.cloneRange().adjustmentBoundary().shrinkBoundary();if(b(c)){var d=c.startContainer.childNodes[c.startOffset];d&&1==d.nodeType&&(dtd.$empty[d.tagName]||dtd.$nonChild[d.tagName])&&(a=d)}}return a},select:browser.ie?function(a,b){var c;this.collapsed||this.shrinkBoundary();var d=this.getClosedNode();if(d&&!b){try{c=this.document.body.createControlRange(),c.addElement(d),c.select()}catch(h){}return this}var j,k=this.createBookmark(),l=k.start;if(c=this.document.body.createTextRange(),c.moveToElementText(l),c.moveStart("character",1),this.collapsed){if(!a&&3!=this.startContainer.nodeType){var m=this.document.createTextNode(i),n=this.document.createElement("span");n.appendChild(this.document.createTextNode(i)),l.parentNode.insertBefore(n,l),l.parentNode.insertBefore(m,l),e(this.document,m),g=m,f(n,"previousSibling"),f(l,"nextSibling"),c.moveStart("character",-1),c.collapse(!0)}}else{var o=this.document.body.createTextRange();j=k.end,o.moveToElementText(j),c.setEndPoint("EndToEnd",o)}this.moveToBookmark(k),n&&domUtils.remove(n);try{c.select()}catch(h){}return this}:function(a){function b(a){function b(b,c,d){3==b.nodeType&&b.nodeValue.length0)j=k-1;else{if(!(l<0))return{container:d,offset:c(e)};i=k+1}}if(k==-1){if(h.moveToElementText(d),h.setEndPoint("StartToStart",a),f=h.text.replace(/(\r\n|\r)/g,"\n").length,g=d.childNodes,!f)return e=g[g.length-1],{container:e,offset:e.nodeValue.length};for(var m=g.length;f>0;)f-=g[--m].nodeValue.length;return{container:g[m],offset:-f}}if(h.collapse(l>0),h.setEndPoint(l>0?"StartToStart":"EndToStart",a),f=h.text.replace(/(\r\n|\r)/g,"\n").length,!f)return dtd.$empty[e.tagName]||dtd.$nonChild[e.tagName]?{container:d,offset:c(e)+(l>0?0:1)}:{container:e,offset:l>0?0:e.childNodes.length};for(;f>0;)try{var n=e;e=e[l>0?"previousSibling":"nextSibling"],f-=e.nodeValue.length}catch(o){return{container:d,offset:c(n)}}return{container:e,offset:l>0?-f:e.nodeValue.length+f}}function b(b,c){if(b.item)c.selectNode(b.item(0));else{var d=a(b,!0);c.setStart(d.container,d.offset),0!=b.compareEndPoints("StartToEnd",b)&&(d=a(b,!1),c.setEnd(d.container,d.offset))}return c}function c(a){var b;try{b=a.getNative().createRange()}catch(c){return null}var d=b.item?b.item(0):b.parentElement();return(d.ownerDocument||d)===a.document?b:null}var d=dom.Selection=function(a){var b,d=this;d.document=a,browser.ie9below&&(b=domUtils.getWindow(a).frameElement,domUtils.on(b,"beforedeactivate",function(){d._bakIERange=d.getIERange()}),domUtils.on(b,"activate",function(){try{!c(d)&&d._bakIERange&&d._bakIERange.select()}catch(a){}d._bakIERange=null})),b=a=null};d.prototype={rangeInBody:function(a,b){var c=browser.ie9below||b?a.item?a.item():a.parentElement():a.startContainer;return c===this.document.body||domUtils.inDoc(c,this.document)},getNative:function(){var a=this.document;try{return a?browser.ie9below?a.selection:domUtils.getWindow(a).getSelection():null}catch(b){return null}},getIERange:function(){var a=c(this);return!a&&this._bakIERange?this._bakIERange:a},cache:function(){this.clear(),this._cachedRange=this.getRange(),this._cachedStartElement=this.getStart(),this._cachedStartElementPath=this.getStartElementPath()},getStartElementPath:function(){if(this._cachedStartElementPath)return this._cachedStartElementPath;var a=this.getStart();return a?domUtils.findParents(a,!0,null,!0):[]},clear:function(){this._cachedStartElementPath=this._cachedRange=this._cachedStartElement=null},isFocus:function(){try{if(browser.ie9below){var a=c(this);return!(!a||!this.rangeInBody(a))}return!!this.getNative().rangeCount}catch(b){return!1}},getRange:function(){function a(a){for(var b=c.document.body.firstChild,d=a.collapsed;b&&b.firstChild;)a.setStart(b,0),b=b.firstChild;a.startContainer||a.setStart(c.document.body,0),d&&a.collapse(!0)}var c=this;if(null!=c._cachedRange)return this._cachedRange;var d=new baidu.editor.dom.Range(c.document);if(browser.ie9below){var e=c.getIERange();if(e)try{b(e,d)}catch(f){a(d)}else a(d)}else{var g=c.getNative();if(g&&g.rangeCount){var h=g.getRangeAt(0),i=g.getRangeAt(g.rangeCount-1);d.setStart(h.startContainer,h.startOffset).setEnd(i.endContainer,i.endOffset),d.collapsed&&domUtils.isBody(d.startContainer)&&!d.startOffset&&a(d)}else{if(this._bakRange&&domUtils.inDoc(this._bakRange.startContainer,this.document))return this._bakRange;a(d)}}return this._bakRange=d},getStart:function(){if(this._cachedStartElement)return this._cachedStartElement;var a,b,c,d,e=browser.ie9below?this.getIERange():this.getRange();if(browser.ie9below){if(!e)return this.document.body.firstChild;if(e.item)return e.item(0);for(a=e.duplicate(),a.text.length>0&&a.moveStart("character",1),a.collapse(1),b=a.parentElement(),d=c=e.parentElement();c=c.parentNode;)if(c==b){b=d;break}}else if(e.shrinkBoundary(),b=e.startContainer,1==b.nodeType&&b.hasChildNodes()&&(b=b.childNodes[Math.min(b.childNodes.length-1,e.startOffset)]),3==b.nodeType)return b.parentNode;return b},getText:function(){var a,b;return this.isFocus()&&(a=this.getNative())?(b=browser.ie9below?a.createRange():a.getRangeAt(0),browser.ie9below?b.text:b.toString()):""},clearRange:function(){this.getNative()[browser.ie9below?"empty":"removeAllRanges"]()}}}(),function(){function a(a,b){var c;if(b.textarea)if(utils.isString(b.textarea)){for(var d,e=0,f=domUtils.getElementsByTagName(a,"textarea");d=f[e++];)if(d.id=="ueditor_textarea_"+b.options.textarea){c=d;break}}else c=b.textarea;c||(a.appendChild(c=domUtils.createElement(document,"textarea",{name:b.options.textarea,id:"ueditor_textarea_"+b.options.textarea,style:"display:none"})),b.textarea=c),!c.getAttribute("name")&&c.setAttribute("name",b.options.textarea),c.value=b.hasContents()?b.options.allHtmlEnabled?b.getAllHtml():b.getContent(null,null,!0):""}function b(a){for(var b in a)return b}function c(a){a.langIsReady=!0,a.fireEvent("langReady")}var d,e=0,f=UE.Editor=function(a){var d=this;d.uid=e++,EventBase.call(d),d.commands={},d.options=utils.extend(utils.clone(a||{}),UEDITOR_CONFIG,!0),d.shortcutkeys={},d.inputRules=[],d.outputRules=[],d.setOpt(f.defaultOptions(d)),d.loadServerConfig(),utils.isEmptyObject(UE.I18N)?utils.loadFile(document,{src:d.options.langPath+d.options.lang+"/"+d.options.lang+".js",tag:"script",type:"text/javascript",defer:"defer"},function(){UE.plugin.load(d),c(d)}):(d.options.lang=b(UE.I18N),UE.plugin.load(d),c(d)),UE.instants["ueditorInstant"+d.uid]=d};f.prototype={registerCommand:function(a,b){this.commands[a]=b},ready:function(a){var b=this;a&&(b.isReady?a.apply(b):b.addListener("ready",a))},setOpt:function(a,b){var c={};utils.isString(a)?c[a]=b:c=a,utils.extend(this.options,c,!0)},getOpt:function(a){return this.options[a]},destroy:function(){var a=this;a.fireEvent("destroy");var b=a.container.parentNode,c=a.textarea;c?c.style.display="":(c=document.createElement("textarea"),b.parentNode.insertBefore(c,b)),c.style.width=a.iframe.offsetWidth+"px",c.style.height=a.iframe.offsetHeight+"px",c.value=a.getContent(),c.id=a.key,b.innerHTML="",domUtils.remove(b);var d=a.key;for(var e in a)a.hasOwnProperty(e)&&delete this[e];UE.delEditor(d)},render:function(a){var b=this,c=b.options,d=function(b){return parseInt(domUtils.getComputedStyle(a,b))};if(utils.isString(a)&&(a=document.getElementById(a)),a){c.initialFrameWidth?c.minFrameWidth=c.initialFrameWidth:c.minFrameWidth=c.initialFrameWidth=a.offsetWidth,c.initialFrameHeight?c.minFrameHeight=c.initialFrameHeight:c.initialFrameHeight=c.minFrameHeight=a.offsetHeight,a.style.width=/%$/.test(c.initialFrameWidth)?"100%":c.initialFrameWidth-d("padding-left")-d("padding-right")+"px",a.style.height=/%$/.test(c.initialFrameHeight)?"100%":c.initialFrameHeight-d("padding-top")-d("padding-bottom")+"px",a.style.zIndex=c.zIndex;var e=(ie&&browser.version<9?"":"")+""+(c.iframeCssUrl?"":"")+(c.initialStyle?"":"")+"";a.appendChild(domUtils.createElement(document,"iframe",{id:"ueditor_"+b.uid,width:"100%",height:"100%",frameborder:"0",src:"javascript:void(function(){document.open();"+(c.customDomain&&document.domain!=location.hostname?'document.domain="'+document.domain+'";':"")+'document.write("'+e+'");document.close();}())'})),a.style.overflow="hidden",setTimeout(function(){/%$/.test(c.initialFrameWidth)&&(c.minFrameWidth=c.initialFrameWidth=a.offsetWidth),/%$/.test(c.initialFrameHeight)&&(c.minFrameHeight=c.initialFrameHeight=a.offsetHeight,a.style.height=c.initialFrameHeight+"px")})}},_setup:function(b){var c=this,d=c.options;ie?(b.body.disabled=!0,b.body.contentEditable=!0,b.body.disabled=!1):b.body.contentEditable=!0,b.body.spellcheck=!1,c.document=b,c.window=b.defaultView||b.parentWindow,c.iframe=c.window.frameElement,c.body=b.body,c.selection=new dom.Selection(b);var e;browser.gecko&&(e=this.selection.getNative())&&e.removeAllRanges(),this._initEvents();for(var f=this.iframe.parentNode;!domUtils.isBody(f);f=f.parentNode)if("FORM"==f.tagName){c.form=f,c.options.autoSyncData?domUtils.on(c.window,"blur",function(){a(f,c)}):domUtils.on(f,"submit",function(){a(this,c)});break}if(d.initialContent)if(d.autoClearinitialContent){var g=c.execCommand;c.execCommand=function(){return c.fireEvent("firstBeforeExecCommand"),g.apply(c,arguments)},this._setDefaultContent(d.initialContent)}else this.setContent(d.initialContent,!1,!0);domUtils.isEmptyNode(c.body)&&(c.body.innerHTML="

    "+(browser.ie?"":"
    ")+"

    "),d.focus&&setTimeout(function(){c.focus(c.options.focusInEnd),!c.options.autoClearinitialContent&&c._selectionChange()},0),c.container||(c.container=this.iframe.parentNode),d.fullscreen&&c.ui&&c.ui.setFullScreen(!0);try{c.document.execCommand("2D-position",!1,!1)}catch(h){}try{c.document.execCommand("enableInlineTableEditing",!1,!1)}catch(h){}try{c.document.execCommand("enableObjectResizing",!1,!1)}catch(h){}c._bindshortcutKeys(),c.isReady=1,c.fireEvent("ready"),d.onready&&d.onready.call(c),browser.ie9below||domUtils.on(c.window,["blur","focus"],function(a){if("blur"==a.type){c._bakRange=c.selection.getRange();try{c._bakNativeRange=c.selection.getNative().getRangeAt(0),c.selection.getNative().removeAllRanges()}catch(a){c._bakNativeRange=null}}else try{c._bakRange&&c._bakRange.select()}catch(a){}}),browser.gecko&&browser.version<=10902&&(c.body.contentEditable=!1,setTimeout(function(){c.body.contentEditable=!0},100),setInterval(function(){c.body.style.height=c.iframe.offsetHeight-20+"px"},100)),!d.isShow&&c.setHide(),d.readonly&&c.setDisabled()},sync:function(b){var c=this,d=b?document.getElementById(b):domUtils.findParent(c.iframe.parentNode,function(a){return"FORM"==a.tagName},!0);d&&a(d,c)},setHeight:function(a,b){a!==parseInt(this.iframe.parentNode.style.height)&&(this.iframe.parentNode.style.height=a+"px"),!b&&(this.options.minFrameHeight=this.options.initialFrameHeight=a),this.body.style.height=a+"px",!b&&this.trigger("setHeight")},addshortcutkey:function(a,b){var c={};b?c[a]=b:c=a,utils.extend(this.shortcutkeys,c)},_bindshortcutKeys:function(){var a=this,b=this.shortcutkeys;a.addListener("keydown",function(c,d){var e=d.keyCode||d.which;for(var f in b)for(var g,h=b[f].split(","),i=0;g=h[i++];){g=g.split(":");var j=g[0],k=g[1];(/^(ctrl)(\+shift)?\+(\d+)$/.test(j.toLowerCase())||/^(\d+)$/.test(j))&&(("ctrl"==RegExp.$1?d.ctrlKey||d.metaKey:0)&&(""!=RegExp.$2?d[RegExp.$2.slice(1)+"Key"]:1)&&e==RegExp.$3||e==RegExp.$1)&&(a.queryCommandState(f,k)!=-1&&a.execCommand(f,k),domUtils.preventDefault(d))}})},getContent:function(a,b,c,d,e){var f=this;if(a&&utils.isFunction(a)&&(b=a,a=""),b?!b():!this.hasContents())return"";f.fireEvent("beforegetcontent");var g=UE.htmlparser(f.body.innerHTML,d);return f.filterOutputRule(g),f.fireEvent("aftergetcontent",a,g),g.toHtml(e)},getAllHtml:function(){var a=this,b=[];if(a.fireEvent("getAllHtml",b),browser.ie&&browser.version>8){var c="";utils.each(a.document.styleSheets,function(a){c+=a.href?'':""}),utils.each(a.document.getElementsByTagName("script"),function(a){c+=a.outerHTML})}return""+(a.options.charset?'':"")+(c||a.document.getElementsByTagName("head")[0].innerHTML)+b.join("\n")+""+a.getContent(null,null,!0)+""},getPlainTxt:function(){var a=new RegExp(domUtils.fillChar,"g"),b=this.body.innerHTML.replace(/[\n\r]/g,"");return b=b.replace(/<(p|div)[^>]*>(| )<\/\1>/gi,"\n").replace(//gi,"\n").replace(/<[^>\/]+>/g,"").replace(/(\n)?<\/([^>]+)>/g,function(a,b,c){return dtd.$block[c]?"\n":b?b:""}),b.replace(a,"").replace(/\u00a0/g," ").replace(/ /g," ")},getContentTxt:function(){var a=new RegExp(domUtils.fillChar,"g");return this.body[browser.ie?"innerText":"textContent"].replace(a,"").replace(/\u00a0/g," ")},setContent:function(b,c,d){function e(a){return"DIV"==a.tagName&&a.getAttribute("cdata_tag")}var f=this;f.fireEvent("beforesetcontent",b);var g=UE.htmlparser(b);if(f.filterInputRule(g),b=g.toHtml(),f.body.innerHTML=(c?f.body.innerHTML:"")+b,"p"==f.options.enterTag){var h,i=this.body.firstChild;if(!i||1==i.nodeType&&(dtd.$cdata[i.tagName]||e(i)||domUtils.isCustomeNode(i))&&i===this.body.lastChild)this.body.innerHTML="

    "+(browser.ie?" ":"
    ")+"

    "+this.body.innerHTML;else for(var j=f.document.createElement("p");i;){for(;i&&(3==i.nodeType||1==i.nodeType&&dtd.p[i.tagName]&&!dtd.$cdata[i.tagName]);)h=i.nextSibling,j.appendChild(i),i=h;if(j.firstChild){if(!i){f.body.appendChild(j);break}i.parentNode.insertBefore(j,i),j=f.document.createElement("p")}i=i.nextSibling}}f.fireEvent("aftersetcontent"),f.fireEvent("contentchange"),!d&&f._selectionChange(),f._bakRange=f._bakIERange=f._bakNativeRange=null;var k;browser.gecko&&(k=this.selection.getNative())&&k.removeAllRanges(),f.options.autoSyncData&&f.form&&a(f.form,f)},focus:function(a){try{var b=this,c=b.selection.getRange();if(a){var d=b.body.lastChild;d&&1==d.nodeType&&!dtd.$empty[d.tagName]&&(domUtils.isEmptyBlock(d)?c.setStartAtFirst(d):c.setStartAtLast(d),c.collapse(!0)),c.setCursor(!0)}else{if(!c.collapsed&&domUtils.isBody(c.startContainer)&&0==c.startOffset){var d=b.body.firstChild;d&&1==d.nodeType&&!dtd.$empty[d.tagName]&&c.setStartAtFirst(d).collapse(!0)}c.select(!0)}this.fireEvent("focus selectionchange")}catch(e){}},isFocus:function(){return this.selection.isFocus()},blur:function(){var a=this.selection.getNative();if(a.empty&&browser.ie){var b=document.body.createTextRange();b.moveToElementText(document.body),b.collapse(!0),b.select(),a.empty()}else a.removeAllRanges()},_initEvents:function(){var a=this,b=a.document,c=a.window;a._proxyDomEvent=utils.bind(a._proxyDomEvent,a),domUtils.on(b,["click","contextmenu","mousedown","keydown","keyup","keypress","mouseup","mouseover","mouseout","selectstart"],a._proxyDomEvent),domUtils.on(c,["focus","blur"],a._proxyDomEvent),domUtils.on(a.body,"drop",function(b){browser.gecko&&b.stopPropagation&&b.stopPropagation(),a.fireEvent("contentchange")}),domUtils.on(b,["mouseup","keydown"],function(b){"keydown"==b.type&&(b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)||2!=b.button&&a._selectionChange(250,b)})},_proxyDomEvent:function(a){return this.fireEvent("before"+a.type.replace(/^on/,"").toLowerCase())!==!1&&(this.fireEvent(a.type.replace(/^on/,""),a)!==!1&&this.fireEvent("after"+a.type.replace(/^on/,"").toLowerCase()))},_selectionChange:function(a,b){var c,e,f=this,g=!1;if(browser.ie&&browser.version<9&&b&&"mouseup"==b.type){var h=this.selection.getRange();h.collapsed||(g=!0,c=b.clientX,e=b.clientY)}clearTimeout(d),d=setTimeout(function(){if(f.selection&&f.selection.getNative()){var a;if(g&&"None"==f.selection.getNative().type){a=f.document.body.createTextRange();try{a.moveToPoint(c,e)}catch(d){a=null}}var h;a&&(h=f.selection.getIERange,f.selection.getIERange=function(){return a}),f.selection.cache(),h&&(f.selection.getIERange=h),f.selection._cachedRange&&f.selection._cachedStartElement&&(f.fireEvent("beforeselectionchange"),f.fireEvent("selectionchange",!!b),f.fireEvent("afterselectionchange"),f.selection.clear())}},a||50)},_callCmdFn:function(a,b){var c,d,e=b[0].toLowerCase();return c=this.commands[e]||UE.commands[e],d=c&&c[a],c&&d||"queryCommandState"!=a?d?d.apply(this,b):void 0:0},execCommand:function(a){a=a.toLowerCase();var b,c=this,d=c.commands[a]||UE.commands[a];return d&&d.execCommand?(d.notNeedUndo||c.__hasEnterExecCommand?(b=this._callCmdFn("execCommand",arguments),!c.__hasEnterExecCommand&&!d.ignoreContentChange&&!c._ignoreContentChange&&c.fireEvent("contentchange")):(c.__hasEnterExecCommand=!0,c.queryCommandState.apply(c,arguments)!=-1&&(c.fireEvent("saveScene"),c.fireEvent.apply(c,["beforeexeccommand",a].concat(arguments)),b=this._callCmdFn("execCommand",arguments),c.fireEvent.apply(c,["afterexeccommand",a].concat(arguments)),c.fireEvent("saveScene")),c.__hasEnterExecCommand=!1),!c.__hasEnterExecCommand&&!d.ignoreContentChange&&!c._ignoreContentChange&&c._selectionChange(),b):null},queryCommandState:function(a){return this._callCmdFn("queryCommandState",arguments)},queryCommandValue:function(a){return this._callCmdFn("queryCommandValue",arguments)},hasContents:function(a){if(a)for(var b,c=0;b=a[c++];)if(this.document.getElementsByTagName(b).length>0)return!0;if(!domUtils.isEmptyBlock(this.body))return!0;for(a=["div"],c=0;b=a[c++];)for(var d,e=domUtils.getElementsByTagName(this.document,b),f=0;d=e[f++];)if(domUtils.isCustomeNode(d))return!0;return!1},reset:function(){this.fireEvent("reset")},setEnabled:function(){var a,b=this;if("false"==b.body.contentEditable){b.body.contentEditable=!0,a=b.selection.getRange();try{a.moveToBookmark(b.lastBk),delete b.lastBk}catch(c){a.setStartAtFirst(b.body).collapse(!0)}a.select(!0),b.bkqueryCommandState&&(b.queryCommandState=b.bkqueryCommandState,delete b.bkqueryCommandState),b.bkqueryCommandValue&&(b.queryCommandValue=b.bkqueryCommandValue,delete b.bkqueryCommandValue),b.fireEvent("selectionchange")}},enable:function(){return this.setEnabled()},setDisabled:function(a){var b=this;a=a?utils.isArray(a)?a:[a]:[],"true"==b.body.contentEditable&&(b.lastBk||(b.lastBk=b.selection.getRange().createBookmark(!0)),b.body.contentEditable=!1,b.bkqueryCommandState=b.queryCommandState,b.bkqueryCommandValue=b.queryCommandValue,b.queryCommandState=function(c){return utils.indexOf(a,c)!=-1?b.bkqueryCommandState.apply(b,arguments):-1},b.queryCommandValue=function(c){return utils.indexOf(a,c)!=-1?b.bkqueryCommandValue.apply(b,arguments):null},b.fireEvent("selectionchange"))},disable:function(a){return this.setDisabled(a)},_setDefaultContent:function(){function a(){var b=this;b.document.getElementById("initContent")&&(b.body.innerHTML="

    "+(ie?"":"
    ")+"

    ",b.removeListener("firstBeforeExecCommand focus",a),setTimeout(function(){b.focus(),b._selectionChange()},0))}return function(b){var c=this;c.body.innerHTML='

    '+b+"

    ",c.addListener("firstBeforeExecCommand focus",a)}}(),setShow:function(){var a=this,b=a.selection.getRange();if("none"==a.container.style.display){try{b.moveToBookmark(a.lastBk),delete a.lastBk}catch(c){b.setStartAtFirst(a.body).collapse(!0)}setTimeout(function(){b.select(!0)},100),a.container.style.display=""}},show:function(){return this.setShow(); +},setHide:function(){var a=this;a.lastBk||(a.lastBk=a.selection.getRange().createBookmark(!0)),a.container.style.display="none"},hide:function(){return this.setHide()},getLang:function(a){if(!this.options)return"";var b=UE.I18N[this.options.lang];if(!b)throw Error("not import language file");a=(a||"").split(".");for(var c,d=0;(c=a[d++])&&(b=b[c],b););return b},getContentLength:function(a,b){var c=this.getContent(!1,!1,!0).length;if(a){b=(b||[]).concat(["hr","img","iframe"]),c=this.getContentTxt().replace(/[\t\r\n]+/g,"").length;for(var d,e=0;d=b[e++];)c+=this.document.getElementsByTagName(d).length}return c},addInputRule:function(a){this.inputRules.push(a)},filterInputRule:function(a){for(var b,c=0;b=this.inputRules[c++];)b.call(this,a)},addOutputRule:function(a){this.outputRules.push(a)},filterOutputRule:function(a){for(var b,c=0;b=this.outputRules[c++];)b.call(this,a)},getActionUrl:function(a){var b=this.getOpt(a)||a,c=this.getOpt("imageUrl"),d=this.getOpt("serverUrl");return!d&&c&&(d=c.replace(/^(.*[\/]).+([\.].+)$/,"$1controller$2")),d?(d=d+(d.indexOf("?")==-1?"?":"&")+"action="+(b||""),utils.formatUrl(d)):""}},utils.inherits(f,EventBase)}(),UE.Editor.defaultOptions=function(a){var b=a.options.UEDITOR_HOME_URL;return{isShow:!0,initialContent:"",initialStyle:"",autoClearinitialContent:!1,iframeCssUrl:b+"themes/iframe.css",textarea:"editorValue",focus:!1,focusInEnd:!0,autoClearEmptyNode:!0,fullscreen:!1,readonly:!1,zIndex:999,imagePopup:!0,enterTag:"p",customDomain:!1,lang:"zh-cn",langPath:b+"lang/",theme:"default",themePath:b+"themes/",allHtmlEnabled:!1,scaleEnabled:!1,tableNativeEditInFF:!1,autoSyncData:!0,fileNameFormat:"{time}{rand:6}"}},function(){UE.Editor.prototype.loadServerConfig=function(){function showErrorMsg(a){console&&console.error(a)}var me=this;setTimeout(function(){try{me.options.imageUrl&&me.setOpt("serverUrl",me.options.imageUrl.replace(/^(.*[\/]).+([\.].+)$/,"$1controller$2"));var configUrl=me.getActionUrl("config"),isJsonp=utils.isCrossDomainUrl(configUrl);me._serverConfigLoaded=!1,configUrl&&UE.ajax.request(configUrl,{method:"GET",dataType:isJsonp?"jsonp":"",onsuccess:function(r){try{var config=isJsonp?r:eval("("+r.responseText+")");utils.extend(me.options,config),me.fireEvent("serverConfigLoaded"),me._serverConfigLoaded=!0}catch(e){showErrorMsg(me.getLang("loadconfigFormatError"))}},onerror:function(){showErrorMsg(me.getLang("loadconfigHttpError"))}})}catch(e){showErrorMsg(me.getLang("loadconfigError"))}})},UE.Editor.prototype.isServerConfigLoaded=function(){var a=this;return a._serverConfigLoaded||!1},UE.Editor.prototype.afterConfigReady=function(a){if(a&&utils.isFunction(a)){var b=this,c=function(){a.apply(b,arguments),b.removeListener("serverConfigLoaded",c)};b.isServerConfigLoaded()?a.call(b,"serverConfigLoaded"):b.addListener("serverConfigLoaded",c)}}}(),UE.ajax=function(){function a(a){var b=[];for(var c in a)if("method"!=c&&"timeout"!=c&&"async"!=c&&"dataType"!=c&&"callback"!=c&&void 0!=a[c]&&null!=a[c])if("function"!=(typeof a[c]).toLowerCase()&&"object"!=(typeof a[c]).toLowerCase())b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));else if(utils.isArray(a[c]))for(var d=0;d/gi,"").replace(/]*>[\s\S]*?.<\/v:shape>/gi,function(a){if(browser.opera)return"";try{if(/Bitmap/i.test(a))return"";var c=a.match(/width:([ \d.]*p[tx])/i)[1],d=a.match(/height:([ \d.]*p[tx])/i)[1],e=a.match(/src=\s*"([^"]*)"/i)[1];return''}catch(f){return""}}).replace(/<\/?div[^>]*>/g,"").replace(/v:\w+=(["']?)[^'"]+\1/g,"").replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|xml|meta|link|style|\w+:\w+)(?=[\s\/>]))[^>]*>/gi,"").replace(/

    ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

    $1

    ").replace(/\s+(class|lang|align)\s*=\s*(['"]?)([\w-]+)\2/gi,function(a,b,c,d){return"class"==b&&"MsoListParagraph"==d?a:""}).replace(/<(font|span)[^>]*>(\s*)<\/\1>/gi,function(a,b,c){return c.replace(/[\t\r\n ]+/g," ")}).replace(/(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi,function(a,c,d,e){for(var f,g=[],h=e.replace(/^\s+|\s+$/,"").replace(/'/g,"'").replace(/"/gi,"'").replace(/[\d.]+(cm|pt)/g,function(a){return utils.transUnitToPx(a)}).split(/;\s*/g),i=0;f=h[i];i++){var j,k,l=f.split(":");if(2==l.length){if(j=l[0].toLowerCase(),k=l[1].toLowerCase(),/^(background)\w*/.test(j)&&0==k.replace(/(initial|\s)/g,"").length||/^(margin)\w*/.test(j)&&/^0\w+$/.test(k))continue;switch(j){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":/1&&(a(h,j,!0),b(h,j)),c(k,h,i,j);break;case"text":d(g,h);break;case"element":e(g,h,i,j);break;case"comment":f(g,h,i)}return h}function d(a,b){"pre"==a.parentNode.tagName?b.push(a.data):b.push(l[a.parentNode.tagName]?utils.html(a.data):a.data.replace(/[ ]{2}/g,"  "))}function e(d,e,f,g){var h="";if(d.attrs){h=[];var i=d.attrs;for(var j in i)h.push(j+(void 0!==i[j]?'="'+(k[j]?utils.html(i[j]).replace(/["]/g,function(a){return"""}):utils.unhtml(i[j]))+'"':""));h=h.join(" ")}if(e.push("<"+d.tagName+(h?" "+h:"")+(dtd.$empty[d.tagName]?"/":"")+">"),f&&!dtd.$inlineWithA[d.tagName]&&"pre"!=d.tagName&&d.children&&d.children.length&&(g=a(e,g,!0),b(e,g)),d.children&&d.children.length)for(var l,m=0;l=d.children[m++];)f&&"element"==l.type&&!dtd.$inlineWithA[l.tagName]&&m>1&&(a(e,g),b(e,g)),c(l,e,f,g);dtd.$empty[d.tagName]||(f&&!dtd.$inlineWithA[d.tagName]&&"pre"!=d.tagName&&d.children&&d.children.length&&(g=a(e,g),b(e,g)),e.push(""))}function f(a,b){b.push("")}function g(a,b){var c;if("element"==a.type&&a.getAttr("id")==b)return a;if(a.children&&a.children.length)for(var d,e=0;d=a.children[e++];)if(c=g(d,b))return c}function h(a,b,c){if("element"==a.type&&a.tagName==b&&c.push(a),a.children&&a.children.length)for(var d,e=0;d=a.children[e++];)h(d,b,c)}function i(a,b){if(a.children&&a.children.length)for(var c,d=0;c=a.children[d];)i(c,b),c.parentNode&&(c.children&&c.children.length&&b(c),c.parentNode&&d++);else b(a)}var j=UE.uNode=function(a){this.type=a.type,this.data=a.data,this.tagName=a.tagName,this.parentNode=a.parentNode,this.attrs=a.attrs||{},this.children=a.children},k={href:1,src:1,_src:1,_href:1,cdata_data:1},l={style:1,script:1},m=" ",n="\n";j.createElement=function(a){return/[<>]/.test(a)?UE.htmlparser(a).children[0]:new j({type:"element",children:[],tagName:a})},j.createText=function(a,b){return new UE.uNode({type:"text",data:b?a:utils.unhtml(a||"")})},j.prototype={toHtml:function(a){var b=[];return c(this,b,a,0),b.join("")},innerHTML:function(a){if("element"!=this.type||dtd.$empty[this.tagName])return this;if(utils.isString(a)){if(this.children)for(var b,c=0;b=this.children[c++];)b.parentNode=null;this.children=[];for(var b,d=UE.htmlparser(a),c=0;b=d.children[c++];)this.children.push(b),b.parentNode=this;return this}var d=new UE.uNode({type:"root",children:this.children});return d.toHtml()},innerText:function(a,b){if("element"!=this.type||dtd.$empty[this.tagName])return this;if(a){if(this.children)for(var c,d=0;c=this.children[d++];)c.parentNode=null;return this.children=[],this.appendChild(j.createText(a,b)),this}return this.toHtml().replace(/<[^>]+>/g,"")},getData:function(){return"element"==this.type?"":this.data},firstChild:function(){return this.children?this.children[0]:null},lastChild:function(){return this.children?this.children[this.children.length-1]:null},previousSibling:function(){for(var a,b=this.parentNode,c=0;a=b.children[c];c++)if(a===this)return 0==c?null:b.children[c-1]},nextSibling:function(){for(var a,b=this.parentNode,c=0;a=b.children[c++];)if(a===this)return b.children[c]},replaceChild:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var c,d=0;c=this.children[d];d++)if(c===b)return this.children.splice(d,1,a),b.parentNode=null,a.parentNode=this,a}},appendChild:function(a){if("root"==this.type||"element"==this.type&&!dtd.$empty[this.tagName]){this.children||(this.children=[]),a.parentNode&&a.parentNode.removeChild(a);for(var b,c=0;b=this.children[c];c++)if(b===a){this.children.splice(c,1);break}return this.children.push(a),a.parentNode=this,a}},insertBefore:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var c,d=0;c=this.children[d];d++)if(c===b)return this.children.splice(d,0,a),a.parentNode=this,a}},insertAfter:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var c,d=0;c=this.children[d];d++)if(c===b)return this.children.splice(d+1,0,a),a.parentNode=this,a}},removeChild:function(a,b){if(this.children)for(var c,d=0;c=this.children[d];d++)if(c===a){if(this.children.splice(d,1),c.parentNode=null,b&&c.children&&c.children.length)for(var e,f=0;e=c.children[f];f++)this.children.splice(d+f,0,e),e.parentNode=this;return c}},getAttr:function(a){return this.attrs&&this.attrs[a.toLowerCase()]},setAttr:function(a,b){if(!a)return void delete this.attrs;if(this.attrs||(this.attrs={}),utils.isObject(a))for(var c in a)a[c]?this.attrs[c.toLowerCase()]=a[c]:delete this.attrs[c];else b?this.attrs[a.toLowerCase()]=b:delete this.attrs[a]},getIndex:function(){for(var a,b=this.parentNode,c=0;a=b.children[c];c++)if(a===this)return c;return-1},getNodeById:function(a){var b;if(this.children&&this.children.length)for(var c,d=0;c=this.children[d++];)if(b=g(c,a))return b},getNodesByTagName:function(a){a=utils.trim(a).replace(/[ ]{2,}/g," ").split(" ");var b=[],c=this;return utils.each(a,function(a){if(c.children&&c.children.length)for(var d,e=0;d=c.children[e++];)h(d,a,b)}),b},getStyle:function(a){var b=this.getAttr("style");if(!b)return"";var c=new RegExp("(^|;)\\s*"+a+":([^;]+)","i"),d=b.match(c);return d&&d[0]?d[2]:""},setStyle:function(a,b){function c(a,b){var c=new RegExp("(^|;)\\s*"+a+":([^;]+;?)","gi");d=d.replace(c,"$1"),b&&(d=a+":"+utils.unhtml(b)+";"+d)}var d=this.getAttr("style");if(d||(d=""),utils.isObject(a))for(var e in a)c(e,a[e]);else c(a,b);this.setAttr("style",utils.trim(d))},traversal:function(a){return this.children&&this.children.length&&i(this,a),this}}}();var htmlparser=UE.htmlparser=function(a,b){function c(a,b){if(m[a.tagName]){var c=k.createElement(m[a.tagName]);a.appendChild(c),c.appendChild(k.createText(b)),a=c}else a.appendChild(k.createText(b))}function d(a,b,c){var e;if(e=l[b]){for(var f,h=a;"root"!=h.type;){if(utils.isArray(e)?utils.indexOf(e,h.tagName)!=-1:e==h.tagName){a=h,f=!0;break}h=h.parentNode}f||(a=d(a,utils.isArray(e)?e[0]:e))}var i=new k({parentNode:a,type:"element",tagName:b.toLowerCase(),children:dtd.$empty[b]?null:[]});if(c){for(var m,n={};m=g.exec(c);)n[m[1].toLowerCase()]=j[m[1].toLowerCase()]?m[2]||m[3]||m[4]:utils.unhtml(m[2]||m[3]||m[4]);i.attrs=n}return a.children.push(i),dtd.$empty[b]?a:i}function e(a,b){a.children.push(new k({type:"comment",data:b,parentNode:a}))}var f=/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\s\/<>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g,g=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,h={b:1,code:1,i:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,span:1,sub:1,img:1,sup:1,font:1,big:1,small:1,iframe:1,a:1,br:1,pre:1};a=a.replace(new RegExp(domUtils.fillChar,"g"),""),b||(a=a.replace(new RegExp("[\\r\\t\\n"+(b?"":" ")+"]*]*)>[\\r\\t\\n"+(b?"":" ")+"]*","g"),function(a,c){return c&&h[c.toLowerCase()]?a.replace(/(^[\n\r]+)|([\n\r]+$)/g,""):a.replace(new RegExp("^[\\r\\n"+(b?"":" ")+"]+"),"").replace(new RegExp("[\\r\\n"+(b?"":" ")+"]+$"),"")}));for(var i,j={href:1,src:1},k=UE.uNode,l={td:"tr",tr:["tbody","thead","tfoot"],tbody:"table",th:"tr",thead:"table",tfoot:"table",caption:"table",li:["ul","ol"],dt:"dl",dd:"dl",option:"select"},m={ol:"li",ul:"li"},n=0,o=0,p=new k({type:"root",children:[]}),q=p;i=f.exec(a);){n=i.index;try{if(n>o&&c(q,a.slice(o,n)),i[3])dtd.$cdata[q.tagName]?c(q,i[0]):q=d(q,i[3].toLowerCase(),i[4]);else if(i[1]){if("root"!=q.type)if(dtd.$cdata[q.tagName]&&!dtd.$cdata[i[1]])c(q,i[0]);else{for(var r=q;"element"==q.type&&q.tagName!=i[1].toLowerCase();)if(q=q.parentNode,"root"==q.type)throw q=r,"break";q=q.parentNode}}else i[2]&&e(q,i[2])}catch(s){}o=f.lastIndex}return o");break;case"div":if(b.getAttr("cdata_tag"))break;if(d=b.getAttr("class"),d&&/^line number\d+/.test(d))break;if(!e)break;for(var f,g=UE.uNode.createElement("p");f=b.firstChild();)"text"!=f.type&&UE.dom.dtd.$block[f.tagName]?g.firstChild()?(b.parentNode.insertBefore(g,b),g=UE.uNode.createElement("p")):b.parentNode.insertBefore(f,b):g.appendChild(f);g.firstChild()&&b.parentNode.insertBefore(g,b),b.parentNode.removeChild(b);break;case"dl":b.tagName="ul";break;case"dt":case"dd":b.tagName="li";break;case"li":var h=b.getAttr("class");h&&/list\-/.test(h)||b.setAttr();var i=b.getNodesByTagName("ol ul");UE.utils.each(i,function(a){b.parentNode.insertAfter(a,b)});break;case"td":case"th":case"caption":b.children&&b.children.length||b.appendChild(browser.ie11below?UE.uNode.createText(" "):UE.uNode.createElement("br"));break;case"table":a.options.disabledTableInTable&&c(b)&&(b.parentNode.insertBefore(UE.uNode.createText(b.innerText()),b),b.parentNode.removeChild(b))}}})}),a.addOutputRule(function(b){var c;b.traversal(function(b){if("element"==b.type){if(a.options.autoClearEmptyNode&&dtd.$inline[b.tagName]&&!dtd.$empty[b.tagName]&&(!b.attrs||utils.isEmptyObject(b.attrs)))return void(b.firstChild()?"span"!=b.tagName||b.attrs&&!utils.isEmptyObject(b.attrs)||b.parentNode.removeChild(b,!0):b.parentNode.removeChild(b));switch(b.tagName){case"div":(c=b.getAttr("cdata_tag"))&&(b.tagName=c,b.appendChild(UE.uNode.createText(b.getAttr("cdata_data"))),b.setAttr({cdata_tag:"",cdata_data:"",_ue_custom_node_:""}));break;case"a":(c=b.getAttr("_href"))&&b.setAttr({href:utils.html(c),_href:""});break;case"span":c=b.getAttr("id"),c&&/^_baidu_bookmark_/i.test(c)&&b.parentNode.removeChild(b);break;case"img":(c=b.getAttr("_src"))&&b.setAttr({src:b.getAttr("_src"),_src:""})}}})})},UE.commands.inserthtml={execCommand:function(a,b,c){var d,e,f=this;if(b&&f.fireEvent("beforeinserthtml",b)!==!0){if(d=f.selection.getRange(),e=d.document.createElement("div"),e.style.display="inline",!c){var g=UE.htmlparser(b);f.options.filterRules&&UE.filterNode(g,f.options.filterRules),f.filterInputRule(g),b=g.toHtml()}if(e.innerHTML=utils.trim(b),!d.collapsed){var h=d.startContainer;if(domUtils.isFillChar(h)&&d.setStartBefore(h),h=d.endContainer,domUtils.isFillChar(h)&&d.setEndAfter(h),d.txtToElmBoundary(),d.endContainer&&1==d.endContainer.nodeType&&(h=d.endContainer.childNodes[d.endOffset],h&&domUtils.isBr(h)&&d.setEndAfter(h)),0==d.startOffset&&(h=d.startContainer,domUtils.isBoundaryNode(h,"firstChild")&&(h=d.endContainer,d.endOffset==(3==h.nodeType?h.nodeValue.length:h.childNodes.length)&&domUtils.isBoundaryNode(h,"lastChild")&&(f.body.innerHTML="

    "+(browser.ie?"":"
    ")+"

    ",d.setStart(f.body.firstChild,0).collapse(!0)))),!d.collapsed&&d.deleteContents(),1==d.startContainer.nodeType){var i,j=d.startContainer.childNodes[d.startOffset];if(j&&domUtils.isBlockElm(j)&&(i=j.previousSibling)&&domUtils.isBlockElm(i)){for(d.setEnd(i,i.childNodes.length).collapse();j.firstChild;)i.appendChild(j.firstChild);domUtils.remove(j)}}}var j,k,i,l,m,n=0;d.inFillChar()&&(j=d.startContainer,domUtils.isFillChar(j)?(d.setStartBefore(j).collapse(!0),domUtils.remove(j)):domUtils.isFillChar(j,!0)&&(j.nodeValue=j.nodeValue.replace(fillCharReg,""),d.startOffset--,d.collapsed&&d.collapse(!0)));var o=domUtils.findParentByTagName(d.startContainer,"li",!0);if(o){for(var p,q;j=e.firstChild;){for(;j&&(3==j.nodeType||!domUtils.isBlockElm(j)||"HR"==j.tagName);)p=j.nextSibling,d.insertNode(j).collapse(),q=j,j=p;if(j)if(/^(ol|ul)$/i.test(j.tagName)){for(;j.firstChild;)q=j.firstChild,domUtils.insertAfter(o,j.firstChild),o=o.nextSibling;domUtils.remove(j)}else{var r;p=j.nextSibling,r=f.document.createElement("li"),domUtils.insertAfter(o,r),r.appendChild(j),q=j,j=p,o=r}}o=domUtils.findParentByTagName(d.startContainer,"li",!0),domUtils.isEmptyBlock(o)&&domUtils.remove(o),q&&d.setStartAfter(q).collapse(!0).select(!0)}else{for(;j=e.firstChild;){if(n){for(var s=f.document.createElement("p");j&&(3==j.nodeType||!dtd.$block[j.tagName]);)m=j.nextSibling,s.appendChild(j),j=m;s.firstChild&&(j=s)}if(d.insertNode(j),m=j.nextSibling,!n&&j.nodeType==domUtils.NODE_ELEMENT&&domUtils.isBlockElm(j)&&(k=domUtils.findParent(j,function(a){return domUtils.isBlockElm(a)}),k&&"body"!=k.tagName.toLowerCase()&&(!dtd[k.tagName][j.nodeName]||j.parentNode!==k))){if(dtd[k.tagName][j.nodeName])for(l=j.parentNode;l!==k;)i=l,l=l.parentNode;else i=k;domUtils.breakParent(j,i||l);var i=j.previousSibling;domUtils.trimWhiteTextNode(i),i.childNodes.length||domUtils.remove(i),!browser.ie&&(p=j.nextSibling)&&domUtils.isBlockElm(p)&&p.lastChild&&!domUtils.isBr(p.lastChild)&&p.appendChild(f.document.createElement("br")),n=1}var p=j.nextSibling;if(!e.firstChild&&p&&domUtils.isBlockElm(p)){d.setStart(p,0).collapse(!0);break}d.setEndAfter(j).collapse()}if(j=d.startContainer,m&&domUtils.isBr(m)&&domUtils.remove(m),domUtils.isBlockElm(j)&&domUtils.isEmptyNode(j))if(m=j.nextSibling)domUtils.remove(j),1==m.nodeType&&dtd.$block[m.tagName]&&d.setStart(m,0).collapse(!0).shrinkBoundary();else try{j.innerHTML=browser.ie?domUtils.fillChar:"
    "}catch(t){d.setStartBefore(j),domUtils.remove(j)}try{d.select(!0)}catch(t){}}setTimeout(function(){d=f.selection.getRange(),d.scrollToView(f.autoHeightEnabled,f.autoHeightEnabled?domUtils.getXY(f.iframe).y:0),f.fireEvent("afterinserthtml",b)},200)}}},UE.plugins.autotypeset=function(){function a(a,b){return a&&3!=a.nodeType?domUtils.isBr(a)?1:a&&a.parentNode&&l[a.tagName.toLowerCase()]?g&&g.contains(a)||a.getAttribute("pagebreak")?0:b?!domUtils.isEmptyBlock(a):domUtils.isEmptyBlock(a,new RegExp("[\\s"+domUtils.fillChar+"]","g")):void 0:0}function b(a){a.style.cssText||(domUtils.removeAttributes(a,["style"]),"span"==a.tagName.toLowerCase()&&domUtils.hasNoAttributes(a)&&domUtils.remove(a,!0))}function c(c,f){var h,l=this;if(f){if(!i.pasteFilter)return;h=l.document.createElement("div"),h.innerHTML=f.html}else h=l.document.body;for(var m,n=domUtils.getElementsByTagName(h,"*"),o=0;m=n[o++];)if(l.fireEvent("excludeNodeinautotype",m)!==!0){if(i.clearFontSize&&m.style.fontSize&&(domUtils.removeStyle(m,"font-size"),b(m)),i.clearFontFamily&&m.style.fontFamily&&(domUtils.removeStyle(m,"font-family"),b(m)),a(m)){if(i.mergeEmptyline)for(var p,q=m.nextSibling,r=domUtils.isBr(m);a(q)&&(p=q,q=p.nextSibling,!r||q&&(!q||domUtils.isBr(q)));)domUtils.remove(p);if(i.removeEmptyline&&domUtils.inDoc(m,h)&&!k[m.parentNode.tagName.toLowerCase()]){if(domUtils.isBr(m)&&(q=m.nextSibling,q&&!domUtils.isBr(q)))continue;domUtils.remove(m);continue}}if(a(m,!0)&&"SPAN"!=m.tagName&&(i.indent&&(m.style.textIndent=i.indentValue),i.textAlign&&(m.style.textAlign=i.textAlign)),i.removeClass&&m.className&&!j[m.className.toLowerCase()]){if(g&&g.contains(m))continue;domUtils.removeAttributes(m,["class"])}if(i.imageBlockLine&&"img"==m.tagName.toLowerCase()&&!m.getAttribute("emotion"))if(f){var s=m;switch(i.imageBlockLine){case"left":case"right":case"none":for(var p,t,q,u=s.parentNode;dtd.$inline[u.tagName]||"A"==u.tagName;)u=u.parentNode;if(p=u,"P"==p.tagName&&"center"==domUtils.getStyle(p,"text-align")&&!domUtils.isBody(p)&&1==domUtils.getChildCount(p,function(a){return!domUtils.isBr(a)&&!domUtils.isWhitespace(a)}))if(t=p.previousSibling,q=p.nextSibling,t&&q&&1==t.nodeType&&1==q.nodeType&&t.tagName==q.tagName&&domUtils.isBlockElm(t)){for(t.appendChild(p.firstChild);q.firstChild;)t.appendChild(q.firstChild);domUtils.remove(p),domUtils.remove(q)}else domUtils.setStyle(p,"text-align","");domUtils.setStyle(s,"float",i.imageBlockLine);break;case"center":if("center"!=l.queryCommandValue("imagefloat")){for(u=s.parentNode,domUtils.setStyle(s,"float","none"),p=s;u&&1==domUtils.getChildCount(u,function(a){return!domUtils.isBr(a)&&!domUtils.isWhitespace(a)})&&(dtd.$inline[u.tagName]||"A"==u.tagName);)p=u,u=u.parentNode;var v=l.document.createElement("p");domUtils.setAttributes(v,{style:"text-align:center"}),p.parentNode.insertBefore(v,p),v.appendChild(p),domUtils.setStyle(p,"float","")}}}else{var w=l.selection.getRange();w.selectNode(m).select(),l.execCommand("imagefloat",i.imageBlockLine)}i.removeEmptyNode&&i.removeTagNames[m.tagName.toLowerCase()]&&domUtils.hasNoAttributes(m)&&domUtils.isEmptyBlock(m)&&domUtils.remove(m)}if(i.tobdc){var x=UE.htmlparser(h.innerHTML);x.traversal(function(a){"text"==a.type&&(a.data=e(a.data))}),h.innerHTML=x.toHtml()}if(i.bdc2sb){var x=UE.htmlparser(h.innerHTML);x.traversal(function(a){"text"==a.type&&(a.data=d(a.data))}),h.innerHTML=x.toHtml()}f&&(f.html=h.innerHTML)}function d(a){for(var b="",c=0;c=65281&&d<=65373?String.fromCharCode(a.charCodeAt(c)-65248):12288==d?String.fromCharCode(a.charCodeAt(c)-12288+32):a.charAt(c)}return b}function e(a){a=utils.html(a);for(var b="",c=0;c0?e.substring(e.indexOf(d.options.imagePath),e.length-1).replace(/"|\(|\)/gi,""):"none"!=e?e.replace(/url\("?|"?\)/gi,""):"";var g=' ",b.push(g)},aftersetcontent:function(){0==c&&b()}},inputRule:function(d){c=!1,utils.each(d.getNodesByTagName("p"),function(d){var e=d.getAttr("data-background");e&&(c=!0,b(a(e)),d.parentNode.removeChild(d))})},outputRule:function(a){var b=this,c=(utils.cssRule(e,b.document)||"").replace(/[\n\r]+/g,"").match(f);c&&a.appendChild(UE.uNode.createElement('


    '))},commands:{background:{execCommand:function(a,c){b(c)},queryCommandValue:function(){var b=this,c=(utils.cssRule(e,b.document)||"").replace(/[\n\r]+/g,"").match(f);return c?a(c[1]):null},notNeedUndo:!0}}}}),UE.commands.imagefloat={execCommand:function(a,b){var c=this,d=c.selection.getRange();if(!d.collapsed){var e=d.getClosedNode();if(e&&"IMG"==e.tagName)switch(b){case"left":case"right":case"none":for(var f,g,h,i=e.parentNode;dtd.$inline[i.tagName]||"A"==i.tagName;)i=i.parentNode;if(f=i,"P"==f.tagName&&"center"==domUtils.getStyle(f,"text-align")){if(!domUtils.isBody(f)&&1==domUtils.getChildCount(f,function(a){return!domUtils.isBr(a)&&!domUtils.isWhitespace(a)}))if(g=f.previousSibling,h=f.nextSibling,g&&h&&1==g.nodeType&&1==h.nodeType&&g.tagName==h.tagName&&domUtils.isBlockElm(g)){for(g.appendChild(f.firstChild);h.firstChild;)g.appendChild(h.firstChild);domUtils.remove(f),domUtils.remove(h)}else domUtils.setStyle(f,"text-align","");d.selectNode(e).select()}domUtils.setStyle(e,"float","none"==b?"":b),"none"==b&&domUtils.removeAttributes(e,"align");break;case"center":if("center"!=c.queryCommandValue("imagefloat")){for(i=e.parentNode,domUtils.setStyle(e,"float",""),domUtils.removeAttributes(e,"align"),f=e;i&&1==domUtils.getChildCount(i,function(a){return!domUtils.isBr(a)&&!domUtils.isWhitespace(a)})&&(dtd.$inline[i.tagName]||"A"==i.tagName);)f=i,i=i.parentNode;d.setStartBefore(f).setCursor(!1),i=c.document.createElement("div"),i.appendChild(f),domUtils.setStyle(f,"float",""),c.execCommand("insertHtml",'

    '+i.innerHTML+"

    "),f=c.document.getElementById("_img_parent_tmp"),f.removeAttribute("id"),f=f.firstChild,d.selectNode(f).select(),h=f.parentNode.nextSibling,h&&domUtils.isEmptyNode(h)&&domUtils.remove(h)}}}},queryCommandValue:function(){var a,b,c=this.selection.getRange();return c.collapsed?"none":(a=c.getClosedNode(),a&&1==a.nodeType&&"IMG"==a.tagName?(b=domUtils.getComputedStyle(a,"float")||a.getAttribute("align"),"none"==b&&(b="center"==domUtils.getComputedStyle(a.parentNode,"text-align")?"center":b),{left:1,right:1,center:1}[b]?b:"none"):"none")},queryCommandState:function(){var a,b=this.selection.getRange();return b.collapsed?-1:(a=b.getClosedNode(),a&&1==a.nodeType&&"IMG"==a.tagName?0:-1)}},UE.commands.insertimage={execCommand:function(a,b){function c(a){utils.each("width,height,border,hspace,vspace".split(","),function(b){a[b]&&(a[b]=parseInt(a[b],10)||0)}),utils.each("src,_src".split(","),function(b){a[b]&&(a[b]=utils.unhtmlForUrl(a[b]))}),utils.each("title,alt".split(","),function(b){a[b]&&(a[b]=utils.unhtml(a[b]))})}if(b=utils.isArray(b)?b:[b],b.length){var d=this,e=d.selection.getRange(),f=e.getClosedNode();if(d.fireEvent("beforeinsertimage",b)!==!0){if(!f||!/img/i.test(f.tagName)||"edui-faked-video"==f.className&&f.className.indexOf("edui-upload-video")==-1||f.getAttribute("word_img")){var g,h=[],i="";if(g=b[0],1==b.length)c(g),i=''+g.alt+'","center"==g.floatStyle&&(i='

    '+i+"

    "),h.push(i);else for(var j=0;g=b[j++];)c(g),i="

    ",h.push(i);d.execCommand("insertHtml",h.join(""))}else{var k=b.shift(),l=k.floatStyle;delete k.floatStyle,domUtils.setAttributes(f,k),d.execCommand("imagefloat",l),b.length>0&&(e.setStartAfter(f).setCursor(!1,!0),d.execCommand("insertimage",b))}d.fireEvent("afterinsertimage",b)}}}},UE.plugins.justify=function(){var a=domUtils.isBlockElm,b={left:1,right:1,center:1,justify:1},c=function(b,c){var d=b.createBookmark(),e=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase()&&!domUtils.isBookmarkNode(a):!domUtils.isWhitespace(a)};b.enlarge(!0);for(var f,g=b.createBookmark(),h=domUtils.getNextDomNode(g.start,!1,e),i=b.cloneRange();h&&!(domUtils.getPosition(h,g.end)&domUtils.POSITION_FOLLOWING);)if(3!=h.nodeType&&a(h))h=domUtils.getNextDomNode(h,!0,e);else{for(i.setStartBefore(h);h&&h!==g.end&&!a(h);)f=h,h=domUtils.getNextDomNode(h,!1,null,function(b){return!a(b)});i.setEndAfter(f);var j=i.getCommonAncestor();if(!domUtils.isBody(j)&&a(j))domUtils.setStyles(j,utils.isString(c)?{"text-align":c}:c),h=j;else{var k=b.document.createElement("p");domUtils.setStyles(k,utils.isString(c)?{"text-align":c}:c);var l=i.extractContents();k.appendChild(l),i.insertNode(k),h=k}h=domUtils.getNextDomNode(h,!1,e)}return b.moveToBookmark(g).moveToBookmark(d)};UE.commands.justify={execCommand:function(a,b){var d,e=this.selection.getRange();return e.collapsed&&(d=this.document.createTextNode("p"),e.insertNode(d)),c(e,b),d&&(e.setStartBefore(d).collapse(!0),domUtils.remove(d)),e.select(),!0},queryCommandValue:function(){var a=this.selection.getStart(),c=domUtils.getComputedStyle(a,"text-align");return b[c]?c:"left"},queryCommandState:function(){var a=this.selection.getStart(),b=a&&domUtils.findParentByTagName(a,["td","th","caption"],!0);return b?-1:0}}},UE.plugins.font=function(){function a(a){for(var b;(b=a.parentNode)&&"SPAN"==b.tagName&&1==domUtils.getChildCount(b,function(a){return!domUtils.isBookmarkNode(a)&&!domUtils.isBr(a)});)b.style.cssText+=a.style.cssText,domUtils.remove(a,!0),a=b}function b(a,b,c){if(g[b]&&(a.adjustmentBoundary(),!a.collapsed&&1==a.startContainer.nodeType)){var d=a.startContainer.childNodes[a.startOffset];if(d&&domUtils.isTagNode(d,"span")){var e=a.createBookmark();utils.each(domUtils.getElementsByTagName(d,"span"),function(a){a.parentNode&&!domUtils.isBookmarkNode(a)&&("backcolor"==b&&domUtils.getComputedStyle(a,"background-color").toLowerCase()===c||(domUtils.removeStyle(a,g[b]),0==a.style.cssText.replace(/^\s+$/,"").length&&domUtils.remove(a,!0)))}),a.moveToBookmark(e)}}}function c(c,d,e){var f,g=c.collapsed,h=c.createBookmark();if(g)for(f=h.start.parentNode;dtd.$inline[f.tagName];)f=f.parentNode;else f=domUtils.getCommonAncestor(h.start,h.end);utils.each(domUtils.getElementsByTagName(f,"span"),function(b){if(b.parentNode&&!domUtils.isBookmarkNode(b)){if(/\s*border\s*:\s*none;?\s*/i.test(b.style.cssText))return void(/^\s*border\s*:\s*none;?\s*$/.test(b.style.cssText)?domUtils.remove(b,!0):domUtils.removeStyle(b,"border"));if(/border/i.test(b.style.cssText)&&"SPAN"==b.parentNode.tagName&&/border/i.test(b.parentNode.style.cssText)&&(b.style.cssText=b.style.cssText.replace(/border[^:]*:[^;]+;?/gi,"")),"fontborder"!=d||"none"!=e)for(var c=b.nextSibling;c&&1==c.nodeType&&"SPAN"==c.tagName;)if(domUtils.isBookmarkNode(c)&&"fontborder"==d)b.appendChild(c),c=b.nextSibling;else{if(c.style.cssText==b.style.cssText&&(domUtils.moveChild(c,b),domUtils.remove(c)),b.nextSibling===c)break;c=b.nextSibling}if(a(b),browser.ie&&browser.version>8){var f=domUtils.findParent(b,function(a){return"SPAN"==a.tagName&&/background-color/.test(a.style.cssText)});f&&!/background-color/.test(b.style.cssText)&&(b.style.backgroundColor=f.style.backgroundColor)}}}),c.moveToBookmark(h),b(c,d,e)}var d=this,e={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family",underline:"text-decoration",strikethrough:"text-decoration",fontborder:"border"},f={underline:1,strikethrough:1,fontborder:1},g={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family"};d.setOpt({fontfamily:[{name:"songti",val:"宋体,SimSun"},{name:"yahei",val:"微软雅黑,Microsoft YaHei"},{name:"kaiti",val:"楷体,楷体_GB2312, SimKai"},{name:"heiti",val:"黑体, SimHei"},{name:"lishu",val:"隶书, SimLi"},{name:"andaleMono",val:"andale mono"},{name:"arial",val:"arial, helvetica,sans-serif"},{name:"arialBlack",val:"arial black,avant garde"},{name:"comicSansMs",val:"comic sans ms"},{name:"impact",val:"impact,chicago"},{name:"timesNewRoman",val:"times new roman"}],fontsize:[10,11,12,14,16,18,20,24,36]}),d.addInputRule(function(a){utils.each(a.getNodesByTagName("u s del font strike"),function(a){if("font"==a.tagName){var b=[];for(var c in a.attrs)switch(c){case"size":b.push("font-size:"+({1:"10",2:"12",3:"16",4:"18",5:"24",6:"32",7:"48"}[a.attrs[c]]||a.attrs[c])+"px");break;case"color":b.push("color:"+a.attrs[c]);break;case"face":b.push("font-family:"+a.attrs[c]);break;case"style":b.push(a.attrs[c])}a.attrs={style:b.join(";")}}else{var d="u"==a.tagName?"underline":"line-through";a.attrs={style:(a.getAttr("style")||"")+"text-decoration:"+d+";"}}a.tagName="span"})});for(var h in e)!function(a,b){UE.commands[a]={execCommand:function(d,e){e=e||(this.queryCommandState(d)?"none":"underline"==d?"underline":"fontborder"==d?"1px solid #000":"line-through");var g,h=this,i=this.selection.getRange();if("default"==e)i.collapsed&&(g=h.document.createTextNode("font"),i.insertNode(g).select()),h.execCommand("removeFormat","span,a",b),g&&(i.setStartBefore(g).collapse(!0),domUtils.remove(g)),c(i,d,e),i.select();else if(i.collapsed){var j=domUtils.findParentByTagName(i.startContainer,"span",!0);if(g=h.document.createTextNode("font"),!j||j.children.length||j[browser.ie?"innerText":"textContent"].replace(fillCharReg,"").length){if(i.insertNode(g),i.selectNode(g).select(),j=i.document.createElement("span"),f[a]){if(domUtils.findParentByTagName(g,"a",!0))return i.setStartBefore(g).setCursor(),void domUtils.remove(g);h.execCommand("removeFormat","span,a",b)}if(j.style.cssText=b+":"+e,g.parentNode.insertBefore(j,g),!browser.ie||browser.ie&&9==browser.version)for(var k=j.parentNode;!domUtils.isBlockElm(k);)"SPAN"==k.tagName&&(j.style.cssText=k.style.cssText+";"+j.style.cssText),k=k.parentNode;opera?setTimeout(function(){i.setStart(j,0).collapse(!0),c(i,d,e),i.select()}):(i.setStart(j,0).collapse(!0),c(i,d,e),i.select())}else i.insertNode(g),f[a]&&(i.selectNode(g).select(),h.execCommand("removeFormat","span,a",b,null),j=domUtils.findParentByTagName(g,"span",!0),i.setStartBefore(g)),j&&(j.style.cssText+=";"+b+":"+e),i.collapse(!0).select();domUtils.remove(g)}else f[a]&&h.queryCommandValue(a)&&h.execCommand("removeFormat","span,a",b),i=h.selection.getRange(),i.applyInlineStyle("span",{style:b+":"+e}),c(i,d,e),i.select();return!0},queryCommandValue:function(a){var c=this.selection.getStart();if("underline"==a||"strikethrough"==a){for(var d,e=c;e&&!domUtils.isBlockElm(e)&&!domUtils.isBody(e);){if(1==e.nodeType&&(d=domUtils.getComputedStyle(e,b),"none"!=d))return d;e=e.parentNode}return"none"}if("fontborder"==a){for(var f,g=c;g&&dtd.$inline[g.tagName];){if((f=domUtils.getComputedStyle(g,"border"))&&/1px/.test(f)&&/solid/.test(f))return f;g=g.parentNode}return""}if("FontSize"==a){var h=domUtils.getComputedStyle(c,b),g=/^([\d\.]+)(\w+)$/.exec(h);return g?Math.floor(g[1])+g[2]:h}return domUtils.getComputedStyle(c,b)},queryCommandState:function(a){if(!f[a])return 0;var b=this.queryCommandValue(a);return"fontborder"==a?/1px/.test(b)&&/solid/.test(b):"underline"==a?/underline/.test(b):/line\-through/.test(b)}}}(h,e[h])},UE.plugins.link=function(){function a(a){var b=a.startContainer,c=a.endContainer;(b=domUtils.findParentByTagName(b,"a",!0))&&a.setStartBefore(b),(c=domUtils.findParentByTagName(c,"a",!0))&&a.setEndAfter(c)}function b(b,c,d){var e=b.cloneRange(),f=d.queryCommandValue("link");a(b=b.adjustmentBoundary());var g=b.startContainer;if(1==g.nodeType&&f&&(g=g.childNodes[b.startOffset],g&&1==g.nodeType&&"A"==g.tagName&&/^(?:https?|ftp|file)\s*:\s*\/\//.test(g[browser.ie?"innerText":"textContent"])&&(g[browser.ie?"innerText":"textContent"]=utils.html(c.textValue||c.href))),e.collapsed&&!f||(b.removeInlineStyle("a"),e=b.cloneRange()),e.collapsed){var h=b.document.createElement("a"),i="";c.textValue?(i=utils.html(c.textValue),delete c.textValue):i=utils.html(c.href),domUtils.setAttributes(h,c),g=domUtils.findParentByTagName(e.startContainer,"a",!0),g&&domUtils.isInNodeEndBoundary(e,g)&&b.setStartAfter(g).collapse(!0),h[browser.ie?"innerText":"textContent"]=i,b.insertNode(h).selectNode(h)}else b.applyInlineStyle("a",c)}UE.commands.unlink={execCommand:function(){var b,c=this.selection.getRange();c.collapsed&&!domUtils.findParentByTagName(c.startContainer,"a",!0)||(b=c.createBookmark(),a(c),c.removeInlineStyle("a").moveToBookmark(b).select())},queryCommandState:function(){return!this.highlight&&this.queryCommandValue("link")?0:-1}},UE.commands.link={execCommand:function(a,c){var d;c._href&&(c._href=utils.unhtml(c._href,/[<">]/g)),c.href&&(c.href=utils.unhtml(c.href,/[<">]/g)),c.textValue&&(c.textValue=utils.unhtml(c.textValue,/[<">]/g)),b(d=this.selection.getRange(),c,this),d.collapse().select(!0)},queryCommandValue:function(){var a,b=this.selection.getRange();if(!b.collapsed){b.shrinkBoundary();var c=3!=b.startContainer.nodeType&&b.startContainer.childNodes[b.startOffset]?b.startContainer.childNodes[b.startOffset]:b.startContainer,d=3==b.endContainer.nodeType||0==b.endOffset?b.endContainer:b.endContainer.childNodes[b.endOffset-1],e=b.getCommonAncestor();if(a=domUtils.findParentByTagName(e,"a",!0),!a&&1==e.nodeType)for(var f,g,h,i=e.getElementsByTagName("a"),j=0;h=i[j++];)if(f=domUtils.getPosition(h,c),g=domUtils.getPosition(h,d),(f&domUtils.POSITION_FOLLOWING||f&domUtils.POSITION_CONTAINS)&&(g&domUtils.POSITION_PRECEDING||g&domUtils.POSITION_CONTAINS)){a=h;break}return a}if(a=b.startContainer,a=1==a.nodeType?a:a.parentNode,a&&(a=domUtils.findParentByTagName(a,"a",!0))&&!domUtils.isInNodeEndBoundary(b,a))return a},queryCommandState:function(){var a=this.selection.getRange().getClosedNode(),b=a&&("edui-faked-video"==a.className||a.className.indexOf("edui-upload-video")!=-1);return b?-1:0}}},UE.plugins.insertframe=function(){function a(){b._iframe&&delete b._iframe}var b=this;b.addListener("selectionchange",function(){a()})},UE.commands.scrawl={queryCommandState:function(){return browser.ie&&browser.version<=8?-1:0}},UE.plugins.removeformat=function(){var a=this;a.setOpt({removeFormatTags:"b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var",removeFormatAttributes:"class,style,lang,width,height,align,hspace,valign"}),a.commands.removeformat={execCommand:function(a,b,c,d,e){function f(a){if(3==a.nodeType||"span"!=a.tagName.toLowerCase())return 0;if(browser.ie){var b=a.attributes;if(b.length){for(var c=0,d=b.length;c
    "+this.getContent(null,null,!0)+"
    "),b.close()},notNeedUndo:1},UE.plugins.selectall=function(){var a=this;a.commands.selectall={execCommand:function(){var a=this,b=a.body,c=a.selection.getRange();c.selectNodeContents(b),domUtils.isEmptyBlock(b)&&(browser.opera&&b.firstChild&&1==b.firstChild.nodeType&&c.setStartAtFirst(b.firstChild),c.collapse(!0)),c.select(!0)},notNeedUndo:1},a.addshortcutkey({selectAll:"ctrl+65"})},UE.plugins.paragraph=function(){var a=this,b=domUtils.isBlockElm,c=["TD","LI","PRE"],d=function(a,d,e,f){var g,h=a.createBookmark(),i=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase()&&!domUtils.isBookmarkNode(a):!domUtils.isWhitespace(a)};a.enlarge(!0);for(var j,k=a.createBookmark(),l=domUtils.getNextDomNode(k.start,!1,i),m=a.cloneRange();l&&!(domUtils.getPosition(l,k.end)&domUtils.POSITION_FOLLOWING);)if(3!=l.nodeType&&b(l))l=domUtils.getNextDomNode(l,!0,i);else{for(m.setStartBefore(l);l&&l!==k.end&&!b(l);)j=l,l=domUtils.getNextDomNode(l,!1,null,function(a){return!b(a)});m.setEndAfter(j),g=a.document.createElement(d),e&&(domUtils.setAttributes(g,e),f&&"customstyle"==f&&e.style&&(g.style.cssText=e.style)),g.appendChild(m.extractContents()),domUtils.isEmptyNode(g)&&domUtils.fillChar(a.document,g),m.insertNode(g);var n=g.parentNode;b(n)&&!domUtils.isBody(g.parentNode)&&utils.indexOf(c,n.tagName)==-1&&(f&&"customstyle"==f||(n.getAttribute("dir")&&g.setAttribute("dir",n.getAttribute("dir")),n.style.cssText&&(g.style.cssText=n.style.cssText+";"+g.style.cssText),n.style.textAlign&&!g.style.textAlign&&(g.style.textAlign=n.style.textAlign),n.style.textIndent&&!g.style.textIndent&&(g.style.textIndent=n.style.textIndent),n.style.padding&&!g.style.padding&&(g.style.padding=n.style.padding)),e&&/h\d/i.test(n.tagName)&&!/h\d/i.test(g.tagName)?(domUtils.setAttributes(n,e),f&&"customstyle"==f&&e.style&&(n.style.cssText=e.style),domUtils.remove(g,!0),g=n):domUtils.remove(g.parentNode,!0)),l=utils.indexOf(c,n.tagName)!=-1?n:g,l=domUtils.getNextDomNode(l,!1,i)}return a.moveToBookmark(k).moveToBookmark(h)};a.setOpt("paragraph",{p:"",h1:"",h2:"",h3:"",h4:"",h5:"",h6:""}),a.commands.paragraph={execCommand:function(a,b,c,e){var f=this.selection.getRange();if(f.collapsed){var g=this.document.createTextNode("p");if(f.insertNode(g),browser.ie){var h=g.previousSibling;h&&domUtils.isWhitespace(h)&&domUtils.remove(h),h=g.nextSibling,h&&domUtils.isWhitespace(h)&&domUtils.remove(h)}}if(f=d(f,b,c,e),g&&(f.setStartBefore(g).collapse(!0),pN=g.parentNode,domUtils.remove(g),domUtils.isBlockElm(pN)&&domUtils.isEmptyNode(pN)&&domUtils.fillNode(this.document,pN)),browser.gecko&&f.collapsed&&1==f.startContainer.nodeType){var i=f.startContainer.childNodes[f.startOffset];i&&1==i.nodeType&&i.tagName.toLowerCase()==b&&f.setStart(i,0).collapse(!0)}return f.select(),!0},queryCommandValue:function(){var a=domUtils.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");return a?a.tagName.toLowerCase():""}}},function(){var a=domUtils.isBlockElm,b=function(a){return domUtils.filterNodeList(a.selection.getStartElementPath(),function(a){return a&&1==a.nodeType&&a.getAttribute("dir")})},c=function(c,d,e){var f,g=function(a){return 1==a.nodeType?!domUtils.isBookmarkNode(a):!domUtils.isWhitespace(a)},h=b(d);if(h&&c.collapsed)return h.setAttribute("dir",e),c;f=c.createBookmark(),c.enlarge(!0);for(var i,j=c.createBookmark(),k=domUtils.getNextDomNode(j.start,!1,g),l=c.cloneRange();k&&!(domUtils.getPosition(k,j.end)&domUtils.POSITION_FOLLOWING);)if(3!=k.nodeType&&a(k))k=domUtils.getNextDomNode(k,!0,g);else{for(l.setStartBefore(k);k&&k!==j.end&&!a(k);)i=k,k=domUtils.getNextDomNode(k,!1,null,function(b){return!a(b)});l.setEndAfter(i);var m=l.getCommonAncestor();if(!domUtils.isBody(m)&&a(m))m.setAttribute("dir",e),k=m;else{var n=c.document.createElement("p");n.setAttribute("dir",e);var o=l.extractContents();n.appendChild(o),l.insertNode(n),k=n}k=domUtils.getNextDomNode(k,!1,g)}return c.moveToBookmark(j).moveToBookmark(f)};UE.commands.directionality={execCommand:function(a,b){var d=this.selection.getRange();if(d.collapsed){var e=this.document.createTextNode("d");d.insertNode(e)}return c(d,this,b),e&&(d.setStartBefore(e).collapse(!0),domUtils.remove(e)),d.select(),!0},queryCommandValue:function(){var a=b(this);return a?a.getAttribute("dir"):"ltr"}}}(),UE.plugins.horizontal=function(){var a=this;a.commands.horizontal={execCommand:function(a){var b=this;if(b.queryCommandState(a)!==-1){b.execCommand("insertHtml","
    ");var c=b.selection.getRange(),d=c.startContainer;if(1==d.nodeType&&!d.childNodes[c.startOffset]){var e;(e=d.childNodes[c.startOffset-1])&&1==e.nodeType&&"HR"==e.tagName&&("p"==b.options.enterTag?(e=b.document.createElement("p"),c.insertNode(e),c.setStart(e,0).setCursor()):(e=b.document.createElement("br"),c.insertNode(e),c.setStartBefore(e).setCursor()))}return!0}},queryCommandState:function(){return domUtils.filterNodeList(this.selection.getStartElementPath(),"table")?-1:0}},a.addListener("delkeydown",function(a,b){var c=this.selection.getRange();if(c.txtToElmBoundary(!0),domUtils.isStartInblock(c)){var d=c.startContainer,e=d.previousSibling;if(e&&domUtils.isTagNode(e,"hr"))return domUtils.remove(e),c.select(),domUtils.preventDefault(b),!0}})},UE.commands.time=UE.commands.date={execCommand:function(a,b){function c(a,b){var c=("0"+a.getHours()).slice(-2),d=("0"+a.getMinutes()).slice(-2),e=("0"+a.getSeconds()).slice(-2);return b=b||"hh:ii:ss",b.replace(/hh/gi,c).replace(/ii/gi,d).replace(/ss/gi,e)}function d(a,b){var c=("000"+a.getFullYear()).slice(-4),d=c.slice(-2),e=("0"+(a.getMonth()+1)).slice(-2),f=("0"+a.getDate()).slice(-2);return b=b||"yyyy-mm-dd",b.replace(/yyyy/gi,c).replace(/yy/gi,d).replace(/mm/gi,e).replace(/dd/gi,f)}var e=new Date;this.execCommand("insertHtml","time"==a?c(e,b):d(e,b))}},UE.plugins.rowspacing=function(){var a=this;a.setOpt({rowspacingtop:["5","10","15","20","25"],rowspacingbottom:["5","10","15","20","25"]}),a.commands.rowspacing={execCommand:function(a,b,c){return this.execCommand("paragraph","p",{style:"margin-"+c+":"+b+"px"}),!0},queryCommandValue:function(a,b){var c,d=domUtils.filterNodeList(this.selection.getStartElementPath(),function(a){return domUtils.isBlockElm(a)});return d?(c=domUtils.getComputedStyle(d,"margin-"+b).replace(/[^\d]/g,""),c?c:0):0}}},UE.plugins.lineheight=function(){var a=this;a.setOpt({lineheight:["1","1.5","1.75","2","3","4","5"]}),a.commands.lineheight={execCommand:function(a,b){return this.execCommand("paragraph","p",{style:"line-height:"+("1"==b?"normal":b+"em")}),!0},queryCommandValue:function(){var a=domUtils.filterNodeList(this.selection.getStartElementPath(),function(a){return domUtils.isBlockElm(a)});if(a){var b=domUtils.getComputedStyle(a,"line-height");return"normal"==b?1:b.replace(/[^\d.]*/gi,"")}}}},UE.plugins.insertcode=function(){var a=this;a.ready(function(){utils.cssRule("pre","pre{margin:.5em 0;padding:.4em .6em;border-radius:8px;background:#f8f8f8;}",a.document)}),a.setOpt("insertcode",{as3:"ActionScript3",bash:"Bash/Shell",cpp:"C/C++",css:"Css",cf:"CodeFunction","c#":"C#",delphi:"Delphi",diff:"Diff",erlang:"Erlang",groovy:"Groovy",html:"Html",java:"Java",jfx:"JavaFx",js:"Javascript",pl:"Perl",php:"Php",plain:"Plain Text",ps:"PowerShell",python:"Python",ruby:"Ruby",scala:"Scala",sql:"Sql",vb:"Vb",xml:"Xml"}),a.commands.insertcode={execCommand:function(a,b){var c=this,d=c.selection.getRange(),e=domUtils.findParentByTagName(d.startContainer,"pre",!0);if(e)e.className="brush:"+b+";toolbar:false;";else{var f="";if(d.collapsed)f=browser.ie&&browser.ie11below?browser.version<=8?" ":"":"
    ";else{var g=d.extractContents(),h=c.document.createElement("div");h.appendChild(g),utils.each(UE.filterNode(UE.htmlparser(h.innerHTML.replace(/[\r\t]/g,"")),c.options.filterTxtRules).children,function(a){if(browser.ie&&browser.ie11below&&browser.version>8)"element"==a.type?"br"==a.tagName?f+="\n":dtd.$empty[a.tagName]||(utils.each(a.children,function(b){"element"==b.type?"br"==b.tagName?f+="\n":dtd.$empty[a.tagName]||(f+=b.innerText()):f+=b.data}),/\n$/.test(f)||(f+="\n")):f+=a.data+"\n",!a.nextSibling()&&/\n$/.test(f)&&(f=f.replace(/\n$/,""));else if(browser.ie&&browser.ie11below)"element"==a.type?"br"==a.tagName?f+="
    ":dtd.$empty[a.tagName]||(utils.each(a.children,function(b){"element"==b.type?"br"==b.tagName?f+="
    ":dtd.$empty[a.tagName]||(f+=b.innerText()):f+=b.data}),/br>$/.test(f)||(f+="
    ")):f+=a.data+"
    ",!a.nextSibling()&&/
    $/.test(f)&&(f=f.replace(/
    $/,""));else if(f+="element"==a.type?dtd.$empty[a.tagName]?"":a.innerText():a.data,!/br\/?\s*>$/.test(f)){if(!a.nextSibling())return;f+="
    "}})}c.execCommand("inserthtml",'
    '+f+"
    ",!0),e=c.document.getElementById("coder"),domUtils.removeAttributes(e,"id");var i=e.previousSibling;i&&(3==i.nodeType&&1==i.nodeValue.length&&browser.ie&&6==browser.version||domUtils.isEmptyBlock(i))&&domUtils.remove(i);var d=c.selection.getRange();domUtils.isEmptyBlock(e)?d.setStart(e,0).setCursor(!1,!0):d.selectNodeContents(e).select()}},queryCommandValue:function(){var a=this.selection.getStartElementPath(),b="";return utils.each(a,function(a){if("PRE"==a.nodeName){var c=a.className.match(/brush:([^;]+)/);return b=c&&c[1]?c[1]:"",!1}}),b}},a.addInputRule(function(a){utils.each(a.getNodesByTagName("pre"),function(a){var b=a.getNodesByTagName("br");if(b.length)return void(browser.ie&&browser.ie11below&&browser.version>8&&utils.each(b,function(a){var b=UE.uNode.createText("\n");a.parentNode.insertBefore(b,a),a.parentNode.removeChild(a)}));if(!(browser.ie&&browser.ie11below&&browser.version>8)){var c=a.innerText().split(/\n/);a.innerHTML(""),utils.each(c,function(b){b.length&&a.appendChild(UE.uNode.createText(b)),a.appendChild(UE.uNode.createElement("br"))})}})}),a.addOutputRule(function(a){utils.each(a.getNodesByTagName("pre"),function(a){var b="";utils.each(a.children,function(a){b+="text"==a.type?a.data.replace(/[ ]/g," ").replace(/\n$/,""):"br"==a.tagName?"\n":dtd.$empty[a.tagName]?a.innerText():""}),a.innerText(b.replace(/( |\n)+$/,""))})}),a.notNeedCodeQuery={help:1,undo:1,redo:1,source:1,print:1,searchreplace:1,fullscreen:1,preview:1,insertparagraph:1,elementpath:1,insertcode:1,inserthtml:1,selectall:1};a.queryCommandState;a.queryCommandState=function(a){var b=this;return!b.notNeedCodeQuery[a.toLowerCase()]&&b.selection&&b.queryCommandValue("insertcode")?-1:UE.Editor.prototype.queryCommandState.apply(this,arguments)},a.addListener("beforeenterkeydown",function(){var b=a.selection.getRange(),c=domUtils.findParentByTagName(b.startContainer,"pre",!0);if(c){if(a.fireEvent("saveScene"),b.collapsed||b.deleteContents(),!browser.ie||browser.ie9above){var c,d=a.document.createElement("br");b.insertNode(d).setStartAfter(d).collapse(!0); +var e=d.nextSibling;e||browser.ie&&!(browser.version>10)?b.setStartAfter(d):b.insertNode(d.cloneNode(!1)),c=d.previousSibling;for(var f;c;)if(f=c,c=c.previousSibling,!c||"BR"==c.nodeName){c=f;break}if(c){for(var g="";c&&"BR"!=c.nodeName&&new RegExp("^[\\s"+domUtils.fillChar+"]*$").test(c.nodeValue);)g+=c.nodeValue,c=c.nextSibling;if("BR"!=c.nodeName){var h=c.nodeValue.match(new RegExp("^([\\s"+domUtils.fillChar+"]+)"));h&&h[1]&&(g+=h[1])}g&&(g=a.document.createTextNode(g),b.insertNode(g).setStartAfter(g))}b.collapse(!0).select(!0)}else if(browser.version>8){var i=a.document.createTextNode("\n"),j=b.startContainer;if(0==b.startOffset){var k=j.previousSibling;if(k){b.insertNode(i);var l=a.document.createTextNode(" ");b.setStartAfter(i).insertNode(l).setStart(l,0).collapse(!0).select(!0)}}else{b.insertNode(i).setStartAfter(i);var l=a.document.createTextNode(" ");j=b.startContainer.childNodes[b.startOffset],j&&!/^\n/.test(j.nodeValue)&&b.setStartBefore(i),b.insertNode(l).setStart(l,0).collapse(!0).select(!0)}}else{var d=a.document.createElement("br");b.insertNode(d),b.insertNode(a.document.createTextNode(domUtils.fillChar)),b.setStartAfter(d),c=d.previousSibling;for(var f;c;)if(f=c,c=c.previousSibling,!c||"BR"==c.nodeName){c=f;break}if(c){for(var g="";c&&"BR"!=c.nodeName&&new RegExp("^[ "+domUtils.fillChar+"]*$").test(c.nodeValue);)g+=c.nodeValue,c=c.nextSibling;if("BR"!=c.nodeName){var h=c.nodeValue.match(new RegExp("^([ "+domUtils.fillChar+"]+)"));h&&h[1]&&(g+=h[1])}g=a.document.createTextNode(g),b.insertNode(g).setStartAfter(g)}b.collapse(!0).select()}return a.fireEvent("saveScene"),!0}}),a.addListener("tabkeydown",function(b,c){var d=a.selection.getRange(),e=domUtils.findParentByTagName(d.startContainer,"pre",!0);if(e){if(a.fireEvent("saveScene"),c.shiftKey);else if(d.collapsed){var f=a.document.createTextNode(" ");d.insertNode(f).setStartAfter(f).collapse(!0).select(!0)}else{for(var g=d.createBookmark(),h=g.start.previousSibling;h;){if(e.firstChild===h&&!domUtils.isBr(h)){e.insertBefore(a.document.createTextNode(" "),h);break}if(domUtils.isBr(h)){e.insertBefore(a.document.createTextNode(" "),h.nextSibling);break}h=h.previousSibling}var i=g.end;for(h=g.start.nextSibling,e.firstChild===g.start&&e.insertBefore(a.document.createTextNode(" "),h.nextSibling);h&&h!==i;){if(domUtils.isBr(h)&&h.nextSibling){if(h.nextSibling===i)break;e.insertBefore(a.document.createTextNode(" "),h.nextSibling)}h=h.nextSibling}d.moveToBookmark(g).select()}return a.fireEvent("saveScene"),!0}}),a.addListener("beforeinserthtml",function(a,b){var c=this,d=c.selection.getRange(),e=domUtils.findParentByTagName(d.startContainer,"pre",!0);if(e){d.collapsed||d.deleteContents();var f="";if(browser.ie&&browser.version>8){utils.each(UE.filterNode(UE.htmlparser(b),c.options.filterTxtRules).children,function(a){"element"==a.type?"br"==a.tagName?f+="\n":dtd.$empty[a.tagName]||(utils.each(a.children,function(b){"element"==b.type?"br"==b.tagName?f+="\n":dtd.$empty[a.tagName]||(f+=b.innerText()):f+=b.data}),/\n$/.test(f)||(f+="\n")):f+=a.data+"\n",!a.nextSibling()&&/\n$/.test(f)&&(f=f.replace(/\n$/,""))});var g=c.document.createTextNode(utils.html(f.replace(/ /g," ")));d.insertNode(g).selectNode(g).select()}else{var h=c.document.createDocumentFragment();utils.each(UE.filterNode(UE.htmlparser(b),c.options.filterTxtRules).children,function(a){"element"==a.type?"br"==a.tagName?h.appendChild(c.document.createElement("br")):dtd.$empty[a.tagName]||(utils.each(a.children,function(b){"element"==b.type?"br"==b.tagName?h.appendChild(c.document.createElement("br")):dtd.$empty[a.tagName]||h.appendChild(c.document.createTextNode(utils.html(b.innerText().replace(/ /g," ")))):h.appendChild(c.document.createTextNode(utils.html(b.data.replace(/ /g," "))))}),"BR"!=h.lastChild.nodeName&&h.appendChild(c.document.createElement("br"))):h.appendChild(c.document.createTextNode(utils.html(a.data.replace(/ /g," ")))),a.nextSibling()||"BR"!=h.lastChild.nodeName||h.removeChild(h.lastChild)}),d.insertNode(h).select()}return!0}}),a.addListener("keydown",function(a,b){var c=this,d=b.keyCode||b.which;if(40==d){var e,f=c.selection.getRange(),g=f.startContainer;if(f.collapsed&&(e=domUtils.findParentByTagName(f.startContainer,"pre",!0))&&!e.nextSibling){for(var h=e.lastChild;h&&"BR"==h.nodeName;)h=h.previousSibling;(h===g||f.startContainer===e&&f.startOffset==e.childNodes.length)&&(c.execCommand("insertparagraph"),domUtils.preventDefault(b))}}}),a.addListener("delkeydown",function(b,c){var d=this.selection.getRange();d.txtToElmBoundary(!0);var e=d.startContainer;if(domUtils.isTagNode(e,"pre")&&d.collapsed&&domUtils.isStartInblock(d)){var f=a.document.createElement("p");return domUtils.fillNode(a.document,f),e.parentNode.insertBefore(f,e),domUtils.remove(e),d.setStart(f,0).setCursor(!1,!0),domUtils.preventDefault(c),!0}})},UE.commands.cleardoc={execCommand:function(a){var b=this,c=b.options.enterTag,d=b.selection.getRange();"br"==c?(b.body.innerHTML="
    ",d.setStart(b.body,0).setCursor()):(b.body.innerHTML="

    "+(ie?"":"
    ")+"

    ",d.setStart(b.body.firstChild,0).setCursor(!1,!0)),setTimeout(function(){b.fireEvent("clearDoc")},0)}},UE.plugin.register("anchor",function(){return{bindEvents:{ready:function(){utils.cssRule("anchor",".anchorclass{background: url('"+this.options.themePath+this.options.theme+"/images/anchor.gif') no-repeat scroll left center transparent;cursor: auto;display: inline-block;height: 16px;width: 15px;}",this.document)}},outputRule:function(a){utils.each(a.getNodesByTagName("img"),function(a){var b;(b=a.getAttr("anchorname"))&&(a.tagName="a",a.setAttr({anchorname:"",name:b,"class":""}))})},inputRule:function(a){utils.each(a.getNodesByTagName("a"),function(a){var b;(b=a.getAttr("name"))&&!a.getAttr("href")&&(a.tagName="img",a.setAttr({anchorname:a.getAttr("name"),"class":"anchorclass"}),a.setAttr("name"))})},commands:{anchor:{execCommand:function(a,b){var c=this.selection.getRange(),d=c.getClosedNode();if(d&&d.getAttribute("anchorname"))b?d.setAttribute("anchorname",b):(c.setStartBefore(d).setCursor(),domUtils.remove(d));else if(b){var e=this.document.createElement("img");c.collapse(!0),domUtils.setAttributes(e,{anchorname:b,"class":"anchorclass"}),c.insertNode(e).setStartAfter(e).setCursor(!1,!0)}}}}}}),UE.plugins.wordcount=function(){var a=this;a.setOpt("wordCount",!0),a.addListener("contentchange",function(){a.fireEvent("wordcount")});var b;a.addListener("ready",function(){var a=this;domUtils.on(a.body,"keyup",function(c){var d=c.keyCode||c.which,e={16:1,18:1,20:1,37:1,38:1,39:1,40:1};d in e||(clearTimeout(b),b=setTimeout(function(){a.fireEvent("wordcount")},200))})})},UE.plugins.pagebreak=function(){function a(a){if(domUtils.isEmptyBlock(a)){for(var b,d=a.firstChild;d&&1==d.nodeType&&domUtils.isEmptyBlock(d);)b=d,d=d.firstChild;!b&&(b=a),domUtils.fillNode(c.document,b)}}function b(a){return a&&1==a.nodeType&&"HR"==a.tagName&&"pagebreak"==a.className}var c=this,d=["td"];c.setOpt("pageBreakTag","_ueditor_page_break_tag_"),c.ready(function(){utils.cssRule("pagebreak",".pagebreak{display:block;clear:both !important;cursor:default !important;width: 100% !important;margin:0;}",c.document)}),c.addInputRule(function(a){a.traversal(function(a){if("text"==a.type&&a.data==c.options.pageBreakTag){var b=UE.uNode.createElement('
    ');a.parentNode.insertBefore(b,a),a.parentNode.removeChild(a)}})}),c.addOutputRule(function(a){utils.each(a.getNodesByTagName("hr"),function(a){if("pagebreak"==a.getAttr("class")){var b=UE.uNode.createText(c.options.pageBreakTag);a.parentNode.insertBefore(b,a),a.parentNode.removeChild(a)}})}),c.commands.pagebreak={execCommand:function(){var e=c.selection.getRange(),f=c.document.createElement("hr");domUtils.setAttributes(f,{"class":"pagebreak",noshade:"noshade",size:"5"}),domUtils.unSelectable(f);var g,h=domUtils.findParentByTagName(e.startContainer,d,!0),i=[];if(h)switch(h.tagName){case"TD":if(g=h.parentNode,g.previousSibling)g.parentNode.insertBefore(f,g),i=domUtils.findParents(f);else{var j=domUtils.findParentByTagName(g,"table");j.parentNode.insertBefore(f,j),i=domUtils.findParents(f,!0)}g=i[1],f!==g&&domUtils.breakParent(f,g),c.fireEvent("afteradjusttable",c.document)}else{if(!e.collapsed){e.deleteContents();for(var k=e.startContainer;!domUtils.isBody(k)&&domUtils.isBlockElm(k)&&domUtils.isEmptyNode(k);)e.setStartBefore(k).collapse(!0),domUtils.remove(k),k=e.startContainer}e.insertNode(f);for(var l,g=f.parentNode;!domUtils.isBody(g);)domUtils.breakParent(f,g),l=f.nextSibling,l&&domUtils.isEmptyBlock(l)&&domUtils.remove(l),g=f.parentNode;l=f.nextSibling;var m=f.previousSibling;if(b(m)?domUtils.remove(m):m&&a(m),l)b(l)?domUtils.remove(l):a(l),e.setEndAfter(f).collapse(!1);else{var n=c.document.createElement("p");f.parentNode.appendChild(n),domUtils.fillNode(c.document,n),e.setStart(n,0).collapse(!0)}e.select(!0)}}}},UE.plugin.register("wordimage",function(){var a=this,b=[];return{commands:{wordimage:{execCommand:function(){for(var b,c=domUtils.getElementsByTagName(a.body,"img"),d=[],e=0;b=c[e++];){var f=b.getAttribute("word_img");f&&d.push(f)}return d},queryCommandState:function(){b=domUtils.getElementsByTagName(a.body,"img");for(var c,d=0;c=b[d++];)if(c.getAttribute("word_img"))return 1;return-1},notNeedUndo:!0}},inputRule:function(b){utils.each(b.getNodesByTagName("img"),function(b){var c=b.attrs,d=parseInt(c.width)<128||parseInt(c.height)<43,e=a.options,f=e.UEDITOR_HOME_URL+"themes/default/images/spacer.gif";c.src&&/^(?:(file:\/+))/.test(c.src)&&b.setAttr({width:c.width,height:c.height,alt:c.alt,word_img:c.src,src:f,style:"background:url("+(d?e.themePath+e.theme+"/images/word.gif":e.langPath+e.lang+"/images/localimage.png")+") no-repeat center center;border:1px solid #ddd"})})}}}),UE.plugins.dragdrop=function(){var a=this;a.ready(function(){domUtils.on(this.body,"dragend",function(){var b=a.selection.getRange(),c=b.getClosedNode()||a.selection.getStart();if(c&&"IMG"==c.tagName){for(var d,e=c.previousSibling;(d=c.nextSibling)&&1==d.nodeType&&"SPAN"==d.tagName&&!d.firstChild;)domUtils.remove(d);(!e||1!=e.nodeType||domUtils.isEmptyBlock(e))&&e||d&&(!d||domUtils.isEmptyBlock(d))||(e&&"P"==e.tagName&&!domUtils.isEmptyBlock(e)?(e.appendChild(c),domUtils.moveChild(d,e),domUtils.remove(d)):d&&"P"==d.tagName&&!domUtils.isEmptyBlock(d)&&d.insertBefore(c,d.firstChild),e&&"P"==e.tagName&&domUtils.isEmptyBlock(e)&&domUtils.remove(e),d&&"P"==d.tagName&&domUtils.isEmptyBlock(d)&&domUtils.remove(d),b.selectNode(c).select(),a.fireEvent("saveScene"))}})}),a.addListener("keyup",function(b,c){var d=c.keyCode||c.which;if(13==d){var e,f=a.selection.getRange();(e=domUtils.findParentByTagName(f.startContainer,"p",!0))&&"center"==domUtils.getComputedStyle(e,"text-align")&&domUtils.removeStyle(e,"text-align")}})},UE.plugins.undo=function(){function a(a,b){if(a.length!=b.length)return 0;for(var c=0,d=a.length;cf&&this.list.shift(),this.index=this.list.length-1,this.clearKey(),this.update())},this.update=function(){this.hasRedo=!!this.list[this.index+1],this.hasUndo=!!this.list[this.index-1]},this.reset=function(){this.list=[],this.index=0,this.hasUndo=!1,this.hasRedo=!1,this.clearKey()},this.clearKey=function(){m=0,k=null}}var d,e=this,f=e.options.maxUndoCount||20,g=e.options.maxInputCount||20,h=new RegExp(domUtils.fillChar+"|","gi"),i={ol:1,ul:1,table:1,tbody:1,tr:1,body:1},j=e.options.autoClearEmptyNode;e.undoManger=new c,e.undoManger.editor=e,e.addListener("saveScene",function(){var a=Array.prototype.splice.call(arguments,1);this.undoManger.save.apply(this.undoManger,a)}),e.addListener("reset",function(a,b){b||this.undoManger.reset()}),e.commands.redo=e.commands.undo={execCommand:function(a){this.undoManger[a]()},queryCommandState:function(a){return this.undoManger["has"+("undo"==a.toLowerCase()?"Undo":"Redo")]?0:-1},notNeedUndo:1};var k,l={16:1,17:1,18:1,37:1,38:1,39:1,40:1},m=0,n=!1;e.addListener("ready",function(){domUtils.on(this.body,"compositionstart",function(){n=!0}),domUtils.on(this.body,"compositionend",function(){n=!1})}),e.addshortcutkey({Undo:"ctrl+90",Redo:"ctrl+89"});var o=!0;e.addListener("keydown",function(a,b){function c(a){a.undoManger.save(!1,!0),a.fireEvent("selectionchange")}var e=this,f=b.keyCode||b.which;if(!(l[f]||b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)){if(n)return;if(!e.selection.getRange().collapsed)return e.undoManger.save(!1,!0),void(o=!1);0==e.undoManger.list.length&&e.undoManger.save(!0),clearTimeout(d),d=setTimeout(function(){if(n)var a=setInterval(function(){n||(c(e),clearInterval(a))},300);else c(e)},200),k=f,m++,m>=g&&c(e)}}),e.addListener("keyup",function(a,b){var c=b.keyCode||b.which;if(!(l[c]||b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)){if(n)return;o||(this.undoManger.save(!1,!0),o=!0)}}),e.stopCmdUndo=function(){e.__hasEnterExecCommand=!0},e.startCmdUndo=function(){e.__hasEnterExecCommand=!1}},UE.plugin.register("copy",function(){function a(){ZeroClipboard.config({debug:!1,swfPath:b.options.UEDITOR_HOME_URL+"third-party/zeroclipboard/ZeroClipboard.swf"});var a=b.zeroclipboard=new ZeroClipboard;a.on("copy",function(a){var c=a.client,d=b.selection.getRange(),e=document.createElement("div");e.appendChild(d.cloneContents()),c.setText(e.innerText||e.textContent),c.setHtml(e.innerHTML),d.select()}),a.on("mouseover mouseout",function(a){var b=a.target;"mouseover"==a.type?domUtils.addClass(b,"edui-state-hover"):"mouseout"==a.type&&domUtils.removeClasses(b,"edui-state-hover")}),a.on("wrongflash noflash",function(){ZeroClipboard.destroy()})}var b=this;return{bindEvents:{ready:function(){browser.ie||(window.ZeroClipboard?a():utils.loadFile(document,{src:b.options.UEDITOR_HOME_URL+"third-party/zeroclipboard/ZeroClipboard.js",tag:"script",type:"text/javascript",defer:"defer"},function(){a()}))}},commands:{copy:{execCommand:function(a){b.document.execCommand("copy")||alert(b.getLang("copymsg"))}}}}}),UE.plugins.paste=function(){function a(a){var b=this.document;if(!b.getElementById("baidu_pastebin")){var c=this.selection.getRange(),d=c.createBookmark(),e=b.createElement("div");e.id="baidu_pastebin",browser.webkit&&e.appendChild(b.createTextNode(domUtils.fillChar+domUtils.fillChar)),b.body.appendChild(e),d.start.style.display="",e.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:"+domUtils.getXY(d.start).y+"px",c.selectNodeContents(e).select(!0),setTimeout(function(){if(browser.webkit)for(var f,g=0,h=b.querySelectorAll("#baidu_pastebin");f=h[g++];){if(!domUtils.isEmptyNode(f)){e=f;break}domUtils.remove(f)}try{e.parentNode.removeChild(e)}catch(i){}c.moveToBookmark(d).select(!0),a(e)},0)}}function b(a){return a.replace(/<(\/?)([\w\-]+)([^>]*)>/gi,function(a,b,c,d){return c=c.toLowerCase(),{img:1}[c]?a:(d=d.replace(/([\w\-]*?)\s*=\s*(("([^"]*)")|('([^']*)')|([^\s>]+))/gi,function(a,b,c){return{src:1,href:1,name:1}[b.toLowerCase()]?b+"="+c+" ":""}),{span:1,div:1}[c]?"":"<"+b+c+" "+utils.trim(d)+">")})}function c(a){var c;if(a.firstChild){for(var h,i=domUtils.getElementsByTagName(a,"span"),j=0;h=i[j++];)"_baidu_cut_start"!=h.id&&"_baidu_cut_end"!=h.id||domUtils.remove(h);if(browser.webkit){for(var k,l=a.querySelectorAll("div br"),j=0;k=l[j++];){var m=k.parentNode;"DIV"==m.tagName&&1==m.childNodes.length&&(m.innerHTML="


    ",domUtils.remove(m))}for(var n,o=a.querySelectorAll("#baidu_pastebin"),j=0;n=o[j++];){var p=d.document.createElement("p");for(n.parentNode.insertBefore(p,n);n.firstChild;)p.appendChild(n.firstChild);domUtils.remove(n)}for(var q,r=a.querySelectorAll("meta"),j=0;q=r[j++];)domUtils.remove(q);var l=a.querySelectorAll("br");for(j=0;q=l[j++];)/^apple-/i.test(q.className)&&domUtils.remove(q)}if(browser.gecko){var s=a.querySelectorAll("[_moz_dirty]");for(j=0;q=s[j++];)q.removeAttribute("_moz_dirty")}if(!browser.ie)for(var q,t=a.querySelectorAll("span.Apple-style-span"),j=0;q=t[j++];)domUtils.remove(q,!0);c=a.innerHTML,c=UE.filterWord(c);var u=UE.htmlparser(c);if(d.options.filterRules&&UE.filterNode(u,d.options.filterRules),d.filterInputRule(u),browser.webkit){var v=u.lastChild();v&&"element"==v.type&&"br"==v.tagName&&u.removeChild(v),utils.each(d.body.querySelectorAll("div"),function(a){domUtils.isEmptyBlock(a)&&domUtils.remove(a,!0)})}if(c={html:u.toHtml()},d.fireEvent("beforepaste",c,u),!c.html)return;u=UE.htmlparser(c.html,!0),1===d.queryCommandState("pasteplain")?d.execCommand("insertHtml",UE.filterNode(u,d.options.filterTxtRules).toHtml(),!0):(UE.filterNode(u,d.options.filterTxtRules),e=u.toHtml(),f=c.html,g=d.selection.getRange().createAddress(!0),d.execCommand("insertHtml",d.getOpt("retainOnlyLabelPasted")===!0?b(f):f,!0)),d.fireEvent("afterpaste",c)}}var d=this;d.setOpt({retainOnlyLabelPasted:!1});var e,f,g;d.addListener("pasteTransfer",function(a,c){if(g&&e&&f&&e!=f){var h=d.selection.getRange();if(h.moveToAddress(g,!0),!h.collapsed){for(;!domUtils.isBody(h.startContainer);){var i=h.startContainer;if(1==i.nodeType){if(i=i.childNodes[h.startOffset],!i){h.setStartBefore(h.startContainer);continue}var j=i.previousSibling;j&&3==j.nodeType&&new RegExp("^[\n\r\t "+domUtils.fillChar+"]*$").test(j.nodeValue)&&h.setStartBefore(j)}if(0!=h.startOffset)break;h.setStartBefore(h.startContainer)}for(;!domUtils.isBody(h.endContainer);){var k=h.endContainer;if(1==k.nodeType){if(k=k.childNodes[h.endOffset],!k){h.setEndAfter(h.endContainer);continue}var l=k.nextSibling;l&&3==l.nodeType&&new RegExp("^[\n\r\t"+domUtils.fillChar+"]*$").test(l.nodeValue)&&h.setEndAfter(l)}if(h.endOffset!=h.endContainer[3==h.endContainer.nodeType?"nodeValue":"childNodes"].length)break;h.setEndAfter(h.endContainer)}}h.deleteContents(),h.select(!0),d.__hasEnterExecCommand=!0;var m=f;2===c?m=b(m):c&&(m=e),d.execCommand("inserthtml",m,!0),d.__hasEnterExecCommand=!1;for(var n=d.selection.getRange();!domUtils.isBody(n.startContainer)&&!n.startOffset&&n.startContainer[3==n.startContainer.nodeType?"nodeValue":"childNodes"].length;)n.setStartBefore(n.startContainer);var o=n.createAddress(!0);g.endAddress=o.startAddress}}),d.addListener("ready",function(){domUtils.on(d.body,"cut",function(){var a=d.selection.getRange();!a.collapsed&&d.undoManger&&d.undoManger.save()}),domUtils.on(d.body,browser.ie||browser.opera?"keydown":"paste",function(b){(!browser.ie&&!browser.opera||(b.ctrlKey||b.metaKey)&&"86"==b.keyCode)&&a.call(d,function(a){c(a)})})}),d.commands.paste={execCommand:function(b){browser.ie?(a.call(d,function(a){c(a)}),d.document.execCommand("paste")):alert(d.getLang("pastemsg"))}}},UE.plugins.pasteplain=function(){var a=this;a.setOpt({pasteplain:!1,filterTxtRules:function(){function a(a){a.tagName="p",a.setStyle()}function b(a){a.parentNode.removeChild(a,!0)}return{"-":"script style object iframe embed input select",p:{$:{}},br:{$:{}},div:function(a){for(var b,c=UE.uNode.createElement("p");b=a.firstChild();)"text"!=b.type&&UE.dom.dtd.$block[b.tagName]?c.firstChild()?(a.parentNode.insertBefore(c,a),c=UE.uNode.createElement("p")):a.parentNode.insertBefore(b,a):c.appendChild(b);c.firstChild()&&a.parentNode.insertBefore(c,a),a.parentNode.removeChild(a)},ol:b,ul:b,dl:b,dt:b,dd:b,li:b,caption:a,th:a,tr:a,h1:a,h2:a,h3:a,h4:a,h5:a,h6:a,td:function(a){var b=!!a.innerText();b&&a.parentNode.insertAfter(UE.uNode.createText("    "),a),a.parentNode.removeChild(a,a.innerText())}}}()});var b=a.options.pasteplain;a.commands.pasteplain={queryCommandState:function(){return b?1:0},execCommand:function(){b=0|!b},notNeedUndo:1}},UE.plugins.list=function(){function a(a){var b=[];for(var c in a)b.push(c);return b}function b(a){var b=a.className;return domUtils.hasClass(a,/custom_/)?b.match(/custom_(\w+)/)[1]:domUtils.getStyle(a,"list-style-type")}function c(a,c){utils.each(domUtils.getElementsByTagName(a,"ol ul"),function(f){if(domUtils.inDoc(f,a)){var g=f.parentNode;if(g.tagName==f.tagName){var h=b(f)||("OL"==f.tagName?"decimal":"disc"),i=b(g)||("OL"==g.tagName?"decimal":"disc");if(h==i){var l=utils.indexOf(k[f.tagName],h);l=l+1==k[f.tagName].length?0:l+1,e(f,k[f.tagName][l])}}var m=0,n=2;domUtils.hasClass(f,/custom_/)?/[ou]l/i.test(g.tagName)&&domUtils.hasClass(g,/custom_/)||(n=1):/[ou]l/i.test(g.tagName)&&domUtils.hasClass(g,/custom_/)&&(n=3);var o=domUtils.getStyle(f,"list-style-type");o&&(f.style.cssText="list-style-type:"+o),f.className=utils.trim(f.className.replace(/list-paddingleft-\w+/,""))+" list-paddingleft-"+n,utils.each(domUtils.getElementsByTagName(f,"li"),function(a){if(a.style.cssText&&(a.style.cssText=""),!a.firstChild)return void domUtils.remove(a);if(a.parentNode===f){if(m++,domUtils.hasClass(f,/custom_/)){var c=1,d=b(f);if("OL"==f.tagName){if(d)switch(d){case"cn":case"cn1":case"cn2":m>10&&(m%10==0||m>10&&m<20)?c=2:m>20&&(c=3);break;case"num2":m>9&&(c=2)}a.className="list-"+j[d]+m+" list-"+d+"-paddingleft-"+c}else a.className="list-"+j[d]+" list-"+d+"-paddingleft"}else a.className=a.className.replace(/list-[\w\-]+/gi,"");var e=a.getAttribute("class");null===e||e.replace(/\s/g,"")||domUtils.removeAttributes(a,"class")}}),!c&&d(f,f.tagName.toLowerCase(),b(f)||domUtils.getStyle(f,"list-style-type"),!0)}})}function d(a,d,e,f){var g=a.nextSibling;g&&1==g.nodeType&&g.tagName.toLowerCase()==d&&(b(g)||domUtils.getStyle(g,"list-style-type")||("ol"==d?"decimal":"disc"))==e&&(domUtils.moveChild(g,a),0==g.childNodes.length&&domUtils.remove(g)),g&&domUtils.isFillChar(g)&&domUtils.remove(g);var h=a.previousSibling;h&&1==h.nodeType&&h.tagName.toLowerCase()==d&&(b(h)||domUtils.getStyle(h,"list-style-type")||("ol"==d?"decimal":"disc"))==e&&domUtils.moveChild(a,h),h&&domUtils.isFillChar(h)&&domUtils.remove(h),!f&&domUtils.isEmptyBlock(a)&&domUtils.remove(a),b(a)&&c(a.ownerDocument,!0)}function e(a,b){j[b]&&(a.className="custom_"+b);try{domUtils.setStyle(a,"list-style-type",b)}catch(c){}}function f(a){var b=a.previousSibling;b&&domUtils.isEmptyBlock(b)&&domUtils.remove(b),b=a.nextSibling,b&&domUtils.isEmptyBlock(b)&&domUtils.remove(b)}function g(a){for(;a&&!domUtils.isBody(a);){if("TABLE"==a.nodeName)return null;if("LI"==a.nodeName)return a;a=a.parentNode}}var h=this,i={TD:1,PRE:1,BLOCKQUOTE:1},j={cn:"cn-1-",cn1:"cn-2-",cn2:"cn-3-",num:"num-1-",num1:"num-2-",num2:"num-3-",dash:"dash",dot:"dot"};h.setOpt({autoTransWordToList:!1,insertorderedlist:{num:"",num1:"",num2:"",cn:"",cn1:"",cn2:"",decimal:"","lower-alpha":"","lower-roman":"","upper-alpha":"","upper-roman":""},insertunorderedlist:{circle:"",disc:"",square:"",dash:"",dot:""},listDefaultPaddingLeft:"30",listiconpath:"http://bs.baidu.com/listicon/",maxListLevel:-1,disablePInList:!1});var k={OL:a(h.options.insertorderedlist),UL:a(h.options.insertunorderedlist)},l=h.options.listiconpath;for(var m in j)h.options.insertorderedlist.hasOwnProperty(m)||h.options.insertunorderedlist.hasOwnProperty(m)||delete j[m];h.ready(function(){var a=[];for(var b in j){if("dash"==b||"dot"==b)a.push("li.list-"+j[b]+"{background-image:url("+l+j[b]+".gif)}"),a.push("ul.custom_"+b+"{list-style:none;}ul.custom_"+b+" li{background-position:0 3px;background-repeat:no-repeat}");else{for(var c=0;c<99;c++)a.push("li.list-"+j[b]+c+"{background-image:url("+l+"list-"+j[b]+c+".gif)}");a.push("ol.custom_"+b+"{list-style:none;}ol.custom_"+b+" li{background-position:0 3px;background-repeat:no-repeat}")}switch(b){case"cn":a.push("li.list-"+b+"-paddingleft-1{padding-left:25px}"),a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}"),a.push("li.list-"+b+"-paddingleft-3{padding-left:55px}");break;case"cn1":a.push("li.list-"+b+"-paddingleft-1{padding-left:30px}"),a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}"),a.push("li.list-"+b+"-paddingleft-3{padding-left:55px}");break;case"cn2":a.push("li.list-"+b+"-paddingleft-1{padding-left:40px}"),a.push("li.list-"+b+"-paddingleft-2{padding-left:55px}"),a.push("li.list-"+b+"-paddingleft-3{padding-left:68px}");break;case"num":case"num1":a.push("li.list-"+b+"-paddingleft-1{padding-left:25px}");break;case"num2":a.push("li.list-"+b+"-paddingleft-1{padding-left:35px}"),a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}");break;case"dash":a.push("li.list-"+b+"-paddingleft{padding-left:35px}");break;case"dot":a.push("li.list-"+b+"-paddingleft{padding-left:20px}")}}a.push(".list-paddingleft-1{padding-left:0}"),a.push(".list-paddingleft-2{padding-left:"+h.options.listDefaultPaddingLeft+"px}"),a.push(".list-paddingleft-3{padding-left:"+2*h.options.listDefaultPaddingLeft+"px}"),utils.cssRule("list","ol,ul{margin:0;pading:0;"+(browser.ie?"":"width:95%")+"}li{clear:both;}"+a.join("\n"),h.document)}),h.ready(function(){domUtils.on(h.body,"cut",function(){setTimeout(function(){var a,b=h.selection.getRange();if(!b.collapsed&&(a=domUtils.findParentByTagName(b.startContainer,"li",!0))&&!a.nextSibling&&domUtils.isEmptyBlock(a)){var c,d=a.parentNode;if(c=d.previousSibling)domUtils.remove(d),b.setStartAtLast(c).collapse(!0),b.select(!0);else if(c=d.nextSibling)domUtils.remove(d),b.setStartAtFirst(c).collapse(!0),b.select(!0);else{var e=h.document.createElement("p");domUtils.fillNode(h.document,e),d.parentNode.insertBefore(e,d),domUtils.remove(d),b.setStart(e,0).collapse(!0),b.select(!0)}}})})}),h.addListener("beforepaste",function(a,c){var d,e=this,f=e.selection.getRange(),g=UE.htmlparser(c.html,!0);if(d=domUtils.findParentByTagName(f.startContainer,"li",!0)){var h=d.parentNode,i="OL"==h.tagName?"ul":"ol";utils.each(g.getNodesByTagName(i),function(c){if(c.tagName=h.tagName,c.setAttr(),c.parentNode===g)a=b(h)||("OL"==h.tagName?"decimal":"disc");else{var d=c.parentNode.getAttr("class");a=d&&/custom_/.test(d)?d.match(/custom_(\w+)/)[1]:c.parentNode.getStyle("list-style-type"),a||(a="OL"==h.tagName?"decimal":"disc")}var e=utils.indexOf(k[h.tagName],a);c.parentNode!==g&&(e=e+1==k[h.tagName].length?0:e+1);var f=k[h.tagName][e];j[f]?c.setAttr("class","custom_"+f):c.setStyle("list-style-type",f)})}c.html=g.toHtml()}),h.getOpt("disablePInList")===!0&&h.addOutputRule(function(a){utils.each(a.getNodesByTagName("li"),function(a){var b=[],c=0;utils.each(a.children,function(d){if("p"==d.tagName){for(var e;e=d.children.pop();)b.splice(c,0,e),e.parentNode=a,lastNode=e;if(e=b[b.length-1],!e||"element"!=e.type||"br"!=e.tagName){var f=UE.uNode.createElement("br");f.parentNode=a,b.push(f)}c=b.length}}),b.length&&(a.children=b)})}),h.addInputRule(function(a){function b(a,b){var e=b.firstChild();if(e&&"element"==e.type&&"span"==e.tagName&&/Wingdings|Symbol/.test(e.getStyle("font-family"))){for(var f in d)if(d[f]==e.data)return f;return"disc"}for(var f in c)if(c[f].test(a))return f}if(utils.each(a.getNodesByTagName("li"),function(a){for(var b,c=UE.uNode.createElement("p"),d=0;b=a.children[d];)"text"==b.type||dtd.p[b.tagName]?c.appendChild(b):c.firstChild()?(a.insertBefore(c,b),c=UE.uNode.createElement("p"),d+=2):d++;(c.firstChild()&&!c.parentNode||!a.firstChild())&&a.appendChild(c),c.firstChild()||c.innerHTML(browser.ie?" ":"
    ");var e=a.firstChild(),f=e.lastChild();f&&"text"==f.type&&/^\s*$/.test(f.data)&&e.removeChild(f)}),h.options.autoTransWordToList){var c={num1:/^\d+\)/,decimal:/^\d+\./,"lower-alpha":/^[a-z]+\)/,"upper-alpha":/^[A-Z]+\./,cn:/^[\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+[\u3001]/,cn2:/^\([\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+\)/},d={square:"n"};utils.each(a.getNodesByTagName("p"),function(a){function d(a,b,d){if("ol"==a.tagName)if(browser.ie){var e=b.firstChild();"element"==e.type&&"span"==e.tagName&&c[d].test(e.innerText())&&b.removeChild(e)}else b.innerHTML(b.innerHTML().replace(c[d],""));else b.removeChild(b.firstChild());var f=UE.uNode.createElement("li");f.appendChild(b),a.appendChild(f)}if("MsoListParagraph"==a.getAttr("class")){a.setStyle("margin",""),a.setStyle("margin-left",""),a.setAttr("class","");var e,f=a,g=a;if("li"!=a.parentNode.tagName&&(e=b(a.innerText(),a))){var i=UE.uNode.createElement(h.options.insertorderedlist.hasOwnProperty(e)?"ol":"ul");for(j[e]?i.setAttr("class","custom_"+e):i.setStyle("list-style-type",e);a&&"li"!=a.parentNode.tagName&&b(a.innerText(),a);)f=a.nextSibling(),f||a.parentNode.insertBefore(i,a),d(i,a,e),a=f;!i.parentNode&&a&&a.parentNode&&a.parentNode.insertBefore(i,a)}var k=g.firstChild();k&&"element"==k.type&&"span"==k.tagName&&/^\s*( )+\s*$/.test(k.innerText())&&k.parentNode.removeChild(k)}})}}),h.addListener("contentchange",function(){c(h.document)}),h.addListener("keydown",function(a,b){function c(){b.preventDefault?b.preventDefault():b.returnValue=!1,h.fireEvent("contentchange"),h.undoManger&&h.undoManger.save()}function d(a,b){for(;a&&!domUtils.isBody(a);){if(b(a))return null;if(1==a.nodeType&&/[ou]l/i.test(a.tagName))return a;a=a.parentNode}return null}var e=b.keyCode||b.which;if(13==e&&!b.shiftKey){var g=h.selection.getRange(),i=domUtils.findParent(g.startContainer,function(a){return domUtils.isBlockElm(a)},!0),j=domUtils.findParentByTagName(g.startContainer,"li",!0);if(i&&"PRE"!=i.tagName&&!j){var k=i.innerHTML.replace(new RegExp(domUtils.fillChar,"g"),"");/^\s*1\s*\.[^\d]/.test(k)&&(i.innerHTML=k.replace(/^\s*1\s*\./,""),g.setStartAtLast(i).collapse(!0).select(),h.__hasEnterExecCommand=!0,h.execCommand("insertorderedlist"),h.__hasEnterExecCommand=!1)}var l=h.selection.getRange(),m=d(l.startContainer,function(a){return"TABLE"==a.tagName}),n=l.collapsed?m:d(l.endContainer,function(a){return"TABLE"==a.tagName});if(m&&n&&m===n){if(!l.collapsed){if(m=domUtils.findParentByTagName(l.startContainer,"li",!0),n=domUtils.findParentByTagName(l.endContainer,"li",!0),!m||!n||m!==n){var o=l.cloneRange(),p=o.collapse(!1).createBookmark();l.deleteContents(),o.moveToBookmark(p);var j=domUtils.findParentByTagName(o.startContainer,"li",!0);return f(j),o.select(),void c()}if(l.deleteContents(),j=domUtils.findParentByTagName(l.startContainer,"li",!0),j&&domUtils.isEmptyBlock(j))return v=j.previousSibling,next=j.nextSibling,s=h.document.createElement("p"),domUtils.fillNode(h.document,s),q=j.parentNode,v&&next?(l.setStart(next,0).collapse(!0).select(!0),domUtils.remove(j)):((v||next)&&v?j.parentNode.parentNode.insertBefore(s,q.nextSibling):q.parentNode.insertBefore(s,q),domUtils.remove(j),q.firstChild||domUtils.remove(q), +l.setStart(s,0).setCursor()),void c()}if(j=domUtils.findParentByTagName(l.startContainer,"li",!0)){if(domUtils.isEmptyBlock(j)){p=l.createBookmark();var q=j.parentNode;if(j!==q.lastChild?(domUtils.breakParent(j,q),f(j)):(q.parentNode.insertBefore(j,q.nextSibling),domUtils.isEmptyNode(q)&&domUtils.remove(q)),!dtd.$list[j.parentNode.tagName])if(domUtils.isBlockElm(j.firstChild))domUtils.remove(j,!0);else{for(s=h.document.createElement("p"),j.parentNode.insertBefore(s,j);j.firstChild;)s.appendChild(j.firstChild);domUtils.remove(j)}l.moveToBookmark(p).select()}else{var r=j.firstChild;if(!r||!domUtils.isBlockElm(r)){var s=h.document.createElement("p");for(!j.firstChild&&domUtils.fillNode(h.document,s);j.firstChild;)s.appendChild(j.firstChild);j.appendChild(s),r=s}var t=h.document.createElement("span");l.insertNode(t),domUtils.breakParent(t,j);var u=t.nextSibling;r=u.firstChild,r||(s=h.document.createElement("p"),domUtils.fillNode(h.document,s),u.appendChild(s),r=s),domUtils.isEmptyNode(r)&&(r.innerHTML="",domUtils.fillNode(h.document,r)),l.setStart(r,0).collapse(!0).shrinkBoundary().select(),domUtils.remove(t);var v=u.previousSibling;v&&domUtils.isEmptyBlock(v)&&(v.innerHTML="

    ",domUtils.fillNode(h.document,v.firstChild))}c()}}}if(8==e&&(l=h.selection.getRange(),l.collapsed&&domUtils.isStartInblock(l)&&(o=l.cloneRange().trimBoundary(),j=domUtils.findParentByTagName(l.startContainer,"li",!0),j&&domUtils.isStartInblock(o)))){if(m=domUtils.findParentByTagName(l.startContainer,"p",!0),m&&m!==j.firstChild){var q=domUtils.findParentByTagName(m,["ol","ul"]);return domUtils.breakParent(m,q),f(m),h.fireEvent("contentchange"),l.setStart(m,0).setCursor(!1,!0),h.fireEvent("saveScene"),void domUtils.preventDefault(b)}if(j&&(v=j.previousSibling)){if(46==e&&j.childNodes.length)return;if(dtd.$list[v.tagName]&&(v=v.lastChild),h.undoManger&&h.undoManger.save(),r=j.firstChild,domUtils.isBlockElm(r))if(domUtils.isEmptyNode(r))for(v.appendChild(r),l.setStart(r,0).setCursor(!1,!0);j.firstChild;)v.appendChild(j.firstChild);else t=h.document.createElement("span"),l.insertNode(t),domUtils.isEmptyBlock(v)&&(v.innerHTML=""),domUtils.moveChild(j,v),l.setStartBefore(t).collapse(!0).select(!0),domUtils.remove(t);else if(domUtils.isEmptyNode(j)){var s=h.document.createElement("p");v.appendChild(s),l.setStart(s,0).setCursor()}else for(l.setEnd(v,v.childNodes.length).collapse().select(!0);j.firstChild;)v.appendChild(j.firstChild);return domUtils.remove(j),h.fireEvent("contentchange"),h.fireEvent("saveScene"),void domUtils.preventDefault(b)}if(j&&!j.previousSibling){var q=j.parentNode,p=l.createBookmark();if(domUtils.isTagNode(q.parentNode,"ol ul"))q.parentNode.insertBefore(j,q),domUtils.isEmptyNode(q)&&domUtils.remove(q);else{for(;j.firstChild;)q.parentNode.insertBefore(j.firstChild,q);domUtils.remove(j),domUtils.isEmptyNode(q)&&domUtils.remove(q)}return l.moveToBookmark(p).setCursor(!1,!0),h.fireEvent("contentchange"),h.fireEvent("saveScene"),void domUtils.preventDefault(b)}}}),h.addListener("keyup",function(a,c){var e=c.keyCode||c.which;if(8==e){var f,g=h.selection.getRange();(f=domUtils.findParentByTagName(g.startContainer,["ol","ul"],!0))&&d(f,f.tagName.toLowerCase(),b(f)||domUtils.getComputedStyle(f,"list-style-type"),!0)}}),h.addListener("tabkeydown",function(){function a(a){if(h.options.maxListLevel!=-1){for(var b=a.parentNode,c=0;/[ou]l/i.test(b.tagName);)c++,b=b.parentNode;if(c>=h.options.maxListLevel)return!0}}var c=h.selection.getRange(),f=domUtils.findParentByTagName(c.startContainer,"li",!0);if(f){var g;if(!c.collapsed){h.fireEvent("saveScene"),g=c.createBookmark();for(var i,j,l=0,m=domUtils.findParents(f);j=m[l++];)if(domUtils.isTagNode(j,"ol ul")){i=j;break}var n=f;if(g.end)for(;n&&!(domUtils.getPosition(n,g.end)&domUtils.POSITION_FOLLOWING);)if(a(n))n=domUtils.getNextDomNode(n,!1,null,function(a){return a!==i});else{var o=n.parentNode,p=h.document.createElement(o.tagName),q=utils.indexOf(k[p.tagName],b(o)||domUtils.getComputedStyle(o,"list-style-type")),r=q+1==k[p.tagName].length?0:q+1,s=k[p.tagName][r];for(e(p,s),o.insertBefore(p,n);n&&!(domUtils.getPosition(n,g.end)&domUtils.POSITION_FOLLOWING);){if(f=n.nextSibling,p.appendChild(n),!f||domUtils.isTagNode(f,"ol ul")){if(f)for(;(f=f.firstChild)&&"LI"!=f.tagName;);else f=domUtils.getNextDomNode(n,!1,null,function(a){return a!==i});break}n=f}d(p,p.tagName.toLowerCase(),s),n=f}return h.fireEvent("contentchange"),c.moveToBookmark(g).select(),!0}if(a(f))return!0;var o=f.parentNode,p=h.document.createElement(o.tagName),q=utils.indexOf(k[p.tagName],b(o)||domUtils.getComputedStyle(o,"list-style-type"));q=q+1==k[p.tagName].length?0:q+1;var s=k[p.tagName][q];if(e(p,s),domUtils.isStartInblock(c))return h.fireEvent("saveScene"),g=c.createBookmark(),o.insertBefore(p,f),p.appendChild(f),d(p,p.tagName.toLowerCase(),s),h.fireEvent("contentchange"),c.moveToBookmark(g).select(!0),!0}}),h.commands.insertorderedlist=h.commands.insertunorderedlist={execCommand:function(a,c){c||(c="insertorderedlist"==a.toLowerCase()?"decimal":"disc");var f=this,h=this.selection.getRange(),j=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase():!domUtils.isWhitespace(a)},k="insertorderedlist"==a.toLowerCase()?"ol":"ul",l=f.document.createDocumentFragment();h.adjustmentBoundary().shrinkBoundary();var m,n,o,p,q=h.createBookmark(!0),r=g(f.document.getElementById(q.start)),s=0,t=g(f.document.getElementById(q.end)),u=0;if(r||t){if(r&&(m=r.parentNode),q.end||(t=r),t&&(n=t.parentNode),m===n){for(;r!==t;){if(p=r,r=r.nextSibling,!domUtils.isBlockElm(p.firstChild)){for(var v=f.document.createElement("p");p.firstChild;)v.appendChild(p.firstChild);p.appendChild(v)}l.appendChild(p)}if(p=f.document.createElement("span"),m.insertBefore(p,t),!domUtils.isBlockElm(t.firstChild)){for(v=f.document.createElement("p");t.firstChild;)v.appendChild(t.firstChild);t.appendChild(v)}l.appendChild(t),domUtils.breakParent(p,m),domUtils.isEmptyNode(p.previousSibling)&&domUtils.remove(p.previousSibling),domUtils.isEmptyNode(p.nextSibling)&&domUtils.remove(p.nextSibling);var w=b(m)||domUtils.getComputedStyle(m,"list-style-type")||("insertorderedlist"==a.toLowerCase()?"decimal":"disc");if(m.tagName.toLowerCase()==k&&w==c){for(var x,y=0,z=f.document.createDocumentFragment();x=l.firstChild;)if(domUtils.isTagNode(x,"ol ul"))z.appendChild(x);else for(;x.firstChild;)z.appendChild(x.firstChild),domUtils.remove(x);p.parentNode.insertBefore(z,p)}else o=f.document.createElement(k),e(o,c),o.appendChild(l),p.parentNode.insertBefore(o,p);return domUtils.remove(p),o&&d(o,k,c),void h.moveToBookmark(q).select()}if(r){for(;r;){if(p=r.nextSibling,domUtils.isTagNode(r,"ol ul"))l.appendChild(r);else{for(var A=f.document.createDocumentFragment(),B=0;r.firstChild;)domUtils.isBlockElm(r.firstChild)&&(B=1),A.appendChild(r.firstChild);if(B)l.appendChild(A);else{var C=f.document.createElement("p");C.appendChild(A),l.appendChild(C)}domUtils.remove(r)}r=p}m.parentNode.insertBefore(l,m.nextSibling),domUtils.isEmptyNode(m)?(h.setStartBefore(m),domUtils.remove(m)):h.setStartAfter(m),s=1}if(t&&domUtils.inDoc(n,f.document)){for(r=n.firstChild;r&&r!==t;){if(p=r.nextSibling,domUtils.isTagNode(r,"ol ul"))l.appendChild(r);else{for(A=f.document.createDocumentFragment(),B=0;r.firstChild;)domUtils.isBlockElm(r.firstChild)&&(B=1),A.appendChild(r.firstChild);B?l.appendChild(A):(C=f.document.createElement("p"),C.appendChild(A),l.appendChild(C)),domUtils.remove(r)}r=p}var D=domUtils.createElement(f.document,"div",{tmpDiv:1});domUtils.moveChild(t,D),l.appendChild(D),domUtils.remove(t),n.parentNode.insertBefore(l,n),h.setEndBefore(n),domUtils.isEmptyNode(n)&&domUtils.remove(n),u=1}}s||h.setStartBefore(f.document.getElementById(q.start)),q.end&&!u&&h.setEndAfter(f.document.getElementById(q.end)),h.enlarge(!0,function(a){return i[a.tagName]}),l=f.document.createDocumentFragment();for(var E,F=h.createBookmark(),G=domUtils.getNextDomNode(F.start,!1,j),H=h.cloneRange(),I=domUtils.isBlockElm;G&&G!==F.end&&domUtils.getPosition(G,F.end)&domUtils.POSITION_PRECEDING;)if(3==G.nodeType||dtd.li[G.tagName]){if(1==G.nodeType&&dtd.$list[G.tagName]){for(;G.firstChild;)l.appendChild(G.firstChild);E=domUtils.getNextDomNode(G,!1,j),domUtils.remove(G),G=E;continue}for(E=G,H.setStartBefore(G);G&&G!==F.end&&(!I(G)||domUtils.isBookmarkNode(G));)E=G,G=domUtils.getNextDomNode(G,!1,null,function(a){return!i[a.tagName]});G&&I(G)&&(p=domUtils.getNextDomNode(E,!1,j),p&&domUtils.isBookmarkNode(p)&&(G=domUtils.getNextDomNode(p,!1,j),E=p)),H.setEndAfter(E),G=domUtils.getNextDomNode(E,!1,j);var J=h.document.createElement("li");if(J.appendChild(H.extractContents()),domUtils.isEmptyNode(J)){for(var E=h.document.createElement("p");J.firstChild;)E.appendChild(J.firstChild);J.appendChild(E)}l.appendChild(J)}else G=domUtils.getNextDomNode(G,!0,j);h.moveToBookmark(F).collapse(!0),o=f.document.createElement(k),e(o,c),o.appendChild(l),h.insertNode(o),d(o,k,c);for(var x,y=0,K=domUtils.getElementsByTagName(o,"div");x=K[y++];)x.getAttribute("tmpDiv")&&domUtils.remove(x,!0);h.moveToBookmark(q).select()},queryCommandState:function(a){for(var b,c="insertorderedlist"==a.toLowerCase()?"ol":"ul",d=this.selection.getStartElementPath(),e=0;b=d[e++];){if("TABLE"==b.nodeName)return 0;if(c==b.nodeName.toLowerCase())return 1}return 0},queryCommandValue:function(a){for(var c,d,e="insertorderedlist"==a.toLowerCase()?"ol":"ul",f=this.selection.getStartElementPath(),g=0;d=f[g++];){if("TABLE"==d.nodeName){c=null;break}if(e==d.nodeName.toLowerCase()){c=d;break}}return c?b(c)||domUtils.getComputedStyle(c,"list-style-type"):null}}},function(){var a={textarea:function(a,b){var c=b.ownerDocument.createElement("textarea");return c.style.cssText="position:absolute;resize:none;width:100%;height:100%;border:0;padding:0;margin:0;overflow-y:auto;",browser.ie&&browser.version<8&&(c.style.width=b.offsetWidth+"px",c.style.height=b.offsetHeight+"px",b.onresize=function(){c.style.width=b.offsetWidth+"px",c.style.height=b.offsetHeight+"px"}),b.appendChild(c),{setContent:function(a){c.value=a},getContent:function(){return c.value},select:function(){var a;browser.ie?(a=c.createTextRange(),a.collapse(!0),a.select()):(c.setSelectionRange(0,0),c.focus())},dispose:function(){b.removeChild(c),b.onresize=null,c=null,b=null}}},codemirror:function(a,b){var c=window.CodeMirror(b,{mode:"text/html",tabMode:"indent",lineNumbers:!0,lineWrapping:!0}),d=c.getWrapperElement();return d.style.cssText='position:absolute;left:0;top:0;width:100%;height:100%;font-family:consolas,"Courier new",monospace;font-size:13px;',c.getScrollerElement().style.cssText="position:absolute;left:0;top:0;width:100%;height:100%;",c.refresh(),{getCodeMirror:function(){return c},setContent:function(a){c.setValue(a)},getContent:function(){return c.getValue()},select:function(){c.focus()},dispose:function(){b.removeChild(d),d=null,c=null}}}};UE.plugins.source=function(){function b(b){return a["codemirror"==f.sourceEditor&&window.CodeMirror?"codemirror":"textarea"](e,b)}var c,d,e=this,f=this.options,g=!1;f.sourceEditor=browser.ie?"textarea":f.sourceEditor||"codemirror",e.setOpt({sourceEditorFirst:!1});var h,i,j;e.commands.source={execCommand:function(){if(g=!g){j=e.selection.getRange().createAddress(!1,!0),e.undoManger&&e.undoManger.save(!0),browser.gecko&&(e.body.contentEditable=!1),h=e.iframe.style.cssText,e.iframe.style.cssText+="position:absolute;left:-32768px;top:-32768px;",e.fireEvent("beforegetcontent");var a=UE.htmlparser(e.body.innerHTML);e.filterOutputRule(a),a.traversal(function(a){if("element"==a.type)switch(a.tagName){case"td":case"th":case"caption":a.children&&1==a.children.length&&"br"==a.firstChild().tagName&&a.removeChild(a.firstChild());break;case"pre":a.innerText(a.innerText().replace(/ /g," "))}}),e.fireEvent("aftergetcontent");var f=a.toHtml(!0);c=b(e.iframe.parentNode),c.setContent(f),d=e.setContent,e.setContent=function(a){var b=UE.htmlparser(a);e.filterInputRule(b),a=b.toHtml(),c.setContent(a)},setTimeout(function(){c.select(),e.addListener("fullscreenchanged",function(){try{c.getCodeMirror().refresh()}catch(a){}})}),i=e.getContent,e.getContent=function(){return c.getContent()||"

    "+(browser.ie?"":"
    ")+"

    "}}else{e.iframe.style.cssText=h;var k=c.getContent()||"

    "+(browser.ie?"":"
    ")+"

    ";k=k.replace(new RegExp("[\\r\\t\\n ]*]*)>","g"),function(a,b){return b&&!dtd.$inlineWithA[b.toLowerCase()]?a.replace(/(^[\n\r\t ]*)|([\n\r\t ]*$)/g,""):a.replace(/(^[\n\r\t]*)|([\n\r\t]*$)/g,"")}),e.setContent=d,e.setContent(k),c.dispose(),c=null,e.getContent=i;var l=e.body.firstChild;if(l||(e.body.innerHTML="

    "+(browser.ie?"":"
    ")+"

    ",l=e.body.firstChild),e.undoManger&&e.undoManger.save(!0),browser.gecko){var m=document.createElement("input");m.style.cssText="position:absolute;left:0;top:-32768px",document.body.appendChild(m),e.body.contentEditable=!1,setTimeout(function(){domUtils.setViewportOffset(m,{left:-32768,top:0}),m.focus(),setTimeout(function(){e.body.contentEditable=!0,e.selection.getRange().moveToAddress(j).select(!0),domUtils.remove(m)})})}else try{e.selection.getRange().moveToAddress(j).select(!0)}catch(n){}}this.fireEvent("sourcemodechanged",g)},queryCommandState:function(){return 0|g},notNeedUndo:1};var k=e.queryCommandState;e.queryCommandState=function(a){return a=a.toLowerCase(),g?a in{source:1,fullscreen:1}?1:-1:k.apply(this,arguments)},"codemirror"==f.sourceEditor&&e.addListener("ready",function(){utils.loadFile(document,{src:f.codeMirrorJsUrl||f.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.js",tag:"script",type:"text/javascript",defer:"defer"},function(){f.sourceEditorFirst&&setTimeout(function(){e.execCommand("source")},0)}),utils.loadFile(document,{tag:"link",rel:"stylesheet",type:"text/css",href:f.codeMirrorCssUrl||f.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.css"})})}}(),UE.plugins.enterkey=function(){var a,b=this,c=b.options.enterTag;b.addListener("keyup",function(c,d){var e=d.keyCode||d.which;if(13==e){var f,g=b.selection.getRange(),h=g.startContainer;if(browser.ie)b.fireEvent("saveScene",!0,!0);else{if(/h\d/i.test(a)){if(browser.gecko){var i=domUtils.findParentByTagName(h,["h1","h2","h3","h4","h5","h6","blockquote","caption","table"],!0);i||(b.document.execCommand("formatBlock",!1,"

    "),f=1)}else if(1==h.nodeType){var j,k=b.document.createTextNode("");if(g.insertNode(k),j=domUtils.findParentByTagName(k,"div",!0)){for(var l=b.document.createElement("p");j.firstChild;)l.appendChild(j.firstChild);j.parentNode.insertBefore(l,j),domUtils.remove(j),g.setStartBefore(k).setCursor(),f=1}domUtils.remove(k)}b.undoManger&&f&&b.undoManger.save()}browser.opera&&g.select()}}}),b.addListener("keydown",function(d,e){var f=e.keyCode||e.which;if(13==f){if(b.fireEvent("beforeenterkeydown"))return void domUtils.preventDefault(e);b.fireEvent("saveScene",!0,!0),a="";var g=b.selection.getRange();if(!g.collapsed){var h=g.startContainer,i=g.endContainer,j=domUtils.findParentByTagName(h,"td",!0),k=domUtils.findParentByTagName(i,"td",!0);if(j&&k&&j!==k||!j&&k||j&&!k)return void(e.preventDefault?e.preventDefault():e.returnValue=!1)}if("p"==c)browser.ie||(h=domUtils.findParentByTagName(g.startContainer,["ol","ul","p","h1","h2","h3","h4","h5","h6","blockquote","caption"],!0),h||browser.opera?(a=h.tagName,"p"==h.tagName.toLowerCase()&&browser.gecko&&domUtils.removeDirtyAttr(h)):(b.document.execCommand("formatBlock",!1,"

    "),browser.gecko&&(g=b.selection.getRange(),h=domUtils.findParentByTagName(g.startContainer,"p",!0),h&&domUtils.removeDirtyAttr(h))));else if(e.preventDefault?e.preventDefault():e.returnValue=!1,g.collapsed){m=g.document.createElement("br"),g.insertNode(m);var l=m.parentNode;l.lastChild===m?(m.parentNode.insertBefore(m.cloneNode(!0),m),g.setStartBefore(m)):g.setStartAfter(m),g.setCursor()}else if(g.deleteContents(),h=g.startContainer,1==h.nodeType&&(h=h.childNodes[g.startOffset])){for(;1==h.nodeType;){if(dtd.$empty[h.tagName])return g.setStartBefore(h).setCursor(),b.undoManger&&b.undoManger.save(),!1;if(!h.firstChild){var m=g.document.createElement("br");return h.appendChild(m),g.setStart(h,0).setCursor(),b.undoManger&&b.undoManger.save(),!1}h=h.firstChild}h===g.startContainer.childNodes[g.startOffset]?(m=g.document.createElement("br"),g.insertNode(m).setCursor()):g.setStart(h,0).setCursor()}else m=g.document.createElement("br"),g.insertNode(m).setStartAfter(m).setCursor()}})},UE.plugins.keystrokes=function(){var a=this,b=!0;a.addListener("keydown",function(c,d){var e=d.keyCode||d.which,f=a.selection.getRange();if(!f.collapsed&&!(d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)&&(e>=65&&e<=90||e>=48&&e<=57||e>=96&&e<=111||{13:1,8:1,46:1}[e])){var g=f.startContainer;if(domUtils.isFillChar(g)&&f.setStartBefore(g),g=f.endContainer,domUtils.isFillChar(g)&&f.setEndAfter(g),f.txtToElmBoundary(),f.endContainer&&1==f.endContainer.nodeType&&(g=f.endContainer.childNodes[f.endOffset],g&&domUtils.isBr(g)&&f.setEndAfter(g)),0==f.startOffset&&(g=f.startContainer,domUtils.isBoundaryNode(g,"firstChild")&&(g=f.endContainer,f.endOffset==(3==g.nodeType?g.nodeValue.length:g.childNodes.length)&&domUtils.isBoundaryNode(g,"lastChild"))))return a.fireEvent("saveScene"),a.body.innerHTML="

    "+(browser.ie?"":"
    ")+"

    ",f.setStart(a.body.firstChild,0).setCursor(!1,!0),void a._selectionChange()}if(e==keymap.Backspace){if(f=a.selection.getRange(),b=f.collapsed,a.fireEvent("delkeydown",d))return;var h,i;if(f.collapsed&&f.inFillChar()&&(h=f.startContainer,domUtils.isFillChar(h)?(f.setStartBefore(h).shrinkBoundary(!0).collapse(!0),domUtils.remove(h)):(h.nodeValue=h.nodeValue.replace(new RegExp("^"+domUtils.fillChar),""),f.startOffset--,f.collapse(!0).select(!0))),h=f.getClosedNode())return a.fireEvent("saveScene"),f.setStartBefore(h),domUtils.remove(h),f.setCursor(),a.fireEvent("saveScene"),void domUtils.preventDefault(d);if(!browser.ie&&(h=domUtils.findParentByTagName(f.startContainer,"table",!0),i=domUtils.findParentByTagName(f.endContainer,"table",!0),h&&!i||!h&&i||h!==i))return void d.preventDefault()}if(e==keymap.Tab){var j={ol:1,ul:1,table:1};if(a.fireEvent("tabkeydown",d))return void domUtils.preventDefault(d);var k=a.selection.getRange();a.fireEvent("saveScene");for(var l=0,m="",n=a.options.tabSize||4,o=a.options.tabNode||" ";l"});d.insertNode(g).setStart(g,0).setCursor(!1,!0)}}if(!b&&(3==d.startContainer.nodeType||1==d.startContainer.nodeType&&domUtils.isEmptyBlock(d.startContainer)))if(browser.ie){var k=d.document.createElement("span");d.insertNode(k).setStartBefore(k).collapse(!0),d.select(),domUtils.remove(k)}else d.select()}})},UE.plugins.fiximgclick=function(){function a(){this.editor=null,this.resizer=null,this.cover=null,this.doc=document,this.prePos={x:0,y:0},this.startPos={x:0,y:0}}var b=!1;return function(){var c=[[0,0,-1,-1],[0,0,0,-1],[0,0,1,-1],[0,0,-1,0],[0,0,1,0],[0,0,-1,1],[0,0,0,1],[0,0,1,1]];a.prototype={init:function(a){var b=this;b.editor=a,b.startPos=this.prePos={x:0,y:0},b.dragId=-1;var c=[],d=b.cover=document.createElement("div"),e=b.resizer=document.createElement("div");for(d.id=b.editor.ui.id+"_imagescale_cover",d.style.cssText="position:absolute;display:none;z-index:"+b.editor.options.zIndex+";filter:alpha(opacity=0); opacity:0;background:#CCC;",domUtils.on(d,"mousedown click",function(){b.hide()}),i=0;i<8;i++)c.push('');e.id=b.editor.ui.id+"_imagescale",e.className="edui-editor-imagescale",e.innerHTML=c.join(""),e.style.cssText+=";display:none;border:1px solid #3b77ff;z-index:"+b.editor.options.zIndex+";",b.editor.ui.getDom().appendChild(d),b.editor.ui.getDom().appendChild(e),b.initStyle(),b.initEvents()},initStyle:function(){utils.cssRule("imagescale",".edui-editor-imagescale{display:none;position:absolute;border:1px solid #38B2CE;cursor:hand;-webkit-box-sizing: content-box;-moz-box-sizing: content-box;box-sizing: content-box;}.edui-editor-imagescale span{position:absolute;width:6px;height:6px;overflow:hidden;font-size:0px;display:block;background-color:#3C9DD0;}.edui-editor-imagescale .edui-editor-imagescale-hand0{cursor:nw-resize;top:0;margin-top:-4px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand1{cursor:n-resize;top:0;margin-top:-4px;left:50%;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand2{cursor:ne-resize;top:0;margin-top:-4px;left:100%;margin-left:-3px;}.edui-editor-imagescale .edui-editor-imagescale-hand3{cursor:w-resize;top:50%;margin-top:-4px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand4{cursor:e-resize;top:50%;margin-top:-4px;left:100%;margin-left:-3px;}.edui-editor-imagescale .edui-editor-imagescale-hand5{cursor:sw-resize;top:100%;margin-top:-3px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand6{cursor:s-resize;top:100%;margin-top:-3px;left:50%;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand7{cursor:se-resize;top:100%;margin-top:-3px;left:100%;margin-left:-3px;}")},initEvents:function(){var a=this;a.startPos.x=a.startPos.y=0,a.isDraging=!1},_eventHandler:function(a){var c=this;switch(a.type){case"mousedown":var d,d=a.target||a.srcElement;d.className.indexOf("edui-editor-imagescale-hand")!=-1&&c.dragId==-1&&(c.dragId=d.className.slice(-1),c.startPos.x=c.prePos.x=a.clientX,c.startPos.y=c.prePos.y=a.clientY,domUtils.on(c.doc,"mousemove",c.proxy(c._eventHandler,c)));break;case"mousemove":c.dragId!=-1&&(c.updateContainerStyle(c.dragId,{x:a.clientX-c.prePos.x,y:a.clientY-c.prePos.y}),c.prePos.x=a.clientX,c.prePos.y=a.clientY,b=!0,c.updateTargetElement());break;case"mouseup":c.dragId!=-1&&(c.updateContainerStyle(c.dragId,{x:a.clientX-c.prePos.x,y:a.clientY-c.prePos.y}),c.updateTargetElement(),c.target.parentNode&&c.attachTo(c.target),c.dragId=-1),domUtils.un(c.doc,"mousemove",c.proxy(c._eventHandler,c)),b&&(b=!1,c.editor.fireEvent("contentchange"))}},updateTargetElement:function(){var a=this;domUtils.setStyles(a.target,{width:a.resizer.style.width,height:a.resizer.style.height}),a.target.width=parseInt(a.resizer.style.width),a.target.height=parseInt(a.resizer.style.height),a.attachTo(a.target)},updateContainerStyle:function(a,b){var d,e=this,f=e.resizer;0!=c[a][0]&&(d=parseInt(f.style.left)+b.x,f.style.left=e._validScaledProp("left",d)+"px"),0!=c[a][1]&&(d=parseInt(f.style.top)+b.y,f.style.top=e._validScaledProp("top",d)+"px"),0!=c[a][2]&&(d=f.clientWidth+c[a][2]*b.x,f.style.width=e._validScaledProp("width",d)+"px"),0!=c[a][3]&&(d=f.clientHeight+c[a][3]*b.y,f.style.height=e._validScaledProp("height",d)+"px")},_validScaledProp:function(a,b){var c=this.resizer,d=document;switch(b=isNaN(b)?0:b,a){case"left":return b<0?0:b+c.clientWidth>d.clientWidth?d.clientWidth-c.clientWidth:b;case"top":return b<0?0:b+c.clientHeight>d.clientHeight?d.clientHeight-c.clientHeight:b;case"width":return b<=0?1:b+c.offsetLeft>d.clientWidth?d.clientWidth-c.offsetLeft:b;case"height":return b<=0?1:b+c.offsetTop>d.clientHeight?d.clientHeight-c.offsetTop:b}},hideCover:function(){this.cover.style.display="none"},showCover:function(){var a=this,b=domUtils.getXY(a.editor.ui.getDom()),c=domUtils.getXY(a.editor.iframe);domUtils.setStyles(a.cover,{width:a.editor.iframe.offsetWidth+"px",height:a.editor.iframe.offsetHeight+"px",top:c.y-b.y+"px",left:c.x-b.x+"px",position:"absolute",display:""})},show:function(a){var b=this;b.resizer.style.display="block",a&&b.attachTo(a),domUtils.on(this.resizer,"mousedown",b.proxy(b._eventHandler,b)),domUtils.on(b.doc,"mouseup",b.proxy(b._eventHandler,b)),b.showCover(),b.editor.fireEvent("afterscaleshow",b),b.editor.fireEvent("saveScene")},hide:function(){var a=this;a.hideCover(),a.resizer.style.display="none",domUtils.un(a.resizer,"mousedown",a.proxy(a._eventHandler,a)),domUtils.un(a.doc,"mouseup",a.proxy(a._eventHandler,a)),a.editor.fireEvent("afterscalehide",a)},proxy:function(a,b){return function(c){return a.apply(b||this,arguments)}},attachTo:function(a){var b=this,c=b.target=a,d=this.resizer,e=domUtils.getXY(c),f=domUtils.getXY(b.editor.iframe),g=domUtils.getXY(d.parentNode);domUtils.setStyles(d,{width:c.width+"px",height:c.height+"px",left:f.x+e.x-b.editor.document.body.scrollLeft-g.x-parseInt(d.style.borderLeftWidth)+"px",top:f.y+e.y-b.editor.document.body.scrollTop-g.y-parseInt(d.style.borderTopWidth)+"px"})}}}(),function(){var b,c=this;c.setOpt("imageScaleEnabled",!0),!browser.ie&&c.options.imageScaleEnabled&&c.addListener("click",function(d,e){var f=c.selection.getRange(),g=f.getClosedNode();if(g&&"IMG"==g.tagName&&"false"!=c.body.contentEditable){if(g.className.indexOf("edui-faked-music")!=-1||g.getAttribute("anchorname")||domUtils.hasClass(g,"loadingclass")||domUtils.hasClass(g,"loaderrorclass"))return;if(!b){b=new a,b.init(c),c.ui.getDom().appendChild(b.resizer);var h,i=function(a){b.hide(),b.target&&c.selection.getRange().selectNode(b.target).select()},j=function(a){var b=a.target||a.srcElement;!b||void 0!==b.className&&b.className.indexOf("edui-editor-imagescale")!=-1||i(a)};c.addListener("afterscaleshow",function(a){c.addListener("beforekeydown",i),c.addListener("beforemousedown",j),domUtils.on(document,"keydown",i),domUtils.on(document,"mousedown",j),c.selection.getNative().removeAllRanges()}),c.addListener("afterscalehide",function(a){c.removeListener("beforekeydown",i),c.removeListener("beforemousedown",j),domUtils.un(document,"keydown",i),domUtils.un(document,"mousedown",j);var d=b.target;d.parentNode&&c.selection.getRange().selectNode(d).select()}),domUtils.on(b.resizer,"mousedown",function(a){c.selection.getNative().removeAllRanges();var d=a.target||a.srcElement;d&&d.className.indexOf("edui-editor-imagescale-hand")==-1&&(h=setTimeout(function(){b.hide(),b.target&&c.selection.getRange().selectNode(d).select()},200))}),domUtils.on(b.resizer,"mouseup",function(a){var b=a.target||a.srcElement;b&&b.className.indexOf("edui-editor-imagescale-hand")==-1&&clearTimeout(h)})}b.show(g)}else b&&"none"!=b.resizer.style.display&&b.hide()}),browser.webkit&&c.addListener("click",function(a,b){if("IMG"==b.target.tagName&&"false"!=c.body.contentEditable){var d=new dom.Range(c.document);d.selectNode(b.target).select()}})}}(),UE.plugin.register("autolink",function(){var a=0;return browser.ie?{}:{bindEvents:{reset:function(){a=0},keydown:function(a,b){var c=this,d=b.keyCode||b.which;if(32==d||13==d){for(var e,f,g=c.selection.getNative(),h=g.getRangeAt(0).cloneRange(),i=h.startContainer;1==i.nodeType&&h.startOffset>0&&(i=h.startContainer.childNodes[h.startOffset-1]);)h.setStart(i,1==i.nodeType?i.childNodes.length:i.nodeValue.length),h.collapse(!0),i=h.startContainer;do{if(0==h.startOffset){for(i=h.startContainer.previousSibling;i&&1==i.nodeType;)i=i.lastChild;if(!i||domUtils.isFillChar(i))break;e=i.nodeValue.length}else i=h.startContainer,e=h.startOffset;h.setStart(i,e-1),f=h.toString().charCodeAt(0)}while(160!=f&&32!=f);if(h.toString().replace(new RegExp(domUtils.fillChar,"g"),"").match(/(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i)){for(;h.toString().length&&!/^(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i.test(h.toString());)try{h.setStart(h.startContainer,h.startOffset+1)}catch(j){for(var i=h.startContainer;!(next=i.nextSibling);){if(domUtils.isBody(i))return;i=i.parentNode}h.setStart(next,0)}if(domUtils.findParentByTagName(h.startContainer,"a",!0))return;var k,l=c.document.createElement("a"),m=c.document.createTextNode(" ");c.undoManger&&c.undoManger.save(),l.appendChild(h.extractContents()),l.href=l.innerHTML=l.innerHTML.replace(/<[^>]+>/g,""),k=l.getAttribute("href").replace(new RegExp(domUtils.fillChar,"g"),""),k=/^(?:https?:\/\/)/gi.test(k)?k:"http://"+k,l.setAttribute("_src",utils.html(k)),l.href=utils.html(k),h.insertNode(l),l.parentNode.insertBefore(m,l.nextSibling),h.setStart(m,0),h.collapse(!0),g.removeAllRanges(),g.addRange(h),c.undoManger&&c.undoManger.save()}}}}}},function(){function a(a){if(3==a.nodeType)return null;if("A"==a.nodeName)return a;for(var b=a.lastChild;b;){if("A"==b.nodeName)return b;if(3==b.nodeType){if(domUtils.isWhitespace(b)){b=b.previousSibling;continue}return null}b=b.lastChild}}var b={37:1,38:1,39:1,40:1,13:1,32:1};browser.ie&&this.addListener("keyup",function(c,d){var e=this,f=d.keyCode;if(b[f]){var g=e.selection.getRange(),h=g.startContainer;if(13==f){for(;h&&!domUtils.isBody(h)&&!domUtils.isBlockElm(h);)h=h.parentNode;if(h&&!domUtils.isBody(h)&&"P"==h.nodeName){var i=h.previousSibling;if(i&&1==i.nodeType){var i=a(i);i&&!i.getAttribute("_href")&&domUtils.remove(i,!0)}}}else if(32==f)3==h.nodeType&&/^\s$/.test(h.nodeValue)&&(h=h.previousSibling,h&&"A"==h.nodeName&&!h.getAttribute("_href")&&domUtils.remove(h,!0));else if(h=domUtils.findParentByTagName(h,"a",!0),h&&!h.getAttribute("_href")){var j=g.createBookmark();domUtils.remove(h,!0),g.moveToBookmark(j).select(!0)}}})}),UE.plugins.autoheight=function(){function a(){var a=this;clearTimeout(e),f||(!a.queryCommandState||a.queryCommandState&&1!=a.queryCommandState("source"))&&(e=setTimeout(function(){for(var b=a.body.lastChild;b&&1!=b.nodeType;)b=b.previousSibling;b&&1==b.nodeType&&(b.style.clear="both",d=Math.max(domUtils.getXY(b).y+b.offsetHeight+25,Math.max(h.minFrameHeight,h.initialFrameHeight)),d!=g&&(d!==parseInt(a.iframe.parentNode.style.height)&&(a.iframe.parentNode.style.height=d+"px"),a.body.style.height=d+"px",g=d),domUtils.removeStyle(b,"clear"))},50))}var b=this;if(b.autoHeightEnabled=b.options.autoHeightEnabled!==!1,b.autoHeightEnabled){var c,d,e,f,g=0,h=b.options;b.addListener("fullscreenchanged",function(a,b){f=b}),b.addListener("destroy",function(){b.removeListener("contentchange afterinserthtml keyup mouseup",a)}),b.enableAutoHeight=function(){var b=this;if(b.autoHeightEnabled){var d=b.document;b.autoHeightEnabled=!0,c=d.body.style.overflowY,d.body.style.overflowY="hidden",b.addListener("contentchange afterinserthtml keyup mouseup",a),setTimeout(function(){a.call(b)},browser.gecko?100:0),b.fireEvent("autoheightchanged",b.autoHeightEnabled)}},b.disableAutoHeight=function(){b.body.style.overflowY=c||"",b.removeListener("contentchange",a),b.removeListener("keyup",a),b.removeListener("mouseup",a),b.autoHeightEnabled=!1,b.fireEvent("autoheightchanged",b.autoHeightEnabled)},b.on("setHeight",function(){b.disableAutoHeight()}),b.addListener("ready",function(){b.enableAutoHeight();var c;domUtils.on(browser.ie?b.body:b.document,browser.webkit?"dragover":"drop",function(){ +clearTimeout(c),c=setTimeout(function(){a.call(b)},100)});var d;window.onscroll=function(){null===d?d=this.scrollY:0==this.scrollY&&0!=d&&(b.window.scrollTo(0,0),d=null)}})}},UE.plugins.autofloat=function(){function a(){return UE.ui?1:(alert(g.autofloatMsg),0)}function b(){var a=document.body.style;a.backgroundImage='url("about:blank")',a.backgroundAttachment="fixed"}function c(){var a=domUtils.getXY(k),b=domUtils.getComputedStyle(k,"position"),c=domUtils.getComputedStyle(k,"left");k.style.width=k.offsetWidth+"px",k.style.zIndex=1*f.options.zIndex+1,k.parentNode.insertBefore(q,k),o||p&&browser.ie?("absolute"!=k.style.position&&(k.style.position="absolute"),k.style.top=(document.body.scrollTop||document.documentElement.scrollTop)-l+i+"px"):(browser.ie7Compat&&r&&(r=!1,k.style.left=domUtils.getXY(k).x-document.documentElement.getBoundingClientRect().left+2+"px"),"fixed"!=k.style.position&&(k.style.position="fixed",k.style.top=i+"px",("absolute"==b||"relative"==b)&&parseFloat(c)&&(k.style.left=a.x+"px")))}function d(){r=!0,q.parentNode&&q.parentNode.removeChild(q),k.style.cssText=j}function e(){var a=m(f.container),b=f.options.toolbarTopOffset||0;a.top<0&&a.bottom-k.offsetHeight>b?c():d()}var f=this,g=f.getLang();f.setOpt({topOffset:0});var h=f.options.autoFloatEnabled!==!1,i=f.options.topOffset;if(h){var j,k,l,m,n=UE.ui.uiUtils,o=browser.ie&&browser.version<=6,p=browser.quirks,q=document.createElement("div"),r=!0,s=utils.defer(function(){e()},browser.ie?200:100,!0);f.addListener("destroy",function(){domUtils.un(window,["scroll","resize"],e),f.removeListener("keydown",s)}),f.addListener("ready",function(){if(a(f)){if(!f.ui)return;m=n.getClientRect,k=f.ui.getDom("toolbarbox"),l=m(k).top,j=k.style.cssText,q.style.height=k.offsetHeight+"px",o&&b(),domUtils.on(window,["scroll","resize"],e),f.addListener("keydown",s),f.addListener("beforefullscreenchange",function(a,b){b&&d()}),f.addListener("fullscreenchanged",function(a,b){b||e()}),f.addListener("sourcemodechanged",function(a,b){setTimeout(function(){e()},0)}),f.addListener("clearDoc",function(){setTimeout(function(){e()},0)})}})}},UE.plugins.video=function(){function a(a,b,d,e,f,g,h){a=utils.unhtmlForUrl(a),f=utils.unhtml(f),g=utils.unhtml(g).trim(),b=parseInt(b,10)||0,d=parseInt(d,10)||0;var i;switch(h){case"image":i="';break;case"embed":i='';break;case"video":var j=a.substr(a.lastIndexOf(".")+1);"ogv"==j&&(j="ogg"),i="'}return i}function b(b,c){utils.each(b.getNodesByTagName(c?"img":"embed video"),function(b){var d=b.getAttr("class");if(d&&d.indexOf("edui-faked-video")!=-1){var e=a(c?b.getAttr("_url"):b.getAttr("src"),b.getAttr("width"),b.getAttr("height"),null,b.getStyle("float")||"",d,c?"embed":"image");b.parentNode.replaceChild(UE.uNode.createElement(e),b)}if(d&&d.indexOf("edui-upload-video")!=-1){var e=a(c?b.getAttr("_url"):b.getAttr("src"),b.getAttr("width"),b.getAttr("height"),null,b.getStyle("float")||"",d,c?"video":"image");b.parentNode.replaceChild(UE.uNode.createElement(e),b)}})}var c=this;c.addOutputRule(function(a){b(a,!0)}),c.addInputRule(function(a){b(a)}),c.commands.insertvideo={execCommand:function(b,d,e){d=utils.isArray(d)?d:[d];for(var f,g,h=[],i="tmpVedio",j=0,k=d.length;j0)return 0;for(var c in dtd.$isNotEmpty)if(dtd.$isNotEmpty.hasOwnProperty(c)&&a.getElementsByTagName(c).length)return 0;return 1},b.getWidth=function(a){return a?parseInt(domUtils.getComputedStyle(a,"width"),10):0},b.getTableCellAlignState=function(a){!utils.isArray(a)&&(a=[a]);var b={},c=["align","valign"],d=null,e=!0;return utils.each(a,function(a){return utils.each(c,function(c){if(d=a.getAttribute(c),!b[c]&&d)b[c]=d;else if(!b[c]||d!==b[c])return e=!1,!1}),e}),e?b:null},b.getTableItemsByRange=function(a){var b=a.selection.getStart();b&&b.id&&0===b.id.indexOf("_baidu_bookmark_start_")&&b.nextSibling&&(b=b.nextSibling);var c=b&&domUtils.findParentByTagName(b,["td","th"],!0),d=c&&c.parentNode,e=b&&domUtils.findParentByTagName(b,"caption",!0),f=e?e.parentNode:d&&d.parentNode.parentNode;return{cell:c,tr:d,table:f,caption:e}},b.getUETableBySelected=function(a){var c=b.getTableItemsByRange(a).table;return c&&c.ueTable&&c.ueTable.selectedTds.length?c.ueTable:null},b.getDefaultValue=function(a,b){var c,d,e,f,g={thin:"0px",medium:"1px",thick:"2px"};if(b)return h=b.getElementsByTagName("td")[0],f=domUtils.getComputedStyle(b,"border-left-width"),c=parseInt(g[f]||f,10),f=domUtils.getComputedStyle(h,"padding-left"),d=parseInt(g[f]||f,10),f=domUtils.getComputedStyle(h,"border-left-width"),e=parseInt(g[f]||f,10),{tableBorder:c,tdPadding:d,tdBorder:e};b=a.document.createElement("table"),b.insertRow(0).insertCell(0).innerHTML="xxx",a.body.appendChild(b);var h=b.getElementsByTagName("td")[0];return f=domUtils.getComputedStyle(b,"border-left-width"),c=parseInt(g[f]||f,10),f=domUtils.getComputedStyle(h,"padding-left"),d=parseInt(g[f]||f,10),f=domUtils.getComputedStyle(h,"border-left-width"),e=parseInt(g[f]||f,10),domUtils.remove(b),{tableBorder:c,tdPadding:d,tdBorder:e}},b.getUETable=function(a){var c=a.tagName.toLowerCase();return a="td"==c||"th"==c||"caption"==c?domUtils.findParentByTagName(a,"table",!0):a,a.ueTable||(a.ueTable=new b(a)),a.ueTable},b.cloneCell=function(a,b,c){if(!a||utils.isString(a))return this.table.ownerDocument.createElement(a||"td");var d=domUtils.hasClass(a,"selectTdClass");d&&domUtils.removeClasses(a,"selectTdClass");var e=a.cloneNode(!0);return b&&(e.rowSpan=e.colSpan=1),!c&&domUtils.removeAttributes(e,"width height"),!c&&domUtils.removeAttributes(e,"style"),e.style.borderLeftStyle="",e.style.borderTopStyle="",e.style.borderLeftColor=a.style.borderRightColor,e.style.borderLeftWidth=a.style.borderRightWidth,e.style.borderTopColor=a.style.borderBottomColor,e.style.borderTopWidth=a.style.borderBottomWidth,d&&domUtils.addClass(a,"selectTdClass"),e},b.prototype={getMaxRows:function(){for(var a,b=this.table.rows,c=1,d=0;a=b[d];d++){for(var e,f=1,g=0;e=a.cells[g++];)f=Math.max(e.rowSpan||1,f);c=Math.max(f+d,c)}return c},getMaxCols:function(){for(var a,b=this.table.rows,c=0,d={},e=0;a=b[e];e++){for(var f,g=0,h=0;f=a.cells[h++];)if(g+=f.colSpan||1,f.rowSpan&&f.rowSpan>1)for(var i=1;ithis.rowsNum-1)?null:(e=c?h?i.endRowIndex+1:g.rowIndex+g.rowSpan:h?i.beginRowIndex-1:g.rowIndex-1,f=h?i.beginColIndex:g.colIndex,this.getCell(this.indexTable[e][f].rowIndex,this.indexTable[e][f].cellIndex))}catch(j){a(j)}},getSameEndPosCells:function(b,c){try{for(var d="x"===c.toLowerCase(),e=domUtils.getXY(b)[d?"x":"y"]+b["offset"+(d?"Width":"Height")],f=this.table.rows,g=null,h=[],i=0;ie&&d)break;if((b==j||e==l)&&(1==j[d?"colSpan":"rowSpan"]&&h.push(j),d))break}}return h}catch(m){a(m)}},setCellContent:function(a,b){a.innerHTML=b||(browser.ie?domUtils.fillChar:"
    ")},cloneCell:b.cloneCell,getSameStartPosXCells:function(b){try{for(var c,d=domUtils.getXY(b).x+b.offsetWidth,e=this.table.rows,f=[],g=0;gd)break;if(j==d&&1==h.colSpan){f.push(h);break}}}return f}catch(k){a(k)}},update:function(a){this.table=a||this.table,this.selectedTds=[],this.cellsRange={},this.indexTable=[];for(var b=this.table.rows,c=this.getMaxRows(),d=c-b.length,e=this.getMaxCols();d--;)this.table.insertRow(b.length);this.rowsNum=c,this.colsNum=e;for(var f=0,g=b.length;fc&&(j.rowSpan=c);for(var m=k,n=j.rowSpan||1,o=j.colSpan||1;this.indexTable[i][m];)m++;for(var p=0;p0)for(h=b;hf&&(m=Math.max(h,m));if(ee&&(l=Math.max(i,l));if(b>0)for(i=a;ig||d+b.colSpan-1>h)return null;j.push(this.getCell(c,b.cellIndex))}}return j},clearSelected:function(){b.removeSelectedClass(this.selectedTds),this.selectedTds=[],this.cellsRange={}},setSelected:function(a){var c=this.getCells(a);b.addSelectedClass(c),this.selectedTds=c,this.cellsRange=a},isFullRow:function(){var a=this.cellsRange;return a.endColIndex-a.beginColIndex+1==this.colsNum},isFullCol:function(){var a=this.cellsRange,b=this.table,c=b.getElementsByTagName("th"),d=a.endRowIndex-a.beginRowIndex+1;return c.length?d==this.rowsNum||d==this.rowsNum-1:d==this.rowsNum},getNextCell:function(b,c,d){try{var e,f,g=this.getCellInfo(b),h=this.selectedTds.length&&!d,i=this.cellsRange;return!c&&0==g.rowIndex||c&&(h?i.endRowIndex==this.rowsNum-1:g.rowIndex+g.rowSpan>this.rowsNum-1)?null:(e=c?h?i.endRowIndex+1:g.rowIndex+g.rowSpan:h?i.beginRowIndex-1:g.rowIndex-1,f=h?i.beginColIndex:g.colIndex,this.getCell(this.indexTable[e][f].rowIndex,this.indexTable[e][f].cellIndex))}catch(j){a(j)}},getPreviewCell:function(b,c){try{var d,e,f=this.getCellInfo(b),g=this.selectedTds.length,h=this.cellsRange;return!c&&(g?!h.beginColIndex:!f.colIndex)||c&&(g?h.endColIndex==this.colsNum-1:f.rowIndex>this.colsNum-1)?null:(d=c?g?h.beginRowIndex:f.rowIndex<1?0:f.rowIndex-1:g?h.beginRowIndex:f.rowIndex,e=c?g?h.endColIndex+1:f.colIndex:g?h.beginColIndex-1:f.colIndex<1?0:f.colIndex-1,this.getCell(this.indexTable[d][e].rowIndex,this.indexTable[d][e].cellIndex))}catch(i){a(i)}},moveContent:function(a,c){if(!b.isEmptyBlock(c)){if(b.isEmptyBlock(a))return void(a.innerHTML=c.innerHTML);var d=a.lastChild;for(3!=d.nodeType&&dtd.$block[d.tagName]||a.appendChild(a.ownerDocument.createElement("br"));d=c.firstChild;)a.appendChild(d)}},mergeRight:function(a){var b=this.getCellInfo(a),c=b.colIndex+b.colSpan,d=this.indexTable[b.rowIndex][c],e=this.getCell(d.rowIndex,d.cellIndex);a.colSpan=b.colSpan+d.colSpan,a.removeAttribute("width"),this.moveContent(a,e),this.deleteCell(e,d.rowIndex),this.update()},mergeDown:function(a){var b=this.getCellInfo(a),c=b.rowIndex+b.rowSpan,d=this.indexTable[c][b.colIndex],e=this.getCell(d.rowIndex,d.cellIndex);a.rowSpan=b.rowSpan+d.rowSpan,a.removeAttribute("height"),this.moveContent(a,e),this.deleteCell(e,d.rowIndex),this.update()},mergeRange:function(){var a=this.cellsRange,b=this.getCell(a.beginRowIndex,this.indexTable[a.beginRowIndex][a.beginColIndex].cellIndex);if("TH"==b.tagName&&a.endRowIndex!==a.beginRowIndex){var c=this.indexTable,d=this.getCellInfo(b);b=this.getCell(1,c[1][d.colIndex].cellIndex),a=this.getCellsRange(b,this.getCell(c[this.rowsNum-1][d.colIndex].rowIndex,c[this.rowsNum-1][d.colIndex].cellIndex))}for(var e,f=this.getCells(a),g=0;e=f[g++];)e!==b&&(this.moveContent(b,e),this.deleteCell(e));if(b.rowSpan=a.endRowIndex-a.beginRowIndex+1,b.rowSpan>1&&b.removeAttribute("height"),b.colSpan=a.endColIndex-a.beginColIndex+1,b.colSpan>1&&b.removeAttribute("width"),b.rowSpan==this.rowsNum&&1!=b.colSpan&&(b.colSpan=1),b.colSpan==this.colsNum&&1!=b.rowSpan){var h=b.parentNode.rowIndex;if(this.table.deleteRow)for(var g=h+1,i=h+1,j=b.rowSpan;g1&&g.rowIndex==a){var i=h.cloneNode(!0);i.rowSpan=h.rowSpan-1,i.innerHTML="",h.rowSpan=1;var j,k=a+1,l=this.table.rows[k],m=this.getPreviewMergedCellsNum(k,f)-e;m1?l.colSpan--:c[h].deleteCell(j.cellIndex),h+=j.rowSpan||1}}this.table.setAttribute("width",d-e),this.update()},splitToCells:function(a){var b=this,c=this.splitToRows(a);utils.each(c,function(a){b.splitToCols(a)})},splitToRows:function(a){var b=this.getCellInfo(a),c=b.rowIndex,d=b.colIndex,e=[];a.rowSpan=1,e.push(a);for(var f=c,g=c+b.rowSpan;f");for(var g=0;g'+(browser.ie&&browser.version<11?domUtils.fillChar:"
    ")+"");c.push("")}return"
    "+c.join("")+"
    "}b||(b=utils.extend({},{numCols:this.options.defaultCols,numRows:this.options.defaultRows,tdvalign:this.options.tdvalign}));var d=this,e=this.selection.getRange(),f=e.startContainer,h=domUtils.findParent(f,function(a){return domUtils.isBlockElm(a)},!0)||d.body,i=g(d),j=h.offsetWidth,k=Math.floor(j/b.numCols-2*i.tdPadding-i.tdBorder);!b.tdvalign&&(b.tdvalign=d.options.tdvalign),d.execCommand("inserthtml",c(b,k))}},UE.commands.insertparagraphbeforetable={queryCommandState:function(){return e(this).cell?0:-1},execCommand:function(){var a=e(this).table;if(a){var b=this.document.createElement("p");b.innerHTML=browser.ie?" ":"
    ",a.parentNode.insertBefore(b,a),this.selection.getRange().setStart(b,0).setCursor()}}},UE.commands.deletetable={queryCommandState:function(){var a=this.selection.getRange();return domUtils.findParentByTagName(a.startContainer,"table",!0)?0:-1},execCommand:function(a,b){var c=this.selection.getRange();if(b=b||domUtils.findParentByTagName(c.startContainer,"table",!0)){var d=b.nextSibling;d||(d=domUtils.createElement(this.document,"p",{innerHTML:browser.ie?domUtils.fillChar:"
    "}),b.parentNode.insertBefore(d,b)),domUtils.remove(b),c=this.selection.getRange(),3==d.nodeType?c.setStartBefore(d):c.setStart(d,0),c.setCursor(!1,!0),this.fireEvent("tablehasdeleted")}}},UE.commands.cellalign={queryCommandState:function(){return c(this).length?0:-1},execCommand:function(a,b){var d=c(this);if(d.length)for(var e,f=0;e=d[f++];)e.setAttribute("align",b)}},UE.commands.cellvalign={queryCommandState:function(){return c(this).length?0:-1},execCommand:function(a,b){var d=c(this);if(d.length)for(var e,f=0;e=d[f++];)e.setAttribute("vAlign",b)}},UE.commands.insertcaption={queryCommandState:function(){var a=e(this).table;return a&&0==a.getElementsByTagName("caption").length?1:-1},execCommand:function(){var a=e(this).table;if(a){var b=this.document.createElement("caption");b.innerHTML=browser.ie?domUtils.fillChar:"
    ",a.insertBefore(b,a.firstChild);var c=this.selection.getRange();c.setStart(b,0).setCursor()}}},UE.commands.deletecaption={queryCommandState:function(){var a=this.selection.getRange(),b=domUtils.findParentByTagName(a.startContainer,"table");return b?0==b.getElementsByTagName("caption").length?-1:1:-1},execCommand:function(){var a=this.selection.getRange(),b=domUtils.findParentByTagName(a.startContainer,"table");if(b){domUtils.remove(b.getElementsByTagName("caption")[0]);var c=this.selection.getRange();c.setStart(b.rows[0].cells[0],0).setCursor()}}},UE.commands.inserttitle={queryCommandState:function(){var a=e(this).table;if(a){var b=a.rows[0];return"th"!=b.cells[b.cells.length-1].tagName.toLowerCase()?0:-1}return-1},execCommand:function(){var a=e(this).table;a&&h(a).insertRow(0,"th");var b=a.getElementsByTagName("th")[0];this.selection.getRange().setStart(b,0).setCursor(!1,!0)}},UE.commands.deletetitle={queryCommandState:function(){var a=e(this).table;if(a){var b=a.rows[0];return"th"==b.cells[b.cells.length-1].tagName.toLowerCase()?0:-1}return-1},execCommand:function(){var a=e(this).table;a&&domUtils.remove(a.rows[0]);var b=a.getElementsByTagName("td")[0];this.selection.getRange().setStart(b,0).setCursor(!1,!0)}},UE.commands.inserttitlecol={queryCommandState:function(){var a=e(this).table;if(a){var b=a.rows[a.rows.length-1];return b.getElementsByTagName("th").length?-1:0}return-1},execCommand:function(b){var c=e(this).table;c&&h(c).insertCol(0,"th"),a(c,this);var d=c.getElementsByTagName("th")[0];this.selection.getRange().setStart(d,0).setCursor(!1,!0)}},UE.commands.deletetitlecol={queryCommandState:function(){var a=e(this).table;if(a){var b=a.rows[a.rows.length-1];return b.getElementsByTagName("th").length?0:-1}return-1},execCommand:function(){var b=e(this).table;if(b)for(var c=0;c=f.colsNum)return-1;var j=f.indexTable[g.rowIndex][i],k=c.rows[j.rowIndex].cells[j.cellIndex];return k&&d.tagName==k.tagName&&j.rowIndex==g.rowIndex&&j.rowSpan==g.rowSpan?0:-1},execCommand:function(a){var b=this.selection.getRange(),c=b.createBookmark(!0),d=e(this).cell,f=h(d);f.mergeRight(d),b.moveToBookmark(c).select()}},UE.commands.mergedown={queryCommandState:function(a){var b=e(this),c=b.table,d=b.cell;if(!c||!d)return-1;var f=h(c);if(f.selectedTds.length)return-1;var g=f.getCellInfo(d),i=g.rowIndex+g.rowSpan;if(i>=f.rowsNum)return-1;var j=f.indexTable[i][g.colIndex],k=c.rows[j.rowIndex].cells[j.cellIndex];return k&&d.tagName==k.tagName&&j.colIndex==g.colIndex&&j.colSpan==g.colSpan?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell,d=h(c);d.mergeDown(c),a.moveToBookmark(b).select()}},UE.commands.mergecells={queryCommandState:function(){return f(this)?0:-1},execCommand:function(){var a=f(this);if(a&&a.selectedTds.length){var b=a.selectedTds[0];a.mergeRange();var c=this.selection.getRange();domUtils.isEmptyBlock(b)?c.setStart(b,0).collapse(!0):c.selectNodeContents(b),c.select()}}},UE.commands.insertrow={queryCommandState:function(){var a=e(this),b=a.cell;return b&&("TD"==b.tagName||"TH"==b.tagName&&a.tr!==a.table.rows[0])&&h(a.table).rowsNum0?-1:b&&(b.colSpan>1||b.rowSpan>1)?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell,d=h(c);d.splitToCells(c),a.moveToBookmark(b).select()}},UE.commands.splittorows={queryCommandState:function(){var a=e(this),b=a.cell;if(!b)return-1;var c=h(a.table);return c.selectedTds.length>0?-1:b&&b.rowSpan>1?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell,d=h(c);d.splitToRows(c),a.moveToBookmark(b).select()}},UE.commands.splittocols={queryCommandState:function(){var a=e(this),b=a.cell;if(!b)return-1;var c=h(a.table);return c.selectedTds.length>0?-1:b&&b.colSpan>1?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell,d=h(c);d.splitToCols(c),a.moveToBookmark(b).select()}},UE.commands.adaptbytext=UE.commands.adaptbywindow={queryCommandState:function(){return e(this).table?0:-1},execCommand:function(b){var c=e(this),d=c.table;if(d)if("adaptbywindow"==b)a(d,this);else{var f=domUtils.getElementsByTagName(d,"td th");utils.each(f,function(a){a.removeAttribute("width")}),d.removeAttribute("width")}}},UE.commands.averagedistributecol={queryCommandState:function(){var a=f(this);return a&&(a.isFullRow()||a.isFullCol())?0:-1},execCommand:function(a){function b(){var a,b=e.table,c=0,f=0,h=g(d,b);if(e.isFullRow())c=b.offsetWidth,f=e.colsNum;else for(var i,j=e.cellsRange.beginColIndex,k=e.cellsRange.endColIndex,l=j;l<=k;)i=e.selectedTds[l],c+=i.offsetWidth,l+=i.colSpan,f+=1;return a=Math.ceil(c/f)-2*h.tdBorder-2*h.tdPadding}function c(a){utils.each(domUtils.getElementsByTagName(e.table,"th"),function(a){a.setAttribute("width","")});var b=e.isFullRow()?domUtils.getElementsByTagName(e.table,"td"):e.selectedTds;utils.each(b,function(b){1==b.colSpan&&b.setAttribute("width",a)})}var d=this,e=f(d);e&&e.selectedTds.length&&c(b())}},UE.commands.averagedistributerow={queryCommandState:function(){var a=f(this);return a?a.selectedTds&&/th/gi.test(a.selectedTds[0].tagName)?-1:a.isFullRow()||a.isFullCol()?0:-1:-1},execCommand:function(a){function b(){var a,b,c=0,f=e.table,h=g(d,f),i=parseInt(domUtils.getComputedStyle(f.getElementsByTagName("td")[0],"padding-top"));if(e.isFullCol()){var j,k,l=domUtils.getElementsByTagName(f,"caption"),m=domUtils.getElementsByTagName(f,"th");l.length>0&&(j=l[0].offsetHeight),m.length>0&&(k=m[0].offsetHeight),c=f.offsetHeight-(j||0)-(k||0),b=0==m.length?e.rowsNum:e.rowsNum-1}else{for(var n=e.cellsRange.beginRowIndex,o=e.cellsRange.endRowIndex,p=0,q=domUtils.getElementsByTagName(f,"tr"),r=n;r<=o;r++)c+=q[r].offsetHeight,p+=1;b=p}return a=browser.ie&&browser.version<9?Math.ceil(c/b):Math.ceil(c/b)-2*h.tdBorder-2*i}function c(a){var b=e.isFullCol()?domUtils.getElementsByTagName(e.table,"td"):e.selectedTds;utils.each(b,function(b){1==b.rowSpan&&b.setAttribute("height",a)})}var d=this,e=f(d);e&&e.selectedTds.length&&c(b())}},UE.commands.cellalignment={queryCommandState:function(){return e(this).table?0:-1},execCommand:function(a,b){var c=this,d=f(c);if(d)utils.each(d.selectedTds,function(a){domUtils.setAttributes(a,b)});else{var e=c.selection.getStart(),g=e&&domUtils.findParentByTagName(e,["td","th","caption"],!0);/caption/gi.test(g.tagName)?(g.style.textAlign=b.align,g.style.verticalAlign=b.vAlign):domUtils.setAttributes(g,b),c.selection.getRange().setCursor(!0)}},queryCommandValue:function(a){var b=e(this).cell;if(b||(b=c(this)[0]),b){var d=UE.UETable.getUETable(b).selectedTds;return!d.length&&(d=b),UE.UETable.getTableCellAlignState(d)}return null}},UE.commands.tablealignment={queryCommandState:function(){return browser.ie&&browser.version<8?-1:e(this).table?0:-1},execCommand:function(a,b){var c=this,d=c.selection.getStart(),e=d&&domUtils.findParentByTagName(d,["table"],!0);e&&e.setAttribute("align",b)}},UE.commands.edittable={queryCommandState:function(){return e(this).table?0:-1},execCommand:function(a,b){var c=this.selection.getRange(),d=domUtils.findParentByTagName(c.startContainer,"table");if(d){var e=domUtils.getElementsByTagName(d,"td").concat(domUtils.getElementsByTagName(d,"th"),domUtils.getElementsByTagName(d,"caption"));utils.each(e,function(a){a.style.borderColor=b})}}},UE.commands.edittd={queryCommandState:function(){return e(this).table?0:-1},execCommand:function(a,b){var c=this,d=f(c);if(d)utils.each(d.selectedTds,function(a){a.style.backgroundColor=b});else{var e=c.selection.getStart(),g=e&&domUtils.findParentByTagName(e,["td","th","caption"],!0);g&&(g.style.backgroundColor=b)}}},UE.commands.settablebackground={queryCommandState:function(){return c(this).length>1?0:-1},execCommand:function(a,b){var d,e;d=c(this),e=h(d[0]),e.setBackground(d,b)}},UE.commands.cleartablebackground={queryCommandState:function(){var a=c(this);if(!a.length)return-1;for(var b,d=0;b=a[d++];)if(""!==b.style.backgroundColor)return 0;return-1},execCommand:function(){var a=c(this),b=h(a[0]);b.removeBackground(a)}},UE.commands.interlacetable=UE.commands.uninterlacetable={queryCommandState:function(a){var b=e(this).table;if(!b)return-1;var c=b.getAttribute("interlaced");return"interlacetable"==a?"enabled"===c?-1:0:c&&"disabled"!==c?0:-1},execCommand:function(a,b){var c=e(this).table;"interlacetable"==a?(c.setAttribute("interlaced","enabled"),this.fireEvent("interlacetable",c,b)):(c.setAttribute("interlaced","disabled"),this.fireEvent("uninterlacetable",c))}},UE.commands.setbordervisible={queryCommandState:function(a){var b=e(this).table;return b?0:-1},execCommand:function(){var a=e(this).table;utils.each(domUtils.getElementsByTagName(a,"td"),function(a){a.style.borderWidth="1px",a.style.borderStyle="solid"})}}}(),UE.plugins.table=function(){function a(a){}function b(a,b){c(a,"width",!0),c(a,"height",!0)}function c(a,b,c){a.style[b]&&(c&&a.setAttribute(b,parseInt(a.style[b],10)),a.style[b]="")}function d(a){if("TD"==a.tagName||"TH"==a.tagName)return a;var b;return(b=domUtils.findParentByTagName(a,"td",!0)||domUtils.findParentByTagName(a,"th",!0))?b:null}function e(a){var b=new RegExp(domUtils.fillChar,"g");if(a[browser.ie?"innerText":"textContent"].replace(/^\s*$/,"").replace(b,"").length>0)return 0;for(var c in dtd.$isNotEmpty)if(a.getElementsByTagName(c).length)return 0;return 1}function f(a){return a.pageX||a.pageY?{x:a.pageX,y:a.pageY}:{x:a.clientX+N.document.body.scrollLeft-N.document.body.clientLeft,y:a.clientY+N.document.body.scrollTop-N.document.body.clientTop}}function g(b){if(!A())try{var c,e=d(b.target||b.srcElement);if(R&&(N.body.style.webkitUserSelect="none",(Math.abs(V.x-b.clientX)>T||Math.abs(V.y-b.clientY)>T)&&(t(),R=!1,U=0,v(b))),ca&&ha)return U=0,N.body.style.webkitUserSelect="none",N.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"](),c=f(b),m(N,!0,ca,c,e),void("h"==ca?ga.style.left=k(ha,b)+"px":"v"==ca&&(ga.style.top=l(ha,b)+"px"));if(e){if(N.fireEvent("excludetable",e)===!0)return;c=f(b);var g=n(e,c),i=domUtils.findParentByTagName(e,"table",!0);if(j(i,e,b,!0)){if(N.fireEvent("excludetable",i)===!0)return;N.body.style.cursor="url("+N.options.cursorpath+"h.png),pointer"}else if(j(i,e,b)){if(N.fireEvent("excludetable",i)===!0)return;N.body.style.cursor="url("+N.options.cursorpath+"v.png),pointer"}else{N.body.style.cursor="text";/\d/.test(g)&&(g=g.replace(/\d/,""),e=Y(e).getPreviewCell(e,"v"==g)),m(N,!!e&&!!g,e?g:"",c,e)}}else h(!1,i,N)}catch(o){a(o)}}function h(a,b,c){if(a)i(b,c);else{if(fa)return;la=setTimeout(function(){!fa&&ea&&ea.parentNode&&ea.parentNode.removeChild(ea)},2e3)}}function i(a,b){function c(c,d){clearTimeout(g),g=setTimeout(function(){b.fireEvent("tableClicked",a,d)},300)}function d(c){clearTimeout(g);var d=Y(a),e=a.rows[0].cells[0],f=d.getLastCell(),h=d.getCellsRange(e,f);b.selection.getRange().setStart(e,0).setCursor(!1,!0),d.setSelected(h)}var e=domUtils.getXY(a),f=a.ownerDocument;if(ea&&ea.parentNode)return ea;ea=f.createElement("div"),ea.contentEditable=!1,ea.innerHTML="",ea.style.cssText="width:15px;height:15px;background-image:url("+b.options.UEDITOR_HOME_URL+"dialogs/table/dragicon.png);position: absolute;cursor:move;top:"+(e.y-15)+"px;left:"+e.x+"px;",domUtils.unSelectable(ea),ea.onmouseover=function(a){fa=!0},ea.onmouseout=function(a){fa=!1},domUtils.on(ea,"click",function(a,b){c(b,this)}),domUtils.on(ea,"dblclick",function(a,b){d(b)}),domUtils.on(ea,"dragstart",function(a,b){domUtils.preventDefault(b)});var g;f.body.appendChild(ea)}function j(a,b,c,d){var e=f(c),g=n(b,e);if(d){var h=a.getElementsByTagName("caption")[0],i=h?h.offsetHeight:0;return"v1"==g&&e.y-domUtils.getXY(a).y-i<8}return"h1"==g&&e.x-domUtils.getXY(a).x<8}function k(a,b){var c=Y(a);if(c){var d=c.getSameEndPosCells(a,"x")[0],e=c.getSameStartPosXCells(a)[0],g=f(b).x,h=(d?domUtils.getXY(d).x:domUtils.getXY(c.table).x)+20,i=e?domUtils.getXY(e).x+e.offsetWidth-20:N.body.offsetWidth+5||parseInt(domUtils.getComputedStyle(N.body,"width"),10);return h+=Q,i-=Q,gi?i:g}}function l(b,c){try{var d=domUtils.getXY(b).y,e=f(c).y;return ek[c]?(a=!1,!1):void l.push(d)});var b=a?l:k;utils.each(i,function(a,c){a.width=b[c]-G()})},0)}}}}function q(a){if(_(domUtils.getElementsByTagName(N.body,"td th")),utils.each(N.document.getElementsByTagName("table"),function(a){a.ueTable=null}),aa=M(N,a)){var b=domUtils.findParentByTagName(aa,"table",!0);ut=Y(b),ut&&ut.clearSelected(),da?r(a):(N.document.body.style.webkitUserSelect="",ia=!0,N.addListener("mouseover",x))}}function r(a){browser.ie&&(a=u(a)),t(),R=!0,O=setTimeout(function(){v(a)},W)}function s(a,b){for(var c=[],d=null,e=0,f=a.length;e0&&U--},W),2===U))return U=0,void p(b);if(2!=b.button){var c=this,d=c.selection.getRange(),e=domUtils.findParentByTagName(d.startContainer,"table",!0),f=domUtils.findParentByTagName(d.endContainer,"table",!0);if((e||f)&&(e===f?(e=domUtils.findParentByTagName(d.startContainer,["td","th","caption"],!0),f=domUtils.findParentByTagName(d.endContainer,["td","th","caption"],!0),e!==f&&c.selection.clearRange()):c.selection.clearRange()),ia=!1,c.document.body.style.webkitUserSelect="",ca&&ha&&(c.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"](),U=0,ga=c.document.getElementById("ue_tableDragLine"))){var g=domUtils.getXY(ha),h=domUtils.getXY(ga);switch(ca){case"h":z(ha,h.x-g.x);break;case"v":B(ha,h.y-g.y-ha.offsetHeight)}return ca="",ha=null,I(c),void c.fireEvent("saveScene")}if(aa){var i=Y(aa),j=i?i.selectedTds[0]:null;if(j)d=new dom.Range(c.document),domUtils.isEmptyBlock(j)?d.setStart(j,0).setCursor(!1,!0):d.selectNodeContents(j).shrinkBoundary().setCursor(!1,!0);else if(d=c.selection.getRange().shrinkBoundary(),!d.collapsed){var e=domUtils.findParentByTagName(d.startContainer,["td","th"],!0),f=domUtils.findParentByTagName(d.endContainer,["td","th"],!0);(e&&!f||!e&&f||e&&f&&e!==f)&&d.setCursor(!1,!0)}aa=null,c.removeListener("mouseover",x)}else{var k=domUtils.findParentByTagName(b.target||b.srcElement,"td",!0);if(k||(k=domUtils.findParentByTagName(b.target||b.srcElement,"th",!0)),k&&("TD"==k.tagName||"TH"==k.tagName)){if(c.fireEvent("excludetable",k)===!0)return;d=new dom.Range(c.document),d.setStart(k,0).setCursor(!1,!0)}}c._selectionChange(250,b)}}}function x(a,b){if(!A()){var c=this,d=b.target||b.srcElement;if(ba=domUtils.findParentByTagName(d,"td",!0)||domUtils.findParentByTagName(d,"th",!0),aa&&ba&&("TD"==aa.tagName&&"TD"==ba.tagName||"TH"==aa.tagName&&"TH"==ba.tagName)&&domUtils.findParentByTagName(aa,"table")==domUtils.findParentByTagName(ba,"table")){var e=Y(ba);if(aa!=ba){c.document.body.style.webkitUserSelect="none",c.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"]();var f=e.getCellsRange(aa,ba);e.setSelected(f)}else c.document.body.style.webkitUserSelect="",e.clearSelected()}b.preventDefault?b.preventDefault():b.returnValue=!1}}function y(a,b,c){var d=parseInt(domUtils.getComputedStyle(a,"line-height"),10),e=c+b;b=ef?(c&&g.push({left:a}),!1):void 0})}),g}function D(a,b,c){if(a-=G(),a<0)return 0;a-=E(b);var d=a<0?"left":"right";return a=Math.abs(a),utils.each(c,function(b){var c=b[d];c&&(a=Math.min(a,E(c)-Q))}),a=a<0?0:a,"left"===d?-a:a}function E(a){var b=0,b=a.offsetWidth-G();a.nextSibling||(b-=F(a)),b=b<0?0:b;try{a.width=b}catch(c){}return b}function F(a){if(tab=domUtils.findParentByTagName(a,"table",!1),void 0===tab.offsetVal){var b=a.previousSibling;b?tab.offsetVal=a.offsetWidth-b.offsetWidth===X.borderWidth?X.borderWidth:0:tab.offsetVal=0}return tab.offsetVal}function G(){if(void 0===X.tabcellSpace){var a=N.document.createElement("table"),b=N.document.createElement("tbody"),c=N.document.createElement("tr"),d=N.document.createElement("td"),e=null;d.style.cssText="border: 0;",d.width=1,c.appendChild(d),c.appendChild(e=d.cloneNode(!1)),b.appendChild(c),a.appendChild(b),a.style.cssText="visibility: hidden;",N.body.appendChild(a),X.paddingSpace=d.offsetWidth-1;var f=a.offsetWidth;d.style.cssText="",e.style.cssText="",X.borderWidth=(a.offsetWidth-f)/3,X.tabcellSpace=X.paddingSpace+X.borderWidth,N.body.removeChild(a)}return G=function(){return X.tabcellSpace},X.tabcellSpace}function H(a,b){ia||(ga=a.document.createElement("div"),domUtils.setAttributes(ga,{id:"ue_tableDragLine",unselectable:"on",contenteditable:!1,onresizestart:"return false",ondragstart:"return false",onselectstart:"return false",style:"background-color:blue;position:absolute;padding:0;margin:0;background-image:none;border:0px none;opacity:0;filter:alpha(opacity=0)"}),a.body.appendChild(ga))}function I(a){if(!ia)for(var b;b=a.document.getElementById("ue_tableDragLine");)domUtils.remove(b)}function J(a,b){if(b){var c,d=domUtils.findParentByTagName(b,"table"),e=d.getElementsByTagName("caption"),f=d.offsetWidth,g=d.offsetHeight-(e.length>0?e[0].offsetHeight:0),h=domUtils.getXY(d),i=domUtils.getXY(b);switch(a){case"h":c="height:"+g+"px;top:"+(h.y+(e.length>0?e[0].offsetHeight:0))+"px;left:"+(i.x+b.offsetWidth),ga.style.cssText=c+"px;position: absolute;display:block;background-color:blue;width:1px;border:0; color:blue;opacity:.3;filter:alpha(opacity=30)";break;case"v":c="width:"+f+"px;left:"+h.x+"px;top:"+(i.y+b.offsetHeight),ga.style.cssText=c+"px;overflow:hidden;position: absolute;display:block;background-color:blue;height:1px;border:0;color:blue;opacity:.2;filter:alpha(opacity=20)"}}}function K(a,b){for(var c,d,e=domUtils.getElementsByTagName(a.body,"table"),f=0;d=e[f++];){var g=domUtils.getElementsByTagName(d,"td");g[0]&&(b?(c=g[0].style.borderColor.replace(/\s/g,""),/(#ffffff)|(rgb\(255,255,255\))/gi.test(c)&&domUtils.addClass(d,"noBorderTable")):domUtils.removeClasses(d,"noBorderTable"))}}function L(a,b,c){var d=a.body;return d.offsetWidth-(b?2*parseInt(domUtils.getComputedStyle(d,"margin-left"),10):0)-2*c.tableBorder-(a.options.offsetWidth||0)}function M(a,b){var c=domUtils.findParentByTagName(b.target||b.srcElement,["td","th"],!0),d=null;if(!c)return null;if(d=n(c,f(b)),!c)return null;if("h1"===d&&c.previousSibling){var e=domUtils.getXY(c),g=c.offsetWidth;Math.abs(e.x+g-b.clientX)>g/3&&(c=c.previousSibling)}else if("v1"===d&&c.parentNode.previousSibling){var e=domUtils.getXY(c),h=c.offsetHeight;Math.abs(e.y+h-b.clientY)>h/3&&(c=c.parentNode.previousSibling.firstChild)}return c&&a.fireEvent("excludetable",c)!==!0?c:null}var N=this,O=null,P=null,Q=5,R=!1,S=5,T=10,U=0,V=null,W=360,X=UE.UETable,Y=function(a){return X.getUETable(a)},Z=function(a){return X.getUETableBySelected(a)},$=function(a,b){return X.getDefaultValue(a,b)},_=function(a){return X.removeSelectedClass(a)};N.ready(function(){var a=this,b=a.selection.getText;a.selection.getText=function(){var c=Z(a);if(c){var d="";return utils.each(c.selectedTds,function(a){d+=a[browser.ie?"innerText":"textContent"]}),d}return b.call(a.selection)}});var aa=null,ba=null,ca="",da=!1,ea=null,fa=!1,ga=null,ha=null,ia=!1,ja=!0;N.setOpt({maxColNum:20,maxRowNum:100,defaultCols:5,defaultRows:5,tdvalign:"top",cursorpath:N.options.UEDITOR_HOME_URL+"themes/default/images/cursor_",tableDragable:!1,classList:["ue-table-interlace-color-single","ue-table-interlace-color-double"]}),N.getUETable=Y;var ka={deletetable:1,inserttable:1,cellvalign:1,insertcaption:1,deletecaption:1,inserttitle:1,deletetitle:1,mergeright:1,mergedown:1,mergecells:1,insertrow:1,insertrownext:1,deleterow:1,insertcol:1,insertcolnext:1,deletecol:1,splittocells:1,splittorows:1,splittocols:1,adaptbytext:1,adaptbywindow:1,adaptbycustomer:1,insertparagraph:1,insertparagraphbeforetable:1,averagedistributecol:1,averagedistributerow:1};N.ready(function(){utils.cssRule("table",".selectTdClass{background-color:#edf5fa !important}table.noBorderTable td,table.noBorderTable th,table.noBorderTable caption{border:1px dashed #ddd !important}table{margin-bottom:10px;border-collapse:collapse;display:table;}td,th{padding: 5px 10px;border: 1px solid #DDD;}caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}th{border-top:1px solid #BBB;background-color:#F7F7F7;}table tr.firstRow th{border-top-width:2px;}.ue-table-interlace-color-single{ background-color: #fcfcfc; } .ue-table-interlace-color-double{ background-color: #f7faff; }td p{margin:0;padding:0;}",N.document);var a,c,f;N.addListener("keydown",function(b,d){var g=this,h=d.keyCode||d.which;if(8==h){var i=Z(g);i&&i.selectedTds.length&&(i.isFullCol()?g.execCommand("deletecol"):i.isFullRow()?g.execCommand("deleterow"):g.fireEvent("delcells"),domUtils.preventDefault(d));var j=domUtils.findParentByTagName(g.selection.getStart(),"caption",!0),k=g.selection.getRange();if(k.collapsed&&j&&e(j)){g.fireEvent("saveScene");var l=j.parentNode;domUtils.remove(j),l&&k.setStart(l.rows[0].cells[0],0).setCursor(!1,!0),g.fireEvent("saveScene")}}if(46==h&&(i=Z(g))){g.fireEvent("saveScene");for(var m,n=0;m=i.selectedTds[n++];)domUtils.fillNode(g.document,m);g.fireEvent("saveScene"),domUtils.preventDefault(d)}if(13==h){var o=g.selection.getRange(),j=domUtils.findParentByTagName(o.startContainer,"caption",!0);if(j){var l=domUtils.findParentByTagName(j,"table");return o.collapsed?j&&o.setStart(l.rows[0].cells[0],0).setCursor(!1,!0):(o.deleteContents(),g.fireEvent("saveScene")),void domUtils.preventDefault(d)}if(o.collapsed){var l=domUtils.findParentByTagName(o.startContainer,"table");if(l){var p=l.rows[0].cells[0],q=domUtils.findParentByTagName(g.selection.getStart(),["td","th"],!0),r=l.previousSibling;if(p===q&&(!r||1==r.nodeType&&"TABLE"==r.tagName)&&domUtils.isStartInblock(o)){var s=domUtils.findParent(g.selection.getStart(),function(a){return domUtils.isBlockElm(a)},!0);s&&(/t(h|d)/i.test(s.tagName)||s===q.firstChild)&&(g.execCommand("insertparagraphbeforetable"),domUtils.preventDefault(d))}}}}if((d.ctrlKey||d.metaKey)&&"67"==d.keyCode){a=null;var i=Z(g);if(i){var t=i.selectedTds;c=i.isFullCol(),f=i.isFullRow(),a=[[i.cloneCell(t[0],null,!0)]];for(var m,n=1;m=t[n];n++)m.parentNode!==t[n-1].parentNode?a.push([i.cloneCell(m,null,!0)]):a[a.length-1].push(i.cloneCell(m,null,!0))}}}),N.addListener("tablehasdeleted",function(){m(this,!1,"",null),ea&&domUtils.remove(ea)}),N.addListener("beforepaste",function(d,g){var h=this,i=h.selection.getRange();if(domUtils.findParentByTagName(i.startContainer,"caption",!0)){var j=h.document.createElement("div");return j.innerHTML=g.html,void(g.html=j[browser.ie9below?"innerText":"textContent"])}var k=Z(h);if(a){h.fireEvent("saveScene");var l,m,i=h.selection.getRange(),n=domUtils.findParentByTagName(i.startContainer,["td","th"],!0);if(n){var o=Y(n);if(f){var p=o.getCellInfo(n).rowIndex;"TH"==n.tagName&&p++;for(var q,r=0;q=a[r++];){for(var s,t=o.insertRow(p++,"td"),u=0;s=q[u];u++){var v=t.cells[u];v||(v=t.insertCell(u)),v.innerHTML=s.innerHTML,s.getAttribute("width")&&v.setAttribute("width",s.getAttribute("width")),s.getAttribute("vAlign")&&v.setAttribute("vAlign",s.getAttribute("vAlign")),s.getAttribute("align")&&v.setAttribute("align",s.getAttribute("align")),s.style.cssText&&(v.style.cssText=s.style.cssText)}for(var s,u=0;(s=t.cells[u])&&q[u];u++)s.innerHTML=q[u].innerHTML,q[u].getAttribute("width")&&s.setAttribute("width",q[u].getAttribute("width")),q[u].getAttribute("vAlign")&&s.setAttribute("vAlign",q[u].getAttribute("vAlign")),q[u].getAttribute("align")&&s.setAttribute("align",q[u].getAttribute("align")),q[u].style.cssText&&(s.style.cssText=q[u].style.cssText)}}else{if(c){y=o.getCellInfo(n);for(var s,w=0,u=0,q=a[0];s=q[u++];)w+=s.colSpan||1;for(h.__hasEnterExecCommand=!0,r=0;r1&&(x.rowSpan=1)}var z=$(h),A=h.body.offsetWidth-(ja?2*parseInt(domUtils.getComputedStyle(h.body,"margin-left"),10):0)-2*z.tableBorder-(h.options.offsetWidth||0);h.execCommand("insertHTML",""+k.innerHTML.replace(/>\s*<").replace(/\bth\b/gi,"td")+"
    ")}return h.fireEvent("contentchange"),h.fireEvent("saveScene"),g.html="",!0}var B,j=h.document.createElement("div");j.innerHTML=g.html,B=j.getElementsByTagName("table"),domUtils.findParentByTagName(h.selection.getStart(),"table")?(utils.each(B,function(a){domUtils.remove(a)}),domUtils.findParentByTagName(h.selection.getStart(),"caption",!0)&&(j.innerHTML=j[browser.ie?"innerText":"textContent"])):utils.each(B,function(a){b(a,!0),domUtils.removeAttributes(a,["style","border"]),utils.each(domUtils.getElementsByTagName(a,"td"),function(a){e(a)&&domUtils.fillNode(h.document,a),b(a,!0)})}),g.html=j.innerHTML}),N.addListener("afterpaste",function(){utils.each(domUtils.getElementsByTagName(N.body,"table"),function(a){if(a.offsetWidth>N.body.offsetWidth){var b=$(N,a);a.style.width=N.body.offsetWidth-(ja?2*parseInt(domUtils.getComputedStyle(N.body,"margin-left"),10):0)-2*b.tableBorder-(N.options.offsetWidth||0)+"px"}})}),N.addListener("blur",function(){a=null});var i;N.addListener("keydown",function(){clearTimeout(i),i=setTimeout(function(){var a=N.selection.getRange(),b=domUtils.findParentByTagName(a.startContainer,["th","td"],!0);if(b){var c=b.parentNode.parentNode.parentNode;c.offsetWidth>c.getAttribute("width")&&(b.style.wordBreak="break-all")}},100)}),N.addListener("selectionchange",function(){m(N,!1,"",null)}),N.addListener("contentchange",function(){var a=this;if(I(a),!Z(a)){var b=a.selection.getRange(),c=b.startContainer;c=domUtils.findParentByTagName(c,["td","th"],!0),utils.each(domUtils.getElementsByTagName(a.document,"table"),function(b){a.fireEvent("excludetable",b)!==!0&&(b.ueTable=new X(b),b.onmouseover=function(){a.fireEvent("tablemouseover",b)},b.onmousemove=function(){a.fireEvent("tablemousemove",b),a.options.tableDragable&&h(!0,this,a),utils.defer(function(){a.fireEvent("contentchange",50)},!0)},b.onmouseout=function(){a.fireEvent("tablemouseout",b),m(a,!1,"",null),I(a)},b.onclick=function(b){b=a.window.event||b;var c=d(b.target||b.srcElement);if(c){var e,f=Y(c),g=f.table,h=f.getCellInfo(c),i=a.selection.getRange();if(j(g,c,b,!0)){var k=f.getCell(f.indexTable[f.rowsNum-1][h.colIndex].rowIndex,f.indexTable[f.rowsNum-1][h.colIndex].cellIndex);return void(b.shiftKey&&f.selectedTds.length?f.selectedTds[0]!==k?(e=f.getCellsRange(f.selectedTds[0],k),f.setSelected(e)):i&&i.selectNodeContents(k).select():c!==k?(e=f.getCellsRange(c,k),f.setSelected(e)):i&&i.selectNodeContents(k).select())}if(j(g,c,b)){var l=f.getCell(f.indexTable[h.rowIndex][f.colsNum-1].rowIndex,f.indexTable[h.rowIndex][f.colsNum-1].cellIndex);b.shiftKey&&f.selectedTds.length?f.selectedTds[0]!==l?(e=f.getCellsRange(f.selectedTds[0],l),f.setSelected(e)):i&&i.selectNodeContents(l).select():c!==l?(e=f.getCellsRange(c,l),f.setSelected(e)):i&&i.selectNodeContents(l).select()}}})}),K(a,!0)}}),domUtils.on(N.document,"mousemove",g),domUtils.on(N.document,"mouseout",function(a){var b=a.target||a.srcElement;"TABLE"==b.tagName&&m(N,!1,"",null)}),N.addListener("interlacetable",function(a,b,c){if(b)for(var d=this,e=b.rows,f=e.length,g=function(a,b,c){return a[b]?a[b]:c?a[b%a.length]:""},h=0;h1?k:f.getCellInfo(d).rowIndex;var g=f.getTabNextCell(d,k);g?e(g)?a.setStart(g,0).setCursor(!1,!0):a.selectNodeContents(g).select():(N.fireEvent("saveScene"),N.__hasEnterExecCommand=!0,this.execCommand("insertrownext"),N.__hasEnterExecCommand=!1,a=this.selection.getRange(),a.setStart(c.rows[c.rows.length-1].cells[0],0).setCursor(),N.fireEvent("saveScene"))}return!0}}),browser.ie&&N.addListener("selectionchange",function(){m(this,!1,"",null)}),N.addListener("keydown",function(a,b){var c=this,d=b.keyCode||b.which;if(8!=d&&46!=d){var e=!(b.ctrlKey||b.metaKey||b.shiftKey||b.altKey);e&&_(domUtils.getElementsByTagName(c.body,"td"));var f=Z(c);f&&e&&f.clearSelected()}}),N.addListener("beforegetcontent",function(){K(this,!1),browser.ie&&utils.each(this.document.getElementsByTagName("caption"),function(a){domUtils.isEmptyNode(a)&&(a.innerHTML=" ")})}),N.addListener("aftergetcontent",function(){K(this,!0)}),N.addListener("getAllHtml",function(){_(N.document.getElementsByTagName("td"))}),N.addListener("fullscreenchanged",function(a,b){if(!b){var c=this.body.offsetWidth/document.body.offsetWidth,d=domUtils.getElementsByTagName(this.body,"table");utils.each(d,function(a){if(a.offsetWidth1||c[e].getAttribute("rowspan")>1)return-1;return b?"enablesort"==a^"sortEnabled"!=b.getAttribute("data-sort")?-1:0:-1},execCommand:function(a){var b=d(this).table;b.setAttribute("data-sort","enablesort"==a?"sortEnabled":"sortDisabled"),"enablesort"==a?domUtils.addClass(b,"sortEnabled"):domUtils.removeClasses(b,"sortEnabled")}}},UE.plugins.contextmenu=function(){var a=this;if(a.setOpt("enableContextMenu",!0),a.getOpt("enableContextMenu")!==!1){var b,c=a.getLang("contextMenu"),d=a.options.contextMenu||[{label:c.selectall,cmdName:"selectall"},{label:c.cleardoc,cmdName:"cleardoc",exec:function(){confirm(c.confirmclear)&&this.execCommand("cleardoc")}},"-",{label:c.unlink,cmdName:"unlink"},"-",{group:c.paragraph,icon:"justifyjustify",subMenu:[{label:c.justifyleft,cmdName:"justify",value:"left"},{label:c.justifyright,cmdName:"justify",value:"right"},{label:c.justifycenter,cmdName:"justify",value:"center"},{label:c.justifyjustify,cmdName:"justify",value:"justify"}]},"-",{group:c.table,icon:"table",subMenu:[{label:c.inserttable,cmdName:"inserttable"},{label:c.deletetable,cmdName:"deletetable"},"-",{label:c.deleterow,cmdName:"deleterow"},{label:c.deletecol,cmdName:"deletecol"},{label:c.insertcol,cmdName:"insertcol"},{label:c.insertcolnext,cmdName:"insertcolnext"},{label:c.insertrow,cmdName:"insertrow"},{label:c.insertrownext,cmdName:"insertrownext"},"-",{label:c.insertcaption,cmdName:"insertcaption"},{label:c.deletecaption,cmdName:"deletecaption"},{label:c.inserttitle,cmdName:"inserttitle"},{label:c.deletetitle,cmdName:"deletetitle"},{label:c.inserttitlecol,cmdName:"inserttitlecol"},{label:c.deletetitlecol,cmdName:"deletetitlecol"},"-",{label:c.mergecells,cmdName:"mergecells"},{label:c.mergeright,cmdName:"mergeright"},{label:c.mergedown,cmdName:"mergedown"},"-",{label:c.splittorows,cmdName:"splittorows"},{label:c.splittocols,cmdName:"splittocols"},{label:c.splittocells,cmdName:"splittocells"},"-",{label:c.averageDiseRow,cmdName:"averagedistributerow"},{label:c.averageDisCol,cmdName:"averagedistributecol"},"-",{label:c.edittd,cmdName:"edittd",exec:function(){UE.ui.edittd&&new UE.ui.edittd(this),this.getDialog("edittd").open()}},{label:c.edittable,cmdName:"edittable",exec:function(){UE.ui.edittable&&new UE.ui.edittable(this),this.getDialog("edittable").open()}},{label:c.setbordervisible,cmdName:"setbordervisible"}]},{group:c.tablesort,icon:"tablesort",subMenu:[{label:c.enablesort,cmdName:"enablesort"},{label:c.disablesort,cmdName:"disablesort"},"-",{label:c.reversecurrent,cmdName:"sorttable",value:"reversecurrent"},{label:c.orderbyasc,cmdName:"sorttable",value:"orderbyasc"},{label:c.reversebyasc,cmdName:"sorttable",value:"reversebyasc"},{label:c.orderbynum,cmdName:"sorttable",value:"orderbynum"},{label:c.reversebynum,cmdName:"sorttable",value:"reversebynum"}]},{group:c.borderbk,icon:"borderBack",subMenu:[{label:c.setcolor,cmdName:"interlacetable",exec:function(){this.execCommand("interlacetable")}},{label:c.unsetcolor,cmdName:"uninterlacetable",exec:function(){this.execCommand("uninterlacetable")}},{label:c.setbackground,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#bbb","#ccc"]})}},{label:c.unsetbackground,cmdName:"cleartablebackground",exec:function(){this.execCommand("cleartablebackground")}},{label:c.redandblue,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["red","blue"]})}},{label:c.threecolorgradient,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#aaa","#bbb","#ccc"]})}}]},{group:c.aligntd,icon:"aligntd",subMenu:[{cmdName:"cellalignment",value:{align:"left",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"bottom"}}]},{group:c.aligntable,icon:"aligntable",subMenu:[{cmdName:"tablealignment",className:"left",label:c.tableleft,value:"left"},{cmdName:"tablealignment",className:"center",label:c.tablecenter,value:"center"},{cmdName:"tablealignment",className:"right",label:c.tableright,value:"right"}]},"-",{label:c.insertparagraphbefore,cmdName:"insertparagraph",value:!0},{label:c.insertparagraphafter,cmdName:"insertparagraph"},{label:c.copy,cmdName:"copy"},{label:c.paste,cmdName:"paste"}];if(d.length){var e=UE.ui.uiUtils;a.addListener("contextmenu",function(f,g){var h=e.getViewportOffsetByEvent(g);a.fireEvent("beforeselectionchange"),b&&b.destroy();for(var i,j=0,k=[];i=d[j];j++){var l;!function(b){function d(){switch(b.icon){case"table":return a.getLang("contextMenu.table");case"justifyjustify":return a.getLang("contextMenu.paragraph");case"aligntd":return a.getLang("contextMenu.aligntd");case"aligntable":return a.getLang("contextMenu.aligntable");case"tablesort":return c.tablesort;case"borderBack":return c.borderbk;default:return""}}if("-"==b)(l=k[k.length-1])&&"-"!==l&&k.push("-");else if(b.hasOwnProperty("group")){for(var e,f=0,g=[];e=b.subMenu[f];f++)!function(b){"-"==b?(l=g[g.length-1])&&"-"!==l?g.push("-"):g.splice(g.length-1):(a.commands[b.cmdName]||UE.commands[b.cmdName]||b.query)&&(b.query?b.query():a.queryCommandState(b.cmdName))>-1&&g.push({label:b.label||a.getLang("contextMenu."+b.cmdName+(b.value||""))||"",className:"edui-for-"+b.cmdName+(b.className?" edui-for-"+b.cmdName+"-"+b.className:""),onclick:b.exec?function(){b.exec.call(a)}:function(){a.execCommand(b.cmdName,b.value)}})}(e);g.length&&k.push({label:d(),className:"edui-for-"+b.icon,subMenu:{items:g,editor:a}})}else(a.commands[b.cmdName]||UE.commands[b.cmdName]||b.query)&&(b.query?b.query.call(a):a.queryCommandState(b.cmdName))>-1&&k.push({label:b.label||a.getLang("contextMenu."+b.cmdName),className:"edui-for-"+(b.icon?b.icon:b.cmdName+(b.value||"")),onclick:b.exec?function(){b.exec.call(a)}:function(){a.execCommand(b.cmdName,b.value)}})}(i)}if("-"==k[k.length-1]&&k.pop(),b=new UE.ui.Menu({items:k,className:"edui-contextmenu",editor:a}),b.render(),b.showAt(h),a.fireEvent("aftershowcontextmenu",b),domUtils.preventDefault(g),browser.ie){var m;try{m=a.selection.getNative().createRange()}catch(n){return}if(m.item){var o=new dom.Range(a.document);o.selectNode(m.item(0)).select(!0,!0)}}}),a.addListener("aftershowcontextmenu",function(b,c){if(a.zeroclipboard){var d=c.items;for(var e in d)"edui-for-copy"==d[e].className&&a.zeroclipboard.clip(d[e].getDom())}})}}},UE.plugins.shortcutmenu=function(){var a,b=this,c=b.options.shortcutMenu||[];c.length&&(b.addListener("contextmenu mouseup",function(b,d){var e=this,f={type:b,target:d.target||d.srcElement,screenX:d.screenX,screenY:d.screenY,clientX:d.clientX,clientY:d.clientY};if(setTimeout(function(){var d=e.selection.getRange();d.collapsed!==!1&&"contextmenu"!=b||(a||(a=new baidu.editor.ui.ShortCutMenu({editor:e,items:c,theme:e.options.theme,className:"edui-shortcutmenu"}),a.render(),e.fireEvent("afterrendershortcutmenu",a)),a.show(f,!!UE.plugins.contextmenu))}),"contextmenu"==b&&(domUtils.preventDefault(d),browser.ie9below)){var g;try{g=e.selection.getNative().createRange()}catch(d){return}if(g.item){var h=new dom.Range(e.document);h.selectNode(g.item(0)).select(!0,!0)}}}),b.addListener("keydown",function(b){"keydown"==b&&a&&!a.isHidden&&a.hide()}))},UE.plugins.basestyle=function(){var a={bold:["strong","b"],italic:["em","i"],subscript:["sub"],superscript:["sup"]},b=function(a,b){return domUtils.filterNodeList(a.selection.getStartElementPath(),b)},c=this;c.addshortcutkey({Bold:"ctrl+66",Italic:"ctrl+73",Underline:"ctrl+85"}),c.addInputRule(function(a){utils.each(a.getNodesByTagName("b i"),function(a){switch(a.tagName){case"b":a.tagName="strong";break;case"i":a.tagName="em"}})});for(var d in a)!function(a,d){c.commands[a]={execCommand:function(a){var e=c.selection.getRange(),f=b(this,d);if(e.collapsed){if(f){var g=c.document.createTextNode("");e.insertNode(g).removeInlineStyle(d),e.setStartBefore(g),domUtils.remove(g)}else{var h=e.document.createElement(d[0]);"superscript"!=a&&"subscript"!=a||(g=c.document.createTextNode(""),e.insertNode(g).removeInlineStyle(["sub","sup"]).setStartBefore(g).collapse(!0)),e.insertNode(h).setStart(h,0)}e.collapse(!0)}else"superscript"!=a&&"subscript"!=a||f&&f.tagName.toLowerCase()==a||e.removeInlineStyle(["sub","sup"]),f?e.removeInlineStyle(d):e.applyInlineStyle(d[0]);e.select()},queryCommandState:function(){return b(this,d)?1:0}}}(d,a[d])},UE.plugins.elementpath=function(){var a,b,c=this;c.setOpt("elementPathEnabled",!0),c.options.elementPathEnabled&&(c.commands.elementpath={execCommand:function(d,e){var f=b[e],g=c.selection.getRange();a=1*e,g.selectNode(f).select()},queryCommandValue:function(){var c=[].concat(this.selection.getStartElementPath()).reverse(),d=[];b=c;for(var e,f=0;e=c[f];f++)if(3!=e.nodeType){var g=e.tagName.toLowerCase();if("img"==g&&e.getAttribute("anchorname")&&(g="anchor"),d[f]=g,a==f){a=-1;break}}return d}})},UE.plugins.formatmatch=function(){function a(f,g){function h(a){return m&&a.selectNode(m),a.applyInlineStyle(d[d.length-1].tagName,null,d)}if(browser.webkit)var i="IMG"==g.target.tagName?g.target:null;c.undoManger&&c.undoManger.save();var j=c.selection.getRange(),k=i||j.getClosedNode();if(b&&k&&"IMG"==k.tagName)k.style.cssText+=";float:"+(b.style.cssFloat||b.style.styleFloat||"none")+";display:"+(b.style.display||"inline"),b=null;else if(!b){var l=j.collapsed;if(l){var m=c.document.createTextNode("match");j.insertNode(m).select()}c.__hasEnterExecCommand=!0;var n=c.options.removeFormatAttributes;c.options.removeFormatAttributes="",c.execCommand("removeformat"),c.options.removeFormatAttributes=n,c.__hasEnterExecCommand=!1,j=c.selection.getRange(),d.length&&h(j),m&&j.setStartBefore(m).collapse(!0),j.select(),m&&domUtils.remove(m)}c.undoManger&&c.undoManger.save(),c.removeListener("mouseup",a),e=0}var b,c=this,d=[],e=0;c.addListener("reset",function(){d=[],e=0}),c.commands.formatmatch={execCommand:function(f){if(e)return e=0,d=[],void c.removeListener("mouseup",a);var g=c.selection.getRange();if(b=g.getClosedNode(),!b||"IMG"!=b.tagName){g.collapse(!0).shrinkBoundary();var h=g.startContainer;d=domUtils.findParents(h,!0,function(a){return!domUtils.isBlockElm(a)&&1==a.nodeType});for(var i,j=0;i=d[j];j++)if("A"==i.tagName){d.splice(j,1);break}}c.addListener("mouseup",a),e=1},queryCommandState:function(){return e},notNeedUndo:1}},UE.plugin.register("searchreplace",function(){function a(a,b,c){var d=b.searchStr;b.dir==-1&&(a=a.split("").reverse().join(""),d=d.split("").reverse().join(""),c=a.length-c);for(var e,f=new RegExp(d,"g"+(b.casesensitive?"":"i"));e=f.exec(a);)if(e.index>=c)return b.dir==-1?a.length-e.index-b.searchStr.length:e.index;return-1}function b(b,c,d){var e,f,h=d.all||1==d.dir?"getNextDomNode":"getPreDomNode";domUtils.isBody(b)&&(b=b.firstChild);for(var i=1;b;){if(e=3==b.nodeType?b.nodeValue:b[browser.ie?"innerText":"textContent"],f=a(e,d,c),i=0,f!=-1)return{node:b,index:f};for(b=domUtils[h](b);b&&g[b.nodeName.toLowerCase()];)b=domUtils[h](b,!0);b&&(c=d.dir==-1?(3==b.nodeType?b.nodeValue:b[browser.ie?"innerText":"textContent"]).length:0)}}function c(a,b,d){for(var e,f=0,g=a.firstChild,h=0;g;){if(3==g.nodeType){if(h=g.nodeValue.replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,"").length,f+=h,f>=b)return{node:g,index:h-(f-b)}}else if(!dtd.$empty[g.tagName]&&(h=g[browser.ie?"innerText":"textContent"].replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,"").length,f+=h,f>=b&&(e=c(g,h-(f-b),d))))return e;g=domUtils.getNextDomNode(g)}}function d(a,d){var f,g=a.selection.getRange(),h=d.searchStr,i=a.document.createElement("span");if(i.innerHTML="$$ueditor_searchreplace_key$$",g.shrinkBoundary(!0),!g.collapsed){g.select();var j=a.selection.getText();if(new RegExp("^"+d.searchStr+"$",d.casesensitive?"":"i").test(j)){if(void 0!=d.replaceStr)return e(g,d.replaceStr),g.select(),!0;g.collapse(d.dir==-1)}}g.insertNode(i),g.enlargeToBlockElm(!0),f=g.startContainer;var k=f[browser.ie?"innerText":"textContent"].indexOf("$$ueditor_searchreplace_key$$");g.setStartBefore(i),domUtils.remove(i);var l=b(f,k,d);if(l){var m=c(l.node,l.index,h),n=c(l.node,l.index+h.length,h);return g.setStart(m.node,m.index).setEnd(n.node,n.index),void 0!==d.replaceStr&&e(g,d.replaceStr),g.select(),!0}g.setCursor()}function e(a,b){b=f.document.createTextNode(b),a.deleteContents().insertNode(b)}var f=this,g={table:1,tbody:1,tr:1,ol:1,ul:1};return{commands:{searchreplace:{execCommand:function(a,b){utils.extend(b,{all:!1,casesensitive:!1,dir:1},!0);var c=0;if(b.all){var e=f.selection.getRange(),g=f.body.firstChild;for(g&&1==g.nodeType?(e.setStart(g,0),e.shrinkBoundary(!0)):3==g.nodeType&&e.setStartBefore(g),e.collapse(!0).select(!0),void 0!==b.replaceStr&&f.fireEvent("saveScene");d(this,b);)c++;c&&f.fireEvent("saveScene")}else void 0!==b.replaceStr&&f.fireEvent("saveScene"),d(this,b)&&c++,c&&f.fireEvent("saveScene");return c},notNeedUndo:1}}}}),UE.plugins.customstyle=function(){var a=this;a.setOpt({customstyle:[{tag:"h1",name:"tc",style:"font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;"},{tag:"h1",name:"tl",style:"font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:left;margin:0 0 10px 0;"},{tag:"span",name:"im",style:"font-size:16px;font-style:italic;font-weight:bold;line-height:18px;"},{tag:"span",name:"hi",style:"font-size:16px;font-style:italic;font-weight:bold;color:rgb(51, 153, 204);line-height:18px;"}]}),a.commands.customstyle={execCommand:function(a,b){var c,d,e=this,f=b.tag,g=domUtils.findParent(e.selection.getStart(),function(a){return a.getAttribute("label")},!0),h={};for(var i in b)void 0!==b[i]&&(h[i]=b[i]);if(delete h.tag,g&&g.getAttribute("label")==b.label){if(c=this.selection.getRange(),d=c.createBookmark(),c.collapsed)if(dtd.$block[g.tagName]){var j=e.document.createElement("p");domUtils.moveChild(g,j),g.parentNode.insertBefore(j,g),domUtils.remove(g)}else domUtils.remove(g,!0);else{var k=domUtils.getCommonAncestor(d.start,d.end),l=domUtils.getElementsByTagName(k,f);new RegExp(f,"i").test(k.tagName)&&l.push(k);for(var m,n=0;m=l[n++];)if(m.getAttribute("label")==b.label){var o=domUtils.getPosition(m,d.start),p=domUtils.getPosition(m,d.end);if((o&domUtils.POSITION_FOLLOWING||o&domUtils.POSITION_CONTAINS)&&(p&domUtils.POSITION_PRECEDING||p&domUtils.POSITION_CONTAINS)&&dtd.$block[f]){var j=e.document.createElement("p");domUtils.moveChild(m,j),m.parentNode.insertBefore(j,m)}domUtils.remove(m,!0)}g=domUtils.findParent(k,function(a){return a.getAttribute("label")==b.label},!0),g&&domUtils.remove(g,!0)}c.moveToBookmark(d).select()}else if(dtd.$block[f]){if(this.execCommand("paragraph",f,h,"customstyle"),c=e.selection.getRange(),!c.collapsed){c.collapse(),g=domUtils.findParent(e.selection.getStart(),function(a){return a.getAttribute("label")==b.label},!0);var q=e.document.createElement("p");domUtils.insertAfter(g,q),domUtils.fillNode(e.document,q),c.setStart(q,0).setCursor()}}else{if(c=e.selection.getRange(),c.collapsed)return g=e.document.createElement(f),domUtils.setAttributes(g,h),void c.insertNode(g).setStart(g,0).setCursor();d=c.createBookmark(),c.applyInlineStyle(f,h).moveToBookmark(d).select()}},queryCommandValue:function(){var a=domUtils.filterNodeList(this.selection.getStartElementPath(),function(a){return a.getAttribute("label")});return a?a.getAttribute("label"):""}},a.addListener("keyup",function(b,c){var d=c.keyCode||c.which;if(32==d||13==d){var e=a.selection.getRange();if(e.collapsed){var f=domUtils.findParent(a.selection.getStart(),function(a){return a.getAttribute("label")},!0);if(f&&dtd.$block[f.tagName]&&domUtils.isEmptyNode(f)){var g=a.document.createElement("p");domUtils.insertAfter(f,g),domUtils.fillNode(a.document,g),domUtils.remove(f),e.setStart(g,0).setCursor()}}}})},UE.plugins.catchremoteimage=function(){var me=this,ajax=UE.ajax;me.options.catchRemoteImageEnable!==!1&&(me.setOpt({catchRemoteImageEnable:!1}),me.addListener("afterpaste",function(){me.fireEvent("catchRemoteImage")}),me.addListener("catchRemoteImage",function(){function catchremoteimage(a,b){var c=utils.serializeParam(me.queryCommandValue("serverparam"))||"",d=utils.formatUrl(catcherActionUrl+(catcherActionUrl.indexOf("?")==-1?"?":"&")+c),e=utils.isCrossDomainUrl(d),f={method:"POST",dataType:e?"jsonp":"",timeout:6e4,onsuccess:b.success,onerror:b.error};f[catcherFieldName]=a,ajax.request(d,f)}for(var catcherLocalDomain=me.getOpt("catcherLocalDomain"),catcherActionUrl=me.getActionUrl(me.getOpt("catcherActionName")),catcherUrlPrefix=me.getOpt("catcherUrlPrefix"),catcherFieldName=me.getOpt("catcherFieldName"),remoteImages=[],imgs=domUtils.getElementsByTagName(me.document,"img"),test=function(a,b){if(a.indexOf(location.host)!=-1||/(^\.)|(^\/)/.test(a))return!0;if(b)for(var c,d=0;c=b[d++];)if(a.indexOf(c)!==-1)return!0;return!1},i=0,ci;ci=imgs[i++];)if(!ci.getAttribute("word_img")){var src=ci.getAttribute("_src")||ci.src||"";/^(https?|ftp):/i.test(src)&&!test(src,catcherLocalDomain)&&remoteImages.push(src)}remoteImages.length&&catchremoteimage(remoteImages,{success:function(r){try{var info=void 0!==r.state?r:eval("("+r.responseText+")")}catch(e){return}var i,j,ci,cj,oldSrc,newSrc,list=info.list;for(i=0;ci=imgs[i++];)for(oldSrc=ci.getAttribute("_src")||ci.src||"",j=0;cj=list[j++];)if(oldSrc==cj.source&&"SUCCESS"==cj.state){newSrc=catcherUrlPrefix+cj.url,domUtils.setAttributes(ci,{src:newSrc,_src:newSrc});break}me.fireEvent("catchremotesuccess")},error:function(){me.fireEvent("catchremoteerror")}})}))},UE.plugin.register("snapscreen",function(){function getLocation(a){var b,c=document.createElement("a"),d=utils.serializeParam(me.queryCommandValue("serverparam"))||"";return c.href=a,browser.ie&&(c.href=c.href),b=c.search,d&&(b=b+(b.indexOf("?")==-1?"?":"&")+d,b=b.replace(/[&]+/gi,"&")),{port:c.port,hostname:c.hostname,path:c.pathname+b||+c.hash}}var me=this,snapplugin;return{commands:{snapscreen:{execCommand:function(cmd){function onSuccess(rs){try{if(rs=eval("("+rs+")"),"SUCCESS"==rs.state){var opt=me.options;me.execCommand("insertimage",{src:opt.snapscreenUrlPrefix+rs.url,_src:opt.snapscreenUrlPrefix+rs.url,alt:rs.title||"",floatStyle:opt.snapscreenImgAlign})}else alert(rs.state)}catch(e){alert(lang.callBackErrorMsg)}}var url,local,res,lang=me.getLang("snapScreen_plugin");if(!snapplugin){var container=me.container,doc=me.container.ownerDocument||me.container.document;snapplugin=doc.createElement("object");try{snapplugin.type="application/x-pluginbaidusnap"}catch(e){return}snapplugin.style.cssText="position:absolute;left:-9999px;width:0;height:0;",snapplugin.setAttribute("width","0"),snapplugin.setAttribute("height","0"),container.appendChild(snapplugin)}url=me.getActionUrl(me.getOpt("snapscreenActionName")),local=getLocation(url),setTimeout(function(){try{res=snapplugin.saveSnapshot(local.hostname,local.path,local.port)}catch(a){return void me.ui._dialogs.snapscreenDialog.open()}onSuccess(res)},50)},queryCommandState:function(){return navigator.userAgent.indexOf("Windows",0)!=-1?0:-1}}}}}),UE.commands.insertparagraph={execCommand:function(a,b){for(var c,d=this,e=d.selection.getRange(),f=e.startContainer;f&&!domUtils.isBody(f);)c=f,f=f.parentNode;if(c){var g=d.document.createElement("p");b?c.parentNode.insertBefore(g,c):c.parentNode.insertBefore(g,c.nextSibling),domUtils.fillNode(d.document,g),e.setStart(g,0).setCursor(!1,!0)}}},UE.plugin.register("webapp",function(){function a(a,c){return c?'':'"}var b=this;return{outputRule:function(b){utils.each(b.getNodesByTagName("img"),function(b){var c;if("edui-faked-webapp"==b.getAttr("class")){c=a({title:b.getAttr("title"),width:b.getAttr("width"),height:b.getAttr("height"),align:b.getAttr("align"),cssfloat:b.getStyle("float"),url:b.getAttr("_url"),logo:b.getAttr("_logo_url")},!0);var d=UE.uNode.createElement(c);b.parentNode.replaceChild(d,b)}})},inputRule:function(b){utils.each(b.getNodesByTagName("iframe"),function(b){if("edui-faked-webapp"==b.getAttr("class")){var c=UE.uNode.createElement(a({title:b.getAttr("title"),width:b.getAttr("width"),height:b.getAttr("height"),align:b.getAttr("align"),cssfloat:b.getStyle("float"),url:b.getAttr("src"),logo:b.getAttr("logo_url")}));b.parentNode.replaceChild(c,b)}})},commands:{webapp:{execCommand:function(b,c){var d=this,e=a(utils.extend(c,{align:"none"}),!1);d.execCommand("inserthtml",e)},queryCommandState:function(){var a=this,b=a.selection.getRange().getClosedNode(),c=b&&"edui-faked-webapp"==b.className;return c?1:0}}}}}),UE.plugins.template=function(){UE.commands.template={execCommand:function(a,b){b.html&&this.execCommand("inserthtml",b.html)}},this.addListener("click",function(a,b){var c=b.target||b.srcElement,d=this.selection.getRange(),e=domUtils.findParent(c,function(a){if(a.className&&domUtils.hasClass(a,"ue_t"))return a},!0);e&&d.selectNode(e).shrinkBoundary().select()}),this.addListener("keydown",function(a,b){var c=this.selection.getRange();if(!c.collapsed&&!(b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)){var d=domUtils.findParent(c.startContainer,function(a){if(a.className&&domUtils.hasClass(a,"ue_t"))return a},!0);d&&domUtils.removeClasses(d,["ue_t"])}})},UE.plugin.register("music",function(){function a(a,c,d,e,f,g){return g?'':"'}var b=this;return{outputRule:function(b){utils.each(b.getNodesByTagName("img"),function(b){var c;if("edui-faked-music"==b.getAttr("class")){var d=b.getStyle("float"),e=b.getAttr("align");c=a(b.getAttr("_url"),b.getAttr("width"),b.getAttr("height"),e,d,!0);var f=UE.uNode.createElement(c);b.parentNode.replaceChild(f,b)}})},inputRule:function(b){utils.each(b.getNodesByTagName("embed"),function(b){if("edui-faked-music"==b.getAttr("class")){var c=b.getStyle("float"),d=b.getAttr("align");html=a(b.getAttr("src"),b.getAttr("width"),b.getAttr("height"),d,c,!1);var e=UE.uNode.createElement(html);b.parentNode.replaceChild(e,b)}})},commands:{music:{execCommand:function(b,c){var d=this,e=a(c.url,c.width||400,c.height||95,"none",!1);d.execCommand("inserthtml",e)},queryCommandState:function(){var a=this,b=a.selection.getRange().getClosedNode(),c=b&&"edui-faked-music"==b.className;return c?1:0}}}}}),UE.plugin.register("autoupload",function(){function a(a,b){var c,d,e,f,g,h,i,j,k=b,l=/image\/\w+/i.test(a.type)?"image":"file",m="loading_"+(+new Date).toString(36);if(c=k.getOpt(l+"FieldName"),d=k.getOpt(l+"UrlPrefix"),e=k.getOpt(l+"MaxSize"),f=k.getOpt(l+"AllowFiles"),g=k.getActionUrl(k.getOpt(l+"ActionName")),i=function(a){var b=k.document.getElementById(m);b&&domUtils.remove(b),k.fireEvent("showmessage",{id:m,content:a,type:"error",timeout:4e3})},"image"==l?(h='',j=function(a){var b=d+a.url,c=k.document.getElementById(m);c&&(c.setAttribute("src",b),c.setAttribute("_src",b),c.setAttribute("title",a.title||""),c.setAttribute("alt",a.original||""),c.removeAttribute("id"),domUtils.removeClasses(c,"loadingclass"))}):(h='

    ',j=function(a){var b=d+a.url,c=k.document.getElementById(m),e=k.selection.getRange(),f=e.createBookmark();e.selectNode(c).select(),k.execCommand("insertfile",{url:b}),e.moveToBookmark(f).select()}),k.execCommand("inserthtml",h),!k.getOpt(l+"ActionName"))return void i(k.getLang("autoupload.errorLoadConfig"));if(a.size>e)return void i(k.getLang("autoupload.exceedSizeError"));var n=a.name?a.name.substr(a.name.lastIndexOf(".")):"";if(n&&"image"!=l||f&&(f.join("")+".").indexOf(n.toLowerCase()+".")==-1)return void i(k.getLang("autoupload.exceedTypeError"));var o=new XMLHttpRequest,p=new FormData,q=utils.serializeParam(k.queryCommandValue("serverparam"))||"",r=utils.formatUrl(g+(g.indexOf("?")==-1?"?":"&")+q);p.append(c,a,a.name||"blob."+a.type.substr("image/".length)),p.append("type","ajax"),o.open("post",r,!0),o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.addEventListener("load",function(a){try{var b=new Function("return "+utils.trim(a.target.response))();"SUCCESS"==b.state&&b.url?j(b):i(b.state)}catch(c){i(k.getLang("autoupload.loadError"))}}),o.send(p)}function b(a){return a.clipboardData&&a.clipboardData.items&&1==a.clipboardData.items.length&&/^image\//.test(a.clipboardData.items[0].type)?a.clipboardData.items:null}function c(a){return a.dataTransfer&&a.dataTransfer.files?a.dataTransfer.files:null}return{outputRule:function(a){utils.each(a.getNodesByTagName("img"),function(a){/\b(loaderrorclass)|(bloaderrorclass)\b/.test(a.getAttr("class"))&&a.parentNode.removeChild(a)}),utils.each(a.getNodesByTagName("p"),function(a){/\bloadpara\b/.test(a.getAttr("class"))&&a.parentNode.removeChild(a)})},bindEvents:{ready:function(d){var e=this;window.FormData&&window.FileReader&&(domUtils.on(e.body,"paste drop",function(d){var f,g=!1;if(f="paste"==d.type?b(d):c(d)){for(var h,i=f.length;i--;)h=f[i],h.getAsFile&&(h=h.getAsFile()),h&&h.size>0&&(a(h,e),g=!0);g&&d.preventDefault()}}),domUtils.on(e.body,"dragover",function(a){"Files"==a.dataTransfer.types[0]&&a.preventDefault()}),utils.cssRule("loading",".loadingclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-left:1px;height: 22px;width: 22px;}\n.loaderrorclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}",this.document))}}}}),UE.plugin.register("autosave",function(){function a(a){var f;if(!(new Date-c0?b._saveFlag=window.setTimeout(function(){a(b)},b.options.saveInterval):a(b))}},commands:{clearlocaldata:{execCommand:function(a,c){e&&b.getPreferences(e)&&b.removePreferences(e)},notNeedUndo:!0,ignoreContentChange:!0},getlocaldata:{execCommand:function(a,c){return e?b.getPreferences(e)||"":""},notNeedUndo:!0,ignoreContentChange:!0},drafts:{execCommand:function(a,c){e&&(b.body.innerHTML=b.getPreferences(e)||"

    "+domUtils.fillHtml+"

    ",b.focus(!0))},queryCommandState:function(){return e?null===b.getPreferences(e)?-1:0:-1},notNeedUndo:!0,ignoreContentChange:!0}}}}),UE.plugin.register("charts",function(){function a(a){var b=null,c=0;if(a.rows.length<2)return!1;if(a.rows[0].cells.length<2)return!1;b=a.rows[0].cells,c=b.length;for(var d,e=0;d=b[e];e++)if("th"!==d.tagName.toLowerCase())return!1;for(var f,e=1;f=a.rows[e];e++){if(f.cells.length!=c)return!1;if("th"!==f.cells[0].tagName.toLowerCase())return!1;for(var d,g=1;d=f.cells[g];g++){var h=utils.trim(d.innerText||d.textContent||"");if(h=h.replace(new RegExp(UE.dom.domUtils.fillChar,"g"),"").replace(/^\s+|\s+$/g,""),!/^\d*\.?\d+$/.test(h))return!1}}return!0}var b=this;return{bindEvents:{chartserror:function(){}},commands:{charts:{execCommand:function(c,d){var e=domUtils.findParentByTagName(this.selection.getRange().startContainer,"table",!0),f=[],g={};if(!e)return!1;if(!a(e))return b.fireEvent("chartserror"),!1;g.title=d.title||"",g.subTitle=d.subTitle||"",g.xTitle=d.xTitle||"",g.yTitle=d.yTitle||"",g.suffix=d.suffix||"",g.tip=d.tip||"",g.dataFormat=d.tableDataFormat||"",g.chartType=d.chartType||0;for(var h in g)g.hasOwnProperty(h)&&f.push(h+":"+g[h]); +e.setAttribute("data-chart",f.join(";")),domUtils.addClass(e,"edui-charts-table")},queryCommandState:function(b,c){var d=domUtils.findParentByTagName(this.selection.getRange().startContainer,"table",!0);return d&&a(d)?0:-1}}},inputRule:function(a){utils.each(a.getNodesByTagName("table"),function(a){void 0!==a.getAttr("data-chart")&&a.setAttr("style")})},outputRule:function(a){utils.each(a.getNodesByTagName("table"),function(a){void 0!==a.getAttr("data-chart")&&a.setAttr("style","display: none;")})}}}),UE.plugin.register("section",function(){function a(a){this.tag="",this.level=-1,this.dom=null,this.nextSection=null,this.previousSection=null,this.parentSection=null,this.startAddress=[],this.endAddress=[],this.children=[]}function b(b){var c=new a;return utils.extend(c,b)}function c(a,b){for(var c=b,d=0;d=0){var o=h.selection.getRange().selectNode(i).createAddress(!0).startAddress,p=b({tag:i.tagName,title:i.innerText||i.textContent||"",level:f,dom:i,startAddress:utils.clone(o,[]),endAddress:utils.clone(o,[]),children:[]});for(j.nextSection=p,p.previousSection=j,g=j;f<=g.level;)g=g.parentSection;p.parentSection=g,g.children.push(p),k=j=p}else 1===i.nodeType&&e(i,c),k&&k.endAddress[k.endAddress.length-1]++}for(var f=c||["h1","h2","h3","h4","h5","h6"],g=0;g=c.length);f++){if(c[f]>a[f]){d=!0;break}if(c[f]=c.length);f++){if(c[f]a[f])break}return d&&e}var g,h,i=this;if(b&&d&&d.level!=-1&&(g=e?d.endAddress:d.startAddress,h=c(g,i.body),g&&h&&!f(b.startAddress,b.endAddress,g))){var j,k,l=c(b.startAddress,i.body),m=c(b.endAddress,i.body);if(e)for(j=m;j&&!(domUtils.getPosition(l,j)&domUtils.POSITION_FOLLOWING)&&(k=j.previousSibling,domUtils.insertAfter(h,j),j!=l);)j=k;else for(j=l;j&&!(domUtils.getPosition(j,m)&domUtils.POSITION_FOLLOWING)&&(k=j.nextSibling,h.parentNode.insertBefore(j,h),j!=m);)j=k;i.fireEvent("updateSections")}}},deletesection:{execCommand:function(a,b,c){function d(a){for(var b=e.body,c=0;c'),!c.getOpt("imageActionName"))return void b(c.getLang("autoupload.errorLoadConfig"));var k=h.value,l=k?k.substr(k.lastIndexOf(".")):"";if(!l||j&&(j.join("")+".").indexOf(l.toLowerCase()+".")==-1)return void b(c.getLang("simpleupload.exceedTypeError"));var m=new XMLHttpRequest;if(m.open("post",i,!0),c.options.headers&&"[object Object]"===Object.prototype.toString.apply(c.options.headers))for(var n in c.options.headers)m.setRequestHeader(n,c.options.headers[n]);m.onload=function(){if(m.status>=200&&m.status<300||304==m.status){var a=JSON.parse(m.responseText),e=c.options.imageUrlPrefix+a.url;"SUCCESS"==a.state&&a.url?(loader=c.document.getElementById(d),loader.setAttribute("src",e),loader.setAttribute("_src",e),loader.setAttribute("title",a.title||""),loader.setAttribute("alt",a.original||""),loader.removeAttribute("id"),domUtils.removeClasses(loader,"loadingclass"),c.fireEvent("contentchange")):b(a.state)}else b(c.getLang("simpleupload.loadError"))},m.onerror=function(){b(c.getLang("simpleupload.loadError"))},m.send(new FormData(g)),g.reset()}})}var b,c=this,d=(+new Date).toString(36);return{bindEvents:{ready:function(){utils.cssRule("loading",".loadingclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}\n.loaderrorclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}",this.document)},simpleuploadbtnready:function(d,e){b=e,c.afterConfigReady(a)}},outputRule:function(a){utils.each(a.getNodesByTagName("img"),function(a){/\b(loaderrorclass)|(bloaderrorclass)\b/.test(a.getAttr("class"))&&a.parentNode.removeChild(a)})}}}),UE.plugin.register("serverparam",function(){var a={};return{commands:{serverparam:{execCommand:function(b,c,d){void 0===c||null===c?a={}:utils.isString(c)?void 0===d||null===d?delete a[c]:a[c]=d:utils.isObject(c)?utils.extend(a,c,!0):utils.isFunction(c)&&utils.extend(a,c(),!0)},queryCommandValue:function(){return a||{}}}}}}),UE.plugin.register("insertfile",function(){function a(a){var b=a.substr(a.lastIndexOf(".")+1).toLowerCase(),c={rar:"icon_rar.gif",zip:"icon_rar.gif",tar:"icon_rar.gif",gz:"icon_rar.gif",bz2:"icon_rar.gif",doc:"icon_doc.gif",docx:"icon_doc.gif",pdf:"icon_pdf.gif",mp3:"icon_mp3.gif",xls:"icon_xls.gif",chm:"icon_chm.gif",ppt:"icon_ppt.gif",pptx:"icon_ppt.gif",avi:"icon_mv.gif",rmvb:"icon_mv.gif",wmv:"icon_mv.gif",flv:"icon_mv.gif",swf:"icon_mv.gif",rm:"icon_mv.gif",exe:"icon_exe.gif",psd:"icon_psd.gif",txt:"icon_txt.gif",jpg:"icon_jpg.gif",png:"icon_jpg.gif",jpeg:"icon_jpg.gif",gif:"icon_jpg.gif",ico:"icon_jpg.gif",bmp:"icon_jpg.gif"};return c[b]?c[b]:c.txt}var b=this;return{commands:{insertfile:{execCommand:function(c,d){d=utils.isArray(d)?d:[d];var e,f,g,h,i="",j=b.getOpt("UEDITOR_HOME_URL"),k=j+("/"==j.substr(j.length-1)?"":"/")+"dialogs/attachment/fileTypeImages/";for(e=0;e'+h+"

    ";b.execCommand("insertHtml",i)}}}}}),UE.plugins.xssFilter=function(){function a(a){var b=a.tagName,d=a.attrs;return c.hasOwnProperty(b)?void UE.utils.each(d,function(d,e){c[b].indexOf(e)===-1&&a.setAttr(e)}):(a.parentNode.removeChild(a),!1)}var b=UEDITOR_CONFIG,c=b.whitList;c&&b.xssFilterRules&&(this.options.filterRules=function(){var b={};return UE.utils.each(c,function(c,d){b[d]=function(b){return a(b)}}),b}());var d=[];UE.utils.each(c,function(a,b){d.push(b)}),c&&b.inputXssFilter&&this.addInputRule(function(b){b.traversal(function(b){return"element"===b.type&&void a(b)})}),c&&b.outputXssFilter&&this.addOutputRule(function(b){b.traversal(function(b){return"element"===b.type&&void a(b)})})};var baidu=baidu||{};baidu.editor=baidu.editor||{},UE.ui=baidu.editor.ui={},function(){function a(){var a=document.getElementById("edui_fixedlayer");i.setViewportOffset(a,{left:0,top:0})}function b(b){d.on(window,"scroll",a),d.on(window,"resize",baidu.editor.utils.defer(a,0,!0))}var c=baidu.editor.browser,d=baidu.editor.dom.domUtils,e="$EDITORUI",f=window[e]={},g="ID"+e,h=0,i=baidu.editor.ui.uiUtils={uid:function(a){return a?a[g]||(a[g]=++h):++h},hook:function(a,b){var c;return a&&a._callbacks?c=a:(c=function(){var b;a&&(b=a.apply(this,arguments));for(var d=c._callbacks,e=d.length;e--;){var f=d[e].apply(this,arguments);void 0===b&&(b=f)}return b},c._callbacks=[]),c._callbacks.push(b),c},createElementByHtml:function(a){var b=document.createElement("div");return b.innerHTML=a,b=b.firstChild,b.parentNode.removeChild(b),b},getViewportElement:function(){return c.ie&&c.quirks?document.body:document.documentElement},getClientRect:function(a){var b;try{b=a.getBoundingClientRect()}catch(c){b={left:0,top:0,height:0,width:0}}for(var e,f={left:Math.round(b.left),top:Math.round(b.top),height:Math.round(b.bottom-b.top),width:Math.round(b.right-b.left)};(e=a.ownerDocument)!==document&&(a=d.getWindow(e).frameElement);)b=a.getBoundingClientRect(),f.left+=b.left,f.top+=b.top;return f.bottom=f.top+f.height,f.right=f.left+f.width,f},getViewportRect:function(){var a=i.getViewportElement(),b=0|(window.innerWidth||a.clientWidth),c=0|(window.innerHeight||a.clientHeight);return{left:0,top:0,height:c,width:b,bottom:c,right:b}},setViewportOffset:function(a,b){var c=i.getFixedLayer();a.parentNode===c?(a.style.left=b.left+"px",a.style.top=b.top+"px"):d.setViewportOffset(a,b)},getEventOffset:function(a){var b=a.target||a.srcElement,c=i.getClientRect(b),d=i.getViewportOffsetByEvent(a);return{left:d.left-c.left,top:d.top-c.top}},getViewportOffsetByEvent:function(a){var b=a.target||a.srcElement,c=d.getWindow(b).frameElement,e={left:a.clientX,top:a.clientY};if(c&&b.ownerDocument!==document){var f=i.getClientRect(c);e.left+=f.left,e.top+=f.top}return e},setGlobal:function(a,b){return f[a]=b,e+'["'+a+'"]'},unsetGlobal:function(a){delete f[a]},copyAttributes:function(a,b){for(var e=b.attributes,f=e.length;f--;){var g=e[f];"style"==g.nodeName||"class"==g.nodeName||c.ie&&!g.specified||a.setAttribute(g.nodeName,g.nodeValue)}b.className&&d.addClass(a,b.className),b.style.cssText&&(a.style.cssText+=";"+b.style.cssText)},removeStyle:function(a,b){if(a.style.removeProperty)a.style.removeProperty(b);else{if(!a.style.removeAttribute)throw"";a.style.removeAttribute(b)}},contains:function(a,b){return a&&b&&a!==b&&(a.contains?a.contains(b):16&a.compareDocumentPosition(b))},startDrag:function(a,b,c){function d(a){var c=a.clientX-g,d=a.clientY-h;b.ondragmove(c,d,a),a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function e(a){c.removeEventListener("mousemove",d,!0),c.removeEventListener("mouseup",e,!0),window.removeEventListener("mouseup",e,!0),b.ondragstop()}function f(){i.releaseCapture(),i.detachEvent("onmousemove",d),i.detachEvent("onmouseup",f),i.detachEvent("onlosecaptrue",f),b.ondragstop()}var c=c||document,g=a.clientX,h=a.clientY;if(c.addEventListener)c.addEventListener("mousemove",d,!0),c.addEventListener("mouseup",e,!0),window.addEventListener("mouseup",e,!0),a.preventDefault();else{var i=a.srcElement;i.setCapture(),i.attachEvent("onmousemove",d),i.attachEvent("onmouseup",f),i.attachEvent("onlosecaptrue",f),a.returnValue=!1}b.ondragstart()},getFixedLayer:function(){var d=document.getElementById("edui_fixedlayer");return null==d&&(d=document.createElement("div"),d.id="edui_fixedlayer",document.body.appendChild(d),c.ie&&c.version<=8?(d.style.position="absolute",b(),setTimeout(a)):d.style.position="fixed",d.style.left="0",d.style.top="0",d.style.width="0",d.style.height="0"),d},makeUnselectable:function(a){if(c.opera||c.ie&&c.version<9){if(a.unselectable="on",a.hasChildNodes())for(var b=0;b'}},a.inherits(c,b)}(),function(){var a=baidu.editor.utils,b=baidu.editor.dom.domUtils,c=baidu.editor.ui.UIBase,d=baidu.editor.ui.uiUtils,e=baidu.editor.ui.Mask=function(a){this.initOptions(a),this.initUIBase()};e.prototype={getHtmlTpl:function(){return'
    '},postRender:function(){var a=this;b.on(window,"resize",function(){setTimeout(function(){a.isHidden()||a._fill()})})},show:function(a){this._fill(),this.getDom().style.display="",this.getDom().style.zIndex=a},hide:function(){this.getDom().style.display="none",this.getDom().style.zIndex=""},isHidden:function(){return"none"==this.getDom().style.display},_onMouseDown:function(){return!1},_onClick:function(a,b){this.fireEvent("click",a,b)},_fill:function(){var a=this.getDom(),b=d.getViewportRect();a.style.width=b.width+"px",a.style.height=b.height+"px"}},a.inherits(e,c)}(),function(){function a(a,b){for(var c=0;c
    '+this.getContentHtmlTpl()+"
    "},getContentHtmlTpl:function(){return this.content?"string"==typeof this.content?this.content:this.content.renderHtml():""},_UIBase_postRender:e.prototype.postRender,postRender:function(){if(this.content instanceof e&&this.content.postRender(),this.captureWheel&&!this.captured){this.captured=!0;var a=(document.documentElement.clientHeight||document.body.clientHeight)-80,b=this.getDom().offsetHeight,f=c.getClientRect(this.combox.getDom()).top,g=this.getDom("content"),h=this.getDom("body").getElementsByTagName("iframe"),i=this;for(h.length&&(h=h[0]);f+b>a;)b-=30;g.style.height=b+"px",h&&(h.style.height=b+"px"),window.XMLHttpRequest?d.on(g,"onmousewheel"in document.body?"mousewheel":"DOMMouseScroll",function(a){a.preventDefault?a.preventDefault():a.returnValue=!1,a.wheelDelta?g.scrollTop-=a.wheelDelta/120*60:g.scrollTop-=a.detail/-3*60}):d.on(this.getDom(),"mousewheel",function(a){a.returnValue=!1,i.getDom("content").scrollTop-=a.wheelDelta/120*60})}this.fireEvent("postRenderAfter"),this.hide(!0),this._UIBase_postRender()},_doAutoRender:function(){!this.getDom()&&this.autoRender&&this.render()},mesureSize:function(){var a=this.getDom("content");return c.getClientRect(a)},fitSize:function(){if(this.captureWheel&&this.sized)return this.__size;this.sized=!0;var a=this.getDom("body");a.style.width="",a.style.height="";var b=this.mesureSize();if(this.captureWheel){a.style.width=-(-20-b.width)+"px";var c=parseInt(this.getDom("content").style.height,10);!window.isNaN(c)&&(b.height=c)}else a.style.width=b.width+"px";return a.style.height=b.height+"px",this.__size=b,this.captureWheel&&(this.getDom("content").style.overflow="auto"),b},showAnchor:function(a,b){this.showAnchorRect(c.getClientRect(a),b)},showAnchorRect:function(a,b,e){this._doAutoRender();var f=c.getViewportRect();this.getDom().style.visibility="hidden",this._show();var g,i,j,k,l=this.fitSize();b?(g=this.canSideLeft&&a.right+l.width>f.right&&a.left>l.width,i=this.canSideUp&&a.top+l.height>f.bottom&&a.bottom>l.height,j=g?a.left-l.width:a.right,k=i?a.bottom-l.height:a.top):(g=this.canSideLeft&&a.right+l.width>f.right&&a.left>l.width,i=this.canSideUp&&a.top+l.height>f.bottom&&a.bottom>l.height,j=g?a.right-l.width:a.left,k=i?a.top-l.height:a.bottom);var m=this.getDom();c.setViewportOffset(m,{left:j,top:k}),d.removeClasses(m,h),m.className+=" "+h[2*(i?1:0)+(g?1:0)],this.editor&&(m.style.zIndex=1*this.editor.container.style.zIndex+10,baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex=m.style.zIndex-1),this.getDom().style.visibility="visible"},showAt:function(a){var b=a.left,c=a.top,d={left:b,top:c,right:b,bottom:c,height:0,width:0};this.showAnchorRect(d,!1,!0)},_show:function(){if(this._hidden){var a=this.getDom();a.style.display="",this._hidden=!1,this.fireEvent("show")}},isHidden:function(){return this._hidden},show:function(){this._doAutoRender(),this._show()},hide:function(a){!this._hidden&&this.getDom()&&(this.getDom().style.display="none",this._hidden=!0,a||this.fireEvent("hide"))},queryAutoHide:function(a){return!a||!c.contains(this.getDom(),a)}},b.inherits(f,e),d.on(document,"mousedown",function(b){var c=b.target||b.srcElement;a(b,c)}),d.on(window,"scroll",function(b,c){a(b,c)})}(),function(){function a(a,b){for(var c='
    '+a+'
    ',d=0;d"+(60==d?'":"")+""),c+=d<70?'':"";return c+="
    '+b.getLang("themeColor")+'
    '+b.getLang("standardColor")+"
    =60?"border-width:1px;":d>=10&&d<20?"border-width:1px 1px 0 1px;":"border-width:0 1px 0 1px;")+'">
    "}var b=baidu.editor.utils,c=baidu.editor.ui.UIBase,d=baidu.editor.ui.ColorPicker=function(a){this.initOptions(a),this.noColorText=this.noColorText||this.editor.getLang("clearColor"),this.initUIBase()};d.prototype={getHtmlTpl:function(){return a(this.noColorText,this.editor)},_onTableClick:function(a){var b=a.target||a.srcElement,c=b.getAttribute("data-color");c&&this.fireEvent("pickcolor",c)},_onTableOver:function(a){var b=a.target||a.srcElement,c=b.getAttribute("data-color");c&&(this.getDom("preview").style.backgroundColor=c)},_onTableOut:function(){this.getDom("preview").style.backgroundColor=""},_onPickNoColor:function(){this.fireEvent("picknocolor")}},b.inherits(d,c);var e="ffffff,000000,eeece1,1f497d,4f81bd,c0504d,9bbb59,8064a2,4bacc6,f79646,f2f2f2,7f7f7f,ddd9c3,c6d9f0,dbe5f1,f2dcdb,ebf1dd,e5e0ec,dbeef3,fdeada,d8d8d8,595959,c4bd97,8db3e2,b8cce4,e5b9b7,d7e3bc,ccc1d9,b7dde8,fbd5b5,bfbfbf,3f3f3f,938953,548dd4,95b3d7,d99694,c3d69b,b2a2c7,92cddc,fac08f,a5a5a5,262626,494429,17365d,366092,953734,76923c,5f497a,31859b,e36c09,7f7f7f,0c0c0c,1d1b10,0f243e,244061,632423,4f6128,3f3151,205867,974806,c00000,ff0000,ffc000,ffff00,92d050,00b050,00b0f0,0070c0,002060,7030a0,".split(",")}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=baidu.editor.ui.UIBase,d=baidu.editor.ui.TablePicker=function(a){this.initOptions(a),this.initTablePicker()};d.prototype={defaultNumRows:10,defaultNumCols:10,maxNumRows:20,maxNumCols:20,numRows:10,numCols:10,lengthOfCellSide:22,initTablePicker:function(){this.initUIBase()},getHtmlTpl:function(){return'
    '},_UIBase_render:c.prototype.render,render:function(a){this._UIBase_render(a),this.getDom("label").innerHTML="0"+this.editor.getLang("t_row")+" x 0"+this.editor.getLang("t_col")},_track:function(a,b){var c=this.getDom("overlay").style,d=this.lengthOfCellSide;c.width=a*d+"px",c.height=b*d+"px";var e=this.getDom("label");e.innerHTML=a+this.editor.getLang("t_col")+" x "+b+this.editor.getLang("t_row"),this.numCols=a,this.numRows=b},_onMouseOver:function(a,c){var d=a.relatedTarget||a.fromElement;b.contains(c,d)||c===d||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="")},_onMouseOut:function(a,c){var d=a.relatedTarget||a.toElement;b.contains(c,d)||c===d||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="hidden")},_onMouseMove:function(a,c){var d=(this.getDom("overlay").style,b.getEventOffset(a)),e=this.lengthOfCellSide,f=Math.ceil(d.left/e),g=Math.ceil(d.top/e);this._track(f,g)},_onClick:function(){this.fireEvent("picktable",this.numCols,this.numRows)}},a.inherits(d,c)}(),function(){var a=baidu.editor.browser,b=baidu.editor.dom.domUtils,c=baidu.editor.ui.uiUtils,d='onmousedown="$$.Stateful_onMouseDown(event, this);" onmouseup="$$.Stateful_onMouseUp(event, this);"'+(a.ie?' onmouseenter="$$.Stateful_onMouseEnter(event, this);" onmouseleave="$$.Stateful_onMouseLeave(event, this);"':' onmouseover="$$.Stateful_onMouseOver(event, this);" onmouseout="$$.Stateful_onMouseOut(event, this);"');baidu.editor.ui.Stateful={alwalysHoverable:!1,target:null,Stateful_init:function(){this._Stateful_dGetHtmlTpl=this.getHtmlTpl,this.getHtmlTpl=this.Stateful_getHtmlTpl},Stateful_getHtmlTpl:function(){var a=this._Stateful_dGetHtmlTpl();return a.replace(/stateful/g,function(){return d})},Stateful_onMouseEnter:function(a,b){this.target=b,this.isDisabled()&&!this.alwalysHoverable||(this.addState("hover"),this.fireEvent("over"))},Stateful_onMouseLeave:function(a,b){this.isDisabled()&&!this.alwalysHoverable||(this.removeState("hover"),this.removeState("active"),this.fireEvent("out"))},Stateful_onMouseOver:function(a,b){var d=a.relatedTarget;c.contains(b,d)||b===d||this.Stateful_onMouseEnter(a,b)},Stateful_onMouseOut:function(a,b){var d=a.relatedTarget;c.contains(b,d)||b===d||this.Stateful_onMouseLeave(a,b)},Stateful_onMouseDown:function(a,b){this.isDisabled()||this.addState("active")},Stateful_onMouseUp:function(a,b){this.isDisabled()||this.removeState("active")},Stateful_postRender:function(){this.disabled&&!this.hasState("disabled")&&this.addState("disabled")},hasState:function(a){return b.hasClass(this.getStateDom(),"edui-state-"+a)},addState:function(a){this.hasState(a)||(this.getStateDom().className+=" edui-state-"+a)},removeState:function(a){this.hasState(a)&&b.removeClasses(this.getStateDom(),["edui-state-"+a])},getStateDom:function(){return this.getDom("state")},isChecked:function(){return this.hasState("checked")},setChecked:function(a){!this.isDisabled()&&a?this.addState("checked"):this.removeState("checked")},isDisabled:function(){return this.hasState("disabled")},setDisabled:function(a){a?(this.removeState("hover"),this.removeState("checked"),this.removeState("active"),this.addState("disabled")):this.removeState("disabled")}}}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.UIBase,c=baidu.editor.ui.Stateful,d=baidu.editor.ui.Button=function(a){if(a.name){var b=a.name,c=a.cssRules;a.className||(a.className="edui-for-"+b),a.cssRules=".edui-default .edui-for-"+b+" .edui-icon {"+c+"}"}this.initOptions(a),this.initButton()};d.prototype={uiName:"button",label:"",title:"",showIcon:!0,showText:!0,cssRules:"",initButton:function(){this.initUIBase(),this.Stateful_init(),this.cssRules&&a.cssRule("edui-customize-"+this.name+"-style",this.cssRules)},getHtmlTpl:function(){return'
    '+(this.showIcon?'
    ':"")+(this.showText?'
    '+this.label+"
    ":"")+"
    "},postRender:function(){this.Stateful_postRender(),this.setDisabled(this.disabled)},_onMouseDown:function(a){var b=a.target||a.srcElement,c=b&&b.tagName&&b.tagName.toLowerCase();if("input"==c||"object"==c||"object"==c)return!1},_onClick:function(){this.isDisabled()||this.fireEvent("click")},setTitle:function(a){var b=this.getDom("label");b.innerHTML=a}},a.inherits(d,b),a.extend(d.prototype,c)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=(baidu.editor.dom.domUtils,baidu.editor.ui.UIBase),d=baidu.editor.ui.Stateful,e=baidu.editor.ui.SplitButton=function(a){this.initOptions(a),this.initSplitButton()};e.prototype={popup:null,uiName:"splitbutton",title:"",initSplitButton:function(){this.initUIBase(),this.Stateful_init();if(null!=this.popup){var a=this.popup;this.popup=null,this.setPopup(a)}},_UIBase_postRender:c.prototype.postRender,postRender:function(){this.Stateful_postRender(),this._UIBase_postRender()},setPopup:function(c){this.popup!==c&&(null!=this.popup&&this.popup.dispose(),c.addListener("show",a.bind(this._onPopupShow,this)),c.addListener("hide",a.bind(this._onPopupHide,this)),c.addListener("postrender",a.bind(function(){c.getDom("body").appendChild(b.createElementByHtml('
    ')),c.getDom().className+=" "+this.className},this)),this.popup=c)},_onPopupShow:function(){this.addState("opened")},_onPopupHide:function(){this.removeState("opened")},getHtmlTpl:function(){return'
    '},showPopup:function(){var a=b.getClientRect(this.getDom());a.top-=this.popup.SHADOW_RADIUS,a.height+=this.popup.SHADOW_RADIUS,this.popup.showAnchorRect(a)},_onArrowClick:function(a,b){this.isDisabled()||this.showPopup()},_onButtonClick:function(){this.isDisabled()||this.fireEvent("buttonclick")}},a.inherits(e,c),a.extend(e.prototype,d,!0)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=baidu.editor.ui.ColorPicker,d=baidu.editor.ui.Popup,e=baidu.editor.ui.SplitButton,f=baidu.editor.ui.ColorButton=function(a){this.initOptions(a),this.initColorButton()};f.prototype={initColorButton:function(){var a=this;this.popup=new d({content:new c({noColorText:a.editor.getLang("clearColor"),editor:a.editor,onpickcolor:function(b,c){a._onPickColor(c)},onpicknocolor:function(b,c){a._onPickNoColor(c)}}),editor:a.editor}),this.initSplitButton()},_SplitButton_postRender:e.prototype.postRender,postRender:function(){this._SplitButton_postRender(),this.getDom("button_body").appendChild(b.createElementByHtml('
    ')),this.getDom().className+=" edui-colorbutton"},setColor:function(a){this.getDom("colorlump").style.backgroundColor=a,this.color=a},_onPickColor:function(a){this.fireEvent("pickcolor",a)!==!1&&(this.setColor(a),this.popup.hide())},_onPickNoColor:function(a){this.fireEvent("picknocolor")!==!1&&this.popup.hide()}},a.inherits(f,e)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.Popup,c=baidu.editor.ui.TablePicker,d=baidu.editor.ui.SplitButton,e=baidu.editor.ui.TableButton=function(a){this.initOptions(a),this.initTableButton()};e.prototype={initTableButton:function(){var a=this;this.popup=new b({content:new c({editor:a.editor,onpicktable:function(b,c,d){ +a._onPickTable(c,d)}}),editor:a.editor}),this.initSplitButton()},_onPickTable:function(a,b){this.fireEvent("picktable",a,b)!==!1&&this.popup.hide()}},a.inherits(e,d)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.UIBase,c=baidu.editor.ui.AutoTypeSetPicker=function(a){this.initOptions(a),this.initAutoTypeSetPicker()};c.prototype={initAutoTypeSetPicker:function(){this.initUIBase()},getHtmlTpl:function(){var a=this.editor,b=a.options.autotypeset,c=a.getLang("autoTypeSet"),d="textAlignValue"+a.uid,e="imageBlockLineValue"+a.uid,f="symbolConverValue"+a.uid;return'
    "+c.mergeLine+'"+c.delLine+'
    "+c.removeFormat+'"+c.indent+'
    "+c.alignment+'"+a.getLang("justifyleft")+'"+a.getLang("justifycenter")+'"+a.getLang("justifyright")+'
    "+c.imageFloat+'"+a.getLang("default")+'"+a.getLang("justifyleft")+'"+a.getLang("justifycenter")+'"+a.getLang("justifyright")+'
    "+c.removeFontsize+'"+c.removeFontFamily+'
    "+c.removeHtml+'
    "+c.pasteFilter+'
    "+c.symbol+'"+c.bdc2sb+'"+c.tobdc+'
    "},_UIBase_render:b.prototype.render},a.inherits(c,b)}(),function(){function a(a){for(var c,d={},e=a.getDom(),f=a.editor.uid,g=null,h=null,i=domUtils.getElementsByTagName(e,"input"),j=i.length-1;c=i[j--];)if(g=c.getAttribute("type"),"checkbox"==g)if(h=c.getAttribute("name"),d[h]&&delete d[h],c.checked){var k=document.getElementById(h+"Value"+f);if(k){if(/input/gi.test(k.tagName))d[h]=k.value;else for(var l,m=k.getElementsByTagName("input"),n=m.length-1;l=m[n--];)if(l.checked){d[h]=l.value;break}}else d[h]=!0}else d[h]=!1;else d[c.getAttribute("value")]=c.checked;for(var o,p=domUtils.getElementsByTagName(e,"select"),j=0;o=p[j++];){var q=o.getAttribute("name");d[q]=d[q]?o.value:""}b.extend(a.editor.options.autotypeset,d),a.editor.setPreferences("autotypeset",d)}var b=baidu.editor.utils,c=baidu.editor.ui.Popup,d=baidu.editor.ui.AutoTypeSetPicker,e=baidu.editor.ui.SplitButton,f=baidu.editor.ui.AutoTypeSetButton=function(a){this.initOptions(a),this.initAutoTypeSetButton()};f.prototype={initAutoTypeSetButton:function(){var b=this;this.popup=new c({content:new d({editor:b.editor}),editor:b.editor,hide:function(){!this._hidden&&this.getDom()&&(a(this),this.getDom().style.display="none",this._hidden=!0,this.fireEvent("hide"))}});var e=0;this.popup.addListener("postRenderAfter",function(){var c=this;if(!e){var d=this.getDom(),f=d.getElementsByTagName("button")[0];f.onclick=function(){a(c),b.editor.execCommand("autotypeset"),c.hide()},domUtils.on(d,"click",function(d){var e=d.target||d.srcElement,f=b.editor.uid;if(e&&"INPUT"==e.tagName){if("imageBlockLine"==e.name||"textAlign"==e.name||"symbolConver"==e.name)for(var g=e.checked,h=document.getElementById(e.name+"Value"+f),i=h.getElementsByTagName("input"),j={imageBlockLine:"none",textAlign:"left",symbolConver:"tobdc"},k=0;k"),e.push('
    '),2===d&&e.push("");return'
    '+e.join("")+"
    "},getStateDom:function(){return this.target},_onClick:function(a){var c=a.target||a.srcElement;/icon/.test(c.className)&&(this.items[c.parentNode.getAttribute("index")].onclick(),b.postHide(a))},_UIBase_render:d.prototype.render},a.inherits(e,d),a.extend(e.prototype,c,!0)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.Stateful,c=baidu.editor.ui.uiUtils,d=baidu.editor.ui.UIBase,e=baidu.editor.ui.PastePicker=function(a){this.initOptions(a),this.initPastePicker()};e.prototype={initPastePicker:function(){this.initUIBase(),this.Stateful_init()},getHtmlTpl:function(){return'
    '+this.editor.getLang("pasteOpt")+'
    '},getStateDom:function(){return this.target},format:function(a){this.editor.ui._isTransfer=!0,this.editor.fireEvent("pasteTransfer",a)},_onClick:function(a){var b=domUtils.getNextDomNode(a),d=c.getViewportRect().height,e=c.getClientRect(b);e.top+e.height>d?b.style.top=-e.height-a.offsetHeight+"px":b.style.top="",/hidden/gi.test(domUtils.getComputedStyle(b,"visibility"))?(b.style.visibility="visible",domUtils.addClass(a,"edui-state-opened")):(b.style.visibility="hidden",domUtils.removeClasses(a,"edui-state-opened"))},_UIBase_render:d.prototype.render},a.inherits(e,d),a.extend(e.prototype,b,!0)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=baidu.editor.ui.UIBase,d=baidu.editor.ui.Toolbar=function(a){this.initOptions(a),this.initToolbar()};d.prototype={items:null,initToolbar:function(){this.items=this.items||[],this.initUIBase()},add:function(a,b){void 0===b?this.items.push(a):this.items.splice(b,0,a)},getHtmlTpl:function(){for(var a=[],b=0;b'+a.join("")+""},postRender:function(){for(var a=this.getDom(),c=0;c
    '},postRender:function(){},queryAutoHide:function(){return!0}};h.prototype={items:null,uiName:"menu",initMenu:function(){this.items=this.items||[],this.initPopup(),this.initItems()},initItems:function(){for(var a=0;a'+a.join("")+""},_Popup_postRender:e.prototype.postRender,postRender:function(){for(var a=this,d=0;d
    '+this.renderLabelHtml()+"
    "},postRender:function(){var a=this;this.addListener("over",function(){a.ownerMenu.fireEvent("submenuover",a),a.subMenu&&a.delayShowSubMenu()}),this.subMenu&&(this.getDom().className+=" edui-hassubmenu",this.subMenu.render(),this.addListener("out",function(){a.delayHideSubMenu()}),this.subMenu.addListener("over",function(){clearTimeout(a._closingTimer),a._closingTimer=null,a.addState("opened")}),this.ownerMenu.addListener("hide",function(){a.hideSubMenu()}),this.ownerMenu.addListener("submenuover",function(b,c){c!==a&&a.delayHideSubMenu()}),this.subMenu._bakQueryAutoHide=this.subMenu.queryAutoHide,this.subMenu.queryAutoHide=function(b){return(!b||!c.contains(a.getDom(),b))&&this._bakQueryAutoHide(b)}),this.getDom().style.tabIndex="-1",c.makeUnselectable(this.getDom()),this.Stateful_postRender()},delayShowSubMenu:function(){var a=this;a.isDisabled()||(a.addState("opened"),clearTimeout(a._showingTimer),clearTimeout(a._closingTimer),a._closingTimer=null,a._showingTimer=setTimeout(function(){a.showSubMenu()},250))},delayHideSubMenu:function(){var a=this;a.isDisabled()||(a.removeState("opened"),clearTimeout(a._showingTimer),a._closingTimer||(a._closingTimer=setTimeout(function(){a.hasState("opened")||a.hideSubMenu(),a._closingTimer=null},400)))},renderLabelHtml:function(){return'
    '+(this.label||"")+"
    "},getStateDom:function(){return this.getDom()},queryAutoHide:function(a){if(this.subMenu&&this.hasState("opened"))return this.subMenu.queryAutoHide(a)},_onClick:function(a,b){this.hasState("disabled")||this.fireEvent("click",a,b)!==!1&&(this.subMenu?this.showSubMenu():e.postHide(a))},showSubMenu:function(){var a=c.getClientRect(this.getDom());a.right-=5,a.left+=2,a.width-=7,a.top-=4,a.bottom+=4,a.height+=8,this.subMenu.showAnchorRect(a,!0,!0)},hideSubMenu:function(){this.subMenu.hide()}},a.inherits(j,d),a.extend(j.prototype,f,!0)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=baidu.editor.ui.Menu,d=baidu.editor.ui.SplitButton,e=baidu.editor.ui.Combox=function(a){this.initOptions(a),this.initCombox()};e.prototype={uiName:"combox",onbuttonclick:function(){this.showPopup()},initCombox:function(){var a=this;this.items=this.items||[];for(var b=0;bd.right&&(g=d.right-e.width);var h=a.top;h+e.height>d.bottom&&(h=d.bottom-e.height),c.style.left=Math.max(g,0)+"px",c.style.top=Math.max(h,0)+"px"},showAtCenter:function(){var a=f.getViewportRect();if(this.fullscreen){var b=this.getDom(),c=this.getDom("content");b.style.display="block";var d=UE.ui.uiUtils.getClientRect(b),g=UE.ui.uiUtils.getClientRect(c);b.style.left="-100000px",c.style.width=a.width-d.width+g.width+"px",c.style.height=a.height-d.height+g.height+"px",b.style.width=a.width+"px",b.style.height=a.height+"px",b.style.left=0,this._originalContext={html:{overflowX:document.documentElement.style.overflowX,overflowY:document.documentElement.style.overflowY},body:{overflowX:document.body.style.overflowX,overflowY:document.body.style.overflowY}},document.documentElement.style.overflowX="hidden",document.documentElement.style.overflowY="hidden",document.body.style.overflowX="hidden",document.body.style.overflowY="hidden"}else{this.getDom().style.display="";var h=this.fitSize(),i=0|this.getDom("titlebar").offsetHeight,j=a.width/2-h.width/2,k=a.height/2-(h.height-i)/2-i,l=this.getDom();this.safeSetOffset({left:Math.max(0|j,0),top:Math.max(0|k,0)}),e.hasClass(l,"edui-state-centered")||(l.className+=" edui-state-centered")}this._show()},getContentHtml:function(){var a="";return"string"==typeof this.content?a=this.content:this.iframeUrl&&(a=''),a},getHtmlTpl:function(){var a="";if(this.buttons){for(var b=[],c=0;c
    '+b.join("")+"
    "}return'
    '+(this.title||"")+"
    "+this.closeButton.renderHtml()+'
    '+(this.autoReset?"":this.getContentHtml())+"
    "+a+"
    "},postRender:function(){this.modalMask.getDom()||(this.modalMask.render(),this.modalMask.hide()),this.dragMask.getDom()||(this.dragMask.render(),this.dragMask.hide());var a=this;if(this.addListener("show",function(){a.modalMask.show(this.getDom().style.zIndex-2)}),this.addListener("hide",function(){a.modalMask.hide()}),this.buttons)for(var b=0;b',a.editor.container.style.zIndex&&(this.getDom().style.zIndex=1*a.editor.container.style.zIndex+1))}}),this.onbuttonclick=function(){this.showPopup()},this.initSplitButton()}},a.inherits(d,c)}(),function(){function a(a){var b=a.target||a.srcElement,c=g.findParent(b,function(a){return g.hasClass(a,"edui-shortcutmenu")||g.hasClass(a,"edui-popup")},!0);if(!c)for(var d,e=0;d=h[e++];)d.hide()}var b,c=baidu.editor.ui,d=c.UIBase,e=c.uiUtils,f=baidu.editor.utils,g=baidu.editor.dom.domUtils,h=[],i=!1,j=c.ShortCutMenu=function(a){this.initOptions(a),this.initShortCutMenu()};j.postHide=a,j.prototype={isHidden:!0,SPACE:5,initShortCutMenu:function(){this.items=this.items||[],this.initUIBase(),this.initItems(),this.initEvent(),h.push(this)},initEvent:function(){var a=this,c=a.editor.document;g.on(c,"mousemove",function(c){if(a.isHidden===!1){if(a.getSubMenuMark()||"contextmenu"==a.eventType)return;var d=!0,e=a.getDom(),f=e.offsetWidth,g=e.offsetHeight,h=f/2+a.SPACE,i=g/2,j=Math.abs(c.screenX-a.left),k=Math.abs(c.screenY-a.top);clearTimeout(b),b=setTimeout(function(){k>0&&ki&&ki+70&&k0&&jh&&jh+70&&j'+a+""}},f.inherits(j,d),g.on(document,"mousedown",function(b){a(b)}),g.on(window,"scroll",function(b){a(b)})}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.UIBase,c=baidu.editor.ui.Breakline=function(a){this.initOptions(a),this.initSeparator()};c.prototype={uiName:"Breakline",initSeparator:function(){this.initUIBase()},getHtmlTpl:function(){return"
    "}},a.inherits(c,b)}(),function(){var a=baidu.editor.utils,b=baidu.editor.dom.domUtils,c=baidu.editor.ui.UIBase,d=baidu.editor.ui.Message=function(a){this.initOptions(a),this.initMessage()};d.prototype={initMessage:function(){this.initUIBase()},getHtmlTpl:function(){return'
    ×
    '},reset:function(a){var b=this;a.keepshow||(clearTimeout(this.timer),b.timer=setTimeout(function(){b.hide()},a.timeout||4e3)),void 0!==a.content&&b.setContent(a.content),void 0!==a.type&&b.setType(a.type),b.show()},postRender:function(){var a=this,c=this.getDom("closer");c&&b.on(c,"click",function(){a.hide()})},setContent:function(a){this.getDom("content").innerHTML=a},setType:function(a){a=a||"info";var b=this.getDom("body");b.className=b.className.replace(/edui-message-type-[\w-]+/,"edui-message-type-"+a)},getContent:function(){return this.getDom("content").innerHTML},getType:function(){var a=this.getDom("body").match(/edui-message-type-([\w-]+)/);return a?a[1]:""},show:function(){this.getDom().style.display="block"},hide:function(){var a=this.getDom();a&&(a.style.display="none",a.parentNode&&a.parentNode.removeChild(a))}},a.inherits(d,c)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui,c=b.Dialog;b.buttons={},b.Dialog=function(a){var b=new c(a);return b.addListener("hide",function(){if(b.editor){var a=b.editor;try{if(browser.gecko){var c=a.window.scrollY,d=a.window.scrollX;a.body.focus(),a.window.scrollTo(d,c)}else a.focus()}catch(e){}}}),b};for(var d,e={anchor:"~/dialogs/anchor/anchor.html",insertimage:"~/dialogs/image/image.html",link:"~/dialogs/link/link.html",spechars:"~/dialogs/spechars/spechars.html",searchreplace:"~/dialogs/searchreplace/searchreplace.html",map:"~/dialogs/map/map.html",gmap:"~/dialogs/gmap/gmap.html",insertvideo:"~/dialogs/video/video.html",help:"~/dialogs/help/help.html",preview:"~/dialogs/preview/preview.html",emotion:"~/dialogs/emotion/emotion.html",wordimage:"~/dialogs/wordimage/wordimage.html",attachment:"~/dialogs/attachment/attachment.html",insertframe:"~/dialogs/insertframe/insertframe.html",edittip:"~/dialogs/table/edittip.html",edittable:"~/dialogs/table/edittable.html",edittd:"~/dialogs/table/edittd.html",webapp:"~/dialogs/webapp/webapp.html",snapscreen:"~/dialogs/snapscreen/snapscreen.html",scrawl:"~/dialogs/scrawl/scrawl.html",music:"~/dialogs/music/music.html",template:"~/dialogs/template/template.html",background:"~/dialogs/background/background.html",charts:"~/dialogs/charts/charts.html"},f=["undo","redo","formatmatch","bold","italic","underline","fontborder","touppercase","tolowercase","strikethrough","subscript","superscript","source","indent","outdent","blockquote","pasteplain","pagebreak","selectall","print","horizontal","removeformat","time","date","unlink","insertparagraphbeforetable","insertrow","insertcol","mergeright","mergedown","deleterow","deletecol","splittorows","splittocols","splittocells","mergecells","deletetable","drafts"],g=0;d=f[g++];)d=d.toLowerCase(),b[d]=function(a){return function(c){var d=new b.Button({className:"edui-for-"+a,title:c.options.labelMap[a]||c.getLang("labelMap."+a)||"",onclick:function(){c.execCommand(a)},theme:c.options.theme,showText:!1});return b.buttons[a]=d,c.addListener("selectionchange",function(b,e,f){var g=c.queryCommandState(a);g==-1?(d.setDisabled(!0),d.setChecked(!1)):f||(d.setDisabled(!1),d.setChecked(g))}),d}}(d);b.cleardoc=function(a){var c=new b.Button({className:"edui-for-cleardoc",title:a.options.labelMap.cleardoc||a.getLang("labelMap.cleardoc")||"",theme:a.options.theme,onclick:function(){confirm(a.getLang("confirmClear"))&&a.execCommand("cleardoc")}});return b.buttons.cleardoc=c,a.addListener("selectionchange",function(){c.setDisabled(a.queryCommandState("cleardoc")==-1)}),c};var h={justify:["left","right","center","justify"],imagefloat:["none","left","center","right"],directionality:["ltr","rtl"]};for(var i in h)!function(a,c){for(var d,e=0;d=c[e++];)!function(c){b[a.replace("float","")+c]=function(d){var e=new b.Button({className:"edui-for-"+a.replace("float","")+c,title:d.options.labelMap[a.replace("float","")+c]||d.getLang("labelMap."+a.replace("float","")+c)||"",theme:d.options.theme,onclick:function(){d.execCommand(a,c)}});return b.buttons[a]=e,d.addListener("selectionchange",function(b,f,g){e.setDisabled(d.queryCommandState(a)==-1),e.setChecked(d.queryCommandValue(a)==c&&!g)}),e}}(d)}(i,h[i]);for(var d,g=0;d=["backcolor","forecolor"][g++];)b[d]=function(a){return function(c){var d=new b.ColorButton({className:"edui-for-"+a,color:"default",title:c.options.labelMap[a]||c.getLang("labelMap."+a)||"",editor:c,onpickcolor:function(b,d){ +c.execCommand(a,d)},onpicknocolor:function(){c.execCommand(a,"default"),this.setColor("transparent"),this.color="default"},onbuttonclick:function(){c.execCommand(a,this.color)}});return b.buttons[a]=d,c.addListener("selectionchange",function(){d.setDisabled(c.queryCommandState(a)==-1)}),d}}(d);var j={noOk:["searchreplace","help","spechars","webapp","preview"],ok:["attachment","anchor","link","insertimage","map","gmap","insertframe","wordimage","insertvideo","insertframe","edittip","edittable","edittd","scrawl","template","music","background","charts"]};for(var i in j)!function(c,d){for(var f,g=0;f=d[g++];)browser.opera&&"searchreplace"===f||!function(d){b[d]=function(f,g,h){g=g||(f.options.iframeUrlMap||{})[d]||e[d],h=f.options.labelMap[d]||f.getLang("labelMap."+d)||"";var i;g&&(i=new b.Dialog(a.extend({iframeUrl:f.ui.mapUrl(g),editor:f,className:"edui-for-"+d,title:h,holdScroll:"insertimage"===d,fullscreen:/charts|preview/.test(d),closeDialog:f.getLang("closeDialog")},"ok"==c?{buttons:[{className:"edui-okbutton",label:f.getLang("ok"),editor:f,onclick:function(){i.close(!0)}},{className:"edui-cancelbutton",label:f.getLang("cancel"),editor:f,onclick:function(){i.close(!1)}}]}:{})),f.ui._dialogs[d+"Dialog"]=i);var j=new b.Button({className:"edui-for-"+d,title:h,onclick:function(){if(i)switch(d){case"wordimage":var a=f.execCommand("wordimage");a&&a.length&&(i.render(),i.open());break;case"scrawl":f.queryCommandState("scrawl")!=-1&&(i.render(),i.open());break;default:i.render(),i.open()}},theme:f.options.theme,disabled:"scrawl"==d&&f.queryCommandState("scrawl")==-1||"charts"==d});return b.buttons[d]=j,f.addListener("selectionchange",function(){var a={edittable:1};if(!(d in a)){var b=f.queryCommandState(d);j.getDom()&&(j.setDisabled(b==-1),j.setChecked(b))}}),j}}(f.toLowerCase())}(i,j[i]);b.snapscreen=function(a,c,d){d=a.options.labelMap.snapscreen||a.getLang("labelMap.snapscreen")||"";var f=new b.Button({className:"edui-for-snapscreen",title:d,onclick:function(){a.execCommand("snapscreen")},theme:a.options.theme});if(b.buttons.snapscreen=f,c=c||(a.options.iframeUrlMap||{}).snapscreen||e.snapscreen){var g=new b.Dialog({iframeUrl:a.ui.mapUrl(c),editor:a,className:"edui-for-snapscreen",title:d,buttons:[{className:"edui-okbutton",label:a.getLang("ok"),editor:a,onclick:function(){g.close(!0)}},{className:"edui-cancelbutton",label:a.getLang("cancel"),editor:a,onclick:function(){g.close(!1)}}]});g.render(),a.ui._dialogs.snapscreenDialog=g}return a.addListener("selectionchange",function(){f.setDisabled(a.queryCommandState("snapscreen")==-1)}),f},b.insertcode=function(c,d,e){d=c.options.insertcode||[],e=c.options.labelMap.insertcode||c.getLang("labelMap.insertcode")||"";var f=[];a.each(d,function(a,b){f.push({label:a,value:b,theme:c.options.theme,renderLabelHtml:function(){return'
    '+(this.label||"")+"
    "}})});var g=new b.Combox({editor:c,items:f,onselect:function(a,b){c.execCommand("insertcode",this.items[b].value)},onbuttonclick:function(){this.showPopup()},title:e,initValue:e,className:"edui-for-insertcode",indexByValue:function(a){if(a)for(var b,c=0;b=this.items[c];c++)if(b.value.indexOf(a)!=-1)return c;return-1}});return b.buttons.insertcode=g,c.addListener("selectionchange",function(a,b,d){if(!d){var f=c.queryCommandState("insertcode");if(f==-1)g.setDisabled(!0);else{g.setDisabled(!1);var h=c.queryCommandValue("insertcode");if(!h)return void g.setValue(e);h&&(h=h.replace(/['"]/g,"").split(",")[0]),g.setValue(h)}}}),g},b.fontfamily=function(c,d,e){if(d=c.options.fontfamily||[],e=c.options.labelMap.fontfamily||c.getLang("labelMap.fontfamily")||"",d.length){for(var f,g=0,h=[];f=d[g];g++){var i=c.getLang("fontfamily")[f.name]||"";!function(b,d){h.push({label:b,value:d,theme:c.options.theme,renderLabelHtml:function(){return'
    '+(this.label||"")+"
    "}})}(f.label||i,f.val)}var j=new b.Combox({editor:c,items:h,onselect:function(a,b){c.execCommand("FontFamily",this.items[b].value)},onbuttonclick:function(){this.showPopup()},title:e,initValue:e,className:"edui-for-fontfamily",indexByValue:function(a){if(a)for(var b,c=0;b=this.items[c];c++)if(b.value.indexOf(a)!=-1)return c;return-1}});return b.buttons.fontfamily=j,c.addListener("selectionchange",function(a,b,d){if(!d){var e=c.queryCommandState("FontFamily");if(e==-1)j.setDisabled(!0);else{j.setDisabled(!1);var f=c.queryCommandValue("FontFamily");f&&(f=f.replace(/['"]/g,"").split(",")[0]),j.setValue(f)}}}),j}},b.fontsize=function(a,c,d){if(d=a.options.labelMap.fontsize||a.getLang("labelMap.fontsize")||"",c=c||a.options.fontsize||[],c.length){for(var e=[],f=0;f'+(this.label||"")+""}})}var h=new b.Combox({editor:a,items:e,title:d,initValue:d,onselect:function(b,c){a.execCommand("FontSize",this.items[c].value)},onbuttonclick:function(){this.showPopup()},className:"edui-for-fontsize"});return b.buttons.fontsize=h,a.addListener("selectionchange",function(b,c,d){if(!d){var e=a.queryCommandState("FontSize");e==-1?h.setDisabled(!0):(h.setDisabled(!1),h.setValue(a.queryCommandValue("FontSize")))}}),h}},b.paragraph=function(c,d,e){if(e=c.options.labelMap.paragraph||c.getLang("labelMap.paragraph")||"",d=c.options.paragraph||[],!a.isEmptyObject(d)){var f=[];for(var g in d)f.push({value:g,label:d[g]||c.getLang("paragraph")[g],theme:c.options.theme,renderLabelHtml:function(){return'
    '+(this.label||"")+"
    "}});var h=new b.Combox({editor:c,items:f,title:e,initValue:e,className:"edui-for-paragraph",onselect:function(a,b){c.execCommand("Paragraph",this.items[b].value)},onbuttonclick:function(){this.showPopup()}});return b.buttons.paragraph=h,c.addListener("selectionchange",function(a,b,d){if(!d){var e=c.queryCommandState("Paragraph");if(e==-1)h.setDisabled(!0);else{h.setDisabled(!1);var f=c.queryCommandValue("Paragraph"),g=h.indexByValue(f);g!=-1?h.setValue(f):h.setValue(h.initValue)}}}),h}},b.customstyle=function(a){var c=a.options.customstyle||[],d=a.options.labelMap.customstyle||a.getLang("labelMap.customstyle")||"";if(c.length){for(var e,f=a.getLang("customstyle"),g=0,h=[];e=c[g++];)!function(b){var c={};c.label=b.label?b.label:f[b.name],c.style=b.style,c.className=b.className,c.tag=b.tag,h.push({label:c.label,value:c,theme:a.options.theme,renderLabelHtml:function(){return'
    <'+c.tag+" "+(c.className?' class="'+c.className+'"':"")+(c.style?' style="'+c.style+'"':"")+">"+c.label+"
    "}})}(e);var i=new b.Combox({editor:a,items:h,title:d,initValue:d,className:"edui-for-customstyle",onselect:function(b,c){a.execCommand("customstyle",this.items[c].value)},onbuttonclick:function(){this.showPopup()},indexByValue:function(a){for(var b,c=0;b=this.items[c++];)if(b.label==a)return c-1;return-1}});return b.buttons.customstyle=i,a.addListener("selectionchange",function(b,c,d){if(!d){var e=a.queryCommandState("customstyle");if(e==-1)i.setDisabled(!0);else{i.setDisabled(!1);var f=a.queryCommandValue("customstyle"),g=i.indexByValue(f);g!=-1?i.setValue(f):i.setValue(i.initValue)}}}),i}},b.inserttable=function(a,c,d){d=a.options.labelMap.inserttable||a.getLang("labelMap.inserttable")||"";var e=new b.TableButton({editor:a,title:d,className:"edui-for-inserttable",onpicktable:function(b,c,d){a.execCommand("InsertTable",{numRows:d,numCols:c,border:1})},onbuttonclick:function(){this.showPopup()}});return b.buttons.inserttable=e,a.addListener("selectionchange",function(){e.setDisabled(a.queryCommandState("inserttable")==-1)}),e},b.lineheight=function(a){var c=a.options.lineheight||[];if(c.length){for(var d,e=0,f=[];d=c[e++];)f.push({label:d,value:d,theme:a.options.theme,onclick:function(){a.execCommand("lineheight",this.value)}});var g=new b.MenuButton({editor:a,className:"edui-for-lineheight",title:a.options.labelMap.lineheight||a.getLang("labelMap.lineheight")||"",items:f,onbuttonclick:function(){var b=a.queryCommandValue("LineHeight")||this.value;a.execCommand("LineHeight",b)}});return b.buttons.lineheight=g,a.addListener("selectionchange",function(){var b=a.queryCommandState("LineHeight");if(b==-1)g.setDisabled(!0);else{g.setDisabled(!1);var c=a.queryCommandValue("LineHeight");c&&g.setValue((c+"").replace(/cm/,"")),g.setChecked(b)}}),g}};for(var k,l=["top","bottom"],m=0;k=l[m++];)!function(a){b["rowspacing"+a]=function(c){var d=c.options["rowspacing"+a]||[];if(!d.length)return null;for(var e,f=0,g=[];e=d[f++];)g.push({label:e,value:e,theme:c.options.theme,onclick:function(){c.execCommand("rowspacing",this.value,a)}});var h=new b.MenuButton({editor:c,className:"edui-for-rowspacing"+a,title:c.options.labelMap["rowspacing"+a]||c.getLang("labelMap.rowspacing"+a)||"",items:g,onbuttonclick:function(){var b=c.queryCommandValue("rowspacing",a)||this.value;c.execCommand("rowspacing",b,a)}});return b.buttons[a]=h,c.addListener("selectionchange",function(){var b=c.queryCommandState("rowspacing",a);if(b==-1)h.setDisabled(!0);else{h.setDisabled(!1);var d=c.queryCommandValue("rowspacing",a);d&&h.setValue((d+"").replace(/%/,"")),h.setChecked(b)}}),h}}(k);for(var n,o=["insertorderedlist","insertunorderedlist"],p=0;n=o[p++];)!function(a){b[a]=function(c){var d=c.options[a],e=function(){c.execCommand(a,this.value)},f=[];for(var g in d)f.push({label:d[g]||c.getLang()[a][g]||"",value:g,theme:c.options.theme,onclick:e});var h=new b.MenuButton({editor:c,className:"edui-for-"+a,title:c.getLang("labelMap."+a)||"",items:f,onbuttonclick:function(){var b=c.queryCommandValue(a)||this.value;c.execCommand(a,b)}});return b.buttons[a]=h,c.addListener("selectionchange",function(){var b=c.queryCommandState(a);if(b==-1)h.setDisabled(!0);else{h.setDisabled(!1);var d=c.queryCommandValue(a);h.setValue(d),h.setChecked(b)}}),h}}(n);b.fullscreen=function(a,c){c=a.options.labelMap.fullscreen||a.getLang("labelMap.fullscreen")||"";var d=new b.Button({className:"edui-for-fullscreen",title:c,theme:a.options.theme,onclick:function(){a.ui&&a.ui.setFullScreen(!a.ui.isFullScreen()),this.setChecked(a.ui.isFullScreen())}});return b.buttons.fullscreen=d,a.addListener("selectionchange",function(){var b=a.queryCommandState("fullscreen");d.setDisabled(b==-1),d.setChecked(a.ui.isFullScreen())}),d},b.emotion=function(a,c){var d="emotion",f=new b.MultiMenuPop({title:a.options.labelMap[d]||a.getLang("labelMap."+d)||"",editor:a,className:"edui-for-"+d,iframeUrl:a.ui.mapUrl(c||(a.options.iframeUrlMap||{})[d]||e[d])});return b.buttons[d]=f,a.addListener("selectionchange",function(){f.setDisabled(a.queryCommandState(d)==-1)}),f},b.autotypeset=function(a){var c=new b.AutoTypeSetButton({editor:a,title:a.options.labelMap.autotypeset||a.getLang("labelMap.autotypeset")||"",className:"edui-for-autotypeset",onbuttonclick:function(){a.execCommand("autotypeset")}});return b.buttons.autotypeset=c,a.addListener("selectionchange",function(){c.setDisabled(a.queryCommandState("autotypeset")==-1)}),c},b.simpleupload=function(a){var c="simpleupload",d=new b.Button({className:"edui-for-"+c,title:a.options.labelMap[c]||a.getLang("labelMap."+c)||"",onclick:function(){},theme:a.options.theme,showText:!1});return b.buttons[c]=d,a.addListener("ready",function(){var b=d.getDom("body"),c=b.children[0];a.fireEvent("simpleuploadbtnready",c)}),a.addListener("selectionchange",function(b,e,f){var g=a.queryCommandState(c);g==-1?(d.setDisabled(!0),d.setChecked(!1)):f||(d.setDisabled(!1),d.setChecked(g))}),d}}(),function(){function a(a){this.initOptions(a),this.initEditorUI()}var b=baidu.editor.utils,c=baidu.editor.ui.uiUtils,d=baidu.editor.ui.UIBase,e=baidu.editor.dom.domUtils,f=[];a.prototype={uiName:"editor",initEditorUI:function(){function a(a,b){a.setOpt({wordCount:!0,maximumWords:1e4,wordCountMsg:a.options.wordCountMsg||a.getLang("wordCountMsg"),wordOverFlowMsg:a.options.wordOverFlowMsg||a.getLang("wordOverFlowMsg")});var c=a.options,d=c.maximumWords,e=c.wordCountMsg,f=c.wordOverFlowMsg,g=b.getDom("wordcount");if(c.wordCount){var h=a.getContentLength(!0);h>d?(g.innerHTML=f,a.fireEvent("wordcountoverflow")):g.innerHTML=e.replace("{#leave}",d-h).replace("{#count}",h)}}this.editor.ui=this,this._dialogs={},this.initUIBase(),this._initToolbars();var b=this.editor,c=this;b.addListener("ready",function(){function d(){a(b,c),e.un(b.document,"click",arguments.callee)}b.getDialog=function(a){return b.ui._dialogs[a+"Dialog"]},e.on(b.window,"scroll",function(a){baidu.editor.ui.Popup.postHide(a)}),b.ui._actualFrameWidth=b.options.initialFrameWidth,UE.browser.ie&&6===UE.browser.version&&b.container.ownerDocument.execCommand("BackgroundImageCache",!1,!0),b.options.elementPathEnabled&&(b.ui.getDom("elementpath").innerHTML='
    '+b.getLang("elementPathTip")+":
    "),b.options.wordCount&&(e.on(b.document,"click",d),b.ui.getDom("wordcount").innerHTML=b.getLang("wordCountTip")),b.ui._scale(),b.options.scaleEnabled?(b.autoHeightEnabled&&b.disableAutoHeight(),c.enableScale()):c.disableScale(),b.options.elementPathEnabled||b.options.wordCount||b.options.scaleEnabled||(b.ui.getDom("elementpath").style.display="none",b.ui.getDom("wordcount").style.display="none",b.ui.getDom("scale").style.display="none"),b.selection.isFocus()&&b.fireEvent("selectionchange",!1,!0)}),b.addListener("mousedown",function(a,b){var c=b.target||b.srcElement;baidu.editor.ui.Popup.postHide(b,c),baidu.editor.ui.ShortCutMenu.postHide(b)}),b.addListener("delcells",function(){UE.ui.edittip&&new UE.ui.edittip(b),b.getDialog("edittip").open()});var d,f,g=!1;b.addListener("afterpaste",function(){b.queryCommandState("pasteplain")||(baidu.editor.ui.PastePicker&&(d=new baidu.editor.ui.Popup({content:new baidu.editor.ui.PastePicker({editor:b}),editor:b,className:"edui-wordpastepop"}),d.render()),g=!0)}),b.addListener("afterinserthtml",function(){clearTimeout(f),f=setTimeout(function(){if(d&&(g||b.ui._isTransfer)){if(d.isHidden()){var a=e.createElement(b.document,"span",{style:"line-height:0px;",innerHTML:"\ufeff"}),c=b.selection.getRange();c.insertNode(a);var f=getDomNode(a,"firstChild","previousSibling");f&&d.showAnchor(3==f.nodeType?f.parentNode:f),e.remove(a)}else d.show();delete b.ui._isTransfer,g=!1}},200)}),b.addListener("contextmenu",function(a,b){baidu.editor.ui.Popup.postHide(b)}),b.addListener("keydown",function(a,b){d&&d.dispose(b);var c=b.keyCode||b.which;b.altKey&&90==c&&UE.ui.buttons.fullscreen.onclick()}),b.addListener("wordcount",function(b){a(this,c)}),b.addListener("selectionchange",function(){b.options.elementPathEnabled&&c[(b.queryCommandState("elementpath")==-1?"dis":"en")+"ableElementPath"](),b.options.scaleEnabled&&c[(b.queryCommandState("scale")==-1?"dis":"en")+"ableScale"]()});var h=new baidu.editor.ui.Popup({editor:b,content:"",className:"edui-bubble",_onEditButtonClick:function(){this.hide(),b.ui._dialogs.linkDialog.open()},_onImgEditButtonClick:function(a){this.hide(),b.ui._dialogs[a]&&b.ui._dialogs[a].open()},_onImgSetFloat:function(a){this.hide(),b.execCommand("imagefloat",a)},_setIframeAlign:function(a){var b=h.anchorEl,c=b.cloneNode(!0);switch(a){case-2:c.setAttribute("align","");break;case-1:c.setAttribute("align","left");break;case 1:c.setAttribute("align","right")}b.parentNode.insertBefore(c,b),e.remove(b),h.anchorEl=c,h.showAnchor(h.anchorEl)},_updateIframe:function(){var a=b._iframe=h.anchorEl;e.hasClass(a,"ueditor_baidumap")?(b.selection.getRange().selectNode(a).select(),b.ui._dialogs.mapDialog.open(),h.hide()):(b.ui._dialogs.insertframeDialog.open(),h.hide())},_onRemoveButtonClick:function(a){b.execCommand(a),this.hide()},queryAutoHide:function(a){return a&&a.ownerDocument==b.document&&("img"==a.tagName.toLowerCase()||e.findParentByTagName(a,"a",!0))?a!==h.anchorEl:baidu.editor.ui.Popup.prototype.queryAutoHide.call(this,a)}});h.render(),b.options.imagePopup&&(b.addListener("mouseover",function(a,c){c=c||window.event;var d=c.target||c.srcElement;if(b.ui._dialogs.insertframeDialog&&/iframe/gi.test(d.tagName)){var e=h.formatHtml(""+b.getLang("property")+': '+b.getLang("default")+'  '+b.getLang("justifyleft")+'  '+b.getLang("justifyright")+'   '+b.getLang("modify")+"");e?(h.getDom("content").innerHTML=e,h.anchorEl=d,h.showAnchor(h.anchorEl)):h.hide()}}),b.addListener("selectionchange",function(a,c){if(c){var d="",f="",g=b.selection.getRange().getClosedNode(),i=b.ui._dialogs;if(g&&"IMG"==g.tagName){var j="insertimageDialog";if(g.className.indexOf("edui-faked-video")==-1&&g.className.indexOf("edui-upload-video")==-1||(j="insertvideoDialog"),g.className.indexOf("edui-faked-webapp")!=-1&&(j="webappDialog"),g.src.indexOf("http://api.map.baidu.com")!=-1&&(j="mapDialog"),g.className.indexOf("edui-faked-music")!=-1&&(j="musicDialog"),g.src.indexOf("http://maps.google.com/maps/api/staticmap")!=-1&&(j="gmapDialog"),g.getAttribute("anchorname")&&(j="anchorDialog",d=h.formatHtml(""+b.getLang("property")+': '+b.getLang("modify")+"  "+b.getLang("delete")+"")),g.getAttribute("word_img")&&(b.word_img=[g.getAttribute("word_img")],j="wordimageDialog"),(e.hasClass(g,"loadingclass")||e.hasClass(g,"loaderrorclass"))&&(j=""),!i[j])return;f=""+b.getLang("property")+': '+b.getLang("default")+'  '+b.getLang("justifyleft")+'  '+b.getLang("justifyright")+'  '+b.getLang("justifycenter")+"  '+b.getLang("modify")+"",!d&&(d=h.formatHtml(f))}if(b.ui._dialogs.linkDialog){var k,l=b.queryCommandValue("link");if(l&&(k=l.getAttribute("_href")||l.getAttribute("href",2))){var m=k;k.length>30&&(m=k.substring(0,20)+"..."),d&&(d+='
    '),d+=h.formatHtml(""+b.getLang("anthorMsg")+': '+m+' '+b.getLang("modify")+' '+b.getLang("clear")+""),h.showAnchor(l)}}d?(h.getDom("content").innerHTML=d,h.anchorEl=g||l,h.showAnchor(h.anchorEl)):h.hide()}}))},_initToolbars:function(){for(var a=this.editor,b=this.toolbars||[],c=[],d=0;d
    '+(this.toolbars.length?'
    '+this.renderToolbarBoxHtml()+"
    ":"")+'
    '},showWordImageDialog:function(){this._dialogs.wordimageDialog.open()},renderToolbarBoxHtml:function(){for(var a=[],b=0;b'+c+"");b.innerHTML='
    '+this.editor.getLang("elementPathTip")+": "+d.join(" > ")+"
    "}else b.style.display="none"},disableElementPath:function(){var a=this.getDom("elementpath");a.innerHTML="",a.style.display="none",this.elementPathEnabled=!1},enableElementPath:function(){var a=this.getDom("elementpath");a.style.display="",this.elementPathEnabled=!0,this._updateElementPath()},_scale:function(){function a(){o=e.getXY(h),p||(p=g.options.minFrameHeight+j.offsetHeight+k.offsetHeight),m.style.cssText="position:absolute;left:0;display:;top:0;background-color:#41ABFF;opacity:0.4;filter: Alpha(opacity=40);width:"+h.offsetWidth+"px;height:"+h.offsetHeight+"px;z-index:"+(g.options.zIndex+1),e.on(f,"mousemove",b),e.on(i,"mouseup",c),e.on(f,"mouseup",c)}function b(a){d();var b=a||window.event;r=b.pageX||f.documentElement.scrollLeft+b.clientX,s=b.pageY||f.documentElement.scrollTop+b.clientY,t=r-o.x,u=s-o.y,t>=q&&(n=!0,m.style.width=t+"px"),u>=p&&(n=!0,m.style.height=u+"px")}function c(){n&&(n=!1,g.ui._actualFrameWidth=m.offsetWidth-2,h.style.width=g.ui._actualFrameWidth+"px",g.setHeight(m.offsetHeight-k.offsetHeight-j.offsetHeight-2,!0)),m&&(m.style.display="none"),d(),e.un(f,"mousemove",b),e.un(i,"mouseup",c),e.un(f,"mouseup",c)}function d(){browser.ie?f.selection.clear():window.getSelection().removeAllRanges()}var f=document,g=this.editor,h=g.container,i=g.document,j=this.getDom("toolbarbox"),k=this.getDom("bottombar"),l=this.getDom("scale"),m=this.getDom("scalelayer"),n=!1,o=null,p=0,q=g.options.minFrameWidth,r=0,s=0,t=0,u=0,v=this;this.editor.addListener("fullscreenchanged",function(a,b){if(b)v.disableScale();else if(v.editor.options.scaleEnabled){v.enableScale();var c=v.editor.document.createElement("span");v.editor.body.appendChild(c),v.editor.body.style.height=Math.max(e.getXY(c).y,v.editor.iframe.offsetHeight-20)+"px",e.remove(c)}}),this.enableScale=function(){1!=g.queryCommandState("source")&&(l.style.display="",this.scaleEnabled=!0,e.on(l,"mousedown",a))},this.disableScale=function(){l.style.display="none",this.scaleEnabled=!1,e.un(l,"mousedown",a)}},isFullScreen:function(){return this._fullscreen},postRender:function(){d.prototype.postRender.call(this);for(var a=0;a[\n\r\t]+([ ]{4})+/g,">").replace(/[\n\r\t]+([ ]{4})+[\n\r\t]+<"),c.className&&(b.className=c.className),c.style.cssText&&(b.style.cssText=c.style.cssText),/textarea/i.test(c.tagName)?(d.textarea=c,d.textarea.style.display="none"):c.parentNode.removeChild(c),c.id&&(b.id=c.id,e.removeAttributes(c,"id")),c=b,c.innerHTML=""}e.addClass(c,"edui-"+d.options.theme),d.ui.render(c);var h=d.options;d.container=d.ui.getDom();for(var i,j=e.findParents(c,!0),k=[],l=0;i=j[l];l++)k[l]=i.style.display,i.style.display="block";if(h.initialFrameWidth)h.minFrameWidth=h.initialFrameWidth;else{h.minFrameWidth=h.initialFrameWidth=c.offsetWidth;var m=c.style.width;/%$/.test(m)&&(h.initialFrameWidth=m)}h.initialFrameHeight?h.minFrameHeight=h.initialFrameHeight:h.initialFrameHeight=h.minFrameHeight=c.offsetHeight;for(var i,l=0;i=j[l];l++)i.style.display=k[l];c.style.height&&(c.style.height=""),d.container.style.width=h.initialFrameWidth+(/%$/.test(h.initialFrameWidth)?"":"px"),d.container.style.zIndex=h.zIndex,f.call(d,d.ui.getDom("iframeholder")),d.fireEvent("afteruiready")}d.langIsReady?b():d.addListener("langReady",b)})},d},UE.getEditor=function(a,b){var c=g[a];return c||(c=g[a]=new UE.ui.Editor(b),c.render(a)),c},UE.delEditor=function(a){var b;(b=g[a])&&(b.key&&b.destroy(),delete g[a])},UE.registerUI=function(a,c,d,e){b.each(a.split(/\s+/),function(a){UE._customizeUI[a]={id:e,execFn:c,index:d}})}}(),UE.registerUI("message",function(a){function b(){var a=g.ui.getDom("toolbarbox");a&&(c.style.top=a.offsetHeight+3+"px"),c.style.zIndex=Math.max(g.options.zIndex,g.iframe.style.zIndex)+1}var c,d=baidu.editor.ui,e=d.Message,f=[],g=a;g.addListener("ready",function(){c=document.getElementById(g.ui.id+"_message_holder"),b()}),g.addListener("showmessage",function(a,d){d=utils.isString(d)?{content:d}:d;var h=new e({timeout:d.timeout,type:d.type,content:d.content,keepshow:d.keepshow,editor:g}),i=d.id||"msg_"+(+new Date).toString(36);return h.render(c),f[i]=h,h.reset(d),b(),i}),g.addListener("updatemessage",function(a,b,d){d=utils.isString(d)?{content:d}:d;var e=f[b];e.render(c),e&&e.reset(d)}),g.addListener("hidemessage",function(a,b){var c=f[b];c&&c.hide()})}),UE.registerUI("autosave",function(a){var b=null,c=null;a.on("afterautosave",function(){clearTimeout(b),b=setTimeout(function(){c&&a.trigger("hidemessage",c),c=a.trigger("showmessage",{content:a.getLang("autosave.success"),timeout:2e3})},2e3)})})}(); \ No newline at end of file diff --git a/public/static/Ueditor/ueditor.config.js b/public/static/Ueditor/ueditor.config.js new file mode 100644 index 0000000..f9384b1 --- /dev/null +++ b/public/static/Ueditor/ueditor.config.js @@ -0,0 +1,482 @@ +/** + * ueditor完整配置项 + * 可以在这里配置整个编辑器的特性 + */ +/** ************************提示******************************** + * 所有被注释的配置项均为UEditor默认值。 + * 修改默认配置请首先确保已经完全明确该参数的真实用途。 + * 主要有两种修改方案,一种是取消此处注释,然后修改成对应参数;另一种是在实例化编辑器时传入对应参数。 + * 当升级编辑器时,可直接使用旧版配置文件替换新版配置文件,不用担心旧版配置文件中因缺少新功能所需的参数而导致脚本报错。 + **************************提示********************************/ + +(function () { + /** + * 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。 + * 鉴于很多同学在使用编辑器的时候出现的种种路径问题,此处强烈建议大家使用"相对于网站根目录的相对路径"进行配置。 + * "相对于网站根目录的相对路径"也就是以斜杠开头的形如"/myProject/ueditor/"这样的路径。 + * 如果站点中有多个不在同一层级的页面需要实例化编辑器,且引用了同一UEditor的时候,此处的URL可能不适用于每个页面的编辑器。 + * 因此,UEditor提供了针对不同页面的编辑器可单独配置的根路径,具体来说,在需要实例化编辑器的页面最顶部写上如下代码即可。当然,需要令此处的URL等于对应的配置。 + * window.UEDITOR_HOME_URL = "/xxxx/xxxx/"; + */ + window.UEDITOR_HOME_URL = '/static/Ueditor' + var URL = window.UEDITOR_HOME_URL || getUEBasePath() + + /** + * 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。 + */ + window.UEDITOR_CONFIG = { + + // 为编辑器实例添加一个路径,这个不能被注释 + UEDITOR_HOME_URL: URL, + + // 服务器统一请求接口路径 + serverUrl: URL + 'php/controller.php', + + // 工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的重新定义 + toolbars: [[ + 'fullscreen', 'source', '|', 'undo', 'redo', '|', + 'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|', + 'rowspacingtop', 'rowspacingbottom', 'lineheight', '|', + 'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|', + 'directionalityltr', 'directionalityrtl', 'indent', '|', + 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|', + 'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|', + 'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe', 'insertcode', 'webapp', 'pagebreak', 'template', 'background', '|', + 'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|', + 'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|', + 'print', 'preview', 'searchreplace', 'drafts', 'help', 'lbinsertimage', 'lbinsertvideo', 'lbinsertmusic' + ]], + // insertvideo + // 当鼠标放在工具栏上时显示的tooltip提示,留空支持自动多语言配置,否则以配置值为准 + labelMap: { + 'lbinsertimage': '图片', + 'lbinsertvideo': '视频', + 'lbinsertmusic': '音乐' + }, + + // 语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件: + // lang值也可以通过自动获取 (navigator.language||navigator.browserLanguage ||navigator.userLanguage).toLowerCase() + //, lang:"zh-cn" + //, langPath:URL +"lang/" + + // 主题配置项,默认是default。有需要的话也可以使用如下这样的方式来自动多主题切换,当然,前提条件是themes文件夹下存在对应的主题文件: + // 现有如下皮肤:default + //, theme:'default' + //, themePath:URL +"themes/" + + //, zIndex : 900 //编辑器层级的基数,默认是900 + + // 针对getAllHtml方法,会在对应的head标签中增加该编码设置。 + //, charset:"utf-8" + + // 若实例化编辑器的页面手动修改的domain,此处需要设置为true + //, customDomain:false + + // 常用配置项目 + //, isShow : true //默认显示编辑器 + + //, textarea:'editorValue' // 提交表单时,服务器获取编辑器提交内容的所用的参数,多实例时可以给容器name属性,会将name给定的值最为每个实例的键值,不用每次实例化的时候都设置这个值 + + //, initialContent:'欢迎使用ueditor!' //初始化编辑器的内容,也可以通过textarea/script给值,看官网例子 + + //, autoClearinitialContent:true //是否自动清除编辑器初始内容,注意:如果focus属性设置为true,这个也为真,那么编辑器一上来就会触发导致初始化的内容看不到了 + + //, focus:false //初始化时,是否让编辑器获得焦点true或false + + // 如果自定义,最好给p标签如下的行高,要不输入中文时,会有跳动感 + //, initialStyle:'p{line-height:1em}'//编辑器层级的基数,可以用来改变字体等 + + //, iframeCssUrl: URL + '/themes/iframe.css' //给编辑区域的iframe引入一个css文件 + + // indentValue + // 首行缩进距离,默认是2em + //, indentValue:'2em' + + //, initialFrameWidth:1000 //初始化编辑器宽度,默认1000 + //, initialFrameHeight:320 //初始化编辑器高度,默认320 + + //, readonly : false //编辑器初始化结束后,编辑区域是否是只读的,默认是false + + //, autoClearEmptyNode : true //getContent时,是否删除空的inlineElement节点(包括嵌套的情况) + + // 启用自动保存 + //, enableAutoSave: true + // 自动保存间隔时间, 单位ms + //, saveInterval: 500 + + //, fullscreen : false //是否开启初始化时即全屏,默认关闭 + + //, imagePopup:true //图片操作的浮层开关,默认打开 + + //, autoSyncData:true //自动同步编辑器要提交的数据 + //, emotionLocalization:false //是否开启表情本地化,默认关闭。若要开启请确保emotion文件夹下包含官网提供的images表情文件夹 + + // 粘贴只保留标签,去除标签所有属性 + //, retainOnlyLabelPasted: false + + //, pasteplain:false //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴 + // 纯文本粘贴模式下的过滤规则 + // 'filterTxtRules' : function(){ + // function transP(node){ + // node.tagName = 'p'; + // node.setStyle(); + // } + // return { + // //直接删除及其字节点内容 + // '-' : 'script style object iframe embed input select', + // 'p': {$:{}}, + // 'br':{$:{}}, + // 'div':{'$':{}}, + // 'li':{'$':{}}, + // 'caption':transP, + // 'th':transP, + // 'tr':transP, + // 'h1':transP,'h2':transP,'h3':transP,'h4':transP,'h5':transP,'h6':transP, + // 'td':function(node){ + // //没有内容的td直接删掉 + // var txt = !!node.innerText(); + // if(txt){ + // node.parentNode.insertAfter(UE.uNode.createText('    '),node); + // } + // node.parentNode.removeChild(node,node.innerText()) + // } + // } + // }() + + //, allHtmlEnabled:false //提交到后台的数据是否包含整个html字符串 + + // insertorderedlist + // 有序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准 + //, 'insertorderedlist':{ + // //自定的样式 + // 'num':'1,2,3...', + // 'num1':'1),2),3)...', + // 'num2':'(1),(2),(3)...', + // 'cn':'一,二,三....', + // 'cn1':'一),二),三)....', + // 'cn2':'(一),(二),(三)....', + // //系统自带 + // 'decimal' : '' , //'1,2,3...' + // 'lower-alpha' : '' , // 'a,b,c...' + // 'lower-roman' : '' , //'i,ii,iii...' + // 'upper-alpha' : '' , lang //'A,B,C' + // 'upper-roman' : '' //'I,II,III...' + // } + + // insertunorderedlist + // 无序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准 + //, insertunorderedlist : { //自定的样式 + // 'dash' :'— 破折号', //-破折号 + // 'dot':' 。 小圆圈', //系统自带 + // 'circle' : '', // '○ 小圆圈' + // 'disc' : '', // '● 小圆点' + // 'square' : '' //'■ 小方块' + // } + //, listDefaultPaddingLeft : '30'//默认的左边缩进的基数倍 + //, listiconpath : 'http://bs.baidu.com/listicon/'//自定义标号的路径 + //, maxListLevel : 3 //限制可以tab的级数, 设置-1为不限制 + + //, autoTransWordToList:false //禁止word中粘贴进来的列表自动变成列表标签 + + // fontfamily + // 字体设置 label留空支持多语言自动切换,若配置,则以配置值为准 + //, 'fontfamily':[ + // { label:'',name:'songti',val:'宋体,SimSun'}, + // { label:'',name:'kaiti',val:'楷体,楷体_GB2312, SimKai'}, + // { label:'',name:'yahei',val:'微软雅黑,Microsoft YaHei'}, + // { label:'',name:'heiti',val:'黑体, SimHei'}, + // { label:'',name:'lishu',val:'隶书, SimLi'}, + // { label:'',name:'andaleMono',val:'andale mono'}, + // { label:'',name:'arial',val:'arial, helvetica,sans-serif'}, + // { label:'',name:'arialBlack',val:'arial black,avant garde'}, + // { label:'',name:'comicSansMs',val:'comic sans ms'}, + // { label:'',name:'impact',val:'impact,chicago'}, + // { label:'',name:'timesNewRoman',val:'times new roman'} + // ] + + // fontsize + // 字号 + //, 'fontsize':[10, 11, 12, 14, 16, 18, 20, 24, 36] + + // paragraph + // 段落格式 值留空时支持多语言自动识别,若配置,则以配置值为准 + //, 'paragraph':{'p':'', 'h1':'', 'h2':'', 'h3':'', 'h4':'', 'h5':'', 'h6':''} + + // rowspacingtop + // 段间距 值和显示的名字相同 + //, 'rowspacingtop':['5', '10', '15', '20', '25'] + + // rowspacingBottom + // 段间距 值和显示的名字相同 + //, 'rowspacingbottom':['5', '10', '15', '20', '25'] + + // lineheight + // 行内间距 值和显示的名字相同 + //, 'lineheight':['1', '1.5','1.75','2', '3', '4', '5'] + + // customstyle + // 自定义样式,不支持国际化,此处配置值即可最后显示值 + // block的元素是依据设置段落的逻辑设置的,inline的元素依据BIU的逻辑设置 + // 尽量使用一些常用的标签 + // 参数说明 + // tag 使用的标签名字 + // label 显示的名字也是用来标识不同类型的标识符,注意这个值每个要不同, + // style 添加的样式 + // 每一个对象就是一个自定义的样式 + //, 'customstyle':[ + // {tag:'h1', name:'tc', label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;'}, + // {tag:'h1', name:'tl',label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;margin:0 0 10px 0;'}, + // {tag:'span',name:'im', label:'', style:'font-style:italic;font-weight:bold'}, + // {tag:'span',name:'hi', label:'', style:'font-style:italic;font-weight:bold;color:rgb(51, 153, 204)'} + // ] + + // 打开右键菜单功能 + //, enableContextMenu: true + // 右键菜单的内容,可以参考plugins/contextmenu.js里边的默认菜单的例子,label留空支持国际化,否则以此配置为准 + //, contextMenu:[ + // { + // label:'', //显示的名称 + // cmdName:'selectall',//执行的command命令,当点击这个右键菜单时 + // //exec可选,有了exec就会在点击时执行这个function,优先级高于cmdName + // exec:function () { + // //this是当前编辑器的实例 + // //this.ui._dialogs['inserttableDialog'].open(); + // } + // } + // ] + + // 快捷菜单 + //, shortcutMenu:["fontfamily", "fontsize", "bold", "italic", "underline", "forecolor", "backcolor", "insertorderedlist", "insertunorderedlist"] + + // elementPathEnabled + // 是否启用元素路径,默认是显示 + //, elementPathEnabled : true + + // wordCount + //, wordCount:true //是否开启字数统计 + //, maximumWords:10000 //允许的最大字符数 + // 字数统计提示,{#count}代表当前字数,{#leave}代表还可以输入多少字符数,留空支持多语言自动切换,否则按此配置显示 + //, wordCountMsg:'' //当前已输入 {#count} 个字符,您还可以输入{#leave} 个字符 + // 超出字数限制提示 留空支持多语言自动切换,否则按此配置显示 + //, wordOverFlowMsg:'' //你输入的字符个数已经超出最大允许值,服务器可能会拒绝保存! + + // tab + // 点击tab键时移动的距离,tabSize倍数,tabNode什么字符做为单位 + //, tabSize:4 + //, tabNode:' ' + + // removeFormat + // 清除格式时可以删除的标签和属性 + // removeForamtTags标签 + //, removeFormatTags:'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var' + // removeFormatAttributes属性 + //, removeFormatAttributes:'class,style,lang,width,height,align,hspace,valign' + + // undo + // 可以最多回退的次数,默认20 + //, maxUndoCount:20 + // 当输入的字符数超过该值时,保存一次现场 + //, maxInputCount:1 + + // autoHeightEnabled + // 是否自动长高,默认true + //, autoHeightEnabled:true + + // scaleEnabled + // 是否可以拉伸长高,默认true(当开启时,自动长高失效) + //, scaleEnabled:false + //, minFrameWidth:800 //编辑器拖动时最小宽度,默认800 + //, minFrameHeight:220 //编辑器拖动时最小高度,默认220 + + // autoFloatEnabled + // 是否保持toolbar的位置不动,默认true + //, autoFloatEnabled:true + // 浮动时工具栏距离浏览器顶部的高度,用于某些具有固定头部的页面 + //, topOffset:30 + // 编辑器底部距离工具栏高度(如果参数大于等于编辑器高度,则设置无效) + //, toolbarTopOffset:400 + + // 设置远程图片是否抓取到本地保存 + //, catchRemoteImageEnable: true //设置是否抓取远程图片 + + // pageBreakTag + // 分页标识符,默认是_ueditor_page_break_tag_ + //, pageBreakTag:'_ueditor_page_break_tag_' + + // autotypeset + // 自动排版参数 + //, autotypeset: { + // mergeEmptyline: true, //合并空行 + // removeClass: true, //去掉冗余的class + // removeEmptyline: false, //去掉空行 + // textAlign:"left", //段落的排版方式,可以是 left,right,center,justify 去掉这个属性表示不执行排版 + // imageBlockLine: 'center', //图片的浮动方式,独占一行剧中,左右浮动,默认: center,left,right,none 去掉这个属性表示不执行排版 + // pasteFilter: false, //根据规则过滤没事粘贴进来的内容 + // clearFontSize: false, //去掉所有的内嵌字号,使用编辑器默认的字号 + // clearFontFamily: false, //去掉所有的内嵌字体,使用编辑器默认的字体 + // removeEmptyNode: false, // 去掉空节点 + // //可以去掉的标签 + // removeTagNames: {标签名字:1}, + // indent: false, // 行首缩进 + // indentValue : '2em', //行首缩进的大小 + // bdc2sb: false, + // tobdc: false + // } + + // tableDragable + // 表格是否可以拖拽 + //, tableDragable: true + + // sourceEditor + // 源码的查看方式,codemirror 是代码高亮,textarea是文本框,默认是codemirror + // 注意默认codemirror只能在ie8+和非ie中使用 + //, sourceEditor:"codemirror" + // 如果sourceEditor是codemirror,还用配置一下两个参数 + // codeMirrorJsUrl js加载的路径,默认是 URL + "third-party/codemirror/codemirror.js" + //, codeMirrorJsUrl:URL + "third-party/codemirror/codemirror.js" + // codeMirrorCssUrl css加载的路径,默认是 URL + "third-party/codemirror/codemirror.css" + //, codeMirrorCssUrl:URL + "third-party/codemirror/codemirror.css" + // 编辑器初始化完成后是否进入源码模式,默认为否。 + //, sourceEditorFirst:false + + // iframeUrlMap + // dialog内容的路径 ~会被替换成URL,垓属性一旦打开,将覆盖所有的dialog的默认路径 + //, iframeUrlMap:{ + // 'anchor':'~/dialogs/anchor/anchor.html', + // } + + // allowLinkProtocol 允许的链接地址,有这些前缀的链接地址不会自动添加http + //, allowLinkProtocols: ['http:', 'https:', '#', '/', 'ftp:', 'mailto:', 'tel:', 'git:', 'svn:'] + + // webAppKey 百度应用的APIkey,每个站长必须首先去百度官网注册一个key后方能正常使用app功能,注册介绍,http://app.baidu.com/static/cms/getapikey.html + //, webAppKey: "" + + // 默认过滤规则相关配置项目 + //, disabledTableInTable:true //禁止表格嵌套 + //, allowDivTransToP:true //允许进入编辑器的div标签自动变成p标签 + //, rgb2Hex:true //默认产出的数据中的color自动从rgb格式变成16进制格式 + + // xss 过滤是否开启,inserthtml等操作 + xssFilterRules: true, + // input xss过滤 + inputXssFilter: true, + // output xss过滤 + outputXssFilter: true, + // xss过滤白名单 名单来源: https://raw.githubusercontent.com/leizongmin/js-xss/master/lib/default.js + whiteList: { + a: ['target', 'href', 'title', 'class', 'style'], + abbr: ['title', 'class', 'style'], + address: ['class', 'style'], + area: ['shape', 'coords', 'href', 'alt'], + article: [], + aside: [], + audio: ['autoplay', 'controls', 'loop', 'preload', 'src', 'class', 'style'], + b: ['class', 'style'], + bdi: ['dir'], + bdo: ['dir'], + big: [], + blockquote: ['cite', 'class', 'style'], + br: [], + caption: ['class', 'style'], + center: [], + cite: [], + code: ['class', 'style'], + col: ['align', 'valign', 'span', 'width', 'class', 'style'], + colgroup: ['align', 'valign', 'span', 'width', 'class', 'style'], + dd: ['class', 'style'], + del: ['datetime'], + details: ['open'], + div: ['class', 'style'], + dl: ['class', 'style'], + dt: ['class', 'style'], + em: ['class', 'style'], + font: ['color', 'size', 'face'], + footer: [], + h1: ['class', 'style'], + h2: ['class', 'style'], + h3: ['class', 'style'], + h4: ['class', 'style'], + h5: ['class', 'style'], + h6: ['class', 'style'], + header: [], + hr: [], + i: ['class', 'style'], + img: ['src', 'alt', 'title', 'width', 'height', 'id', '_src', 'loadingclass', 'class', 'data-latex'], + ins: ['datetime'], + li: ['class', 'style'], + mark: [], + nav: [], + ol: ['class', 'style'], + p: ['class', 'style'], + pre: ['class', 'style'], + s: [], + section: [], + small: [], + span: ['class', 'style'], + sub: ['class', 'style'], + sup: ['class', 'style'], + strong: ['class', 'style'], + table: ['width', 'border', 'align', 'valign', 'class', 'style'], + tbody: ['align', 'valign', 'class', 'style'], + td: ['width', 'rowspan', 'colspan', 'align', 'valign', 'class', 'style'], + tfoot: ['align', 'valign', 'class', 'style'], + th: ['width', 'rowspan', 'colspan', 'align', 'valign', 'class', 'style'], + thead: ['align', 'valign', 'class', 'style'], + tr: ['rowspan', 'align', 'valign', 'class', 'style'], + tt: [], + u: [], + ul: ['class', 'style'], + video: ['autoplay', 'controls', 'loop', 'preload', 'src', 'height', 'width', 'class', 'style'] + } + } + + function getUEBasePath (docUrl, confUrl) { + return getBasePath(docUrl || self.document.URL || self.location.href, confUrl || getConfigFilePath()) + } + + function getConfigFilePath () { + var configPath = document.getElementsByTagName('script') + + return configPath[ configPath.length - 1 ].src + } + + function getBasePath (docUrl, confUrl) { + var basePath = confUrl + + if (/^(\/|\\\\)/.test(confUrl)) { + basePath = /^.+?\w(\/|\\\\)/.exec(docUrl)[0] + confUrl.replace(/^(\/|\\\\)/, '') + } else if (!/^[a-z]+:/i.test(confUrl)) { + docUrl = docUrl.split('#')[0].split('?')[0].replace(/[^\\\/]+$/, '') + + basePath = docUrl + '' + confUrl + } + + return optimizationPath(basePath) + } + + function optimizationPath (path) { + var protocol = /^[a-z]+:\/\//.exec(path)[ 0 ], + tmp = null, + res = [] + + path = path.replace(protocol, '').split('?')[0].split('#')[0] + + path = path.replace(/\\/g, '/').split(/\//) + + path[ path.length - 1 ] = '' + + while (path.length) { + if ((tmp = path.shift()) === '..') { + res.pop() + } else if (tmp !== '.') { + res.push(tmp) + } + } + + return protocol + res.join('/') + } + + window.UE = { + getUEBasePath: getUEBasePath + } +})() diff --git a/public/static/Ueditor/ueditor.parse.js b/public/static/Ueditor/ueditor.parse.js new file mode 100644 index 0000000..32f9cd5 --- /dev/null +++ b/public/static/Ueditor/ueditor.parse.js @@ -0,0 +1,944 @@ +/*! + * UEditor + * version: ueditor + * build: Wed Dec 26 2018 17:25:05 GMT+0800 (CST) + */ + +(function () { + (function () { + UE = window.UE || {} + var isIE = !!window.ActiveXObject + // 定义utils工具 + var utils = { + removeLastbs: function (url) { + return url.replace(/\/$/, '') + }, + extend: function (t, s) { + var a = arguments, + notCover = this.isBoolean(a[a.length - 1]) ? a[a.length - 1] : false, + len = this.isBoolean(a[a.length - 1]) ? a.length - 1 : a.length + for (var i = 1; i < len; i++) { + var x = a[i] + for (var k in x) { + if (!notCover || !t.hasOwnProperty(k)) { + t[k] = x[k] + } + } + } + return t + }, + isIE: isIE, + cssRule: isIE ? function (key, style, doc) { + var indexList, index + doc = doc || document + if (doc.indexList) { + indexList = doc.indexList + } else { + indexList = doc.indexList = {} + } + var sheetStyle + if (!indexList[key]) { + if (style === undefined) { + return '' + } + sheetStyle = doc.createStyleSheet('', index = doc.styleSheets.length) + indexList[key] = index + } else { + sheetStyle = doc.styleSheets[indexList[key]] + } + if (style === undefined) { + return sheetStyle.cssText + } + sheetStyle.cssText = sheetStyle.cssText + '\n' + (style || '') + } : function (key, style, doc) { + doc = doc || document + var head = doc.getElementsByTagName('head')[0], node + if (!(node = doc.getElementById(key))) { + if (style === undefined) { + return '' + } + node = doc.createElement('style') + node.id = key + head.appendChild(node) + } + if (style === undefined) { + return node.innerHTML + } + if (style !== '') { + node.innerHTML = node.innerHTML + '\n' + style + } else { + head.removeChild(node) + } + }, + domReady: function (onready) { + var doc = window.document + if (doc.readyState === 'complete') { + onready() + } else { + if (isIE) { + (function () { + if (doc.isReady) return + try { + doc.documentElement.doScroll('left') + } catch (error) { + setTimeout(arguments.callee, 0) + return + } + onready() + })() + window.attachEvent('onload', function () { + onready() + }) + } else { + doc.addEventListener('DOMContentLoaded', function () { + doc.removeEventListener('DOMContentLoaded', arguments.callee, false) + onready() + }, false) + window.addEventListener('load', function () { onready() }, false) + } + } + }, + each: function (obj, iterator, context) { + if (obj == null) return + if (obj.length === +obj.length) { + for (var i = 0, l = obj.length; i < l; i++) { + if (iterator.call(context, obj[i], i, obj) === false) { return false } + } + } else { + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + if (iterator.call(context, obj[key], key, obj) === false) { return false } + } + } + } + }, + inArray: function (arr, item) { + var index = -1 + this.each(arr, function (v, i) { + if (v === item) { + index = i + return false + } + }) + return index + }, + pushItem: function (arr, item) { + if (this.inArray(arr, item) == -1) { + arr.push(item) + } + }, + trim: function (str) { + return str.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, '') + }, + indexOf: function (array, item, start) { + var index = -1 + start = this.isNumber(start) ? start : 0 + this.each(array, function (v, i) { + if (i >= start && v === item) { + index = i + return false + } + }) + return index + }, + hasClass: function (element, className) { + className = className.replace(/(^[ ]+)|([ ]+$)/g, '').replace(/[ ]{2,}/g, ' ').split(' ') + for (var i = 0, ci, cls = element.className; ci = className[i++];) { + if (!new RegExp('\\b' + ci + '\\b', 'i').test(cls)) { + return false + } + } + return i - 1 == className.length + }, + addClass: function (elm, classNames) { + if (!elm) return + classNames = this.trim(classNames).replace(/[ ]{2,}/g, ' ').split(' ') + for (var i = 0, ci, cls = elm.className; ci = classNames[i++];) { + if (!new RegExp('\\b' + ci + '\\b').test(cls)) { + cls += ' ' + ci + } + } + elm.className = utils.trim(cls) + }, + removeClass: function (elm, classNames) { + classNames = this.isArray(classNames) ? classNames + : this.trim(classNames).replace(/[ ]{2,}/g, ' ').split(' ') + for (var i = 0, ci, cls = elm.className; ci = classNames[i++];) { + cls = cls.replace(new RegExp('\\b' + ci + '\\b'), '') + } + cls = this.trim(cls).replace(/[ ]{2,}/g, ' ') + elm.className = cls + !cls && elm.removeAttribute('className') + }, + on: function (element, type, handler) { + var types = this.isArray(type) ? type : type.split(/\s+/), + k = types.length + if (k) { + while (k--) { + type = types[k] + if (element.addEventListener) { + element.addEventListener(type, handler, false) + } else { + if (!handler._d) { + handler._d = { + els: [] + } + } + var key = type + handler.toString(), index = utils.indexOf(handler._d.els, element) + if (!handler._d[key] || index == -1) { + if (index == -1) { + handler._d.els.push(element) + } + if (!handler._d[key]) { + handler._d[key] = function (evt) { + return handler.call(evt.srcElement, evt || window.event) + } + } + + element.attachEvent('on' + type, handler._d[key]) + } + } + } + } + element = null + }, + off: function (element, type, handler) { + var types = this.isArray(type) ? type : type.split(/\s+/), + k = types.length + if (k) { + while (k--) { + type = types[k] + if (element.removeEventListener) { + element.removeEventListener(type, handler, false) + } else { + var key = type + handler.toString() + try { + element.detachEvent('on' + type, handler._d ? handler._d[key] : handler) + } catch (e) {} + if (handler._d && handler._d[key]) { + var index = utils.indexOf(handler._d.els, element) + if (index != -1) { + handler._d.els.splice(index, 1) + } + handler._d.els.length == 0 && delete handler._d[key] + } + } + } + } + }, + loadFile: (function () { + var tmpList = [] + function getItem (doc, obj) { + try { + for (var i = 0, ci; ci = tmpList[i++];) { + if (ci.doc === doc && ci.url == (obj.src || obj.href)) { + return ci + } + } + } catch (e) { + return null + } + } + return function (doc, obj, fn) { + var item = getItem(doc, obj) + if (item) { + if (item.ready) { + fn && fn() + } else { + item.funs.push(fn) + } + return + } + tmpList.push({ + doc: doc, + url: obj.src || obj.href, + funs: [fn] + }) + if (!doc.body) { + var html = [] + for (var p in obj) { + if (p == 'tag') continue + html.push(p + '="' + obj[p] + '"') + } + doc.write('<' + obj.tag + ' ' + html.join(' ') + ' >') + return + } + if (obj.id && doc.getElementById(obj.id)) { + return + } + var element = doc.createElement(obj.tag) + delete obj.tag + for (var p in obj) { + element.setAttribute(p, obj[p]) + } + element.onload = element.onreadystatechange = function () { + if (!this.readyState || /loaded|complete/.test(this.readyState)) { + item = getItem(doc, obj) + if (item.funs.length > 0) { + item.ready = 1 + for (var fi; fi = item.funs.pop();) { + fi() + } + } + element.onload = element.onreadystatechange = null + } + } + element.onerror = function () { + throw Error('The load ' + (obj.href || obj.src) + ' fails,check the url') + } + doc.getElementsByTagName('head')[0].appendChild(element) + } + }()) + } + utils.each(['String', 'Function', 'Array', 'Number', 'RegExp', 'Object', 'Boolean'], function (v) { + utils['is' + v] = function (obj) { + return Object.prototype.toString.apply(obj) == '[object ' + v + ']' + } + }) + var parselist = {} + UE.parse = { + register: function (parseName, fn) { + parselist[parseName] = fn + }, + load: function (opt) { + utils.each(parselist, function (v) { + v.call(opt, utils) + }) + } + } + uParse = function (selector, opt) { + utils.domReady(function () { + var contents + if (document.querySelectorAll) { + contents = document.querySelectorAll(selector) + } else { + if (/^#/.test(selector)) { + contents = [document.getElementById(selector.replace(/^#/, ''))] + } else if (/^\./.test(selector)) { + var contents = [] + utils.each(document.getElementsByTagName('*'), function (node) { + if (node.className && new RegExp('\\b' + selector.replace(/^\./, '') + '\\b', 'i').test(node.className)) { + contents.push(node) + } + }) + } else { + contents = document.getElementsByTagName(selector) + } + } + utils.each(contents, function (v) { + UE.parse.load(utils.extend({root: v, selector: selector}, opt)) + }) + }) + } + })() + + UE.parse.register('insertcode', function (utils) { + var pres = this.root.getElementsByTagName('pre') + if (pres.length) { + if (typeof XRegExp === 'undefined') { + var jsurl, cssurl + if (this.rootPath !== undefined) { + jsurl = utils.removeLastbs(this.rootPath) + '/third-party/SyntaxHighlighter/shCore.js' + cssurl = utils.removeLastbs(this.rootPath) + '/third-party/SyntaxHighlighter/shCoreDefault.css' + } else { + jsurl = this.highlightJsUrl + cssurl = this.highlightCssUrl + } + utils.loadFile(document, { + id: 'syntaxhighlighter_css', + tag: 'link', + rel: 'stylesheet', + type: 'text/css', + href: cssurl + }) + utils.loadFile(document, { + id: 'syntaxhighlighter_js', + src: jsurl, + tag: 'script', + type: 'text/javascript', + defer: 'defer' + }, function () { + utils.each(pres, function (pi) { + if (pi && /brush/i.test(pi.className)) { + SyntaxHighlighter.highlight(pi) + } + }) + }) + } else { + utils.each(pres, function (pi) { + if (pi && /brush/i.test(pi.className)) { + SyntaxHighlighter.highlight(pi) + } + }) + } + } + }) + UE.parse.register('table', function (utils) { + var me = this, + root = this.root, + tables = root.getElementsByTagName('table') + if (tables.length) { + var selector = this.selector + // 追加默认的表格样式 + utils.cssRule('table', + selector + ' table.noBorderTable td,' + + selector + ' table.noBorderTable th,' + + selector + ' table.noBorderTable caption{border:1px dashed #ddd !important}' + + selector + ' table.sortEnabled tr.firstRow th,' + selector + ' table.sortEnabled tr.firstRow td{padding-right:20px; background-repeat: no-repeat;' + + 'background-position: center right; background-image:url(' + this.rootPath + 'themes/default/images/sortable.png);}' + + selector + ' table.sortEnabled tr.firstRow th:hover,' + selector + ' table.sortEnabled tr.firstRow td:hover{background-color: #EEE;}' + + selector + ' table{margin-bottom:10px;border-collapse:collapse;display:table;}' + + selector + ' td,' + selector + ' th{ background:white; padding: 5px 10px;border: 1px solid #DDD;}' + + selector + ' caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}' + + selector + ' th{border-top:1px solid #BBB;background:#F7F7F7;}' + + selector + ' table tr.firstRow th{border-top:2px solid #BBB;background:#F7F7F7;}' + + selector + ' tr.ue-table-interlace-color-single td{ background: #fcfcfc; }' + + selector + ' tr.ue-table-interlace-color-double td{ background: #f7faff; }' + + selector + ' td p{margin:0;padding:0;}', + document) + // 填充空的单元格 + + utils.each('td th caption'.split(' '), function (tag) { + var cells = root.getElementsByTagName(tag) + cells.length && utils.each(cells, function (node) { + if (!node.firstChild) { + node.innerHTML = ' ' + } + }) + }) + + // 表格可排序 + var tables = root.getElementsByTagName('table') + utils.each(tables, function (table) { + if (/\bsortEnabled\b/.test(table.className)) { + utils.on(table, 'click', function (e) { + var target = e.target || e.srcElement, + cell = findParentByTagName(target, ['td', 'th']) + var table = findParentByTagName(target, 'table'), + colIndex = utils.indexOf(table.rows[0].cells, cell), + sortType = table.getAttribute('data-sort-type') + if (colIndex != -1) { + sortTable(table, colIndex, me.tableSortCompareFn || sortType) + updateTable(table) + } + }) + } + }) + + // 按照标签名查找父节点 + function findParentByTagName (target, tagNames) { + var i, current = target + tagNames = utils.isArray(tagNames) ? tagNames : [tagNames] + while (current) { + for (i = 0; i < tagNames.length; i++) { + if (current.tagName == tagNames[i].toUpperCase()) return current + } + current = current.parentNode + } + return null + } + // 表格排序 + function sortTable (table, sortByCellIndex, compareFn) { + var rows = table.rows, + trArray = [], + flag = rows[0].cells[0].tagName === 'TH', + lastRowIndex = 0 + + for (var i = 0, len = rows.length; i < len; i++) { + trArray[i] = rows[i] + } + + var Fn = { + 'reversecurrent': function (td1, td2) { + return 1 + }, + 'orderbyasc': function (td1, td2) { + var value1 = td1.innerText || td1.textContent, + value2 = td2.innerText || td2.textContent + return value1.localeCompare(value2) + }, + 'reversebyasc': function (td1, td2) { + var value1 = td1.innerHTML, + value2 = td2.innerHTML + return value2.localeCompare(value1) + }, + 'orderbynum': function (td1, td2) { + var value1 = td1[utils.isIE ? 'innerText' : 'textContent'].match(/\d+/), + value2 = td2[utils.isIE ? 'innerText' : 'textContent'].match(/\d+/) + if (value1) value1 = +value1[0] + if (value2) value2 = +value2[0] + return (value1 || 0) - (value2 || 0) + }, + 'reversebynum': function (td1, td2) { + var value1 = td1[utils.isIE ? 'innerText' : 'textContent'].match(/\d+/), + value2 = td2[utils.isIE ? 'innerText' : 'textContent'].match(/\d+/) + if (value1) value1 = +value1[0] + if (value2) value2 = +value2[0] + return (value2 || 0) - (value1 || 0) + } + } + + // 对表格设置排序的标记data-sort-type + table.setAttribute('data-sort-type', compareFn && typeof compareFn === 'string' && Fn[compareFn] ? compareFn : '') + + // th不参与排序 + flag && trArray.splice(0, 1) + trArray = sort(trArray, function (tr1, tr2) { + var result + if (compareFn && typeof compareFn === 'function') { + result = compareFn.call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]) + } else if (compareFn && typeof compareFn === 'number') { + result = 1 + } else if (compareFn && typeof compareFn === 'string' && Fn[compareFn]) { + result = Fn[compareFn].call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]) + } else { + result = Fn['orderbyasc'].call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]) + } + return result + }) + var fragment = table.ownerDocument.createDocumentFragment() + for (var j = 0, len = trArray.length; j < len; j++) { + fragment.appendChild(trArray[j]) + } + var tbody = table.getElementsByTagName('tbody')[0] + if (!lastRowIndex) { + tbody.appendChild(fragment) + } else { + tbody.insertBefore(fragment, rows[lastRowIndex - range.endRowIndex + range.beginRowIndex - 1]) + } + } + // 冒泡排序 + function sort (array, compareFn) { + compareFn = compareFn || function (item1, item2) { return item1.localeCompare(item2) } + for (var i = 0, len = array.length; i < len; i++) { + for (var j = i, length = array.length; j < length; j++) { + if (compareFn(array[i], array[j]) > 0) { + var t = array[i] + array[i] = array[j] + array[j] = t + } + } + } + return array + } + // 更新表格 + function updateTable (table) { + // 给第一行设置firstRow的样式名称,在排序图标的样式上使用到 + if (!utils.hasClass(table.rows[0], 'firstRow')) { + for (var i = 1; i < table.rows.length; i++) { + utils.removeClass(table.rows[i], 'firstRow') + } + utils.addClass(table.rows[0], 'firstRow') + } + } + } + }) + UE.parse.register('charts', function (utils) { + utils.cssRule('chartsContainerHeight', '.edui-chart-container { height:' + (this.chartContainerHeight || 300) + 'px}') + var resourceRoot = this.rootPath, + containers = this.root, + sources = null + + // 不存在指定的根路径, 则直接退出 + if (!resourceRoot) { + return + } + + if (sources = parseSources()) { + loadResources() + } + + function parseSources () { + if (!containers) { + return null + } + + return extractChartData(containers) + } + + /** + * 提取数据 + */ + function extractChartData (rootNode) { + var data = [], + tables = rootNode.getElementsByTagName('table') + + for (var i = 0, tableNode; tableNode = tables[ i ]; i++) { + if (tableNode.getAttribute('data-chart') !== null) { + data.push(formatData(tableNode)) + } + } + + return data.length ? data : null + } + + function formatData (tableNode) { + var meta = tableNode.getAttribute('data-chart'), + metaConfig = {}, + data = [] + + // 提取table数据 + for (var i = 0, row; row = tableNode.rows[ i ]; i++) { + var rowData = [] + + for (var j = 0, cell; cell = row.cells[ j ]; j++) { + var value = (cell.innerText || cell.textContent || '') + rowData.push(cell.tagName == 'TH' ? value : (value | 0)) + } + + data.push(rowData) + } + + // 解析元信息 + meta = meta.split(';') + for (var i = 0, metaData; metaData = meta[ i ]; i++) { + metaData = metaData.split(':') + metaConfig[ metaData[ 0 ] ] = metaData[ 1 ] + } + + return { + table: tableNode, + meta: metaConfig, + data: data + } + } + + // 加载资源 + function loadResources () { + loadJQuery() + } + + function loadJQuery () { + // 不存在jquery, 则加载jquery + if (!window.jQuery) { + utils.loadFile(document, { + src: resourceRoot + '/third-party/jquery-1.10.2.min.js', + tag: 'script', + type: 'text/javascript', + defer: 'defer' + }, function () { + loadHighcharts() + }) + } else { + loadHighcharts() + } + } + + function loadHighcharts () { + // 不存在Highcharts, 则加载Highcharts + if (!window.Highcharts) { + utils.loadFile(document, { + src: resourceRoot + '/third-party/highcharts/highcharts.js', + tag: 'script', + type: 'text/javascript', + defer: 'defer' + }, function () { + loadTypeConfig() + }) + } else { + loadTypeConfig() + } + } + + // 加载图表差异化配置文件 + function loadTypeConfig () { + utils.loadFile(document, { + src: resourceRoot + '/dialogs/charts/chart.config.js', + tag: 'script', + type: 'text/javascript', + defer: 'defer' + }, function () { + render() + }) + } + + // 渲染图表 + function render () { + var config = null, + chartConfig = null, + container = null + + for (var i = 0, len = sources.length; i < len; i++) { + config = sources[ i ] + + chartConfig = analysisConfig(config) + + container = createContainer(config.table) + + renderChart(container, typeConfig[ config.meta.chartType ], chartConfig) + } + } + + /** + * 渲染图表 + * @param container 图表容器节点对象 + * @param typeConfig 图表类型配置 + * @param config 图表通用配置 + * */ + function renderChart (container, typeConfig, config) { + $(container).highcharts($.extend({}, typeConfig, { + + credits: { + enabled: false + }, + exporting: { + enabled: false + }, + title: { + text: config.title, + x: -20 // center + }, + subtitle: { + text: config.subTitle, + x: -20 + }, + xAxis: { + title: { + text: config.xTitle + }, + categories: config.categories + }, + yAxis: { + title: { + text: config.yTitle + }, + plotLines: [{ + value: 0, + width: 1, + color: '#808080' + }] + }, + tooltip: { + enabled: true, + valueSuffix: config.suffix + }, + legend: { + layout: 'vertical', + align: 'right', + verticalAlign: 'middle', + borderWidth: 1 + }, + series: config.series + + })) + } + + /** + * 创建图表的容器 + * 新创建的容器会替换掉对应的table对象 + * */ + function createContainer (tableNode) { + var container = document.createElement('div') + container.className = 'edui-chart-container' + + tableNode.parentNode.replaceChild(container, tableNode) + + return container + } + + // 根据config解析出正确的类别和图表数据信息 + function analysisConfig (config) { + var series = [], + // 数据类别 + categories = [], + result = [], + data = config.data, + meta = config.meta + + // 数据对齐方式为相反的方式, 需要反转数据 + if (meta.dataFormat != '1') { + for (var i = 0, len = data.length; i < len; i++) { + for (var j = 0, jlen = data[ i ].length; j < jlen; j++) { + if (!result[ j ]) { + result[ j ] = [] + } + + result[ j ][ i ] = data[ i ][ j ] + } + } + + data = result + } + + result = {} + + // 普通图表 + if (meta.chartType != typeConfig.length - 1) { + categories = data[ 0 ].slice(1) + + for (var i = 1, curData; curData = data[ i ]; i++) { + series.push({ + name: curData[ 0 ], + data: curData.slice(1) + }) + } + + result.series = series + result.categories = categories + result.title = meta.title + result.subTitle = meta.subTitle + result.xTitle = meta.xTitle + result.yTitle = meta.yTitle + result.suffix = meta.suffix + } else { + var curData = [] + + for (var i = 1, len = data[ 0 ].length; i < len; i++) { + curData.push([ data[ 0 ][ i ], data[ 1 ][ i ] | 0 ]) + } + + // 饼图 + series[ 0 ] = { + type: 'pie', + name: meta.tip, + data: curData + } + + result.series = series + result.title = meta.title + result.suffix = meta.suffix + } + + return result + } + }) + UE.parse.register('background', function (utils) { + var me = this, + root = me.root, + p = root.getElementsByTagName('p'), + styles + + for (var i = 0, ci; ci = p[i++];) { + styles = ci.getAttribute('data-background') + if (styles) { + ci.parentNode.removeChild(ci) + } + } + + // 追加默认的表格样式 + styles && utils.cssRule('ueditor_background', me.selector + '{' + styles + '}', document) + }) + UE.parse.register('list', function (utils) { + var customCss = [], + customStyle = { + 'cn': 'cn-1-', + 'cn1': 'cn-2-', + 'cn2': 'cn-3-', + 'num': 'num-1-', + 'num1': 'num-2-', + 'num2': 'num-3-', + 'dash': 'dash', + 'dot': 'dot' + } + + utils.extend(this, { + liiconpath: 'http://bs.baidu.com/listicon/', + listDefaultPaddingLeft: '20' + }) + + var root = this.root, + ols = root.getElementsByTagName('ol'), + uls = root.getElementsByTagName('ul'), + selector = this.selector + + if (ols.length) { + applyStyle.call(this, ols) + } + + if (uls.length) { + applyStyle.call(this, uls) + } + + if (ols.length || uls.length) { + customCss.push(selector + ' .list-paddingleft-1{padding-left:0}') + customCss.push(selector + ' .list-paddingleft-2{padding-left:' + this.listDefaultPaddingLeft + 'px}') + customCss.push(selector + ' .list-paddingleft-3{padding-left:' + this.listDefaultPaddingLeft * 2 + 'px}') + + utils.cssRule('list', selector + ' ol,' + selector + ' ul{margin:0;padding:0;}li{clear:both;}' + customCss.join('\n'), document) + } + function applyStyle (nodes) { + var T = this + utils.each(nodes, function (list) { + if (list.className && /custom_/i.test(list.className)) { + var listStyle = list.className.match(/custom_(\w+)/)[1] + if (listStyle == 'dash' || listStyle == 'dot') { + utils.pushItem(customCss, selector + ' li.list-' + customStyle[listStyle] + '{background-image:url(' + T.liiconpath + customStyle[listStyle] + '.gif)}') + utils.pushItem(customCss, selector + ' ul.custom_' + listStyle + '{list-style:none;} ' + selector + ' ul.custom_' + listStyle + ' li{background-position:0 3px;background-repeat:no-repeat}') + } else { + var index = 1 + utils.each(list.childNodes, function (li) { + if (li.tagName == 'LI') { + utils.pushItem(customCss, selector + ' li.list-' + customStyle[listStyle] + index + '{background-image:url(' + T.liiconpath + 'list-' + customStyle[listStyle] + index + '.gif)}') + index++ + } + }) + utils.pushItem(customCss, selector + ' ol.custom_' + listStyle + '{list-style:none;}' + selector + ' ol.custom_' + listStyle + ' li{background-position:0 3px;background-repeat:no-repeat}') + } + switch (listStyle) { + case 'cn': + utils.pushItem(customCss, selector + ' li.list-' + listStyle + '-paddingleft-1{padding-left:25px}') + utils.pushItem(customCss, selector + ' li.list-' + listStyle + '-paddingleft-2{padding-left:40px}') + utils.pushItem(customCss, selector + ' li.list-' + listStyle + '-paddingleft-3{padding-left:55px}') + break + case 'cn1': + utils.pushItem(customCss, selector + ' li.list-' + listStyle + '-paddingleft-1{padding-left:30px}') + utils.pushItem(customCss, selector + ' li.list-' + listStyle + '-paddingleft-2{padding-left:40px}') + utils.pushItem(customCss, selector + ' li.list-' + listStyle + '-paddingleft-3{padding-left:55px}') + break + case 'cn2': + utils.pushItem(customCss, selector + ' li.list-' + listStyle + '-paddingleft-1{padding-left:40px}') + utils.pushItem(customCss, selector + ' li.list-' + listStyle + '-paddingleft-2{padding-left:55px}') + utils.pushItem(customCss, selector + ' li.list-' + listStyle + '-paddingleft-3{padding-left:68px}') + break + case 'num': + case 'num1': + utils.pushItem(customCss, selector + ' li.list-' + listStyle + '-paddingleft-1{padding-left:25px}') + break + case 'num2': + utils.pushItem(customCss, selector + ' li.list-' + listStyle + '-paddingleft-1{padding-left:35px}') + utils.pushItem(customCss, selector + ' li.list-' + listStyle + '-paddingleft-2{padding-left:40px}') + break + case 'dash': + utils.pushItem(customCss, selector + ' li.list-' + listStyle + '-paddingleft{padding-left:35px}') + break + case 'dot': + utils.pushItem(customCss, selector + ' li.list-' + listStyle + '-paddingleft{padding-left:20px}') + } + } + }) + } + }) + UE.parse.register('vedio', function (utils) { + var video = this.root.getElementsByTagName('video'), + audio = this.root.getElementsByTagName('audio') + + document.createElement('video'); document.createElement('audio') + if (video.length || audio.length) { + var sourcePath = utils.removeLastbs(this.rootPath), + jsurl = sourcePath + '/third-party/video-js/video.js', + cssurl = sourcePath + '/third-party/video-js/video-js.min.css', + swfUrl = sourcePath + '/third-party/video-js/video-js.swf' + + if (window.videojs) { + videojs.autoSetup() + } else { + utils.loadFile(document, { + id: 'video_css', + tag: 'link', + rel: 'stylesheet', + type: 'text/css', + href: cssurl + }) + utils.loadFile(document, { + id: 'video_js', + src: jsurl, + tag: 'script', + type: 'text/javascript' + }, function () { + videojs.options.flash.swf = swfUrl + videojs.autoSetup() + }) + } + } + }) +})() diff --git a/public/static/Ueditor/ueditor.parse.min.js b/public/static/Ueditor/ueditor.parse.min.js new file mode 100644 index 0000000..d996fd0 --- /dev/null +++ b/public/static/Ueditor/ueditor.parse.min.js @@ -0,0 +1,7 @@ +/*! + * UEditor + * version: ueditor + * build: Wed Dec 26 2018 17:25:07 GMT+0800 (CST) + */ + +!function(){!function(){UE=window.UE||{};var a=!!window.ActiveXObject,b={removeLastbs:function(a){return a.replace(/\/$/,"")},extend:function(a,b){for(var c=arguments,d=!!this.isBoolean(c[c.length-1])&&c[c.length-1],e=this.isBoolean(c[c.length-1])?c.length-1:c.length,f=1;f=c&&a===b)return d=e,!1}),d},hasClass:function(a,b){b=b.replace(/(^[ ]+)|([ ]+$)/g,"").replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)if(!new RegExp("\\b"+c+"\\b","i").test(e))return!1;return d-1==b.length},addClass:function(a,c){if(a){c=this.trim(c).replace(/[ ]{2,}/g," ").split(" ");for(var d,e=0,f=a.className;d=c[e++];)new RegExp("\\b"+d+"\\b").test(f)||(f+=" "+d);a.className=b.trim(f)}},removeClass:function(a,b){b=this.isArray(b)?b:this.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)e=e.replace(new RegExp("\\b"+c+"\\b"),"");e=this.trim(e).replace(/[ ]{2,}/g," "),a.className=e,!e&&a.removeAttribute("className")},on:function(a,c,d){var e=this.isArray(c)?c:c.split(/\s+/),f=e.length;if(f)for(;f--;)if(c=e[f],a.addEventListener)a.addEventListener(c,d,!1);else{d._d||(d._d={els:[]});var g=c+d.toString(),h=b.indexOf(d._d.els,a);d._d[g]&&h!=-1||(h==-1&&d._d.els.push(a),d._d[g]||(d._d[g]=function(a){return d.call(a.srcElement,a||window.event)}),a.attachEvent("on"+c,d._d[g]))}a=null},off:function(a,c,d){var e=this.isArray(c)?c:c.split(/\s+/),f=e.length;if(f)for(;f--;)if(c=e[f],a.removeEventListener)a.removeEventListener(c,d,!1);else{var g=c+d.toString();try{a.detachEvent("on"+c,d._d?d._d[g]:d)}catch(h){}if(d._d&&d._d[g]){var i=b.indexOf(d._d.els,a);i!=-1&&d._d.els.splice(i,1),0==d._d.els.length&&delete d._d[g]}}},loadFile:function(){function a(a,c){try{for(var d,e=0;d=b[e++];)if(d.doc===a&&d.url==(c.src||c.href))return d}catch(f){return null}}var b=[];return function(c,d,e){var f=a(c,d);if(f)return void(f.ready?e&&e():f.funs.push(e));if(b.push({doc:c,url:d.src||d.href,funs:[e]}),!c.body){var g=[];for(var h in d)"tag"!=h&&g.push(h+'="'+d[h]+'"');return void c.write("<"+d.tag+" "+g.join(" ")+" >")}if(!d.id||!c.getElementById(d.id)){var i=c.createElement(d.tag);delete d.tag;for(var h in d)i.setAttribute(h,d[h]);i.onload=i.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(f=a(c,d),f.funs.length>0){f.ready=1;for(var b;b=f.funs.pop();)b()}i.onload=i.onreadystatechange=null}},i.onerror=function(){throw Error("The load "+(d.href||d.src)+" fails,check the url")},c.getElementsByTagName("head")[0].appendChild(i)}}}()};b.each(["String","Function","Array","Number","RegExp","Object","Boolean"],function(a){b["is"+a]=function(b){return Object.prototype.toString.apply(b)=="[object "+a+"]"}});var c={};UE.parse={register:function(a,b){c[a]=b},load:function(a){b.each(c,function(c){c.call(a,b)})}},uParse=function(a,c){b.domReady(function(){var d;if(document.querySelectorAll)d=document.querySelectorAll(a);else if(/^#/.test(a))d=[document.getElementById(a.replace(/^#/,""))];else if(/^\./.test(a)){var d=[];b.each(document.getElementsByTagName("*"),function(b){b.className&&new RegExp("\\b"+a.replace(/^\./,"")+"\\b","i").test(b.className)&&d.push(b)})}else d=document.getElementsByTagName(a);b.each(d,function(d){UE.parse.load(b.extend({root:d,selector:a},c))})})}}(),UE.parse.register("insertcode",function(a){var b=this.root.getElementsByTagName("pre");if(b.length)if("undefined"==typeof XRegExp){var c,d;void 0!==this.rootPath?(c=a.removeLastbs(this.rootPath)+"/third-party/SyntaxHighlighter/shCore.js",d=a.removeLastbs(this.rootPath)+"/third-party/SyntaxHighlighter/shCoreDefault.css"):(c=this.highlightJsUrl,d=this.highlightCssUrl),a.loadFile(document,{id:"syntaxhighlighter_css",tag:"link",rel:"stylesheet",type:"text/css",href:d}),a.loadFile(document,{id:"syntaxhighlighter_js",src:c,tag:"script",type:"text/javascript",defer:"defer"},function(){a.each(b,function(a){a&&/brush/i.test(a.className)&&SyntaxHighlighter.highlight(a)})})}else a.each(b,function(a){a&&/brush/i.test(a.className)&&SyntaxHighlighter.highlight(a)})}),UE.parse.register("table",function(a){function b(b,c){var d,e=b;for(c=a.isArray(c)?c:[c];e;){for(d=0;d0){var g=a[c];a[c]=a[e],a[e]=g}return a}function e(b){if(!a.hasClass(b.rows[0],"firstRow")){for(var c=1;cdiv[data-v-ee2e5702]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;white-space:nowrap +} +.lb-page>div>div.isShowBatch[data-v-ee2e5702]{border-right:1px solid #e8e8e8 +} +.lb-page>div>div[data-v-ee2e5702]:first-child{height:40px;padding-right:30px;margin-right:30px;line-height:40px +} +.lb-page>div>div .el-button[data-v-ee2e5702]{margin-left:10px +} + +.lb-goods-edit-classify[data-v-9e52c13e]{width:100%;border-top:1px solid #eff2f6;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center +} +.lb-goods-edit-classify .title[data-v-9e52c13e]{display:inline-block;padding:6px 15px;color:#609beb;background:#f5f7fa;margin-right:10px +} +.lb-goods-edit-classify .tips[data-v-9e52c13e]{color:#aaafbb;font-size:12px +} + +.fen_item[data-v-525816fe]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center +} +.group_item[data-v-525816fe]{display:-webkit-box;display:-ms-flexbox;display:flex;margin:10px 0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between +} +.btn_view[data-v-525816fe]{margin:0 50px +} +.btn_view .el-button[data-v-525816fe]{margin:0 15px +} +.img-view[data-v-525816fe]{width:100%;height:398px;padding:20px 0;border-bottom:1px solid #eff2f6;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;position:relative +} +.img-view .loading[data-v-525816fe]{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%, 50%);transform:translate(-50%, 50%) +} +.img-view .img-item[data-v-525816fe]{width:16%;height:140px;background-color:#f5f7fa;background-size:contain;background-repeat:no-repeat;background-position:center center;margin:2%;position:relative;border:2px solid #f5f7fa;cursor:pointer +} +.img-view .img-item .img-name[data-v-525816fe]{width:100%;height:32px;position:absolute;bottom:0px;right:0;left:0;margin:auto;background:rgba(0,0,0,0.5);z-index:10;line-height:32px;color:#fff;padding:0 20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap +} +.img-view .img-item .icon-selected[data-v-525816fe]{display:inline-block;width:100%;height:100%;background:rgba(0,0,0,0.5);position:absolute;top:0;left:0;z-index:15;color:#fff;font-size:60px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center +} +.img-view .img-item .icon-d[data-v-525816fe]{display:none;width:32px;height:32px;background:#f56c6c;color:#fff;text-align:center;line-height:32px;position:absolute;right:0;bottom:0;z-index:20;font-size:20px +} +.img-view .img-item .icon-d.el-icon-upload[data-v-525816fe]{background:#e6a23c +} +.img-view .img-item[data-v-525816fe]:hover{border:2px solid #4c88d8;width:16% +} +.img-view .img-item:hover .icon-d[data-v-525816fe]{display:inline-block +} +.lb-tabs .img-view[data-v-525816fe]{border-top:none +} +.top-video-switch[data-v-525816fe]{width:100%;border-bottom:1px solid #eff2f6 +} +.get-network-video[data-v-525816fe]{height:398px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:distribute;justify-content:space-around;-webkit-box-align:center;-ms-flex-align:center;align-items:center +} +.get-network-video .el-input[data-v-525816fe]{width:500px +} +.upload-page[data-v-525816fe]{margin-top:20px;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between +} +.upload-page .operate[data-v-525816fe]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center +} +.upload-page .operate .el-checkbox[data-v-525816fe]{margin-right:10px +} +.upload-page .operate .count[data-v-525816fe]{color:#4c88d8;margin-left:5px;margin-right:10px +} +.upload-page .operate .el-button[data-v-525816fe]{margin-left:10px +} + +.lb-tool-tips[data-v-7f27e55a]{font-size:12px;line-height:1.6;padding-top:10px +} +.lb-tool-tips.c-link[data-v-7f27e55a]{cursor:pointer +} +.tool-tips[data-v-7f27e55a]{margin-left:5px;vertical-align:top;font-size:18px;color:#333 +} +.tool-tips .content[data-v-7f27e55a]{max-width:300px +} +.tool-tips .el-icon-question[data-v-7f27e55a]{cursor:pointer +} + +.avatar-uploader[data-v-c6664236]{border:1px dashed #d9d9d9;border-radius:6px;cursor:pointer;position:relative;overflow:hidden;width:128px;height:128px +} +.avatar-uploader[data-v-c6664236]:hover{border-color:#409eff +} +.avatar-uploader-icon[data-v-c6664236]{font-size:28px;color:#8c939d;width:128px;height:128px;line-height:128px;text-align:center +} +.avatar[data-v-c6664236]{width:128px;height:128px;display:block +} + +.lb-cover-wrap[data-v-8c35f6c0]{display:inline-block +} +.lb-cover-wrap .lb-cover.small[data-v-8c35f6c0]{width:60px;height:60px +} +.lb-cover-wrap .lb-cover.small .el-image[data-v-8c35f6c0]{width:60px;height:60px +} +.lb-cover-wrap .lb-cover.small i[data-v-8c35f6c0]{font-size:20px;line-height:60px +} +.lb-cover-wrap .lb-cover.small .el-icon-circle-close[data-v-8c35f6c0]{font-size:18px;line-height:18px +} +.lb-cover-wrap .lb-cover.middle[data-v-8c35f6c0]{width:80px;height:80px +} +.lb-cover-wrap .lb-cover.middle .el-image[data-v-8c35f6c0]{width:80px;height:80px +} +.lb-cover-wrap .lb-cover.middle i[data-v-8c35f6c0]{font-size:20px;line-height:80px +} +.lb-cover-wrap .lb-cover.middle .el-icon-circle-close[data-v-8c35f6c0]{font-size:22px;line-height:22px +} +.lb-cover-wrap .lb-cover[data-v-8c35f6c0]{width:100px;height:100px;border:1px dashed #d9d9d9;border-radius:6px;cursor:pointer;text-align:center;overflow:hidden;position:relative +} +.lb-cover-wrap .lb-cover .el-image[data-v-8c35f6c0]{width:100px;height:100px +} +.lb-cover-wrap .lb-cover i[data-v-8c35f6c0]{font-size:26px;line-height:100px +} +.lb-cover-wrap .lb-cover[data-v-8c35f6c0]:hover{border:1px dashed #09f +} +.lb-cover-wrap .lb-cover:hover .el-icon-circle-close[data-v-8c35f6c0]{display:inline-block +} +.lb-cover-wrap .lb-cover .el-icon-circle-close[data-v-8c35f6c0]{display:none;z-index:10;position:absolute;right:5px;top:5px;line-height:1 +} +.lb-cover-wrap .lb-upload-more[data-v-8c35f6c0]{width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap +} +.lb-cover-wrap .lb-upload-more .more-item.small[data-v-8c35f6c0]{width:60px;height:60px +} +.lb-cover-wrap .lb-upload-more .more-item.small .el-image[data-v-8c35f6c0]{width:60px;height:60px;z-index:5 +} +.lb-cover-wrap .lb-upload-more .more-item.middle[data-v-8c35f6c0]{width:80px;height:80px +} +.lb-cover-wrap .lb-upload-more .more-item.middle .el-image[data-v-8c35f6c0]{width:80px;height:80px;z-index:5 +} +.lb-cover-wrap .lb-upload-more .more-item[data-v-8c35f6c0]{width:100px;height:100px;border:1px solid #d9d9d9;border-radius:6px;position:relative;margin-right:10px;margin-bottom:10px;overflow:hidden +} +.lb-cover-wrap .lb-upload-more .more-item .el-image[data-v-8c35f6c0]{width:100px;height:100px;z-index:5 +} +.lb-cover-wrap .lb-upload-more .more-item .mask[data-v-8c35f6c0]{display:none;position:absolute;width:100%;height:100%;background:rgba(0,0,0,0.5);font-size:20px;color:#fff;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;z-index:10;top:0;left:0 +} +.lb-cover-wrap .lb-upload-more .more-item .mask i[data-v-8c35f6c0]{margin:0 10px;cursor:pointer +} +.lb-cover-wrap .lb-upload-more .more-item:hover .mask[data-v-8c35f6c0]{display:-webkit-box;display:-ms-flexbox;display:flex +} +.lb-cover-wrap .lb-upload-more .up-item[data-v-8c35f6c0]{width:100px;height:100px;border:1px dashed #d9d9d9;border-radius:6px;cursor:pointer;text-align:center +} +.lb-cover-wrap .lb-upload-more .up-item i[data-v-8c35f6c0]{font-size:26px;line-height:100px +} +.lb-cover-wrap .lb-upload-more .up-item[data-v-8c35f6c0]:hover{border:1px dashed #09f +} +.lb-cover-wrap .lb-upload-more .up-item.small[data-v-8c35f6c0]{width:60px;height:60px;border:1px dashed #d9d9d9;border-radius:6px;cursor:pointer;text-align:center +} +.lb-cover-wrap .lb-upload-more .up-item.small i[data-v-8c35f6c0]{font-size:18px;line-height:60px +} +.lb-cover-wrap .lb-upload-more .up-item.small[data-v-8c35f6c0]:hover{border:1px dashed #09f +} +.lb-cover-wrap .lb-upload-more .up-item.middle[data-v-8c35f6c0]{width:80px;height:80px;border:1px dashed #d9d9d9;border-radius:6px;cursor:pointer;text-align:center +} +.lb-cover-wrap .lb-upload-more .up-item.middle i[data-v-8c35f6c0]{font-size:22px;line-height:80px +} +.lb-cover-wrap .lb-upload-more .up-item.middle[data-v-8c35f6c0]:hover{border:1px dashed #09f +} +.lb-cover-wrap .dialog-inner-img[data-v-8c35f6c0]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center +} +.lb-cover-wrap .dialog-inner-img .dialog-img[data-v-8c35f6c0]{width:100% +} + +.el-image[data-v-b7b3523a]{background:#f5f7fa;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center +} +.el-image .image-slot i[data-v-b7b3523a]{font-size:20px +} + +#container[data-v-37243830]{width:500px;height:400px;margin:0 auto +} +.dialog-inner .map-search[data-v-37243830]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-bottom:20px +} +.dialog-inner .map-search .el-input[data-v-37243830]{width:300px;margin-right:10px +} diff --git a/public/static/img/login_bg.6875196.png b/public/static/img/login_bg.6875196.png new file mode 100644 index 0000000..4e73f2e Binary files /dev/null and b/public/static/img/login_bg.6875196.png differ diff --git a/public/static/img/login_left.2570f69.png b/public/static/img/login_left.2570f69.png new file mode 100644 index 0000000..d642b7d Binary files /dev/null and b/public/static/img/login_left.2570f69.png differ diff --git a/public/static/img/notice1.55287d5.jpg b/public/static/img/notice1.55287d5.jpg new file mode 100644 index 0000000..f623718 Binary files /dev/null and b/public/static/img/notice1.55287d5.jpg differ diff --git a/public/static/img/notice2.2055c13.jpg b/public/static/img/notice2.2055c13.jpg new file mode 100644 index 0000000..e8adff3 Binary files /dev/null and b/public/static/img/notice2.2055c13.jpg differ diff --git a/public/static/img/notice3.10a1279.jpg b/public/static/img/notice3.10a1279.jpg new file mode 100644 index 0000000..a669931 Binary files /dev/null and b/public/static/img/notice3.10a1279.jpg differ diff --git a/public/static/js/0.js b/public/static/js/0.js new file mode 100644 index 0000000..416d2f4 --- /dev/null +++ b/public/static/js/0.js @@ -0,0 +1 @@ +webpackJsonp([0],{"+2Ke":function(t,e){e.SOURCE_FORMAT_ORIGINAL="original",e.SOURCE_FORMAT_ARRAY_ROWS="arrayRows",e.SOURCE_FORMAT_OBJECT_ROWS="objectRows",e.SOURCE_FORMAT_KEYED_COLUMNS="keyedColumns",e.SOURCE_FORMAT_UNKNOWN="unknown",e.SOURCE_FORMAT_TYPED_ARRAY="typedArray",e.SERIES_LAYOUT_BY_COLUMN="column",e.SERIES_LAYOUT_BY_ROW="row"},"+Dgo":function(t,e,i){var n=i("Y5nL"),r=i("Pgdp"),a=i("kdOt").detectSourceFormat,o=i("+2Ke").SERIES_LAYOUT_BY_COLUMN;n.extend({type:"dataset",defaultOption:{seriesLayoutBy:o,sourceHeader:null,dimensions:null,source:null},optionUpdated:function(){a(this)}}),r.extend({type:"dataset"})},"+UTs":function(t,e,i){var n=i("GxVO"),r=i("No7X"),a=n.extend({type:"polygon",shape:{points:null,smooth:!1,smoothConstraint:null},buildPath:function(t,e){r.buildPath(t,e,!0)}});t.exports=a},"+Y0c":function(t,e,i){var n=new(i("zMj2"))(50);function r(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=e[0]&&t<=e[1]},r.prototype.normalize=function(t){var e=this._extent;return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])},r.prototype.scale=function(t){var e=this._extent;return t*(e[1]-e[0])+e[0]},r.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1])},r.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=t),isNaN(e)||(i[1]=e)},r.prototype.isBlank=function(){return this._isBlank},r.prototype.setBlank=function(t){this._isBlank=t},r.prototype.getLabel=null,n.enableClassExtend(r),n.enableClassManagement(r,{registerWhenExtend:!0});var a=r;t.exports=a},"/86O":function(t,e,i){var n=i("9qnA"),r=i("/gxq"),a=i("3h1/"),o=i("qjrH"),s=i("28kU").ContextCachedBy,l=function(t){n.call(this,t)};l.prototype={constructor:l,type:"text",brush:function(t,e){var i=this.style;this.__dirty&&o.normalizeTextStyle(i,!0),i.fill=i.stroke=i.shadowBlur=i.shadowColor=i.shadowOffsetX=i.shadowOffsetY=null;var n=i.text;null!=n&&(n+=""),o.needDrawText(n,i)?(this.setTransform(t),o.renderText(this,t,n,i,null,e),this.restoreTransform(t)):t.__attrCachedBy=s.NONE},getBoundingRect:function(){var t=this.style;if(this.__dirty&&o.normalizeTextStyle(t,!0),!this._rect){var e=t.text;null!=e?e+="":e="";var i=a.getBoundingRect(t.text+"",t.font,t.textAlign,t.textVerticalAlign,t.textPadding,t.textLineHeight,t.rich);if(i.x+=t.x||0,i.y+=t.y||0,o.getStroke(t.textStroke,t.textStrokeWidth)){var n=t.textStrokeWidth;i.x-=n/2,i.y-=n/2,i.width+=n,i.height+=n}this._rect=i}return this._rect}},r.inherits(l,n);var u=l;t.exports=u},"/ZBO":function(t,e,i){var n=i("dOVI"),r=i("C7PF"),a=n.identity,o=5e-5;function s(t){return t>o||t<-o}var l=function(t){(t=t||{}).position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null},u=l.prototype;u.transform=null,u.needLocalTransform=function(){return s(this.rotation)||s(this.position[0])||s(this.position[1])||s(this.scale[0]-1)||s(this.scale[1]-1)};var h=[];u.updateTransform=function(){var t=this.parent,e=t&&t.transform,i=this.needLocalTransform(),r=this.transform;if(i||e){r=r||n.create(),i?this.getLocalTransform(r):a(r),e&&(i?n.mul(r,t.transform,r):n.copy(r,t.transform)),this.transform=r;var o=this.globalScaleRatio;if(null!=o&&1!==o){this.getGlobalScale(h);var s=h[0]<0?-1:1,l=h[1]<0?-1:1,u=((h[0]-s)*o+s)/h[0]||0,c=((h[1]-l)*o+l)/h[1]||0;r[0]*=u,r[1]*=u,r[2]*=c,r[3]*=c}this.invTransform=this.invTransform||n.create(),n.invert(this.invTransform,r)}else r&&a(r)},u.getLocalTransform=function(t){return l.getLocalTransform(this,t)},u.setTransform=function(t){var e=this.transform,i=t.dpr||1;e?t.setTransform(i*e[0],i*e[1],i*e[2],i*e[3],i*e[4],i*e[5]):t.setTransform(i,0,0,i,0,0)},u.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var c=[],d=n.create();u.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],i=t[2]*t[2]+t[3]*t[3],n=this.position,r=this.scale;s(e-1)&&(e=Math.sqrt(e)),s(i-1)&&(i=Math.sqrt(i)),t[0]<0&&(e=-e),t[3]<0&&(i=-i),n[0]=t[4],n[1]=t[5],r[0]=e,r[1]=i,this.rotation=Math.atan2(-t[1]/i,t[0]/e)}},u.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(n.mul(c,t.invTransform,e),e=c);var i=this.origin;i&&(i[0]||i[1])&&(d[4]=i[0],d[5]=i[1],n.mul(c,e,d),c[4]-=i[0],c[5]-=i[1],e=c),this.setLocalTransform(e)}},u.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},u.transformCoordToLocal=function(t,e){var i=[t,e],n=this.invTransform;return n&&r.applyTransform(i,i,n),i},u.transformCoordToGlobal=function(t,e){var i=[t,e],n=this.transform;return n&&r.applyTransform(i,i,n),i},l.getLocalTransform=function(t,e){a(e=e||[]);var i=t.origin,r=t.scale||[1,1],o=t.rotation||0,s=t.position||[0,0];return i&&(e[4]-=i[0],e[5]-=i[1]),n.scale(e,e,r),o&&n.rotate(e,e,o),i&&(e[4]+=i[0],e[5]+=i[1]),e[4]+=s[0],e[5]+=s[1],e};var f=l;t.exports=f},"/gZK":function(t,e,i){var n=i("hcq/"),r=i("Rfu2"),a=i("/gxq"),o=a.extend,s=a.isArray;t.exports=function(t,e,i){e=s(e)&&{coordDimensions:e}||o({},e);var a=t.getSource(),l=n(a,e),u=new r(l,t);return u.initData(a,i),u}},"/gxq":function(t,e){var i={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},n={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},r=Object.prototype.toString,a=Array.prototype,o=a.forEach,s=a.filter,l=a.slice,u=a.map,h=a.reduce,c={};function d(t){if(null==t||"object"!=typeof t)return t;var e=t,a=r.call(t);if("[object Array]"===a){if(!M(t)){e=[];for(var o=0,s=t.length;oe[0]&&(e=e.slice().reverse());var n=t.coordToPoint([e[0],i]),r=t.coordToPoint([e[1],i]);return{x1:n[0],y1:n[1],x2:r[0],y2:r[1]}}function h(t){return t.getRadiusAxis().inverse?0:1}function c(t){var e=t[0],i=t[t.length-1];e&&i&&Math.abs(Math.abs(e.coord-i.coord)-360)<1e-4&&t.pop()}var d=o.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(t,e){if(this.group.removeAll(),t.get("show")){var i=t.axis,r=i.polar,a=r.getRadiusAxis().getExtent(),o=i.getTicksCoords(),s=n.map(i.getViewLabels(),function(t){return(t=n.clone(t)).coord=i.dataToCoord(t.tickValue),t});c(s),c(o),n.each(l,function(e){!t.get(e+".show")||i.scale.isBlank()&&"axisLine"!==e||this["_"+e](t,r,o,a,s)},this)}},_axisLine:function(t,e,i,n){var a=t.getModel("axisLine.lineStyle"),o=new r.Circle({shape:{cx:e.cx,cy:e.cy,r:n[h(e)]},style:a.getLineStyle(),z2:1,silent:!0});o.style.fill=null,this.group.add(o)},_axisTick:function(t,e,i,a){var o=t.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[h(e)],c=n.map(i,function(t){return new r.Line({shape:u(e,[l,l+s],t.coord)})});this.group.add(r.mergePath(c,{style:n.defaults(o.getModel("lineStyle").getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")})}))},_axisLabel:function(t,e,i,o,l){var u=t.getCategories(!0),c=t.getModel("axisLabel"),d=c.get("margin"),f=t.get("triggerEvent");n.each(l,function(i,n){var l=c,p=i.tickValue,g=o[h(e)],v=e.coordToPoint([g+d,i.coord]),m=e.cx,y=e.cy,x=Math.abs(v[0]-m)/g<.3?"center":v[0]>m?"left":"right",_=Math.abs(v[1]-y)/g<.3?"middle":v[1]>y?"top":"bottom";u&&u[p]&&u[p].textStyle&&(l=new a(u[p].textStyle,c,c.ecModel));var w=new r.Text({silent:s.isLabelSilent(t)});this.group.add(w),r.setTextStyle(w.style,l,{x:v[0],y:v[1],textFill:l.getTextColor()||t.get("axisLine.lineStyle.color"),text:i.formattedLabel,textAlign:x,textVerticalAlign:_}),f&&(w.eventData=s.makeAxisEventDataBase(t),w.eventData.targetType="axisLabel",w.eventData.value=i.rawLabel)},this)},_splitLine:function(t,e,i,a){var o=t.getModel("splitLine").getModel("lineStyle"),s=o.get("color"),l=0;s=s instanceof Array?s:[s];for(var h=[],c=0;c=0),l=!s&&null!=r;(s||l)&&(e={textFill:t.textFill,textStroke:t.textStroke,textStrokeWidth:t.textStrokeWidth}),s&&(t.textFill="#fff",null==t.textStroke&&(t.textStroke=r,null==t.textStrokeWidth&&(t.textStrokeWidth=2))),l&&(t.textFill=r)}t.insideRollback=e}function lt(t){var e=t.insideRollback;e&&(t.textFill=e.textFill,t.textStroke=e.textStroke,t.textStrokeWidth=e.textStrokeWidth,t.insideRollback=null)}function ut(t,e,i,n,r,a){if("function"==typeof r&&(a=r,r=null),n&&n.isAnimationEnabled()){var o=t?"Update":"",s=n.getShallow("animationDuration"+o),l=n.getShallow("animationEasing"+o),u=n.getShallow("animationDelay"+o);"function"==typeof u&&(u=u(r,n.getAnimationDelayParams?n.getAnimationDelayParams(e,r):null)),"function"==typeof s&&(s=s(r)),s>0?e.animateTo(i,s,u||0,l,a,!!a):(e.stopAnimation(),e.attr(i),a&&a())}else e.stopAnimation(),e.attr(i),a&&a()}function ht(t,e,i,n,r){ut(!0,t,e,i,n,r)}function ct(t,e,i){return e&&!n.isArrayLike(e)&&(e=u.getLocalTransform(e)),i&&(e=o.invert([],e)),s.applyTransform([],t,e)}function dt(t,e,i,n,r,a,o,s){var l,u=i-t,h=n-e,c=o-r,d=s-a,f=ft(c,d,u,h);if((l=f)<=1e-6&&l>=-1e-6)return!1;var p=t-r,g=e-a,v=ft(p,g,u,h)/f;if(v<0||v>1)return!1;var m=ft(p,g,c,d)/f;return!(m<0||m>1)}function ft(t,e,i,n){return t*n-i*e}N("circle",f),N("sector",p),N("ring",g),N("polygon",v),N("polyline",m),N("rect",y),N("line",x),N("bezierCurve",_),N("arc",w),e.Z2_EMPHASIS_LIFT=P,e.CACHED_LABEL_STYLE_PROPERTIES={color:"textFill",textBorderColor:"textStroke",textBorderWidth:"textStrokeWidth"},e.extendShape=function(t){return l.extend(t)},e.extendPath=function(t,e){return r.extendFromString(t,e)},e.registerShape=N,e.getShapeClass=function(t){if(z.hasOwnProperty(t))return z[t]},e.makePath=B,e.makeImage=function(t,e,i){var n=new h({style:{image:t,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(t){if("center"===i){var r={width:t.width,height:t.height};n.setStyle(F(e,r))}}});return n},e.mergePath=H,e.resizePath=V,e.subPixelOptimizeLine=function(t){return C.subPixelOptimizeLine(t.shape,t.shape,t.style),t},e.subPixelOptimizeRect=function(t){return C.subPixelOptimizeRect(t.shape,t.shape,t.style),t},e.subPixelOptimize=q,e.setElementHoverStyle=J,e.setHoverStyle=function(t,e){it(t,!0),Z(t,J,e)},e.setAsHighDownDispatcher=it,e.isHighDownDispatcher=function(t){return!(!t||!t.__highDownDispatcher)},e.getHighlightDigit=function(t){var e=E[t];return null==e&&R<=32&&(e=E[t]=R++),e},e.setLabelStyle=function(t,e,i,r,a,o,s){var l,u=(a=a||k).labelFetcher,h=a.labelDataIndex,c=a.labelDimIndex,d=i.getShallow("show"),f=r.getShallow("show");(d||f)&&(u&&(l=u.getFormattedLabel(h,"normal",null,c)),null==l&&(l=n.isFunction(a.defaultText)?a.defaultText(h,a):a.defaultText));var p=d?l:null,g=f?n.retrieve2(u?u.getFormattedLabel(h,"emphasis",null,c):null,l):null;null==p&&null==g||(nt(t,i,o,a),nt(e,r,s,a,!0)),t.text=p,e.text=g},e.modifyLabelStyle=function(t,e,i){var r=t.style;e&&(lt(r),t.setStyle(e),st(r)),r=t.__hoverStl,i&&r&&(lt(r),n.extend(r,i),st(r))},e.setTextStyle=nt,e.setText=function(t,e,i){var n,r={isRectText:!0};!1===i?n=!0:r.autoColor=i,rt(t,e,r,n)},e.getFont=function(t,e){var i=e||e.getModel("textStyle");return n.trim([t.fontStyle||i&&i.getShallow("fontStyle")||"",t.fontWeight||i&&i.getShallow("fontWeight")||"",(t.fontSize||i&&i.getShallow("fontSize")||12)+"px",t.fontFamily||i&&i.getShallow("fontFamily")||"sans-serif"].join(" "))},e.updateProps=ht,e.initProps=function(t,e,i,n,r){ut(!1,t,e,i,n,r)},e.getTransform=function(t,e){for(var i=o.identity([]);t&&t!==e;)o.mul(i,t.getLocalTransform(),i),t=t.parent;return i},e.applyTransform=ct,e.transformDirection=function(t,e,i){var n=0===e[4]||0===e[5]||0===e[0]?1:Math.abs(2*e[4]/e[0]),r=0===e[4]||0===e[5]||0===e[2]?1:Math.abs(2*e[4]/e[2]),a=["left"===t?-n:"right"===t?n:0,"top"===t?-r:"bottom"===t?r:0];return a=ct(a,e,i),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"},e.groupTransition=function(t,e,i,r){if(t&&e){var a,o=(a={},t.traverse(function(t){!t.isGroup&&t.anid&&(a[t.anid]=t)}),a);e.traverse(function(t){if(!t.isGroup&&t.anid){var e=o[t.anid];if(e){var n=l(t);t.attr(l(e)),ht(t,n,i,t.dataIndex)}}})}function l(t){var e={position:s.clone(t.position),rotation:t.rotation};return t.shape&&(e.shape=n.extend({},t.shape)),e}},e.clipPointsByRect=function(t,e){return n.map(t,function(t){var i=t[0];i=I(i,e.x),i=D(i,e.x+e.width);var n=t[1];return n=I(n,e.y),[i,n=D(n,e.y+e.height)]})},e.clipRectByRect=function(t,e){var i=I(t.x,e.x),n=D(t.x+t.width,e.x+e.width),r=I(t.y,e.y),a=D(t.y+t.height,e.y+e.height);if(n>=i&&a>=r)return{x:i,y:r,width:n-i,height:a-r}},e.createIcon=function(t,e,i){var r=(e=n.extend({rectHover:!0},e)).style={strokeNoScale:!0};if(i=i||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(r.image=t.slice(8),n.defaults(r,i),new h(e)):B(t.replace("path://",""),e,i,"center")},e.linePolygonIntersect=function(t,e,i,n,r){for(var a=0,o=r[r.length-1];a0&&(c?"scale"!==d:"transition"!==f)){for(var v=a.getItemLayout(0),m=1;isNaN(v.startAngle)&&m=i.r0}}});t.exports=h},"1Hui":function(t,e){function i(t){return t}function n(t,e,n,r,a){this._old=t,this._new=e,this._oldKeyGetter=n||i,this._newKeyGetter=r||i,this.context=a}function r(t,e,i,n,r){for(var a=0;an||l.newline?(a=0,h=v,o+=s+i,s=f.height):s=Math.max(s,f.height)}else{var m=f.height+(g?-g.y+f.y:0);(c=o+m)>r||l.newline?(a+=s+i,o=0,c=m,s=f.width):s=Math.max(s,f.width)}l.newline||(d[0]=a,d[1]=o,"horizontal"===t?a=h+i:o=c+i)})}var c=h,d=n.curry(h,"vertical"),f=n.curry(h,"horizontal");function p(t,e,i){i=o.normalizeCssArray(i||0);var n=e.width,s=e.height,l=a(t.left,n),u=a(t.top,s),h=a(t.right,n),c=a(t.bottom,s),d=a(t.width,n),f=a(t.height,s),p=i[2]+i[0],g=i[1]+i[3],v=t.aspect;switch(isNaN(d)&&(d=n-h-g-l),isNaN(f)&&(f=s-c-p-u),null!=v&&(isNaN(d)&&isNaN(f)&&(v>n/s?d=.8*n:f=.8*s),isNaN(d)&&(d=v*f),isNaN(f)&&(f=d/v)),isNaN(l)&&(l=n-h-d-g),isNaN(u)&&(u=s-c-f-p),t.left||t.right){case"center":l=n/2-d/2-i[3];break;case"right":l=n-d-g}switch(t.top||t.bottom){case"middle":case"center":u=s/2-f/2-i[0];break;case"bottom":u=s-f-p}l=l||0,u=u||0,isNaN(d)&&(d=n-g-l-(h||0)),isNaN(f)&&(f=s-p-u-(c||0));var m=new r(l+i[3],u+i[0],d,f);return m.margin=i,m}function g(t,e){return e&&t&&s(l,function(i){e.hasOwnProperty(i)&&(t[i]=e[i])}),t}e.LOCATION_PARAMS=l,e.HV_NAMES=u,e.box=c,e.vbox=d,e.hbox=f,e.getAvailableSize=function(t,e,i){var n=e.width,r=e.height,s=a(t.x,n),l=a(t.y,r),u=a(t.x2,n),h=a(t.y2,r);return(isNaN(s)||isNaN(parseFloat(t.x)))&&(s=0),(isNaN(u)||isNaN(parseFloat(t.x2)))&&(u=n),(isNaN(l)||isNaN(parseFloat(t.y)))&&(l=0),(isNaN(h)||isNaN(parseFloat(t.y2)))&&(h=r),i=o.normalizeCssArray(i||0),{width:Math.max(u-s-i[1]-i[3],0),height:Math.max(h-l-i[0]-i[2],0)}},e.getLayoutRect=p,e.positionElement=function(t,e,i,a,o){var s=!o||!o.hv||o.hv[0],l=!o||!o.hv||o.hv[1],u=o&&o.boundingMode||"all";if(s||l){var h;if("raw"===u)h="group"===t.type?new r(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(h=t.getBoundingRect(),t.needLocalTransform()){var c=t.getLocalTransform();(h=h.clone()).applyTransform(c)}e=p(n.defaults({width:h.width,height:h.height},e),i,a);var d=t.position,f=s?e.x-h.x:0,g=l?e.y-h.y:0;t.attr("position","raw"===u?[f,g]:[d[0]+f,d[1]+g])}},e.sizeCalculable=function(t,e){return null!=t[u[e][0]]||null!=t[u[e][1]]&&null!=t[u[e][2]]},e.mergeLayoutParam=function(t,e,i){!n.isObject(i)&&(i={});var r=i.ignoreSize;!n.isArray(r)&&(r=[r,r]);var a=l(u[0],0),o=l(u[1],1);function l(i,n){var a={},o=0,l={},u=0;if(s(i,function(e){l[e]=t[e]}),s(i,function(t){h(e,t)&&(a[t]=l[t]=e[t]),c(a,t)&&o++,c(l,t)&&u++}),r[n])return c(e,i[1])?l[i[2]]=null:c(e,i[2])&&(l[i[1]]=null),l;if(2!==u&&o){if(o>=2)return a;for(var d=0;d=i&&t<=n},containData:function(t){return this.contain(this.dataToCoord(t))},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(t){return l(t||this.scale.getExtent(),this._extent)},setExtent:function(t,e){var i=this._extent;i[0]=t,i[1]=e},dataToCoord:function(t,e){var i=this._extent,n=this.scale;return t=n.normalize(t),this.onBand&&"ordinal"===n.type&&g(i=i.slice(),n.count()),s(t,f,i,e)},coordToData:function(t,e){var i=this._extent,n=this.scale;this.onBand&&"ordinal"===n.type&&g(i=i.slice(),n.count());var r=s(t,i,f,e);return this.scale.scale(r)},pointToData:function(t,e){},getTicksCoords:function(t){var e=(t=t||{}).tickModel||this.getTickModel(),i=h(this,e),n=i.ticks,o=a(n,function(t){return{coord:this.dataToCoord(t),tickValue:t}},this),s=e.get("alignWithLabel");return function(t,e,i,n,a){var o=e.length;if(!t.onBand||n||!o)return;var s,l=t.getExtent();if(1===o)e[0].coord=l[0],s=e[1]={coord:l[0]};else{var u=e[1].coord-e[0].coord;r(e,function(t){t.coord-=u/2;var e=e||0;e%2>0&&(t.coord-=u/(2*(e+1)))}),s={coord:e[o-1].coord+u},e.push(s)}var h=l[0]>l[1];c(e[0].coord,l[0])&&(a?e[0].coord=l[0]:e.shift());a&&c(l[0],e[0].coord)&&e.unshift({coord:l[0]});c(l[1],s.coord)&&(a?s.coord=l[1]:e.pop());a&&c(s.coord,l[1])&&e.push({coord:l[1]});function c(t,e){return h?t>e:ti||d+co&&(o+=r);var p=Math.atan2(h,u);return p<0&&(p+=r),p>=a&&p<=o||p+r>=a&&p+r<=o}},"2M5Q":function(t,e,i){var n=i("moDv"),r=i("u+XU"),a=i("LICT"),o=i("oBGI"),s=i("2I/p"),l=i("ABnm").normalizeRadian,u=i("AAi1"),h=i("QxFU"),c=n.CMD,d=2*Math.PI,f=1e-4;var p=[-1,-1,-1],g=[-1,-1];function v(t,e,i,n,r,a,o,s,l,h){if(h>e&&h>n&&h>a&&h>s||h1&&(void 0,c=g[0],g[0]=g[1],g[1]=c),f=u.cubicAt(e,n,a,s,g[0]),y>1&&(v=u.cubicAt(e,n,a,s,g[1]))),2===y?_e&&s>n&&s>a||s=0&&h<=1){for(var c=0,d=u.quadraticAt(e,n,a,h),f=0;fi||s<-i)return 0;var u=Math.sqrt(i*i-s*s);p[0]=-u,p[1]=u;var h=Math.abs(n-r);if(h<1e-4)return 0;if(h%d<1e-4){n=0,r=d;var c=a?1:-1;return o>=p[0]+t&&o<=p[1]+t?c:0}if(a){u=n;n=l(r),r=l(u)}else n=l(n),r=l(r);n>r&&(r+=d);for(var f=0,g=0;g<2;g++){var v=p[g];if(v+t>o){var m=Math.atan2(s,v);c=a?1:-1;m<0&&(m=d+m),(m>=n&&m<=r||m+d>=n&&m+d<=r)&&(m>Math.PI/2&&m<1.5*Math.PI&&(c=-c),f+=c)}}return f}function x(t,e,i,n,l){for(var u,d,p=0,g=0,x=0,_=0,w=0,b=0;b1&&(i||(p+=h(g,x,_,w,n,l))),1===b&&(_=g=t[b],w=x=t[b+1]),S){case c.M:g=_=t[b++],x=w=t[b++];break;case c.L:if(i){if(r.containStroke(g,x,t[b],t[b+1],e,n,l))return!0}else p+=h(g,x,t[b],t[b+1],n,l)||0;g=t[b++],x=t[b++];break;case c.C:if(i){if(a.containStroke(g,x,t[b++],t[b++],t[b++],t[b++],t[b],t[b+1],e,n,l))return!0}else p+=v(g,x,t[b++],t[b++],t[b++],t[b++],t[b],t[b+1],n,l)||0;g=t[b++],x=t[b++];break;case c.Q:if(i){if(o.containStroke(g,x,t[b++],t[b++],t[b],t[b+1],e,n,l))return!0}else p+=m(g,x,t[b++],t[b++],t[b],t[b+1],n,l)||0;g=t[b++],x=t[b++];break;case c.A:var M=t[b++],A=t[b++],T=t[b++],C=t[b++],I=t[b++],D=t[b++];b+=1;var k=1-t[b++],P=Math.cos(I)*T+M,O=Math.sin(I)*C+A;b>1?p+=h(g,x,P,O,n,l):(_=P,w=O);var L=(n-M)*C/T+M;if(i){if(s.containStroke(M,A,C,I,I+D,k,e,L,l))return!0}else p+=y(M,A,C,I,I+D,k,L,l);g=Math.cos(I+D)*T+M,x=Math.sin(I+D)*C+A;break;case c.R:_=g=t[b++],w=x=t[b++];P=_+t[b++],O=w+t[b++];if(i){if(r.containStroke(_,w,P,w,e,n,l)||r.containStroke(P,w,P,O,e,n,l)||r.containStroke(P,O,_,O,e,n,l)||r.containStroke(_,O,_,w,e,n,l))return!0}else p+=h(P,w,P,O,n,l),p+=h(_,O,_,w,n,l);break;case c.Z:if(i){if(r.containStroke(g,x,_,w,e,n,l))return!0}else p+=h(g,x,_,w,n,l);g=_,x=w}}return i||(u=x,d=w,Math.abs(u-d)i-2?i-1:f+1],c=t[f>i-3?i-1:f+2]);var v=p*p,m=p*v;a.push([r(u[0],g[0],h[0],c[0],p,v,m),r(u[1],g[1],h[1],c[1],p,v,m)])}return a}},"2uoh":function(t,e,i){var n=i("/gxq"),r={getMin:function(t){var e=this.option,i=t||null==e.rangeStart?e.min:e.rangeStart;return this.axis&&null!=i&&"dataMin"!==i&&"function"!=typeof i&&!n.eqNaN(i)&&(i=this.axis.scale.parse(i)),i},getMax:function(t){var e=this.option,i=t||null==e.rangeEnd?e.max:e.rangeEnd;return this.axis&&null!=i&&"dataMax"!==i&&"function"!=typeof i&&!n.eqNaN(i)&&(i=this.axis.scale.parse(i)),i},getNeedCrossZero:function(){var t=this.option;return null==t.rangeStart&&null==t.rangeEnd&&!t.scale},getCoordSysModel:n.noop,setRange:function(t,e){this.option.rangeStart=t,this.option.rangeEnd=e},resetRange:function(){this.option.rangeStart=this.option.rangeEnd=null}};t.exports=r},"3h1/":function(t,e,i){var n=i("8b51"),r=i("+Y0c"),a=i("/gxq"),o=a.getContext,s=a.extend,l=a.retrieve2,u=a.retrieve3,h=a.trim,c={},d=0,f=5e3,p=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,g="12px sans-serif",v={};function m(t,e){var i=t+":"+(e=e||g);if(c[i])return c[i];for(var n=(t+"").split("\n"),r=0,a=0,o=n.length;af&&(d=0,c={}),d++,c[i]=r,r}function y(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function x(t,e,i){return"middle"===i?t-=e/2:"bottom"===i&&(t-=e),t}function _(t,e,i){var n=e.textPosition,r=e.textDistance,a=i.x,o=i.y,s=i.height,l=i.width,u=s/2,h="left",c="top";switch(n){case"left":a-=r,o+=u,h="right",c="middle";break;case"right":a+=r+l,o+=u,c="middle";break;case"top":a+=l/2,o-=r,h="center",c="bottom";break;case"bottom":a+=l/2,o+=s+r,h="center";break;case"inside":a+=l/2,o+=u,h="center",c="middle";break;case"insideLeft":a+=r,o+=u,c="middle";break;case"insideRight":a+=l-r,o+=u,h="right",c="middle";break;case"insideTop":a+=l/2,o+=r,h="center";break;case"insideBottom":a+=l/2,o+=s-r,h="center",c="bottom";break;case"insideTopLeft":a+=r,o+=r;break;case"insideTopRight":a+=l-r,o+=r,h="right";break;case"insideBottomLeft":a+=r,o+=s-r,c="bottom";break;case"insideBottomRight":a+=l-r,o+=s-r,h="right",c="bottom"}return(t=t||{}).x=a,t.y=o,t.textAlign=h,t.textVerticalAlign=c,t}function w(t,e,i,n,r){if(!e)return"";var a=(t+"").split("\n");r=b(e,i,n,r);for(var o=0,s=a.length;o=a;u++)o-=a;var h=m(i,e);return h>o&&(i="",h=0),o=t-h,n.ellipsis=i,n.ellipsisWidth=h,n.contentWidth=o,n.containerWidth=t,n}function S(t,e){var i=e.containerWidth,n=e.font,r=e.contentWidth;if(!i)return"";var a=m(t,n);if(a<=i)return t;for(var o=0;;o++){if(a<=r||o>=e.maxIterations){t+=e.ellipsis;break}var s=0===o?M(t,r,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(t.length*r/a):0;a=m(t=t.substr(0,s),n)}return""===t&&(t=e.placeholder),t}function M(t,e,i,n){for(var r=0,a=0,o=t.length;ah)t="",o=[];else if(null!=c)for(var d=b(c-(i?i[1]+i[3]:0),e,r.ellipsis,{minChar:r.minChar,placeholder:r.placeholder}),f=0,p=o.length;fa&&D(i,t.substring(a,o)),D(i,n[2],n[1]),a=p.lastIndex}ay)return{lines:[],width:0,height:0};N.textWidth=m(N.text,I);var P=T.textWidth,O=null==P||"auto"===P;if("string"==typeof P&&"%"===P.charAt(P.length-1))N.percentWidth=P,d.push(N),P=0;else{if(O){P=N.textWidth;var L=T.textBackgroundColor,R=L&&L.image;R&&(R=r.findExistImage(R),r.isImageReady(R)&&(P=Math.max(P,R.width*k/R.height)))}var E=C?C[1]+C[3]:0;P+=E;var z=null!=v?v-S:null;null!=z&&z0&&d>0&&!f&&(l=0),l<0&&d<0&&!p&&(d=0));var v=e.ecModel;if(v&&"time"===o){var m,y=u("bar",v);if(n.each(y,function(t){m|=t.getBaseAxis()===e.axis}),m){var x=h(y),_=function(t,e,i,r){var a=i.axis.getExtent(),o=a[1]-a[0],s=c(r,i.axis);if(void 0===s)return{min:t,max:e};var l=1/0;n.each(s,function(t){l=Math.min(t.offset,l)});var u=-1/0;n.each(s,function(t){u=Math.max(t.offset+t.width,u)}),l=Math.abs(l),u=Math.abs(u);var h=l+u,d=e-t,f=d/(1-(l+u)/o)-d;return{min:t-=f*(l/h),max:e+=f*(u/h)}}(l,d,e,x);l=_.min,d=_.max}}return[l,d]}function p(t){var e,i=t.getLabelModel().get("formatter"),n="category"===t.type?t.scale.getExtent()[0]:null;return"string"==typeof i?(e=i,i=function(i){return i=t.scale.getLabel(i),e.replace("{value}",null!=i?i:"")}):"function"==typeof i?function(e,r){return null!=n&&(r=e-n),i(g(t,e),r)}:function(e){return t.scale.getLabel(e)}}function g(t,e){return"category"===t.type?t.scale.getLabel(e):e}function v(t){var e=t.get("interval");return null==e?"auto":e}i("dDRy"),i("xCbH"),e.getScaleExtent=f,e.niceScaleExtent=function(t,e){var i=f(t,e),n=null!=e.getMin(),r=null!=e.getMax(),a=e.get("splitNumber");"log"===t.type&&(t.base=e.get("logBase"));var o=t.type;t.setExtent(i[0],i[1]),t.niceExtent({splitNumber:a,fixMin:n,fixMax:r,minInterval:"interval"===o||"time"===o?e.get("minInterval"):null,maxInterval:"interval"===o||"time"===o?e.get("maxInterval"):null});var s=e.get("interval");null!=s&&t.setInterval&&t.setInterval(s)},e.createScaleByModel=function(t,e){if(e=e||t.get("type"))switch(e){case"category":return new r(t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),[1/0,-1/0]);case"value":return new a;default:return(o.getClass(e)||a).create(t)}},e.ifAxisCrossZero=function(t){var e=t.scale.getExtent(),i=e[0],n=e[1];return!(i>0&&n>0||i<0&&n<0)},e.makeLabelFormatter=p,e.getAxisRawValue=g,e.estimateLabelUnionRect=function(t){var e=t.model,i=t.scale;if(e.get("axisLabel.show")&&!i.isBlank()){var n,r,a="category"===t.type,o=i.getExtent();r=a?i.count():(n=i.getTicks()).length;var s,l,u,h,c,f,g,v,m,y=t.getLabelModel(),x=p(t),_=1;r>40&&(_=Math.ceil(r/40));for(var w=0;w0&&e.animate(i,!1).when(null==a?500:a,h).delay(o||0)}(t,"",t,e,i,n,c);var d=t.animators.slice(),p=d.length;function g(){--p||a&&a()}p||a&&a();for(var v=0;v=0)&&i({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},remove:function(t,e){r.unregister(e.getZr(),"axisPointer"),a.superApply(this._model,"remove",arguments)},dispose:function(t,e){r.unregister("axisPointer",e),a.superApply(this._model,"dispose",arguments)}}),o=a;t.exports=o},"5KBG":function(t,e,i){i("4Nz2").__DEV__;var n=i("/gxq"),r=(n.isTypedArray,n.extend),a=(n.assert,n.each),o=n.isObject,s=i("vXqC"),l=s.getDataItemValue,u=s.isDataItemOption,h=i("wWR3").parseDate,c=i("rrAD"),d=i("+2Ke"),f=d.SOURCE_FORMAT_TYPED_ARRAY,p=d.SOURCE_FORMAT_ARRAY_ROWS,g=d.SOURCE_FORMAT_ORIGINAL,v=d.SOURCE_FORMAT_OBJECT_ROWS;function m(t,e){c.isInstance(t)||(t=c.seriesDataToSource(t)),this._source=t;var i=this._data=t.data,n=t.sourceFormat;n===f&&(this._offset=0,this._dimSize=e,this._data=i);var a=x[n===p?n+"_"+t.seriesLayoutBy:n];r(this,a)}var y=m.prototype;y.pure=!1,y.persistent=!0,y.getSource=function(){return this._source};var x={arrayRows_column:{pure:!0,count:function(){return Math.max(0,this._data.length-this._source.startIndex)},getItem:function(t){return this._data[t+this._source.startIndex]},appendData:b},arrayRows_row:{pure:!0,count:function(){var t=this._data[0];return t?Math.max(0,t.length-this._source.startIndex):0},getItem:function(t){t+=this._source.startIndex;for(var e=[],i=this._data,n=0;n=0},getOrient:function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},defaultOption:{zlevel:0,z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",itemStyle:{borderWidth:0},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:" sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}}}),h=u;t.exports=h},"6Kqb":function(t,e,i){var n=i("GxVO").extend({type:"ring",shape:{cx:0,cy:0,r:0,r0:0},buildPath:function(t,e){var i=e.cx,n=e.cy,r=2*Math.PI;t.moveTo(i+e.r,n),t.arc(i,n,e.r,0,r,!1),t.moveTo(i+e.r0,n),t.arc(i,n,e.r0,0,r,!0)}});t.exports=n},"6NQ8":function(t,e){var i=Math.log(2);function n(t,e,r,a,o,s){var l=a+"-"+o,u=t.length;if(s.hasOwnProperty(l))return s[l];if(1===e){var h=Math.round(Math.log((1<c?c=f:(d.lastTickCount=n,d.lastAutoInterval=c),c}},n.inherits(s,a);var l=s;t.exports=l},"6axr":function(t,e,i){var n=i("YqdL"),r=i("6UfY"),a=function(t){this.name=t||"",this.cx=0,this.cy=0,this._radiusAxis=new n,this._angleAxis=new r,this._radiusAxis.polar=this._angleAxis.polar=this};a.prototype={type:"polar",axisPointerEnabled:!0,constructor:a,dimensions:["radius","angle"],model:null,containPoint:function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},containData:function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},getAxis:function(t){return this["_"+t+"Axis"]},getAxes:function(){return[this._radiusAxis,this._angleAxis]},getAxesByScale:function(t){var e=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===t&&e.push(i),n.scale.type===t&&e.push(n),e},getAngleAxis:function(){return this._angleAxis},getRadiusAxis:function(){return this._radiusAxis},getOtherAxis:function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},getTooltipAxes:function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},dataToPoint:function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},pointToData:function(t,e){var i=this.pointToCoord(t);return[this._radiusAxis.radiusToData(i[0],e),this._angleAxis.angleToData(i[1],e)]},pointToCoord:function(t){var e=t[0]-this.cx,i=t[1]-this.cy,n=this.getAngleAxis(),r=n.getExtent(),a=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);n.inverse?a=o-360:o=a+360;var s=Math.sqrt(e*e+i*i);e/=s,i/=s;for(var l=Math.atan2(-i,e)/Math.PI*180,u=lo;)l+=360*u;return[s,l]},coordToPoint:function(t){var e=t[0],i=t[1]/180*Math.PI;return[Math.cos(i)*e+this.cx,-Math.sin(i)*e+this.cy]},getArea:function(){var t=this.getAngleAxis(),e=this.getRadiusAxis().getExtent().slice();e[0]>e[1]&&e.reverse();var i=t.getExtent(),n=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:e[0],r:e[1],startAngle:-i[0]*n,endAngle:-i[1]*n,clockwise:t.inverse,contain:function(t,e){var i=t-this.cx,n=e-this.cy,r=i*i+n*n,a=this.r,o=this.r0;return r<=a*a&&r>=o*o}}}};var o=a;t.exports=o},"6f6q":function(t,e,i){var n=i("Icdr"),r=i("/gxq");function a(t,e,i){var n,a={},o="toggleSelected"===t;return i.eachComponent("legend",function(i){o&&null!=n?i[n?"select":"unSelect"](e.name):"allSelect"===t||"inverseSelect"===t?i[t]():(i[t](e.name),n=i.isSelected(e.name));var s=i.getData();r.each(s,function(t){var e=t.get("name");if("\n"!==e&&""!==e){var n=i.isSelected(e);a.hasOwnProperty(e)?a[e]=a[e]&&n:a[e]=n}})}),"allSelect"===t||"inverseSelect"===t?{selected:a}:{name:e.name,selected:a}}n.registerAction("legendToggleSelect","legendselectchanged",r.curry(a,"toggleSelected")),n.registerAction("legendAllSelect","legendselectall",r.curry(a,"allSelect")),n.registerAction("legendInverseSelect","legendinverseselect",r.curry(a,"inverseSelect")),n.registerAction("legendSelect","legendselected",r.curry(a,"select")),n.registerAction("legendUnSelect","legendunselected",r.curry(a,"unSelect"))},"7XrG":function(t,e,i){var n=i("Icdr").extendComponentModel({type:"tooltip",dependencies:["axisPointer"],defaultOption:{zlevel:0,z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:!1,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(50,50,50,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#fff",fontSize:14}}});t.exports=n},"80cc":function(t,e,i){var n=i("Icdr");i("6JAQ"),i("6f6q"),i("8RN9");var r=i("JIsR"),a=i("Y5nL");n.registerProcessor(n.PRIORITY.PROCESSOR.SERIES_FILTER,r),a.registerSubTypeDefaulter("legend",function(){return"plain"})},"8RN9":function(t,e,i){i("4Nz2").__DEV__;var n=i("Icdr"),r=i("/gxq"),a=i("kK7q").createSymbol,o=i("0sHC"),s=i("v/cD").makeBackground,l=i("1Xuh"),u=r.curry,h=r.each,c=o.Group,d=n.extendComponentView({type:"legend.plain",newlineDisabled:!1,init:function(){this.group.add(this._contentGroup=new c),this._backgroundEl,this.group.add(this._selectorGroup=new c),this._isFirstRender=!0},getContentGroup:function(){return this._contentGroup},getSelectorGroup:function(){return this._selectorGroup},render:function(t,e,i){var n=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var a=t.get("align"),o=t.get("orient");a&&"auto"!==a||(a="right"===t.get("left")&&"vertical"===o?"right":"left");var u=t.get("selector",!0),h=t.get("selectorPosition",!0);!u||h&&"auto"!==h||(h="horizontal"===o?"end":"start"),this.renderInner(a,t,e,i,u,o,h);var c=t.getBoxLayoutParams(),d={width:i.getWidth(),height:i.getHeight()},f=t.get("padding"),p=l.getLayoutRect(c,d,f),g=this.layoutInner(t,a,p,n,u,h),v=l.getLayoutRect(r.defaults({width:g.width,height:g.height},c),d,f);this.group.attr("position",[v.x-g.x,v.y-g.y]),this.group.add(this._backgroundEl=s(g,t))}},resetInner:function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},renderInner:function(t,e,i,n,a,o,s){var l=this.getContentGroup(),d=r.createHashMap(),f=e.get("selectedMode"),m=[];i.eachRawSeries(function(t){!t.get("legendHoverLink")&&m.push(t.id)}),h(e.getData(),function(r,a){var o=r.get("name");if(this.newlineDisabled||""!==o&&"\n"!==o){var s=i.getSeriesByName(o)[0];if(!d.get(o))if(s){var h=s.getData(),y=h.getVisual("color"),x=h.getVisual("borderColor");"function"==typeof y&&(y=y(s.getDataParams(0))),"function"==typeof x&&(x=x(s.getDataParams(0)));var _=h.getVisual("legendSymbol")||"roundRect",w=h.getVisual("symbol");this._createItem(o,a,r,e,_,w,t,y,x,f).on("click",u(p,o,n)).on("mouseover",u(g,s.name,null,n,m)).on("mouseout",u(v,s.name,null,n,m)),d.set(o,!0)}else i.eachRawSeries(function(i){if(!d.get(o)&&i.legendDataProvider){var s=i.legendDataProvider(),l=s.indexOfName(o);if(l<0)return;var h=s.getItemVisual(l,"color"),c=s.getItemVisual(l,"borderColor");this._createItem(o,a,r,e,"roundRect",null,t,h,c,f).on("click",u(p,o,n)).on("mouseover",u(g,null,o,n,m)).on("mouseout",u(v,null,o,n,m)),d.set(o,!0)}},this)}else l.add(new c({newline:!0}))},this),a&&this._createSelector(a,e,n,o,s)},_createSelector:function(t,e,i,n,r){var a=this.getSelectorGroup();h(t,function(t){!function(t){var n=t.type,r=new o.Text({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:"all"===n?"legendAllSelect":"legendInverseSelect"})}});a.add(r);var s=e.getModel("selectorLabel"),l=e.getModel("emphasis.selectorLabel");o.setLabelStyle(r.style,r.hoverStyle={},s,l,{defaultText:t.title,isRectText:!1}),o.setHoverStyle(r)}(t)})},_createItem:function(t,e,i,n,s,l,u,h,d,p){var g=n.get("itemWidth"),v=n.get("itemHeight"),m=n.get("inactiveColor"),y=n.get("inactiveBorderColor"),x=n.get("symbolKeepAspect"),_=n.getModel("itemStyle"),w=n.isSelected(t),b=new c,S=i.getModel("textStyle"),M=i.get("icon"),A=i.getModel("tooltip"),T=A.parentModel,C=a(s=M||s,0,0,g,v,w?h:m,null==x||x);if(b.add(f(C,s,_,d,y,w)),!M&&l&&(l!==s||"none"===l)){var I=.8*v;"none"===l&&(l="circle");var D=a(l,(g-I)/2,(v-I)/2,I,I,w?h:m,null==x||x);b.add(f(D,l,_,d,y,w))}var k="left"===u?g+5:-5,P=u,O=n.get("formatter"),L=t;"string"==typeof O&&O?L=O.replace("{name}",null!=t?t:""):"function"==typeof O&&(L=O(t)),b.add(new o.Text({style:o.setTextStyle({},S,{text:L,x:k,y:v/2,textFill:w?S.getTextColor():m,textAlign:P,textVerticalAlign:"middle"})}));var R=new o.Rect({shape:b.getBoundingRect(),invisible:!0,tooltip:A.get("show")?r.extend({content:t,formatter:T.get("formatter",!0)||function(){return t},formatterParams:{componentType:"legend",legendIndex:n.componentIndex,name:t,$vars:["name"]}},A.option):null});return b.add(R),b.eachChild(function(t){t.silent=!0}),R.silent=!p,this.getContentGroup().add(b),o.setHoverStyle(b),b.__legendDataIndex=e,b},layoutInner:function(t,e,i,n,r,a){var o=this.getContentGroup(),s=this.getSelectorGroup();l.box(t.get("orient"),o,t.get("itemGap"),i.width,i.height);var u=o.getBoundingRect(),h=[-u.x,-u.y];if(r){l.box("horizontal",s,t.get("selectorItemGap",!0));var c=s.getBoundingRect(),d=[-c.x,-c.y],f=t.get("selectorButtonGap",!0),p=t.getOrient().index,g=0===p?"width":"height",v=0===p?"height":"width",m=0===p?"y":"x";"end"===a?d[p]+=u[g]+f:h[p]+=c[g]+f,d[1-p]+=u[v]/2-c[v]/2,s.attr("position",d),o.attr("position",h);var y={x:0,y:0};return y[g]=u[g]+f+c[g],y[v]=Math.max(u[v],c[v]),y[m]=Math.min(0,c[m]+d[1-p]),y}return o.attr("position",h),this.group.getBoundingRect()},remove:function(){this.getContentGroup().removeAll(),this._isFirstRender=!0}});function f(t,e,i,n,r,a){var o;return"line"!==e&&e.indexOf("empty")<0?(o=i.getItemStyle(),t.style.stroke=n,a||(o.stroke=r)):o=i.getItemStyle(["borderWidth","borderColor"]),t.setStyle(o)}function p(t,e){e.dispatchAction({type:"legendToggleSelect",name:t})}function g(t,e,i,n){var r=i.getZr().storage.getDisplayList()[0];r&&r.useHoverLayer||i.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:n})}function v(t,e,i,n){var r=i.getZr().storage.getDisplayList()[0];r&&r.useHoverLayer||i.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:n})}t.exports=d},"8V5i":function(t,e,i){var n=i("/gxq"),r=n.each,a=n.isArray,o=n.isObject,s=i("xb/I"),l=i("vXqC").normalizeToArray;function u(t){r(h,function(e){e[0]in t&&!(e[1]in t)&&(t[e[1]]=t[e[0]])})}var h=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],c=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"];t.exports=function(t,e){s(t,e),t.series=l(t.series),r(t.series,function(t){if(o(t)){var e=t.type;if("line"===e)null!=t.clipOverflow&&(t.clip=t.clipOverflow);else if("pie"===e||"gauge"===e)null!=t.clockWise&&(t.clockwise=t.clockWise);else if("gauge"===e){var i=function(t,e){e=e.split(",");for(var i=t,n=0;n=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height},clone:function(){return new d(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},d.create=function(t){return new d(t.x,t.y,t.width,t.height)};var f=d;t.exports=f},"94aj":function(t,e,i){var n=i("UnZu"),r=Object.prototype,a=r.hasOwnProperty,o=r.toString,s=n?n.toStringTag:void 0;t.exports=function(t){var e=a.call(t,s),i=t[s];try{t[s]=void 0;var n=!0}catch(t){}var r=o.call(t);return n&&(e?t[s]=i:delete t[s]),r}},"9N6q":function(t,e,i){var n=i("/gxq"),r=i("YNzw"),a=i("AlhT"),o=i("HKuw");function s(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var l=function(){this._roots=[],this._displayList=[],this._displayListLen=0};l.prototype={constructor:l,traverse:function(t,e){for(var i=0;i=0&&(this.delFromStorage(t),this._roots.splice(o,1),t instanceof a&&t.delChildrenFromStorage(this))}},addToStorage:function(t){return t&&(t.__storage=this,t.dirty(!1)),this},delFromStorage:function(t){return t&&(t.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:s};var u=l;t.exports=u},"9Z3y":function(t,e,i){var n=i("wWR3"),r=n.parsePercent,a=n.linearMap,o=i("XhgW"),s=i("/gxq"),l=2*Math.PI,u=Math.PI/180;t.exports=function(t,e,i,n){e.eachSeriesByType(t,function(t){var e=t.getData(),n=e.mapDimension("value"),h=t.get("center"),c=t.get("radius");s.isArray(c)||(c=[0,c]),s.isArray(h)||(h=[h,h]);var d=i.getWidth(),f=i.getHeight(),p=Math.min(d,f),g=r(h[0],d),v=r(h[1],f),m=r(c[0],p/2),y=r(c[1],p/2),x=-t.get("startAngle")*u,_=t.get("minAngle")*u,w=0;e.each(n,function(t){!isNaN(t)&&w++});var b=e.getSum(n),S=Math.PI/(b||w)*2,M=t.get("clockwise"),A=t.get("roseType"),T=t.get("stillShowZeroSum"),C=e.getDataExtent(n);C[0]=0;var I=l,D=0,k=x,P=M?1:-1;if(e.each(n,function(t,i){var n;if(isNaN(t))e.setItemLayout(i,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:M,cx:g,cy:v,r0:m,r:A?NaN:y});else{(n="area"!==A?0===b&&T?S:t*S:l/w)<_?(n=_,I-=_):D+=t;var r=k+P*n;e.setItemLayout(i,{angle:n,startAngle:k,endAngle:r,clockwise:M,cx:g,cy:v,r0:m,r:A?a(t,C,[m,y]):y}),k=r}}),I-l&&tl||t<-l}function m(t,e,i,n,r){var a=1-r;return a*a*(a*t+3*r*e)+r*r*(r*n+3*a*i)}function y(t,e,i,n){var r=1-n;return r*(r*t+2*n*e)+n*n*i}e.cubicAt=m,e.cubicDerivativeAt=function(t,e,i,n,r){var a=1-r;return 3*(((e-t)*a+2*(i-e)*r)*a+(n-i)*r*r)},e.cubicRootAt=function(t,e,i,n,r,a){var l=n+3*(e-i)-t,u=3*(i-2*e+t),d=3*(e-t),f=t-r,p=u*u-3*l*d,v=u*d-9*l*f,m=d*d-3*u*f,y=0;if(g(p)&&g(v))g(u)?a[0]=0:(D=-d/u)>=0&&D<=1&&(a[y++]=D);else{var x=v*v-4*p*m;if(g(x)){var _=v/p,w=-_/2;(D=-u/l+_)>=0&&D<=1&&(a[y++]=D),w>=0&&w<=1&&(a[y++]=w)}else if(x>0){var b=s(x),S=p*u+1.5*l*(-v+b),M=p*u+1.5*l*(-v-b);(D=(-u-((S=S<0?-o(-S,c):o(S,c))+(M=M<0?-o(-M,c):o(M,c))))/(3*l))>=0&&D<=1&&(a[y++]=D)}else{var A=(2*p*u-3*l*v)/(2*s(p*p*p)),T=Math.acos(A)/3,C=s(p),I=Math.cos(T),D=(-u-2*C*I)/(3*l),k=(w=(-u+C*(I+h*Math.sin(T)))/(3*l),(-u+C*(I-h*Math.sin(T)))/(3*l));D>=0&&D<=1&&(a[y++]=D),w>=0&&w<=1&&(a[y++]=w),k>=0&&k<=1&&(a[y++]=k)}}return y},e.cubicExtrema=function(t,e,i,n,r){var a=6*i-12*e+6*t,o=9*e+3*n-3*t-9*i,l=3*e-3*t,u=0;if(g(o))v(a)&&(c=-l/a)>=0&&c<=1&&(r[u++]=c);else{var h=a*a-4*o*l;if(g(h))r[0]=-a/(2*o);else if(h>0){var c,d=s(h),f=(-a-d)/(2*o);(c=(-a+d)/(2*o))>=0&&c<=1&&(r[u++]=c),f>=0&&f<=1&&(r[u++]=f)}}return u},e.cubicSubdivide=function(t,e,i,n,r,a){var o=(e-t)*r+t,s=(i-e)*r+e,l=(n-i)*r+i,u=(s-o)*r+o,h=(l-s)*r+s,c=(h-u)*r+u;a[0]=t,a[1]=o,a[2]=u,a[3]=c,a[4]=c,a[5]=h,a[6]=l,a[7]=n},e.cubicProjectPoint=function(t,e,i,n,r,o,l,h,c,g,v){var y,x,_,w,b,S=.005,M=1/0;d[0]=c,d[1]=g;for(var A=0;A<1;A+=.05)f[0]=m(t,i,r,l,A),f[1]=m(e,n,o,h,A),(w=a(d,f))=0&&w=0&&c<=1&&(r[u++]=c);else{var h=o*o-4*a*l;if(g(h))(c=-o/(2*a))>=0&&c<=1&&(r[u++]=c);else if(h>0){var c,d=s(h),f=(-o-d)/(2*a);(c=(-o+d)/(2*a))>=0&&c<=1&&(r[u++]=c),f>=0&&f<=1&&(r[u++]=f)}}return u},e.quadraticExtremum=function(t,e,i){var n=t+i-2*e;return 0===n?.5:(t-e)/n},e.quadraticSubdivide=function(t,e,i,n,r){var a=(e-t)*n+t,o=(i-e)*n+e,s=(o-a)*n+a;r[0]=t,r[1]=a,r[2]=s,r[3]=s,r[4]=o,r[5]=i},e.quadraticProjectPoint=function(t,e,i,n,r,o,l,h,c){var g,v=.005,m=1/0;d[0]=l,d[1]=h;for(var x=0;x<1;x+=.05)f[0]=y(t,i,r,x),f[1]=y(e,n,o,x),(S=a(d,f))=0&&S=0&&(i.splice(n,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__storage,i=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),t instanceof o&&t.addChildrenToStorage(e)),i&&i.refresh()},remove:function(t){var e=this.__zr,i=this.__storage,r=this._children,a=n.indexOf(r,t);return a<0?this:(r.splice(a,1),t.parent=null,i&&(i.delFromStorage(t),t instanceof o&&t.delChildrenFromStorage(i)),e&&e.refresh(),this)},removeAll:function(){var t,e,i=this._children,n=this.__storage;for(e=0;e>1^-(1&s),l=l>>1^-(1&l),r=s+=r,a=l+=a,n.push([s/i,l/i])}return n}t.exports=function(t){return function(t){if(!t.UTF8Encoding)return t;var e=t.UTF8Scale;null==e&&(e=1024);for(var i=t.features,n=0;n0}),function(t){var e=t.properties,i=t.geometry,a=i.coordinates,o=[];"Polygon"===i.type&&o.push({type:"polygon",exterior:a[0],interiors:a.slice(1)}),"MultiPolygon"===i.type&&n.each(a,function(t){t[0]&&o.push({type:"polygon",exterior:t[0],interiors:t.slice(1)})});var s=new r(e.name,o,e.cp);return s.properties=e,s})}},B33o:function(t,e,i){var n=i("8b51"),r=i("wUOi"),a=i("C7PF"),o=i("N1qP");function s(t,e,i){if(this.name=t,this.geometries=e,i)i=[i[0],i[1]];else{var n=this.getBoundingRect();i=[n.x+n.width/2,n.y+n.height/2]}this.center=i}s.prototype={constructor:s,properties:null,getBoundingRect:function(){var t=this._rect;if(t)return t;for(var e=Number.MAX_VALUE,i=[e,e],o=[-e,-e],s=[],l=[],u=this.geometries,h=0;h.5?e:t}function c(t,e,i,n,r){var a=t.length;if(1===r)for(var o=0;or)t.length=r;else for(var a=n;a=0&&!(C[i]<=e);i--);i=Math.min(i,_-2)}else{for(i=H;i<_&&!(C[i]>e);i++);i=Math.min(i-1,_-2)}H=i,V=e;var n=C[i+1]-C[i];if(0!==n)if(E=(e-C[i])/n,x)if(N=I[i],z=I[0===i?i:i-1],B=I[i>_-2?_-1:i+1],F=I[i>_-3?_-1:i+2],S)p(z,N,B,F,E,E*E,E*E*E,v(t,s),T);else{if(M)r=p(z,N,B,F,E,E*E,E*E*E,q,1),r=m(q);else{if(A)return h(N,B,E);r=g(z,N,B,F,E,E*E,E*E*E)}y(t,s,r)}else if(S)c(I[i],I[i+1],E,v(t,s),T);else{var r;if(M)c(I[i],I[i+1],E,q,1),r=m(q);else{if(A)return h(I[i],I[i+1],E);r=u(I[i],I[i+1],E)}y(t,s,r)}},ondestroy:i});return e&&"spline"!==e&&(W.easing=e),W}}}var x=function(t,e,i,n){this._tracks={},this._target=t,this._loop=e||!1,this._getter=i||s,this._setter=n||l,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};x.prototype={when:function(t,e){var i=this._tracks;for(var n in e)if(e.hasOwnProperty(n)){if(!i[n]){i[n]=[];var r=this._getter(this._target,n);if(null==r)continue;0!==t&&i[n].push({time:0,value:v(r)})}i[n].push({time:t,value:e[n]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t255?255:t}function a(t){return t<0?0:t>1?1:t}function o(t){return t.length&&"%"===t.charAt(t.length-1)?r(parseFloat(t)/100*255):r(parseInt(t,10))}function s(t){return t.length&&"%"===t.charAt(t.length-1)?a(parseFloat(t)/100):a(parseFloat(t))}function l(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}function u(t,e,i){return t+(e-t)*i}function h(t,e,i,n,r){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t}function c(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var d=new(i("zMj2"))(20),f=null;function p(t,e){f&&c(f,e),f=d.put(t,f||e.slice())}function g(t,e){if(t){e=e||[];var i=d.get(t);if(i)return c(e,i);var r,a=(t+="").replace(/ /g,"").toLowerCase();if(a in n)return c(e,n[a]),p(t,e),e;if("#"===a.charAt(0))return 4===a.length?(r=parseInt(a.substr(1),16))>=0&&r<=4095?(h(e,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1),p(t,e),e):void h(e,0,0,0,1):7===a.length?(r=parseInt(a.substr(1),16))>=0&&r<=16777215?(h(e,(16711680&r)>>16,(65280&r)>>8,255&r,1),p(t,e),e):void h(e,0,0,0,1):void 0;var l=a.indexOf("("),u=a.indexOf(")");if(-1!==l&&u+1===a.length){var f=a.substr(0,l),g=a.substr(l+1,u-(l+1)).split(","),m=1;switch(f){case"rgba":if(4!==g.length)return void h(e,0,0,0,1);m=s(g.pop());case"rgb":return 3!==g.length?void h(e,0,0,0,1):(h(e,o(g[0]),o(g[1]),o(g[2]),m),p(t,e),e);case"hsla":return 4!==g.length?void h(e,0,0,0,1):(g[3]=s(g[3]),v(g,e),p(t,e),e);case"hsl":return 3!==g.length?void h(e,0,0,0,1):(v(g,e),p(t,e),e);default:return}}h(e,0,0,0,1)}}function v(t,e){var i=(parseFloat(t[0])%360+360)%360/360,n=s(t[1]),a=s(t[2]),o=a<=.5?a*(n+1):a+n-a*n,u=2*a-o;return h(e=e||[],r(255*l(u,o,i+1/3)),r(255*l(u,o,i)),r(255*l(u,o,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function m(t,e,i){if(e&&e.length&&t>=0&&t<=1){i=i||[];var n=t*(e.length-1),o=Math.floor(n),s=Math.ceil(n),l=e[o],h=e[s],c=n-o;return i[0]=r(u(l[0],h[0],c)),i[1]=r(u(l[1],h[1],c)),i[2]=r(u(l[2],h[2],c)),i[3]=a(u(l[3],h[3],c)),i}}var y=m;function x(t,e,i){if(e&&e.length&&t>=0&&t<=1){var n=t*(e.length-1),o=Math.floor(n),s=Math.ceil(n),l=g(e[o]),h=g(e[s]),c=n-o,d=w([r(u(l[0],h[0],c)),r(u(l[1],h[1],c)),r(u(l[2],h[2],c)),a(u(l[3],h[3],c))],"rgba");return i?{color:d,leftIndex:o,rightIndex:s,value:n}:d}}var _=x;function w(t,e){if(t&&t.length){var i=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(i+=","+t[3]),e+"("+i+")"}}e.parse=g,e.lift=function(t,e){var i=g(t);if(i){for(var n=0;n<3;n++)i[n]=e<0?i[n]*(1-e)|0:(255-i[n])*e+i[n]|0,i[n]>255?i[n]=255:t[n]<0&&(i[n]=0);return w(i,4===i.length?"rgba":"rgb")}},e.toHex=function(t){var e=g(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)},e.fastLerp=m,e.fastMapToColor=y,e.lerp=x,e.mapToColor=_,e.modifyHSL=function(t,e,i,n){if(t=g(t))return t=function(t){if(t){var e,i,n=t[0]/255,r=t[1]/255,a=t[2]/255,o=Math.min(n,r,a),s=Math.max(n,r,a),l=s-o,u=(s+o)/2;if(0===l)e=0,i=0;else{i=u<.5?l/(s+o):l/(2-s-o);var h=((s-n)/6+l/2)/l,c=((s-r)/6+l/2)/l,d=((s-a)/6+l/2)/l;n===s?e=d-c:r===s?e=1/3+h-d:a===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,i,u];return null!=t[3]&&f.push(t[3]),f}}(t),null!=e&&(t[0]=(r=e,(r=Math.round(r))<0?0:r>360?360:r)),null!=i&&(t[1]=s(i)),null!=n&&(t[2]=s(n)),w(v(t),"rgba");var r},e.modifyAlpha=function(t,e){if((t=g(t))&&null!=e)return t[3]=a(e),w(t,"rgba")},e.stringify=w},DkK7:function(t,e){var i=Object.prototype.toString;t.exports=function(t){return i.call(t)}},DlMc:function(t,e,i){var n=i("gApy"),r=i("DtRx"),a=r;a.v1=n,a.v4=r,t.exports=a},DpwM:function(t,e,i){var n=i("/gxq"),r=i("YNzw"),a=(0,i("vXqC").makeInner)(),o=n.each;function s(t,e,i){t.handler("leave",null,i)}function l(t,e,i,n){e.handler(t,i,n)}e.register=function(t,e,i){if(!r.node){var u=e.getZr();a(u).records||(a(u).records={}),function(t,e){function i(i,n){t.on(i,function(i){var r=function(t){var e={showTip:[],hideTip:[]},i=function(n){var r=e[n.type];r?r.push(n):(n.dispatchAction=i,t.dispatchAction(n))};return{dispatchAction:i,pendings:e}}(e);o(a(t).records,function(t){t&&n(t,i,r.dispatchAction)}),function(t,e){var i,n=t.showTip.length,r=t.hideTip.length;n?i=t.showTip[n-1]:r&&(i=t.hideTip[r-1]),i&&(i.dispatchAction=null,e.dispatchAction(i))}(r.pendings,e)})}a(t).initialized||(a(t).initialized=!0,i("click",n.curry(l,"click")),i("mousemove",n.curry(l,"mousemove")),i("globalout",s))}(u,e),(a(u).records[t]||(a(u).records[t]={})).handler=i}},e.unregister=function(t,e){if(!r.node){var i=e.getZr();(a(i).records||{})[t]&&(a(i).records[t]=null)}}},DtRx:function(t,e,i){var n=i("i4uy"),r=i("MAlW");t.exports=function(t,e,i){var a=e&&i||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var s=0;s<16;++s)e[a+s]=o[s];return e||r(o)}},EJsE:function(t,e,i){i("4Nz2").__DEV__;var n=i("/gxq"),r=i("YNzw"),a=i("HHfb"),o=a.formatTime,s=a.encodeHTML,l=a.addCommas,u=a.getTooltipMarker,h=i("vXqC"),c=i("Y5nL"),d=i("MyoG"),f=i("bBvJ"),p=i("1Xuh"),g=p.getLayoutParams,v=p.mergeLayoutParam,m=i("gV7x").createTask,y=i("kdOt"),x=y.prepareSource,_=y.getSource,w=i("5KBG").retrieveRawValue,b=h.makeInner(),S=c.extend({type:"series.__base__",seriesIndex:0,coordinateSystem:null,defaultOption:null,legendDataProvider:null,visualColorAccessPath:"itemStyle.color",visualBorderColorAccessPath:"itemStyle.borderColor",layoutMode:null,init:function(t,e,i,n){this.seriesIndex=this.componentIndex,this.dataTask=m({count:A,reset:T}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,i),x(this);var r=this.getInitialData(t,i);I(r,this),this.dataTask.context.data=r,b(this).dataBeforeProcessed=r,M(this)},mergeDefaultAndTheme:function(t,e){var i=this.layoutMode,r=i?g(t):{},a=this.subType;c.hasClass(a)&&(a+="Series"),n.merge(t,e.getTheme().get(this.subType)),n.merge(t,this.getDefaultOption()),h.defaultEmphasis(t,"label",["show"]),this.fillDataTextStyle(t.data),i&&v(t,r,i)},mergeOption:function(t,e){t=n.merge(this.option,t,!0),this.fillDataTextStyle(t.data);var i=this.layoutMode;i&&v(this.option,t,i),x(this);var r=this.getInitialData(t,e);I(r,this),this.dataTask.dirty(),this.dataTask.context.data=r,b(this).dataBeforeProcessed=r,M(this)},fillDataTextStyle:function(t){if(t&&!n.isTypedArray(t))for(var e=["show"],i=0;i":"\n",d="richText"===r,f={},p=0;function g(t){return{renderMode:r,content:s(l(t)),style:f}}var v=this.getData(),m=v.mapDimension("defaultedTooltip",!0),y=m.length,x=this.getRawValue(t),_=n.isArray(x),b=v.getItemVisual(t,"color");n.isObject(b)&&b.colorStops&&(b=(b.colorStops[0]||{}).color),b=b||"transparent";var S=(y>1||_&&!y?function(i){var h=n.reduce(i,function(t,e,i){var n=v.getDimensionInfo(i);return t|(n&&!1!==n.tooltip&&null!=n.displayName)},0),c=[];function g(t,i){var n=v.getDimensionInfo(i);if(n&&!1!==n.otherDims.tooltip){var g=n.type,m="sub"+a.seriesIndex+"at"+p,y=u({color:b,type:"subItem",renderMode:r,markerId:m}),x="string"==typeof y?y:y.content,_=(h?x+s(n.displayName||"-")+": ":"")+s("ordinal"===g?t+"":"time"===g?e?"":o("yyyy/MM/dd hh:mm:ss",t):l(t));_&&c.push(_),d&&(f[m]=b,++p)}}m.length?n.each(m,function(e){g(w(v,t,e),e)}):n.each(i,g);var y=h?d?"\n":"
    ":"",x=y+c.join(y||", ");return{renderMode:r,content:x,style:f}}(x):g(y?w(v,t,m[0]):_?x[0]:x)).content,M=a.seriesIndex+"at"+p,A=u({color:b,type:"item",renderMode:r,markerId:M});f[M]=b,++p;var T=v.getName(t),C=this.name;h.isNameSpecified(this)||(C=""),C=C?s(C)+(e?": ":c):"";var I="string"==typeof A?A:A.content;return{html:e?I+C+S:C+I+(T?s(T)+": "+S:S),markers:f}},isAnimationEnabled:function(){if(r.node)return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),t},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(t,e,i){var n=this.ecModel,r=d.getColorFromPalette.call(this,t,e,i);return r||(r=n.getColorFromPalette(t,e,i)),r},coordDimToDataDim:function(t){return this.getRawData().mapDimension(t,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});function M(t){var e=t.name;h.isNameSpecified(t)||(t.name=function(t){var e=t.getRawData(),i=e.mapDimension("seriesName",!0),r=[];return n.each(i,function(t){var i=e.getDimensionInfo(t);i.displayName&&r.push(i.displayName)}),r.join(" ")}(t)||e)}function A(t){return t.model.getRawData().count()}function T(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),C}function C(t,e){t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function I(t,e){n.each(t.CHANGABLE_METHODS,function(i){t.wrapMethod(i,n.curry(D,e))})}function D(t){var e=k(t);e&&e.setOutputEnd(this.count())}function k(t){var e=(t.ecModel||{}).scheduler,i=e&&e.getPipeline(t.uid);if(i){var n=i.currentTask;if(n){var r=n.agentStubMap;r&&(n=r.get(t.uid))}return n}}n.mixin(S,f),n.mixin(S,d);var P=S;t.exports=P},FIAY:function(t,e){t.exports={legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}}},"G5/o":function(t,e,i){i("uqUo")("getOwnPropertyNames",function(){return i("Rrel").f})},Gw4f:function(t,e,i){var n=i("/gxq"),r=i("wRzc"),a=function(t,e,i,n,a,o){this.x=null==t?0:t,this.y=null==e?0:e,this.x2=null==i?1:i,this.y2=null==n?0:n,this.type="linear",this.global=o||!1,r.call(this,a)};a.prototype={constructor:a},n.inherits(a,r);var o=a;t.exports=o},GxVO:function(t,e,i){var n=i("9qnA"),r=i("/gxq"),a=i("moDv"),o=i("2M5Q"),s=i("dZ2L").prototype.getCanvasPattern,l=Math.abs,u=new a(!0);function h(t){n.call(this,t),this.path=null}h.prototype={constructor:h,type:"path",__dirtyPath:!0,strokeContainThreshold:5,segmentIgnoreThreshold:0,subPixelOptimize:!1,brush:function(t,e){var i,n=this.style,r=this.path||u,a=n.hasStroke(),o=n.hasFill(),l=n.fill,h=n.stroke,c=o&&!!l.colorStops,d=a&&!!h.colorStops,f=o&&!!l.image,p=a&&!!h.image;(n.bind(t,this,e),this.setTransform(t),this.__dirty)&&(c&&(i=i||this.getBoundingRect(),this._fillGradient=n.getGradient(t,l,i)),d&&(i=i||this.getBoundingRect(),this._strokeGradient=n.getGradient(t,h,i)));c?t.fillStyle=this._fillGradient:f&&(t.fillStyle=s.call(l,t)),d?t.strokeStyle=this._strokeGradient:p&&(t.strokeStyle=s.call(h,t));var g=n.lineDash,v=n.lineDashOffset,m=!!t.setLineDash,y=this.getGlobalScale();if(r.setScale(y[0],y[1],this.segmentIgnoreThreshold),this.__dirtyPath||g&&!m&&a?(r.beginPath(t),g&&!m&&(r.setLineDash(g),r.setLineDashOffset(v)),this.buildPath(r,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(t.beginPath(),this.path.rebuildPath(t)),o)if(null!=n.fillOpacity){var x=t.globalAlpha;t.globalAlpha=n.fillOpacity*n.opacity,r.fill(t),t.globalAlpha=x}else r.fill(t);if(g&&m&&(t.setLineDash(g),t.lineDashOffset=v),a)if(null!=n.strokeOpacity){x=t.globalAlpha;t.globalAlpha=n.strokeOpacity*n.opacity,r.stroke(t),t.globalAlpha=x}else r.stroke(t);g&&m&&t.setLineDash([]),null!=n.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))},buildPath:function(t,e,i){},createPathProxy:function(){this.path=new a},getBoundingRect:function(){var t=this._rect,e=this.style,i=!t;if(i){var n=this.path;n||(n=this.path=new a),this.__dirtyPath&&(n.beginPath(),this.buildPath(n,this.shape,!1)),t=n.getBoundingRect()}if(this._rect=t,e.hasStroke()){var r=this._rectWithStroke||(this._rectWithStroke=t.clone());if(this.__dirty||i){r.copy(t);var o=e.lineWidth,s=e.strokeNoScale?this.getLineScale():1;e.hasFill()||(o=Math.max(o,this.strokeContainThreshold||4)),s>1e-10&&(r.width+=o/s,r.height+=o/s,r.x-=o/s/2,r.y-=o/s/2)}return r}return t},contain:function(t,e){var i=this.transformCoordToLocal(t,e),n=this.getBoundingRect(),r=this.style;if(t=i[0],e=i[1],n.contain(t,e)){var a=this.path.data;if(r.hasStroke()){var s=r.lineWidth,l=r.strokeNoScale?this.getLineScale():1;if(l>1e-10&&(r.hasFill()||(s=Math.max(s,this.strokeContainThreshold)),o.containStroke(a,s/l,t,e)))return!0}if(r.hasFill())return o.contain(a,t,e)}return!1},dirty:function(t){null==t&&(t=!0),t&&(this.__dirtyPath=t,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(t){return this.animate("shape",t)},attrKV:function(t,e){"shape"===t?(this.setShape(e),this.__dirtyPath=!0,this._rect=null):n.prototype.attrKV.call(this,t,e)},setShape:function(t,e){var i=this.shape;if(i){if(r.isObject(t))for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);else i[t]=e;this.dirty(!0)}return this},getLineScale:function(){var t=this.transform;return t&&l(t[0]-1)>1e-10&&l(t[3]-1)>1e-10?Math.sqrt(l(t[0]*t[3]-t[2]*t[1])):1}},h.extend=function(t){var e=function(e){h.call(this,e),t.style&&this.style.extendFrom(t.style,!1);var i=t.shape;if(i){this.shape=this.shape||{};var n=this.shape;for(var r in i)!n.hasOwnProperty(r)&&i.hasOwnProperty(r)&&(n[r]=i[r])}t.init&&t.init.call(this,e)};for(var i in r.inherits(e,h),t)"style"!==i&&"shape"!==i&&(e.prototype[i]=t[i]);return e},r.inherits(h,n);var c=h;t.exports=c},HESh:function(t,e,i){var n=i("UnZu"),r=i("94aj"),a=i("DkK7"),o="[object Null]",s="[object Undefined]",l=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?s:o:l&&l in Object(t)?r(t):a(t)}},HHfb:function(t,e,i){var n=i("/gxq"),r=i("3h1/"),a=i("wWR3");var o=n.normalizeCssArray,s=/([&<>"'])/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"};function u(t){return null==t?"":(t+"").replace(s,function(t,e){return l[e]})}var h=["a","b","c","d","e","f","g"],c=function(t,e){return"{"+t+(null==e?"":e)+"}"};function d(t,e){return"0000".substr(0,e-(t+="").length)+t}var f=r.truncateText;e.addCommas=function(t){return isNaN(t)?"-":(t=(t+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")},e.toCamelCase=function(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t},e.normalizeCssArray=o,e.encodeHTML=u,e.formatTpl=function(t,e,i){n.isArray(e)||(e=[e]);var r=e.length;if(!r)return"";for(var a=e[0].$vars||[],o=0;o':'':{renderMode:a,content:"{marker"+o+"|} ",style:{color:i}}:""},e.formatTime=function(t,e,i){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var n=a.parseDate(e),r=i?"UTC":"",o=n["get"+r+"FullYear"](),s=n["get"+r+"Month"]()+1,l=n["get"+r+"Date"](),u=n["get"+r+"Hours"](),h=n["get"+r+"Minutes"](),c=n["get"+r+"Seconds"](),f=n["get"+r+"Milliseconds"]();return t=t.replace("MM",d(s,2)).replace("M",s).replace("yyyy",o).replace("yy",o%100).replace("dd",d(l,2)).replace("d",l).replace("hh",d(u,2)).replace("h",u).replace("mm",d(h,2)).replace("m",h).replace("ss",d(c,2)).replace("s",c).replace("SSS",d(f,3))},e.capitalFirst=function(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t},e.truncateText=f,e.getTextBoundingRect=function(t){return r.getBoundingRect(t.text,t.font,t.textAlign,t.textVerticalAlign,t.textPadding,t.textLineHeight,t.rich,t.truncate)},e.getTextRect=function(t,e,i,n,a,o,s,l){return r.getBoundingRect(t,e,i,n,a,l,o,s)}},HKuw:function(t,e){var i=32,n=7;function r(t,e,i,n){var r=e+1;if(r===i)return 1;if(n(t[r++],t[e])<0){for(;r=0;)r++;return r-e}function a(t,e,i,n,r){for(n===e&&n++;n>>1])<0?l=a:s=a+1;var u=n-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=o}}function o(t,e,i,n,r,a){var o=0,s=0,l=1;if(a(t,e[i+r])>0){for(s=n-r;l0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}else{for(s=r+1;ls&&(l=s);var u=o;o=r-l,l=r-u}for(o++;o>>1);a(t,e[i+h])>0?o=h+1:l=h}return l}function s(t,e,i,n,r,a){var o=0,s=0,l=1;if(a(t,e[i+r])<0){for(s=r+1;ls&&(l=s);var u=o;o=r-l,l=r-u}else{for(s=n-r;l=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}for(o++;o>>1);a(t,e[i+h])<0?l=h:o=h+1}return l}function l(t,e){var i,r,a,l=n,u=0;i=t.length;var h=[];function c(i){var c=r[i],d=a[i],f=r[i+1],p=a[i+1];a[i]=d+p,i===u-3&&(r[i+1]=r[i+2],a[i+1]=a[i+2]),u--;var g=s(t[f],t,c,d,0,e);c+=g,0!==(d-=g)&&0!==(p=o(t[c+d-1],t,f,p,p-1,e))&&(d<=p?function(i,r,a,u){var c=0;for(c=0;c=n||v>=n);if(m)break;y<0&&(y=0),y+=2}if((l=y)<1&&(l=1),1===r){for(c=0;c=0;c--)t[v+c]=t[g+c];return void(t[p]=h[f])}var m=l;for(;;){var y=0,x=0,_=!1;do{if(e(h[f],t[d])<0){if(t[p--]=t[d--],y++,x=0,0==--r){_=!0;break}}else if(t[p--]=h[f--],x++,y=0,1==--u){_=!0;break}}while((y|x)=0;c--)t[v+c]=t[g+c];if(0===r){_=!0;break}}if(t[p--]=h[f--],1==--u){_=!0;break}if(0!==(x=u-o(t[d],h,0,u,u-1,e))){for(u-=x,v=(p-=x)+1,g=(f-=x)+1,c=0;c=n||x>=n);if(_)break;m<0&&(m=0),m+=2}(l=m)<1&&(l=1);if(1===u){for(v=(p-=r)+1,g=(d-=r)+1,c=r-1;c>=0;c--)t[v+c]=t[g+c];t[p]=h[f]}else{if(0===u)throw new Error;for(g=p-(u-1),c=0;c1;){var t=u-2;if(t>=1&&a[t-1]<=a[t]+a[t+1]||t>=2&&a[t-2]<=a[t]+a[t-1])a[t-1]a[t+1])break;c(t)}},this.forceMergeRuns=function(){for(;u>1;){var t=u-2;t>0&&a[t-1]=i;)e|=1&t,t>>=1;return t+e}(s);do{if((u=r(t,n,o,e))c&&(d=c),a(t,n,n+d,n+u,e),u=d}h.pushRun(n,u),h.mergeRuns(),s-=u,n+=u}while(0!==s);h.forceMergeRuns()}}}},HSQo:function(t,e,i){t.exports={default:i("CJli"),__esModule:!0}},I0Vc:function(t,e,i){var n=i("g+yZ").devicePixelRatio,r=i("/gxq"),a=i("eZxa"),o=i("8b51"),s=i("HKuw"),l=i("OT4p"),u=i("a1Sp"),h=i("MAom"),c=i("YNzw");function d(t){return parseInt(t,10)}var f=new o(0,0,0,0),p=new o(0,0,0,0);var g=function(t,e,i){this.type="canvas";var a=!t.nodeName||"CANVAS"===t.nodeName.toUpperCase();this._opts=i=r.extend({},i||{}),this.dpr=i.devicePixelRatio||n,this._singleCanvas=a,this.root=t;var o=t.style;o&&(o["-webkit-tap-highlight-color"]="transparent",o["-webkit-user-select"]=o["user-select"]=o["-webkit-touch-callout"]="none",t.innerHTML=""),this.storage=e;var s=this._zlevelList=[],u=this._layers={};if(this._layerConfig={},this._needsManuallyCompositing=!1,a){var h=t.width,c=t.height;null!=i.width&&(h=i.width),null!=i.height&&(c=i.height),this.dpr=i.devicePixelRatio||1,t.width=h*this.dpr,t.height=c*this.dpr,this._width=h,this._height=c;var d=new l(t,this,this.dpr);d.__builtin__=!0,d.initContext(),u[314159]=d,d.zlevel=314159,s.push(314159),this._domRoot=t}else{this._width=this._getSize(0),this._height=this._getSize(1);var f=this._domRoot=function(t,e){var i=document.createElement("div");return i.style.cssText=["position:relative","overflow:hidden","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",i}(this._width,this._height);t.appendChild(f)}this._hoverlayer=null,this._hoverElements=[]};g.prototype={constructor:g,getType:function(){return"canvas"},isSingleCanvas:function(){return this._singleCanvas},getViewportRoot:function(){return this._domRoot},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(t){var e=this.storage.getDisplayList(!0),i=this._zlevelList;this._redrawId=Math.random(),this._paintList(e,t,this._redrawId);for(var n=0;n=0&&i.splice(n,1),t.__hoverMir=null},clearHover:function(t){for(var e=this._hoverElements,i=0;i15)break}l.__drawIndex=m,l.__drawIndex0&&t>n[0]){for(s=0;st);s++);o=i[n[s]]}if(n.splice(s+1,0,t),i[t]=e,!e.virtual)if(o){var u=o.dom;u.nextSibling?l.insertBefore(e.dom,u.nextSibling):l.appendChild(e.dom)}else l.firstChild?l.insertBefore(e.dom,l.firstChild):l.appendChild(e.dom)}else a("Layer of zlevel "+t+" is not valid")},eachLayer:function(t,e){var i,n,r=this._zlevelList;for(n=0;n0?.01:0),this._needsManuallyCompositing),s.__builtin__||a("ZLevel "+l+" has been used by unkown layer "+s.id),s!==n&&(s.__used=!0,s.__startIndex!==i&&(s.__dirty=!0),s.__startIndex=i,s.incremental?s.__drawIndex=-1:s.__drawIndex=i,e(i),n=s),o.__dirty&&(s.__dirty=!0,s.incremental&&s.__drawIndex<0&&(s.__drawIndex=i))}e(i),this.eachBuiltinLayer(function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(t){t.clear()},setBackgroundColor:function(t){this._backgroundColor=t},configLayer:function(t,e){if(e){var i=this._layerConfig;i[t]?r.merge(i[t],e,!0):i[t]=e;for(var n=0;n0&&t.unfinished);t.unfinished||this._zr.flush()}}},G.getDom=function(){return this._dom},G.getZr=function(){return this._zr},G.setOption=function(t,e,i){if(this._disposed)this.id;else{var n;if(O(e)&&(i=e.lazyUpdate,n=e.silent,e=e.notMerge),this[B]=!0,!this._model||e){var r=new d(this._api),a=this._theme,o=this._model=new u;o.scheduler=this._scheduler,o.init(null,null,a,r)}this._model.setOption(t,ht),i?(this[F]={silent:n},this[B]=!1):(X(this),U.update.call(this),this._zr.flush(),this[F]=!1,this[B]=!1,K.call(this,n),Q.call(this,n))}},G.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},G.getModel=function(){return this._model},G.getOption=function(){return this._model&&this._model.getOption()},G.getWidth=function(){return this._zr.getWidth()},G.getHeight=function(){return this._zr.getHeight()},G.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},G.getRenderedCanvas=function(t){if(o.canvasSupported)return(t=t||{}).pixelRatio=t.pixelRatio||1,t.backgroundColor=t.backgroundColor||this._model.get("backgroundColor"),this._zr.painter.getRenderedCanvas(t)},G.getSvgDataUrl=function(){if(o.svgSupported){var t=this._zr,e=t.storage.getDisplayList();return r.each(e,function(t){t.stopAnimation(!0)}),t.painter.pathToDataUrl()}},G.getDataURL=function(t){if(!this._disposed){var e=(t=t||{}).excludeComponents,i=this._model,n=[],r=this;k(e,function(t){i.eachComponent({mainType:t},function(t){var e=r._componentsMap[t.__viewId];e.group.ignore||(n.push(e),e.group.ignore=!0)})});var a="svg"===this._zr.painter.getType()?this.getSvgDataUrl():this.getRenderedCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return k(n,function(t){t.group.ignore=!1}),a}this.id},G.getConnectedDataURL=function(t){if(this._disposed)this.id;else if(o.canvasSupported){var e=this.group,i=Math.min,a=Math.max;if(vt[e]){var s=1/0,l=1/0,u=-1/0,h=-1/0,c=[],d=t&&t.pixelRatio||1;r.each(gt,function(n,o){if(n.group===e){var d=n.getRenderedCanvas(r.clone(t)),f=n.getDom().getBoundingClientRect();s=i(f.left,s),l=i(f.top,l),u=a(f.right,u),h=a(f.bottom,h),c.push({dom:d,left:f.left,top:f.top})}});var f=(u*=d)-(s*=d),p=(h*=d)-(l*=d),g=r.createCanvas();g.width=f,g.height=p;var v=n.init(g);return t.connectedBackgroundColor&&v.add(new x.Rect({shape:{x:0,y:0,width:f,height:p},style:{fill:t.connectedBackgroundColor}})),k(c,function(t){var e=new x.Image({style:{x:t.left*d-s,y:t.top*d-l,image:t.dom}});v.add(e)}),v.refreshImmediately(),g.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}},G.convertToPixel=r.curry(Y,"convertToPixel"),G.convertFromPixel=r.curry(Y,"convertFromPixel"),G.containPixel=function(t,e){if(!this._disposed){var i,n=this._model;return t=_.parseFinder(n,t),r.each(t,function(t,n){n.indexOf("Models")>=0&&r.each(t,function(t){var r=t.coordinateSystem;if(r&&r.containPoint)i|=!!r.containPoint(e);else if("seriesModels"===n){var a=this._chartsMap[t.__viewId];a&&a.containPoint&&(i|=a.containPoint(e,t))}},this)},this),!!i}this.id},G.getVisual=function(t,e){var i=this._model,n=(t=_.parseFinder(i,t,{defaultMainType:"series"})).seriesModel.getData(),r=t.hasOwnProperty("dataIndexInside")?t.dataIndexInside:t.hasOwnProperty("dataIndex")?n.indexOfRawIndex(t.dataIndex):null;return null!=r?n.getItemVisual(r,e):n.getVisual(e)},G.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},G.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]};var U={prepareAndUpdate:function(t){X(this),U.update.call(this,t)},update:function(t){var e=this._model,i=this._api,n=this._zr,r=this._coordSysMgr,s=this._scheduler;if(e){s.restoreData(e,t),s.performSeriesTasks(e),r.create(e,i),s.performDataProcessorTasks(e,t),Z(this,e),r.update(e,i),tt(e),s.performVisualTasks(e,t),et(this,e,i,t);var l=e.get("backgroundColor")||"transparent";if(o.canvasSupported)n.setBackgroundColor(l);else{var u=a.parse(l);l=a.stringify(u,"rgb"),0===u[3]&&(l="transparent")}nt(e,i)}},updateTransform:function(t){var e=this._model,i=this,n=this._api;if(e){var a=[];e.eachComponent(function(r,o){var s=i.getViewOfComponentModel(o);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(o,e,n,t);l&&l.update&&a.push(s)}else a.push(s)});var o=r.createHashMap();e.eachSeries(function(r){var a=i._chartsMap[r.__viewId];if(a.updateTransform){var s=a.updateTransform(r,e,n,t);s&&s.update&&o.set(r.uid,1)}else o.set(r.uid,1)}),tt(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0,dirtyMap:o}),it(i,e,n,t,o),nt(e,this._api)}},updateView:function(t){var e=this._model;e&&(y.markUpdateMethod(t,"updateView"),tt(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0}),et(this,this._model,this._api,t),nt(e,this._api))},updateVisual:function(t){U.update.call(this,t)},updateLayout:function(t){U.update.call(this,t)}};function X(t){var e=t._model,i=t._scheduler;i.restorePipelines(e),i.prepareStageTasks(),$(t,"component",e,i),$(t,"chart",e,i),i.plan()}function j(t,e,i,n,a){var o=t._model;if(n){var s={};s[n+"Id"]=i[n+"Id"],s[n+"Index"]=i[n+"Index"],s[n+"Name"]=i[n+"Name"];var l={mainType:n,query:s};a&&(l.subType=a);var u=i.excludeSeriesId;null!=u&&(u=r.createHashMap(_.normalizeToArray(u))),o&&o.eachComponent(l,function(e){u&&null!=u.get(e.id)||h(t["series"===n?"_chartsMap":"_componentsMap"][e.__viewId])},t)}else k(t._componentsViews.concat(t._chartsViews),h);function h(n){n&&n.__alive&&n[e]&&n[e](n.__model,o,t._api,i)}}function Z(t,e){var i=t._chartsMap,n=t._scheduler;e.eachSeries(function(t){n.updateStreamModes(t,i[t.__viewId])})}function J(t,e){var i=t.type,n=t.escapeConnect,a=st[i],o=a.actionInfo,s=(o.update||"update").split(":"),l=s.pop();s=null!=s[0]&&L(s[0]),this[B]=!0;var u=[t],h=!1;t.batch&&(h=!0,u=r.map(t.batch,function(e){return(e=r.defaults(r.extend({},e),t)).batch=null,e}));var c,d=[],f="highlight"===i||"downplay"===i;k(u,function(t){(c=(c=a.action(t,this._model,this._api))||r.extend({},t)).type=o.event||c.type,d.push(c),f?j(this,l,t,"series"):s&&j(this,l,t,s.main,s.sub)},this),"none"===l||f||s||(this[F]?(X(this),U.update.call(this,t),this[F]=!1):U[l].call(this,t)),c=h?{type:o.event||i,escapeConnect:n,batch:d}:d[0],this[B]=!1,!e&&this._messageCenter.trigger(c.type,c)}function K(t){for(var e=this._pendingActions;e.length;){var i=e.shift();J.call(this,i,t)}}function Q(t){!t&&this.trigger("updated")}function $(t,e,i,n){for(var r="component"===e,a=r?t._componentsViews:t._chartsViews,o=r?t._componentsMap:t._chartsMap,s=t._zr,l=t._api,u=0;ue.get("hoverLayerThreshold")&&!o.node&&e.eachSeries(function(e){if(!e.preventUsingHoverLayer){var i=t._chartsMap[e.__viewId];i.__alive&&i.group.traverse(function(t){t.useHoverLayer=!0})}})}(t,e),S(t._zr.dom,e)}function nt(t,e){k(ct,function(i){i(t,e)})}G.resize=function(t){if(this._disposed)this.id;else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var i=e.resetOption("media"),n=t&&t.silent;this[B]=!0,i&&X(this),U.update.call(this),this[B]=!1,K.call(this,n),Q.call(this,n)}}},G.showLoading=function(t,e){if(this._disposed)this.id;else if(O(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),pt[t]){var i=pt[t](this._api,e),n=this._zr;this._loadingFX=i,n.add(i)}},G.hideLoading=function(){this._disposed?this.id:(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},G.makeActionFromEvent=function(t){var e=r.extend({},t);return e.type=lt[t.type],e},G.dispatchAction=function(t,e){this._disposed?this.id:(O(e)||(e={silent:!!e}),st[t.type]&&this._model&&(this[B]?this._pendingActions.push(t):(J.call(this,t,e.silent),e.flush?this._zr.flush(!0):!1!==e.flush&&o.browser.weChat&&this._throttledZrFlush(),K.call(this,e.silent),Q.call(this,e.silent))))},G.appendData=function(t){if(this._disposed)this.id;else{var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0}},G.on=V("on",!1),G.off=V("off",!1),G.one=V("one",!1);var rt=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function at(t,e){var i=t.get("z"),n=t.get("zlevel");e.group.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=n&&(t.zlevel=n))})}function ot(){this.eventInfo}G._initEvents=function(){k(rt,function(t){var e=function(e){var i,n=this.getModel(),a=e.target;if("globalout"===t)i={};else if(a&&null!=a.dataIndex){var o=a.dataModel||n.getSeriesByIndex(a.seriesIndex);i=o&&o.getDataParams(a.dataIndex,a.dataType,a)||{}}else a&&a.eventData&&(i=r.extend({},a.eventData));if(i){var s=i.componentType,l=i.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=i.seriesIndex);var u=s&&null!=l&&n.getComponent(s,l),h=u&&this["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];i.event=e,i.type=t,this._ecEventProcessor.eventInfo={targetEl:a,packedEvent:i,model:u,view:h},this.trigger(t,i)}};e.zrEventfulCallAtLast=!0,this._zr.on(t,e,this)},this),k(lt,function(t,e){this._messageCenter.on(e,function(t){this.trigger(e,t)},this)},this)},G.isDisposed=function(){return this._disposed},G.clear=function(){this._disposed?this.id:this.setOption({series:[]},!0)},G.dispose=function(){if(this._disposed)this.id;else{this._disposed=!0,_.setAttribute(this.getDom(),xt,"");var t=this._api,e=this._model;k(this._componentsViews,function(i){i.dispose(e,t)}),k(this._chartsViews,function(i){i.dispose(e,t)}),this._zr.dispose(),delete gt[this.id]}},r.mixin(W,l),ot.prototype={constructor:ot,normalizeQuery:function(t){var e={},i={},n={};if(r.isString(t)){var a=L(t);e.mainType=a.main||null,e.subType=a.sub||null}else{var o=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};r.each(t,function(t,r){for(var a=!1,l=0;l0&&h===r.length-u.length){var c=r.slice(0,h);"data"!==c&&(e.mainType=c,e[u.toLowerCase()]=t,a=!0)}}s.hasOwnProperty(r)&&(i[r]=t,a=!0),a||(n[r]=t)})}return{cptQuery:e,dataQuery:i,otherQuery:n}},filter:function(t,e,i){var n=this.eventInfo;if(!n)return!0;var r=n.targetEl,a=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=e.cptQuery,u=e.dataQuery;return h(l,o,"mainType")&&h(l,o,"subType")&&h(l,o,"index","componentIndex")&&h(l,o,"name")&&h(l,o,"id")&&h(u,a,"name")&&h(u,a,"dataIndex")&&h(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,e.otherQuery,r,a));function h(t,e,i,n){return null==t[i]||e[n||i]===t[i]}},afterTrigger:function(){this.eventInfo=null}};var st={},lt={},ut=[],ht=[],ct=[],dt=[],ft={},pt={},gt={},vt={},mt=new Date-0,yt=new Date-0,xt="_echarts_instance_";function _t(t){vt[t]=!1}var wt=_t;function bt(t){return gt[_.getAttribute(t,xt)]}function St(t,e){ft[t]=e}function Mt(t){ht.push(t)}function At(t,e){It(ut,t,e,R)}function Tt(t,e,i){"function"==typeof e&&(i=e,e="");var n=O(t)?t.type:[t,t={event:e}][0];t.event=(t.event||n).toLowerCase(),e=t.event,D(H.test(n)&&H.test(e)),st[n]||(st[n]={action:i,actionInfo:t}),lt[e]=n}function Ct(t,e){It(dt,t,e,z,"visual")}function It(t,e,i,n,r){(P(e)||O(e))&&(i=e,e=n);var a=A.wrapStageHandler(i,r);return a.__prio=e,a.__raw=i,t.push(a),a}function Dt(t,e){pt[t]=e}Ct(2e3,b),Mt(f),At(900,p),Dt("default",M),Tt({type:"highlight",event:"highlight",update:"highlight"},r.noop),Tt({type:"downplay",event:"downplay",update:"downplay"},r.noop),St("light",T),St("dark",C);e.version="4.4.0",e.dependencies={zrender:"4.1.1"},e.PRIORITY=N,e.init=function(t,e,i){var n=bt(t);if(n)return n;var r=new W(t,e,i);return r.id="ec_"+mt++,gt[r.id]=r,_.setAttribute(t,xt,r.id),function(t){var e="__connectUpdateStatus";function i(t,i){for(var n=0;n1&&r&&r.length>1){var s=a(r)/a(o);!isFinite(s)&&(s=1),e.pinchScale=s;var l=[((n=r)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];return e.pinchX=l[0],e.pinchY=l[1],{type:"pinch",target:t[0].target,event:e}}}}},s=r;t.exports=s},K0T9:function(t,e){var i={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-i.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*i.bounceIn(2*t):.5*i.bounceOut(2*t-1)+.5}},n=i;t.exports=n},KsMi:function(t,e,i){var n=i("GxVO"),r=i("xr8J").subPixelOptimizeLine,a={},o=n.extend({type:"line",shape:{x1:0,y1:0,x2:0,y2:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i,n,o,s;this.subPixelOptimize?(r(a,e,this.style),i=a.x1,n=a.y1,o=a.x2,s=a.y2):(i=e.x1,n=e.y1,o=e.x2,s=e.y2);var l=e.percent;0!==l&&(t.moveTo(i,n),l<1&&(o=i*(1-l)+o*l,s=n*(1-l)+s*l),t.lineTo(o,s))},pointAt:function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]}});t.exports=o},LICT:function(t,e,i){var n=i("AAi1");e.containStroke=function(t,e,i,r,a,o,s,l,u,h,c){if(0===u)return!1;var d=u;return!(c>e+d&&c>r+d&&c>o+d&&c>l+d||ct+d&&h>i+d&&h>a+d&&h>s+d||h=r||v<0)break;if(f(y)){if(p){v+=a;continue}break}if(v===i)t[a>0?"moveTo":"lineTo"](y[0],y[1]);else if(l>0){var x=e[g],_="y"===h?1:0,w=(y[_]-x[_])*l;u(c,x),c[_]=x[_]+w,u(d,y),d[_]=y[_]-w,t.bezierCurveTo(c[0],c[1],d[0],d[1],y[0],y[1])}else t.lineTo(y[0],y[1]);g=v,v+=a}return m}.apply(this,arguments):function(t,e,i,n,a,p,g,v,m,y,x){for(var _=0,w=i,b=0;b=a||w<0)break;if(f(S)){if(x){w+=p;continue}break}if(w===i)t[p>0?"moveTo":"lineTo"](S[0],S[1]),u(c,S);else if(m>0){var M=w+p,A=e[M];if(x)for(;A&&f(e[M]);)A=e[M+=p];var T=.5,C=e[_],A=e[M];if(!A||f(A))u(d,S);else{var I,D;if(f(A)&&!x&&(A=S),r.sub(h,A,C),"x"===y||"y"===y){var k="x"===y?0:1;I=Math.abs(S[k]-C[k]),D=Math.abs(S[k]-A[k])}else I=r.dist(S,C),D=r.dist(S,A);l(d,S,h,-m*(1-(T=D/(D+I))))}o(c,c,v),s(c,c,g),o(d,d,v),s(d,d,g),t.bezierCurveTo(c[0],c[1],d[0],d[1],S[0],S[1]),l(c,S,h,m*T)}else t.lineTo(S[0],S[1]);_=w,w+=p}return b}.apply(this,arguments)}function g(t,e){var i=[1/0,1/0],n=[-1/0,-1/0];if(e)for(var r=0;rn[0]&&(n[0]=a[0]),a[1]>n[1]&&(n[1]=a[1])}return{min:e?i:n,max:e?n:i}}var v=n.extend({type:"ec-polyline",shape:{points:[],smooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},style:{fill:null,stroke:"#000"},brush:a(n.prototype.brush),buildPath:function(t,e){var i=e.points,n=0,r=i.length,a=g(i,e.smoothConstraint);if(e.connectNulls){for(;r>0&&f(i[r-1]);r--);for(;n0&&f(i[a-1]);a--);for(;re)return t[n];return t[i-1]}(u,i):l;if((h=h||l)&&h.length){var c=h[r];return t&&(s[t]=c),n.colorIdx=(r+1)%h.length,c}}};t.exports=s},N1qP:function(t,e,i){var n=i("QxFU"),r=1e-8;function a(t,e){return Math.abs(t-e)=2){if(o&&"spline"!==o){var s=r(a,o,i,e.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var l=a.length,u=0;u<(i?l:l-1);u++){var h=s[2*u],c=s[2*u+1],d=a[(u+1)%l];t.bezierCurveTo(h[0],h[1],c[0],c[1],d[0],d[1])}}else{"spline"===o&&(a=n(a,i)),t.moveTo(a[0][0],a[0][1]),u=1;for(var f=a.length;us)return!0;if(a){var l=o.getAxisInfo(t).seriesDataCount,u=n.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return!0===i},makeElOption:function(t,e,i,n,r){},createPointerEl:function(t,e,i,n){var r=e.pointer;if(r){var o=u(t).pointerEl=new a[r.type](h(e.pointer));t.add(o)}},createLabelEl:function(t,e,i,n){if(e.label){var r=u(t).labelEl=new a.Rect(h(e.label));t.add(r),p(r,n)}},updatePointerEl:function(t,e,i){var n=u(t).pointerEl;n&&e.pointer&&(n.setStyle(e.pointer.style),i(n,{shape:e.pointer.shape}))},updateLabelEl:function(t,e,i,n){var r=u(t).labelEl;r&&(r.setStyle(e.label.style),i(r,{shape:e.label.shape,position:e.label.position}),p(r,n))},_renderHandle:function(t){if(!this._dragging&&this.updateHandleTransform){var e,i=this._axisPointerModel,r=this._api.getZr(),o=this._handle,u=i.getModel("handle"),h=i.get("status");if(!u.get("show")||!h||"hide"===h)return o&&r.remove(o),void(this._handle=null);this._handle||(e=!0,o=this._handle=a.createIcon(u.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){s.stop(t.event)},onmousedown:c(this._onHandleDragMove,this,0,0),drift:c(this._onHandleDragMove,this),ondragend:c(this._onHandleDragEnd,this)}),r.add(o)),v(o,i,!1);o.setStyle(u.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var d=u.get("size");n.isArray(d)||(d=[d,d]),o.attr("scale",[d[0]/2,d[1]/2]),l.createOrUpdate(this,"_doDispatchAxisPointer",u.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},_moveHandleToValue:function(t,e){f(this._axisPointerModel,!e&&this._moveAnimation,this._handle,g(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(t,e){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(g(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(g(n)),u(i).lastProp=null,this._doDispatchAxisPointer()}},_doDispatchAxisPointer:function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},_onHandleDragEnd:function(t){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},getHandleTransform:null,updateHandleTransform:null,clear:function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),i=this._group,n=this._handle;e&&i&&(this._lastGraphicKey=null,i&&e.remove(i),n&&e.remove(n),this._group=null,this._handle=null,this._payloadInfo=null)},doClear:function(){},buildLabel:function(t,e,i){return{x:t[i=i||0],y:t[1-i],width:e[i],height:e[1-i]}}},d.prototype.constructor=d,r.enableClassExtend(d);var m=d;t.exports=m},OxCu:function(t,e,i){var n=i("/gxq"),r=i("vXqC");t.exports=function(t,e){var i,a=[],o=t.seriesIndex;if(null==o||!(i=e.getSeriesByIndex(o)))return{point:[]};var s=i.getData(),l=r.queryDataIndex(s,t);if(null==l||l<0||n.isArray(l))return{point:[]};var u=s.getItemGraphicEl(l),h=i.coordinateSystem;if(i.getTooltipPosition)a=i.getTooltipPosition(l)||[];else if(h&&h.dataToPoint)a=h.dataToPoint(s.getValues(n.map(h.dimensions,function(t){return s.mapDimension(t)}),l,!0))||[];else if(u){var c=u.getBoundingRect().clone();c.applyTransform(u.transform),a=[c.x+c.width/2,c.y+c.height/2]}return{point:a,el:u}}},PBlc:function(t,e,i){i("4Nz2").__DEV__;var n=i("/gxq"),r=i("6axr"),a=i("wWR3").parsePercent,o=i("3yJd"),s=o.createScaleByModel,l=o.niceScaleExtent,u=i("rctg"),h=i("qVJQ").getStackedDimension;function c(t,e){var i=this,r=i.getAngleAxis(),a=i.getRadiusAxis();if(r.scale.setExtent(1/0,-1/0),a.scale.setExtent(1/0,-1/0),t.eachSeries(function(t){if(t.coordinateSystem===i){var e=t.getData();n.each(e.mapDimension("radius",!0),function(t){a.scale.unionExtentFromData(e,h(e,t))}),n.each(e.mapDimension("angle",!0),function(t){r.scale.unionExtentFromData(e,h(e,t))})}}),l(r.scale,r.model),l(a.scale,a.model),"category"===r.type&&!r.onBand){var o=r.getExtent(),s=360/r.scale.count();r.inverse?o[1]+=s:o[1]-=s,r.setExtent(o[0],o[1])}}function d(t,e){if(t.type=e.get("type"),t.scale=s(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,t.inverse=e.get("inverse"),"angleAxis"===e.mainType){t.inverse^=e.get("clockwise");var i=e.get("startAngle");t.setExtent(i,i+(t.inverse?-360:360))}e.axis=t,t.model=e}i("ZRmN");var f={dimensions:r.prototype.dimensions,create:function(t,e){var i=[];return t.eachComponent("polar",function(t,n){var o=new r(n);o.update=c;var s=o.getRadiusAxis(),l=o.getAngleAxis(),u=t.findAxisModel("radiusAxis"),h=t.findAxisModel("angleAxis");d(s,u),d(l,h),function(t,e,i){var n=e.get("center"),r=i.getWidth(),o=i.getHeight();t.cx=a(n[0],r),t.cy=a(n[1],o);var s=t.getRadiusAxis(),l=Math.min(r,o)/2,u=a(e.get("radius"),l);s.inverse?s.setExtent(u,0):s.setExtent(0,u)}(o,t,e),i.push(o),t.coordinateSystem=o,o.model=t}),t.eachSeries(function(e){if("polar"===e.get("coordinateSystem")){var i=t.queryComponents({mainType:"polar",index:e.get("polarIndex"),id:e.get("polarId")})[0];e.coordinateSystem=i.coordinateSystem}}),i}};u.register("polar",f)},PD67:function(t,e,i){var n=i("GxVO"),r=i("Sm9T"),a=i("xr8J").subPixelOptimizeRect,o={},s=n.extend({type:"rect",shape:{r:0,x:0,y:0,width:0,height:0},buildPath:function(t,e){var i,n,s,l;this.subPixelOptimize?(a(o,e,this.style),i=o.x,n=o.y,s=o.width,l=o.height,o.r=e.r,e=o):(i=e.x,n=e.y,s=e.width,l=e.height),e.r?r.buildPath(t,e):t.rect(i,n,s,l),t.closePath()}});t.exports=s},PWa9:function(t,e){var i={average:function(t){for(var e=0,i=0,n=0;ne&&(e=t[i]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,i=0;i1&&("string"==typeof o?l=i[o]:"function"==typeof o&&(l=o),l&&t.setData(a.downSample(a.mapDimension(h.dim),1/f,l,n)))}}}}},Pdtn:function(t,e,i){var n=i("/gxq"),r=i("YNzw"),a=i("vXqC").makeInner,o=i("BNYN"),s=o.enableClassExtend,l=o.enableClassCheck,u=i("BwZ6"),h=i("fgF4"),c=i("NZsM"),d=i("e95b"),f=n.mixin,p=a();function g(t,e,i){this.parentModel=e,this.ecModel=i,this.option=t}function v(t,e,i){for(var n=0;n=0||t===e}function l(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[h(t)]}function u(t){return!!t.get("handle.show")}function h(t){return t.type+"||"+t.id}e.collect=function(t,e){var i={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(t,e,i){var l=e.getComponent("tooltip"),c=e.getComponent("axisPointer"),d=c.get("link",!0)||[],f=[];a(i.getCoordinateSystems(),function(i){if(i.axisPointerEnabled){var p=h(i.model),g=t.coordSysAxesInfo[p]={};t.coordSysMap[p]=i;var v=i.model,m=v.getModel("tooltip",l);if(a(i.getAxes(),o(w,!1,null)),i.getTooltipAxes&&l&&m.get("show")){var y="axis"===m.get("trigger"),x="cross"===m.get("axisPointer.type"),_=i.getTooltipAxes(m.get("axisPointer.axis"));(y||x)&&a(_.baseAxes,o(w,!x||"cross",y)),x&&a(_.otherAxes,o(w,"cross",!1))}}function w(o,l,p){var v=p.model.getModel("axisPointer",c),y=v.get("show");if(y&&("auto"!==y||o||u(v))){null==l&&(l=v.get("triggerTooltip"));var x=(v=o?function(t,e,i,o,s,l){var u=e.getModel("axisPointer"),h={};a(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],function(t){h[t]=n.clone(u.get(t))}),h.snap="category"!==t.type&&!!l,"cross"===u.get("type")&&(h.type="line");var c=h.label||(h.label={});if(null==c.show&&(c.show=!1),"cross"===s){var d=u.get("label.show");if(c.show=null==d||d,!l){var f=h.lineStyle=u.get("crossStyle");f&&n.defaults(c,f.textStyle)}}return t.model.getModel("axisPointer",new r(h,i,o))}(p,m,c,e,o,l):v).get("snap"),_=h(p.model),w=l||x||"category"===p.type,b=t.axesInfo[_]={key:_,axis:p,coordSys:i,axisPointerModel:v,triggerTooltip:l,involveSeries:w,snap:x,useHandle:u(v),seriesModels:[]};g[_]=b,t.seriesInvolved|=w;var S=function(t,e){for(var i=e.model,n=e.dim,r=0;rh[1]&&h.reverse(),(null==o||o>h[1])&&(o=h[1]),o=0?c():h=setTimeout(c,-r),l=n};return d.clear=function(){h&&(clearTimeout(h),h=null)},d.debounceNextCall=function(t){s=t},d}e.throttle=a,e.createOrUpdate=function(t,e,o,s){var l=t[e];if(l){var u=l[i]||l,h=l[r];if(l[n]!==o||h!==s){if(null==o||!s)return t[e]=u;(l=t[e]=a(u,o,"debounce"===s))[i]=u,l[r]=s,l[n]=o}return l}},e.clear=function(t,e){var n=t[e];n&&n[i]&&(t[e]=n[i])}},QDiV:function(t,e,i){var n=i("/gxq"),r=i("FIAY"),a=i("5KBG").retrieveRawValue;t.exports=function(t,e){var i=e.getModel("aria");if(i.get("show"))if(i.get("description"))t.setAttribute("aria-label",i.get("description"));else{var o=0;e.eachSeries(function(t,e){++o},this);var s,l=i.get("data.maxCount")||10,u=i.get("series.maxCount")||10,h=Math.min(o,u);if(!(o<1)){var c=function(){var t=e.getModel("title").option;return t&&t.length&&(t=t[0]),t&&t.text}();s=c?f(p("general.withTitle"),{title:c}):p("general.withoutTitle");var d=[];s+=f(p(o>1?"series.multiple.prefix":"series.single.prefix"),{seriesCount:o}),e.eachSeries(function(t,e){if(e1?"multiple":"single")+".";i=f(i=p(n?s+"withName":s+"withoutName"),{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:(y=t.subType,r.series.typeNames[y]||"自定义图")});var u=t.getData();window.data=u,u.count()>l?i+=f(p("data.partialData"),{displayCnt:l}):i+=p("data.allData");for(var c=[],g=0;gx?"left":"right",f=Math.abs(c[1]-_)/y<.3?"middle":c[1]>_?"top":"bottom"}return{position:c,align:d,verticalAlign:f}}(e,i,0,f,r.get("label.margin"));o.buildLabelElOption(t,i,r,u,y)}});var c={line:function(t,e,i,n,r){return"angle"===t.dim?{type:"Line",shape:o.makeLineShape(e.coordToPoint([n[0],i]),e.coordToPoint([n[1],i]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:i}}},shadow:function(t,e,i,n,r){var a=Math.max(1,t.getBandWidth()),s=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:o.makeSectorShape(e.cx,e.cy,n[0],n[1],(-i-a/2)*s,(a/2-i)*s)}:{type:"Sector",shape:o.makeSectorShape(e.cx,e.cy,i-a/2,i+a/2,0,2*Math.PI)}}};u.registerAxisPointerClass("PolarAxisPointer",h);var d=h;t.exports=d},QxFU:function(t,e){t.exports=function(t,e,i,n,r,a){if(a>e&&a>n||ar?o:0}},RKzr:function(t,e,i){var n=i("/gxq"),r=i("2HcM"),a=function(t,e,i,n,a){r.call(this,t,e,i),this.type=n||"value",this.position=a||"bottom"};a.prototype={constructor:a,index:0,getAxesOnZeroOf:null,model:null,isHorizontal:function(){var t=this.position;return"top"===t||"bottom"===t},getGlobalExtent:function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},getOtherAxis:function(){this.grid.getOtherAxis()},pointToData:function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},toLocalCoord:null,toGlobalCoord:null},n.inherits(a,r);var o=a;t.exports=o},RYbJ:function(t,e,i){var n=i("/gxq");t.exports=function(t){for(var e=0;e=0||r&&n.indexOf(r,s)<0)){var l=e.getShallow(s);null!=l&&(a[t[o][0]]=l)}}return a}}},Rfu2:function(t,e,i){i("4Nz2").__DEV__;var n=i("/gxq"),r=i("Pdtn"),a=i("1Hui"),o=i("rrAD"),s=i("5KBG"),l=s.defaultDimValueGetters,u=s.DefaultDataProvider,h=i("mvCM").summarizeDimensions,c=n.isObject,d=-1,f="e\0\0",p={float:"undefined"==typeof Float64Array?Array:Float64Array,int:"undefined"==typeof Int32Array?Array:Int32Array,ordinal:Array,number:Array,time:Array},g="undefined"==typeof Uint32Array?Array:Uint32Array,v="undefined"==typeof Int32Array?Array:Int32Array,m="undefined"==typeof Uint16Array?Array:Uint16Array;function y(t){return t._rawCount>65535?g:m}var x=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_rawData","_chunkSize","_chunkCount","_dimValueGetter","_count","_rawCount","_nameDimIdx","_idDimIdx"],_=["_extent","_approximateExtent","_rawExtent"];function w(t,e){n.each(x.concat(e.__wrappedMethods||[]),function(i){e.hasOwnProperty(i)&&(t[i]=e[i])}),t.__wrappedMethods=e.__wrappedMethods,n.each(_,function(i){t[i]=n.clone(e[i])}),t._calculationInfo=n.extend(e._calculationInfo)}var b=function(t,e){t=t||["x","y"];for(var i={},r=[],a={},o=0;o=0?this._indices[t]:-1}function D(t,e){var i=t._idList[e];return null==i&&(i=T(t,t._idDimIdx,e)),null==i&&(i=f+e),i}function k(t){return n.isArray(t)||(t=[t]),t}function P(t,e){var i=t.dimensions,r=new b(n.map(i,t.getDimensionInfo,t),t.hostModel);w(r,t);for(var a=r._storage={},o=t._storage,s=0;s=0?(a[l]=O(o[l]),r._rawExtent[l]=L(),r._extent[l]=null):a[l]=o[l])}return r}function O(t){for(var e,i,n=new Array(t.length),r=0;rx[1]&&(x[1]=y)}e&&(this._nameList[d]=e[f])}this._rawCount=this._count=l,this._extent={},A(this)},S._initDataFromProvider=function(t,e){if(!(t>=e)){for(var i,n=this._chunkSize,r=this._rawData,a=this._storage,o=this.dimensions,s=o.length,l=this._dimensionInfos,u=this._nameList,h=this._idList,c=this._rawExtent,d=this._nameRepeatCount={},f=this._chunkCount,p=0;pT[1]&&(T[1]=S)}if(!r.pure){var C=u[m];if(v&&null==C)if(null!=v.name)u[m]=C=v.name;else if(null!=i){var I=o[i],D=a[I][y];if(D){C=D[x];var k=l[I].ordinalMeta;k&&k.categories.length&&(C=k.categories[C])}}var P=null==v?null:v.id;null==P&&null!=C&&(d[C]=d[C]||0,P=C,d[C]>0&&(P+="__ec__"+d[C]),d[C]++),null!=P&&(h[m]=P)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=e,this._extent={},A(this)}},S.count=function(){return this._count},S.getIndices=function(){var t=this._indices;if(t){var e=t.constructor,i=this._count;if(e===Array){r=new e(i);for(var n=0;n=0&&e=0&&eo&&(o=l)}return n=[a,o],this._extent[t]=n,n},S.getApproximateExtent=function(t){return t=this.getDimension(t),this._approximateExtent[t]||this.getDataExtent(t)},S.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},S.getCalculationInfo=function(t){return this._calculationInfo[t]},S.setCalculationInfo=function(t,e){c(t)?n.extend(this._calculationInfo,t):this._calculationInfo[t]=e},S.getSum=function(t){var e=0;if(this._storage[t])for(var i=0,n=this.count();i=this._rawCount||t<0)return-1;var e=this._indices,i=e[t];if(null!=i&&it))return a;r=a-1}}return-1},S.indicesOfNearest=function(t,e,i){var n=[];if(!this._storage[t])return n;null==i&&(i=1/0);for(var r=Number.MAX_VALUE,a=-1,o=0,s=this.count();o=0&&a<0)&&(r=u,a=l,n.length=0),n.push(o))}return n},S.getRawIndex=C,S.getRawDataItem=function(t){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(t));for(var e=[],i=0;i=l&&b<=u||isNaN(b))&&(a[o++]=c),c++}h=!0}else if(2===n){d=this._storage[s];var m=this._storage[e[1]],x=t[e[1]][0],_=t[e[1]][1];for(f=0;f=l&&b<=u||isNaN(b))&&(S>=x&&S<=_||isNaN(S))&&(a[o++]=c),c++}}h=!0}}if(!h)if(1===n)for(v=0;v=l&&b<=u||isNaN(b))&&(a[o++]=M)}else for(v=0;vt[T][1])&&(A=!1)}A&&(a[o++]=this.getRawIndex(v))}return ob[1]&&(b[1]=w)}}}return a},S.downSample=function(t,e,i,n){for(var r=P(this,[t]),a=r._storage,o=[],s=Math.floor(1/e),l=a[t],u=this.count(),h=this._chunkSize,c=r._rawExtent[t],d=new(y(this))(u),f=0,p=0;pu-p&&(s=u-p,o.length=s);for(var g=0;gc[1]&&(c[1]=_),d[f++]=w}return r._count=f,r._indices=d,r.getRawIndex=I,r},S.getItemModel=function(t){var e=this.hostModel;return new r(this.getRawDataItem(t),e,e&&e.ecModel)},S.diff=function(t){var e=this;return new a(t?t.getIndices():[],this.getIndices(),function(e){return D(t,e)},function(t){return D(e,t)})},S.getVisual=function(t){var e=this._visual;return e&&e[t]},S.setVisual=function(t,e){if(c(t))for(var i in t)t.hasOwnProperty(i)&&this.setVisual(i,t[i]);else this._visual=this._visual||{},this._visual[t]=e},S.setLayout=function(t,e){if(c(t))for(var i in t)t.hasOwnProperty(i)&&this.setLayout(i,t[i]);else this._layout[t]=e},S.getLayout=function(t){return this._layout[t]},S.getItemLayout=function(t){return this._itemLayouts[t]},S.setItemLayout=function(t,e,i){this._itemLayouts[t]=i?n.extend(this._itemLayouts[t]||{},e):e},S.clearItemLayouts=function(){this._itemLayouts.length=0},S.getItemVisual=function(t,e,i){var n=this._itemVisuals[t],r=n&&n[e];return null!=r||i?r:this.getVisual(e)},S.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{},r=this.hasItemVisual;if(this._itemVisuals[t]=n,c(e))for(var a in e)e.hasOwnProperty(a)&&(n[a]=e[a],r[a]=!0);else n[e]=i,r[e]=!0},S.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var R=function(t){t.seriesIndex=this.seriesIndex,t.dataIndex=this.dataIndex,t.dataType=this.dataType};S.setItemGraphicEl=function(t,e){var i=this.hostModel;e&&(e.dataIndex=t,e.dataType=this.dataType,e.seriesIndex=i&&i.seriesIndex,"group"===e.type&&e.traverse(R,e)),this._graphicEls[t]=e},S.getItemGraphicEl=function(t){return this._graphicEls[t]},S.eachItemGraphicEl=function(t,e){n.each(this._graphicEls,function(i,n){i&&t&&t.call(e,i,n)})},S.cloneShallow=function(t){if(!t){var e=n.map(this.dimensions,this.getDimensionInfo,this);t=new b(e,this.hostModel)}if(t._storage=this._storage,w(t,this),this._indices){var i=this._indices.constructor;t._indices=new i(this._indices)}else t._indices=null;return t.getRawIndex=t._indices?I:C,t},S.wrapMethod=function(t,e){var i=this[t];"function"==typeof i&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=i.apply(this,arguments);return e.apply(this,[t].concat(n.slice(arguments)))})},S.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],S.CHANGABLE_METHODS=["filterSelf","selectRange"];var E=b;t.exports=E},RiVu:function(t,e){var i=2311;t.exports=function(){return i++}},RjA7:function(t,e,i){var n=i("5KBG").retrieveRawValue;e.getDefaultLabel=function(t,e){var i=t.mapDimension("defaultedLabel",!0),r=i.length;if(1===r)return n(t,e,i[0]);if(r){for(var a=[],o=0;o=e||i<0||m&&t-g>=c}function w(){var t=r();if(_(t))return b(t);f=setTimeout(w,function(t){var i=e-(t-p);return m?l(i,c-(t-g)):i}(t))}function b(t){return f=void 0,y&&u?x(t):(u=h=void 0,d)}function S(){var t=r(),i=_(t);if(u=arguments,h=this,p=t,i){if(void 0===f)return function(t){return g=t,f=setTimeout(w,e),v?x(t):d}(p);if(m)return clearTimeout(f),f=setTimeout(w,e),x(p)}return void 0===f&&(f=setTimeout(w,e)),d}return e=a(e)||0,n(i)&&(v=!!i.leading,c=(m="maxWait"in i)?s(a(i.maxWait)||0,e):c,y="trailing"in i?!!i.trailing:y),S.cancel=function(){void 0!==f&&clearTimeout(f),g=0,u=p=h=f=void 0},S.flush=function(){return void 0===f?d:b(r())},S}},Rtf0:function(t,e,i){i("4Nz2").__DEV__;var n=i("/gxq"),r=n.each,a=n.filter,o=n.map,s=n.isArray,l=n.indexOf,u=n.isObject,h=n.isString,c=n.createHashMap,d=n.assert,f=n.clone,p=n.merge,g=n.extend,v=n.mixin,m=i("vXqC"),y=i("Pdtn"),x=i("Y5nL"),_=i("u820"),w=i("MyoG"),b=i("kdOt").resetSourceDefaulter,S="\0_ec_inner",M=y.extend({init:function(t,e,i,n){i=i||{},this.option=null,this._theme=new y(i),this._optionManager=n},setOption:function(t,e){d(!(S in t),"please use chart.getOption()"),this._optionManager.setOption(t,e),this.resetOption(null)},resetOption:function(t){var e=!1,i=this._optionManager;if(!t||"recreate"===t){var n=i.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this.mergeOption(n)):function(t){t=t,this.option={},this.option[S]=1,this._componentsMap=c({series:[]}),this._seriesIndices,this._seriesIndicesMap,e=t,i=this._theme.option,n=e.color&&!e.colorLayer,r(i,function(t,i){"colorLayer"===i&&n||x.hasClass(i)||("object"==typeof t?e[i]=e[i]?p(e[i],t,!1):f(t):null==e[i]&&(e[i]=t))}),p(t,_,!1),this.mergeOption(t);var e,i,n}.call(this,n),e=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var a=i.getTimelineOption(this);a&&(this.mergeOption(a),e=!0)}if(!t||"recreate"===t||"media"===t){var o=i.getMediaOption(this,this._api);o.length&&r(o,function(t){this.mergeOption(t,e=!0)},this)}return e},mergeOption:function(t){var e=this.option,i=this._componentsMap,n=[];b(this),r(t,function(t,i){null!=t&&(x.hasClass(i)?i&&n.push(i):e[i]=null==e[i]?f(t):p(e[i],t,!0))}),x.topologicalTravel(n,x.getAllClassMainTypes(),function(n,a){var o=m.normalizeToArray(t[n]),l=m.mappingToExists(i.get(n),o);m.makeIdAndName(l),r(l,function(t,e){var i=t.option;u(i)&&(t.keyInfo.mainType=n,t.keyInfo.subType=function(t,e,i){return e.type?e.type:i?i.subType:x.determineSubType(t,e)}(n,i,t.exist))});var h=function(t,e){s(e)||(e=e?[e]:[]);var i={};return r(e,function(e){i[e]=(t.get(e)||[]).slice()}),i}(i,a);e[n]=[],i.set(n,[]),r(l,function(t,r){var a=t.exist,o=t.option;if(d(u(o)||a,"Empty component definition"),o){var s=x.getClass(n,t.keyInfo.subType,!0);if(a&&a instanceof s)a.name=t.keyInfo.name,a.mergeOption(o,this),a.optionUpdated(o,!1);else{var l=g({dependentModels:h,componentIndex:r},t.keyInfo);a=new s(o,this,this,l),g(a,l),a.init(o,this,this,l),a.optionUpdated(null,!0)}}else a.mergeOption({},this),a.optionUpdated({},!1);i.get(n)[r]=a,e[n][r]=a.option},this),"series"===n&&A(this,i.get("series"))},this),this._seriesIndicesMap=c(this._seriesIndices=this._seriesIndices||[])},getOption:function(){var t=f(this.option);return r(t,function(e,i){if(x.hasClass(i)){for(var n=(e=m.normalizeToArray(e)).length-1;n>=0;n--)m.isIdInner(e[n])&&e.splice(n,1);t[i]=e}}),delete t[S],t},getTheme:function(){return this._theme},getComponent:function(t,e){var i=this._componentsMap.get(t);if(i)return i[e||0]},queryComponents:function(t){var e=t.mainType;if(!e)return[];var i,n=t.index,r=t.id,u=t.name,h=this._componentsMap.get(e);if(!h||!h.length)return[];if(null!=n)s(n)||(n=[n]),i=a(o(n,function(t){return h[t]}),function(t){return!!t});else if(null!=r){var c=s(r);i=a(h,function(t){return c&&l(r,t.id)>=0||!c&&t.id===r})}else if(null!=u){var d=s(u);i=a(h,function(t){return d&&l(u,t.name)>=0||!d&&t.name===u})}else i=h.slice();return T(i,t)},findComponents:function(t){var e,i,n,r,o,s=t.query,l=t.mainType,u=(i=l+"Index",n=l+"Id",r=l+"Name",!(e=s)||null==e[i]&&null==e[n]&&null==e[r]?null:{mainType:l,index:e[i],id:e[n],name:e[r]}),h=u?this.queryComponents(u):this._componentsMap.get(l);return o=T(h,t),t.filter?a(o,t.filter):o},eachComponent:function(t,e,i){var n=this._componentsMap;if("function"==typeof t)i=e,e=t,n.each(function(t,n){r(t,function(t,r){e.call(i,n,t,r)})});else if(h(t))r(n.get(t),e,i);else if(u(t)){var a=this.findComponents(t);r(a,e,i)}},getSeriesByName:function(t){var e=this._componentsMap.get("series");return a(e,function(e){return e.name===t})},getSeriesByIndex:function(t){return this._componentsMap.get("series")[t]},getSeriesByType:function(t){var e=this._componentsMap.get("series");return a(e,function(e){return e.subType===t})},getSeries:function(){return this._componentsMap.get("series").slice()},getSeriesCount:function(){return this._componentsMap.get("series").length},eachSeries:function(t,e){r(this._seriesIndices,function(i){var n=this._componentsMap.get("series")[i];t.call(e,n,i)},this)},eachRawSeries:function(t,e){r(this._componentsMap.get("series"),t,e)},eachSeriesByType:function(t,e,i){r(this._seriesIndices,function(n){var r=this._componentsMap.get("series")[n];r.subType===t&&e.call(i,r,n)},this)},eachRawSeriesByType:function(t,e,i){return r(this.getSeriesByType(t),e,i)},isSeriesFiltered:function(t){return null==this._seriesIndicesMap.get(t.componentIndex)},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(t,e){A(this,a(this._componentsMap.get("series"),t,e))},restoreData:function(t){var e=this._componentsMap;A(this,e.get("series"));var i=[];e.each(function(t,e){i.push(e)}),x.topologicalTravel(i,x.getAllClassMainTypes(),function(i,n){r(e.get(i),function(e){("series"!==i||!function(t,e){if(e){var i=e.seiresIndex,n=e.seriesId,r=e.seriesName;return null!=i&&t.componentIndex!==i||null!=n&&t.id!==n||null!=r&&t.name!==r}}(e,t))&&e.restoreData()})})}});function A(t,e){t._seriesIndicesMap=c(t._seriesIndices=o(e,function(t){return t.componentIndex})||[])}function T(t,e){return e.hasOwnProperty("subType")?a(t,function(t){return t.subType===e.subType}):t}v(M,w);var C=M;t.exports=C},SiPa:function(t,e,i){var n=i("/gxq"),r=i("3h1/"),a=i("vXqC").makeInner,o=i("3yJd"),s=o.makeLabelFormatter,l=o.getOptionCategoryInterval,u=o.shouldShowAllLabels,h=a();function c(t,e){var i,r=d(t,"labels"),a=l(e),o=f(r,a);return o||p(r,a,{labels:n.isFunction(a)?v(t,a):g(t,i="auto"===a?function(t){var e=h(t).autoInterval;return null!=e?e:h(t).autoInterval=t.calculateCategoryInterval()}(t):a),labelCategoryInterval:i})}function d(t,e){return h(t)[e]||(h(t)[e]=[])}function f(t,e){for(var i=0;i1&&d/h>2&&(c=Math.round(Math.ceil(c/h)*h));var f=u(t),p=o.get("showMinLabel")||f,g=o.get("showMaxLabel")||f;p&&c!==a[0]&&m(a[0]);for(var v=c;v<=a[1];v+=h)m(v);function m(t){l.push(i?t:{formattedLabel:n(t),rawLabel:r.getLabel(t),tickValue:t})}return g&&v-h!==a[1]&&m(a[1]),l}function v(t,e,i){var r=t.scale,a=s(t),o=[];return n.each(r.getTicks(),function(t){var n=r.getLabel(t);e(t,n)&&o.push(i?t:{formattedLabel:a(t),rawLabel:n,tickValue:t})}),o}e.createAxisLabels=function(t){return"category"===t.type?function(t){var e=t.getLabelModel(),i=c(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:i.labelCategoryInterval}:i}(t):function(t){var e=t.scale.getTicks(),i=s(t);return{labels:n.map(e,function(e,n){return{formattedLabel:i(e,n),rawLabel:t.scale.getLabel(e),tickValue:e}})}}(t)},e.createAxisTicks=function(t,e){return"category"===t.type?function(t,e){var i,r,a=d(t,"ticks"),o=l(e),s=f(a,o);if(s)return s;if(e.get("show")&&!t.scale.isBlank()||(i=[]),n.isFunction(o))i=v(t,o,!0);else if("auto"===o){var u=c(t,t.getLabelModel());r=u.labelCategoryInterval,i=n.map(u.labels,function(t){return t.tickValue})}else i=g(t,r=o,!0);return p(a,o,{ticks:i,tickCategoryInterval:r})}(t,e):{ticks:t.scale.getTicks()}},e.calculateCategoryInterval=function(t){var e=function(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}(t),i=s(t),n=(e.axisRotate-e.labelRotate)/180*Math.PI,a=t.scale,o=a.getExtent(),l=a.count();if(o[1]-o[0]<1)return 0;var u=1;l>40&&(u=Math.max(1,Math.floor(l/40)));for(var c=o[0],d=t.dataToCoord(c+1)-t.dataToCoord(c),f=Math.abs(d*Math.cos(n)),p=Math.abs(d*Math.sin(n)),g=0,v=0;c<=o[1];c+=u){var m,y,x=r.getBoundingRect(i(c),e.font,"center","top");m=1.3*x.width,y=1.3*x.height,g=Math.max(g,m,7),v=Math.max(v,y,7)}var _=g/f,w=v/p;isNaN(_)&&(_=1/0),isNaN(w)&&(w=1/0);var b=Math.max(0,Math.floor(Math.min(_,w))),S=h(t.model),M=S.lastAutoInterval,A=S.lastTickCount;return null!=M&&null!=A&&Math.abs(M-b)<=1&&Math.abs(A-l)<=1&&M>b?b=M:(S.lastTickCount=l,S.lastAutoInterval=b),b}},SlE6:function(t,e,i){var n=i("tzpD"),r=n.prepareDataCoordInfo,a=n.getStackedOnPoint;t.exports=function(t,e,i,n,o,s,l,u){for(var h=function(t,e){var i=[];return e.diff(t).add(function(t){i.push({cmd:"+",idx:t})}).update(function(t,e){i.push({cmd:"=",idx:e,idx1:t})}).remove(function(t){i.push({cmd:"-",idx:t})}).execute(),i}(t,e),c=[],d=[],f=[],p=[],g=[],v=[],m=[],y=r(o,e,l),x=r(s,t,u),_=0;_u&&(i*=u/(o=i+n),n*=u/o),r+a>u&&(r*=u/(o=r+a),a*=u/o),n+r>h&&(n*=h/(o=n+r),r*=h/o),i+a>h&&(i*=h/(o=i+a),a*=h/o),t.moveTo(s+i,l),t.lineTo(s+u-n,l),0!==n&&t.arc(s+u-n,l+n,n,-Math.PI/2,0),t.lineTo(s+u,l+h-r),0!==r&&t.arc(s+u-r,l+h-r,r,0,Math.PI/2),t.lineTo(s+a,l+h),0!==a&&t.arc(s+a,l+h-a,a,Math.PI/2,Math.PI),t.lineTo(s,l+i),0!==i&&t.arc(s+i,l+i,i,Math.PI,1.5*Math.PI)}},TCXJ:function(t,e,i){var n=i("Icdr").extendComponentModel({type:"axisPointer",coordSysAxesInfo:null,defaultOption:{show:"auto",triggerOn:null,zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#aaa",width:1,type:"solid"},shadowStyle:{color:"rgba(150,150,150,0.3)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,shadowBlur:3,shadowColor:"#aaa"},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}}});t.exports=n},TIfe:function(t,e){function i(){this.on("mousedown",this._dragStart,this),this.on("mousemove",this._drag,this),this.on("mouseup",this._dragEnd,this),this.on("globalout",this._dragEnd,this)}function n(t,e){return{target:t,topTarget:e&&e.topTarget}}i.prototype={constructor:i,_dragStart:function(t){var e=t.target;e&&e.draggable&&(this._draggingTarget=e,e.dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.dispatchToElement(n(e,t),"dragstart",t.event))},_drag:function(t){var e=this._draggingTarget;if(e){var i=t.offsetX,r=t.offsetY,a=i-this._x,o=r-this._y;this._x=i,this._y=r,e.drift(a,o,t),this.dispatchToElement(n(e,t),"drag",t.event);var s=this.findHover(i,r,e).target,l=this._dropTarget;this._dropTarget=s,e!==s&&(l&&s!==l&&this.dispatchToElement(n(l,t),"dragleave",t.event),s&&s!==l&&this.dispatchToElement(n(s,t),"dragenter",t.event))}},_dragEnd:function(t){var e=this._draggingTarget;e&&(e.dragging=!1),this.dispatchToElement(n(e,t),"dragend",t.event),this._dropTarget&&this.dispatchToElement(n(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null}};var r=i;t.exports=r},UAiw:function(t,e,i){var n=i("qjvV");e.Dispatcher=n;var r=i("YNzw"),a=i("6NQ8").buildTransformer,o="undefined"!=typeof window&&!!window.addEventListener,s=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,l="___zrEVENTSAVED",u=[];function h(t,e,i,n){return i=i||{},n||!r.canvasSupported?c(t,e,i):r.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(i.zrX=e.layerX,i.zrY=e.layerY):null!=e.offsetX?(i.zrX=e.offsetX,i.zrY=e.offsetY):c(t,e,i),i}function c(t,e,i){if(t.getBoundingClientRect&&r.domSupported){var n=e.clientX,o=e.clientY;if("CANVAS"===t.nodeName.toUpperCase()){var s=t.getBoundingClientRect();return i.zrX=n-s.left,void(i.zrY=o-s.top)}var h=t[l]||(t[l]={}),c=function(t,e){for(var i=e.transformer,n=e.srcCoords,r=!0,o=[],s=[],l=0;l<4;l++){var u=t[l].getBoundingClientRect(),h=2*l,c=u.left,d=u.top;o.push(c,d),r&=n&&c===n[h]&&d===n[h+1],s.push(t[l].offsetLeft,t[l].offsetTop)}return r?i:(e.srcCoords=o,e.transformer=a(o,s))}(function(t,e){var i=e.markers;if(i)return i;i=e.markers=[];for(var n=["left","right"],r=["top","bottom"],a=0;a<4;a++){var o=document.createElement("div"),s=o.style,l=a%2,u=(a>>1)%2;s.cssText=["position:absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","width:0","height:0",n[l]+":0",r[u]+":0",n[1-l]+":auto",r[1-u]+":auto",""].join("!important;"),t.appendChild(o),i.push(o)}return i}(t,h),h);if(c)return c(u,n,o),i.zrX=u[0],void(i.zrY=u[1])}i.zrX=i.zrY=0}var d=o?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0};e.clientToLocal=h,e.normalizeEvent=function(t,e,i){if(null!=(e=e||window.event).zrX)return e;var n=e.type;if(n&&n.indexOf("touch")>=0){var r="touchend"!==n?e.targetTouches[0]:e.changedTouches[0];r&&h(t,r,e,i)}else h(t,e,e,i),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;var a=e.button;return null==e.which&&void 0!==a&&s.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e},e.addEventListener=function(t,e,i){o?t.addEventListener(e,i):t.attachEvent("on"+e,i)},e.removeEventListener=function(t,e,i){o?t.removeEventListener(e,i):t.detachEvent("on"+e,i)},e.stop=d,e.isMiddleOrRightButtonOnMouseUpDown=function(t){return 2===t.which||3===t.which},e.notLeftMouse=function(t){return t.which>1}},UkNE:function(t,e,i){var n=i("Icdr"),r=i("/gxq"),a=i("0sHC");i("5vFd"),i("zz1u"),n.extendComponentView({type:"grid",render:function(t,e){this.group.removeAll(),t.get("show")&&this.group.add(new a.Rect({shape:t.coordinateSystem.getRect(),style:r.defaults({fill:t.get("backgroundColor")},t.getItemStyle()),silent:!0,z2:-1}))}}),n.registerPreprocessor(function(t){t.xAxis&&t.yAxis&&!t.grid&&(t.grid={})})},UnZu:function(t,e,i){var n=i("w/A/").Symbol;t.exports=n},V4nf:function(t,e,i){var n=i("/gxq"),r=i("UAiw").Dispatcher,a=i("a1Sp"),o=i("CCtz"),s=function(t){t=t||{},this.stage=t.stage||{},this.onframe=t.onframe||function(){},this._clips=[],this._running=!1,this._time,this._pausedTime,this._pauseStart,this._paused=!1,r.call(this)};s.prototype={constructor:s,addClip:function(t){this._clips.push(t)},addAnimator:function(t){t.animation=this;for(var e=t.getClips(),i=0;i=0&&this._clips.splice(e,1)},removeAnimator:function(t){for(var e=t.getClips(),i=0;i=0?this._tryShow(i,n):"leave"===e&&this._hide(n))},this))},_keepShow:function(){var t=this._tooltipModel,e=this._ecModel,i=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==t.get("triggerOn")){var n=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&n.manuallyShowTip(t,e,i,{x:n._lastX,y:n._lastY})})}},manuallyShowTip:function(t,e,i,n){if(n.from!==this.uid&&!a.node){var r=M(n,i);this._ticket="";var o=n.dataByCoordSys;if(n.tooltip&&null!=n.x&&null!=n.y){var s=w;s.position=[n.x,n.y],s.update(),s.tooltip=n.tooltip,this._tryShow({offsetX:n.x,offsetY:n.y,target:s},r)}else if(o)this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,event:{},dataByCoordSys:n.dataByCoordSys,tooltipOption:n.tooltipOption},r);else if(null!=n.seriesIndex){if(this._manuallyAxisShowTip(t,e,i,n))return;var l=c(n,e),u=l.point[0],h=l.point[1];null!=u&&null!=h&&this._tryShow({offsetX:u,offsetY:h,position:n.position,target:l.el,event:{}},r)}else null!=n.x&&null!=n.y&&(i.dispatchAction({type:"updateAxisPointer",x:n.x,y:n.y}),this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,target:i.getZr().findHover(n.x,n.y).target,event:{}},r))}},manuallyHideTip:function(t,e,i,n){var r=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,n.from!==this.uid&&this._hide(M(n,i))},_manuallyAxisShowTip:function(t,e,i,n){var r=n.seriesIndex,a=n.dataIndex,o=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=a&&null!=o){var s=e.getSeriesByIndex(r);if(s)if("axis"===(t=S([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model,t])).get("trigger"))return i.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:a,position:n.position}),!0}},_tryShow:function(t,e){var i=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var n=t.dataByCoordSys;n&&n.length?this._showAxisTooltip(n,t):i&&null!=i.dataIndex?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(t,i,e)):i&&i.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(t,i,e)):(this._lastDataByCoordSys=null,this._hide(e))}},_showOrMove:function(t,e){var i=t.get("showDelay");e=r.bind(e,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(e,i):e()},_showAxisTooltip:function(t,e){var i=this._ecModel,n=this._tooltipModel,a=[e.offsetX,e.offsetY],o=[],s=[],u=S([e.tooltipOption,n]),h=this._renderMode,c=this._newLine,d={};x(t,function(t){x(t.dataByAxis,function(t){var e=i.getComponent(t.axisDim+"Axis",t.axisIndex),n=t.value,a=[];if(e&&null!=n){var u=v.getValueLabel(n,e.axis,i,t.seriesDataIndices,t.valueLabelOpt);r.each(t.seriesDataIndices,function(o){var l=i.getSeriesByIndex(o.seriesIndex),c=o.dataIndexInside,f=l&&l.getDataParams(c);if(f.axisDim=t.axisDim,f.axisIndex=t.axisIndex,f.axisType=t.axisType,f.axisId=t.axisId,f.axisValue=g.getAxisRawValue(e.axis,n),f.axisValueLabel=u,f){s.push(f);var p,v=l.formatTooltip(c,!0,null,h);if(r.isObject(v)){p=v.html;var m=v.markers;r.merge(d,m)}else p=v;a.push(p)}});var f=u;"html"!==h?o.push(a.join(c)):o.push((f?l.encodeHTML(f)+c:"")+a.join(c))}})},this),o.reverse(),o=o.join(this._newLine+this._newLine);var f=e.position;this._showOrMove(u,function(){this._updateContentNotChangedOnAxis(t)?this._updatePosition(u,f,a[0],a[1],this._tooltipContent,s):this._showTooltipContent(u,o,s,Math.random(),a[0],a[1],f,void 0,d)})},_showSeriesItemTooltip:function(t,e,i){var n=this._ecModel,a=e.seriesIndex,o=n.getSeriesByIndex(a),s=e.dataModel||o,l=e.dataIndex,u=e.dataType,h=s.getData(),c=S([h.getItemModel(l),s,o&&(o.coordinateSystem||{}).model,this._tooltipModel]),d=c.get("trigger");if(null==d||"item"===d){var f,p,g=s.getDataParams(l,u),v=s.formatTooltip(l,!1,u,this._renderMode);r.isObject(v)?(f=v.html,p=v.markers):(f=v,p=null);var m="item_"+s.name+"_"+l;this._showOrMove(c,function(){this._showTooltipContent(c,f,g,m,t.offsetX,t.offsetY,t.position,t.target,p)}),i({type:"showTip",dataIndexInside:l,dataIndex:h.getRawIndex(l),seriesIndex:a,from:this.uid})}},_showComponentItemTooltip:function(t,e,i){var n=e.tooltip;if("string"==typeof n){n={content:n,formatter:n}}var r=new f(n,this._tooltipModel,this._ecModel),a=r.get("content"),o=Math.random();this._showOrMove(r,function(){this._showTooltipContent(r,a,r.get("formatterParams")||{},o,t.offsetX,t.offsetY,t.position,e)}),i({type:"showTip",from:this.uid})},_showTooltipContent:function(t,e,i,n,r,a,o,s,u){if(this._ticket="",t.get("showContent")&&t.get("show")){var h=this._tooltipContent,c=t.get("formatter");o=o||t.get("position");var d=e;if(c&&"string"==typeof c)d=l.formatTpl(c,i,!0);else if("function"==typeof c){var f=y(function(e,n){e===this._ticket&&(h.setContent(n,u,t),this._updatePosition(t,o,r,a,h,i,s))},this);this._ticket=n,d=c(i,n,f)}h.setContent(d,u,t),h.show(t),this._updatePosition(t,o,r,a,h,i,s)}},_updatePosition:function(t,e,i,n,a,o,s){var l=this._api.getWidth(),u=this._api.getHeight();e=e||t.get("position");var h=a.getSize(),c=t.get("align"),f=t.get("verticalAlign"),p=s&&s.getBoundingRect().clone();if(s&&p.applyTransform(s.transform),"function"==typeof e&&(e=e([i,n],o,a.el,p,{viewSize:[l,u],contentSize:h.slice()})),r.isArray(e))i=_(e[0],l),n=_(e[1],u);else if(r.isObject(e)){e.width=h[0],e.height=h[1];var g=d.getLayoutRect(e,{width:l,height:u});i=g.x,n=g.y,c=null,f=null}else if("string"==typeof e&&s){var v=function(t,e,i){var n=i[0],r=i[1],a=0,o=0,s=e.width,l=e.height;switch(t){case"inside":a=e.x+s/2-n/2,o=e.y+l/2-r/2;break;case"top":a=e.x+s/2-n/2,o=e.y-r-5;break;case"bottom":a=e.x+s/2-n/2,o=e.y+l+5;break;case"left":a=e.x-n-5,o=e.y+l/2-r/2;break;case"right":a=e.x+s+5,o=e.y+l/2-r/2}return[a,o]}(e,p,h);i=v[0],n=v[1]}else{v=function(t,e,i,n,r,a,o){var s=i.getOuterSize(),l=s.width,u=s.height;null!=a&&(t+l+a>n?t-=l+a:t+=a);null!=o&&(e+u+o>r?e-=u+o:e+=o);return[t,e]}(i,n,a,l,u,c?null:20,f?null:20);i=v[0],n=v[1]}if(c&&(i-=A(c)?h[0]/2:"right"===c?h[0]:0),f&&(n-=A(f)?h[1]/2:"bottom"===f?h[1]:0),t.get("confine")){v=function(t,e,i,n,r){var a=i.getOuterSize(),o=a.width,s=a.height;return t=Math.min(t+o,n)-o,e=Math.min(e+s,r)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}(i,n,a,l,u);i=v[0],n=v[1]}a.moveTo(i,n)},_updateContentNotChangedOnAxis:function(t){var e=this._lastDataByCoordSys,i=!!e&&e.length===t.length;return i&&x(e,function(e,n){var r=e.dataByAxis||{},a=(t[n]||{}).dataByAxis||[];(i&=r.length===a.length)&&x(r,function(t,e){var n=a[e]||{},r=t.seriesDataIndices||[],o=n.seriesDataIndices||[];(i&=t.value===n.value&&t.axisType===n.axisType&&t.axisId===n.axisId&&r.length===o.length)&&x(r,function(t,e){var n=o[e];i&=t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex})})}),this._lastDataByCoordSys=t,!!i},_hide:function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},dispose:function(t,e){a.node||(this._tooltipContent.hide(),p.unregister("itemTooltip",e))}});function S(t){for(var e=t.pop();t.length;){var i=t.pop();i&&(f.isInstance(i)&&(i=i.get("tooltip",!0)),"string"==typeof i&&(i={formatter:i}),e=new f(i,e,e.ecModel))}return e}function M(t,e){return t.dispatchAction||r.bind(e.dispatchAction,e)}function A(t){return"center"===t||"middle"===t}t.exports=b},XRkS:function(t,e,i){var n=i("Icdr"),r=i("/gxq");t.exports=function(t,e){r.each(e,function(e){e.update="updateView",n.registerAction(e,function(i,n){var r={};return n.eachComponent({mainType:"series",subType:t,query:i},function(t){t[e.method]&&t[e.method](i.name,i.dataIndex);var n=t.getData();n.each(function(e){var i=n.getName(e);r[i]=t.isSelected(i)||!1})}),{name:i.name,selected:r,seriesId:i.seriesId}})})}},Xd32:function(t,e,i){i("+tPU"),i("zQR9"),t.exports=i("5PlU")},XhgW:function(t,e,i){var n=i("3h1/"),r=Math.PI/180;function a(t,e,i,n,r,a,o){function s(e,i,n,r){for(var a=e;ae&&a+1t[a].y+t[a].height)return void l(a,n/2);l(i-1,n/2)}function l(e,i){for(var n=e;n>=0&&(t[n].y-=i,!(n>0&&t[n].y>t[n-1].y+t[n-1].height));n--);}function u(t,e,i,n,r,a){for(var o=e?Number.MAX_VALUE:0,s=0,l=t.length;s=o&&(d=o-10),!e&&d<=o&&(d=o+10),t[s].x=i+d*a,o=d}}t.sort(function(t,e){return t.y-e.y});for(var h,c=0,d=t.length,f=[],p=[],g=0;g=i?p.push(t[g]):f.push(t[g]);u(f,!1,e,i,n,r),u(p,!0,e,i,n,r)}function o(t){return"center"===t.position}t.exports=function(t,e,i,s,l){var u,h,c=t.getData(),d=[],f=!1,p=(t.get("minShowLabelAngle")||0)*r;c.each(function(i){var r=c.getItemLayout(i),a=c.getItemModel(i),o=a.getModel("label"),s=o.get("position")||a.get("emphasis.label.position"),l=a.getModel("labelLine"),g=l.get("length"),v=l.get("length2");if(!(r.angle0?"left":"right"}var k,P=o.getFont(),O=o.get("rotate");k="number"==typeof O?O*(Math.PI/180):O?b<0?-w+Math.PI:-w:0;var L=t.getFormattedLabel(i,"normal")||c.getName(i),R=n.getBoundingRect(L,P,_,"top");f=!!k,r.label={x:m,y:y,position:s,height:R.height,len:g,len2:v,linePoints:x,textAlign:_,verticalAlign:"middle",rotation:k,inside:M},M||d.push(r.label)}}),!f&&t.get("avoidLabelOverlap")&&function(t,e,i,n,r,s){for(var l=[],u=[],h=0;h=0;o--)a=n.merge(a,e[o],!0);t.defaultOption=a}return t.defaultOption},getReferringComponents:function(t){return this.ecModel.queryComponents({mainType:t,index:this.get(t+"Index",!0),id:this.get(t+"Id",!0)})}});s(f,{registerWhenExtend:!0}),a.enableSubTypeDefaulter(f),a.enableTopologicalTravel(f,function(t){var e=[];n.each(f.getClassesByMainType(t),function(t){e=e.concat(t.prototype.dependencies||[])}),e=n.map(e,function(t){return l(t).main}),"dataset"!==t&&n.indexOf(e,"dataset")<=0&&e.unshift("dataset");return e}),n.mixin(f,c);var p=f;t.exports=p},YNzw:function(t,e){var i="object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?{browser:{},os:{},node:!1,wxa:!0,canvasSupported:!0,svgSupported:!1,touchEventsSupported:!0,domSupported:!1}:"undefined"==typeof document&&"undefined"!=typeof self?{browser:{},os:{},node:!1,worker:!0,canvasSupported:!0,domSupported:!1}:"undefined"==typeof navigator?{browser:{},os:{},node:!0,worker:!1,canvasSupported:!0,svgSupported:!0,domSupported:!1}:function(t){var e={},i=t.match(/Firefox\/([\d.]+)/),n=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),r=t.match(/Edge\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(e.firefox=!0,e.version=i[1]);n&&(e.ie=!0,e.version=n[1]);r&&(e.edge=!0,e.version=r[1]);a&&(e.weChat=!0);return{browser:e,os:{},node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:"undefined"!=typeof SVGRect,touchEventsSupported:"ontouchstart"in window&&!e.ie&&!e.edge,pointerEventsSupported:"onpointerdown"in window&&(e.edge||e.ie&&e.version>=11),domSupported:"undefined"!=typeof document}}(navigator.userAgent);t.exports=i},Ylhr:function(t,e,i){var n=i("/gxq").each,r=i("AlhT"),a=i("h0jU"),o=i("BNYN"),s=i("vXqC"),l=i("0sHC"),u=i("gV7x").createTask,h=i("CqCN"),c=s.makeInner(),d=h();function f(){this.group=new r,this.uid=a.getUID("viewChart"),this.renderTask=u({plan:m,reset:y}),this.renderTask.context={view:this}}f.prototype={type:"chart",init:function(t,e){},render:function(t,e,i,n){},highlight:function(t,e,i,n){v(t.getData(),n,"emphasis")},downplay:function(t,e,i,n){v(t.getData(),n,"normal")},remove:function(t,e){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};var p=f.prototype;function g(t,e,i){if(t&&(t.trigger(e,i),t.isGroup&&!l.isHighDownDispatcher(t)))for(var n=0,r=t.childCount();nn)return!1;return!0}(s,e))){var l=e.mapDimension(s.dim),u={};return n.each(s.getViewLabels(),function(t){u[t.tickValue]=1}),function(t){return!u.hasOwnProperty(e.get(l,t))}}}}function S(t,e,i){if("cartesian2d"===t.type){var n=t.getBaseAxis().isHorizontal(),r=m(t,e,i);if(!i.get("clip",!0)){var a=r.shape,o=Math.max(a.width,a.height);n?(a.y-=o,a.height+=2*o):(a.x-=o,a.width+=2*o)}return r}return y(t,e,i)}var M=d.extend({type:"line",init:function(){var t=new s.Group,e=new r;this.group.add(e.group),this._symbolDraw=e,this._lineGroup=t},render:function(t,e,i){var r=t.coordinateSystem,a=this.group,o=t.getData(),l=t.getModel("lineStyle"),u=t.getModel("areaStyle"),h=o.mapArray(o.getItemLayout),c="polar"===r.type,d=this._coordSys,f=this._symbolDraw,v=this._polyline,m=this._polygon,y=this._lineGroup,M=t.get("animation"),A=!u.isEmpty(),T=u.get("origin"),C=function(t,e,i){if(!i.valueDim)return[];for(var n=[],r=0,a=e.count();r=0;o--){var l=i[o].dimension,u=t.dimensions[l],h=t.getDimensionInfo(u);if("x"===(r=h&&h.coordDim)||"y"===r){a=i[o];break}}if(a){var c=e.getAxis(r),d=n.map(a.stops,function(t){return{coord:c.toGlobalCoord(c.dataToCoord(t.value)),color:t.color}}),f=d.length,p=a.outerColors.slice();f&&d[0].coord>d[f-1].coord&&(d.reverse(),p.reverse());var g=d[0].coord-10,v=d[f-1].coord+10,m=v-g;if(m<.001)return"transparent";n.each(d,function(t){t.offset=(t.coord-g)/m}),d.push({offset:f?d[f-1].offset:.5,color:p[1]||"transparent"}),d.unshift({offset:f?d[0].offset:.5,color:p[0]||"transparent"});var y=new s.LinearGradient(0,0,0,0,d,!0);return y[r]=g,y[r+"2"]=v,y}}}(o,r)||o.getVisual("color");v.useStyle(n.defaults(l.getLineStyle(),{fill:"none",stroke:L,lineJoin:"bevel"}));var R=t.get("smooth");if(R=_(t.get("smooth")),v.setShape({smooth:R,smoothMonotone:t.get("smoothMonotone"),connectNulls:t.get("connectNulls")}),m){var E=o.getCalculationInfo("stackedOnSeries"),z=0;m.useStyle(n.defaults(u.getAreaStyle(),{fill:L,opacity:.7,lineJoin:"bevel"})),E&&(z=_(E.get("smooth"))),m.setShape({smooth:R,stackedOnSmooth:z,smoothMonotone:t.get("smoothMonotone"),connectNulls:t.get("connectNulls")})}this._data=o,this._coordSys=r,this._stackedOnPoints=C,this._points=h,this._step=O,this._valueOrigin=T},dispose:function(){},highlight:function(t,e,i,n){var r=t.getData(),o=l.queryDataIndex(r,n);if(!(o instanceof Array)&&null!=o&&o>=0){var s=r.getItemGraphicEl(o);if(!s){var u=r.getItemLayout(o);if(!u)return;(s=new a(r,o)).position=u,s.setZ(t.get("zlevel"),t.get("z")),s.ignore=isNaN(u[0])||isNaN(u[1]),s.__temp=!0,r.setItemGraphicEl(o,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else d.prototype.highlight.call(this,t,e,i,n)},downplay:function(t,e,i,n){var r=t.getData(),a=l.queryDataIndex(r,n);if(null!=a&&a>=0){var o=r.getItemGraphicEl(a);o&&(o.__temp?(r.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else d.prototype.downplay.call(this,t,e,i,n)},_newPolyline:function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new h({shape:{points:t},silent:!0,z2:10}),this._lineGroup.add(e),this._polyline=e,e},_newPolygon:function(t,e){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new c({shape:{points:t,stackedOnPoints:e},silent:!0}),this._lineGroup.add(i),this._polygon=i,i},_updateAnimation:function(t,e,i,n,r,a){var l=this._polyline,u=this._polygon,h=t.hostModel,c=o(this._data,t,this._stackedOnPoints,e,this._coordSys,i,this._valueOrigin,a),d=c.current,f=c.stackedOnCurrent,p=c.next,g=c.stackedOnNext;r&&(d=w(c.current,i,r),f=w(c.stackedOnCurrent,i,r),p=w(c.next,i,r),g=w(c.stackedOnNext,i,r)),l.shape.__points=c.current,l.shape.points=d,s.updateProps(l,{shape:{points:p}},h),u&&(u.setShape({points:d,stackedOnPoints:f}),s.updateProps(u,{shape:{points:p,stackedOnPoints:g}},h));for(var v=[],m=c.status,y=0;y0},extendFrom:function(t,e){if(t)for(var i in t)!t.hasOwnProperty(i)||!0!==e&&(!1===e?this.hasOwnProperty(i):null==t[i])||(this[i]=t[i])},set:function(t,e){"string"==typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,i){for(var n=("radial"===e.type?l:s)(t,e,i),r=e.colorStops,a=0;ai&&(s=i);var l=d.length,c=function(t,e,i,n){for(;i>>1;t[r][1]1&&(h*=o(_),f*=o(_));var w=(r===a?-1:1)*o((h*h*(f*f)-h*h*(x*x)-f*f*(y*y))/(h*h*(x*x)+f*f*(y*y)))||0,b=w*h*x/f,S=w*-f*y/h,M=(t+i)/2+l(m)*b-s(m)*S,A=(e+n)/2+s(m)*b+l(m)*S,T=d([1,0],[(y-b)/h,(x-S)/f]),C=[(y-b)/h,(x-S)/f],I=[(-1*y-b)/h,(-1*x-S)/f],D=d(C,I);c(C,I)<=-1&&(D=u),c(C,I)>=1&&(D=0),0===a&&D>0&&(D-=2*u),1===a&&D<0&&(D+=2*u),v.addData(g,M,A,h,f,T,D,m,a)}var p=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,g=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function v(t,e){var i=function(t){if(!t)return new r;for(var e,i=0,n=0,a=i,o=n,s=new r,l=r.CMD,u=t.match(p),h=0;h=11?function(){var e,i=this.__clipPaths,n=this.style;if(i)for(var a=0;a=0&&l<0)&&(o=g,l=p,r=h,a.length=0),s(c,function(t){a.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:a,snapToValue:r}}(e,t),u=l.payloadBatch,h=l.snapToValue;u[0]&&null==a.seriesIndex&&n.extend(a,u[0]),!r&&t.snap&&o.containData(h)&&null!=h&&(e=h),i.showPointer(t,e,u,a),i.showTooltip(t,l,h)}else i.showPointer(t,e)}function c(t,e,i,n){t[e.key]={value:i,payloadBatch:n}}function d(t,e,i,n){var r=i.payloadBatch,o=e.axis,s=o.model,l=e.axisPointerModel;if(e.triggerTooltip&&r.length){var u=e.coordSys.model,h=a.makeKey(u),c=t.map[h];c||(c=t.map[h]={coordSysId:u.id,coordSysIndex:u.componentIndex,coordSysType:u.type,coordSysMainType:u.mainType,dataByAxis:[]},t.list.push(c)),c.dataByAxis.push({axisDim:o.dim,axisIndex:s.componentIndex,axisType:s.type,axisId:s.id,value:n,valueLabelOpt:{precision:l.get("label.precision"),formatter:l.get("label.formatter")},seriesDataIndices:r.slice()})}}function f(t){var e=t.axis.model,i={},n=i.axisDim=t.axis.dim;return i.axisIndex=i[n+"AxisIndex"]=e.componentIndex,i.axisName=i[n+"AxisName"]=e.name,i.axisId=i[n+"AxisId"]=e.id,i}function p(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}t.exports=function(t,e,i){var r=t.currTrigger,a=[t.x,t.y],g=t,v=t.dispatchAction||n.bind(i.dispatchAction,i),m=e.getComponent("axisPointer").coordSysAxesInfo;if(m){p(a)&&(a=o({seriesIndex:g.seriesIndex,dataIndex:g.dataIndex},e).point);var y=p(a),x=g.axesInfo,_=m.axesInfo,w="leave"===r||p(a),b={},S={},M={list:[],map:{}},A={showPointer:l(c,S),showTooltip:l(d,M)};s(m.coordSysMap,function(t,e){var i=y||t.containPoint(a);s(m.coordSysAxesInfo[e],function(t,e){var n=t.axis,r=function(t,e){for(var i=0;i<(t||[]).length;i++){var n=t[i];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}(x,t);if(!w&&i&&(!x||r)){var o=r&&r.value;null!=o||y||(o=n.pointToData(a)),null!=o&&h(t,o,A,!1,b)}})});var T={};return s(_,function(t,e){var i=t.linkGroup;i&&!S[e]&&s(i.axesInfo,function(e,n){var r=S[n];if(e!==t&&r){var a=r.value;i.mapper&&(a=t.axis.scale.parse(i.mapper(a,f(e),f(t)))),T[t.key]=a}})}),s(T,function(t,e){h(_[e],t,A,!0,b)}),function(t,e,i){var n=i.axesInfo=[];s(e,function(e,i){var r=e.axisPointerModel.option,a=t[i];a?(!e.useHandle&&(r.status="show"),r.value=a.value,r.seriesDataIndices=(a.payloadBatch||[]).slice()):!e.useHandle&&(r.status="hide"),"show"===r.status&&n.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:r.value})})}(S,_,b),function(t,e,i,n){if(!p(e)&&t.list.length){var r=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:i.tooltipOption,position:i.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:t.list})}else n({type:"hideTip"})}(M,a,t,v),function(t,e,i){var r=i.getZr(),a=u(r).axisPointerLastHighlights||{},o=u(r).axisPointerLastHighlights={};s(t,function(t,e){var i=t.axisPointerModel.option;"show"===i.status&&s(i.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;o[e]=t})});var l=[],h=[];n.each(a,function(t,e){!o[e]&&h.push(t)}),n.each(o,function(t,e){!a[e]&&l.push(t)}),h.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,batch:h}),l.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,batch:l})}(_,0,i),b}}},"e8/X":function(t,e,i){var n=i("UAiw"),r=n.addEventListener,a=n.removeEventListener,o=n.normalizeEvent,s=i("/gxq"),l=i("qjvV"),u=i("YNzw"),h=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],c=["touchstart","touchend","touchmove"],d={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},f=s.map(h,function(t){var e=t.replace("mouse","pointer");return d[e]?e:t});function p(t){return"mousewheel"===t&&u.browser.firefox?"DOMMouseScroll":t}function g(t){t._touching=!0,clearTimeout(t._touchTimer),t._touchTimer=setTimeout(function(){t._touching=!1},700)}var v={mousemove:function(t){t=o(this.dom,t),this.trigger("mousemove",t)},mouseout:function(t){var e=(t=o(this.dom,t)).toElement||t.relatedTarget;if(e!==this.dom)for(;e&&9!==e.nodeType;){if(e===this.dom)return;e=e.parentNode}this.trigger("mouseout",t)},touchstart:function(t){(t=o(this.dom,t)).zrByTouch=!0,this._lastTouchMoment=new Date,this.handler.processGesture(this,t,"start"),v.mousemove.call(this,t),v.mousedown.call(this,t),g(this)},touchmove:function(t){(t=o(this.dom,t)).zrByTouch=!0,this.handler.processGesture(this,t,"change"),v.mousemove.call(this,t),g(this)},touchend:function(t){(t=o(this.dom,t)).zrByTouch=!0,this.handler.processGesture(this,t,"end"),v.mouseup.call(this,t),+new Date-this._lastTouchMoment<300&&v.click.call(this,t),g(this)},pointerdown:function(t){v.mousedown.call(this,t)},pointermove:function(t){m(t)||v.mousemove.call(this,t)},pointerup:function(t){v.mouseup.call(this,t)},pointerout:function(t){m(t)||v.mouseout.call(this,t)}};function m(t){var e=t.pointerType;return"pen"===e||"touch"===e}function y(t){var e;function i(e,i){s.each(e,function(e){r(t,p(e),i._handlers[e])},i)}l.call(this),this.dom=t,this._touching=!1,this._touchTimer,this._handlers={},e=this,s.each(c,function(t){e._handlers[t]=s.bind(v[t],e)}),s.each(f,function(t){e._handlers[t]=s.bind(v[t],e)}),s.each(h,function(t){e._handlers[t]=function(t,e){return function(){if(!e._touching)return t.apply(e,arguments)}}(v[t],e)}),u.pointerEventsSupported?i(f,this):(u.touchEventsSupported&&i(c,this),i(h,this))}s.each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){v[t]=function(e){e=o(this.dom,e),this.trigger(t,e)}});var x=y.prototype;x.dispose=function(){for(var t=h.concat(c),e=0;e=e:"max"===i?t<=e:t===e})(r[o],t,n)||(a=!1)}}),a}c.prototype={constructor:c,setOption:function(t,e){t&&n.each(r.normalizeToArray(t.series),function(t){t&&t.data&&n.isTypedArray(t.data)&&n.setAsPrimitive(t.data)}),t=s(t);var i,h,c=this._optionBackup,d=function(t,e,i){var r,a,s=[],l=[],u=t.timeline;t.baseOption&&(a=t.baseOption);(u||t.options)&&(a=a||{},s=(t.options||[]).slice());if(t.media){a=a||{};var h=t.media;o(h,function(t){t&&t.option&&(t.query?l.push(t):r||(r=t))})}a||(a=t);a.timeline||(a.timeline=u);return o([a].concat(s).concat(n.map(l,function(t){return t.option})),function(t){o(e,function(e){e(t,i)})}),{baseOption:a,timelineOptions:s,mediaDefault:r,mediaList:l}}.call(this,t,e,!c);this._newBaseOption=d.baseOption,c?(i=c.baseOption,h=d.baseOption,o(h=h||{},function(t,e){if(null!=t){var n=i[e];if(a.hasClass(e)){t=r.normalizeToArray(t),n=r.normalizeToArray(n);var o=r.mappingToExists(n,t);i[e]=l(o,function(t){return t.option&&t.exist?u(t.exist,t.option,!0):t.exist||t.option})}else i[e]=u(n,t,!0)}}),d.timelineOptions.length&&(c.timelineOptions=d.timelineOptions),d.mediaList.length&&(c.mediaList=d.mediaList),d.mediaDefault&&(c.mediaDefault=d.mediaDefault)):this._optionBackup=d},mountOption:function(t){var e=this._optionBackup;return this._timelineOptions=l(e.timelineOptions,s),this._mediaList=l(e.mediaList,s),this._mediaDefault=s(e.mediaDefault),this._currentMediaIndices=[],s(t?e.baseOption:this._newBaseOption)},getTimelineOption:function(t){var e,i=this._timelineOptions;if(i.length){var n=t.getComponent("timeline");n&&(e=s(i[n.getCurrentIndex()],!0))}return e},getMediaOption:function(t){var e,i,n=this._api.getWidth(),r=this._api.getHeight(),a=this._mediaList,o=this._mediaDefault,u=[],h=[];if(!a.length&&!o)return h;for(var c=0,f=a.length;c=0;p--){var g=t[p];if(s||(c=g.data.rawIndexOf(g.stackedByDimension,h)),c>=0){var v=g.data.getByRawIndex(g.stackResultDimension,c);if(d>=0&&v>0||d<=0&&v<0){d+=v,f=v;break}}}return n[0]=d,n[1]=f,n});o.hostModel.setData(l),e.data=l})}t.exports=function(t){var e=r();t.eachSeries(function(t){var i=t.get("stack");if(i){var n=e.get(i)||e.set(i,[]),r=t.getData(),a={stackResultDimension:r.getCalculationInfo("stackResultDimension"),stackedOverDimension:r.getCalculationInfo("stackedOverDimension"),stackedDimension:r.getCalculationInfo("stackedDimension"),stackedByDimension:r.getCalculationInfo("stackedByDimension"),isStackedByIndex:r.getCalculationInfo("isStackedByIndex"),data:r,seriesModel:t};if(!a.stackedDimension||!a.isStackedByIndex&&!a.stackedByDimension)return;n.length&&r.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(a)}}),e.each(o)}},fgF4:function(t,e,i){var n=i("RYbJ")([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),r={getAreaStyle:function(t,e){return n(this,t,e)}};t.exports=r},fxRn:function(t,e,i){i("+tPU"),i("zQR9"),t.exports=i("g8Ux")},"g+yZ":function(t,e){var i=1;"undefined"!=typeof window&&(i=Math.max(window.devicePixelRatio||1,1));var n=i;e.debugMode=0,e.devicePixelRatio=n},g8Ux:function(t,e,i){var n=i("77Pl"),r=i("3fs2");t.exports=i("FeBl").getIterator=function(t){var e=r(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return n(e.call(t))}},gApy:function(t,e,i){var n,r,a=i("i4uy"),o=i("MAlW"),s=0,l=0;t.exports=function(t,e,i){var u=e&&i||0,h=e||[],c=(t=t||{}).node||n,d=void 0!==t.clockseq?t.clockseq:r;if(null==c||null==d){var f=a();null==c&&(c=n=[1|f[0],f[1],f[2],f[3],f[4],f[5]]),null==d&&(d=r=16383&(f[6]<<8|f[7]))}var p=void 0!==t.msecs?t.msecs:(new Date).getTime(),g=void 0!==t.nsecs?t.nsecs:l+1,v=p-s+(g-l)/1e4;if(v<0&&void 0===t.clockseq&&(d=d+1&16383),(v<0||p>s)&&void 0===t.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=p,l=g,r=d;var m=(1e4*(268435455&(p+=122192928e5))+g)%4294967296;h[u++]=m>>>24&255,h[u++]=m>>>16&255,h[u++]=m>>>8&255,h[u++]=255&m;var y=p/4294967296*1e4&268435455;h[u++]=y>>>8&255,h[u++]=255&y,h[u++]=y>>>24&15|16,h[u++]=y>>>16&255,h[u++]=d>>>8|128,h[u++]=255&d;for(var x=0;x<6;++x)h[u+x]=c[x];return e||o(h)}},gAsd:function(t,e,i){i("G5/o");var n=i("FeBl").Object;t.exports=function(t){return n.getOwnPropertyNames(t)}},gV7x:function(t,e,i){var n=i("/gxq"),r=(n.assert,n.isArray);i("4Nz2").__DEV__;function a(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0,this.context}var o=a.prototype;o.perform=function(t){var e,i=this._upstream,n=t&&t.skip;if(this._dirty&&i){var a=this.context;a.data=a.outputData=i.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!n&&(e=this._plan(this.context));var o,s=d(this._modBy),u=this._modDataCount||0,h=d(t&&t.modBy),c=t&&t.modDataCount||0;function d(t){return!(t>=1)&&(t=1),t}s===h&&u===c||(e="reset"),(this._dirty||"reset"===e)&&(this._dirty=!1,o=function(t,e){var i,n;t._dueIndex=t._outputDueEnd=t._dueEnd=0,t._settedOutputEnd=null,!e&&t._reset&&((i=t._reset(t.context))&&i.progress&&(n=i.forceFirstProgress,i=i.progress),r(i)&&!i.length&&(i=null));t._progress=i,t._modBy=t._modDataCount=null;var a=t._downstream;return a&&a.dirty(),n}(this,n)),this._modBy=h,this._modDataCount=c;var f=t&&t.step;if(this._dueEnd=i?i._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var p=this._dueIndex,g=Math.min(null!=f?this._dueIndex+f:1/0,this._dueEnd);if(!n&&(o||p1&&n>0?s:o}};return a;function o(){return e=t?null:a=0&&i.push(t)}),i}(s.originalDeps=e(o),t);s.entryCount=l.length,0===s.entryCount&&a.push(o),n.each(l,function(t){n.indexOf(s.predecessor,t)<0&&s.predecessor.push(t);var e=i(r,t);n.indexOf(e.successor,t)<0&&e.successor.push(o)})}),{graph:r,noEntryList:a}}(r),l=s.graph,u=s.noEntryList,h={};for(n.each(t,function(t){h[t]=!0});u.length;){var c=u.pop(),d=l[c],f=!!h[c];f&&(a.call(o,c,d.originalDeps.slice()),delete h[c]),n.each(d.successor,f?g:p)}n.each(h,function(){throw new Error("Circle dependency may exists")})}function p(t){l[t].entryCount--,0===l[t].entryCount&&u.push(t)}function g(t){h[t]=!0,p(t)}}}},"hcq/":function(t,e,i){var n=i("/n1K");t.exports=function(t,e){return n((e=e||{}).coordDimensions||[],t,{dimsDef:e.dimensionsDefine||t.dimensionsDefine,encodeDef:e.encodeDefine||t.encodeDefine,dimCount:e.dimensionsCount,generateCoord:e.generateCoord,generateCoordCount:e.generateCoordCount})}},hv2j:function(t,e,i){var n=i("RiVu"),r=i("YNzw"),a=i("/gxq"),o=i("lj6Z"),s=i("9N6q"),l=i("I0Vc"),u=i("V4nf"),h=i("e8/X"),c=!r.canvasSupported,d={canvas:l},f={};var p=function(t,e,i){i=i||{},this.dom=e,this.id=t;var n=this,l=new s,f=i.renderer;if(c){if(!d.vml)throw new Error("You need to require 'zrender/vml/vml' to support IE8");f="vml"}else f&&d[f]||(f="canvas");var p=new d[f](e,l,i,t);this.storage=l,this.painter=p;var g=r.node||r.worker?null:new h(p.getViewportRoot());this.handler=new o(l,p,g,p.root),this.animation=new u({stage:{update:a.bind(this.flush,this)}}),this.animation.start(),this._needsRefresh;var v=l.delFromStorage,m=l.addToStorage;l.delFromStorage=function(t){v.call(l,t),t&&t.removeSelfFromZr(n)},l.addToStorage=function(t){m.call(l,t),t.addSelfToZr(n)}};p.prototype={constructor:p,getId:function(){return this.id},add:function(t){this.storage.addRoot(t),this._needsRefresh=!0},remove:function(t){this.storage.delRoot(t),this._needsRefresh=!0},configLayer:function(t,e){this.painter.configLayer&&this.painter.configLayer(t,e),this._needsRefresh=!0},setBackgroundColor:function(t){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(t),this._needsRefresh=!0},refreshImmediately:function(){this._needsRefresh=this._needsRefreshHover=!1,this.painter.refresh(),this._needsRefresh=this._needsRefreshHover=!1},refresh:function(){this._needsRefresh=!0},flush:function(){var t;this._needsRefresh&&(t=!0,this.refreshImmediately()),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately()),t&&this.trigger("rendered")},addHover:function(t,e){if(this.painter.addHover){var i=this.painter.addHover(t,e);return this.refreshHover(),i}},removeHover:function(t){this.painter.removeHover&&(this.painter.removeHover(t),this.refreshHover())},clearHover:function(){this.painter.clearHover&&(this.painter.clearHover(),this.refreshHover())},refreshHover:function(){this._needsRefreshHover=!0},refreshHoverImmediately:function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.refreshHover()},resize:function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},clearAnimation:function(){this.animation.clear()},getWidth:function(){return this.painter.getWidth()},getHeight:function(){return this.painter.getHeight()},pathToImage:function(t,e){return this.painter.pathToImage(t,e)},setCursorStyle:function(t){this.handler.setCursorStyle(t)},findHover:function(t,e){return this.handler.findHover(t,e)},on:function(t,e,i){this.handler.on(t,e,i)},off:function(t,e){this.handler.off(t,e)},trigger:function(t,e){this.handler.trigger(t,e)},clear:function(){this.storage.delRoot(),this.painter.clear()},dispose:function(){var t;this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,t=this.id,delete f[t]}},e.version="4.1.1",e.init=function(t,e){var i=new p(n(),t,e);return f[i.id]=i,i},e.dispose=function(t){if(t)t.dispose();else{for(var e in f)f.hasOwnProperty(e)&&f[e].dispose();f={}}return this},e.getInstance=function(t){return f[t]},e.registerPainter=function(t,e){d[t]=e}},i4uy:function(t,e){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var n=new Uint8Array(16);t.exports=function(){return i(n),n}}else{var r=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),r[e]=t>>>((3&e)<<3)&255;return r}}},iGPw:function(t,e,i){var n=i("/gxq"),r=n.createHashMap,a=n.isObject,o=n.map;function s(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this._map}s.createByAxisModel=function(t){var e=t.option,i=e.data,n=i&&o(i,h);return new s({categories:n,needCollect:!n,deduplication:!1!==e.dedplication})};var l=s.prototype;function u(t){return t._map||(t._map=r(t.categories))}function h(t){return a(t)&&null!=t.value?t.value:t+""}l.getOrdinal=function(t){return u(this).get(t)},l.parseAndCollect=function(t){var e,i=this._needCollect;if("string"!=typeof t&&!i)return t;if(i&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var n=u(this);return null==(e=n.get(t))&&(i?(e=this.categories.length,this.categories[e]=t,n.set(t,e)):e=NaN),e};var c=s;t.exports=c},iNHu:function(t,e,i){var n=i("hv2j");e.zrender=n;var r=i("dOVI");e.matrix=r;var a=i("C7PF");e.vector=a;var o=i("/gxq"),s=i("DRaW");e.color=s;var l=i("0sHC"),u=i("wWR3");e.number=u;var h=i("HHfb");e.format=h;var c=i("QD+P");c.throttle;e.throttle=c.throttle;var d=i("5QRV");e.helper=d;var f=i("Axyt");e.parseGeoJSON=f;var p=i("Rfu2");e.List=p;var g=i("Pdtn");e.Model=g;var v=i("2HcM");e.Axis=v;var m=i("YNzw");e.env=m;var y=f,x={};o.each(["map","each","filter","indexOf","inherits","reduce","filter","bind","curry","isArray","isString","isObject","isFunction","extend","defaults","clone","merge"],function(t){x[t]=o[t]});var _={};o.each(["extendShape","extendPath","makePath","makeImage","mergePath","resizePath","createIcon","setHoverStyle","setLabelStyle","setTextStyle","setText","getFont","updateProps","initProps","getTransform","clipPointsByRect","clipRectByRect","registerShape","getShapeClass","Group","Image","Text","Circle","Sector","Ring","Polygon","Polyline","Rect","Line","BezierCurve","Arc","IncrementalDisplayable","CompoundPath","LinearGradient","RadialGradient","BoundingRect"],function(t){_[t]=l[t]}),e.parseGeoJson=y,e.util=x,e.graphic=_},jDhh:function(t,e,i){var n=i("AlhT"),r=i("MAom"),a=i("/86O"),o=i("Of86"),s=i("PD67"),l=i("udrn"),u=i("KsMi"),h=i("GxVO"),c=i("+UTs"),d=i("BeCT"),f=i("Gw4f"),p=i("d8Tt"),g=i("dOVI"),v=i("dE09").createFromString,m=i("/gxq"),y=m.isString,x=m.extend,_=m.defaults,w=m.trim,b=m.each,S=/[\s,]+/;function M(t){y(t)&&(t=(new DOMParser).parseFromString(t,"text/xml"));for(9===t.nodeType&&(t=t.firstChild);"svg"!==t.nodeName.toLowerCase()||1!==t.nodeType;)t=t.nextSibling;return t}function A(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}A.prototype.parse=function(t,e){e=e||{};var i=M(t);if(!i)throw new Error("Illegal svg");var r=new n;this._root=r;var a=i.getAttribute("viewBox")||"",o=parseFloat(i.getAttribute("width")||e.width),l=parseFloat(i.getAttribute("height")||e.height);isNaN(o)&&(o=null),isNaN(l)&&(l=null),P(i,r,null,!0);for(var u,h,c=i.firstChild;c;)this._parseNode(c,r),c=c.nextSibling;if(a){var d=w(a).split(S);d.length>=4&&(u={x:parseFloat(d[0]||0),y:parseFloat(d[1]||0),width:parseFloat(d[2]),height:parseFloat(d[3])})}if(u&&null!=o&&null!=l&&(h=z(u,o,l),!e.ignoreViewBox)){var f=r;(r=new n).add(f),f.scale=h.scale.slice(),f.position=h.position.slice()}return e.ignoreRootClip||null==o||null==l||r.setClipPath(new s({shape:{x:0,y:0,width:o,height:l}})),{root:r,width:o,height:l,viewBoxRect:u,viewBoxTransform:h}},A.prototype._parseNode=function(t,e){var i,n,r=t.nodeName.toLowerCase();if("defs"===r?this._isDefine=!0:"text"===r&&(this._isText=!0),this._isDefine){if(n=C[r]){var a=n.call(this,t),o=t.getAttribute("id");o&&(this._defs[o]=a)}}else(n=T[r])&&(i=n.call(this,t,e),e.add(i));for(var s=t.firstChild;s;)1===s.nodeType&&this._parseNode(s,i),3===s.nodeType&&this._isText&&this._parseText(s,i),s=s.nextSibling;"defs"===r?this._isDefine=!1:"text"===r&&(this._isText=!1)},A.prototype._parseText=function(t,e){if(1===t.nodeType){var i=t.getAttribute("dx")||0,n=t.getAttribute("dy")||0;this._textX+=parseFloat(i),this._textY+=parseFloat(n)}var r=new a({style:{text:t.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});I(e,r),P(t,r,this._defs);var o=r.style.fontSize;o&&o<9&&(r.style.fontSize=9,r.scale=r.scale||[1,1],r.scale[0]*=o/9,r.scale[1]*=o/9);var s=r.getBoundingRect();return this._textX+=s.width,e.add(r),r};var T={g:function(t,e){var i=new n;return I(e,i),P(t,i,this._defs),i},rect:function(t,e){var i=new s;return I(e,i),P(t,i,this._defs),i.setShape({x:parseFloat(t.getAttribute("x")||0),y:parseFloat(t.getAttribute("y")||0),width:parseFloat(t.getAttribute("width")||0),height:parseFloat(t.getAttribute("height")||0)}),i},circle:function(t,e){var i=new o;return I(e,i),P(t,i,this._defs),i.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),r:parseFloat(t.getAttribute("r")||0)}),i},line:function(t,e){var i=new u;return I(e,i),P(t,i,this._defs),i.setShape({x1:parseFloat(t.getAttribute("x1")||0),y1:parseFloat(t.getAttribute("y1")||0),x2:parseFloat(t.getAttribute("x2")||0),y2:parseFloat(t.getAttribute("y2")||0)}),i},ellipse:function(t,e){var i=new l;return I(e,i),P(t,i,this._defs),i.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),rx:parseFloat(t.getAttribute("rx")||0),ry:parseFloat(t.getAttribute("ry")||0)}),i},polygon:function(t,e){var i=t.getAttribute("points");i&&(i=D(i));var n=new c({shape:{points:i||[]}});return I(e,n),P(t,n,this._defs),n},polyline:function(t,e){var i=new h;I(e,i),P(t,i,this._defs);var n=t.getAttribute("points");return n&&(n=D(n)),new d({shape:{points:n||[]}})},image:function(t,e){var i=new r;return I(e,i),P(t,i,this._defs),i.setStyle({image:t.getAttribute("xlink:href"),x:t.getAttribute("x"),y:t.getAttribute("y"),width:t.getAttribute("width"),height:t.getAttribute("height")}),i},text:function(t,e){var i=t.getAttribute("x")||0,r=t.getAttribute("y")||0,a=t.getAttribute("dx")||0,o=t.getAttribute("dy")||0;this._textX=parseFloat(i)+parseFloat(a),this._textY=parseFloat(r)+parseFloat(o);var s=new n;return I(e,s),P(t,s,this._defs),s},tspan:function(t,e){var i=t.getAttribute("x"),r=t.getAttribute("y");null!=i&&(this._textX=parseFloat(i)),null!=r&&(this._textY=parseFloat(r));var a=t.getAttribute("dx")||0,o=t.getAttribute("dy")||0,s=new n;return I(e,s),P(t,s,this._defs),this._textX+=a,this._textY+=o,s},path:function(t,e){var i=t.getAttribute("d")||"",n=v(i);return I(e,n),P(t,n,this._defs),n}},C={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||0,10),i=parseInt(t.getAttribute("y1")||0,10),n=parseInt(t.getAttribute("x2")||10,10),r=parseInt(t.getAttribute("y2")||0,10),a=new f(e,i,n,r);return function(t,e){var i=t.firstChild;for(;i;){if(1===i.nodeType){var n=i.getAttribute("offset");n=n.indexOf("%")>0?parseInt(n,10)/100:n?parseFloat(n):0;var r=i.getAttribute("stop-color")||"#000000";e.addColorStop(n,r)}i=i.nextSibling}}(t,a),a},radialgradient:function(t){}};function I(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),_(e.__inheritedStyle,t.__inheritedStyle))}function D(t){for(var e=w(t).split(S),i=[],n=0;n0;a-=2){var o=r[a],s=r[a-1];switch(n=n||g.create(),s){case"translate":o=w(o).split(S),g.translate(n,n,[parseFloat(o[0]),parseFloat(o[1]||0)]);break;case"scale":o=w(o).split(S),g.scale(n,n,[parseFloat(o[0]),parseFloat(o[1]||o[0])]);break;case"rotate":o=w(o).split(S),g.rotate(n,n,parseFloat(o[0]));break;case"skew":o=w(o).split(S),console.warn("Skew transform is not supported yet");break;case"matrix":var o=w(o).split(S);n[0]=parseFloat(o[0]),n[1]=parseFloat(o[1]),n[2]=parseFloat(o[2]),n[3]=parseFloat(o[3]),n[4]=parseFloat(o[4]),n[5]=parseFloat(o[5])}}e.setLocalTransform(n)}}(t,e),x(r,function(t){var e=t.getAttribute("style"),i={};if(!e)return i;var n,r={};E.lastIndex=0;for(;null!=(n=E.exec(e));)r[n[1]]=n[2];for(var a in k)k.hasOwnProperty(a)&&null!=r[a]&&(i[k[a]]=r[a]);return i}(t)),!n))for(var o in k)if(k.hasOwnProperty(o)){var s=t.getAttribute(o);null!=s&&(r[k[o]]=s)}var l=a?"textFill":"fill",u=a?"textStroke":"stroke";e.style=e.style||new p;var h=e.style;null!=r.fill&&h.set(l,L(r.fill,i)),null!=r.stroke&&h.set(u,L(r.stroke,i)),b(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],function(t){var e="lineWidth"===t&&a?"textStrokeWidth":t;null!=r[t]&&h.set(e,parseFloat(r[t]))}),r.textBaseline&&"auto"!==r.textBaseline||(r.textBaseline="alphabetic"),"alphabetic"===r.textBaseline&&(r.textBaseline="bottom"),"start"===r.textAlign&&(r.textAlign="left"),"end"===r.textAlign&&(r.textAlign="right"),b(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign","textBaseline"],function(t){null!=r[t]&&h.set(t,r[t])}),r.lineDash&&(e.style.lineDash=w(r.lineDash).split(S)),h[u]&&"none"!==h[u]&&(e[u]=!0),e.__inheritedStyle=r}var O=/url\(\s*#(.*?)\)/;function L(t,e){var i=e&&t&&t.match(O);return i?e[w(i[1])]:t}var R=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g;var E=/([^\s:;]+)\s*:\s*([^:;]+)/g;function z(t,e,i){var n=e/t.width,r=i/t.height,a=Math.min(n,r);return{scale:[a,a],position:[-(t.x+t.width/2)*a+e/2,-(t.y+t.height/2)*a+i/2]}}e.parseXML=M,e.makeViewBoxTransform=z,e.parseSVG=function(t,e){return(new A).parse(t,e)}},jHiU:function(t,e,i){var n=i("/gxq"),r=i("wRzc"),a=function(t,e,i,n,a){this.x=null==t?.5:t,this.y=null==e?.5:e,this.r=null==i?.5:i,this.type="radial",this.global=a||!1,r.call(this,n)};a.prototype={constructor:a},n.inherits(a,r);var o=a;t.exports=o},jMTz:function(t,e,i){i("4Nz2").__DEV__;var n=i("ao1T"),r=i("EJsE").extend({type:"series.line",dependencies:["grid","polar"],getInitialData:function(t,e){return n(this.getSource(),this)},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,clip:!0,label:{position:"top"},lineStyle:{width:2,type:"solid"},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0}});t.exports=r},kK7q:function(t,e,i){var n=i("/gxq"),r=i("0sHC"),a=i("8b51"),o=i("3h1/").calculateTextPosition,s=r.extendShape({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,n=e.cy,r=e.width/2,a=e.height/2;t.moveTo(i,n-a),t.lineTo(i+r,n+a),t.lineTo(i-r,n+a),t.closePath()}}),l=r.extendShape({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,n=e.cy,r=e.width/2,a=e.height/2;t.moveTo(i,n-a),t.lineTo(i+r,n),t.lineTo(i,n+a),t.lineTo(i-r,n),t.closePath()}}),u=r.extendShape({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.x,n=e.y,r=e.width/5*3,a=Math.max(r,e.height),o=r/2,s=o*o/(a-o),l=n-a+o+s,u=Math.asin(s/o),h=Math.cos(u)*o,c=Math.sin(u),d=Math.cos(u),f=.6*o,p=.7*o;t.moveTo(i-h,l+s),t.arc(i,l,o,Math.PI-u,2*Math.PI+u),t.bezierCurveTo(i+h-c*f,l+s+d*f,i,n-p,i,n),t.bezierCurveTo(i,n-p,i-h+c*f,l+s+d*f,i-h,l+s),t.closePath()}}),h=r.extendShape({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.height,n=e.width,r=e.x,a=e.y,o=n/3*2;t.moveTo(r,a),t.lineTo(r+o,a+i),t.lineTo(r,a+i/4*3),t.lineTo(r-o,a+i),t.lineTo(r,a),t.closePath()}}),c={line:r.Line,rect:r.Rect,roundRect:r.Rect,square:r.Rect,circle:r.Circle,diamond:l,pin:u,arrow:h,triangle:s},d={line:function(t,e,i,n,r){r.x1=t,r.y1=e+n/2,r.x2=t+i,r.y2=e+n/2},rect:function(t,e,i,n,r){r.x=t,r.y=e,r.width=i,r.height=n},roundRect:function(t,e,i,n,r){r.x=t,r.y=e,r.width=i,r.height=n,r.r=Math.min(i,n)/4},square:function(t,e,i,n,r){var a=Math.min(i,n);r.x=t,r.y=e,r.width=a,r.height=a},circle:function(t,e,i,n,r){r.cx=t+i/2,r.cy=e+n/2,r.r=Math.min(i,n)/2},diamond:function(t,e,i,n,r){r.cx=t+i/2,r.cy=e+n/2,r.width=i,r.height=n},pin:function(t,e,i,n,r){r.x=t+i/2,r.y=e+n/2,r.width=i,r.height=n},arrow:function(t,e,i,n,r){r.x=t+i/2,r.y=e+n/2,r.width=i,r.height=n},triangle:function(t,e,i,n,r){r.cx=t+i/2,r.cy=e+n/2,r.width=i,r.height=n}},f={};n.each(c,function(t,e){f[e]=new t});var p=r.extendShape({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(t,e,i){var n=o(t,e,i),r=this.shape;return r&&"pin"===r.symbolType&&"inside"===e.textPosition&&(n.y=i.y+.4*i.height),n},buildPath:function(t,e,i){var n=e.symbolType;if("none"!==n){var r=f[n];r||(r=f[n="rect"]),d[n](e.x,e.y,e.width,e.height,r.shape),r.buildPath(t,r.shape,i)}}});function g(t,e){if("image"!==this.type){var i=this.style,n=this.shape;n&&"line"===n.symbolType?i.stroke=t:this.__isEmptyBrush?(i.stroke=t,i.fill=e||"#fff"):(i.fill&&(i.fill=t),i.stroke&&(i.stroke=t)),this.dirty(!1)}}e.createSymbol=function(t,e,i,n,o,s,l){var u,h=0===t.indexOf("empty");return h&&(t=t.substr(5,1).toLowerCase()+t.substr(6)),(u=0===t.indexOf("image://")?r.makeImage(t.slice(8),new a(e,i,n,o),l?"center":"cover"):0===t.indexOf("path://")?r.makePath(t.slice(7),{},new a(e,i,n,o),l?"center":"cover"):new p({shape:{symbolType:t,x:e,y:i,width:n,height:o}})).__isEmptyBrush=h,u.setColor=g,u.setColor(s),u}},kQD9:function(t,e,i){var n=i("/gxq"),r={updateSelectedMap:function(t){this._targetList=n.isArray(t)?t.slice():[],this._selectTargetMap=n.reduce(t||[],function(t,e){return t.set(e.name,e),t},n.createHashMap())},select:function(t,e){var i=null!=e?this._targetList[e]:this._selectTargetMap.get(t);"single"===this.get("selectedMode")&&this._selectTargetMap.each(function(t){t.selected=!1}),i&&(i.selected=!0)},unSelect:function(t,e){var i=null!=e?this._targetList[e]:this._selectTargetMap.get(t);i&&(i.selected=!1)},toggleSelected:function(t,e){var i=null!=e?this._targetList[e]:this._selectTargetMap.get(t);if(null!=i)return this[i.selected?"unSelect":"select"](t,e),i.selected},isSelected:function(t,e){var i=null!=e?this._targetList[e]:this._selectTargetMap.get(t);return i&&i.selected}};t.exports=r},kdOt:function(t,e,i){i("4Nz2").__DEV__;var n=i("vXqC"),r=n.makeInner,a=n.getDataItemValue,o=i("zZZ/").getCoordSysDefineBySeries,s=i("/gxq"),l=s.createHashMap,u=s.each,h=s.map,c=s.isArray,d=s.isString,f=s.isObject,p=s.isTypedArray,g=s.isArrayLike,v=s.extend,m=(s.assert,i("rrAD")),y=i("+2Ke"),x=y.SOURCE_FORMAT_ORIGINAL,_=y.SOURCE_FORMAT_ARRAY_ROWS,w=y.SOURCE_FORMAT_OBJECT_ROWS,b=y.SOURCE_FORMAT_KEYED_COLUMNS,S=y.SOURCE_FORMAT_UNKNOWN,M=y.SOURCE_FORMAT_TYPED_ARRAY,A=y.SERIES_LAYOUT_BY_ROW,T=r();function C(t){if(t){var e=l();return h(t,function(t,i){if(null==(t=v({},f(t)?t:{name:t})).name)return t;t.name+="",null==t.displayName&&(t.displayName=t.name);var n=e.get(t.name);return n?t.name+="-"+n.count++:e.set(t.name,{count:1}),t})}}function I(t,e,i,n){if(null==n&&(n=1/0),e===A)for(var r=0;r=0;a--){var o;if(n[a]!==i&&!n[a].ignore&&(o=p(n[a],t,e))&&(!r.topTarget&&(r.topTarget=n[a]),o!==u)){r.target=n[a];break}}return r},processGesture:function(t,e){this._gestureMgr||(this._gestureMgr=new l);var i=this._gestureMgr;"start"===e&&i.clear();var n=i.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if("end"===e&&i.clear(),n){var r=n.type;t.gestureEvent=r,this.dispatchToElement({target:n.target},r,n.event)}}},n.each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){f.prototype[t]=function(e){var i=this.findHover(e.zrX,e.zrY),n=i.target;if("mousedown"===t)this._downEl=n,this._downPoint=[e.zrX,e.zrY],this._upEl=n;else if("mouseup"===t)this._upEl=n;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||r.dist(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,t,e)}}),n.mixin(f,o),n.mixin(f,a);var g=f;t.exports=g},"m/6y":function(t,e,i){var n=i("/gxq"),r=i("wWR3").parsePercent,a=i("qVJQ").isDimensionStacked,o=i("CqCN"),s="__ec_stack_",l="undefined"!=typeof Float32Array?Float32Array:Array;function u(t){return t.get("stack")||s+t.seriesIndex}function h(t){return t.dim+t.index}function c(t,e){var i=[];return e.eachSeriesByType(t,function(t){v(t)&&!m(t)&&i.push(t)}),i}function d(t){var e=[];return n.each(t,function(t){var i=t.getData(),n=t.coordinateSystem.getBaseAxis(),a=n.getExtent(),o="category"===n.type?n.getBandWidth():Math.abs(a[1]-a[0])/i.count(),s=r(t.get("barWidth"),o),l=r(t.get("barMaxWidth"),o),c=t.get("barGap"),d=t.get("barCategoryGap");e.push({bandWidth:o,barWidth:s,barMaxWidth:l,barGap:c,barCategoryGap:d,axisKey:h(n),stackId:u(t)})}),f(e)}function f(t){var e={};n.each(t,function(t,i){var n=t.axisKey,r=t.bandWidth,a=e[n]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},o=a.stacks;e[n]=a;var s=t.stackId;o[s]||a.autoWidthCount++,o[s]=o[s]||{width:0,maxWidth:0};var l=t.barWidth;l&&!o[s].width&&(o[s].width=l,l=Math.min(a.remainedWidth,l),a.remainedWidth-=l);var u=t.barMaxWidth;u&&(o[s].maxWidth=u);var h=t.barGap;null!=h&&(a.gap=h);var c=t.barCategoryGap;null!=c&&(a.categoryGap=c)});var i={};return n.each(e,function(t,e){i[e]={};var a=t.stacks,o=t.bandWidth,s=r(t.categoryGap,o),l=r(t.gap,1),u=t.remainedWidth,h=t.autoWidthCount,c=(u-s)/(h+(h-1)*l);c=Math.max(c,0),n.each(a,function(t,e){var i=t.maxWidth;i&&i.5||(h=.5),{progress:function(t,e){var c,d=t.count,f=new l(2*d),p=new l(d),g=[],v=[],m=0,x=0;for(;null!=(c=t.next());)v[u]=e.get(a,c),v[1-u]=e.get(o,c),g=i.dataToPoint(v,null,g),f[m++]=g[0],f[m++]=g[1],p[x++]=c;e.setLayout({largePoints:f,largeDataIndices:p,barWidth:h,valueAxisStart:y(n,r,!1),valueAxisHorizontal:s})}}}}};function v(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type}function m(t){return t.pipelineContext&&t.pipelineContext.large}function y(t,e,i){return e.toGlobalCoord(e.dataToCoord(0))}e.getLayoutOnAxis=function(t){var e=[],i=t.axis;if("category"===i.type){for(var r=i.getBandWidth(),a=0;a=0?"p":"n",O=w;x&&(o[l][A]||(o[l][A]={p:w,n:w}),O=o[l][A][P]),_?(T=O,C=(k=i.dataToPoint([M,A]))[1]+d,I=k[0]-w,D=f,Math.abs(I)=0?"p":"n",O=b;if(w&&(l[h][T]||(l[h][T]={p:b,n:b}),O=l[h][T][P]),"radius"===p.dim){var L=p.dataToRadius(A)-b,R=n.dataToAngle(T);Math.abs(L)this._ux||y(e-this._yi)>this._uy||this._len<5;return this.addData(l.L,t,e),this._ctx&&i&&(this._needsDash()?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),i&&(this._xi=t,this._yi=e),this},bezierCurveTo:function(t,e,i,n,r,a){return this.addData(l.C,t,e,i,n,r,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,i,n,r,a):this._ctx.bezierCurveTo(t,e,i,n,r,a)),this._xi=r,this._yi=a,this},quadraticCurveTo:function(t,e,i,n){return this.addData(l.Q,t,e,i,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,i,n):this._ctx.quadraticCurveTo(t,e,i,n)),this._xi=i,this._yi=n,this},arc:function(t,e,i,n,r,a){return this.addData(l.A,t,e,i,i,n,r-n,0,a?0:1),this._ctx&&this._ctx.arc(t,e,i,n,r,a),this._xi=g(r)*i+t,this._yi=v(r)*i+e,this},arcTo:function(t,e,i,n,r){return this._ctx&&this._ctx.arcTo(t,e,i,n,r),this},rect:function(t,e,i,n){return this._ctx&&this._ctx.rect(t,e,i,n),this.addData(l.R,t,e,i,n),this},closePath:function(){this.addData(l.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,i),t.closePath()),this._xi=e,this._yi=i,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if(t instanceof Array){this._lineDash=t,this._dashIdx=0;for(var e=0,i=0;ie.length&&(this._expandData(),e=this.data);for(var i=0;i0&&g<=t||h<0&&g>=t||0===h&&(c>0&&v<=e||c<0&&v>=e);)g+=h*(i=o[n=this._dashIdx]),v+=c*i,this._dashIdx=(n+1)%y,h>0&&gl||c>0&&vu||s[n%2?"moveTo":"lineTo"](h>=0?f(g,t):p(g,t),c>=0?f(v,e):p(v,e));h=g-t,c=v-e,this._dashOffset=-m(h*h+c*c)},_dashedBezierTo:function(t,e,i,r,a,o){var s,l,u,h,c,d=this._dashSum,f=this._dashOffset,p=this._lineDash,g=this._ctx,v=this._xi,y=this._yi,x=n.cubicAt,_=0,w=this._dashIdx,b=p.length,S=0;for(f<0&&(f=d+f),f%=d,s=0;s<1;s+=.1)l=x(v,t,i,a,s+.1)-x(v,t,i,a,s),u=x(y,e,r,o,s+.1)-x(y,e,r,o,s),_+=m(l*l+u*u);for(;wf);w++);for(s=(S-f)/_;s<=1;)h=x(v,t,i,a,s),c=x(y,e,r,o,s),w%2?g.moveTo(h,c):g.lineTo(h,c),s+=p[w]/_,w=(w+1)%b;w%2!=0&&g.lineTo(a,o),l=a-h,u=o-c,this._dashOffset=-m(l*l+u*u)},_dashedQuadraticTo:function(t,e,i,n){var r=i,a=n;i=(i+2*t)/3,n=(n+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,i,n,r,a)},toStatic:function(){var t=this.data;t instanceof Array&&(t.length=this._len,x&&(this.data=new Float32Array(t)))},getBoundingRect:function(){u[0]=u[1]=c[0]=c[1]=Number.MAX_VALUE,h[0]=h[1]=d[0]=d[1]=-Number.MAX_VALUE;for(var t=this.data,e=0,i=0,n=0,s=0,f=0;fu||y(o-r)>h||d===c-1)&&(t.lineTo(a,o),n=a,r=o);break;case l.C:t.bezierCurveTo(s[d++],s[d++],s[d++],s[d++],s[d++],s[d++]),n=s[d-2],r=s[d-1];break;case l.Q:t.quadraticCurveTo(s[d++],s[d++],s[d++],s[d++]),n=s[d-2],r=s[d-1];break;case l.A:var p=s[d++],m=s[d++],x=s[d++],_=s[d++],w=s[d++],b=s[d++],S=s[d++],M=s[d++],A=x>_?x:_,T=x>_?1:x/_,C=x>_?_/x:1,I=w+b;Math.abs(x-_)>.001?(t.translate(p,m),t.rotate(S),t.scale(T,C),t.arc(0,0,A,w,I,1-M),t.scale(1/T,1/C),t.rotate(-S),t.translate(-p,-m)):t.arc(p,m,A,w,I,1-M),1===d&&(e=g(w)*x+p,i=v(w)*_+m),n=g(I)*x+p,r=v(I)*_+m;break;case l.R:e=n=s[d],i=r=s[d+1],t.rect(s[d++],s[d++],s[d++],s[d++]);break;case l.Z:t.closePath(),n=e,r=i}}}},_.CMD=l;var w=_;t.exports=w},mvCM:function(t,e,i){var n=i("/gxq"),r=n.each,a=n.createHashMap,o=(n.assert,i("4Nz2").__DEV__,a(["tooltip","label","itemName","itemId","seriesName"]));function s(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}e.OTHER_DIMENSIONS=o,e.summarizeDimensions=function(t){var e={},i=e.encode={},n=a(),l=[],u=[],h=e.userOutput={dimensionNames:t.dimensions.slice(),encode:{}};r(t.dimensions,function(e){var r,a=t.getDimensionInfo(e),c=a.coordDim;if(c){var d=a.coordDimIndex;s(i,c)[d]=e,a.isExtraCoord||(n.set(c,1),"ordinal"!==(r=a.type)&&"time"!==r&&(l[0]=e),s(h.encode,c)[d]=a.index),a.defaultTooltip&&u.push(e)}o.each(function(t,e){var n=s(i,e),r=a.otherDims[e];null!=r&&!1!==r&&(n[r]=a.name)})});var c=[],d={};n.each(function(t,e){var n=i[e];d[e]=n[0],c=c.concat(n)}),e.dataDimsOnCoord=c,e.encodeFirstDimNotExtra=d;var f=i.label;f&&f.length&&(l=f.slice());var p=i.tooltip;return p&&p.length?u=p.slice():u.length||(u=l.slice()),i.defaultedLabel=l,i.defaultedTooltip=u,e},e.getDimensionTypeByAxis=function(t){return"category"===t?"ordinal":"time"===t?"time":"float"}},n5nI:function(t,e,i){var n=i("wRzc"),r={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var i=t.getData(),r=(t.visualColorAccessPath||"itemStyle.color").split("."),a=t.get(r)||t.getColorFromPalette(t.name,null,e.getSeriesCount());i.setVisual("color",a);var o=(t.visualBorderColorAccessPath||"itemStyle.borderColor").split("."),s=t.get(o);if(i.setVisual("borderColor",s),!e.isSeriesFiltered(t)){"function"!=typeof a||a instanceof n||i.each(function(e){i.setItemVisual(e,"color",a(t.getDataParams(e)))});return{dataEach:i.hasItemOption?function(t,e){var i=t.getItemModel(e),n=i.get(r,!0),a=i.get(o,!0);null!=n&&t.setItemVisual(e,"color",n),null!=a&&t.setItemVisual(e,"borderColor",a)}:null}}}};t.exports=r},oBGI:function(t,e,i){var n=i("AAi1").quadraticProjectPoint;e.containStroke=function(t,e,i,r,a,o,s,l,u){if(0===s)return!1;var h=s;return!(u>e+h&&u>r+h&&u>o+h||ut+h&&l>i+h&&l>a+h||l=0;){var s=a.indexOf("|}"),l=a.substr(o+"{marker".length,s-o-"{marker".length);l.indexOf("sub")>-1?n["marker"+l]={textWidth:4,textHeight:4,textBorderRadius:2,textBackgroundColor:e[l],textOffset:[3,0]}:n["marker"+l]={textWidth:10,textHeight:10,textBorderRadius:5,textBackgroundColor:e[l]},o=(a=a.substr(s+1)).indexOf("{marker")}this.el=new r({style:{rich:n,text:t,textLineHeight:20,textBackgroundColor:i.get("backgroundColor"),textBorderRadius:i.get("borderRadius"),textFill:i.get("textStyle.color"),textPadding:i.get("padding")},z:i.get("z")}),this._zr.add(this.el);var u=this;this.el.on("mouseover",function(){u._enterable&&(clearTimeout(u._hideTimeout),u._show=!0),u._inContent=!0}),this.el.on("mouseout",function(){u._enterable&&u._show&&u.hideLater(u._hideDelay),u._inContent=!1})},setEnterable:function(t){this._enterable=t},getSize:function(){var t=this.el.getBoundingRect();return[t.width,t.height]},moveTo:function(t,e){this.el&&this.el.attr("position",[t,e])},hide:function(){this.el&&this.el.hide(),this._show=!1},hideLater:function(t){!this._show||this._inContent&&this._enterable||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(n.bind(this.hide,this),t)):this.hide())},isShow:function(){return this._show},getOuterSize:function(){var t=this.getSize();return{width:t[0],height:t[1]}}};var o=a;t.exports=o},pRCB:function(t,e,i){var n=i("kM2E");n(n.S+n.F*!i("+E39"),"Object",{defineProperties:i("qio6")})},qVJQ:function(t,e,i){var n=i("/gxq"),r=n.each,a=n.isString;function o(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}e.enableDataStack=function(t,e,i){var n,o,s,l,u=(i=i||{}).byIndex,h=i.stackedCoordDimension,c=!(!t||!t.get("stack"));if(r(e,function(t,i){a(t)&&(e[i]=t={name:t}),c&&!t.isExtraCoord&&(u||n||!t.ordinalMeta||(n=t),o||"ordinal"===t.type||"time"===t.type||h&&h!==t.coordDim||(o=t))}),!o||u||n||(u=!0),o){s="__\0ecstackresult",l="__\0ecstackedover",n&&(n.createInvertedIndices=!0);var d=o.coordDim,f=o.type,p=0;r(e,function(t){t.coordDim===d&&p++}),e.push({name:s,coordDim:d,coordDimIndex:p,type:f,isExtraCoord:!0,isCalculationCoord:!0}),p++,e.push({name:l,coordDim:l,coordDimIndex:p,type:f,isExtraCoord:!0,isCalculationCoord:!0})}return{stackedDimension:o&&o.name,stackedByDimension:n&&n.name,isStackedByIndex:u,stackedOverDimension:l,stackResultDimension:s}},e.isDimensionStacked=o,e.getStackedDimension=function(t,e){return o(t,e)?t.getCalculationInfo("stackResultDimension"):e}},qjrH:function(t,e,i){var n=i("/gxq"),r=n.retrieve2,a=n.retrieve3,o=n.each,s=n.normalizeCssArray,l=n.isString,u=n.isObject,h=i("3h1/"),c=i("Sm9T"),d=i("+Y0c"),f=i("9b8q"),p=i("28kU"),g=p.ContextCachedBy,v=p.WILL_BE_RESTORED,m=h.DEFAULT_FONT,y={left:1,right:1,center:1},x={top:1,bottom:1,middle:1},_=[["textShadowBlur","shadowBlur",0],["textShadowOffsetX","shadowOffsetX",0],["textShadowOffsetY","shadowOffsetY",0],["textShadowColor","shadowColor","transparent"]],w={},b={};function S(t){if(t){t.font=h.makeFont(t);var e=t.textAlign;"middle"===e&&(e="center"),t.textAlign=null==e||y[e]?e:"left";var i=t.textVerticalAlign||t.textBaseline;"center"===i&&(i="middle"),t.textVerticalAlign=null==i||x[i]?i:"top",t.textPadding&&(t.textPadding=s(t.textPadding))}}function M(t,e,i,n,r){if(i&&e.textRotation){var a=e.textOrigin;"center"===a?(n=i.width/2+i.x,r=i.height/2+i.y):a&&(n=a[0]+i.x,r=a[1]+i.y),t.translate(n,r),t.rotate(-e.textRotation),t.translate(-n,-r)}}function A(t,e,i,n,o,s,l,u){var h=n.rich[i.styleName]||{};h.text=i.text;var c=i.textVerticalAlign,d=s+o/2;"top"===c?d=s+i.height/2:"bottom"===c&&(d=s+o-i.height/2),!i.isLineHolder&&T(h)&&C(t,e,h,"right"===u?l-i.width:"center"===u?l-i.width/2:l,d-i.height/2,i.width,i.height);var f=i.textPadding;f&&(l=R(l,u,f),d-=i.height/2-f[2]-i.textHeight/2),k(e,"shadowBlur",a(h.textShadowBlur,n.textShadowBlur,0)),k(e,"shadowColor",h.textShadowColor||n.textShadowColor||"transparent"),k(e,"shadowOffsetX",a(h.textShadowOffsetX,n.textShadowOffsetX,0)),k(e,"shadowOffsetY",a(h.textShadowOffsetY,n.textShadowOffsetY,0)),k(e,"textAlign",u),k(e,"textBaseline","middle"),k(e,"font",i.font||m);var p=P(h.textStroke||n.textStroke,v),g=O(h.textFill||n.textFill),v=r(h.textStrokeWidth,n.textStrokeWidth);p&&(k(e,"lineWidth",v),k(e,"strokeStyle",p),e.strokeText(i.text,l,d)),g&&(k(e,"fillStyle",g),e.fillText(i.text,l,d))}function T(t){return!!(t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor)}function C(t,e,i,n,r,a,o){var s=i.textBackgroundColor,h=i.textBorderWidth,f=i.textBorderColor,p=l(s);if(k(e,"shadowBlur",i.textBoxShadowBlur||0),k(e,"shadowColor",i.textBoxShadowColor||"transparent"),k(e,"shadowOffsetX",i.textBoxShadowOffsetX||0),k(e,"shadowOffsetY",i.textBoxShadowOffsetY||0),p||h&&f){e.beginPath();var g=i.textBorderRadius;g?c.buildPath(e,{x:n,y:r,width:a,height:o,r:g}):e.rect(n,r,a,o),e.closePath()}if(p)if(k(e,"fillStyle",s),null!=i.fillOpacity){var v=e.globalAlpha;e.globalAlpha=i.fillOpacity*i.opacity,e.fill(),e.globalAlpha=v}else e.fill();else if(u(s)){var m=s.image;(m=d.createOrUpdateImage(m,null,t,I,s))&&d.isImageReady(m)&&e.drawImage(m,n,r,a,o)}if(h&&f)if(k(e,"lineWidth",h),k(e,"strokeStyle",f),null!=i.strokeOpacity){v=e.globalAlpha;e.globalAlpha=i.strokeOpacity*i.opacity,e.stroke(),e.globalAlpha=v}else e.stroke()}function I(t,e){e.image=t}function D(t,e,i,n){var r=i.x||0,a=i.y||0,o=i.textAlign,s=i.textVerticalAlign;if(n){var l=i.textPosition;if(l instanceof Array)r=n.x+L(l[0],n.width),a=n.y+L(l[1],n.height);else{var u=e&&e.calculateTextPosition?e.calculateTextPosition(w,i,n):h.calculateTextPosition(w,i,n);r=u.x,a=u.y,o=o||u.textAlign,s=s||u.textVerticalAlign}var c=i.textOffset;c&&(r+=c[0],a+=c[1])}return(t=t||{}).baseX=r,t.baseY=a,t.textAlign=o,t.textVerticalAlign=s,t}function k(t,e,i){return t[e]=f(t,e,i),t[e]}function P(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function O(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function L(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function R(t,e,i){return"right"===e?t-i[1]:"center"===e?t+i[3]/2-i[1]/2:t+i[3]}e.normalizeTextStyle=function(t){return S(t),o(t.rich,S),t},e.renderText=function(t,e,i,n,r,a){n.rich?function(t,e,i,n,r,a){a!==v&&(e.__attrCachedBy=g.NONE);var o=t.__textCotentBlock;o&&!t.__dirtyText||(o=t.__textCotentBlock=h.parseRichText(i,n)),function(t,e,i,n,r){var a=i.width,o=i.outerWidth,s=i.outerHeight,l=n.textPadding,u=D(b,t,n,r),c=u.baseX,d=u.baseY,f=u.textAlign,p=u.textVerticalAlign;M(e,n,r,c,d);var g=h.adjustTextX(c,o,f),v=h.adjustTextY(d,s,p),m=g,y=v;l&&(m+=l[3],y+=l[0]);var x=m+a;T(n)&&C(t,e,n,g,v,o,s);for(var _=0;_=0&&"right"===(w=I[z]).textAlign;)A(t,e,w,n,P,y,E,"right"),O-=w.width,E-=w.width,z--;for(R+=(a-(R-m)-(x-E)-O)/2;L<=z;)w=I[L],A(t,e,w,n,P,y,R+w.width/2,"center"),R+=w.width,L++;y+=P}}(t,e,o,n,r)}(t,e,i,n,r,a):function(t,e,i,n,r,a){"use strict";var o,s=T(n),l=!1,u=e.__attrCachedBy===g.PLAIN_TEXT;a!==v?(a&&(o=a.style,l=!s&&u&&o),e.__attrCachedBy=s?g.NONE:g.PLAIN_TEXT):u&&(e.__attrCachedBy=g.NONE);var c=n.font||m;l&&c===(o.font||m)||(e.font=c);var d=t.__computedFont;t.__styleFont!==c&&(t.__styleFont=c,d=t.__computedFont=e.font);var p=n.textPadding,y=n.textLineHeight,x=t.__textCotentBlock;x&&!t.__dirtyText||(x=t.__textCotentBlock=h.parsePlainText(i,d,p,y,n.truncate));var w=x.outerHeight,S=x.lines,A=x.lineHeight,I=D(b,t,n,r),k=I.baseX,L=I.baseY,E=I.textAlign||"left",z=I.textVerticalAlign;M(e,n,r,k,L);var N=h.adjustTextY(L,w,z),B=k,F=N;if(s||p){var H=h.getWidth(i,d),V=H;p&&(V+=p[1]+p[3]);var q=h.adjustTextX(k,V,E);s&&C(t,e,n,q,N,V,w),p&&(B=R(k,E,p),F+=p[0])}e.textAlign=E,e.textBaseline="middle",e.globalAlpha=n.opacity||1;for(var W=0;W<_.length;W++){var G=_[W],Y=G[0],U=G[1],X=n[Y];l&&X===o[Y]||(e[U]=f(e,U,X||G[2]))}F+=A/2;var j=n.textStrokeWidth,Z=l?o.textStrokeWidth:null,J=!l||j!==Z,K=!l||J||n.textStroke!==o.textStroke,Q=P(n.textStroke,j),$=O(n.textFill);if(Q&&(J&&(e.lineWidth=j),K&&(e.strokeStyle=Q)),$&&(l&&n.textFill===o.textFill||(e.fillStyle=$)),1===S.length)Q&&e.strokeText(S[0],B,F),$&&e.fillText(S[0],B,F);else for(var W=0;W3&&(r=i.call(r,1));for(var o=e.length,s=0;s4&&(r=i.call(r,1,r.length-1));for(var o=r[r.length-1],s=e.length,l=0;l{i[t]=e[t]}),i}function p(t,e,i){return(window.getComputedStyle(t,i||null)||{display:"none"})[e]}function g(t){if(!document.documentElement.contains(t))return{detached:!0,rendered:!1};let e=t;for(;e!==document;){if("none"===p(e,"display"))return{detached:!1,rendered:!1};e=e.parentNode}return{detached:!1,rendered:!0}}var v='.resize-triggers{visibility:hidden;opacity:0}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}';let m=0,y=null;function x(t,e){if(t.__resize_mutation_handler__||(t.__resize_mutation_handler__=function(){let{rendered:t,detached:e}=g(this);t!==this.__resize_rendered__&&(!e&&this.__resize_triggers__&&(b(this),this.addEventListener("scroll",_,!0)),this.__resize_rendered__=t,w(this))}.bind(t)),!t.__resize_listeners__)if(t.__resize_listeners__=[],window.ResizeObserver){let{offsetWidth:e,offsetHeight:i}=t,n=new ResizeObserver(()=>{(t.__resize_observer_triggered__||(t.__resize_observer_triggered__=!0,t.offsetWidth!==e||t.offsetHeight!==i))&&w(t)}),{detached:r,rendered:a}=g(t);t.__resize_observer_triggered__=!1===r&&!1===a,t.__resize_observer__=n,n.observe(t)}else if(t.attachEvent&&t.addEventListener)t.__resize_legacy_resize_handler__=function(){w(t)},t.attachEvent("onresize",t.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",t.__resize_mutation_handler__);else if(m||(y=function(t){var e=document.createElement("style");return e.type="text/css",e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t)),(document.querySelector("head")||document.body).appendChild(e),e}(v)),function(t){let e=p(t,"position");e&&"static"!==e||(t.style.position="relative");t.__resize_old_position__=e,t.__resize_last__={};let i=f("div",{className:"resize-triggers"}),n=f("div",{className:"resize-expand-trigger"}),r=f("div"),a=f("div",{className:"resize-contract-trigger"});n.appendChild(r),i.appendChild(n),i.appendChild(a),t.appendChild(i),t.__resize_triggers__={triggers:i,expand:n,expandChild:r,contract:a},b(t),t.addEventListener("scroll",_,!0),t.__resize_last__={width:t.offsetWidth,height:t.offsetHeight}}(t),t.__resize_rendered__=g(t).rendered,window.MutationObserver){let e=new MutationObserver(t.__resize_mutation_handler__);e.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),t.__resize_mutation_observer__=e}t.__resize_listeners__.push(e),m++}function _(){var t,e;b(this),this.__resize_raf__&&(t=this.__resize_raf__,d||(d=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(t){clearTimeout(t)}).bind(window)),d(t)),this.__resize_raf__=(e=(()=>{let t=function(t){let{width:e,height:i}=t.__resize_last__,{offsetWidth:n,offsetHeight:r}=t;return n!==e||r!==i?{width:n,height:r}:null}(this);t&&(this.__resize_last__=t,w(this))}),c||(c=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){return setTimeout(t,16)}).bind(window)),c(e))}function w(t){t&&t.__resize_listeners__&&t.__resize_listeners__.forEach(e=>{e.call(t)})}function b(t){let{expand:e,expandChild:i,contract:n}=t.__resize_triggers__,{scrollWidth:r,scrollHeight:a}=n,{offsetWidth:o,offsetHeight:s,scrollWidth:l,scrollHeight:u}=e;n.scrollLeft=r,n.scrollTop=a,i.style.width=o+1+"px",i.style.height=s+1+"px",e.scrollLeft=l,e.scrollTop=u}var S=["legendselectchanged","legendselected","legendunselected","legendscroll","datazoom","datarangeselected","timelinechanged","timelineplaychanged","restore","dataviewchanged","magictypechanged","geoselectchanged","geoselected","geounselected","pieselectchanged","pieselected","pieunselected","mapselectchanged","mapselected","mapunselected","axisareaselected","focusnodeadjacency","unfocusnodeadjacency","brush","brushselected","rendered","finished","click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"],M=["theme","initOptions","autoresize"],A=["manualUpdate","watchShallow"],T={props:{options:Object,theme:[String,Object],initOptions:Object,group:String,autoresize:Boolean,watchShallow:Boolean,manualUpdate:Boolean},data:function(){return{lastArea:0}},watch:{group:function(t){this.chart.group=t}},methods:{mergeOptions:function(t,e,i){this.manualUpdate&&(this.manualOptions=t),this.chart?this.delegateMethod("setOption",t,e,i):this.init()},appendData:function(t){this.delegateMethod("appendData",t)},resize:function(t){this.delegateMethod("resize",t)},dispatchAction:function(t){this.delegateMethod("dispatchAction",t)},convertToPixel:function(t,e){return this.delegateMethod("convertToPixel",t,e)},convertFromPixel:function(t,e){return this.delegateMethod("convertFromPixel",t,e)},containPixel:function(t,e){return this.delegateMethod("containPixel",t,e)},showLoading:function(t,e){this.delegateMethod("showLoading",t,e)},hideLoading:function(){this.delegateMethod("hideLoading")},getDataURL:function(t){return this.delegateMethod("getDataURL",t)},getConnectedDataURL:function(t){return this.delegateMethod("getConnectedDataURL",t)},clear:function(){this.delegateMethod("clear")},dispose:function(){this.delegateMethod("dispose")},delegateMethod:function(t){var e;this.chart||this.init();for(var i=arguments.length,n=Array(i>1?i-1:0),r=1;re[1]&&(e[1]=t[1]),l.prototype.setExtent.call(this,e[0],e[1])},getInterval:function(){return this._interval},setInterval:function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=o.getIntervalPrecision(t)},getTicks:function(){return o.intervalScaleGetTicks(this._interval,this._extent,this._niceExtent,this._intervalPrecision)},getLabel:function(t,e){if(null==t)return"";var i=e&&e.precision;return null==i?i=n.getPrecisionSafe(t)||0:"auto"===i&&(i=this._intervalPrecision),t=s(t,i,!0),r.addCommas(t)},niceTicks:function(t,e,i){t=t||5;var n=this._extent,r=n[1]-n[0];if(isFinite(r)){r<0&&(r=-r,n.reverse());var a=o.intervalScaleNiceTicks(n,t,e,i);this._intervalPrecision=a.intervalPrecision,this._interval=a.interval,this._niceExtent=a.niceTickExtent}},niceExtent:function(t){var e=this._extent;if(e[0]===e[1])if(0!==e[0]){var i=e[0];t.fixMax?e[0]-=i/2:(e[1]+=i/2,e[0]-=i/2)}else e[1]=1;var n=e[1]-e[0];isFinite(n)||(e[0]=0,e[1]=1),this.niceTicks(t.splitNumber,t.minInterval,t.maxInterval);var r=this._interval;t.fixMin||(e[0]=s(Math.floor(e[0]/r)*r)),t.fixMax||(e[1]=s(Math.ceil(e[1]/r)*r))}});l.create=function(){return new l};var u=l;t.exports=u},taS8:function(t,e,i){var n=i("qjrH"),r=i("8b51"),a=i("28kU").WILL_BE_RESTORED,o=new r,s=function(){};s.prototype={constructor:s,drawRectText:function(t,e){var i=this.style;e=i.textRect||e,this.__dirty&&n.normalizeTextStyle(i,!0);var r=i.text;if(null!=r&&(r+=""),n.needDrawText(r,i)){t.save();var s=this.transform;i.transformText?this.setTransform(t):s&&(o.copy(e),o.applyTransform(s),e=o),n.renderText(this,t,r,i,e,a),t.restore()}}};var l=s;t.exports=l},thE4:function(t,e,i){var n=i("/gxq").inherits,r=i("9qnA"),a=i("8b51");function o(t){r.call(this,t),this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.notClear=!0}o.prototype.incremental=!0,o.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.dirty(),this.notClear=!1},o.prototype.addDisplayable=function(t,e){e?this._temporaryDisplayables.push(t):this._displayables.push(t),this.dirty()},o.prototype.addDisplayables=function(t,e){e=e||!1;for(var i=0;i0?i=n[0]:n[1]<0&&(i=n[1]),i}(s,i),u=o.dim,h=s.dim,c=e.mapDimension(h),d=e.mapDimension(u),f="x"===h||"radius"===h?1:0,p=r(t.dimensions,function(t){return e.mapDimension(t)}),g=e.getCalculationInfo("stackResultDimension");return(a|=n(e,p[0]))&&(p[0]=g),(a|=n(e,p[1]))&&(p[1]=g),{dataDimsForPoint:p,valueStart:l,valueAxisDim:h,baseAxisDim:u,stacked:!!a,valueDim:c,baseDim:d,baseDataOffset:f,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}},e.getStackedOnPoint=function(t,e,i,n){var r=NaN;t.stacked&&(r=i.get(i.getCalculationInfo("stackedOverDimension"),n)),isNaN(r)&&(r=t.valueStart);var a=t.baseDataOffset,o=[];return o[a]=i.get(t.baseDim,n),o[1-a]=r,e.dataToPoint(o)}},"u+XU":function(t,e){e.containStroke=function(t,e,i,n,r,a,o){if(0===r)return!1;var s=r,l=0;if(o>e+s&&o>n+s||ot+s&&a>i+s||a=i.length&&i.push({option:t})}}),i},e.makeIdAndName=function(t){var e=n.createHashMap();a(t,function(t,i){var n=t.exist;n&&e.set(n.id,t)}),a(t,function(t,i){var r=t.option;n.assert(!r||null==r.id||!e.get(r.id)||e.get(r.id)===t,"id duplicates: "+(r&&r.id)),r&&null!=r.id&&e.set(r.id,t),!t.keyInfo&&(t.keyInfo={})}),a(t,function(t,i){var n=t.exist,r=t.option,a=t.keyInfo;if(o(r)){if(a.name=null!=r.name?r.name+"":n?n.name:l+i,n)a.id=n.id;else if(null!=r.id)a.id=r.id+"";else{var s=0;do{a.id="\0"+a.name+"\0"+s++}while(e.get(a.id))}e.set(a.id,t)}})},e.isNameSpecified=function(t){var e=t.name;return!(!e||!e.indexOf(l))},e.isIdInner=h,e.compressBatches=function(t,e){var i={},n={};return r(t||[],i),r(e||[],n,i),[a(i),a(n)];function r(t,e,i){for(var n=0,r=t.length;ng[1]?-1:1,m=["start"===s?g[0]-v*p:"end"===s?g[1]+v*p:(g[0]+g[1])/2,T(s)?t.labelOffset+h*p:0],x=e.get("nameRotate");null!=x&&(x=x*y/180),T(s)?n=b(t.rotation,null!=x?x:t.rotation,h):(n=function(t,e,i,n){var r,a,o=f(i-t.rotation),s=n[0]>n[1],l="start"===e&&!s||"start"!==e&&s;d(o-y/2)?(a=l?"bottom":"top",r="center"):d(o-1.5*y)?(a=l?"top":"bottom",r="center"):(a="middle",r=o<1.5*y&&o>y/2?l?"left":"right":l?"right":"left");return{rotation:o,textAlign:r,textVerticalAlign:a}}(t,s,x||0,g),null!=(a=t.axisNameAvailableWidth)&&(a=Math.abs(a/Math.sin(n.rotation)),!isFinite(a)&&(a=null)));var _=c.getFont(),M=e.get("nameTruncate",!0)||{},A=M.ellipsis,C=r(t.nameTruncateMaxWidth,M.maxWidth,a),I=null!=A&&null!=C?l.truncateText(i,C,_,A,{minChar:2,placeholder:M.placeholder}):i,D=e.get("tooltip",!0),k=e.mainType,P={componentType:k,name:i,$vars:["name"]};P[k+"Index"]=e.componentIndex;var O=new u.Text({anid:"name",__fullText:i,__truncatedText:I,position:m,rotation:n.rotation,silent:S(e),z2:1,tooltip:D&&D.show?o({content:i,formatter:function(){return i},formatterParams:P},D):null});u.setTextStyle(O.style,c,{text:I,textFont:_,textFill:c.getTextColor()||e.get("axisLine.lineStyle.color"),textAlign:c.get("align")||n.textAlign,textVerticalAlign:c.get("verticalAlign")||n.textVerticalAlign}),e.get("triggerEvent")&&(O.eventData=w(e),O.eventData.targetType="axisName",O.eventData.name=i),this._dumbGroup.add(O),O.updateTransform(),this.group.add(O),O.decomposeTransform()}}},w=x.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},b=x.innerTextLayout=function(t,e,i){var n,r,a=f(e-t);return d(a)?(r=i>0?"top":"bottom",n="center"):d(a-y)?(r=i>0?"bottom":"top",n="center"):(r="middle",n=a>0&&a0?"right":"left":i>0?"left":"right"),{rotation:a,textAlign:n,textVerticalAlign:r}};var S=x.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)};function M(t){t&&(t.ignore=!0)}function A(t,e,i){var n=t&&t.getBoundingRect().clone(),r=e&&e.getBoundingRect().clone();if(n&&r){var a=g.identity([]);return g.rotate(a,a,-t.rotation),n.applyTransform(g.mul([],a,t.getLocalTransform())),r.applyTransform(g.mul([],a,e.getLocalTransform())),n.intersect(r)}}function T(t){return"middle"===t||"center"===t}var C=x;t.exports=C},vub9:function(t,e,i){var n=i("/gxq"),r=n.each,a=n.map,o=n.isFunction,s=n.createHashMap,l=n.noop,u=i("gV7x").createTask,h=i("h0jU").getUID,c=i("Rtf0"),d=i("uJBW"),f=i("vXqC").normalizeToArray;function p(t,e,i,n){this.ecInstance=t,this.api=e,this.unfinished;i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice();this._allHandlers=i.concat(n),this._stageTaskMap=s()}var g=p.prototype;function v(t,e,i,n,a){var o;function s(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}a=a||{},r(e,function(e,r){if(!a.visualType||a.visualType===e.visualType){var l=t._stageTaskMap.get(e.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each(function(t){s(a,t)&&(t.dirty(),c=!0)}),c&&h.dirty(),m(h,n);var f=t.getPerformArgs(h,a.block);d.each(function(t){t.perform(f)}),o|=h.perform(f)}else u&&u.each(function(r,l){s(a,r)&&r.dirty();var u=t.getPerformArgs(r,a.block);u.skip=!e.performRawSeries&&i.isSeriesFiltered(r.context.model),m(r,n),o|=r.perform(u)})}}),t.unfinished|=o}g.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each(function(t){var e=t.overallTask;e&&e.dirty()})},g.getPerformArgs=function(t,e){if(t.__pipeline){var i=this._pipelineMap.get(t.__pipeline.id),n=i.context,r=!e&&i.progressiveEnabled&&(!n||n.progressiveRender)&&t.__idxInPipeline>i.blockIndex?i.step:null,a=n&&n.modDataCount;return{step:r,modBy:null!=a?Math.ceil(a/r):null,modDataCount:a}}},g.getPipeline=function(t){return this._pipelineMap.get(t)},g.updateStreamModes=function(t,e){var i=this._pipelineMap.get(t.uid),n=t.getData().count(),r=i.progressiveEnabled&&e.incrementalPrepareRender&&n>=i.threshold,a=t.get("large")&&n>=t.get("largeThreshold"),o="mod"===t.get("progressiveChunkMode")?n:null;t.pipelineContext=i.context={progressiveRender:r,modDataCount:o,large:a}},g.restorePipelines=function(t){var e=this,i=e._pipelineMap=s();t.eachSeries(function(t){var n=t.getProgressive(),r=t.uid;i.set(r,{id:r,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:n&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(n||700),count:0}),C(e,t,t.dataTask)})},g.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.ecInstance.getModel(),i=this.api;r(this._allHandlers,function(n){var a=t.get(n.uid)||t.set(n.uid,[]);n.reset&&function(t,e,i,n,r){var a=i.seriesTaskMap||(i.seriesTaskMap=s()),o=e.seriesType,l=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(h):o?n.eachRawSeriesByType(o,h):l&&l(n,r).each(h);function h(i){var o=i.uid,s=a.get(o)||a.set(o,u({plan:b,reset:S,count:T}));s.context={model:i,ecModel:n,api:r,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:t},C(t,i,s)}var c=t._pipelineMap;a.each(function(t,e){c.get(e)||(t.dispose(),a.removeKey(e))})}(this,n,a,e,i),n.overallReset&&function(t,e,i,n,a){var o=i.overallTask=i.overallTask||u({reset:y});o.context={ecModel:n,api:a,overallReset:e.overallReset,scheduler:t};var l=o.agentStubMap=o.agentStubMap||s(),h=e.seriesType,c=e.getTargetSeries,d=!0,f=e.modifyOutputEnd;h?n.eachRawSeriesByType(h,p):c?c(n,a).each(p):(d=!1,r(n.getSeries(),p));function p(e){var i=e.uid,n=l.get(i);n||(n=l.set(i,u({reset:x,onDirty:w})),o.dirty()),n.context={model:e,overallProgress:d,modifyOutputEnd:f},n.agent=o,n.__block=d,C(t,e,n)}var g=t._pipelineMap;l.each(function(t,e){g.get(e)||(t.dispose(),o.dirty(),l.removeKey(e))})}(this,n,a,e,i)},this)},g.prepareView=function(t,e,i,n){var r=t.renderTask,a=r.context;a.model=e,a.ecModel=i,a.api=n,r.__block=!t.incrementalPrepareRender,C(this,e,r)},g.performDataProcessorTasks=function(t,e){v(this,this._dataProcessorHandlers,t,e,{block:!0})},g.performVisualTasks=function(t,e,i){v(this,this._visualHandlers,t,e,i)},g.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e|=t.dataTask.perform()}),this.unfinished|=e},g.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})};var m=g.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)};function y(t){t.overallReset(t.ecModel,t.api,t.payload)}function x(t,e){return t.overallProgress&&_}function _(){this.agent.dirty(),this.getDownstream().dirty()}function w(){this.agent&&this.agent.dirty()}function b(t){return t.plan&&t.plan(t.model,t.ecModel,t.api,t.payload)}function S(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=f(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?a(e,function(t,e){return A(e)}):M}var M=A(0);function A(t){return function(e,i){var n=i.data,r=i.resetDefines[t];if(r&&r.dataEach)for(var a=e.start;a1e-4)return p[0]=t-i,p[1]=e-r,g[0]=t+i,void(g[1]=e+r);if(h[0]=l(a)*i+t,h[1]=s(a)*r+e,c[0]=l(o)*i+t,c[1]=s(o)*r+e,v(p,h,c),m(g,h,c),(a%=u)<0&&(a+=u),(o%=u)<0&&(o+=u),a>o&&!f?o+=u:aa&&(d[0]=l(_)*i+t,d[1]=s(_)*r+e,v(p,d,p),m(g,d,g))}},wW3A:function(t,e,i){var n=i("wWR3"),r=n.round;function a(t){return n.getPrecisionSafe(t)+2}function o(t,e,i){t[e]=Math.max(Math.min(t[e],i[1]),i[0])}function s(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),o(t,0,e),o(t,1,e),t[0]>t[1]&&(t[0]=t[1])}e.intervalScaleNiceTicks=function(t,e,i,o){var l={},u=t[1]-t[0],h=l.interval=n.nice(u/e,!0);null!=i&&ho&&(h=l.interval=o);var c=l.intervalPrecision=a(h);return s(l.niceTickExtent=[r(Math.ceil(t[0]/h)*h,c),r(Math.floor(t[1]/h)*h,c)],t),l},e.getIntervalPrecision=a,e.fixExtent=s,e.intervalScaleGetTicks=function(t,e,i,n){var a=[];if(!t)return a;e[0]1e4)return[];return e[1]>(a.length?a[a.length-1]:i[1])&&a.push(e[1]),a}},wWR3:function(t,e,i){var n=i("/gxq"),r=1e-4;var a=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function o(t){return Math.floor(Math.log(t)/Math.LN10)}e.linearMap=function(t,e,i,n){var r=e[1]-e[0],a=i[1]-i[0];if(0===r)return 0===a?i[0]:(i[0]+i[1])/2;if(n)if(r>0){if(t<=e[0])return i[0];if(t>=e[1])return i[1]}else{if(t>=e[0])return i[0];if(t<=e[1])return i[1]}else{if(t===e[0])return i[0];if(t===e[1])return i[1]}return(t-e[0])/r*a+i[0]},e.parsePercent=function(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?(i=t,i.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t;var i},e.round=function(t,e,i){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),i?t:+t},e.asc=function(t){return t.sort(function(t,e){return t-e}),t},e.getPrecision=function(t){if(t=+t,isNaN(t))return 0;for(var e=1,i=0;Math.round(t*e)/e!==t;)e*=10,i++;return i},e.getPrecisionSafe=function(t){var e=t.toString(),i=e.indexOf("e");if(i>0){var n=+e.slice(i+1);return n<0?-n:0}var r=e.indexOf(".");return r<0?0:e.length-1-r},e.getPixelPrecision=function(t,e){var i=Math.log,n=Math.LN10,r=Math.floor(i(t[1]-t[0])/n),a=Math.round(i(Math.abs(e[1]-e[0]))/n),o=Math.min(Math.max(-r+a,0),20);return isFinite(o)?o:20},e.getPercentWithPrecision=function(t,e,i){if(!t[e])return 0;var r=n.reduce(t,function(t,e){return t+(isNaN(e)?0:e)},0);if(0===r)return 0;for(var a=Math.pow(10,i),o=n.map(t,function(t){return(isNaN(t)?0:t)/r*a*100}),s=100*a,l=n.map(o,function(t){return Math.floor(t)}),u=n.reduce(l,function(t,e){return t+e},0),h=n.map(o,function(t,e){return t-l[e]});uc&&(c=h[f],d=f);++l[d],h[d]=0,++u}return l[e]/a},e.MAX_SAFE_INTEGER=9007199254740991,e.remRadian=function(t){var e=2*Math.PI;return(t%e+e)%e},e.isRadianAroundZero=function(t){return t>-r&&t=-20?+t.toFixed(i<0?-i:0):t},e.quantile=function(t,e){var i=(t.length-1)*e+1,n=Math.floor(i),r=+t[n-1],a=i-n;return a?r+a*(t[n]-r):r},e.reformIntervals=function(t){t.sort(function(t,e){return function t(e,i,n){return e.interval[n]=0}},wYzz:function(t,e,i){(function(e){var i="object"==typeof e&&e&&e.Object===Object&&e;t.exports=i}).call(e,i("DuR2"))},xCbH:function(t,e,i){var n=i("/gxq"),r=i("/+sa"),a=i("wWR3"),o=i("tBuv"),s=r.prototype,l=o.prototype,u=a.getPrecisionSafe,h=a.round,c=Math.floor,d=Math.ceil,f=Math.pow,p=Math.log,g=r.extend({type:"log",base:10,$constructor:function(){r.apply(this,arguments),this._originalScale=new o},getTicks:function(){var t=this._originalScale,e=this._extent,i=t.getExtent();return n.map(l.getTicks.call(this),function(n){var r=a.round(f(this.base,n));return r=n===e[0]&&t.__fixMin?v(r,i[0]):r,r=n===e[1]&&t.__fixMax?v(r,i[1]):r},this)},getLabel:l.getLabel,scale:function(t){return t=s.scale.call(this,t),f(this.base,t)},setExtent:function(t,e){var i=this.base;t=p(t)/p(i),e=p(e)/p(i),l.setExtent.call(this,t,e)},getExtent:function(){var t=this.base,e=s.getExtent.call(this);e[0]=f(t,e[0]),e[1]=f(t,e[1]);var i=this._originalScale,n=i.getExtent();return i.__fixMin&&(e[0]=v(e[0],n[0])),i.__fixMax&&(e[1]=v(e[1],n[1])),e},unionExtent:function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=p(t[0])/p(e),t[1]=p(t[1])/p(e),s.unionExtent.call(this,t)},unionExtentFromData:function(t,e){this.unionExtent(t.getApproximateExtent(e))},niceTicks:function(t){t=t||10;var e=this._extent,i=e[1]-e[0];if(!(i===1/0||i<=0)){var n=a.quantity(i);for(t/i*n<=.5&&(n*=10);!isNaN(n)&&Math.abs(n)<1&&Math.abs(n)>0;)n*=10;var r=[a.round(d(e[0]/n)*n),a.round(c(e[1]/n)*n)];this._interval=n,this._niceExtent=r}},niceExtent:function(t){l.niceExtent.call(this,t);var e=this._originalScale;e.__fixMin=t.fixMin,e.__fixMax=t.fixMax}});function v(t,e){return h(t,u(e))}n.each(["contain","normalize"],function(t){g.prototype[t]=function(e){return e=p(e)/p(this.base),s[t].call(this,e)}}),g.create=function(){return new g};var m=g;t.exports=m},"xb/I":function(t,e,i){var n=i("/gxq"),r=i("vXqC"),a=n.each,o=n.isObject,s=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function l(t){var e=t&&t.itemStyle;if(e)for(var i=0,r=s.length;i=this._maxSize&&o>0){var l=i.head;i.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=e:s=new r(e),s.key=t,i.insertEntry(s),n[t]=s}return a},o.get=function(t){var e=this._map[t],i=this._list;if(null!=e)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},o.clear=function(){this._list.clear(),this._map={}};var s=a;t.exports=s},"zZZ/":function(t,e,i){i("4Nz2").__DEV__;var n=i("/gxq"),r=n.createHashMap,a=(n.retrieve,n.each);var o={cartesian2d:function(t,e,i,n){var r=t.getReferringComponents("xAxis")[0],a=t.getReferringComponents("yAxis")[0];e.coordSysDims=["x","y"],i.set("x",r),i.set("y",a),s(r)&&(n.set("x",r),e.firstCategoryDimIndex=0),s(a)&&(n.set("y",a),e.firstCategoryDimIndex=1)},singleAxis:function(t,e,i,n){var r=t.getReferringComponents("singleAxis")[0];e.coordSysDims=["single"],i.set("single",r),s(r)&&(n.set("single",r),e.firstCategoryDimIndex=0)},polar:function(t,e,i,n){var r=t.getReferringComponents("polar")[0],a=r.findAxisModel("radiusAxis"),o=r.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],i.set("radius",a),i.set("angle",o),s(a)&&(n.set("radius",a),e.firstCategoryDimIndex=0),s(o)&&(n.set("angle",o),e.firstCategoryDimIndex=1)},geo:function(t,e,i,n){e.coordSysDims=["lng","lat"]},parallel:function(t,e,i,n){var r=t.ecModel,o=r.getComponent("parallel",t.get("parallelIndex")),l=e.coordSysDims=o.dimensions.slice();a(o.parallelAxisIndex,function(t,a){var o=r.getComponent("parallelAxis",t),u=l[a];i.set(u,o),s(o)&&null==e.firstCategoryDimIndex&&(n.set(u,o),e.firstCategoryDimIndex=a)})}};function s(t){return"category"===t.get("type")}e.getCoordSysDefineBySeries=function(t){var e=t.get("coordinateSystem"),i={coordSysName:e,coordSysDims:[],axisMap:r(),categoryAxisMap:r()},n=o[e];if(n)return n(t,i,i.axisMap,i.categoryAxisMap),i}},zz1u:function(t,e,i){i("ecfp"),i("s48c")}}); \ No newline at end of file diff --git a/public/static/js/1.js b/public/static/js/1.js new file mode 100644 index 0000000..e3c7f2b --- /dev/null +++ b/public/static/js/1.js @@ -0,0 +1 @@ +webpackJsonp([1],{"1NrC":function(t,e){},BdTD:function(t,e){},SunE:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXwAAABQCAYAAAAa/s4zAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAA2YSURBVHja7J1djCRVFcd/NR+LLrhsK6DAssjwoYCo2CAGEKL2mBhijDGzJhpegAzEGI360ANEJOLiTgyIDxB2gGhEjDLR4KvbiRqIhLCtCC4a0YbV4CfQfAhZ2JkpH251dmirbtWtrqqprvr/kg7LdFX17Vtd/3Puueee6/m+jxBCiOozoS4QQggJvhBCCAm+EEIICb4QQggJvhBCCAm+EEIICb4QQggJvhBCCAm+EEIICb4QQkjwhRBCSPCFEEJI8IUQQkjwhRBCSPCFEEJI8IUQQkjwhRBCpGWqyl/Ou+dg4kOBtwOnBP9Osg3YNPA0sA9YyaH508AWYDtwMnAc0AA2A5PAKvAK0Ade8T87fad+zkKI2go+yXdvfCNwFXBFIKRrMcdPAocBtwPXZSz4HjADXAJ8BDgDOCq4VxPBa2CU1oL/fxFILfje3QebgTEJoxsYlXFmHpiLeG92hOu2gD2W63Y26Pva7mcveFUe/9JpKXytBD85W4APA292OOdl4EngQIbt2BoYni8BRwfCHscK8K0RxX5vjAFyFZtdGfbJbAbXaATiXAcaMfdztkSCH3VP+oGjMcxM8Er6207Tpr5/6XRXgl9tD/8E4CTHq/895sFy5Vjg28CnHc+7E7jDWei/f7AVPDzzlsN6QNvhst2YBzlP9qT8XD/G2Nm8+Lj2MIL3307ZD02bmAXvNzPq8z6wNOI9C6MTYejnMnYmXD5bgl8RJoELAy/fhR6wP6M2HA3cAuxwPO9+4GbghRQyl0TEZhwfsIUIz0y4k4ewNTK+bmdEwRcS/MI9/E3AeZhJ0qSsAg8Dz2XQys3AN1KI/VPANcAT+hkLIST4yQT/KOB0xyu/ADzC6JO108BXsIdVwng2EPsHcu6bcWKZ6DBJi+hwz0KCkdyCZQQUde+WiI6V12LSVEjwCxb8RPONTUwM31Vws3hoP4N7rPYgcBPw4wKMYdZEZYg4TcZZBNZGlOAvJmjzouWa8ykMUB3ZRfK5gyavj+93ExhmIcGPPcILflxbHa+8j9Hj9+cC1wKHO573E+BW4lNHXY3hejFuxDycUUIWl765FCGebUaPLdsExWZM4iZXbcc0YtrTj7lunWiSfFK9TllVEvwCBX8KE85xST18DfgNo+Wmb8ekUp7qeN5DmFDOiyN3zWVTkd/Zu2slLjNlNoUnXSZBcW1vK2V78iAqVNS2GKClEUekrZII8DLpkwJsazGGP0OCX1FOA852POcA8NgIQZEtgZd7seN5TwUP9ZNZfHHvrhVbKCkuvNKu48NSEsJCRba1Dz3gygw+twyC77RozL98avBbn0so9kv+5VOVzjqqu4f/PGal7BEJQyQTmMyc+1O2aBITxvmU43nPA18HfpVh34wSQok6t6opmR1L6KFp6YuiVijbJv0XqTHenSszwO4k99i/YurKqvdHtQU/XsKfBn6YuRmJNhaXBQ/ntOPnfRe4u2BjOG7MxoxIooyUN8K1baGvBYqZtLVlCvXrPOry7lhpAPdin2sZjBx21KFPlJZZnPR9Avgq7hPEPwVuIOsCbdUTfFv9mJmUoYpOzDHNmPa4jhiSGJmuo3efxSgjKnbucu2uQ98Pl1ZIO3JMkhnUB3b481N9aoAEvxg+CHwT9/TPvcAXcwkNVE/wd5EuzmybnPYSHGNrT9x1GdEoNGIEP6t4dBYF1xYcfoVdRs9kmifZ+pYF/8qp2qwOl+DnzymYvPl3OJ73D+ALmLBTHn2zEBMCaaTw+HqMnk8v3ETNlpnTjzFYy1SzNEKTZHH7Rf+qqVqVhtDCq3zZAtyIybl34QBwNfBgbl1z1VToZJ532+pu4mOerUAswuLDEvxiBT9SzIZGAs2IcMY4CV7aAnmRjo132+r/ZZz5n5v0qvqDqauHPwm8FVPT3nUB0ySH6tKvr08//MnTmJW0c47XXwG+A/woz67xbl0Ne3DmEg6DB5Nhw/ndcUPjluPfXcirtILtmLSlFbIS+5mEn92JEHyXfm8nGEkICX4pBf8cTJrjVtwDP946kY8T/DTe7kuBeL2ac9/syeAq8yHC2I0R/LzyufMqrWA7ZiNLK7RjjB9Dgt+OMNzNBIY6qixxj5qnfUrwx0PwLwA+WtJWHw6cSd457W5mbhxi83nUwx+1PVGjhVFFsmW5H50QQ9OJuVYSwU9jZIUEv0DCgzVvwsTUfdx3cyqCTcBFmHTM/5ZA8JcCkdpDfuUCoqhrqMBWTK6BfUJyyeL1z0UIvs0ANSyCr5XVEvzSe/jHAGeVVOwHnI/ZAeuJgvsm7IEerD6cDYRmrsB+qGu4IO3OTj2LCHctgp/Gu++iMs8S/DEQ/BNx27t2I3gnsC1nwY+LLw/Xge9jViPuCkSgF+GR9xk9dt0LBMUlZFC2XOqNqD2zGGO8d1na2nEU/I3w7rOcFylLQTgJfnaiFurEN4EjS95yD3g38EvyijGveTuID9GEvd+JeegaGXrmDZKHdcpWL73oVSC9GAM5WDw1E3GfOxH93yqR4DvNGfhfnoh+wG5e2yijLMEv8JHbjNnOcPMYtP5C4Huk2a82Wd8MbzJRRpJs9j3AZYONKpKk8FeH8KyieQeDP7hOGcI5bdtIx7tprVHz30TtBf9YTEnkceACTOjphYL6ZtxJWw9/3BmE3pIYxijBd92svgyTta2INnfWjTDnI47pU9P5obpl6bwXeJvjVVYx5Yn9dVI5/G8/4u9rwX8buIeRjgXehamDn708+4jyMryln22B18kO180q/l0GwZ+x9J3LMRL8Cnv45wNvcbzKz4D7OFStcr2Qr//vWojQH8QsoPoY8HlMSqirF/Nz8liEVT3Br9Kk7fA8iW2BlwuDCfVR21aGdNkZy3dcP+rL0/BJ8Ess+FswC5omHK9yO6PHup8BLsFMxLpwEab8gwQ/nrpP2roI9iiCX5ZQSDOB4Y86prZF/uok+Kdh9pJ14Z9kkxq5H7M1oavgnxQM2X9bsBwtFThsz2qyNemepXUnrXc7qKxZFu/YJuZxIywJfjUF/3VpmWcHAurCXjLYMBx4BXgEE9rZ5HDe4cCHgnOz9RjXrOvOev41Xse7sRAnNavwQIPxmLTdaMEcbL3YiBgljcNkZoPoiq69GIOAf43X9W706zjBXxsPfxJ4H/AGxys8QHZZMg8C/wGOd7w/F2GqZ64W6OG3vJ2FRSTq5GktUo65hmXC5wTGJYUxSWx+xnpMTZMW6iL420iXjvlYhkL7e8ymJsc7nndm0P79RQo+45fimMUK3zy9+g7lmVjuWu77OAt+kgnbrgS/+oJ/RvByYT8mJTIrnsGEZpq41fE5GrNFYpGCP44soeqNLgYojKTlkjeaRgJDZjcKEvwKcigP/1Tc8+8fxkzaZsWrwK8xE4suOflHYtJJfyDBT0wL+w5Ptq0BlzkUB25HiIpNMKPSJ8sUGx/UKoraFKXsgj/KhK08/Ip7+Ifhvp8smAnb5zJu0WOYSWDXRVinYzZUOSjBT0RU5s9AdOcsotAdEvxGyPs7iC4eF7UTla2S5UZ5+VGCX/aJ2zjBj56w/ZqnGH7F2Q68J4U3/mgObXka+BtwguN52zApnUV5Xj2Kq5WSddzYVj/FVXC7Ie1rAn8Z+tv6mj9LhC/nb5VQ8NsF3A9yuL9xIR2tsK2xh39iCsH/Q06C9yzwEPB+x74/DvhApj/YmDx8/3pv0bveL+4uZcdcTBjDVRRdBTCqDPEcyQqcFSn4tj4s6+YmSRZctWJGAPLwKyr4Hmay9gjHM39H1pOkhtcwcwMHHNu0GbOOIMO+8bI5pnxkWb99kUOLdGzC3w8xLM0QzzQPIW1bDFk/xshF7YLVDvleaQzHely2oGyFSLIX9OmcxfNvB8fEe/i+15DgV07wva2YcsiuPBqIch48DvwrhRE6ExOe+msBfvW8d93YpWXuInqyNq3grz/PJa69RPg2hLsxMf64zd5dv7dNjGct70ftgtUE7k34+d4G3OMo7z2u4mfXuy713scS/DHw8I/BlBl24d+YnPm86GEmb092PG8GOKcgwbftqVpWmtgn85IK7Ch1kwax/OUIwR+sBi6Ld7lMuq0Uy0iSEGztY/gTlf52PjP4bA8tYhz9+iM+jzue4/J6CZ+9+Kw4ntfA56zI96tHlguplgp+8PuMxwbfPaqzUXzcPe34NyT6rpU2CtUWfBPOcR1yPoHJpsmT+4A/OZ4zjcnUyWZ7Rr/0r4WMrtPBZ2nob4v49Apofy/D79DPqZ3LY/BbSNI/cX29mPB3X+nFe1UP6Xzcwf/1MDXvHy/AZ94HXI2pkbPN4T6ch6kJ9IsM+qaspQgG+equbQs7Jyr3vR+Ex+aDMFBWIZbhydtzMDHyRorwQ1i4aDfZ17tZIH5Susx0MOsibPV1Fv2diWroLPo7qy34nu9XNz/Ju5Z7Ao94LcHhmzDlD27BLLrKm2ngYuCTwLnAMZjqmIetO+Y1zJqAlzG7bv0ZuDmsff7OXPpP1IeZwDCNS0ijGRjYSOMZ9kx410Ya+K6/szLhrXoKvhBCiENMqAuEEEKCL4QQQoIvhBBCgi+EEEKCL4QQQoIvhBBCgi+EEEKCL4QQQoIvhBBCgi+EEBJ8IYQQEnwhhBASfCGEEBJ8IYQQEnwhhBASfCGEEDnwvwEATXozxFNltx8AAAAASUVORK5CYII="},UqFw:function(t,e,n){t.exports=n.p+"static/img/login_left.2570f69.png"},"aUv+":function(t,e,n){t.exports=n.p+"static/img/login_bg.6875196.png"},q8bm:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n("fZjL"),s=n.n(o),i=n("Dd8w"),r=n.n(i),a=n("SJI6"),l={name:"Login",data:function(){return{loginBg:n("aUv+"),logo:n("SunE"),login_Left:n("UqFw"),loginForm:{username:"",passwd:""},loginRules:{username:[{required:!0,trigger:"blur",validator:function(t,e,n){e?n():n(new Error("请输入账号"))}}],passwd:[{required:!0,trigger:"blur",validator:function(t,e,n){e.length<6?n(new Error("请输入至少6位数的密码")):n()}}]},passwordType:"password",capsTooltip:!1,loading:!1,showDialog:!1,redirect:void 0,otherQuery:{}}},watch:{$route:{handler:function(t){var e=t.query;e&&(this.redirect=e.redirect,this.otherQuery=this.getOtherQuery(e))},immediate:!0}},created:function(){},mounted:function(){""===this.loginForm.username?this.$refs.username.focus():""===this.loginForm.passwd&&this.$refs.passwd.focus()},computed:r()({},Object(a.mapState)({routesItem:function(t){return t.routes}})),methods:r()({},Object(a.mapMutations)(["changeRoutesItem"]),{checkCapslock:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.shiftKey,n=t.key;n&&1===n.length&&(this.capsTooltip=!!(e&&n>="a"&&n<="z"||!e&&n>="A"&&n<="Z")),"CapsLock"===n&&!0===this.capsTooltip&&(this.capsTooltip=!1)},showPwd:function(){var t=this;"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick(function(){t.$refs.password.focus()})},handleLogin:function(){var t=this;this.loading=!0,this.$refs.loginForm.validate(function(e){if(!e)return t.loading=!1,!1;t.$api.base.login(t.loginForm).then(function(e){t.loading=!1,200===e.code&&(window.sessionStorage.setItem("minitk",e.data.token),window.sessionStorage.setItem("ms_username",e.data.user.username),t.$router.push("/"))})})},getOtherQuery:function(t){return s()(t).reduce(function(e,n){return"redirect"!==n&&(e[n]=t[n]),e},{})}})},c={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"lb-login",style:{backgroundImage:"url("+t.loginBg+")"}},[n("div",{staticClass:"login-content"},[n("div",{staticClass:"left-box",style:{backgroundImage:"url("+t.login_Left+")"}}),t._v(" "),n("div",{staticClass:"right-box"},[n("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:t.loginForm,rules:t.loginRules,autocomplete:"on","label-position":"left"},nativeOn:{submit:function(t){t.preventDefault()}}},[n("div",{staticClass:"title-container"},[n("div",{staticClass:"logo-img",style:{backgroundImage:"url("+t.logo+")"}})]),t._v(" "),n("el-form-item",{attrs:{prop:"username"}},[n("span",{staticClass:"svg-container"},[n("i",{staticClass:"iconfont icon-username"})]),t._v(" "),n("el-input",{ref:"username",attrs:{placeholder:"请输入账号",name:"username",type:"text",tabindex:"1",autocomplete:"on"},model:{value:t.loginForm.username,callback:function(e){t.$set(t.loginForm,"username",e)},expression:"loginForm.username"}})],1),t._v(" "),n("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:t.capsTooltip,callback:function(e){t.capsTooltip=e},expression:"capsTooltip"}},[n("el-form-item",{attrs:{prop:"passwd"}},[n("span",{staticClass:"svg-container"},[n("i",{staticClass:"iconfont icon-mima"})]),t._v(" "),n("el-input",{key:t.passwordType,ref:"password",attrs:{type:t.passwordType,placeholder:"请输入密码",name:"passwd",tabindex:"2",autocomplete:"on"},on:{blur:function(e){t.capsTooltip=!1}},nativeOn:{keyup:[function(e){return t.checkCapslock(e)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleLogin(e)}]},model:{value:t.loginForm.passwd,callback:function(e){t.$set(t.loginForm,"passwd",e)},expression:"loginForm.passwd"}})],1)],1),t._v(" "),n("el-button",{staticStyle:{width:"100%",height:"46px",display:"block",margin:"30px auto 0",color:"#fff","border-radius":"4px",background:"linear-gradient(90deg,#19b4f1,#0e73e8)!important"},attrs:{loading:t.loading,type:"primary"},nativeOn:{click:function(e){return e.preventDefault(),t.handleLogin(e)}}},[t._v("登录")])],1)],1)]),t._v(" "),n("div",{staticClass:"lb-footer-html",domProps:{innerHTML:t._s(t.fHtml)}})])},staticRenderFns:[]};var u=n("VU/8")(l,c,!1,function(t){n("BdTD"),n("1NrC")},"data-v-13f88726",null);e.default=u.exports}}); \ No newline at end of file diff --git a/public/static/js/10.js b/public/static/js/10.js new file mode 100644 index 0000000..1d7d6e4 --- /dev/null +++ b/public/static/js/10.js @@ -0,0 +1 @@ +webpackJsonp([10],{hELy:function(e,t){},mi9e:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Xxa5"),n=a.n(r),i=a("mvHQ"),o=a.n(i),l=a("exGp"),s=a.n(l),c={data:function(){return{loading:!1,pickerOptions:{disabledDate:function(e){return e.getTime()>Date.now()}},searchForm:{page:1,limit:10,start_time:"",end_time:"",order_code:""},tableData:[],total:0}},created:function(){this.getTableDataList()},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return s()(n.a.mark(function a(){var r,i,l,s,c;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,r=JSON.parse(o()(t.searchForm)),(i=r.start_time)&&i.length>0?(r.start_time=parseInt(i[0]/1e3),r.end_time=parseInt(i[1]/1e3)+86400-1):(r.start_time="",r.end_time=""),a.next=7,t.$api.stored.orderList(r);case 7:if(l=a.sent,s=l.code,c=l.data,t.loading=!1,200===s){a.next=13;break}return a.abrupt("return");case 13:t.tableData=c.data,t.total=c.total;case 15:case"end":return a.stop()}},a,t)}))()}},filters:{handleTime:function(e,t){return 1===t?moment(1e3*e).format("YYYY-MM-DD"):2===t?moment(1e3*e).format("HH:mm:ss"):moment(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},m={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-finance-stored-order"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"系统订单号",prop:"order_code"}},[a("el-input",{attrs:{placeholder:"请输入系统订单号"},model:{value:e.searchForm.order_code,callback:function(t){e.$set(e.searchForm,"order_code",t)},expression:"searchForm.order_code"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"日期",prop:"start_time"}},[a("el-date-picker",{attrs:{type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"timestamp","picker-options":e.pickerOptions},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.start_time,callback:function(t){e.$set(e.searchForm,"start_time",t)},expression:"searchForm.start_time"}})],1),e._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1)}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("searchForm")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1)],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"id",label:"ID",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{prop:"user_id",label:"客户ID"}}),e._v(" "),a("el-table-column",{attrs:{prop:"nick_name",label:"客户昵称"}}),e._v(" "),a("el-table-column",{attrs:{prop:"title",label:"套餐名称","min-width":"200"}}),e._v(" "),a("el-table-column",{attrs:{prop:"pay_price",label:"实际支付"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.pay_price)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"true_price",label:"充值金额"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.true_price)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"order_code","min-width":"150",label:"系统订单号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"transaction_id","min-width":"150",label:"付款订单号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"create_time",label:"下单时间","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s(e._f("handleTime")(t.row.create_time,1)))]),e._v(" "),a("div",[e._v(e._s(e._f("handleTime")(t.row.create_time,2)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"create_time",label:"支付时间","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("p",[e._v(e._s(e._f("handleTime")(t.row.pay_time,1)))]),e._v(" "),a("p",[e._v(e._s(e._f("handleTime")(t.row.pay_time,2)))])]}}])})],1),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}})],1)],1)},staticRenderFns:[]};var d=a("VU/8")(c,m,!1,function(e){a("nPSV"),a("hELy")},"data-v-1a9c1c62",null);t.default=d.exports},nPSV:function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/100.js b/public/static/js/100.js new file mode 100644 index 0000000..6b7a956 --- /dev/null +++ b/public/static/js/100.js @@ -0,0 +1 @@ +webpackJsonp([100],{iqYD:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=r("mvHQ"),i=r.n(s),a=r("Xxa5"),n=r.n(a),o=r("exGp"),u=r.n(o),l={data:function(){return{navTitle:"",subForm:{id:0,title:"",text:"",type:0,top:0},subFormRules:{title:{required:!0,validator:this.$reg.isNoEmpty,text:"文章标题",reg_type:2,trigger:"blur"},text:{required:!0,type:"string",message:"请输入文章内容",trigger:"blur"},top:{required:!0,type:"number",message:"请输入排序值",trigger:"blur"}}}},created:function(){var t=this;return u()(n.a.mark(function e(){var r;return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.$route.query.id)){e.next=5;break}return t.subForm.id=r,e.next=5,t.getDetail(r);case 5:t.navTitle=t.$t(r?"menu.MediaAboutEdit":"menu.MediaAboutAdd");case 6:case"end":return e.stop()}},e,t)}))()},methods:{getDetail:function(t){var e=this;return u()(n.a.mark(function r(){var s,i,a,o;return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.$api.media.aboutUsInfo({id:t});case 2:if(s=r.sent,i=s.code,a=s.data,200===i){r.next=7;break}return r.abrupt("return");case 7:for(o in e.subForm)e.subForm[o]=a[o];case 8:case"end":return r.stop()}},r,e)}))()},submitFormInfo:function(){var t=this,e=!0;if(this.$refs.subForm.validate(function(t){t||(e=!1)}),e){var r=JSON.parse(i()(this.subForm)),s=r.id?"aboutUsUpdate":"aboutUsAdd";this.$api.media[s](r).then(function(e){200===e.code&&(t.$message.success(t.$t(r.id?"tips.successRev":"tips.successSub")),t.$router.back(-1))})}}}},c={render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"lb-article-edit"},[r("top-nav",{attrs:{title:t.navTitle,isBack:!0}}),t._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",attrs:{model:t.subForm,rules:t.subFormRules,"label-width":"120px"},nativeOn:{submit:function(t){t.preventDefault()}}},[r("el-form-item",{attrs:{label:"文章标题",prop:"title"}},[r("el-input",{attrs:{maxlength:"10","show-word-limit":"",placeholder:"请输入文章标题"},model:{value:t.subForm.title,callback:function(e){t.$set(t.subForm,"title",e)},expression:"subForm.title"}})],1),t._v(" "),r("el-form-item",{attrs:{label:"文章内容",prop:"text"}},[r("lb-ueditor",{attrs:{destroy:!0,ueditorType:"3"},model:{value:t.subForm.text,callback:function(e){t.$set(t.subForm,"text",e)},expression:"subForm.text"}})],1),t._v(" "),r("el-form-item",{attrs:{label:"排序值",prop:"top"}},[r("el-input-number",{staticClass:"lb-input-number",attrs:{controls:!1,precision:0,min:0,placeholder:"请输入排序值"},model:{value:t.subForm.top,callback:function(e){t.$set(t.subForm,"top",e)},expression:"subForm.top"}}),t._v(" "),r("lb-tool-tips",[t._v("值越大, 排序越靠前")])],1),t._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:t.submitFormInfo}},[t._v(t._s(t.$t("action.submit")))]),t._v(" "),r("lb-button",{on:{click:function(e){return t.$router.back(-1)}}},[t._v(t._s(t.$t("action.back")))])],1)],1)],1)],1)},staticRenderFns:[]};var m=r("VU/8")(l,c,!1,function(t){r("wHGe")},"data-v-0323862c",null);e.default=m.exports},wHGe:function(t,e){}}); \ No newline at end of file diff --git a/public/static/js/101.js b/public/static/js/101.js new file mode 100644 index 0000000..078f7fc --- /dev/null +++ b/public/static/js/101.js @@ -0,0 +1 @@ +webpackJsonp([101],{"85cy":function(e,t){},tnLr:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("mvHQ"),s=a.n(r),i=a("Xxa5"),n=a.n(i),o=a("exGp"),l=a.n(o),c={data:function(){return{loading:!1,searchForm:{page:1,limit:10,type:1},tableData:[],total:0,showDialog:!1,subForm:{id:0,title:"",top:0},subFormRules:{title:{required:!0,validator:this.$reg.isNoEmpty,text:"会员等级名称",reg_type:2,trigger:["blur","change"]},top:{required:!0,type:"number",message:"请输入排序值",trigger:"blur"}}}},activated:function(){this.getTableDataList(1)},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return l()(n.a.mark(function a(){var r,s,i;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.custom.memberList(t.searchForm);case 4:if(r=a.sent,s=r.code,i=r.data,t.loading=!1,200===s){a.next=10;break}return a.abrupt("return");case 10:t.tableData=i.data,t.total=i.total;case 12:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return l()(n.a.mark(function r(){return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.custom.memberUpdate({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page0&&void 0!==arguments[0]?arguments[0]:{id:0,title:"",status:1};return l()(n.a.mark(function a(){var r;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:for(r in t=JSON.parse(s()(t)),e.subForm)e.subForm[r]=t[r];e.showDialog=!e.showDialog;case 3:case"end":return a.stop()}},a,e)}))()},submitFormInfo:function(){var e=this;return l()(n.a.mark(function t(){var a,r,i,o;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=!0,e.$refs.subForm.validate(function(e){e||(a=!1)}),!a){t.next=14;break}return r=JSON.parse(s()(e.subForm)),i=r.id?"memberUpdate":"memberAdd",t.next=7,e.$api.custom[i](r);case 7:if(o=t.sent,200===o.code){t.next=11;break}return t.abrupt("return");case 11:e.$message.success(e.$t(e.subForm.id?"tips.successRev":"tips.successSub")),e.showDialog=!1,e.getTableDataList();case 14:case"end":return t.stop()}},t,e)}))()}},filters:{handleTime:function(e,t){return 1===t?moment(1e3*e).format("YYYY-MM-DD"):2===t?moment(1e3*e).format("HH:mm:ss"):moment(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},u={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-custom-level"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("lb-tips",[e._v("会员的积分会按照实际消费金额1:1的比例兑换")]),e._v(" "),a("el-row",{staticClass:"page-top-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-add",expression:"`${$route.name}-add`"}],attrs:{type:"primary",icon:"el-icon-plus"},on:{click:e.toShowDialog}},[e._v(e._s(e.$t("menu.CustomMemberLevelAdd")))])],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"id",label:"ID"}}),e._v(" "),a("el-table-column",{attrs:{prop:"title",label:"会员等级名称"}}),e._v(" "),a("el-table-column",{attrs:{prop:"status",label:"是否上架"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-switch",{attrs:{"active-value":1,"inactive-value":0},on:{change:function(a){return e.updateItem(t.row.id,t.row.status)}},model:{value:t.row.status,callback:function(a){e.$set(t.row,"status",a)},expression:"scope.row.status"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"top",label:"排序值"}}),e._v(" "),a("el-table-column",{attrs:{prop:"create_time",label:"创建时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s(e._f("handleTime")(t.row.create_time,1)))]),e._v(" "),a("div",[e._v(e._s(e._f("handleTime")(t.row.create_time,2)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"table-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-edit",expression:"`${$route.name}-edit`"}],attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(a){return e.toShowDialog(t.row)}}},[e._v(e._s(e.$t("action.edit")))]),e._v(" "),a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-delete",expression:"`${$route.name}-delete`"}],attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(a){return e.confirmDel(t.row.id)}}},[e._v(e._s(e.$t("action.delete")))])],1)]}}])})],1),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}})],1),e._v(" "),a("el-dialog",{attrs:{title:e.$t(e.subForm.id?"menu.CustomMemberLevelEdit":"menu.CustomMemberLevelAdd"),visible:e.showDialog,width:"550px",center:""},on:{"update:visible":function(t){e.showDialog=t}}},[a("el-form",{ref:"subForm",staticClass:"dialog-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"130px"}},[a("el-form-item",{attrs:{label:"会员等级名称",prop:"title"}},[a("el-input",{attrs:{placeholder:"请输入会员等级名称",maxlength:"10","show-word-limit":""},model:{value:e.subForm.title,callback:function(t){e.$set(e.subForm,"title",t)},expression:"subForm.title"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"排序值",prop:"top"}},[a("el-input-number",{staticClass:"lb-input-number",attrs:{controls:!1,precision:0,min:0,placeholder:"请输入排序值"},model:{value:e.subForm.top,callback:function(t){e.$set(e.subForm,"top",t)},expression:"subForm.top"}}),e._v(" "),a("lb-tool-tips",[e._v("值越大, 排序越靠前")])],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.showDialog=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v("确 定")])],1)],1)],1)},staticRenderFns:[]};var m=a("VU/8")(c,u,!1,function(e){a("85cy")},"data-v-0284d6eb",null);t.default=m.exports}}); \ No newline at end of file diff --git a/public/static/js/11.js b/public/static/js/11.js new file mode 100644 index 0000000..00446c1 --- /dev/null +++ b/public/static/js/11.js @@ -0,0 +1 @@ +webpackJsonp([11],{MXi2:function(e,t){},P54s:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("aFK5"),n=a.n(r),i=a("mvHQ"),o=a.n(i),s=a("Xxa5"),l=a.n(s),c=a("exGp"),m=a.n(c),p={data:function(){return{loading:!1,downloadLoading:!1,print:!1,searchForm:{page:1,limit:10,goods_name:"",order_code:"",mobile:"",start_time:"",end_time:"",pay_type:0,farmer_id:0},pickerOptions:{disabledDate:function(e){return e.getTime()>Date.now()}},statusOptions:[{label:"全部",value:0},{label:"待支付",value:1},{label:"租赁中",value:2},{label:"已完成",value:7}],statusType:{"-1":"已取消",1:"待支付",2:"租赁中",7:"已完成"},payType:{1:"微信支付",2:"余额支付",3:"支付宝支付"},tableData:[],printTableData:[],total:0}},activated:function(){var e=this;return m()(l.a.mark(function t(){return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getBaseInfo();case 2:e.getTableDataList();case 3:case"end":return t.stop()}},t,e)}))()},methods:{getBaseInfo:function(){var e=this;return m()(l.a.mark(function t(){var a,r,n;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$api.farmer.farmerSelectList();case 2:if(a=t.sent,r=a.code,n=a.data,200===r){t.next=7;break}return t.abrupt("return");case 7:n.unshift({id:0,title:"全部"}),e.base_farmer=n;case 9:case"end":return t.stop()}},t,e)}))()},resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return m()(l.a.mark(function a(){var r,n,i,s,c,m;return l.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,r=JSON.parse(o()(t.searchForm)),(n=r.start_time)&&n.length>0?(r.start_time=parseInt(n[0]/1e3),r.end_time=parseInt(n[1]/1e3)+86400-1):(r.start_time="",r.end_time=""),a.next=7,t.$api.land.orderList(r);case 7:if(i=a.sent,s=i.code,c=i.data,t.loading=!1,200===s){a.next=13;break}return a.abrupt("return");case 13:t.tableData=c.data,t.total=c.total,m=c.data.map(function(e){var a=moment(1e3*e.end_time).format("YYYY-MM-DD HH:mm:ss");return e.goods_text=e.goods_name+" 到期时间:"+a+" 面积:¥"+e.area+"m²",[e.id,e.goods_text,e.farmer_info.title,e.massif_title,e.rent_user_name,e.rent_mobile,e.user_name,e.mobile,e.pay_price,e.order_code,e.transaction_id,moment(1e3*e.create_time).format("YYYY-MM-DD HH:mm:ss"),t.payType[e.pay_model],t.statusType[e.pay_type]]}),t.printTableData=[["ID","土地信息","农场名称","服务类型","租赁人","租赁人手机号","下单人","下单手机号","实收金额","系统订单号","付款订单号","下单时间","支付方式","状态"],m];case 17:case"end":return a.stop()}},a,t)}))()},exportOrder:function(){var e=this;this.downloadLoading=!0;var t=JSON.parse(o()(this.searchForm)),a=t.start_time;a&&a.length>0?(t.start_time=parseInt(a[0]/1e3),t.end_time=parseInt(a[1]/1e3)+86400-1):(t.start_time="",t.end_time="");var r=this.$util.getProCurrentHref(),i=r.indexOf("?")>0?"":"?",s=r.indexOf("?")>0;n()(t).forEach(function(e,a){i+=s?"&"+e+"="+t[e]:e+"="+t[e],s=!0});var l=sessionStorage.getItem("minitk"),c=r+"/farm/admin/AdminExcel/landOrderList"+i+"&token="+l;window.location.href=c,setTimeout(function(){e.downloadLoading=!1},5e3)},printTable:function(){var e=this;this.print=!0,setTimeout(function(){e.$print(e.$refs.print),e.print=!1},50)}},filters:{handleTime:function(e,t){return 1===t?moment(1e3*e).format("YYYY-MM-DD"):2===t?moment(1e3*e).format("HH:mm:ss"):moment(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},d={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-shop-order"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"土地名称",prop:"goods_name"}},[a("el-input",{attrs:{placeholder:"请输入土地名称"},model:{value:e.searchForm.goods_name,callback:function(t){e.$set(e.searchForm,"goods_name",t)},expression:"searchForm.goods_name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"系统订单号",prop:"order_code"}},[a("el-input",{attrs:{placeholder:"请输入系统订单号"},model:{value:e.searchForm.order_code,callback:function(t){e.$set(e.searchForm,"order_code",t)},expression:"searchForm.order_code"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"下单手机号",prop:"mobile"}},[a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"请输入下单时填写的手机号"},model:{value:e.searchForm.mobile,callback:function(t){e.$set(e.searchForm,"mobile",t)},expression:"searchForm.mobile"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"日期",prop:"start_time"}},[a("el-date-picker",{attrs:{type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"timestamp","picker-options":e.pickerOptions},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.start_time,callback:function(t){e.$set(e.searchForm,"start_time",t)},expression:"searchForm.start_time"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"农场",prop:"farmer_id"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.farmer_id,callback:function(t){e.$set(e.searchForm,"farmer_id",t)},expression:"searchForm.farmer_id"}},e._l(e.base_farmer,function(e){return a("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"状态",prop:"pay_type"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.pay_type,callback:function(t){e.$set(e.searchForm,"pay_type",t)},expression:"searchForm.pay_type"}},e._l(e.statusOptions,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1)}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("searchForm")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1)],1),e._v(" "),a("el-row",{staticClass:"page-top-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-print",expression:"`${$route.name}-print`"}],attrs:{size:"mini",plain:"",type:"primary",icon:"el-icon-printer"},on:{click:e.printTable}},[e._v(e._s(e.$t("action.print")))]),e._v(" "),a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-export",expression:"`${$route.name}-export`"}],attrs:{size:"mini",plain:"",type:"primary",icon:"el-icon-download",loading:e.downloadLoading},on:{click:e.exportOrder}},[e._v(e._s(e.$t("action.export")))])],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"80",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{prop:"goods_info_text",width:"300",label:"土地信息"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"pb-sm"},[a("div",{staticClass:"flex-center pt-md"},[a("lb-image",{staticClass:"avatar radius-5",attrs:{src:t.row.goods_cover}}),e._v(" "),a("div",{staticClass:"flex-1 f-caption c-caption ml-md mr-lg",staticStyle:{width:"180px"}},[a("div",{staticClass:"flex-between"},[a("div",{staticClass:"f-paragraph c-title ellipsis",staticStyle:{"line-height":"1.2"}},[e._v("\n "+e._s(t.row.goods_name)+"\n ")])]),e._v(" "),a("div",{staticClass:"f-caption c-desc ellipsis"},[e._v("\n "+e._s(e._f("handleTime")(t.row.end_time))+" 到期\n ")]),e._v(" "),a("div",{staticClass:"flex-between f-caption"},[a("div",{staticClass:"c-warning"},[e._v("\n "+e._s(t.row.area+"m²")+"\n ")])])])],1)])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"farmer_info.title",label:"农场名称"}}),e._v(" "),a("el-table-column",{attrs:{prop:"massif_title",label:"服务类型"}}),e._v(" "),a("el-table-column",{attrs:{prop:"rent_user_name",label:"租赁人"}}),e._v(" "),a("el-table-column",{attrs:{prop:"rent_mobile",label:"租赁人手机号","min-width":"120"}}),e._v(" "),a("el-table-column",{attrs:{prop:"user_name",label:"下单人"}}),e._v(" "),a("el-table-column",{attrs:{prop:"mobile",label:"下单手机号","min-width":"120"}}),e._v(" "),a("el-table-column",{attrs:{prop:"pay_price",label:"实收金额"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v("\n "+e._s("¥"+t.row.pay_price)+"\n ")])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"order_code","min-width":"150",label:"系统订单号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"transaction_id","min-width":"150",label:"付款订单号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"create_time","min-width":"120",label:"下单时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s(e._f("handleTime")(t.row.create_time,1)))]),e._v(" "),a("div",[e._v(e._s(e._f("handleTime")(t.row.create_time,2)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"pay_model",label:"支付方式","min-width":"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.payType[t.row.pay_model])+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"status",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.statusType[t.row.pay_type])+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"table-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-view",expression:"`${$route.name}-view`"}],attrs:{size:"mini",type:"primary",plain:""},on:{click:function(a){return e.$router.push("/order/land/detail?id="+t.row.id)}}},[e._v(e._s(e.$t("action.view")))])],1)]}}])})],1),e._v(" "),a("table",{directives:[{name:"show",rawName:"v-show",value:e.print,expression:"print"}],ref:"print",staticStyle:{"font-size":"12px"},attrs:{border:"0",cellspacing:"0",cellapdding:"0"}},[a("thead",[a("tr",e._l(e.printTableData[0],function(t,r){return a("th",{key:r,staticStyle:{border:"1px solid"}},[e._v("\n "+e._s(t)+"\n ")])}),0)]),e._v(" "),a("tbody",e._l(e.printTableData[1],function(t,r){return a("tr",{key:r},e._l(t,function(t,r){return a("td",{key:r,staticStyle:{border:"1px solid"}},[e._v("\n "+e._s(t)+"\n ")])}),0)}),0)]),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}})],1)],1)},staticRenderFns:[]};var u=a("VU/8")(p,d,!1,function(e){a("QFeX"),a("MXi2")},"data-v-1934be58",null);t.default=u.exports},QFeX:function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/12.js b/public/static/js/12.js new file mode 100644 index 0000000..39b2a5c --- /dev/null +++ b/public/static/js/12.js @@ -0,0 +1 @@ +webpackJsonp([12],{"/1Wg":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("aFK5"),n=a.n(r),o=a("mvHQ"),i=a.n(o),s=a("Xxa5"),l=a.n(s),c=a("exGp"),d=a.n(c),p={data:function(){return{loading:!1,downloadLoading:!1,print:!1,searchForm:{page:1,limit:10,goods_name:"",order_code:"",mobile:"",start_time:"",end_time:"",send_type:0,pay_type:0,store_id:0},pickerOptions:{disabledDate:function(e){return e.getTime()>Date.now()}},base_store:[],statusOptions:[{label:"全部",value:0},{label:"已取消",value:-1},{label:"待支付",value:1},{label:"待发货",value:2},{label:"已发货",value:3},{label:"已完成",value:7}],statusType:{"-1":"已取消",1:"待支付",2:"待发货",3:"已发货",7:"已完成"},payType:{1:"微信支付",2:"余额支付",3:"支付宝支付"},tableData:[],printTableData:[],total:0,subForm:{id:0,video:[]},showUpload:!1}},activated:function(){var e=this;return d()(l.a.mark(function t(){return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getBaseInfo();case 2:e.getTableDataList();case 3:case"end":return t.stop()}},t,e)}))()},methods:{getBaseInfo:function(){var e=this;return d()(l.a.mark(function t(){var a,r,n;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$api.farmer.storeSelect();case 2:if(a=t.sent,r=a.code,n=a.data,200===r){t.next=7;break}return t.abrupt("return");case 7:n.unshift({id:0,title:"全部"}),e.base_store=n;case 9:case"end":return t.stop()}},t,e)}))()},resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return d()(l.a.mark(function a(){var r,n,o,s,c,d;return l.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,r=JSON.parse(i()(t.searchForm)),(n=r.start_time)&&n.length>0?(r.start_time=parseInt(n[0]/1e3),r.end_time=parseInt(n[1]/1e3)+86400-1):(r.start_time="",r.end_time=""),a.next=7,t.$api.shop.orderList(r);case 7:if(o=a.sent,s=o.code,c=o.data,t.loading=!1,200===s){a.next=13;break}return a.abrupt("return");case 13:c.data.map(function(e){e.hx_user_name=7!==e.pay_type||e.hx_user_name?e.hx_user_name:"系统自动收货"}),t.tableData=c.data,t.total=c.total,d=c.data.map(function(e){return e.goods_text="",e.order_goods.map(function(t){e.goods_text+=t.goods_name+" 规格:"+t.spe_name+" 单价:¥"+t.goods_price+" 数量:x"+t.goods_num+";"}),[e.id,e.goods_text,e.store_info.user_name,e.store_info.title,e.user_name,e.mobile,e.pay_price,e.order_code,e.transaction_id,moment(1e3*e.create_time).format("YYYY-MM-DD HH:mm:ss"),t.payType[e.pay_model],t.statusType[e.pay_type]]}),t.printTableData=[["ID","商品信息","店长","店铺名称","下单人","下单手机号","实收金额","系统订单号","付款订单号","下单时间","支付方式","状态"],d];case 18:case"end":return a.stop()}},a,t)}))()},exportOrder:function(){var e=this;this.downloadLoading=!0;var t=JSON.parse(i()(this.searchForm)),a=t.start_time;a&&a.length>0?(t.start_time=parseInt(a[0]/1e3),t.end_time=parseInt(a[1]/1e3)+86400-1):(t.start_time="",t.end_time="");var r=this.$util.getProCurrentHref();alert(r);var o=r.indexOf("?")>0?"":"?",s=r.indexOf("?")>0;n()(t).forEach(function(e,a){o+=s?"&"+e+"="+t[e]:e+"="+t[e],s=!0});var l=sessionStorage.getItem("minitk"),c=r+"/farm/admin/AdminExcel/orderList"+o+"&token="+l;window.location.href=c,setTimeout(function(){e.downloadLoading=!1},5e3)},printTable:function(){var e=this;this.print=!0,setTimeout(function(){e.$print(e.$refs.print),e.print=!1},50)},confirmSendGoods:function(e){var t=this;this.$confirm("你确认要发货吗?",this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.toUpdateItem("shopOrderSend",{id:e})})},confirmUploadVideo:function(e){this.subForm.id=e,this.showUpload=!0},selectedFiles:function(e){var t=e[0].attachment,a=this.subForm.id;this.toUpdateItem("uploadVideo",{id:a,video:t})},toUpdateItem:function(e,t){var a=this;return d()(l.a.mark(function r(){var n;return l.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,a.$api.shop[e](t);case 2:if(n=r.sent,200===n.code){r.next=6;break}return r.abrupt("return");case 6:a.$message.success(a.$t("tips.successOper")),a.getTableDataList();case 8:case"end":return r.stop()}},r,a)}))()}},filters:{handleTime:function(e,t){return 1===t?moment(1e3*e).format("YYYY-MM-DD"):2===t?moment(1e3*e).format("HH:mm:ss"):moment(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},m={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-shop-order"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"店铺",prop:"store_id"}},[a("el-select",{attrs:{filterable:"",placeholder:"请选择店铺"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.store_id,callback:function(t){e.$set(e.searchForm,"store_id",t)},expression:"searchForm.store_id"}},e._l(e.base_store,function(e){return a("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"商品名称",prop:"goods_name"}},[a("el-input",{attrs:{placeholder:"请输入商品名称"},model:{value:e.searchForm.goods_name,callback:function(t){e.$set(e.searchForm,"goods_name",t)},expression:"searchForm.goods_name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"系统订单号",prop:"order_code"}},[a("el-input",{attrs:{placeholder:"请输入系统订单号"},model:{value:e.searchForm.order_code,callback:function(t){e.$set(e.searchForm,"order_code",t)},expression:"searchForm.order_code"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"下单手机号",prop:"mobile"}},[a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"请输入下单时填写的手机号"},model:{value:e.searchForm.mobile,callback:function(t){e.$set(e.searchForm,"mobile",t)},expression:"searchForm.mobile"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"日期",prop:"start_time"}},[a("el-date-picker",{attrs:{type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"timestamp","picker-options":e.pickerOptions},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.start_time,callback:function(t){e.$set(e.searchForm,"start_time",t)},expression:"searchForm.start_time"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"状态",prop:"pay_type"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.pay_type,callback:function(t){e.$set(e.searchForm,"pay_type",t)},expression:"searchForm.pay_type"}},e._l(e.statusOptions,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1)}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("searchForm")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1)],1),e._v(" "),a("el-row",{staticClass:"page-top-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-print",expression:"`${$route.name}-print`"}],attrs:{size:"mini",plain:"",type:"primary",icon:"el-icon-printer"},on:{click:e.printTable}},[e._v(e._s(e.$t("action.print")))]),e._v(" "),a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-export",expression:"`${$route.name}-export`"}],attrs:{size:"mini",plain:"",type:"primary",icon:"el-icon-download",loading:e.downloadLoading},on:{click:e.exportOrder}},[e._v(e._s(e.$t("action.export")))])],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"80",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{prop:"goods_info_text",width:"300",label:"商品信息"},scopedSlots:e._u([{key:"default",fn:function(t){return e._l(t.row.order_goods,function(t,r){return a("div",{key:r,staticClass:"pb-sm"},[a("div",{staticClass:"flex-center pt-md"},[a("lb-image",{staticClass:"avatar radius-5",attrs:{src:t.goods_cover}}),e._v(" "),a("div",{staticClass:"flex-1 f-caption c-caption ml-md mr-lg",staticStyle:{width:"180px"}},[a("div",{staticClass:"flex-between"},[a("div",{staticClass:"f-paragraph c-title ellipsis",class:[{"max-300":t.refund_num>0}],staticStyle:{"line-height":"1.2"}},[e._v("\n "+e._s(t.goods_name)+"\n ")]),e._v(" "),t.refund_num>0?a("div",{staticClass:"c-warning"},[e._v("\n 已退x"+e._s(t.refund_num)+"\n ")]):e._e()]),e._v(" "),a("div",{staticClass:"c-title ellipsis"},[e._v("\n "+e._s(t.spe_name)+"\n ")]),e._v(" "),a("div",{staticClass:"flex-between"},[a("div",{staticClass:"flex-y-baseline"},[a("div",{staticClass:"c-warning"},[e._v(e._s("¥"+t.goods_price))])]),e._v(" "),a("div",[e._v("x"+e._s(t.goods_num))])])])],1)])})}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"store_info.user_name",label:"店长"}}),e._v(" "),a("el-table-column",{attrs:{prop:"store_info.title",label:"店铺名称"}}),e._v(" "),a("el-table-column",{attrs:{prop:"user_name",label:"下单人"}}),e._v(" "),a("el-table-column",{attrs:{prop:"mobile","min-width":"120",label:"下单手机号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"pay_price",label:"实收金额"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s("¥"+t.row.pay_price))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"order_code","min-width":"150",label:"系统订单号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"transaction_id","min-width":"150",label:"付款订单号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"create_time","min-width":"120",label:"下单时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s(e._f("handleTime")(t.row.create_time,1)))]),e._v(" "),a("div",[e._v(e._s(e._f("handleTime")(t.row.create_time,2)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"pay_model",label:"支付方式","min-width":"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.payType[t.row.pay_model])+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"status",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.statusType[t.row.pay_type])+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"table-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-view",expression:"`${$route.name}-view`"}],attrs:{size:"mini",type:"primary",plain:""},on:{click:function(a){return e.$router.push("/order/shop/detail?id="+t.row.id)}}},[e._v(e._s(e.$t("action.view")))]),e._v(" "),a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-sendGoods",expression:"`${$route.name}-sendGoods`"},{name:"show",rawName:"v-show",value:2===t.row.pay_type,expression:"scope.row.pay_type === 2"}],attrs:{size:"mini",type:"danger",plain:""},on:{click:function(a){return e.confirmSendGoods(t.row.id)}}},[e._v(e._s(e.$t("action.sendGoods")))]),e._v(" "),a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-uploadVideo",expression:"`${$route.name}-uploadVideo`"},{name:"show",rawName:"v-show",value:2===t.row.pay_type&&!t.row.video,expression:"scope.row.pay_type === 2 && !scope.row.video"}],attrs:{size:"mini",type:"success",plain:""},on:{click:function(a){return e.confirmUploadVideo(t.row.id)}}},[e._v(e._s(e.$t("action.uploadVideo")))])],1)]}}])})],1),e._v(" "),a("table",{directives:[{name:"show",rawName:"v-show",value:e.print,expression:"print"}],ref:"print",staticStyle:{"font-size":"12px"},attrs:{border:"0",cellspacing:"0",cellapdding:"0"}},[a("thead",[a("tr",e._l(e.printTableData[0],function(t,r){return a("th",{key:r,staticStyle:{border:"1px solid"}},[e._v("\n "+e._s(t)+"\n ")])}),0)]),e._v(" "),a("tbody",e._l(e.printTableData[1],function(t,r){return a("tr",{key:r},e._l(t,function(t,r){return a("td",{key:r,staticStyle:{border:"1px solid"}},[e._v("\n "+e._s(t)+"\n ")])}),0)}),0)]),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}})],1),e._v(" "),a("lb-upload",{attrs:{filesLength:"0",fileSize:"1",multilineType:"single",visibles:e.showUpload,fileType:"video"},on:{"update:visibles":function(t){e.showUpload=t},selectedFiles:e.selectedFiles}})],1)},staticRenderFns:[]};var u=a("VU/8")(p,m,!1,function(e){a("CXlt"),a("vbu6")},"data-v-0a9e3034",null);t.default=u.exports},CXlt:function(e,t){},vbu6:function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/13.js b/public/static/js/13.js new file mode 100644 index 0000000..1d3563d --- /dev/null +++ b/public/static/js/13.js @@ -0,0 +1 @@ +webpackJsonp([13],{Wxq9:function(t,e,r){var n;window,n=function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=40)}([function(t,e){t.exports={86:{110000:"北京市",120000:"天津市",130000:"河北省",140000:"山西省",150000:"内蒙古自治区",210000:"辽宁省",220000:"吉林省",230000:"黑龙江省",310000:"上海市",320000:"江苏省",330000:"浙江省",340000:"安徽省",350000:"福建省",360000:"江西省",370000:"山东省",410000:"河南省",420000:"湖北省",430000:"湖南省",440000:"广东省",450000:"广西壮族自治区",460000:"海南省",500000:"重庆市",510000:"四川省",520000:"贵州省",530000:"云南省",540000:"西藏自治区",610000:"陕西省",620000:"甘肃省",630000:"青海省",640000:"宁夏回族自治区",650000:"新疆维吾尔自治区",710000:"台湾省",810000:"香港特别行政区",820000:"澳门特别行政区"},110000:{110100:"市辖区"},110100:{110101:"东城区",110102:"西城区",110105:"朝阳区",110106:"丰台区",110107:"石景山区",110108:"海淀区",110109:"门头沟区",110111:"房山区",110112:"通州区",110113:"顺义区",110114:"昌平区",110115:"大兴区",110116:"怀柔区",110117:"平谷区",110118:"密云区",110119:"延庆区"},120000:{120100:"市辖区"},120100:{120101:"和平区",120102:"河东区",120103:"河西区",120104:"南开区",120105:"河北区",120106:"红桥区",120110:"东丽区",120111:"西青区",120112:"津南区",120113:"北辰区",120114:"武清区",120115:"宝坻区",120116:"滨海新区",120117:"宁河区",120118:"静海区",120119:"蓟州区"},130000:{130100:"石家庄市",130200:"唐山市",130300:"秦皇岛市",130400:"邯郸市",130500:"邢台市",130600:"保定市",130700:"张家口市",130800:"承德市",130900:"沧州市",131000:"廊坊市",131100:"衡水市",139001:"定州市",139002:"辛集市"},130100:{130102:"长安区",130104:"桥西区",130105:"新华区",130107:"井陉矿区",130108:"裕华区",130109:"藁城区",130110:"鹿泉区",130111:"栾城区",130121:"井陉县",130123:"正定县",130125:"行唐县",130126:"灵寿县",130127:"高邑县",130128:"深泽县",130129:"赞皇县",130130:"无极县",130131:"平山县",130132:"元氏县",130133:"赵县",130183:"晋州市",130184:"新乐市"},130200:{130202:"路南区",130203:"路北区",130204:"古冶区",130205:"开平区",130207:"丰南区",130208:"丰润区",130209:"曹妃甸区",130223:"滦县",130224:"滦南县",130225:"乐亭县",130227:"迁西县",130229:"玉田县",130281:"遵化市",130283:"迁安市"},130300:{130302:"海港区",130303:"山海关区",130304:"北戴河区",130306:"抚宁区",130321:"青龙满族自治县",130322:"昌黎县",130324:"卢龙县"},130400:{130402:"邯山区",130403:"丛台区",130404:"复兴区",130406:"峰峰矿区",130421:"邯郸县",130423:"临漳县",130424:"成安县",130425:"大名县",130426:"涉县",130427:"磁县",130428:"肥乡县",130429:"永年县",130430:"邱县",130431:"鸡泽县",130432:"广平县",130433:"馆陶县",130434:"魏县",130435:"曲周县",130481:"武安市"},130500:{130502:"桥东区",130503:"桥西区",130521:"邢台县",130522:"临城县",130523:"内丘县",130524:"柏乡县",130525:"隆尧县",130526:"任县",130527:"南和县",130528:"宁晋县",130529:"巨鹿县",130530:"新河县",130531:"广宗县",130532:"平乡县",130533:"威县",130534:"清河县",130535:"临西县",130581:"南宫市",130582:"沙河市"},130600:{130602:"竞秀区",130606:"莲池区",130607:"满城区",130608:"清苑区",130609:"徐水区",130623:"涞水县",130624:"阜平县",130626:"定兴县",130627:"唐县",130628:"高阳县",130629:"容城县",130630:"涞源县",130631:"望都县",130632:"安新县",130633:"易县",130634:"曲阳县",130635:"蠡县",130636:"顺平县",130637:"博野县",130638:"雄县",130681:"涿州市",130683:"安国市",130684:"高碑店市"},130700:{130702:"桥东区",130703:"桥西区",130705:"宣化区",130706:"下花园区",130708:"万全区",130709:"崇礼区",130722:"张北县",130723:"康保县",130724:"沽源县",130725:"尚义县",130726:"蔚县",130727:"阳原县",130728:"怀安县",130730:"怀来县",130731:"涿鹿县",130732:"赤城县"},130800:{130802:"双桥区",130803:"双滦区",130804:"鹰手营子矿区",130821:"承德县",130822:"兴隆县",130823:"平泉县",130824:"滦平县",130825:"隆化县",130826:"丰宁满族自治县",130827:"宽城满族自治县",130828:"围场满族蒙古族自治县"},130900:{130902:"新华区",130903:"运河区",130921:"沧县",130922:"青县",130923:"东光县",130924:"海兴县",130925:"盐山县",130926:"肃宁县",130927:"南皮县",130928:"吴桥县",130929:"献县",130930:"孟村回族自治县",130981:"泊头市",130982:"任丘市",130983:"黄骅市",130984:"河间市"},131000:{131002:"安次区",131003:"广阳区",131022:"固安县",131023:"永清县",131024:"香河县",131025:"大城县",131026:"文安县",131028:"大厂回族自治县",131081:"霸州市",131082:"三河市"},131100:{131102:"桃城区",131103:"冀州区",131121:"枣强县",131122:"武邑县",131123:"武强县",131124:"饶阳县",131125:"安平县",131126:"故城县",131127:"景县",131128:"阜城县",131182:"深州市"},140000:{140100:"太原市",140200:"大同市",140300:"阳泉市",140400:"长治市",140500:"晋城市",140600:"朔州市",140700:"晋中市",140800:"运城市",140900:"忻州市",141000:"临汾市",141100:"吕梁市"},140100:{140105:"小店区",140106:"迎泽区",140107:"杏花岭区",140108:"尖草坪区",140109:"万柏林区",140110:"晋源区",140121:"清徐县",140122:"阳曲县",140123:"娄烦县",140181:"古交市"},140200:{140202:"城区",140203:"矿区",140211:"南郊区",140212:"新荣区",140221:"阳高县",140222:"天镇县",140223:"广灵县",140224:"灵丘县",140225:"浑源县",140226:"左云县",140227:"大同县"},140300:{140302:"城区",140303:"矿区",140311:"郊区",140321:"平定县",140322:"盂县"},140400:{140402:"城区",140411:"郊区",140421:"长治县",140423:"襄垣县",140424:"屯留县",140425:"平顺县",140426:"黎城县",140427:"壶关县",140428:"长子县",140429:"武乡县",140430:"沁县",140431:"沁源县",140481:"潞城市"},140500:{140502:"城区",140521:"沁水县",140522:"阳城县",140524:"陵川县",140525:"泽州县",140581:"高平市"},140600:{140602:"朔城区",140603:"平鲁区",140621:"山阴县",140622:"应县",140623:"右玉县",140624:"怀仁县"},140700:{140702:"榆次区",140721:"榆社县",140722:"左权县",140723:"和顺县",140724:"昔阳县",140725:"寿阳县",140726:"太谷县",140727:"祁县",140728:"平遥县",140729:"灵石县",140781:"介休市"},140800:{140802:"盐湖区",140821:"临猗县",140822:"万荣县",140823:"闻喜县",140824:"稷山县",140825:"新绛县",140826:"绛县",140827:"垣曲县",140828:"夏县",140829:"平陆县",140830:"芮城县",140881:"永济市",140882:"河津市"},140900:{140902:"忻府区",140921:"定襄县",140922:"五台县",140923:"代县",140924:"繁峙县",140925:"宁武县",140926:"静乐县",140927:"神池县",140928:"五寨县",140929:"岢岚县",140930:"河曲县",140931:"保德县",140932:"偏关县",140981:"原平市"},141000:{141002:"尧都区",141021:"曲沃县",141022:"翼城县",141023:"襄汾县",141024:"洪洞县",141025:"古县",141026:"安泽县",141027:"浮山县",141028:"吉县",141029:"乡宁县",141030:"大宁县",141031:"隰县",141032:"永和县",141033:"蒲县",141034:"汾西县",141081:"侯马市",141082:"霍州市"},141100:{141102:"离石区",141121:"文水县",141122:"交城县",141123:"兴县",141124:"临县",141125:"柳林县",141126:"石楼县",141127:"岚县",141128:"方山县",141129:"中阳县",141130:"交口县",141181:"孝义市",141182:"汾阳市"},150000:{150100:"呼和浩特市",150200:"包头市",150300:"乌海市",150400:"赤峰市",150500:"通辽市",150600:"鄂尔多斯市",150700:"呼伦贝尔市",150800:"巴彦淖尔市",150900:"乌兰察布市",152200:"兴安盟",152500:"锡林郭勒盟",152900:"阿拉善盟"},150100:{150102:"新城区",150103:"回民区",150104:"玉泉区",150105:"赛罕区",150121:"土默特左旗",150122:"托克托县",150123:"和林格尔县",150124:"清水河县",150125:"武川县"},150200:{150202:"东河区",150203:"昆都仑区",150204:"青山区",150205:"石拐区",150206:"白云鄂博矿区",150207:"九原区",150221:"土默特右旗",150222:"固阳县",150223:"达尔罕茂明安联合旗"},150300:{150302:"海勃湾区",150303:"海南区",150304:"乌达区"},150400:{150402:"红山区",150403:"元宝山区",150404:"松山区",150421:"阿鲁科尔沁旗",150422:"巴林左旗",150423:"巴林右旗",150424:"林西县",150425:"克什克腾旗",150426:"翁牛特旗",150428:"喀喇沁旗",150429:"宁城县",150430:"敖汉旗"},150500:{150502:"科尔沁区",150521:"科尔沁左翼中旗",150522:"科尔沁左翼后旗",150523:"开鲁县",150524:"库伦旗",150525:"奈曼旗",150526:"扎鲁特旗",150581:"霍林郭勒市"},150600:{150602:"东胜区",150603:"康巴什区",150621:"达拉特旗",150622:"准格尔旗",150623:"鄂托克前旗",150624:"鄂托克旗",150625:"杭锦旗",150626:"乌审旗",150627:"伊金霍洛旗"},150700:{150702:"海拉尔区",150703:"扎赉诺尔区",150721:"阿荣旗",150722:"莫力达瓦达斡尔族自治旗",150723:"鄂伦春自治旗",150724:"鄂温克族自治旗",150725:"陈巴尔虎旗",150726:"新巴尔虎左旗",150727:"新巴尔虎右旗",150781:"满洲里市",150782:"牙克石市",150783:"扎兰屯市",150784:"额尔古纳市",150785:"根河市"},150800:{150802:"临河区",150821:"五原县",150822:"磴口县",150823:"乌拉特前旗",150824:"乌拉特中旗",150825:"乌拉特后旗",150826:"杭锦后旗"},150900:{150902:"集宁区",150921:"卓资县",150922:"化德县",150923:"商都县",150924:"兴和县",150925:"凉城县",150926:"察哈尔右翼前旗",150927:"察哈尔右翼中旗",150928:"察哈尔右翼后旗",150929:"四子王旗",150981:"丰镇市"},152200:{152201:"乌兰浩特市",152202:"阿尔山市",152221:"科尔沁右翼前旗",152222:"科尔沁右翼中旗",152223:"扎赉特旗",152224:"突泉县"},152500:{152501:"二连浩特市",152502:"锡林浩特市",152522:"阿巴嘎旗",152523:"苏尼特左旗",152524:"苏尼特右旗",152525:"东乌珠穆沁旗",152526:"西乌珠穆沁旗",152527:"太仆寺旗",152528:"镶黄旗",152529:"正镶白旗",152530:"正蓝旗",152531:"多伦县"},152900:{152921:"阿拉善左旗",152922:"阿拉善右旗",152923:"额济纳旗"},210000:{210100:"沈阳市",210200:"大连市",210300:"鞍山市",210400:"抚顺市",210500:"本溪市",210600:"丹东市",210700:"锦州市",210800:"营口市",210900:"阜新市",211000:"辽阳市",211100:"盘锦市",211200:"铁岭市",211300:"朝阳市",211400:"葫芦岛市"},210100:{210102:"和平区",210103:"沈河区",210104:"大东区",210105:"皇姑区",210106:"铁西区",210111:"苏家屯区",210112:"浑南区",210113:"沈北新区",210114:"于洪区",210115:"辽中区",210123:"康平县",210124:"法库县",210181:"新民市"},210200:{210202:"中山区",210203:"西岗区",210204:"沙河口区",210211:"甘井子区",210212:"旅顺口区",210213:"金州区",210214:"普兰店区",210224:"长海县",210281:"瓦房店市",210283:"庄河市"},210300:{210302:"铁东区",210303:"铁西区",210304:"立山区",210311:"千山区",210321:"台安县",210323:"岫岩满族自治县",210381:"海城市"},210400:{210402:"新抚区",210403:"东洲区",210404:"望花区",210411:"顺城区",210421:"抚顺县",210422:"新宾满族自治县",210423:"清原满族自治县"},210500:{210502:"平山区",210503:"溪湖区",210504:"明山区",210505:"南芬区",210521:"本溪满族自治县",210522:"桓仁满族自治县"},210600:{210602:"元宝区",210603:"振兴区",210604:"振安区",210624:"宽甸满族自治县",210681:"东港市",210682:"凤城市"},210700:{210702:"古塔区",210703:"凌河区",210711:"太和区",210726:"黑山县",210727:"义县",210781:"凌海市",210782:"北镇市"},210800:{210802:"站前区",210803:"西市区",210804:"鲅鱼圈区",210811:"老边区",210881:"盖州市",210882:"大石桥市"},210900:{210902:"海州区",210903:"新邱区",210904:"太平区",210905:"清河门区",210911:"细河区",210921:"阜新蒙古族自治县",210922:"彰武县"},211000:{211002:"白塔区",211003:"文圣区",211004:"宏伟区",211005:"弓长岭区",211011:"太子河区",211021:"辽阳县",211081:"灯塔市"},211100:{211102:"双台子区",211103:"兴隆台区",211104:"大洼区",211122:"盘山县"},211200:{211202:"银州区",211204:"清河区",211221:"铁岭县",211223:"西丰县",211224:"昌图县",211281:"调兵山市",211282:"开原市"},211300:{211302:"双塔区",211303:"龙城区",211321:"朝阳县",211322:"建平县",211324:"喀喇沁左翼蒙古族自治县",211381:"北票市",211382:"凌源市"},211400:{211402:"连山区",211403:"龙港区",211404:"南票区",211421:"绥中县",211422:"建昌县",211481:"兴城市"},220000:{220100:"长春市",220200:"吉林市",220300:"四平市",220400:"辽源市",220500:"通化市",220600:"白山市",220700:"松原市",220800:"白城市",222400:"延边朝鲜族自治州"},220100:{220102:"南关区",220103:"宽城区",220104:"朝阳区",220105:"二道区",220106:"绿园区",220112:"双阳区",220113:"九台区",220122:"农安县",220182:"榆树市",220183:"德惠市"},220200:{220202:"昌邑区",220203:"龙潭区",220204:"船营区",220211:"丰满区",220221:"永吉县",220281:"蛟河市",220282:"桦甸市",220283:"舒兰市",220284:"磐石市"},220300:{220302:"铁西区",220303:"铁东区",220322:"梨树县",220323:"伊通满族自治县",220381:"公主岭市",220382:"双辽市"},220400:{220402:"龙山区",220403:"西安区",220421:"东丰县",220422:"东辽县"},220500:{220502:"东昌区",220503:"二道江区",220521:"通化县",220523:"辉南县",220524:"柳河县",220581:"梅河口市",220582:"集安市"},220600:{220602:"浑江区",220605:"江源区",220621:"抚松县",220622:"靖宇县",220623:"长白朝鲜族自治县",220681:"临江市"},220700:{220702:"宁江区",220721:"前郭尔罗斯蒙古族自治县",220722:"长岭县",220723:"乾安县",220781:"扶余市"},220800:{220802:"洮北区",220821:"镇赉县",220822:"通榆县",220881:"洮南市",220882:"大安市"},222400:{222401:"延吉市",222402:"图们市",222403:"敦化市",222404:"珲春市",222405:"龙井市",222406:"和龙市",222424:"汪清县",222426:"安图县"},230000:{230100:"哈尔滨市",230200:"齐齐哈尔市",230300:"鸡西市",230400:"鹤岗市",230500:"双鸭山市",230600:"大庆市",230700:"伊春市",230800:"佳木斯市",230900:"七台河市",231000:"牡丹江市",231100:"黑河市",231200:"绥化市",232700:"大兴安岭地区"},230100:{230102:"道里区",230103:"南岗区",230104:"道外区",230108:"平房区",230109:"松北区",230110:"香坊区",230111:"呼兰区",230112:"阿城区",230113:"双城区",230123:"依兰县",230124:"方正县",230125:"宾县",230126:"巴彦县",230127:"木兰县",230128:"通河县",230129:"延寿县",230183:"尚志市",230184:"五常市"},230200:{230202:"龙沙区",230203:"建华区",230204:"铁锋区",230205:"昂昂溪区",230206:"富拉尔基区",230207:"碾子山区",230208:"梅里斯达斡尔族区",230221:"龙江县",230223:"依安县",230224:"泰来县",230225:"甘南县",230227:"富裕县",230229:"克山县",230230:"克东县",230231:"拜泉县",230281:"讷河市"},230300:{230302:"鸡冠区",230303:"恒山区",230304:"滴道区",230305:"梨树区",230306:"城子河区",230307:"麻山区",230321:"鸡东县",230381:"虎林市",230382:"密山市"},230400:{230402:"向阳区",230403:"工农区",230404:"南山区",230405:"兴安区",230406:"东山区",230407:"兴山区",230421:"萝北县",230422:"绥滨县"},230500:{230502:"尖山区",230503:"岭东区",230505:"四方台区",230506:"宝山区",230521:"集贤县",230522:"友谊县",230523:"宝清县",230524:"饶河县"},230600:{230602:"萨尔图区",230603:"龙凤区",230604:"让胡路区",230605:"红岗区",230606:"大同区",230621:"肇州县",230622:"肇源县",230623:"林甸县",230624:"杜尔伯特蒙古族自治县"},230700:{230702:"伊春区",230703:"南岔区",230704:"友好区",230705:"西林区",230706:"翠峦区",230707:"新青区",230708:"美溪区",230709:"金山屯区",230710:"五营区",230711:"乌马河区",230712:"汤旺河区",230713:"带岭区",230714:"乌伊岭区",230715:"红星区",230716:"上甘岭区",230722:"嘉荫县",230781:"铁力市"},230800:{230803:"向阳区",230804:"前进区",230805:"东风区",230811:"郊区",230822:"桦南县",230826:"桦川县",230828:"汤原县",230881:"同江市",230882:"富锦市",230883:"抚远市"},230900:{230902:"新兴区",230903:"桃山区",230904:"茄子河区",230921:"勃利县"},231000:{231002:"东安区",231003:"阳明区",231004:"爱民区",231005:"西安区",231025:"林口县",231081:"绥芬河市",231083:"海林市",231084:"宁安市",231085:"穆棱市",231086:"东宁市"},231100:{231102:"爱辉区",231121:"嫩江县",231123:"逊克县",231124:"孙吴县",231181:"北安市",231182:"五大连池市"},231200:{231202:"北林区",231221:"望奎县",231222:"兰西县",231223:"青冈县",231224:"庆安县",231225:"明水县",231226:"绥棱县",231281:"安达市",231282:"肇东市",231283:"海伦市"},232700:{232721:"呼玛县",232722:"塔河县",232723:"漠河县"},310000:{310100:"市辖区"},310100:{310101:"黄浦区",310104:"徐汇区",310105:"长宁区",310106:"静安区",310107:"普陀区",310109:"虹口区",310110:"杨浦区",310112:"闵行区",310113:"宝山区",310114:"嘉定区",310115:"浦东新区",310116:"金山区",310117:"松江区",310118:"青浦区",310120:"奉贤区",310151:"崇明区"},320000:{320100:"南京市",320200:"无锡市",320300:"徐州市",320400:"常州市",320500:"苏州市",320600:"南通市",320700:"连云港市",320800:"淮安市",320900:"盐城市",321000:"扬州市",321100:"镇江市",321200:"泰州市",321300:"宿迁市"},320100:{320102:"玄武区",320104:"秦淮区",320105:"建邺区",320106:"鼓楼区",320111:"浦口区",320113:"栖霞区",320114:"雨花台区",320115:"江宁区",320116:"六合区",320117:"溧水区",320118:"高淳区"},320200:{320205:"锡山区",320206:"惠山区",320211:"滨湖区",320213:"梁溪区",320214:"新吴区",320281:"江阴市",320282:"宜兴市"},320300:{320302:"鼓楼区",320303:"云龙区",320305:"贾汪区",320311:"泉山区",320312:"铜山区",320321:"丰县",320322:"沛县",320324:"睢宁县",320381:"新沂市",320382:"邳州市"},320400:{320402:"天宁区",320404:"钟楼区",320411:"新北区",320412:"武进区",320413:"金坛区",320481:"溧阳市"},320500:{320505:"虎丘区",320506:"吴中区",320507:"相城区",320508:"姑苏区",320509:"吴江区",320581:"常熟市",320582:"张家港市",320583:"昆山市",320585:"太仓市"},320600:{320602:"崇川区",320611:"港闸区",320612:"通州区",320621:"海安县",320623:"如东县",320681:"启东市",320682:"如皋市",320684:"海门市"},320700:{320703:"连云区",320706:"海州区",320707:"赣榆区",320722:"东海县",320723:"灌云县",320724:"灌南县"},320800:{320803:"淮安区",320804:"淮阴区",320812:"清江浦区",320813:"洪泽区",320826:"涟水县",320830:"盱眙县",320831:"金湖县"},320900:{320902:"亭湖区",320903:"盐都区",320904:"大丰区",320921:"响水县",320922:"滨海县",320923:"阜宁县",320924:"射阳县",320925:"建湖县",320981:"东台市"},321000:{321002:"广陵区",321003:"邗江区",321012:"江都区",321023:"宝应县",321081:"仪征市",321084:"高邮市"},321100:{321102:"京口区",321111:"润州区",321112:"丹徒区",321181:"丹阳市",321182:"扬中市",321183:"句容市"},321200:{321202:"海陵区",321203:"高港区",321204:"姜堰区",321281:"兴化市",321282:"靖江市",321283:"泰兴市"},321300:{321302:"宿城区",321311:"宿豫区",321322:"沭阳县",321323:"泗阳县",321324:"泗洪县"},330000:{330100:"杭州市",330200:"宁波市",330300:"温州市",330400:"嘉兴市",330500:"湖州市",330600:"绍兴市",330700:"金华市",330800:"衢州市",330900:"舟山市",331000:"台州市",331100:"丽水市"},330100:{330102:"上城区",330103:"下城区",330104:"江干区",330105:"拱墅区",330106:"西湖区",330108:"滨江区",330109:"萧山区",330110:"余杭区",330111:"富阳区",330122:"桐庐县",330127:"淳安县",330182:"建德市",330185:"临安市"},330200:{330203:"海曙区",330204:"江东区",330205:"江北区",330206:"北仑区",330211:"镇海区",330212:"鄞州区",330225:"象山县",330226:"宁海县",330281:"余姚市",330282:"慈溪市",330283:"奉化市"},330300:{330302:"鹿城区",330303:"龙湾区",330304:"瓯海区",330305:"洞头区",330324:"永嘉县",330326:"平阳县",330327:"苍南县",330328:"文成县",330329:"泰顺县",330381:"瑞安市",330382:"乐清市"},330400:{330402:"南湖区",330411:"秀洲区",330421:"嘉善县",330424:"海盐县",330481:"海宁市",330482:"平湖市",330483:"桐乡市"},330500:{330502:"吴兴区",330503:"南浔区",330521:"德清县",330522:"长兴县",330523:"安吉县"},330600:{330602:"越城区",330603:"柯桥区",330604:"上虞区",330624:"新昌县",330681:"诸暨市",330683:"嵊州市"},330700:{330702:"婺城区",330703:"金东区",330723:"武义县",330726:"浦江县",330727:"磐安县",330781:"兰溪市",330782:"义乌市",330783:"东阳市",330784:"永康市"},330800:{330802:"柯城区",330803:"衢江区",330822:"常山县",330824:"开化县",330825:"龙游县",330881:"江山市"},330900:{330902:"定海区",330903:"普陀区",330921:"岱山县",330922:"嵊泗县"},331000:{331002:"椒江区",331003:"黄岩区",331004:"路桥区",331021:"玉环县",331022:"三门县",331023:"天台县",331024:"仙居县",331081:"温岭市",331082:"临海市"},331100:{331102:"莲都区",331121:"青田县",331122:"缙云县",331123:"遂昌县",331124:"松阳县",331125:"云和县",331126:"庆元县",331127:"景宁畲族自治县",331181:"龙泉市"},340000:{340100:"合肥市",340200:"芜湖市",340300:"蚌埠市",340400:"淮南市",340500:"马鞍山市",340600:"淮北市",340700:"铜陵市",340800:"安庆市",341000:"黄山市",341100:"滁州市",341200:"阜阳市",341300:"宿州市",341500:"六安市",341600:"亳州市",341700:"池州市",341800:"宣城市"},340100:{340102:"瑶海区",340103:"庐阳区",340104:"蜀山区",340111:"包河区",340121:"长丰县",340122:"肥东县",340123:"肥西县",340124:"庐江县",340181:"巢湖市"},340200:{340202:"镜湖区",340203:"弋江区",340207:"鸠江区",340208:"三山区",340221:"芜湖县",340222:"繁昌县",340223:"南陵县",340225:"无为县"},340300:{340302:"龙子湖区",340303:"蚌山区",340304:"禹会区",340311:"淮上区",340321:"怀远县",340322:"五河县",340323:"固镇县"},340400:{340402:"大通区",340403:"田家庵区",340404:"谢家集区",340405:"八公山区",340406:"潘集区",340421:"凤台县",340422:"寿县"},340500:{340503:"花山区",340504:"雨山区",340506:"博望区",340521:"当涂县",340522:"含山县",340523:"和县"},340600:{340602:"杜集区",340603:"相山区",340604:"烈山区",340621:"濉溪县"},340700:{340705:"铜官区",340706:"义安区",340711:"郊区",340722:"枞阳县"},340800:{340802:"迎江区",340803:"大观区",340811:"宜秀区",340822:"怀宁县",340824:"潜山县",340825:"太湖县",340826:"宿松县",340827:"望江县",340828:"岳西县",340881:"桐城市"},341000:{341002:"屯溪区",341003:"黄山区",341004:"徽州区",341021:"歙县",341022:"休宁县",341023:"黟县",341024:"祁门县"},341100:{341102:"琅琊区",341103:"南谯区",341122:"来安县",341124:"全椒县",341125:"定远县",341126:"凤阳县",341181:"天长市",341182:"明光市"},341200:{341202:"颍州区",341203:"颍东区",341204:"颍泉区",341221:"临泉县",341222:"太和县",341225:"阜南县",341226:"颍上县",341282:"界首市"},341300:{341302:"埇桥区",341321:"砀山县",341322:"萧县",341323:"灵璧县",341324:"泗县"},341500:{341502:"金安区",341503:"裕安区",341504:"叶集区",341522:"霍邱县",341523:"舒城县",341524:"金寨县",341525:"霍山县"},341600:{341602:"谯城区",341621:"涡阳县",341622:"蒙城县",341623:"利辛县"},341700:{341702:"贵池区",341721:"东至县",341722:"石台县",341723:"青阳县"},341800:{341802:"宣州区",341821:"郎溪县",341822:"广德县",341823:"泾县",341824:"绩溪县",341825:"旌德县",341881:"宁国市"},350000:{350100:"福州市",350200:"厦门市",350300:"莆田市",350400:"三明市",350500:"泉州市",350600:"漳州市",350700:"南平市",350800:"龙岩市",350900:"宁德市"},350100:{350102:"鼓楼区",350103:"台江区",350104:"仓山区",350105:"马尾区",350111:"晋安区",350121:"闽侯县",350122:"连江县",350123:"罗源县",350124:"闽清县",350125:"永泰县",350128:"平潭县",350181:"福清市",350182:"长乐市"},350200:{350203:"思明区",350205:"海沧区",350206:"湖里区",350211:"集美区",350212:"同安区",350213:"翔安区"},350300:{350302:"城厢区",350303:"涵江区",350304:"荔城区",350305:"秀屿区",350322:"仙游县"},350400:{350402:"梅列区",350403:"三元区",350421:"明溪县",350423:"清流县",350424:"宁化县",350425:"大田县",350426:"尤溪县",350427:"沙县",350428:"将乐县",350429:"泰宁县",350430:"建宁县",350481:"永安市"},350500:{350502:"鲤城区",350503:"丰泽区",350504:"洛江区",350505:"泉港区",350521:"惠安县",350524:"安溪县",350525:"永春县",350526:"德化县",350527:"金门县",350581:"石狮市",350582:"晋江市",350583:"南安市"},350600:{350602:"芗城区",350603:"龙文区",350622:"云霄县",350623:"漳浦县",350624:"诏安县",350625:"长泰县",350626:"东山县",350627:"南靖县",350628:"平和县",350629:"华安县",350681:"龙海市"},350700:{350702:"延平区",350703:"建阳区",350721:"顺昌县",350722:"浦城县",350723:"光泽县",350724:"松溪县",350725:"政和县",350781:"邵武市",350782:"武夷山市",350783:"建瓯市"},350800:{350802:"新罗区",350803:"永定区",350821:"长汀县",350823:"上杭县",350824:"武平县",350825:"连城县",350881:"漳平市"},350900:{350902:"蕉城区",350921:"霞浦县",350922:"古田县",350923:"屏南县",350924:"寿宁县",350925:"周宁县",350926:"柘荣县",350981:"福安市",350982:"福鼎市"},360000:{360100:"南昌市",360200:"景德镇市",360300:"萍乡市",360400:"九江市",360500:"新余市",360600:"鹰潭市",360700:"赣州市",360800:"吉安市",360900:"宜春市",361000:"抚州市",361100:"上饶市"},360100:{360102:"东湖区",360103:"西湖区",360104:"青云谱区",360105:"湾里区",360111:"青山湖区",360112:"新建区",360121:"南昌县",360123:"安义县",360124:"进贤县"},360200:{360202:"昌江区",360203:"珠山区",360222:"浮梁县",360281:"乐平市"},360300:{360302:"安源区",360313:"湘东区",360321:"莲花县",360322:"上栗县",360323:"芦溪县"},360400:{360402:"濂溪区",360403:"浔阳区",360421:"九江县",360423:"武宁县",360424:"修水县",360425:"永修县",360426:"德安县",360428:"都昌县",360429:"湖口县",360430:"彭泽县",360481:"瑞昌市",360482:"共青城市",360483:"庐山市"},360500:{360502:"渝水区",360521:"分宜县"},360600:{360602:"月湖区",360622:"余江县",360681:"贵溪市"},360700:{360702:"章贡区",360703:"南康区",360721:"赣县",360722:"信丰县",360723:"大余县",360724:"上犹县",360725:"崇义县",360726:"安远县",360727:"龙南县",360728:"定南县",360729:"全南县",360730:"宁都县",360731:"于都县",360732:"兴国县",360733:"会昌县",360734:"寻乌县",360735:"石城县",360781:"瑞金市"},360800:{360802:"吉州区",360803:"青原区",360821:"吉安县",360822:"吉水县",360823:"峡江县",360824:"新干县",360825:"永丰县",360826:"泰和县",360827:"遂川县",360828:"万安县",360829:"安福县",360830:"永新县",360881:"井冈山市"},360900:{360902:"袁州区",360921:"奉新县",360922:"万载县",360923:"上高县",360924:"宜丰县",360925:"靖安县",360926:"铜鼓县",360981:"丰城市",360982:"樟树市",360983:"高安市"},361000:{361002:"临川区",361021:"南城县",361022:"黎川县",361023:"南丰县",361024:"崇仁县",361025:"乐安县",361026:"宜黄县",361027:"金溪县",361028:"资溪县",361029:"东乡县",361030:"广昌县"},361100:{361102:"信州区",361103:"广丰区",361121:"上饶县",361123:"玉山县",361124:"铅山县",361125:"横峰县",361126:"弋阳县",361127:"余干县",361128:"鄱阳县",361129:"万年县",361130:"婺源县",361181:"德兴市"},370000:{370100:"济南市",370200:"青岛市",370300:"淄博市",370400:"枣庄市",370500:"东营市",370600:"烟台市",370700:"潍坊市",370800:"济宁市",370900:"泰安市",371000:"威海市",371100:"日照市",371200:"莱芜市",371300:"临沂市",371400:"德州市",371500:"聊城市",371600:"滨州市",371700:"菏泽市"},370100:{370102:"历下区",370103:"市中区",370104:"槐荫区",370105:"天桥区",370112:"历城区",370113:"长清区",370124:"平阴县",370125:"济阳县",370126:"商河县",370181:"章丘市"},370200:{370202:"市南区",370203:"市北区",370211:"黄岛区",370212:"崂山区",370213:"李沧区",370214:"城阳区",370281:"胶州市",370282:"即墨市",370283:"平度市",370285:"莱西市"},370300:{370302:"淄川区",370303:"张店区",370304:"博山区",370305:"临淄区",370306:"周村区",370321:"桓台县",370322:"高青县",370323:"沂源县"},370400:{370402:"市中区",370403:"薛城区",370404:"峄城区",370405:"台儿庄区",370406:"山亭区",370481:"滕州市"},370500:{370502:"东营区",370503:"河口区",370505:"垦利区",370522:"利津县",370523:"广饶县"},370600:{370602:"芝罘区",370611:"福山区",370612:"牟平区",370613:"莱山区",370634:"长岛县",370681:"龙口市",370682:"莱阳市",370683:"莱州市",370684:"蓬莱市",370685:"招远市",370686:"栖霞市",370687:"海阳市"},370700:{370702:"潍城区",370703:"寒亭区",370704:"坊子区",370705:"奎文区",370724:"临朐县",370725:"昌乐县",370781:"青州市",370782:"诸城市",370783:"寿光市",370784:"安丘市",370785:"高密市",370786:"昌邑市"},370800:{370811:"任城区",370812:"兖州区",370826:"微山县",370827:"鱼台县",370828:"金乡县",370829:"嘉祥县",370830:"汶上县",370831:"泗水县",370832:"梁山县",370881:"曲阜市",370883:"邹城市"},370900:{370902:"泰山区",370911:"岱岳区",370921:"宁阳县",370923:"东平县",370982:"新泰市",370983:"肥城市"},371000:{371002:"环翠区",371003:"文登区",371082:"荣成市",371083:"乳山市"},371100:{371102:"东港区",371103:"岚山区",371121:"五莲县",371122:"莒县"},371200:{371202:"莱城区",371203:"钢城区"},371300:{371302:"兰山区",371311:"罗庄区",371312:"河东区",371321:"沂南县",371322:"郯城县",371323:"沂水县",371324:"兰陵县",371325:"费县",371326:"平邑县",371327:"莒南县",371328:"蒙阴县",371329:"临沭县"},371400:{371402:"德城区",371403:"陵城区",371422:"宁津县",371423:"庆云县",371424:"临邑县",371425:"齐河县",371426:"平原县",371427:"夏津县",371428:"武城县",371481:"乐陵市",371482:"禹城市"},371500:{371502:"东昌府区",371521:"阳谷县",371522:"莘县",371523:"茌平县",371524:"东阿县",371525:"冠县",371526:"高唐县",371581:"临清市"},371600:{371602:"滨城区",371603:"沾化区",371621:"惠民县",371622:"阳信县",371623:"无棣县",371625:"博兴县",371626:"邹平县"},371700:{371702:"牡丹区",371703:"定陶区",371721:"曹县",371722:"单县",371723:"成武县",371724:"巨野县",371725:"郓城县",371726:"鄄城县",371728:"东明县"},410000:{410100:"郑州市",410200:"开封市",410300:"洛阳市",410400:"平顶山市",410500:"安阳市",410600:"鹤壁市",410700:"新乡市",410800:"焦作市",410900:"濮阳市",411000:"许昌市",411100:"漯河市",411200:"三门峡市",411300:"南阳市",411400:"商丘市",411500:"信阳市",411600:"周口市",411700:"驻马店市",419001:"济源市"},410100:{410102:"中原区",410103:"二七区",410104:"管城回族区",410105:"金水区",410106:"上街区",410108:"惠济区",410122:"中牟县",410181:"巩义市",410182:"荥阳市",410183:"新密市",410184:"新郑市",410185:"登封市"},410200:{410202:"龙亭区",410203:"顺河回族区",410204:"鼓楼区",410205:"禹王台区",410211:"金明区",410212:"祥符区",410221:"杞县",410222:"通许县",410223:"尉氏县",410225:"兰考县"},410300:{410302:"老城区",410303:"西工区",410304:"瀍河回族区",410305:"涧西区",410306:"吉利区",410311:"洛龙区",410322:"孟津县",410323:"新安县",410324:"栾川县",410325:"嵩县",410326:"汝阳县",410327:"宜阳县",410328:"洛宁县",410329:"伊川县",410381:"偃师市"},410400:{410402:"新华区",410403:"卫东区",410404:"石龙区",410411:"湛河区",410421:"宝丰县",410422:"叶县",410423:"鲁山县",410425:"郏县",410481:"舞钢市",410482:"汝州市"},410500:{410502:"文峰区",410503:"北关区",410505:"殷都区",410506:"龙安区",410522:"安阳县",410523:"汤阴县",410526:"滑县",410527:"内黄县",410581:"林州市"},410600:{410602:"鹤山区",410603:"山城区",410611:"淇滨区",410621:"浚县",410622:"淇县"},410700:{410702:"红旗区",410703:"卫滨区",410704:"凤泉区",410711:"牧野区",410721:"新乡县",410724:"获嘉县",410725:"原阳县",410726:"延津县",410727:"封丘县",410728:"长垣县",410781:"卫辉市",410782:"辉县市"},410800:{410802:"解放区",410803:"中站区",410804:"马村区",410811:"山阳区",410821:"修武县",410822:"博爱县",410823:"武陟县",410825:"温县",410882:"沁阳市",410883:"孟州市"},410900:{410902:"华龙区",410922:"清丰县",410923:"南乐县",410926:"范县",410927:"台前县",410928:"濮阳县"},411000:{411002:"魏都区",411023:"许昌县",411024:"鄢陵县",411025:"襄城县",411081:"禹州市",411082:"长葛市"},411100:{411102:"源汇区",411103:"郾城区",411104:"召陵区",411121:"舞阳县",411122:"临颍县"},411200:{411202:"湖滨区",411203:"陕州区",411221:"渑池县",411224:"卢氏县",411281:"义马市",411282:"灵宝市"},411300:{411302:"宛城区",411303:"卧龙区",411321:"南召县",411322:"方城县",411323:"西峡县",411324:"镇平县",411325:"内乡县",411326:"淅川县",411327:"社旗县",411328:"唐河县",411329:"新野县",411330:"桐柏县",411381:"邓州市"},411400:{411402:"梁园区",411403:"睢阳区",411421:"民权县",411422:"睢县",411423:"宁陵县",411424:"柘城县",411425:"虞城县",411426:"夏邑县",411481:"永城市"},411500:{411502:"浉河区",411503:"平桥区",411521:"罗山县",411522:"光山县",411523:"新县",411524:"商城县",411525:"固始县",411526:"潢川县",411527:"淮滨县",411528:"息县"},411600:{411602:"川汇区",411621:"扶沟县",411622:"西华县",411623:"商水县",411624:"沈丘县",411625:"郸城县",411626:"淮阳县",411627:"太康县",411628:"鹿邑县",411681:"项城市"},411700:{411702:"驿城区",411721:"西平县",411722:"上蔡县",411723:"平舆县",411724:"正阳县",411725:"确山县",411726:"泌阳县",411727:"汝南县",411728:"遂平县",411729:"新蔡县"},420000:{420100:"武汉市",420200:"黄石市",420300:"十堰市",420500:"宜昌市",420600:"襄阳市",420700:"鄂州市",420800:"荆门市",420900:"孝感市",421000:"荆州市",421100:"黄冈市",421200:"咸宁市",421300:"随州市",422800:"恩施土家族苗族自治州",429004:"仙桃市",429005:"潜江市",429006:"天门市",429021:"神农架林区"},420100:{420102:"江岸区",420103:"江汉区",420104:"硚口区",420105:"汉阳区",420106:"武昌区",420107:"青山区",420111:"洪山区",420112:"东西湖区",420113:"汉南区",420114:"蔡甸区",420115:"江夏区",420116:"黄陂区",420117:"新洲区"},420200:{420202:"黄石港区",420203:"西塞山区",420204:"下陆区",420205:"铁山区",420222:"阳新县",420281:"大冶市"},420300:{420302:"茅箭区",420303:"张湾区",420304:"郧阳区",420322:"郧西县",420323:"竹山县",420324:"竹溪县",420325:"房县",420381:"丹江口市"},420500:{420502:"西陵区",420503:"伍家岗区",420504:"点军区",420505:"猇亭区",420506:"夷陵区",420525:"远安县",420526:"兴山县",420527:"秭归县",420528:"长阳土家族自治县",420529:"五峰土家族自治县",420581:"宜都市",420582:"当阳市",420583:"枝江市"},420600:{420602:"襄城区",420606:"樊城区",420607:"襄州区",420624:"南漳县",420625:"谷城县",420626:"保康县",420682:"老河口市",420683:"枣阳市",420684:"宜城市"},420700:{420702:"梁子湖区",420703:"华容区",420704:"鄂城区"},420800:{420802:"东宝区",420804:"掇刀区",420821:"京山县",420822:"沙洋县",420881:"钟祥市"},420900:{420902:"孝南区",420921:"孝昌县",420922:"大悟县",420923:"云梦县",420981:"应城市",420982:"安陆市",420984:"汉川市"},421000:{421002:"沙市区",421003:"荆州区",421022:"公安县",421023:"监利县",421024:"江陵县",421081:"石首市",421083:"洪湖市",421087:"松滋市"},421100:{421102:"黄州区",421121:"团风县",421122:"红安县",421123:"罗田县",421124:"英山县",421125:"浠水县",421126:"蕲春县",421127:"黄梅县",421181:"麻城市",421182:"武穴市"},421200:{421202:"咸安区",421221:"嘉鱼县",421222:"通城县",421223:"崇阳县",421224:"通山县",421281:"赤壁市"},421300:{421303:"曾都区",421321:"随县",421381:"广水市"},422800:{422801:"恩施市",422802:"利川市",422822:"建始县",422823:"巴东县",422825:"宣恩县",422826:"咸丰县",422827:"来凤县",422828:"鹤峰县"},430000:{430100:"长沙市",430200:"株洲市",430300:"湘潭市",430400:"衡阳市",430500:"邵阳市",430600:"岳阳市",430700:"常德市",430800:"张家界市",430900:"益阳市",431000:"郴州市",431100:"永州市",431200:"怀化市",431300:"娄底市",433100:"湘西土家族苗族自治州"},430100:{430102:"芙蓉区",430103:"天心区",430104:"岳麓区",430105:"开福区",430111:"雨花区",430112:"望城区",430121:"长沙县",430124:"宁乡县",430181:"浏阳市"},430200:{430202:"荷塘区",430203:"芦淞区",430204:"石峰区",430211:"天元区",430221:"株洲县",430223:"攸县",430224:"茶陵县",430225:"炎陵县",430281:"醴陵市"},430300:{430302:"雨湖区",430304:"岳塘区",430321:"湘潭县",430381:"湘乡市",430382:"韶山市"},430400:{430405:"珠晖区",430406:"雁峰区",430407:"石鼓区",430408:"蒸湘区",430412:"南岳区",430421:"衡阳县",430422:"衡南县",430423:"衡山县",430424:"衡东县",430426:"祁东县",430481:"耒阳市",430482:"常宁市"},430500:{430502:"双清区",430503:"大祥区",430511:"北塔区",430521:"邵东县",430522:"新邵县",430523:"邵阳县",430524:"隆回县",430525:"洞口县",430527:"绥宁县",430528:"新宁县",430529:"城步苗族自治县",430581:"武冈市"},430600:{430602:"岳阳楼区",430603:"云溪区",430611:"君山区",430621:"岳阳县",430623:"华容县",430624:"湘阴县",430626:"平江县",430681:"汨罗市",430682:"临湘市"},430700:{430702:"武陵区",430703:"鼎城区",430721:"安乡县",430722:"汉寿县",430723:"澧县",430724:"临澧县",430725:"桃源县",430726:"石门县",430781:"津市市"},430800:{430802:"永定区",430811:"武陵源区",430821:"慈利县",430822:"桑植县"},430900:{430902:"资阳区",430903:"赫山区",430921:"南县",430922:"桃江县",430923:"安化县",430981:"沅江市"},431000:{431002:"北湖区",431003:"苏仙区",431021:"桂阳县",431022:"宜章县",431023:"永兴县",431024:"嘉禾县",431025:"临武县",431026:"汝城县",431027:"桂东县",431028:"安仁县",431081:"资兴市"},431100:{431102:"零陵区",431103:"冷水滩区",431121:"祁阳县",431122:"东安县",431123:"双牌县",431124:"道县",431125:"江永县",431126:"宁远县",431127:"蓝山县",431128:"新田县",431129:"江华瑶族自治县"},431200:{431202:"鹤城区",431221:"中方县",431222:"沅陵县",431223:"辰溪县",431224:"溆浦县",431225:"会同县",431226:"麻阳苗族自治县",431227:"新晃侗族自治县",431228:"芷江侗族自治县",431229:"靖州苗族侗族自治县",431230:"通道侗族自治县",431281:"洪江市"},431300:{431302:"娄星区",431321:"双峰县",431322:"新化县",431381:"冷水江市",431382:"涟源市"},433100:{433101:"吉首市",433122:"泸溪县",433123:"凤凰县",433124:"花垣县",433125:"保靖县",433126:"古丈县",433127:"永顺县",433130:"龙山县"},440000:{440100:"广州市",440200:"韶关市",440300:"深圳市",440400:"珠海市",440500:"汕头市",440600:"佛山市",440700:"江门市",440800:"湛江市",440900:"茂名市",441200:"肇庆市",441300:"惠州市",441400:"梅州市",441500:"汕尾市",441600:"河源市",441700:"阳江市",441800:"清远市",441900:"东莞市",442000:"中山市",445100:"潮州市",445200:"揭阳市",445300:"云浮市"},440100:{440103:"荔湾区",440104:"越秀区",440105:"海珠区",440106:"天河区",440111:"白云区",440112:"黄埔区",440113:"番禺区",440114:"花都区",440115:"南沙区",440117:"从化区",440118:"增城区"},440200:{440203:"武江区",440204:"浈江区",440205:"曲江区",440222:"始兴县",440224:"仁化县",440229:"翁源县",440232:"乳源瑶族自治县",440233:"新丰县",440281:"乐昌市",440282:"南雄市"},440300:{440303:"罗湖区",440304:"福田区",440305:"南山区",440306:"宝安区",440307:"龙岗区",440308:"盐田区"},440400:{440402:"香洲区",440403:"斗门区",440404:"金湾区"},440500:{440507:"龙湖区",440511:"金平区",440512:"濠江区",440513:"潮阳区",440514:"潮南区",440515:"澄海区",440523:"南澳县"},440600:{440604:"禅城区",440605:"南海区",440606:"顺德区",440607:"三水区",440608:"高明区"},440700:{440703:"蓬江区",440704:"江海区",440705:"新会区",440781:"台山市",440783:"开平市",440784:"鹤山市",440785:"恩平市"},440800:{440802:"赤坎区",440803:"霞山区",440804:"坡头区",440811:"麻章区",440823:"遂溪县",440825:"徐闻县",440881:"廉江市",440882:"雷州市",440883:"吴川市"},440900:{440902:"茂南区",440904:"电白区",440981:"高州市",440982:"化州市",440983:"信宜市"},441200:{441202:"端州区",441203:"鼎湖区",441204:"高要区",441223:"广宁县",441224:"怀集县",441225:"封开县",441226:"德庆县",441284:"四会市"},441300:{441302:"惠城区",441303:"惠阳区",441322:"博罗县",441323:"惠东县",441324:"龙门县"},441400:{441402:"梅江区",441403:"梅县区",441422:"大埔县",441423:"丰顺县",441424:"五华县",441426:"平远县",441427:"蕉岭县",441481:"兴宁市"},441500:{441502:"城区",441521:"海丰县",441523:"陆河县",441581:"陆丰市"},441600:{441602:"源城区",441621:"紫金县",441622:"龙川县",441623:"连平县",441624:"和平县",441625:"东源县"},441700:{441702:"江城区",441704:"阳东区",441721:"阳西县",441781:"阳春市"},441800:{441802:"清城区",441803:"清新区",441821:"佛冈县",441823:"阳山县",441825:"连山壮族瑶族自治县",441826:"连南瑶族自治县",441881:"英德市",441882:"连州市"},445100:{445102:"湘桥区",445103:"潮安区",445122:"饶平县"},445200:{445202:"榕城区",445203:"揭东区",445222:"揭西县",445224:"惠来县",445281:"普宁市"},445300:{445302:"云城区",445303:"云安区",445321:"新兴县",445322:"郁南县",445381:"罗定市"},450000:{450100:"南宁市",450200:"柳州市",450300:"桂林市",450400:"梧州市",450500:"北海市",450600:"防城港市",450700:"钦州市",450800:"贵港市",450900:"玉林市",451000:"百色市",451100:"贺州市",451200:"河池市",451300:"来宾市",451400:"崇左市"},450100:{450102:"兴宁区",450103:"青秀区",450105:"江南区",450107:"西乡塘区",450108:"良庆区",450109:"邕宁区",450110:"武鸣区",450123:"隆安县",450124:"马山县",450125:"上林县",450126:"宾阳县",450127:"横县"},450200:{450202:"城中区",450203:"鱼峰区",450204:"柳南区",450205:"柳北区",450206:"柳江区",450222:"柳城县",450223:"鹿寨县",450224:"融安县",450225:"融水苗族自治县",450226:"三江侗族自治县"},450300:{450302:"秀峰区",450303:"叠彩区",450304:"象山区",450305:"七星区",450311:"雁山区",450312:"临桂区",450321:"阳朔县",450323:"灵川县",450324:"全州县",450325:"兴安县",450326:"永福县",450327:"灌阳县",450328:"龙胜各族自治县",450329:"资源县",450330:"平乐县",450331:"荔浦县",450332:"恭城瑶族自治县"},450400:{450403:"万秀区",450405:"长洲区",450406:"龙圩区",450421:"苍梧县",450422:"藤县",450423:"蒙山县",450481:"岑溪市"},450500:{450502:"海城区",450503:"银海区",450512:"铁山港区",450521:"合浦县"},450600:{450602:"港口区",450603:"防城区",450621:"上思县",450681:"东兴市"},450700:{450702:"钦南区",450703:"钦北区",450721:"灵山县",450722:"浦北县"},450800:{450802:"港北区",450803:"港南区",450804:"覃塘区",450821:"平南县",450881:"桂平市"},450900:{450902:"玉州区",450903:"福绵区",450921:"容县",450922:"陆川县",450923:"博白县",450924:"兴业县",450981:"北流市"},451000:{451002:"右江区",451021:"田阳县",451022:"田东县",451023:"平果县",451024:"德保县",451026:"那坡县",451027:"凌云县",451028:"乐业县",451029:"田林县",451030:"西林县",451031:"隆林各族自治县",451081:"靖西市"},451100:{451102:"八步区",451103:"平桂区",451121:"昭平县",451122:"钟山县",451123:"富川瑶族自治县"},451200:{451202:"金城江区",451221:"南丹县",451222:"天峨县",451223:"凤山县",451224:"东兰县",451225:"罗城仫佬族自治县",451226:"环江毛南族自治县",451227:"巴马瑶族自治县",451228:"都安瑶族自治县",451229:"大化瑶族自治县",451281:"宜州市"},451300:{451302:"兴宾区",451321:"忻城县",451322:"象州县",451323:"武宣县",451324:"金秀瑶族自治县",451381:"合山市"},451400:{451402:"江州区",451421:"扶绥县",451422:"宁明县",451423:"龙州县",451424:"大新县",451425:"天等县",451481:"凭祥市"},460000:{460100:"海口市",460200:"三亚市",460300:"三沙市",460400:"儋州市",469001:"五指山市",469002:"琼海市",469005:"文昌市",469006:"万宁市",469007:"东方市",469021:"定安县",469022:"屯昌县",469023:"澄迈县",469024:"临高县",469025:"白沙黎族自治县",469026:"昌江黎族自治县",469027:"乐东黎族自治县",469028:"陵水黎族自治县",469029:"保亭黎族苗族自治县",469030:"琼中黎族苗族自治县"},460100:{460105:"秀英区",460106:"龙华区",460107:"琼山区",460108:"美兰区"},460200:{460202:"海棠区",460203:"吉阳区",460204:"天涯区",460205:"崖州区"},500000:{500100:"市辖区",500200:"县"},500100:{500101:"万州区",500102:"涪陵区",500103:"渝中区",500104:"大渡口区",500105:"江北区",500106:"沙坪坝区",500107:"九龙坡区",500108:"南岸区",500109:"北碚区",500110:"綦江区",500111:"大足区",500112:"渝北区",500113:"巴南区",500114:"黔江区",500115:"长寿区",500116:"江津区",500117:"合川区",500118:"永川区",500119:"南川区",500120:"璧山区",500151:"铜梁区",500152:"潼南区",500153:"荣昌区",500154:"开州区"},500200:{500228:"梁平县",500229:"城口县",500230:"丰都县",500231:"垫江县",500232:"武隆县",500233:"忠县",500235:"云阳县",500236:"奉节县",500237:"巫山县",500238:"巫溪县",500240:"石柱土家族自治县",500241:"秀山土家族苗族自治县",500242:"酉阳土家族苗族自治县",500243:"彭水苗族土家族自治县"},510000:{510100:"成都市",510300:"自贡市",510400:"攀枝花市",510500:"泸州市",510600:"德阳市",510700:"绵阳市",510800:"广元市",510900:"遂宁市",511000:"内江市",511100:"乐山市",511300:"南充市",511400:"眉山市",511500:"宜宾市",511600:"广安市",511700:"达州市",511800:"雅安市",511900:"巴中市",512000:"资阳市",513200:"阿坝藏族羌族自治州",513300:"甘孜藏族自治州",513400:"凉山彝族自治州"},510100:{510104:"锦江区",510105:"青羊区",510106:"金牛区",510107:"武侯区",510108:"成华区",510112:"龙泉驿区",510113:"青白江区",510114:"新都区",510115:"温江区",510116:"双流区",510121:"金堂县",510124:"郫县",510129:"大邑县",510131:"蒲江县",510132:"新津县",510181:"都江堰市",510182:"彭州市",510183:"邛崃市",510184:"崇州市",510185:"简阳市"},510300:{510302:"自流井区",510303:"贡井区",510304:"大安区",510311:"沿滩区",510321:"荣县",510322:"富顺县"},510400:{510402:"东区",510403:"西区",510411:"仁和区",510421:"米易县",510422:"盐边县"},510500:{510502:"江阳区",510503:"纳溪区",510504:"龙马潭区",510521:"泸县",510522:"合江县",510524:"叙永县",510525:"古蔺县"},510600:{510603:"旌阳区",510623:"中江县",510626:"罗江县",510681:"广汉市",510682:"什邡市",510683:"绵竹市"},510700:{510703:"涪城区",510704:"游仙区",510705:"安州区",510722:"三台县",510723:"盐亭县",510725:"梓潼县",510726:"北川羌族自治县",510727:"平武县",510781:"江油市"},510800:{510802:"利州区",510811:"昭化区",510812:"朝天区",510821:"旺苍县",510822:"青川县",510823:"剑阁县",510824:"苍溪县"},510900:{510903:"船山区",510904:"安居区",510921:"蓬溪县",510922:"射洪县",510923:"大英县"},511000:{511002:"市中区",511011:"东兴区",511024:"威远县",511025:"资中县",511028:"隆昌县"},511100:{511102:"市中区",511111:"沙湾区",511112:"五通桥区",511113:"金口河区",511123:"犍为县",511124:"井研县",511126:"夹江县",511129:"沐川县",511132:"峨边彝族自治县",511133:"马边彝族自治县",511181:"峨眉山市"},511300:{511302:"顺庆区",511303:"高坪区",511304:"嘉陵区",511321:"南部县",511322:"营山县",511323:"蓬安县",511324:"仪陇县",511325:"西充县",511381:"阆中市"},511400:{511402:"东坡区",511403:"彭山区",511421:"仁寿县",511423:"洪雅县",511424:"丹棱县",511425:"青神县"},511500:{511502:"翠屏区",511503:"南溪区",511521:"宜宾县",511523:"江安县",511524:"长宁县",511525:"高县",511526:"珙县",511527:"筠连县",511528:"兴文县",511529:"屏山县"},511600:{511602:"广安区",511603:"前锋区",511621:"岳池县",511622:"武胜县",511623:"邻水县",511681:"华蓥市"},511700:{511702:"通川区",511703:"达川区",511722:"宣汉县",511723:"开江县",511724:"大竹县",511725:"渠县",511781:"万源市"},511800:{511802:"雨城区",511803:"名山区",511822:"荥经县",511823:"汉源县",511824:"石棉县",511825:"天全县",511826:"芦山县",511827:"宝兴县"},511900:{511902:"巴州区",511903:"恩阳区",511921:"通江县",511922:"南江县",511923:"平昌县"},512000:{512002:"雁江区",512021:"安岳县",512022:"乐至县"},513200:{513201:"马尔康市",513221:"汶川县",513222:"理县",513223:"茂县",513224:"松潘县",513225:"九寨沟县",513226:"金川县",513227:"小金县",513228:"黑水县",513230:"壤塘县",513231:"阿坝县",513232:"若尔盖县",513233:"红原县"},513300:{513301:"康定市",513322:"泸定县",513323:"丹巴县",513324:"九龙县",513325:"雅江县",513326:"道孚县",513327:"炉霍县",513328:"甘孜县",513329:"新龙县",513330:"德格县",513331:"白玉县",513332:"石渠县",513333:"色达县",513334:"理塘县",513335:"巴塘县",513336:"乡城县",513337:"稻城县",513338:"得荣县"},513400:{513401:"西昌市",513422:"木里藏族自治县",513423:"盐源县",513424:"德昌县",513425:"会理县",513426:"会东县",513427:"宁南县",513428:"普格县",513429:"布拖县",513430:"金阳县",513431:"昭觉县",513432:"喜德县",513433:"冕宁县",513434:"越西县",513435:"甘洛县",513436:"美姑县",513437:"雷波县"},520000:{520100:"贵阳市",520200:"六盘水市",520300:"遵义市",520400:"安顺市",520500:"毕节市",520600:"铜仁市",522300:"黔西南布依族苗族自治州",522600:"黔东南苗族侗族自治州",522700:"黔南布依族苗族自治州"},520100:{520102:"南明区",520103:"云岩区",520111:"花溪区",520112:"乌当区",520113:"白云区",520115:"观山湖区",520121:"开阳县",520122:"息烽县",520123:"修文县",520181:"清镇市"},520200:{520201:"钟山区",520203:"六枝特区",520221:"水城县",520222:"盘县"},520300:{520302:"红花岗区",520303:"汇川区",520304:"播州区",520322:"桐梓县",520323:"绥阳县",520324:"正安县",520325:"道真仡佬族苗族自治县",520326:"务川仡佬族苗族自治县",520327:"凤冈县",520328:"湄潭县",520329:"余庆县",520330:"习水县",520381:"赤水市",520382:"仁怀市"},520400:{520402:"西秀区",520403:"平坝区",520422:"普定县",520423:"镇宁布依族苗族自治县",520424:"关岭布依族苗族自治县",520425:"紫云苗族布依族自治县"},520500:{520502:"七星关区",520521:"大方县",520522:"黔西县",520523:"金沙县",520524:"织金县",520525:"纳雍县",520526:"威宁彝族回族苗族自治县",520527:"赫章县"},520600:{520602:"碧江区",520603:"万山区",520621:"江口县",520622:"玉屏侗族自治县",520623:"石阡县",520624:"思南县",520625:"印江土家族苗族自治县",520626:"德江县",520627:"沿河土家族自治县",520628:"松桃苗族自治县"},522300:{522301:"兴义市",522322:"兴仁县",522323:"普安县",522324:"晴隆县",522325:"贞丰县",522326:"望谟县",522327:"册亨县",522328:"安龙县"},522600:{522601:"凯里市",522622:"黄平县",522623:"施秉县",522624:"三穗县",522625:"镇远县",522626:"岑巩县",522627:"天柱县",522628:"锦屏县",522629:"剑河县",522630:"台江县",522631:"黎平县",522632:"榕江县",522633:"从江县",522634:"雷山县",522635:"麻江县",522636:"丹寨县"},522700:{522701:"都匀市",522702:"福泉市",522722:"荔波县",522723:"贵定县",522725:"瓮安县",522726:"独山县",522727:"平塘县",522728:"罗甸县",522729:"长顺县",522730:"龙里县",522731:"惠水县",522732:"三都水族自治县"},530000:{530100:"昆明市",530300:"曲靖市",530400:"玉溪市",530500:"保山市",530600:"昭通市",530700:"丽江市",530800:"普洱市",530900:"临沧市",532300:"楚雄彝族自治州",532500:"红河哈尼族彝族自治州",532600:"文山壮族苗族自治州",532800:"西双版纳傣族自治州",532900:"大理白族自治州",533100:"德宏傣族景颇族自治州",533300:"怒江傈僳族自治州",533400:"迪庆藏族自治州"},530100:{530102:"五华区",530103:"盘龙区",530111:"官渡区",530112:"西山区",530113:"东川区",530114:"呈贡区",530122:"晋宁县",530124:"富民县",530125:"宜良县",530126:"石林彝族自治县",530127:"嵩明县",530128:"禄劝彝族苗族自治县",530129:"寻甸回族彝族自治县",530181:"安宁市"},530300:{530302:"麒麟区",530303:"沾益区",530321:"马龙县",530322:"陆良县",530323:"师宗县",530324:"罗平县",530325:"富源县",530326:"会泽县",530381:"宣威市"},530400:{530402:"红塔区",530403:"江川区",530422:"澄江县",530423:"通海县",530424:"华宁县",530425:"易门县",530426:"峨山彝族自治县",530427:"新平彝族傣族自治县",530428:"元江哈尼族彝族傣族自治县"},530500:{530502:"隆阳区",530521:"施甸县",530523:"龙陵县",530524:"昌宁县",530581:"腾冲市"},530600:{530602:"昭阳区",530621:"鲁甸县",530622:"巧家县",530623:"盐津县",530624:"大关县",530625:"永善县",530626:"绥江县",530627:"镇雄县",530628:"彝良县",530629:"威信县",530630:"水富县"},530700:{530702:"古城区",530721:"玉龙纳西族自治县",530722:"永胜县",530723:"华坪县",530724:"宁蒗彝族自治县"},530800:{530802:"思茅区",530821:"宁洱哈尼族彝族自治县",530822:"墨江哈尼族自治县",530823:"景东彝族自治县",530824:"景谷傣族彝族自治县",530825:"镇沅彝族哈尼族拉祜族自治县",530826:"江城哈尼族彝族自治县",530827:"孟连傣族拉祜族佤族自治县",530828:"澜沧拉祜族自治县",530829:"西盟佤族自治县"},530900:{530902:"临翔区",530921:"凤庆县",530922:"云县",530923:"永德县",530924:"镇康县",530925:"双江拉祜族佤族布朗族傣族自治县",530926:"耿马傣族佤族自治县",530927:"沧源佤族自治县"},532300:{532301:"楚雄市",532322:"双柏县",532323:"牟定县",532324:"南华县",532325:"姚安县",532326:"大姚县",532327:"永仁县",532328:"元谋县",532329:"武定县",532331:"禄丰县"},532500:{532501:"个旧市",532502:"开远市",532503:"蒙自市",532504:"弥勒市",532523:"屏边苗族自治县",532524:"建水县",532525:"石屏县",532527:"泸西县",532528:"元阳县",532529:"红河县",532530:"金平苗族瑶族傣族自治县",532531:"绿春县",532532:"河口瑶族自治县"},532600:{532601:"文山市",532622:"砚山县",532623:"西畴县",532624:"麻栗坡县",532625:"马关县",532626:"丘北县",532627:"广南县",532628:"富宁县"},532800:{532801:"景洪市",532822:"勐海县",532823:"勐腊县"},532900:{532901:"大理市",532922:"漾濞彝族自治县",532923:"祥云县",532924:"宾川县",532925:"弥渡县",532926:"南涧彝族自治县",532927:"巍山彝族回族自治县",532928:"永平县",532929:"云龙县",532930:"洱源县",532931:"剑川县",532932:"鹤庆县"},533100:{533102:"瑞丽市",533103:"芒市",533122:"梁河县",533123:"盈江县",533124:"陇川县"},533300:{533301:"泸水市",533323:"福贡县",533324:"贡山独龙族怒族自治县",533325:"兰坪白族普米族自治县"},533400:{533401:"香格里拉市",533422:"德钦县",533423:"维西傈僳族自治县"},540000:{540100:"拉萨市",540200:"日喀则市",540300:"昌都市",540400:"林芝市",540500:"山南市",542400:"那曲地区",542500:"阿里地区"},540100:{540102:"城关区",540103:"堆龙德庆区",540121:"林周县",540122:"当雄县",540123:"尼木县",540124:"曲水县",540126:"达孜县",540127:"墨竹工卡县"},540200:{540202:"桑珠孜区",540221:"南木林县",540222:"江孜县",540223:"定日县",540224:"萨迦县",540225:"拉孜县",540226:"昂仁县",540227:"谢通门县",540228:"白朗县",540229:"仁布县",540230:"康马县",540231:"定结县",540232:"仲巴县",540233:"亚东县",540234:"吉隆县",540235:"聂拉木县",540236:"萨嘎县",540237:"岗巴县"},540300:{540302:"卡若区",540321:"江达县",540322:"贡觉县",540323:"类乌齐县",540324:"丁青县",540325:"察雅县",540326:"八宿县",540327:"左贡县",540328:"芒康县",540329:"洛隆县",540330:"边坝县"},540400:{540402:"巴宜区",540421:"工布江达县",540422:"米林县",540423:"墨脱县",540424:"波密县",540425:"察隅县",540426:"朗县"},540500:{540502:"乃东区",540521:"扎囊县",540522:"贡嘎县",540523:"桑日县",540524:"琼结县",540525:"曲松县",540526:"措美县",540527:"洛扎县",540528:"加查县",540529:"隆子县",540530:"错那县",540531:"浪卡子县"},542400:{542421:"那曲县",542422:"嘉黎县",542423:"比如县",542424:"聂荣县",542425:"安多县",542426:"申扎县",542427:"索县",542428:"班戈县",542429:"巴青县",542430:"尼玛县",542431:"双湖县"},542500:{542521:"普兰县",542522:"札达县",542523:"噶尔县",542524:"日土县",542525:"革吉县",542526:"改则县",542527:"措勤县"},610000:{610100:"西安市",610200:"铜川市",610300:"宝鸡市",610400:"咸阳市",610500:"渭南市",610600:"延安市",610700:"汉中市",610800:"榆林市",610900:"安康市",611000:"商洛市"},610100:{610102:"新城区",610103:"碑林区",610104:"莲湖区",610111:"灞桥区",610112:"未央区",610113:"雁塔区",610114:"阎良区",610115:"临潼区",610116:"长安区",610117:"高陵区",610122:"蓝田县",610124:"周至县",610125:"户县"},610200:{610202:"王益区",610203:"印台区",610204:"耀州区",610222:"宜君县"},610300:{610302:"渭滨区",610303:"金台区",610304:"陈仓区",610322:"凤翔县",610323:"岐山县",610324:"扶风县",610326:"眉县",610327:"陇县",610328:"千阳县",610329:"麟游县",610330:"凤县",610331:"太白县"},610400:{610402:"秦都区",610403:"杨陵区",610404:"渭城区",610422:"三原县",610423:"泾阳县",610424:"乾县",610425:"礼泉县",610426:"永寿县",610427:"彬县",610428:"长武县",610429:"旬邑县",610430:"淳化县",610431:"武功县",610481:"兴平市"},610500:{610502:"临渭区",610503:"华州区",610522:"潼关县",610523:"大荔县",610524:"合阳县",610525:"澄城县",610526:"蒲城县",610527:"白水县",610528:"富平县",610581:"韩城市",610582:"华阴市"},610600:{610602:"宝塔区",610603:"安塞区",610621:"延长县",610622:"延川县",610623:"子长县",610625:"志丹县",610626:"吴起县",610627:"甘泉县",610628:"富县",610629:"洛川县",610630:"宜川县",610631:"黄龙县",610632:"黄陵县"},610700:{610702:"汉台区",610721:"南郑县",610722:"城固县",610723:"洋县",610724:"西乡县",610725:"勉县",610726:"宁强县",610727:"略阳县",610728:"镇巴县",610729:"留坝县",610730:"佛坪县"},610800:{610802:"榆阳区",610803:"横山区",610821:"神木县",610822:"府谷县",610824:"靖边县",610825:"定边县",610826:"绥德县",610827:"米脂县",610828:"佳县",610829:"吴堡县",610830:"清涧县",610831:"子洲县"},610900:{610902:"汉滨区",610921:"汉阴县",610922:"石泉县",610923:"宁陕县",610924:"紫阳县",610925:"岚皋县",610926:"平利县",610927:"镇坪县",610928:"旬阳县",610929:"白河县"},611000:{611002:"商州区",611021:"洛南县",611022:"丹凤县",611023:"商南县",611024:"山阳县",611025:"镇安县",611026:"柞水县"},620000:{620100:"兰州市",620200:"嘉峪关市",620300:"金昌市",620400:"白银市",620500:"天水市",620600:"武威市",620700:"张掖市",620800:"平凉市",620900:"酒泉市",621000:"庆阳市",621100:"定西市",621200:"陇南市",622900:"临夏回族自治州",623000:"甘南藏族自治州"},620100:{620102:"城关区",620103:"七里河区",620104:"西固区",620105:"安宁区",620111:"红古区",620121:"永登县",620122:"皋兰县",620123:"榆中县"},620300:{620302:"金川区",620321:"永昌县"},620400:{620402:"白银区",620403:"平川区",620421:"靖远县",620422:"会宁县",620423:"景泰县"},620500:{620502:"秦州区",620503:"麦积区",620521:"清水县",620522:"秦安县",620523:"甘谷县",620524:"武山县",620525:"张家川回族自治县"},620600:{620602:"凉州区",620621:"民勤县",620622:"古浪县",620623:"天祝藏族自治县"},620700:{620702:"甘州区",620721:"肃南裕固族自治县",620722:"民乐县",620723:"临泽县",620724:"高台县",620725:"山丹县"},620800:{620802:"崆峒区",620821:"泾川县",620822:"灵台县",620823:"崇信县",620824:"华亭县",620825:"庄浪县",620826:"静宁县"},620900:{620902:"肃州区",620921:"金塔县",620922:"瓜州县",620923:"肃北蒙古族自治县",620924:"阿克塞哈萨克族自治县",620981:"玉门市",620982:"敦煌市"},621000:{621002:"西峰区",621021:"庆城县",621022:"环县",621023:"华池县",621024:"合水县",621025:"正宁县",621026:"宁县",621027:"镇原县"},621100:{621102:"安定区",621121:"通渭县",621122:"陇西县",621123:"渭源县",621124:"临洮县",621125:"漳县",621126:"岷县"},621200:{621202:"武都区",621221:"成县",621222:"文县",621223:"宕昌县",621224:"康县",621225:"西和县",621226:"礼县",621227:"徽县",621228:"两当县"},622900:{622901:"临夏市",622921:"临夏县",622922:"康乐县",622923:"永靖县",622924:"广河县",622925:"和政县",622926:"东乡族自治县",622927:"积石山保安族东乡族撒拉族自治县"},623000:{623001:"合作市",623021:"临潭县",623022:"卓尼县",623023:"舟曲县",623024:"迭部县",623025:"玛曲县",623026:"碌曲县",623027:"夏河县"},630000:{630100:"西宁市",630200:"海东市",632200:"海北藏族自治州",632300:"黄南藏族自治州",632500:"海南藏族自治州",632600:"果洛藏族自治州",632700:"玉树藏族自治州",632800:"海西蒙古族藏族自治州"},630100:{630102:"城东区",630103:"城中区",630104:"城西区",630105:"城北区",630121:"大通回族土族自治县",630122:"湟中县",630123:"湟源县"},630200:{630202:"乐都区",630203:"平安区",630222:"民和回族土族自治县",630223:"互助土族自治县",630224:"化隆回族自治县",630225:"循化撒拉族自治县"},632200:{632221:"门源回族自治县",632222:"祁连县",632223:"海晏县",632224:"刚察县"},632300:{632321:"同仁县",632322:"尖扎县",632323:"泽库县",632324:"河南蒙古族自治县"},632500:{632521:"共和县",632522:"同德县",632523:"贵德县",632524:"兴海县",632525:"贵南县"},632600:{632621:"玛沁县",632622:"班玛县",632623:"甘德县",632624:"达日县",632625:"久治县",632626:"玛多县"},632700:{632701:"玉树市",632722:"杂多县",632723:"称多县",632724:"治多县",632725:"囊谦县",632726:"曲麻莱县"},632800:{632801:"格尔木市",632802:"德令哈市",632821:"乌兰县",632822:"都兰县",632823:"天峻县"},640000:{640100:"银川市",640200:"石嘴山市",640300:"吴忠市",640400:"固原市",640500:"中卫市"},640100:{640104:"兴庆区",640105:"西夏区",640106:"金凤区",640121:"永宁县",640122:"贺兰县",640181:"灵武市"},640200:{640202:"大武口区",640205:"惠农区",640221:"平罗县"},640300:{640302:"利通区",640303:"红寺堡区",640323:"盐池县",640324:"同心县",640381:"青铜峡市"},640400:{640402:"原州区",640422:"西吉县",640423:"隆德县",640424:"泾源县",640425:"彭阳县"},640500:{640502:"沙坡头区",640521:"中宁县",640522:"海原县"},650000:{650100:"乌鲁木齐市",650200:"克拉玛依市",650400:"吐鲁番市",650500:"哈密市",652300:"昌吉回族自治州",652700:"博尔塔拉蒙古自治州",652800:"巴音郭楞蒙古自治州",652900:"阿克苏地区",653000:"克孜勒苏柯尔克孜自治州",653100:"喀什地区",653200:"和田地区",654000:"伊犁哈萨克自治州",654200:"塔城地区",654300:"阿勒泰地区",659001:"石河子市",659002:"阿拉尔市",659003:"图木舒克市",659004:"五家渠市",659006:"铁门关市"},650100:{650102:"天山区",650103:"沙依巴克区",650104:"新市区",650105:"水磨沟区",650106:"头屯河区",650107:"达坂城区",650109:"米东区",650121:"乌鲁木齐县"},650200:{650202:"独山子区",650203:"克拉玛依区",650204:"白碱滩区",650205:"乌尔禾区"},650400:{650402:"高昌区",650421:"鄯善县",650422:"托克逊县"},650500:{650502:"伊州区",650521:"巴里坤哈萨克自治县",650522:"伊吾县"},652300:{652301:"昌吉市",652302:"阜康市",652323:"呼图壁县",652324:"玛纳斯县",652325:"奇台县",652327:"吉木萨尔县",652328:"木垒哈萨克自治县"},652700:{652701:"博乐市",652702:"阿拉山口市",652722:"精河县",652723:"温泉县"},652800:{652801:"库尔勒市",652822:"轮台县",652823:"尉犁县",652824:"若羌县",652825:"且末县",652826:"焉耆回族自治县",652827:"和静县",652828:"和硕县",652829:"博湖县"},652900:{652901:"阿克苏市",652922:"温宿县",652923:"库车县",652924:"沙雅县",652925:"新和县",652926:"拜城县",652927:"乌什县",652928:"阿瓦提县",652929:"柯坪县"},653000:{653001:"阿图什市",653022:"阿克陶县",653023:"阿合奇县",653024:"乌恰县"},653100:{653101:"喀什市",653121:"疏附县",653122:"疏勒县",653123:"英吉沙县",653124:"泽普县",653125:"莎车县",653126:"叶城县",653127:"麦盖提县",653128:"岳普湖县",653129:"伽师县",653130:"巴楚县",653131:"塔什库尔干塔吉克自治县"},653200:{653201:"和田市",653221:"和田县",653222:"墨玉县",653223:"皮山县",653224:"洛浦县",653225:"策勒县",653226:"于田县",653227:"民丰县"},654000:{654002:"伊宁市",654003:"奎屯市",654004:"霍尔果斯市",654021:"伊宁县",654022:"察布查尔锡伯自治县",654023:"霍城县",654024:"巩留县",654025:"新源县",654026:"昭苏县",654027:"特克斯县",654028:"尼勒克县"},654200:{654201:"塔城市",654202:"乌苏市",654221:"额敏县",654223:"沙湾县",654224:"托里县",654225:"裕民县",654226:"和布克赛尔蒙古自治县"},654300:{654301:"阿勒泰市",654321:"布尔津县",654322:"富蕴县",654323:"福海县",654324:"哈巴河县",654325:"青河县",654326:"吉木乃县"},810000:{810001:"中西區",810002:"灣仔區",810003:"東區",810004:"南區",810005:"油尖旺區",810006:"深水埗區",810007:"九龍城區",810008:"黃大仙區",810009:"觀塘區",810010:"荃灣區",810011:"屯門區",810012:"元朗區",810013:"北區",810014:"大埔區",810015:"西貢區",810016:"沙田區",810017:"葵青區",810018:"離島區"},820000:{820001:"花地瑪堂區",820002:"花王堂區",820003:"望德堂區",820004:"大堂區",820005:"風順堂區",820006:"嘉模堂區",820007:"路氹填海區",820008:"聖方濟各堂區"}}},function(t,e,r){var n=r(25),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},function(t,e,r){var n=r(53),o=r(59);t.exports=function(t,e){var r=o(t,e);return n(r)?r:void 0}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,r){var n=r(43),o=r(44),i=r(45),a=r(46),u=r(47);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991}},function(t,e){t.exports=function(t,e){return function(r){return t(e(r))}}},function(t,e,r){var n=r(24),o=r(31);t.exports=function(t){return null!=t&&o(t.length)&&!n(t)}},function(t,e,r){var n=r(29),o=r(86),i=r(33);t.exports=function(t){return i(t)?n(t,!0):o(t)}},function(t,e){t.exports=function(){return[]}},function(t,e,r){var n=r(37),o=r(38),i=r(20),a=r(35),u=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)n(e,i(t)),t=o(t);return e}:a;t.exports=u},function(t,e){t.exports=function(t,e){for(var r=-1,n=e.length,o=t.length;++r-1}},function(t,e,r){var n=r(6);t.exports=function(t,e){var r=this.__data__,o=n(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}},function(t,e,r){var n=r(5);t.exports=function(){this.__data__=new n,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,r){var n=r(5),o=r(12),i=r(60);t.exports=function(t,e){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!o||a.length<199)return a.push([t,e]),this.size=++r.size,this;r=this.__data__=new i(a)}return r.set(t,e),this.size=r.size,this}},function(t,e,r){var n=r(24),o=r(57),i=r(3),a=r(26),u=/^\[object .+?Constructor\]$/,c=Function.prototype,s=Object.prototype,l=c.toString,f=s.hasOwnProperty,p=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(n(t)?p:u).test(a(t))}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var n=r(13),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=n?n.toStringTag:void 0;t.exports=function(t){var e=i.call(t,u),r=t[u];try{t[u]=void 0;var n=!0}catch(t){}var o=a.call(t);return n&&(e?t[u]=r:delete t[u]),o}},function(t,e){var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},function(t,e,r){var n,o=r(58),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!i&&i in t}},function(t,e,r){var n=r(1)["__core-js_shared__"];t.exports=n},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,r){var n=r(61),o=r(68),i=r(70),a=r(71),u=r(72);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t1&&void 0!==arguments[1]?arguments[1]:{id:0,province:[],start_num:"",start_price:"",add_num:"",add_price:""};for(var r in(e=JSON.parse(a()(e))).id&&(e.province=e.province.map(function(t){return[t]})),this[t+"Form"])this[t+"Form"][r]=e[r];this.showDialog[t]=!this.showDialog[t]},submitFormInfo:function(t){var e=this,r=!0;if(this.$refs[t+"Form"].validate(function(t){t||(r=!1)}),r){var n=function(){var r=JSON.parse(a()(e[t+"Form"]));if("sub"!==t){var n=JSON.parse(a()(e.subForm)),i=r.id,u=void 0===i?0:i;r.province=r.province.map(function(t){return t[0]});var c=[];n.config.map(function(t){t.province.map(function(t){c.push(t)})});var s=function(t){if(c.includes(r.province[t])){var o=n.config.findIndex(function(e){return e.province.includes(r.province[t])});if(!u||u&&u!==n.config[o].id)return e.$message.error("当前运费模版配送区域中已包含「"+r.province[t]+"」"),{v:{v:void 0}}}};for(var l in r.province){var f=s(l);if("object"===(void 0===f?"undefined":o()(f)))return f.v}if(u){var v=n[t].findIndex(function(t){return t.id===u});n[t][v]=r}else r.id=p()(),n[t].push(r);return e.subForm=n,e.showDialog[t]=!1,{v:void 0}}r.config.map(function(t){a()(t.id).includes("-")&&delete t.id});var b=r.id?"tmplUpdate":"tmplAdd";e.$api.shop[b](r).then(function(t){200===t.code&&(e.$message.success(e.$t(r.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}();if("object"===(void 0===n?"undefined":o()(n)))return n.v}}}},d={render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"lb-land-list-edit"},[r("top-nav",{attrs:{title:t.navTitle,isBack:!0}}),t._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",staticClass:"dialog-form",attrs:{model:t.subForm,rules:t.subFormRules,"label-width":"130px"}},[r("el-form-item",{attrs:{label:"模版名称",prop:"title"}},[r("el-input",{attrs:{maxlength:"20","show-word-limit":"",placeholder:"请输入模版名称"},model:{value:t.subForm.title,callback:function(e){t.$set(t.subForm,"title",e)},expression:"subForm.title"}})],1),t._v(" "),r("el-form-item",{attrs:{label:"计费方式",prop:"type"}},[r("el-radio-group",{model:{value:t.subForm.type,callback:function(e){t.$set(t.subForm,"type",e)},expression:"subForm.type"}},[r("el-radio",{attrs:{label:1}},[t._v("按件数")]),t._v(" "),r("el-radio",{attrs:{label:2}},[t._v("按重量")])],1)],1),t._v(" "),r("el-form-item",{attrs:{label:"配送区域",prop:"config"}},[r("lb-button",{staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary",plain:"",icon:"el-icon-plus"},on:{click:function(e){return t.toShowDialog("config")}}},[t._v(t._s(t.$t("menu.SystemFreightAreaAdd")))]),t._v(" "),r("el-table",{staticStyle:{width:"100%"},attrs:{data:t.subForm.config,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[r("el-table-column",{attrs:{prop:"province",label:"配送区域","min-width":"200"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.province,function(e,n){return r("block",{key:n},[t._v("\n "+t._s(0===n?"":"、")+t._s(e)+"\n ")])})}}])}),t._v(" "),r("el-table-column",{attrs:{prop:"start_num",label:t.tabText[t.subForm.type][0].title},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.start_num+" "+t.tabText[t.subForm.type][0].unit)+"\n ")]}}])}),t._v(" "),r("el-table-column",{attrs:{prop:"start_price",label:t.tabText[t.subForm.type][1].title},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.start_price+" "+t.tabText[t.subForm.type][1].unit)+"\n ")]}}])}),t._v(" "),r("el-table-column",{attrs:{prop:"add_num",label:t.tabText[t.subForm.type][2].title},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.add_num+" "+t.tabText[t.subForm.type][2].unit)+"\n ")]}}])}),t._v(" "),r("el-table-column",{attrs:{prop:"price",label:t.tabText[t.subForm.type][3].title},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.add_price+" "+t.tabText[t.subForm.type][3].unit)+"\n ")]}}])}),t._v(" "),r("el-table-column",{attrs:{label:"操作","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("div",{staticClass:"table-operate"},[r("lb-button",{attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(r){return t.toShowDialog("config",e.row)}}},[t._v(t._s(t.$t("action.edit")))]),t._v(" "),r("lb-button",{attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(r){return t.toDelItem("config",e.$index)}}},[t._v(t._s(t.$t("action.delete")))])],1)]}}])})],1)],1),t._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(e){return t.submitFormInfo("sub")}}},[t._v(t._s(t.$t("action.submit")))]),t._v(" "),r("lb-button",{on:{click:function(e){return t.$router.back(-1)}}},[t._v(t._s(t.$t("action.back")))])],1)],1)],1),t._v(" "),r("el-dialog",{attrs:{title:t.$t(t.configForm.id?"menu.SystemFreightAreaEdit":"menu.SystemFreightAreaAdd"),visible:t.showDialog.config,width:"550px",center:""},on:{"update:visible":function(e){return t.$set(t.showDialog,"config",e)}}},[r("el-form",{ref:"configForm",staticClass:"dialog-form",attrs:{model:t.configForm,rules:1===t.subForm.type?t.configFormRules:t.configNumFormRules,"label-width":"130px"}},[r("el-form-item",{attrs:{label:"配送区域",prop:"province"}},[r("el-cascader",{attrs:{"collapse-tags":"",options:t.areaOptions,props:{multiple:!0,checkStrictly:!0,label:"label",value:"label"},clearable:""},on:{change:t.changeProvince},model:{value:t.configForm.province,callback:function(e){t.$set(t.configForm,"province",e)},expression:"configForm.province"}})],1),t._v(" "),r("el-form-item",{attrs:{label:t.tabText[t.subForm.type][0].title,prop:"start_num"}},[r("el-input",{attrs:{placeholder:"请输入"+t.tabText[t.subForm.type][0].title},model:{value:t.configForm.start_num,callback:function(e){t.$set(t.configForm,"start_num",e)},expression:"configForm.start_num"}},[r("template",{slot:"append"},[t._v(t._s(t.tabText[t.subForm.type][0].unit))])],2)],1),t._v(" "),r("el-form-item",{attrs:{label:t.tabText[t.subForm.type][1].title,prop:"start_price"}},[r("el-input",{attrs:{placeholder:"请输入"+t.tabText[t.subForm.type][1].title},model:{value:t.configForm.start_price,callback:function(e){t.$set(t.configForm,"start_price",e)},expression:"configForm.start_price"}},[r("template",{slot:"append"},[t._v(t._s(t.tabText[t.subForm.type][1].unit))])],2)],1),t._v(" "),r("el-form-item",{attrs:{label:t.tabText[t.subForm.type][2].title,prop:"add_num"}},[r("el-input",{attrs:{placeholder:"请输入"+t.tabText[t.subForm.type][2].title},model:{value:t.configForm.add_num,callback:function(e){t.$set(t.configForm,"add_num",e)},expression:"configForm.add_num"}},[r("template",{slot:"append"},[t._v(t._s(t.tabText[t.subForm.type][2].unit))])],2)],1),t._v(" "),r("el-form-item",{attrs:{label:t.tabText[t.subForm.type][3].title,prop:"add_price"}},[r("el-input",{attrs:{placeholder:"请输入"+t.tabText[t.subForm.type][3].title},model:{value:t.configForm.add_price,callback:function(e){t.$set(t.configForm,"add_price",e)},expression:"configForm.add_price"}},[r("template",{slot:"append"},[t._v(t._s(t.tabText[t.subForm.type][3].unit))])],2)],1)],1),t._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(e){t.showDialog.config=!1}}},[t._v("取 消")]),t._v(" "),r("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(e){return t.submitFormInfo("config")}}},[t._v("确 定")])],1)],1)],1)},staticRenderFns:[]};var y=r("VU/8")(b,d,!1,function(t){r("dzZX")},"data-v-62899b0a",null);e.default=y.exports}}); \ No newline at end of file diff --git a/public/static/js/14.js b/public/static/js/14.js new file mode 100644 index 0000000..c10ef50 --- /dev/null +++ b/public/static/js/14.js @@ -0,0 +1 @@ +webpackJsonp([14],{"6wdW":function(e,t){},Nyb3:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=r("Xxa5"),a=r.n(s),l=r("exGp"),o=r.n(l),n={data:function(){return{loading:!1,navTitle:"",pagePermission:[],sendPayType:{1:{"-1":"已取消",2:"待提货",3:"已提货",7:"已完成"},2:{"-1":"已取消",2:"待配送",3:"配送中",7:"已完成"}},payType:{1:"微信支付",2:"余额支付",3:"支付宝支付"},orderType:{1:"认养订单",2:"土地订单"},orderText:{1:"claim_order",2:"land_order"},sendType:{1:"自提",2:"快递"},type:"",subForm:{id:0}}},created:function(){var e=this;return o()(a.a.mark(function t(){var r,s,l;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.$route.query,s=r.id,l=r.type,e.subForm.id=s,e.type=l,t.next=5,e.getDetail();case 5:e.routesItem.routes.map(function(t){"/order"===t.path&&t.children.map(function(t){"OrderDistribution"===t.name&&(e.pagePermission=t.meta.pagePermission[0].auth)})});case 6:case"end":return t.stop()}},t,e)}))()},methods:{getDetail:function(){var e=this;return o()(a.a.mark(function t(){var r,s,l,o;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.subForm.id,t.next=3,e.$api.claim.sendOrderInfo({id:r});case 3:if(s=t.sent,l=s.code,o=s.data,200===l){t.next=8;break}return t.abrupt("return");case 8:e.subForm=o;case 9:case"end":return t.stop()}},t,e)}))()},toSendOrder:function(){var e=this,t=this.subForm,r=t.id,s=t.send_type;this.$confirm("你确认要"+(1===s?"取货":"发货")+"吗?",this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){e.updateItem(r,s)}).catch(function(){})},updateItem:function(e,t){var r=this;return o()(a.a.mark(function s(){var l;return a.a.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:l=1===t?"sendOrderReceiving":"sendOrderSend",r.$api.claim[l]({id:e}).then(function(e){200===e.code?(r.$message.success(r.$t("tips.successOper")),r.getDetail()):r.getDetail()});case 2:case"end":return s.stop()}},s,r)}))()}},watch:{$route:function(e){var t=this;return o()(a.a.mark(function r(){var s,l;return a.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:s=e.query.id,1*(l=void 0===s?0:s)!==t.subForm.id&&t.getDetail(l);case 2:case"end":return r.stop()}},r,t)}))()}},filters:{handleTime:function(e,t){return 1===t?moment(1e3*e).format("YYYY-MM-DD"):2===t?moment(1e3*e).format("HH:mm:ss"):3===t?moment(1e3*e).format("YYYY-MM-DD HH:mm"):4===t?moment(1e3*e).format("HH:mm"):moment(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},i={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-shop-order-edit"},[r("top-nav",{attrs:{isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{attrs:{model:e.subForm,"label-width":"110px",size:"mini"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("lb-classify-title",{attrs:{title:"配送信息"}}),e._v(" "),r("el-form-item",{attrs:{label:"配送次数:"}},[r("div",[e._v("\n "+e._s("第"+e.subForm.times+"次"+(1===e.subForm.send_type?"自提":"配送"))+"\n ")])]),e._v(" "),r("el-form-item",{attrs:{label:"配送单号:"}},[r("div",[e._v(e._s(e.subForm.order_code))])]),e._v(" "),r("el-form-item",{attrs:{label:1==e.subForm.send_type?"自提时间:":"送货时间:"}},[r("div",[e._v("\n "+e._s(e._f("handleTime")(e.subForm.start_time,1))+"\n "+e._s(e._f("handleTime")(e.subForm.start_time,4))+" ~\n "+e._s(e._f("handleTime")(e.subForm.end_time,4))+"\n ")])]),e._v(" "),r("el-form-item",{attrs:{label:1==e.subForm.send_type?"自提地址:":"收货地址:"}},[r("div",[e._v("\n "+e._s(1===e.subForm.send_type?e.subForm.farmer_info.address:e.subForm.address)+"\n ")])]),e._v(" "),r("el-form-item",{attrs:{label:1==e.subForm.send_type?"自提人:":"收货人:"}},[r("div",[e._v(e._s(e.subForm.user_name+" "+e.subForm.mobile))])]),e._v(" "),e.subForm.text?r("el-form-item",{attrs:{label:"订单备注:"}},[r("div",{domProps:{innerHTML:e._s(e.subForm.text)}})]):e._e(),e._v(" "),e.pagePermission.includes("sendOrder")&&2===e.subForm.pay_type?r("el-form-item",{attrs:{label:""}},[r("div",[r("lb-button",{attrs:{size:"mini",type:"primary",plain:""},on:{click:e.toSendOrder}},[e._v(e._s(1===e.subForm.send_type?"取货":"发货"))])],1)]):e._e(),e._v(" "),e.subForm.pay_type>2?r("block",[2===e.subForm.send_type?r("el-form-item",{attrs:{label:"发货时间:"}},[r("div",[e._v(e._s(e._f("handleTime")(e.subForm.send_time)))])]):e._e(),e._v(" "),r("el-form-item",{attrs:{label:1===e.subForm.send_type?"取货时间:":"收货时间:"}},[r("div",[e._v(e._s(e._f("handleTime")(e.subForm.receiving_time)))])])],1):e._e(),e._v(" "),r("lb-classify-title",{attrs:{title:"订单信息"}}),e._v(" "),r("el-form-item",{attrs:{label:"订单状态:"}},[r("div",[e._v(e._s(e.sendPayType[e.subForm.send_type][e.subForm.pay_type]))])]),e._v(" "),e.subForm.transaction_id?r("el-form-item",{attrs:{label:"付款订单号:"}},[r("div",[e._v(e._s(e.subForm.transaction_id))])]):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"下单时间:"}},[r("div",[e._v(e._s(e._f("handleTime")(e.subForm.create_time)))])]),e._v(" "),2===e.subForm.send_type&&e.subForm.pay_time?r("el-form-item",{attrs:{label:"支付时间:"}},[r("div",[e._v(e._s(e._f("handleTime")(e.subForm.pay_time)))])]):e._e(),e._v(" "),1*e.subForm.discount>0?r("el-form-item",{attrs:{label:"卡券优惠:"}},[r("div",{staticClass:"c-warning"},[e._v("\n "+e._s("-¥"+e.subForm.discount)+"\n ")])]):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"实付金额:"}},[r("div",{staticClass:"c-warning"},[e._v("\n "+e._s("¥"+e.subForm.pay_price)+"\n ")])]),e._v(" "),2===e.subForm.send_type?r("el-form-item",{attrs:{label:"支付方式:"}},[r("div",[e._v(e._s(e.payType[e.subForm.pay_model]))])]):e._e(),e._v(" "),r("lb-classify-title",{attrs:{title:"农场信息"}}),e._v(" "),r("el-form-item",{attrs:{label:"农场名称:"}},[r("div",[e._v(e._s(e.subForm.farmer_info.title))])]),e._v(" "),r("el-form-item",{attrs:{label:"农场头像:"}},[r("div",[r("lb-cover",{attrs:{fileList:[{url:e.subForm.farmer_info.cover}],isToDel:!1,type:"more",size:"small",fileSize:1}})],1)]),e._v(" "),r("el-form-item",{attrs:{label:"农场地址:"}},[r("div",[e._v(e._s(e.subForm.farmer_info.address))]),e._v(" "),r("div",[e._v("\n "+e._s(e.subForm.farmer_info.user_name+" "+e.subForm.farmer_info.mobile)+"\n ")])]),e._v(" "),1===e.subForm.type?r("block",[r("lb-classify-title",{attrs:{title:"认养信息"}}),e._v(" "),r("el-form-item",{attrs:{label:"认养编号:"}},[r("div",[e._v(e._s(e.subForm.claim_order.claim_code))])]),e._v(" "),r("el-form-item",{attrs:{label:"认养项目:"}},[r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:[e.subForm.claim_order],"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[r("el-table-column",{attrs:{prop:"goods_cover",label:"商品图片"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("lb-image",{attrs:{src:e.row.goods_cover}})]}}],null,!1,121304493)}),e._v(" "),r("el-table-column",{attrs:{prop:"goods_name",label:"商品名称"}}),e._v(" "),r("el-table-column",{attrs:{prop:"goods_price",label:"价格"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+e.subForm.goods_price)+"\n ")]}}],null,!1,3458706020)}),e._v(" "),r("el-table-column",{attrs:{prop:"num",label:"数量"}})],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"起止时间:"}},[r("div",[e._v("\n "+e._s(e._f("handleTime")(e.subForm.claim_order.start_time,1))+" ~\n "+e._s(e._f("handleTime")(e.subForm.claim_order.end_time,1))+"\n ")])]),e._v(" "),r("el-form-item",{attrs:{label:"认养天数:"}},[r("div",[e._v(e._s(e.subForm.claim_order.cycle+"天"))])]),e._v(" "),r("el-form-item",{attrs:{label:"认养取名:"}},[r("div",[e._v(e._s(e.subForm.claim_order.name))])]),e._v(" "),r("el-form-item",{attrs:{label:"认养收获:"}},[r("div",[r("lb-cover",{attrs:{fileList:[{url:e.subForm.claim_order.harvest_cover}],isToDel:!1,type:"more",size:"small",fileSize:1}})],1),e._v(" "),r("div",[e._v(e._s(e.subForm.claim_order.harvest_text))])])],1):e._e(),e._v(" "),2===e.subForm.type?r("block",[r("lb-classify-title",{attrs:{title:"土地信息"}}),e._v(" "),r("el-table",{staticStyle:{width:"100%"},attrs:{data:[e.subForm.land_order],"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[r("el-table-column",{attrs:{prop:"goods_cover",label:"土地图片"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("lb-image",{attrs:{src:e.row.goods_cover}})]}}],null,!1,121304493)}),e._v(" "),r("el-table-column",{attrs:{prop:"goods_name",label:"土地名称"}}),e._v(" "),r("el-table-column",{attrs:{prop:"area",label:"土地面积"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.subForm.land_order.area+"m²")+"\n ")]}}],null,!1,3474298771)}),e._v(" "),r("el-table-column",{attrs:{prop:"massif_title",label:"服务类型"}}),e._v(" "),r("el-table-column",{attrs:{prop:"cycle",label:"租赁周期"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.subForm.land_order.cycle+"天")+"\n ")]}}],null,!1,4028737378)}),e._v(" "),r("el-table-column",{attrs:{prop:"end_time",label:"到期时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("handleTime")(e.subForm.land_order.end_time))+"\n ")]}}],null,!1,1594556058)})],1),e._v(" "),r("div",{staticClass:"space-lg"}),e._v(" "),r("div",{staticClass:"space-lg"}),e._v(" "),r("lb-classify-title",{attrs:{title:"种子管理"}}),e._v(" "),r("el-table",{staticStyle:{width:"100%"},attrs:{data:e.subForm.land_order.seed,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[r("el-table-column",{attrs:{prop:"imgs",label:"种子图片"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("lb-image",{attrs:{src:e.row.imgs}})]}}],null,!1,3765103775)}),e._v(" "),r("el-table-column",{attrs:{prop:"title",label:"种子名称"}}),e._v(" "),r("el-table-column",{attrs:{prop:"area",label:"种植面积"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.area+"m²")+"\n ")]}}],null,!1,2489800791)}),e._v(" "),r("el-table-column",{attrs:{prop:"goods_price",label:"价格"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+e.subForm.seed_price)+"\n ")]}}],null,!1,3655331875)}),e._v(" "),r("el-table-column",{attrs:{prop:"num",label:"数量"}})],1)],1):e._e()],1),e._v(" "),r("div",{staticClass:"space-lg"}),e._v(" "),r("lb-button",{attrs:{type:"primary"},on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)},staticRenderFns:[]};var m=r("VU/8")(n,i,!1,function(e){r("6wdW")},"data-v-fb534008",null);t.default=m.exports}}); \ No newline at end of file diff --git a/public/static/js/15.js b/public/static/js/15.js new file mode 100644 index 0000000..d8e5fa3 --- /dev/null +++ b/public/static/js/15.js @@ -0,0 +1 @@ +webpackJsonp([15],{HTa2:function(e,t){},uGCl:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Xxa5"),n=a.n(r),i=a("exGp"),s=a.n(i),o=a("Zz1P"),l=a.n(o),c={data:function(){return{loading:!1,searchForm:{page:1,limit:10,title:""},tableData:[],total:0}},activated:function(){this.getTableDataList(1)},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return s()(n.a.mark(function a(){var r,i,s;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.media.aboutUsList(t.searchForm);case 4:if(r=a.sent,i=r.code,s=r.data,t.loading=!1,200===i){a.next=10;break}return a.abrupt("return");case 10:t.tableData=s.data,t.total=s.total;case 12:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return s()(n.a.mark(function r(){return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.media.aboutUsUpdate({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page2,maxlength:"20","show-word-limit":"",placeholder:"请输入活动名称"},model:{value:t.subForm.title,callback:function(e){t.$set(t.subForm,"title",e)},expression:"subForm.title"}})],1),t._v(" "),r("el-form-item",{attrs:{label:"活动时间",prop:"start_time"}},[r("el-date-picker",{attrs:{type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","picker-options":t.pickerOptions,"value-format":"timestamp",disabled:t.atv_status>1},model:{value:t.subForm.start_time,callback:function(e){t.$set(t.subForm,"start_time",e)},expression:"subForm.start_time"}})],1),t._v(" "),r("el-form-item",{attrs:{label:"每人限购",prop:"is_limit"}},[r("el-radio-group",{attrs:{disabled:t.atv_status>2},model:{value:t.subForm.is_limit,callback:function(e){t.$set(t.subForm,"is_limit",e)},expression:"subForm.is_limit"}},[r("el-radio",{attrs:{label:1}},[t._v(t._s(t.$t("action.ON")))]),t._v(" "),r("el-radio",{attrs:{label:0}},[t._v(t._s(t.$t("action.OFF")))])],1)],1),t._v(" "),t.subForm.is_limit?r("el-form-item",{attrs:{label:"限购数量",prop:"limit_num"}},[r("el-input",{attrs:{disabled:t.atv_status>2,placeholder:"请输入限购数量"},model:{value:t.subForm.limit_num,callback:function(e){t.$set(t.subForm,"limit_num",e)},expression:"subForm.limit_num"}}),t._v(" "),r("lb-tool-tips",[t._v("每人限购数量")])],1):t._e(),t._v(" "),r("el-form-item",{attrs:{label:"订单取消时间",prop:"over_time"}},[r("block",[t._v(" 买家 ")]),t._v(" "),r("el-input",{staticStyle:{width:"160px"},attrs:{disabled:t.atv_status>2,placeholder:"请输入订单取消时间"},model:{value:t.subForm.over_time,callback:function(e){t.$set(t.subForm,"over_time",e)},expression:"subForm.over_time"}}),t._v(" "),r("block",[t._v(" 分钟未支付订单,订单取消")])],1),t._v(" "),r("el-form-item",[t.atv_status<3?r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(e){return t.submitFormInfo("sub")}}},[t._v(t._s(t.$t("action.submit")))]):t._e(),t._v(" "),r("lb-button",{on:{click:function(e){return t.$router.back(-1)}}},[t._v(t._s(t.$t("action.back")))])],1)],1)],1)],1)},staticRenderFns:[]};var c=r("VU/8")(u,m,!1,function(t){r("ZbIM")},"data-v-e09ddeda",null);e.default=c.exports},ZbIM:function(t,e){}}); \ No newline at end of file diff --git a/public/static/js/17.js b/public/static/js/17.js new file mode 100644 index 0000000..e187f97 --- /dev/null +++ b/public/static/js/17.js @@ -0,0 +1 @@ +webpackJsonp([17],{"A/Bp":function(t,e){},cRoC:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=a("mvHQ"),s=a.n(r),i=a("Xxa5"),o=a.n(i),n=a("exGp"),l=a.n(n),m={data:function(){var t=this;return{loading:!1,statusText:{1:{type:"info",text:"申请中"},2:{type:"",text:"已授权"},3:{type:"danger",text:"取消授权"},4:{type:"danger",text:"已驳回"}},pickerOptions:{disabledDate:function(t){return t.getTime()>Date.now()}},searchForm:{page:1,limit:10,status:0,start_time:"",end_time:"",name:""},tableData:[],total:0,count:{},showApply:!1,applyForm:{title:"",status:"",sh_text:""},subForm:{id:0,status:0,sh_text:""},subFormRules:{status:{required:!0,validator:function(e,a,r){t.subForm.status?r():r(new Error("请选择审核结果"))},trigger:"blur"}}}},created:function(){this.getTableDataList(1)},methods:{resetForm:function(t){this.$refs[t].resetFields(),this.getTableDataList(1)},handleSizeChange:function(t){this.searchForm.limit=t,this.handleCurrentChange(1)},handleCurrentChange:function(t){this.searchForm.page=t,this.getTableDataList()},toChange:function(t){var e=this;return l()(o.a.mark(function a(){return o.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:e.searchForm.status=t,e.getTableDataList(1);case 2:case"end":return a.stop()}},a,e)}))()},getTableDataList:function(t){var e=this;return l()(o.a.mark(function a(){var r,i,n,l,m,p,c,u,v,d;return o.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return t&&(e.searchForm.page=1),e.loading=!0,r=JSON.parse(s()(e.searchForm)),(i=r.start_time)&&i.length>0?(r.start_time=parseInt(i[0]/1e3),r.end_time=parseInt(i[1]/1e3)+86400-1):(r.start_time="",r.end_time=""),a.next=7,e.$api.farmer.farmerList(r);case 7:if(n=a.sent,l=n.code,m=n.data,e.loading=!1,200===l){a.next=13;break}return a.abrupt("return");case 13:p=m.all,c=m.nopass,u=m.ing,v=m.pass,d=m.total,e.tableData=m.data,e.total=d,e.count={all:p,nopass:c,ing:u,pass:v};case 17:case"end":return a.stop()}},a,e)}))()},toShowApply:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return l()(o.a.mark(function a(){var r,s,i;return o.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t.$api.farmer.farmerInfo({id:e});case 2:if(r=a.sent,s=r.code,i=r.data,200===s){a.next=7;break}return a.abrupt("return");case 7:["imgs","idcard_imgs"].map(function(t){i[t]=i[t].map(function(t){return{url:t}})}),t.applyForm=i,t.subForm={id:e,status:2,sh_text:""},t.showApply=!t.showApply;case 12:case"end":return a.stop()}},a,t)}))()},confirmDel:function(t,e){var a=this;this.$confirm(this.$t(3===e?"tips.confirmNoPass":"tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){a.updateItem(t,e)}).catch(function(){})},updateItem:function(t,e){var a=this;return l()(o.a.mark(function r(){return o.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.farmer.farmerUpdate({id:t,status:e}).then(function(t){if(200===t.code)a.$message.success(a.$t(-1===e?"tips.successDel":"tips.successOper")),-1===e&&(a.searchForm.page=a.searchForm.pageDate.now()}},searchForm:{page:1,limit:10,status:0,start_time:"",end_time:"",name:""},tableData:[],total:0,count:{},showApply:!1,applyForm:{title:"",status:"",sh_text:""},subForm:{id:0,status:0,sh_text:""},subFormRules:{status:{required:!0,validator:function(e,a,s){t.subForm.status?s():s(new Error("请选择审核结果"))},trigger:"blur"}}}},created:function(){this.getTableDataList(1)},methods:{resetForm:function(t){this.$refs[t].resetFields(),this.getTableDataList(1)},handleSizeChange:function(t){this.searchForm.limit=t,this.handleCurrentChange(1)},handleCurrentChange:function(t){this.searchForm.page=t,this.getTableDataList()},toChange:function(t){var e=this;return l()(n.a.mark(function a(){return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:e.searchForm.status=t,e.getTableDataList(1);case 2:case"end":return a.stop()}},a,e)}))()},getTableDataList:function(t){var e=this;return l()(n.a.mark(function a(){var s,i,o,l,m,u,c,p,h,v;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return t&&(e.searchForm.page=1),e.loading=!0,s=JSON.parse(r()(e.searchForm)),(i=s.start_time)&&i.length>0?(s.start_time=parseInt(i[0]/1e3),s.end_time=parseInt(i[1]/1e3)+86400-1):(s.start_time="",s.end_time=""),a.next=7,e.$api.distribution.resellerList(s);case 7:if(o=a.sent,l=o.code,m=o.data,e.loading=!1,200===l){a.next=13;break}return a.abrupt("return");case 13:u=m.all,c=m.nopass,p=m.ing,h=m.pass,v=m.total,e.tableData=m.data,e.total=v,e.count={all:u,nopass:c,ing:p,pass:h};case 17:case"end":return a.stop()}},a,e)}))()},toShowApply:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return l()(n.a.mark(function a(){var s,r,i;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t.$api.distribution.resellerInfo({id:e});case 2:if(s=a.sent,r=s.code,i=s.data,200===r){a.next=7;break}return a.abrupt("return");case 7:t.applyForm=i,t.subForm={id:e,status:2,sh_text:""},t.showApply=!t.showApply;case 10:case"end":return a.stop()}},a,t)}))()},confirmDel:function(t,e){var a=this;this.$confirm(this.$t(3===e?"tips.confirmNoPass":"tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){a.updateItem(t,e)}).catch(function(){})},updateItem:function(t,e){var a=this;return l()(n.a.mark(function s(){return n.a.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:a.$api.distribution.resellerUpdate({id:t,status:e}).then(function(t){if(200===t.code)a.$message.success(a.$t(-1===e?"tips.successDel":"tips.successOper")),-1===e&&(a.searchForm.page=a.searchForm.page100){var a=r.test(i)?"取值范围不超过100":"最多2位小数";s(new Error("请输入"+t.text+","+a))}else s();else s(new Error("请输入"+t.text));else s()};return{navTitle:"",base_cate:[],base_store:[],base_freight:[],specIsImg:!1,copySpecsItem:[],subForm:{id:0,goods_name:"",cate_id:[],store:"",cover:[],imgs:[],image_url:"",video:"",desc:"",text:"",sale_num:0,send_tmpl_id:"",send_template_type:1,weight:"",is_fx:0,one_fx:"",two_fx:"",top:0,specsItem:[],specsTable:[],multipleSelection:[]},subFormRules:{goods_name:{required:!0,validator:this.$reg.isNoEmpty,text:"商品名称",reg_type:2,trigger:"blur"},cate_id:{required:!0,type:"array",message:"请选择所属分类",trigger:"blur"},store:{required:!0,type:"number",message:"请选择所属店铺",trigger:"blur"},cover:{required:!0,type:"array",message:"请上传封面图",trigger:"blur"},imgs:{required:!0,type:"array",message:"请上传轮播图",trigger:"blur"},desc:{required:!0,validator:this.$reg.isNoEmpty,text:"商品描述",reg_type:2,trigger:"blur"},text:{required:!0,validator:this.$reg.isNoEmpty,text:"商品详情",reg_type:2,trigger:"blur"},sale_num:{required:!0,validator:this.$reg.valiDateInt,text:"虚拟销售量",trigger:"blur"},send_tmpl_id:{required:!0,type:"number",message:"请选择运费模版",trigger:"blur"},weight:{required:!0,validator:function(t,i,s){2===e.subForm.send_template_type?i?/^(([0-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/.test(i)?s():s(new Error("请输入"+t.text+",最多2位小数")):s(new Error("请输入"+t.text)):s()},text:"一级分销",trigger:"blur"},is_fx:{required:!0,type:"number",message:"请选择",trigger:"blur"},one_fx:{required:!0,validator:t,text:"一级分销",trigger:["blur","change"]},two_fx:{required:!0,validator:t,text:"二级分销",trigger:["blur","change"]},top:{required:!0,type:"number",message:"请输入排序值",trigger:"blur"}},dialogSwitch:!1,dialogTitle:"添加规格",dialogType:"add",dialogIndex:"",specsName:"",batchValue:"0",dialogPriceTitle:"",dialogPriceVisible:!1}},created:function(){var e=this;return v()(b.a.mark(function t(){var i;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.$route.query.id,e.id=i,e.navTitle=e.$t(i?"menu.ShopGoodsEdit":"menu.ShopGoodsAdd"),t.next=5,e.getBaseInfo();case 5:if(!i){t.next=8;break}return t.next=8,e.getDetail();case 8:case"end":return t.stop()}},t,e)}))()},methods:{getBaseInfo:function(){var e=this;return v()(b.a.mark(function t(){var i,s,r,a;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.a.all([e.$api.shop.goodsCateSelect(),e.$api.shop.tmplSelect()]);case 2:i=t.sent,s=p()(i,2),r=s[0],a=s[1],e.base_cate=r.data,e.base_freight=a.data;case 8:case"end":return t.stop()}},t,e)}))()},getFarmerSelectList:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return v()(b.a.mark(function e(){var s,r,a;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i||(t.subForm.store=[],i=t.subForm.cate_id),e.next=3,t.$api.farmer.farmerSelectList({cate_type:3,cate_id:i,type:2});case 3:if(s=e.sent,r=s.code,a=s.data,200===r){e.next=8;break}return e.abrupt("return");case 8:t.base_store=a;case 9:case"end":return e.stop()}},e,t)}))()},getDetail:function(){var e=this;return v()(b.a.mark(function t(){var i,s,r,a,n,o,l,c,u,m;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.id,t.next=3,e.$api.shop.goodsInfo({id:i});case 3:if(s=t.sent,r=s.code,a=s.data,200===r){t.next=8;break}return t.abrupt("return");case 8:return n=a.goods_info,o=a.spe_info,n.cover=[{url:n.cover}],n.imgs=n.imgs.map(function(e){return{url:e}}),n.store=n.store[0],l=!1,o.text.forEach(function(e){e.inputVisible=!1,e.inputValue="",1===e.is_img&&(l=!0,e.cate.map(function(e){e.image&&(e.image=[{url:e.image}])}))}),e.specIsImg=l,c=o.text,u=o.price,n.specsItem=c,n.specsTable=u,n.multipleSelection=[],e.copySpecsItem=u,t.next=22,e.getFarmerSelectList("",n.cate_id);case 22:for(m in e.subForm)e.subForm[m]=n[m];case 23:case"end":return t.stop()}},t,e)}))()},changeSendTmpl:function(){var e=this.subForm.send_tmpl_id,t=void 0===e?0:e,i=this.base_freight.filter(function(e){return e.id===t});if(i&&i.length>0){var s=i[0].type;this.subForm.send_template_type=s}},createTableData:function(){var e=this.subForm.specsItem;if(0===e.length)this.subForm.specsTable=[];else{var t=e.map(function(e){return e.cate}),i=this.handleSpecsData(t);this.copySpecsItem.forEach(function(e){i.forEach(function(t){e.id==t.id&&(t.price=e.price,t.original_price=e.original_price,t.stock=e.stock)})}),this.subForm.specsTable=i}},handleSpecsData:function(e){if(e.length>1){for(var t=e[0].length,i=e[1].length,s=e.slice(0),r=[],a=0;a50?this.$message.error("规格值最多只能输入50个字!"):(this.subForm.specsItem[e].cate.push({title:i,id:h()(),price:"0.00",original_price:"0.00",stock:0,image:""}),this.createTableData())),this.subForm.specsItem[e].inputVisible=!1,this.subForm.specsItem[e].inputValue=""):this.$message.error("请输入规格值")},showInput:function(e){var t=this;this.subForm.specsItem[e].inputVisible=!0,this.$nextTick(function(i){t.$refs["saveTagInput"+e][0].$refs.input.focus()})},changeCheckBox:function(e){var t=this;this.authList.map(function(i){t.subForm[i.key]=e.includes(i.title)?1:0})},addSpecsName:function(e){var t=JSON.parse(l()(this.specsName)).replace(/^\s+|\s+$/g,"");if(2!==e||t){if(2===e&&t)-1===this.subForm.specsItem.map(function(e){return e.title}).indexOf(t)?"add"===this.dialogType?this.subForm.specsItem.push({inputVisible:!1,inputValue:"",title:t,pid:h()(),cate:[],is_img:0}):this.subForm.specsItem[this.dialogIndex].title=t:this.$message.error("请勿添加相同的规格名!");this.specsName="",this.dialogIndex="",this.dialogSwitch=!1}else this.$message.error("请添加规格名!")},addOrEditSpecsTitle:function(e,t){"add"===e?this.dialogTitle="添加规格":"edit"===e&&(this.dialogTitle="编辑规格"),this.dialogSwitch=!0,this.dialogType=e,this.specsName=this.subForm.specsItem[t].title||"",t>=0&&(this.dialogIndex=t)},getGoodsCover:function(e){this.subForm.cover=e},getSpecImg:function(e,t,i){this.subForm.specsItem[t].cate[i].image=e.length>0?e:""},setSpecImg:function(e){var t=this;this.specIsImg?1===this.subForm.specsItem[e].is_img?(this.subForm.specsItem[e].is_img=0,this.specIsImg=!1):this.$confirm(this.$t("tips.confirmDeleteSpecImage"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.subForm.specsItem[e].cate.length<1&&t.$confirm("请先添加规格值",t.$t("tips.reminder"),{confirmButtonText:t.$t("action.comfirm"),cancelButtonText:t.$t("action.cancel"),type:"warning"}).then(function(){t.showInput(e)});var i=t.subForm.specsItem;i.map(function(t,i){t.is_img=e===i?1:0,e===i&&t.cate.map(function(e){e.image&&(e.image="string"==typeof e.image?[{url:e.image}]:e.image)})}),t.subForm.specsItem=i}).catch(function(){}):(this.specIsImg=!0,this.subForm.specsItem[e].is_img=1,this.subForm.specsItem[e].cate.length<1&&this.$confirm("请先添加规格值",this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.showInput(e)}))},selectedFiles:function(e,t){var i;(i=this.subForm[t]).push.apply(i,n()(e))},moveFiles:function(e,t){this.subForm[t]=e},getVideo:function(e){this.subForm.video=e[e.length-1].url},submitFormInfo:function(e){var t=this,i=!0;if(this.$refs[e+"Form"].validate(function(e){e||(i=!1)}),i){var s=JSON.parse(l()(this.subForm));if(!s.specsTable.length)return this.$message.error("请填写规格值");if(this.checkSpecsItems(s.specsTable))return this.$message.error("请填写规格的价格和库存");var r="";if(s.specsItem.map(function(e){e.cate.length<1&&(r="规格名【"+e.title+"】暂未添加规格值,请先添加规格!"),1===e.is_img&&e.cate.map(function(t){t.image?t.image=t.image[0].url:r="规格名【"+e.title+"】暂未添加规格图片,请先添加规格图片!"})}),r)return void this.$message.error(r);var a=s.is_fx,n=s.one_fx,o=s.two_fx;if(1===a&&1*n+1*o>100)return void this.$message.error("分销累计总和不能大于100%");s.cover=s.cover[0].url,s.imgs=s.imgs.map(function(e){return e.url}),s.store=[s.store],delete s.send_template_type,delete s.multipleSelection;var c=s.id?"goodsUpdate":"goodsAdd";this.$api.shop[c](s).then(function(e){200===e.code&&(t.$message.success(t.$t("tips.successSub")),t.$router.back(-1))})}},checkSpecsItems:function(e){return e.some(function(e){return void 0===e.price||""===e.price||void 0===e.stock||""===e.stock})}},computed:r()({},Object(_.mapGetters)(["adSwitch"])),watch:{"subForm.text":function(e,t){e&&!t&&this.$refs.subForm.clearValidate("text")}}},F={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"lb-goods-edit"},[i("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),i("div",{staticClass:"page-main"},[i("lb-classify-title",{attrs:{title:"基本信息"}}),e._v(" "),i("el-form",{ref:"subForm",staticClass:"basic-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"180px"},nativeOn:{submit:function(e){e.preventDefault()}}},[i("el-form-item",{attrs:{label:"商品名称",prop:"goods_name"}},[i("el-input",{attrs:{placeholder:"请输入商品名称",maxlength:"40","show-word-limit":""},model:{value:e.subForm.goods_name,callback:function(t){e.$set(e.subForm,"goods_name",t)},expression:"subForm.goods_name"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"所属分类",prop:"cate_id"}},[i("el-select",{attrs:{multiple:"",filterable:"",closable:"","collapse-tags":"",placeholder:"请选择"},on:{change:function(t){return e.getFarmerSelectList(t)}},model:{value:e.subForm.cate_id,callback:function(t){e.$set(e.subForm,"cate_id",t)},expression:"subForm.cate_id"}},e._l(e.base_cate,function(e){return i("el-option",{key:e.title,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),e.subForm.cate_id.length>0?i("el-form-item",{attrs:{label:"所属店铺",prop:"store"}},[i("el-select",{attrs:{filterable:"",closable:"","collapse-tags":"",placeholder:"请选择所属店铺"},model:{value:e.subForm.store,callback:function(t){e.$set(e.subForm,"store",t)},expression:"subForm.store"}},e._l(e.base_store,function(e){return i("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1):e._e(),e._v(" "),i("lb-classify-title",{attrs:{title:"规格信息"}}),e._v(" "),i("div",{staticClass:"specs-info"},[i("div",{staticClass:"specs-item"},[i("div",{staticClass:"item-label"},[i("span",{staticClass:"require"},[e._v("*")]),e._v(" "),i("span",[e._v("创建商品规格")])]),e._v(" "),i("div",{staticClass:"item-value"},[i("lb-button",{attrs:{type:"primary",plain:"",icon:"el-icon-plus"},on:{click:function(t){return e.addOrEditSpecsTitle("add")}}},[e._v("添加规格")])],1)]),e._v(" "),e._l(e.subForm.specsItem,function(t,s){return i("div",{key:s,staticClass:"specs-item"},[i("div",{staticClass:"item-label"}),e._v(" "),i("div",{staticClass:"item-value"},[i("div",{staticClass:"item-value-specs-name"},[i("span",[e._v("规格名: "+e._s(t.title))]),e._v(" "),i("lb-button",{attrs:{type:"warning",size:"mini",plain:"",icon:"el-icon-edit"},on:{click:function(t){return e.addOrEditSpecsTitle("edit",s)}}},[e._v(e._s(e.$t("action.edit")))]),e._v(" "),i("lb-button",{attrs:{type:"danger",size:"mini",plain:"",icon:"el-icon-delete"},on:{click:function(t){return e.delSpecsItem(s)}}},[e._v(e._s(e.$t("action.delete")))]),e._v(" "),i("lb-button",{attrs:{type:e.specIsImg?1===t.is_img?"primary":"info":"primary",size:"mini",plain:"",icon:e.specIsImg&&1===t.is_img?"el-icon-remove":"el-icon-circle-plus"},on:{click:function(t){return e.setSpecImg(s)}}},[e._v(e._s(e.$t("action.addImage")))])],1),e._v(" "),i("div",{staticClass:"flex-warp"},[e._l(t.cate,function(r,a){return i("div",{key:a,staticClass:"specsItem-tag-img"},[i("el-tag",{attrs:{closable:"",size:"medium","disable-transitions":!1,effect:"plain",type:"success"},on:{close:function(t){return e.handleCloseTag(s,a)}}},[e._v(e._s(r.title))]),e._v(" "),1===t.is_img?i("div",{staticStyle:{"margin-top":"5px"}},[i("lb-cover",{attrs:{fileList:r.image,size:"small"},on:{selectedFiles:function(t){return e.getSpecImg(t,s,a)}}})],1):e._e()],1)}),e._v(" "),i("div",{staticClass:"specsItem-tag-img"},[i("el-input",{directives:[{name:"show",rawName:"v-show",value:t.inputVisible,expression:"item.inputVisible"}],ref:"saveTagInput"+s,refInFor:!0,staticStyle:{width:"300px"},attrs:{type:"textarea",rows:2,resize:"none",maxlength:"50","show-word-limit":""},on:{blur:function(t){return e.handleInputConfirm(s)}},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleInputConfirm(s)}},model:{value:t.inputValue,callback:function(i){e.$set(t,"inputValue",i)},expression:"item.inputValue"}}),e._v(" "),i("el-button",{directives:[{name:"show",rawName:"v-show",value:!t.inputVisible,expression:"!item.inputVisible"}],staticClass:"button-new-tag",staticStyle:{"margin-top":"5px"},attrs:{size:"mini"},on:{click:function(t){return e.showInput(s)}}},[e._v("\n + 添加规格值\n ")])],1)],2)])])}),e._v(" "),i("div",{staticClass:"specs-item"},[i("div",{staticClass:"item-label item-label-table"}),e._v(" "),i("div",{staticClass:"item-value"},[i("el-table",{ref:"multipleTable",staticStyle:{width:"800px"},attrs:{"header-cell-style":{background:"#f5f7fa",color:"#606266"},"tooltip-effect":"dark",data:e.subForm.specsTable},on:{"selection-change":e.handleSelectionChange}},[i("el-table-column",{attrs:{type:"selection",label:"全选",width:"45"}}),e._v(" "),i("el-table-column",{attrs:{prop:"title",label:"规格组合名称"}}),e._v(" "),i("el-table-column",{attrs:{prop:"original_price",label:"划线价",width:"140"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input-number",{staticClass:"lb-input-num-mini",attrs:{size:"mini",controls:!1,precision:2,min:0},model:{value:t.row.original_price,callback:function(i){e.$set(t.row,"original_price",i)},expression:"scope.row.original_price"}})]}}])}),e._v(" "),i("el-table-column",{attrs:{prop:"price",label:"出售价",width:"140"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input-number",{staticClass:"lb-input-num-mini",attrs:{size:"mini",controls:!1,precision:2,min:0},model:{value:t.row.price,callback:function(i){e.$set(t.row,"price",i)},expression:"scope.row.price"}})]}}])}),e._v(" "),i("el-table-column",{attrs:{prop:"stock",label:"库存",width:"140"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input-number",{staticClass:"lb-input-num-mini",attrs:{size:"mini",controls:!1,precision:0,min:0},model:{value:t.row.stock,callback:function(i){e.$set(t.row,"stock",i)},expression:"scope.row.stock"}})]}}])})],1),e._v(" "),i("div",{staticClass:"table-bot"},[i("span",[e._v("已选 "+e._s(e.subForm.multipleSelection.length))]),e._v(" "),i("span",[e._v("批量设置:")]),e._v(" "),i("el-link",{attrs:{disabled:0===e.subForm.multipleSelection.length,type:"primary"},on:{click:function(t){return e.batchSetting("划线价")}}},[e._v("划线价")]),e._v(" "),i("el-link",{attrs:{disabled:0===e.subForm.multipleSelection.length,type:"primary"},on:{click:function(t){return e.batchSetting("出售价")}}},[e._v("出售价")]),e._v(" "),i("el-link",{attrs:{disabled:0===e.subForm.multipleSelection.length,type:"primary"},on:{click:function(t){return e.batchSetting("库存")}}},[e._v("库存")])],1)],1)])],2),e._v(" "),i("div",{staticStyle:{height:"20px"}}),e._v(" "),i("lb-classify-title",{attrs:{title:"商品信息"}}),e._v(" "),i("el-form-item",{attrs:{label:"封面图",prop:"cover"}},[i("lb-cover",{attrs:{fileList:e.subForm.cover},on:{selectedFiles:e.getGoodsCover}}),e._v(" "),i("lb-tool-tips",[e._v("图片建议尺寸:750 * 750")])],1),e._v(" "),i("el-form-item",{attrs:{label:"轮播图",prop:"imgs"}},[i("lb-cover",{attrs:{type:"more",tips:"750 * 760",fileList:e.subForm.imgs},on:{selectedFiles:function(t){return e.selectedFiles(t,"imgs")},moveFiles:function(t){return e.moveFiles(t,"imgs")}}})],1),e._v(" "),i("el-form-item",{attrs:{label:"轮播图链接",prop:"image_url"}},[i("el-input",{attrs:{placeholder:"请输入轮播图跳转链接"},model:{value:e.subForm.image_url,callback:function(t){e.$set(e.subForm,"image_url",t)},expression:"subForm.image_url"}}),e._v(" "),i("lb-tool-tips",[e._v("点击轮播图跳转网址")])],1),e._v(" "),i("el-form-item",{attrs:{label:"视频",prop:"video"}},[i("div",{staticClass:"item-warp"},[i("div",{staticClass:"upload-file-warp"},[i("input",{directives:[{name:"model",rawName:"v-model",value:e.subForm.video,expression:"subForm.video"}],staticClass:"choice-file-input",attrs:{placeholder:"选择视频文件"},domProps:{value:e.subForm.video},on:{input:function(t){t.target.composing||e.$set(e.subForm,"video",t.target.value)}}}),e._v(" "),i("lb-cover",{attrs:{type:"button",fileType:"video"},on:{selectedFiles:e.getVideo}})],1)])]),e._v(" "),i("el-form-item",{attrs:{label:"商品描述",prop:"desc"}},[i("el-input",{attrs:{type:"textarea",rows:5,maxlength:"50","show-word-limit":"",resize:"none",placeholder:"请输入商品描述"},model:{value:e.subForm.desc,callback:function(t){e.$set(e.subForm,"desc",t)},expression:"subForm.desc"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"商品详情",prop:"text"}},[i("lb-ueditor",{attrs:{destroy:!0},model:{value:e.subForm.text,callback:function(t){e.$set(e.subForm,"text",t)},expression:"subForm.text"}})],1),e._v(" "),i("lb-classify-title",{attrs:{title:"相关设置"}}),e._v(" "),i("el-form-item",{attrs:{label:"虚拟销售量",prop:"sale_num"}},[i("el-input",{attrs:{placeholder:"请输入虚拟销售量"},model:{value:e.subForm.sale_num,callback:function(t){e.$set(e.subForm,"sale_num",e._n(t))},expression:"subForm.sale_num"}}),e._v(" "),i("lb-tool-tips",[e._v("商品虚拟销售量,用于小程序展示给用户看,用户购买商品后会累加相应购买数量")])],1),e._v(" "),i("el-form-item",{attrs:{label:"运费模版",prop:"send_tmpl_id"}},[i("el-select",{attrs:{filterable:"","collapse-tags":"",placeholder:"请选择运费模版"},on:{change:e.changeSendTmpl},model:{value:e.subForm.send_tmpl_id,callback:function(t){e.$set(e.subForm,"send_tmpl_id",t)},expression:"subForm.send_tmpl_id"}},e._l(e.base_freight,function(e){return i("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1),e._v(" "),i("div",{staticClass:"f-caption c-link cursor-pointer",on:{click:function(t){return e.$router.push("/sys/freight/edit")}}},[e._v("\n 还没有运费模版?立即创建\n "),i("lb-tool-tips",[e._v("运费模版支持按重量计费和按件数计费两种方式,计费方式按照商品累加运费")])],1)],1),e._v(" "),2===e.subForm.send_template_type?i("el-form-item",{attrs:{label:"商品重量",prop:"weight"}},[i("el-input",{attrs:{placeholder:"请输入商品重量"},model:{value:e.subForm.weight,callback:function(t){e.$set(e.subForm,"weight",t)},expression:"subForm.weight"}},[i("template",{slot:"append"},[e._v("kg")])],2)],1):e._e(),e._v(" "),i("el-form-item",{attrs:{label:"是否开启分销",prop:"is_fx"}},[i("el-radio-group",{model:{value:e.subForm.is_fx,callback:function(t){e.$set(e.subForm,"is_fx",t)},expression:"subForm.is_fx"}},[i("el-radio",{attrs:{label:1}},[e._v(e._s(e.$t("action.ON")))]),e._v(" "),i("el-radio",{attrs:{label:0}},[e._v(e._s(e.$t("action.OFF")))])],1)],1),e._v(" "),1===e.subForm.is_fx?i("block",[i("el-form-item",{attrs:{label:"一级分销",prop:"one_fx"}},[i("el-input",{attrs:{placeholder:"请输入一级分销"},model:{value:e.subForm.one_fx,callback:function(t){e.$set(e.subForm,"one_fx",t)},expression:"subForm.one_fx"}},[i("template",{slot:"append"},[e._v("%")])],2)],1),e._v(" "),i("el-form-item",{attrs:{label:"二级分销",prop:"two_fx"}},[i("el-input",{attrs:{placeholder:"请输入二级分销"},model:{value:e.subForm.two_fx,callback:function(t){e.$set(e.subForm,"two_fx",t)},expression:"subForm.two_fx"}},[i("template",{slot:"append"},[e._v("%")])],2)],1)],1):e._e(),e._v(" "),i("el-form-item",{attrs:{label:"排序值",prop:"top"}},[i("el-input-number",{staticClass:"lb-input-number",attrs:{controls:!1,precision:0,min:0,placeholder:"请输入排序值"},model:{value:e.subForm.top,callback:function(t){e.$set(e.subForm,"top",t)},expression:"subForm.top"}}),e._v(" "),i("lb-tool-tips",[e._v("值越大, 排序越靠前")])],1)],1),e._v(" "),i("div",{staticClass:"space-body"})],1),e._v(" "),i("el-dialog",{attrs:{title:e.dialogTitle,visible:e.dialogSwitch,width:"400px",center:""},on:{"update:visible":function(t){e.dialogSwitch=t}},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.addSpecsName(2)}}},[i("div",{staticClass:"dialog-inner"},[i("el-input",{attrs:{type:"textarea",rows:4,resize:"none",maxlength:"50","show-word-limit":"",placeholder:"请输入规格名"},model:{value:e.specsName,callback:function(t){e.specsName=t},expression:"specsName"}})],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){return e.addSpecsName(1)}}},[e._v(e._s(e.$t("action.cancel")))]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.addSpecsName(2)}}},[e._v(e._s(e.$t("action.comfirm")))])],1)]),e._v(" "),i("el-dialog",{attrs:{title:"批量设置"+e.dialogPriceTitle,visible:e.dialogPriceVisible,width:"300px",center:""},on:{"update:visible":function(t){e.dialogPriceVisible=t}},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.setBatchPrice(2)}}},[i("div",{staticClass:"dialog-inner"},["库存"===e.dialogPriceTitle?i("el-input-number",{attrs:{controls:!1,precision:0,min:0},model:{value:e.batchValue,callback:function(t){e.batchValue=t},expression:"batchValue"}}):i("el-input-number",{attrs:{controls:!1,precision:2,min:0},model:{value:e.batchValue,callback:function(t){e.batchValue=t},expression:"batchValue"}})],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){return e.setBatchPrice(1)}}},[e._v(e._s(e.$t("action.cancel")))]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.setBatchPrice(2)}}},[e._v(e._s(e.$t("action.comfirm")))])],1)]),e._v(" "),i("div",{staticClass:"fiexd",staticStyle:{bottom:"0px"},style:{right:e.adSwitch?"242px":"22px"}},[i("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(t){return e.submitFormInfo("sub")}}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),i("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"default"},on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)},staticRenderFns:[]};var y=i("VU/8")(x,F,!1,function(e){i("Z46U")},"data-v-d4bee76e",null);t.default=y.exports},Z46U:function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/21.js b/public/static/js/21.js new file mode 100644 index 0000000..241a9f3 --- /dev/null +++ b/public/static/js/21.js @@ -0,0 +1 @@ +webpackJsonp([21],{"9w+x":function(e,t){},"HhR/":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a("Xxa5"),r=a.n(n),i=a("exGp"),s=a.n(i),o={data:function(){return{connectType:{1:"农场",2:"文章",3:"查看大图"},loading:!1,searchForm:{page:1,limit:10,type:1},tableData:[],total:0}},activated:function(){this.getTableDataList(1)},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return s()(r.a.mark(function a(){var n,i,s;return r.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.media.bannerList(t.searchForm);case 4:if(n=a.sent,i=n.code,s=n.data,t.loading=!1,200===i){a.next=10;break}return a.abrupt("return");case 10:t.tableData=s.data,t.total=s.total;case 12:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return s()(r.a.mark(function n(){return r.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:a.$api.media.bannerUpdate({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page100){var i=o.test(r)?"取值范围不超过100":"最多2位小数";s(new Error("请输入"+t.text+","+i))}else s();else s(new Error("请输入"+t.text));else s()};return{id:"",navTitle:"",base_cate:[],base_farmer:[],base_machine:[],base_monitor:[],base_freight:[],checkList:[],authList:[{title:"到店自提",key:"is_self"},{title:"配送上门",key:"is_send"}],subForm:{id:0,title:"",cate_id:[],farmer_id:"",cover:[],imgs:[],video:"",address:"",lng:"",lat:"",desc:"",price:"",unit:"",stock:"",breed:"",start_time:[],end_time:"",output:"",harvest_cover:[],harvest_text:"",process:[],text:"",is_self:0,is_send:0,send_cycle:"",send_times:"",monitor:[],machine_id:"",send_tmpl_id:"",is_fx:0,one_fx:"",two_fx:"",top:0},subFormRules:{title:{required:!0,validator:this.$reg.isNoEmpty,text:"认养名称",reg_type:2,trigger:"blur"},cate_id:{required:!0,type:"array",message:"请选择所属分类",trigger:"blur"},farmer_id:{required:!0,type:"number",message:"请选择所属农场",trigger:"blur"},cover:{required:!0,type:"array",message:"请上传封面图",trigger:"blur"},imgs:{required:!0,type:"array",message:"请上传轮播图",trigger:"blur"},address:{required:!0,validator:function(t,r,s){var o=e.subForm,i=o.address,a=o.lat,l=o.lng;(i=i?i.replace(/(^\s*)|(\s*$)/g,""):"")?l&&/^[\-\+]?(0(\.\d{1,15})?|([1-9](\d)?)(\.\d{1,15})?|1[0-7]\d{1}(\.\d{1,15})?|180\.0{1,15})$/.test(l)?a&&/^[\-\+]?((0|([1-8]\d?))(\.\d{1,15})?|90(\.0{1,15})?)$/.test(a)?s():s(new Error(a?"请输入正确的纬度":"请输入认养纬度")):s(new Error(l?"请输入正确的经度":"请输入认养经度")):s(new Error("请输入认养地址"))},trigger:["blur","change"]},desc:{required:!0,validator:this.$reg.isNoEmpty,text:"认养简介",reg_type:2,trigger:"blur"},price:{required:!0,validator:this.$reg.isMoney,text:"认养价格",reg_type:2,trigger:"blur"},unit:{required:!0,validator:this.$reg.isNoEmpty,text:"单位",reg_type:2,trigger:"blur"},stock:{required:!0,validator:this.$reg.valiDateInt,text:"库存",trigger:"blur"},breed:{required:!0,validator:this.$reg.isNoEmpty,text:"认养品种",reg_type:2,trigger:"blur"},harvest_cover:{required:!0,type:"array",message:"请上传认养收获图片",trigger:"blur"},harvest_text:{required:!0,validator:this.$reg.isNoEmpty,text:"认养收获",reg_type:2,trigger:"blur"},start_time:{required:!0,type:"array",message:"请选择认养时间",trigger:["blur","change"]},output:{required:!0,validator:this.$reg.isFloatNum,text:"产量",trigger:"blur"},process:{required:!0,type:"array",message:"请添加认养流程",trigger:["blur","change"]},checkList:{required:!0,validator:function(t,r,s){var o=e.subForm,i=o.is_self,a=void 0===i?0:i,l=o.is_send;a||void 0!==l&&l?s():s(new Error("请选择配送方式"))},trigger:["blur","change"]},send_cycle:{required:!0,validator:this.$reg.isNoEmpty,text:"配送周期",reg_type:2,trigger:"blur"},send_times:{required:!0,validator:this.$reg.valiDateInt,text:"配送总次数",trigger:"blur"},send_tmpl_id:{required:!0,type:"number",message:"请选择运费模版",trigger:"blur"},is_fx:{required:!0,type:"number",message:"请选择",trigger:"blur"},one_fx:{required:!0,validator:t,text:"一级分销",trigger:["blur","change"]},two_fx:{required:!0,validator:t,text:"二级分销",trigger:["blur","change"]},top:{required:!0,type:"number",message:"请输入排序值",trigger:"blur"},text:{required:!0,validator:this.$reg.isNoEmpty,text:"认养图文详情",reg_type:2,trigger:"blur"}},showMap:!1,showDialog:{process:!1},processForm:{id:0,cover:[],title:"",time:"",sub_title:""},processFormRules:{cover:{required:!0,type:"array",message:"请上传图片",trigger:["blur","change"]},title:{required:!0,validator:this.$reg.isNoEmpty,text:"流程名称",reg_type:2,trigger:"blur"},time:{required:!0,validator:this.$reg.isNoEmpty,text:"时间段",reg_type:2,trigger:"blur"},sub_title:{required:!0,validator:this.$reg.isNoEmpty,text:"副标题",reg_type:2,trigger:"blur"}}}},created:function(){var e=this;return b()(p.a.mark(function t(){var r;return p.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getBaseInfo();case 2:(r=e.$route.query.id)&&(e.subForm.id=r,e.getDetail(r)),e.navTitle=e.$t(r?"menu.ClaimListEdit":"menu.ClaimListAdd");case 5:case"end":return t.stop()}},t,e)}))()},methods:{getBaseInfo:function(){var e=this;return b()(p.a.mark(function t(){var r,s,o,i,a,l;return p.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.a.all([e.$api.claim.landAndClaimCate({type:2}),e.$api.land.massifSelect(),e.$api.land.seedSelect(),e.$api.shop.tmplSelect()]);case 2:r=t.sent,s=u()(r,4),o=s[0],i=s[1],a=s[2],l=s[3],e.base_cate=o.data,e.base_massif=i.data,e.base_seed=a.data,e.base_freight=l.data;case 12:case"end":return t.stop()}},t,e)}))()},getFarmerSelectList:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return b()(p.a.mark(function e(){var s,o,i;return p.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r||(t.subForm.farmer_id="",r=t.subForm.cate_id),e.next=3,t.$api.farmer.farmerSelectList({cate_type:2,cate_id:r});case 3:if(s=e.sent,o=s.code,i=s.data,200===o){e.next=8;break}return e.abrupt("return");case 8:t.base_farmer=i;case 9:case"end":return e.stop()}},e,t)}))()},getBaseByFarmerId:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return b()(p.a.mark(function e(){var s,o,i,a;return p.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r||(t.subForm.machine_id="",t.subForm.monitor=[],r=t.subForm.farmer_id),e.next=3,n.a.all([t.$api.hardware.machineSelect({farmer_id:r}),t.$api.hardware.monitorSelect({farmer_id:r})]);case 3:s=e.sent,o=u()(s,2),i=o[0],a=o[1],t.base_machine=i.data,t.base_monitor=a.data;case 9:case"end":return e.stop()}},e,t)}))()},getDetail:function(e){var t=this;return b()(p.a.mark(function r(){var s,o,i,a,l,c,u;return p.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.$api.claim.claimInfo({id:e});case 2:if(s=r.sent,o=s.code,i=s.data,200===o){r.next=7;break}return r.abrupt("return");case 7:return i.cover=[{url:i.cover}],i.imgs=i.imgs.map(function(e){return{url:e}}),a=i.start_time,l=i.end_time,i.start_time=[1e3*a,1e3*l],i.harvest_cover=[{url:i.harvest_cover}],r.next=14,n.a.all([t.getFarmerSelectList("",i.cate_id),t.getBaseByFarmerId("",i.farmer_id)]);case 14:for(c in t.subForm)t.subForm[c]=i[c];u=[],t.authList.map(function(e){1===i[e.key]&&u.push(e.title)}),t.checkList=u;case 18:case"end":return r.stop()}},r,t)}))()},getLatLng:function(e){this.subForm.lat=e.lat,this.subForm.lng=e.lng},getCover:function(e,t,r){this[t][r]=e},selectedFiles:function(e,t){var r;(r=this.subForm[t]).push.apply(r,a()(e))},moveFiles:function(e,t){this.subForm[t]=e},getVideo:function(e){this.subForm.video=e[e.length-1].url},toDelItem:function(e,t){this.subForm[e].splice(t,1)},changeCheckBox:function(e){var t=this;this.authList.map(function(r){t.subForm[r.key]=e.includes(r.title)?1:0})},toShowDialog:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var r in t=t.id?t:{process:{id:0,cover:[],title:"",time:"",sub_title:""}}[e],(t=JSON.parse(o()(t))).cover=t.cover&&t.cover.length>0?[{url:t.cover}]:[],this[e+"Form"])this[e+"Form"][r]=t[r];this.showDialog[e]=!this.showDialog[e]},submitFormInfo:function(e){var t=this,r=!0;if(this.$refs[e+"Form"].validate(function(e){e||(r=!1)}),r){var s=JSON.parse(o()(this[e+"Form"]));if("process"===e){var i=JSON.parse(o()(this.subForm)),a=s.id,l=void 0===a?0:a;if(s.cover=s.cover[0].url,l){var n=i[e].findIndex(function(e){return e.id===l});i[e][n]=s}else s.id=_()(),i[e].push(s);return this.subForm=i,void(this.showDialog[e]=!1)}s.cover=s.cover[0].url,s.imgs=s.imgs.map(function(e){return e.url});var c=s.is_fx,u=s.one_fx,m=s.two_fx,p=s.start_time;if(1===c&&1*u+1*m>100)return void this.$message.error("分销累计总和不能大于100%");s.start_time=p[0]/1e3,s.end_time=p[1]/1e3,s.harvest_cover=s.harvest_cover[0].url,s.process.map(function(e){o()(e.id).includes("-")&&delete e.id});var d=s.id?"claimUpdate":"claimAdd";this.$api.claim[d](s).then(function(e){200===e.code&&(t.$message.success(t.$t(s.id?"tips.successRev":"tips.successSub")),t.$router.back(-1))})}}}},g={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-land-list-edit"},[r("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",staticClass:"dialog-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"130px"}},[r("el-form-item",{attrs:{label:"认养名称",prop:"title"}},[r("el-input",{attrs:{maxlength:"20","show-word-limit":"",placeholder:"请输入认养名称"},model:{value:e.subForm.title,callback:function(t){e.$set(e.subForm,"title",t)},expression:"subForm.title"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"所属分类",prop:"cate_id"}},[r("el-select",{attrs:{multiple:"",filterable:"",clearable:"","collapse-tags":"",placeholder:"请选择所属分类"},on:{change:function(t){return e.getFarmerSelectList(t)}},model:{value:e.subForm.cate_id,callback:function(t){e.$set(e.subForm,"cate_id",t)},expression:"subForm.cate_id"}},e._l(e.base_cate,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),e.subForm.cate_id.length>0?r("el-form-item",{attrs:{label:"所属农场",prop:"farmer_id"}},[r("el-select",{attrs:{filterable:"",clearable:"","collapse-tags":"",placeholder:"请选择所属农场"},on:{change:function(t){return e.getBaseByFarmerId(t)}},model:{value:e.subForm.farmer_id,callback:function(t){e.$set(e.subForm,"farmer_id",t)},expression:"subForm.farmer_id"}},e._l(e.base_farmer,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"封面图",prop:"cover"}},[r("lb-cover",{attrs:{fileList:e.subForm.cover},on:{selectedFiles:function(t){return e.getCover(t,"subForm","cover")}}}),e._v(" "),r("lb-tool-tips",[e._v("图片建议尺寸:710 * 345")])],1),e._v(" "),r("el-form-item",{attrs:{label:"轮播图",prop:"imgs"}},[r("lb-cover",{attrs:{type:"more",fileList:e.subForm.imgs,tips:"750 * 750"},on:{selectedFiles:function(t){return e.selectedFiles(t,"imgs")},moveFiles:function(t){return e.moveFiles(t,"imgs")}}})],1),e._v(" "),r("el-form-item",{attrs:{label:"视频",prop:"video"}},[r("div",{staticClass:"item-warp"},[r("div",{staticClass:"upload-file-warp"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.subForm.video,expression:"subForm.video"}],staticClass:"choice-file-input",attrs:{type:"text",placeholder:"选择视频文件"},domProps:{value:e.subForm.video},on:{input:function(t){t.target.composing||e.$set(e.subForm,"video",t.target.value)}}}),e._v(" "),r("lb-cover",{attrs:{type:"button",fileType:"video"},on:{selectedFiles:e.getVideo}})],1)])]),e._v(" "),r("el-form-item",{attrs:{label:"认养环境",prop:"address"}},[r("el-input",{attrs:{placeholder:"请输入认养地址"},model:{value:e.subForm.address,callback:function(t){e.$set(e.subForm,"address",t)},expression:"subForm.address"}}),e._v(" "),r("div",{staticClass:"mt-md mb-md"},[r("el-input",{attrs:{placeholder:"请输入认养经度"},model:{value:e.subForm.lng,callback:function(t){e.$set(e.subForm,"lng",t)},expression:"subForm.lng"}})],1),e._v(" "),r("div",[r("el-input",{attrs:{placeholder:"请输入认养纬度"},model:{value:e.subForm.lat,callback:function(t){e.$set(e.subForm,"lat",t)},expression:"subForm.lat"}}),e._v(" "),r("lb-button",{staticClass:"getLocation",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",plain:""},on:{click:function(t){e.showMap=!0}}},[e._v("获取经纬度")])],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"认养简介",prop:"desc"}},[r("el-input",{attrs:{type:"textarea",rows:5,maxlength:"50","show-word-limit":"",resize:"none",placeholder:"请输入认养简介"},model:{value:e.subForm.desc,callback:function(t){e.$set(e.subForm,"desc",t)},expression:"subForm.desc"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"认养价格",prop:"price"}},[r("el-input",{attrs:{placeholder:"请输入认养价格"},model:{value:e.subForm.price,callback:function(t){e.$set(e.subForm,"price",t)},expression:"subForm.price"}},[r("template",{slot:"append"},[e._v("元")])],2)],1),e._v(" "),r("el-form-item",{attrs:{label:"单位",prop:"unit"}},[r("el-input",{attrs:{maxlength:"2","show-word-limit":"",placeholder:"请输入单位"},model:{value:e.subForm.unit,callback:function(t){e.$set(e.subForm,"unit",t)},expression:"subForm.unit"}}),e._v(" "),r("lb-tool-tips",[e._v("认养物种单位,如:头、颗、只等")])],1),e._v(" "),r("el-form-item",{attrs:{label:"库存",prop:"stock"}},[r("el-input",{attrs:{placeholder:"请输入库存"},model:{value:e.subForm.stock,callback:function(t){e.$set(e.subForm,"stock",t)},expression:"subForm.stock"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"认养品种",prop:"breed"}},[r("el-input",{attrs:{maxlength:"20","show-word-limit":"",placeholder:"请输入认养品种"},model:{value:e.subForm.breed,callback:function(t){e.$set(e.subForm,"breed",t)},expression:"subForm.breed"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"认养时间",prop:"start_time"}},[r("el-date-picker",{attrs:{type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"timestamp"},model:{value:e.subForm.start_time,callback:function(t){e.$set(e.subForm,"start_time",t)},expression:"subForm.start_time"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"产量",prop:"output"}},[r("el-input",{attrs:{placeholder:"请输入产量"},model:{value:e.subForm.output,callback:function(t){e.$set(e.subForm,"output",t)},expression:"subForm.output"}},[r("template",{slot:"append"},[e._v("kg")])],2)],1),e._v(" "),r("el-form-item",{attrs:{label:"认养收获",prop:"harvest_cover"}},[r("lb-cover",{attrs:{fileList:e.subForm.harvest_cover},on:{selectedFiles:function(t){return e.getCover(t,"subForm","harvest_cover")}}}),e._v(" "),r("lb-tool-tips",[e._v("图片建议尺寸:200 * 200")])],1),e._v(" "),r("el-form-item",{attrs:{label:"",prop:"harvest_text"}},[r("el-input",{attrs:{placeholder:"请输入认养收获",maxlength:"40","show-word-limit":""},model:{value:e.subForm.harvest_text,callback:function(t){e.$set(e.subForm,"harvest_text",t)},expression:"subForm.harvest_text"}}),e._v(" "),r("lb-tool-tips",[e._v("例如:金花猪1头200斤")])],1),e._v(" "),r("el-form-item",{attrs:{label:"认养流程",prop:"process"}},[r("lb-button",{staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary",plain:"",icon:"el-icon-plus"},on:{click:function(t){return e.toShowDialog("process")}}},[e._v(e._s(e.$t("menu.ClaimProcessAdd")))]),e._v(" "),r("el-table",{staticStyle:{width:"800px"},attrs:{data:e.subForm.process,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[r("el-table-column",{attrs:{prop:"cover",label:"图片"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("lb-image",{attrs:{src:e.row.cover}})]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"title",label:"名称"}}),e._v(" "),r("el-table-column",{attrs:{prop:"time",label:"时间段"}}),e._v(" "),r("el-table-column",{attrs:{prop:"sub_title",label:"副标题"}}),e._v(" "),r("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("div",{staticClass:"table-operate"},[r("lb-button",{attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(r){return e.toShowDialog("process",t.row)}}},[e._v(e._s(e.$t("action.edit")))]),e._v(" "),r("lb-button",{attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(r){return e.toDelItem("process",t.$index)}}},[e._v(e._s(e.$t("action.delete")))])],1)]}}])})],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"认养图文详情",prop:"text"}},[r("lb-ueditor",{attrs:{destroy:!0},model:{value:e.subForm.text,callback:function(t){e.$set(e.subForm,"text",t)},expression:"subForm.text"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"配送方式",prop:"checkList"}},[r("el-checkbox-group",{on:{change:e.changeCheckBox},model:{value:e.checkList,callback:function(t){e.checkList=t},expression:"checkList"}},e._l(e.authList,function(t,s){return r("div",{key:s,style:{display:"inline-block",marginLeft:0===s?0:"15px"}},[r("el-checkbox",{attrs:{label:t.title}}),e._v(" "),t.tips?r("lb-tool-tips",[e._v(e._s(t.tips))]):e._e()],1)}),0)],1),e._v(" "),r("el-form-item",{attrs:{label:"配送周期",prop:"send_cycle"}},[r("el-input",{attrs:{placeholder:"请输入配送周期",maxlength:"20","show-word-limit":""},model:{value:e.subForm.send_cycle,callback:function(t){e.$set(e.subForm,"send_cycle",t)},expression:"subForm.send_cycle"}}),e._v(" "),r("lb-tool-tips",[e._v("例如:一月一次")])],1),e._v(" "),r("el-form-item",{attrs:{label:"配送总次数",prop:"send_times"}},[r("el-input",{attrs:{placeholder:"请输入配送总次数"},model:{value:e.subForm.send_times,callback:function(t){e.$set(e.subForm,"send_times",t)},expression:"subForm.send_times"}},[r("template",{slot:"append"},[e._v("次")])],2)],1),e._v(" "),e.subForm.farmer_id?r("block",[r("el-form-item",{attrs:{label:"关联仪器",prop:"machine_id"}},[r("el-select",{attrs:{filterable:"",clearable:"","collapse-tags":"",placeholder:"请选择关联仪器"},model:{value:e.subForm.machine_id,callback:function(t){e.$set(e.subForm,"machine_id",t)},expression:"subForm.machine_id"}},e._l(e.base_machine,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),r("el-form-item",{attrs:{label:"关联监控",prop:"monitor"}},[r("el-select",{attrs:{multiple:"",filterable:"",clearable:"","collapse-tags":"",placeholder:"请选择关联监控"},model:{value:e.subForm.monitor,callback:function(t){e.$set(e.subForm,"monitor",t)},expression:"subForm.monitor"}},e._l(e.base_monitor,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1)],1):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"运费模版",prop:"send_tmpl_id"}},[r("el-select",{attrs:{filterable:"","collapse-tags":"",placeholder:"请选择运费模版"},model:{value:e.subForm.send_tmpl_id,callback:function(t){e.$set(e.subForm,"send_tmpl_id",t)},expression:"subForm.send_tmpl_id"}},e._l(e.base_freight,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1),e._v(" "),r("div",{staticClass:"f-caption c-link cursor-pointer",on:{click:function(t){return e.$router.push("/sys/freight/edit")}}},[e._v("\n 还没有运费模版?立即创建\n "),r("lb-tool-tips",[e._v("运费模版支持按重量计费和按件数计费两种方式,计费方式按照商品累加运费")])],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"是否开启分销",prop:"is_fx"}},[r("el-radio-group",{model:{value:e.subForm.is_fx,callback:function(t){e.$set(e.subForm,"is_fx",t)},expression:"subForm.is_fx"}},[r("el-radio",{attrs:{label:1}},[e._v(e._s(e.$t("action.ON")))]),e._v(" "),r("el-radio",{attrs:{label:0}},[e._v(e._s(e.$t("action.OFF")))])],1)],1),e._v(" "),1===e.subForm.is_fx?r("block",[r("el-form-item",{attrs:{label:"一级分销",prop:"one_fx"}},[r("el-input",{attrs:{placeholder:"请输入一级分销"},model:{value:e.subForm.one_fx,callback:function(t){e.$set(e.subForm,"one_fx",t)},expression:"subForm.one_fx"}},[r("template",{slot:"append"},[e._v("%")])],2)],1),e._v(" "),r("el-form-item",{attrs:{label:"二级分销",prop:"two_fx"}},[r("el-input",{attrs:{placeholder:"请输入二级分销"},model:{value:e.subForm.two_fx,callback:function(t){e.$set(e.subForm,"two_fx",t)},expression:"subForm.two_fx"}},[r("template",{slot:"append"},[e._v("%")])],2)],1)],1):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"排序值",prop:"top"}},[r("el-input-number",{staticClass:"lb-input-number",attrs:{controls:!1,precision:0,min:0,placeholder:"请输入排序值"},model:{value:e.subForm.top,callback:function(t){e.$set(e.subForm,"top",t)},expression:"subForm.top"}}),e._v(" "),r("lb-tool-tips",[e._v("值越大, 排序越靠前")])],1),e._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(t){return e.submitFormInfo("sub")}}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),r("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)],1),e._v(" "),r("el-dialog",{attrs:{title:e.$t(e.processForm.id?"menu.ClaimProcessEdit":"menu.ClaimProcessAdd"),visible:e.showDialog.process,width:"550px",center:""},on:{"update:visible":function(t){return e.$set(e.showDialog,"process",t)}}},[r("el-form",{ref:"processForm",staticClass:"dialog-form",attrs:{model:e.processForm,rules:e.processFormRules,"label-width":"130px"}},[r("el-form-item",{attrs:{label:"图片",prop:"cover"}},[r("lb-cover",{attrs:{fileList:e.processForm.cover},on:{selectedFiles:function(t){return e.getCover(t,"processForm","cover")}}}),e._v(" "),r("lb-tool-tips",[e._v("图片建议尺寸:200 * 200")])],1),e._v(" "),r("el-form-item",{attrs:{label:"流程名称",prop:"title"}},[r("el-input",{attrs:{placeholder:"请输入流程名称",maxlength:"20","show-word-limit":""},model:{value:e.processForm.title,callback:function(t){e.$set(e.processForm,"title",t)},expression:"processForm.title"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"时间段",prop:"time"}},[r("el-input",{attrs:{placeholder:"请输入时间段",maxlength:"30","show-word-limit":""},model:{value:e.processForm.time,callback:function(t){e.$set(e.processForm,"time",t)},expression:"processForm.time"}}),e._v(" "),r("lb-tool-tips",[e._v("例如2021.1.1至2021.6.1")])],1),e._v(" "),r("el-form-item",{attrs:{label:"副标题",prop:"sub_title"}},[r("el-input",{attrs:{placeholder:"请输入副标题",maxlength:"20","show-word-limit":""},model:{value:e.processForm.sub_title,callback:function(t){e.$set(e.processForm,"sub_title",t)},expression:"processForm.sub_title"}})],1)],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.showDialog.process=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(t){return e.submitFormInfo("process")}}},[e._v("确 定")])],1)],1),e._v(" "),r("lb-map",{attrs:{dialogVisible:e.showMap},on:{"update:dialogVisible":function(t){e.showMap=t},"update:dialog-visible":function(t){e.showMap=t},selectedLatLng:e.getLatLng}})],1)},staticRenderFns:[]};var h=r("VU/8")(f,g,!1,function(e){r("diX4")},"data-v-bfbbad86",null);t.default=h.exports},diX4:function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/23.js b/public/static/js/23.js new file mode 100644 index 0000000..190c1b4 --- /dev/null +++ b/public/static/js/23.js @@ -0,0 +1 @@ +webpackJsonp([23],{"1Nbn":function(e,t){},E6Sj:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Xxa5"),n=a.n(r),i=a("exGp"),s=a.n(i),o={data:function(){return{storeType:{0:{type:"primary",title:"农场"},1:{type:"danger",title:"平台直营"}},loading:!1,searchForm:{page:1,limit:10,type:2,store_name:""},tableData:[],total:0}},activated:function(){this.getTableDataList(1)},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return s()(n.a.mark(function a(){var r,i,s;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.farmer.farmerList(t.searchForm);case 4:if(r=a.sent,i=r.code,s=r.data,t.loading=!1,200===i){a.next=10;break}return a.abrupt("return");case 10:t.tableData=s.data,t.total=s.total;case 12:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1,3)}).catch(function(){})},updateItem:function(e,t){var a=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return s()(n.a.mark(function i(){var s;return n.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:s=1===r?{id:e,index_show:t}:2===r?{id:e,business_status:t}:{id:e,status:t},a.$api.farmer.farmerUpdate(s).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page0?n.imgs.map(function(e){return{url:e}}):[],n.text=n.text.replace(/\n/g,"
    "),t.subForm=n;case 10:case"end":return s.stop()}},s,t)}))()},showRefundDialog:function(){var e=this.subForm.apply_price;this.refundTotalMoney=e,this.refundMoney=e,this.dialogRefund=!0},toPassRefund:function(){var e=this;return n()(a.a.mark(function t(){var s,r,i,n,o,l;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.lockRefund){t.next=2;break}return t.abrupt("return");case 2:if(s=e.subForm,r=s.id,i=s.apply_price,n=e.refundMoney,o={id:r,price:n,text:""},!(1*i==0&&1*n==0||n>0&&n<=i&&/^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/.test(n))){t.next=20;break}return t.next=9,e.$api.shop.passRefund(o);case 9:if(l=t.sent,200===l.code){t.next=13;break}return t.abrupt("return");case 13:e.$message.success(e.$t("tips.successSub")),e.dialogRefund=!1,e.refundMoney="",e.getDetail(r),e.lockRefund=!1,t.next=21;break;case 20:e.$message.error("请核对金额再提交!");case 21:case"end":return t.stop()}},t,e)}))()},toRefuse:function(){var e=this;this.$confirm(this.$t("tips.confirmNoRefund"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){e.refuseRefund()}).catch(function(){})},refuseRefund:function(){var e=this;return n()(a.a.mark(function t(){var s,r;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return s=e.subForm.id,t.next=3,e.$api.shop.noPassRefund({id:s,text:""});case 3:if(r=t.sent,200===r.code){t.next=7;break}return t.abrupt("return");case 7:e.$message.success(e.$t("tips.successOper")),e.getDetail(s);case 9:case"end":return t.stop()}},t,e)}))()}},watch:{$route:function(e){var t=this;return n()(a.a.mark(function s(){var r,i;return a.a.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:r=e.query.id,1*(i=void 0===r?0:r)!==t.subForm.id&&t.getDetail(i);case 2:case"end":return s.stop()}},s,t)}))()}},filters:{handleTime:function(e,t){return 1===t?moment(1e3*e).format("YYYY-MM-DD"):2===t?moment(1e3*e).format("HH:mm:ss"):moment(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},l={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"lb-shop-order-edit"},[s("top-nav",{attrs:{isBack:!0}}),e._v(" "),s("div",{staticClass:"page-main"},[s("el-steps",{attrs:{active:1===e.subForm.status?1:3,"align-center":""}},[s("el-step",{attrs:{title:"买家退款",description:e.subForm.create_time}}),e._v(" "),s("el-step",{attrs:{title:"商家退款",description:1===e.subForm.status?"等待商家处理":e.subForm.refund_time}}),e._v(" "),2===e.subForm.status?s("el-step",{attrs:{title:"退款成功,退款金额:¥"+e.subForm.refund_price,description:e.subForm.refund_time}}):e._e(),e._v(" "),3===e.subForm.status?s("el-step",{attrs:{title:"退款失败",description:e.subForm.refund_time}}):e._e()],1),e._v(" "),s("div",{staticClass:"space-lg"}),e._v(" "),s("div",{staticClass:"space-lg"}),e._v(" "),s("el-form",{attrs:{model:e.subForm,"label-width":"130px",size:"mini"},nativeOn:{submit:function(e){e.preventDefault()}}},[s("lb-classify-title",{attrs:{title:"用户信息"}}),e._v(" "),s("el-form-item",{attrs:{label:"用户ID:"}},[s("div",[e._v(e._s(e.subForm.user_id))])]),e._v(" "),s("el-form-item",{attrs:{label:"下单人:"}},[s("div",[e._v(e._s(e.subForm.address_info.user_name))])]),e._v(" "),s("el-form-item",{attrs:{label:"手机号:"}},[s("div",[e._v(e._s(e.subForm.address_info.mobile))])]),e._v(" "),e.subForm.address_info.id?s("el-form-item",{attrs:{label:"收货地址:"}},[s("div",[e._v("\n "+e._s(e.subForm.address_info.address+" "+e.subForm.address_info.address_info)+"\n ")])]):e._e(),e._v(" "),e.subForm.store_id?s("block",[s("lb-classify-title",{attrs:{title:"店铺信息"}}),e._v(" "),s("el-form-item",{attrs:{label:"店铺名称:"}},[s("div",[e._v(e._s(e.subForm.store_info.title))])]),e._v(" "),s("el-form-item",{attrs:{label:"店铺头像:"}},[s("div",[s("lb-cover",{attrs:{fileList:[{url:e.subForm.store_info.cover}],isToDel:!1,type:"more",size:"small",fileSize:1}})],1)]),e._v(" "),s("el-form-item",{attrs:{label:"店铺地址:"}},[s("div",[e._v(e._s(e.subForm.store_info.address))]),e._v(" "),s("div",[e._v("\n "+e._s(e.subForm.store_info.user_name+" "+e.subForm.store_info.mobile)+"\n ")])])],1):e._e(),e._v(" "),s("lb-classify-title",{attrs:{title:"订单信息"}}),e._v(" "),s("el-form-item",{attrs:{label:"订单状态:"}},[s("div",[e._v(e._s(e.statusType[e.subForm.status]))])]),e._v(" "),s("el-form-item",{attrs:{label:"付款订单号:"}},[s("div",[e._v(e._s(e.subForm.pay_order_code))])]),e._v(" "),s("el-form-item",{attrs:{label:"退款订单号:"}},[s("div",[e._v(e._s(e.subForm.order_code))])]),e._v(" "),e.subForm.out_refund_no?s("el-form-item",{attrs:{label:"微信退款订单号:"}},[s("div",[e._v(e._s(e.subForm.out_refund_no))])]):e._e(),e._v(" "),s("el-form-item",{attrs:{label:"申请时间:"}},[s("div",[e._v(e._s(e.subForm.create_time))])]),e._v(" "),s("el-form-item",{attrs:{label:"申请退款金额:"}},[s("div",{staticClass:"flex-y-baseline"},[s("div",{staticClass:"c-warning"},[e._v(e._s("¥"+e.subForm.apply_price))]),e._v(" "),1*e.subForm.car_price>0?s("div",{staticClass:"f-caption c-caption ml-sm"},[e._v("\n 含配送费:"+e._s("¥"+e.subForm.car_price)+"\n ")]):e._e()])]),e._v(" "),2===e.subForm.status?s("el-form-item",{attrs:{label:"退款金额:"}},[s("div",[e._v(e._s("¥"+e.subForm.refund_price))])]):e._e(),e._v(" "),e.subForm.status>1?s("block",[s("el-form-item",{attrs:{label:"处理时间:"}},[s("div",[e._v(e._s(e.subForm.refund_time))])]),e._v(" "),s("el-form-item",{attrs:{label:"处理人:"}},[s("div",[e._v(e._s(e.subForm.refund_user_name||"-"))])])],1):e._e(),e._v(" "),s("el-form-item",{directives:[{name:"show",rawName:"v-show",value:(e.pagePermission.includes("agreeRefund")||e.pagePermission.includes("rejectRefund"))&&1===e.subForm.status,expression:"\n (pagePermission.includes('agreeRefund') ||\n pagePermission.includes('rejectRefund')) &&\n subForm.status === 1\n "}],attrs:{label:"处理退款:"}},[s("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:"OrderRefundShop-rejectRefund",expression:"`OrderRefundShop-rejectRefund`"}],attrs:{size:"mini",plain:"",type:"danger"},on:{click:e.toRefuse}},[e._v("拒绝退款")]),e._v(" "),s("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:"OrderRefundShop-agreeRefund",expression:"`OrderRefundShop-agreeRefund`"}],attrs:{size:"mini",plain:"",type:"success"},on:{click:e.showRefundDialog}},[e._v("立即退款")])],1),e._v(" "),s("lb-classify-title",{attrs:{title:"退款信息"}}),e._v(" "),e.subForm.text?s("el-form-item",{attrs:{label:"退款原因:"}},[s("div",{domProps:{innerHTML:e._s(e.subForm.text)}})]):e._e(),e._v(" "),e.subForm.imgs&&e.subForm.imgs.length>0?s("el-form-item",{attrs:{label:"上传图片:"}},[s("div",{staticClass:"c-title flex-warp"},[s("lb-cover",{attrs:{fileList:e.subForm.imgs,isToDel:!1,size:"small",type:"more",fileSize:e.subForm.imgs.length}})],1)]):e._e()],1),e._v(" "),s("lb-classify-title",{attrs:{title:"退款商品"}}),e._v(" "),s("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.subForm.order_goods,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[s("el-table-column",{attrs:{prop:"goods_cover",label:"商品图片"},scopedSlots:e._u([{key:"default",fn:function(e){return[s("lb-image",{attrs:{src:e.row.goods_cover}})]}}])}),e._v(" "),s("el-table-column",{attrs:{prop:"goods_name",label:"商品名称"}}),e._v(" "),s("el-table-column",{attrs:{prop:"spe_name",label:"规格"}}),e._v(" "),s("el-table-column",{attrs:{prop:"goods_price",label:"价格"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.goods_price)+"\n ")]}}])}),e._v(" "),s("el-table-column",{attrs:{prop:"goods_num",label:"数量"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.goods_num||1)+"\n ")]}}])})],1),e._v(" "),s("div",{staticClass:"space-lg mt-lg mb-lg"},[e._v("\n 合计数量:"+e._s(e.subForm.all_goods_num||1)+"\n ")]),e._v(" "),s("lb-button",{attrs:{type:"primary"},on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))]),e._v(" "),s("el-dialog",{attrs:{title:"立即退款",visible:e.dialogRefund,width:"400px",center:""},on:{"update:visible":function(t){e.dialogRefund=t}}},[s("div",{staticClass:"refund-inner"},[s("lb-tips",{attrs:{isIcon:!1}},[e._v("请核对信息后输入需要退款的金额")]),e._v(" "),s("el-input",{staticStyle:{width:"100%"},attrs:{disabled:1*e.refundTotalMoney==0,placeholder:"请输入退款金额"},model:{value:e.refundMoney,callback:function(t){e.refundMoney=t},expression:"refundMoney"}}),e._v(" "),s("p",{staticClass:"mt-lg"},[e._v("\n 实际可退款金额\n "),s("span",{staticClass:"c-warning"},[e._v("¥"+e._s(e.refundTotalMoney))])]),e._v(" "),s("p",[e._v("退款金额不能大于可退款金额")])],1),e._v(" "),s("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{on:{click:function(t){e.dialogRefund=!1}}},[e._v(e._s(e.$t("action.cancel")))]),e._v(" "),s("el-button",{attrs:{type:"primary"},on:{click:e.toPassRefund}},[e._v("确认退款")])],1)])],1)],1)},staticRenderFns:[]};var u=s("VU/8")(o,l,!1,function(e){s("fqbX")},"data-v-9c5ea024",null);t.default=u.exports}}); \ No newline at end of file diff --git a/public/static/js/29.js b/public/static/js/29.js new file mode 100644 index 0000000..843d981 --- /dev/null +++ b/public/static/js/29.js @@ -0,0 +1 @@ +webpackJsonp([29],{Mxvt:function(e,t){},qIuO:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Xxa5"),n=a.n(r),i=a("exGp"),s=a.n(i),l={data:function(){return{loading:!1,searchForm:{page:1,limit:10,type:1,title:""},tableData:[],total:0}},activated:function(){var e=this;return s()(n.a.mark(function t(){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e.getTableDataList(1);case 1:case"end":return t.stop()}},t,e)}))()},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return s()(n.a.mark(function a(){var r,i,s;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.claim.claimCateList(t.searchForm);case 4:if(r=a.sent,i=r.code,s=r.data,t.loading=!1,200===i){a.next=10;break}return a.abrupt("return");case 10:t.tableData=s.data,t.total=s.total;case 12:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return s()(n.a.mark(function r(){return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.claim.claimCateUpdate({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.pages}}},timePickerOptions:{onPick:function(e){var a=e.maxDate,s=e.minDate;t.searchForm.start_time=s.getTime(),a&&(t.selectDate="")},disabledDate:function(e){if(t.searchForm.start_time){var a=t.searchForm.start_time-31536e6,s=t.searchForm.start_time+31536e6;return e.getTime()s}}},searchForm:{page:1,limit:30,date_start_time:"",date_end_time:"",start_time:"",end_time:""},cash:{},date:[],total_count:0,new_count:0,h_down:0,t_down:0,h_balance:"",t_balance:"",tableData:[]}},created:function(){this.initIndex()},methods:{initIndex:function(){var t=moment(moment((new Date).getTime()).format("YYYY-MM-DD")).unix(),e=moment((new Date).getTime()).format("YYYY"),a=moment((new Date).getTime()).format("YYYY-MM"),s=new Date,i=s.getDay();0===i&&(i=7);var n=new Date(s-864e5*(i-1)),r=1===i?n:new Date(1e3*(n/1e3+86400*(i-1)));this.rankList[0].start_time=t,this.rankList[0].end_time=t,this.rankList[1].start_time=moment(moment(new Date(n).getTime()).format("YYYY-MM-DD")).unix(),this.rankList[1].end_time=moment(moment(new Date(r).getTime()).format("YYYY-MM-DD")).unix(),this.rankList[2].start_time=moment(a+"-1").unix(),this.rankList[2].end_time=t,this.rankList[3].start_time=moment(e+"-1-1").unix(),this.rankList[3].end_time=t,this.getTableDataList(1,1),this.getTableDataList(1,2)},toRank:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.searchForm.date_start_time="",this.searchForm.start_time="",!e){var a=this.start_ind;this.last_ind=-1===a?1:1*a+1}this[e+"start_ind"]=t,this.getTableDataList(1,"date_"===e?1:2)},changeSort:function(t){var e=t.order,a=t.prop;this.searchForm.order=a,this.searchForm.by="ascending"===e?"asc":"desc",this.handleCurrentChange(1)},handleSizeChange:function(t){this.searchForm.limit=t,this.handleCurrentChange(1)},handleCurrentChange:function(t){this.searchForm.page=t,this.getTableDataList()},getTableDataList:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return c()(i.a.mark(function s(){var n,o,c,d,l,m,_,h,u,f,p,v,g,b,y,x,k,w,D,C,F,L,E,Y,T,O,S;return i.a.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return t&&(e.searchForm.page=1),e.loading=!0,n=JSON.parse(r()(e.searchForm)),o=n.date_start_time&&n.date_start_time.length>1,e.date_start_ind=o?-1:-1===e.date_start_ind?0:e.date_start_ind,c=n.start_time&&n.start_time.length>1,d=e.date_start_ind,l=e.start_ind,m=e.last_ind,o?(n.date_end_time=n.date_start_time[1]/1e3+86400-1,n.date_start_time=n.date_start_time[0]/1e3):(_=e.rankList[d],h=_.start_time,u=_.end_time,n.date_start_time=h,n.date_end_time=u+86400-1),c?(n.end_time=n.start_time[1]/1e3+86400-1,n.start_time=n.start_time[0]/1e3,n.date=m):(f=e.rankList[l],p=f.start_time,v=f.end_time,n.start_time=p,n.end_time=v+86400-1,n.date=1*l+1),1===a&&(n.start_time=n.date_start_time,n.end_time=n.date_end_time),delete n.date_start_time,delete n.date_end_time,g=1===a?"statisticsCash":"statisticsUser",s.next=15,e.$api.farmer[g](n);case 15:if(b=s.sent,y=b.code,x=b.data,e.loading=!1,200===y){s.next=21;break}return s.abrupt("return");case 21:if(1===a?(k=x.cash,e.cash=k):(w=x.h_balance,D=x.t_balance,C=x.total_count,F=x.new_count,e.h_balance=Math.abs(w),e.h_down=1*w==0?1:1*w>0?2:3,e.t_balance=Math.abs(D),e.t_down=1*D==0?1:1*D>0?2:3,e.total_count=C,e.new_count=F),L=x.list,E=L.data,!((Y=L.last_page)>1)){s.next=35;break}T=2;case 25:if(!(T0&&void 0!==arguments[0]?arguments[0]:{is_admin:0,role:[]};return u()(l.a.mark(function a(){var r,s,n,i,o,c,u;return l.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(r=t.id,!(s=void 0===r?0:r)){a.next=12;break}return a.next=4,e.$api.account.adminInfo({id:s});case 4:n=a.sent,i=n.data,o=i.role,c=o.map(function(e){return e.id}),i.passwd=i.o_passwd,i.role_info=o,i.role=c,t=i;case 12:for(u in e.subForm)e.subForm[u]=t[u];e.showDialog=!e.showDialog;case 14:case"end":return a.stop()}},a,e)}))()},submitFormInfo:function(){var e=this;return u()(l.a.mark(function t(){var a,r,n,i;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=!0,e.$refs.subForm.validate(function(e){e||(a=!1)}),!a){t.next=23;break}return r=e.subForm.id?"adminUpdate":"adminAdd",delete(n=JSON.parse(s()(e.subForm))).is_admin,n.passwd||delete n.passwd,t.next=9,e.$api.account[r](n);case 9:if(i=t.sent,200===i.code){t.next=13;break}return t.abrupt("return");case 13:if(e.$message.success(e.$t(n.id?"tips.successRev":"tips.successSub")),e.showDialog=!1,e.username!==n.username){t.next=22;break}return e.changeRoutesItem({key:"isAuth",val:!1}),sessionStorage.removeItem("minitk"),sessionStorage.removeItem("ms_username"),e.$router.push("/login"),window.location.reload(),t.abrupt("return");case 22:e.getTableDataList();case 23:case"end":return t.stop()}},t,e)}))()}}),filters:{handleTime:function(e,t){return 1===t?d()(1e3*e).format("YYYY-MM-DD"):2===t?d()(1e3*e).format("HH:mm:ss"):d()(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},h={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-system-news"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-add",expression:"`${$route.name}-add`"}],attrs:{type:"primary",icon:"el-icon-plus"},on:{click:e.toShowDialog}},[e._v(e._s(e.$t("menu.AccountAdd")))]),e._v(" "),a("div",{staticClass:"space-lg"}),e._v(" "),a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"账号",prop:"title"}},[a("el-input",{attrs:{placeholder:"请输入账号"},model:{value:e.searchForm.title,callback:function(t){e.$set(e.searchForm,"title",t)},expression:"searchForm.title"}})],1),e._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1)}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("searchForm")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1)],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"id",label:"ID"}}),e._v(" "),a("el-table-column",{attrs:{prop:"username",label:"账号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"o_passwd",label:"密码"}}),e._v(" "),a("el-table-column",{attrs:{prop:"create_time",label:"创建时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("p",[e._v(e._s(e._f("handleTime")(t.row.create_time,1)))]),e._v(" "),a("p",[e._v(e._s(e._f("handleTime")(t.row.create_time,2)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"table-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-edit",expression:"`${$route.name}-edit`"}],attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(a){return e.toShowDialog(t.row)}}},[e._v(e._s(e.$t("action.edit")))]),e._v(" "),a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-delete",expression:"`${$route.name}-delete`"},{name:"show",rawName:"v-show",value:0===t.row.is_admin,expression:"scope.row.is_admin === 0"}],attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(a){return e.confirmDel(t.row.id)}}},[e._v(e._s(e.$t("action.delete")))])],1)]}}])})],1),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}}),e._v(" "),a("el-dialog",{attrs:{title:e.$t(e.subForm.id?"menu.AccountEdit":"menu.AccountAdd"),visible:e.showDialog,width:"500px",center:""},on:{"update:visible":function(t){e.showDialog=t}}},[a("el-form",{ref:"subForm",staticClass:"dialog-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"账号",prop:"username"}},[a("el-input",{attrs:{disabled:1===e.subForm.is_admin,placeholder:"请输入账号"},model:{value:e.subForm.username,callback:function(t){e.$set(e.subForm,"username",t)},expression:"subForm.username"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"密码",prop:"passwd"}},[a("el-input",{attrs:{placeholder:"请输入密码"},model:{value:e.subForm.passwd,callback:function(t){e.$set(e.subForm,"passwd",t)},expression:"subForm.passwd"}})],1),e._v(" "),0===e.subForm.is_admin?a("el-form-item",{attrs:{label:"所属角色",prop:"role"}},[a("el-select",{attrs:{multiple:"","collapse-tags":"",clearable:"",placeholder:"请选择"},model:{value:e.subForm.role,callback:function(t){e.$set(e.subForm,"role",t)},expression:"subForm.role"}},e._l(e.roleList,function(e){return a("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1):e._e()],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.showDialog=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v("确 定")])],1)],1)],1)],1)},staticRenderFns:[]};var b=a("VU/8")(f,h,!1,function(e){a("ZYPP")},"data-v-971d1ba4",null);t.default=b.exports},ZYPP:function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/31.js b/public/static/js/31.js new file mode 100644 index 0000000..0cb74de --- /dev/null +++ b/public/static/js/31.js @@ -0,0 +1 @@ +webpackJsonp([31],{"/xA4":function(e,t){},jqwu:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r("mvHQ"),i=r.n(o),s=r("Xxa5"),n=r.n(s),a=r("exGp"),u=r.n(a),l={data:function(){return{navTitle:"",subForm:{id:0,title:"",sub_title:"",cover:[],content:"",type:2,top:0},subFormRules:{title:{required:!0,validator:this.$reg.isNoEmpty,text:"公告标题",reg_type:2,trigger:"blur"},cover:{required:!0,type:"array",message:"请上传封面图",trigger:"blur"},content:{required:!0,type:"string",message:"请输入公告内容",trigger:"blur"},top:{required:!0,type:"number",message:"请输入排序值",trigger:"blur"}}}},created:function(){var e=this;return u()(n.a.mark(function t(){var r;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=e.$route.query.id)){t.next=5;break}return e.subForm.id=r,t.next=5,e.getDetail(r);case 5:e.navTitle=e.$t(r?"menu.MediaNoticeEdit":"menu.MediaNoticeAdd");case 6:case"end":return t.stop()}},t,e)}))()},methods:{getDetail:function(e){var t=this;return u()(n.a.mark(function r(){var o,i,s,a;return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.$api.media.welfareInfo({id:e});case 2:if(o=r.sent,i=o.code,s=o.data,200===i){r.next=7;break}return r.abrupt("return");case 7:for(a in s.cover=[{url:s.cover}],t.subForm)t.subForm[a]=s[a];case 9:case"end":return r.stop()}},r,t)}))()},getCover:function(e){this.subForm.cover=e},submitFormInfo:function(){var e=this,t=!0;if(this.$refs.subForm.validate(function(e){e||(t=!1)}),t){var r=JSON.parse(i()(this.subForm));r.cover=r.cover[0].url;var o=r.id?"welfareUpdate":"welfareAdd";this.$api.media[o](r).then(function(t){200===t.code&&(e.$message.success(e.$t(r.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}}}},c={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-media-notice-edit"},[r("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"120px"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("el-form-item",{attrs:{label:"公告标题",prop:"title"}},[r("el-input",{attrs:{maxlength:"50","show-word-limit":"",placeholder:"请输入公告标题"},model:{value:e.subForm.title,callback:function(t){e.$set(e.subForm,"title",t)},expression:"subForm.title"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"封面图",prop:"cover"}},[r("lb-cover",{attrs:{fileList:e.subForm.cover},on:{selectedFiles:e.getCover}}),e._v(" "),r("lb-tool-tips",[e._v("图片建议尺寸:180 * 160")])],1),e._v(" "),r("el-form-item",{attrs:{label:"公告内容",prop:"content"}},[r("lb-ueditor",{attrs:{destroy:!0,ueditorType:"3"},model:{value:e.subForm.content,callback:function(t){e.$set(e.subForm,"content",t)},expression:"subForm.content"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"排序值",prop:"top"}},[r("el-input-number",{staticClass:"lb-input-number",attrs:{controls:!1,precision:0,min:0,placeholder:"请输入排序值"},model:{value:e.subForm.top,callback:function(t){e.$set(e.subForm,"top",t)},expression:"subForm.top"}}),e._v(" "),r("lb-tool-tips",[e._v("值越大, 排序越靠前")])],1),e._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),r("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)],1)],1)},staticRenderFns:[]};var m=r("VU/8")(l,c,!1,function(e){r("/xA4")},"data-v-7df71afe",null);t.default=m.exports}}); \ No newline at end of file diff --git a/public/static/js/32.js b/public/static/js/32.js new file mode 100644 index 0000000..8d4e4b6 --- /dev/null +++ b/public/static/js/32.js @@ -0,0 +1 @@ +webpackJsonp([32],{WI8u:function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=s("Xxa5"),a=s.n(n),r=s("exGp"),o=s.n(r),c={data:function(){return{subForm:{blacklist:0}}},created:function(){this.getFormInfo()},methods:{getFormInfo:function(){var t=this;return o()(a.a.mark(function e(){var s,n,r,o;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$api.system.configInfo();case 2:if(s=e.sent,n=s.code,r=s.data,200===n){e.next=7;break}return e.abrupt("return");case 7:for(o in t.subForm)t.subForm[o]=r[o];case 8:case"end":return e.stop()}},e,t)}))()},submitFormInfo:function(){var t=this;this.$refs.subForm.validate(function(e){if(e){var s=t.subForm;t.$api.system.configUpdate(s).then(function(e){200===e.code&&t.$message.success(t.$t("tips.successSub"))})}})}}},i={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"lb-system-wechat"},[s("top-nav"),t._v(" "),s("div",{staticClass:"page-main"},[s("el-form",{ref:"subForm",staticClass:"config-form",attrs:{model:t.subForm,rules:t.subFormRules,"label-width":"120px"},nativeOn:{submit:function(t){t.preventDefault()}}},[s("el-form-item",{attrs:{label:"黑名单功能",prop:"blacklist"}},[s("el-switch",{attrs:{"active-value":1,"inactive-value":0},on:{change:t.submitFormInfo},model:{value:t.subForm.blacklist,callback:function(e){t.$set(t.subForm,"blacklist",e)},expression:"subForm.blacklist"}}),t._v(" "),s("lb-tool-tips",[t._v("默认关闭,关闭之后,会员管理页面不出现「移入黑名单」「移出黑名单」按钮")])],1)],1)],1)],1)},staticRenderFns:[]};var u=s("VU/8")(c,i,!1,function(t){s("cdbc")},"data-v-7c8f7cb0",null);e.default=u.exports},cdbc:function(t,e){}}); \ No newline at end of file diff --git a/public/static/js/33.js b/public/static/js/33.js new file mode 100644 index 0000000..2ed0328 --- /dev/null +++ b/public/static/js/33.js @@ -0,0 +1 @@ +webpackJsonp([33],{U2D0:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a("Xxa5"),r=a.n(n),i=a("exGp"),s=a.n(i),o={data:function(){return{connectType:{1:"农场",2:"文章",3:"查看大图",4:"店铺"},loading:!1,searchForm:{page:1,limit:10,type:2},tableData:[],total:0}},activated:function(){this.getTableDataList(1)},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return s()(r.a.mark(function a(){var n,i,s;return r.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.media.bannerList(t.searchForm);case 4:if(n=a.sent,i=n.code,s=n.data,t.loading=!1,200===i){a.next=10;break}return a.abrupt("return");case 10:t.tableData=s.data,t.total=s.total;case 12:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return s()(r.a.mark(function n(){return r.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:a.$api.media.bannerUpdate({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page0?1*n.link:"",r.subForm)r.subForm[o]=n[o];case 9:case"end":return t.stop()}},t,r)}))()},submitFormInfo:function(){var e=this,r=!0;if(this.$refs.subForm.validate(function(e){e||(r=!1)}),r){var t=JSON.parse(i()(this.subForm)),a=t.id?"machineUpdate":"machineAdd";this.$api.hardware[a](t).then(function(r){200===r.code&&(e.$message.success(e.$t(t.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}}}},c={render:function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("div",{staticClass:"lb-system-banner-edit"},[t("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),t("div",{staticClass:"page-main"},[t("el-form",{ref:"subForm",staticClass:"dialog-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"100px"}},[t("el-form-item",{attrs:{label:"仪器名称",prop:"title"}},[t("el-input",{attrs:{maxlength:"20","show-word-limit":"",placeholder:"请输入仪器名称"},model:{value:e.subForm.title,callback:function(r){e.$set(e.subForm,"title",r)},expression:"subForm.title"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"房间号",prop:"room_id"}},[t("el-input",{attrs:{placeholder:"请输入房间号"},model:{value:e.subForm.room_id,callback:function(r){e.$set(e.subForm,"room_id",e._n(r))},expression:"subForm.room_id"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"所属农场",prop:"farmer_id"}},[t("el-select",{attrs:{filterable:"","collapse-tags":"",placeholder:"请选择所属农场"},model:{value:e.subForm.farmer_id,callback:function(r){e.$set(e.subForm,"farmer_id",r)},expression:"subForm.farmer_id"}},e._l(e.base_farmer,function(e){return t("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),t("el-form-item",[t("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),t("lb-button",{on:{click:function(r){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)],1)],1)},staticRenderFns:[]};var m=t("VU/8")(l,c,!1,function(e){t("yiB7")},"data-v-712e7b54",null);r.default=m.exports},yiB7:function(e,r){}}); \ No newline at end of file diff --git a/public/static/js/37.js b/public/static/js/37.js new file mode 100644 index 0000000..e15d6f6 --- /dev/null +++ b/public/static/js/37.js @@ -0,0 +1 @@ +webpackJsonp([37],{"0CRz":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Xxa5"),n=a.n(r),i=a("exGp"),s=a.n(i),o={data:function(){return{loading:!1,searchForm:{page:1,limit:10,title:""},tableData:[],total:0}},activated:function(){this.getTableDataList(1)},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return s()(n.a.mark(function a(){var r,i,s;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.hardware.machineList(t.searchForm);case 4:if(r=a.sent,i=r.code,s=r.data,t.loading=!1,200===i){a.next=10;break}return a.abrupt("return");case 10:t.tableData=s.data,t.total=s.total;case 12:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return s()(n.a.mark(function r(){return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.hardware.machineUpdate({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page100){var s=l.test(r)?"取值范围不超过100":"最多2位小数";a(new Error("请输入"+t.text+","+s))}else a();else a(new Error("请输入"+t.text));else a()};return{id:"",navTitle:"",base_cate:[],base_farmer:[],bass_massif:[],base_seed:[],base_machine:[],base_monitor:[],base_freight:[],subForm:{id:0,title:"",cate_id:[],farmer_id:"",cover:[],imgs:[],video:"",address:"",lng:"",lat:"",desc:"",spe:[],text:"",cycle:[],massif:[],seed:[],monitor:[],machine_id:"",send_tmpl_id:"",is_fx:0,one_fx:"",two_fx:"",top:0},subFormRules:{title:{required:!0,validator:this.$reg.isNoEmpty,text:"土地名称",reg_type:2,trigger:"blur"},cate_id:{required:!0,type:"array",message:"请选择所属分类",trigger:"blur"},farmer_id:{required:!0,type:"number",message:"请选择所属农场",trigger:"blur"},cover:{required:!0,type:"array",message:"请上传封面图",trigger:"blur"},imgs:{required:!0,type:"array",message:"请上传轮播图",trigger:"blur"},address:{required:!0,validator:function(t,r,a){var l=e.subForm,s=l.address,i=l.lat,o=l.lng;(s=s?s.replace(/(^\s*)|(\s*$)/g,""):"")?o&&/^[\-\+]?(0(\.\d{1,15})?|([1-9](\d)?)(\.\d{1,15})?|1[0-7]\d{1}(\.\d{1,15})?|180\.0{1,15})$/.test(o)?i&&/^[\-\+]?((0|([1-8]\d?))(\.\d{1,15})?|90(\.0{1,15})?)$/.test(i)?a():a(new Error(i?"请输入正确的纬度":"请输入土地纬度")):a(new Error(o?"请输入正确的经度":"请输入土地经度")):a(new Error("请输入土地地址"))},trigger:["blur","change"]},desc:{required:!0,validator:this.$reg.isNoEmpty,text:"土地简介",reg_type:2,trigger:"blur"},spe:{required:!0,type:"array",message:"请添加土地规格",trigger:["blur","change"]},text:{required:!0,validator:this.$reg.isNoEmpty,text:"土地图文详情",reg_type:2,trigger:"blur"},cycle:{required:!0,type:"array",message:"请选择租赁周期",trigger:"blur"},massif:{required:!0,type:"array",message:"请选择地块服务",trigger:"blur"},send_tmpl_id:{required:!0,type:"number",message:"请选择运费模版",trigger:"blur"},is_fx:{required:!0,type:"number",message:"请选择",trigger:"blur"},one_fx:{required:!0,validator:t,text:"一级分销",trigger:["blur","change"]},two_fx:{required:!0,validator:t,text:"二级分销",trigger:["blur","change"]},top:{required:!0,type:"number",message:"请输入排序值",trigger:"blur"}},multipleSelection:[],showMap:!1,showDialog:{spe:!1,cycle:!1,batch:!1},speForm:{id:0,spe_name:"",area:"",price:""},speFormRules:{spe_name:{required:!0,validator:this.$reg.isNoEmpty,text:"规格名称",reg_type:2,trigger:"blur"},area:{required:!0,validator:this.$reg.isFloatNum,text:"面积",max:9999.99,unit:"m²",trigger:"blur"},price:{required:!0,validator:this.$reg.isMoney,text:"价格",reg_type:2,trigger:"blur"}},cycleForm:{id:0,day:""},cycleFormRules:{day:{required:!0,validator:this.$reg.isFloatNum,text:"租赁周期",dotLen:1,trigger:"blur"}},batchForm:{title:"",value:""},batchAreaFormRules:{value:{required:!0,validator:this.$reg.isFloatNum,text:"面积",max:9999.99,unit:"m²",trigger:"blur"}},batchPriceFormRules:{value:{required:!0,validator:this.$reg.isMoney,text:"价格",reg_type:2,trigger:"blur"}}}},created:function(){var e=this;return b()(p.a.mark(function t(){var r;return p.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getBaseInfo();case 2:(r=e.$route.query.id)&&(e.subForm.id=r,e.getDetail(r)),e.navTitle=e.$t(r?"menu.LandListEdit":"menu.LandListAdd");case 5:case"end":return t.stop()}},t,e)}))()},methods:{getBaseInfo:function(){var e=this;return b()(p.a.mark(function t(){var r,a,l,s,i,o;return p.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.a.all([e.$api.claim.landAndClaimCate({type:1}),e.$api.land.massifSelect(),e.$api.land.seedSelect(),e.$api.shop.tmplSelect()]);case 2:r=t.sent,a=u()(r,4),l=a[0],s=a[1],i=a[2],o=a[3],e.base_cate=l.data,e.base_massif=s.data,e.base_seed=i.data,e.base_freight=o.data;case 12:case"end":return t.stop()}},t,e)}))()},getFarmerSelectList:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return b()(p.a.mark(function e(){var a,l,s;return p.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r||(t.subForm.farmer_id="",r=t.subForm.cate_id),e.next=3,t.$api.farmer.farmerSelectList({cate_type:1,cate_id:r});case 3:if(a=e.sent,l=a.code,s=a.data,200===l){e.next=8;break}return e.abrupt("return");case 8:t.base_farmer=s;case 9:case"end":return e.stop()}},e,t)}))()},getBaseByFarmerId:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return b()(p.a.mark(function e(){var a,l,s,i;return p.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r||(t.subForm.machine_id="",t.subForm.monitor=[],r=t.subForm.farmer_id),e.next=3,n.a.all([t.$api.hardware.machineSelect({farmer_id:r}),t.$api.hardware.monitorSelect({farmer_id:r})]);case 3:a=e.sent,l=u()(a,2),s=l[0],i=l[1],t.base_machine=s.data,t.base_monitor=i.data;case 9:case"end":return e.stop()}},e,t)}))()},getDetail:function(e){var t=this;return b()(p.a.mark(function r(){var a,l,s,i;return p.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.$api.land.landInfo({id:e});case 2:if(a=r.sent,l=a.code,s=a.data,200===l){r.next=7;break}return r.abrupt("return");case 7:return s.cover=[{url:s.cover}],s.imgs=s.imgs.map(function(e){return{url:e}}),s.cycle=s.cycle.map(function(e,t){return{id:t+1,day:e}}),r.next=12,n.a.all([t.getFarmerSelectList("",s.cate_id),t.getBaseByFarmerId("",s.farmer_id)]);case 12:for(i in t.subForm)t.subForm[i]=s[i];case 13:case"end":return r.stop()}},r,t)}))()},getLatLng:function(e){this.subForm.lat=e.lat,this.subForm.lng=e.lng},getCover:function(e){this.subForm.cover=e},selectedFiles:function(e,t){var r;(r=this.subForm[t]).push.apply(r,i()(e))},moveFiles:function(e,t){this.subForm[t]=e},getVideo:function(e){this.subForm.video=e[e.length-1].url},toDelItem:function(e,t){this.subForm[e].splice(t,1)},handleSelectionChange:function(e){this.multipleSelection=e},toShowDialog:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var r in t="batch"===e||t.id?t:{spe:{id:0,spe_name:"",area:"",price:""},cycle:{id:0,day:""}}[e],t=JSON.parse(l()(t)),this[e+"Form"])this[e+"Form"][r]=t[r];this.showDialog[e]=!this.showDialog[e]},submitFormInfo:function(e){var t=this,r=!0;if(this.$refs[e+"Form"].validate(function(e){e||(r=!1)}),r){var a=JSON.parse(l()(this[e+"Form"]));if("sub"!==e){var s=JSON.parse(l()(this.subForm)),i=a.id,o=void 0===i?0:i,n=a.title,c=void 0===n?"":n,u=a.value,m=void 0===u?"":u;if("batch"===e){var p=this.multipleSelection.map(function(e){return e.id}),d="面积"===c?"area":"price";s.spe.map(function(e){p.includes(e.id)&&(e[d]=m)})}else if(o){var b=s[e].findIndex(function(e){return e.id===o});s[e][b]=a}else a.id=v()(),s[e].push(a);return this.subForm=s,void(this.showDialog[e]=!1)}var f=a.is_fx,_=a.one_fx,g=a.two_fx;if(1===f&&1*_+1*g>100)return void this.$message.error("分销累计总和不能大于100%");a.cover=a.cover[0].url,a.imgs=a.imgs.map(function(e){return e.url}),a.spe.map(function(e){l()(e.id).includes("-")&&delete e.id}),a.cycle=a.cycle.map(function(e){return e.day});var h=a.id?"landUpdate":"landAdd";this.$api.land[h](a).then(function(e){200===e.code&&(t.$message.success(t.$t(a.id?"tips.successRev":"tips.successSub")),t.$router.back(-1))})}}}},g={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-land-list-edit"},[r("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",staticClass:"dialog-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"130px"}},[r("el-form-item",{attrs:{label:"土地名称",prop:"title"}},[r("el-input",{attrs:{maxlength:"20","show-word-limit":"",placeholder:"请输入土地名称"},model:{value:e.subForm.title,callback:function(t){e.$set(e.subForm,"title",t)},expression:"subForm.title"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"所属分类",prop:"cate_id"}},[r("el-select",{attrs:{multiple:"",filterable:"",clearable:"","collapse-tags":"",placeholder:"请选择所属分类"},on:{change:function(t){return e.getFarmerSelectList(t)}},model:{value:e.subForm.cate_id,callback:function(t){e.$set(e.subForm,"cate_id",t)},expression:"subForm.cate_id"}},e._l(e.base_cate,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),e.subForm.cate_id.length>0?r("el-form-item",{attrs:{label:"所属农场",prop:"farmer_id"}},[r("el-select",{attrs:{filterable:"",clearable:"","collapse-tags":"",placeholder:"请选择所属农场"},on:{change:function(t){return e.getBaseByFarmerId(t)}},model:{value:e.subForm.farmer_id,callback:function(t){e.$set(e.subForm,"farmer_id",t)},expression:"subForm.farmer_id"}},e._l(e.base_farmer,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"封面图",prop:"cover"}},[r("lb-cover",{attrs:{fileList:e.subForm.cover},on:{selectedFiles:e.getCover}}),e._v(" "),r("lb-tool-tips",[e._v("图片建议尺寸:710 * 345")])],1),e._v(" "),r("el-form-item",{attrs:{label:"轮播图",prop:"imgs"}},[r("lb-cover",{attrs:{type:"more",fileList:e.subForm.imgs,tips:"750 * 750"},on:{selectedFiles:function(t){return e.selectedFiles(t,"imgs")},moveFiles:function(t){return e.moveFiles(t,"imgs")}}})],1),e._v(" "),r("el-form-item",{attrs:{label:"视频",prop:"video"}},[r("div",{staticClass:"item-warp"},[r("div",{staticClass:"upload-file-warp"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.subForm.video,expression:"subForm.video"}],staticClass:"choice-file-input",attrs:{type:"text",placeholder:"选择视频文件"},domProps:{value:e.subForm.video},on:{input:function(t){t.target.composing||e.$set(e.subForm,"video",t.target.value)}}}),e._v(" "),r("lb-cover",{attrs:{type:"button",fileType:"video"},on:{selectedFiles:e.getVideo}})],1)])]),e._v(" "),r("el-form-item",{attrs:{label:"土地地址",prop:"address"}},[r("el-input",{attrs:{placeholder:"请输入土地地址"},model:{value:e.subForm.address,callback:function(t){e.$set(e.subForm,"address",t)},expression:"subForm.address"}}),e._v(" "),r("div",{staticClass:"mt-md mb-md"},[r("el-input",{attrs:{placeholder:"请输入土地经度"},model:{value:e.subForm.lng,callback:function(t){e.$set(e.subForm,"lng",t)},expression:"subForm.lng"}})],1),e._v(" "),r("div",[r("el-input",{attrs:{placeholder:"请输入土地纬度"},model:{value:e.subForm.lat,callback:function(t){e.$set(e.subForm,"lat",t)},expression:"subForm.lat"}}),e._v(" "),r("lb-button",{staticClass:"getLocation",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",plain:""},on:{click:function(t){e.showMap=!0}}},[e._v("获取经纬度")])],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"土地简介",prop:"desc"}},[r("el-input",{attrs:{type:"textarea",rows:5,maxlength:"50","show-word-limit":"",resize:"none",placeholder:"请输入土地简介"},model:{value:e.subForm.desc,callback:function(t){e.$set(e.subForm,"desc",t)},expression:"subForm.desc"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"土地规格",prop:"spe"}},[r("lb-button",{staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary",plain:"",icon:"el-icon-plus"},on:{click:function(t){return e.toShowDialog("spe")}}},[e._v(e._s(e.$t("menu.LandSpeAdd")))]),e._v(" "),r("el-table",{ref:"multipleTable",staticStyle:{width:"800px"},attrs:{data:e.subForm.spe,"header-cell-style":{background:"#f5f7fa",color:"#606266"}},on:{"selection-change":e.handleSelectionChange}},[r("el-table-column",{attrs:{type:"selection",label:"全选"}}),e._v(" "),r("el-table-column",{attrs:{prop:"spe_name",label:"规格名称"}}),e._v(" "),r("el-table-column",{attrs:{prop:"area",label:"面积"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.area+"/m²")+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"price",label:"价格"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.price)+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("div",{staticClass:"table-operate"},[r("lb-button",{attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(r){return e.toShowDialog("spe",t.row)}}},[e._v(e._s(e.$t("action.edit")))]),e._v(" "),r("lb-button",{attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(r){return e.toDelItem("spe",t.$index)}}},[e._v(e._s(e.$t("action.delete")))])],1)]}}])})],1),e._v(" "),r("div",{staticClass:"table-bot"},[r("span",[e._v("已选 "+e._s(e.multipleSelection.length))]),e._v(" "),r("span",[e._v("批量设置:")]),e._v(" "),r("el-link",{staticClass:"mr-md",attrs:{disabled:0===e.multipleSelection.length,type:"primary"},on:{click:function(t){return e.toShowDialog("batch",{title:"面积",value:""})}}},[e._v("面积")]),e._v(" "),r("el-link",{attrs:{disabled:0===e.multipleSelection.length,type:"primary"},on:{click:function(t){return e.toShowDialog("batch",{title:"价格",value:""})}}},[e._v("价格")])],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"土地图文详情",prop:"text"}},[r("lb-ueditor",{attrs:{destroy:!0},model:{value:e.subForm.text,callback:function(t){e.$set(e.subForm,"text",t)},expression:"subForm.text"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"租赁周期",prop:"cycle"}},[r("lb-button",{staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary",plain:"",icon:"el-icon-plus"},on:{click:function(t){return e.toShowDialog("cycle")}}},[e._v(e._s(e.$t("menu.LandCycleAdd")))]),e._v(" "),r("div",{staticClass:"flex-warp"},e._l(e.subForm.cycle,function(t,a){return r("el-tag",{key:a,staticClass:"mb-sm",class:[{"ml-md":0!==a}],attrs:{closable:""},on:{close:function(t){return e.toDelItem("cycle",a)},click:function(r){return e.toShowDialog("cycle",t)}}},[e._v(e._s(t.day+"天"))])}),1)],1),e._v(" "),r("el-form-item",{attrs:{label:"地块服务",prop:"massif"}},[r("el-select",{attrs:{multiple:"",filterable:"",clearable:"","collapse-tags":"",placeholder:"请选择地块服务"},model:{value:e.subForm.massif,callback:function(t){e.$set(e.subForm,"massif",t)},expression:"subForm.massif"}},e._l(e.base_massif,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),r("el-form-item",{attrs:{label:"关联种子",prop:"seed"}},[r("el-select",{attrs:{multiple:"",filterable:"",clearable:"","collapse-tags":"",placeholder:"请选择关联种子"},model:{value:e.subForm.seed,callback:function(t){e.$set(e.subForm,"seed",t)},expression:"subForm.seed"}},e._l(e.base_seed,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),e.subForm.farmer_id?r("block",[r("el-form-item",{attrs:{label:"关联仪器",prop:"machine_id"}},[r("el-select",{attrs:{filterable:"",clearable:"","collapse-tags":"",placeholder:"请选择关联仪器"},model:{value:e.subForm.machine_id,callback:function(t){e.$set(e.subForm,"machine_id",t)},expression:"subForm.machine_id"}},e._l(e.base_machine,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),r("el-form-item",{attrs:{label:"关联监控",prop:"monitor"}},[r("el-select",{attrs:{multiple:"",filterable:"",clearable:"","collapse-tags":"",placeholder:"请选择关联监控"},model:{value:e.subForm.monitor,callback:function(t){e.$set(e.subForm,"monitor",t)},expression:"subForm.monitor"}},e._l(e.base_monitor,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1)],1):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"运费模版",prop:"send_tmpl_id"}},[r("el-select",{attrs:{filterable:"","collapse-tags":"",placeholder:"请选择运费模版"},model:{value:e.subForm.send_tmpl_id,callback:function(t){e.$set(e.subForm,"send_tmpl_id",t)},expression:"subForm.send_tmpl_id"}},e._l(e.base_freight,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1),e._v(" "),r("div",{staticClass:"f-caption c-link cursor-pointer",on:{click:function(t){return e.$router.push("/sys/freight/edit")}}},[e._v("\n 还没有运费模版?立即创建\n "),r("lb-tool-tips",[e._v("运费模版支持按重量计费和按件数计费两种方式,计费方式按照商品累加运费")])],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"是否开启分销",prop:"is_fx"}},[r("el-radio-group",{model:{value:e.subForm.is_fx,callback:function(t){e.$set(e.subForm,"is_fx",t)},expression:"subForm.is_fx"}},[r("el-radio",{attrs:{label:1}},[e._v(e._s(e.$t("action.ON")))]),e._v(" "),r("el-radio",{attrs:{label:0}},[e._v(e._s(e.$t("action.OFF")))])],1)],1),e._v(" "),1===e.subForm.is_fx?r("block",[r("el-form-item",{attrs:{label:"一级分销",prop:"one_fx"}},[r("el-input",{attrs:{placeholder:"请输入一级分销"},model:{value:e.subForm.one_fx,callback:function(t){e.$set(e.subForm,"one_fx",t)},expression:"subForm.one_fx"}},[r("template",{slot:"append"},[e._v("%")])],2)],1),e._v(" "),r("el-form-item",{attrs:{label:"二级分销",prop:"two_fx"}},[r("el-input",{attrs:{placeholder:"请输入二级分销"},model:{value:e.subForm.two_fx,callback:function(t){e.$set(e.subForm,"two_fx",t)},expression:"subForm.two_fx"}},[r("template",{slot:"append"},[e._v("%")])],2)],1)],1):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"排序值",prop:"top"}},[r("el-input-number",{staticClass:"lb-input-number",attrs:{controls:!1,precision:0,min:0,placeholder:"请输入排序值"},model:{value:e.subForm.top,callback:function(t){e.$set(e.subForm,"top",t)},expression:"subForm.top"}}),e._v(" "),r("lb-tool-tips",[e._v("值越大, 排序越靠前")])],1),e._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(t){return e.submitFormInfo("sub")}}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),r("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)],1),e._v(" "),r("el-dialog",{attrs:{title:e.$t(e.speForm.id?"menu.LandSpeEdit":"menu.LandSpeAdd"),visible:e.showDialog.spe,width:"550px",center:""},on:{"update:visible":function(t){return e.$set(e.showDialog,"spe",t)}}},[r("el-form",{ref:"speForm",staticClass:"dialog-form",attrs:{model:e.speForm,rules:e.speFormRules,"label-width":"130px"}},[r("el-form-item",{attrs:{label:"规格名称",prop:"spe_name"}},[r("el-input",{attrs:{placeholder:"请输入规格名称",maxlength:"20","show-word-limit":""},model:{value:e.speForm.spe_name,callback:function(t){e.$set(e.speForm,"spe_name",t)},expression:"speForm.spe_name"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"面积",prop:"area"}},[r("el-input",{attrs:{placeholder:"请输入面积"},model:{value:e.speForm.area,callback:function(t){e.$set(e.speForm,"area",t)},expression:"speForm.area"}},[r("template",{slot:"append"},[e._v("m²")])],2)],1),e._v(" "),r("el-form-item",{attrs:{label:"价格",prop:"price"}},[r("el-input",{attrs:{placeholder:"请输入价格"},model:{value:e.speForm.price,callback:function(t){e.$set(e.speForm,"price",t)},expression:"speForm.price"}},[r("template",{slot:"append"},[e._v("元")])],2)],1)],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.showDialog.spe=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(t){return e.submitFormInfo("spe")}}},[e._v("确 定")])],1)],1),e._v(" "),r("el-dialog",{attrs:{title:e.$t(e.cycleForm.id?"menu.LandCycleEdit":"menu.LandCycleAdd"),visible:e.showDialog.cycle,width:"550px",center:""},on:{"update:visible":function(t){return e.$set(e.showDialog,"cycle",t)}}},[r("el-form",{ref:"cycleForm",staticClass:"dialog-form",attrs:{model:e.cycleForm,rules:e.cycleFormRules,"label-width":"130px"}},[r("el-form-item",{attrs:{label:"租赁周期",prop:"day"}},[r("el-input",{attrs:{placeholder:"请输入租赁周期"},model:{value:e.cycleForm.day,callback:function(t){e.$set(e.cycleForm,"day",t)},expression:"cycleForm.day"}},[r("template",{slot:"append"},[e._v("天")])],2)],1)],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.showDialog.cycle=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(t){return e.submitFormInfo("cycle")}}},[e._v("确 定")])],1)],1),e._v(" "),r("el-dialog",{attrs:{title:"批量设置"+e.batchForm.title,visible:e.showDialog.batch,width:"550px",center:""},on:{"update:visible":function(t){return e.$set(e.showDialog,"batch",t)}}},[r("el-form",{ref:"batchForm",staticClass:"dialog-form",attrs:{model:e.batchForm,rules:"面积"===e.batchForm.title?e.batchAreaFormRules:e.batchPriceFormRules,"label-width":"130px"}},[r("el-form-item",{attrs:{label:e.batchForm.title,prop:"value"}},[r("el-input",{attrs:{placeholder:"请输入"+e.batchForm.title},model:{value:e.batchForm.value,callback:function(t){e.$set(e.batchForm,"value",t)},expression:"batchForm.value"}},[r("template",{slot:"append"},[e._v(e._s("面积"===e.batchForm.title?"m²":"元"))])],2)],1)],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.showDialog.batch=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(t){return e.submitFormInfo("batch")}}},[e._v("确 定")])],1)],1),e._v(" "),r("lb-map",{attrs:{dialogVisible:e.showMap},on:{"update:dialogVisible":function(t){e.showMap=t},"update:dialog-visible":function(t){e.showMap=t},selectedLatLng:e.getLatLng}})],1)},staticRenderFns:[]};var h=r("VU/8")(_,g,!1,function(e){r("Mexw")},"data-v-6b727638",null);t.default=h.exports}}); \ No newline at end of file diff --git a/public/static/js/4.js b/public/static/js/4.js new file mode 100644 index 0000000..cc7f696 --- /dev/null +++ b/public/static/js/4.js @@ -0,0 +1 @@ +webpackJsonp([4],{"R7v/":function(t,e){},Uxh6:function(t,e,a){t.exports=a.p+"static/img/notice3.10a1279.jpg"},rsLl:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=a("mvHQ"),n=a.n(s),i=a("Xxa5"),r=a.n(i),c=a("exGp"),o=a.n(c),l={data:function(){return{loading:!1,tableData:[],activeNames:[]}},created:function(){this.getFormInfo()},methods:{getFormInfo:function(){var t=this;return o()(r.a.mark(function e(){var a,s,n;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.loading=!0,e.next=3,t.$api.system.tmpLists();case 3:if(a=e.sent,s=a.code,n=a.data,t.loading=!1,200===s){e.next=9;break}return e.abrupt("return");case 9:t.tableData=n;case 10:case"end":return e.stop()}},e,t)}))()},getTmpID:function(t){var e=this;return o()(r.a.mark(function a(){var s,i,c,o;return r.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,e.$api.system.getTmplId({id:t});case 2:if(s=a.sent,i=s.code,c=s.data,200===i){a.next=7;break}return a.abrupt("return");case 7:o=JSON.parse(n()(e.tableData)),e.$message.success(e.$t("tips.successSub")),o.map(function(a){a.id===t&&(a.tmpl_id=c,e.tableData=o)});case 10:case"end":return a.stop()}},a,e)}))()},submitFormInfo:function(){var t=this;return o()(r.a.mark(function e(){var a,s;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=JSON.parse(n()(t.tableData)),e.next=3,t.$api.system.tmplUpdate(a);case 3:if(s=e.sent,200===s.code){e.next=7;break}return e.abrupt("return");case 7:t.$message.success(t.$t("tips.successSave")),t.getFormInfo();case 9:case"end":return e.stop()}},e,t)}))()}}},p={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"lb-sys-notice"},[s("top-nav"),t._v(" "),s("div",{staticClass:"page-main"},[s("el-collapse",{model:{value:t.activeNames,callback:function(e){t.activeNames=e},expression:"activeNames"}},[s("el-collapse-item",{attrs:{title:"* 【点击查看】如何配置订阅消息模板?",name:"1"}},[s("div",{staticStyle:{height:"15px"}}),t._v(" "),s("el-steps",{attrs:{direction:"vertical",active:4}},[s("el-step",{attrs:{title:"登录微信公众平台【https://mp.weixin.qq.com】"}},[s("div",{staticClass:"notice-description",attrs:{slot:"description"},slot:"description"},[s("p",[t._v("选择"),s("span",[t._v("【功能 - 订阅消息】")])]),t._v(" "),s("img",{attrs:{src:a("xsW+")}})])]),t._v(" "),s("el-step",{attrs:{title:"点击【公共模板库 - 搜索栏】"}},[s("div",{staticClass:"notice-description",attrs:{slot:"description"},slot:"description"},[s("p",[t._v("\n 在搜索栏输入模板标题,点击搜索然后手动添加对应的数据。若是没有相关模板,则可以通过"),s("span",[t._v("【申请模板】")]),t._v("来生成所需要的模板信息。\n ")]),t._v(" "),s("img",{attrs:{src:a("ytzi")}})])]),t._v(" "),s("el-step",{attrs:{title:"如下图中红框所示"}},[s("div",{staticClass:"notice-description",attrs:{slot:"description"},slot:"description"},[s("p",[t._v("\n 详细内容应与表格中对应"),s("span",[t._v("【详细内容】")]),t._v("的内容及顺序一致\n ")]),t._v(" "),s("img",{attrs:{src:a("Uxh6")}})])]),t._v(" "),s("el-step",{attrs:{title:"添加成功"}},[s("div",{staticClass:"notice-description",attrs:{slot:"description"},slot:"description"},[s("p",[t._v("\n 返回"),s("span",[t._v("【我的模板】")]),t._v(",找到对应模板配置,然后将"),s("span",[t._v("【模板ID】")]),t._v("复制到表格对应"),s("span",[t._v("【模板ID】")]),t._v("栏,最后点击"),s("span",[t._v("【保存】")]),t._v("按钮即可;\n ")])])])],1)],1)],1),t._v(" "),s("div",{staticStyle:{height:"20px"}}),t._v(" "),s("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[s("el-table-column",{attrs:{prop:"id",width:"100",label:"ID"}}),t._v(" "),s("el-table-column",{attrs:{prop:"sceneDesc",width:"150","show-overflow-tooltip":"",label:"模板标题"}}),t._v(" "),s("el-table-column",{attrs:{prop:"example",label:"详细内容"}}),t._v(" "),s("el-table-column",{attrs:{prop:"tmpl_id",label:"模板ID"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("el-input",{attrs:{placeholder:"请输入模板ID"},model:{value:e.row.tmpl_id,callback:function(a){t.$set(e.row,"tmpl_id",a)},expression:"scope.row.tmpl_id"}})]}}])})],1),t._v(" "),s("div",{staticClass:"space-lg"}),t._v(" "),s("lb-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitFormInfo()}}},[t._v(t._s(t.$t("action.save")))])],1)],1)},staticRenderFns:[]};var v=a("VU/8")(l,p,!1,function(t){a("R7v/")},"data-v-5c2f1151",null);e.default=v.exports},"xsW+":function(t,e,a){t.exports=a.p+"static/img/notice1.55287d5.jpg"},ytzi:function(t,e,a){t.exports=a.p+"static/img/notice2.2055c13.jpg"}}); \ No newline at end of file diff --git a/public/static/js/40.js b/public/static/js/40.js new file mode 100644 index 0000000..00806d5 --- /dev/null +++ b/public/static/js/40.js @@ -0,0 +1 @@ +webpackJsonp([40],{"09BK":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Xxa5"),n=a.n(r),i=a("exGp"),s=a.n(i),l={data:function(){return{loading:!1,searchForm:{page:1,limit:10,title:""},tableData:[],total:0}},activated:function(){this.getTableDataList(1)},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return s()(n.a.mark(function a(){var r,i,s;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.claim.breedList(t.searchForm);case 4:if(r=a.sent,i=r.code,s=r.data,t.loading=!1,200===i){a.next=10;break}return a.abrupt("return");case 10:t.tableData=s.data,t.total=s.total;case 12:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return s()(n.a.mark(function r(){return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.claim.breedUpdate({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page0){var a=t.map(function(e){return e.id});-1===e?this.confirmDel(a):this.updateItem(a,e)}else this.$message.error("请选择要操作的数据")},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return p()(u.a.mark(function n(){var o;return u.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:o=1===r?{id:e,status:t}:{id:e,index_show:t},a.$api.shop.goodsStatusUpdate(o).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page0?i.send_time.map(function(e){return{start_time:e.start_time,end_time:e.end_time}}):[{start_time:"",end_time:""}],e.subForm)e.subForm[r]=i[r];case 9:case"end":return t.stop()}},t,e)}))()},toAddDel:function(e){if(1===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))this.subForm.send_time.splice(e,1);else{var t=0===e?0:e-1,n=this.subForm.send_time[t],s=n.start_time,i=n.end_time;if(!s||!i)return void this.$message.error(s?"请选择结束时间":"请选择开始时间");this.subForm.send_time.push({start_time:"",end_time:""})}},submitFormInfo:function(){var e=this;this.$refs.subForm.validate(function(t){if(t){var n=JSON.parse(i()(e.subForm));for(var s in n.send_time){var r=1*s+1,a=1*s==0?s:1*s-1,m=n.send_time[s],o=m.start_time,l=m.end_time,d=n.send_time[a].end_time,u=moment((new Date).getTime()).format("YYYY-MM-DD");if(!o||!l){var c=o?"请选择结束时间":"请选择开始时间";return void e.$message.error("配送时段 第"+r+"条数据: "+c)}if(moment(u+" "+o).unix()>=moment(u+" "+l).unix())return void e.$message.error("配送时段 第"+r+"条数据:开始时间必须小于结束时间");if(1*s>0&&moment(u+" "+o).unix()1?n("el-button",{staticStyle:{"margin-left":"15px"},attrs:{size:"small",type:"danger",icon:"el-icon-delete"},on:{click:function(t){return e.toAddDel(s,1)}}},[e._v(e._s(e.$t("action.delete")))]):e._e(),e._v(" "),s===e.subForm.send_time.length-1?n("el-button",{staticStyle:{"margin-left":"15px"},attrs:{size:"small",type:"primary",icon:"el-icon-plus"},on:{click:function(t){return e.toAddDel(s)}}},[e._v(e._s(e.$t("action.add")))]):e._e()],1)])}),0),e._v(" "),n("el-form-item",[n("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v(e._s(e.$t("action.submit")))])],1)],1)],1)],1)},staticRenderFns:[]};var u=n("VU/8")(l,d,!1,function(e){n("xKFA")},"data-v-636f8265",null);t.default=u.exports},xKFA:function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/44.js b/public/static/js/44.js new file mode 100644 index 0000000..469a70c --- /dev/null +++ b/public/static/js/44.js @@ -0,0 +1 @@ +webpackJsonp([44],{"M+bL":function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t("Xxa5"),r=t.n(i),u=t("exGp"),s=t.n(u),a={data:function(){return{options:[{value:0,label:"本地上传"},{value:2,label:"七牛云上传"},{value:1,label:"阿里云OSS上传"},{value:3,label:"腾讯云上传"}],baseForm:{id:""},baseFormRules:{},open_oss:0,qiniuyunForm:{qiniu_accesskey:"",qiniu_secretkey:"",qiniu_bucket:"",qiniu_yuming:""},qiniuyunFormRules:{qiniu_accesskey:{required:!0,type:"string",message:"请输入AccessKey",trigger:"blur"},qiniu_secretkey:{required:!0,type:"string",message:"请输入SecretKey",trigger:"blur"},qiniu_bucket:{required:!0,type:"string",message:"请输入仓库名称",trigger:"blur"},qiniu_yuming:{required:!0,type:"string",message:"请输入自定义域名",trigger:"blur"}},aliyunForm:{aliyun_bucket:"",aliyun_access_key_id:"",aliyun_access_key_secret:"",aliyun_base_dir:"",aliyun_zidinyi_yuming:"",aliyun_endpoint:""},aliyunFormRules:{aliyun_bucket:{required:!0,type:"string",message:"请输入仓库名称",trigger:"blur"},aliyun_access_key_id:{required:!0,type:"string",message:"请输入AccessKeyId",trigger:"blur"},aliyun_access_key_secret:{required:!0,type:"string",message:"请输入AccessKeySecret",trigger:"blur"},aliyun_base_dir:{required:!0,type:"string",message:"请输入上传根目录",trigger:"blur"},aliyun_zidinyi_yuming:{required:!0,type:"string",message:"请输入自定义域名",trigger:"blur"},aliyun_endpoint:{required:!0,type:"string",message:"请输入Endpoint",trigger:"blur"}},tengxunyunForm:{tenxunyun_appid:"",tenxunyun_secretid:"",tenxunyun_secretkey:"",tenxunyun_bucket:"",tenxunyun_region:"",tenxunyun_yuming:""},tengxunyunFormRules:{tenxunyun_appid:{required:!0,type:"string",message:"请输入AppId",trigger:"blur"},tenxunyun_secretid:{required:!0,type:"string",message:"请输入SecretId",trigger:"blur"},tenxunyun_secretkey:{required:!0,type:"string",message:"请输入SecretKey",trigger:"blur"},tenxunyun_bucket:{required:!0,type:"string",message:"请输入仓库名称",trigger:"blur"},tenxunyun_region:{required:!1,type:"string",message:"请输入仓库地域",trigger:"blur"},tenxunyun_yuming:{required:!0,type:"string",message:"请输入仓库域名",trigger:"blur"}}}},created:function(){this.getFormInfo()},methods:{getFormInfo:function(){var e=this;return s()(r.a.mark(function n(){var t,i,u,s,a,l,o;return r.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.$api.system.getOssConfig();case 2:if(t=n.sent,i=t.code,u=t.data,200===i){n.next=7;break}return n.abrupt("return");case 7:for(e.open_oss=u.open_oss,a=0,l=(s=["baseForm","qiniuyunForm","aliyunForm","tengxunyunForm"]).length;a0?"":"?")+"token="+sessionStorage.getItem("minitk");window.location.href=a,setTimeout(function(){e.downloadLoading=!1},5e3)}},filters:{handleTime:function(e,t){return 1===t?moment(1e3*e).format("YYYY-MM-DD"):2===t?moment(1e3*e).format("HH:mm:ss"):moment(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},u={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-dis-relation"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("el-tabs",{attrs:{type:"border-card"}},[a("el-tab-pane",{attrs:{label:"分销商关系"}},[a("el-row",{staticClass:"page-top-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-export",expression:"`${$route.name}-export`"}],attrs:{size:"mini",plain:"",type:"primary",icon:"el-icon-download",loading:e.downloadLoading},on:{click:e.toExport}},[e._v(e._s(e.$t("action.export")))])],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading.list,expression:"loading.list"}],staticStyle:{width:"100%"},attrs:{data:e.tableData.list,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"id",label:"用户ID"}}),e._v(" "),a("el-table-column",{attrs:{prop:"nickName",label:"微信昵称","min-width":"120"}}),e._v(" "),a("el-table-column",{attrs:{label:"微信头像"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("lb-image",{attrs:{src:e.row.avatarUrl}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"total_fx_cash",label:"产生收益"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.total_fx_cash)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"fx_cash",label:""},scopedSlots:e._u([{key:"header",fn:function(t){return[a("div",[e._v("\n 总收益"),a("lb-tool-tips",{attrs:{padding:"2"}},[e._v("可提现金额")])],1)]}},{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.fx_cash)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"wallte_cash",label:"已提现"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.wallte_cash)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"pid",label:"上线ID"}}),e._v(" "),a("el-table-column",{attrs:{prop:"top_info.nickName",label:"上线昵称"}}),e._v(" "),a("el-table-column",{attrs:{label:"上线头像"},scopedSlots:e._u([{key:"default",fn:function(e){return e.row.top_info?[a("lb-image",{attrs:{src:e.row.top_info.avatarUrl}})]:void 0}}],null,!0)}),e._v(" "),a("el-table-column",{attrs:{prop:"create_time",label:"绑定时间","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return t.row.fx_bind_time>0?[a("p",[e._v(e._s(e._f("handleTime")(t.row.fx_bind_time,1)))]),e._v(" "),a("p",[e._v(e._s(e._f("handleTime")(t.row.fx_bind_time,2)))])]:void 0}}],null,!0)})],1),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.list.page,pageSize:e.searchForm.list.limit,total:e.total.list},on:{handleSizeChange:function(t){return e.handleSizeChange(t,"list")},handleCurrentChange:function(t){return e.handleCurrentChange(t,"list")}}})],1),e._v(" "),a("el-tab-pane",{attrs:{label:"查找关系"}},[a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"findForm",attrs:{inline:!0,model:e.searchForm.find},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"输入查询",prop:"user_id"}},[a("el-input",{attrs:{placeholder:"请输入用户ID"},model:{value:e.searchForm.find.user_id,callback:function(t){e.$set(e.searchForm.find,"user_id",t)},expression:"searchForm.find.user_id"}})],1),e._v(" "),e.searchForm.find.user_id?a("el-form-item",{attrs:{label:"查询类型",prop:"type"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1,"find")}},model:{value:e.searchForm.find.type,callback:function(t){e.$set(e.searchForm.find,"type",t)},expression:"searchForm.find.type"}},e._l(e.searchType,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1):e._e(),e._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1,"find")}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("find")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1)],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading.find,expression:"loading.find"}],staticStyle:{width:"100%"},attrs:{data:e.tableData.find,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"id",label:"用户ID"}}),e._v(" "),a("el-table-column",{attrs:{prop:"nickName",label:"微信昵称"}}),e._v(" "),a("el-table-column",{attrs:{label:"微信头像"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("lb-image",{attrs:{src:e.row.avatarUrl}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"date",label:"绑定时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("p",[e._v(e._s(e._f("handleTime")(t.row.create_time,1)))]),e._v(" "),a("p",[e._v(e._s(e._f("handleTime")(t.row.create_time,2)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"total_fx_cash",label:"产生收益"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.total_fx_cash)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"fx_cash",label:""},scopedSlots:e._u([{key:"header",fn:function(t){return[a("div",[e._v("\n 总收益"),a("lb-tool-tips",{attrs:{padding:"2"}},[e._v("可提现金额")])],1)]}},{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.fx_cash)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"wallte_cash",label:"已提现"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.wallte_cash)+"\n ")]}}])})],1),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.list.page,pageSize:e.searchForm.list.limit,total:e.total.list},on:{handleSizeChange:function(t){return e.handleSizeChange(t,"list")},handleCurrentChange:function(t){return e.handleCurrentChange(t,"list")}}})],1)],1)],1)],1)},staticRenderFns:[]};var d=a("VU/8")(c,u,!1,function(e){a("VuFY")},"data-v-62fb97ca",null);t.default=d.exports}}); \ No newline at end of file diff --git a/public/static/js/47.js b/public/static/js/47.js new file mode 100644 index 0000000..999922c --- /dev/null +++ b/public/static/js/47.js @@ -0,0 +1 @@ +webpackJsonp([47],{kaEl:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=r("mvHQ"),a=r.n(s),o=r("Xxa5"),i=r.n(o),l=r("exGp"),n=r.n(l),u={data:function(){var e=this;return{id:"",navTitle:"",subForm:{id:0,type:2,user_name:"平台",cover:[],title:"",desc:"",address:"",lat:"",lng:"",mobile:"",index_show:0,business_status:0},subFormRules:{cover:{required:!0,type:"array",message:"请上传店铺头像",trigger:"blur"},title:{required:!0,validator:this.$reg.isNoEmpty,text:"店铺名称",reg_type:2,trigger:"blur"},address:{required:!0,validator:function(t,r,s){var a=e.subForm,o=a.address,i=a.lat,l=a.lng;(o=o?o.replace(/(^\s*)|(\s*$)/g,""):"")?l&&/^[\-\+]?(0(\.\d{1,15})?|([1-9](\d)?)(\.\d{1,15})?|1[0-7]\d{1}(\.\d{1,15})?|180\.0{1,15})$/.test(l)?i&&/^[\-\+]?((0|([1-8]\d?))(\.\d{1,15})?|90(\.0{1,15})?)$/.test(i)?s():s(new Error(i?"请输入正确的纬度":"请输入店铺纬度")):s(new Error(l?"请输入正确的经度":"请输入店铺经度")):s(new Error("请输入店铺地址"))},trigger:["blur","change"]},desc:{required:!0,validator:this.$reg.isNoEmpty,text:"店铺描述",reg_type:2,trigger:"blur"},mobile:{required:!0,validator:this.$reg.validateAllPhone,text:"联系电话",reg_type:2,trigger:"blur"}},showMap:!1}},created:function(){var e=this;return n()(i.a.mark(function t(){var r;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(r=e.$route.query.id)&&(e.subForm.id=r,e.getDetail(r)),e.navTitle=e.$t(r?"menu.ShopStoreEdit":"menu.ShopStoreAdd");case 3:case"end":return t.stop()}},t,e)}))()},methods:{getDetail:function(e){var t=this;return n()(i.a.mark(function r(){var s,a,o,l;return i.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.$api.farmer.farmerInfo({id:e});case 2:if(s=r.sent,a=s.code,o=s.data,200===a){r.next=7;break}return r.abrupt("return");case 7:for(l in o.cover=[{url:o.cover}],t.subForm)t.subForm[l]=o[l];case 9:case"end":return r.stop()}},r,t)}))()},getCover:function(e){this.subForm.cover=e},getLatLng:function(e){this.subForm.lat=e.lat,this.subForm.lng=e.lng},submitFormInfo:function(){var e=this,t=!0;if(this.$refs.subForm.validate(function(e){e||(t=!1)}),t){var r=JSON.parse(a()(this.subForm));r.cover=r.cover[0].url;var s=r.id?"farmerUpdate":"farmerAdd";this.$api.farmer[s](r).then(function(t){200===t.code&&(e.$message.success(e.$t(r.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}}}},c={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-shop-store-edit"},[r("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",staticClass:"dialog-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"100px"}},[r("el-form-item",{attrs:{label:"店铺头像",prop:"cover"}},[r("lb-cover",{attrs:{fileList:e.subForm.cover},on:{selectedFiles:e.getCover}}),e._v(" "),r("lb-tool-tips",[e._v("图片建议尺寸:710 * 286")])],1),e._v(" "),r("el-form-item",{attrs:{label:"店铺名称",prop:"title"}},[r("el-input",{attrs:{maxlength:"20","show-word-limit":"",placeholder:"请输入店铺名称"},model:{value:e.subForm.title,callback:function(t){e.$set(e.subForm,"title",t)},expression:"subForm.title"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"店铺地址",prop:"address"}},[r("el-input",{attrs:{placeholder:"请输入店铺地址"},model:{value:e.subForm.address,callback:function(t){e.$set(e.subForm,"address",t)},expression:"subForm.address"}}),e._v(" "),r("div",{staticClass:"mt-md mb-md"},[r("el-input",{attrs:{placeholder:"请输入店铺经度"},model:{value:e.subForm.lng,callback:function(t){e.$set(e.subForm,"lng",t)},expression:"subForm.lng"}})],1),e._v(" "),r("div",[r("el-input",{attrs:{placeholder:"请输入店铺纬度"},model:{value:e.subForm.lat,callback:function(t){e.$set(e.subForm,"lat",t)},expression:"subForm.lat"}}),e._v(" "),r("lb-button",{staticClass:"getLocation",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",plain:""},on:{click:function(t){e.showMap=!0}}},[e._v("获取经纬度")])],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"店铺描述",prop:"desc"}},[r("el-input",{attrs:{placeholder:"请输入店铺描述"},model:{value:e.subForm.desc,callback:function(t){e.$set(e.subForm,"desc",t)},expression:"subForm.desc"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"联系电话",prop:"mobile"}},[r("el-input",{attrs:{placeholder:"请输入联系电话"},model:{value:e.subForm.mobile,callback:function(t){e.$set(e.subForm,"mobile",t)},expression:"subForm.mobile"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"设为推荐",prop:"index_show"}},[r("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:e.subForm.index_show,callback:function(t){e.$set(e.subForm,"index_show",t)},expression:"subForm.index_show"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"是否营业",prop:"business_status"}},[r("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:e.subForm.business_status,callback:function(t){e.$set(e.subForm,"business_status",t)},expression:"subForm.business_status"}})],1),e._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),r("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)],1),e._v(" "),r("lb-map",{attrs:{dialogVisible:e.showMap},on:{"update:dialogVisible":function(t){e.showMap=t},"update:dialog-visible":function(t){e.showMap=t},selectedLatLng:e.getLatLng}})],1)},staticRenderFns:[]};var m=r("VU/8")(u,c,!1,function(e){r("shms")},"data-v-5db3e25f",null);t.default=m.exports},shms:function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/48.js b/public/static/js/48.js new file mode 100644 index 0000000..800e98b --- /dev/null +++ b/public/static/js/48.js @@ -0,0 +1 @@ +webpackJsonp([48],{eB79:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r("mvHQ"),a=r.n(o),p=r("Gu7T"),s=r.n(p),i=r("Xxa5"),n=r.n(i),l=r("exGp"),u=r.n(l),c={data:function(){return{subForm:{ios_login:0,app_app_id:"",app_app_secret:"",app_text:"",app_logo:[],app_banner:[],login_protocol:"",information_protection:""},subFormRules:{app_app_id:{required:!0,type:"string",message:"请输入微信开放平台移动应用AppID",trigger:"blur"},app_app_secret:{required:!0,type:"string",message:"请输入微信开放平台移动应用AppSecret",trigger:"blur"},app_text:{required:!0,validator:this.$reg.isNoEmpty,text:"APP名称",reg_type:2,trigger:"blur"},app_logo:{required:!0,type:"array",message:"请上传Logo",trigger:"blur"},app_banner:{required:!0,type:"array",message:"请上传开屏广告图片",trigger:"blur"},ios_login:{required:!0,type:"number",message:"请选择",trigger:"blur"},login_protocol:{required:!0,type:"string",message:"请输入用户隐私协议",trigger:"blur"},information_protection:{required:!0,type:"string",message:"请输入个人信息保护指引",trigger:"blur"}}}},created:function(){this.getFormInfo()},methods:{getFormInfo:function(){var e=this;return u()(n.a.mark(function t(){var r,o,a,p;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$api.system.configInfo();case 2:if(r=t.sent,o=r.code,a=r.data,200===o){t.next=7;break}return t.abrupt("return");case 7:for(p in a.app_logo=a.app_logo?[{url:a.app_logo}]:[],a.app_banner=a.app_banner&&a.app_banner.length>0?a.app_banner.map(function(e){return{url:e}}):[],e.subForm)e.subForm[p]=a[p];case 10:case"end":return t.stop()}},t,e)}))()},getCover:function(e,t){this.subForm[t]=e},selectedFiles:function(e,t){var r;(r=this.subForm[t]).push.apply(r,s()(e))},moveFiles:function(e,t){this.subForm[t]=e},submitFormInfo:function(){var e=this;this.$refs.subForm.validate(function(t){if(t){var r=JSON.parse(a()(e.subForm));r.app_logo=r.app_logo[0].url,r.app_banner=r.app_banner.map(function(e){return e.url}),e.$api.system.configUpdate(r).then(function(t){200===t.code&&e.$message.success(e.$t("tips.successSub"))})}})}}},_={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-system-wechat"},[r("top-nav"),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",staticClass:"config-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"160px"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("el-form-item",{attrs:{label:"AppID",prop:"app_app_id"}},[r("el-input",{attrs:{placeholder:"请输入微信开放平台移动应用AppID"},model:{value:e.subForm.app_app_id,callback:function(t){e.$set(e.subForm,"app_app_id",t)},expression:"subForm.app_app_id"}}),e._v(" "),r("lb-tool-tips",[e._v("请输入微信开放平台申请移动应用的AppID,输入错误会影响APP的正常使用,谨慎修改")])],1),e._v(" "),r("el-form-item",{attrs:{label:"AppSecret",prop:"app_app_secret"}},[r("el-input",{attrs:{placeholder:"请输入微信开放平台移动应用AppSecret"},model:{value:e.subForm.app_app_secret,callback:function(t){e.$set(e.subForm,"app_app_secret",t)},expression:"subForm.app_app_secret"}}),e._v(" "),r("lb-tool-tips",[e._v("请输入微信开放平台申请移动应用的AppSecret,输入错误会影响APP的正常使用,谨慎修改")])],1),e._v(" "),r("el-form-item",{attrs:{label:"APP名称",prop:"app_text"}},[r("el-input",{attrs:{maxlength:"10","show-word-limit":"",placeholder:"请输入APP名称"},model:{value:e.subForm.app_text,callback:function(t){e.$set(e.subForm,"app_text",t)},expression:"subForm.app_text"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"Logo",prop:"app_logo"}},[r("lb-cover",{attrs:{fileList:e.subForm.app_logo},on:{selectedFiles:function(t){return e.getCover(t,"app_logo")}}}),e._v(" "),r("lb-tool-tips",[e._v("图片建议尺寸:160*160")])],1),e._v(" "),r("el-form-item",{attrs:{label:"开屏广告图片",prop:"app_banner"}},[r("div",{staticClass:"c-warning mb-lg"},[r("div",{staticStyle:{"line-height":"1.5"}},[e._v("\n 开屏广告图片建议制作成.9.png格式的图片,鉴于每个手机的屏幕尺寸不一致,为了适配图片,请不要将重要信息放于上下左右靠边的位置;\n ")]),e._v(" "),r("div",{staticStyle:{"line-height":"1.5"}},[e._v("\n 设计样式请参考\n "),r("a",{staticClass:"c-link pointer",attrs:{href:"https://lbqny.migugu.com/image/666/22/08/nzI7RMWcVJzuQO6K73wWqALzAfjf6qE3.9"}},[e._v("点击查看此图")])])]),e._v(" "),r("lb-cover",{attrs:{fileList:e.subForm.app_banner},on:{selectedFiles:function(t){return e.getCover(t,"app_banner")}}}),e._v(" "),r("lb-tool-tips",[e._v("图片建议尺寸:1080 * 1920")])],1),e._v(" "),r("el-form-item",{attrs:{label:"是否开启Apple登录",prop:"ios_login"}},[r("el-radio-group",{model:{value:e.subForm.ios_login,callback:function(t){e.$set(e.subForm,"ios_login",t)},expression:"subForm.ios_login"}},[r("el-radio",{attrs:{label:1}},[e._v(e._s(e.$t("action.ON")))]),e._v(" "),r("el-radio",{attrs:{label:0}},[e._v(e._s(e.$t("action.OFF")))])],1),e._v(" "),r("lb-tool-tips",[e._v("当苹果应用提交审核时需开启,审核通过后需关闭")])],1),e._v(" "),r("el-form-item",{attrs:{label:"用户隐私协议",prop:"login_protocol"}},[r("lb-ueditor",{attrs:{destroy:!0,ueditorType:3},model:{value:e.subForm.login_protocol,callback:function(t){e.$set(e.subForm,"login_protocol",t)},expression:"subForm.login_protocol"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"个人信息保护指引",prop:"information_protection"}},[r("lb-ueditor",{attrs:{destroy:!0,ueditorType:3},model:{value:e.subForm.information_protection,callback:function(t){e.$set(e.subForm,"information_protection",t)},expression:"subForm.information_protection"}})],1),e._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v(e._s(e.$t("action.submit")))])],1)],1)],1)],1)},staticRenderFns:[]};var m=r("VU/8")(c,_,!1,function(e){r("qMFh")},"data-v-5cc2c8d4",null);t.default=m.exports},qMFh:function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/49.js b/public/static/js/49.js new file mode 100644 index 0000000..6581da2 --- /dev/null +++ b/public/static/js/49.js @@ -0,0 +1 @@ +webpackJsonp([49],{CJ0a:function(t,e){},O0Tl:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a("Xxa5"),r=a.n(n),i=a("exGp"),s=a.n(i),l=a("Zz1P"),o=a.n(l),c={data:function(){return{loading:!1,typeText:{1:"按件数",2:"按重量"},searchForm:{page:1,limit:10,title:""},tableData:[],total:0}},activated:function(){this.getTableDataList(1)},methods:{resetForm:function(t){this.$refs[t].resetFields(),this.getTableDataList(1)},handleSizeChange:function(t){this.searchForm.limit=t,this.handleCurrentChange(1)},handleCurrentChange:function(t){this.searchForm.page=t,this.getTableDataList()},getTableDataList:function(t){var e=this;return s()(r.a.mark(function a(){var n,i,s;return r.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return t&&(e.searchForm.page=1),e.loading=!0,a.next=4,e.$api.shop.tmplList(e.searchForm);case 4:if(n=a.sent,i=n.code,s=n.data,e.loading=!1,200===i){a.next=10;break}return a.abrupt("return");case 10:e.tableData=s.data,e.total=s.total;case 12:case"end":return a.stop()}},a,e)}))()},confirmDel:function(t){var e=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){e.updateItem(t,-1)}).catch(function(){})},updateItem:function(t,e){var a=this;return s()(r.a.mark(function n(){return r.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:a.$api.shop.tmplUpdate({id:t,status:e}).then(function(t){if(200===t.code)a.$message.success(a.$t(-1===e?"tips.successDel":"tips.successOper")),-1===e&&(a.searchForm.page=a.searchForm.page")}),l=s.good_eva,c=s.bad_eva,u=s.data,d=s.total,t.count={goods:l,bad:c},t.tableData=u,t.total=d;case 21:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return d()(m.a.mark(function r(){return m.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.claim.evaluateUpdate({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page0?r.imgs.map(function(e){return{url:e}}):[],t.dialogForm=r,t.showDialog=!t.showDialog;case 4:case"end":return a.stop()}},a,t)}))()}},filters:{handleTime:function(e,t){return 1===t?f()(1e3*e).format("YYYY-MM-DD"):2===t?f()(1e3*e).format("HH:mm:ss"):f()(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},_={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-shop-refund"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("el-row",{staticClass:"page-top-operate"},[a("el-button",{attrs:{type:0===e.searchForm.eva_type?"primary":"",plain:"",size:"medium"},on:{click:function(t){return e.toChange(0)}}},[e._v("全部")]),e._v(" "),a("el-button",{attrs:{type:1===e.searchForm.eva_type?"primary":"",plain:"",size:"medium"},on:{click:function(t){return e.toChange(1)}}},[e._v("好评("+e._s(e.count.goods||0)+")")]),e._v(" "),a("el-button",{attrs:{type:2===e.searchForm.eva_type?"primary":"",plain:"",size:"medium"},on:{click:function(t){return e.toChange(2)}}},[e._v("差评("+e._s(e.count.bad||0)+")")])],1),e._v(" "),a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"订单类型",prop:"type"}},[a("el-select",{attrs:{filterable:"",placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.type,callback:function(t){e.$set(e.searchForm,"type",t)},expression:"searchForm.type"}},e._l(e.base_type,function(e){return a("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),3!==e.searchForm.type?a("el-form-item",{attrs:{label:"农场",prop:"farmer_id"}},[a("el-select",{attrs:{filterable:"",placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.farmer_id,callback:function(t){e.$set(e.searchForm,"farmer_id",t)},expression:"searchForm.farmer_id"}},e._l(e.base_farmer,function(e){return a("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1):e._e(),e._v(" "),3===e.searchForm.type?a("el-form-item",{attrs:{label:"店铺",prop:"store_id"}},[a("el-select",{attrs:{filterable:"",placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.store_id,callback:function(t){e.$set(e.searchForm,"store_id",t)},expression:"searchForm.store_id"}},e._l(e.base_store,function(e){return a("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1):e._e(),e._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1)}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("searchForm")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1)],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"80",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{prop:"user_id",label:"用户ID"}}),e._v(" "),a("el-table-column",{attrs:{prop:"nickName",label:"用户昵称"}}),e._v(" "),a("el-table-column",{attrs:{prop:"",label:3===e.searchForm.type?"评价店铺":"评价农场"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(3===e.searchForm.type?t.row.order_info.store_info.title:t.row.title)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"type",label:"订单类型"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.orderType[t.row.type])+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"order_code",label:"评价关联单号","min-width":"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"c-link",staticStyle:{cursor:"pointer"},on:{click:function(a){e.$route.meta.pagePermission[0].auth.includes("joinOrder")&&e.$router.push("/order/"+(1===t.row.type?"claim":2===t.row.type?"land":"shop")+"/detail?id="+t.row.order_id)}}},[e._v("\n "+e._s(t.row.order_code)+"\n ")])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"star",label:"评价星级","min-width":"140"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"flex-warp"},e._l(5,function(e,r){return a("i",{key:r,staticClass:"iconfont icon-star-fill mr-sm",style:{color:r0?s("el-form-item",{attrs:{label:"秒杀优惠:"}},[s("div",{staticClass:"c-warning"},[e._v(e._s("-¥"+e.subForm.kill_discount_price))])]):e._e(),e._v(" "),1*e.subForm.integral_discount_price>0?s("el-form-item",{attrs:{label:"积分抵扣:"}},[s("div",{staticClass:"c-warning"},[e._v("\n "+e._s("-¥"+e.subForm.integral_discount_price)+"\n ")])]):e._e(),e._v(" "),1*e.subForm.discount>0?s("el-form-item",{attrs:{label:"卡券优惠:"}},[s("div",{staticClass:"c-warning"},[e._v(e._s("-¥"+e.subForm.discount))])]):e._e(),e._v(" "),s("el-form-item",{attrs:{label:"实付金额:"}},[s("div",{staticClass:"c-warning"},[e._v(e._s("¥"+e.subForm.pay_price))])]),e._v(" "),s("el-form-item",{attrs:{label:"支付方式:"}},[s("div",[e._v(e._s(e.payType[e.subForm.pay_model]))])]),e._v(" "),s("el-form-item",{attrs:{label:"配送时间:"}},[s("div",[e._v("\n "+e._s(e._f("handleTime")(e.subForm.send_start_time,3))+" ~\n "+e._s(e._f("handleTime")(e.subForm.send_end_time,3))+"\n ")])]),e._v(" "),e.subForm.text?s("el-form-item",{attrs:{label:"订单备注:"}},[s("div",[e._v("\n "+e._s(e.subForm.text)+"\n ")])]):e._e()],1),e._v(" "),e.subForm.video?s("block",[s("lb-classify-title",{attrs:{title:"上传视频"}}),e._v(" "),s("video",{attrs:{controls:"",width:"500",height:"300",src:e.subForm.video}}),e._v(" "),s("div",{staticClass:"space-lg"})],1):e._e(),e._v(" "),s("lb-classify-title",{attrs:{title:"所购商品"}}),e._v(" "),s("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.subForm.order_goods,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[s("el-table-column",{attrs:{prop:"goods_cover",label:"商品图片"},scopedSlots:e._u([{key:"default",fn:function(e){return[s("lb-image",{attrs:{src:e.row.goods_cover}})]}}])}),e._v(" "),s("el-table-column",{attrs:{prop:"goods_name",label:"商品名称"}}),e._v(" "),s("el-table-column",{attrs:{prop:"spe_name",label:"规格"}}),e._v(" "),s("el-table-column",{attrs:{prop:"goods_price",label:"价格"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.goods_price)+"\n ")]}}])}),e._v(" "),s("el-table-column",{attrs:{prop:"goods_num",label:"数量"}})],1),e._v(" "),s("div",{staticClass:"space-lg mt-lg mb-lg"},[e._v("\n 合计数量:"+e._s(e.subForm.all_goods_num)+"\n ")]),e._v(" "),s("lb-button",{attrs:{type:"primary"},on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)},staticRenderFns:[]};var n=s("VU/8")(l,_,!1,function(e){s("k3vT")},"data-v-5a7d95af",null);t.default=n.exports}}); \ No newline at end of file diff --git a/public/static/js/51.js b/public/static/js/51.js new file mode 100644 index 0000000..c7808a3 --- /dev/null +++ b/public/static/js/51.js @@ -0,0 +1 @@ +webpackJsonp([51],{"3oPi":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a("Xxa5"),r=a.n(n),i=a("exGp"),s=a.n(i),o={data:function(){return{loading:!1,searchForm:{page:1,limit:10,type:1,title:""},tableData:[],total:0}},activated:function(){this.getTableDataList(1)},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return s()(r.a.mark(function a(){var n,i,s;return r.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.land.seedList(t.searchForm);case 4:if(n=a.sent,i=n.code,s=n.data,t.loading=!1,200===i){a.next=10;break}return a.abrupt("return");case 10:t.tableData=s.data,t.total=s.total;case 12:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return s()(r.a.mark(function n(){return r.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:a.$api.land.seedStatusUpdate({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.pageDate.now()}},statusOptions:[{label:"全部",value:0},{label:"未授权微信昵称/头像",value:1},{label:"已授权微信昵称/头像",value:2}],blacklist:0,loading:!1,searchForm:{page:1,limit:10,nickName:"",type:0,is_black:0,start_time:"",end_time:""},tableData:[],total:0,showDialog:!1,subForm:{id:0,nickName:"",phone:"",yu_integral:"",oper_type:1,integral:""},subFormRules:{oper_type:{required:!0,type:"number",message:"请选择操作类型",trigger:"blur"},integral:{required:!0,validator:this.$reg.isFloatNum,text:"积分",reg_type:2,trigger:"blur"}}}},activated:function(){var e=this;return l()(i.a.mark(function t(){return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getBaseInfo();case 2:e.getTableDataList();case 3:case"end":return t.stop()}},t,e)}))()},methods:{getBaseInfo:function(){var e=this;return l()(i.a.mark(function t(){var a,r,n,s;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$api.system.configInfo();case 2:if(a=t.sent,r=a.code,n=a.data,200===r){t.next=7;break}return t.abrupt("return");case 7:s=n.blacklist,e.blacklist=s,e.searchForm.is_black=s?0:-1;case 10:case"end":return t.stop()}},t,e)}))()},changeType:function(){var e=this.searchForm,t=e.type,a=e.nickName;this.searchForm.nickName=1===t?"":a,this.getTableDataList(1)},resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return l()(i.a.mark(function a(){var r,s,o,l,c;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,r=JSON.parse(n()(t.searchForm)),(s=r.start_time)&&s.length>0?(r.start_time=parseInt(s[0]/1e3),r.end_time=parseInt(s[1]/1e3)+86400-1):(r.start_time="",r.end_time=""),-1===r.is_black&&delete r.is_black,a.next=8,t.$api.custom.userList(r);case 8:if(o=a.sent,l=o.code,c=o.data,t.loading=!1,200===l){a.next=14;break}return a.abrupt("return");case 14:t.tableData=c.data,t.total=c.total;case 16:case"end":return a.stop()}},a,t)}))()},handleSelectionChange:function(e){var t=[];e.map(function(e){t.push(e.id)}),this.multipleSelection=t},confirmRemoveBlackList:function(e){var t=this,a=e.id,r=e.nickName,n=e.is_black,s=1===n?"移出":"移入";this.$confirm("请确认是否要将「"+r+"」"+s+"黑名单?",this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(a,1===n?0:1)}).catch(function(){})},updateItem:function(e,t){var a=this;return l()(i.a.mark(function r(){return i.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.custom.userUpdate({id:e,is_black:t}).then(function(e){200===e.code?(a.$message.success(a.$t("tips.successOper")),a.getTableDataList()):a.getTableDataList()});case 1:case"end":return r.stop()}},r,a)}))()},toShowDialog:function(e){var t=this;return l()(i.a.mark(function a(){var r;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:for(r in(e=JSON.parse(n()(e))).yu_integral=e.integral,e.oper_type=1,e.integral="",t.subForm)t.subForm[r]=e[r];t.showDialog=!t.showDialog;case 6:case"end":return a.stop()}},a,t)}))()},submitFormInfo:function(){var e=this;return l()(i.a.mark(function t(){var a,r,s,o,l,c;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=!0,e.$refs.subForm.validate(function(e){e||(a=!1)}),!a){t.next=14;break}return r=JSON.parse(n()(e.subForm)),s=r.id,o=r.oper_type,l=r.integral,2===o&&(l="-"+l),t.next=7,e.$api.custom.userIntegralUpdate({user_id:s,integral:l});case 7:if(c=t.sent,200===c.code){t.next=11;break}return t.abrupt("return");case 11:e.$message.success(e.$t("tips.successRev")),e.showDialog=!1,e.getTableDataList();case 14:case"end":return t.stop()}},t,e)}))()}},filters:{handleTime:function(e,t){return 1===t?moment(1e3*e).format("YYYY-MM-DD"):2===t?moment(1e3*e).format("HH:mm:ss"):moment(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},u={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-custom"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"授权类型",prop:"type"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:e.changeType},model:{value:e.searchForm.type,callback:function(t){e.$set(e.searchForm,"type",t)},expression:"searchForm.type"}},e._l(e.statusOptions,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),1!==e.searchForm.type?a("el-form-item",{attrs:{label:"微信昵称",prop:"nickName"}},[a("el-input",{attrs:{placeholder:"请输入微信昵称"},model:{value:e.searchForm.nickName,callback:function(t){e.$set(e.searchForm,"nickName",t)},expression:"searchForm.nickName"}})],1):e._e(),e._v(" "),a("el-form-item",{attrs:{label:"加入时间",prop:"start_time"}},[a("el-date-picker",{attrs:{type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","picker-options":e.pickerOptions,"value-format":"timestamp"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.start_time,callback:function(t){e.$set(e.searchForm,"start_time",t)},expression:"searchForm.start_time"}})],1),e._v(" "),a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.blacklist,expression:"blacklist"}],attrs:{label:"黑名单",prop:"is_black"}},[a("el-switch",{attrs:{"active-value":1,"inactive-value":0},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.is_black,callback:function(t){e.$set(e.searchForm,"is_black",t)},expression:"searchForm.is_black"}})],1),e._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1)}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("searchForm")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1)],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{prop:"id",label:"ID",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{prop:"nickName",label:"微信昵称","min-width":"200"}}),e._v(" "),a("el-table-column",{attrs:{prop:"avatarUrl",label:"微信头像"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("lb-image",{attrs:{src:e.row.avatarUrl}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"phone",label:"手机号","min-width":"200"}}),e._v(" "),a("el-table-column",{attrs:{prop:"member_title",label:"会员等级","min-width":"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.member_level?t.row.member_title:"普通会员")+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"pay_cash",label:"","min-width":"120"},scopedSlots:e._u([{key:"header",fn:function(t){return[a("div",[e._v("\n 消费总金额"),a("lb-tool-tips",{attrs:{padding:"2"}},[e._v("包含土地、认养、养殖,配送邮费、商城的所有消费,不包含退款的")])],1)]}},{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.pay_cash)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"refund_cash",label:"退款金额","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.refund_cash)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"balance_cash",label:"充值总金额","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.balance_cash)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"balance",label:"当前余额","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.balance)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"total_integral",label:"总积分","min-width":"120"}}),e._v(" "),a("el-table-column",{attrs:{prop:"integral",label:"当前积分","min-width":"120"}}),e._v(" "),a("el-table-column",{attrs:{prop:"pay_integral",label:"已兑换积分","min-width":"120"}}),e._v(" "),a("el-table-column",{attrs:{prop:"create_time",label:"加入时间","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("p",[e._v(e._s(e._f("handleTime")(t.row.create_time,1)))]),e._v(" "),a("p",[e._v(e._s(e._f("handleTime")(t.row.create_time,2)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"240"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"table-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-editIntegral",expression:"`${$route.name}-editIntegral`"}],attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(a){return e.toShowDialog(t.row)}}},[e._v(e._s(e.$t("action.editIntegral")))]),e._v(" "),a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-removeInBlackList",expression:"`${$route.name}-removeInBlackList`"},{name:"show",rawName:"v-show",value:e.blacklist&&!t.row.is_black,expression:"blacklist && !scope.row.is_black"}],attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(a){return e.confirmRemoveBlackList(t.row)}}},[e._v(e._s(e.$t("action.removeInBlackList")))]),e._v(" "),a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-removeOutBlackList",expression:"`${$route.name}-removeOutBlackList`"},{name:"show",rawName:"v-show",value:e.blacklist&&t.row.is_black,expression:"blacklist && scope.row.is_black"}],attrs:{size:"mini",plain:"",type:"success"},on:{click:function(a){return e.confirmRemoveBlackList(t.row)}}},[e._v(e._s(e.$t("action.removeOutBlackList")))])],1)]}}])})],1),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}})],1),e._v(" "),a("el-dialog",{attrs:{title:"修改积分",visible:e.showDialog,width:"500px",center:""},on:{"update:visible":function(t){e.showDialog=t}}},[a("lb-tips",[a("div",[e._v("微信昵称:"+e._s(e.subForm.nickName))]),e._v(" "),a("div",{staticClass:"mt-sm mb-sm"},[e._v("手机号:"+e._s(e.subForm.phone||"-"))]),e._v(" "),a("div",[e._v("总积分:"+e._s(e.subForm.yu_integral))])]),e._v(" "),a("el-form",{ref:"subForm",staticClass:"dialog-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"操作类型",prop:"oper_type"}},[a("el-radio-group",{model:{value:e.subForm.oper_type,callback:function(t){e.$set(e.subForm,"oper_type",t)},expression:"subForm.oper_type"}},[a("el-radio",{attrs:{label:1}},[e._v("增加")]),e._v(" "),a("el-radio",{attrs:{label:2}},[e._v("减少")])],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"积分",prop:"integral"}},[a("el-input",{attrs:{placeholder:"请输入积分"},model:{value:e.subForm.integral,callback:function(t){e.$set(e.subForm,"integral",t)},expression:"subForm.integral"}})],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.showDialog=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v("确 定")])],1)],1)],1)},staticRenderFns:[]};var m=a("VU/8")(c,u,!1,function(e){a("KJWE")},"data-v-57de1ed0",null);t.default=m.exports}}); \ No newline at end of file diff --git a/public/static/js/53.js b/public/static/js/53.js new file mode 100644 index 0000000..883615c --- /dev/null +++ b/public/static/js/53.js @@ -0,0 +1 @@ +webpackJsonp([53],{ZBWn:function(e,t){},vy2F:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Xxa5"),n=a.n(r),i=a("exGp"),s=a.n(i),o=a("Zz1P"),l=a.n(o),c={data:function(){return{loading:!1,searchForm:{page:1,limit:10,type:3,title:""},tableData:[],total:0}},activated:function(){this.getTableDataList(1)},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return s()(n.a.mark(function a(){var r,i,s;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.media.welfareList(t.searchForm);case 4:if(r=a.sent,i=r.code,s=r.data,t.loading=!1,200===i){a.next=10;break}return a.abrupt("return");case 10:t.tableData=s.data,t.total=s.total;case 12:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return s()(n.a.mark(function r(){return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.media.welfareUpdate({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page0?1*s.text_id:"",t.subForm)t.subForm[i]=s[i];case 10:case"end":return r.stop()}},r,t)}))()},submitFormInfo:function(){var e=this,t=!0;if(this.$refs.subForm.validate(function(e){e||(t=!1)}),t){var r=JSON.parse(n()(this.subForm));r.img=r.img[0].url;var a=r.id?"bannerUpdate":"bannerAdd";this.$api.media[a](r).then(function(t){200===t.code&&(e.$message.success(e.$t(r.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}}}},d={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-system-banner-edit"},[r("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"130px"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("el-form-item",{attrs:{label:"图片",prop:"img"}},[r("lb-cover",{attrs:{fileList:e.subForm.img},on:{selectedFiles:e.getCover}}),e._v(" "),r("lb-tool-tips",[e._v("图片建议尺寸:680 * 285")])],1),e._v(" "),r("el-form-item",{attrs:{label:"关联内容",prop:"connect_type"}},[r("el-radio-group",{attrs:{disabled:e.subForm.id},on:{change:function(t){e.subForm.text_id=""}},model:{value:e.subForm.connect_type,callback:function(t){e.$set(e.subForm,"connect_type",t)},expression:"subForm.connect_type"}},[r("el-radio",{attrs:{label:1}},[e._v("农场")]),e._v(" "),r("el-radio",{attrs:{label:2}},[e._v("文章")]),e._v(" "),r("el-radio",{attrs:{label:4}},[e._v("店铺")])],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"",prop:"text_id"}},[r("el-select",{attrs:{filterable:"",placeholder:"请选择"+e.typeText[e.subForm.connect_type]},model:{value:e.subForm.text_id,callback:function(t){e.$set(e.subForm,"text_id",t)},expression:"subForm.text_id"}},e._l(1===e.subForm.connect_type?e.base_farmer:1===e.subForm.connect_type?e.base_article:e.base_store,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),r("el-form-item",{attrs:{label:"排序值",prop:"top"}},[r("el-input-number",{staticClass:"lb-input-number",attrs:{controls:!1,precision:0,min:0,placeholder:"请输入排序值"},model:{value:e.subForm.top,callback:function(t){e.$set(e.subForm,"top",t)},expression:"subForm.top"}}),e._v(" "),r("lb-tool-tips",[e._v("值越大, 排序越靠前")])],1),e._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),r("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)],1)],1)},staticRenderFns:[]};var v=r("VU/8")(p,d,!1,function(e){r("oWWK")},"data-v-55971867",null);t.default=v.exports},oWWK:function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/56.js b/public/static/js/56.js new file mode 100644 index 0000000..549dddf --- /dev/null +++ b/public/static/js/56.js @@ -0,0 +1 @@ +webpackJsonp([56],{DVJl:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Xxa5"),n=a.n(r),i=a("exGp"),s=a.n(i),o={data:function(){return{loading:!1,searchForm:{page:1,limit:10,goods_name:""},tableData:[],total:0}},activated:function(){var e=this.$route.query.id;this.searchForm.atv_id=e,this.getTableDataList()},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return s()(n.a.mark(function a(){var r,i,s;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.market.killGoodsList(t.searchForm);case 4:if(r=a.sent,i=r.code,s=r.data,t.loading=!1,200===i){a.next=10;break}return a.abrupt("return");case 10:t.tableData=s.data,t.total=s.total;case 12:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return s()(n.a.mark(function r(){return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.market.killGoodsDel({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page0?1*s.link:"",t.subForm)t.subForm[o]=s[o];case 9:case"end":return r.stop()}},r,t)}))()},submitFormInfo:function(){var e=this,t=!0;if(this.$refs.subForm.validate(function(e){e||(t=!1)}),t){var r=JSON.parse(i()(this.subForm)),a=r.id?"claimCateUpdate":"claimCateAdd";this.$api.claim[a](r).then(function(t){200===t.code&&(e.$message.success(e.$t(r.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}}}},c={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-system-banner-edit"},[r("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",staticClass:"dialog-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"100px"}},[r("el-form-item",{attrs:{label:"分类名称",prop:"title"}},[r("el-input",{attrs:{maxlength:"10","show-word-limit":"",placeholder:"请输入分类名称"},model:{value:e.subForm.title,callback:function(t){e.$set(e.subForm,"title",t)},expression:"subForm.title"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"所属农场",prop:"is_public"}},[r("el-radio-group",{attrs:{disabled:e.subForm.id},on:{change:function(t){e.subForm.farmer_id=[]}},model:{value:e.subForm.is_public,callback:function(t){e.$set(e.subForm,"is_public",t)},expression:"subForm.is_public"}},[r("el-radio",{attrs:{label:0}},[e._v("所属农场")]),e._v(" "),r("el-radio",{attrs:{label:1}},[e._v("全部农场")])],1)],1),e._v(" "),0===e.subForm.is_public?r("el-form-item",{attrs:{prop:"farmer_id"}},[r("el-select",{attrs:{multiple:"",filterable:"",clearable:"","collapse-tags":"",placeholder:"请选择所属农场"},model:{value:e.subForm.farmer_id,callback:function(t){e.$set(e.subForm,"farmer_id",t)},expression:"subForm.farmer_id"}},e._l(e.base_farmer,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"排序值",prop:"top"}},[r("el-input-number",{staticClass:"lb-input-number",attrs:{controls:!1,precision:0,min:0,placeholder:"请输入排序值"},model:{value:e.subForm.top,callback:function(t){e.$set(e.subForm,"top",t)},expression:"subForm.top"}}),e._v(" "),r("lb-tool-tips",[e._v("值越大, 排序越靠前")])],1),e._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),r("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)],1)],1)},staticRenderFns:[]};var m=r("VU/8")(u,c,!1,function(e){r("eL/Y")},"data-v-50c9f004",null);t.default=m.exports},"eL/Y":function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/58.js b/public/static/js/58.js new file mode 100644 index 0000000..d9737d5 --- /dev/null +++ b/public/static/js/58.js @@ -0,0 +1 @@ +webpackJsonp([58],{iwsh:function(e,t){},wKaq:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a("aFK5"),r=a.n(n),o=a("mvHQ"),l=a.n(o),i={data:function(){return{loading:!1,downloadLoading:!1,searchForm:{limit:10,page:1,name:""},total:0,tableData:[]}},activated:function(){this.getTableDataList()},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;e&&(this.searchForm.page=1),this.loading=!0;var a=this.searchForm;this.$api.distribution.userProfitList(a).then(function(e){console.log(e),t.loading=!1,200===e.code&&(t.total=e.data.total,t.tableData=e.data.data)})},toExport:function(){var e=this;this.downloadLoading=!0;var t=JSON.parse(l()(this.searchForm)),a=this.$util.getProCurrentHref(),n=a.indexOf("?")>0?"":"?",o=a.indexOf("?")>0;r()(t).forEach(function(e,a){n+=o?"&"+e+"="+t[e]:e+"="+t[e],o=!0});var i=sessionStorage.getItem("minitk"),s=a+"/farm/admin/AdminExcel/userProfitListExcel"+n+"&token="+i;window.location.href=s,setTimeout(function(){e.downloadLoading=!1},5e3)}}},s={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-dis-profit"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"输入查询",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入姓名/微信昵称"},model:{value:e.searchForm.name,callback:function(t){e.$set(e.searchForm,"name",t)},expression:"searchForm.name"}})],1),e._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1)}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("searchForm")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1)],1),e._v(" "),a("el-row",{staticClass:"page-top-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-export",expression:"`${$route.name}-export`"}],attrs:{size:"mini",plain:"",type:"primary",icon:"el-icon-download",loading:e.downloadLoading},on:{click:e.toExport}},[e._v(e._s(e.$t("action.export")))])],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"user_id",label:"用户ID",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{prop:"user_name",label:"姓名"}}),e._v(" "),a("el-table-column",{attrs:{prop:"nickName",label:"微信昵称"}}),e._v(" "),a("el-table-column",{attrs:{prop:"total_fx_cash",label:"总收益"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.total_fx_cash)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"total_wallte_cash",label:"总提现"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.total_wallte_cash)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"wallte_ing_cash",label:"提现中"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.wallte_ing_cash)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"unrecorded_fx_cash",label:"未入账"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.unrecorded_fx_cash)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"fx_cash",label:"当前余额"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.fx_cash)+"\n ")]}}])})],1),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}})],1)],1)},staticRenderFns:[]};var c=a("VU/8")(i,s,!1,function(e){a("iwsh")},"data-v-5087e6e6",null);t.default=c.exports}}); \ No newline at end of file diff --git a/public/static/js/59.js b/public/static/js/59.js new file mode 100644 index 0000000..fd05b86 --- /dev/null +++ b/public/static/js/59.js @@ -0,0 +1 @@ +webpackJsonp([59],{wdcP:function(e,t){},yED0:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=r("mvHQ"),o=r.n(s),n=r("Xxa5"),a=r.n(n),i=r("exGp"),u=r.n(i),c={data:function(){return{subForm:{short_id:"",short_secret:"",short_sign:"",short_code:""},subFormRules:{short_id:{required:!0,type:"string",message:"请输入阿里云ID",trigger:"blur"},short_secret:{required:!0,type:"string",message:"请输入阿里云密匙",trigger:"blur"},short_sign:{required:!0,type:"string",message:"请输入签名",trigger:"blur"},short_code:{required:!0,type:"string",message:"请输入短信模板CODE",trigger:"blur"}}}},created:function(){var e=this;return u()(a.a.mark(function t(){return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getDetail();case 2:case"end":return t.stop()}},t,e)}))()},methods:{getDetail:function(){var e=this;return u()(a.a.mark(function t(){var r,s,o,n;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$api.system.configInfo();case 2:if(r=t.sent,s=r.code,o=r.data,200===s){t.next=7;break}return t.abrupt("return");case 7:for(n in e.subForm)e.subForm[n]=o[n];case 8:case"end":return t.stop()}},t,e)}))()},submitFormInfo:function(e){var t=this;this.$refs[e].validate(function(e){if(e){var r=JSON.parse(o()(t.subForm));t.$api.system.configUpdate(r).then(function(e){200===e.code&&t.$message.success(t.$t("tips.successSub"))})}})}}},l={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-system-message"},[r("top-nav"),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"140px"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("el-form-item",{attrs:{label:"阿里云ID",prop:"short_id"}},[r("el-input",{attrs:{placeholder:"请输入阿里云ID"},model:{value:e.subForm.short_id,callback:function(t){e.$set(e.subForm,"short_id",t)},expression:"subForm.short_id"}}),e._v(" "),r("lb-tool-tips",[e._v("此处应填写自己的阿里云AccessKey ID, 登录自己的阿里云账号,\n 鼠标放到自己的头像处, 会展示出一个列表,\n 点击列表中的accesskeys就能查看到信息")])],1),e._v(" "),r("el-form-item",{attrs:{label:"阿里云密匙",prop:"short_secret"}},[r("el-input",{attrs:{placeholder:"请输入阿里云密匙"},model:{value:e.subForm.short_secret,callback:function(t){e.$set(e.subForm,"short_secret",t)},expression:"subForm.short_secret"}}),e._v(" "),r("lb-tool-tips",[e._v("此处应填写自己的阿里云Access Key Secret, 登录自己的阿里云账号,\n 鼠标放到自己的头像处, 会展示出一个列表,\n 点击列表中的accesskeys就能查看到信息")])],1),e._v(" "),r("el-form-item",{attrs:{label:"签名",prop:"short_sign"}},[r("el-input",{attrs:{placeholder:"请输入签名"},model:{value:e.subForm.short_sign,callback:function(t){e.$set(e.subForm,"short_sign",t)},expression:"subForm.short_sign"}}),e._v(" "),r("lb-tool-tips",[e._v("签名在阿里云短信签名管理处查看")])],1),e._v(" "),r("el-form-item",{attrs:{label:"短信模板CODE",prop:"short_code"}},[r("el-input",{attrs:{placeholder:"请输入短信模板CODE"},model:{value:e.subForm.short_code,callback:function(t){e.$set(e.subForm,"short_code",t)},expression:"subForm.short_code"}}),e._v(" "),r("lb-tool-tips",[e._v("短信模板CODE, 如: SMS_129755997,用于发送短信验证码")])],1),e._v(" "),r("el-form-item",[r("lb-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitFormInfo("subForm")}}},[e._v(e._s(e.$t("action.submit")))])],1)],1)],1)],1)},staticRenderFns:[]};var m=r("VU/8")(c,l,!1,function(e){r("wdcP")},"data-v-506b4212",null);t.default=m.exports}}); \ No newline at end of file diff --git a/public/static/js/6.js b/public/static/js/6.js new file mode 100644 index 0000000..3eabe98 --- /dev/null +++ b/public/static/js/6.js @@ -0,0 +1 @@ +webpackJsonp([6],{"3f3H":function(e,t){},Frmd:function(e,t){},IMDQ:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Zz1P"),n=a.n(r),i={data:function(){return{loading:!1,downloadLoading:!1,userOptions:[{label:"农场",value:1},{label:"店铺",value:2}],searchForm:{page:1,limit:10,store_name:"",type:1},pickerOptions:{disabledDate:function(e){return e.getTime()>Date.now()}},range:"",storeList:[],tableData:[],total:0}},created:function(){this.getTableDataList()},methods:{resetForm:function(e){this.range="",this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;e&&(this.searchForm.page=1),this.loading=!0;var a=this.searchForm,r=this.range;r&&r.length>0?(a.start_time=parseInt(r[0]/1e3),a.end_time=parseInt(r[1]/1e3)+86400-1):(a.start_time="",a.end_time=""),this.$api.finance.fincanceWaterList(a).then(function(e){t.loading=!1,200===e.code&&(t.tableData=e.data.data,t.total=e.data.total)})}},filters:{handleTime:function(e,t){return 1===t?n()(1e3*e).format("YYYY-MM-DD"):2===t?n()(1e3*e).format("HH:mm:ss"):n()(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},l={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-finance"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"类型",prop:"type"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.type,callback:function(t){e.$set(e.searchForm,"type",t)},expression:"searchForm.type"}},e._l(e.userOptions,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"名称",prop:"store_name"}},[a("el-input",{attrs:{placeholder:1===e.searchForm.type?"请输入农场名称":"请输入店铺名称"},model:{value:e.searchForm.store_name,callback:function(t){e.$set(e.searchForm,"store_name",t)},expression:"searchForm.store_name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"日期",prop:"start_time"}},[a("el-date-picker",{attrs:{type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"timestamp","picker-options":e.pickerOptions},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.range,callback:function(t){e.range=t},expression:"range"}})],1),e._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1)}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("searchForm")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1)],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"title",label:1===e.searchForm.type?"农场名称":"店铺名称"}}),e._v(" "),a("el-table-column",{attrs:{prop:"cash",label:""},scopedSlots:e._u([{key:"header",fn:function(t){return[a("div",[e._v("\n 可提余额(元)"),a("lb-tool-tips",{attrs:{padding:"2"}},[e._v("所有收入总金额,不含冻结金额,不含已经提现到账金额,不含配送已退款金额,实际可提金额")])],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"income_cash",label:""},scopedSlots:e._u([{key:"header",fn:function(t){return[a("div",[e._v("\n 订单收入(元)"),a("lb-tool-tips",{attrs:{padding:"2"}},[e._v("不含冻结金额,包含已经提现到账的金额,所有实际到账的金额")])],1)]}},{key:"default",fn:function(t){return[a("div",{staticClass:"flex-column"},[a("div",{staticClass:"c-success"},[e._v("+"+e._s(t.row.income_cash))]),e._v(" "),a("div",[e._v(e._s(t.row.income_count)+"笔")])])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"total_price",label:""},scopedSlots:e._u([{key:"header",fn:function(t){return[a("div",[e._v("\n 提现(元)"),a("lb-tool-tips",{attrs:{padding:"2"}},[e._v("实际提现到账成功")])],1)]}},{key:"default",fn:function(t){return[a("div",{staticClass:"flex-column"},[a("div",[e._v("-"+e._s(t.row.wallet_cash))]),e._v(" "),a("div",[e._v(e._s(t.row.wallet_count)+"笔")])])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"table-operate"},[a("lb-button",{attrs:{size:"mini",type:"primary",plain:""},on:{click:function(a){return e.$router.push("/finance/detail?id="+t.row.id+"&range="+e.range+"&type="+e.searchForm.type)}}},[e._v(e._s(e.$t("action.view")))])],1)]}}])})],1),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}})],1)],1)},staticRenderFns:[]};var s=a("VU/8")(i,l,!1,function(e){a("3f3H"),a("Frmd")},"data-v-7fc31314",null);t.default=s.exports}}); \ No newline at end of file diff --git a/public/static/js/60.js b/public/static/js/60.js new file mode 100644 index 0000000..b43fd7b --- /dev/null +++ b/public/static/js/60.js @@ -0,0 +1 @@ +webpackJsonp([60],{Q076:function(e,t){},fqtf:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("//Fk"),n=a.n(r),i=a("d7EF"),s=a.n(i),o=a("Xxa5"),l=a.n(o),c=a("exGp"),u=a.n(c),m={data:function(){return{loading:!1,base_farmer:[],searchForm:{page:1,limit:10,status:1,farmer_id:0,title:""},tableData:[],total:0,count:{}}},activated:function(){var e=this;return u()(l.a.mark(function t(){return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getBaseInfo();case 2:e.getTableDataList(1);case 3:case"end":return t.stop()}},t,e)}))()},methods:{getBaseInfo:function(){var e=this;return u()(l.a.mark(function t(){var a,r,i;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.a.all([e.$api.farmer.farmerSelectList()]);case 2:a=t.sent,r=s()(a,1),(i=r[0]).data.unshift({id:0,title:"全部"}),e.base_farmer=i.data;case 7:case"end":return t.stop()}},t,e)}))()},resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},toChange:function(e){var t=this;return u()(l.a.mark(function a(){return l.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:t.searchForm.status=e,t.getTableDataList(1);case 2:case"end":return a.stop()}},a,t)}))()},getTableDataList:function(e){var t=this;return u()(l.a.mark(function a(){var r,n,i,s,o,c,u;return l.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.claim.claimList(t.searchForm);case 4:if(r=a.sent,n=r.code,i=r.data,t.loading=!1,200===n){a.next=10;break}return a.abrupt("return");case 10:s=i.on_num,o=i.off_num,c=i.data,u=i.total,t.tableData=c,t.total=u,t.count={on:s,off:o};case 14:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return u()(l.a.mark(function r(){return l.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.claim.claimStatusUpdate({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page1&&void 0!==arguments[1]?arguments[1]:{};return s()(n.a.mark(function r(){var i,l;return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(i={data:{id:0,top:"",title:"",icon:[],type:1,coupon_id:"",integral:"",num:"",balance:""}},a=a.id||"data"!==t?a:i[t],a=JSON.parse(o()(a)),"data"!==t){r.next=8;break}for(l in a.icon=a.icon&&a.icon.length>0?[{url:a.icon}]:[],e[t+"Form"])e[t+"Form"][l]=a[l];r.next=11;break;case 8:return e.currentRow={},r.next=11,e.getTableDataList(1);case 11:e.showDialog[t]=!e.showDialog[t];case 12:case"end":return r.stop()}},r,e)}))()},handleCurrentRow:function(t){this.currentRow=t},handleDialogConfirm:function(){var t=this.currentRow,e=t.id,a=void 0===e?0:e,r=t.title;a?(this.dataForm.coupon_id=a,this.dataForm.coupon_title=r,this.showDialog.coupon=!1):this.$message.error("请选择卡券")},toDelItem:function(t,e){this.subForm[t].splice(e,1)},getCover:function(t,e,a){this[e][a]=t},toSetDefault:function(){this.subForm.cover=[{url:this.default_img}]},submitFormInfo:function(t){var e=this,a=!0;if(this.$refs[t+"Form"].validate(function(t){t||(a=!1)}),a){var r=JSON.parse(o()(this[t+"Form"]));if("data"===t){var i=JSON.parse(o()(this.subForm)),n=i[t].map(function(t){return t.top}),l=i[t].findIndex(function(t){return t.top===r.top}),s=0,u=r.id,m=void 0===u?0:u;if(r.icon=r.icon[0].url,n.includes(r.top)&&m!==i[t][l].id)return void this.$message.error("抽奖设置中已有第"+r.top+"宫格");i[t].map(function(t){(!m||m&&t.id!==m)&&(s+=1*t.balance)});var d=s+1*r.balance;if(d>100)return void this.$message.error("抽奖设置中所有中奖概率相加不能大于100,现已"+d);if(m){var p=i[t].findIndex(function(t){return t.id===m});i[t][p]=r}else r.id=c()(),i[t].push(r);return this.subForm=i,void(this.showDialog[t]=!1)}var b=r.start_time,v=void 0===b?[]:b;r.start_time=v[0]/1e3,r.end_time=v[1]/1e3,r.data.map(function(t){o()(t.id).includes("-")&&delete t.id,delete t.coupon_title}),r.cover=r.cover[0].url,this.atv_status>1&&delete r.data;var f=r.id?"luckUpdate":"luckAdd";this.$api.market[f](r).then(function(t){200===t.code&&(e.$message.success(e.$t(r.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}}},watch:{"subForm.data":function(t,e){var a=0;t.map(function(t){a+=1*t.balance}),this.isDisabled=a>=100||this.atv_status>1}},filters:{handleTime:function(t,e){return 1===e?moment(1e3*t).format("YYYY-MM-DD"):2===e?moment(1e3*t).format("HH:mm:ss"):moment(1e3*t).format("YYYY-MM-DD HH:mm:ss")}}},d={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"lb-market-luck-edit"},[a("top-nav",{attrs:{title:t.navTitle,isBack:!0}}),t._v(" "),a("div",{staticClass:"page-main"},[a("el-form",{ref:"subForm",attrs:{model:t.subForm,rules:t.subFormRules,"label-width":"140px"},nativeOn:{submit:function(t){t.preventDefault()}}},[a("el-form-item",{attrs:{label:"活动名称",prop:"title"}},[a("el-input",{attrs:{maxlength:"20","show-word-limit":"",placeholder:"请输入活动名称"},model:{value:t.subForm.title,callback:function(e){t.$set(t.subForm,"title",e)},expression:"subForm.title"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"活动时间",prop:"start_time"}},[a("el-date-picker",{attrs:{type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","picker-options":t.pickerOptions,"value-format":"timestamp",disabled:t.atv_status>1},model:{value:t.subForm.start_time,callback:function(e){t.$set(t.subForm,"start_time",e)},expression:"subForm.start_time"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"当日可抽奖次数",prop:"day_times"}},[a("el-input-number",{staticClass:"lb-input-number",staticStyle:{width:"300px"},attrs:{controls:!1,precision:0,min:1,placeholder:"请输入可抽奖次数"},model:{value:t.subForm.day_times,callback:function(e){t.$set(t.subForm,"day_times",e)},expression:"subForm.day_times"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"每次抽奖消耗积分",prop:"integral"}},[a("el-input-number",{staticClass:"lb-input-number",staticStyle:{width:"300px"},attrs:{controls:!1,precision:0,min:1,placeholder:"请输入消耗积分"},model:{value:t.subForm.integral,callback:function(e){t.$set(t.subForm,"integral",e)},expression:"subForm.integral"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"抽奖设置",prop:"data"}},[a("el-button",{attrs:{disabled:t.isDisabled,type:"primary",plain:"",icon:"el-icon-plus"},on:{click:function(e){return t.toShowDialog("data")}}},[t._v(t._s(t.$t("menu.MarketLuckSetAdd")))]),t._v(" "),a("el-table",{staticClass:"mt-lg",staticStyle:{width:"100%"},attrs:{data:t.subForm.data,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"top",label:"宫格序号"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s("第"+e.row.top+"宫格")+"\n ")]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"icon",label:"奖品图标"},scopedSlots:t._u([{key:"default",fn:function(t){return[a("lb-image",{attrs:{src:t.row.icon}})]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"title",label:"奖品名称","min-width":"200"}}),t._v(" "),a("el-table-column",{attrs:{prop:"type",label:"奖品类型","min-width":"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-tag",{attrs:{type:1===e.row.type?"primary":"danger"}},[t._v(t._s(t.typeText[e.row.type]))]),t._v(" "),a("div",{staticClass:"mt-sm"},[t._v("\n "+t._s(1===e.row.type?e.row.coupon_title+"(1张)":e.row.integral+"积分")+"\n ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"num",label:"奖品数量"}}),t._v(" "),a("el-table-column",{attrs:{prop:"balance",label:"概率"}}),t._v(" "),1===t.atv_status?a("el-table-column",{attrs:{prop:"",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"table-operate"},[a("lb-button",{attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(a){return t.toShowDialog("data",e.row)}}},[t._v(t._s(t.$t("action.edit")))]),t._v(" "),a("lb-button",{attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(a){return t.toDelItem("data",e.$index)}}},[t._v(t._s(t.$t("action.delete")))])],1)]}}],null,!1,2188647325)}):t._e()],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"抽奖背景图",prop:"cover"}},[a("div",[a("lb-cover",{attrs:{fileList:t.subForm.cover},on:{selectedFiles:function(e){return t.getCover(e,"subForm","cover")}}}),t._v(" "),a("lb-tool-tips",[t._v("图片建议尺寸: 750 * 1912")])],1),t._v(" "),a("lb-button",{attrs:{type:"danger"},on:{click:t.toSetDefault}},[t._v("恢复默认设置\n ")])],1),t._v(" "),a("el-form-item",{attrs:{label:"规则说明",prop:"text"}},[a("el-input",{attrs:{type:"textarea",rows:10,maxlength:"1000",resize:"none","show-word-limit":"",placeholder:"请输入规则说明"},model:{value:t.subForm.text,callback:function(e){t.$set(t.subForm,"text",e)},expression:"subForm.text"}})],1),t._v(" "),a("el-form-item",[a("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(e){return t.submitFormInfo("sub")}}},[t._v(t._s(t.$t("action.submit")))]),t._v(" "),a("lb-button",{on:{click:function(e){return t.$router.back(-1)}}},[t._v(t._s(t.$t("action.back")))])],1)],1)],1),t._v(" "),a("el-dialog",{attrs:{title:t.$t(t.dataForm.id?"menu.MarketLuckSetEdit":"menu.MarketLuckSetAdd"),visible:t.showDialog.data,width:"550px",center:""},on:{"update:visible":function(e){return t.$set(t.showDialog,"data",e)}}},[a("el-form",{ref:"dataForm",staticClass:"dialog-form",attrs:{model:t.dataForm,rules:t.dataFormRules,"label-width":"130px"}},[a("el-form-item",{attrs:{label:"宫格序号",prop:"top"}},[a("el-select",{attrs:{filterable:"","collapse-tags":"",placeholder:"请选择宫格序号"},model:{value:t.dataForm.top,callback:function(e){t.$set(t.dataForm,"top",e)},expression:"dataForm.top"}},t._l(t.base_top,function(t){return a("el-option",{key:t.id,attrs:{label:t.title,value:t.id}})}),1)],1),t._v(" "),a("el-form-item",{attrs:{label:"奖品名称",prop:"title"}},[a("el-input",{attrs:{placeholder:"请输入奖品名称",maxlength:"6","show-word-limit":""},model:{value:t.dataForm.title,callback:function(e){t.$set(t.dataForm,"title",e)},expression:"dataForm.title"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"奖品图片",prop:"icon"}},[a("lb-cover",{attrs:{fileList:t.dataForm.icon},on:{selectedFiles:function(e){return t.getCover(e,"dataForm","icon")}}}),t._v(" "),a("lb-tool-tips",[t._v("图片建议尺寸:56 * 52")])],1),t._v(" "),a("el-form-item",{attrs:{label:"奖品类型",prop:"type"}},[a("el-radio-group",{model:{value:t.dataForm.type,callback:function(e){t.$set(t.dataForm,"type",e)},expression:"dataForm.type"}},[a("el-radio",{attrs:{label:1}},[t._v("卡券")]),t._v(" "),a("el-radio",{attrs:{label:2}},[t._v("积分")])],1),t._v(" "),1===t.dataForm.type?a("div",[a("el-tag",{staticClass:"cursor-pointer",on:{click:function(e){return t.toShowDialog("coupon")}}},[t._v(t._s(t.dataForm.coupon_title||"请选择卡券"))])],1):t._e(),t._v(" "),2===t.dataForm.type?a("el-input",{attrs:{placeholder:"请输入积分"},model:{value:t.dataForm.integral,callback:function(e){t.$set(t.dataForm,"integral",e)},expression:"dataForm.integral"}}):t._e()],1),t._v(" "),a("el-form-item",{attrs:{label:"奖品数量",prop:"num"}},[a("el-input",{attrs:{placeholder:"请输入奖品数量"},model:{value:t.dataForm.num,callback:function(e){t.$set(t.dataForm,"num",e)},expression:"dataForm.num"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"中奖概率",prop:"balance"}},[a("el-input",{attrs:{placeholder:"请输入中奖概率"},model:{value:t.dataForm.balance,callback:function(e){t.$set(t.dataForm,"balance",e)},expression:"dataForm.balance"}})],1)],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.showDialog.data=!1}}},[t._v("取 消")]),t._v(" "),a("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(e){return t.submitFormInfo("data")}}},[t._v("确 定")])],1)],1),t._v(" "),a("el-dialog",{attrs:{title:"选择卡券",visible:t.showDialog.coupon,width:"800px",center:""},on:{"update:visible":function(e){return t.$set(t.showDialog,"coupon",e)}}},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:t.searchForm},nativeOn:{submit:function(t){t.preventDefault()}}},[a("el-form-item",{attrs:{label:"输入查询",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入卡券名称"},model:{value:t.searchForm.name,callback:function(e){t.$set(t.searchForm,"name",e)},expression:"searchForm.name"}})],1),t._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(e){return t.getTableDataList(1)}}},[t._v(t._s(t.$t("action.search")))]),t._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(e){return t.resetForm("searchForm")}}},[t._v(t._s(t.$t("action.reset")))])],1)],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"singleTable",staticStyle:{width:"100%"},attrs:{data:t.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"},"tooltip-effect":"dark","highlight-current-row":""},on:{"current-change":t.handleCurrentRow}},[a("el-table-column",{attrs:{prop:"id",label:"ID",fixed:""}}),t._v(" "),a("el-table-column",{attrs:{prop:"title",label:"卡券名称","min-width":"120"}}),t._v(" "),a("el-table-column",{attrs:{prop:"type",label:"使用条件","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[t._v("\n "+t._s(0===e.row.type?"消费满¥"+e.row.full+"减¥"+e.row.discount:"立减¥"+e.row.discount)+"\n ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"create_time",label:"创建时间","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[t._v(t._s(t._f("handleTime")(e.row.create_time,1)))]),t._v(" "),a("p",[t._v(t._s(t._f("handleTime")(e.row.create_time,2)))])]}}])})],1),t._v(" "),a("lb-page",{attrs:{batch:!1,page:t.searchForm.page,pageSize:t.searchForm.limit,total:t.total},on:{handleSizeChange:t.handleSizeChange,handleCurrentChange:t.handleCurrentChange}}),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.showDialog.coupon=!1}}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:t.handleDialogConfirm}},[t._v("确 定")])],1)],1)],1)},staticRenderFns:[]};var p=a("VU/8")(m,d,!1,function(t){a("UPsS")},"data-v-415e23ac",null);e.default=p.exports},UPsS:function(t,e){}}); \ No newline at end of file diff --git a/public/static/js/66.js b/public/static/js/66.js new file mode 100644 index 0000000..50bc573 --- /dev/null +++ b/public/static/js/66.js @@ -0,0 +1 @@ +webpackJsonp([66],{MAPy:function(e,t){},xw3J:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r("mvHQ"),s=r.n(i),o=r("Xxa5"),l=r.n(o),a=r("exGp"),n=r.n(a),c=r("DlMc"),u=r.n(c),m={data:function(){return{id:"",navTitle:"",subForm:{id:0,title:"",desc:"",price:"",service:[],top:0},subFormRules:{title:{required:!0,validator:this.$reg.isNoEmpty,text:"地块服务名称",reg_type:2,trigger:"blur"},desc:{required:!0,validator:this.$reg.isNoEmpty,text:"服务简介",reg_type:2,trigger:"blur"},price:{required:!0,validator:this.$reg.isMoney,text:"服务价格",reg_type:2,trigger:"blur"},service:{required:!0,type:"array",message:"请添加服务类型",trigger:"blur"},top:{required:!0,type:"number",message:"请输入排序值",trigger:"blur"}},showDialog:{service:!1},serviceForm:{id:0,cover:[],title:"",sub_title:""},serviceFormRules:{cover:{required:!0,type:"array",message:"请上传图片",trigger:["blur","change"]},title:{required:!0,validator:this.$reg.isNoEmpty,text:"类型名称",reg_type:2,trigger:"blur"},sub_title:{required:!0,validator:this.$reg.isNoEmpty,text:"类型描述",reg_type:2,trigger:"blur"}}}},created:function(){var e=this;return n()(l.a.mark(function t(){var r;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(r=e.$route.query.id)&&(e.subForm.id=r,e.getDetail(r)),e.navTitle=e.$t(r?"menu.LandMassifEdit":"menu.LandMassifAdd");case 3:case"end":return t.stop()}},t,e)}))()},methods:{getDetail:function(e){var t=this;return n()(l.a.mark(function r(){var i,s,o,a;return l.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.$api.land.massifInfo({id:e});case 2:if(i=r.sent,s=i.code,o=i.data,200===s){r.next=7;break}return r.abrupt("return");case 7:for(a in t.subForm)t.subForm[a]=o[a];case 8:case"end":return r.stop()}},r,t)}))()},toShowDialog:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var r in t=t.id?t:{service:{id:0,cover:[],title:"",sub_title:""}}[e],(t=JSON.parse(s()(t))).cover=t.cover&&t.cover.length>0?[{url:t.cover}]:[],this[e+"Form"])this[e+"Form"][r]=t[r];this.showDialog[e]=!this.showDialog[e]},toDelItem:function(e,t){this.subForm[e].splice(t,1)},getCover:function(e){this.serviceForm.cover=e},submitFormInfo:function(e){var t=this,r=!0;if(this.$refs[e+"Form"].validate(function(e){e||(r=!1)}),r){var i=JSON.parse(s()(this[e+"Form"]));if("service"===e){var o=JSON.parse(s()(this.subForm)),l=i.id,a=void 0===l?0:l;if(i.cover=i.cover[0].url,a){var n=o[e].findIndex(function(e){return e.id===a});o[e][n]=i}else i.id=u()(),o[e].push(i);return this.subForm=o,void(this.showDialog[e]=!1)}var c=i.id?"massifUpdate":"massifAdd";i.service.map(function(e){s()(e.id).includes("-")&&delete e.id}),this.$api.land[c](i).then(function(e){200===e.code&&(t.$message.success(t.$t(i.id?"tips.successRev":"tips.successSub")),t.$router.back(-1))})}}}},v={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-land-massif-edit"},[r("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",staticClass:"dialog-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"130px"}},[r("el-form-item",{attrs:{label:"地块服务名称",prop:"title"}},[r("el-input",{attrs:{placeholder:"请输入地块服务名称",maxlength:"10","show-word-limit":""},model:{value:e.subForm.title,callback:function(t){e.$set(e.subForm,"title",t)},expression:"subForm.title"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"服务价格",prop:"price"}},[r("el-input",{attrs:{placeholder:"请输入服务价格"},model:{value:e.subForm.price,callback:function(t){e.$set(e.subForm,"price",t)},expression:"subForm.price"}},[r("template",{slot:"append"},[e._v("元/天")])],2)],1),e._v(" "),r("el-form-item",{attrs:{label:"服务简介",prop:"desc"}},[r("el-input",{attrs:{placeholder:"请输入服务简介",maxlength:"15","show-word-limit":""},model:{value:e.subForm.desc,callback:function(t){e.$set(e.subForm,"desc",t)},expression:"subForm.desc"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"服务类型",prop:"service"}},[r("lb-button",{attrs:{type:"primary",plain:"",icon:"el-icon-plus"},on:{click:function(t){return e.toShowDialog("service")}}},[e._v(e._s(e.$t("menu.LandServiceAdd")))]),e._v(" "),r("el-table",{staticClass:"mt-lg",staticStyle:{width:"800px"},attrs:{data:e.subForm.service,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[r("el-table-column",{attrs:{prop:"cover",label:"图片"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("lb-image",{attrs:{src:e.row.cover}})]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"title",label:"类型名称"}}),e._v(" "),r("el-table-column",{attrs:{prop:"sub_title",label:"类型描述"}}),e._v(" "),r("el-table-column",{attrs:{label:"操作","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("div",{staticClass:"table-operate"},[r("lb-button",{attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(r){return e.toShowDialog("service",t.row)}}},[e._v(e._s(e.$t("action.edit")))]),e._v(" "),r("lb-button",{attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(r){return e.toDelItem("service",t.$index)}}},[e._v(e._s(e.$t("action.delete")))])],1)]}}])})],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"排序值",prop:"top"}},[r("el-input-number",{staticClass:"lb-input-number",attrs:{controls:!1,precision:0,min:0,placeholder:"请输入排序值"},model:{value:e.subForm.top,callback:function(t){e.$set(e.subForm,"top",t)},expression:"subForm.top"}}),e._v(" "),r("lb-tool-tips",[e._v("值越大, 排序越靠前")])],1),e._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(t){return e.submitFormInfo("sub")}}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),r("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)],1),e._v(" "),r("el-dialog",{attrs:{title:e.$t(e.serviceForm.id?"menu.LandServiceEdit":"menu.LandServiceAdd"),visible:e.showDialog.service,width:"550px",center:""},on:{"update:visible":function(t){return e.$set(e.showDialog,"service",t)}}},[r("el-form",{ref:"serviceForm",staticClass:"dialog-form",attrs:{model:e.serviceForm,rules:e.serviceFormRules,"label-width":"130px"}},[r("el-form-item",{attrs:{label:"图片",prop:"cover"}},[r("lb-cover",{attrs:{fileList:e.serviceForm.cover},on:{selectedFiles:e.getCover}}),e._v(" "),r("lb-tool-tips",[e._v("图片建议尺寸:200 * 200")])],1),e._v(" "),r("el-form-item",{attrs:{label:"类型名称",prop:"title"}},[r("el-input",{attrs:{placeholder:"请输入类型名称",maxlength:"20","show-word-limit":""},model:{value:e.serviceForm.title,callback:function(t){e.$set(e.serviceForm,"title",t)},expression:"serviceForm.title"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"类型描述",prop:"sub_title"}},[r("el-input",{attrs:{placeholder:"请输入类型描述",maxlength:"20","show-word-limit":""},model:{value:e.serviceForm.sub_title,callback:function(t){e.$set(e.serviceForm,"sub_title",t)},expression:"serviceForm.sub_title"}})],1)],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.showDialog.service=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(t){return e.submitFormInfo("service")}}},[e._v("确 定")])],1)],1)],1)},staticRenderFns:[]};var d=r("VU/8")(m,v,!1,function(e){r("MAPy")},"data-v-4061e3fe",null);t.default=d.exports}}); \ No newline at end of file diff --git a/public/static/js/67.js b/public/static/js/67.js new file mode 100644 index 0000000..f08bc7e --- /dev/null +++ b/public/static/js/67.js @@ -0,0 +1 @@ +webpackJsonp([67],{p5gD:function(e,t){},sIiw:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Dd8w"),n=a.n(r),i=a("Xxa5"),o=a.n(i),s=a("mvHQ"),l=a.n(s),c=a("exGp"),u=a.n(c),d=a("UzK0"),h=a("SJI6"),m=a("Zz1P"),p=a.n(m),f={data:function(){var e=this;return{loading:!1,searchForm:{page:1,limit:10,title:"",type:0},tableData:[],total:0,checkTreeAll:!1,authPermiList:[],ops:{vuescroll:{wheelScrollDuration:600},scrollPanel:{initialScrollY:!1,initialScrollX:!1,scrollingX:!1,scrollingY:!0,speed:2e3,easing:"easeInOutQuart",verticalNativeBarPos:"right"},rail:{},bar:{showDelay:500,onlyShowBarOnScroll:!1,keepShow:!1,background:"#c1c1c1",opacity:.5,hoverStyle:!1,specifyBorderRadius:!1,minSize:!1,size:"6px",disable:!1}},defaultProps:{children:"children",label:"title"},currentNodeKey:[],showDialog:!1,dialogType:1,subForm:{id:0,title:"",node:[]},subFormRules:{title:{required:!0,validator:d.a.isNoEmpty,text:"角色名称",reg_type:2,trigger:"blur"},role:{required:!0,validator:function(t,a,r){0===e.toReturnPermi().length?r(new Error("请选择权限")):r()},trigger:"change"}}}},activated:function(){var e=this;return u()(o.a.mark(function t(){var a,r;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e.getTableDataList(1),a=JSON.parse(l()(e.allRoutes)),r=[],a.map(function(t,a){var n=1*a+1,i=[];t.hidden||"/account"===t.path||(t.children.map(function(t,a){var r=1*a+1;if(!t.hidden){var o=[];t.meta.pagePermission[0].auth.map(function(t,a){var i=1*a+1;o.push({id:n+"-"+r+"-"+i,name:t,title:e.$t("action."+t),selected:!1})}),i.push({id:n+"-"+r,name:t.name,title:e.$t("menu."+t.name),children:o,selected:!1})}}),r.push({id:""+n,name:t.meta.menuName,title:e.$t("menu."+t.meta.menuName),children:i,selected:!1}))}),e.authPermiList=r;case 5:case"end":return t.stop()}},t,e)}))()},computed:n()({},Object(h.mapState)({allRoutes:function(e){return e.routes.allRoutes}})),methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return u()(o.a.mark(function a(){var r,n,i;return o.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.account.roleList(t.searchForm);case 4:if(r=a.sent,n=r.code,i=r.data,t.loading=!1,200===n){a.next=10;break}return a.abrupt("return");case 10:t.tableData=i.data,t.total=i.total;case 12:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return u()(o.a.mark(function r(){return o.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.account.roleUpdate({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page0&&void 0!==arguments[0]?arguments[0]:{};return u()(o.a.mark(function a(){var r,n,i,s,c,u,d,h,m;return o.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:for(r in e.subForm)e.subForm[r]=t[r];if(n=t.id,i=void 0===n?0:n,e.showDialog=!e.showDialog,i){a.next=7;break}return e.currentNodeKey=[],e.$refs.tree.setCheckedKeys([]),a.abrupt("return");case 7:return a.next=9,e.$api.account.roleInfo({id:i});case 9:s=a.sent,c=s.data,u=c.node,d=u.map(function(e){return e.node}),h=JSON.parse(l()(e.authPermiList)),m=[],h.map(function(e){e.children.map(function(e){if(d.includes(e.name)){var t=u.findIndex(function(t){return t.node===e.name}),a=u[t].auth;0===e.children.length&&m.push(e),e.children.map(function(e){a.includes(e.name)&&m.push(e)})}})}),e.$refs.tree.setCheckedNodes(m);case 17:case"end":return a.stop()}},a,e)}))()},handleClickTreeNode:function(e){e.selected=!e.selected},currentChecked:function(e,t){var a=this,r=t.checkedKeys;t.halfCheckedNodes.map(function(e){a.handleNodeChildren(e,r)}),this.currentNodeKey=r},handleNodeChildren:function(e,t){var a=this;if(e.children.map(function(e){return e.name}).includes("pagedata")){var r=e.children.filter(function(e){return e.selected});e.children.map(function(e){"pagedata"===e.name&&r.length>0&&!t.includes(e.id)&&t.push(e.id)})}else e.children.map(function(e){a.handleNodeChildren(e,t)})},handleCheckTreeAllChange:function(){var e=this.checkTreeAll,t=this.authPermiList.map(function(e,t){return e.id}),a=e?t:[];this.$refs.tree.setCheckedKeys(a)},toReturnPermi:function(){var e=[];return JSON.parse(l()(this.authPermiList)).map(function(t){(0!==t.children.length||t.selected)&&t.children.map(function(t){if(0!==t.children.length||t.selected){var a=[];t.children.map(function(e){e.selected&&a.push(e.name)}),t.children.length>0&&0===a.length||e.push({node:t.name,auth:a})}})}),e},submitFormInfo:function(){var e=this;return u()(o.a.mark(function t(){var a,r,n,i;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=!0,e.$refs.subForm.validate(function(e){e||(a=!1)}),!a){t.next=15;break}return r=e.subForm.id?"roleUpdate":"roleAdd",(n=JSON.parse(l()(e.subForm))).node=e.toReturnPermi(),t.next=8,e.$api.account[r](n);case 8:if(i=t.sent,200===i.code){t.next=12;break}return t.abrupt("return");case 12:e.$message.success(e.$t(n.id?"tips.successRev":"tips.successSub")),e.showDialog=!1,e.getTableDataList();case 15:case"end":return t.stop()}},t,e)}))()}},filters:{handleTime:function(e,t){return 1===t?p()(1e3*e).format("YYYY-MM-DD"):2===t?p()(1e3*e).format("HH:mm:ss"):p()(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},v={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-system-news"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-add",expression:"`${$route.name}-add`"}],attrs:{type:"primary",icon:"el-icon-plus"},on:{click:e.toShowDialog}},[e._v(e._s(e.$t("menu.AccountRoleAdd")))]),e._v(" "),a("div",{staticClass:"space-lg"}),e._v(" "),a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"角色名称",prop:"title"}},[a("el-input",{attrs:{placeholder:"请输入角色名称"},model:{value:e.searchForm.title,callback:function(t){e.$set(e.searchForm,"title",t)},expression:"searchForm.title"}})],1),e._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1)}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("searchForm")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1)],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"id",label:"ID"}}),e._v(" "),a("el-table-column",{attrs:{prop:"title",label:"角色名称"}}),e._v(" "),a("el-table-column",{attrs:{prop:"create_time",label:"创建时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("p",[e._v(e._s(e._f("handleTime")(t.row.create_time,1)))]),e._v(" "),a("p",[e._v(e._s(e._f("handleTime")(t.row.create_time,2)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{"min-width":"120",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"table-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-edit",expression:"`${$route.name}-edit`"}],attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(a){return e.toShowDialog(t.row)}}},[e._v(e._s(e.$t("action.edit")))]),e._v(" "),a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-delete",expression:"`${$route.name}-delete`"}],attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(a){return e.confirmDel(t.row.id)}}},[e._v(e._s(e.$t("action.delete")))])],1)]}}])})],1),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}}),e._v(" "),a("el-dialog",{attrs:{title:e.$t(e.subForm.id?"menu.AccountRoleEdit":"menu.AccountRoleAdd"),visible:e.showDialog,width:"500px",center:""},on:{"update:visible":function(t){e.showDialog=t}}},[a("el-form",{ref:"subForm",staticClass:"dialog-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"角色名称",prop:"title"}},[a("el-input",{attrs:{placeholder:"请输入角色名称",maxlength:"20","show-word-limit":""},model:{value:e.subForm.title,callback:function(t){e.$set(e.subForm,"title",t)},expression:"subForm.title"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"选择权限",prop:"role"}},[a("el-checkbox",{on:{change:e.handleCheckTreeAllChange},model:{value:e.checkTreeAll,callback:function(t){e.checkTreeAll=t},expression:"checkTreeAll"}},[e._v("全选")]),e._v(" "),a("div",{staticClass:"data-box"},[a("vue-scroll",{attrs:{ops:e.ops}},[a("el-tree",{ref:"tree",attrs:{data:e.authPermiList,"show-checkbox":"","default-expand-all":"","node-key":"id","highlight-current":"",props:e.defaultProps,"default-checked-keys":e.currentNodeKey},on:{"check-change":e.handleClickTreeNode,check:e.currentChecked}})],1)],1)],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.showDialog=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v("确 定")])],1)],1)],1)],1)},staticRenderFns:[]};var g=a("VU/8")(f,v,!1,function(e){a("p5gD")},"data-v-3f6253ea",null);t.default=g.exports}}); \ No newline at end of file diff --git a/public/static/js/68.js b/public/static/js/68.js new file mode 100644 index 0000000..fdf08e4 --- /dev/null +++ b/public/static/js/68.js @@ -0,0 +1 @@ +webpackJsonp([68],{F76B:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=a("Xxa5"),n=a.n(r),s=a("exGp"),i=a.n(s),o={data:function(){return{statusOptions:[{label:"全部",value:0},{label:"未开始",value:1},{label:"进行中",value:2},{label:"已过期",value:3}],statusType:{1:"未开始",2:"进行中",3:"已过期"},loading:!1,searchForm:{page:1,limit:10,goods_name:"",atv_status:0},tableData:[],total:0,showDialog:!1,dialogForm:{}}},activated:function(){this.getTableDataList()},methods:{resetForm:function(t){this.$refs[t].resetFields(),this.getTableDataList(1)},handleSizeChange:function(t){this.searchForm.limit=t,this.handleCurrentChange(1)},handleCurrentChange:function(t){this.searchForm.page=t,this.getTableDataList()},getTableDataList:function(t){var e=this;return i()(n.a.mark(function a(){var r,s,i;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return t&&(e.searchForm.page=1),e.loading=!0,a.next=4,e.$api.market.integralList(e.searchForm);case 4:if(r=a.sent,s=r.code,i=r.data,e.loading=!1,200===s){a.next=10;break}return a.abrupt("return");case 10:i.data.map(function(t){t.total_stock=t.all_stock-t.all_have_stock}),e.tableData=i.data,e.total=i.total;case 13:case"end":return a.stop()}},a,e)}))()},confirmDel:function(t){var e=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){e.updateItem(t,-1)}).catch(function(){})},updateItem:function(t,e){var a=this;return i()(n.a.mark(function r(){return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.market.integralUpdate({id:t,status:e}).then(function(t){if(200===t.code)a.$message.success(a.$t(-1===e?"tips.successDel":"tips.successOper")),-1===e&&(a.searchForm.page=a.searchForm.pageDate.now()}},statusOptions:[{label:"全部",value:0},{label:"待支付",value:1},{label:"认养中",value:2},{label:"配送中",value:3},{label:"已完成",value:7}],statusType:{"-1":"已取消",1:"待支付",2:"认养中",3:"配送中",7:"已完成"},payType:{1:"微信支付",2:"余额支付",3:"支付宝支付"},sendType:{1:"自提",2:"快递"},tableData:[],printTableData:[],total:0}},activated:function(){var e=this;return m()(l.a.mark(function t(){return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getBaseInfo();case 2:e.getTableDataList();case 3:case"end":return t.stop()}},t,e)}))()},methods:{getBaseInfo:function(){var e=this;return m()(l.a.mark(function t(){var a,r,n;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$api.farmer.farmerSelectList();case 2:if(a=t.sent,r=a.code,n=a.data,200===r){t.next=7;break}return t.abrupt("return");case 7:n.unshift({id:0,title:"全部"}),e.base_farmer=n;case 9:case"end":return t.stop()}},t,e)}))()},resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return m()(l.a.mark(function a(){var r,n,i,s,c,m;return l.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,r=JSON.parse(o()(t.searchForm)),(n=r.start_time)&&n.length>0?(r.start_time=parseInt(n[0]/1e3),r.end_time=parseInt(n[1]/1e3)+86400-1):(r.start_time="",r.end_time=""),a.next=7,t.$api.claim.orderList(r);case 7:if(i=a.sent,s=i.code,c=i.data,t.loading=!1,200===s){a.next=13;break}return a.abrupt("return");case 13:t.tableData=c.data,t.total=c.total,m=c.data.map(function(e){return e.goods_text=e.goods_name+" 数量:x"+e.num+" 配送周期:"+e.send_cycle+",共"+e.send_times+"次",[e.id,e.goods_text,e.farmer_info.title,e.claim_code,e.user_name,e.mobile,"¥"+e.pay_price,e.order_code,e.transaction_id,moment(1e3*e.create_time).format("YYYY-MM-DD HH:mm:ss"),t.payType[e.pay_model],t.sendType[e.send_type],t.statusType[e.pay_type]]}),t.printTableData=[["ID","商品信息","农场名称","认养编号","下单人","下单手机号","实收金额","系统订单号","付款订单号","下单时间","支付方式","配送方式","状态"],m];case 17:case"end":return a.stop()}},a,t)}))()},exportOrder:function(){var e=this;this.downloadLoading=!0;var t=JSON.parse(o()(this.searchForm)),a=t.start_time;a&&a.length>0?(t.start_time=parseInt(a[0]/1e3),t.end_time=parseInt(a[1]/1e3)+86400-1):(t.start_time="",t.end_time="");var r=this.$util.getProCurrentHref(),i=r.indexOf("?")>0?"":"?",s=r.indexOf("?")>0;n()(t).forEach(function(e,a){i+=s?"&"+e+"="+t[e]:e+"="+t[e],s=!0});var l=sessionStorage.getItem("minitk"),c=r+"/farm/admin/AdminExcel/claimOrderList"+i+"&token="+l;window.location.href=c,setTimeout(function(){e.downloadLoading=!1},5e3)},printTable:function(){var e=this;this.print=!0,setTimeout(function(){e.$print(e.$refs.print),e.print=!1},50)}},filters:{handleTime:function(e,t){return 1===t?moment(1e3*e).format("YYYY-MM-DD"):2===t?moment(1e3*e).format("HH:mm:ss"):moment(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},d={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-shop-order"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"商品名称",prop:"goods_name"}},[a("el-input",{attrs:{placeholder:"请输入商品名称"},model:{value:e.searchForm.goods_name,callback:function(t){e.$set(e.searchForm,"goods_name",t)},expression:"searchForm.goods_name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"系统订单号",prop:"order_code"}},[a("el-input",{attrs:{placeholder:"请输入系统订单号"},model:{value:e.searchForm.order_code,callback:function(t){e.$set(e.searchForm,"order_code",t)},expression:"searchForm.order_code"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"下单手机号",prop:"mobile"}},[a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"请输入下单时填写的手机号"},model:{value:e.searchForm.mobile,callback:function(t){e.$set(e.searchForm,"mobile",t)},expression:"searchForm.mobile"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"日期",prop:"start_time"}},[a("el-date-picker",{attrs:{type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"timestamp","picker-options":e.pickerOptions},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.start_time,callback:function(t){e.$set(e.searchForm,"start_time",t)},expression:"searchForm.start_time"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"农场",prop:"farmer_id"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.farmer_id,callback:function(t){e.$set(e.searchForm,"farmer_id",t)},expression:"searchForm.farmer_id"}},e._l(e.base_farmer,function(e){return a("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"状态",prop:"pay_type"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.pay_type,callback:function(t){e.$set(e.searchForm,"pay_type",t)},expression:"searchForm.pay_type"}},e._l(e.statusOptions,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1)}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("searchForm")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1)],1),e._v(" "),a("el-row",{staticClass:"page-top-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-print",expression:"`${$route.name}-print`"}],attrs:{size:"mini",plain:"",type:"primary",icon:"el-icon-printer"},on:{click:e.printTable}},[e._v(e._s(e.$t("action.print")))]),e._v(" "),a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-export",expression:"`${$route.name}-export`"}],attrs:{size:"mini",plain:"",type:"primary",icon:"el-icon-download",loading:e.downloadLoading},on:{click:e.exportOrder}},[e._v(e._s(e.$t("action.export")))])],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"80",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{prop:"goods_info_text",width:"300",label:"商品信息"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"pb-sm"},[a("div",{staticClass:"flex-center pt-md"},[a("lb-image",{staticClass:"avatar radius-5",attrs:{src:t.row.goods_cover}}),e._v(" "),a("div",{staticClass:"flex-1 f-caption c-caption ml-md mr-lg",staticStyle:{width:"180px"}},[a("div",{staticClass:"flex-between"},[a("div",{staticClass:"f-paragraph c-title ellipsis",staticStyle:{"line-height":"1.2"}},[e._v("\n "+e._s(t.row.goods_name)+"\n ")])]),e._v(" "),a("div",{staticClass:"f-caption c-desc ellipsis"},[e._v("\n 数量:"+e._s(t.row.num)+"\n ")]),e._v(" "),a("div",{staticClass:"flex-between f-caption"},[a("div",{staticClass:"flex-y-baseline"},[a("div",{staticClass:"c-warning"},[e._v("\n "+e._s(t.row.send_cycle+",共"+t.row.send_times+"次")+"\n ")])])])])],1)])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"farmer_info.title",label:"农场名称","min-width":"130"}}),e._v(" "),a("el-table-column",{attrs:{prop:"claim_code",label:"认养编号","min-width":"130"}}),e._v(" "),a("el-table-column",{attrs:{prop:"user_name",label:"下单人","min-width":"130"}}),e._v(" "),a("el-table-column",{attrs:{prop:"mobile",label:"下单手机号","min-width":"120"}}),e._v(" "),a("el-table-column",{attrs:{prop:"pay_price",label:"实收金额"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v("\n "+e._s("¥"+t.row.pay_price)+"\n ")])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"order_code","min-width":"150",label:"系统订单号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"transaction_id","min-width":"150",label:"付款订单号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"create_time","min-width":"120",label:"下单时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s(e._f("handleTime")(t.row.create_time,1)))]),e._v(" "),a("div",[e._v(e._s(e._f("handleTime")(t.row.create_time,2)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"pay_model",label:"支付方式","min-width":"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.payType[t.row.pay_model])+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"send_type",label:"配送方式"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.sendType[t.row.send_type])+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"status",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.statusType[t.row.pay_type])+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"table-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-view",expression:"`${$route.name}-view`"}],attrs:{size:"mini",type:"primary",plain:""},on:{click:function(a){return e.$router.push("/order/claim/detail?id="+t.row.id)}}},[e._v(e._s(e.$t("action.view")))])],1)]}}])})],1),e._v(" "),a("table",{directives:[{name:"show",rawName:"v-show",value:e.print,expression:"print"}],ref:"print",staticStyle:{"font-size":"12px"},attrs:{border:"0",cellspacing:"0",cellapdding:"0"}},[a("thead",[a("tr",e._l(e.printTableData[0],function(t,r){return a("th",{key:r,staticStyle:{border:"1px solid"}},[e._v("\n "+e._s(t)+"\n ")])}),0)]),e._v(" "),a("tbody",e._l(e.printTableData[1],function(t,r){return a("tr",{key:r},e._l(t,function(t,r){return a("td",{key:r,staticStyle:{border:"1px solid"}},[e._v("\n "+e._s(t)+"\n ")])}),0)}),0)]),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}})],1)],1)},staticRenderFns:[]};var u=a("VU/8")(p,d,!1,function(e){a("herQ"),a("Ymgj")},"data-v-7983ce58",null);t.default=u.exports}}); \ No newline at end of file diff --git a/public/static/js/70.js b/public/static/js/70.js new file mode 100644 index 0000000..a1dce21 --- /dev/null +++ b/public/static/js/70.js @@ -0,0 +1 @@ +webpackJsonp([70],{kbYB:function(e,t){},rEC9:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-system-notice"},[r("top-nav"),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{attrs:{"label-width":"150px"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("el-form-item",{attrs:{required:"",label:"请选择通知类型"}},[r("el-select",{attrs:{placeholder:"请选择"},model:{value:e.notice_switch,callback:function(t){e.notice_switch=t},expression:"notice_switch"}},e._l(e.options,function(e){return r("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1)],1),e._v(" "),r("el-form",{directives:[{name:"show",rawName:"v-show",value:1===e.notice_switch,expression:"notice_switch === 1"}],ref:"publicForm",staticClass:"baseform",attrs:{model:e.publicForm,rules:e.publicFormRules,"label-width":"150px"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("el-form-item",{attrs:{label:"AppId",prop:"gzh_appid"}},[r("el-input",{attrs:{placeholder:"请输入AppId"},model:{value:e.publicForm.gzh_appid,callback:function(t){e.$set(e.publicForm,"gzh_appid",t)},expression:"publicForm.gzh_appid"}}),e._v(" "),r("lb-tool-tips",[e._v("与这个小程序关联的微信公众号的AppID,注意不是小程序的AppID")])],1),e._v(" "),r("el-form-item",{attrs:{label:"模板ID",prop:"gzh_tplid"}},[r("el-input",{attrs:{placeholder:"请输入模板ID"},model:{value:e.publicForm.gzh_tplid,callback:function(t){e.$set(e.publicForm,"gzh_tplid",t)},expression:"publicForm.gzh_tplid"}}),e._v(" "),r("lb-tool-tips",[e._v("与这个小程序关联的微信公众号里面添加的模板消息ID,与服务通知的模板ID类似")])],1),e._v(" "),r("el-form-item",[r("lb-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitFrom("publicForm")}}},[e._v(e._s(e.$t("action.submit")))])],1)],1),e._v(" "),r("el-form",{directives:[{name:"show",rawName:"v-show",value:2===e.notice_switch,expression:"notice_switch === 2"}],ref:"enterpriseForm",staticClass:"baseform",attrs:{model:e.enterpriseForm,rules:e.enterpriseFormRules,"label-width":"150px"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("el-form-item",{attrs:{label:"企业微信ID",prop:"corpid"}},[r("el-input",{attrs:{placeholder:"请输入企业微信ID"},model:{value:e.enterpriseForm.corpid,callback:function(t){e.$set(e.enterpriseForm,"corpid",t)},expression:"enterpriseForm.corpid"}}),e._v(" "),r("lb-tool-tips",[e._v("每个企业都拥有唯一的corpid")])],1),e._v(" "),r("el-form-item",{attrs:{label:"应用密匙",prop:"corpsecret"}},[r("el-input",{attrs:{placeholder:"请输入应用密匙"},model:{value:e.enterpriseForm.corpsecret,callback:function(t){e.$set(e.enterpriseForm,"corpsecret",t)},expression:"enterpriseForm.corpsecret"}}),e._v(" "),r("lb-tool-tips",[e._v("在企业微信中,将自己的小程序添加到应用就可以查看应用密匙")])],1),e._v(" "),r("el-form-item",{attrs:{label:"企业应用ID",prop:"agentid"}},[r("el-input",{attrs:{placeholder:"请输入企业应用ID"},model:{value:e.enterpriseForm.agentid,callback:function(t){e.$set(e.enterpriseForm,"agentid",t)},expression:"enterpriseForm.agentid"}}),e._v(" "),r("lb-tool-tips",[e._v("企业应用ID,在企业微信应用与小程序中查看")])],1),e._v(" "),r("el-form-item",[r("lb-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitFrom("enterpriseForm")}}},[e._v(e._s(e.$t("action.submit")))])],1)],1),e._v(" "),r("el-form",{directives:[{name:"show",rawName:"v-show",value:4===e.notice_switch,expression:"notice_switch === 4"}],ref:"miniForm",staticClass:"baseform",attrs:{model:e.miniForm,rules:e.miniFormRules,"label-width":"150px"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("el-form-item",{attrs:{label:"企业微信ID",prop:"yq_corpid"}},[r("el-input",{attrs:{placeholder:"请输入企业微信ID"},model:{value:e.miniForm.yq_corpid,callback:function(t){e.$set(e.miniForm,"yq_corpid",t)},expression:"miniForm.yq_corpid"}}),e._v(" "),r("lb-tool-tips",[e._v("每个企业都拥有唯一的corpid")])],1),e._v(" "),r("el-form-item",{attrs:{label:"应用密匙",prop:"yq_corpsecret"}},[r("el-input",{attrs:{placeholder:"请输入应用密匙"},model:{value:e.miniForm.yq_corpsecret,callback:function(t){e.$set(e.miniForm,"yq_corpsecret",t)},expression:"miniForm.yq_corpsecret"}}),e._v(" "),r("lb-tool-tips",[e._v("在企业微信应用中点击对应小程序查看应用密匙")])],1),e._v(" "),r("el-form-item",{attrs:{label:"企业应用ID",prop:"yq_agentid"}},[r("el-input",{attrs:{placeholder:"请输入企业应用ID"},model:{value:e.miniForm.yq_agentid,callback:function(t){e.$set(e.miniForm,"yq_agentid",t)},expression:"miniForm.yq_agentid"}}),e._v(" "),r("lb-tool-tips",[e._v("企业应用ID,在企业微信应用与小程序中查看")])],1),e._v(" "),r("el-form-item",[r("lb-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitFrom("miniForm")}}},[e._v(e._s(e.$t("action.submit")))])],1)],1)],1)],1)},staticRenderFns:[]};var o=r("VU/8")({data:function(){return{options:[{value:1,label:"公众号通知"}],notice_switch:1,miniForm:{yq_corpid:"",yq_corpsecret:"",yq_agentid:"",notice_switch:4},miniFormRules:{yq_corpid:{required:!0,message:"请输入",type:"string",trigger:"blur"},yq_corpsecret:{required:!0,message:"请输入",type:"string",trigger:"blur"},yq_agentid:{required:!0,message:"请输入",type:"string",trigger:"blur"},notice_switch:{required:!0,message:"请选择",type:"number",trigger:"change"}},enterpriseForm:{corpid:"",corpsecret:"",agentid:"",notice_switch:2},enterpriseFormRules:{corpid:{required:!0,message:"请输入",type:"string",trigger:"blur"},corpsecret:{required:!0,message:"请输入",type:"string",trigger:"blur"},agentid:{required:!0,message:"请输入",type:"string",trigger:"blur"},notice_switch:{required:!0,message:"请选择",type:"number",trigger:"change"}},publicForm:{gzh_appid:"",gzh_tplid:""},publicFormRules:{gzh_appid:{required:!0,message:"请输入AppId",type:"string",trigger:"blur"},gzh_tplid:{required:!0,message:"请输入模板ID",type:"string",trigger:"blur"},notice_switch:{required:!0,message:"请选择",type:"number",trigger:"change"}}}},created:function(){this.getFormInfo()},methods:{getFormInfo:function(){var e=this;this.$api.system.configInfo().then(function(t){if(200===t.code)for(var r=["publicForm"],i=0,o=r.length;i0&&r.length<1)){o.next=23;break}return t.$confirm("当前无选择规格,请确认是否要清空选项?",t.$t("tips.reminder"),{confirmButtonText:t.$t("action.comfirm"),cancelButtonText:t.$t("action.cancel"),type:"warning"}).then(function(){t.subForm.goods_info=[],t.showDialog[e]=!1}).catch(function(){}),o.abrupt("return");case 23:if(!(i&&r.length<1)){o.next=26;break}return t.$message.error("请选择商品规格"),o.abrupt("return");case 26:return t.subForm.goods_info=r,o.abrupt("break",28);case 28:t.showDialog[e]=!1;case 29:case"end":return o.stop()}},o,t)}))()},submitFormInfo:function(e){var t=this;return l()(s.a.mark(function o(){var r,n,i,l,c,u,d,p,m,b,f,g;return s.a.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(r=!0,t.$refs[e+"Form"].validate(function(e){e||(r=!1)}),!r){o.next=30;break}if(n=JSON.parse(a()("sub"===e?t.subForm:t.batchForm)),"sub"===e){o.next=12;break}return i=JSON.parse(a()(t.subForm)),l=n.stock,c=n.price,u=t.multipleBatchSelection.map(function(e){return e.spe_id}),i.goods_info.map(function(t){u.includes(t.spe_id)&&("stock"===e?t.stock=l:t.price=c)}),t.subForm=i,t.showDialog.batch=!1,o.abrupt("return");case 12:o.t0=s.a.keys(n.goods_info);case 13:if((o.t1=o.t0()).done){o.next=25;break}if(d=o.t1.value,p=1*d+1,m=n.goods_info[d],b=m.stock,f=m.price,b&&/^\+?[0-9]*$/.test(b)){o.next=20;break}return t.$message.error("商品规格 第"+p+"条数据:请输入秒杀库存"),o.abrupt("return");case 20:if(/^(([0-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/.test(f)){o.next=23;break}return t.$message.error("商品规格 第"+p+"条数据:请输入正确的秒杀价格,最多保留2位小数"),o.abrupt("return");case 23:o.next=13;break;case 25:n.goods_info=n.goods_info.map(function(e){return{spe_id:e.spe_id,stock:e.stock,price:e.price}}),g=t.options.atv_id,n.atv_id=g,delete n.goods_name,t.$api.market.addKillGoods(n).then(function(e){200===e.code&&(t.$message.success(t.$t(n.id?"tips.successRev":"tips.successSub")),t.$router.back(-1))});case 30:case"end":return o.stop()}},o,t)}))()}}},u={render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"lb-market-seckill-edit"},[o("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),o("div",{staticClass:"page-main"},[o("el-form",{ref:"subForm",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"120px"},nativeOn:{submit:function(e){e.preventDefault()}}},[o("el-form-item",{attrs:{label:"活动商品",prop:"goods_id"}},[o("el-tag",{staticStyle:{cursor:"pointer"},on:{click:function(t){return e.toShowDialog("goods")}}},[e._v(e._s(e.subForm.goods_name||"请选择活动商品"))])],1),e._v(" "),e.subForm.goods_id?o("block",[o("el-form-item",{attrs:{label:"活动规格",prop:"goods_info"}},[o("el-tag",{staticStyle:{cursor:"pointer"},on:{click:function(t){return e.toShowDialog("spec")}}},[e._v("选择商品规格")]),e._v(" "),o("el-table",{ref:"multipleTable",staticClass:"mt-lg",staticStyle:{width:"1000px"},attrs:{data:e.subForm.goods_info,"header-cell-style":{background:"#f5f7fa",color:"#606266"}},on:{"selection-change":e.handleBatchSelectionChange}},[o("el-table-column",{attrs:{type:"selection",width:"55"}}),e._v(" "),o("el-table-column",{attrs:{prop:"spe_name",label:"规格",width:"250"}}),e._v(" "),o("el-table-column",{attrs:{prop:"goods_stock",label:"现有库存"}}),e._v(" "),o("el-table-column",{attrs:{prop:"goods_price",label:"","min-width":"100"},scopedSlots:e._u([{key:"header",fn:function(t){return[o("div",[e._v("\n 原价"),o("lb-tool-tips",{attrs:{padding:"2"}},[e._v("这里是指商品现价")])],1)]}},{key:"default",fn:function(t){return[o("div",[e._v("¥"+e._s(t.row.goods_price))])]}}],null,!1,958371890)}),e._v(" "),o("el-table-column",{attrs:{prop:"stock",label:"秒杀库存",width:"140"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-input-number",{attrs:{size:"small",precision:0,controls:!1,min:1},model:{value:t.row.stock,callback:function(o){e.$set(t.row,"stock",o)},expression:"scope.row.stock"}})]}}],null,!1,1257918037)}),e._v(" "),o("el-table-column",{attrs:{prop:"price",label:"秒杀价格",width:"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("div",{staticClass:"flex-y-center f-caption c-title"},[o("el-input-number",{attrs:{size:"small",controls:!1,precision:2,min:0,max:t.row.goods_price},model:{value:t.row.price,callback:function(o){e.$set(t.row,"price",o)},expression:"scope.row.price"}}),e._v(" "),o("div",{staticClass:"ml-sm"},[e._v("元")])],1)]}}],null,!1,181804985)})],1),e._v(" "),o("lb-page",{attrs:{isShowPage:!1,selected:e.multipleSelection.length}},[o("lb-button",{attrs:{size:"mini",type:"primary"},on:{click:function(t){return e.toShowDialog("batch",1)}}},[e._v("秒杀库存")]),e._v(" "),o("lb-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){return e.toShowDialog("batch",2)}}},[e._v("秒杀价格")])],1)],1)],1):e._e(),e._v(" "),o("el-form-item",[o("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(t){return e.submitFormInfo("sub")}}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),o("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1),e._v(" "),o("el-dialog",{attrs:{title:"选择活动商品",visible:e.showDialog.goods,width:"800px","close-on-click-modal":!1,"close-on-press-escape":!1,"append-to-body":!0,center:""},on:{"update:visible":function(t){return e.$set(e.showDialog,"goods",t)}}},[o("el-form",{ref:"goodsForm",attrs:{inline:!0,model:e.searchForm.goods},nativeOn:{submit:function(e){e.preventDefault()}}},[o("el-form-item",{attrs:{label:"输入查询",prop:"name"}},[o("el-input",{attrs:{placeholder:"请输入商品名称"},model:{value:e.searchForm.goods.name,callback:function(t){e.$set(e.searchForm.goods,"name",t)},expression:"searchForm.goods.name"}})],1),e._v(" "),o("el-form-item",[o("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1,"goods")}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),o("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("goods")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1),e._v(" "),o("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading.goods,expression:"loading.goods"}],ref:"singleTable",staticStyle:{width:"100%"},attrs:{data:e.tableData.goods,"highlight-current-row":""},on:{"current-change":e.handleCurrentRow}},[o("el-table-column",{attrs:{prop:"id",label:"ID"}}),e._v(" "),o("el-table-column",{attrs:{prop:"goods_name",label:"商品名称"}}),e._v(" "),o("el-table-column",{attrs:{prop:"cover",label:"封面图"},scopedSlots:e._u([{key:"default",fn:function(e){return[o("lb-image",{attrs:{src:e.row.cover}})]}}])}),e._v(" "),o("el-table-column",{attrs:{prop:"show_price",label:"价格"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n ¥"+e._s(t.row.show_price)+"起\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{prop:"stock",label:"库存"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.all_stock>0?t.row.all_stock:"暂无库存")+"\n ")]}}])})],1),e._v(" "),o("lb-page",{attrs:{batch:!1,page:e.searchForm.goods.page,pageSize:e.searchForm.goods.limit,total:e.total.goods},on:{handleSizeChange:function(t){return e.handleSizeChange(t,"goods")},handleCurrentChange:function(t){return e.handleCurrentChange(t,"goods")}}}),e._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(t){e.showDialog.goods=!1}}},[e._v("取 消")]),e._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.handleConfirm("goods")}}},[e._v("确 定")])],1)],1),e._v(" "),o("el-dialog",{attrs:{title:"选择商品规格",visible:e.showDialog.spec,width:"800px","close-on-click-modal":!1,"close-on-press-escape":!1,"append-to-body":!0,center:""},on:{"update:visible":function(t){return e.$set(e.showDialog,"spec",t)}}},[o("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading.spec,expression:"loading.spec"}],ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:e.tableData.spec,"header-cell-style":{background:"#f5f7fa",color:"#606266"},"tooltip-effect":"dark"},on:{"selection-change":e.handleSelectionChange}},[o("el-table-column",{attrs:{type:"selection",width:"55"}}),e._v(" "),o("el-table-column",{attrs:{prop:"spe_name",label:"规格",width:"250"}}),e._v(" "),o("el-table-column",{attrs:{prop:"original_price",label:"原价"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("div",[e._v("¥"+e._s(t.row.original_price))])]}}])}),e._v(" "),o("el-table-column",{attrs:{prop:"price",label:"现价"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("div",[e._v("¥"+e._s(t.row.price))])]}}])}),e._v(" "),o("el-table-column",{attrs:{prop:"goods_stock",label:"库存"}})],1),e._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(t){e.showDialog.spec=!1}}},[e._v("取 消")]),e._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.handleConfirm("spec")}}},[e._v("确 定")])],1)],1),e._v(" "),o("el-dialog",{attrs:{title:1===e.dialogType?"批量设置秒杀库存":"批量设置秒杀价格",visible:e.showDialog.batch,width:"500px",center:""},on:{"update:visible":function(t){return e.$set(e.showDialog,"batch",t)}}},[1===e.dialogType?o("el-form",{ref:"stockForm",staticClass:"dialog-form",attrs:{model:e.batchForm,rules:e.stockFormRules,"label-width":"100px"}},[o("el-form-item",{attrs:{label:"秒杀库存",prop:"stock"}},[o("el-input",{attrs:{placeholder:"请输入秒杀库存"},model:{value:e.batchForm.stock,callback:function(t){e.$set(e.batchForm,"stock",t)},expression:"batchForm.stock"}})],1)],1):e._e(),e._v(" "),2===e.dialogType?o("el-form",{ref:"priceForm",staticClass:"dialog-form",attrs:{model:e.batchForm,rules:e.priceFormRules,"label-width":"100px"}},[o("el-form-item",{attrs:{label:"秒杀价格",prop:"price"}},[o("el-input",{attrs:{placeholder:"请输入秒杀价格"},model:{value:e.batchForm.price,callback:function(t){e.$set(e.batchForm,"price",t)},expression:"batchForm.price"}},[o("template",{slot:"append"},[e._v("元")])],2)],1)],1):e._e(),e._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(t){e.showDialog.batch=!1}}},[e._v("取 消")]),e._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitFormInfo(1===e.dialogType?"stock":"price")}}},[e._v("确 定")])],1)],1)],1)],1)},staticRenderFns:[]};var d=o("VU/8")(c,u,!1,function(e){o("WwGo")},"data-v-37f92b22",null);t.default=d.exports}}); \ No newline at end of file diff --git a/public/static/js/72.js b/public/static/js/72.js new file mode 100644 index 0000000..b884525 --- /dev/null +++ b/public/static/js/72.js @@ -0,0 +1 @@ +webpackJsonp([72],{"03t2":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r("Xxa5"),s=r.n(a),i=r("exGp"),n=r.n(i),o={data:function(){return{loading:!1,navTitle:"",statusType:{"-1":"已取消",1:"待支付",2:"认养中",3:"配送中",7:"已完成"},payType:{1:"微信支付",2:"余额支付",3:"支付宝支付"},sendType:{1:"自提",2:"快递"},sendPayType:{1:{"-1":"已取消",2:"待提货",3:"已提货",7:"已完成"},2:{"-1":"已取消",2:"待配送",3:"配送中",7:"已完成"}},subForm:{id:0},searchForm:{page:1,limit:10},tableData:[],total:0,showDialog:!1}},created:function(){var e=this;return n()(s.a.mark(function t(){var r;return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.$route.query.id,e.subForm.id=r,e.searchForm.claim_order_id=r,t.next=5,e.getDetail();case 5:case"end":return t.stop()}},t,e)}))()},methods:{getDetail:function(){var e=this;return n()(s.a.mark(function t(){var r,a,i,n;return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.subForm.id,t.next=3,e.$api.claim.orderInfo({id:r});case 3:if(a=t.sent,i=a.code,n=a.data,200===i){t.next=8;break}return t.abrupt("return");case 8:return e.subForm=n,t.next=11,e.getTableDataList();case 11:case"end":return t.stop()}},t,e)}))()},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return n()(s.a.mark(function r(){var a,i,n,o,l;return s.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,r.next=4,t.$api.claim.userSendOrderList(t.searchForm);case 4:if(a=r.sent,i=a.code,n=a.data,t.loading=!1,200===i){r.next=10;break}return r.abrupt("return");case 10:o=n.data,l=n.total,t.tableData=o,t.total=l;case 13:case"end":return r.stop()}},r,t)}))()},toSendOrder:function(e){var t=this,r=e.id,a=e.send_type;this.$confirm("你确认要"+(1===a?"取货":"发货")+"吗?",this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(r,a)}).catch(function(){})},updateItem:function(e,t){var r=this;return n()(s.a.mark(function a(){var i;return s.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:i=1===t?"sendOrderReceiving":"sendOrderSend",r.$api.claim[i]({id:e}).then(function(e){200===e.code?(r.$message.success(r.$t("tips.successOper")),r.getTableDataList()):r.getTableDataList()});case 2:case"end":return a.stop()}},a,r)}))()}},watch:{$route:function(e){var t=this;return n()(s.a.mark(function r(){var a,i;return s.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a=e.query.id,1*(i=void 0===a?0:a)!==t.subForm.id&&t.getDetail(i);case 2:case"end":return r.stop()}},r,t)}))()}},filters:{handleTime:function(e,t){return 1===t?moment(1e3*e).format("YYYY-MM-DD"):2===t?moment(1e3*e).format("HH:mm:ss"):3===t?moment(1e3*e).format("YYYY-MM-DD HH:mm"):4===t?moment(1e3*e).format("HH:mm"):moment(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},l={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-shop-order-edit"},[r("top-nav",{attrs:{isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{attrs:{model:e.subForm,"label-width":"110px",size:"mini"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("lb-classify-title",{attrs:{title:"用户信息"}}),e._v(" "),r("el-form-item",{attrs:{label:"用户ID:"}},[r("div",[e._v(e._s(e.subForm.user_id))])]),e._v(" "),r("el-form-item",{attrs:{label:"下单人:"}},[r("div",[e._v(e._s(e.subForm.address_info.user_name))])]),e._v(" "),r("el-form-item",{attrs:{label:"下单手机号:"}},[r("div",[e._v(e._s(e.subForm.address_info.mobile))])]),e._v(" "),r("lb-classify-title",{attrs:{title:"订单信息"}}),e._v(" "),r("el-form-item",{attrs:{label:"订单状态:"}},[r("div",[e._v(e._s(e.statusType[e.subForm.pay_type]))])]),e._v(" "),r("el-form-item",{attrs:{label:"系统订单号:"}},[r("div",[e._v(e._s(e.subForm.order_code))])]),e._v(" "),e.subForm.transaction_id?r("el-form-item",{attrs:{label:"付款订单号:"}},[r("div",[e._v(e._s(e.subForm.transaction_id))])]):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"下单时间:"}},[r("div",[e._v(e._s(e._f("handleTime")(e.subForm.create_time)))])]),e._v(" "),e.subForm.pay_time?r("el-form-item",{attrs:{label:"支付时间:"}},[r("div",[e._v(e._s(e._f("handleTime")(e.subForm.pay_time)))])]):e._e(),e._v(" "),1*e.subForm.discount_price>0||1*e.subForm.collage_discount_price>0?r("block",[r("el-form-item",{attrs:{label:"应付金额:"}},[r("div",[e._v("\n "+e._s("¥"+e.subForm.init_price)+"\n ")])]),e._v(" "),1*e.subForm.discount_price>0?r("el-form-item",{attrs:{label:"卡券优惠:"}},[r("div",{staticClass:"c-warning"},[e._v("\n "+e._s("-¥"+e.subForm.discount_price)+"\n ")])]):e._e(),e._v(" "),1*e.subForm.collage_discount_price>0?r("el-form-item",{attrs:{label:"众筹优惠:"}},[r("div",{staticClass:"c-warning"},[e._v("\n "+e._s("-¥"+e.subForm.collage_discount_price)+"\n ")])]):e._e()],1):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"实付金额:"}},[r("div",{staticClass:"c-warning"},[e._v("\n "+e._s("¥"+e.subForm.pay_price)+"\n ")])]),e._v(" "),r("el-form-item",{attrs:{label:"支付方式:"}},[r("div",[e._v(e._s(e.payType[e.subForm.pay_model]))])]),e._v(" "),e.subForm.text?r("el-form-item",{attrs:{label:"订单备注:"}},[r("div",{domProps:{innerHTML:e._s(e.subForm.text)}})]):e._e(),e._v(" "),r("lb-classify-title",{attrs:{title:"农场信息"}}),e._v(" "),r("el-form-item",{attrs:{label:"农场名称:"}},[r("div",[e._v(e._s(e.subForm.farmer_info.title))])]),e._v(" "),r("el-form-item",{attrs:{label:"农场头像:"}},[r("div",[r("lb-cover",{attrs:{fileList:[{url:e.subForm.farmer_info.cover}],isToDel:!1,type:"more",size:"small",fileSize:1}})],1)]),e._v(" "),r("el-form-item",{attrs:{label:"农场地址:"}},[r("div",[e._v(e._s(e.subForm.farmer_info.address))]),e._v(" "),r("div",[e._v("\n "+e._s(e.subForm.farmer_info.user_name+" "+e.subForm.farmer_info.mobile)+"\n ")])]),e._v(" "),r("lb-classify-title",{attrs:{title:"认养信息"}}),e._v(" "),r("el-form-item",{attrs:{label:"认养编号:"}},[r("div",[e._v(e._s(e.subForm.claim_code))])]),e._v(" "),r("el-form-item",{attrs:{label:"认养项目:"}},[r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:[e.subForm],"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[r("el-table-column",{attrs:{prop:"goods_cover",label:"商品图片"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("lb-image",{attrs:{src:e.row.goods_cover}})]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"goods_name",label:"商品名称"}}),e._v(" "),r("el-table-column",{attrs:{prop:"goods_price",label:"价格"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.goods_price)+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"num",label:"数量"}})],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"起止时间:"}},[r("div",[e._v("\n "+e._s(e._f("handleTime")(e.subForm.start_time,1))+" ~\n "+e._s(e._f("handleTime")(e.subForm.end_time,1))+"\n ")])]),e._v(" "),r("el-form-item",{attrs:{label:"认养天数:"}},[r("div",[e._v(e._s(e.subForm.cycle+"天"))])]),e._v(" "),r("el-form-item",{attrs:{label:"认养取名:"}},[r("div",[e._v(e._s(e.subForm.name))])]),e._v(" "),r("el-form-item",{attrs:{label:"认养收获:"}},[r("div",[r("lb-cover",{attrs:{fileList:[{url:e.subForm.harvest_cover}],isToDel:!1,type:"more",size:"small",fileSize:1}})],1),e._v(" "),r("div",[e._v(e._s(e.subForm.harvest_text))])]),e._v(" "),r("lb-classify-title",{attrs:{title:"配送信息"}}),e._v(" "),r("el-form-item",{attrs:{label:"配送方式:"}},[r("div",[e._v(e._s(e.sendType[e.subForm.send_type]))])]),e._v(" "),r("el-form-item",{attrs:{label:"配送周期:"}},[r("div",[e._v(e._s(e.subForm.send_cycle+",共"+e.subForm.send_times+"次"))])]),e._v(" "),r("el-form-item",{attrs:{label:"配送订单:"}},[r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[r("el-table-column",{attrs:{prop:"id",label:"ID",fixed:""}}),e._v(" "),r("el-table-column",{attrs:{prop:"times",label:"配送次数","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("第"+t.row.times+"次"+(1===t.row.send_type?"自提":"配送"))+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"order_code",label:"配送单号","min-width":"140"}}),e._v(" "),r("el-table-column",{attrs:{prop:"send_time",label:1===e.subForm.send_type?"自提时间":"送货时间","min-width":"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.time_text)+"\n ")]}}])}),e._v(" "),2===e.subForm.send_type?r("el-table-column",{attrs:{prop:"address",label:"收货地址","min-width":"200"}}):e._e(),e._v(" "),r("el-table-column",{attrs:{prop:"times",label:1===e.subForm.send_type?"自提人":"收货人","min-width":"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.user_name+" "+t.row.mobile)+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"status",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.sendPayType[e.subForm.send_type][t.row.pay_type])+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("div",{staticClass:"table-operate"},[r("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:"OrderDistribution-view",expression:"`OrderDistribution-view`"}],attrs:{size:"mini",type:"primary",plain:""},on:{click:function(r){return e.$router.push("/order/distribution/detail?id="+t.row.id+"&type="+t.row.type)}}},[e._v(e._s(e.$t("action.view")))]),e._v(" "),r("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:"OrderClaim-sendOrder",expression:"`OrderClaim-sendOrder`"},{name:"show",rawName:"v-show",value:2===t.row.pay_type,expression:"scope.row.pay_type === 2"}],attrs:{size:"mini",type:1===t.row.send_type?"danger":"success",plain:""},on:{click:function(r){return e.toSendOrder(t.row)}}},[e._v(e._s(1===t.row.send_type?"取货":"发货"))])],1)]}}])})],1),e._v(" "),r("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}})],1)],1),e._v(" "),r("div",{staticClass:"space-lg"}),e._v(" "),r("lb-button",{attrs:{type:"primary"},on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1),e._v(" "),r("el-dialog",{attrs:{title:"溯源信息",visible:e.showDialog,width:"600px",center:""},on:{"update:visible":function(t){e.showDialog=t}}},[r("el-timeline",e._l(e.subForm.source.stage,function(t,a){return r("el-timeline-item",{key:a},[r("div",[r("div",{staticClass:"f-desc text-bold c-title"},[e._v(e._s(t.stage))]),e._v(" "),r("div",{staticClass:"f-caption c-caption"},[e._v(e._s(t.time_text))]),e._v(" "),r("lb-cover",{attrs:{fileList:[{url:t.cover}],isToDel:!1,size:"small",type:"more",fileSize:1}})],1)])}),1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.showDialog=!1}}},[e._v("知道了")])],1)],1)],1)},staticRenderFns:[]};var m=r("VU/8")(o,l,!1,function(e){r("XEr/")},"data-v-35ad82ea",null);t.default=m.exports},"XEr/":function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/73.js b/public/static/js/73.js new file mode 100644 index 0000000..e826f3c --- /dev/null +++ b/public/static/js/73.js @@ -0,0 +1 @@ +webpackJsonp([73],{"93xJ":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var l={data:function(){return{statusOptions:[{label:"全部",value:0},{label:"未入账",value:1},{label:"已入账",value:2},{label:"已退款",value:3}],fxType:{1:"一级分销提成",2:"二级分销提成"},type:{1:"商城",2:"土地",3:"认养"},statusType:{1:"未入账",2:"已入账",3:"已退款"},searchForm:{limit:10,page:1,status:0,name:""},loading:!1,total:0,tableData:[]}},activated:function(){this.getTableDataList()},methods:{resetForm:function(t){this.$refs[t].resetFields(),this.getTableDataList(1)},getTableDataList:function(t){var e=this;t&&(this.searchForm.page=1),this.loading=!0;var a=this.searchForm;this.$api.distribution.cashList(a).then(function(t){console.log(t),e.loading=!1,200===t.code&&(e.total=t.data.total,e.tableData=t.data.data)})},delReocde:function(t){console.log(t)},handleSizeChange:function(t){this.searchForm.limit=t,this.handleCurrentChange(1)},handleCurrentChange:function(t){this.searchForm.page=t,this.getTableDataList()}},filters:{handleTime:function(t,e){return 1===e?moment(1e3*t).format("YYYY-MM-DD"):2===e?moment(1e3*t).format("HH:mm:ss"):moment(1e3*t).format("YYYY-MM-DD HH:mm:ss")}}},s={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"lb-dis-commission"},[a("top-nav"),t._v(" "),a("div",{staticClass:"page-main"},[a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:t.searchForm},nativeOn:{submit:function(t){t.preventDefault()}}},[a("el-form-item",{attrs:{label:"输入查询",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入姓名/微信昵称"},model:{value:t.searchForm.name,callback:function(e){t.$set(t.searchForm,"name",e)},expression:"searchForm.name"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"状态",prop:"status"}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:t.searchForm.status,callback:function(e){t.$set(t.searchForm,"status",e)},expression:"searchForm.status"}},t._l(t.statusOptions,function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})}),1)],1),t._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(e){return t.getTableDataList(1)}}},[t._v(t._s(t.$t("action.search")))]),t._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(e){return t.resetForm("searchForm")}}},[t._v(t._s(t.$t("action.reset")))])],1)],1)],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"id",label:"ID",fixed:""}}),t._v(" "),a("el-table-column",{attrs:{prop:"user_id",label:"用户ID"}}),t._v(" "),a("el-table-column",{attrs:{prop:"user_name",label:"姓名","min-width":"120"}}),t._v(" "),a("el-table-column",{attrs:{prop:"nickName",label:"微信昵称","min-width":"120"}}),t._v(" "),a("el-table-column",{attrs:{prop:"source_info.nickName",label:"下单人昵称","min-width":"120"}}),t._v(" "),a("el-table-column",{attrs:{prop:"cover",label:"下单人头像","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(t){return[a("lb-image",{attrs:{src:t.row.source_info.avatarUrl}})]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"order_code",label:"系统订单号","min-width":"160"}}),t._v(" "),a("el-table-column",{attrs:{prop:"transaction_id",label:"商户订单号","min-width":"160"}}),t._v(" "),a("el-table-column",{attrs:{prop:"fx_type",label:"类型","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.fxType[e.row.fx_type])+"\n ")]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"status",label:"状态","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.statusType[e.row.status])+"\n ")]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"goods_info_text",width:"300",label:"商品信息"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.order_goods,function(e,l){return a("div",{key:l,staticClass:"pb-sm"},[a("div",{staticClass:"flex-center pt-md"},[a("lb-image",{staticClass:"avatar radius-5",attrs:{src:e.goods_cover}}),t._v(" "),a("div",{staticClass:"flex-1 f-caption c-caption ml-md mr-lg",staticStyle:{width:"180px"}},[a("div",{staticClass:"f-paragraph c-title ellipsis",staticStyle:{"line-height":"1.2"}},[t._v("\n "+t._s(e.goods_name)+"\n ")]),t._v(" "),a("div",{staticClass:"c-title ellipsis"},[t._v("\n "+t._s(e.spe_name)+"\n ")]),t._v(" "),a("div",{staticClass:"flex-between"},[a("div",{staticClass:"flex-y-baseline"},[a("div",{staticClass:"c-warning"},[t._v("\n "+t._s("¥"+e.singe_pay_price)+"\n ")]),t._v(" "),a("div",{staticClass:"ml-sm"},[t._v("提成比例 "+t._s(e.balance)+"%")])]),t._v(" "),a("div",[t._v("x"+t._s(e.num))])])])],1)])})}}])}),t._v(" "),a("el-table-column",{attrs:{label:"订单金额","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s("¥"+e.row.order_price)+"\n ")]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"分销佣金","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s("¥"+e.row.cash)+"\n ")]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"时间","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[t._v(t._s(t._f("handleTime")(e.row.create_time,1)))]),t._v(" "),a("p",[t._v(t._s(t._f("handleTime")(e.row.create_time,2)))])]}}])})],1),t._v(" "),a("lb-page",{attrs:{batch:!1,page:t.searchForm.page,pageSize:t.searchForm.limit,total:t.total},on:{handleSizeChange:t.handleSizeChange,handleCurrentChange:t.handleCurrentChange}})],1)],1)},staticRenderFns:[]};var n=a("VU/8")(l,s,!1,function(t){a("k+4q")},"data-v-2fb032e3",null);e.default=n.exports},"k+4q":function(t,e){}}); \ No newline at end of file diff --git a/public/static/js/74.js b/public/static/js/74.js new file mode 100644 index 0000000..a7471bf --- /dev/null +++ b/public/static/js/74.js @@ -0,0 +1 @@ +webpackJsonp([74],{QkO7:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r("mvHQ"),s=r.n(o),i=r("Xxa5"),n=r.n(i),a=r("exGp"),u=r.n(a),l={data:function(){return{navTitle:"",subForm:{id:0,title:"",sub_title:"",cover:[],content:"",type:1,top:0},subFormRules:{title:{required:!0,validator:this.$reg.isNoEmpty,text:"栏目标题",reg_type:2,trigger:"blur"},cover:{required:!0,type:"array",message:"请上传封面图",trigger:"blur"},content:{required:!0,type:"string",message:"请输入栏目内容",trigger:"blur"},top:{required:!0,type:"number",message:"请输入排序值",trigger:"blur"}}}},created:function(){var e=this;return u()(n.a.mark(function t(){var r;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=e.$route.query.id)){t.next=5;break}return e.subForm.id=r,t.next=5,e.getDetail(r);case 5:e.navTitle=e.$t(r?"menu.MediaWelfareEdit":"menu.MediaWelfareAdd");case 6:case"end":return t.stop()}},t,e)}))()},methods:{getDetail:function(e){var t=this;return u()(n.a.mark(function r(){var o,s,i,a;return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.$api.media.welfareInfo({id:e});case 2:if(o=r.sent,s=o.code,i=o.data,200===s){r.next=7;break}return r.abrupt("return");case 7:for(a in i.cover=[{url:i.cover}],t.subForm)t.subForm[a]=i[a];case 9:case"end":return r.stop()}},r,t)}))()},getCover:function(e){this.subForm.cover=e},submitFormInfo:function(){var e=this,t=!0;if(this.$refs.subForm.validate(function(e){e||(t=!1)}),t){var r=JSON.parse(s()(this.subForm));r.cover=r.cover[0].url;var o=r.id?"welfareUpdate":"welfareAdd";this.$api.media[o](r).then(function(t){200===t.code&&(e.$message.success(e.$t(r.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}}}},c={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-media-welfare-edit"},[r("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"120px"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("el-form-item",{attrs:{label:"栏目标题",prop:"title"}},[r("el-input",{attrs:{maxlength:"50","show-word-limit":"",placeholder:"请输入栏目标题"},model:{value:e.subForm.title,callback:function(t){e.$set(e.subForm,"title",t)},expression:"subForm.title"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"封面图",prop:"cover"}},[r("lb-cover",{attrs:{fileList:e.subForm.cover},on:{selectedFiles:e.getCover}}),e._v(" "),r("lb-tool-tips",[e._v("图片建议尺寸:180 * 160")])],1),e._v(" "),r("el-form-item",{attrs:{label:"栏目内容",prop:"content"}},[r("lb-ueditor",{attrs:{destroy:!0,ueditorType:"3"},model:{value:e.subForm.content,callback:function(t){e.$set(e.subForm,"content",t)},expression:"subForm.content"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"排序值",prop:"top"}},[r("el-input-number",{staticClass:"lb-input-number",attrs:{controls:!1,precision:0,min:0,placeholder:"请输入排序值"},model:{value:e.subForm.top,callback:function(t){e.$set(e.subForm,"top",t)},expression:"subForm.top"}}),e._v(" "),r("lb-tool-tips",[e._v("值越大, 排序越靠前")])],1),e._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),r("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)],1)],1)},staticRenderFns:[]};var m=r("VU/8")(l,c,!1,function(e){r("bmmK")},"data-v-2f6d0dcc",null);t.default=m.exports},bmmK:function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/75.js b/public/static/js/75.js new file mode 100644 index 0000000..a077f60 --- /dev/null +++ b/public/static/js/75.js @@ -0,0 +1 @@ +webpackJsonp([75],{"6RhH":function(e,t){},OWis:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("aFK5"),n=a.n(r),l=a("mvHQ"),s=a.n(l),i=a("Xxa5"),o=a.n(i),c=a("exGp"),d=a.n(c),m={data:function(){return{loading:!1,navTitle:"",downloadLoading:!1,typeType:{1:"农场",2:"店铺"},searchForm:{page:1,limit:10,farmer_id:0,start_time:"",end_time:""},store_name:"",tableData:[],total:0}},created:function(){var e=this.$route.query,t=e.id,a=e.range,r=e.type;this.searchForm.type=1*r,this.searchForm.farmer_id=t,a&&a.length>0&&(this.searchForm.start_time=parseInt(a.split(",")[0]/1e3),this.searchForm.end_time=parseInt(a.split(",")[1]/1e3)+86400-1),this.getTableDataList()},methods:{handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return d()(o.a.mark(function a(){var r,n,l,s;return o.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,r=t.searchForm,a.next=5,t.$api.finance.fincanceWaterInfo(r);case 5:if(n=a.sent,l=n.code,s=n.data,t.loading=!1,200===l){a.next=11;break}return a.abrupt("return");case 11:t.tableData=s.data,t.total=s.total,t.store_name=s.farmer_name,t.searchForm.start_time=s.start_time||"",t.searchForm.end_time=s.end_time?s.end_time:"";case 16:case"end":return a.stop()}},a,t)}))()},exportOrder:function(){var e=this;this.downloadLoading=!0;var t=JSON.parse(s()(this.searchForm)),a=this.$util.getProCurrentHref(),r=a.indexOf("?")>0?"":"?",l=a.indexOf("?")>0;n()(t).forEach(function(e,a){r+=l?"&"+e+"="+t[e]:e+"="+t[e],l=!0});var i=sessionStorage.getItem("minitk"),o=a+"/farm/admin/AdminExcel/dateCount"+r+"&token="+i;window.location.href=o,setTimeout(function(){e.downloadLoading=!1},5e3)}},filters:{handleTime:function(e,t){return 1===t?moment(1e3*e).format("YYYY-MM-DD"):2===t?moment(1e3*e).format("HH:mm:ss"):moment(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},h={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-finance-detail"},[a("top-nav",{attrs:{isBack:!0}}),e._v(" "),a("div",{staticClass:"page-main"},[a("el-row",{staticClass:"mb-lg"},[a("lb-button",{attrs:{size:"mini",plain:"",type:"primary",icon:"el-icon-download",loading:e.downloadLoading},on:{click:e.exportOrder}},[e._v("导出")])],1),e._v(" "),a("el-row",[a("div",{staticClass:"flex-warp mb-lg"},[a("div",{staticClass:"flex-1 mr-lg pr-lg"},[e._v("\n "+e._s(e.typeType[e.searchForm.type])+"名称:"+e._s(e.store_name)+"\n ")]),e._v(" "),e.searchForm.start_time?a("div",[e._v("\n 账单周期:"+e._s(e._f("handleTime")(e.searchForm.start_time))+" 至\n "+e._s(e._f("handleTime")(e.searchForm.end_time))+"\n ")]):e._e()])]),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"},{name:"show",rawName:"v-show",value:1===e.searchForm.type,expression:"searchForm.type === 1"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"create_date",label:"收支时间","min-width":"120",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{prop:"land_cash",label:"土地订单收入(元)","min-width":"160"}}),e._v(" "),a("el-table-column",{attrs:{prop:"land_send_cash",label:"土地配送收入(元)","min-width":"160"}}),e._v(" "),a("el-table-column",{attrs:{prop:"claim_cash",label:"认养订单收入(元)","min-width":"160"}}),e._v(" "),a("el-table-column",{attrs:{prop:"claim_send_cash",label:"认养配送收入(元)","min-width":"160"}}),e._v(" "),a("el-table-column",{attrs:{prop:"breed_cash",label:"养殖订单收入(元)","min-width":"160"}}),e._v(" "),a("el-table-column",{attrs:{prop:"shop_send_cash",label:"商城配送收入(元)","min-width":"160"}}),e._v(" "),a("el-table-column",{attrs:{prop:"wallet_cash",label:"","min-width":"120"},scopedSlots:e._u([{key:"header",fn:function(t){return[a("div",[e._v("\n 提现(元)"),a("lb-tool-tips",{attrs:{padding:"2"}},[e._v("实际提现到账成功")])],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"cash",label:"","min-width":"120"},scopedSlots:e._u([{key:"header",fn:function(t){return[a("div",[e._v("\n 余额(元)"),a("lb-tool-tips",{attrs:{padding:"2"}},[e._v("所有收入总金额,包含冻结金额,不含提现已到账金额,不含配送已退款金额")])],1)]}}])})],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"},{name:"show",rawName:"v-show",value:2===e.searchForm.type,expression:"searchForm.type === 2"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"create_date",label:"收支时间"}}),e._v(" "),a("el-table-column",{attrs:{prop:"shop_cash",label:"订单收入(元)"}}),e._v(" "),a("el-table-column",{attrs:{prop:"shop_refund_cash",label:"订单退款(元)"}}),e._v(" "),a("el-table-column",{attrs:{prop:"wallet_cash",label:"提现(元)"}}),e._v(" "),a("el-table-column",{attrs:{prop:"cash",label:"余额(元)"}})],1),e._v(" "),a("div",{staticClass:"space-lg mt-lg mb-lg"}),e._v(" "),a("lb-button",{attrs:{type:"primary"},on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)},staticRenderFns:[]};var p=a("VU/8")(m,h,!1,function(e){a("6RhH")},"data-v-2f223bd6",null);t.default=p.exports}}); \ No newline at end of file diff --git a/public/static/js/76.js b/public/static/js/76.js new file mode 100644 index 0000000..88e7371 --- /dev/null +++ b/public/static/js/76.js @@ -0,0 +1 @@ +webpackJsonp([76],{COyb:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Xxa5"),i=a.n(r),n=a("exGp"),s=a.n(n),o=a("Zz1P"),l=a.n(o),c={data:function(){return{loading:!1,searchForm:{page:1,limit:10,title:""},tableData:[],total:0}},activated:function(){this.getTableDataList(1)},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return s()(i.a.mark(function a(){var r,n,s;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.media.articleList(t.searchForm);case 4:if(r=a.sent,n=r.code,s=r.data,t.loading=!1,200===n){a.next=10;break}return a.abrupt("return");case 10:t.tableData=s.data,t.total=s.total;case 12:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return s()(i.a.mark(function r(){return i.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.media.articleUpdate({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page0&&n<=s&&/^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/.test(n))){t.next=19;break}return t.next=8,e.$api.shop.passRefund(o);case 8:if(i=t.sent,200===i.code){t.next=12;break}return t.abrupt("return");case 12:e.$message.success(e.$t("tips.successSub")),e.dialogRefund=!1,e.refundMoney="",e.getTableDataList(),e.lockRefund=!1,t.next=20;break;case 19:e.$message.error("请核对金额再提交!");case 20:case"end":return t.stop()}},t,e)}))()},toRefuse:function(e){var t=this;this.$confirm(this.$t("tips.confirmNoRefund"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.refuseRefund(e)}).catch(function(){})},refuseRefund:function(e){var t=this;return o()(r.a.mark(function a(){var n;return r.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t.$api.shop.noPassRefund({id:e,text:""});case 2:if(n=a.sent,200===n.code){a.next=6;break}return a.abrupt("return");case 6:t.$message.success(t.$t("tips.successOper")),t.getTableDataList();case 8:case"end":return a.stop()}},a,t)}))()}},filters:{handleTime:function(e,t){return 1===t?moment(1e3*e).format("YYYY-MM-DD"):2===t?moment(1e3*e).format("HH:mm:ss"):moment(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},l={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-shop-refund"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"商品名称",prop:"goods_name"}},[a("el-input",{attrs:{placeholder:"请输入商品名称"},model:{value:e.searchForm.goods_name,callback:function(t){e.$set(e.searchForm,"goods_name",t)},expression:"searchForm.goods_name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"订单号",prop:"order_code"}},[a("el-input",{attrs:{placeholder:"请输入付款/退款订单号"},model:{value:e.searchForm.order_code,callback:function(t){e.$set(e.searchForm,"order_code",t)},expression:"searchForm.order_code"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"状态",prop:"status"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.status,callback:function(t){e.$set(e.searchForm,"status",t)},expression:"searchForm.status"}},e._l(e.statusOptions,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1)}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("searchForm")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1)],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"80",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{prop:"goods_info_text",width:"300",label:"商品信息"},scopedSlots:e._u([{key:"default",fn:function(t){return e._l(t.row.order_goods,function(t,n){return a("div",{key:n,staticClass:"pb-sm"},[a("div",{staticClass:"flex-center pt-md"},[a("lb-image",{staticClass:"avatar radius-5",attrs:{src:t.goods_cover}}),e._v(" "),a("div",{staticClass:"flex-1 f-caption c-caption ml-md mr-lg",staticStyle:{width:"180px"}},[a("div",{staticClass:"flex-between"},[a("div",{staticClass:"f-paragraph c-title ellipsis",staticStyle:{"line-height":"1.2","margin-bottom":"4px"}},[e._v("\n "+e._s(t.goods_name)+"\n ")])]),e._v(" "),a("div",{staticClass:"f-caption c-title ellipsis"},[e._v("\n "+e._s(t.spe_name)+"\n ")]),e._v(" "),a("div",{staticClass:"flex-between f-caption"},[a("div",{staticClass:"c-warning"},[e._v(e._s("¥"+t.goods_price))]),e._v(" "),a("div",[e._v("x"+e._s(t.goods_num||1))])])])],1)])})}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"user_id",label:"用户ID"}}),e._v(" "),a("el-table-column",{attrs:{prop:"address_info.user_name",label:"下单人"}}),e._v(" "),a("el-table-column",{attrs:{prop:"store_info.user_name",label:"店长"}}),e._v(" "),a("el-table-column",{attrs:{prop:"store_info.title",label:"店铺名称"}}),e._v(" "),a("el-table-column",{attrs:{prop:"apply_price",label:"申请退款金额","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s("¥"+t.row.apply_price))]),e._v(" "),1*t.row.car_price>0?a("div",{staticClass:"f-caption c-warning"},[e._v("\n 含配送费:"+e._s("¥"+t.row.car_price)+"\n ")]):e._e()]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"refund_price",label:"退款金额"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s("¥"+t.row.refund_price))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"pay_order_code","min-width":"150",label:"付款订单号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"order_code","min-width":"150",label:"退款订单号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"out_refund_no","min-width":"150",label:"微信退款订单号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"create_time","min-width":"120",label:"申请时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s(e._f("handleTime")(t.row.create_time,1)))]),e._v(" "),a("div",[e._v(e._s(e._f("handleTime")(t.row.create_time,2)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"status_text",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.statusType[t.row.status])+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"table-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-view",expression:"`${$route.name}-view`"}],attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(a){return e.$router.push("/order/shop/refund/detail?id="+t.row.id)}}},[e._v(e._s(e.$t("action.view")))]),e._v(" "),1===t.row.status?a("block",[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-rejectRefund",expression:"`${$route.name}-rejectRefund`"}],attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(a){return e.toRefuse(t.row.id)}}},[e._v("拒绝退款")]),e._v(" "),a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-agreeRefund",expression:"`${$route.name}-agreeRefund`"}],attrs:{size:"mini",plain:"",type:"success"},on:{click:function(a){return e.showRefundDialog(t.row.id,t.row.apply_price)}}},[e._v("立即退款")])],1):e._e()],1)]}}])})],1),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}}),e._v(" "),a("el-dialog",{attrs:{title:"立即退款",visible:e.dialogRefund,width:"400px",center:""},on:{"update:visible":function(t){e.dialogRefund=t}}},[a("div",{staticClass:"refund-inner"},[a("lb-tips",{attrs:{isIcon:!1}},[e._v("请核对信息后输入需要退款的金额")]),e._v(" "),a("el-input",{staticStyle:{width:"100%"},attrs:{disabled:1*e.refundTotalMoney==0,placeholder:"请输入退款金额"},model:{value:e.refundMoney,callback:function(t){e.refundMoney=t},expression:"refundMoney"}}),e._v(" "),a("p",{staticClass:"mt-lg"},[e._v("\n 实际可退款金额\n "),a("span",{staticClass:"c-warning"},[e._v("¥"+e._s(e.refundTotalMoney))])]),e._v(" "),a("p",[e._v("退款金额不能大于可退款金额")])],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.dialogRefund=!1}}},[e._v(e._s(e.$t("action.cancel")))]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.toPassRefund}},[e._v("确认退款")])],1)])],1)],1)},staticRenderFns:[]};var c=a("VU/8")(i,l,!1,function(e){a("C1fi"),a("1doK")},"data-v-5bb9c0da",null);t.default=c.exports}}); \ No newline at end of file diff --git a/public/static/js/80.js b/public/static/js/80.js new file mode 100644 index 0000000..245c656 --- /dev/null +++ b/public/static/js/80.js @@ -0,0 +1 @@ +webpackJsonp([80],{"8JsW":function(e,t){},u2D2:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Xxa5"),n=a.n(r),i=a("exGp"),s=a.n(i),o={components:{},data:function(){return{loading:!1,storeList:[],searchForm:{page:1,limit:10},tableData:[],total:0}},activated:function(){this.getTableDataList()},methods:{handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return s()(n.a.mark(function a(){var r,i,s,o,l;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.stored.cardList(t.searchForm);case 4:if(r=a.sent,i=r.code,s=r.data,t.loading=!1,200===i){a.next=10;break}return a.abrupt("return");case 10:o=s.data,l=s.total,t.tableData=o,t.total=l;case 13:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)})},updateItem:function(e,t){var a=this;return s()(n.a.mark(function r(){return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.stored.cardUpdate({id:e,status:t}).then(function(e){if(200===e.code){if(a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1!==t)return;a.searchForm.page=a.searchForm.page0?1*s.link:"",t.subForm)t.subForm[o]=s[o];case 9:case"end":return r.stop()}},r,t)}))()},submitFormInfo:function(){var e=this,t=!0;if(this.$refs.subForm.validate(function(e){e||(t=!1)}),t){var r=JSON.parse(i()(this.subForm)),a=r.id?"claimCateUpdate":"claimCateAdd";this.$api.claim[a](r).then(function(t){200===t.code&&(e.$message.success(e.$t(r.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}}}},c={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-system-banner-edit"},[r("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",staticClass:"dialog-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"100px"}},[r("el-form-item",{attrs:{label:"分类名称",prop:"title"}},[r("el-input",{attrs:{maxlength:"10","show-word-limit":"",placeholder:"请输入分类名称"},model:{value:e.subForm.title,callback:function(t){e.$set(e.subForm,"title",t)},expression:"subForm.title"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"所属农场",prop:"is_public"}},[r("el-radio-group",{attrs:{disabled:e.subForm.id},on:{change:function(t){e.subForm.farmer_id=[]}},model:{value:e.subForm.is_public,callback:function(t){e.$set(e.subForm,"is_public",t)},expression:"subForm.is_public"}},[r("el-radio",{attrs:{label:0}},[e._v("所属农场")]),e._v(" "),r("el-radio",{attrs:{label:1}},[e._v("全部农场")])],1)],1),e._v(" "),0===e.subForm.is_public?r("el-form-item",{attrs:{prop:"farmer_id"}},[r("el-select",{attrs:{multiple:"",filterable:"",clearable:"","collapse-tags":"",placeholder:"请选择所属农场"},model:{value:e.subForm.farmer_id,callback:function(t){e.$set(e.subForm,"farmer_id",t)},expression:"subForm.farmer_id"}},e._l(e.base_farmer,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"排序值",prop:"top"}},[r("el-input-number",{staticClass:"lb-input-number",attrs:{controls:!1,precision:0,min:0,placeholder:"请输入排序值"},model:{value:e.subForm.top,callback:function(t){e.$set(e.subForm,"top",t)},expression:"subForm.top"}}),e._v(" "),r("lb-tool-tips",[e._v("值越大, 排序越靠前")])],1),e._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),r("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)],1)],1)},staticRenderFns:[]};var m=r("VU/8")(u,c,!1,function(e){r("vvi5")},"data-v-260be10a",null);t.default=m.exports},vvi5:function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/82.js b/public/static/js/82.js new file mode 100644 index 0000000..56c7390 --- /dev/null +++ b/public/static/js/82.js @@ -0,0 +1 @@ +webpackJsonp([82],{IxZa:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("mvHQ"),a=r.n(n),i=r("//Fk"),s=r.n(i),o=r("d7EF"),u=r.n(o),c=r("Xxa5"),l=r.n(c),m=r("exGp"),b=r.n(m),p={data:function(){return{id:"",navTitle:"",base_shop:[],base_article:[],subForm:{id:0,img:"",type:3,connect_type:"",text_id:"",top:0},subFormRules:{img:{required:!0,type:"array",message:"请上传图片",trigger:"blur"},top:{required:!0,type:"number",message:"请输入排序值",trigger:"blur"}}}},created:function(){var e=this;return b()(l.a.mark(function t(){var r;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.$route.query.id,t.next=3,e.getBaseInfo();case 3:r&&(e.subForm.id=r,e.getDetail(r)),e.navTitle=e.$t(r?"menu.MediaBannerEdit":"menu.MediaBannerAdd");case 5:case"end":return t.stop()}},t,e)}))()},methods:{getBaseInfo:function(){var e=this;return b()(l.a.mark(function t(){var r,n,a;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.a.all([e.$api.media.articleSelect()]);case 2:r=t.sent,n=u()(r,1),a=n[0],e.base_article=a.data;case 6:case"end":return t.stop()}},t,e)}))()},getCover:function(e){this.subForm.img=e},getDetail:function(e){var t=this;return b()(l.a.mark(function r(){var n,a,i,s;return l.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.$api.media.bannerInfo({id:e});case 2:if(n=r.sent,a=n.code,i=n.data,200===a){r.next=7;break}return r.abrupt("return");case 7:for(s in i.img=[{url:i.img}],i.text_id=1*i.text_id>0?1*i.text_id:"",t.subForm)t.subForm[s]=i[s];case 10:case"end":return r.stop()}},r,t)}))()},submitFormInfo:function(){var e=this,t=!0;if(this.$refs.subForm.validate(function(e){e||(t=!1)}),t){var r=JSON.parse(a()(this.subForm));r.img=r.img[0].url;var n=r.id?"bannerUpdate":"bannerAdd";this.$api.media[n](r).then(function(t){200===t.code&&(e.$message.success(e.$t(r.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}}}},d={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-system-banner-edit"},[r("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"130px"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("el-form-item",{attrs:{label:"图片",prop:"img"}},[r("lb-cover",{attrs:{fileList:e.subForm.img},on:{selectedFiles:e.getCover}}),e._v(" "),r("lb-tool-tips",[e._v("图片建议尺寸:750 * 420")])],1),e._v(" "),r("el-form-item",{attrs:{label:"排序值",prop:"top"}},[r("el-input-number",{staticClass:"lb-input-number",attrs:{controls:!1,precision:0,min:0,placeholder:"请输入排序值"},model:{value:e.subForm.top,callback:function(t){e.$set(e.subForm,"top",t)},expression:"subForm.top"}}),e._v(" "),r("lb-tool-tips",[e._v("值越大, 排序越靠前")])],1),e._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),r("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)],1)],1)},staticRenderFns:[]};var v=r("VU/8")(p,d,!1,function(e){r("UrrR")},"data-v-25e60246",null);t.default=v.exports},UrrR:function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/83.js b/public/static/js/83.js new file mode 100644 index 0000000..351404b --- /dev/null +++ b/public/static/js/83.js @@ -0,0 +1 @@ +webpackJsonp([83],{Jj12:function(e,t){},ZVP8:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a("Xxa5"),r=a.n(n),s=a("exGp"),l=a.n(s),i=a("Zz1P"),o=a.n(i),c={data:function(){return{statusOptions:[{label:"全部",value:0},{label:"未到账",value:1},{label:"已到账",value:2},{label:"已拒绝",value:3}],statusType:{1:"未到账",2:"已到账",3:"已拒绝"},userOptions:[{label:"全部",value:0},{label:"农场主",value:1},{label:"店主",value:2},{label:"分销商",value:5}],userType:{1:{type:"primary",text:"农场主"},2:{type:"danger",text:"店主"},5:{type:"success",text:"分销商"}},searchForm:{page:1,limit:10,type:0,status:0,order_code:""},loading:!1,total:0,tableData:[]}},created:function(){this.getTableDataList()},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return l()(r.a.mark(function a(){var n,s,l,i;return r.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,n=t.searchForm,a.next=5,t.$api.finance.walletList(n);case 5:if(s=a.sent,l=s.code,i=s.data,t.loading=!1,200===l){a.next=11;break}return a.abrupt("return");case 11:t.tableData=i.data,t.total=i.total;case 13:case"end":return a.stop()}},a,t)}))()},confirmWxCash:function(e){var t=this;this.$confirm(this.$t("tips.confirmOperate"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.$api.finance.walletPass({id:e,status:2,online:1}).then(function(e){200===e.code&&(t.$message.success(t.$t("tips.successOper")),t.getTableDataList())})})},confirmAccount:function(e){var t=this;this.$confirm(this.$t("tips.confirmOperate"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.$api.finance.walletPass({id:e,status:2,online:0}).then(function(e){200===e.code&&(t.$message.success(t.$t("tips.successOper")),t.getTableDataList())})})},refuseAccount:function(e){var t=this;this.$confirm("你确认要拒绝提现吗?",this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.$api.finance.walletNoPass({id:e,status:3}).then(function(e){200===e.code&&(t.$message.success(t.$t("tips.successOper")),t.getTableDataList())})})}},filters:{handleTime:function(e,t){return 1===t?o()(1e3*e).format("YYYY-MM-DD"):2===t?o()(1e3*e).format("HH:mm:ss"):o()(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},u={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-finance-record"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"申请人",prop:"type"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.type,callback:function(t){e.$set(e.searchForm,"type",t)},expression:"searchForm.type"}},e._l(e.userOptions,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"状态",prop:"status"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.status,callback:function(t){e.$set(e.searchForm,"status",t)},expression:"searchForm.status"}},e._l(e.statusOptions,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"提现号",prop:"order_code"}},[a("el-input",{attrs:{placeholder:"请输入提现号"},model:{value:e.searchForm.order_code,callback:function(t){e.$set(e.searchForm,"order_code",t)},expression:"searchForm.order_code"}})],1),e._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1)}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("searchForm")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1)],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"id",label:"ID",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{prop:"nickName",label:"姓名"}}),e._v(" "),a("el-table-column",{attrs:{prop:"type",label:"申请人"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-tag",{attrs:{type:e.userType[t.row.type].type}},[e._v(e._s(e.userType[t.row.type].text))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"order_code",label:"提现号",width:"150"}}),e._v(" "),a("el-table-column",{attrs:{prop:"text",label:"提现备注","min-width":"300"}}),e._v(" "),a("el-table-column",{attrs:{prop:"pay_price",label:"申请金额"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.pay_price)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"true_price",label:"到账金额(不包含手续费)",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.true_price)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"service_cash",label:"手续费"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.service_cash)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"balance",label:"抽成比例"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.balance+"%")+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"status",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.statusType[t.row.status])+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"create_time",label:"申请时间",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("p",[e._v(e._s(e._f("handleTime")(t.row.create_time,1)))]),e._v(" "),a("p",[e._v(e._s(e._f("handleTime")(t.row.create_time,2)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"处理时间",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.status>1?a("div",[a("p",[e._v(e._s(e._f("handleTime")(t.row.sh_time,1)))]),e._v(" "),a("p",[e._v(e._s(e._f("handleTime")(t.row.sh_time,2)))])]):e._e()]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"220"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"table-operate"},[1===t.row.status?a("block",[a("lb-button",{attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(a){return e.confirmWxCash(t.row.id)}}},[e._v("在线转账")]),e._v(" "),a("lb-button",{attrs:{size:"mini",plain:"",type:"success"},on:{click:function(a){return e.confirmAccount(t.row.id)}}},[e._v("线下转账")]),e._v(" "),a("lb-button",{attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(a){return e.refuseAccount(t.row.id)}}},[e._v("拒绝提现")])],1):e._e()],1)]}}])})],1),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}})],1)],1)},staticRenderFns:[]};var p=a("VU/8")(c,u,!1,function(e){a("Jj12")},"data-v-2564dccf",null);t.default=p.exports}}); \ No newline at end of file diff --git a/public/static/js/84.js b/public/static/js/84.js new file mode 100644 index 0000000..a4252b8 --- /dev/null +++ b/public/static/js/84.js @@ -0,0 +1 @@ +webpackJsonp([84],{hXFe:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("//Fk"),n=a.n(r),i=a("d7EF"),s=a.n(i),o=a("Xxa5"),l=a.n(o),c=a("exGp"),u=a.n(c),m={data:function(){return{loading:!1,base_farmer:[],searchForm:{page:1,limit:10,status:1,farmer_id:0,title:""},tableData:[],total:0,count:{}}},activated:function(){var e=this;return u()(l.a.mark(function t(){return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getBaseInfo();case 2:e.getTableDataList(1);case 3:case"end":return t.stop()}},t,e)}))()},methods:{getBaseInfo:function(){var e=this;return u()(l.a.mark(function t(){var a,r,i;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.a.all([e.$api.farmer.farmerSelectList()]);case 2:a=t.sent,r=s()(a,1),(i=r[0]).data.unshift({id:0,title:"全部"}),e.base_farmer=i.data;case 7:case"end":return t.stop()}},t,e)}))()},resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},toChange:function(e){var t=this;return u()(l.a.mark(function a(){return l.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:t.searchForm.status=e,t.getTableDataList(1);case 2:case"end":return a.stop()}},a,t)}))()},getTableDataList:function(e){var t=this;return u()(l.a.mark(function a(){var r,n,i,s,o,c,u;return l.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.land.landList(t.searchForm);case 4:if(r=a.sent,n=r.code,i=r.data,t.loading=!1,200===n){a.next=10;break}return a.abrupt("return");case 10:s=i.on_num,o=i.off_num,c=i.data,u=i.total,t.tableData=c,t.total=u,t.count={on:s,off:o};case 14:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return u()(l.a.mark(function r(){return l.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.land.landStatusUpdate({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page0&&void 0!==arguments[0]?arguments[0]:0)&&(this.subForm.cover=[{url:this.default_img}]),this.$refs.subForm.validate(function(t){if(t){var r=JSON.parse(s()(e.subForm));r.cover=r.cover[0].url,e.$api.market.signUpdate(r).then(function(t){200===t.code&&e.$message.success(e.$t("tips.successSub"))})}})}}},c={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-market-coupon-set"},[r("top-nav",{attrs:{isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"130px"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("el-form-item",{attrs:{label:"签到背景图",prop:"cover"}},[r("div",[r("lb-cover",{attrs:{fileList:e.subForm.cover},on:{selectedFiles:e.getCover}}),e._v(" "),r("lb-tool-tips",[e._v("图片建议尺寸: 750 * 532")])],1),e._v(" "),r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"danger"},on:{click:function(t){return e.submitFormInfo(1)}}},[e._v("恢复默认设置\n ")])],1),e._v(" "),r("el-form-item",{attrs:{label:"每签到1次可获得",prop:"integral"}},[r("el-input",{attrs:{placeholder:"请输入获得积分"},model:{value:e.subForm.integral,callback:function(t){e.$set(e.subForm,"integral",t)},expression:"subForm.integral"}},[r("template",{slot:"append"},[e._v("积分")])],2),e._v(" "),r("lb-tool-tips",[e._v("可连续累计积分,积分永久不清零")])],1),e._v(" "),r("el-form-item",{attrs:{label:"签到规则说明",prop:"text"}},[r("el-input",{attrs:{type:"textarea",rows:10,maxlength:"1000",resize:"none","show-word-limit":"",placeholder:"请输入签到规则说明"},model:{value:e.subForm.text,callback:function(t){e.$set(e.subForm,"text",t)},expression:"subForm.text"}})],1),e._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v(e._s(e.$t("action.submit")))])],1)],1)],1)],1)},staticRenderFns:[]};var m=r("VU/8")(u,c,!1,function(e){r("32V+")},"data-v-23ee83bc",null);t.default=m.exports}}); \ No newline at end of file diff --git a/public/static/js/87.js b/public/static/js/87.js new file mode 100644 index 0000000..32440f0 --- /dev/null +++ b/public/static/js/87.js @@ -0,0 +1 @@ +webpackJsonp([87],{"/bNQ":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Xxa5"),n=a.n(r),i=a("exGp"),s=a.n(i),o=a("Zz1P"),l=a.n(o),c={data:function(){return{loading:!1,searchForm:{page:1,limit:10,type:2,title:""},tableData:[],total:0}},activated:function(){this.getTableDataList(1)},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return s()(n.a.mark(function a(){var r,i,s;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.media.welfareList(t.searchForm);case 4:if(r=a.sent,i=r.code,s=r.data,t.loading=!1,200===i){a.next=10;break}return a.abrupt("return");case 10:t.tableData=s.data,t.total=s.total;case 12:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return s()(n.a.mark(function r(){return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.media.welfareUpdate({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page100)||2===o&&!s.test(n)){var c=s.test(r)?"取值范围不超过100":"最多2位小数";a(new Error(1===o?"请输入正确的百分比,"+c:"请输入正确的金额,"+c))}else a();else a(new Error("请输入"+u))},trigger:"blur"},top:{required:!0,type:"number",message:"请输入排序值",trigger:"blur"}}}},created:function(){var e=this;return n()(o.a.mark(function t(){var r;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.$route.query.id,t.next=3,e.getBaseInfo();case 3:r&&(e.subForm.id=r,e.getDetail(r)),e.navTitle=e.$t(r?"menu.StoredEdit":"menu.StoredAdd");case 5:case"end":return t.stop()}},t,e)}))()},methods:{getBaseInfo:function(){var e=this;return n()(o.a.mark(function t(){var r,a,s;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$api.custom.memberSelect();case 2:if(r=t.sent,a=r.code,s=r.data,200===a){t.next=7;break}return t.abrupt("return");case 7:e.base_level=s;case 8:case"end":return t.stop()}},t,e)}))()},getDetail:function(e){var t=this;return n()(o.a.mark(function r(){var a,s,l,i;return o.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.$api.stored.cardInfo({id:e});case 2:if(a=r.sent,s=a.code,l=a.data,200===s){r.next=7;break}return r.abrupt("return");case 7:for(i in l.member_level=0===l.member_level?"":l.member_level,t.subForm)t.subForm[i]=l[i];case 9:case"end":return r.stop()}},r,t)}))()},submitFormInfo:function(){var e=this,t=!0;if(this.$refs.subForm.validate(function(e){e||(t=!1)}),t){var r=JSON.parse(s()(this.subForm)),a=r.id?"cardUpdate":"cardAdd";this.$api.stored[a](r).then(function(t){200===t.code&&(e.$message.success(e.$t(r.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}}}},c={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-system-banner-edit"},[r("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",staticClass:"dialog-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"100px"}},[r("el-form-item",{attrs:{label:"套餐名称",prop:"title"}},[r("el-input",{attrs:{maxlength:"20","show-word-limit":"",placeholder:"请输入套餐名称"},model:{value:e.subForm.title,callback:function(t){e.$set(e.subForm,"title",t)},expression:"subForm.title"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"购买价格",prop:"price"}},[r("el-input-number",{staticClass:"lb-input-number",attrs:{controls:!1,precision:2,min:.01,placeholder:"请输入购买价格"},model:{value:e.subForm.price,callback:function(t){e.$set(e.subForm,"price",t)},expression:"subForm.price"}}),e._v(" "),r("lb-tool-tips",[e._v("用户所要支付的价格")])],1),e._v(" "),r("el-form-item",{attrs:{label:"实际充值",prop:"true_price"}},[r("el-input",{attrs:{placeholder:"请输入实际充值"},model:{value:e.subForm.true_price,callback:function(t){e.$set(e.subForm,"true_price",t)},expression:"subForm.true_price"}}),e._v(" "),r("lb-tool-tips",[e._v("实际充入到账金额")])],1),e._v(" "),r("el-form-item",{attrs:{label:"赠送积分",prop:"integral"}},[r("el-input",{attrs:{placeholder:"请输入赠送积分"},model:{value:e.subForm.integral,callback:function(t){e.$set(e.subForm,"integral",t)},expression:"subForm.integral"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"储值返佣",prop:"cash_type"}},[r("el-radio-group",{model:{value:e.subForm.cash_type,callback:function(t){e.$set(e.subForm,"cash_type",t)},expression:"subForm.cash_type"}},[r("el-radio",{attrs:{label:1}},[e._v("百分比返佣 ")]),e._v(" "),r("el-radio",{attrs:{label:2}},[e._v("固定金额提成")])],1),e._v(" "),r("div",[1===e.subForm.cash_type?r("el-input",{attrs:{placeholder:"请输入百分比"},model:{value:e.subForm.cash_balance,callback:function(t){e.$set(e.subForm,"cash_balance",t)},expression:"subForm.cash_balance"}},[r("template",{slot:"append"},[e._v("%")])],2):e._e(),e._v(" "),2===e.subForm.cash_type?r("el-input",{attrs:{placeholder:"请输入固定金额"},model:{value:e.subForm.cash,callback:function(t){e.$set(e.subForm,"cash",t)},expression:"subForm.cash"}},[r("template",{slot:"append"},[e._v("元")])],2):e._e()],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"关联会员",prop:"member_level"}},[r("el-select",{attrs:{filterable:"",clearable:"",placeholder:"请选择关联会员"},model:{value:e.subForm.member_level,callback:function(t){e.$set(e.subForm,"member_level",t)},expression:"subForm.member_level"}},e._l(e.base_level,function(e){return r("el-option",{key:e.title,attrs:{label:e.title,value:e.id}})}),1),e._v(" "),r("lb-tool-tips",[e._v("用户购买此储值套餐,则会自动成为该等级会员")])],1),e._v(" "),r("el-form-item",{attrs:{label:"排序值",prop:"top"}},[r("el-input-number",{staticClass:"lb-input-number",attrs:{controls:!1,precision:0,min:0,placeholder:"请输入排序值"},model:{value:e.subForm.top,callback:function(t){e.$set(e.subForm,"top",t)},expression:"subForm.top"}}),e._v(" "),r("lb-tool-tips",[e._v("值越大, 排序越靠前")])],1),e._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),r("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)],1)],1)},staticRenderFns:[]};var m=r("VU/8")(u,c,!1,function(e){r("F4Mg")},"data-v-1c5791dc",null);t.default=m.exports}}); \ No newline at end of file diff --git a/public/static/js/9.js b/public/static/js/9.js new file mode 100644 index 0000000..9dc6814 --- /dev/null +++ b/public/static/js/9.js @@ -0,0 +1 @@ +webpackJsonp([9],{"/Ynd":function(e,t){},"LMJ+":function(e,t){},LkP1:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Xxa5"),n=a.n(r),s=a("exGp"),i=a.n(s),l={data:function(){return{pickerOptions:{disabledDate:function(e){return e.getTime()>Date.now()}},base_farmer:[],base_type:[{id:0,title:"全部"},{id:1,title:"认养订单"},{id:2,title:"土地订单"}],sendOptions:[{label:"全部",value:0},{label:"自提",value:1},{label:"快递",value:2}],statusOptions:[{label:"全部",value:0},{label:"待配送",value:2},{label:"配送中",value:3},{label:"已完成",value:7},{label:"已取消",value:"-1"}],statusType:{"-1":"已取消",2:"待配送",3:"配送中",7:"已完成"},orderType:{1:"认养订单",2:"土地订单"},sendType:{1:"自提",2:"快递"},sendPayType:{1:{"-1":"已取消",2:"待提货",3:"已提货",7:"已完成"},2:{"-1":"已取消",2:"待配送",3:"配送中",7:"已完成"}},loading:!1,searchForm:{page:1,limit:10,send_type:0,pay_type:0,farmer_id:0,type:0},tableData:[],total:0}},activated:function(){var e=this;return i()(n.a.mark(function t(){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getBaseInfo();case 2:e.getTableDataList();case 3:case"end":return t.stop()}},t,e)}))()},methods:{getBaseInfo:function(){var e=this;return i()(n.a.mark(function t(){var a,r,s;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$api.farmer.farmerSelectList();case 2:if(a=t.sent,r=a.code,s=a.data,200===r){t.next=7;break}return t.abrupt("return");case 7:s.unshift({id:0,title:"全部"}),e.base_farmer=s;case 9:case"end":return t.stop()}},t,e)}))()},resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return i()(n.a.mark(function a(){var r,s,i,l,o;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a.next=4,t.$api.claim.sendOrderList(t.searchForm);case 4:if(r=a.sent,s=r.code,i=r.data,t.loading=!1,200===s){a.next=10;break}return a.abrupt("return");case 10:l=i.data,o=i.total,t.tableData=l,t.total=o;case 13:case"end":return a.stop()}},a,t)}))()},toSendOrder:function(e){var t=this,a=e.id,r=e.send_type;this.$confirm("你确认要"+(1===r?"取货":"发货")+"吗?",this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(a,r)}).catch(function(){})},updateItem:function(e,t){var a=this;return i()(n.a.mark(function r(){var s;return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:s=1===t?"sendOrderReceiving":"sendOrderSend",a.$api.claim[s]({id:e}).then(function(e){200===e.code?(a.$message.success(a.$t("tips.successOper")),a.getTableDataList()):a.getTableDataList()});case 2:case"end":return r.stop()}},r,a)}))()}},filters:{handleTime:function(e,t){return 1===t?moment(1e3*e).format("YYYY-MM-DD"):2===t?moment(1e3*e).format("HH:mm:ss"):3===t?moment(1e3*e).format("YYYY-MM-DD HH:mm"):4===t?moment(1e3*e).format("HH:mm"):moment(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},o={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-shop-order"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"农场",prop:"farmer_id"}},[a("el-select",{attrs:{filterable:"",placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.farmer_id,callback:function(t){e.$set(e.searchForm,"farmer_id",t)},expression:"searchForm.farmer_id"}},e._l(e.base_farmer,function(e){return a("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"配送方式",prop:"send_type"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.send_type,callback:function(t){e.$set(e.searchForm,"send_type",t)},expression:"searchForm.send_type"}},e._l(e.sendOptions,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"订单类型",prop:"type"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.type,callback:function(t){e.$set(e.searchForm,"type",t)},expression:"searchForm.type"}},e._l(e.base_type,function(e){return a("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"状态",prop:"pay_type"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.pay_type,callback:function(t){e.$set(e.searchForm,"pay_type",t)},expression:"searchForm.pay_type"}},e._l(e.statusOptions,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1)}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("searchForm")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1)],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"id",label:"ID",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{prop:"times",label:"配送次数","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("第"+t.row.times+"次"+(1===t.row.send_type?"自提":"配送"))+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"order_code",label:"配送单号","min-width":"140"}}),e._v(" "),a("el-table-column",{attrs:{prop:"send_time",label:"配送时间","min-width":"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v("\n "+e._s(e._f("handleTime")(t.row.start_time,1))+"\n "+e._s(e._f("handleTime")(t.row.start_time,4))+" ~\n "+e._s(e._f("handleTime")(t.row.end_time,4))+"\n ")])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"send_type",label:"配送方式"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.sendType[t.row.send_type])+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"address",label:"收货地址","min-width":"200"}}),e._v(" "),a("el-table-column",{attrs:{prop:"times",label:"收货人","min-width":"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.user_name+" "+t.row.mobile)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"status",label:"订单类型"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-tag",{attrs:{type:1===t.row.type?"primary":"danger"}},[e._v(e._s(e.orderType[t.row.type]))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"status",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.sendPayType[t.row.send_type][t.row.pay_type])+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"table-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-view",expression:"`${$route.name}-view`"}],attrs:{size:"mini",type:"primary",plain:""},on:{click:function(a){return e.$router.push("/order/distribution/detail?id="+t.row.id+"&type="+t.row.type)}}},[e._v(e._s(e.$t("action.view")))]),e._v(" "),a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-sendOrder",expression:"`${$route.name}-sendOrder`"},{name:"show",rawName:"v-show",value:2===t.row.pay_type,expression:"scope.row.pay_type === 2"}],attrs:{size:"mini",type:1===t.row.send_type?"danger":"success",plain:""},on:{click:function(a){return e.toSendOrder(t.row)}}},[e._v(e._s(1===t.row.send_type?"取货":"发货"))])],1)]}}])})],1),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}})],1)],1)},staticRenderFns:[]};var c=a("VU/8")(l,o,!1,function(e){a("/Ynd"),a("LMJ+")},"data-v-20fc065c",null);t.default=c.exports}}); \ No newline at end of file diff --git a/public/static/js/90.js b/public/static/js/90.js new file mode 100644 index 0000000..c64cbf7 --- /dev/null +++ b/public/static/js/90.js @@ -0,0 +1 @@ +webpackJsonp([90],{MMp4:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=o("mvHQ"),a=o.n(r),s=o("Xxa5"),i=o.n(s),n=o("exGp"),l=o.n(n),c={data:function(){return{navTitle:"",checkList:[],authList:[{title:"可叠加其他营销活动",key:"discount_add",tips:"勾选“可叠加其他营销活动”,使用积分时可使用卡券优惠;若不勾选“可叠加其他营销活动”,则该活动商品所选规格仅参与本活动优惠"}],checkPriceList:["所选规格可原价购买"],authPriceList:[{title:"所选规格可原价购买",key:"buy_limit"}],pickerOptions:{disabledDate:function(t){return t.getTime()1)){r.next=10;break}return r.abrupt("return");case 10:return r.next=12,o.getTableDataList(1,t);case 12:if(o.multipleSelection=[],o.showDialog[t]=!0,"spec"===t){r.next=16;break}return r.abrupt("return");case 16:a=[],o.subForm.goods_info.map(function(t){a.push(t.spe_id)}),o.tableData.spec.map(function(t){a.includes(t.spe_id)&&o.$nextTick(function(){o.$refs.multipleTable.toggleRowSelection(t,!0)})});case 19:case"end":return r.stop()}},r,o)}))()},resetForm:function(t){this.$refs[t+"Form"].resetFields(),this.getTableDataList(1,t)},handleSizeChange:function(t,e){this.searchForm[e].limit=t,this.handleCurrentChange(1,e)},handleCurrentChange:function(t,e){this.searchForm[e].page=t,this.getTableDataList("",e)},getTableDataList:function(t,e){var o=this;return l()(i.a.mark(function r(){var s,n,l,c,u,p,d,m;return i.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t&&(o.searchForm[e].page=1),o.loading[e]=!0,s=JSON.parse(a()(o.searchForm[e])),n=o.subForm.goods_id,"spec"===e&&(s.id=n),l={goods:{methodKey:"shop",methodModel:"goodsList"},spec:{methodKey:"shop",methodModel:"goodsInfo"}}[e],c=l.methodKey,u=l.methodModel,r.next=9,o.$api[c][u](s);case 9:if(p=r.sent,d=p.code,m=p.data,o.loading[e]=!1,200===d){r.next=15;break}return r.abrupt("return");case 15:"spec"===e&&(m.spe_info.price.map(function(t){t.spe_id=t.true_id,t.spe_name=t.title,t.goods_price=(1*t.price).toFixed(2),t.have_stock=0,t.price=(1*t.price).toFixed(2),t.stock=1*t.stock,t.goods_stock=t.stock,t.integral=.01,o.subForm.goods_info.map(function(e){e.spe_id===t.spe_id&&(t.have_stock=e.have_stock,t.price=e.price,t.stock=e.stock,t.integral=e.integral)})}),m.data=m.spe_info.price),o.tableData[e]=m.data,o.total[e]="spec"===e?0:m.total;case 18:case"end":return r.stop()}},r,o)}))()},toDelItem:function(t){this.atv_status>1||(this.subForm.goods_id=0,this.subForm.goods_name="",this.subForm.goods_info=[])},handleCurrentRow:function(t){this.currentRow=t},handleSelectionChange:function(t){this.multipleSelection=t},handleBatchSelectionChange:function(t){this.multipleBatchSelection=t},handleConfirm:function(t){var e=this,o=JSON.parse(a()(this.multipleSelection)),r=JSON.parse(a()(this.subForm)),s=r.id,i=r.goods_info;switch(t){case"goods":if(null===this.currentRow)return void this.$message.error("请选择活动商品");var n=this.currentRow,l=n.id,c=void 0===l?0:l,u=n.goods_name,p=n.all_stock;if(!c||!(void 0===p?0:p))return void this.$message.error(c?"此商品暂无库存,请选择其他商品":"请选择活动商品");this.subForm.goods_id=c,this.subForm.goods_name=u,this.currentRow={},i.length>0&&c!==i[0].goods_id&&(this.subForm.goods_info=[]);break;case"spec":if(!s&&i.length>0&&o.length<1)return void this.$confirm("当前无选择规格,请确认是否要清空选项?",this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){e.subForm.goods_info=[],e.showDialog[t]=!1}).catch(function(){});if(s&&o.length<1)return void this.$message.error("请选择商品规格");this.subForm.goods_info=o}this.showDialog[t]=!1},changeCheckBox:function(t,e){var o=this;this[e].map(function(e){o.subForm[e.key]=t.includes(e.title)?1:0})},submitFormInfo:function(t){var e=this;return l()(i.a.mark(function o(){var r,s,n,l,c,u,p,d,m,b,g,h,f,_,v,k,w;return i.a.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(r=!0,e.$refs[t+"Form"].validate(function(t){t||(r=!1)}),!r){o.next=35;break}if(s=JSON.parse(a()("sub"===t?e.subForm:e.batchForm)),n=JSON.parse(a()(e.subForm)),"sub"===t){o.next=12;break}return l=s.stock,c=s.integral,u=s.price,p=e.multipleBatchSelection.map(function(t){return t.spe_id}),n.goods_info.map(function(e){p.includes(e.spe_id)&&("stock"===t?e.stock=l:(e.integral=c,e.price=u))}),e.subForm=n,e.showDialog.batch=!1,o.abrupt("return");case 12:d=s.start_time,m=void 0===d?[]:d,s.start_time=m[0]/1e3,s.end_time=m[1]/1e3,o.t0=i.a.keys(s.goods_info);case 16:if((o.t1=o.t0()).done){o.next=31;break}if(b=o.t1.value,g=1*b+1,h=s.goods_info[b],f=h.have_stock,_=h.stock,v=h.price,k=h.integral,!(f>_)){o.next=23;break}return e.$message.error("商品规格 第"+g+"条数据:可兑换数量不能小于已兑换数量"),o.abrupt("return");case 23:if(/^(([0-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/.test(k)){o.next=26;break}return e.$message.error("商品规格 第"+g+"条数据:请输入兑换积分,最多保留2位小数"),o.abrupt("return");case 26:if(/^(([0-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/.test(v)){o.next=29;break}return e.$message.error("商品规格 第"+g+"条数据:请输入正确的兑换金额,最多保留2位小数"),o.abrupt("return");case 29:o.next=16;break;case 31:s.goods_info=s.goods_info.map(function(t){return{spe_id:t.spe_id,stock:t.stock,price:t.price,integral:t.integral}}),delete s.goods_name,w=s.id?"integralUpdate":"integralAdd",e.$api.market[w](s).then(function(t){200===t.code&&(e.$message.success(e.$t(s.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))});case 35:case"end":return o.stop()}},o,e)}))()}}},u={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"lb-market-integral-edit"},[o("top-nav",{attrs:{title:t.navTitle,isBack:!0}}),t._v(" "),o("div",{staticClass:"page-main"},[o("el-form",{ref:"subForm",attrs:{model:t.subForm,rules:t.subFormRules,"label-width":"120px"},nativeOn:{submit:function(t){t.preventDefault()}}},[o("el-form-item",{attrs:{label:"活动商品",prop:"goods_id"}},[o("el-tag",{staticStyle:{cursor:"pointer"},attrs:{type:t.atv_status>1?"info":"",closable:!!(t.subForm.goods_id&&t.atv_status<2)},on:{close:t.toDelItem,click:function(e){return t.toShowDialog("goods")}}},[t._v(t._s(t.subForm.goods_name||"请选择活动商品"))])],1),t._v(" "),t.subForm.goods_id?o("block",[o("el-form-item",{attrs:{label:"活动规格",prop:"goods_info"}},[o("el-tag",{staticStyle:{cursor:"pointer"},attrs:{type:t.atv_status>1?"info":""},on:{click:function(e){return t.toShowDialog("spec")}}},[t._v("选择商品规格")]),t._v(" "),o("el-table",{ref:"multipleTable",staticClass:"mt-lg",staticStyle:{width:"1000px"},attrs:{data:t.subForm.goods_info,"header-cell-style":{background:"#f5f7fa",color:"#606266"}},on:{"selection-change":t.handleBatchSelectionChange}},[o("el-table-column",{attrs:{type:"selection",width:"55"}}),t._v(" "),o("el-table-column",{attrs:{prop:"spe_name",label:"规格",width:"250"}}),t._v(" "),o("el-table-column",{attrs:{prop:"goods_stock",label:"库存"}}),t._v(" "),o("el-table-column",{attrs:{prop:"goods_price",label:"","min-width":"100"},scopedSlots:t._u([{key:"header",fn:function(e){return[o("div",[t._v("\n 原价"),o("lb-tool-tips",{attrs:{padding:"2"}},[t._v("这里是指商品现价")])],1)]}},{key:"default",fn:function(e){return[o("div",[t._v("¥"+t._s(e.row.goods_price))])]}}],null,!1,958371890)}),t._v(" "),o("el-table-column",{attrs:{prop:"have_stock",label:"已兑换数量",width:"100"}}),t._v(" "),o("el-table-column",{attrs:{prop:"stock",label:"可兑换数量",width:"140"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("el-input-number",{attrs:{disabled:t.atv_status>2,size:"small",precision:0,controls:!1,min:1},model:{value:e.row.stock,callback:function(o){t.$set(e.row,"stock",o)},expression:"scope.row.stock"}})]}}],null,!1,1410531383)}),t._v(" "),o("el-table-column",{attrs:{prop:"price",label:"兑换价",width:"300"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("div",{staticClass:"flex-y-center f-caption c-title"},[o("el-input-number",{attrs:{disabled:t.atv_status>2,size:"small",controls:!1,precision:2,min:.01},model:{value:e.row.integral,callback:function(o){t.$set(e.row,"integral",o)},expression:"scope.row.integral"}}),t._v(" "),o("div",{staticClass:"ml-sm mr-sm"},[t._v("积分 +")]),t._v(" "),o("el-input-number",{attrs:{disabled:t.atv_status>2,size:"small",controls:!1,precision:2,min:0,max:e.row.goods_price},model:{value:e.row.price,callback:function(o){t.$set(e.row,"price",o)},expression:"scope.row.price"}}),t._v(" "),o("div",{staticClass:"ml-sm"},[t._v("元")])],1)]}}],null,!1,431562664)})],1),t._v(" "),t.atv_status<3?o("lb-page",{attrs:{isShowPage:!1,selected:t.multipleSelection.length}},[o("lb-button",{attrs:{size:"mini",type:"primary"},on:{click:function(e){return t.toShowDialog("batch",1)}}},[t._v("兑换数量")]),t._v(" "),o("lb-button",{attrs:{size:"mini",type:"danger"},on:{click:function(e){return t.toShowDialog("batch",2)}}},[t._v("兑换价")])],1):t._e()],1)],1):t._e(),t._v(" "),o("el-form-item",{attrs:{label:"活动时间",prop:"start_time"}},[o("el-date-picker",{attrs:{type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","picker-options":t.pickerOptions,"value-format":"timestamp",disabled:t.atv_status>1},model:{value:t.subForm.start_time,callback:function(e){t.$set(t.subForm,"start_time",e)},expression:"subForm.start_time"}})],1),t._v(" "),o("el-form-item",{attrs:{label:"兑换限制",prop:"user_limit"}},[o("el-input",{attrs:{disabled:t.atv_status>2,placeholder:"请输入兑换限制数量"},model:{value:t.subForm.user_limit,callback:function(e){t.$set(t.subForm,"user_limit",e)},expression:"subForm.user_limit"}}),t._v(" "),o("block",[t._v(" 件/人")]),t._v(" "),o("lb-tool-tips",[t._v("每人参与兑换的数量")])],1),t._v(" "),o("el-form-item",{attrs:{label:"购买限制",prop:""}},[o("el-checkbox-group",{attrs:{disabled:t.atv_status>2},on:{change:function(e){return t.changeCheckBox(e,"authPriceList")}},model:{value:t.checkPriceList,callback:function(e){t.checkPriceList=e},expression:"checkPriceList"}},t._l(t.authPriceList,function(e,r){return o("div",{key:r,style:{display:"inline-block",marginLeft:0===r?0:"15px"}},[o("el-checkbox",{attrs:{label:e.title}}),t._v(" "),e.tips?o("lb-tool-tips",[t._v(t._s(e.tips))]):t._e()],1)}),0)],1),t._v(" "),o("el-form-item",{attrs:{label:"优惠叠加",prop:""}},[o("el-checkbox-group",{attrs:{disabled:t.atv_status>2},on:{change:function(e){return t.changeCheckBox(e,"authList")}},model:{value:t.checkList,callback:function(e){t.checkList=e},expression:"checkList"}},t._l(t.authList,function(e,r){return o("div",{key:r,style:{display:"inline-block",marginLeft:0===r?0:"15px"}},[o("el-checkbox",{attrs:{label:e.title}}),t._v(" "),e.tips?o("lb-tool-tips",[t._v(t._s(e.tips))]):t._e()],1)}),0)],1),t._v(" "),o("el-form-item",{attrs:{label:"活动标签",prop:"type"}},[o("el-radio-group",{model:{value:t.subForm.type,callback:function(e){t.$set(t.subForm,"type",e)},expression:"subForm.type"}},[o("el-radio",{attrs:{label:1}},[t._v("会员积分商品")]),t._v(" "),o("el-radio",{attrs:{label:2}},[t._v("非会员积分商品")])],1)],1),t._v(" "),o("el-form-item",[t.atv_status<3?o("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(e){return t.submitFormInfo("sub")}}},[t._v(t._s(t.$t("action.submit")))]):t._e(),t._v(" "),o("lb-button",{on:{click:function(e){return t.$router.back(-1)}}},[t._v(t._s(t.$t("action.back")))])],1)],1),t._v(" "),o("el-dialog",{attrs:{title:"选择活动商品",visible:t.showDialog.goods,width:"800px","close-on-click-modal":!1,"close-on-press-escape":!1,"append-to-body":!0,center:""},on:{"update:visible":function(e){return t.$set(t.showDialog,"goods",e)}}},[o("el-form",{ref:"goodsForm",attrs:{inline:!0,model:t.searchForm.goods},nativeOn:{submit:function(t){t.preventDefault()}}},[o("el-form-item",{attrs:{label:"输入查询",prop:"name"}},[o("el-input",{attrs:{placeholder:"请输入商品名称"},model:{value:t.searchForm.goods.name,callback:function(e){t.$set(t.searchForm.goods,"name",e)},expression:"searchForm.goods.name"}})],1),t._v(" "),o("el-form-item",[o("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(e){return t.getTableDataList(1,"goods")}}},[t._v(t._s(t.$t("action.search")))]),t._v(" "),o("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(e){return t.resetForm("goods")}}},[t._v(t._s(t.$t("action.reset")))])],1)],1),t._v(" "),o("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading.goods,expression:"loading.goods"}],ref:"singleTable",staticStyle:{width:"100%"},attrs:{data:t.tableData.goods,"highlight-current-row":""},on:{"current-change":t.handleCurrentRow}},[o("el-table-column",{attrs:{prop:"id",label:"ID"}}),t._v(" "),o("el-table-column",{attrs:{prop:"goods_name",label:"商品名称"}}),t._v(" "),o("el-table-column",{attrs:{prop:"cover",label:"封面图"},scopedSlots:t._u([{key:"default",fn:function(t){return[o("lb-image",{attrs:{src:t.row.cover}})]}}])}),t._v(" "),o("el-table-column",{attrs:{prop:"store_name",label:"所属店铺"}}),t._v(" "),o("el-table-column",{attrs:{prop:"show_price",label:"价格"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n ¥"+t._s(e.row.show_price)+"起\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{prop:"stock",label:"库存"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.all_stock>0?e.row.all_stock:"暂无库存")+"\n ")]}}])})],1),t._v(" "),o("lb-page",{attrs:{batch:!1,page:t.searchForm.goods.page,pageSize:t.searchForm.goods.limit,total:t.total.goods},on:{handleSizeChange:function(e){return t.handleSizeChange(e,"goods")},handleCurrentChange:function(e){return t.handleCurrentChange(e,"goods")}}}),t._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.showDialog.goods=!1}}},[t._v("取 消")]),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.handleConfirm("goods")}}},[t._v("确 定")])],1)],1),t._v(" "),o("el-dialog",{attrs:{title:"选择商品规格",visible:t.showDialog.spec,width:"800px","close-on-click-modal":!1,"close-on-press-escape":!1,"append-to-body":!0,center:""},on:{"update:visible":function(e){return t.$set(t.showDialog,"spec",e)}}},[o("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading.spec,expression:"loading.spec"}],ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:t.tableData.spec,"header-cell-style":{background:"#f5f7fa",color:"#606266"},"tooltip-effect":"dark"},on:{"selection-change":t.handleSelectionChange}},[o("el-table-column",{attrs:{type:"selection",width:"55"}}),t._v(" "),o("el-table-column",{attrs:{prop:"spe_name",label:"规格",width:"250"}}),t._v(" "),o("el-table-column",{attrs:{prop:"original_price",label:"原价"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("div",[t._v("¥"+t._s(e.row.original_price))])]}}])}),t._v(" "),o("el-table-column",{attrs:{prop:"price",label:"现价"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("div",[t._v("¥"+t._s(e.row.price))])]}}])}),t._v(" "),o("el-table-column",{attrs:{prop:"goods_stock",label:"库存"}})],1),t._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.showDialog.spec=!1}}},[t._v("取 消")]),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.handleConfirm("spec")}}},[t._v("确 定")])],1)],1),t._v(" "),o("el-dialog",{attrs:{title:1===t.dialogType?"批量设置兑换数量":"批量设置兑换价",visible:t.showDialog.batch,width:"500px",center:""},on:{"update:visible":function(e){return t.$set(t.showDialog,"batch",e)}}},[1===t.dialogType?o("el-form",{ref:"stockForm",staticClass:"dialog-form",attrs:{model:t.batchForm,rules:t.stockFormRules,"label-width":"100px"}},[o("el-form-item",{attrs:{label:"可兑换数量",prop:"stock"}},[o("el-input",{attrs:{placeholder:"请输入可兑换数量"},model:{value:t.batchForm.stock,callback:function(e){t.$set(t.batchForm,"stock",e)},expression:"batchForm.stock"}})],1)],1):t._e(),t._v(" "),2===t.dialogType?o("el-form",{ref:"priceForm",staticClass:"dialog-form",attrs:{model:t.batchForm,rules:t.priceFormRules,"label-width":"100px"}},[o("el-form-item",{attrs:{label:"积分",prop:"integral"}},[o("el-input",{attrs:{placeholder:"请输入积分"},model:{value:t.batchForm.integral,callback:function(e){t.$set(t.batchForm,"integral",e)},expression:"batchForm.integral"}})],1),t._v(" "),o("el-form-item",{attrs:{label:"价格",prop:"price"}},[o("el-input",{attrs:{placeholder:"请输入价格"},model:{value:t.batchForm.price,callback:function(e){t.$set(t.batchForm,"price",e)},expression:"batchForm.price"}},[o("template",{slot:"append"},[t._v("元")])],2)],1)],1):t._e(),t._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.showDialog.batch=!1}}},[t._v("取 消")]),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitFormInfo(1===t.dialogType?"stock":"price")}}},[t._v("确 定")])],1)],1)],1)],1)},staticRenderFns:[]};var p=o("VU/8")(c,u,!1,function(t){o("glsN")},"data-v-1aefdda4",null);e.default=p.exports},glsN:function(t,e){}}); \ No newline at end of file diff --git a/public/static/js/91.js b/public/static/js/91.js new file mode 100644 index 0000000..6f59016 --- /dev/null +++ b/public/static/js/91.js @@ -0,0 +1 @@ +webpackJsonp([91],{mHKU:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a("Xxa5"),r=a.n(n),i=a("exGp"),s=a.n(i),o={data:function(){return{sendType:{1:"活动派发",2:"用户领取"},loading:!1,searchForm:{page:1,limit:10,name:""},tableData:[],total:0}},activated:function(){this.getTableDataList(1)},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return s()(r.a.mark(function a(){var n,i,s,o;return r.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,n=t.searchForm,a.next=5,t.$api.market.couponList(n);case 5:if(i=a.sent,s=i.code,o=i.data,t.loading=!1,200===s){a.next=11;break}return a.abrupt("return");case 11:t.tableData=o.data,t.total=o.total;case 13:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)}).catch(function(){})},updateItem:function(e,t){var a=this;return s()(r.a.mark(function n(){return r.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:a.$api.market.couponUpdate({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page0?1*i.text_id:"",t.subForm)t.subForm[s]=i[s];case 10:case"end":return r.stop()}},r,t)}))()},submitFormInfo:function(){var e=this,t=!0;if(this.$refs.subForm.validate(function(e){e||(t=!1)}),t){var r=JSON.parse(n()(this.subForm));r.img=r.img[0].url;var a=r.id?"bannerUpdate":"bannerAdd";this.$api.media[a](r).then(function(t){200===t.code&&(e.$message.success(e.$t(r.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}}}},d={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-system-banner-edit"},[r("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"130px"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("el-form-item",{attrs:{label:"图片",prop:"img"}},[r("lb-cover",{attrs:{fileList:e.subForm.img},on:{selectedFiles:e.getCover}}),e._v(" "),r("lb-tool-tips",[e._v("图片建议尺寸:710 * 286")])],1),e._v(" "),r("el-form-item",{attrs:{label:"关联内容",prop:"connect_type"}},[r("el-radio-group",{attrs:{disabled:e.subForm.id},on:{change:function(t){e.subForm.text_id=""}},model:{value:e.subForm.connect_type,callback:function(t){e.$set(e.subForm,"connect_type",t)},expression:"subForm.connect_type"}},[r("el-radio",{attrs:{label:1}},[e._v("农场")]),e._v(" "),r("el-radio",{attrs:{label:2}},[e._v("文章")]),e._v(" "),r("el-radio",{attrs:{label:3}},[e._v("查看大图")])],1)],1),e._v(" "),3!==e.subForm.connect_type?r("el-form-item",{attrs:{label:"",prop:"text_id"}},[r("el-select",{attrs:{filterable:"",placeholder:"请选择"+e.typeText[e.subForm.connect_type]},model:{value:e.subForm.text_id,callback:function(t){e.$set(e.subForm,"text_id",t)},expression:"subForm.text_id"}},e._l(1===e.subForm.connect_type?e.base_farmer:e.base_article,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"排序值",prop:"top"}},[r("el-input-number",{staticClass:"lb-input-number",attrs:{controls:!1,precision:0,min:0,placeholder:"请输入排序值"},model:{value:e.subForm.top,callback:function(t){e.$set(e.subForm,"top",t)},expression:"subForm.top"}}),e._v(" "),r("lb-tool-tips",[e._v("值越大, 排序越靠前")])],1),e._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),r("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)],1)],1)},staticRenderFns:[]};var v=r("VU/8")(p,d,!1,function(e){r("mk3H")},"data-v-17f2bc05",null);t.default=v.exports},mk3H:function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/94.js b/public/static/js/94.js new file mode 100644 index 0000000..a036067 --- /dev/null +++ b/public/static/js/94.js @@ -0,0 +1 @@ +webpackJsonp([94],{CRZ6:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s("Xxa5"),a=s.n(r),n=s("exGp"),o=s.n(n),i={data:function(){return{subForm:{ys_appkey:"",ys_secret:""},subFormRules:{ys_appkey:{required:!0,type:"string",message:"请输入萤石AppKey",trigger:"blur"},ys_secret:{required:!0,type:"string",message:"请输入萤石Secret",trigger:"blur"}}}},created:function(){this.getFormInfo()},methods:{getFormInfo:function(){var e=this;return o()(a.a.mark(function t(){var s,r,n,o;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$api.system.configInfo();case 2:if(s=t.sent,r=s.code,n=s.data,200===r){t.next=7;break}return t.abrupt("return");case 7:for(o in e.subForm)e.subForm[o]=n[o];case 8:case"end":return t.stop()}},t,e)}))()},submitFormInfo:function(){var e=this;this.$refs.subForm.validate(function(t){if(t){var s=e.subForm;e.$api.system.configUpdate(s).then(function(t){200===t.code&&e.$message.success(e.$t("tips.successSub"))})}})}}},c={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"lb-system-wechat"},[s("top-nav"),e._v(" "),s("div",{staticClass:"page-main"},[s("el-form",{ref:"subForm",staticClass:"config-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"120px"},nativeOn:{submit:function(e){e.preventDefault()}}},[s("el-form-item",{attrs:{label:"AppKey",prop:"ys_appkey"}},[s("el-input",{attrs:{placeholder:"请输入萤石AppKey"},model:{value:e.subForm.ys_appkey,callback:function(t){e.$set(e.subForm,"ys_appkey",t)},expression:"subForm.ys_appkey"}}),e._v(" "),s("lb-tool-tips",[e._v("请输入萤石AppKey,填写错误会影响视频监控的正常使用,谨慎修改")])],1),e._v(" "),s("el-form-item",{attrs:{label:"Secret",prop:"ys_secret"}},[s("el-input",{attrs:{placeholder:"请输入萤石Secret"},model:{value:e.subForm.ys_secret,callback:function(t){e.$set(e.subForm,"ys_secret",t)},expression:"subForm.ys_secret"}}),e._v(" "),s("lb-tool-tips",[e._v("请输入萤石Secret,填写错误会影响视频监控的正常使用,谨慎修改")])],1),e._v(" "),s("el-form-item",[s("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v(e._s(e.$t("action.submit")))])],1)],1)],1)],1)},staticRenderFns:[]};var u=s("VU/8")(i,c,!1,function(e){s("cTTx")},"data-v-176841c8",null);t.default=u.exports},cTTx:function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/95.js b/public/static/js/95.js new file mode 100644 index 0000000..a61232f --- /dev/null +++ b/public/static/js/95.js @@ -0,0 +1 @@ +webpackJsonp([95],{DSrI:function(t,e){},IqjV:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=a("sE1n"),r=(a("Vb+l"),a("LbEf"),a("Oq2I"),a("80cc"),a("4UDB"),{props:{datas:{type:Array,default:function(){return[]}}},data:function(){return{isEmpty:!1,echartsOptions:{color:["#00DDFF","#37A2FF","#FF0087"],title:{text:"平台实时交易情况"},legend:{top:20,data:["商城","土地","认养"]},tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}}},xAxis:[{type:"category",boundaryGap:!1,data:[]}],yAxis:[{type:"value"}],series:[{name:"商城",type:"line",stack:"总量",smooth:!0,areaStyle:{color:new s.a.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(0, 221, 255)"},{offset:1,color:"rgba(77, 119, 255)"}])},emphasis:{focus:"series"},data:[]},{name:"土地",type:"line",stack:"总量",smooth:!0,areaStyle:{color:new s.a.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(55, 162, 255)"},{offset:1,color:"rgba(116, 21, 219)"}])},emphasis:{focus:"series"},data:[]},{name:"认养",type:"line",stack:"总量",smooth:!0,areaStyle:{color:new s.a.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(255, 0, 135)"},{offset:1,color:"rgba(135, 0, 157)"}])},emphasis:{focus:"series"},data:[]}]}}},components:{ECharts:s.a},created:function(){this.datas.length&&this.handleDatas(this.datas)},mounted:function(){window.addEventListener("resize",this.loadEcharts)},methods:{handleDatas:function(t){this.echartsOptions.series[0].data=t.map(function(t){return t.shop_cash||0}),this.echartsOptions.series[1].data=t.map(function(t){return t.land_cash||0}),this.echartsOptions.series[2].data=t.map(function(t){return t.claim_cash||0}),this.echartsOptions.xAxis[0].data=t.map(function(t){return t.date})},loadEcharts:function(){var t=this;this.$refs.myecharts&&setTimeout(function(){t.$refs.myecharts.resize()},10)}},watch:{datas:function(t){t.length?(this.isEmpty=!1,this.handleDatas(t)):this.isEmpty=!0}},destroyed:function(){window.removeEventListener("resize",this.loadEcharts)}}),i={render:function(){var t=this.$createElement,e=this._self._c||t;return this.isEmpty?e("div",{staticClass:"empty"},[this._v("暂无数据")]):e("e-charts",{ref:"myecharts",attrs:{id:"count-echarts",theme:"ovilia-green",options:this.echartsOptions}})},staticRenderFns:[]};var n=a("VU/8")(r,i,!1,function(t){a("DSrI")},"data-v-136691b0",null);e.default=n.exports}}); \ No newline at end of file diff --git a/public/static/js/96.js b/public/static/js/96.js new file mode 100644 index 0000000..e49d417 --- /dev/null +++ b/public/static/js/96.js @@ -0,0 +1 @@ +webpackJsonp([96],{VpBL:function(e,r){},eXm2:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=t("mvHQ"),i=t.n(a),s=t("Xxa5"),n=t.n(s),o=t("exGp"),l=t.n(o),u={data:function(){return{id:"",navTitle:"",base_farmer:[],subForm:{id:0,title:"",cover:[],deviceSerial:"",channelNo:"",farmer_id:""},subFormRules:{title:{required:!0,validator:this.$reg.isNoEmpty,text:"监控名称",reg_type:2,trigger:"blur"},cover:{required:!0,type:"array",message:"请上传封面图",trigger:"blur"},deviceSerial:{required:!0,type:"string",message:"请输入设备序列号",trigger:"blur"},channelNo:{required:!0,type:"string",message:"请输入通道号",trigger:"blur"},farmer_id:{required:!0,type:"number",message:"请选择所属农场",trigger:"blur"}}}},created:function(){var e=this;return l()(n.a.mark(function r(){var t;return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.getBaseInfo();case 2:(t=e.$route.query.id)&&(e.subForm.id=t,e.getDetail(t)),e.navTitle=e.$t(t?"menu.HardwareMonitorEdit":"menu.HardwareMonitorAdd");case 5:case"end":return r.stop()}},r,e)}))()},methods:{getBaseInfo:function(){var e=this;return l()(n.a.mark(function r(){var t,a,i;return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.$api.farmer.farmerSelectList();case 2:if(t=r.sent,a=t.code,i=t.data,200===a){r.next=7;break}return r.abrupt("return");case 7:e.base_farmer=i;case 8:case"end":return r.stop()}},r,e)}))()},getCover:function(e){this.subForm.cover=e},getDetail:function(e){var r=this;return l()(n.a.mark(function t(){var a,i,s,o;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.$api.hardware.monitorInfo({id:e});case 2:if(a=t.sent,i=a.code,s=a.data,200===i){t.next=7;break}return t.abrupt("return");case 7:for(o in s.cover=[{url:s.cover}],r.subForm)r.subForm[o]=s[o];case 9:case"end":return t.stop()}},t,r)}))()},submitFormInfo:function(){var e=this,r=!0;if(this.$refs.subForm.validate(function(e){e||(r=!1)}),r){var t=JSON.parse(i()(this.subForm));t.cover=t.cover[0].url;var a=t.id?"monitorUpdate":"monitorAdd";this.$api.hardware[a](t).then(function(r){200===r.code&&(e.$message.success(e.$t(t.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}}}},c={render:function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("div",{staticClass:"lb-system-banner-edit"},[t("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),t("div",{staticClass:"page-main"},[t("el-form",{ref:"subForm",staticClass:"dialog-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"100px"}},[t("el-form-item",{attrs:{label:"监控名称",prop:"title"}},[t("el-input",{attrs:{maxlength:"20","show-word-limit":"",placeholder:"请输入监控名称"},model:{value:e.subForm.title,callback:function(r){e.$set(e.subForm,"title",r)},expression:"subForm.title"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"封面图",prop:"cover"}},[t("lb-cover",{attrs:{fileList:e.subForm.cover},on:{selectedFiles:e.getCover}}),e._v(" "),t("lb-tool-tips",[e._v("图片建议尺寸:690 * 380")])],1),e._v(" "),t("el-form-item",{attrs:{label:"设备序列号",prop:"deviceSerial"}},[t("el-input",{attrs:{maxlength:"20","show-word-limit":"",placeholder:"请输入设备序列号"},model:{value:e.subForm.deviceSerial,callback:function(r){e.$set(e.subForm,"deviceSerial",r)},expression:"subForm.deviceSerial"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"通道号",prop:"channelNo"}},[t("el-input",{attrs:{placeholder:"请输入通道号"},model:{value:e.subForm.channelNo,callback:function(r){e.$set(e.subForm,"channelNo",r)},expression:"subForm.channelNo"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"所属农场",prop:"farmer_id"}},[t("el-select",{attrs:{filterable:"","collapse-tags":"",placeholder:"请选择所属农场"},model:{value:e.subForm.farmer_id,callback:function(r){e.$set(e.subForm,"farmer_id",r)},expression:"subForm.farmer_id"}},e._l(e.base_farmer,function(e){return t("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),t("el-form-item",[t("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),t("lb-button",{on:{click:function(r){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)],1)],1)},staticRenderFns:[]};var m=t("VU/8")(u,c,!1,function(e){t("VpBL")},"data-v-1226de7f",null);r.default=m.exports}}); \ No newline at end of file diff --git a/public/static/js/97.js b/public/static/js/97.js new file mode 100644 index 0000000..342aef3 --- /dev/null +++ b/public/static/js/97.js @@ -0,0 +1 @@ +webpackJsonp([97],{LjsJ:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r("Xxa5"),s=r.n(a),n=r("exGp"),l=r.n(n),i={data:function(){return{loading:!1,navTitle:"",statusType:{"-1":"已取消",1:"待支付",2:"租赁中",7:"已完成"},payType:{1:"微信支付",2:"余额支付",3:"支付宝支付"},sendType:{1:"自提",2:"快递"},sendPayType:{1:{"-1":"已取消",2:"待提货",3:"已提货",7:"已完成"},2:{"-1":"已取消",2:"待配送",3:"配送中",7:"已完成"}},subForm:{id:0},searchForm:{page:1,limit:10},tableData:[],total:0,showDialog:!1,progress:[]}},created:function(){var e=this;return l()(s.a.mark(function t(){var r;return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.$route.query.id,e.subForm.id=r,e.searchForm.land_order_id=r,t.next=5,e.getDetail();case 5:case"end":return t.stop()}},t,e)}))()},methods:{getDetail:function(){var e=this;return l()(s.a.mark(function t(){var r,a,n,l;return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.subForm.id,t.next=3,e.$api.land.orderInfo({id:r});case 3:if(a=t.sent,n=a.code,l=a.data,200===n){t.next=8;break}return t.abrupt("return");case 8:return e.subForm=l,t.next=11,e.getTableDataList();case 11:case"end":return t.stop()}},t,e)}))()},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return l()(s.a.mark(function r(){var a,n,l,i,o;return s.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,r.next=4,t.$api.land.userSendOrderList(t.searchForm);case 4:if(a=r.sent,n=a.code,l=a.data,t.loading=!1,200===n){r.next=10;break}return r.abrupt("return");case 10:i=l.data,o=l.total,t.tableData=i,t.total=o;case 13:case"end":return r.stop()}},r,t)}))()},toShowDialog:function(e){var t=this;return l()(s.a.mark(function r(){return s.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:t.progress=e,t.showDialog=!t.showDialog;case 2:case"end":return r.stop()}},r,t)}))()},toSendOrder:function(e){var t=this,r=e.id,a=e.send_type;this.$confirm("你确认要"+(1===a?"取货":"发货")+"吗?",this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(r,a)}).catch(function(){})},updateItem:function(e,t){var r=this;return l()(s.a.mark(function a(){var n;return s.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:n=1===t?"sendOrderReceiving":"sendOrderSend",r.$api.claim[n]({id:e}).then(function(e){200===e.code?(r.$message.success(r.$t("tips.successOper")),r.getTableDataList()):r.getTableDataList()});case 2:case"end":return a.stop()}},a,r)}))()}},watch:{$route:function(e){var t=this;return l()(s.a.mark(function r(){var a,n;return s.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a=e.query.id,1*(n=void 0===a?0:a)!==t.subForm.id&&t.getDetail(n);case 2:case"end":return r.stop()}},r,t)}))()}},filters:{handleTime:function(e,t){return 1===t?moment(1e3*e).format("YYYY-MM-DD"):2===t?moment(1e3*e).format("HH:mm:ss"):3===t?moment(1e3*e).format("YYYY-MM-DD HH:mm"):4===t?moment(1e3*e).format("HH:mm"):moment(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},o={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-shop-order-edit"},[r("top-nav",{attrs:{isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{attrs:{model:e.subForm,"label-width":"130px",size:"mini"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("lb-classify-title",{attrs:{title:"用户信息"}}),e._v(" "),r("el-form-item",{attrs:{label:"用户ID:"}},[r("div",[e._v(e._s(e.subForm.user_id))])]),e._v(" "),r("el-form-item",{attrs:{label:"下单人:"}},[r("div",[e._v(e._s(e.subForm.address_info.user_name))])]),e._v(" "),r("el-form-item",{attrs:{label:"下单手机号:"}},[r("div",[e._v(e._s(e.subForm.address_info.mobile))])]),e._v(" "),r("lb-classify-title",{attrs:{title:"租赁人信息"}}),e._v(" "),r("el-form-item",{attrs:{label:"租赁人:"}},[r("div",[e._v(e._s(e.subForm.rent_user_name))])]),e._v(" "),r("el-form-item",{attrs:{label:"租赁人手机号:"}},[r("div",[e._v(e._s(e.subForm.rent_mobile))])]),e._v(" "),r("lb-classify-title",{attrs:{title:"订单信息"}}),e._v(" "),r("el-form-item",{attrs:{label:"订单状态:"}},[r("div",[e._v(e._s(e.statusType[e.subForm.pay_type]))])]),e._v(" "),r("el-form-item",{attrs:{label:"系统订单号:"}},[r("div",[e._v(e._s(e.subForm.order_code))])]),e._v(" "),e.subForm.transaction_id?r("el-form-item",{attrs:{label:"付款订单号:"}},[r("div",[e._v(e._s(e.subForm.transaction_id))])]):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"下单时间:"}},[r("div",[e._v(e._s(e._f("handleTime")(e.subForm.create_time)))])]),e._v(" "),e.subForm.pay_time?r("el-form-item",{attrs:{label:"支付时间:"}},[r("div",[e._v(e._s(e._f("handleTime")(e.subForm.pay_time)))])]):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"土地价格:"}},[r("div",[e._v("\n "+e._s("¥"+e.subForm.land_price)+"\n ")])]),e._v(" "),r("el-form-item",{attrs:{label:"服务价格:"}},[r("div",[e._v("\n "+e._s("¥"+e.subForm.total_massif_price)+"\n ")])]),e._v(" "),e.subForm.seed.length>0?r("el-form-item",{attrs:{label:"种子价格:"}},[r("div",[e._v("\n "+e._s("¥"+e.subForm.seed_price)+"\n ")])]):e._e(),e._v(" "),1*e.subForm.discount>0?r("el-form-item",{attrs:{label:"卡券优惠:"}},[r("div",{staticClass:"c-warning"},[e._v("\n "+e._s("-¥"+e.subForm.discount)+"\n ")])]):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"实付金额:"}},[r("div",{staticClass:"c-warning"},[e._v("\n "+e._s("¥"+e.subForm.pay_price)+"\n ")])]),e._v(" "),r("el-form-item",{attrs:{label:"支付方式:"}},[r("div",[e._v(e._s(e.payType[e.subForm.pay_model]))])]),e._v(" "),e.subForm.text?r("el-form-item",{attrs:{label:"订单备注:"}},[r("div",{domProps:{innerHTML:e._s(e.subForm.text)}})]):e._e(),e._v(" "),r("lb-classify-title",{attrs:{title:"农场信息"}}),e._v(" "),r("el-form-item",{attrs:{label:"农场名称:"}},[r("div",[e._v(e._s(e.subForm.farmer_info.title))])]),e._v(" "),r("el-form-item",{attrs:{label:"农场头像:"}},[r("div",[r("lb-cover",{attrs:{fileList:[{url:e.subForm.farmer_info.cover}],isToDel:!1,type:"more",size:"small",fileSize:1}})],1)]),e._v(" "),r("el-form-item",{attrs:{label:"农场地址:"}},[r("div",[e._v(e._s(e.subForm.farmer_info.address))]),e._v(" "),r("div",[e._v("\n "+e._s(e.subForm.farmer_info.user_name+" "+e.subForm.farmer_info.mobile)+"\n ")])]),e._v(" "),r("lb-classify-title",{attrs:{title:"土地信息"}}),e._v(" "),r("el-table",{staticStyle:{width:"100%"},attrs:{data:[e.subForm],"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[r("el-table-column",{attrs:{prop:"goods_cover",label:"土地图片"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("lb-image",{attrs:{src:e.row.goods_cover}})]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"goods_name",label:"土地名称"}}),e._v(" "),r("el-table-column",{attrs:{prop:"area",label:"土地面积"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.subForm.area+"m²")+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"massif_title",label:"服务类型"}}),e._v(" "),r("el-table-column",{attrs:{prop:"cycle",label:"租赁周期"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.subForm.cycle+"天")+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"end_time",label:"到期时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("handleTime")(e.subForm.end_time))+"\n ")]}}])})],1),e._v(" "),r("div",{staticClass:"space-lg"}),e._v(" "),r("div",{staticClass:"space-lg"})],1),e._v(" "),r("lb-classify-title",{attrs:{title:"种子管理"}}),e._v(" "),r("el-table",{staticStyle:{width:"100%"},attrs:{data:e.subForm.seed,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[r("el-table-column",{attrs:{prop:"imgs",label:"种子图片"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("lb-image",{attrs:{src:e.row.imgs}})]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"title",label:"种子名称"}}),e._v(" "),r("el-table-column",{attrs:{prop:"area",label:"种植面积"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.area+"m²")+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"seed_price",label:"价格"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("¥"+t.row.seed_price)+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"num",label:"数量"}}),e._v(" "),r("el-table-column",{attrs:{prop:"",label:"溯源信息"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("lb-button",{attrs:{size:"mini",type:"primary",plain:""},on:{click:function(r){return e.toShowDialog(t.row.source.stage)}}},[e._v(e._s(e.$t("action.view")))])]}}])})],1),e._v(" "),r("div",{staticClass:"space-lg"}),e._v(" "),r("div",{staticClass:"space-lg"}),e._v(" "),r("lb-classify-title",{attrs:{title:"配送信息"}}),e._v(" "),r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[r("el-table-column",{attrs:{prop:"id",label:"ID",fixed:""}}),e._v(" "),r("el-table-column",{attrs:{prop:"times",label:"配送次数","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("第"+t.row.times+"次"+(1===t.row.send_type?"自提":"配送"))+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"order_code",label:"配送单号","min-width":"140"}}),e._v(" "),r("el-table-column",{attrs:{prop:"send_time",label:"配送时间","min-width":"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.time_text)+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"send_type",label:"配送方式"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.sendType[t.row.send_type])+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"address",label:"收货地址","min-width":"200"}}),e._v(" "),r("el-table-column",{attrs:{prop:"times",label:"收货人","min-width":"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.user_name+" "+t.row.mobile)+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"status",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.sendPayType[t.row.send_type][t.row.pay_type])+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"操作","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("div",{staticClass:"table-operate"},[r("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:"OrderDistribution-view",expression:"`OrderDistribution-view`"}],attrs:{size:"mini",type:"primary",plain:""},on:{click:function(r){return e.$router.push("/order/distribution/detail?id="+t.row.id+"&type="+t.row.type)}}},[e._v(e._s(e.$t("action.view")))]),e._v(" "),r("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:"OrderLand-sendOrder",expression:"`OrderLand-sendOrder`"},{name:"show",rawName:"v-show",value:2===t.row.pay_type,expression:"scope.row.pay_type === 2"}],attrs:{size:"mini",type:1===t.row.send_type?"danger":"success",plain:""},on:{click:function(r){return e.toSendOrder(t.row)}}},[e._v(e._s(1===t.row.send_type?"取货":"发货"))])],1)]}}])})],1),e._v(" "),r("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}}),e._v(" "),r("lb-button",{attrs:{type:"primary"},on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1),e._v(" "),r("el-dialog",{attrs:{title:"溯源信息",visible:e.showDialog,width:"600px",center:""},on:{"update:visible":function(t){e.showDialog=t}}},[r("el-timeline",e._l(e.progress,function(t,a){return r("el-timeline-item",{key:a},[r("div",[r("div",{staticClass:"f-desc text-bold c-title"},[e._v(e._s(t.stage))]),e._v(" "),r("div",{staticClass:"f-caption c-caption"},[e._v(e._s(t.time_text))]),e._v(" "),r("lb-cover",{attrs:{fileList:[{url:t.cover}],isToDel:!1,size:"small",type:"more",fileSize:1}})],1)])}),1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.showDialog=!1}}},[e._v("知道了")])],1)],1)],1)},staticRenderFns:[]};var u=r("VU/8")(i,o,!1,function(e){r("SAho")},"data-v-0f834bf6",null);t.default=u.exports},SAho:function(e,t){}}); \ No newline at end of file diff --git a/public/static/js/98.js b/public/static/js/98.js new file mode 100644 index 0000000..670292f --- /dev/null +++ b/public/static/js/98.js @@ -0,0 +1 @@ +webpackJsonp([98],{EpDb:function(t,e){},V21k:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=r("Xxa5"),o=r.n(a),i=r("exGp"),s=r.n(i),n={data:function(){return{subForm:{over_time:"",can_tx_time:"",auto_hx_time:""},subFormRules:{over_time:{required:!0,validator:this.$reg.valiDateInt,text:"订单超时分钟",trigger:"blur"},can_tx_time:{required:!0,validator:this.$reg.valiDateInt,text:"可退款时间",trigger:"blur"},auto_hx_time:{required:!0,validator:this.$reg.valiDateInt,text:"自动收货时间",trigger:"blur"}}}},created:function(){this.getFormInfo()},methods:{getFormInfo:function(){var t=this;return s()(o.a.mark(function e(){var r,a,i,s;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$api.system.configInfo();case 2:if(r=e.sent,a=r.code,i=r.data,200===a){e.next=7;break}return e.abrupt("return");case 7:for(s in t.subForm)t.subForm[s]=i[s];case 8:case"end":return e.stop()}},e,t)}))()},submitFormInfo:function(){var t=this;this.$refs.subForm.validate(function(e){if(e){var r=t.subForm;t.$api.system.configUpdate(r).then(function(e){200===e.code&&t.$message.success(t.$t("tips.successSub"))})}})}}},u={render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"lb-system-transaction"},[r("top-nav"),t._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",attrs:{model:t.subForm,rules:t.subFormRules,"label-width":"120px"},nativeOn:{submit:function(t){t.preventDefault()}}},[r("el-form-item",{attrs:{label:"订单超时",prop:"over_time"}},[r("el-input",{attrs:{placeholder:"请输入订单超时分钟"},model:{value:t.subForm.over_time,callback:function(e){t.$set(t.subForm,"over_time",t._n(e))},expression:"subForm.over_time"}},[r("template",{slot:"append"},[t._v("分钟")])],2),t._v(" "),r("lb-tool-tips",[t._v("订单未支付超时时间,超时将自动取消订单,单位:分钟")])],1),t._v(" "),r("el-form-item",{attrs:{label:"可退款时间",prop:"can_tx_time"}},[r("el-input",{attrs:{placeholder:"请输入可退款时间"},model:{value:t.subForm.can_tx_time,callback:function(e){t.$set(t.subForm,"can_tx_time",t._n(e))},expression:"subForm.can_tx_time"}},[r("template",{slot:"append"},[t._v("小时")])],2),t._v(" "),r("lb-tool-tips",[t._v("订单可发起退款的时间,从订单完成之后计算可退款时间")])],1),t._v(" "),r("el-form-item",{attrs:{label:"自动收货时间",prop:"auto_hx_time"}},[r("el-input",{attrs:{placeholder:"请输入自动收货时间"},model:{value:t.subForm.auto_hx_time,callback:function(e){t.$set(t.subForm,"auto_hx_time",t._n(e))},expression:"subForm.auto_hx_time"}},[r("template",{slot:"append"},[t._v("天")])],2),t._v(" "),r("lb-tool-tips",[t._v("订单自动收货时间,从订单发货之后计算,超过则自动收货")])],1),t._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:t.submitFormInfo}},[t._v(t._s(t.$t("action.submit")))])],1)],1)],1)],1)},staticRenderFns:[]};var l=r("VU/8")(n,u,!1,function(t){r("EpDb")},"data-v-0f5abdf9",null);e.default=l.exports}}); \ No newline at end of file diff --git a/public/static/js/99.js b/public/static/js/99.js new file mode 100644 index 0000000..c682f58 --- /dev/null +++ b/public/static/js/99.js @@ -0,0 +1 @@ +webpackJsonp([99],{AF8l:function(e,t){},m6tW:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r("mvHQ"),a=r.n(i),s=r("Xxa5"),n=r.n(s),o=r("exGp"),u=r.n(o),l={data:function(){return{navTitle:"",subForm:{id:0,title:"",sub_title:"",cover:"",content:"",type:3,top:0},subFormRules:{title:{required:!0,validator:this.$reg.isNoEmpty,text:"公告标题",reg_type:2,trigger:"blur"},sub_title:{required:!0,validator:this.$reg.isNoEmpty,text:"副标题",reg_type:2,trigger:"blur"},content:{required:!0,type:"string",message:"请输入公告内容",trigger:"blur"}}}},created:function(){var e=this;return u()(n.a.mark(function t(){var r;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=e.$route.query.id)){t.next=5;break}return e.subForm.id=r,t.next=5,e.getDetail(r);case 5:e.navTitle=e.$t(r?"menu.MediaOperateEdit":"menu.MediaOperateAdd");case 6:case"end":return t.stop()}},t,e)}))()},methods:{getDetail:function(e){var t=this;return u()(n.a.mark(function r(){var i,a,s,o;return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.$api.media.welfareInfo({id:e});case 2:if(i=r.sent,a=i.code,s=i.data,200===a){r.next=7;break}return r.abrupt("return");case 7:for(o in t.subForm)t.subForm[o]=s[o];case 8:case"end":return r.stop()}},r,t)}))()},submitFormInfo:function(){var e=this,t=!0;if(this.$refs.subForm.validate(function(e){e||(t=!1)}),t){var r=JSON.parse(a()(this.subForm)),i=r.id?"welfareUpdate":"welfareAdd";this.$api.media[i](r).then(function(t){200===t.code&&(e.$message.success(e.$t(r.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}}}},c={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-media-operate-edit"},[r("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"120px"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("el-form-item",{attrs:{label:"公告标题",prop:"title"}},[r("el-input",{attrs:{maxlength:"50","show-word-limit":"",placeholder:"请输入公告标题"},model:{value:e.subForm.title,callback:function(t){e.$set(e.subForm,"title",t)},expression:"subForm.title"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"副标题",prop:"sub_title"}},[r("el-input",{attrs:{maxlength:"100","show-word-limit":"",placeholder:"请输入副标题"},model:{value:e.subForm.sub_title,callback:function(t){e.$set(e.subForm,"sub_title",t)},expression:"subForm.sub_title"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"公告内容",prop:"content"}},[r("lb-ueditor",{attrs:{destroy:!0,ueditorType:"3"},model:{value:e.subForm.content,callback:function(t){e.$set(e.subForm,"content",t)},expression:"subForm.content"}})],1),e._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),r("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1)],1)],1)},staticRenderFns:[]};var m=r("VU/8")(l,c,!1,function(e){r("AF8l")},"data-v-0dfc4f74",null);t.default=m.exports}}); \ No newline at end of file diff --git a/public/static/js/app.js b/public/static/js/app.js new file mode 100644 index 0000000..06d10b7 --- /dev/null +++ b/public/static/js/app.js @@ -0,0 +1,7 @@ +webpackJsonp([103],{0:function(e,t,i){i("j1ja"),e.exports=i("NHnr")},"0HbI":function(e,t){},"0dq+":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkE3ODE4QkNBRTAwRDExRTlBRjA0RUU0MzMzMjMxNTA4IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkE3ODE4QkNCRTAwRDExRTlBRjA0RUU0MzMzMjMxNTA4Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTc4MThCQzhFMDBEMTFFOUFGMDRFRTQzMzMyMzE1MDgiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTc4MThCQzlFMDBEMTFFOUFGMDRFRTQzMzMyMzE1MDgiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5gMO1VAAAEoElEQVR42uSb32sUVxTHz53Z2Y3ZjTFGrZqmNUGhqT8q6Q/Qp6J9UKwPAZ9LHwQVfPFBn0QpotAXxQdBMfZJhP4BAR+sfSz9QVGaBExRK2qiNolRs7uTnR/Xc3/MZtcY3JmduevOHDjsL2Z2Pvfce8733Nkl5tAAvGGfou9H343eg56B5rI59Hvo19EH0UcrPyQVwGn0s+iH0DWIh7nol9GPoBfZG6kK2CH0byBexgJ3AH2DnLElL5LnYghbaTvk7OUjsFGOQtztIGPVZILSEwDMGPcz4F2QHNvFgHsTBNyryQydFEunfB9CNNC7MaFnlrEX6DTC68PzUyyl5hQ4j26GckZ/wEYW0tvOAMl1qy+oXV+D9ccPOABO3YW5dt7NhxsCyy+0cxOk+r5XG2GybAN/pC/ugvX3j/iEKiBNgfHVSSCtq4Es7VE8pZ2iADYngRYnlUWXzj0XwJg3tI4+oKUZoIWnYn1HCuxFVFfbQBFNFBKSXQvGttPlQQDzObgzY2CPXQOwZiMAfo+MZDqwUnSA3t4LBJOpdetc+Emr0UZLL8Gd+gfoy/tVEdXWbI9oSi822tkuMLZiy5lZWv/JSq/AHv0J3OmRhcAsWf55Sl75Ekj1DoC+fl+Ea3ixabKqH0h7SAq1ZQVo3TvfCgyaMf/cLgK1i/K5qRbYefgLjzJp6cQw2HVMlRQmo2lw/v25xpm1plw1lAKDXQB7+KL6xGXkBHB+PBql9d4Z1/MMeCIBwEQHLfehrMkz8QcmS1ahuM/JJZVPALBMWDzCVhKAc11VWjsBEZbA2B/T2cdJAF4teAvPeFlUW4fZBaRRVqbbfQgPjbd3tDAREHitBPZ3fEjS8nMw+o9VS78azZ0aBuv3k+BrbwyzM8l0yhr8JLotnkVHG5vzILDe1o3vY1h0CZERHlcfYee/IUwcj/BsrbXvQhCxoUBfPQTfO59SYflVWaGuYXfytnINLSLcgCmt3IyseLRmRZaOOzBvQ3l0n/rep24uYJkfiNc05Md9n6K5gN2SrAofBFq/zQcst3J4GWTApRfxBqaOiW3hSt4Li6SVj3mEnbmypBRtYcH3KcKpwzji+se7+dbpAuFBNH6h/HZnjXcHatHQHNicbAyw3rMXUp989w69/QVq5hN1flFmvi10Ld8qKzRgOjMm1pMnCN4yFd1nf4XQkbXzu4llSemYjQF2p0dh7tcD/B7PYsDsNkn9gqMDo9wSuCSFqqVZE07tQrRJy2gr37kMIjrCBVZh2I0R3ZiXldEDkyqJp6z+ol4mvEvKiqwfoC0MVoc1vRpcVbPgCQ2iVbSFEwoiLH8BoC3vA+PL46JTIRH+atF1+E4KaftoYb4o/h89sH3nKhj9R3mm1Fb2N66HYGUwaBrw9UVPfgPr1llIrdsLkG6DSH+YxmaT0Spqb+Xb+cdgjwwGXx7m0ACFBBnLAqUE8c4y4HsJAn7AgK8nCPgGA77C1G4CYBnjIAMeRr+UAGDGOOxJF/a/nhsxhr0pGcvSkmXqPegXQPy5KS7mysh+61WjSi3N3jiMvgX9PPoddKsJIdnO3ohk+AzE33eK3oevBRgAU9x1Y0cDdZEAAAAASUVORK5CYII="},1:function(e,t){},2:function(e,t){},"240R":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("lRwf"),a=new(i.n(n).a);t.default=a},3:function(e,t){},"31H8":function(e,t){},"32Qh":function(e,t,i){var n={"./app/activity.png":"SoK4","./app/appointment.png":"89du","./app/article.png":"0dq+","./app/baidu.png":"afEE","./app/closure.png":"och2","./app/company.png":"ViOo","./app/house.png":"Zg/r","./app/msg.png":"RBF1","./app/pay.png":"w5zi","./app/poster.png":"oAV5","./app/present.png":"tHlv","./audio.png":"piFs","./commonIcon/assemble.png":"OSt1","./commonIcon/businessCard.png":"BKIj","./commonIcon/company.png":"pEIT","./commonIcon/customer.png":"j28u","./commonIcon/dynamic.png":"rBJ+","./commonIcon/goods.png":"3q0v","./commonIcon/website.png":"nLPQ","./diy/banner-tongping.png":"VodW","./icon/1.png":"tbYh","./icon/2.png":"ihEB","./icon/3.png":"twuN","./icon/apps.png":"RD+4","./logo.png":"7Otq","./nav-bg.png":"lzON","./video.png":"wa1j"};function a(e){return i(o(e))}function o(e){var t=n[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}a.keys=function(){return Object.keys(n)},a.resolve=o,e.exports=a,a.id="32Qh"},"3q0v":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkVGNEFGNTlDRTAwQjExRTlBQUM1RDJGRkIxMDJGNEU3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkVGNEFGNTlERTAwQjExRTlBQUM1RDJGRkIxMDJGNEU3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RUY0QUY1OUFFMDBCMTFFOUFBQzVEMkZGQjEwMkY0RTciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RUY0QUY1OUJFMDBCMTFFOUFBQzVEMkZGQjEwMkY0RTciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5b9/74AAAHRUlEQVR42uxbaVBTVxQ+JCEQQlYI4lYB97VYxbpWxQ1EVOqCVqvWMtVObTu2tVM7Tq3T2h8dtYvtTFuxM1VbreIuFalSlyoquFWx7gqiRZYEkmAWsvSeS/KSFx0rmpcA6Zk5M8l9vJDvnnvP+c53X4IujZsJHtaNeAbxZOKxxEOgaZmJ+A3iOcQziV90v8hzey0k/g3x88QXEu/SBMGC4zt3dWBALN8RFzkvCtzAZhMfCc3LMKDziHd0rFizM8JfNEOw7pZIfJVzBro7ZqG523zEynMkKH4AAEaMGQg4CQLHkhBwXAABjuM5MnSgmJAHAWYCn/6zCAUoxo8BUddOEMTngenWbajedxCMV643L8DC1tEgGz0MFONGQZDQtYNCO7Wn49qDx6A6Jw8MRZc5/y5BhEvbOaM5IUKInDWVRpVldjvYTCbghYayhmsLzkL52p/BfKesaUWYLwmHiPQJIBnyPAiUCmbcoq6Gqs07ofbkGbDeN4C4dw+QJ4+AsF7d6HVxQjzE9ulFI67ZnQvGazcbf4SVaWNBOXU88MPFrPGqTdtBvTUbbEbTA/eE9+8DUa+9DMGqCNY4LvPK9Vlg1eoaGeCgIFBOSgHpsEEQ0q6Na+VaLKDesht0xwpognrkRwgEIHmhP9nnoyG0YywzbtXXgu5wPqi3/QZ19yr8Dxijo5qTThJTS9a49o+jULkhC+rKKxv8mfKk4RAxYxII5DLX5NVZ6HbQ7NoHNrIdfA5YOnwQKCenQsgzrVnjuPeq9+aB+fadp0544oTeEDlzMs3yTMR1+vrJXLeZJD6zbwBHL5gLsjHD2Rn21Dmo2rgDDJeveTnV8yBiSiotX8FRkS5Zo7gUSt5d2mDQDQaMyUWROpqZbT3JuJqdOWC6WcJ5DZUM7kdKXBIhLh3rQZO8cOvNDxusCDy2YRZ1gqVRLTwHZV/+4BOwaLo/T9KVxGg5MW1J6evPXR2WDB3A3sfDBkJYfA+aSNRZuzkFGzE9jZY8nohNVrCW644c5wYwkzXtdqYcCRQyUM2eCrLEwaDZkwvavKOk1hq9s31DQ0CaOAQUE8aAsFU06xrWc7yOe5yzJc0AJVb6ySqo+Gmziy+3bQUtXp8DcZkrWcv+SU0+dgTErllJPnM2Cyxm6FtvLwG72fxEnytoGF5XZC1VGsp9awvPgpQsdcXEZEoe+DIpTWxSEnHd0YIGL3Xk3bgvRV06sMZrfj9EKef9vy4y9NUzCJxy6eAIJZhuFNNMWUFck70fojJmgGRQv/pOqEMsdTkpJ1VbdtEv/EgCM6AvRE6bCCFx7VjjCBAJjOHvqy6uTibVbrWRCeZzG2F2tG2s95ZKNeXKTsDMxLSMgui3MkA2Ygjo8gtpCfMkMLhCxH2eZWdkkoi0h/JBf+L0I7eWX7slgVLOvFZvy6a9L/bAaKLunaljcitf+wttCFSz00Hclw0UiUvVph205DX+9pDsbacZL1+nTQMuZUXKSMqUaO0kS7bt8sUP3KovQAKzD+6fK2qaigcuZcqGyD4vW72WkgZFWjKpmz1Zf4fyDvJvTEhNT+JxizDY2Pus9sx56kgeVHOn12fe3IN0MnxpXlUtecL/VnzNd13yTd29SvC1eRWwqdjV5POcddJT/nFTQnhhIp8D9uqSxppcsng5zcSGokvQGM3rSctw4RL1xmoBd/Lw5IDtfvzWlGnZuQccxHdxV7vJ5De8VNZxlkD3UuhtwO76UXALld8A86XhrMnnDLD+xCnmteqVabRr8Ye1WvSGq5aXlXMHGPkx048SsDFfL6fdDkqqvjDxcz3hmRVLQdStE7OXa3IPcZu0Sj/6nBHXsTtq+c58iM1cxXRFnABNiIeY1Z9Bm2Xvg6izSxgo+eBTsKg13NZhu9UKJYuW0R7X2cOi1hU1bxaNduXG7V5r7VBAUE5JBcnABDY9vX23XhS4eMU3xANPAUs/XkHPdyNfSmOA4/s2S9+jfLnix40Pb94fB2j7GKqeiHp08RAZqqBi3Raqa/mFaWFrh8DxfAmlHFx6aCi6tV6yEGpPn4fqvQdAf/yU2yZy20UeFQV1LOybZaOGsilryR3QHjgCml05YLdY/U8tERB6WHx3UM1KZ07/MMmgG6/ehPI166kuVffPPeY+a7WWyQUo/HnKQyj3Vm7Y+oAs9FQdLBdPAEgG9gV58kg6Ae6G6ofNYGSeCKghUcPtge/dM72lugbUWXuoKGCt0Xq3ZefykQc8C4p6dQYIIpWPfQ8eieKZ8sMOzhu1xIOGso7++Gl60I1KB54FPTTz49nvrztAd6zwqY9Z/RphT5MnJ4LyxRQXQyPEQXs4n6qUKOz7wnwK+P9+2E+AzQGEV4+AbwQQ4GIEnBNAgPcjYFTCrQEAFjFmIuALxL8PAMCI8YIzS+NvfPY3Y7B5DoxMWcJMnUL8W+TszQiozRHZcc5q5F6HcWAB8V7EvyKODy/XNUGQtcSLHBiwUcef7zDPKv4rwACQXrVzGZIhFwAAAABJRU5ErkJggg=="},4:function(e,t){},"4Vh3":function(e,t){e.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},"5HAW":function(e,t){UE.I18N["zh-cn"]={labelMap:{anchor:"锚点",undo:"撤销",redo:"重做",bold:"加粗",indent:"首行缩进",snapscreen:"截图",italic:"斜体",underline:"下划线",strikethrough:"删除线",subscript:"下标",fontborder:"字符边框",superscript:"上标",formatmatch:"格式刷",source:"源代码",blockquote:"引用",pasteplain:"纯文本粘贴模式",selectall:"全选",print:"打印",preview:"预览",horizontal:"分隔线",removeformat:"清除格式",time:"时间",date:"日期",unlink:"取消链接",insertrow:"前插入行",insertcol:"前插入列",mergeright:"右合并单元格",mergedown:"下合并单元格",deleterow:"删除行",deletecol:"删除列",splittorows:"拆分成行",splittocols:"拆分成列",splittocells:"完全拆分单元格",deletecaption:"删除表格标题",inserttitle:"插入标题",mergecells:"合并多个单元格",deletetable:"删除表格",cleardoc:"清空文档",insertparagraphbeforetable:"表格前插入行",insertcode:"代码语言",fontfamily:"字体",fontsize:"字号",paragraph:"段落格式",simpleupload:"单图上传",insertimage:"多图上传",edittable:"表格属性",edittd:"单元格属性",link:"超链接",emotion:"表情",spechars:"特殊字符",searchreplace:"查询替换",map:"Baidu地图",gmap:"Google地图",insertvideo:"视频",help:"帮助",justifyleft:"居左对齐",justifyright:"居右对齐",justifycenter:"居中对齐",justifyjustify:"两端对齐",forecolor:"字体颜色",backcolor:"背景色",insertorderedlist:"有序列表",insertunorderedlist:"无序列表",fullscreen:"全屏",directionalityltr:"从左向右输入",directionalityrtl:"从右向左输入",rowspacingtop:"段前距",rowspacingbottom:"段后距",pagebreak:"分页",insertframe:"插入Iframe",imagenone:"默认",imageleft:"左浮动",imageright:"右浮动",attachment:"附件",imagecenter:"居中",wordimage:"图片转存",lineheight:"行间距",edittip:"编辑提示",customstyle:"自定义标题",autotypeset:"自动排版",webapp:"百度应用",touppercase:"字母大写",tolowercase:"字母小写",background:"背景",template:"模板",scrawl:"涂鸦",music:"音乐",inserttable:"插入表格",drafts:"从草稿箱加载",charts:"图表"},insertorderedlist:{num:"1,2,3...",num1:"1),2),3)...",num2:"(1),(2),(3)...",cn:"一,二,三....",cn1:"一),二),三)....",cn2:"(一),(二),(三)....",decimal:"1,2,3...","lower-alpha":"a,b,c...","lower-roman":"i,ii,iii...","upper-alpha":"A,B,C...","upper-roman":"I,II,III..."},insertunorderedlist:{circle:"○ 大圆圈",disc:"● 小黑点",square:"■ 小方块 ",dash:"— 破折号",dot:" 。 小圆圈"},paragraph:{p:"段落",h1:"标题 1",h2:"标题 2",h3:"标题 3",h4:"标题 4",h5:"标题 5",h6:"标题 6"},fontfamily:{songti:"宋体",kaiti:"楷体",heiti:"黑体",lishu:"隶书",yahei:"微软雅黑",andaleMono:"andale mono",arial:"arial",arialBlack:"arial black",comicSansMs:"comic sans ms",impact:"impact",timesNewRoman:"times new roman"},customstyle:{tc:"标题居中",tl:"标题居左",im:"强调",hi:"明显强调"},autoupload:{exceedSizeError:"文件大小超出限制",exceedTypeError:"文件格式不允许",jsonEncodeError:"服务器返回格式错误",loading:"正在上传...",loadError:"上传错误",errorLoadConfig:"后端配置项没有正常加载,上传插件不能正常使用!"},simpleupload:{exceedSizeError:"文件大小超出限制",exceedTypeError:"文件格式不允许",jsonEncodeError:"服务器返回格式错误",loading:"正在上传...",loadError:"上传错误",errorLoadConfig:"后端配置项没有正常加载,上传插件不能正常使用!"},elementPathTip:"元素路径",wordCountTip:"字数统计",wordCountMsg:"当前已输入{#count}个字符, 您还可以输入{#leave}个字符。 ",wordOverFlowMsg:'字数超出最大允许值!',ok:"确认",cancel:"取消",closeDialog:"关闭对话框",tableDrag:"表格拖动必须引入uiUtils.js文件!",autofloatMsg:"工具栏浮动依赖编辑器UI,您首先需要引入UI文件!",loadconfigError:"获取后台配置项请求出错,上传功能将不能正常使用!",loadconfigFormatError:"后台配置项返回格式出错,上传功能将不能正常使用!",loadconfigHttpError:"请求后台配置项http错误,上传功能将不能正常使用!",snapScreen_plugin:{browserMsg:"仅支持IE浏览器!",callBackErrorMsg:"服务器返回数据有误,请检查配置项之后重试。",uploadErrorMsg:"截图上传失败,请检查服务器端环境! "},insertcode:{as3:"ActionScript 3",bash:"Bash/Shell",cpp:"C/C++",css:"CSS",cf:"ColdFusion","c#":"C#",delphi:"Delphi",diff:"Diff",erlang:"Erlang",groovy:"Groovy",html:"HTML",java:"Java",jfx:"JavaFX",js:"JavaScript",pl:"Perl",php:"PHP",plain:"Plain Text",ps:"PowerShell",python:"Python",ruby:"Ruby",scala:"Scala",sql:"SQL",vb:"Visual Basic",xml:"XML"},confirmClear:"确定清空当前文档么?",contextMenu:{delete:"删除",selectall:"全选",deletecode:"删除代码",cleardoc:"清空文档",confirmclear:"确定清空当前文档么?",unlink:"删除超链接",paragraph:"段落格式",edittable:"表格属性",aligntd:"单元格对齐方式",aligntable:"表格对齐方式",tableleft:"左浮动",tablecenter:"居中显示",tableright:"右浮动",edittd:"单元格属性",setbordervisible:"设置表格边线可见",justifyleft:"左对齐",justifyright:"右对齐",justifycenter:"居中对齐",justifyjustify:"两端对齐",table:"表格",inserttable:"插入表格",deletetable:"删除表格",insertparagraphbefore:"前插入段落",insertparagraphafter:"后插入段落",deleterow:"删除当前行",deletecol:"删除当前列",insertrow:"前插入行",insertcol:"左插入列",insertrownext:"后插入行",insertcolnext:"右插入列",insertcaption:"插入表格名称",deletecaption:"删除表格名称",inserttitle:"插入表格标题行",deletetitle:"删除表格标题行",inserttitlecol:"插入表格标题列",deletetitlecol:"删除表格标题列",averageDiseRow:"平均分布各行",averageDisCol:"平均分布各列",mergeright:"向右合并",mergeleft:"向左合并",mergedown:"向下合并",mergecells:"合并单元格",splittocells:"完全拆分单元格",splittocols:"拆分成列",splittorows:"拆分成行",tablesort:"表格排序",enablesort:"设置表格可排序",disablesort:"取消表格可排序",reversecurrent:"逆序当前",orderbyasc:"按ASCII字符升序",reversebyasc:"按ASCII字符降序",orderbynum:"按数值大小升序",reversebynum:"按数值大小降序",borderbk:"边框底纹",setcolor:"表格隔行变色",unsetcolor:"取消表格隔行变色",setbackground:"选区背景隔行",unsetbackground:"取消选区背景",redandblue:"红蓝相间",threecolorgradient:"三色渐变",copy:"复制(Ctrl + c)",copymsg:"浏览器不支持,请使用 'Ctrl + c'",paste:"粘贴(Ctrl + v)",pastemsg:"浏览器不支持,请使用 'Ctrl + v'"},copymsg:"浏览器不支持,请使用 'Ctrl + c'",pastemsg:"浏览器不支持,请使用 'Ctrl + v'",anthorMsg:"链接",clearColor:"清空颜色",standardColor:"标准颜色",themeColor:"主题颜色",property:"属性",default:"默认",modify:"修改",justifyleft:"左对齐",justifyright:"右对齐",justifycenter:"居中",justify:"默认",clear:"清除",anchorMsg:"锚点",delete:"删除",clickToUpload:"点击上传",unset:"尚未设置语言文件",t_row:"行",t_col:"列",more:"更多",pasteOpt:"粘贴选项",pasteSourceFormat:"保留源格式",tagFormat:"只保留标签",pasteTextFormat:"只保留文本",autoTypeSet:{mergeLine:"合并空行",delLine:"清除空行",removeFormat:"清除格式",indent:"首行缩进",alignment:"对齐方式",imageFloat:"图片浮动",removeFontsize:"清除字号",removeFontFamily:"清除字体",removeHtml:"清除冗余HTML代码",pasteFilter:"粘贴过滤",run:"执行",symbol:"符号转换",bdc2sb:"全角转半角",tobdc:"半角转全角"},background:{static:{lang_background_normal:"背景设置",lang_background_local:"在线图片",lang_background_set:"选项",lang_background_none:"无背景色",lang_background_colored:"有背景色",lang_background_color:"颜色设置",lang_background_netimg:"网络图片",lang_background_align:"对齐方式",lang_background_position:"精确定位",repeatType:{options:["居中","横向重复","纵向重复","平铺","自定义"]}},noUploadImage:"当前未上传过任何图片!",toggleSelect:"单击可切换选中状态\n原图尺寸: "},insertimage:{static:{lang_tab_remote:"插入图片",lang_tab_upload:"本地上传",lang_tab_online:"在线管理",lang_tab_search:"图片搜索",lang_input_url:"地 址:",lang_input_size:"大 小:",lang_input_width:"宽度",lang_input_height:"高度",lang_input_border:"边 框:",lang_input_vhspace:"边 距:",lang_input_title:"描 述:",lang_input_align:"图片浮动方式:",lang_imgLoading:" 图片加载中……",lang_start_upload:"开始上传",lock:{title:"锁定宽高比例"},searchType:{title:"图片类型",options:["新闻","壁纸","表情","头像"]},searchTxt:{value:"请输入搜索关键词"},searchBtn:{value:"百度一下"},searchReset:{value:"清空搜索"},noneAlign:{title:"无浮动"},leftAlign:{title:"左浮动"},rightAlign:{title:"右浮动"},centerAlign:{title:"居中独占一行"}},uploadSelectFile:"点击选择图片",uploadAddFile:"继续添加",uploadStart:"开始上传",uploadPause:"暂停上传",uploadContinue:"继续上传",uploadRetry:"重试上传",uploadDelete:"删除",uploadTurnLeft:"向左旋转",uploadTurnRight:"向右旋转",uploadPreview:"预览中",uploadNoPreview:"不能预览",updateStatusReady:"选中_张图片,共_KB。",updateStatusConfirm:"已成功上传_张照片,_张照片上传失败",updateStatusFinish:"共_张(_KB),_张上传成功",updateStatusError:",_张上传失败。",errorNotSupport:"WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。",errorLoadConfig:"后端配置项没有正常加载,上传插件不能正常使用!",errorExceedSize:"文件大小超出",errorFileType:"文件格式不允许",errorInterrupt:"文件传输中断",errorUploadRetry:"上传失败,请重试",errorHttp:"http请求错误",errorServerUpload:"服务器返回出错",remoteLockError:"宽高不正确,不能所定比例",numError:"请输入正确的长度或者宽度值!例如:123,400",imageUrlError:"不允许的图片格式或者图片域!",imageLoadError:"图片加载失败!请检查链接地址或网络状态!",searchRemind:"请输入搜索关键词",searchLoading:"图片加载中,请稍后……",searchRetry:" :( ,抱歉,没有找到图片!请重试一次!"},attachment:{static:{lang_tab_upload:"上传附件",lang_tab_online:"在线附件",lang_start_upload:"开始上传",lang_drop_remind:"可以将文件拖到这里,单次最多可选100个文件"},uploadSelectFile:"点击选择文件",uploadAddFile:"继续添加",uploadStart:"开始上传",uploadPause:"暂停上传",uploadContinue:"继续上传",uploadRetry:"重试上传",uploadDelete:"删除",uploadTurnLeft:"向左旋转",uploadTurnRight:"向右旋转",uploadPreview:"预览中",updateStatusReady:"选中_个文件,共_KB。",updateStatusConfirm:"已成功上传_个文件,_个文件上传失败",updateStatusFinish:"共_个(_KB),_个上传成功",updateStatusError:",_张上传失败。",errorNotSupport:"WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。",errorLoadConfig:"后端配置项没有正常加载,上传插件不能正常使用!",errorExceedSize:"文件大小超出",errorFileType:"文件格式不允许",errorInterrupt:"文件传输中断",errorUploadRetry:"上传失败,请重试",errorHttp:"http请求错误",errorServerUpload:"服务器返回出错"},insertvideo:{static:{lang_tab_insertV:"插入视频",lang_tab_searchV:"搜索视频",lang_tab_uploadV:"上传视频",lang_video_url:"视频网址",lang_video_size:"视频尺寸",lang_videoW:"宽度",lang_videoH:"高度",lang_alignment:"对齐方式",videoSearchTxt:{value:"请输入搜索关键字!"},videoType:{options:["全部","热门","娱乐","搞笑","体育","科技","综艺"]},videoSearchBtn:{value:"百度一下"},videoSearchReset:{value:"清空结果"},lang_input_fileStatus:" 当前未上传文件",startUpload:{style:"background:url(upload.png) no-repeat;"},lang_upload_size:"视频尺寸",lang_upload_width:"宽度",lang_upload_height:"高度",lang_upload_alignment:"对齐方式",lang_format_advice:"建议使用mp4格式."},numError:"请输入正确的数值,如123,400",floatLeft:"左浮动",floatRight:"右浮动",'"default"':"默认",block:"独占一行",urlError:"输入的视频地址有误,请检查后再试!",loading:"  视频加载中,请等待……",clickToSelect:"点击选中",goToSource:"访问源视频",noVideo:"    抱歉,找不到对应的视频,请重试!",browseFiles:"浏览文件",uploadSuccess:"上传成功!",delSuccessFile:"从成功队列中移除",delFailSaveFile:"移除保存失败文件",statusPrompt:" 个文件已上传! ",flashVersionError:"当前Flash版本过低,请更新FlashPlayer后重试!",flashLoadingError:"Flash加载失败!请检查路径或网络状态",fileUploadReady:"等待上传……",delUploadQueue:"从上传队列中移除",limitPrompt1:"单次不能选择超过",limitPrompt2:"个文件!请重新选择!",delFailFile:"移除失败文件",fileSizeLimit:"文件大小超出限制!",emptyFile:"空文件无法上传!",fileTypeError:"文件类型不允许!",unknownError:"未知错误!",fileUploading:"上传中,请等待……",cancelUpload:"取消上传",netError:"网络错误",failUpload:"上传失败!",serverIOError:"服务器IO错误!",noAuthority:"无权限!",fileNumLimit:"上传个数限制",failCheck:"验证失败,本次上传被跳过!",fileCanceling:"取消中,请等待……",stopUploading:"上传已停止……",uploadSelectFile:"点击选择文件",uploadAddFile:"继续添加",uploadStart:"开始上传",uploadPause:"暂停上传",uploadContinue:"继续上传",uploadRetry:"重试上传",uploadDelete:"删除",uploadTurnLeft:"向左旋转",uploadTurnRight:"向右旋转",uploadPreview:"预览中",updateStatusReady:"选中_个文件,共_KB。",updateStatusConfirm:"成功上传_个,_个失败",updateStatusFinish:"共_个(_KB),_个成功上传",updateStatusError:",_张上传失败。",errorNotSupport:"WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。",errorLoadConfig:"后端配置项没有正常加载,上传插件不能正常使用!",errorExceedSize:"文件大小超出",errorFileType:"文件格式不允许",errorInterrupt:"文件传输中断",errorUploadRetry:"上传失败,请重试",errorHttp:"http请求错误",errorServerUpload:"服务器返回出错"},webapp:{tip1:"本功能由百度APP提供,如看到此页面,请各位站长首先申请百度APPKey!",tip2:"申请完成之后请至ueditor.config.js中配置获得的appkey! ",applyFor:"点此申请",anthorApi:"百度API"},template:{static:{lang_template_bkcolor:"背景颜色",lang_template_clear:"保留原有内容",lang_template_select:"选择模板"},blank:"空白文档",blog:"博客文章",resume:"个人简历",richText:"图文混排",sciPapers:"科技论文"},scrawl:{static:{lang_input_previousStep:"上一步",lang_input_nextsStep:"下一步",lang_input_clear:"清空",lang_input_addPic:"添加背景",lang_input_ScalePic:"缩放背景",lang_input_removePic:"删除背景",J_imgTxt:{title:"添加背景图片"}},noScarwl:"尚未作画,白纸一张~",scrawlUpLoading:"涂鸦上传中,别急哦~",continueBtn:"继续",imageError:"糟糕,图片读取失败了!",backgroundUploading:"背景图片上传中,别急哦~"},music:{static:{lang_input_tips:"输入歌手/歌曲/专辑,搜索您感兴趣的音乐!",J_searchBtn:{value:"搜索歌曲"}},emptyTxt:"未搜索到相关音乐结果,请换一个关键词试试。",chapter:"歌曲",singer:"歌手",special:"专辑",listenTest:"试听"},anchor:{static:{lang_input_anchorName:"锚点名字:"}},charts:{static:{lang_data_source:"数据源:",lang_chart_format:"图表格式:",lang_data_align:"数据对齐方式",lang_chart_align_same:"数据源与图表X轴Y轴一致",lang_chart_align_reverse:"数据源与图表X轴Y轴相反",lang_chart_title:"图表标题",lang_chart_main_title:"主标题:",lang_chart_sub_title:"子标题:",lang_chart_x_title:"X轴标题:",lang_chart_y_title:"Y轴标题:",lang_chart_tip:"提示文字",lang_cahrt_tip_prefix:"提示文字前缀:",lang_cahrt_tip_description:"仅饼图有效, 当鼠标移动到饼图中相应的块上时,提示框内的文字的前缀",lang_chart_data_unit:"数据单位",lang_chart_data_unit_title:"单位:",lang_chart_data_unit_description:"显示在每个数据点上的数据的单位, 比如: 温度的单位 ℃",lang_chart_type:"图表类型:",lang_prev_btn:"上一个",lang_next_btn:"下一个"}},emotion:{static:{lang_input_choice:"精选",lang_input_Tuzki:"兔斯基",lang_input_BOBO:"BOBO",lang_input_lvdouwa:"绿豆蛙",lang_input_babyCat:"baby猫",lang_input_bubble:"泡泡",lang_input_youa:"有啊"}},gmap:{static:{lang_input_address:"地址",lang_input_search:"搜索",address:{value:"北京"}},searchError:"无法定位到该地址!"},help:{static:{lang_input_about:"关于UEditor",lang_input_shortcuts:"快捷键",lang_input_introduction:"UEditor是由百度web前端研发部开发的所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点。开源基于BSD协议,允许自由使用和修改代码。",lang_Txt_shortcuts:"快捷键",lang_Txt_func:"功能",lang_Txt_bold:"给选中字设置为加粗",lang_Txt_copy:"复制选中内容",lang_Txt_cut:"剪切选中内容",lang_Txt_Paste:"粘贴",lang_Txt_undo:"重新执行上次操作",lang_Txt_redo:"撤销上一次操作",lang_Txt_italic:"给选中字设置为斜体",lang_Txt_underline:"给选中字加下划线",lang_Txt_selectAll:"全部选中",lang_Txt_visualEnter:"软回车",lang_Txt_fullscreen:"全屏"}},insertframe:{static:{lang_input_address:"地址:",lang_input_width:"宽度:",lang_input_height:"高度:",lang_input_isScroll:"允许滚动条:",lang_input_frameborder:"显示框架边框:",lang_input_alignMode:"对齐方式:",align:{title:"对齐方式",options:["默认","左对齐","右对齐","居中"]}},enterAddress:"请输入地址!"},link:{static:{lang_input_text:"文本内容:",lang_input_url:"链接地址:",lang_input_title:"标题:",lang_input_target:"是否在新窗口打开:"},validLink:"只支持选中一个链接时生效",httpPrompt:"您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀"},map:{static:{lang_city:"城市",lang_address:"地址",city:{value:"北京"},lang_search:"搜索",lang_dynamicmap:"插入动态地图"},cityMsg:"请选择城市",errorMsg:"抱歉,找不到该位置!"},searchreplace:{static:{lang_tab_search:"查找",lang_tab_replace:"替换",lang_search1:"查找",lang_search2:"查找",lang_replace:"替换",lang_searchReg:"支持正则表达式,添加前后斜杠标示为正则表达式,例如“/表达式/”",lang_searchReg1:"支持正则表达式,添加前后斜杠标示为正则表达式,例如“/表达式/”",lang_case_sensitive1:"区分大小写",lang_case_sensitive2:"区分大小写",nextFindBtn:{value:"下一个"},preFindBtn:{value:"上一个"},nextReplaceBtn:{value:"下一个"},preReplaceBtn:{value:"上一个"},repalceBtn:{value:"替换"},repalceAllBtn:{value:"全部替换"}},getEnd:"已经搜索到文章末尾!",getStart:"已经搜索到文章头部",countMsg:"总共替换了{#count}处!"},snapscreen:{static:{lang_showMsg:"截图功能需要首先安装UEditor截图插件! ",lang_download:"点此下载",lang_step1:"第一步,下载UEditor截图插件并运行安装。",lang_step2:"第二步,插件安装完成后即可使用,如不生效,请重启浏览器后再试!"}},spechars:{static:{},tsfh:"特殊字符",lmsz:"罗马字符",szfh:"数学字符",rwfh:"日文字符",xlzm:"希腊字母",ewzm:"俄文字符",pyzm:"拼音字母",yyyb:"英语音标",zyzf:"其他"},edittable:{static:{lang_tableStyle:"表格样式",lang_insertCaption:"添加表格名称行",lang_insertTitle:"添加表格标题行",lang_insertTitleCol:"添加表格标题列",lang_orderbycontent:"使表格内容可排序",lang_tableSize:"自动调整表格尺寸",lang_autoSizeContent:"按表格文字自适应",lang_autoSizePage:"按页面宽度自适应",lang_example:"示例",lang_borderStyle:"表格边框",lang_color:"颜色:"},captionName:"表格名称",titleName:"标题",cellsName:"内容",errorMsg:"有合并单元格,不可排序"},edittip:{static:{lang_delRow:"删除整行",lang_delCol:"删除整列"}},edittd:{static:{lang_tdBkColor:"背景颜色:"}},formula:{static:{}},wordimage:{static:{lang_resave:"转存步骤",uploadBtn:{src:"upload.png",alt:"上传"},clipboard:{style:"background: url(copy.png) -153px -1px no-repeat;"},lang_step:"1、点击顶部复制按钮,将地址复制到剪贴板;2、点击添加照片按钮,在弹出的对话框中使用Ctrl+V粘贴地址;3、点击打开后选择图片上传流程。"},fileType:"图片",flashError:"FLASH初始化失败,请检查FLASH插件是否正确安装!",netError:"网络连接错误,请重试!",copySuccess:"图片地址已经复制!",flashI18n:{}},autosave:{saving:"保存中...",success:"本地保存成功"}}},"6ZSt":function(e,t){e.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}},"7Otq":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAU8UlEQVR4Xu1dv3KkN3L/YWSJm7hOCs4aRtqtcpVDcROn4j7B8h7AtRxWXXKJdsOLlnoCUYEzF4d6As9mzsx9Ao+rnDk4XsTRXSD6givduZa4amCGGnKGM0CjgQ/foKdKJZWIf/1r/L5GA42Ggf4UAUXgUQSMYqMIKAKPI6AE0dmhCGxAQAmi00MRUILoHFAEeAioBeHhprUaQUAJ0oiiVUweAkoQHm5aqxEElCCNKFrF5CGgBOHhprUaQUAJ0oiiVUweAkoQHm5aqxEElCCNKFrF5CGgBOHhprUaQUAJ0oiiVUweAkoQHm5aqxEElCCNKFrF5CGgBOHhprUaQUAJ0oiiVUweAkoQHm5aqxEElCCNKFrF5CGgBOHhprUaQUAJ0oii2WKe//ErmA8HgPkUwFPAPl1q6wYwU1g7hRn8HqN/mLL7qbSiEqRSxXQ2rPGPn8L+/0uY22MAh5HjIMJMYO0EJ8N3kXWrLK4EqVItHQxqfP0UGLwFLBFD4kdkOQM++Q6jz24kGuyiDSVIF6jX1CdZDPz1W0FiPJTOE2X0+Tc1iR06FiVIKFK7WG58fQyYbwGQf5H7NwUGo775KUqQ3NOixvad1fjLGMBR+eHZEUb7F+X75fWoBOHh1t9anhz/CeCgOyHMBUafj7rrP7xnJUg4Vv0vWQU5FjD2gyRKkP5P+zAJqiLHYsj2G4z2T8ME6KaUEqQb3Mv3Op79ezc+xzZR6/ZJlCDb9LcLfx/PXgOg3aoafzeAfY7R/lWNg1OC1KgVyTG5A0DzO8kmM7R1idHwRYZ2k5tUgiRDWHkD4xntWMWGjHQgVJ1LLSVIB1OhWJfj60PAEEH68LvCaPistoEqQWrTiOR4emM97na1qjtEVIJITsia2uqH7/EQseqsiBKkpkktOZbx7AzA15JNwtr3gLmBsVNYcwDYAxjzhWgfGDyvKV5LCSKr3XpaG89o52r5chN/bNZ+D4PTtVux5OdYnMKYr/gd3Kv5HUZD2pau4qcEqUINwoOQWl5Z/B+MPcJo/3LrCOUs1hSj4fOt/RUqoAQpBHTRbnwYO0Xr8n+OHIPDqOWOFElGw2rmZTUD4WtSa64gML4+BczbNGSYcVLn11fpfol9EWS10gQMqq0ECYKpZ4XOry+TfAJnPfaesq7KSlgv1HNoqATp2dwPGm46Qd7hZMi7TOWjhn8MGuejhZjWK63TtbWVIBlA7bzJ8ey/0i5EJU7QVIIisX9BBShBBMGspqnxzKaNJXGCKkHS4NfamRE4n01h8CW/l0SCdG3B+IKv1FQLIghmNU2lfsEt1AeZK1MJUs2sFhxIKkGAG2Dvme5iAUoQwXlZTVNdnoOIhLjoOUg1c2knByJyFkHIRE5UPUnfyem0e0JJxWK5pZb9VdCp9viHsUj60hT/J4MmdYmVAdQqmhQJ+VhIYi6AW0rRs5pYwd9apLAWqWu9bzAaUqh+FT8lSBVqyDAIqeXO/aFN3XsgwBVgiRAUTi8TUn/Xj31WU4YTJUiGuVlFk3LLrHLiWPw3ToYdpkRdFVUJUk795Xs6n01g8LJ8x9we6wlSvFtcckXpTb3xHw5gzS8eHe/JL9/3RpbYgfYpq0mF1oPg3h0L4t7Su52vi907erFOIzmg9I9fY9uPpqiRPLR0sn/3hZfV3mwdZ2+sSOSWcuzHglm+vwQhywD7cu4sxpIhBi66bjoBBu+jbtfF9BBSdvNu0ePPnTlCGYrNetyKhvSfswwlgzjZz6lD9uj7RRBHittX8yTMwrsnQRiShZkA9rtiOy1xj92sf8Wp5ty8KZezglSWVqgfBDn/wyvmq6tp6GyuPYUdnMF8/I4VsxQysvEPR4Clu+UxT6RdAXvPV8Z0fn0BY+jjUtmvzqVV/U66f1zya8BSCpiYCVJ6Asi/5hpnNdbJu5oM2j3v/JfLtDB4aWgTw+qlh7OmvTotiLcY9LBKF8soLuwyROFZjTVjXvNlrook9W3prlN8XQTxjii9Y1HVYVEkY+iUmXLMbs8ltdxwutV4OMz1CdiqIEk/yFHPNm/+t7oj57hIcXLm3wQ582JWY2ncm3aGHEl+OivukziH3Bxj9PlEBOECjXRvQbzVIEe0T8upUNVQNCyRZP2zx/JWY3lc2xNBEzGtvSiyBUyENTgO+mCEolugXLcEGf/wFrBVP+IopIMzjIZv7rU1nlFiaZI9zwZE6NlCbmti7e9hDMlfTYRujE67IUiVL67GwMYqO3V3K9zPWcy8B2Ox9yrcgaJLQi2zFeyI4RJer7eeLAjLVypPEB9lSi+u9tkR52rqzwA+APh7bgPh9ZiOsPt4/XQEa46iAx0pnsrgErCT6E2KcMGKlixLEH8STk+C5VlWFIUutjNKVVUIbvp6n+zL+HTOR5zf+7D37n9cwbjYNQCDKfDJZbYD01ioBcsX0hiApslBMCfmcotSuvlVn3aKokQrXLgMQZQcBdXKXFoVHGGfuspPkKbJUXAqeKeYtlHjDigLDrGPXeUliHfIKZFyWZ+DnEVYCvGmyTJfJz+ZrqyR3fhoXU3v7eEprHtzT+opMT8fyrge3wF7p7voA3RNqswESc0yHgGPe0dvMBFxFv3JNr29d5x8iGYtYDLBrFYjYoLwimbSHDnlQnmSNsnlthXtGfBkku3r6U6bb1+zLUs+gqjV4M35qFp5CCKW2e8RWbr4cnJfc5UmSBeyR02p3SosT5Ccfod/dfV1p6eznih0+Uj4ffCgiaVWIwgmuUIZCDKjg0D5MArnYzx5nW0pFYupSILowE7VagQCJV9MliA5llY1h0g7a2Io99TmhAhpyyy1GvLzPrhFOYL4AMTfiW7pOid8cNxpNpFtUAZdQDKAI8m2xpb+bvE/MIN/qVr2CHH6WjRGZZtllM4F68ixd1jNkmqT9MEkuQ3c8rV0fvI9TvaP+zqxdmXcMgSRzgPbJ3Isz4TQzCGPHR6u/P/Bc7Ug3VJNhiChEyNE1r6Sg2QLsiQLEB4GMK4JaIy90xGCr5aJQiCdIJLWo/IkYkHIRpEkpMW6ngMIGfEulZEgyOn8ARUBXOpOIhYsoEuYfUs5qNLTfdL2tvoiwdBLFxQgyOxHmZ2r+pOIRYEvmu5z77NebFZEAdSPwmkEkTr3qDT1fbIK5TKrV/UsWTIuPWogjSBiE2BHd2vk/LMpRsPnPZpXOzNUPkH8wSAtr9J+u77GFgtJUWc9baLxaicQZEZJpSlNaOJvxxXvd7UowUGqw67LrMSZxqnOJ4jE8mrXrcdCIzJWRJdZnBmeWIdPkLHE7tWOW4+fCULXeilOLfGnu1mJAEZX5xHEJ2Kgu+b8367uXD2GiEi0gabz4U84Xk0mQST8j8bS0/h77pRRMuW3/kmDlBa17kYEeASR8D/Q4HLhfHaT5KyHJqTWSS+GAI8g48RsJa0trxbqkviwjIY8nYlNmbYa4oE9nqXm0WxzqSASftLIxkYlPIwniISDjkadTRHsdiSgsxICbBsGgyDuRShKzJDw29HQkhBEkq1vY5sbIZhmLMMgiMAOVsvr6PPrq7SUQT2KenZh/+YXMB8OALOaftaaK8Bc4eSX7zPO8aSmGQS5Trv/0aqDfueoX1+yszS6NiomyPkfv4L5cDR/HCk29dMNgEvYwQTmw/ta3jLsgCD2PU72Y8FL+gpUVfl8xwji/Cr7NWCJGJJJyqewgzOYj991eRdGCVKaPanZX2o5C/GvE7/NkiRwRSfmArj9pgurogQpTpDUJWrHFrgoMVaUcwbsfVPSoihBlCBhCLj7P3/9FrBd5+q6Acyo1BNzSpCw6SFXKjVosYtUQP78huLIZB4GFUGTll2fvMltTZQgIsqKaKRvTrpU3oEIiCKKToHBKGdyvfIEAW4wGn4WAcJuFe0TQUo8gpSu3Rtg8CIXSRgE0YPCJJ2uXDRbZFRcqGKRf/SxcLdC5yD9IMdCFdlIwiCIhpqwCXIv0cWaVKNrG35YrkCoSb/IkZUkHIIIXB8toGT2LM5Y0W+RpsWxDfBrvBr+W7ZRytyfzza8LQ3fAPa55HlJPEFohKkBd60ka3ioTbnJRzFMl7B2ArP3XmwnJ6dD7p/mpnCS+c98CoMvMzBpCuy9kMKER5DkgDtcYTR8lgGcupu8mP0vLP4xwyCngJnADi7ZgX+Sb0tSEnIQed079Zcbv+h+C/kY1h6lBXHeQ1XsvhGXIPSI5as0RTcW8u7zY/0Y9coUD2Be0N9Y4G1J95aiodPuC9YXnEhqcZo+twg4mTtHPILImGIxlvPmUeFa4x9+A9h/LdwrdXcFYAKLy0eXYyL6FNxdc2HyH87Sop5J7r3nLKIuKYlJEIG0P6S4lpZZ+ZZXsZyjZc8EGLx3Zwepb0vmfEcymbjppOURhFSSmqHDqVXGDMbOkOLl5ZJYSw+d4prIwlDIenzbFFlsnhylfqU3dkzpkqy9YGaDuQH2nqWML4Eg1wJ+CDlwwxfxmulZjdT4qxrFLbkTmfQgUZoV4RNEJhEa3ZB7gdE+mf3d/NVrPfh4d3ErlD/fkqwInyBiyyzsdlLm8YyiYOm2nV/FpCHOn9RRNTcM1L0jaQ8kD+OCh8Y+R+IfTKepS2zpwBcgGNwuCkqcnHcxbu8fzhn9cAAdW3xOsGfCFYE0gvDN3kPUk8xgZ3NoW8fjGWV0v3+Hoi9WxFrAPJgeNVz3ZX90eKlu0wjillmpaWzuZtluOeyPBvwZwE2+beyq8e8dW48FJBwrAt4qJV1NyXvV9ybCbryiFIRJH0zJ0jKrBuuxmCqcjQ/mrls6QeSc9bn4PT8b8bFFFLEbkAJnPgH7wBXmFzibHYxfubA2g2QIwt5dWAtftssv2ZR192WLIceG0VRDmGVHvbKk2Zz0SYyMnkIEoUC8n6aC0Zj9I4lkNKznzp8A+1tY/DNgjpgnyfxvwjJJuzj32DZy1gZRfICsDEFImKB19zap7/29PySJWlaFYvDgBNj3cTgPC/8qtBWRcgnbpCL9P9ZI9L2k+E0GOYL4Ha3EvLMrSNANsTcY7V9kBTqlcf8lG4f5HIEdubDxJwcbY4h8v4ewOBS/eLSyxEsL1wiUOr5YNEHi/VtZgrD3qLdhYy4w+ny0rVTxv49n9E48vRcv/Iv80rnlHQ5hDZ3YE2FS32R/KE+du4vRjno80WUJ4pZaszMAXwvPGGpuOrcm3cdteX+DQkgOxOWUWM645diHI29djMByLJKw4qA80mD0iqUGgril1mwqbvbvMCqTUW+tShwxBm+zpd90cU57T1PCs1fG7VOGHsLezq2L+WKtbOtOzn8uWKcFiX4rsxaCJIUnB31+6B7DGXD7fZGgOT/JKMU/LacCzjeCZFhTqMCX2l9r/Q8Y/JMfwGA+jk33QeInFheBqHrRPkj8abr8EmshociDlSFwmQuX3eNk+C6kdFSZ89lLGFrXl0jYXHASFliaROHMLRxPkOirFfkI4pZaIpeqQuFLT4Xjvq7mSxjQAz+0JCmTrFnC7whFyS+BKePIy+AqpccXMjDWg6jxFjovQTjKCAEnrAxdJfWkod/iPbxF3Xvv5llytumfMoRYHr+70713KOp3bMOHE/nAOIXeNoykv3NWKAwZ8hPEp7u5zOe0J8HcbeUuyEESsw51488QsoIb66DT2dLJfvQHMD9BnEKUJCuTJeQwMNcM40TDAvWkaeKMn7lMLEMQJcn9qe7I8dFRrpT9QbyKPmRz69RnRXYNtwnAWSICrK3qcgRRkni1d7WsejjpOBsozDsV2+Z71N/Zebx45C5LkJ9JQnmOwndRohCsuDCZebN3XNQhfwwOVjRsBVaEE6nB9D9I2vIEWSiMZyYrnv1bh1bPGn4xVF7yv+6uRrO2dp2wrOVVtwTxuykUYEd78tLBdVtna7ECLnzEHJd6lTVKLs7X2HdQnuzspVWa1evOgtxZEnfZaiITVBc1PfIXLpGaM0UKzm7QXX/xYRvsoXpy0DXm+ODQRL+pe4LcESUpBysb+ywVndXAKUZDimyu+8dx1kuSxJODIqcpuoHx4znni47qIYhbcjkwTjOFyzPAZVShL5Z58roKRzxk+ElWxHVwhtHwTUhX0WVS32dnnn0sj7MugtxZE8mHVKLVwqvgllNkNXqYZzh9w+QSPusJhffI/MYzulNEH0te9LRQitQ6CdInoritW3vWS2Lc4ewiHa7SN0sE7ur4W6l0UzPe37hHTZno6LoJskwU4BgWx4KZU/hfOu9jXACOGHJfTf6I0mvKXpem9xInMB+/C1pq+mUenYvRfZvoeKkV4QWzsPSDIMsIuK1hHBdPhXP3MOVgUuWWbTpFaNv9FDBvJZpaaoOiqemRUf/CLUVVGzsnQYYoaqGlVZ1Oeqxm7lLhuEQF8ifz3q9YvNTa/V34WHw45aMvU3E6yVlHNuq4fxZkE7Y+u8c8w4f798JcP310aUZhCP7eyA2Mnfr//mjaaSBhzvmzre1eR17Ln83sFkG2KV//HoZAP0nCDifZBIoSJGzKtFeqVySRtxy74YO0N23LSuxIUnEYkHfIX+fMvKkWpOyU62dv/KDGfPLmfJ99adRKkHwq3K2W3Xvlt2dVnENRNDH2ToPOWBK1oARJBLCp6i5W7qfXGc5KwmDsIJxHCRKmGi21jIDPzngKY14VAcbd4R+87uKAVglSRMM72ok/d8oXAuQio7uNXFCC7OjcLS6Wj+WaZ5THl6z+fTgPvVQ2AfYuSvgY28apBNmGkP49HgHvqxwAxmertC7mat2PIojnGTBxWWPgpxIkXv1aoyEElCANKVtFjUdACRKPmdZoCAElSEPKVlHjEVCCxGOmNRpCQAnSkLJV1HgElCDxmGmNhhBQgjSkbBU1HgElSDxmWqMhBJQgDSlbRY1HQAkSj5nWaAgBJUhDylZR4xFQgsRjpjUaQkAJ0pCyVdR4BJQg8ZhpjYYQUII0pGwVNR4BJUg8ZlqjIQSUIA0pW0WNR0AJEo+Z1mgIASVIQ8pWUeMRUILEY6Y1GkJACdKQslXUeASUIPGYaY2GEFCCNKRsFTUeASVIPGZaoyEElCANKVtFjUdACRKPmdZoCAElSEPKVlHjEVCCxGOmNRpCQAnSkLJV1HgElCDxmGmNhhBQgjSkbBU1HgElSDxmWqMhBJQgDSlbRY1HQAkSj5nWaAgBJUhDylZR4xH4G1Be8DK27yG4AAAAAElFTkSuQmCC"},"89du":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjgzNTMzQzhBRTAwRDExRTk4OTY4REVGODlGMEEyRUE4IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjgzNTMzQzhCRTAwRDExRTk4OTY4REVGODlGMEEyRUE4Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6ODM1MzNDODhFMDBEMTFFOTg5NjhERUY4OUYwQTJFQTgiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6ODM1MzNDODlFMDBEMTFFOTg5NjhERUY4OUYwQTJFQTgiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5U1y5eAAAE4ElEQVR42uyb608UVxTAz4wLC5SHWxAqFuQpKxRsrZVWa9NWTVCs0abaNNjYD0aJ8UuT/gX90A/aaGyqUIJpqm2apg/bRC3aDaklDT6iTbsIVI2iEbQipcLCLvuY6TmzM8uMrLCsM7Izsyc5mWHm7nB/c84959x7d5l9HzrgASlH3Ya6BrUQ1Qr6kjHUa6gtqM2onfKbrOw8EfVTVCfq+6h2HcKC2OeFIgOxNKImSzctMtjjqKvAWEIG3YFaKnqsV7LwPgPCyuV11L3SG6gQ34LRpZ5YWTFAzTIBMDFuI+AaMI/UEHCRiYCLWDFCm0USWS2eWre9Gja88+wjPaOsIge27KiG3KczVM9Tqsr84idhTk4qFJRkgi0zJfo8stYOWdmpsHp9eWwDp6aNF2fWpISon8MwYmidxcY2cCDAh855no/6ORzHi8/jVO2fZdpviGXR3cogfXay4vrQf25wHOsCTtZB75hfOK7bVAmJ1sis3fbLZej/xzXh+gvL50NeYaZyluDxwbm2Hmw/rA0wjUkKJOHdzCYA+/zjwKMjXuFYYs+eRgzIDAu8ZHkBWK0Tu1u6MBvaHFfhQvsNdYHTZyfBu/UvooWDg8vt9inuu+57gmOOZWVj2IJW8MNA/wgkJVuAn8I7Gfzo7VtDYe/1XBmAfAyIcknCF8Bgf1asKoFRlxe6nLfVA35ldakAS+Pym88vwJ3e+2HbJSSMV6kpT1jR1T1wpPFM1FGLEY8/H+0IO7zqP1iBw8WCHpAfEXDEQSs9IzhmR4a9D4UVAhXIghYXfcCxWFjFMXxg4+Dm9cEgSITRnJ1u1GSm+ETPlXsYuHjw+QKCK0cr3c47wv/s/Ktv8tJJGte8ykFLSjEMMJO28+CY/eSj1kdOHxQASSPN1xBhCtSktIz1JZA4cBw4DhwH1o1YYrFT+YU22Fj3HE4+AnBo/+/g9fqNa+GlLxfAm1sWCyUl1eLZuWnGdenisixY9lpx6G8/zrzu9g0b06XJssteLVZMLQ83nlXVnTUFXv/2IvBjPX3ih44p29orn1JYllY5mva26SdovbG5CooWZAWXBbJS4Kumcw9tW7l4Hqxca5etYvjhi4Z2faWl4SFP6HxOThrUbV8ath0txa6stYM0H6Ex27DntDCZ1xXwry2XhemdErp6gmXXbHxm3LJjaNkD7ZrHCs2idMuPl+Bq910ZdCps3fmScL7gAcvS3Llh92mFZ+iy0jr2rRO6ZJamRUCydM2GitA1Wtk8fPAMPC7RPC2dREszYiSWLB3Ksz4ODqJlDVdakntzPA/lVXMVlv2y6axxa+lTP3UKFq16fh543D5o/Pg3408eWk90w5/nb8FAv8s808OZhI0vAMSB48AmApZ2DQMcF1MAlOoEYRhtLBxuj3YmhbZh5QZRLQ93/NEHObnpwubV5veWQO/NwRmHzbAlw1zxWz6RfgsgYmDnxV5hlpNXYIPcvAxBY0WoTKWJiuqV1vdHLkLtW5UC9GT7to9LaDt18N9R+Lr5vHal5fHvnKBnMWVa8pqI10XA10wEfIOAW0wE7CDgQ1RAmQCWGJsJmLYGPjMBMDF2SFGafuPjMDBsq8gYSksUqWtRD1A+NxAoJ1p2nZSN5HmYLuxCrULdj/o3qk+HkPRtuEsiwyII/nzHLd38X4ABADr5hAry3nGlAAAAAElFTkSuQmCC"},"8YCc":function(e,t){e.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},A66B:function(e,t,i){e.exports=function(e){return function(){return i("AMsx")("./view"+e+".vue")}}},AMsx:function(e,t,i){var n={"./view/404/index.vue":["Cy/J",2],"./view/account/list.vue":["7Rtn",30],"./view/account/role.vue":["sIiw",67],"./view/claim/banner/edit.vue":["IxZa",0,82],"./view/claim/banner/list.vue":["wKBn",62],"./view/claim/breed/edit.vue":["VPz1",92],"./view/claim/breed/list.vue":["09BK",40],"./view/claim/classify/edit.vue":["dSd0",81],"./view/claim/classify/list.vue":["Tg1U",78],"./view/claim/collage/edit.vue":["ZMD6",0,77],"./view/claim/collage/list.vue":["CArw",85],"./view/claim/list/edit.vue":["RL5K",0,22],"./view/claim/list/list.vue":["fqtf",0,60],"./view/claim/set.vue":["w/nd",64],"./view/custom/level.vue":["tnLr",101],"./view/custom/list.vue":["RUn2",52],"./view/custom/set.vue":["WI8u",32],"./view/distribution/commission.vue":["93xJ",73],"./view/distribution/examine.vue":["4lsv",19],"./view/distribution/profit.vue":["wKaq",0,58],"./view/distribution/relation.vue":["axeU",46],"./view/farmer/list.vue":["cRoC",17],"./view/finance/finance/detail.vue":["OWis",0,75],"./view/finance/finance/list.vue":["IMDQ",6],"./view/finance/record.vue":["ZVP8",83],"./view/hardware/machine/edit.vue":["vWyt",36],"./view/hardware/machine/list.vue":["0CRz",37],"./view/hardware/monitor/edit.vue":["eXm2",96],"./view/hardware/monitor/list.vue":["Yxp+",54],"./view/hardware/monitor/set.vue":["CRZ6",94],"./view/home/countEcharts.vue":["IqjV",0,95],"./view/home/list.vue":["ec+i",0,3],"./view/home/userEcharts.vue":["5/Vm",0,18],"./view/land/classify/edit.vue":["KbtE",57],"./view/land/classify/list.vue":["qIuO",29],"./view/land/list/edit.vue":["wOVP",0,39],"./view/land/list/list.vue":["hXFe",0,84],"./view/land/massif/edit.vue":["xw3J",0,66],"./view/land/massif/list.vue":["WdSc",42],"./view/land/seed/edit.vue":["Zuu8",38],"./view/land/seed/list.vue":["3oPi",51],"./view/land/set.vue":["0mCw",45],"./view/login/index.vue":["q8bm",1],"./view/market/coupon/edit.vue":["9Rsl",34],"./view/market/coupon/list.vue":["mHKU",91],"./view/market/integral/edit.vue":["MMp4",90],"./view/market/integral/list.vue":["F76B",68],"./view/market/luck/edit.vue":["N8xt",0,65],"./view/market/luck/list.vue":["qIBj",88],"./view/market/seckill/edit.vue":["Pb86",16],"./view/market/seckill/goods/edit.vue":["aquT",71],"./view/market/seckill/goods/list.vue":["DVJl",56],"./view/market/seckill/list.vue":["U8Vh",35],"./view/market/sign.vue":["R35D",86],"./view/media/about/edit.vue":["iqYD",100],"./view/media/about/list.vue":["uGCl",15],"./view/media/advertisement/edit.vue":["kQ7E",0,55],"./view/media/advertisement/list.vue":["U2D0",33],"./view/media/article/edit.vue":["ribk",25],"./view/media/article/list.vue":["COyb",76],"./view/media/banner/edit.vue":["jKJO",0,93],"./view/media/banner/list.vue":["HhR/",21],"./view/media/notice/edit.vue":["jqwu",31],"./view/media/notice/list.vue":["/bNQ",87],"./view/media/operate/edit.vue":["m6tW",99],"./view/media/operate/list.vue":["vy2F",53],"./view/media/welfare/edit.vue":["QkO7",74],"./view/media/welfare/list.vue":["Ahj6",27],"./view/order/claim/detail.vue":["03t2",72],"./view/order/claim/list.vue":["oGbv",0,7],"./view/order/distribution/detail.vue":["Nyb3",14],"./view/order/distribution/list.vue":["LkP1",9],"./view/order/evaluate/list.vue":["eYVs",0,5],"./view/order/land/detail.vue":["LjsJ",97],"./view/order/land/list.vue":["P54s",0,11],"./view/order/shop/detail.vue":["tz+A",50],"./view/order/shop/list.vue":["/1Wg",0,12],"./view/order/shop/refund/detail.vue":["zjvW",28],"./view/order/shop/refund/list.vue":["Tbxf",8],"./view/shop/classify/edit.vue":["R3+A",63],"./view/shop/classify/list.vue":["LSCY",26],"./view/shop/goods/edit.vue":["M4mf",0,20],"./view/shop/goods/list.vue":["xgXD",0,41],"./view/shop/store/edit.vue":["kaEl",47],"./view/shop/store/list.vue":["E6Sj",23],"./view/stored/edit.vue":["GOdH",89],"./view/stored/list.vue":["u2D2",80],"./view/stored/order.vue":["mi9e",10],"./view/system/app.vue":["eB79",48],"./view/system/clientNotice.vue":["rsLl",4],"./view/system/distribution.vue":["65ce",43],"./view/system/freight/edit.vue":["pqu+",0,13],"./view/system/freight/list.vue":["O0Tl",49],"./view/system/message.vue":["yED0",59],"./view/system/other.vue":["b6Q8",69],"./view/system/payment/alipay.vue":["tcAG",24],"./view/system/payment/wechat.vue":["NOL4",79],"./view/system/radarNotice.vue":["rEC9",70],"./view/system/transaction.vue":["V21k",98],"./view/system/upload.vue":["M+bL",44],"./view/system/wechat.vue":["ILcC",61]};function a(e){var t=n[e];return t?Promise.all(t.slice(1).map(i.e)).then(function(){return i(t[0])}):Promise.reject(new Error("Cannot find module '"+e+"'."))}a.keys=function(){return Object.keys(n)},a.id="AMsx",e.exports=a},BKIj:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjk5NDQ1RTM2RTAwQjExRTlBOUI3QkIyNjhFNERGQUI4IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjk5NDQ1RTM3RTAwQjExRTlBOUI3QkIyNjhFNERGQUI4Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OTk0NDVFMzRFMDBCMTFFOUE5QjdCQjI2OEU0REZBQjgiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6OTk0NDVFMzVFMDBCMTFFOUE5QjdCQjI2OEU0REZBQjgiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz60gpEFAAAEFElEQVR42uybT0gUURzHfzO77rquurqaVmqpEZSJXjIIumQRSRIdooJOgVGHCOrSrUNEUEQWKFjYqS4VdYiMCDGoU10KMlMxazFdV2vLdd1/7s70+83O29Y02F0dZ3dnfvB1hxll5vN+733fe79xudbBN/BP1KHaUC2oGpQZMiuCqFHUC1Q3aiD+Ih93bEJ1oD6izqG2ZCAsyM+8VWYgli6UhV00xsH2oPZCdgUl9BRqs9xjQyzD7VkIGx/NqBusBbbJrZDtcZpYedmgDBoAJsY2At4P2on9BFyrIeBaXnZorYSJB42FDqwD68A6sA6czmFM5Y+OlFTBdmsxlBjVmcIjIsBgwAPPfzth0D+rHLCFN8C1DQ1Qbbaqnql1plzYXVgGXa4v0IPgigBfrKyLwX4NzsFIwKsKbL7BCDvzS6JboPJNMBL0wlCCmU4YeKulEOotNun4lWcKbjiHVc0wPc/lqnowcTwcKq6Aq/7BlTWtxrwobFgUoWNyRPUu/dnvgb6ZKenYnoSXJJzhHC7aNn4hAvOioBjI8dKN0ISGaOC4BefRp2A4MAt3XKMQku/vmg9In5wSphWRbvkXPqQA9PHSDXAMZ4D/RQ36B2Xz0vcBeesTTYKgBHB8SI0vrnx2yXUpqAc9cY/DbGQ+1sCH7BVgM+Rg9u1g5Y0wJ4STyuyygJWKgBDN1VuvG+7/cCy4RldOrKmWPMTIcSnfI61WWmzYeCPhRdf8QlgGFyVl1dJSTPBcxgOzh7EZFo+0AvkcjyOXh9S7dFqN4Vw+Wi3egauok2W1sa5NptVStDb6wDh+aRxnBXC/bwbW2nIlqIPF65f8HUfQJzl0VgB3TX2RsldptizZbX+Eg3Bv2rH620OlIojTUqdrZFV8Qi8AJBIVJgscxaUgW2enEk9/TUgbgbQGZiZJsGw5uJxGO/vtfXoDs7X0yxkXVJryMMOpz4uP3d8zp0vTNHLe8SGjxrBuWskElXzaympSNi2ygofuMXjtmU4/YG4J09pXVA6bcvOX9QCH7ZUpAwsiKFfxYCsf+smqHQ9+jkk3ZZWH5DMswrNfzpQbi5WaFAH2CRHp04q7FiqzuMMhGA/54eaketVL1ruS2UoknJp3XnesNS+s3wJFxhxVzWePrRx2FZRKx9TwK57hsZAP+jxT0IwLjTpLIXTXNMFoUL1CfBXO/ywe4dBSxKXbncPS6xaq+ptx3FIxXM2gbeL1iSFwyuVaRaalK+OfM3oe1t8P68A6sA6sA6c7cEhDvF4CHtUQsIOAX2gIuJeA7wK9uMv+IMZuAu5H3dYAMDH2M5em7/j0ZjFsn8wYm5bIqQ+gOiG5f5lI9xDkzLay2Sh+HqYTZ1ANqFuoIdR8BkLOoT7JDI0Q/fpOrELwR4ABAPe0KDi2Q0X0AAAAAElFTkSuQmCC"},"E+dT":function(e,t){},ImTJ:function(e,t){},IvQA:function(module,exports,__webpack_require__){ +/*! + * UEditor + * version: ueditor + * build: Wed Dec 26 2018 17:25:05 GMT+0800 (CST) + */ +let Bus=__webpack_require__("240R");!function(){UEDITOR_CONFIG=window.UEDITOR_CONFIG||{};var baidu=window.baidu||{};window.baidu=baidu,window.UE=baidu.editor=window.UE||{},UE.plugins={},UE.commands={},UE.instants={},UE.I18N={},UE._customizeUI={},UE.version="1.4.3";var dom=UE.dom={},browser=UE.browser=function(){var e=navigator.userAgent.toLowerCase(),t=window.opera,i={ie:/(msie\s|trident.*rv:)([\w.]+)/.test(e),opera:!!t&&t.version,webkit:e.indexOf(" applewebkit/")>-1,mac:e.indexOf("macintosh")>-1,quirks:"BackCompat"==document.compatMode};i.gecko="Gecko"==navigator.product&&!i.webkit&&!i.opera&&!i.ie;var n=0;if(i.ie){var a=e.match(/(?:msie\s([\w.]+))/),o=e.match(/(?:trident.*rv:([\w.]+))/);n=a&&o&&a[1]&&o[1]?Math.max(1*a[1],1*o[1]):a&&a[1]?1*a[1]:o&&o[1]?1*o[1]:0,i.ie11Compat=11==document.documentMode,i.ie9Compat=9==document.documentMode,i.ie8=!!document.documentMode,i.ie8Compat=8==document.documentMode,i.ie7Compat=7==n&&!document.documentMode||7==document.documentMode,i.ie6Compat=n<7||i.quirks,i.ie9above=n>8,i.ie9below=n<9,i.ie11above=n>10,i.ie11below=n<11}if(i.gecko){var r=e.match(/rv:([\d\.]+)/);r&&(n=1e4*(r=r[1].split("."))[0]+100*(r[1]||0)+1*(r[2]||0))}return/chrome\/(\d+\.\d)/i.test(e)&&(i.chrome=+RegExp.$1),/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(e)&&!/chrome/i.test(e)&&(i.safari=+(RegExp.$1||RegExp.$2)),i.opera&&(n=parseFloat(t.version())),i.webkit&&(n=parseFloat(e.match(/ applewebkit\/(\d+)/)[1])),i.version=n,i.isCompatible=!i.mobile&&(i.ie&&n>=6||i.gecko&&n>=10801||i.opera&&n>=9.5||i.air&&n>=1||i.webkit&&n>=522||!1),i}(),ie=browser.ie,webkit=browser.webkit,gecko=browser.gecko,opera=browser.opera,utils=UE.utils={each:function(e,t,i){if(null!=e)if(e.length===+e.length){for(var n=0,a=e.length;n=i&&e===t)return n=a,!1}),n},removeItem:function(e,t){for(var i=0,n=e.length;i'](?:(amp|lt|quot|gt|#39|nbsp|#\d+);)?/g,function(e,t){return t?e:{"<":"<","&":"&",'"':""",">":">","'":"'"}[e]}):""},unhtmlForUrl:function(e,t){return e?e.replace(t||/[<">']/g,function(e){return{"<":"<","&":"&",'"':""",">":">","'":"'"}[e]}):""},html:function(e){return e?e.replace(/&((g|l|quo)t|amp|#39|nbsp);/g,function(e){return{"<":"<","&":"&",""":'"',">":">","'":"'"," ":" "}[e]}):""},cssStyleToDomStyle:(test=document.createElement("div").style,cache={float:void 0!=test.cssFloat?"cssFloat":void 0!=test.styleFloat?"styleFloat":"float"},function(e){return cache[e]||(cache[e]=e.toLowerCase().replace(/-./g,function(e){return e.charAt(1).toUpperCase()}))}),loadFile:function(){var e=[];function t(t,i){try{for(var n,a=0;n=e[a++];)if(n.doc===t&&n.url==(i.src||i.href))return n}catch(e){return null}}return function(i,n,a){var o=t(i,n);if(o)o.ready?a&&a():o.funs.push(a);else if(e.push({doc:i,url:n.src||n.href,funs:[a]}),i.body){if(!n.id||!i.getElementById(n.id)){var r=i.createElement(n.tag);for(var s in delete n.tag,n)r.setAttribute(s,n[s]);r.onload=r.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if((o=t(i,n)).funs.length>0){o.ready=1;for(var e;e=o.funs.pop();)e()}r.onload=r.onreadystatechange=null}},r.onerror=function(){throw Error("The load "+(n.href||n.src)+" fails,check the url settings of file ueditor.config.js ")},i.getElementsByTagName("head")[0].appendChild(r)}}else{var l=[];for(var s in n)"tag"!=s&&l.push(s+'="'+n[s]+'"');i.write("<"+n.tag+" "+l.join(" ")+" >")}}}(),isEmptyObject:function(e){if(null==e)return!0;if(this.isArray(e)||this.isString(e))return 0===e.length;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},fixColor:function(e,t){if(/color/i.test(e)&&/rgba?/.test(t)){var i=t.split(",");if(i.length>3)return"";t="#";for(var n,a=0;n=i[a++];)t+=1==(n=parseInt(n.replace(/[^\d]/gi,""),10).toString(16)).length?"0"+n:n;t=t.toUpperCase()}return t},optCss:function(e){var t,i;function n(e,t){if(!e)return"";var i=e.top,n=e.bottom,a=e.left,o=e.right,r="";if(i&&a&&n&&o)r+=";"+t+":"+(i==n&&n==a&&a==o?i:i==n&&a==o?i+" "+a:a==o?i+" "+a+" "+n:i+" "+o+" "+n+" "+a)+";";else for(var s in e)r+=";"+t+"-"+s+":"+e[s]+";";return r}return e=e.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi,function(e,n,a,o){if(1==o.split(" ").length)switch(n){case"padding":return!t&&(t={}),t[a]=o,"";case"margin":return!i&&(i={}),i[a]=o,"";case"border":return"initial"==o?"":e}return e}),(e+=n(t,"padding")+n(i,"margin")).replace(/^[ \n\r\t;]*|[ \n\r\t]*$/,"").replace(/;([ \n\r\t]+)|\1;/g,";").replace(/(&((l|g)t|quot|#39))?;{2,}/g,function(e,t){return t?t+";;":";"})},clone:function(e,t){var i;for(var n in t=t||{},e)e.hasOwnProperty(n)&&("object"==typeof(i=e[n])?(t[n]=utils.isArray(i)?[]:{},utils.clone(e[n],t[n])):t[n]=i);return t},transUnitToPx:function(e){if(!/(pt|cm)/.test(e))return e;var t;switch(e.replace(/([\d.]+)(\w+)/,function(i,n,a){e=n,t=a}),t){case"cm":e=25*parseFloat(e);break;case"pt":e=Math.round(96*parseFloat(e)/72)}return e+(e?"px":"")},domReady:function(){var e=[];function t(t){t.isReady=!0;for(var i;i=e.pop();i());}return function(i,n){var a=(n=n||window).document;i&&e.push(i),"complete"===a.readyState?t(a):(a.isReady&&t(a),browser.ie&&11!=browser.version?(!function(){if(!a.isReady){try{a.documentElement.doScroll("left")}catch(e){return void setTimeout(arguments.callee,0)}t(a)}}(),n.attachEvent("onload",function(){t(a)})):(a.addEventListener("DOMContentLoaded",function(){a.removeEventListener("DOMContentLoaded",arguments.callee,!1),t(a)},!1),n.addEventListener("load",function(){t(a)},!1)))}}(),cssRule:browser.ie&&11!=browser.version?function(e,t,i){var n,a;return void 0===t||t&&t.nodeType&&9==t.nodeType?void 0!==(a=(n=(i=t&&t.nodeType&&9==t.nodeType?t:i||document).indexList||(i.indexList={}))[e])?i.styleSheets[a].cssText:void 0:(a=(n=(i=i||document).indexList||(i.indexList={}))[e],""===t?void 0!==a&&(i.styleSheets[a].cssText="",delete n[e],!0):(void 0!==a?sheetStyle=i.styleSheets[a]:(sheetStyle=i.createStyleSheet("",a=i.styleSheets.length),n[e]=a),void(sheetStyle.cssText=t)))}:function(e,t,i){var n;return void 0===t||t&&t.nodeType&&9==t.nodeType?(n=(i=t&&t.nodeType&&9==t.nodeType?t:i||document).getElementById(e))?n.innerHTML:void 0:(n=(i=i||document).getElementById(e),""===t?!!n&&(n.parentNode.removeChild(n),!0):void(n?n.innerHTML=t:((n=i.createElement("style")).id=e,n.innerHTML=t,i.getElementsByTagName("head")[0].appendChild(n))))},sort:function(e,t){t=t||function(e,t){return e.localeCompare(t)};for(var i=0,n=e.length;i0){var r=e[i];e[i]=e[a],e[a]=r}return e},serializeParam:function(e){var t=[];for(var i in e)if("method"!=i&&"timeout"!=i&&"async"!=i)if("function"!=(typeof e[i]).toLowerCase()&&"object"!=(typeof e[i]).toLowerCase())t.push(encodeURIComponent(i)+"="+encodeURIComponent(e[i]));else if(utils.isArray(e[i]))for(var n=0;n1||t!==e.parentNode){e.style.cssText=t.style.cssText+";"+e.style.cssText,t=t.parentNode;continue}t.style.cssText+=";"+e.style.cssText,"A"==t.tagName&&(t.style.textDecoration="underline")}if("A"!=t.tagName){t===e.parentNode&&domUtils.remove(e,!0);break}}t=t.parentNode}},mergeSibling:function(e,t,i){function n(e,t,i){var n;if((n=i[e])&&!domUtils.isBookmarkNode(n)&&1==n.nodeType&&domUtils.isSameElement(i,n)){for(;n.firstChild;)"firstChild"==t?i.insertBefore(n.lastChild,i.firstChild):i.appendChild(n.firstChild);domUtils.remove(n)}}!t&&n("previousSibling","firstChild",e),!i&&n("nextSibling","lastChild",e)},unSelectable:ie&&browser.ie9below||browser.opera?function(e){e.onselectstart=function(){return!1},e.onclick=e.onkeyup=e.onkeydown=function(){return!1},e.unselectable="on",e.setAttribute("unselectable","on");for(var t,i=0;t=e.all[i++];)switch(t.tagName.toLowerCase()){case"iframe":case"textarea":case"input":case"select":break;default:t.unselectable="on",e.setAttribute("unselectable","on")}}:function(e){e.style.MozUserSelect=e.style.webkitUserSelect=e.style.msUserSelect=e.style.KhtmlUserSelect="none"},removeAttributes:function(e,t){t=utils.isArray(t)?t:utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var i,n=0;i=t[n++];){switch(i=attrFix[i]||i){case"className":e[i]="";break;case"style":e.style.cssText="";var a=e.getAttributeNode("style");!browser.ie&&a&&e.removeAttributeNode(a)}e.removeAttribute(i)}},createElement:function(e,t,i){return domUtils.setAttributes(e.createElement(t),i)},setAttributes:function(e,t){for(var i in t)if(t.hasOwnProperty(i)){var n=t[i];switch(i){case"class":e.className=n;break;case"style":e.style.cssText=e.style.cssText+";"+n;break;case"innerHTML":e[i]=n;break;case"value":e.value=n;break;default:e.setAttribute(attrFix[i]||i,n)}}return e},getComputedStyle:function(e,t){if("width height top left".indexOf(t)>-1)return e["offset"+t.replace(/^\w/,function(e){return e.toUpperCase()})]+"px";if(3==e.nodeType&&(e=e.parentNode),browser.ie&&browser.version<9&&"font-size"==t&&!e.style.fontSize&&!dtd.$empty[e.tagName]&&!dtd.$nonChild[e.tagName]){var i=e.ownerDocument.createElement("span");i.style.cssText="padding:0;border:0;font-family:simsun;",i.innerHTML=".",e.appendChild(i);var n=i.offsetHeight;return e.removeChild(i),i=null,n+"px"}try{var a=domUtils.getStyle(e,t)||(window.getComputedStyle?domUtils.getWindow(e).getComputedStyle(e,"").getPropertyValue(t):(e.currentStyle||e.style)[utils.cssStyleToDomStyle(t)])}catch(e){return""}return utils.transUnitToPx(utils.fixColor(t,a))},removeClasses:function(e,t){t=utils.isArray(t)?t:utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var i,n=0,a=e.className;i=t[n++];)a=a.replace(new RegExp("\\b"+i+"\\b"),"");(a=utils.trim(a).replace(/[ ]{2,}/g," "))?e.className=a:domUtils.removeAttributes(e,["class"])},addClass:function(e,t){if(e){t=utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var i,n=0,a=e.className;i=t[n++];)new RegExp("\\b"+i+"\\b").test(a)||(a+=" "+i);e.className=utils.trim(a)}},hasClass:function(e,t){if(utils.isRegExp(t))return t.test(e.className);t=utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var i,n=0,a=e.className;i=t[n++];)if(!new RegExp("\\b"+i+"\\b","i").test(a))return!1;return n-1==t.length},preventDefault:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},removeStyle:function(e,t){browser.ie?("color"==t&&(t="(^|;)"+t),e.style.cssText=e.style.cssText.replace(new RegExp(t+"[^:]*:[^;]+;?","ig"),"")):e.style.removeProperty?e.style.removeProperty(t):e.style.removeAttribute(utils.cssStyleToDomStyle(t)),e.style.cssText||domUtils.removeAttributes(e,["style"])},getStyle:function(e,t){var i=e.style[utils.cssStyleToDomStyle(t)];return utils.fixColor(t,i)},setStyle:function(e,t,i){e.style[utils.cssStyleToDomStyle(t)]=i,utils.trim(e.style.cssText)||this.removeAttributes(e,"style")},setStyles:function(e,t){for(var i in t)t.hasOwnProperty(i)&&domUtils.setStyle(e,i,t[i])},removeDirtyAttr:function(e){for(var t,i=0,n=e.getElementsByTagName("*");t=n[i++];)t.removeAttribute("_moz_dirty");e.removeAttribute("_moz_dirty")},getChildCount:function(e,t){var i=0,n=e.firstChild;for(t=t||function(){return 1};n;)t(n)&&i++,n=n.nextSibling;return i},isEmptyNode:function(e){return!e.firstChild||0==domUtils.getChildCount(e,function(e){return!domUtils.isBr(e)&&!domUtils.isBookmarkNode(e)&&!domUtils.isWhitespace(e)})},clearSelectedArr:function(e){for(var t;t=e.pop();)domUtils.removeAttributes(t,["class"])},scrollToView:function(e,t,i){var n,a,o=(n=t.document,a="CSS1Compat"==n.compatMode,{width:(a?n.documentElement.clientWidth:n.body.clientWidth)||0,height:(a?n.documentElement.clientHeight:n.body.clientHeight)||0}).height,r=-1*o+i;r+=e.offsetHeight||0,r+=domUtils.getXY(e).y;var s=function(e){if("pageXOffset"in e)return{x:e.pageXOffset||0,y:e.pageYOffset||0};var t=e.document;return{x:t.documentElement.scrollLeft||t.body.scrollLeft||0,y:t.documentElement.scrollTop||t.body.scrollTop||0}}(t).y;(r>s||r0)return 0;for(var i in dtd.$isNotEmpty)if(e.getElementsByTagName(i).length)return 0;return 1}},setViewportOffset:function(e,t){var i=0|parseInt(e.style.left),n=0|parseInt(e.style.top),a=e.getBoundingClientRect(),o=t.left-a.left,r=t.top-a.top;o&&(e.style.left=i+o+"px"),r&&(e.style.top=n+r+"px")},fillNode:function(e,t){var i=browser.ie?e.createTextNode(domUtils.fillChar):e.createElement("br");t.innerHTML="",t.appendChild(i)},moveChild:function(e,t,i){for(;e.firstChild;)i&&t.firstChild?t.insertBefore(e.lastChild,t.firstChild):t.appendChild(e.firstChild)},hasNoAttributes:function(e){return browser.ie?/^<\w+\s*?>/.test(e.outerHTML):0==e.attributes.length},isCustomeNode:function(e){return 1==e.nodeType&&e.getAttribute("_ue_custom_node_")},isTagNode:function(e,t){return 1==e.nodeType&&new RegExp("\\b"+e.tagName+"\\b","i").test(t)},filterNodeList:function(e,t,i){var n=[];if(!utils.isFunction(t)){var a=t;t=function(e){return-1!=utils.indexOf(utils.isArray(a)?a:a.split(" "),e.tagName.toLowerCase())}}return utils.each(e,function(e){t(e)&&n.push(e)}),0==n.length?null:1!=n.length&&i?n:n[0]},isInNodeEndBoundary:function(e,t){var i=e.startContainer;if(3==i.nodeType&&e.startOffset!=i.nodeValue.length)return 0;if(1==i.nodeType&&e.startOffset!=i.childNodes.length)return 0;for(;i!==t;){if(i.nextSibling)return 0;i=i.parentNode}return 1},isBoundaryNode:function(e,t){for(;!domUtils.isBody(e);)if(e!==(e=e.parentNode)[t])return!1;return!0},fillHtml:browser.ie11below?" ":"
    "},fillCharReg=new RegExp(domUtils.fillChar,"g");!function(){var e,t=0,i=domUtils.fillChar;function n(e){return!e.collapsed&&1==e.startContainer.nodeType&&e.startContainer===e.endContainer&&e.endOffset-e.startOffset==1}function a(e,t,i,n){return 1==t.nodeType&&(dtd.$empty[t.tagName]||dtd.$nonChild[t.tagName])&&(i=domUtils.getNodeIndex(t)+(e?0:1),t=t.parentNode),e?(n.startContainer=t,n.startOffset=i,n.endContainer||n.collapse(!0)):(n.endContainer=t,n.endOffset=i,n.startContainer||n.collapse(!1)),function(e){e.collapsed=e.startContainer&&e.endContainer&&e.startContainer===e.endContainer&&e.startOffset==e.endOffset}(n),n}function o(e,t){var i,n,a=e.startContainer,o=e.endContainer,r=e.startOffset,s=e.endOffset,l=e.document,d=l.createDocumentFragment();if(1==a.nodeType&&(a=a.childNodes[r]||(i=a.appendChild(l.createTextNode("")))),1==o.nodeType&&(o=o.childNodes[s]||(n=o.appendChild(l.createTextNode("")))),a===o&&3==a.nodeType)return d.appendChild(l.createTextNode(a.substringData(r,s-r))),t&&(a.deleteData(r,s-r),e.collapse(!0)),d;for(var c,u,m=d,f=domUtils.findParents(a,!0),h=domUtils.findParents(o,!0),p=0;f[p]==h[p];)p++;for(var g,b=p;g=f[b];b++){for(c=g.nextSibling,g==a?i||(3==e.startContainer.nodeType?(m.appendChild(l.createTextNode(a.nodeValue.slice(r))),t&&a.deleteData(r,a.nodeValue.length-r)):m.appendChild(t?a:a.cloneNode(!0))):(u=g.cloneNode(!1),m.appendChild(u));c&&c!==o&&c!==h[b];)g=c.nextSibling,m.appendChild(t?c:c.cloneNode(!0)),c=g;m=u}m=d,f[p]||(m.appendChild(f[p-1].cloneNode(!1)),m=m.firstChild);var v;for(b=p;v=h[b];b++){if(c=v.previousSibling,v==o?n||3!=e.endContainer.nodeType||(m.appendChild(l.createTextNode(o.substringData(0,s))),t&&o.deleteData(0,s)):(u=v.cloneNode(!1),m.appendChild(u)),b!=p||!f[p])for(;c&&c!==a;)v=c.previousSibling,m.insertBefore(t?c:c.cloneNode(!0),m.firstChild),c=v;m=u}return t&&e.setStartBefore(h[p]?f[p]?h[p]:f[p-1]:h[p-1]).collapse(!0),i&&domUtils.remove(i),n&&domUtils.remove(n),d}var r=dom.Range=function(e){var t=this;t.startContainer=t.startOffset=t.endContainer=t.endOffset=null,t.document=e,t.collapsed=!0};function s(t,i){try{if(e&&domUtils.inDoc(e,t))if(e.nodeValue.replace(fillCharReg,"").length)e.nodeValue=e.nodeValue.replace(fillCharReg,"");else{var n=e.parentNode;for(domUtils.remove(e);n&&domUtils.isEmptyInlineElement(n)&&(browser.safari?!(domUtils.getPosition(n,i)&domUtils.POSITION_CONTAINS):!n.contains(i));)e=n.parentNode,domUtils.remove(n),n=e}}catch(e){}}function l(e,t){var i;for(e=e[t];e&&domUtils.isFillChar(e);)i=e[t],domUtils.remove(e),e=i}r.prototype={cloneContents:function(){return this.collapsed?null:o(this,0)},deleteContents:function(){var e;return this.collapsed||o(this,1),browser.webkit&&(3!=(e=this.startContainer).nodeType||e.nodeValue.length||(this.setStartBefore(e).collapse(!0),domUtils.remove(e))),this},extractContents:function(){return this.collapsed?null:o(this,2)},setStart:function(e,t){return a(!0,e,t,this)},setEnd:function(e,t){return a(!1,e,t,this)},setStartAfter:function(e){return this.setStart(e.parentNode,domUtils.getNodeIndex(e)+1)},setStartBefore:function(e){return this.setStart(e.parentNode,domUtils.getNodeIndex(e))},setEndAfter:function(e){return this.setEnd(e.parentNode,domUtils.getNodeIndex(e)+1)},setEndBefore:function(e){return this.setEnd(e.parentNode,domUtils.getNodeIndex(e))},setStartAtFirst:function(e){return this.setStart(e,0)},setStartAtLast:function(e){return this.setStart(e,3==e.nodeType?e.nodeValue.length:e.childNodes.length)},setEndAtFirst:function(e){return this.setEnd(e,0)},setEndAtLast:function(e){return this.setEnd(e,3==e.nodeType?e.nodeValue.length:e.childNodes.length)},selectNode:function(e){return this.setStartBefore(e).setEndAfter(e)},selectNodeContents:function(e){return this.setStart(e,0).setEndAtLast(e)},cloneRange:function(){var e=this;return new r(e.document).setStart(e.startContainer,e.startOffset).setEnd(e.endContainer,e.endOffset)},collapse:function(e){var t=this;return e?(t.endContainer=t.startContainer,t.endOffset=t.startOffset):(t.startContainer=t.endContainer,t.startOffset=t.endOffset),t.collapsed=!0,t},shrinkBoundary:function(e){var t,i=this,n=i.collapsed;function a(e){return 1==e.nodeType&&!domUtils.isBookmarkNode(e)&&!dtd.$empty[e.tagName]&&!dtd.$nonChild[e.tagName]}for(;1==i.startContainer.nodeType&&(t=i.startContainer.childNodes[i.startOffset])&&a(t);)i.setStart(t,0);if(n)return i.collapse(!0);if(!e)for(;1==i.endContainer.nodeType&&i.endOffset>0&&(t=i.endContainer.childNodes[i.endOffset-1])&&a(t);)i.setEnd(t,t.childNodes.length);return i},getCommonAncestor:function(e,t){var i=this.startContainer,a=this.endContainer;return i===a?e&&n(this)&&1==(i=i.childNodes[this.startOffset]).nodeType?i:t&&3==i.nodeType?i.parentNode:i:domUtils.getCommonAncestor(i,a)},trimBoundary:function(e){this.txtToElmBoundary();var t=this.startContainer,i=this.startOffset,n=this.collapsed,a=this.endContainer;if(3==t.nodeType){if(0==i)this.setStartBefore(t);else if(i>=t.nodeValue.length)this.setStartAfter(t);else{var o=domUtils.split(t,i);t===a?this.setEnd(o,this.endOffset-i):t.parentNode===a&&(this.endOffset+=1),this.setStartBefore(o)}if(n)return this.collapse(!0)}return e||(i=this.endOffset,3==(a=this.endContainer).nodeType&&(0==i?this.setEndBefore(a):(i=i.nodeValue.length&&e["set"+t.replace(/(\w)/,function(e){return e.toUpperCase()})+"After"](i):e["set"+t.replace(/(\w)/,function(e){return e.toUpperCase()})+"Before"](i))}return!e&&this.collapsed||(t(this,"start"),t(this,"end")),this},insertNode:function(e){var t=e,i=1;11==e.nodeType&&(t=e.firstChild,i=e.childNodes.length),this.trimBoundary(!0);var n=this.startContainer,a=this.startOffset,o=n.childNodes[a];return o?n.insertBefore(e,o):n.appendChild(e),t.parentNode===this.endContainer&&(this.endOffset=this.endOffset+i),this.setStartBefore(t)},setCursor:function(e,t){return this.collapse(!e).select(t)},createBookmark:function(e,i){var n,a=this.document.createElement("span");return a.style.cssText="display:none;line-height:0px;",a.appendChild(this.document.createTextNode("‍")),a.id="_baidu_bookmark_start_"+(i?"":t++),this.collapsed||((n=a.cloneNode(!0)).id="_baidu_bookmark_end_"+(i?"":t++)),this.insertNode(a),n&&this.collapse().insertNode(n).setEndBefore(n),this.setStartAfter(a),{start:e?a.id:a,end:n?e?n.id:n:null,id:e}},moveToBookmark:function(e){var t=e.id?this.document.getElementById(e.start):e.start,i=e.end&&e.id?this.document.getElementById(e.end):e.end;return this.setStartBefore(t),domUtils.remove(t),i?(this.setEndBefore(i),domUtils.remove(i)):this.collapse(!0),this},enlarge:function(e,t){var i,n,a=domUtils.isBody,o=this.document.createTextNode("");if(e){for(1==(n=this.startContainer).nodeType?n.childNodes[this.startOffset]?i=n=n.childNodes[this.startOffset]:(n.appendChild(o),i=n=o):i=n;;){if(domUtils.isBlockElm(n)){for(n=i;(i=n.previousSibling)&&!domUtils.isBlockElm(i);)n=i;this.setStartBefore(n);break}i=n,n=n.parentNode}for(1==(n=this.endContainer).nodeType?((i=n.childNodes[this.endOffset])?n.insertBefore(o,i):n.appendChild(o),i=n=o):i=n;;){if(domUtils.isBlockElm(n)){for(n=i;(i=n.nextSibling)&&!domUtils.isBlockElm(i);)n=i;this.setEndAfter(n);break}i=n,n=n.parentNode}o.parentNode===this.endContainer&&this.endOffset--,domUtils.remove(o)}if(!this.collapsed){for(;!(0!=this.startOffset||t&&t(this.startContainer)||a(this.startContainer));)this.setStartBefore(this.startContainer);for(;!(this.endOffset!=(1==this.endContainer.nodeType?this.endContainer.childNodes.length:this.endContainer.nodeValue.length)||t&&t(this.endContainer)||a(this.endContainer));)this.setEndAfter(this.endContainer)}return this},enlargeToBlockElm:function(e){for(;!domUtils.isBlockElm(this.startContainer);)this.setStartBefore(this.startContainer);if(!e)for(;!domUtils.isBlockElm(this.endContainer);)this.setEndAfter(this.endContainer);return this},adjustmentBoundary:function(){if(!this.collapsed){for(;!domUtils.isBody(this.startContainer)&&this.startOffset==this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length&&this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length;)this.setStartAfter(this.startContainer);for(;!domUtils.isBody(this.endContainer)&&!this.endOffset&&this.endContainer[3==this.endContainer.nodeType?"nodeValue":"childNodes"].length;)this.setEndBefore(this.endContainer)}return this},applyInlineStyle:function(e,t,i){if(this.collapsed)return this;this.trimBoundary().enlarge(!1,function(e){return 1==e.nodeType&&domUtils.isBlockElm(e)}).adjustmentBoundary();for(var n,a,o=this.createBookmark(),r=o.end,s=function(e){return 1==e.nodeType?"br"!=e.tagName.toLowerCase():!domUtils.isWhitespace(e)},l=domUtils.getNextDomNode(o.start,!1,s),d=this.cloneRange();l&&domUtils.getPosition(l,r)&domUtils.POSITION_PRECEDING;)if(3==l.nodeType||dtd[e][l.tagName]){for(d.setStartBefore(l),n=l;n&&(3==n.nodeType||dtd[e][n.tagName])&&n!==r;)a=n,n=domUtils.getNextDomNode(n,1==n.nodeType,null,function(t){return dtd[e][t.tagName]});var c,u,m=d.setEndAfter(a).extractContents();if(i&&i.length>0){var f,h;h=f=i[0].cloneNode(!1);for(var p,g=1;p=i[g++];)f.appendChild(p.cloneNode(!1)),f=f.firstChild;c=f}else c=d.document.createElement(e);if(t&&domUtils.setAttributes(c,t),c.appendChild(m),d.insertNode(i?h:c),"span"==e&&t.style&&/text\-decoration/.test(t.style)&&(u=domUtils.findParentByTagName(c,"a",!0))?(domUtils.setAttributes(u,t),domUtils.remove(c,!0),c=u):(domUtils.mergeSibling(c),domUtils.clearEmptySibling(c)),domUtils.mergeChild(c,t),l=domUtils.getNextDomNode(c,!1,s),domUtils.mergeToParent(c),n===r)break}else l=domUtils.getNextDomNode(l,!0,s);return this.moveToBookmark(o)},removeInlineStyle:function(e){if(this.collapsed)return this;e=utils.isArray(e)?e:[e],this.shrinkBoundary().adjustmentBoundary();for(var t=this.startContainer,i=this.endContainer;;){if(1==t.nodeType){if(utils.indexOf(e,t.tagName.toLowerCase())>-1)break;if("body"==t.tagName.toLowerCase()){t=null;break}}t=t.parentNode}for(;;){if(1==i.nodeType){if(utils.indexOf(e,i.tagName.toLowerCase())>-1)break;if("body"==i.tagName.toLowerCase()){i=null;break}}i=i.parentNode}var n,a,o=this.createBookmark();t&&(n=(a=this.cloneRange().setEndBefore(o.start).setStartBefore(t)).extractContents(),a.insertNode(n),domUtils.clearEmptySibling(t,!0),t.parentNode.insertBefore(o.start,t)),i&&(n=(a=this.cloneRange().setStartAfter(o.end).setEndAfter(i)).extractContents(),a.insertNode(n),domUtils.clearEmptySibling(i,!1,!0),i.parentNode.insertBefore(o.end,i.nextSibling));for(var r,s=domUtils.getNextDomNode(o.start,!1,function(e){return 1==e.nodeType});s&&s!==o.end;)r=domUtils.getNextDomNode(s,!0,function(e){return 1==e.nodeType}),utils.indexOf(e,s.tagName.toLowerCase())>-1&&domUtils.remove(s,!0),s=r;return this.moveToBookmark(o)},getClosedNode:function(){var e;if(!this.collapsed){var t=this.cloneRange().adjustmentBoundary().shrinkBoundary();if(n(t)){var i=t.startContainer.childNodes[t.startOffset];i&&1==i.nodeType&&(dtd.$empty[i.tagName]||dtd.$nonChild[i.tagName])&&(e=i)}}return e},select:browser.ie?function(t,n){var a;this.collapsed||this.shrinkBoundary();var o=this.getClosedNode();if(o&&!n){try{(a=this.document.body.createControlRange()).addElement(o),a.select()}catch(e){}return this}var r,d=this.createBookmark(),c=d.start;if((a=this.document.body.createTextRange()).moveToElementText(c),a.moveStart("character",1),this.collapsed){if(!t&&3!=this.startContainer.nodeType){var u=this.document.createTextNode(i),m=this.document.createElement("span");m.appendChild(this.document.createTextNode(i)),c.parentNode.insertBefore(m,c),c.parentNode.insertBefore(u,c),s(this.document,u),e=u,l(m,"previousSibling"),l(c,"nextSibling"),a.moveStart("character",-1),a.collapse(!0)}}else{var f=this.document.body.createTextRange();r=d.end,f.moveToElementText(r),a.setEndPoint("EndToEnd",f)}this.moveToBookmark(d),m&&domUtils.remove(m);try{a.select()}catch(e){}return this}:function(t){var n,a=domUtils.getWindow(this.document),o=a.getSelection();if(browser.gecko?this.document.body.focus():a.focus(),o){if(o.removeAllRanges(),this.collapsed&&!t){var r=this.startContainer,d=r;1==r.nodeType&&(d=r.childNodes[this.startOffset]),3==r.nodeType&&this.startOffset||(d?d.previousSibling&&3==d.previousSibling.nodeType:r.lastChild&&3==r.lastChild.nodeType)||(n=this.document.createTextNode(i),this.insertNode(n),s(this.document,n),l(n,"previousSibling"),l(n,"nextSibling"),e=n,this.setStart(n,browser.webkit?1:0).collapse(!0))}var c=this.document.createRange();if(this.collapsed&&browser.opera&&1==this.startContainer.nodeType)if(d=this.startContainer.childNodes[this.startOffset]){for(;d&&domUtils.isBlockElm(d)&&1==d.nodeType&&d.childNodes[0];)d=d.childNodes[0];d&&this.setStartBefore(d).collapse(!0)}else(d=this.startContainer.lastChild)&&domUtils.isBr(d)&&this.setStartBefore(d).collapse(!0);!function(e){function t(t,i,n){3==t.nodeType&&t.nodeValue.length0)d=c-1;else{if(!(u<0))return{container:n,offset:i(a)};l=c+1}}if(-1==c){if(s.moveToElementText(n),s.setEndPoint("StartToStart",e),o=s.text.replace(/(\r\n|\r)/g,"\n").length,r=n.childNodes,!o)return{container:a=r[r.length-1],offset:a.nodeValue.length};for(var m=r.length;o>0;)o-=r[--m].nodeValue.length;return{container:r[m],offset:-o}}if(s.collapse(u>0),s.setEndPoint(u>0?"StartToStart":"EndToStart",e),!(o=s.text.replace(/(\r\n|\r)/g,"\n").length))return dtd.$empty[a.tagName]||dtd.$nonChild[a.tagName]?{container:n,offset:i(a)+(u>0?0:1)}:{container:a,offset:u>0?0:a.childNodes.length};for(;o>0;)try{var f=a;o-=(a=a[u>0?"previousSibling":"nextSibling"]).nodeValue.length}catch(e){return{container:n,offset:i(f)}}return{container:a,offset:u>0?-o:a.nodeValue.length+o}}function t(e){var t;try{t=e.getNative().createRange()}catch(e){return null}var i=t.item?t.item(0):t.parentElement();return(i.ownerDocument||i)===e.document?t:null}(dom.Selection=function(e){var i,n=this;n.document=e,browser.ie9below&&(i=domUtils.getWindow(e).frameElement,domUtils.on(i,"beforedeactivate",function(){n._bakIERange=n.getIERange()}),domUtils.on(i,"activate",function(){try{!t(n)&&n._bakIERange&&n._bakIERange.select()}catch(e){}n._bakIERange=null})),i=e=null}).prototype={rangeInBody:function(e,t){var i=browser.ie9below||t?e.item?e.item():e.parentElement():e.startContainer;return i===this.document.body||domUtils.inDoc(i,this.document)},getNative:function(){var e=this.document;try{return e?browser.ie9below?e.selection:domUtils.getWindow(e).getSelection():null}catch(e){return null}},getIERange:function(){var e=t(this);return!e&&this._bakIERange?this._bakIERange:e},cache:function(){this.clear(),this._cachedRange=this.getRange(),this._cachedStartElement=this.getStart(),this._cachedStartElementPath=this.getStartElementPath()},getStartElementPath:function(){if(this._cachedStartElementPath)return this._cachedStartElementPath;var e=this.getStart();return e?domUtils.findParents(e,!0,null,!0):[]},clear:function(){this._cachedStartElementPath=this._cachedRange=this._cachedStartElement=null},isFocus:function(){try{if(browser.ie9below){var e=t(this);return!(!e||!this.rangeInBody(e))}return!!this.getNative().rangeCount}catch(e){return!1}},getRange:function(){var t=this;function i(e){for(var i=t.document.body.firstChild,n=e.collapsed;i&&i.firstChild;)e.setStart(i,0),i=i.firstChild;e.startContainer||e.setStart(t.document.body,0),n&&e.collapse(!0)}if(null!=t._cachedRange)return this._cachedRange;var n=new baidu.editor.dom.Range(t.document);if(browser.ie9below){var a=t.getIERange();if(a)try{!function(t,i){if(t.item)i.selectNode(t.item(0));else{var n=e(t,!0);i.setStart(n.container,n.offset),0!=t.compareEndPoints("StartToEnd",t)&&(n=e(t,!1),i.setEnd(n.container,n.offset))}}(a,n)}catch(e){i(n)}else i(n)}else{var o=t.getNative();if(o&&o.rangeCount){var r=o.getRangeAt(0),s=o.getRangeAt(o.rangeCount-1);n.setStart(r.startContainer,r.startOffset).setEnd(s.endContainer,s.endOffset),n.collapsed&&domUtils.isBody(n.startContainer)&&!n.startOffset&&i(n)}else{if(this._bakRange&&domUtils.inDoc(this._bakRange.startContainer,this.document))return this._bakRange;i(n)}}return this._bakRange=n},getStart:function(){if(this._cachedStartElement)return this._cachedStartElement;var e,t,i,n,a=browser.ie9below?this.getIERange():this.getRange();if(browser.ie9below){if(!a)return this.document.body.firstChild;if(a.item)return a.item(0);for((e=a.duplicate()).text.length>0&&e.moveStart("character",1),e.collapse(1),t=e.parentElement(),n=i=a.parentElement();i=i.parentNode;)if(i==t){t=n;break}}else if(a.shrinkBoundary(),1==(t=a.startContainer).nodeType&&t.hasChildNodes()&&(t=t.childNodes[Math.min(t.childNodes.length-1,a.startOffset)]),3==t.nodeType)return t.parentNode;return t},getText:function(){var e,t;return this.isFocus()&&(e=this.getNative())?(t=browser.ie9below?e.createRange():e.getRangeAt(0),browser.ie9below?t.text:t.toString()):""},clearRange:function(){this.getNative()[browser.ie9below?"empty":"removeAllRanges"]()}}}(),function(){var e,t=0;function i(e,t){var i;if(t.textarea)if(utils.isString(t.textarea)){for(var n,a=0,o=domUtils.getElementsByTagName(e,"textarea");n=o[a++];)if(n.id=="ueditor_textarea_"+t.options.textarea){i=n;break}}else i=t.textarea;i||(e.appendChild(i=domUtils.createElement(document,"textarea",{name:t.options.textarea,id:"ueditor_textarea_"+t.options.textarea,style:"display:none"})),t.textarea=i),!i.getAttribute("name")&&i.setAttribute("name",t.options.textarea),i.value=t.hasContents()?t.options.allHtmlEnabled?t.getAllHtml():t.getContent(null,null,!0):""}function n(e){e.langIsReady=!0,e.fireEvent("langReady")}var a=UE.Editor=function(e){var i=this;i.uid=t++,EventBase.call(i),i.commands={},i.options=utils.extend(utils.clone(e||{}),UEDITOR_CONFIG,!0),i.shortcutkeys={},i.inputRules=[],i.outputRules=[],i.setOpt(a.defaultOptions(i)),utils.isEmptyObject(UE.I18N)?utils.loadFile(document,{src:i.options.langPath+i.options.lang+"/"+i.options.lang+".js",tag:"script",type:"text/javascript",defer:"defer"},function(){UE.plugin.load(i),n(i)}):(i.options.lang=function(e){for(var t in e)return t}(UE.I18N),UE.plugin.load(i),n(i)),UE.instants["ueditorInstant"+i.uid]=i};a.prototype={registerCommand:function(e,t){this.commands[e]=t},ready:function(e){e&&(this.isReady?e.apply(this):this.addListener("ready",e))},setOpt:function(e,t){var i={};utils.isString(e)?i[e]=t:i=e,utils.extend(this.options,i,!0)},getOpt:function(e){return this.options[e]},destroy:function(){var e=this;e.fireEvent("destroy");var t=e.container.parentNode,i=e.textarea;i?i.style.display="":(i=document.createElement("textarea"),t.parentNode.insertBefore(i,t)),i.style.width=e.iframe.offsetWidth+"px",i.style.height=e.iframe.offsetHeight+"px",i.value=e.getContent(),i.id=e.key,t.innerHTML="",domUtils.remove(t);var n=e.key;for(var a in e)e.hasOwnProperty(a)&&delete this[a];UE.delEditor(n)},render:function(e){var t=this.options,i=function(t){return parseInt(domUtils.getComputedStyle(e,t))};if(utils.isString(e)&&(e=document.getElementById(e)),e){t.initialFrameWidth?t.minFrameWidth=t.initialFrameWidth:t.minFrameWidth=t.initialFrameWidth=e.offsetWidth,t.initialFrameHeight?t.minFrameHeight=t.initialFrameHeight:t.initialFrameHeight=t.minFrameHeight=e.offsetHeight,e.style.width=/%$/.test(t.initialFrameWidth)?"100%":t.initialFrameWidth-i("padding-left")-i("padding-right")+"px",e.style.height=/%$/.test(t.initialFrameHeight)?"100%":t.initialFrameHeight-i("padding-top")-i("padding-bottom")+"px",e.style.zIndex=t.zIndex;var n=(ie&&browser.version<9?"":"")+""+(t.iframeCssUrl?"":"")+(t.initialStyle?"":"")+"